@openway/ui 1.0.1 → 1.0.3
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/LICENSE +21 -21
- package/dist/chunk-XM7AABEU.js +3 -0
- package/dist/chunk-XM7AABEU.js.map +1 -0
- package/dist/index.cjs +5 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +160 -348
- package/dist/index.d.ts +160 -348
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/query.cjs +1 -1
- package/dist/query.cjs.map +1 -1
- package/dist/query.d.cts +133 -3
- package/dist/query.d.ts +133 -3
- package/dist/query.js +1 -1
- package/dist/query.js.map +1 -1
- package/dist/styles.css +424 -0
- package/dist/{useInfiniteScroll-DAlgjUN4.d.cts → useInfiniteScroll-C5t7bvLu.d.cts} +313 -10
- package/dist/{useInfiniteScroll-DAlgjUN4.d.ts → useInfiniteScroll-C5t7bvLu.d.ts} +313 -10
- package/docs/AGENTS.md +0 -2
- package/docs/README.md +0 -1
- package/docs/components/carousel.md +5 -5
- package/docs/components/input.md +0 -6
- package/docs/components/select.md +2 -2
- package/docs/components/slider.md +2 -2
- package/docs/components/table.md +114 -1
- package/docs/hooks/useInfiniteScroll.md +1 -1
- package/docs/hooks/useMutationApp.md +242 -0
- package/docs/hooks/useTableQuery.md +5 -0
- package/package.json +3 -2
- package/dist/chunk-CJQNI3QX.js +0 -3
- package/dist/chunk-CJQNI3QX.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var Sp=Object.create;var Xs=Object.defineProperty;var Tp=Object.getOwnPropertyDescriptor;var Rp=Object.getOwnPropertyNames;var Dp=Object.getPrototypeOf,Np=Object.prototype.hasOwnProperty;var Pp=(e,t)=>{for(var r in t)Xs(e,r,{get:t[r],enumerable:!0})},Td=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Rp(t))!Np.call(e,o)&&o!==r&&Xs(e,o,{get:()=>t[o],enumerable:!(n=Tp(t,o))||n.enumerable});return e};var Hn=(e,t,r)=>(r=e!=null?Sp(Dp(e)):{},Td(t||!e||!e.__esModule?Xs(r,"default",{value:e,enumerable:!0}):r,e)),zp=e=>Td(Xs({},"__esModule",{value:!0}),e);var pg={};Pp(pg,{AUDIO_EXTENSIONS:()=>Fs,Alert:()=>oi,AlertCircleIcon:()=>qo,AlertTriangleIcon:()=>Xo,ArrowDownIcon:()=>ls,ArrowUpDownIcon:()=>os,ArrowUpIcon:()=>as,AvatarIcon:()=>rs,Badge:()=>ir,Button:()=>xr,Calendar:()=>on,CalendarHeader:()=>fa,CalendarIcon:()=>eu,Carousel:()=>bu,CarouselContent:()=>xu,CarouselNext:()=>wu,CarouselPagination:()=>Cu,CarouselPrevious:()=>yu,CarouselSlide:()=>vu,CheckCircleIcon:()=>_o,CheckIcon:()=>Gn,Checkbox:()=>Jr,CheckboxGroup:()=>bo,ChevronDownIcon:()=>yt,ChevronLeftIcon:()=>Sr,ChevronRightIcon:()=>Tr,ClockIcon:()=>tu,CloseIcon:()=>Ve,Collapse:()=>Nl,CollapseContent:()=>ta,CollapseHeader:()=>ea,CollapsePanel:()=>Il,Collapsible:()=>Fl,Confirm:()=>Rc,ConfirmBody:()=>Pc,ConfirmClose:()=>Fc,ConfirmContainer:()=>Dc,ConfirmFooter:()=>Ic,ConfirmHeader:()=>Nc,CropIcon:()=>ts,DEFAULT_PAGE_SIZE:()=>Os,DEFAULT_PAGE_SIZE_OPTIONS:()=>As,DEFAULT_TOAST_DURATION:()=>en,DOCUMENT_EXTENSIONS:()=>Es,DataTable:()=>kd,DatePicker:()=>To,DateRangeCalendar:()=>hi,DateRangeDayGrid:()=>gi,DateRangeHeader:()=>ba,DateRangeMonthGrid:()=>mi,DateRangePicker:()=>No,DateRangeYearGrid:()=>bi,DateTimePicker:()=>cc,DateTimeRangePicker:()=>uc,DayGrid:()=>pa,DoubleChevronLeftIcon:()=>Un,DoubleChevronRightIcon:()=>Yn,DownloadIcon:()=>Qr,Dropdown:()=>Ol,DropdownGroup:()=>Mu,DropdownHeader:()=>zu,DropdownItem:()=>Nu,DropdownMenu:()=>jl,DropdownSeparator:()=>Iu,DropdownTrigger:()=>Ru,Empty:()=>Mo,EmptyDefaultIcon:()=>bl,EmptyErrorIcon:()=>xl,EmptyFolderIcon:()=>vl,EmptyIllustration:()=>yi,EmptySearchIcon:()=>hl,EmptySimpleIcon:()=>yl,EyeIcon:()=>Vn,FileContainer:()=>Kr,FileIcon:()=>Ni,FilePreview:()=>Pn,FlipHorizontalIcon:()=>ti,IMAGE_EXTENSIONS:()=>zs,IconButton:()=>qr,ImageIcon:()=>Qa,ImagePreview:()=>Na,ImagePreviewToolbar:()=>Da,InfoCircleIcon:()=>Dr,Input:()=>Yt,LoadingImage:()=>In,MinusIcon:()=>ja,Modal:()=>$o,ModalBody:()=>Vo,ModalClose:()=>Lc,ModalContainer:()=>Lo,ModalFooter:()=>Ec,ModalHeader:()=>Ho,MonthGrid:()=>ga,MultiInput:()=>al,MultiSelect:()=>sd,MultiSelectTrigger:()=>Ps,NumberInput:()=>fo,OtpInput:()=>il,PDF_EXTENSIONS:()=>Is,PasswordInput:()=>ol,PlusIcon:()=>Zr,Popover:()=>ia,PopoverBody:()=>Ou,PopoverClose:()=>Uu,PopoverContent:()=>Bu,PopoverFooter:()=>Gu,PopoverHeader:()=>Vu,PopoverTrigger:()=>hs,Radio:()=>Ai,RadioDotIcon:()=>Ya,RadioGroup:()=>gl,ResetIcon:()=>cr,RotateCcwIcon:()=>ei,RotateCwIcon:()=>Kn,SearchIcon:()=>mo,Select:()=>ad,SelectComponent:()=>Sa,SelectMenu:()=>Ci,SelectMenuFilter:()=>Ts,SelectOption:()=>ks,SelectTrigger:()=>wi,SingleSelectTrigger:()=>wi,Skeleton:()=>Oo,Slider:()=>Ji,SliderMarks:()=>ds,SliderStepDots:()=>fs,SliderThumb:()=>Xi,SlidersHorizontalIcon:()=>cs,Spinner:()=>De,Tab:()=>yo,TabList:()=>vo,TabPanel:()=>Bl,TabPanels:()=>Ll,Table:()=>Gs,TableBody:()=>Us,TableCaption:()=>hd,TableCell:()=>zi,TableColumnHeader:()=>Ii,TableFooter:()=>bd,TableHead:()=>lo,TableHeader:()=>js,TablePagination:()=>Ys,TableRow:()=>Uo,TableToolbar:()=>Ws,Tabs:()=>xo,TextArea:()=>sl,TimeColumn:()=>ro,TimePicker:()=>sc,TimeRangePicker:()=>lc,TimeView:()=>Pr,Toaster:()=>wl,Toggle:()=>ml,Tooltip:()=>_i,TrashIcon:()=>Br,UploadAvatar:()=>kc,UploadAvatarCropContent:()=>Cc,UploadAvatarCropModal:()=>Vs,UploadFile:()=>Sc,UploadFileDropzone:()=>Di,UploadFileItemRow:()=>Ia,UploadFileList:()=>Ma,UploadIcon:()=>Zt,UploadImage:()=>wc,UploadImageDropzone:()=>za,UploadImageList:()=>Go,VIDEO_EXTENSIONS:()=>Ms,YearGrid:()=>ma,ZoomInIcon:()=>Jo,ZoomOutIcon:()=>Qo,checkIsDisabled:()=>Io,clamp:()=>Sl,combineDateTime:()=>zr,createDateWithTime:()=>zo,createTableColumnHelper:()=>Cd,defaultTableFeatures:()=>Ac,downloadFile:()=>dn,formatBytes:()=>un,formatDate:()=>dr,formatDateTime:()=>gr,formatNumberString:()=>An,formatTime:()=>Qt,fuzzyFilter:()=>Ks,generateCalendarGrid:()=>vs,generateRangeCalendarGrid:()=>ha,getDefaultDateTimeFormat:()=>no,getDefaultFormat:()=>to,getFileCategory:()=>$s,getFileExtension:()=>Ra,getFileName:()=>Tt,getFileType:()=>Si,getISOWeekNumber:()=>da,getPercentage:()=>qi,getSafeConfig:()=>C,isDateAfter:()=>ua,isDateBefore:()=>ca,isSameDay:()=>eo,isSameMonth:()=>xs,isSameTime:()=>Xu,isTimeAfter:()=>Zu,isTimeBefore:()=>qu,isTimeInRange:()=>Qu,isValidOtpChar:()=>Va,normalizePreviewFile:()=>Nn,padZero:()=>Ur,parseDate:()=>_l,parseDateTime:()=>xa,parseNumber:()=>On,parseRawNumberString:()=>Yc,parseTimeToDate:()=>pr,rankAndFilterItems:()=>co,resolveLocale:()=>Dt,sanitizeOtpString:()=>Aa,splitTagsFromText:()=>Oa,toDate:()=>jt,toDateTime:()=>Ir,toTimeObject:()=>_u,toast:()=>ou,useAnimatedError:()=>rl,useCarousel:()=>ps,useCarouselContext:()=>Ar,useCollapseContext:()=>qn,useCollapsePanelContext:()=>li,useConfirmContext:()=>Er,useDataTable:()=>_s,useDebounce:()=>Df,useDebouncedCallback:()=>go,useDropdownContext:()=>tn,useFileContext:()=>Bs,useFloatingTransition:()=>rt,useInfiniteScroll:()=>Nf,useModalContext:()=>Fr,usePopoverContext:()=>Jt,useTableStyles:()=>Pi,useTabsContext:()=>Jn});module.exports=zp(pg);var qs={xs:{button:"h-6 px-2.5 text-[11px] gap-1",iconOnly:"size-6 p-0",icon:"size-3"},sm:{button:"h-8 px-3 text-xs gap-1.5",iconOnly:"size-8 p-0",icon:"size-3.5"},md:{button:"h-10 px-4 text-sm gap-2",iconOnly:"size-10 p-0",icon:"size-4"},lg:{button:"h-12 px-5 text-base gap-2.5",iconOnly:"size-12 p-0",icon:"size-5"},xl:{button:"h-14 px-6 text-lg gap-3",iconOnly:"size-14 p-0",icon:"size-6"}},Zs={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Js={filled:{primary:"bg-primary-500 text-neutral-white border-transparent hover:bg-primary-600 active:bg-primary-700 focus-visible:ring-primary-700",secondary:"bg-secondary-500 text-neutral-white border-transparent hover:bg-secondary-600 active:bg-secondary-700 focus-visible:ring-secondary-700",neutral:"bg-neutral-800 text-neutral-white border-transparent hover:bg-neutral-900 active:bg-neutral-950 focus-visible:ring-neutral-700",error:"bg-error-500 text-neutral-white border-transparent hover:bg-error-600 active:bg-error-700 focus-visible:ring-error-700",success:"bg-success-500 text-neutral-white border-transparent hover:bg-success-600 active:bg-success-700 focus-visible:ring-success-700",warning:"bg-warning-500 text-neutral-white border-transparent hover:bg-warning-600 active:bg-warning-700 focus-visible:ring-warning-700",info:"bg-info-500 text-neutral-white border-transparent hover:bg-info-600 active:bg-info-700 focus-visible:ring-info-700"},soft:{primary:"bg-primary-100 text-primary-800 border-primary-200 hover:bg-primary-200 hover:text-primary-900 active:bg-primary-300 focus-visible:ring-primary-700",secondary:"bg-secondary-100 text-secondary-800 border-secondary-200 hover:bg-secondary-200 hover:text-secondary-900 active:bg-secondary-300 focus-visible:ring-secondary-700",neutral:"bg-neutral-100 text-neutral-800 border-neutral-200 hover:bg-neutral-200 hover:text-neutral-900 active:bg-neutral-300 focus-visible:ring-neutral-700",error:"bg-error-100 text-error-800 border-error-200 hover:bg-error-200 hover:text-error-900 active:bg-error-300 focus-visible:ring-error-700",success:"bg-success-100 text-success-800 border-success-200 hover:bg-success-200 hover:text-success-900 active:bg-success-300 focus-visible:ring-success-700",warning:"bg-warning-100 text-warning-800 border-warning-200 hover:bg-warning-200 hover:text-warning-900 active:bg-warning-300 focus-visible:ring-warning-700",info:"bg-info-100 text-info-800 border-info-200 hover:bg-info-200 hover:text-info-900 active:bg-info-300 focus-visible:ring-info-700"},ghost:{primary:"bg-transparent text-primary-700 border-transparent hover:bg-primary-100 hover:text-primary-900 active:bg-primary-200 focus-visible:ring-primary-700",secondary:"bg-transparent text-secondary-700 border-transparent hover:bg-secondary-100 hover:text-secondary-900 active:bg-secondary-200 focus-visible:ring-secondary-700",neutral:"bg-transparent text-neutral-700 border-transparent hover:bg-neutral-100 hover:text-neutral-900 active:bg-neutral-200 focus-visible:ring-neutral-700",error:"bg-transparent text-error-700 border-transparent hover:bg-error-100 hover:text-error-900 active:bg-error-200 focus-visible:ring-error-700",success:"bg-transparent text-success-700 border-transparent hover:bg-success-100 hover:text-success-900 active:bg-success-200 focus-visible:ring-success-700",warning:"bg-transparent text-warning-700 border-transparent hover:bg-warning-100 hover:text-warning-900 active:bg-warning-200 focus-visible:ring-warning-700",info:"bg-transparent text-info-700 border-transparent hover:bg-info-100 hover:text-info-900 active:bg-info-200 focus-visible:ring-info-700"},text:{primary:"bg-transparent text-primary-500 border-transparent px-1 hover:text-primary-600 active:text-primary-700 focus-visible:ring-primary-700",secondary:"bg-transparent text-secondary-500 border-transparent px-1 hover:text-secondary-600 active:text-secondary-700 focus-visible:ring-secondary-700",neutral:"bg-transparent text-neutral-700 border-transparent px-1 hover:text-neutral-800 active:text-neutral-900 focus-visible:ring-neutral-700",error:"bg-transparent text-error-500 border-transparent px-1 hover:text-error-600 active:text-error-700 focus-visible:ring-error-700",success:"bg-transparent text-success-500 border-transparent px-1 hover:text-success-600 active:text-success-700 focus-visible:ring-success-700",warning:"bg-transparent text-warning-500 border-transparent px-1 hover:text-warning-600 active:text-warning-700 focus-visible:ring-warning-700",info:"bg-transparent text-info-500 border-transparent px-1 hover:text-info-600 active:text-info-700 focus-visible:ring-info-700"},outline:{primary:"bg-transparent text-primary-700 border-2 border-primary-400 hover:bg-primary-50 hover:border-primary-500 hover:text-primary-900 active:bg-primary-100 focus-visible:ring-primary-700",secondary:"bg-transparent text-secondary-700 border-2 border-secondary-400 hover:bg-secondary-50 hover:border-secondary-500 hover:text-secondary-900 active:bg-secondary-100 focus-visible:ring-secondary-700",neutral:"bg-transparent text-neutral-700 border-2 border-neutral-300 hover:bg-neutral-50 hover:border-neutral-400 hover:text-neutral-900 active:bg-neutral-100 focus-visible:ring-neutral-700",error:"bg-transparent text-error-700 border-2 border-error-400 hover:bg-error-50 hover:border-error-500 hover:text-error-900 active:bg-error-100 focus-visible:ring-error-700",success:"bg-transparent text-success-700 border-2 border-success-400 hover:bg-success-50 hover:border-success-500 hover:text-success-900 active:bg-success-100 focus-visible:ring-success-700",warning:"bg-transparent text-warning-700 border-2 border-warning-400 hover:bg-warning-50 hover:border-warning-500 hover:text-warning-900 active:bg-warning-100 focus-visible:ring-warning-700",info:"bg-transparent text-info-700 border-2 border-info-400 hover:bg-info-50 hover:border-info-500 hover:text-info-900 active:bg-info-100 focus-visible:ring-info-700"}};var Qs=require("@tanstack/match-sorter-utils");function C(e,t,r){return e!=null&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:t[r]}function co(e,t,r){let n=t.trim();if(!n||!e.length)return e;let o=r?Array.isArray(r)?r:[r]:[],i=[];if(o.length>0)for(let s of o)typeof s=="function"?i.push(l=>{let f=s(l);return f!=null?String(f):""}):i.push(l=>{let f=l,c=f[s];if(c!=null)return String(c);if(f.data&&typeof f.data=="object"){let w=f.data[s];if(w!=null)return String(w)}return""});else i.push(s=>{if(s&&typeof s=="object"){let l=s;return l.label!=null?String(l.label):l.value!=null?String(l.value):""}return s!=null?String(s):""});let a=[];for(let s of e){let l=(0,Qs.rankItem)(s,n,{accessors:i});l.passed&&a.push({item:s,info:l})}return a.sort((s,l)=>(0,Qs.compareItems)(s.info,l.info)),a.map(s=>s.item)}var Ba=require("react/jsx-runtime");function De({width:e=16,height:t=16,className:r="",...n}){return(0,Ba.jsxs)("svg",{width:e,height:t,className:`animate-[spin_1s_steps(8)_infinite] ${r}`,viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:[(0,Ba.jsx)("path",{d:"M0 0h25v24H0z",fill:"none"}),(0,Ba.jsx)("path",{fill:"currentColor",d:"M4.818 6.664h-.001a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.277.541h-.029zm-2.97 7.182h-.001a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.278.541h-.031h.002zM12 3.692a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.277.541zM4.818 21.029h-.001a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.276.541h-.031zM19.182 7.125a2.308 2.308 0 1 1 0-4.615a2.308 2.308 0 0 1 0 4.615M12 24a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.277.541zm10.154-9.231h-.048c-.75 0-1.428-.309-1.913-.807l-.001-.001c-.499-.503-.808-1.196-.808-1.961s.308-1.458.808-1.962a2.66 2.66 0 0 1 1.914-.808h.05h-.003h.048c.75 0 1.427.309 1.913.807l.001.001c.499.503.808 1.196.808 1.961s-.308 1.458-.808 1.962a2.66 2.66 0 0 1-1.915.809h-.049zm-2.971 7.643h-.05a3.1 3.1 0 0 1-2.236-.951l-.001-.001c-.584-.584-.945-1.391-.945-2.283s.361-1.698.945-2.283a3.1 3.1 0 0 1 2.234-.945h.054h-.003h.042c.877 0 1.67.362 2.237.944l.001.001c.588.582.952 1.39.952 2.283s-.364 1.7-.952 2.282a3.1 3.1 0 0 1-2.24.953h-.04z"})]})}var Fi=require("react/jsx-runtime");function xr({size:e,variant:t,color:r,radius:n,leftIcon:o,rightIcon:i,isLoading:a=!1,showSpinner:s=!1,loadingText:l,isFullWidth:f=!1,disabled:c=!1,type:w="button",className:p="",children:m,ref:v,...x}){let h=C(e,qs,"md"),k=t==="other"?"":C(r,C(t,Js,"filled"),"primary"),T=C(n,Zs,"lg"),y=["inline-flex items-center justify-center font-medium leading-none border transition-colors duration-150 cursor-pointer select-none whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:pointer-events-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 active:scale-[0.98] transition-transform",h.button,T,k,f?"w-full":"",c?"opacity-50":"",p].filter(Boolean).join(" "),d=g=>(0,Fi.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${h.icon}`,"aria-hidden":"true",children:g}),u=a&&l?l:m;return(0,Fi.jsxs)("button",{ref:v,type:w,disabled:c||a,"aria-busy":a,"aria-disabled":c||a,className:y,...x,children:[a&&s&&d((0,Fi.jsx)(De,{})),(!a||!s)&&o&&d(o),u&&(0,Fi.jsx)("span",{className:"leading-none",children:u}),!a&&i&&d(i)]})}var el=require("react/jsx-runtime");function qr({icon:e,size:t,variant:r,color:n,radius:o,isLoading:i=!1,showSpinner:a=!1,disabled:s=!1,type:l="button",className:f="",ref:c,...w}){let p=C(t,qs,"md"),m=r==="other"?"":C(n,C(r,Js,"filled"),"primary"),v=C(o,Zs,"full"),x=["inline-flex items-center justify-center font-medium leading-none border transition-colors duration-150 active:scale-[0.98] transition-transform cursor-pointer select-none whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:pointer-events-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",p.iconOnly,v,m,s?"opacity-50":"",f].filter(Boolean).join(" "),h=k=>(0,el.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${p.icon}`,"aria-hidden":"true",children:k});return(0,el.jsx)("button",{ref:c,type:l,disabled:s||i,"aria-busy":i,"aria-disabled":s||i,className:x,...w,children:h(i&&a?(0,el.jsx)(De,{}):e)})}var Rd={xs:{badge:"h-5 px-2 text-[11px] gap-1",icon:"size-3",dot:"size-1.5",deleteIcon:"size-3"},sm:{badge:"h-6 px-2.5 text-xs gap-1.5",icon:"size-3.5",dot:"size-1.5",deleteIcon:"size-3.5"},md:{badge:"h-7 px-3 text-xs font-medium gap-1.5",icon:"size-3.5",dot:"w-2 h-2",deleteIcon:"size-3.5"},lg:{badge:"h-8 px-3.5 text-sm font-medium gap-2",icon:"size-4",dot:"size-2.5",deleteIcon:"size-4"},xl:{badge:"h-9 px-4 text-sm font-semibold gap-2",icon:"size-4.5",dot:"size-2.5",deleteIcon:"size-4.5"}},Dd={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Nd={primary:"bg-primary-500",secondary:"bg-secondary-500",error:"bg-error-500",success:"bg-success-500",warning:"bg-warning-500",info:"bg-info-500",neutral:"bg-neutral-500"},Pd={soft:{primary:"bg-primary-100 text-primary-800 border-primary-200 hover:bg-primary-200",secondary:"bg-secondary-100 text-secondary-800 border-secondary-200 hover:bg-secondary-200",error:"bg-error-100 text-error-800 border-error-200 hover:bg-error-200",success:"bg-success-100 text-success-800 border-success-200 hover:bg-success-200",warning:"bg-warning-100 text-warning-800 border-warning-200 hover:bg-warning-200",info:"bg-info-100 text-info-800 border-info-200 hover:bg-info-200",neutral:"bg-neutral-100 text-neutral-800 border-neutral-200 hover:bg-neutral-200"},filled:{primary:"bg-primary-500 text-neutral-white border-transparent hover:bg-primary-600 active:bg-primary-700",secondary:"bg-secondary-500 text-neutral-white border-transparent hover:bg-secondary-600 active:bg-secondary-700",error:"bg-error-500 text-neutral-white border-transparent hover:bg-error-600 active:bg-error-700",success:"bg-success-500 text-neutral-white border-transparent hover:bg-success-600 active:bg-success-700",warning:"bg-warning-500 text-neutral-950 border-transparent hover:bg-warning-600 active:bg-warning-700",info:"bg-info-500 text-neutral-white border-transparent hover:bg-info-600 active:bg-info-700",neutral:"bg-neutral-800 text-neutral-white border-transparent hover:bg-neutral-900 active:bg-neutral-950"},outline:{primary:"bg-transparent text-primary-700 border-2 border-primary-400 hover:bg-primary-50/70",secondary:"bg-transparent text-secondary-800 border-2 border-secondary-400 hover:bg-secondary-50/70",error:"bg-transparent text-error-700 border-2 border-error-400 hover:bg-error-50/70",success:"bg-transparent text-success-700 border-2 border-success-400 hover:bg-success-50/70",warning:"bg-transparent text-warning-800 border-2 border-warning-400 hover:bg-warning-50/70",info:"bg-transparent text-info-800 border-2 border-info-400 hover:bg-info-50/70",neutral:"bg-transparent text-neutral-700 border-2 border-neutral-300 hover:bg-neutral-100/70"},ghost:{primary:"bg-transparent text-primary-700 border-transparent hover:bg-primary-50",secondary:"bg-transparent text-secondary-800 border-transparent hover:bg-secondary-50",error:"bg-transparent text-error-700 border-transparent hover:bg-error-50",success:"bg-transparent text-success-700 border-transparent hover:bg-success-50",warning:"bg-transparent text-warning-800 border-transparent hover:bg-warning-50",info:"bg-transparent text-info-800 border-transparent hover:bg-info-50",neutral:"bg-transparent text-neutral-700 border-transparent hover:bg-neutral-50"}};var Gc=require("react/jsx-runtime");function Ve({width:e=14,height:t=14,className:r="",...n}){return(0,Gc.jsx)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:(0,Gc.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})})}var uo=require("react/jsx-runtime");function ir({size:e="md",variant:t="soft",color:r="primary",radius:n="full",dot:o=!1,dotPing:i=!1,leftIcon:a,rightIcon:s,onDelete:l,deleteAriaLabel:f="Remove",className:c="",children:w,onClick:p,ref:m,...v}){let x=C(e,Rd,"md"),h=t==="other"?"":C(r,C(t,Pd,"soft"),"primary"),k=C(r,Nd,"primary"),T=C(n,Dd,"full"),y=["inline-flex items-center justify-center font-medium leading-none border transition-colors duration-150 whitespace-nowrap",x.badge,T,h,p?"cursor-pointer select-none active:scale-[0.98] transition-transform duration-100":"",c].filter(Boolean).join(" "),d=u=>(0,uo.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${x.icon}`,"aria-hidden":"true",children:u});return(0,uo.jsxs)("span",{ref:m,role:p?"button":void 0,tabIndex:p?0:void 0,className:y,onClick:p,...v,children:[o&&(0,uo.jsx)("span",{className:`relative inline-block shrink-0 rounded-full ${i?"animate-pulse":""} ${x.dot} ${k}`,"aria-hidden":"true"}),a&&d(a),w&&(0,uo.jsx)("span",{className:"leading-none",children:w}),s&&!l&&d(s),l&&(0,uo.jsx)("button",{type:"button",onClick:u=>{u.stopPropagation(),l()},"aria-label":f,className:`inline-flex items-center justify-center shrink-0 rounded-full hover:bg-black/10 active:bg-black/20 transition-colors p-0.5 -mr-0.5 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current ${x.deleteIcon}`,children:(0,uo.jsx)(Ve,{className:"size-full"})})]})}var Hi=require("react"),Ed=require("@floating-ui/react");var tl={xs:{wrapper:"h-6 text-[11px]",input:"px-2 py-0.5 text-[11px] leading-tight",icon:"size-3",iconPaddingLeft:"pl-6",iconPaddingRight:"pr-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{wrapper:"h-8 text-xs",input:"px-2.5 py-1 text-xs leading-normal",icon:"size-3.5",iconPaddingLeft:"pl-7.5",iconPaddingRight:"pr-7.5",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{wrapper:"h-10 text-sm",input:"px-3.5 py-2 text-sm leading-normal",icon:"size-[18px]",iconPaddingLeft:"pl-9",iconPaddingRight:"pr-9",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{wrapper:"h-12 text-base",input:"px-4 py-2.5 text-base leading-normal",icon:"size-5",iconPaddingLeft:"pl-11",iconPaddingRight:"pr-11",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{wrapper:"h-14 text-lg",input:"px-5 py-3 text-lg leading-normal",icon:"size-6",iconPaddingLeft:"pl-13",iconPaddingRight:"pr-13",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},Ei={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},zd={none:"none",sm:"sm",md:"md",lg:"lg",xl:"xl",full:"full"},Id={xs:{wrapper:"min-h-6 text-[11px] px-1.5 py-0.5",input:"text-[11px] leading-tight min-w-[50px]",gap:"gap-1",badgeSize:"xs",icon:"size-3",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{wrapper:"min-h-8 text-xs px-2 py-1",input:"text-xs leading-normal min-w-[60px]",gap:"gap-1",badgeSize:"xs",icon:"size-3.5",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{wrapper:"min-h-10 text-sm px-2.5 py-1.5",input:"text-sm leading-normal min-w-[70px]",gap:"gap-1.5",badgeSize:"sm",icon:"size-[18px]",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{wrapper:"min-h-12 text-base px-3 py-2",input:"text-base leading-normal min-w-[80px]",gap:"gap-1.5",badgeSize:"md",icon:"size-5",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{wrapper:"min-h-14 text-lg px-3.5 py-2.5",input:"text-lg leading-normal min-w-[90px]",gap:"gap-2",badgeSize:"lg",icon:"size-6",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},$i={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"}};var Md={xs:{slot:"size-6 min-w-6",text:"text-xs",gap:"gap-1",label:"text-[11px] mb-1",helper:"text-[9px] mt-0.5"},sm:{slot:"size-8 min-w-8",text:"text-sm",gap:"gap-1.5",label:"text-xs mb-1",helper:"text-[10px] mt-0.5"},md:{slot:"size-10 min-w-10",text:"text-base font-semibold",gap:"gap-2",label:"text-sm mb-1.5",helper:"text-[11px] mt-1"},lg:{slot:"size-12 min-w-12",text:"text-lg font-semibold",gap:"gap-2.5",label:"text-base mb-1.5",helper:"text-xs mt-1"},xl:{slot:"size-14 min-w-14",text:"text-xl font-bold",gap:"gap-3",label:"text-lg mb-2",helper:"text-sm mt-1"}};var Li=require("react");function rl(e,t={}){let{exitDuration:r=250}=t,[n,o]=(0,Li.useState)(e),[i,a]=(0,Li.useState)(!1),[s,l]=(0,Li.useState)(e);return e!==s&&(l(e),e?(o(e),a(!1)):a(!0)),(0,Li.useEffect)(()=>{if(!i)return;let f=setTimeout(()=>{o(void 0),a(!1)},r);return()=>clearTimeout(f)},[r,i]),{displayedError:n,isExiting:i}}var nl=require("react/jsx-runtime");function Le({id:e,helperText:t,errorMessage:r,sizeClassName:n="text-xs",className:o=""}){let{displayedError:i,isExiting:a}=rl(r),s=i||t,l=!!(i||t),f=!!i;return(0,nl.jsx)("div",{className:`grid transition-[grid-template-rows,opacity,margin] duration-200 ease-out overflow-hidden ${l?"grid-rows-[1fr] opacity-100 mt-1":"grid-rows-[0fr] opacity-0 mt-0 pointer-events-none"}`,"aria-live":"polite",children:(0,nl.jsx)("div",{className:"overflow-hidden",children:(0,nl.jsx)("div",{id:e,role:f?"alert":"status",className:`leading-tight transition-colors duration-200 font-normal ${n} ${f?a?"text-error-600 animate-error-out":"text-error-600 animate-error-in":"text-neutral-500 dark:text-neutral-400"} ${o}`,children:s||"\xA0"})})})}var Bi=require("react/jsx-runtime"),jc={primary:"text-primary-500 group-focus-within/field:text-primary-600",secondary:"text-secondary-500 group-focus-within/field:text-secondary-600",error:"text-error-500 group-focus-within/field:text-error-600",success:"text-success-500 group-focus-within/field:text-success-600",warning:"text-warning-500 group-focus-within/field:text-warning-600",info:"text-info-500 group-focus-within/field:text-info-600",neutral:"text-neutral-500 group-focus-within/field:text-neutral-600"},Fd={xs:{label:"text-[11px] mb-1",floatingLabel:"text-[10px]"},sm:{label:"text-xs mb-1",floatingLabel:"text-[10px]"},md:{label:"text-sm mb-1.5",floatingLabel:"text-[11px]"},lg:{label:"text-base mb-1.5",floatingLabel:"text-xs"},xl:{label:"text-lg mb-2",floatingLabel:"text-xs"}};function vt({label:e,children:t,htmlFor:r,id:n,isRequired:o=!1,isFloating:i,placement:a,size:s="md",sizeClassName:l,color:f="primary",hasError:c=!1,isInvalid:w=!1,cursor:p,className:m="",colorConfig:v=jc}){let x=e??t;if(!x)return null;let h=i??a==="floating",k=!!(c||w),T=k?"error":f,y=k?"text-error-600 font-bold":v[T]||jc[T]||jc.primary,d=Fd[s]||Fd.md,u=l||(h?d.floatingLabel:d.label),g=p?`cursor-${p}`:h?"cursor-text":"";return h?(0,Bi.jsxs)("label",{htmlFor:r,id:n,className:`absolute top-0 -translate-y-1/2 left-3 px-1.5 rounded-sm select-none z-10 font-bold bg-neutral-white transition-colors duration-150 ${g} ${u} ${y} ${m}`,children:[x,o&&(0,Bi.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):(0,Bi.jsxs)("label",{htmlFor:r,id:n,className:`inline-flex items-center font-bold transition-colors duration-150 ${g} ${u} ${y} ${m}`,children:[x,o&&(0,Bi.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})}var Vt=require("react/jsx-runtime");function Yt({size:e,variant:t,color:r,radius:n,label:o,labelPlacement:i="floating",config:a,helperText:s,errorMessage:l,leftIcon:f,leftAddon:c,rightIcon:w,rightAddon:p,onClear:m,wrapperClassName:v="",inputWrapperClassName:x="",labelClassName:h="",helperClassName:k="",id:T,value:y,defaultValue:d,onChange:u,disabled:g=!1,readOnly:b=!1,className:S="",type:R="text",placeholder:D,ref:P,...I}){let{isRequired:E=!1,isInvalid:N=!1,isLoading:M=!1,showSpinner:z=!1,isClearable:H=!1,isFullWidth:V=!1}=a??{},Y=(0,Hi.useId)(),$=T||Y,F=`${$}-error-helper`,G=(0,Hi.useRef)(null),A=(0,Ed.useMergeRefs)([G,P]),j=y!==void 0,[B,X]=(0,Hi.useState)(d),le=j?y:B,ne=ye=>{j||X(ye.target.value),u?.(ye)},ue=()=>{j||X(""),m?.()},ie=le!=null?String(le).length>0:!1,Q=!!(N||l),q=Q?"error":r,ge=C(e,tl,"md"),ke=C(n,Ei,"md"),L=t==="other"?"":C(q,C(t,$i,"outline"),"primary"),te=ye=>(0,Vt.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${ge.icon}`,"aria-hidden":"true",children:ye}),Z=i==="floating",he=()=>(0,Vt.jsx)(vt,{htmlFor:$,label:o,isRequired:E,isFloating:Z,size:e,color:q,hasError:Q,className:h}),ae=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2",ge.wrapper,ke,L,g?"opacity-50":"",V?"w-full":"w-auto",x].filter(Boolean).join(" "),ve=["w-full h-full bg-transparent outline-none border-none text-neutral-900 placeholder:text-neutral-400 disabled:cursor-not-allowed",ge.input,f?"pl-1.5":"",w||H||M?"pr-1.5":"",S].filter(Boolean).join(" ");return(0,Vt.jsxs)("div",{className:`group/field flex ${i==="left"?"flex-row items-center gap-3":"flex-col"} ${V?"w-full":"inline-flex"} ${v}`,children:[!Z&&he(),(0,Vt.jsxs)("div",{className:`flex flex-col ${V?"w-full":""}`,children:[(0,Vt.jsxs)("div",{className:"flex items-stretch",children:[c&&(0,Vt.jsx)("div",{className:`inline-flex items-center px-3 text-neutral-600 bg-neutral-100 border border-r-0 border-neutral-300 text-sm font-medium ${ke?`${ke} rounded-r-none`:""}`,children:c}),(0,Vt.jsxs)("div",{className:`${ae} ${c?"rounded-l-none!":""} ${p?"rounded-r-none!":""}`,children:[Z&&he(),f&&(0,Vt.jsx)("div",{className:"flex items-center justify-center pl-3 shrink-0",children:te(f)}),(0,Vt.jsx)("input",{ref:A,id:$,type:R,value:le,onChange:ne,disabled:g||M,readOnly:b,"aria-invalid":Q,"aria-required":E,"aria-describedby":l||s?F:void 0,"aria-errormessage":l?F:void 0,"aria-busy":M,"aria-disabled":g||M,placeholder:D,className:ve,...I}),M&&z&&(0,Vt.jsx)("div",{className:"flex items-center justify-center pr-3 shrink-0",children:te((0,Vt.jsx)(De,{}))}),!M&&H&&!g&&!b&&(0,Vt.jsx)("button",{type:"button",onClick:ue,"aria-label":"X\xF3a n\u1ED9i dung",tabIndex:ie?0:-1,"aria-hidden":!ie,className:`inline-flex items-center justify-center mr-2 shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${ge.icon} ${ie?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,Vt.jsx)(Ve,{className:"size-full"})}),!M&&w&&(0,Vt.jsx)("div",{className:"flex items-center justify-center pr-3 shrink-0",children:te(w)})]}),p&&(0,Vt.jsx)("div",{className:`inline-flex items-center px-3 text-neutral-600 bg-neutral-100 border border-l-0 border-neutral-300 text-sm font-medium ${ke?`${ke} rounded-l-none`:""}`,children:p})]}),(0,Vt.jsx)(Le,{id:F,helperText:s,errorMessage:l,sizeClassName:ge.helper,className:k})]})]})}var Ld=require("react");var mn=require("react/jsx-runtime");function Uc({width:e=16,height:t=16,className:r="",...n}){return(0,mn.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,mn.jsx)("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),(0,mn.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}function $d({width:e=16,height:t=16,className:r="",...n}){return(0,mn.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,mn.jsx)("path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24"}),(0,mn.jsx)("path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"}),(0,mn.jsx)("path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61"}),(0,mn.jsx)("line",{x1:"2",x2:"22",y1:"2",y2:"22"})]})}var Vn=Uc;var Ha=require("react/jsx-runtime");function ol({defaultVisible:e=!1,toggleAriaLabel:t="Hi\u1EC3n th\u1ECB/\u1EA9n m\u1EADt kh\u1EA9u",onVisibilityChange:r,rightIcon:n,disabled:o,readOnly:i,...a}){let[s,l]=(0,Ld.useState)(e);return(0,Ha.jsx)(Yt,{type:s?"text":"password",disabled:o,readOnly:i,rightIcon:n||(0,Ha.jsx)("button",{type:"button",onClick:()=>{if(o||i)return;let w=!s;l(w),r?.(w)},disabled:o||i,"aria-label":t,className:"inline-flex items-center justify-center size-full p-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-colors cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded",children:s?(0,Ha.jsx)($d,{className:"size-full"}):(0,Ha.jsx)(Uc,{className:"size-full"})}),...a})}var Bd=require("react");function An(e,t){if(e==null||e==="")return"";let r=t?.thousandSeparator??".",n=t?.decimalSeparator??",",o=t?.maxDecimalDigits??0,i=t?.min,a=t?.max,s=t?.clampMin??!1,l=t?.allowNegative??(i===void 0||i<0),f=String(e).trim();if(!f)return"";let c=l&&f.startsWith("-");if(c&&f==="-")return"-";if(o>0&&f.includes(n)){let h=f.split(n),k=h[0]?.replace(/\D/g,"")??"",T=h.slice(1).join("").replace(/\D/g,"").slice(0,o);if(k||T){let u=parseFloat(`${k||"0"}.${T||"0"}`);if(c&&(u=-u),a!==void 0&&!isNaN(u)&&u>a)return An(a,{...t,max:void 0,min:void 0});if(i!==void 0&&!isNaN(u)&&u<i&&(s||c&&i<0))return An(i,{...t,max:void 0,min:void 0})}let y=k?parseInt(k,10).toString().replace(/\B(?=(\d{3})+(?!\d))/g,r):"",d=c?"-":"";return h.length>1&&h[1]===""&&T===""?`${d}${y||"0"}${n}`:T.length>0?`${d}${y||"0"}${n}${T}`:`${d}${y}`}let w=f.replace(/\D/g,"");if(!w)return c?"-":"";let p=parseInt(w,10);if(isNaN(p))return"";c&&(p=-p),a!==void 0&&p>a&&(p=a),i!==void 0&&p<i&&(s||c&&i<0)&&(p=i);let m=p<0?"-":"",v=Math.abs(p).toString().replace(/\B(?=(\d{3})+(?!\d))/g,r);return`${m}${v}`}function Yc(e,t){let r=t?.thousandSeparator??".";return e.split(r).join("")}function On(e,t){if(!e)return;let r=t?.thousandSeparator??".",n=t?.decimalSeparator??",",o=e.split(r).join("");if(n!=="."&&(o=o.split(n).join(".")),o=o.replace(/[^\d.-]/g,""),!o||o==="."||o==="-")return;let i=parseFloat(o);return isNaN(i)?void 0:i}function Wc(e,t,r,n){let o=n?.decimalSeparator??",",i=0;for(let l=0;l<r&&l<e.length;l++){let f=e.charAt(l);(/\d/.test(f)||f===o||f==="-")&&i++}if(i===0)return 0;let a=t.length,s=0;for(let l=0;l<t.length;l++){let f=t.charAt(l);if((/\d/.test(f)||f===o||f==="-")&&s++,s===i){a=l+1;break}}return Math.min(a,t.length)}function Va(e,t="numeric"){return t==="numeric"?/^\d$/.test(e):t==="alphanumeric"?/^[a-zA-Z0-9]$/.test(e):!0}function Aa(e,t="numeric"){return t==="numeric"?e.replace(/\D/g,""):t==="alphanumeric"?e.replace(/[^a-zA-Z0-9]/g,""):e}function Oa(e,t=/[\r\n,;\t]+/,r=!0){return e?e.split(t).map(n=>r?n.trim():n).filter(Boolean):[]}var Hd=require("react/jsx-runtime");function fo({value:e,defaultValue:t,min:r,max:n,thousandSeparator:o=".",decimalSeparator:i=",",maxDecimalDigits:a=0,allowNegative:s,onChange:l,onClear:f,onBlur:c,ref:w,...p}){let m={max:n,min:r,thousandSeparator:o,decimalSeparator:i,maxDecimalDigits:a,allowNegative:s},v=e!==void 0,[x,h]=(0,Bd.useState)(t),k=v?e:x,T=An(k,m),y=()=>{v||h(""),f?.()},d=g=>{let b=g.target,S=b.value,R=b.selectionStart||0,D=An(S,m),P=Wc(S,D,R,{decimalSeparator:i});if(v||h(D),b.value=D,l){let I={...g,target:b,currentTarget:b};l(I)}requestAnimationFrame(()=>{b&&b.setSelectionRange&&b.setSelectionRange(P,P)})},u=g=>{if(r!==void 0&&k!==void 0&&k!==null&&k!==""){let b=On(String(k),{thousandSeparator:o,decimalSeparator:i});if(b!==void 0&&b<r){let S=An(r,{...m,clampMin:!0});if(v||h(S),l){g.target.value=S;let R={...g,target:g.target,currentTarget:g.target};l(R)}}}c?.(g)};return(0,Hd.jsx)(Yt,{ref:w,type:"text",inputMode:a>0?"decimal":"numeric",value:T,onChange:d,onBlur:u,onClear:y,...p})}var bn=require("react");var ar=require("react/jsx-runtime");function il({ref:e,config:t,id:r,name:n,length:o=6,value:i,defaultValue:a="",onChange:s,onComplete:l,type:f="numeric",mask:c=!1,size:w="md",variant:p="outline",color:m="primary",radius:v,autoFocus:x=!1,disabled:h=!1,readOnly:k=!1,groupSize:T,separator:y="-",ariaLabel:d="One-time password",getSlotAriaLabel:u,allowOneTimeCode:g=!0,label:b,labelPlacement:S="top",helperText:R,errorMessage:D,className:P="",slotClassName:I="",wrapperClassName:E="",labelClassName:N="",helperClassName:M=""}){let{isRequired:z=!1,isInvalid:H=!1,isLoading:V=!1,showSpinner:Y=!1}=t??{},$=(0,bn.useId)(),F=r||$,G=`${F}-slot-0`,A=`${F}-error-helper`,[j,B]=(0,bn.useState)(()=>{let J=(i!==void 0?i:a).split("");return Array.from({length:o},(O,W)=>J[W]||"")}),X=(0,bn.useRef)([]),le=i!==void 0,ne=le?Array.from({length:o},(J,O)=>i&&i[O]!==void 0?i[O]:""):j,ue=!!(H||D),ie=ue?"error":m;(0,bn.useEffect)(()=>{if(x&&!h&&!k){let J=ne.findIndex(W=>!W),O=J!==-1?J:0;X.current[O]?.focus()}},[x,ne,h,k]),(0,bn.useImperativeHandle)(e,()=>({getValue:()=>ne.join(""),clear:()=>{let J=Array(o).fill("");le||B(J),s?.(""),!h&&!k&&X.current[0]?.focus()},focus:(J=0)=>{let O=Math.max(0,Math.min(J,o-1));X.current[O]?.focus()}}),[ne,o,le,s,h,k]);let Q=J=>{le||B(J);let O=J.join("");s?.(O),J.every(W=>W.length>0)&&J.length===o&&l?.(O)},q=(J,O)=>{let W=Aa(J,f);if(!W)return;let we=[...ne],fe=W.length>=o?0:O,se=W.slice(0,o-fe).split("");se.forEach((Re,xe)=>{fe+xe<o&&(we[fe+xe]=Re)}),Q(we);let me=Math.min(fe+se.length,o-1);X.current[me]?.focus()},ge=(J,O)=>{if(h||k||V)return;let W=J.target.value;if(!W){let fe=[...ne];fe[O]="",Q(fe);return}if(W.length>1){q(W,O);return}let we=W.slice(-1);if(Va(we,f)){let fe=[...ne];fe[O]=we,Q(fe),O<o-1&&X.current[O+1]?.focus()}},ke=(J,O)=>{if(!(h||k||V)){if(J.key==="Backspace"){J.preventDefault();let W=[...ne];ne[O]?(W[O]="",Q(W)):O>0&&(W[O-1]="",Q(W),X.current[O-1]?.focus())}else if(J.key==="Delete"){J.preventDefault();let W=[...ne];W[O]="",Q(W)}else if(J.key==="ArrowLeft")J.preventDefault(),O>0&&X.current[O-1]?.focus();else if(J.key==="ArrowRight")J.preventDefault(),O<o-1&&X.current[O+1]?.focus();else if((J.ctrlKey||J.metaKey)&&J.key.toLowerCase()==="c"){let W=ne.join("");W&&navigator.clipboard?.writeText(W)}else if((J.ctrlKey||J.metaKey)&&J.key.toLowerCase()==="x"){J.preventDefault();let W=ne.join("");W&&navigator.clipboard?.writeText(W);let we=Array(o).fill("");Q(we),X.current[0]?.focus()}}},L=(J,O)=>{if(h||k||V)return;J.preventDefault();let W=J.clipboardData.getData("text/plain");q(W,O)},te=C(w,Md,"md"),Z=C(w,tl,"md"),he=C(v,Ei,"md"),ae=p==="other"?"":C(ie,C(p,$i,"outline"),"primary"),ve=h?"opacity-50":"",Se=()=>b?(0,ar.jsxs)("label",{htmlFor:G,className:`block font-medium text-neutral-700 select-none ${te.label} ${N}`,children:[b,z&&(0,ar.jsx)("span",{className:"text-error-500 ml-0.5",children:"*"})]}):null;return(0,ar.jsxs)("div",{className:`group/otp flex ${S==="left"?"flex-row items-start gap-3":"flex-col"} ${E}`,children:[Se(),(0,ar.jsxs)("div",{className:"flex flex-col",children:[(0,ar.jsxs)("div",{role:"group","aria-label":d,"aria-describedby":D||R?A:void 0,className:`inline-flex items-center ${te.gap} ${P}`,children:[Array.from({length:o}).map((J,O)=>{let W=!!(c||f==="password"),we=u?u(O,o):`K\xFD t\u1EF1 ${O+1} tr\xEAn ${o}`,fe=!!(T&&T>0)&&(O+1)%(T||1)===0&&O<o-1;return(0,ar.jsxs)("div",{className:"inline-flex items-center gap-1.5",children:[(0,ar.jsx)("input",{id:`${F}-slot-${O}`,ref:se=>{X.current[O]=se},type:W?"password":"text",inputMode:f==="numeric"?"numeric":"text",pattern:f==="numeric"?"[0-9]*":void 0,maxLength:1,value:ne[O]||"",onFocus:se=>se.target.select(),onChange:se=>ge(se,O),onKeyDown:se=>ke(se,O),onPaste:se=>L(se,O),disabled:h||V,readOnly:k,"aria-label":we,"aria-invalid":ue,"aria-required":z,"aria-busy":V,"aria-disabled":h||V,autoComplete:g?"one-time-code":"off",autoCorrect:"off",autoCapitalize:"none",spellCheck:!1,"data-1p-ignore":"true","data-lpignore":"true","data-form-type":"other",className:`border-2 text-center p-0 outline-none transition-all duration-150 ease-in-out text-neutral-900 ${te.slot} ${te.text} ${he} ${ae} ${ve} ${I}`}),fe&&(0,ar.jsx)("span",{"aria-hidden":"true",className:"inline-flex items-center justify-center text-neutral-400 select-none font-bold shrink-0",children:y})]},`${F}-slot-${O}`)}),V&&Y&&(0,ar.jsx)("div",{role:"status","aria-label":"\u0110ang t\u1EA3i",className:"inline-flex items-center justify-center pl-1.5 shrink-0 text-neutral-400",children:(0,ar.jsx)(De,{className:`animate-spin ${Z.icon}`})})]}),(0,ar.jsx)(Le,{id:A,helperText:R,errorMessage:D,sizeClassName:te.helper,className:M}),n&&(0,ar.jsx)("input",{type:"hidden",name:n,value:ne.join(""),disabled:h||V})]})]})}var po=require("react"),Vd=require("@floating-ui/react");var Ga=require("react/jsx-runtime");function Zr({width:e=14,height:t=14,className:r="",...n}){return(0,Ga.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Ga.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,Ga.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}var Ke=require("react/jsx-runtime");function al({size:e,variant:t,color:r,radius:n,label:o,labelPlacement:i="floating",config:a,helperText:s,errorMessage:l,leftIcon:f,leftAddon:c,rightIcon:w,rightAddon:p,onClear:m,wrapperClassName:v="",inputWrapperClassName:x="",labelClassName:h="",helperClassName:k="",id:T,name:y,value:d,defaultValue:u=[],onChange:g,inputValue:b,onInputValueChange:S,delimiters:R=["Enter"],showAddButton:D=!1,renderAddButton:P,addOnBlur:I=!1,addOnPaste:E=!0,pasteSplitRegex:N=/[\r\n,;\t]+/,trimValues:M=!0,allowDuplicates:z=!1,onDuplicate:H,maxTags:V,onMaxTagsReached:Y,maxTagLength:$,validateTag:F,onValidateError:G,maxTagCount:A,renderTag:j,tagVariant:B,tagColor:X,tagRadius:le,tagSize:ne,tagClassName:ue="",addButtonClassName:ie="",disabled:Q=!1,readOnly:q=!1,className:ge="",placeholder:ke="Nh\u1EADp v\xE0 nh\u1EA5n Enter...",autoFocus:L=!1,ref:te}){let{isRequired:Z=!1,isInvalid:he=!1,isLoading:ae=!1,showSpinner:ve=!1,isClearable:Se=!1,isFullWidth:ye=!1}=a??{},J=(0,po.useId)(),O=T||J,W=`${O}-error-helper`,we=o?`${O}-label`:void 0,fe=(0,po.useRef)(null),se=(0,Vd.useMergeRefs)([fe,te]),me=d!==void 0,[Re,xe]=(0,po.useState)(u),re=me?d||[]:Re,de=b!==void 0,[ce,ee]=(0,po.useState)(""),U=de?b||"":ce,[Ce,$e]=(0,po.useState)(""),Ee=Me=>{de||ee(Me),S?.(Me)},oe=Me=>{me||xe(Me),g?.(Me)},Te=Me=>{if(Q||q||ae)return!1;let Ue=M?Me.trim():Me;if(!Ue)return!1;if($&&$>0&&Ue.length>$&&(Ue=Ue.slice(0,$)),V!==void 0&&re.length>=V)return Y?.(Ue),$e(`Maximum limit of ${V} tags reached`),!1;if(!z&&re.includes(Ue))return H?.(Ue),$e(`Tag "${Ue}" already exists`),!1;if(F){let Gt=F(Ue);if(Gt===!1||typeof Gt=="string")return G?.(Ue,typeof Gt=="string"?Gt:void 0),$e(`Tag "${Ue}" is invalid`),!1}let Bt=[...re,Ue];return oe(Bt),Ee(""),$e(`Added tag "${Ue}"`),!0},Pe=Me=>{if(Q||q||ae)return;let Ue=[...re],Bt=new Set(re),Gt=0;for(let Bn of Me){let hr=M?Bn.trim():Bn;if(hr){if($&&$>0&&hr.length>$&&(hr=hr.slice(0,$)),V!==void 0&&Ue.length>=V){Y?.(hr);break}if(!z&&Bt.has(hr)){H?.(hr);continue}if(F){let Mi=F(hr);if(Mi===!1||typeof Mi=="string"){G?.(hr,typeof Mi=="string"?Mi:void 0);continue}}Ue.push(hr),Bt.add(hr),Gt++}}oe(Ue),Ee(""),Gt>0&&$e(`Added ${Gt} tags`)},Qe=Me=>{if(Q||q||ae)return;let Ue=re[Me],Bt=re.filter((Gt,Bn)=>Bn!==Me);oe(Bt),Ue&&$e(`Removed tag "${Ue}"`)},We=Me=>{Me?.stopPropagation(),!(Q||q||ae)&&(oe([]),Ee(""),$e("Removed all tags"),m?.(),fe.current?.focus())},Be=Me=>{if(Q||q||ae)return;R.includes(Me.key)||R.includes("Enter")&&Me.key==="Enter"||R.includes("Comma")&&(Me.key===","||Me.key==="Comma")||R.includes("Tab")&&Me.key==="Tab"||R.includes("Space")&&(Me.key===" "||Me.key==="Space")?U&&(Me.preventDefault(),Te(U)):Me.key==="Backspace"&&U===""&&re.length>0&&(Me.preventDefault(),Qe(re.length-1))},Oe=Me=>{if(!(Q||q||ae)&&E){let Ue=Me.clipboardData.getData("text");if(Ue){let Bt=Oa(Ue,N,M);(Bt.length>1||N.test(Ue))&&(Me.preventDefault(),Pe(Bt))}}},Ze=()=>{I&&U.trim()&&Te(U)},K=re.length>0||U.length>0,_=!!(he||l),ze=_?"error":r,pe=C(e,Id,"md"),Fe=C(n,Ei,"md"),et=le||C(n,zd,"md"),Ge=ne||pe.badgeSize||"sm",at=X||r,tt=B||t,Ne=t==="other"?"":C(ze,C(t,$i,"outline"),"primary"),Xe=i==="floating",be=Me=>(0,Ke.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${pe.icon}`,"aria-hidden":"true",children:Me}),je=()=>(0,Ke.jsx)(vt,{id:we,htmlFor:O,label:o,isRequired:Z,isFloating:Xe,size:e,color:ze,hasError:_,className:h}),pt=A&&A>0?re.slice(0,A):re,st=A&&A>0?Math.max(0,re.length-A):0,rr=Q?"opacity-50 cursor-not-allowed pointer-events-none":"cursor-text",br=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2",pe.wrapper,Fe,Ne,rr,ye?"w-full":"w-auto min-w-[200px]",x].filter(Boolean).join(" "),ht=i==="left",nr=V===void 0||re.length<V,Yo=D&&!Q&&!q;return(0,Ke.jsxs)("div",{role:"group","aria-labelledby":we,className:`group/field flex ${ht?"flex-row items-center gap-3":"flex-col"} ${ye?"w-full":"inline-flex"} ${v}`,children:[(0,Ke.jsx)("span",{className:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true",children:Ce}),!Xe&&je(),(0,Ke.jsxs)("div",{className:`flex flex-col ${ye?"w-full":""}`,children:[(0,Ke.jsxs)("div",{className:"flex items-stretch",children:[c&&(0,Ke.jsx)("div",{className:`inline-flex items-center px-3 text-neutral-600 bg-neutral-100 border border-r-0 border-neutral-300 text-sm font-medium ${Fe?`${Fe} rounded-r-none`:""}`,children:c}),(0,Ke.jsxs)("div",{className:`${br} ${c?"rounded-l-none!":""} ${p?"rounded-r-none!":""}`,children:[Xe&&je(),f&&(0,Ke.jsx)("div",{className:"flex items-center justify-center pl-1 pr-1.5 shrink-0",children:be(f)}),(0,Ke.jsxs)("div",{className:`flex flex-wrap items-center flex-1 min-w-0 ${pe.gap}`,children:[(()=>{let Me=new Map;return pt.map((Ue,Bt)=>{let Gt=(Me.get(Ue)??0)+1;Me.set(Ue,Gt);let Bn=`${Ue}_${Gt}`;return j?(0,Ke.jsx)("span",{className:"inline-flex shrink-0",children:j({value:Ue,index:Bt,onRemove:()=>Qe(Bt),disabled:Q,readOnly:q})},Bn):(0,Ke.jsx)("span",{className:"inline-flex shrink-0",children:(0,Ke.jsx)(ir,{size:Ge,variant:tt,color:at,radius:et,deleteAriaLabel:`Remove tag ${Ue}`,onDelete:!Q&&!q?()=>Qe(Bt):void 0,className:`shrink-0 max-w-full truncate select-none ${ue}`,children:Ue})},Bn)})})(),st>0&&(0,Ke.jsx)("span",{className:"inline-flex shrink-0",children:(0,Ke.jsxs)(ir,{size:Ge,variant:"filled",color:"neutral",radius:et,className:"shrink-0 font-medium select-none",children:["+",st]})}),nr?(0,Ke.jsx)("input",{ref:se,id:O,type:"text",value:U,onChange:Me=>Ee(Me.target.value),onKeyDown:Be,onPaste:Oe,onBlur:Ze,disabled:Q||ae,readOnly:q,autoFocus:L,"aria-invalid":_,"aria-required":Z,"aria-describedby":l||s?W:void 0,"aria-errormessage":l?W:void 0,"aria-busy":ae,"aria-disabled":Q||ae,"aria-autocomplete":"none",placeholder:re.length===0?ke:"",className:`flex-1 bg-transparent outline-none border-none text-neutral-900 placeholder:text-neutral-400 disabled:cursor-not-allowed ${pe.input} ${ge}`}):null]}),Yo&&(0,Ke.jsx)("div",{className:"flex items-center justify-center pl-1.5 shrink-0",children:P?P({onAdd:()=>Te(U),disabled:!U.trim()||!nr}):(0,Ke.jsx)("button",{type:"button",onClick:Me=>{Me.stopPropagation(),U.trim()&&nr?Te(U):fe.current?.focus()},disabled:!U.trim()||!nr,"aria-label":"Th\xEAm th\u1EBB",className:`inline-flex items-center justify-center p-1 rounded hover:bg-neutral-200 active:scale-95 disabled:opacity-40 disabled:pointer-events-none transition-all cursor-pointer text-neutral-600 hover:text-neutral-900 ${ie}`,children:(0,Ke.jsx)(Zr,{className:pe.icon})})}),ae&&ve&&(0,Ke.jsx)("div",{className:"flex items-center justify-center pl-1.5 shrink-0",role:"status","aria-label":"\u0110ang t\u1EA3i",children:be((0,Ke.jsx)(De,{}))}),!ae&&Se&&!Q&&!q&&(0,Ke.jsx)("button",{type:"button",onClick:We,"aria-label":"X\xF3a t\u1EA5t c\u1EA3 c\xE1c th\u1EBB",tabIndex:K?0:-1,"aria-hidden":!K,className:`inline-flex items-center justify-center pl-1.5 shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${pe.icon} ${K?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,Ke.jsx)(Ve,{className:"size-full"})}),!ae&&w&&(0,Ke.jsx)("div",{className:"flex items-center justify-center pl-1.5 shrink-0",children:be(w)})]}),p&&(0,Ke.jsx)("div",{className:`inline-flex items-center px-3 text-neutral-600 bg-neutral-100 border border-l-0 border-neutral-300 text-sm font-medium ${Fe?`${Fe} rounded-l-none`:""}`,children:p})]}),(0,Ke.jsx)(Le,{id:W,helperText:s,errorMessage:l,sizeClassName:pe.helper,className:k}),y&&(()=>{let Me=new Map;return(0,Ke.jsxs)(Ke.Fragment,{children:[re.map(Ue=>{let Bt=(Me.get(Ue)??0)+1;Me.set(Ue,Bt);let Gt=`${Ue}_${Bt}`;return(0,Ke.jsx)("input",{type:"hidden",name:`${y}[]`,value:Ue,disabled:Q||ae},`hidden_${Gt}`)}),re.length===0&&(0,Ke.jsx)("input",{type:"hidden",name:y,value:"",disabled:Q||ae})]})})()]})]})}var Vi=require("react"),Ud=Hn(require("react-textarea-autosize"),1),Yd=require("@floating-ui/react");var Ad={xs:{textarea:"text-[11px] px-2 py-1 leading-tight",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{textarea:"text-xs px-2.5 py-1.5 leading-normal",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{textarea:"text-sm px-3.5 py-2 leading-normal",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{textarea:"text-base px-4 py-2.5 leading-normal",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{textarea:"text-lg px-5 py-3 leading-normal",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},Od={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Gd={none:"resize-none",vertical:"resize-y",horizontal:"resize-x",both:"resize"},jd={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-error-50/60 border border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-50/60 border border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},ghost:{primary:"bg-transparent border border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-transparent border border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-transparent border border-transparent hover:bg-neutral-100/50 focus-within:bg-neutral-100/50 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"}};var sr=require("react/jsx-runtime");function sl({size:e,variant:t,color:r,radius:n,label:o,labelPlacement:i="floating",config:a,helperText:s,errorMessage:l,onClear:f,minRows:c=3,maxRows:w,onHeightChange:p,cacheMeasurements:m,resize:v="none",wrapperClassName:x="",textareaWrapperClassName:h="",labelClassName:k="",helperClassName:T="",countClassName:y="",id:d,value:u,defaultValue:g,onChange:b,disabled:S=!1,readOnly:R=!1,className:D="",placeholder:P,maxLength:I,ref:E,style:N,...M}){let{isRequired:z=!1,isInvalid:H=!1,isLoading:V=!1,showSpinner:Y=!1,isClearable:$=!1,showCount:F=!1,isFullWidth:G=!1,autoResize:A=!0}=a??{},j=(0,Vi.useId)(),B=d||j,X=`${B}-error-helper`,le=(0,Vi.useRef)(null),[ne,ue]=(0,Vi.useState)(g),ie=(0,Yd.useMergeRefs)([le,E]),Q=u!==void 0,q=Q?u:ne,ge=!!(H||l),ke=ge?"error":r,L=C(e,Ad,"md"),te=C(n,Od,"md"),Z=A?"resize-none":C(v,Gd,"none"),he=t==="other"?"":C(ke,C(t,jd,"outline"),"primary"),ae=q!=null?String(q).length:0,ve=ae>0,Se=Re=>{let xe=Re.target.value;I!==void 0&&xe.length>I&&(xe=xe.slice(0,I),Re.target.value=xe),Q||ue(xe),b?.(Re)},ye=()=>{Q||ue(""),f?.()},J=i==="floating",O=()=>(0,sr.jsx)(vt,{htmlFor:B,label:o,isRequired:z,isFloating:J,size:e,color:ke,hasError:ge,className:k}),W=["group/textarea relative flex flex-col transition-all duration-150 ease-in-out border-2",te,he,S?"opacity-50":"",G?"w-full":"w-auto",h].filter(Boolean).join(" "),we=$||V&&Y,fe=["w-full bg-transparent outline-none border-none text-neutral-900 placeholder:text-neutral-400 disabled:cursor-not-allowed ui-scrollbar",L.textarea,we?"pr-8":"",F?"pb-6":"",Z,D].filter(Boolean).join(" "),se=i==="left",me={id:B,value:q,onChange:Se,disabled:S||V,readOnly:R,maxLength:I,"aria-invalid":ge,"aria-required":z,"aria-describedby":l||s?X:void 0,"aria-errormessage":l?X:void 0,"aria-busy":V,"aria-disabled":S||V,placeholder:P,className:fe,style:N,...M};return(0,sr.jsxs)("div",{className:`group/field flex ${se?"flex-row items-start gap-3":"flex-col"} ${J?"pt-2":""} ${G?"w-full":"inline-flex"} ${x}`,children:[!J&&O(),(0,sr.jsxs)("div",{className:`flex flex-col ${G?"w-full":""}`,children:[(0,sr.jsxs)("div",{className:W,children:[J&&O(),A?(0,sr.jsx)(Ud.default,{ref:ie,minRows:c,maxRows:w,onHeightChange:p,cacheMeasurements:m,...me}):(0,sr.jsx)("textarea",{ref:ie,rows:c,...me}),V&&Y&&(0,sr.jsx)("div",{className:"absolute top-2.5 right-2.5 text-neutral-400 size-4 select-none pointer-events-none",children:(0,sr.jsx)(De,{className:"size-full animate-spin"})}),!V&&$&&!S&&!R&&(0,sr.jsx)("button",{type:"button",onClick:ye,"aria-label":"X\xF3a n\u1ED9i dung",tabIndex:ve?0:-1,"aria-hidden":!ve,className:`absolute top-2.5 right-2.5 inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full size-4 ${ve?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,sr.jsx)(Ve,{className:"size-full"})}),F&&(0,sr.jsxs)("div",{className:`absolute bottom-2 right-2.5 text-[11px] font-mono select-none pointer-events-none z-10 text-neutral-400 ${y}`,children:[ae,I!==void 0&&`/${I}`]})]}),(0,sr.jsx)(Le,{id:X,helperText:s,errorMessage:l,sizeClassName:L.helper,className:T})]})]})}var cl=require("react");var ll={xs:{box:"size-3.5",icon:"size-2.5",label:"text-xs leading-4",gap:"gap-1.5",helper:"text-[10px]"},sm:{box:"size-4",icon:"size-3",label:"text-sm leading-4",gap:"gap-2",helper:"text-[11px]"},md:{box:"size-5",icon:"size-3.5",label:"text-sm leading-5",gap:"gap-2.5",helper:"text-xs"},lg:{box:"size-6",icon:"size-4",label:"text-base leading-6",gap:"gap-3",helper:"text-xs"},xl:{box:"size-7",icon:"size-5",label:"text-lg leading-7",gap:"gap-3.5",helper:"text-sm"}},Wd={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Kd={filled:{primary:"bg-primary-600 text-neutral-white border-primary-600 dark:bg-primary-500 dark:border-primary-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-secondary-600 text-neutral-white border-secondary-600 dark:bg-secondary-500 dark:border-secondary-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-error-600 text-neutral-white border-error-600 dark:bg-error-500 dark:border-error-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-success-600 text-neutral-white border-success-600 dark:bg-success-500 dark:border-success-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-warning-500 text-neutral-950 border-warning-500 dark:bg-warning-400 dark:border-warning-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-info-600 text-neutral-white border-info-600 dark:bg-info-500 dark:border-info-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-neutral-800 text-neutral-white border-neutral-800 dark:bg-neutral-200 dark:text-neutral-900 dark:border-neutral-200 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"},outline:{primary:"bg-transparent text-primary-600 border-2 border-primary-600 hover:bg-primary-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-transparent text-secondary-600 border-2 border-secondary-600 hover:bg-secondary-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-transparent text-error-600 border-2 border-error-600 hover:bg-error-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-transparent text-success-600 border-2 border-success-600 hover:bg-success-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-transparent text-warning-700 border-2 border-warning-500 hover:bg-warning-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-transparent text-info-600 border-2 border-info-600 hover:bg-info-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-transparent text-neutral-800 border-2 border-neutral-800 hover:bg-neutral-100/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"},soft:{primary:"bg-primary-100 text-primary-800 border-primary-300 hover:bg-primary-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-secondary-100 text-secondary-800 border-secondary-300 hover:bg-secondary-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-error-100 text-error-800 border-error-300 hover:bg-error-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-success-100 text-success-800 border-success-300 hover:bg-success-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-warning-100 text-warning-900 border-warning-300 hover:bg-warning-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-info-100 text-info-800 border-info-300 hover:bg-info-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-neutral-100 text-neutral-800 border-neutral-300 hover:bg-neutral-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"}},_d={horizontal:"flex flex-row flex-wrap gap-4 items-center",vertical:"flex flex-col gap-2.5"},Xd={xs:"sm",sm:"sm",md:"md",lg:"md",xl:"lg"};var Kc=require("react/jsx-runtime");function Gn({width:e=14,height:t=14,className:r="",...n}){return(0,Kc.jsx)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:(0,Kc.jsx)("polyline",{points:"20 6 9 17 4 12"})})}var _c=require("react/jsx-runtime");function ja({width:e=14,height:t=14,className:r="",...n}){return(0,_c.jsx)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:(0,_c.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})}var Xt=require("react/jsx-runtime");function Jr({size:e="md",variant:t="filled",color:r="primary",radius:n,config:o,label:i,children:a,helperText:s,errorMessage:l,labelPlacement:f="right",icon:c,indeterminateIcon:w,wrapperClassName:p="",boxClassName:m="",labelClassName:v="",helperClassName:x="",className:h="",checked:k,defaultChecked:T,disabled:y=!1,readOnly:d=!1,onChange:u,value:g,id:b,name:S,ref:R,...D}){let{isRequired:P=!1,isInvalid:I=!1,isLoading:E=!1,showSpinner:N=!1,indeterminate:M=!1}=o??{},z=i||a,H=(0,cl.useId)(),V=b||H,Y=`${V}-helper`,$=!!(I??!!l),F=k!==void 0,[G,A]=(0,cl.useState)(T??!1),j=F?k:G,B=Z=>{y||d||E||(F||A(Z.target.checked),u?.(Z))},X=C(e,ll,"md"),le=C(n,Wd,"md"),ne=j||M,ue=C(t==="other"?"filled":t,Kd,"filled"),ie;t==="other"?ie="":ne?ie=C(r,ue,"primary"):ie="bg-neutral-white border-neutral-300 hover:border-neutral-400 dark:bg-neutral-900 dark:border-neutral-700 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",$&&(ie=ne?C("error",ue,"primary"):"bg-neutral-white border-error-500 hover:border-error-600 text-error-600 dark:bg-neutral-900 dark:border-error-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500");let Q=["inline-flex items-center justify-center shrink-0 border transition-all duration-150 select-none",X.box,le,ie,!y&&!d&&!E?"active:scale-95":"",m].filter(Boolean).join(" "),q=["select-none font-medium text-neutral-900 dark:text-neutral-100 transition-colors",X.label,y?"opacity-60":"",v].filter(Boolean).join(" "),ge=["group inline-flex relative",f==="left"?"flex-row-reverse justify-between":"flex-row",X.gap,y?"opacity-50":"cursor-pointer",p,h].filter(Boolean).join(" "),ke=()=>E&&N?(0,Xt.jsx)("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${X.icon}`,"aria-hidden":"true",children:(0,Xt.jsx)(De,{className:"size-full animate-spin"})}):M?(0,Xt.jsx)("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${X.icon}`,"aria-hidden":"true",children:w||(0,Xt.jsx)(ja,{className:"size-full"})}):j?(0,Xt.jsx)("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${X.icon}`,"aria-hidden":"true",children:c||(0,Xt.jsx)(Gn,{className:"size-full"})}):null,L=!!z,te=Z=>{(y||d||E)&&Z.preventDefault()};return(0,Xt.jsxs)("div",{className:`inline-flex flex-col ${h}`.trim(),children:[(0,Xt.jsxs)("label",{className:ge,onClick:te,children:[(0,Xt.jsx)("input",{ref:R,type:"checkbox",id:V,name:S,value:g,checked:j,disabled:y||E,readOnly:d,required:P,"aria-checked":M?"mixed":j,"aria-invalid":$,"aria-required":P,"aria-busy":E,"aria-disabled":y||E,"aria-describedby":l||s?Y:void 0,onChange:B,className:"sr-only peer",...D}),(0,Xt.jsx)("span",{className:Q,"aria-hidden":"true",children:ke()}),L&&(0,Xt.jsxs)("span",{className:q,children:[z,P&&(0,Xt.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})]}),(0,Xt.jsx)(Le,{id:Y,helperText:s,errorMessage:l,sizeClassName:X.helper,className:x})]})}var yr=require("react");var lt={BASE:0,STICKY:10,DROPDOWN:50,POPOVER:50,SELECT:50,PICKER:50,TOOLTIP:60,SELECT_FILTER:100,MAX:99999};var jn=require("react");function go(e,t=300){let r=(0,jn.useRef)(e),n=(0,jn.useRef)(null);(0,jn.useEffect)(()=>{r.current=e},[e]);let o=(0,jn.useCallback)(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return(0,jn.useEffect)(()=>o,[o]),{debounced:(0,jn.useCallback)((...a)=>{o(),n.current=setTimeout(()=>{r.current(...a)},t)},[o,t]),cancel:o}}var Ua=require("react/jsx-runtime");function Ip({width:e=16,height:t=16,className:r="",...n}){return(0,Ua.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Ua.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,Ua.jsx)("line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65"})]})}var mo=Ip;var vr=require("react/jsx-runtime"),Mp=[],Fp=[];function bo({value:e,defaultValue:t=Fp,onChange:r,size:n="md",color:o="primary",variant:i="filled",radius:a,disabled:s=!1,label:l,helperText:f,errorMessage:c,orientation:w="vertical",labelPlacement:p="right",className:m="",wrapperClassName:v="",labelClassName:x="",helperClassName:h="",options:k=Mp,config:T,searchMode:y="client",searchPlaceholder:d="T\xECm ki\u1EBFm...",searchValue:u,defaultSearchValue:g="",onSearchChange:b,searchClassName:S="",searchField:R="label",filterFn:D,onSearch:P,debounceMs:I=300,emptyText:E="Kh\xF4ng t\xECm th\u1EA5y k\u1EBFt qu\u1EA3",children:N,ref:M,...z}){let{isRequired:H=!1,isInvalid:V,isLoading:Y=!1,showSpinner:$=!1,isReadOnly:F=!1,searchable:G=!1,preserveSelected:A=!0,isSearching:j}=T??{},B=(0,yr.useId)(),X=`${B}-label`,le=`${B}-helper`,ne=`${B}-search`,ue=e!==void 0,[ie,Q]=(0,yr.useState)(t),q=ue?e:ie,ge=!!(V??!!c),ke=u!==void 0,[L,te]=(0,yr.useState)(g),Z=ke?u:L,[he,ae]=(0,yr.useState)(null),[ve,Se]=(0,yr.useState)(!1),ye=!!(j??ve),[J,O]=(0,yr.useState)(()=>{let ee=new Map;return k.forEach(U=>{ee.set(String(U.value),U)}),ee}),{debounced:W}=go(async ee=>{if(!(y!=="server"||!P))try{Se(!0);let U=await P(ee);Array.isArray(U)&&ae(U)}catch(U){console.error("Error fetching search options:",U)}finally{Se(!1)}},I),we=ee=>{let U=ee.target.value;ke||te(U),b?.(U),y==="server"&&W(U)},fe=()=>{ke||te(""),b?.(""),y==="server"&&W("")},se=(0,yr.useMemo)(()=>{let ee=Z.trim(),U=y==="server"&&he?he:k;if(!G||!ee)return U;let Ce;if(y==="server"?Ce=U:D?Ce=U.filter(oe=>D(oe,ee)):Ce=co(U,ee,R),!A)return Ce;let $e=new Set(Ce.map(oe=>String(oe.value))),Ee=[];for(let oe of q)if(!$e.has(oe)){let Te=J.get(oe);Te?Ee.push(Te):Ee.push({value:oe,label:oe})}return[...Ee,...Ce]},[G,Z,y,he,k,D,R,A,q,J]),me=(0,yr.useCallback)((ee,U)=>{if(s||F||Y)return;if(U){let Ee=(y==="server"&&he?he:k).find(oe=>String(oe.value)===ee);Ee&&O(oe=>{if(oe.has(ee))return oe;let Te=new Map(oe);return Te.set(ee,Ee),Te})}let Ce;U?Ce=[...q,ee]:Ce=q.filter($e=>$e!==ee),ue||Q(Ce),r?.(Ce)},[s,F,Y,q,ue,r,k,y,he]),Re=C(w,_d,"vertical"),xe=["text-sm font-semibold text-neutral-900 dark:text-neutral-100 mb-1.5 select-none",s?"opacity-60":"",x].filter(Boolean).join(" "),re=C(n,ll,"md"),de=C(n,Xd,"md"),ce=(0,yr.useMemo)(()=>new Set(q.map(String)),[q]);return(0,vr.jsxs)("div",{ref:M,role:"group","aria-labelledby":l?X:void 0,"aria-describedby":c||f?le:void 0,"aria-disabled":s||Y?"true":void 0,"aria-busy":Y||ye?"true":void 0,className:`inline-flex flex-col ${v}`,...z,children:[l&&(0,vr.jsxs)("span",{id:X,className:xe,children:[l,H&&(0,vr.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),G&&(0,vr.jsx)("div",{className:`mb-2.5 ${S}`,children:(0,vr.jsx)(Yt,{id:ne,variant:"outline",size:de,color:o,value:Z,onChange:we,placeholder:d,disabled:s,leftIcon:(0,vr.jsx)(mo,{className:"size-4 text-neutral-400"}),rightIcon:ye?(0,vr.jsx)(De,{className:"size-4 animate-spin text-neutral-400"}):void 0,onClear:fe,"aria-label":typeof l=="string"?`T\xECm ki\u1EBFm ${l}`:"T\xECm ki\u1EBFm",config:{isClearable:!ye,isFullWidth:!0}})}),(0,vr.jsx)("div",{className:`${Re} ${m}`,children:N||(se.length>0?se.map(ee=>{let U=String(ee.value),Ce=ce.has(U);return(0,vr.jsx)(Jr,{value:ee.value,label:ee.label,helperText:ee.description,disabled:s||!!ee.disabled,readOnly:F||!!ee.isReadOnly,size:n,color:o,variant:i,radius:a,labelPlacement:p,checked:Ce,onChange:$e=>me(U,$e.target.checked),config:{indeterminate:ee.indeterminate,isLoading:Y,showSpinner:$,isInvalid:ge,isRequired:H}},ee.value)}):(0,vr.jsx)("div",{className:"py-2 text-xs text-neutral-500 dark:text-neutral-400 italic",children:!Z.trim()&&y==="server"?"Nh\u1EADp t\u1EEB kh\xF3a \u0111\u1EC3 t\xECm ki\u1EBFm...":E}))}),(0,vr.jsx)(Le,{id:le,helperText:f,errorMessage:c,sizeClassName:re.helper,className:h})]})}var pl=require("react");var dl={xs:{box:"size-3.5",dot:"size-1.5",label:"text-xs leading-4",gap:"gap-1.5",helper:"text-[10px]"},sm:{box:"size-4",dot:"size-2",label:"text-sm leading-4",gap:"gap-2",helper:"text-[11px]"},md:{box:"size-5",dot:"size-2.5",label:"text-sm leading-5",gap:"gap-2.5",helper:"text-xs"},lg:{box:"size-6",dot:"size-3",label:"text-base leading-6",gap:"gap-3",helper:"text-xs"},xl:{box:"size-7",dot:"size-3.5",label:"text-lg leading-7",gap:"gap-3.5",helper:"text-sm"}},fl={filled:{primary:"bg-primary-600 text-neutral-white border-primary-600 dark:bg-primary-500 dark:border-primary-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-secondary-600 text-neutral-white border-secondary-600 dark:bg-secondary-500 dark:border-secondary-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-error-600 text-neutral-white border-error-600 dark:bg-error-500 dark:border-error-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-success-600 text-neutral-white border-success-600 dark:bg-success-500 dark:border-success-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-warning-500 text-neutral-950 border-warning-500 dark:bg-warning-400 dark:border-warning-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-info-600 text-neutral-white border-info-600 dark:bg-info-500 dark:border-info-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-neutral-800 text-neutral-white border-neutral-800 dark:bg-neutral-200 dark:text-neutral-900 dark:border-neutral-200 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"},outline:{primary:"bg-transparent text-primary-600 border-2 border-primary-600 hover:bg-primary-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-transparent text-secondary-600 border-2 border-secondary-600 hover:bg-secondary-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-transparent text-error-600 border-2 border-error-600 hover:bg-error-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-transparent text-success-600 border-2 border-success-600 hover:bg-success-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-transparent text-warning-700 border-2 border-warning-500 hover:bg-warning-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-transparent text-info-600 border-2 border-info-600 hover:bg-info-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-transparent text-neutral-800 border-2 border-neutral-800 hover:bg-neutral-100/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"},soft:{primary:"bg-primary-100 text-primary-800 border-primary-300 hover:bg-primary-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-secondary-100 text-secondary-800 border-secondary-300 hover:bg-secondary-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-error-100 text-error-800 border-error-300 hover:bg-error-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-success-100 text-success-800 border-success-300 hover:bg-success-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-warning-100 text-warning-900 border-warning-300 hover:bg-warning-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-info-100 text-info-800 border-info-300 hover:bg-info-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-neutral-100 text-neutral-800 border-neutral-300 hover:bg-neutral-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"}},qd={horizontal:"flex flex-row flex-wrap gap-4 items-center",vertical:"flex flex-col gap-2.5"},Zd={xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"xl"};var Xc=require("react/jsx-runtime");function Ya({className:e}){return(0,Xc.jsx)("svg",{viewBox:"0 0 10 10",className:e,fill:"currentColor","aria-hidden":"true",children:(0,Xc.jsx)("circle",{cx:"5",cy:"5",r:"5"})})}var wr=require("react/jsx-runtime");function Ai({size:e="md",variant:t="filled",color:r="primary",disabled:n=!1,readOnly:o=!1,config:i,labelPlacement:a="right",label:s,helperText:l,errorMessage:f,dotIcon:c,wrapperClassName:w="",boxClassName:p="",labelClassName:m="",helperClassName:v="",className:x="",checked:h,defaultChecked:k=!1,onChange:T,value:y,id:d,name:u,ref:g,...b}){let{isRequired:S=!1,isInvalid:R=!1,isLoading:D=!1}=i??{},P=(0,pl.useId)(),I=d||P,E=`${I}-helper`,N=h!==void 0,[M,z]=(0,pl.useState)(k),H=N?h:M,V=!!(R||f),Y=ie=>{n||o||D||(N||z(ie.target.checked),T?.(ie))},$=C(e,dl,"md"),F=t==="other"?"":C(r,C(t,fl,"filled"),"primary"),G=V?fl[t==="other"?"filled":t]?.error||fl.filled.error:H?F:"bg-neutral-white border-neutral-300 hover:border-neutral-400 dark:bg-neutral-900 dark:border-neutral-700 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",A=["inline-flex items-center justify-center shrink-0 border rounded-full transition-all duration-150 select-none",$.box,G,!n&&!o&&!D?"active:scale-95":"",p].filter(Boolean).join(" "),j=["select-none font-medium text-neutral-900 dark:text-neutral-100 transition-colors",$.label,n?"opacity-60":"",m].filter(Boolean).join(" "),B=["group inline-flex relative",a==="left"?"flex-row-reverse justify-between":"flex-row",$.gap,n?"cursor-not-allowed opacity-60":"cursor-pointer",w,x].filter(Boolean).join(" "),X=()=>D?(0,wr.jsx)("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${$.dot}`,"aria-hidden":"true",children:(0,wr.jsx)(De,{className:"size-full animate-spin"})}):H?(0,wr.jsx)("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${$.dot}`,"aria-hidden":"true",children:c||(0,wr.jsx)(Ya,{className:"size-full"})}):null,le=!!s;return(0,wr.jsxs)("div",{className:"inline-flex flex-col",children:[(0,wr.jsxs)("label",{className:B,onClick:ie=>{(n||o||D)&&ie.preventDefault()},children:[(0,wr.jsx)("input",{ref:g,type:"radio",id:I,name:u,value:y,checked:H,disabled:n||D,readOnly:o,required:S,"aria-busy":D,"aria-disabled":n||D,"aria-describedby":f||l?E:void 0,onChange:Y,onClick:ie=>{if(n||o||D){ie.preventDefault();return}b.onClick?.(ie)},className:"sr-only peer",...b}),(0,wr.jsx)("span",{className:A,"aria-hidden":"true",children:X()}),le&&(0,wr.jsxs)("span",{className:j,children:[s,S&&(0,wr.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})]}),(0,wr.jsx)(Le,{id:E,helperText:l,errorMessage:f,sizeClassName:$.helper,className:v})]})}var kr=require("react");var Cr=require("react/jsx-runtime"),Ep=[];function gl({options:e=Ep,value:t,defaultValue:r=null,onChange:n,size:o="md",color:i="primary",variant:a="filled",disabled:s=!1,label:l,helperText:f,errorMessage:c,orientation:w="vertical",labelPlacement:p="right",className:m="",wrapperClassName:v="",labelClassName:x="",helperClassName:h="",config:k,searchPlaceholder:T="T\xECm ki\u1EBFm...",searchValue:y,onSearchChange:d,searchMode:u="client",searchField:g="label",filterFn:b,onSearch:S,debounceMs:R=300,emptyText:D="Kh\xF4ng t\xECm th\u1EA5y k\u1EBFt qu\u1EA3",searchClassName:P="",searchInputSize:I,ref:E,...N}){let{isRequired:M=!1,isInvalid:z,isLoading:H=!1,isReadOnly:V=!1,searchable:Y=!1,preserveSelected:$=!0,isSearching:F}=k??{},G=(0,kr.useId)(),A=`${G}-label`,j=`${G}-helper`,B=`${G}-search`,X=(0,kr.useId)(),le=t!==void 0,[ne,ue]=(0,kr.useState)(r??null),ie=le?t:ne,Q=!!(z||c),q=y!==void 0,[ge,ke]=(0,kr.useState)(""),L=q?y:ge,[te,Z]=(0,kr.useState)(!1),he=F??te,[ae,ve]=(0,kr.useState)(null),[Se,ye]=(0,kr.useState)(()=>{let re=new Map;return e.forEach(de=>{re.set(String(de.value),de)}),re}),{debounced:J}=go(async re=>{if(!(u!=="server"||!S))try{Z(!0);let de=await S(re);Array.isArray(de)&&ve(de)}catch(de){console.error("Error fetching radio search options:",de)}finally{Z(!1)}},R),O=re=>{let de=re.target.value;q||ke(de),d?.(de),u==="server"&&J(de)},W=()=>{q||ke(""),d?.(""),u==="server"&&ve(null)},we=(0,kr.useMemo)(()=>{let re=L.trim(),de=u==="server"&&ae?ae:e;if(!Y||!re)return de;let ce;if(u==="server"?ce=de:b?ce=de.filter(Ce=>b(Ce,re)):ce=co(de,re,g),!$||ie===null||ie===void 0)return ce;let ee=String(ie);if(!ce.some(Ce=>String(Ce.value)===ee)){let Ce=Se.get(ee);return Ce?[Ce,...ce]:[{value:ee,label:ee},...ce]}return ce},[Y,L,u,ae,e,b,g,$,ie,Se]),fe=(0,kr.useCallback)(re=>{if(s||V||H)return;let ce=(u==="server"&&ae?ae:e).find(ee=>String(ee.value)===re);ce&&ye(ee=>{if(ee.has(re))return ee;let U=new Map(ee);return U.set(re,ce),U}),le||ue(re),n?.(re)},[s,V,H,le,n,e,u,ae]),se=C(w,qd,"vertical"),me=C(o,dl,"md"),Re=I??C(o,Zd,"md"),xe=["text-sm font-semibold text-neutral-900 dark:text-neutral-100 mb-1.5 select-none",s?"opacity-60":"",x].filter(Boolean).join(" ");return(0,Cr.jsxs)("div",{ref:E,role:"radiogroup","aria-labelledby":l?A:void 0,"aria-describedby":c||f?j:void 0,"aria-errormessage":c?j:void 0,"aria-orientation":w,"aria-required":M?"true":void 0,"aria-invalid":Q?"true":void 0,"aria-disabled":s?"true":void 0,"aria-readonly":V?"true":void 0,"aria-busy":H?"true":void 0,className:`inline-flex flex-col ${v}`,...N,children:[l&&(0,Cr.jsxs)("span",{id:A,className:xe,children:[l,M&&(0,Cr.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),Y&&(0,Cr.jsx)("div",{className:`mb-2.5 ${P}`,children:(0,Cr.jsx)(Yt,{id:B,variant:"outline",size:Re,color:i,value:L,onChange:O,placeholder:T,disabled:s||H,leftIcon:(0,Cr.jsx)(mo,{className:"size-4 text-neutral-400"}),rightIcon:he?(0,Cr.jsx)(De,{className:"size-4 animate-spin text-neutral-400"}):void 0,onClear:W,"aria-label":typeof l=="string"?`T\xECm ki\u1EBFm ${l}`:"T\xECm ki\u1EBFm",config:{isClearable:!he,isFullWidth:!0}})}),(0,Cr.jsx)("div",{className:`${se} ${m}`,children:we.length>0?we.map(re=>{let de=String(re.value),ce=ie!=null&&String(ie)===de;return(0,Cr.jsx)(Ai,{name:X,value:re.value,checked:ce,onChange:()=>fe(de),label:re.label,helperText:re.description,disabled:s||!!re.disabled,readOnly:V||!!re.isReadOnly,size:o,color:i,variant:a,labelPlacement:p,config:{isLoading:H,isInvalid:Q,isRequired:M}},re.value)}):(0,Cr.jsx)("div",{className:"py-3 text-center text-sm text-neutral-400 select-none",children:!L.trim()&&u==="server"?"Nh\u1EADp t\u1EEB kh\xF3a \u0111\u1EC3 t\xECm ki\u1EBFm s\u1EA3n ph\u1EA9m...":D})}),(0,Cr.jsx)(Le,{id:j,helperText:f,errorMessage:c,sizeClassName:me.helper,className:h})]})}var Oi=require("react"),e0=require("@floating-ui/react");var Jd={xs:{track:"w-7 h-4 p-0.5",thumb:"size-3",translate:"translate-x-3",icon:"size-2",content:"text-[9px]",label:"text-xs leading-4",gap:"gap-1.5",helper:"text-[10px]"},sm:{track:"w-9 h-5 p-0.5",thumb:"size-4",translate:"translate-x-4",icon:"size-2.5",content:"text-[10px]",label:"text-sm leading-4",gap:"gap-2",helper:"text-[11px]"},md:{track:"w-11 h-6 p-0.5",thumb:"size-5",translate:"translate-x-5",icon:"size-3",content:"text-xs",label:"text-sm leading-5",gap:"gap-2.5",helper:"text-xs"},lg:{track:"w-13 h-7 p-0.5",thumb:"size-6",translate:"translate-x-6",icon:"size-3.5",content:"text-xs",label:"text-base leading-6",gap:"gap-3",helper:"text-xs"},xl:{track:"w-16 h-9 p-1",thumb:"size-7",translate:"translate-x-7",icon:"size-4",content:"text-sm",label:"text-lg leading-7",gap:"gap-3.5",helper:"text-sm"}},qc={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Qd={filled:{primary:{checked:{track:"bg-primary-600 dark:bg-primary-500 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-neutral-white text-primary-600 dark:text-primary-500 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}},secondary:{checked:{track:"bg-secondary-600 dark:bg-secondary-500 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-neutral-white text-secondary-600 dark:text-secondary-500 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}},error:{checked:{track:"bg-error-600 dark:bg-error-500 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-neutral-white text-error-600 dark:text-error-500 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}},success:{checked:{track:"bg-success-600 dark:bg-success-500 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-neutral-white text-success-600 dark:text-success-500 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}},warning:{checked:{track:"bg-warning-500 dark:bg-warning-400 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-neutral-white text-warning-500 dark:bg-neutral-900 dark:text-warning-400 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}},info:{checked:{track:"bg-info-600 dark:bg-info-500 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-neutral-white text-info-600 dark:text-info-500 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}},neutral:{checked:{track:"bg-neutral-800 dark:bg-neutral-200 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-white text-neutral-800 dark:bg-neutral-900 dark:text-neutral-200 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}}},outline:{primary:{checked:{track:"bg-primary-50 dark:bg-primary-950/40 border-2 border-primary-600 dark:border-primary-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-primary-600 dark:bg-primary-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}},secondary:{checked:{track:"bg-secondary-50 dark:bg-secondary-950/40 border-2 border-secondary-600 dark:border-secondary-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-secondary-600 dark:bg-secondary-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}},error:{checked:{track:"bg-error-50 dark:bg-error-950/40 border-2 border-error-600 dark:border-error-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-error-600 dark:bg-error-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}},success:{checked:{track:"bg-success-50 dark:bg-success-950/40 border-2 border-success-600 dark:border-success-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-success-600 dark:bg-success-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}},warning:{checked:{track:"bg-warning-50 dark:bg-warning-950/40 border-2 border-warning-500 dark:border-warning-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-warning-500 dark:bg-warning-400 text-neutral-950 shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}},info:{checked:{track:"bg-info-50 dark:bg-info-950/40 border-2 border-info-600 dark:border-info-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-info-600 dark:bg-info-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}},neutral:{checked:{track:"bg-neutral-100 dark:bg-neutral-800 border-2 border-neutral-800 dark:border-neutral-200 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-800 dark:bg-neutral-200 text-neutral-white dark:text-neutral-900 shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}}},soft:{primary:{checked:{track:"bg-primary-100 dark:bg-primary-900/50 border border-primary-200 dark:border-primary-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-primary-600 dark:bg-primary-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}},secondary:{checked:{track:"bg-secondary-100 dark:bg-secondary-900/50 border border-secondary-200 dark:border-secondary-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-secondary-600 dark:bg-secondary-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}},error:{checked:{track:"bg-error-100 dark:bg-error-900/50 border border-error-200 dark:border-error-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-error-600 dark:bg-error-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}},success:{checked:{track:"bg-success-100 dark:bg-success-900/50 border border-success-200 dark:border-success-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-success-600 dark:bg-success-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}},warning:{checked:{track:"bg-warning-100 dark:bg-warning-900/50 border border-warning-200 dark:border-warning-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-warning-500 dark:bg-warning-400 text-neutral-950 shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}},info:{checked:{track:"bg-info-100 dark:bg-info-900/50 border border-info-200 dark:border-info-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-info-600 dark:bg-info-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}},neutral:{checked:{track:"bg-neutral-200 dark:bg-neutral-700 border border-neutral-300 dark:border-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-800 dark:bg-neutral-200 text-neutral-white dark:text-neutral-900 shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}}}};var qt=require("react/jsx-runtime");function ml({size:e,variant:t,color:r,radius:n,thumbRadius:o,config:i,label:a,helperText:s,errorMessage:l,labelPlacement:f="right",thumbIcon:c,startContent:w,endContent:p,wrapperClassName:m="",trackClassName:v="",thumbClassName:x="",labelClassName:h="",helperClassName:k="",className:T="",checked:y,defaultChecked:d,disabled:u=!1,readOnly:g=!1,onChange:b,onClick:S,value:R,id:D,name:P,ref:I,...E}){let{isRequired:N=!1,isInvalid:M=!1,isLoading:z=!1,showSpinner:H=!1}=i??{},V=(0,Oi.useId)(),Y=D||V,$=`${Y}-error-helper`,F=(0,Oi.useRef)(null),G=(0,e0.useMergeRefs)([F,I]),A=y!==void 0,[j,B]=(0,Oi.useState)(d??!1),X=A?!!y:j,le=W=>{u||g||z||(A||B(W.target.checked),b?.(W))},ne=W=>{if(u||g||z){W.preventDefault();return}S?.(W)},ue=W=>{(u||g||z)&&W.preventDefault()},ie=!!(M||l),Q=ie?"error":r,q=C(e,Jd,"md"),ge=C(n,qc,"full"),ke=C(o,qc,"full"),L=t==="other"?void 0:C(Q,C(t,Qd,"filled"),"primary"),te=L?X?L.checked.track:L.unchecked.track:"",Z=L?X?L.checked.thumb:L.unchecked.thumb:"",he=["relative inline-flex items-center shrink-0 border box-border transition-colors duration-200 ease-in-out cursor-pointer select-none",q.track,ge,te,u?"opacity-50":"",v].filter(Boolean).join(" "),ae=["pointer-events-none inline-flex items-center justify-center transition-transform duration-200 ease-in-out select-none",q.thumb,ke,Z,X?q.translate:"translate-x-0",x].filter(Boolean).join(" "),ve=["select-none font-medium text-neutral-900 dark:text-neutral-100 transition-colors",q.label,u?"opacity-50":"",h].filter(Boolean).join(" "),ye=["group inline-flex items-center relative",f==="left"?"flex-row-reverse justify-between":"flex-row",q.gap,u?"cursor-not-allowed opacity-60":"cursor-pointer",m,T].filter(Boolean).join(" "),J=()=>z&&H?(0,qt.jsx)("span",{className:`inline-flex items-center justify-center ${q.icon}`,"aria-hidden":"true",children:(0,qt.jsx)(De,{className:"size-full animate-spin"})}):typeof c=="function"?c({isChecked:X,className:q.icon}):c?(0,qt.jsx)("span",{className:`inline-flex items-center justify-center ${q.icon}`,"aria-hidden":"true",children:c}):null,O=()=>a?(0,qt.jsxs)("span",{className:ve,children:[a,N&&(0,qt.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):null;return(0,qt.jsxs)("div",{className:"inline-flex flex-col",children:[(0,qt.jsxs)("label",{className:ye,onClick:ue,children:[(0,qt.jsx)("input",{ref:G,type:"checkbox",role:"switch",id:Y,name:P,value:R,checked:X,onChange:le,onClick:ne,disabled:u||z,readOnly:g,required:N,"aria-checked":X,"aria-invalid":ie,"aria-required":N,"aria-describedby":l||s?$:void 0,"aria-errormessage":l?$:void 0,"aria-busy":z,"aria-disabled":u||z,className:"sr-only peer",...E}),(0,qt.jsxs)("span",{className:he,"aria-hidden":"true",children:[w&&(0,qt.jsx)("span",{className:`absolute left-1.5 inline-flex items-center justify-center select-none font-medium transition-opacity duration-200 ${q.content} ${X?"opacity-100":"opacity-0"}`,children:w}),(0,qt.jsx)("span",{className:ae,children:J()}),p&&(0,qt.jsx)("span",{className:`absolute right-1.5 inline-flex items-center justify-center select-none font-medium transition-opacity duration-200 ${q.content} ${X?"opacity-0":"opacity-100"}`,children:p})]}),O()]}),(0,qt.jsx)(Le,{id:$,helperText:s,errorMessage:l,sizeClassName:q.helper,className:k})]})}var Zc=require("react/jsx-runtime");function yt({width:e=16,height:t=16,className:r="",...n}){return(0,Zc.jsx)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:(0,Zc.jsx)("path",{d:"m6 9 6 6 6-6"})})}var Jc=require("react/jsx-runtime");function Sr({width:e=16,height:t=16,className:r="",...n}){return(0,Jc.jsx)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:(0,Jc.jsx)("path",{d:"m15 18-6-6 6-6"})})}var Qc=require("react/jsx-runtime");function Tr({width:e=16,height:t=16,className:r="",...n}){return(0,Qc.jsx)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:(0,Qc.jsx)("path",{d:"m9 18 6-6-6-6"})})}var Wo=require("react/jsx-runtime");function eu({width:e=16,height:t=16,className:r="",...n}){return(0,Wo.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Wo.jsx)("path",{d:"M8 2v4"}),(0,Wo.jsx)("path",{d:"M16 2v4"}),(0,Wo.jsx)("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),(0,Wo.jsx)("path",{d:"M3 10h18"})]})}var Wa=require("react/jsx-runtime");function tu({width:e=16,height:t=16,className:r="",...n}){return(0,Wa.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Wa.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,Wa.jsx)("polyline",{points:"12 6 12 12 16 14"})]})}var Ka=require("react/jsx-runtime");function Un({width:e=16,height:t=16,className:r="",...n}){return(0,Ka.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Ka.jsx)("path",{d:"m11 17-5-5 5-5"}),(0,Ka.jsx)("path",{d:"m18 17-5-5 5-5"})]})}var _a=require("react/jsx-runtime");function Yn({width:e=16,height:t=16,className:r="",...n}){return(0,_a.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,_a.jsx)("path",{d:"m6 17 5-5-5-5"}),(0,_a.jsx)("path",{d:"m13 17 5-5-5-5"})]})}var lr=require("react/jsx-runtime");function $p(e){return(0,lr.jsxs)("svg",{viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[(0,lr.jsx)("ellipse",{cx:"48",cy:"80",rx:"36",ry:"8",className:"fill-neutral-200/60 dark:fill-neutral-800/60"}),(0,lr.jsx)("ellipse",{cx:"48",cy:"80",rx:"22",ry:"4.5",className:"fill-neutral-300/50 dark:fill-neutral-700/50"}),(0,lr.jsx)("path",{d:"M24 38L16 32L40 22L48 28L24 38Z",className:"fill-primary-100/80 dark:fill-primary-950/70 stroke-primary-300 dark:stroke-primary-700",strokeWidth:"1.5",strokeLinejoin:"round"}),(0,lr.jsx)("path",{d:"M72 38L80 32L56 22L48 28L72 38Z",className:"fill-primary-100/80 dark:fill-primary-950/70 stroke-primary-300 dark:stroke-primary-700",strokeWidth:"1.5",strokeLinejoin:"round"}),(0,lr.jsx)("path",{d:"M24 38L48 28V52L24 62V38Z",className:"fill-primary-300/80 dark:fill-primary-900/80 stroke-primary-300/40 dark:stroke-primary-700/40",strokeWidth:"1",strokeLinejoin:"round"}),(0,lr.jsx)("path",{d:"M72 38L48 28V52L72 62V38Z",className:"fill-primary-300/60 dark:fill-primary-900/60 stroke-primary-300/40 dark:stroke-primary-700/40",strokeWidth:"1",strokeLinejoin:"round"}),(0,lr.jsx)("path",{d:"M48 52L72 62L48 72L24 62L48 52Z",className:"fill-primary-400/40 dark:fill-primary-950/90 stroke-primary-400/30 dark:stroke-primary-700/30",strokeWidth:"1",strokeLinejoin:"round"}),(0,lr.jsx)("path",{d:"M24 38V64L48 76V50L24 38Z",className:"fill-primary-100 dark:fill-primary-900/50 stroke-primary-400 dark:stroke-primary-600",strokeWidth:"1.8",strokeLinejoin:"round"}),(0,lr.jsx)("path",{d:"M72 38V64L48 76V50L72 38Z",className:"fill-primary-200/90 dark:fill-primary-800/60 stroke-primary-400 dark:stroke-primary-600",strokeWidth:"1.8",strokeLinejoin:"round"}),(0,lr.jsx)("path",{d:"M24 38L48 50L38 60L14 48L24 38Z",className:"fill-primary-50 dark:fill-primary-950/90 stroke-primary-300 dark:stroke-primary-700",strokeWidth:"1.5",strokeLinejoin:"round"}),(0,lr.jsx)("path",{d:"M72 38L48 50L58 60L82 48L72 38Z",className:"fill-primary-100/90 dark:fill-primary-900/80 stroke-primary-300 dark:stroke-primary-700",strokeWidth:"1.5",strokeLinejoin:"round"})]})}var bl=$p;var Rr=require("react/jsx-runtime");function Lp(e){return(0,Rr.jsxs)("svg",{viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[(0,Rr.jsx)("ellipse",{cx:"60",cy:"100",rx:"42",ry:"10",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),(0,Rr.jsx)("rect",{x:"32",y:"24",width:"44",height:"56",rx:"6",className:"fill-white dark:fill-neutral-900 stroke-neutral-300 dark:stroke-neutral-700",strokeWidth:"2"}),(0,Rr.jsx)("line",{x1:"42",y1:"36",x2:"66",y2:"36",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2.5",strokeLinecap:"round"}),(0,Rr.jsx)("line",{x1:"42",y1:"44",x2:"60",y2:"44",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2.5",strokeLinecap:"round"}),(0,Rr.jsx)("line",{x1:"42",y1:"52",x2:"52",y2:"52",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2.5",strokeLinecap:"round"}),(0,Rr.jsxs)("g",{transform:"translate(48, 38)",children:[(0,Rr.jsx)("circle",{cx:"28",cy:"28",r:"20",className:"fill-primary-50/80 dark:fill-primary-950/70 stroke-primary-500",strokeWidth:"3"}),(0,Rr.jsx)("path",{d:"M18 20A14 14 0 0 1 34 16",className:"stroke-primary-300",strokeWidth:"2",strokeLinecap:"round"}),(0,Rr.jsx)("path",{d:"M24 24L32 32M32 24L24 32",className:"stroke-neutral-400 dark:stroke-neutral-500",strokeWidth:"2",strokeLinecap:"round"}),(0,Rr.jsx)("path",{d:"M42 42L58 58",className:"stroke-primary-700 dark:stroke-primary-400",strokeWidth:"5",strokeLinecap:"round"})]})]})}var hl=Lp;var hn=require("react/jsx-runtime");function Bp(e){return(0,hn.jsxs)("svg",{viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[(0,hn.jsx)("ellipse",{cx:"60",cy:"100",rx:"42",ry:"10",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),(0,hn.jsx)("circle",{cx:"60",cy:"52",r:"32",className:"fill-error-50 dark:fill-error-950/40 stroke-error-200 dark:stroke-error-800",strokeWidth:"2"}),(0,hn.jsx)("path",{d:"M60 30L78 64H42L60 30Z",className:"fill-error-100 dark:fill-error-900/60 stroke-error-500",strokeWidth:"2.5",strokeLinejoin:"round"}),(0,hn.jsx)("line",{x1:"60",y1:"42",x2:"60",y2:"52",className:"stroke-error-600",strokeWidth:"2.5",strokeLinecap:"round"}),(0,hn.jsx)("circle",{cx:"60",cy:"58",r:"1.5",className:"fill-error-600"}),(0,hn.jsx)("path",{d:"M22 66L32 60",className:"stroke-neutral-300 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"3 3"}),(0,hn.jsx)("path",{d:"M98 66L88 60",className:"stroke-neutral-300 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"3 3"})]})}var xl=Bp;var Wn=require("react/jsx-runtime");function Hp(e){return(0,Wn.jsxs)("svg",{viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[(0,Wn.jsx)("ellipse",{cx:"60",cy:"98",rx:"42",ry:"10",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),(0,Wn.jsx)("path",{d:"M24 40C24 36.69 26.69 34 30 34H48L56 42H90C93.31 42 96 44.69 96 48V78C96 81.31 93.31 84 90 84H30C26.69 84 24 81.31 24 78V40Z",className:"fill-primary-200/70 dark:fill-primary-900/60 stroke-primary-300 dark:stroke-primary-700",strokeWidth:"2"}),(0,Wn.jsx)("rect",{x:"36",y:"30",width:"48",height:"40",rx:"4",className:"fill-white dark:fill-neutral-900 stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"1.5"}),(0,Wn.jsx)("line",{x1:"44",y1:"40",x2:"68",y2:"40",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round"}),(0,Wn.jsx)("line",{x1:"44",y1:"48",x2:"60",y2:"48",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round"}),(0,Wn.jsx)("path",{d:"M24 52H96V80C96 83.31 93.31 86 90 86H30C26.69 86 24 83.31 24 80V52Z",className:"fill-primary-300/80 dark:fill-primary-800/70 stroke-primary-400 dark:stroke-primary-600",strokeWidth:"2"})]})}var vl=Hp;var Ko=require("react/jsx-runtime");function Vp(e){return(0,Ko.jsxs)("svg",{viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[(0,Ko.jsx)("ellipse",{cx:"32",cy:"54",rx:"24",ry:"5",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),(0,Ko.jsx)("path",{d:"M12 24L32 14L52 24L32 34L12 24Z",className:"fill-neutral-100 dark:fill-neutral-800 stroke-neutral-400 dark:stroke-neutral-500",strokeWidth:"2",strokeLinejoin:"round"}),(0,Ko.jsx)("path",{d:"M12 24V40L32 50V34L12 24Z",className:"fill-neutral-200 dark:fill-neutral-700 stroke-neutral-400 dark:stroke-neutral-500",strokeWidth:"2",strokeLinejoin:"round"}),(0,Ko.jsx)("path",{d:"M52 24V40L32 50V34L52 24Z",className:"fill-neutral-300 dark:fill-neutral-600 stroke-neutral-400 dark:stroke-neutral-500",strokeWidth:"2",strokeLinejoin:"round"})]})}var yl=Vp;var Gi=require("react/jsx-runtime");function Dr({width:e=20,height:t=20,className:r="",...n}){return(0,Gi.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Gi.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,Gi.jsx)("path",{d:"M12 16v-4"}),(0,Gi.jsx)("path",{d:"M12 8h.01"})]})}var Xa=require("react/jsx-runtime");function _o({width:e=20,height:t=20,className:r="",...n}){return(0,Xa.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Xa.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,Xa.jsx)("path",{d:"m9 12 2 2 4-4"})]})}var ji=require("react/jsx-runtime");function Xo({width:e=20,height:t=20,className:r="",...n}){return(0,ji.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,ji.jsx)("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"}),(0,ji.jsx)("path",{d:"M12 9v4"}),(0,ji.jsx)("path",{d:"M12 17h.01"})]})}var Ui=require("react/jsx-runtime");function qo({width:e=20,height:t=20,className:r="",...n}){return(0,Ui.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Ui.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,Ui.jsx)("path",{d:"M12 8v4"}),(0,Ui.jsx)("path",{d:"M12 16h.01"})]})}var Zo=require("react/jsx-runtime");function Jo({width:e=20,height:t=20,className:r="",...n}){return(0,Zo.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Zo.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,Zo.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),(0,Zo.jsx)("line",{x1:"11",y1:"8",x2:"11",y2:"14"}),(0,Zo.jsx)("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})}var Yi=require("react/jsx-runtime");function Qo({width:e=20,height:t=20,className:r="",...n}){return(0,Yi.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Yi.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,Yi.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),(0,Yi.jsx)("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})}var qa=require("react/jsx-runtime");function Kn({width:e=20,height:t=20,className:r="",...n}){return(0,qa.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,qa.jsx)("path",{d:"M21 2v6h-6"}),(0,qa.jsx)("path",{d:"M21 8A10 10 0 1 0 22 13"})]})}var Za=require("react/jsx-runtime");function ei({width:e=20,height:t=20,className:r="",...n}){return(0,Za.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Za.jsx)("path",{d:"M3 2v6h6"}),(0,Za.jsx)("path",{d:"M3 8a10 10 0 1 1-1 5"})]})}var _n=require("react/jsx-runtime");function ti({width:e=20,height:t=20,className:r="",...n}){return(0,_n.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,_n.jsx)("path",{d:"m3 7 5 5-5 5V7z"}),(0,_n.jsx)("path",{d:"m21 7-5 5 5 5V7z"}),(0,_n.jsx)("path",{d:"M12 20v2"}),(0,_n.jsx)("path",{d:"M12 14v2"}),(0,_n.jsx)("path",{d:"M12 8v2"}),(0,_n.jsx)("path",{d:"M12 2v2"})]})}var Wi=require("react/jsx-runtime");function Qr({width:e=20,height:t=20,className:r="",...n}){return(0,Wi.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Wi.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,Wi.jsx)("polyline",{points:"7 10 12 15 17 10"}),(0,Wi.jsx)("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}var Ja=require("react/jsx-runtime");function cr({width:e=20,height:t=20,className:r="",...n}){return(0,Ja.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Ja.jsx)("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),(0,Ja.jsx)("path",{d:"M3 3v5h5"})]})}var Ki=require("react/jsx-runtime");function Qa({width:e=20,height:t=20,className:r="",...n}){return(0,Ki.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Ki.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),(0,Ki.jsx)("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),(0,Ki.jsx)("polyline",{points:"21 15 16 10 5 21"})]})}var es=require("react/jsx-runtime");function ts({width:e=16,height:t=16,className:r="",...n}){return(0,es.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,es.jsx)("path",{d:"M6 2v14a2 2 0 0 0 2 2h14"}),(0,es.jsx)("path",{d:"M18 22V8a2 2 0 0 0-2-2H2"})]})}var ri=require("react/jsx-runtime");function Br({width:e=16,height:t=16,className:r="",...n}){return(0,ri.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,ri.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,ri.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),(0,ri.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,ri.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}var ru=require("react/jsx-runtime");function Zt({width:e=24,height:t=24,className:r="",...n}){return(0,ru.jsx)("svg",{width:e,height:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:r,...n,children:(0,ru.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95C8.08 7.14 9.94 6 12 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11c1.56.1 2.78 1.41 2.78 2.96 0 1.65-1.35 3-3 3M8 13h2.55v3h2.9v-3H16l-4-4z"})})}var ni=require("react/jsx-runtime");function rs({width:e=24,height:t=24,variant:r="solid",className:n="",...o}){return r==="outline"?(0,ni.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:n,...o,children:[(0,ni.jsx)("path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}),(0,ni.jsx)("circle",{cx:"12",cy:"7",r:"4"})]}):(0,ni.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:n,...o,children:(0,ni.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.5 6a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM3.751 20.105a8.25 8.25 0 0 1 16.498 0 .75.75 0 0 1-.437.695A18.683 18.683 0 0 1 12 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 0 1-.437-.695Z"})})}var ns=require("react/jsx-runtime");function os({width:e=16,height:t=16,className:r="",...n}){return(0,ns.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,ns.jsx)("path",{d:"m7 15 5 5 5-5"}),(0,ns.jsx)("path",{d:"m7 9 5-5 5 5"})]})}var is=require("react/jsx-runtime");function as({width:e=16,height:t=16,className:r="",...n}){return(0,is.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,is.jsx)("path",{d:"m5 12 7-7 7 7"}),(0,is.jsx)("path",{d:"M12 19V5"})]})}var ss=require("react/jsx-runtime");function ls({width:e=16,height:t=16,className:r="",...n}){return(0,ss.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,ss.jsx)("path",{d:"M12 5v14"}),(0,ss.jsx)("path",{d:"m19 12-7 7-7-7"})]})}var Hr=require("react/jsx-runtime");function cs({width:e=16,height:t=16,className:r="",...n}){return(0,Hr.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Hr.jsx)("line",{x1:"21",x2:"14",y1:"4",y2:"4"}),(0,Hr.jsx)("line",{x1:"10",x2:"3",y1:"4",y2:"4"}),(0,Hr.jsx)("line",{x1:"21",x2:"12",y1:"12",y2:"12"}),(0,Hr.jsx)("line",{x1:"8",x2:"3",y1:"12",y2:"12"}),(0,Hr.jsx)("line",{x1:"21",x2:"16",y1:"20",y2:"20"}),(0,Hr.jsx)("line",{x1:"12",x2:"3",y1:"20",y2:"20"}),(0,Hr.jsx)("line",{x1:"14",x2:"14",y1:"2",y2:"6"}),(0,Hr.jsx)("line",{x1:"8",x2:"8",y1:"10",y2:"14"}),(0,Hr.jsx)("line",{x1:"16",x2:"16",y1:"18",y2:"22"})]})}var t0={xs:{container:"p-2 gap-2 text-xs",title:"text-xs font-semibold leading-tight",description:"text-[11px] leading-tight",icon:"size-3.5 mt-0.5",closeButton:"size-4 p-0.5 -mr-0.5",closeIcon:"size-3",action:"gap-1.5 text-xs"},sm:{container:"p-2.5 gap-2.5 text-xs",title:"text-sm font-semibold leading-tight",description:"text-xs leading-normal",icon:"size-4 mt-0.5",closeButton:"size-5 p-0.5 -mr-0.5",closeIcon:"size-3.5",action:"gap-1.5 text-xs"},md:{container:"p-3.5 gap-3 text-sm",title:"text-sm font-semibold leading-tight",description:"text-sm leading-normal",icon:"size-5 mt-0.5",closeButton:"size-6 p-1 -mr-1",closeIcon:"size-4",action:"gap-2 text-sm"},lg:{container:"p-4 gap-3.5 text-base",title:"text-base font-semibold leading-snug",description:"text-sm leading-normal",icon:"size-6 mt-0.5",closeButton:"size-7 p-1.5 -mr-1.5",closeIcon:"size-4.5",action:"gap-2.5 text-sm"},xl:{container:"p-5 gap-4 text-lg",title:"text-lg font-semibold leading-snug",description:"text-base leading-normal",icon:"size-7 mt-0.5",closeButton:"size-8 p-1.5 -mr-1.5",closeIcon:"size-5",action:"gap-3 text-base"}},r0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},n0={soft:{primary:"bg-primary-50 text-primary-900 border-2 border-primary-200",secondary:"bg-secondary-50 text-secondary-900 border-2 border-secondary-200",neutral:"bg-neutral-100 text-neutral-900 border-2 border-neutral-200",error:"bg-error-50 text-error-900 border-2 border-error-200",success:"bg-success-50 text-success-900 border-2 border-success-200",warning:"bg-warning-50 text-warning-900 border-2 border-warning-200",info:"bg-info-50 text-info-900 border-2 border-info-200"},filled:{primary:"bg-primary-600 text-white border-2 border-primary-600",secondary:"bg-secondary-600 text-white border-2 border-secondary-600",neutral:"bg-neutral-700 text-white border-2 border-neutral-700",error:"bg-error-600 text-white border-2 border-error-600",success:"bg-success-600 text-white border-2 border-success-600",warning:"bg-warning-500 text-neutral-950 border-2 border-warning-500",info:"bg-info-600 text-white border-2 border-info-600"},outline:{primary:"bg-neutral-white text-primary-700 border-2 border-primary-400",secondary:"bg-neutral-white text-secondary-700 border-2 border-secondary-400",neutral:"bg-neutral-white text-neutral-700 border-2 border-neutral-300",error:"bg-neutral-white text-error-700 border-2 border-error-500",success:"bg-neutral-white text-success-700 border-2 border-success-400",warning:"bg-neutral-white text-warning-800 border-2 border-warning-400",info:"bg-neutral-white text-info-700 border-2 border-info-400"},"accent-left":{primary:"bg-primary-50/70 text-primary-900 border-2 border-primary-200 border-l-4 border-l-primary-500",secondary:"bg-secondary-50/70 text-secondary-900 border-2 border-secondary-200 border-l-4 border-l-secondary-500",neutral:"bg-neutral-50/70 text-neutral-900 border-2 border-neutral-200 border-l-4 border-l-neutral-500",error:"bg-error-50/70 text-error-900 border-2 border-error-200 border-l-4 border-l-error-500",success:"bg-success-50/70 text-success-900 border-2 border-success-200 border-l-4 border-l-success-500",warning:"bg-warning-50/70 text-warning-900 border-2 border-warning-200 border-l-4 border-l-warning-500",info:"bg-info-50/70 text-info-900 border-2 border-info-200 border-l-4 border-l-info-500"},ghost:{primary:"bg-transparent text-primary-800 border-2 border-transparent",secondary:"bg-transparent text-secondary-800 border-2 border-transparent",neutral:"bg-transparent text-neutral-800 border-2 border-transparent",error:"bg-transparent text-error-700 border-2 border-transparent",success:"bg-transparent text-success-700 border-2 border-transparent",warning:"bg-transparent text-warning-800 border-2 border-transparent",info:"bg-transparent text-info-800 border-2 border-transparent"}},o0={soft:{primary:"text-primary-600",secondary:"text-secondary-600",neutral:"text-neutral-600",error:"text-error-600",success:"text-success-600",warning:"text-warning-600",info:"text-info-600"},filled:{primary:"text-white",secondary:"text-white",neutral:"text-white",error:"text-white",success:"text-white",warning:"text-neutral-950",info:"text-white"},outline:{primary:"text-primary-600",secondary:"text-secondary-600",neutral:"text-neutral-600",error:"text-error-600",success:"text-success-600",warning:"text-warning-600",info:"text-info-600"},"accent-left":{primary:"text-primary-600",secondary:"text-secondary-600",neutral:"text-neutral-600",error:"text-error-600",success:"text-success-600",warning:"text-warning-600",info:"text-info-600"},ghost:{primary:"text-primary-600",secondary:"text-secondary-600",neutral:"text-neutral-600",error:"text-error-600",success:"text-success-600",warning:"text-warning-600",info:"text-info-600"}},i0={primary:Dr,secondary:Dr,neutral:Dr,info:Dr,success:_o,warning:Xo,error:qo};var Vr=require("react/jsx-runtime");function oi({size:e,variant:t,color:r,radius:n,title:o,description:i,icon:a=!0,action:s,closable:l=!0,onClose:f,closeAriaLabel:c="\u0110\xF3ng c\u1EA3nh b\xE1o",banner:w=!1,titleClassName:p="",descriptionClassName:m="",actionClassName:v="",iconClassName:x="",closeButtonClassName:h="",className:k="",children:T,role:y,ref:d,...u}){let g=C(e,t0,"md"),b=w?"rounded-none border-x-0 w-full":C(n,r0,"lg"),S=t==="other"?"":C(r,C(t,n0,"soft"),"info"),R=t==="other"?"":C(r,C(t,o0,"soft"),"info"),D=l||!!f,P=Y=>{Y.stopPropagation(),f?.()},E=y||(r==="error"||r==="warning"?"alert":"status"),N=r==="error"||r==="warning"?"assertive":"polite",M=i??T,z=!!M,H=()=>{if(a===!1)return null;if(a!==!0&&a!==void 0)return(0,Vr.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${g.icon} ${x}`,"aria-hidden":"true",children:a});let Y=C(r,i0,"info");return(0,Vr.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${g.icon} ${R} ${x}`,"aria-hidden":"true",children:(0,Vr.jsx)(Y,{className:"size-full"})})},V=["relative flex w-full",g.container,b,S,k].filter(Boolean).join(" ");return(0,Vr.jsxs)("div",{ref:d,role:E,"aria-live":N,className:V,...u,children:[H(),(0,Vr.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[o&&(0,Vr.jsx)("div",{className:`${g.title} ${p}`,children:o}),z&&(0,Vr.jsx)("div",{className:`${g.description} ${o?"mt-0.5":""} ${m}`,children:M})]}),s&&(0,Vr.jsx)("div",{className:`inline-flex items-center shrink-0 ${g.action} ${v}`,children:s}),D&&(0,Vr.jsx)("button",{type:"button",onClick:P,"aria-label":c,className:`inline-flex items-center justify-center shrink-0 rounded-md transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-current opacity-70 hover:opacity-100 ${t==="filled"?"hover:bg-white/20 active:bg-white/30":"hover:bg-black/5 active:bg-black/10"} ${g.closeButton} ${h}`,children:(0,Vr.jsx)(Ve,{className:g.closeIcon})})]})}var a0=require("sonner");var en=4e3;var s0=require("react/jsx-runtime");function wl({position:e="top-right",visibleToasts:t=3,expand:r=!1,duration:n=4e3,closeButton:o=!1,className:i="",toastOptions:a,...s}){return(0,s0.jsx)(a0.Toaster,{position:e,visibleToasts:t,expand:r,duration:n,closeButton:o,className:`toaster group ${i}`,toastOptions:{unstyled:!0,className:"w-full max-w-md pointer-events-auto",...a},...s})}var l0=require("react"),ii=require("sonner");var Cl=require("react/jsx-runtime");function ho(e,t="info",r="soft",n,o={},i){let{duration:a,position:s,onDismiss:l,onAutoClose:f,...c}=o;return ii.toast.custom(w=>(0,Cl.jsx)(oi,{color:t,variant:r,title:e,description:n,closable:c.closable??!0,onClose:()=>{c.onClose?.(),ii.toast.dismiss(w)},...c}),{id:i,duration:a??4e3,position:s,onDismiss:l,onAutoClose:f})}function Ap(e){return typeof e=="object"&&e!==null&&!(0,l0.isValidElement)(e)&&!Array.isArray(e)&&("title"in e||"description"in e||"color"in e||"variant"in e)}function nu(e,t,r){return Ap(e)?{title:e.title??"",description:e.description,color:e.color??t,variant:e.variant??r}:{title:e,description:void 0,color:t,variant:r}}var xn=((e,t,r)=>{let n=r||{};return ho(e,n.color||"info",n.variant||"soft",t,n)});xn.custom=(e,t={})=>{if(typeof e=="function")return ii.toast.custom(s=>e(s),{duration:t.duration??4e3,position:t.position,onDismiss:t.onDismiss,onAutoClose:t.onAutoClose});let{duration:r,position:n,onDismiss:o,onAutoClose:i,...a}=e;return ii.toast.custom(s=>(0,Cl.jsx)(oi,{closable:a.closable??!0,onClose:()=>{a.onClose?.(),ii.toast.dismiss(s)},...a}),{duration:r??4e3,position:n,onDismiss:o,onAutoClose:i})};xn.success=(e,t,r)=>{let n=r||{};return ho(e,n.color||"success",n.variant||"soft",t,n)};xn.error=(e,t,r)=>{let n=r||{};return ho(e,n.color||"error",n.variant||"soft",t,n)};xn.warning=(e,t,r)=>{let n=r||{};return ho(e,n.color||"warning",n.variant||"soft",t,n)};xn.info=(e,t,r)=>{let n=r||{};return ho(e,n.color||"info",n.variant||"soft",t,n)};xn.loading=(e,t,r)=>{let n=r||{};return ho(e,n.color||"info",n.variant||"soft",t,{...n,icon:n.icon??(0,Cl.jsx)(De,{className:"size-full animate-spin"}),duration:n.duration??1/0,closable:n.closable??!1})};xn.promise=async(e,t)=>{let r=typeof e=="function"?e():e,{title:n,description:o}=nu(t.loading,"info",t.variant||"soft"),i=xn.loading(n,o,{size:t.size,variant:t.variant,radius:t.radius});try{let a=await r,s=typeof t.success=="function"?t.success(a):t.success,{title:l,description:f,color:c,variant:w}=nu(s,"success",t.variant||"soft");return ho(l,c,w,f,{duration:t.duration??4e3,size:t.size,radius:t.radius},i),a}catch(a){let s=typeof t.error=="function"?t.error(a):t.error,{title:l,description:f,color:c,variant:w}=nu(s,"error",t.variant||"soft");throw ho(l,c,w,f,{duration:t.duration??4e3,size:t.size,radius:t.radius},i),a}finally{t.finally&&await t.finally()}};xn.dismiss=e=>ii.toast.dismiss(e);var ou=xn;var Xn=require("react"),nt=require("@floating-ui/react");var c0=require("@floating-ui/react");function rt(e,t={}){let{duration:r=150,offset:n=4,scale:o=.96,animated:i=!0}=t;return(0,c0.useTransitionStyles)(e,{duration:i?r:0,initial:({side:a})=>({opacity:0,transform:a==="top"?`translateY(${n}px) scale(${o})`:a==="bottom"?`translateY(-${n}px) scale(${o})`:a==="left"?`translateX(${n}px) scale(${o})`:`translateX(-${n}px) scale(${o})`}),open:{opacity:1,transform:"translate(0px, 0px) scale(1)"},close:({side:a})=>({opacity:0,transform:a==="top"?`translateY(${n}px) scale(${o})`:a==="bottom"?`translateY(-${n}px) scale(${o})`:a==="left"?`translateX(${n}px) scale(${o})`:`translateX(-${n}px) scale(${o})`})})}var u0={xs:{box:"px-2 py-0.5 text-[11px] leading-tight font-medium",arrowWidth:8,arrowHeight:4},sm:{box:"px-2.5 py-1 text-xs leading-tight font-medium",arrowWidth:10,arrowHeight:5},md:{box:"px-3 py-1.5 text-xs leading-normal font-medium",arrowWidth:12,arrowHeight:6},lg:{box:"px-3.5 py-2 text-sm leading-normal font-medium",arrowWidth:14,arrowHeight:7},xl:{box:"px-4 py-2.5 text-base leading-normal font-semibold",arrowWidth:16,arrowHeight:8}},d0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},f0={filled:{primary:"bg-primary-500 text-neutral-white border border-transparent shadow-md",secondary:"bg-secondary-500 text-neutral-white border border-transparent shadow-md",error:"bg-error-500 text-neutral-white border border-transparent shadow-md",success:"bg-success-500 text-neutral-white border border-transparent shadow-md",warning:"bg-warning-500 text-neutral-950 border border-transparent shadow-md",info:"bg-info-500 text-neutral-white border border-transparent shadow-md",neutral:"bg-neutral-800 text-neutral-white border border-transparent shadow-md"},soft:{primary:"bg-primary-100 text-primary-800 border border-primary-200 shadow-sm",secondary:"bg-secondary-100 text-secondary-800 border border-secondary-200 shadow-sm",error:"bg-error-100 text-error-800 border border-error-200 shadow-sm",success:"bg-success-100 text-success-800 border border-success-200 shadow-sm",warning:"bg-warning-100 text-warning-800 border border-warning-200 shadow-sm",info:"bg-info-100 text-info-800 border border-info-200 shadow-sm",neutral:"bg-neutral-100 text-neutral-800 border border-neutral-200 shadow-sm"},outline:{primary:"bg-neutral-white text-primary-700 border border-primary-400 shadow-md",secondary:"bg-neutral-white text-secondary-800 border border-secondary-400 shadow-md",error:"bg-neutral-white text-error-700 border border-error-400 shadow-md",success:"bg-neutral-white text-success-700 border border-success-400 shadow-md",warning:"bg-neutral-white text-warning-800 border border-warning-400 shadow-md",info:"bg-neutral-white text-info-800 border border-info-400 shadow-md",neutral:"bg-neutral-white text-neutral-800 border border-neutral-300 shadow-md"}},p0={filled:{primary:"fill-primary-500",secondary:"fill-secondary-500",error:"fill-error-500",success:"fill-success-500",warning:"fill-warning-500",info:"fill-info-500",neutral:"fill-neutral-800"},soft:{primary:"fill-primary-100 stroke-primary-200",secondary:"fill-secondary-100 stroke-secondary-200",error:"fill-error-100 stroke-error-200",success:"fill-success-100 stroke-success-200",warning:"fill-warning-100 stroke-warning-200",info:"fill-info-100 stroke-info-200",neutral:"fill-neutral-100 stroke-neutral-200"},outline:{primary:"fill-neutral-white stroke-primary-400",secondary:"fill-neutral-white stroke-secondary-400",error:"fill-neutral-white stroke-error-400",success:"fill-neutral-white stroke-success-400",warning:"fill-neutral-white stroke-warning-400",info:"fill-neutral-white stroke-info-400",neutral:"fill-neutral-white stroke-neutral-300"}};var vn=require("react/jsx-runtime");function Op({children:e,ref:t,disabled:r,className:n="",...o}){let i=(0,Xn.isValidElement)(e)?e.props?.ref:void 0,a=(0,nt.useMergeRefs)([t,i]);if(!(0,Xn.isValidElement)(e))return null;let s=e.props||{};return(0,Xn.cloneElement)(e,{...o,...s,ref:a,disabled:r?!0:s.disabled,className:[s.className,n].filter(Boolean).join(" ")})}function _i({content:e,children:t,placement:r="top",variant:n,color:o,size:i,radius:a,hasArrow:s=!0,offset:l=8,flip:f=!0,shift:c=!0,delay:w={open:200,close:150},disabled:p=!1,animated:m=!0,animationDuration:v=150,open:x,defaultOpen:h=!1,onOpenChange:k,className:T="",arrowClassName:y="",zIndex:d=lt.TOOLTIP}){let[u,g]=(0,Xn.useState)(h),[b,S]=(0,Xn.useState)(null),R=x!==void 0,D=R?x:u,P=q=>{R||g(q),k?.(q)},I=[(0,nt.offset)(l),f?(0,nt.flip)():void 0,c?(0,nt.shift)({padding:8}):void 0,s?(0,nt.arrow)({element:b}):void 0].filter(Boolean),{refs:{setReference:E,setFloating:N},floatingStyles:M,context:z,placement:H}=(0,nt.useFloating)({placement:r,open:D&&!p,onOpenChange:P,whileElementsMounted:nt.autoUpdate,transform:!1,middleware:I}),V=(0,nt.useHover)(z,{move:!1,delay:w,enabled:!p}),Y=(0,nt.useFocus)(z,{enabled:!p}),$=(0,nt.useDismiss)(z),F=(0,nt.useRole)(z,{role:"tooltip"}),{getReferenceProps:G,getFloatingProps:A}=(0,nt.useInteractions)([V,Y,$,F]),{isMounted:j,styles:B}=rt(z,{duration:v,animated:m}),X=C(i,u0,"md"),le=C(a,d0,"md"),ne=n==="other"?"":C(o,C(n,f0,"filled"),"neutral"),ue=n==="other"?"":C(o,C(n,p0,"filled"),"neutral"),ie=["select-none pointer-events-none max-w-xs break-words",X.box,le,ne,T].filter(Boolean).join(" "),Q=G();return(0,vn.jsxs)(vn.Fragment,{children:[(0,Xn.isValidElement)(t)?(0,vn.jsx)(Op,{ref:E,disabled:p,...Q,children:t}):(0,vn.jsx)("span",{ref:E,...Q,children:t}),(0,vn.jsx)(nt.FloatingPortal,{children:j&&!p&&e&&(0,vn.jsxs)("div",{ref:N,style:{...M,...m?B:{},zIndex:d},className:ie,"data-state":D?"open":"closed","data-placement":H,...A(),children:[e,s&&(0,vn.jsx)(nt.FloatingArrow,{ref:S,context:z,width:X.arrowWidth,height:X.arrowHeight,strokeWidth:n==="outline"||n==="soft"?1:0,className:[ue,y].filter(Boolean).join(" ")})]})})]})}var Tl=require("react"),Zi=Hn(require("@radix-ui/react-slider"),1);var ai={xs:{trackHorizontal:"h-1",trackVertical:"w-1",thumb:"w-3 h-3",thumbSizePx:12,label:"text-xs font-medium",value:"text-xs font-semibold",helper:"text-[11px]",markText:"text-[10px]",gap:"gap-1",stepDot:"w-1 h-1",tooltipSize:"xs"},sm:{trackHorizontal:"h-1.5",trackVertical:"w-1.5",thumb:"w-4 h-4",thumbSizePx:16,label:"text-xs font-medium",value:"text-xs font-semibold",helper:"text-xs",markText:"text-[11px]",gap:"gap-1.5",stepDot:"w-1.5 h-1.5",tooltipSize:"xs"},md:{trackHorizontal:"h-2",trackVertical:"w-2",thumb:"w-5 h-5",thumbSizePx:20,label:"text-sm font-medium",value:"text-sm font-semibold",helper:"text-xs",markText:"text-xs",gap:"gap-2",stepDot:"w-2 h-2",tooltipSize:"sm"},lg:{trackHorizontal:"h-2.5",trackVertical:"w-2.5",thumb:"w-6 h-6",thumbSizePx:24,label:"text-base font-medium",value:"text-base font-semibold",helper:"text-sm",markText:"text-xs",gap:"gap-2.5",stepDot:"w-2.5 h-2.5",tooltipSize:"md"},xl:{trackHorizontal:"h-3",trackVertical:"w-3",thumb:"w-7 h-7",thumbSizePx:28,label:"text-lg font-medium",value:"text-lg font-semibold",helper:"text-sm",markText:"text-sm",gap:"gap-3",stepDot:"w-3 h-3",tooltipSize:"md"}},iu={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},g0={filled:{primary:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-primary-500 dark:bg-primary-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-primary-500 text-primary-600 focus-visible:ring-2 focus-visible:ring-primary-500/50 shadow-sm"},secondary:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-secondary-500 dark:bg-secondary-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-secondary-500 text-secondary-600 focus-visible:ring-2 focus-visible:ring-secondary-500/50 shadow-sm"},error:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-error-500 dark:bg-error-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-error-500 text-error-600 focus-visible:ring-2 focus-visible:ring-error-500/50 shadow-sm"},success:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-success-500 dark:bg-success-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-success-500 text-success-600 focus-visible:ring-2 focus-visible:ring-success-500/50 shadow-sm"},warning:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-warning-500 dark:bg-warning-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-warning-500 text-warning-600 focus-visible:ring-2 focus-visible:ring-warning-500/50 shadow-sm"},info:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-info-500 dark:bg-info-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-info-500 text-info-600 focus-visible:ring-2 focus-visible:ring-info-500/50 shadow-sm"},neutral:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-neutral-800 dark:bg-neutral-200",thumb:"bg-white dark:bg-neutral-900 border-2 border-neutral-800 dark:border-neutral-200 text-neutral-800 dark:text-neutral-200 focus-visible:ring-2 focus-visible:ring-neutral-500/50 shadow-sm"}},soft:{primary:{track:"bg-primary-100 dark:bg-primary-950/40",filler:"bg-primary-400 dark:bg-primary-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-primary-400 text-primary-500 focus-visible:ring-2 focus-visible:ring-primary-400/50 shadow-sm"},secondary:{track:"bg-secondary-100 dark:bg-secondary-950/40",filler:"bg-secondary-400 dark:bg-secondary-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-secondary-400 text-secondary-500 focus-visible:ring-2 focus-visible:ring-secondary-400/50 shadow-sm"},error:{track:"bg-error-100 dark:bg-error-950/40",filler:"bg-error-400 dark:bg-error-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-error-400 text-error-500 focus-visible:ring-2 focus-visible:ring-error-400/50 shadow-sm"},success:{track:"bg-success-100 dark:bg-success-950/40",filler:"bg-success-400 dark:bg-success-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-success-400 text-success-500 focus-visible:ring-2 focus-visible:ring-success-400/50 shadow-sm"},warning:{track:"bg-warning-100 dark:bg-warning-950/40",filler:"bg-warning-400 dark:bg-warning-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-warning-400 text-warning-500 focus-visible:ring-2 focus-visible:ring-warning-400/50 shadow-sm"},info:{track:"bg-info-100 dark:bg-info-950/40",filler:"bg-info-400 dark:bg-info-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-info-400 text-info-500 focus-visible:ring-2 focus-visible:ring-info-400/50 shadow-sm"},neutral:{track:"bg-neutral-200 dark:bg-neutral-800",filler:"bg-neutral-600 dark:bg-neutral-400",thumb:"bg-white dark:bg-neutral-900 border-2 border-neutral-600 dark:border-neutral-400 text-neutral-600 focus-visible:ring-2 focus-visible:ring-neutral-400/50 shadow-sm"}},outline:{primary:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-primary-500 dark:bg-primary-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-primary-500 text-primary-600 focus-visible:ring-2 focus-visible:ring-primary-500/50 shadow-sm"},secondary:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-secondary-500 dark:bg-secondary-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-secondary-500 text-secondary-600 focus-visible:ring-2 focus-visible:ring-secondary-500/50 shadow-sm"},error:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-error-500 dark:bg-error-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-error-500 text-error-600 focus-visible:ring-2 focus-visible:ring-error-500/50 shadow-sm"},success:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-success-500 dark:bg-success-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-success-500 text-success-600 focus-visible:ring-2 focus-visible:ring-success-500/50 shadow-sm"},warning:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-warning-500 dark:bg-warning-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-warning-500 text-warning-600 focus-visible:ring-2 focus-visible:ring-warning-500/50 shadow-sm"},info:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-info-500 dark:bg-info-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-info-500 text-info-600 focus-visible:ring-2 focus-visible:ring-info-500/50 shadow-sm"},neutral:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-neutral-800 dark:bg-neutral-200",thumb:"bg-white dark:bg-neutral-900 border-2 border-neutral-800 dark:border-neutral-200 text-neutral-800 dark:text-neutral-200 focus-visible:ring-2 focus-visible:ring-neutral-500/50 shadow-sm"}},other:{primary:{track:"",filler:"",thumb:""},secondary:{track:"",filler:"",thumb:""},error:{track:"",filler:"",thumb:""},success:{track:"",filler:"",thumb:""},warning:{track:"",filler:"",thumb:""},info:{track:"",filler:"",thumb:""},neutral:{track:"",filler:"",thumb:""}}};var kl=require("react"),m0=Hn(require("@radix-ui/react-slider"),1);var us=require("react/jsx-runtime");function Xi({id:e,thumbIdx:t,value:r,orientation:n,size:o,thumbRadiusClass:i,thumbThemeStyles:a,thumbClassName:s="",tooltipClassName:l="",state:f,label:c,helperId:w,tooltipMode:p="none",tooltipPlacement:m,formatTooltip:v}){let{isLoading:x=!1,showSpinner:h=!1,disabled:k=!1,readOnly:T=!1,isRequired:y=!1,isInvalid:d=!1,isRange:u=!1,hasDescription:g=!1}=f??{},b=C(o,ai,"md"),[S,R]=(0,kl.useState)(!1),[D,P]=(0,kl.useState)(!1),[I,E]=(0,kl.useState)(!1),N;p==="always"?N=!0:p==="active"?N=I||D:p==="hover"?N=S||I||D:p==="none"&&(N=!1);let M=m||(n==="vertical"?"right":"top"),z=v?v(r):r.toString(),H=typeof z=="string"||typeof z=="number"?String(z):void 0,V=(0,us.jsx)(m0.Thumb,{id:`${e}-thumb-${t}`,tabIndex:k||x?-1:0,"aria-busy":x,"aria-disabled":k||x,"aria-readonly":T,"aria-required":y,"aria-invalid":d,"aria-errormessage":d?w:void 0,"aria-describedby":g?w:void 0,"aria-valuetext":H,"aria-orientation":n,"aria-label":typeof c=="string"?`${c} ${u?t===0?"minimum":"maximum":""}`:`Slider ${u?t===0?"min":"max":""}`,onFocus:()=>P(!0),onBlur:()=>P(!1),onPointerEnter:()=>R(!0),onPointerLeave:()=>R(!1),onPointerDown:()=>E(!0),onPointerUp:()=>E(!1),className:`block relative z-10 select-none outline-none transition-transform duration-100 ease-out ${k||T?"cursor-not-allowed opacity-60 shadow-none":"cursor-grab active:cursor-grabbing hover:scale-105"} ${b.thumb} ${i} ${a} ${I&&!k&&!x?"scale-110 ring-4 ring-primary-500/20":""} ${s}`,children:x&&h&&(0,us.jsx)("div",{className:"absolute inset-0 flex items-center justify-center p-0.5","aria-hidden":"true",children:(0,us.jsx)(De,{className:"size-full animate-spin text-current"})})});return p!=="none"?(0,us.jsx)(_i,{content:z,placement:M,open:N,size:b.tooltipSize,className:l,disabled:k||x,children:V}):V}function Sl(e,t,r){return Math.min(Math.max(e,t),r)}function qi(e,t,r){return r<=t?0:Sl((e-t)/(r-t)*100,0,100)}var si=require("react/jsx-runtime");function ds({marks:e,min:t,max:r,step:n,orientation:o,size:i,markClassName:a=""}){if(!e)return null;let s=[];if(Array.isArray(e))s=e;else if(e===!0&&n>0){let f=Math.floor((r-t)/n);if(f<=20)for(let c=0;c<=f;c++){let w=t+c*n;s.push({value:w,label:w.toString()})}}if(!s.length)return null;let l=C(i,ai,"md");return(0,si.jsx)("div",{className:`relative w-full ${o==="vertical"?"h-full":"mt-2"}`,"aria-hidden":"true",children:s.map(f=>{let c=qi(f.value,t,r);return(0,si.jsx)("div",{className:`absolute flex items-center justify-center select-none text-neutral-500 dark:text-neutral-400 ${l.markText} ${a}`,style:o==="vertical"?{bottom:`${c}%`,left:"100%",transform:"translateY(50%) translateX(6px)"}:{left:`${c}%`,transform:"translateX(-50%)"},children:f.label??f.value},f.value)})})}function fs({showSteps:e,min:t,max:r,step:n,orientation:o,size:i,isRange:a,currentValues:s}){if(!e||n<=0)return null;let l=Math.floor((r-t)/n);if(l>100)return null;let f=C(i,ai,"md"),c=[];for(let w=0;w<=l;w++){let p=t+w*n,m=qi(p,t,r),v=a?p>=(s[0]??t)&&p<=(s[1]??r):p<=(s[0]??t);c.push((0,si.jsx)("span",{"aria-hidden":"true",className:`absolute rounded-full -translate-x-1/2 -translate-y-1/2 pointer-events-none transition-colors duration-150 ${f.stepDot} ${v?"bg-white/80 dark:bg-neutral-900/80":"bg-neutral-400/60 dark:bg-neutral-500/60"}`,style:o==="vertical"?{bottom:`${m}%`,left:"50%"}:{left:`${m}%`,top:"50%"}},`step-dot-${p}`))}return(0,si.jsx)(si.Fragment,{children:c})}var gt=require("react/jsx-runtime");function Ji({config:e,value:t,defaultValue:r,min:n=0,max:o=100,step:i=1,minStepsBetweenThumbs:a=0,inverted:s=!1,size:l,variant:f,color:c,radius:w,thumbRadius:p,orientation:m="horizontal",label:v,labelPlacement:x="top",formatValue:h,showTooltip:k="none",tooltipPlacement:T,formatTooltip:y,marks:d=!1,startContent:u,endContent:g,disabled:b=!1,readOnly:S=!1,helperText:R,errorMessage:D,name:P,id:I,onChange:E,onChangeEnd:N,className:M="",wrapperClassName:z="",trackWrapperClassName:H="",trackClassName:V="",fillerClassName:Y="",thumbClassName:$="",labelClassName:F="",valueClassName:G="",helperClassName:A="",tooltipClassName:j="",markClassName:B="",ref:X}){let{isRequired:le=!1,isInvalid:ne=!1,isLoading:ue=!1,showSpinner:ie=!1,showSteps:Q=!1,showValue:q=!1,isFullWidth:ge=!0}=e??{},ke=(0,Tl.useId)(),L=I||ke,te=`${L}-helper`,Z=!!(ne||D),he=Z?"error":c,ae=Array.isArray(t??r),ve=t!==void 0,[Se,ye]=(0,Tl.useState)(()=>r!==void 0?Array.isArray(r)?r:[r]:ae?[n,o]:[n]),J=ve?Array.isArray(t)?t:t!==void 0?[t]:void 0:void 0,O=ve?Array.isArray(t)?[t[0]??n,t[1]??o]:[t??n,0]:ae?[Se[0]??n,Se[1]??o]:[Se[0]??n,0],W=U=>{if(b||S||ue)return;ve||ye(U);let Ce=ae?[U[0]??n,U[1]??o]:U[0]??n;E?.(Ce)},we=U=>{if(b||S||ue)return;let Ce=ae?[U[0]??n,U[1]??o]:U[0]??n;N?.(Ce)},fe=C(l,ai,"md"),se=C(w,iu,"full"),me=C(p,iu,"full"),Re=f==="other"?{track:"",filler:"",thumb:""}:C(he,C(f,g0,"filled"),"primary"),xe=Re.track,re=Re.filler,de=Re.thumb,ce=()=>{if(!v&&!q)return null;let U="";h?U=h(ae?O:O[0]):ae?U=`${O[0]} - ${O[1]}`:U=`${O[0]}`;let Ce=Z?"text-error-600 font-medium":"text-neutral-900 dark:text-neutral-100";return(0,gt.jsxs)("div",{className:"flex items-center justify-between gap-2 mb-1.5 select-none",children:[v&&(0,gt.jsxs)("label",{htmlFor:`${L}-thumb-0`,className:`font-medium ${Ce} ${fe.label} ${b?"opacity-60 cursor-not-allowed":"cursor-pointer"} ${F}`,children:[v,le&&(0,gt.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),q&&(0,gt.jsx)("span",{className:`select-none text-neutral-700 dark:text-neutral-300 ${fe.value} ${G}`,"aria-hidden":"true",children:U})]})},ee=ae?[O[0],O[1]]:[O[0]];return(0,gt.jsxs)("div",{ref:X,className:`group/field flex flex-col ${ge?"w-full":"inline-flex"} ${b?"opacity-60 cursor-not-allowed":""} ${z||M}`,children:[x==="top"&&ce(),(0,gt.jsxs)("div",{className:`flex items-center ${fe.gap} ${m==="vertical"?"flex-col h-48":"flex-row w-full"} ${H}`,children:[x==="left"&&ce(),u&&(0,gt.jsx)("div",{className:"inline-flex shrink-0 items-center justify-center select-none text-neutral-500 dark:text-neutral-400","aria-hidden":"true",children:u}),(0,gt.jsxs)(Zi.Root,{min:n,max:o,step:i,minStepsBetweenThumbs:a,inverted:s,orientation:m,disabled:b||ue||S,value:J,defaultValue:r!==void 0?Array.isArray(r)?r:[r]:void 0,onValueChange:W,onValueCommit:we,className:`relative flex items-center select-none touch-none ${m==="vertical"?"flex-col h-full w-auto justify-center":"w-full h-auto justify-center"} ${b||S?"cursor-not-allowed":"cursor-pointer"}`,children:[(0,gt.jsxs)(Zi.Track,{className:`relative overflow-hidden ${m==="vertical"?`${fe.trackVertical} h-full`:`${fe.trackHorizontal} w-full`} ${se} ${xe} ${V}`,children:[(0,gt.jsx)(fs,{showSteps:Q,min:n,max:o,step:i,orientation:m,size:l||"md",isRange:ae,currentValues:O}),(0,gt.jsx)(Zi.Range,{className:`absolute ${re} ${se} ${Y}`})]}),ee.map((U,Ce)=>{let $e=ae?Ce===0?`${L}-thumb-min`:`${L}-thumb-max`:`${L}-thumb-single`;return(0,gt.jsx)(Xi,{id:L,thumbIdx:Ce,value:U,orientation:m,size:l||"md",thumbRadiusClass:me,thumbThemeStyles:de,thumbClassName:$,tooltipClassName:j,state:{isLoading:ue,showSpinner:ie,disabled:b,readOnly:S,isRequired:le,isInvalid:Z,isRange:ae,hasDescription:!!(Z||R)},label:v,helperId:te,tooltipMode:k,tooltipPlacement:T,formatTooltip:y},$e)})]}),g&&(0,gt.jsx)("div",{className:"inline-flex shrink-0 items-center justify-center select-none text-neutral-500 dark:text-neutral-400","aria-hidden":"true",children:g}),x==="right"&&ce()]}),(0,gt.jsx)(ds,{marks:d,min:n,max:o,step:i,orientation:m,size:l||"md",markClassName:B}),(0,gt.jsx)(Le,{id:te,helperText:R,errorMessage:D,sizeClassName:fe.helper,className:A}),P&&(0,gt.jsx)(gt.Fragment,{children:ae?(0,gt.jsxs)(gt.Fragment,{children:[(0,gt.jsx)("input",{type:"hidden",name:`${P}[0]`,value:O[0],disabled:b}),(0,gt.jsx)("input",{type:"hidden",name:`${P}[1]`,value:O[1],disabled:b})]}):(0,gt.jsx)("input",{type:"hidden",name:P,value:O[0],disabled:b})})]})}var ci=require("react");var Rl={sm:{header:"py-2.5 px-3.5 text-sm",content:"px-3.5 pb-3 text-sm text-neutral-600",title:"font-medium leading-snug",description:"text-xs text-neutral-500 mt-0.5",icon:"size-4",startIcon:"size-4",gap:"gap-2.5"},md:{header:"py-3.5 px-4 text-base",content:"px-4 pb-4 text-sm text-neutral-600",title:"font-semibold leading-snug",description:"text-xs text-neutral-500 mt-1",icon:"size-4.5",startIcon:"size-4.5",gap:"gap-3"},lg:{header:"py-4.5 px-5 text-lg",content:"px-5 pb-5 text-base text-neutral-600",title:"font-semibold leading-snug",description:"text-sm text-neutral-500 mt-1",icon:"size-5",startIcon:"size-5",gap:"gap-3.5"}},Dl={none:"rounded-none",sm:"rounded-md",md:"rounded-xl",lg:"rounded-2xl",xl:"rounded-3xl",full:"rounded-3xl"},b0={outlined:{primary:"border border-primary-200 bg-white divide-y divide-primary-100 overflow-hidden",secondary:"border border-secondary-200 bg-white divide-y divide-secondary-100 overflow-hidden",neutral:"border border-neutral-200 bg-white divide-y divide-neutral-200 overflow-hidden",error:"border border-error-200 bg-white divide-y divide-error-100 overflow-hidden",success:"border border-success-200 bg-white divide-y divide-success-100 overflow-hidden",warning:"border border-warning-200 bg-white divide-y divide-warning-100 overflow-hidden",info:"border border-info-200 bg-white divide-y divide-info-100 overflow-hidden"},filled:{primary:"bg-primary-50/40 border border-primary-100 divide-y divide-primary-100/80 overflow-hidden",secondary:"bg-secondary-50/40 border border-secondary-100 divide-y divide-secondary-100/80 overflow-hidden",neutral:"bg-neutral-50 border border-neutral-200/60 divide-y divide-neutral-200/60 overflow-hidden",error:"bg-error-50/40 border border-error-100 divide-y divide-error-100/80 overflow-hidden",success:"bg-success-50/40 border border-success-100 divide-y divide-success-100/80 overflow-hidden",warning:"bg-warning-50/40 border border-warning-100 divide-y divide-warning-100/80 overflow-hidden",info:"bg-info-50/40 border border-info-100 divide-y divide-info-100/80 overflow-hidden"},separated:{primary:"bg-transparent border-0 space-y-3",secondary:"bg-transparent border-0 space-y-3",neutral:"bg-transparent border-0 space-y-3",error:"bg-transparent border-0 space-y-3",success:"bg-transparent border-0 space-y-3",warning:"bg-transparent border-0 space-y-3",info:"bg-transparent border-0 space-y-3"},ghost:{primary:"bg-transparent border-0 divide-y divide-neutral-200/70",secondary:"bg-transparent border-0 divide-y divide-neutral-200/70",neutral:"bg-transparent border-0 divide-y divide-neutral-200/70",error:"bg-transparent border-0 divide-y divide-neutral-200/70",success:"bg-transparent border-0 divide-y divide-neutral-200/70",warning:"bg-transparent border-0 divide-y divide-neutral-200/70",info:"bg-transparent border-0 divide-y divide-neutral-200/70"}},h0={outlined:{primary:"",secondary:"",neutral:"",error:"",success:"",warning:"",info:""},filled:{primary:"",secondary:"",neutral:"",error:"",success:"",warning:"",info:""},ghost:{primary:"",secondary:"",neutral:"",error:"",success:"",warning:"",info:""},separated:{primary:"bg-white border border-primary-200 shadow-xs overflow-hidden",secondary:"bg-white border border-secondary-200 shadow-xs overflow-hidden",neutral:"bg-white border border-neutral-200 shadow-xs overflow-hidden",error:"bg-white border border-error-200 shadow-xs overflow-hidden",success:"bg-white border border-success-200 shadow-xs overflow-hidden",warning:"bg-white border border-warning-200 shadow-xs overflow-hidden",info:"bg-white border border-info-200 shadow-xs overflow-hidden"}},x0={outlined:{primary:"bg-primary-50/40",secondary:"bg-secondary-50/40",neutral:"bg-neutral-50/80",error:"bg-error-50/40",success:"bg-success-50/40",warning:"bg-warning-50/40",info:"bg-info-50/40"},filled:{primary:"bg-primary-50/80",secondary:"bg-secondary-50/80",neutral:"bg-neutral-100/70",error:"bg-error-50/80",success:"bg-success-50/80",warning:"bg-warning-50/80",info:"bg-info-50/80"},separated:{primary:"bg-primary-50/40",secondary:"bg-secondary-50/40",neutral:"bg-neutral-50/80",error:"bg-error-50/40",success:"bg-success-50/40",warning:"bg-warning-50/40",info:"bg-info-50/40"},ghost:{primary:"bg-transparent",secondary:"bg-transparent",neutral:"bg-transparent",error:"bg-transparent",success:"bg-transparent",warning:"bg-transparent",info:"bg-transparent"}},v0={primary:{focusRing:"focus-visible:ring-primary-500",title:"text-primary-700",activeIndicator:"text-primary-600"},secondary:{focusRing:"focus-visible:ring-secondary-500",title:"text-secondary-700",activeIndicator:"text-secondary-600"},neutral:{focusRing:"focus-visible:ring-neutral-500",title:"text-neutral-900",activeIndicator:"text-neutral-700"},error:{focusRing:"focus-visible:ring-error-500",title:"text-error-700",activeIndicator:"text-error-600"},success:{focusRing:"focus-visible:ring-success-500",title:"text-success-700",activeIndicator:"text-success-600"},warning:{focusRing:"focus-visible:ring-warning-500",title:"text-warning-700",activeIndicator:"text-warning-600"},info:{focusRing:"focus-visible:ring-info-500",title:"text-info-700",activeIndicator:"text-info-600"}};var Qi=require("react"),au=(0,Qi.createContext)(null),su=(0,Qi.createContext)(null);function qn(){let e=(0,Qi.useContext)(au);if(!e)throw new Error("Collapse compound components must be rendered within a <Collapse> provider");return e}function li(){let e=(0,Qi.useContext)(su);if(!e)throw new Error("Collapse subcomponents (CollapseHeader, CollapseContent) must be rendered within a <CollapsePanel>");return e}var lu=require("react/jsx-runtime");function y0(e){return e==null?[]:Array.isArray(e)?e:[e]}function Nl({activeKey:e,defaultActiveKey:t,onChange:r,accordion:n=!1,size:o="md",variant:i="outlined",color:a="primary",radius:s="md",expandIconPosition:l="right",expandIcon:f,destroyInactivePanel:c=!1,className:w="",style:p,children:m,ref:v,...x}){let h=e!==void 0,[k,T]=(0,ci.useState)(()=>y0(t)),y=(0,ci.useMemo)(()=>new Set(h?y0(e):k),[h,e,k]),d=(0,ci.useCallback)(R=>{let D,P=y.has(R);if(n)D=P?[]:[R];else{let I=Array.from(y);P?D=I.filter(E=>E!==R):D=[...I,R]}h||T(D),r?.(n?D[0]??"":D)},[n,y,h,r]),u=i==="other"?"":C(a,C(i,b0,"outlined"),"primary"),g=i!=="separated"&&i!=="ghost"?C(s,Dl,"md"):"",b=["w-full transition-colors",u,g,w].filter(Boolean).join(" "),S=(0,ci.useMemo)(()=>({activeKeys:y,handleToggle:d,accordion:n,size:o,variant:i,color:a,radius:s,expandIconPosition:l,expandIcon:f,destroyInactivePanel:c}),[y,d,n,o,i,a,s,l,f,c]);return(0,lu.jsx)(au.Provider,{value:S,children:(0,lu.jsx)("div",{ref:v,className:b,style:p,...x,children:m})})}var zl=require("react");var ur=require("react/jsx-runtime");function ea({startIcon:e,description:t,extra:r,showArrow:n=!0,children:o,className:i="",ref:a,onClick:s,onKeyDown:l,...f}){let{size:c,variant:w,color:p,expandIconPosition:m,expandIcon:v}=qn(),{isActive:x,disabled:h,headerId:k,panelId:T,onToggle:y}=li(),d=C(c,Rl,"md"),u=C(p,v0,"primary"),g=w==="other"?"":C(p,C(w,x0,"outlined"),"primary"),b=n&&m!=="none",S=()=>b?typeof v=="function"?(0,ur.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 transition-transform duration-200 text-neutral-400 ${x?"rotate-180":"rotate-0"}`,"aria-hidden":"true",children:v({isActive:x,disabled:h})}):v?(0,ur.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 transition-transform duration-200 text-neutral-400 ${x?"rotate-180":"rotate-0"}`,"aria-hidden":"true",children:v}):(0,ur.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 transition-transform duration-200 text-neutral-400 ${x?"rotate-180 text-neutral-700":"rotate-0"}`,"aria-hidden":"true",children:(0,ur.jsx)(yt,{className:d.icon})}):null,R=["w-full flex items-center justify-between transition-colors duration-150 select-none",d.header,d.gap,h?"cursor-not-allowed opacity-60":g,i].filter(Boolean).join(" "),D=["flex items-center flex-1 min-w-0 text-left outline-none cursor-pointer bg-transparent border-0 p-0",d.gap,h?"cursor-not-allowed pointer-events-none":`${u.focusRing} focus-visible:ring-2 focus-visible:ring-offset-1 rounded-lg`].filter(Boolean).join(" ");return(0,ur.jsxs)("div",{className:R,children:[(0,ur.jsxs)("button",{ref:a,id:k,type:"button","aria-expanded":x,"aria-controls":T,"aria-disabled":h?!0:void 0,disabled:h,onClick:P=>{y(),s?.(P)},onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),y()),l?.(P)},className:D,...f,children:[m==="left"&&S(),(0,ur.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e&&(0,ur.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 ${u.activeIndicator} ${d.startIcon}`,"aria-hidden":"true",children:e}),(0,ur.jsxs)("div",{className:"flex flex-col min-w-0 flex-1",children:[(0,ur.jsx)("span",{className:`truncate ${d.title} ${u.title}`,children:o}),t&&(0,ur.jsx)("span",{className:`line-clamp-2 ${d.description}`,children:t})]})]}),m==="right"&&!r&&S()]}),r&&(0,ur.jsxs)("div",{className:"inline-flex items-center gap-2.5 shrink-0 ml-3",children:[r,m==="right"&&S()]})]})}var Pl=require("react/jsx-runtime");function ta({destroyInactivePanel:e,children:t,className:r="",style:n,ref:o,...i}){let{size:a,destroyInactivePanel:s}=qn(),{isActive:l,headerId:f,panelId:c}=li(),w=C(a,Rl,"md");return(0,Pl.jsx)("div",{ref:o,id:c,role:"region","aria-labelledby":f,"aria-hidden":!l,"data-state":l?"open":"closed",className:`grid transition-[grid-template-rows] duration-200 ease-in-out ${l?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,style:n,...i,children:(0,Pl.jsx)("div",{className:"overflow-hidden",children:(!(e??s)||l)&&(0,Pl.jsx)("div",{className:`${w.content} ${r}`,children:t})})})}var Zn=require("react/jsx-runtime");function Il({value:e,label:t,description:r,startIcon:n,extra:o,disabled:i=!1,showArrow:a=!0,headerClassName:s="",contentClassName:l="",destroyInactivePanel:f,className:c="",children:w,ref:p,...m}){let v=(0,zl.useId)(),{activeKeys:x,handleToggle:h,variant:k,color:T,radius:y}=qn(),d=x.has(e),u=`collapse-header-${e??v}`,g=`collapse-panel-${e??v}`,b=(0,zl.useMemo)(()=>({value:e,isActive:d,disabled:i,headerId:u,panelId:g,onToggle:()=>!i&&h(e)}),[e,d,i,u,g,h]),S=k==="separated"?C(y,Dl,"md"):"",D=["group",k==="other"?"":C(T,C(k,h0,"outlined"),"primary"),S,i?"opacity-50 cursor-not-allowed":"",c].filter(Boolean).join(" ");return(0,Zn.jsx)(su.Provider,{value:b,children:(0,Zn.jsx)("div",{ref:p,className:D,"data-state":d?"open":"closed",...m,children:t!==void 0?(0,Zn.jsxs)(Zn.Fragment,{children:[(0,Zn.jsx)(ea,{startIcon:n,description:r,extra:o,showArrow:a,className:s,children:t}),(0,Zn.jsx)(ta,{destroyInactivePanel:f,className:l,children:w})]}):w})})}var Ml=require("react"),cu=require("react/jsx-runtime");function Fl({open:e,defaultOpen:t=!1,destroyInactivePanel:r=!1,className:n="",children:o,ref:i,...a}){let s=(0,Ml.useId)(),l=e!==void 0,[f]=(0,Ml.useState)(t),c=l?e:f;return(0,cu.jsx)("div",{ref:i,id:s,role:"region","aria-hidden":!c,"data-state":c?"open":"closed",className:`grid transition-[grid-template-rows] duration-200 ease-in-out ${c?"grid-rows-[1fr]":"grid-rows-[0fr]"} ${n}`,...a,children:(0,cu.jsx)("div",{className:"overflow-hidden",children:(!r||c)&&o})})}var ui=require("react");var El=require("react"),uu=(0,El.createContext)(null);function Jn(){let e=(0,El.useContext)(uu);if(!e)throw new Error("Tabs compound components must be used within <Tabs>");return e}var du=require("react/jsx-runtime");function xo({activeKey:e,defaultActiveKey:t,onChange:r,onClose:n,size:o="md",variant:i="line",color:a="primary",radius:s="md",orientation:l="horizontal",placement:f="top",fullWidth:c=!1,disabled:w=!1,destroyInactiveTabPane:p=!1,className:m="",children:v,ref:x,...h}){let k=e!==void 0,[T,y]=(0,ui.useState)(t),d=k?e:T,u=(0,ui.useCallback)(P=>{k||y(P),r?.(P)},[k,r]),g=(0,ui.useCallback)(P=>{n?.(P)},[n]),b=(0,ui.useMemo)(()=>({activeKey:d,setActiveKey:u,size:o,variant:i,color:a,radius:s,orientation:l,placement:f,fullWidth:c,disabled:w,destroyInactiveTabPane:p,onCloseTab:g}),[d,u,o,i,a,s,l,f,c,w,p,g]),S=l==="vertical",R;S?R=f==="right"?"flex flex-row-reverse gap-4 items-start":"flex flex-row gap-4 items-start":R=f==="bottom"?"flex flex-col-reverse gap-3":"flex flex-col gap-3";let D=["w-full",R,m].filter(Boolean).join(" ");return(0,du.jsx)("div",{ref:x,className:D,...h,children:(0,du.jsx)(uu.Provider,{value:b,children:v})})}var D0=require("@floating-ui/react");var w0={sm:{tab:"px-3 py-1.5 text-xs font-medium",icon:"size-3.5",gap:"gap-1.5",badge:"text-[10px] px-1.5 py-0.5 min-w-4 h-4",closeBtn:"size-3.5 -mr-1 p-0.5"},md:{tab:"px-4 py-2 text-sm font-medium",icon:"size-4",gap:"gap-2",badge:"text-xs px-2 py-0.5 min-w-5 h-5",closeBtn:"size-4 -mr-1 p-0.5"},lg:{tab:"px-5 py-2.5 text-base font-medium",icon:"size-5",gap:"gap-2.5",badge:"text-xs px-2.5 py-0.5 min-w-5.5 h-5.5",closeBtn:"size-4.5 -mr-1.5 p-0.5"}},$l={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-full"},C0={line:(e,t)=>e==="vertical"?t==="right"?"border-l border-neutral-200 dark:border-neutral-800 gap-1":"border-r border-neutral-200 dark:border-neutral-800 gap-1":t==="bottom"?"border-t border-neutral-200 dark:border-neutral-800 gap-2":"border-b border-neutral-200 dark:border-neutral-800 gap-2",solid:()=>"bg-neutral-100 dark:bg-neutral-800/80 p-1 gap-1",bordered:()=>"border border-neutral-200 dark:border-neutral-700/80 p-1 gap-1 bg-neutral-50/50 dark:bg-neutral-900/50",flat:()=>"bg-neutral-100/60 dark:bg-neutral-800/40 p-1 gap-1"},k0={primary:{line:{active:"text-primary-700 dark:text-primary-400 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-primary-600 dark:hover:text-primary-300"},solid:{active:"text-primary-700 dark:text-primary-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-primary-700 dark:text-primary-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-primary-700 dark:text-primary-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-primary-700 dark:hover:text-primary-300"}},secondary:{line:{active:"text-secondary-700 dark:text-secondary-400 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-secondary-600 dark:hover:text-secondary-300"},solid:{active:"text-secondary-700 dark:text-secondary-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-secondary-700 dark:text-secondary-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-secondary-700 dark:text-secondary-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-secondary-700 dark:hover:text-secondary-300"}},neutral:{line:{active:"text-neutral-950 dark:text-neutral-50 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-950 dark:hover:text-neutral-100"},solid:{active:"text-neutral-950 dark:text-neutral-50 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-neutral-950 dark:text-neutral-50 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-neutral-950 dark:text-neutral-50 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-100"}},error:{line:{active:"text-error-700 dark:text-error-400 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-error-600 dark:hover:text-error-300"},solid:{active:"text-error-700 dark:text-error-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-error-700 dark:text-error-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-error-700 dark:text-error-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-error-700 dark:hover:text-error-300"}},success:{line:{active:"text-success-700 dark:text-success-400 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-success-600 dark:hover:text-success-300"},solid:{active:"text-success-700 dark:text-success-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-success-700 dark:text-success-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-success-700 dark:text-success-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-success-700 dark:hover:text-success-300"}},warning:{line:{active:"text-warning-700 dark:text-warning-400 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-warning-600 dark:hover:text-warning-300"},solid:{active:"text-warning-700 dark:text-warning-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-warning-700 dark:text-warning-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-warning-700 dark:text-warning-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-warning-700 dark:hover:text-warning-300"}},info:{line:{active:"text-info-700 dark:text-info-400 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-info-600 dark:hover:text-info-300"},solid:{active:"text-info-700 dark:text-info-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-info-700 dark:text-info-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-info-700 dark:text-info-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-info-700 dark:hover:text-info-300"}}},S0={line:{primary:"bg-primary-600 dark:bg-primary-400",secondary:"bg-secondary-600 dark:bg-secondary-400",neutral:"bg-neutral-900 dark:bg-neutral-100",error:"bg-error-600 dark:bg-error-400",success:"bg-success-600 dark:bg-success-400",warning:"bg-warning-600 dark:bg-warning-400",info:"bg-info-600 dark:bg-info-400"},solid:{primary:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70",secondary:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70",neutral:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70",error:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70",success:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70",warning:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70",info:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70"},bordered:{primary:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs",secondary:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs",neutral:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs",error:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs",success:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs",warning:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs",info:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs"},flat:{primary:"bg-primary-100/90 dark:bg-primary-950/80",secondary:"bg-secondary-100/90 dark:bg-secondary-950/80",neutral:"bg-neutral-200/90 dark:bg-neutral-800",error:"bg-error-100/90 dark:bg-error-950/80",success:"bg-success-100/90 dark:bg-success-950/80",warning:"bg-warning-100/90 dark:bg-warning-950/80",info:"bg-info-100/90 dark:bg-info-950/80"}};var Nr=require("react"),T0=typeof window<"u"?Nr.useLayoutEffect:Nr.useEffect;function R0({activeKey:e,orientation:t="horizontal",placement:r="top",variant:n="line",color:o="primary",radius:i="md"}={}){let a=(0,Nr.useRef)(null),[s,l]=(0,Nr.useState)({opacity:0}),[f,c]=(0,Nr.useState)(!1),[w,p]=(0,Nr.useState)(!1),m=(0,Nr.useCallback)(()=>{if(!a.current||t==="vertical"){c(!1),p(!1);return}let{scrollLeft:T,scrollWidth:y,clientWidth:d}=a.current,u=y-d;c(T>1),p(T<u-1)},[t]),v=(0,Nr.useCallback)(()=>{if(!a.current)return;m();let T=a.current.querySelector('[role="tab"][aria-selected="true"]');if(!T){l(S=>({...S,opacity:0}));return}let y=T.closest("[data-tab-wrapper]")||T;y.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"});let{offsetLeft:d,offsetTop:u,offsetWidth:g,offsetHeight:b}=y;l(n==="line"?t==="vertical"?{transform:`translate3d(0, ${u}px, 0)`,height:`${b}px`,width:"2px",top:0,left:r==="right"?0:void 0,right:r!=="right"?0:void 0,opacity:1}:{transform:`translate3d(${d}px, 0, 0)`,width:`${g}px`,height:"2px",left:0,top:r==="bottom"?0:void 0,bottom:r!=="bottom"?0:void 0,opacity:1}:{transform:`translate3d(${d}px, ${u}px, 0)`,width:`${g}px`,height:`${b}px`,top:0,left:0,opacity:1})},[m,t,r,n]);return T0(()=>{v()},[v,e,n,t,r,o,i]),T0(()=>{v();let T=requestAnimationFrame(v),y=new ResizeObserver(v);if(a.current){y.observe(a.current);let u=a.current.querySelectorAll("[data-tab-wrapper], [role='tab']");for(let g of u)y.observe(g)}let d=()=>v();return window.addEventListener("resize",d),()=>{cancelAnimationFrame(T),y.disconnect(),window.removeEventListener("resize",d)}},[v]),{listRef:a,indicatorStyle:s,canScrollLeft:f,canScrollRight:w,checkScroll:m,handleScrollLeft:()=>{a.current&&a.current.scrollBy({left:-200,behavior:"smooth"})},handleScrollRight:()=>{a.current&&a.current.scrollBy({left:200,behavior:"smooth"})},handleKeyDown:T=>{if(!a.current)return;let y=Array.from(a.current.querySelectorAll('[role="tab"]:not([disabled])'));if(!y.length)return;let d=y.findIndex(R=>R===document.activeElement||R.getAttribute("aria-selected")==="true"),u=-1,g=t==="horizontal",b=g?"ArrowRight":"ArrowDown",S=g?"ArrowLeft":"ArrowUp";T.key===b?(T.preventDefault(),u=(d+1)%y.length):T.key===S?(T.preventDefault(),u=(d-1+y.length)%y.length):T.key==="Home"?(T.preventDefault(),u=0):T.key==="End"&&(T.preventDefault(),u=y.length-1),u>=0&&y[u]&&(y[u]?.focus(),y[u]?.click())}}}var yn=require("react/jsx-runtime");function vo({children:e,className:t="",extra:r,centered:n=!1,ref:o,...i}){let{activeKey:a,orientation:s="horizontal",placement:l="top",variant:f="line",color:c="primary",radius:w="md",fullWidth:p=!1}=Jn(),{listRef:m,indicatorStyle:v,canScrollLeft:x,canScrollRight:h,checkScroll:k,handleScrollLeft:T,handleScrollRight:y,handleKeyDown:d}=R0({activeKey:a,orientation:s,placement:l,variant:f,color:c,radius:w}),u=(0,D0.useMergeRefs)([m,o]),g=C(w,$l,"md"),b=f==="other"?"":C(f,C0,"line"),S=typeof b=="function"?b(s,l):"",R=f==="other"?"":C(c,C(f,S0,"line"),"primary"),D=s==="vertical",P=x||h,E=["relative flex-1 min-w-0",D?"flex flex-col items-stretch justify-start w-full":`flex flex-row items-center overflow-x-auto overflow-y-hidden [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden scroll-smooth ${p?"w-full":""}`,n&&!D?"justify-center":"",f!=="line"?g:"",S,t].filter(Boolean).join(" "),N=["absolute pointer-events-none z-0 transition-all duration-300 ease-out",f!=="line"?g:"",R].filter(Boolean).join(" ");return(0,yn.jsxs)("div",{className:D?"flex flex-col items-start gap-2 shrink-0 min-w-44":"flex items-center justify-between gap-1 w-full min-w-0",children:[!D&&P&&(0,yn.jsx)("button",{type:"button","aria-label":"Scroll tabs left",disabled:!x,onClick:T,className:"shrink-0 flex items-center justify-center size-7 rounded-md text-neutral-500 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100 hover:bg-neutral-100 dark:hover:bg-neutral-800 disabled:opacity-20 disabled:pointer-events-none transition-colors cursor-pointer focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500",children:(0,yn.jsx)(Sr,{className:"size-4"})}),(0,yn.jsxs)("div",{ref:u,role:"tablist","aria-orientation":s,onKeyDown:d,onScroll:k,className:E,...i,children:[(0,yn.jsx)("div",{"aria-hidden":"true",className:N,style:v}),e]}),!D&&P&&(0,yn.jsx)("button",{type:"button","aria-label":"Scroll tabs right",disabled:!h,onClick:y,className:"shrink-0 flex items-center justify-center size-7 rounded-md text-neutral-500 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100 hover:bg-neutral-100 dark:hover:bg-neutral-800 disabled:opacity-20 disabled:pointer-events-none transition-colors cursor-pointer focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500",children:(0,yn.jsx)(Tr,{className:"size-4"})}),r&&(0,yn.jsx)("div",{className:D?"w-full mt-1":"shrink-0 ml-auto pl-1",children:r})]})}var N0=require("react"),P0=require("@floating-ui/react");var wn=require("react/jsx-runtime");function yo({value:e,label:t,startIcon:r,endIcon:n,badge:o,disabled:i=!1,closable:a=!1,onClose:s,className:l="",children:f,onClick:c,onKeyDown:w,ref:p,...m}){let{activeKey:v,setActiveKey:x,size:h,variant:k,color:T,radius:y,orientation:d,fullWidth:u,disabled:g,onCloseTab:b}=Jn(),S=(0,N0.useRef)(null),R=(0,P0.useMergeRefs)([S,p]),D=g||i,P=v===e,I=B=>{D||(x(e),c?.(B))},E=B=>{B.stopPropagation(),!D&&(s?.(B),b?.(e))},N=C(h,w0,"md"),M=C(y,$l,"md"),z=C(T,k0,"primary"),H=k==="other"?{active:"",inactive:""}:C(k,z,"line"),V=`tab-${e}`,Y=`tabpanel-${e}`,$=P?H.active:H.inactive,F=d==="vertical",G=["group relative z-10 inline-flex items-center select-none",F?"justify-start text-left w-full":"justify-center text-center",k!=="line"?M:"",u&&!F?"flex-1 text-center":"",D?"opacity-40 cursor-not-allowed pointer-events-none":"",l].filter(Boolean).join(" "),A=["inline-flex items-center cursor-pointer select-none bg-transparent",F?"justify-start text-left w-full":"justify-center text-center","transition-colors duration-200 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2",k!=="line"?M:"",N.tab,N.gap,a?"pr-1.5":"",u&&!F?"flex-1 text-center":"",$,D?"opacity-40 cursor-not-allowed pointer-events-none":""].filter(Boolean).join(" ");return(0,wn.jsxs)("div",{"data-tab-wrapper":!0,className:G,children:[(0,wn.jsxs)("button",{ref:R,id:V,type:"button",role:"tab","aria-selected":P,"aria-controls":Y,"aria-disabled":D?"true":void 0,tabIndex:P?0:-1,disabled:D,onClick:I,onKeyDown:B=>{if(a&&(B.key==="Delete"||B.key==="Backspace")){if(B.preventDefault(),B.stopPropagation(),D)return;s?.(B),b?.(e)}w?.(B)},className:A,...m,children:[r&&(0,wn.jsx)("span",{className:`shrink-0 inline-flex items-center justify-center transition-colors duration-200 ${N.icon}`,"aria-hidden":"true",children:r}),(0,wn.jsx)("span",{className:`truncate ${F?"flex-1 text-left":""}`,children:t||f}),o!=null&&(0,wn.jsx)("span",{className:`inline-flex items-center justify-center font-medium rounded-full bg-neutral-200/80 dark:bg-neutral-700 text-neutral-700 dark:text-neutral-300 transition-colors duration-200 ${N.badge}`,children:o}),n&&(0,wn.jsx)("span",{className:`shrink-0 inline-flex items-center justify-center transition-colors duration-200 ${N.icon}`,"aria-hidden":"true",children:n})]}),a&&(0,wn.jsx)("button",{type:"button","aria-label":"Close tab",disabled:D,tabIndex:P?0:-1,onClick:E,className:`shrink-0 cursor-pointer rounded-full hover:bg-neutral-200/80 dark:hover:bg-neutral-700 text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200 transition-colors inline-flex items-center justify-center focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500 mr-2 ${N.closeBtn}`,children:(0,wn.jsx)(Ve,{className:"size-full pointer-events-none"})})]})}var z0=require("react/jsx-runtime");function Ll({children:e,className:t="",ref:r,...n}){return(0,z0.jsx)("div",{ref:r,className:`w-full ${t}`,...n,children:e})}var I0=require("react/jsx-runtime");function Bl({value:e,children:t,className:r="",destroyInactiveTabPane:n,ref:o,...i}){let{activeKey:a,destroyInactiveTabPane:s}=Jn(),l=a===e;if((n??s)&&!l)return null;let c=`tab-${e}`,w=`tabpanel-${e}`,p=["focus-visible:outline-hidden",l?"":"hidden",r].filter(Boolean).join(" ");return(0,I0.jsx)("div",{ref:o,id:w,role:"tabpanel",tabIndex:0,"aria-labelledby":c,hidden:!l,className:p,...i,children:t})}var Hl=require("react"),fu=(0,Hl.createContext)(null);function Ar(){let e=(0,Hl.useContext)(fu);if(!e)throw new Error("Carousel compound components (CarouselContent, CarouselSlide, CarouselPrevious, CarouselNext, CarouselPagination) must be used within <Carousel>");return e}var qe=require("react");function ps({currentIndex:e,defaultIndex:t=0,onIndexChange:r,loop:n=!1,slidesToShow:o=1,slidesToScroll:i=1,spacing:a=0,autoPlay:s=!0,interval:l=3e3,transitionDuration:f=650,pauseOnHover:c=!0,pauseOnFocus:w=!0,draggable:p=!0,size:m="md",radius:v="md"}={}){let[x,h]=(0,qe.useState)(t),[k,T]=(0,qe.useState)(0),[y,d]=(0,qe.useState)(!1),[u,g]=(0,qe.useState)(0),[b,S]=(0,qe.useState)(!1),[R,D]=(0,qe.useState)(!1),P=(0,qe.useRef)(new Set),I=(0,qe.useRef)(null),E=(0,qe.useRef)(null),N=(0,qe.useRef)(0),M=(0,qe.useRef)(0),z=e!==void 0,H=z?e:x,V=Math.max(0,n?k-1:k-o),Y=(0,qe.useCallback)(L=>{let te=L;n?k>0?te=(te+k)%k:te=0:te=Math.max(0,Math.min(te,V)),z||h(te),r?.(te)},[z,n,V,r,k]),$=n?k>1:H>0,F=n?k>1:H<k-o,G=(0,qe.useCallback)(()=>{$&&Y(H-i)},[H,$,Y,i]),A=(0,qe.useCallback)(()=>{F&&Y(H+i)},[H,F,Y,i]),j=(0,qe.useCallback)(L=>{Y(L)},[Y]),B=(0,qe.useCallback)(L=>{P.current.add(L),T(P.current.size)},[]),X=(0,qe.useCallback)(L=>{P.current.delete(L),T(P.current.size)},[]);(0,qe.useEffect)(()=>{if(!s||k<=o||c&&b||w&&R||y)return;let L=setInterval(()=>{n||H<k-o?A():j(0)},l);return()=>clearInterval(L)},[H,s,l,y,R,b,n,w,c,A,j,o,k]);let le=(0,qe.useCallback)(L=>{if(!p||k<=o||L.button!==0)return;let te=L.clientX;N.current=te,M.current=te,d(!0),g(0);let Z=L.currentTarget;try{Z.setPointerCapture(L.pointerId)}catch{}},[p,o,k]),ne=(0,qe.useCallback)(L=>{if(!y)return;let te=L.clientX;M.current=te;let Z=te-N.current;if(!n){if(H===0&&Z>0){g(Z*.3);return}if(H>=k-o&&Z<0){g(Z*.3);return}}g(Z)},[H,y,n,o,k]),ue=(0,qe.useCallback)(L=>{if(!y)return;d(!1);let te=M.current-N.current;Math.abs(te)>40&&(te>0?G():A()),g(0);try{L.currentTarget.releasePointerCapture(L.pointerId)}catch{}},[y,A,G]),ie=(0,qe.useCallback)(L=>{L.key==="ArrowLeft"?(L.preventDefault(),G()):L.key==="ArrowRight"?(L.preventDefault(),A()):L.key==="Home"?(L.preventDefault(),j(0)):L.key==="End"&&(L.preventDefault(),j(V))},[V,A,G,j]),Q=(0,qe.useCallback)(()=>S(!0),[]),q=(0,qe.useCallback)(()=>S(!1),[]),ge=(0,qe.useCallback)(()=>D(!0),[]),ke=(0,qe.useCallback)(()=>D(!1),[]);return{currentIndex:H,totalSlides:k,slidesToShow:o,slidesToScroll:i,spacing:a,loop:n,canScrollPrev:$,canScrollNext:F,size:m,radius:v,transitionDuration:f,isDragging:y,dragOffset:u,scrollPrev:G,scrollNext:A,scrollTo:j,registerSlide:B,unregisterSlide:X,setTotalSlides:T,viewportRef:I,containerRef:E,handlePointerDown:le,handlePointerMove:ne,handlePointerUp:ue,handlePointerCancel:ue,handleKeyDown:ie,handleMouseEnter:Q,handleMouseLeave:q,handleFocus:ge,handleBlur:ke}}var gs={sm:{arrowBtn:"size-6 p-0.5 text-xs",arrowIcon:"size-3",dot:"size-1.5",activeDot:"size-1.5",line:"w-3.5 h-1",activeLine:"w-6 h-1",fraction:"text-xs px-2 py-0.5",paginationWrapper:"px-2 py-1 gap-1.5",edgeInset:"left-1.5 right-1.5"},md:{arrowBtn:"size-8 p-1.5 text-sm",arrowIcon:"size-3.5",dot:"size-2",activeDot:"size-2",line:"w-5 h-1.5",activeLine:"w-8 h-1.5",fraction:"text-xs px-2.5 py-0.5 font-medium",paginationWrapper:"px-2.5 py-1 gap-2",edgeInset:"left-2 right-2"},lg:{arrowBtn:"size-9 p-2 text-sm",arrowIcon:"size-4",dot:"size-2.5",activeDot:"size-2.5",line:"w-7 h-2",activeLine:"w-11 h-2",fraction:"text-sm px-3 py-1 font-medium",paginationWrapper:"px-3 py-1.5 gap-2.5",edgeInset:"left-2.5 right-2.5"}},M0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},pu={glass:"bg-white/40 dark:bg-black/35 backdrop-blur-md border border-white/40 dark:border-white/15 text-primary-950 dark:text-white shadow-md hover:bg-white/70 dark:hover:bg-black/60 active:scale-90 disabled:opacity-25 disabled:pointer-events-none",filled:"bg-primary-600 text-white shadow-md hover:bg-primary-700 active:bg-primary-800 disabled:bg-neutral-300 dark:disabled:bg-neutral-800 disabled:text-neutral-500 disabled:opacity-50",outline:"border border-primary-600 text-primary-600 bg-white/70 dark:bg-neutral-900/70 backdrop-blur-sm hover:bg-primary-50 dark:hover:bg-primary-950 disabled:border-neutral-300 disabled:text-neutral-400",ghost:"text-primary-600 hover:bg-primary-100/60 dark:hover:bg-primary-950/60 active:bg-primary-200/60 disabled:text-neutral-400"},gu="bg-black/25 dark:bg-white/15 backdrop-blur-md border border-white/20 dark:border-white/15 shadow-sm rounded-full",ms={active:"bg-primary-600 dark:bg-primary-400 shadow-sm",inactive:"bg-white/60 dark:bg-white/40 hover:bg-white/90 dark:hover:bg-white/70 transition-colors"};var mu=require("react/jsx-runtime");function bu({currentIndex:e,defaultIndex:t=0,onIndexChange:r,loop:n=!1,slidesToShow:o=1,slidesToScroll:i=1,spacing:a=0,autoPlay:s=!0,interval:l=3e3,transitionDuration:f=650,pauseOnHover:c=!0,pauseOnFocus:w=!0,draggable:p=!0,size:m="md",radius:v="md",children:x,className:h="",style:k,ref:T,...y}){let d=ps({currentIndex:e,defaultIndex:t,onIndexChange:r,loop:n,slidesToShow:o,slidesToScroll:i,spacing:a,autoPlay:s,interval:l,transitionDuration:f,pauseOnHover:c,pauseOnFocus:w,draggable:p,size:m,radius:v}),u=C(v,M0,"md");return(0,mu.jsx)(fu.Provider,{value:d,children:(0,mu.jsx)("div",{ref:T,role:"region","aria-roledescription":"carousel","aria-label":"B\u0103ng chuy\u1EC1n",tabIndex:0,onKeyDown:d.handleKeyDown,onMouseEnter:d.handleMouseEnter,onMouseLeave:d.handleMouseLeave,onFocus:d.handleFocus,onBlur:d.handleBlur,className:`relative overflow-hidden group focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${u} ${h}`,style:k,...y,children:x})})}var hu=require("react/jsx-runtime");function xu({children:e,className:t="",style:r,ref:n,...o}){let{currentIndex:i,slidesToShow:a,spacing:s,transitionDuration:l,isDragging:f,dragOffset:c,viewportRef:w,handlePointerDown:p,handlePointerMove:m,handlePointerUp:v,handlePointerCancel:x}=Ar(),h=typeof s=="number"?`${s}px`:s||"0px",k=`translateX(calc(-${i} * ((100% + ${h}) / ${a}) + ${c}px))`,T={display:"flex",flexDirection:"row",gap:h,transform:k,transition:f?"none":`transform ${l}ms cubic-bezier(0.25, 1, 0.5, 1)`,touchAction:"pan-y",width:"100%"};return(0,hu.jsx)("div",{ref:w,className:`overflow-hidden relative w-full h-full cursor-grab ${f?"cursor-grabbing select-none":""}`,onPointerDown:p,onPointerMove:m,onPointerUp:v,onPointerCancel:x,children:(0,hu.jsx)("div",{ref:n,role:"presentation",className:`flex ${t}`,style:{...T,...r},...o,children:e})})}var Vl=require("react");var F0=require("react/jsx-runtime");function vu({children:e,className:t="",style:r,ref:n,...o}){let i=(0,Vl.useId)(),{slidesToShow:a,spacing:s,registerSlide:l,unregisterSlide:f}=Ar();(0,Vl.useEffect)(()=>(l(i),()=>{f(i)}),[i,l,f]);let c=typeof s=="number"?`${s}px`:s||"0px",w={...r};return a>1||c!=="0px"?w.flex=`0 0 calc((100% - ${a-1} * ${c}) / ${a})`:w.flex="0 0 100%",(0,F0.jsx)("div",{ref:n,role:"group","aria-roledescription":"slide",className:`min-w-0 shrink-0 grow-0 select-none box-border relative overflow-hidden ${t}`,style:w,...o,children:e})}var bs=require("react/jsx-runtime");function yu({variant:e="glass",icon:t,className:r="",disabled:n,onClick:o,ref:i,...a}){let{scrollPrev:s,canScrollPrev:l,size:f}=Ar(),c=n!==void 0?n:!l,w=C(f,gs,"md"),p=C(e,pu,"glass"),m=(0,bs.jsx)(Sr,{className:w.arrowIcon}),v=["absolute left-2 top-1/2 -translate-y-1/2 inline-flex items-center justify-center font-medium leading-none rounded-full transition-all duration-200 cursor-pointer select-none outline-none disabled:cursor-not-allowed disabled:pointer-events-none disabled:opacity-25 focus-visible:ring-2 focus-visible:ring-primary-500/50 active:scale-90 z-10",p,w.arrowBtn,r].filter(Boolean).join(" ");return(0,bs.jsx)("button",{ref:i,type:"button","aria-label":"Slide tr\u01B0\u1EDBc",disabled:c,onClick:x=>{s(),o?.(x)},className:v,...a,children:t||m})}function wu({variant:e="glass",icon:t,className:r="",disabled:n,onClick:o,ref:i,...a}){let{scrollNext:s,canScrollNext:l,size:f}=Ar(),c=n!==void 0?n:!l,w=C(f,gs,"md"),p=C(e,pu,"glass"),m=(0,bs.jsx)(Tr,{className:w.arrowIcon}),v=["absolute right-2 top-1/2 -translate-y-1/2 inline-flex items-center justify-center font-medium leading-none rounded-full transition-all duration-200 cursor-pointer select-none outline-none disabled:cursor-not-allowed disabled:pointer-events-none disabled:opacity-25 focus-visible:ring-2 focus-visible:ring-primary-500/50 active:scale-90 z-10",p,w.arrowBtn,r].filter(Boolean).join(" ");return(0,bs.jsx)("button",{ref:i,type:"button","aria-label":"Slide ti\u1EBFp theo",disabled:c,onClick:x=>{s(),o?.(x)},className:v,...a,children:t||m})}var di=require("react/jsx-runtime");function Cu({type:e="dots",clickable:t=!0,className:r="",ref:n,...o}){let{currentIndex:i,totalSlides:a,slidesToShow:s,loop:l,scrollTo:f,size:c}=Ar();if(e==="none"||a<=1)return null;let w=C(c,gs,"md"),p=l?a:Math.max(1,a-s+1);return e==="fraction"?(0,di.jsx)("div",{ref:n,role:"status","aria-live":"polite",className:`absolute z-10 bottom-2.5 left-1/2 -translate-x-1/2 inline-flex items-center justify-center font-medium ${gu} text-white ${w.fraction} ${r}`,...o,children:(0,di.jsxs)("span",{children:[Math.min(i+1,p)," / ",p]})}):(0,di.jsx)("div",{ref:n,role:"tablist","aria-label":"Ph\xE2n trang b\u0103ng chuy\u1EC1n",className:`absolute z-10 bottom-2.5 left-1/2 -translate-x-1/2 inline-flex items-center justify-center ${gu} ${w.paginationWrapper} ${r}`,...o,children:Array.from({length:p}).map((m,v)=>{let x=v===i;return e==="line"?(0,di.jsx)("button",{type:"button",role:"tab","aria-selected":x,"aria-label":`Chuy\u1EC3n \u0111\u1EBFn slide ${v+1}`,disabled:!t,onClick:()=>t&&f(v),className:`transition-all duration-300 rounded-full outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${x?`${w.activeLine} ${ms.active}`:`${w.line} ${ms.inactive}`} ${t?"cursor-pointer":"cursor-default"}`},v):(0,di.jsx)("button",{type:"button",role:"tab","aria-selected":x,"aria-label":`Chuy\u1EC3n \u0111\u1EBFn slide ${v+1}`,disabled:!t,onClick:()=>t&&f(v),className:`transition-colors duration-200 rounded-full outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${w.dot} ${x?ms.active:ms.inactive} ${t?"cursor-pointer":"cursor-default"}`},v)})})}var rn=require("react"),dt=require("@floating-ui/react");var Al=require("react"),ku=(0,Al.createContext)(null),tn=()=>{let e=(0,Al.useContext)(ku);if(!e)throw new Error("Dropdown compound components must be used within a <Dropdown> component.");return e};var E0=require("react/jsx-runtime");function Ol({children:e,open:t,defaultOpen:r=!1,onOpenChange:n,trigger:o="click",placement:i="bottom-start",offset:a=4,flip:s=!0,shift:l=!0,size:f="md",radius:c="md",color:w="primary",disabled:p=!1,animated:m=!0,animationDuration:v=150,closeOnSelect:x=!0}){let[h,k]=(0,rn.useState)(r),[T,y]=(0,rn.useState)(null),d=(0,rn.useRef)([]),u=(0,rn.useRef)([]),g=t!==void 0,b=g?t:h,S=(0,rn.useCallback)(j=>{g||k(j),j||y(null),n?.(j)},[g,n]),R=(0,rn.useMemo)(()=>[(0,dt.offset)(a),s?(0,dt.flip)():void 0,l?(0,dt.shift)({padding:8}):void 0].filter(Boolean),[a,s,l]),{refs:D,floatingStyles:P,context:I,placement:E}=(0,dt.useFloating)({placement:i,open:b&&!p,onOpenChange:S,whileElementsMounted:dt.autoUpdate,transform:!1,middleware:R}),N=(0,dt.useClick)(I,{enabled:!p&&o==="click"}),M=(0,dt.useHover)(I,{enabled:!p&&o==="hover",delay:{open:100,close:150},handleClose:(0,dt.safePolygon)()}),z=(0,dt.useDismiss)(I),H=(0,dt.useRole)(I,{role:"menu"}),V=(0,dt.useListNavigation)(I,{listRef:d,activeIndex:T,onNavigate:y,loop:!0}),Y=(0,dt.useTypeahead)(I,{listRef:u,activeIndex:T,onMatch:b?y:void 0}),{getReferenceProps:$,getFloatingProps:F,getItemProps:G}=(0,dt.useInteractions)([N,M,z,H,V,Y]),A=(0,rn.useMemo)(()=>({isOpen:b,setIsOpen:S,refs:D,floatingStyles:P,context:I,getReferenceProps:$,getFloatingProps:F,getItemProps:G,elementsRef:d,labelsRef:u,activeIndex:T,setActiveIndex:y,size:f,radius:c,color:w,disabled:p,animated:m,animationDuration:v,closeOnSelect:x,computedPlacement:E}),[b,S,D,P,I,$,F,G,d,u,T,y,f,c,w,p,m,v,x,E]);return(0,E0.jsx)(ku.Provider,{value:A,children:e})}var ra=require("react");var Tu=require("@floating-ui/react"),Su=require("react/jsx-runtime");function Gp({children:e,ref:t,disabled:r,className:n="",...o}){let i=(0,ra.isValidElement)(e)?e.props?.ref:void 0,a=(0,Tu.useMergeRefs)([t,i]);if(!(0,ra.isValidElement)(e))return null;let s=e.props||{};return(0,ra.cloneElement)(e,{...o,...s,ref:a,disabled:r?!0:s.disabled,className:[s.className,n].filter(Boolean).join(" ")})}function jp({ref:e,children:t,className:r="",asChild:n=!1,...o}){let{refs:i,getReferenceProps:a,isOpen:s,disabled:l}=tn(),f=(0,Tu.useMergeRefs)([i.setReference,e]),c=a({...o,"aria-expanded":s,"aria-haspopup":"menu",className:r});return(0,ra.isValidElement)(t)&&(n||!0)?(0,Su.jsx)(Gp,{ref:f,disabled:l,...c,children:t}):(0,Su.jsx)("button",{ref:f,type:"button",disabled:l,"aria-expanded":s,"aria-haspopup":"menu",className:r,...c,children:t})}var Ru=jp;var oa=require("@floating-ui/react");var na={xs:{menu:"p-1 min-w-36 text-xs",item:"px-2 py-1 text-xs rounded",itemGap:"gap-1.5",icon:"size-3.5",header:"px-2 py-1 text-[10px]",description:"text-[10px]",shortcut:"text-[10px] px-1 py-0.5"},sm:{menu:"p-1.5 min-w-44 text-xs",item:"px-2.5 py-1.5 text-xs rounded-md",itemGap:"gap-2",icon:"size-4",header:"px-2.5 py-1 text-xs",description:"text-[11px]",shortcut:"text-[11px] px-1.5 py-0.5"},md:{menu:"p-1.5 min-w-52 text-sm",item:"px-3 py-2 text-sm rounded-lg",itemGap:"gap-2.5",icon:"size-4.5",header:"px-3 py-1.5 text-xs",description:"text-xs",shortcut:"text-xs px-1.5 py-0.5"},lg:{menu:"p-2 min-w-60 text-base",item:"px-3.5 py-2.5 text-base rounded-xl",itemGap:"gap-3",icon:"size-5",header:"px-3.5 py-1.5 text-sm",description:"text-sm",shortcut:"text-sm px-2 py-0.5"},xl:{menu:"p-2.5 min-w-72 text-lg",item:"px-4 py-3 text-lg rounded-2xl",itemGap:"gap-3.5",icon:"size-6",header:"px-4 py-2 text-base",description:"text-base",shortcut:"text-base px-2 py-1"}},$0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-3xl"},L0={primary:{active:"bg-primary-50 text-primary-900",selected:"bg-primary-100 text-primary-900 font-medium",focus:"focus:bg-primary-50 focus:text-primary-900"},secondary:{active:"bg-secondary-50 text-secondary-900",selected:"bg-secondary-100 text-secondary-900 font-medium",focus:"focus:bg-secondary-50 focus:text-secondary-900"},neutral:{active:"bg-neutral-100 text-neutral-900",selected:"bg-neutral-200 text-neutral-900 font-medium",focus:"focus:bg-neutral-100 focus:text-neutral-900"},error:{active:"bg-error-50 text-error-900",selected:"bg-error-100 text-error-900 font-medium",focus:"focus:bg-error-50 focus:text-error-900"},success:{active:"bg-success-50 text-success-900",selected:"bg-success-100 text-success-900 font-medium",focus:"focus:bg-success-50 focus:text-success-900"},warning:{active:"bg-warning-50 text-warning-900",selected:"bg-warning-100 text-warning-900 font-medium",focus:"focus:bg-warning-50 focus:text-warning-900"},info:{active:"bg-info-50 text-info-900",selected:"bg-info-100 text-info-900 font-medium",focus:"focus:bg-info-50 focus:text-info-900"}},Du={default:"text-error-600 hover:bg-error-50 hover:text-error-700",active:"bg-error-50 text-error-700",focus:"focus:bg-error-50 focus:text-error-700"};var Gl=require("react/jsx-runtime");function jl({ref:e,children:t,className:r="",style:n,minWidth:o,zIndex:i=lt.DROPDOWN,...a}){let{isOpen:s,refs:l,floatingStyles:f,context:c,getFloatingProps:w,elementsRef:p,labelsRef:m,size:v,radius:x,animated:h,animationDuration:k,computedPlacement:T}=tn(),y=(0,oa.useMergeRefs)([l.setFloating,e]),{isMounted:d,styles:u}=rt(c,{duration:k,animated:h});if(!d)return null;let g=C(v,na,"md"),b=C(x,$0,"md"),S=["bg-neutral-white border-2 border-neutral-200 shadow-lg outline-none focus:outline-none flex flex-col",g.menu,b,r].filter(Boolean).join(" ");return(0,Gl.jsx)(oa.FloatingPortal,{children:(0,Gl.jsx)("div",{ref:y,style:{...f,...h?u:{},minWidth:o,zIndex:i,...n},className:S,"data-state":s?"open":"closed","data-placement":T,...w(a),children:(0,Gl.jsx)(oa.FloatingList,{elementsRef:p,labelsRef:m,children:t})})})}var Ul=require("@floating-ui/react");var Qn=require("react/jsx-runtime");function Up({ref:e,children:t,onClick:r,disabled:n=!1,danger:o=!1,selected:i=!1,startIcon:a,endIcon:s,shortcut:l,description:f,className:c="",closeOnSelect:w,...p}){let{getItemProps:m,activeIndex:v,setIsOpen:x,color:h,size:k,closeOnSelect:T}=tn(),y=typeof t=="string"?t:void 0,{ref:d,index:u}=(0,Ul.useListItem)({label:y}),g=(0,Ul.useMergeRefs)([d,e]),b=v===u,S=C(k,na,"md"),R=C(h,L0,"primary"),D=E=>{if(n){E.preventDefault();return}r?.(E),(w??T)&&x(!1)},P=n?"opacity-50 cursor-not-allowed text-neutral-400 select-none":o?`${Du.default} ${b?Du.active:""} cursor-pointer`:i?`${R.selected} cursor-pointer`:`${b?R.active:"text-neutral-700 hover:bg-neutral-100 hover:text-neutral-900"} cursor-pointer`,I=["w-full text-left flex items-center select-none transition-colors duration-100 outline-none focus:outline-none",S.item,S.itemGap,P,c].filter(Boolean).join(" ");return(0,Qn.jsxs)("button",{ref:g,type:"button",role:"menuitem",disabled:n,"aria-disabled":n,tabIndex:b?0:-1,...m({...p,onClick:D,className:I}),children:[a&&(0,Qn.jsx)("span",{className:`flex items-center justify-center shrink-0 ${S.icon}`,children:a}),(0,Qn.jsxs)("div",{className:"flex-1 flex flex-col min-w-0",children:[(0,Qn.jsx)("span",{className:"truncate",children:t}),f&&(0,Qn.jsx)("span",{className:`text-neutral-500 truncate ${S.description}`,children:f})]}),l&&(0,Qn.jsx)("kbd",{className:`shrink-0 rounded border border-neutral-200 bg-neutral-50 font-mono text-neutral-500 tracking-wider ${S.shortcut}`,children:l}),s&&(0,Qn.jsx)("span",{className:`flex items-center justify-center shrink-0 ${S.icon}`,children:s})]})}var Nu=Up;var B0=require("react/jsx-runtime");function Pu({children:e,className:t="",...r}){let{size:n}=tn(),o=C(n,na,"md");return(0,B0.jsx)("div",{role:"presentation",className:["font-semibold text-neutral-500 uppercase tracking-wider select-none",o.header,t].filter(Boolean).join(" "),...r,children:e})}var zu=Pu;var H0=require("react/jsx-runtime");function Yp({className:e="",...t}){return(0,H0.jsx)("hr",{className:["-mx-1 my-1 h-px border-0 bg-neutral-200",e].filter(Boolean).join(" "),...t})}var Iu=Yp;var Yl=require("react/jsx-runtime");function Wp({children:e,label:t,className:r="",...n}){return(0,Yl.jsxs)("div",{role:"group",className:["flex flex-col",r].filter(Boolean).join(" "),...n,children:[t&&(0,Yl.jsx)(Pu,{children:t}),e]})}var Mu=Wp;var fi=require("react"),Ct=require("@floating-ui/react");var Wl=require("react"),Fu=(0,Wl.createContext)(null),Jt=()=>{let e=(0,Wl.useContext)(Fu);if(!e)throw new Error("Popover compound components must be used within a <Popover> component.");return e};var V0=require("react/jsx-runtime");function ia({children:e,open:t,defaultOpen:r=!1,onOpenChange:n,trigger:o="click",placement:i="bottom",offset:a=8,flip:s=!0,shift:l=!0,size:f="md",radius:c="md",color:w="neutral",disabled:p=!1,animated:m=!0,animationDuration:v=150,modal:x=!1,closeOnEsc:h=!0,closeOnClickOutside:k=!0}){let[T,y]=(0,fi.useState)(r),d=t!==void 0,u=d?t:T,g=(0,fi.useCallback)(Y=>{d||y(Y),n?.(Y)},[d,n]),b=(0,fi.useMemo)(()=>[(0,Ct.offset)(a),s?(0,Ct.flip)():void 0,l?(0,Ct.shift)({padding:8}):void 0].filter(Boolean),[a,s,l]),{refs:S,floatingStyles:R,context:D,placement:P}=(0,Ct.useFloating)({placement:i,open:u&&!p,onOpenChange:g,whileElementsMounted:Ct.autoUpdate,transform:!1,middleware:b}),I=(0,Ct.useClick)(D,{enabled:!p&&o==="click"}),E=(0,Ct.useHover)(D,{enabled:!p&&o==="hover",delay:{open:100,close:150},handleClose:(0,Ct.safePolygon)()}),N=(0,Ct.useDismiss)(D,{escapeKey:h,outsidePress:k}),M=(0,Ct.useRole)(D,{role:"dialog"}),{getReferenceProps:z,getFloatingProps:H}=(0,Ct.useInteractions)([I,E,N,M]),V=(0,fi.useMemo)(()=>({isOpen:u,setIsOpen:g,refs:S,floatingStyles:R,context:D,getReferenceProps:z,getFloatingProps:H,size:f,radius:c,color:w,disabled:p,animated:m,animationDuration:v,modal:x,computedPlacement:P}),[u,g,S,R,D,z,H,f,c,w,p,m,v,x,P]);return(0,V0.jsx)(Fu.Provider,{value:V,children:e})}var aa=require("react");var $u=require("@floating-ui/react"),Eu=require("react/jsx-runtime");function Kp({children:e,ref:t,disabled:r,className:n="",...o}){let i=(0,aa.isValidElement)(e)?e.props?.ref:void 0,a=(0,$u.useMergeRefs)([t,i]);if(!(0,aa.isValidElement)(e))return null;let s=e.props||{};return(0,aa.cloneElement)(e,{...o,...s,ref:a,disabled:r?!0:s.disabled,className:[s.className,n].filter(Boolean).join(" ")})}function _p({ref:e,children:t,className:r="",asChild:n=!1,...o}){let{refs:i,getReferenceProps:a,isOpen:s,disabled:l}=Jt(),f=(0,$u.useMergeRefs)([i.setReference,e]),c=a({...o,"aria-expanded":s,"aria-haspopup":"dialog",className:r});return(0,aa.isValidElement)(t)&&(n||!0)?(0,Eu.jsx)(Kp,{ref:f,disabled:l,...c,children:t}):(0,Eu.jsx)("button",{ref:f,type:"button",disabled:l,"aria-expanded":s,"aria-haspopup":"dialog",className:r,...c,children:t})}var hs=_p;var sa=require("@floating-ui/react");var wo={xs:{container:"min-w-44 text-xs",header:"px-2.5 py-1.5 text-xs font-semibold",body:"px-2.5 py-2 text-xs",footer:"px-2.5 py-1.5 text-xs"},sm:{container:"min-w-56 text-xs",header:"px-3 py-2 text-xs font-semibold",body:"px-3 py-2.5 text-xs",footer:"px-3 py-2 text-xs"},md:{container:"min-w-64 text-sm",header:"px-4 py-3 text-sm font-semibold",body:"px-4 py-3 text-sm",footer:"px-4 py-2.5 text-sm"},lg:{container:"min-w-80 text-base",header:"px-5 py-3.5 text-base font-semibold",body:"px-5 py-4 text-base",footer:"px-5 py-3 text-base"},xl:{container:"min-w-96 text-lg",header:"px-6 py-4 text-lg font-semibold",body:"px-6 py-5 text-lg",footer:"px-6 py-4 text-lg"}},A0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-3xl"};var Kl=require("react/jsx-runtime");function Lu({ref:e,children:t,className:r="",style:n,minWidth:o,maxWidth:i,zIndex:a=lt.POPOVER,...s}){let{isOpen:l,refs:f,floatingStyles:c,context:w,getFloatingProps:p,size:m,radius:v,animated:x,animationDuration:h,modal:k,computedPlacement:T}=Jt(),y=(0,sa.useMergeRefs)([f.setFloating,e]),{isMounted:d,styles:u}=rt(w,{duration:h,animated:x});if(!d)return null;let g=C(m,wo,"md"),b=C(v,A0,"md"),R=["bg-neutral-white shadow-xl outline-none focus:outline-none flex flex-col border-2 border-neutral-200",g.container,b,r].filter(Boolean).join(" "),D=(0,Kl.jsx)(sa.FloatingFocusManager,{context:w,modal:k,children:(0,Kl.jsx)("div",{ref:y,style:{...c,...x?u:{},minWidth:o,maxWidth:i,zIndex:a,...n},className:R,"data-state":l?"open":"closed","data-placement":T,...p(s),children:t})});return(0,Kl.jsx)(sa.FloatingPortal,{children:D})}var Bu=Lu;var O0=require("react/jsx-runtime");function Hu({children:e,className:t="",...r}){let{size:n}=Jt(),o=C(n,wo,"md");return(0,O0.jsx)("h2",{className:["text-neutral-900 border-b border-neutral-100 font-semibold",o.header,t].filter(Boolean).join(" "),...r,children:e})}var Vu=Hu;var G0=require("react/jsx-runtime");function Au({children:e,className:t="",...r}){let{size:n}=Jt(),o=C(n,wo,"md");return(0,G0.jsx)("div",{className:["text-neutral-700",o.body,t].filter(Boolean).join(" "),...r,children:e})}var Ou=Au;var j0=require("react/jsx-runtime");function Xp({children:e,className:t="",...r}){let{size:n}=Jt(),o=C(n,wo,"md");return(0,j0.jsx)("div",{className:["border-t border-neutral-100 bg-neutral-50/50",o.footer,t].filter(Boolean).join(" "),...r,children:e})}var Gu=Xp;var la=require("react");var U0=require("@floating-ui/react"),ju=require("react/jsx-runtime");function qp({children:e,ref:t,className:r="",onClick:n,...o}){let i=(0,la.isValidElement)(e)?e.props?.ref:void 0,a=(0,U0.useMergeRefs)([t,i]);if(!(0,la.isValidElement)(e))return null;let s=e.props||{};return(0,la.cloneElement)(e,{...o,...s,ref:a,className:[s.className,r].filter(Boolean).join(" "),onClick:l=>{s.onClick?.(l),n?.(l)}})}function Zp({ref:e,children:t,className:r="",asChild:n=!1,onClick:o,...i}){let{setIsOpen:a}=Jt(),s=l=>{o?.(l),l.defaultPrevented||a(!1)};return(0,la.isValidElement)(t)&&n?(0,ju.jsx)(qp,{ref:e,className:r,onClick:s,...i,children:t}):(0,ju.jsx)("button",{ref:e,type:"button",className:r,onClick:s,...i,children:t})}var Uu=Zp;var So=require("react"),Nt=require("@floating-ui/react");var pi=require("react");var Y0={months:["Th\xE1ng 1","Th\xE1ng 2","Th\xE1ng 3","Th\xE1ng 4","Th\xE1ng 5","Th\xE1ng 6","Th\xE1ng 7","Th\xE1ng 8","Th\xE1ng 9","Th\xE1ng 10","Th\xE1ng 11","Th\xE1ng 12"],monthsShort:["Thg 1","Thg 2","Thg 3","Thg 4","Thg 5","Thg 6","Thg 7","Thg 8","Thg 9","Thg 10","Thg 11","Thg 12"],weekdays:["Ch\u1EE7 Nh\u1EADt","Th\u1EE9 Hai","Th\u1EE9 Ba","Th\u1EE9 T\u01B0","Th\u1EE9 N\u0103m","Th\u1EE9 S\xE1u","Th\u1EE9 B\u1EA3y"],weekdaysShort:["CN","T2","T3","T4","T5","T6","T7"],weekdaysMin:["CN","T2","T3","T4","T5","T6","T7"],todayText:"H\xF4m nay",clearText:"X\xF3a",weekText:"Tu\u1EA7n",viewTabs:{days:"Ng\xE0y",months:"Th\xE1ng",years:"N\u0103m"}},W0={months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],todayText:"Today",clearText:"Clear",weekText:"Week",viewTabs:{days:"Day",months:"Month",years:"Year"}},Or={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",icon:"size-3",iconSize:12,calendarPadding:"p-2",cellSize:"w-7 h-7",cellText:"text-[11px]",headerText:"text-xs font-semibold",headerButtonSize:"h-6 w-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",icon:"size-3.5",iconSize:14,calendarPadding:"p-2.5",cellSize:"w-8 h-8",cellText:"text-xs",headerText:"text-xs font-semibold",headerButtonSize:"h-7 w-7",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",icon:"size-[18px]",iconSize:16,calendarPadding:"p-3",cellSize:"w-9 h-9",cellText:"text-sm",headerText:"text-sm font-semibold",headerButtonSize:"h-8 w-8",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",icon:"size-5",iconSize:18,calendarPadding:"p-4",cellSize:"w-10 h-10",cellText:"text-base",headerText:"text-base font-semibold",headerButtonSize:"h-9 w-9",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",icon:"size-6",iconSize:20,calendarPadding:"p-4.5",cellSize:"w-11 h-11",cellText:"text-base",headerText:"text-lg font-semibold",headerButtonSize:"h-10 w-10",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}};var Co={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},K0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},ko={primary:{selected:"bg-primary-500 text-neutral-white hover:bg-primary-600",selectedText:"text-neutral-white",rangeBg:"bg-primary-100 text-primary-900",rangeText:"text-primary-900",hoverBg:"hover:bg-primary-200 hover:text-primary-900",todayRing:"border-primary-500 text-primary-500",activeText:"text-primary-500",accentBg:"bg-primary-500"},secondary:{selected:"bg-secondary-500 text-neutral-white hover:bg-secondary-600",selectedText:"text-neutral-white",rangeBg:"bg-secondary-100 text-secondary-900",rangeText:"text-secondary-900",hoverBg:"hover:bg-secondary-200 hover:text-secondary-900",todayRing:"border-secondary-500 text-secondary-500",activeText:"text-secondary-500",accentBg:"bg-secondary-500"},neutral:{selected:"bg-neutral-800 text-neutral-white hover:bg-neutral-900",selectedText:"text-neutral-white",rangeBg:"bg-neutral-200 text-neutral-900",rangeText:"text-neutral-900",hoverBg:"hover:bg-neutral-300 hover:text-neutral-900",todayRing:"border-neutral-600 text-neutral-600",activeText:"text-neutral-800",accentBg:"bg-neutral-800"},error:{selected:"bg-error-500 text-neutral-white hover:bg-error-600",selectedText:"text-neutral-white",rangeBg:"bg-error-100 text-error-900",rangeText:"text-error-900",hoverBg:"hover:bg-error-200 hover:text-error-900",todayRing:"border-error-500 text-error-500",activeText:"text-error-500",accentBg:"bg-error-500"},success:{selected:"bg-success-500 text-neutral-white hover:bg-success-600",selectedText:"text-neutral-white",rangeBg:"bg-success-100 text-success-900",rangeText:"text-success-900",hoverBg:"hover:bg-success-200 hover:text-success-900",todayRing:"border-success-500 text-success-500",activeText:"text-success-500",accentBg:"bg-success-500"},warning:{selected:"bg-warning-500 text-neutral-950 hover:bg-warning-600",selectedText:"text-neutral-950",rangeBg:"bg-warning-100 text-warning-900",rangeText:"text-warning-900",hoverBg:"hover:bg-warning-200 hover:text-warning-900",todayRing:"border-warning-500 text-warning-700",activeText:"text-warning-700",accentBg:"bg-warning-500"},info:{selected:"bg-info-500 text-neutral-white hover:bg-info-600",selectedText:"text-neutral-white",rangeBg:"bg-info-100 text-info-900",rangeText:"text-info-900",hoverBg:"hover:bg-info-200 hover:text-info-900",todayRing:"border-info-500 text-info-500",activeText:"text-info-500",accentBg:"bg-info-500"}},_0={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"}};function Dt(e){return!e||e==="vi"?Y0:e==="en"?W0:e}function jt(e,t){if(!e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:new Date(e.getTime());if(typeof e=="string"){let r=e.trim();if(!r)return null;if(t){let o=_l(r,t);if(o)return o}let n=new Date(r);return isNaN(n.getTime())?null:n}if(typeof e=="number"){let r=new Date(e);return isNaN(r.getTime())?null:r}return null}function eo(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function xs(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}function ca(e,t){let r=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),n=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return r<n}function ua(e,t){let r=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),n=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return r>n}function da(e){let t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())),r=t.getUTCDay()||7;t.setUTCDate(t.getUTCDate()+4-r);let n=new Date(Date.UTC(t.getUTCFullYear(),0,1));return Math.ceil(((t.getTime()-n.getTime())/864e5+1)/7)}function X0(e,t){return new Date(e,t+1,0).getDate()}function vs(e,t,r=1,n,o,i,a){let s=[],l=new Date,f=new Date(e,t,1).getDay(),c=X0(e,t-1),w=X0(e,t),p=r===1?f===0?6:f-1:f;for(let v=p-1;v>=0;v--){let x=c-v,h=new Date(e,t-1,x);s.push(Yu(h,!1,l,n,o,i,a))}for(let v=1;v<=w;v++){let x=new Date(e,t,v);s.push(Yu(x,!0,l,n,o,i,a))}let m=42-s.length;for(let v=1;v<=m;v++){let x=new Date(e,t+1,v);s.push(Yu(x,!1,l,n,o,i,a))}return s}function Yu(e,t,r,n,o,i,a){let s=n?eo(e,n):!1,l=!1;return o&&ca(e,o)&&(l=!0),i&&ua(e,i)&&(l=!0),a&&a(e)&&(l=!0),{date:e,day:e.getDate(),month:e.getMonth(),year:e.getFullYear(),isCurrentMonth:t,isToday:eo(e,r),isSelected:s,isDisabled:l,weekNumber:da(e)}}function dr(e,t="DD/MM/YYYY",r){if(!e||isNaN(e.getTime()))return"";let n=Dt(r),o=e.getFullYear(),i=e.getMonth(),a=e.getDate(),s=e.getHours(),l=e.getMinutes(),f=e.getSeconds(),c=e.getDay(),w=x=>String(x).padStart(2,"0"),p=s%12||12,m=s>=12?"PM":"AM",v={YYYY:String(o),YY:String(o).slice(-2),MMMM:n.months[i]??"",MMM:n.monthsShort[i]??"",MM:w(i+1),M:String(i+1),DD:w(a),D:String(a),dddd:n.weekdays[c]??"",ddd:n.weekdaysShort[c]??"",dd:n.weekdaysMin[c]??"",HH:w(s),H:String(s),hh:w(p),h:String(p),mm:w(l),m:String(l),ss:w(f),s:String(f),A:m,a:m.toLowerCase()};return t.replace(/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|ddd|dd|HH|H|hh|h|mm|m|ss|s|A|a/g,x=>v[x]??x)}function _l(e,t="DD/MM/YYYY"){if(!e||typeof e!="string")return null;let r=e.trim();if(!r)return null;let n=new Date().getFullYear(),o=1,i=1,a=0,s=0,l=0,f=t.match(/YYYY|YY|MM|M|DD|D|HH|H|hh|h|mm|m|ss|s/g);if(!f){let m=new Date(r);return isNaN(m.getTime())?null:m}let c="^"+t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");for(let m of f)m==="YYYY"?c=c.replace("YYYY","(\\d{4})"):m==="YY"?c=c.replace("YY","(\\d{2})"):(m==="MM"||m==="M"||m==="DD"||m==="D"||m==="HH"||m==="H"||m==="hh"||m==="h"||m==="mm"||m==="m"||m==="ss"||m==="s")&&(c=c.replace(m,"(\\d{1,2})"));c+="$";let w=new RegExp(c).exec(r);if(!w){let m=new Date(r);return isNaN(m.getTime())?null:m}f.forEach((m,v)=>{let x=w[v+1];if(!x)return;let h=parseInt(x,10);isNaN(h)||(m==="YYYY"?n=h:m==="YY"?n=2e3+h:m==="MM"||m==="M"?o=h:m==="DD"||m==="D"?i=h:m==="HH"||m==="H"||m==="hh"||m==="h"?a=h:m==="mm"||m==="m"?s=h:(m==="ss"||m==="s")&&(l=h))});let p=new Date(n,o-1,i,a,s,l);return isNaN(p.getTime())?null:p}function Xl(e,t="days"){if(t==="days")return e;if(t==="years")return e.includes("YYYY")?"YYYY":e.includes("YY")?"YY":"YYYY";if(t==="months"){let r=e.replace(/(?:DD|D|dddd|ddd|dd)\s*[-/.,\s]+\s*/,"");return r=r.replace(/\s*[-/.,\s]+\s*(?:DD|D|dddd|ddd|dd)/,""),r=r.replace(/[-/.,\s]{2,}/g,n=>n.charAt(0)).trim(),!r||!r.includes("M")&&!r.includes("Y")?e.includes("-")?"MM-YYYY":"MM/YYYY":r}return e}var fr=require("react/jsx-runtime");function fa({currentMonth:e,view:t,onViewChange:r,onPrevMonth:n,onNextMonth:o,onPrevYear:i,onNextYear:a,onPrevDecade:s,onNextDecade:l,size:f="md",color:c="primary",locale:w,showMonthButtons:p=!0}){let m=Dt(w),v=C(f,Or,"md"),x=C(c,ko,"primary"),h=e.getFullYear(),k=e.getMonth(),T=Math.floor(h/10)*10,y=T+9,d=()=>{t==="days"?r("months"):t==="months"?r("years"):t==="years"&&r("days")},u=()=>{t==="years"?s?s():i():t==="months"?i():n()},g=()=>{t==="years"?l?l():a():t==="months"?a():o()},b=()=>t==="years"?`${T} - ${y}`:t==="months"?`${h}`:`${m.months[k]} ${h}`;return(0,fr.jsxs)("div",{className:"flex items-center justify-between px-1 pb-1.5 border-b border-neutral-200",children:[(0,fr.jsxs)("div",{className:"flex items-center space-x-0.5",children:[t==="days"&&(0,fr.jsx)("button",{type:"button",onClick:i,"aria-label":"N\u0103m tr\u01B0\u1EDBc",className:`flex items-center justify-center ${v.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:(0,fr.jsx)(Un,{width:14,height:14})}),p&&(0,fr.jsx)("button",{type:"button",onClick:u,"aria-label":"Th\xE1ng tr\u01B0\u1EDBc",className:`flex items-center justify-center ${v.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:(0,fr.jsx)(Sr,{width:14,height:14})})]}),(0,fr.jsx)("button",{type:"button",onClick:d,className:`${v.headerText} px-2 py-1 rounded-md text-neutral-800 hover:bg-neutral-100 hover:${x.activeText} transition-colors cursor-pointer`,children:b()}),(0,fr.jsxs)("div",{className:"flex items-center space-x-0.5",children:[p&&(0,fr.jsx)("button",{type:"button",onClick:g,"aria-label":"Th\xE1ng ti\u1EBFp theo",className:`flex items-center justify-center ${v.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:(0,fr.jsx)(Tr,{width:14,height:14})}),t==="days"&&(0,fr.jsx)("button",{type:"button",onClick:a,"aria-label":"N\u0103m ti\u1EBFp theo",className:`flex items-center justify-center ${v.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:(0,fr.jsx)(Yn,{width:14,height:14})})]})]})}var ql=Hn(require("react"),1);var nn=require("react/jsx-runtime");function pa({days:e,onSelectDate:t,size:r="md",color:n="primary",radius:o,locale:i,firstDayOfWeek:a=1,showWeekNumbers:s=!1}){let l=Dt(i),f=C(r,Or,"md"),c=C(n,ko,"primary"),w=C(o,Co,"lg"),p=(0,ql.useRef)(null),m=[...l.weekdaysShort];if(a===1){let d=m.shift();m.push(d)}let v=e.some(d=>d.isSelected&&!d.isDisabled),x=e.findIndex(d=>d.isToday&&!d.isDisabled),h=e.findIndex(d=>d.isCurrentMonth&&!d.isDisabled),k=h!==-1?h:e.findIndex(d=>!d.isDisabled),T=d=>{let g=p.current?.querySelectorAll("button")?.[d];g&&!g.disabled&&g.focus()},y=(d,u)=>{let g=null;if(d.key==="ArrowRight"){d.preventDefault();for(let b=u+1;b<e.length;b++)if(!e[b].isDisabled){g=b;break}}else if(d.key==="ArrowLeft"){d.preventDefault();for(let b=u-1;b>=0;b--)if(!e[b].isDisabled){g=b;break}}else if(d.key==="ArrowDown")d.preventDefault(),u+7<e.length&&!e[u+7].isDisabled&&(g=u+7);else if(d.key==="ArrowUp")d.preventDefault(),u-7>=0&&!e[u-7].isDisabled&&(g=u-7);else if(d.key==="Home"){d.preventDefault();let b=u-u%7;for(let S=b;S<b+7&&S<e.length;S++)if(!e[S].isDisabled){g=S;break}}else if(d.key==="End"){d.preventDefault();let b=Math.min(e.length-1,u-u%7+6);for(let S=b;S>=u-u%7;S--)if(!e[S].isDisabled){g=S;break}}else if(d.key==="Enter"||d.key===" "){d.preventDefault();let b=e[u];b&&!b.isDisabled&&t(b.date);return}g!==null&&T(g)};return(0,nn.jsxs)("div",{ref:p,role:"grid","aria-label":l.months[e[15]?.month||0],className:"w-full",children:[(0,nn.jsxs)("div",{role:"row",className:`grid ${s?"grid-cols-8":"grid-cols-7"} gap-1 mb-1 text-center`,children:[s&&(0,nn.jsx)("div",{role:"columnheader","aria-label":l.weekText||"Week",className:`flex items-center justify-center ${f.cellSize} text-neutral-400 ${f.cellText} font-medium`,children:"#"}),m.map(d=>(0,nn.jsx)("div",{role:"columnheader","aria-label":d,className:`flex items-center justify-center ${f.cellSize} text-neutral-500 ${f.cellText} font-medium`,children:d},d))]}),(0,nn.jsx)("div",{role:"rowgroup",className:`grid ${s?"grid-cols-8":"grid-cols-7"} gap-y-1 gap-x-1`,children:e.map((d,u)=>{let g=u%7===0,b="text-neutral-800 hover:bg-neutral-100";d.isDisabled?b="text-neutral-300 cursor-not-allowed line-through":d.isSelected?b=`${c.selected} font-semibold shadow-xs`:d.isCurrentMonth||(b="text-neutral-400 hover:bg-neutral-100");let S=d.isToday&&!d.isSelected?`ring-1 ${c.todayRing} font-bold`:"",R=`${d.day} ${l.months[d.month]} ${d.year}`,D=!d.isDisabled&&(d.isSelected||!v&&d.isToday&&u===x||!v&&x===-1&&u===k);return(0,nn.jsxs)(ql.default.Fragment,{children:[s&&g&&(0,nn.jsxs)("div",{className:`flex items-center justify-center ${f.cellSize} text-neutral-400 ${f.cellText} text-[10px] font-mono`,children:["W",d.weekNumber]}),(0,nn.jsx)("div",{role:"gridcell","aria-selected":d.isSelected,className:"flex items-center justify-center",children:(0,nn.jsx)("button",{type:"button",disabled:d.isDisabled,tabIndex:D?0:-1,onKeyDown:P=>y(P,u),onClick:()=>!d.isDisabled&&t(d.date),"aria-label":R,"aria-current":d.isToday?"date":void 0,"aria-disabled":d.isDisabled,className:`flex items-center justify-center ${f.cellSize} ${f.cellText} ${w} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${b} ${S}`,children:d.day})})]},d.date.toISOString())})})]})}var q0=require("react");var Zl=require("react/jsx-runtime");function ga({currentMonth:e,selectedDate:t,onSelectMonth:r,size:n="md",color:o="primary",radius:i,locale:a}){let s=Dt(a),l=C(n,Or,"md"),f=C(o,ko,"primary"),c=C(i,Co,"lg"),w=(0,q0.useRef)(null),p=e.getFullYear(),m=new Date,v=m.getMonth(),x=m.getFullYear(),h=t&&t.getFullYear()===p?t.getMonth():-1,k=h!==-1?h:x===p?v:0,T=d=>{let g=w.current?.querySelectorAll("button")?.[d];g&&g.focus()},y=(d,u)=>{let g=null;if(d.key==="ArrowRight")d.preventDefault(),u+1<s.monthsShort.length&&(g=u+1);else if(d.key==="ArrowLeft")d.preventDefault(),u-1>=0&&(g=u-1);else if(d.key==="ArrowDown")d.preventDefault(),u+3<s.monthsShort.length&&(g=u+3);else if(d.key==="ArrowUp")d.preventDefault(),u-3>=0&&(g=u-3);else if(d.key==="Home")d.preventDefault(),g=0;else if(d.key==="End")d.preventDefault(),g=s.monthsShort.length-1;else if(d.key==="Enter"||d.key===" "){d.preventDefault(),r(u);return}g!==null&&T(g)};return(0,Zl.jsx)("div",{ref:w,role:"grid","aria-label":"Ch\u1ECDn th\xE1ng",className:"grid grid-cols-3 gap-2 py-2",children:s.monthsShort.map((d,u)=>{let g=new Date(p,u,1),b=t?xs(g,t):!1,S=x===p&&v===u,R=u===k,D="text-neutral-800 hover:bg-neutral-100";return b?D=`${f.selected} font-semibold shadow-xs`:S&&(D=`ring-1 ${f.todayRing} font-semibold`),(0,Zl.jsx)("div",{role:"gridcell","aria-selected":b,className:"flex items-center justify-center",children:(0,Zl.jsx)("button",{type:"button",tabIndex:R?0:-1,onKeyDown:P=>y(P,u),onClick:()=>r(u),"aria-label":`${d} ${p}`,className:`w-full flex items-center justify-center h-10 ${l.cellText} ${c} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${D}`,children:d})},d)})})}var Z0=require("react");var Jl=require("react/jsx-runtime");function ma({currentMonth:e,selectedDate:t,onSelectYear:r,size:n="md",color:o="primary",radius:i}){let a=C(n,Or,"md"),s=C(o,ko,"primary"),l=C(i,Co,"lg"),f=(0,Z0.useRef)(null),c=e.getFullYear(),w=t?t.getFullYear():c,p=Math.floor(c/10)*10,m=new Date().getFullYear(),v=[];for(let d=0;d<12;d++)v.push(p+d);let x=v.indexOf(w),h=v.indexOf(m),k=x!==-1?x:h!==-1?h:0,T=d=>{let g=f.current?.querySelectorAll("button")?.[d];g&&g.focus()},y=(d,u)=>{let g=null;if(d.key==="ArrowRight")d.preventDefault(),u+1<v.length&&(g=u+1);else if(d.key==="ArrowLeft")d.preventDefault(),u-1>=0&&(g=u-1);else if(d.key==="ArrowDown")d.preventDefault(),u+3<v.length&&(g=u+3);else if(d.key==="ArrowUp")d.preventDefault(),u-3>=0&&(g=u-3);else if(d.key==="Home")d.preventDefault(),g=0;else if(d.key==="End")d.preventDefault(),g=v.length-1;else if(d.key==="Enter"||d.key===" "){d.preventDefault();let b=v[u];b!==void 0&&r(b);return}g!==null&&T(g)};return(0,Jl.jsx)("div",{ref:f,role:"grid","aria-label":"Ch\u1ECDn n\u0103m",className:"grid grid-cols-3 gap-2 py-2",children:v.map((d,u)=>{let g=d===w,b=d===m,S=u===k,R="text-neutral-800 hover:bg-neutral-100";return g?R=`${s.selected} font-semibold shadow-xs`:b&&(R=`ring-1 ${s.todayRing} font-semibold`),(0,Jl.jsx)("div",{role:"gridcell","aria-selected":g,className:"flex items-center justify-center",children:(0,Jl.jsx)("button",{type:"button",tabIndex:S?0:-1,onKeyDown:D=>y(D,u),onClick:()=>r(d),"aria-label":`${d}`,className:`w-full flex items-center justify-center h-10 ${a.cellText} ${l} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${R}`,children:d})},d)})})}var Gr=require("react/jsx-runtime");function on({value:e,onChange:t,view:r="days",onViewChange:n,minDate:o,maxDate:i,isDateDisabled:a,locale:s="vi",firstDayOfWeek:l=1,showWeekNumbers:f=!1,showViewTabs:c=!1,viewTabs:w=["days","months","years"],size:p="md",color:m="primary",radius:v,className:x="",bordered:h=!0}){let k=C(p,Or,"md"),T=C(v,K0,"lg"),[y,d]=(0,pi.useState)(r),[u,g]=(0,pi.useState)(r);r!==u&&(g(r),d(r));let[b,S]=(0,pi.useState)(()=>{let A=e||new Date;return new Date(A.getFullYear(),A.getMonth(),1)}),R=Dt(s),D=(0,pi.useMemo)(()=>{let A=R.viewTabs||{days:"Ng\xE0y",months:"Th\xE1ng",years:"N\u0103m"};return(w||["days","months","years"]).map(j=>({key:j,label:A[j]||j}))},[w,R.viewTabs]),P=A=>{let j=A;d(j),n?.(j)},I=()=>{let A=new Date(b.getFullYear(),b.getMonth()-1,1);S(A)},E=()=>{let A=new Date(b.getFullYear(),b.getMonth()+1,1);S(A)},N=()=>{let A=new Date(b.getFullYear()-1,b.getMonth(),1);S(A)},M=()=>{let A=new Date(b.getFullYear()+1,b.getMonth(),1);S(A)},z=()=>{let A=new Date(b.getFullYear()-10,b.getMonth(),1);S(A)},H=()=>{let A=new Date(b.getFullYear()+10,b.getMonth(),1);S(A)},V=A=>{let j=new Date(b.getFullYear(),A,1);S(j),r==="months"?t?.(j):d("days")},Y=A=>{let j=new Date(A,b.getMonth(),1);S(j),r==="years"?t?.(j):d("months")},$=jt(o),F=jt(i),G=(0,pi.useMemo)(()=>vs(b.getFullYear(),b.getMonth(),l,e,$,F,a),[b,l,e,$,F,a]);return(0,Gr.jsxs)("div",{className:`inline-flex flex-col ${h?"border-2 border-neutral-200 bg-neutral-white shadow-xl":"border-0 shadow-none bg-transparent"} ${T} overflow-hidden select-none ${x}`,children:[c&&D.length>0&&(0,Gr.jsx)("div",{className:"px-2.5 py-1.5 border-b border-neutral-200",children:(0,Gr.jsx)(xo,{activeKey:r,onChange:P,size:"sm",variant:"solid",color:m,fullWidth:!0,className:"gap-0!",children:(0,Gr.jsx)(vo,{className:"p-0.5",children:D.map(A=>(0,Gr.jsx)(yo,{value:A.key,className:"py-1 px-2 text-xs",children:A.label},A.key))})})}),(0,Gr.jsxs)("div",{className:`${k.calendarPadding} min-w-70`,children:[(0,Gr.jsx)(fa,{currentMonth:b,view:y,onViewChange:d,onPrevMonth:I,onNextMonth:E,onPrevYear:N,onNextYear:M,onPrevDecade:z,onNextDecade:H,size:p,color:m,locale:s,showMonthButtons:!0}),y==="days"&&(0,Gr.jsx)(pa,{days:G,onSelectDate:A=>t?.(A),size:p,color:m,radius:v,locale:s,firstDayOfWeek:l,showWeekNumbers:f}),y==="months"&&(0,Gr.jsx)(ga,{currentMonth:b,selectedDate:e,onSelectMonth:V,size:p,color:m,radius:v,locale:s}),y==="years"&&(0,Gr.jsx)(ma,{currentMonth:b,selectedDate:e,onSelectYear:Y,size:p,color:m,radius:v})]})]})}var kt=require("react/jsx-runtime");function To({ref:e,value:t,defaultValue:r,onChange:n,format:o="DD/MM/YYYY",displayFormat:i,defaultView:a="days",locale:s="vi",firstDayOfWeek:l=1,minDate:f,maxDate:c,isDateDisabled:w,size:p="md",variant:m="outline",color:v="primary",radius:x,label:h,labelPlacement:k="top",placeholder:T,helperText:y,errorMessage:d,name:u,id:g,autoComplete:b,viewTabs:S=["days","months","years"],view:R,onViewChange:D,onClear:P,placement:I="bottom-start",disabled:E=!1,readOnly:N=!1,portal:M=!0,config:z,className:H="",wrapperClassName:V="",inputWrapperClassName:Y="",labelClassName:$="",helperClassName:F="",popoverClassName:G=""}){let{isRequired:A=!1,isInvalid:j=!1,isLoading:B=!1,showSpinner:X=!1,isClearable:le=!0,isFullWidth:ne=!1,showWeekNumbers:ue=!1,showViewTabs:ie=!1,closeOnSelect:Q=!0}=z??{},q=(0,So.useId)(),ge=g||q,ke=`${ge}-error-helper`,L=`${ge}-popover`,te=R!==void 0,[Z,he]=(0,So.useState)(a),ae=te?R:Z,ve=i||o,Se=(0,So.useMemo)(()=>Xl(ve,ae),[ve,ae]),ye=t!==void 0,[J,O]=(0,So.useState)(()=>jt(r,o)),W=ye?jt(t,o):J,we=W?dr(W,Se,s):"",[fe,se]=(0,So.useState)(!1),{refs:{setReference:me,setFloating:Re},floatingStyles:xe,context:re}=(0,Nt.useFloating)({placement:I,open:fe&&!E&&!N&&!B,onOpenChange:se,whileElementsMounted:Nt.autoUpdate,transform:!1,middleware:[(0,Nt.offset)(6),(0,Nt.flip)(),(0,Nt.shift)({padding:8})]}),de=(0,Nt.useDismiss)(re,{escapeKey:!0,outsidePress:!0}),ce=(0,Nt.useRole)(re,{role:"dialog"}),{getReferenceProps:ee,getFloatingProps:U}=(0,Nt.useInteractions)([de,ce]),{isMounted:Ce,styles:$e}=rt(re),Ee=!!(j||d),oe=Ee?"error":v,Te=C(p,Or,"md"),Pe=C(x,Co,"lg"),Qe=m==="other"?"":C(oe,C(m,_0,"outline"),"primary"),We=!!W,Be=Ne=>{te||he(Ne),D?.(Ne)},Oe=Ne=>{ye||O(Ne);let Xe=Ne?dr(Ne,o,s):"";n?.(Xe),Q&&se(!1)},Ze=Ne=>{E||N||B||(Ne.key==="ArrowDown"||Ne.key==="Enter"||Ne.key===" "?(Ne.preventDefault(),fe||se(!0)):Ne.key==="Escape"&&fe&&(Ne.preventDefault(),se(!1)))},K=Ne=>{Ne.stopPropagation(),ye||O(null),n?.(null),P?.()},_=T||Se,ze=k==="floating",pe=k==="left",Fe=()=>(0,kt.jsx)(vt,{htmlFor:ge,label:h,isRequired:A,isFloating:ze,size:p,color:oe,hasError:Ee,cursor:"pointer",className:$}),et=Ne=>(0,kt.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${Te.icon}`,"aria-hidden":"true",children:Ne}),Ge=["group/field group/datepicker relative flex",pe?"flex-row items-center gap-3":"flex-col",ze?"pt-2":"",ne?"w-full":"inline-flex",V].filter(Boolean).join(" "),at=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",Te.inputHeight,Pe,Qe,E?"opacity-50":"",ne?"w-full":"w-auto",Y].filter(Boolean).join(" "),tt=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",Te.inputText,Te.inputPadding,H].filter(Boolean).join(" ");return M?(0,kt.jsxs)("div",{className:Ge,children:[!ze&&Fe(),(0,kt.jsxs)("div",{className:`flex flex-col ${ne?"w-full":""}`,children:[(0,kt.jsxs)("div",{ref:me,...ee(),className:at,children:[ze&&Fe(),(0,kt.jsx)("input",{ref:e,id:ge,name:u,type:"text",value:we,onClick:()=>!E&&!N&&!B&&se(Ne=>!Ne),onKeyDown:Ze,readOnly:!0,autoComplete:b,placeholder:_,disabled:E||B,role:"combobox","aria-expanded":fe&&!B,"aria-haspopup":"dialog","aria-controls":L,"aria-required":A,"aria-invalid":Ee,"aria-busy":B,"aria-disabled":E||B,"aria-describedby":y||d?ke:void 0,"aria-errormessage":d?ke:void 0,className:tt}),(0,kt.jsxs)("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[B&&X&&(0,kt.jsx)("div",{className:"flex items-center justify-center shrink-0",children:et((0,kt.jsx)(De,{}))}),!B&&le&&!E&&!N&&(0,kt.jsx)("button",{type:"button",onClick:K,"aria-label":"X\xF3a ng\xE0y",tabIndex:We?0:-1,"aria-hidden":!We,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${Te.icon} ${We?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,kt.jsx)(Ve,{className:"size-full"})}),(0,kt.jsx)("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${fe?"rotate-180":"rotate-0"}`,children:et((0,kt.jsx)(yt,{className:"size-full"}))})]})]}),Ce&&(0,kt.jsx)(Nt.FloatingPortal,{children:(0,kt.jsx)(Nt.FloatingFocusManager,{context:re,modal:!1,returnFocus:!0,children:(0,kt.jsx)("div",{ref:Re,id:L,style:{...xe,...$e,zIndex:lt.PICKER},...U(),className:G,children:(0,kt.jsx)(on,{value:W,onChange:Oe,view:ae,onViewChange:Be,minDate:f,maxDate:c,isDateDisabled:w,locale:s,firstDayOfWeek:l,showWeekNumbers:ue,size:p,color:v,radius:x,showViewTabs:ie,viewTabs:S})})})}),(0,kt.jsx)(Le,{id:ke,helperText:y,errorMessage:d,sizeClassName:Te.helper,className:F})]})]}):(0,kt.jsx)("div",{className:H,children:(0,kt.jsx)(on,{bordered:!1,value:W,onChange:Oe,view:ae,onViewChange:Be,minDate:f,maxDate:c,isDateDisabled:w,locale:s,firstDayOfWeek:l,showWeekNumbers:ue,size:p,color:v,radius:x,showViewTabs:ie,viewTabs:S})})}var Do=require("react"),Pt=require("@floating-ui/react");var sn=require("react");var jr={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",icon:"size-3",iconSize:12,calendarPadding:"p-2",cellSize:"w-7 h-7",cellText:"text-[11px]",headerText:"text-xs font-semibold",headerButtonSize:"h-6 w-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",icon:"size-3.5",iconSize:14,calendarPadding:"p-2.5",cellSize:"w-8 h-8",cellText:"text-xs",headerText:"text-xs font-semibold",headerButtonSize:"h-7 w-7",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",icon:"size-[18px]",iconSize:16,calendarPadding:"p-3",cellSize:"w-9 h-9",cellText:"text-sm",headerText:"text-sm font-semibold",headerButtonSize:"h-8 w-8",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",icon:"size-5",iconSize:18,calendarPadding:"p-4",cellSize:"w-10 h-10",cellText:"text-base",headerText:"text-base font-semibold",headerButtonSize:"h-9 w-9",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",icon:"size-6",iconSize:20,calendarPadding:"p-4.5",cellSize:"w-11 h-11",cellText:"text-base",headerText:"text-lg font-semibold",headerButtonSize:"h-10 w-10",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},Cn={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Ql={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},Ro={primary:{selected:"bg-primary-500 text-neutral-white hover:bg-primary-600",rangeBg:"bg-primary-100",rangeText:"text-primary-900",hoverBg:"hover:bg-primary-200 hover:text-primary-900",todayRing:"ring-primary-500 text-primary-600",activeText:"text-primary-600",badge:"bg-primary-100 text-primary-700"},secondary:{selected:"bg-secondary-500 text-neutral-white hover:bg-secondary-600",rangeBg:"bg-secondary-100",rangeText:"text-secondary-900",hoverBg:"hover:bg-secondary-200 hover:text-secondary-900",todayRing:"ring-secondary-500 text-secondary-600",activeText:"text-secondary-600",badge:"bg-secondary-100 text-secondary-700"},neutral:{selected:"bg-neutral-800 text-neutral-white hover:bg-neutral-900",rangeBg:"bg-neutral-200",rangeText:"text-neutral-900",hoverBg:"hover:bg-neutral-300 hover:text-neutral-900",todayRing:"ring-neutral-800 text-neutral-800",activeText:"text-neutral-800",badge:"bg-neutral-200 text-neutral-800"},error:{selected:"bg-error-500 text-neutral-white hover:bg-error-600",rangeBg:"bg-error-100",rangeText:"text-error-900",hoverBg:"hover:bg-error-200 hover:text-error-900",todayRing:"ring-error-500 text-error-600",activeText:"text-error-600",badge:"bg-error-100 text-error-700"},success:{selected:"bg-success-500 text-neutral-white hover:bg-success-600",rangeBg:"bg-success-100",rangeText:"text-success-900",hoverBg:"hover:bg-success-200 hover:text-success-900",todayRing:"ring-success-500 text-success-600",activeText:"text-success-600",badge:"bg-success-100 text-success-700"},warning:{selected:"bg-warning-500 text-neutral-950 hover:bg-warning-600",rangeBg:"bg-warning-100",rangeText:"text-warning-900",hoverBg:"hover:bg-warning-200 hover:text-warning-900",todayRing:"ring-warning-500 text-warning-700",activeText:"text-warning-700",badge:"bg-warning-100 text-warning-700"},info:{selected:"bg-info-500 text-neutral-white hover:bg-info-600",rangeBg:"bg-info-100",rangeText:"text-info-900",hoverBg:"hover:bg-info-200 hover:text-info-900",todayRing:"ring-info-500 text-info-600",activeText:"text-info-600",badge:"bg-info-100 text-info-700"}},ec={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"},other:{primary:"",secondary:"",neutral:"",error:"",success:"",warning:"",info:""}};var At=require("react/jsx-runtime");function ba({month1:e,month2:t,view:r,onViewChange:n,onPrevMonth:o,onNextMonth:i,onPrevYear:a,onNextYear:s,onPrevDecade:l,onNextDecade:f,size:c="md",color:w="primary",locale:p}){let m=Dt(p),v=C(c,jr,"md"),x=C(w,Ro,"primary"),h=m.months[e.getMonth()],k=e.getFullYear(),T=Math.floor(k/10)*10,y=T+9,d=`${h} ${k}`;r==="months"&&(d=`${k}`),r==="years"&&(d=`${T} - ${y}`);let u=m.months[t.getMonth()],g=t.getFullYear(),b=Math.floor(g/10)*10,S=b+9,R=`${u} ${g}`;r==="months"&&(R=`${g}`),r==="years"&&(R=`${b} - ${S}`);let D=()=>{r==="days"?n("months"):r==="months"?n("years"):r==="years"&&n("days")},P=()=>{r==="days"?o():r==="months"?a():r==="years"&&(l?l():a())},I=()=>{r==="days"?i():r==="months"?s():r==="years"&&(f?f():s())};return(0,At.jsxs)("div",{className:"flex items-center justify-between px-2 py-1.5 border-b border-neutral-200",children:[(0,At.jsxs)("div",{className:"flex items-center space-x-0.5",children:[r==="days"&&(0,At.jsx)("button",{type:"button",onClick:a,"aria-label":"N\u0103m tr\u01B0\u1EDBc",className:`flex items-center justify-center ${v.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:(0,At.jsx)(Un,{width:14,height:14})}),(0,At.jsx)("button",{type:"button",onClick:P,"aria-label":"Th\xE1ng tr\u01B0\u1EDBc",className:`flex items-center justify-center ${v.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:(0,At.jsx)(Sr,{width:v.iconSize,height:v.iconSize})})]}),(0,At.jsxs)("div",{className:"grid grid-cols-2 flex-1 text-center divide-x divide-transparent px-2",children:[(0,At.jsx)("div",{className:"flex items-center justify-center",children:(0,At.jsx)("button",{type:"button",onClick:D,"aria-label":"\u0110\u1ED5i ch\u1EBF \u0111\u1ED9 xem l\u1ECBch",className:`font-semibold text-neutral-800 hover:${x.activeText} hover:bg-neutral-100 rounded-md px-2 py-1 transition-colors cursor-pointer ${v.headerText}`,children:d})}),(0,At.jsx)("div",{className:"flex items-center justify-center",children:(0,At.jsx)("button",{type:"button",onClick:D,"aria-label":"\u0110\u1ED5i ch\u1EBF \u0111\u1ED9 xem l\u1ECBch",className:`font-semibold text-neutral-800 hover:${x.activeText} hover:bg-neutral-100 rounded-md px-2 py-1 transition-colors cursor-pointer ${v.headerText}`,children:R})})]}),(0,At.jsxs)("div",{className:"flex items-center space-x-0.5",children:[(0,At.jsx)("button",{type:"button",onClick:I,"aria-label":"Th\xE1ng ti\u1EBFp theo",className:`flex items-center justify-center ${v.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:(0,At.jsx)(Tr,{width:v.iconSize,height:v.iconSize})}),r==="days"&&(0,At.jsx)("button",{type:"button",onClick:s,"aria-label":"N\u0103m ti\u1EBFp theo",className:`flex items-center justify-center ${v.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:(0,At.jsx)(Yn,{width:14,height:14})})]})]})}var tc=Hn(require("react"),1);var an=require("react/jsx-runtime");function gi({days:e,onSelectDate:t,onHoverDate:r,size:n="md",color:o="primary",radius:i,locale:a,firstDayOfWeek:s=1,showWeekNumbers:l=!1}){let f=Dt(a),c=C(n,jr,"md"),w=C(o,Ro,"primary"),p=C(i,Cn,"lg"),m=(0,tc.useRef)(null),v=[...f.weekdaysShort];if(s===1){let u=v.shift();v.push(u)}let x=e.some(u=>(u.isSelected||u.isRangeStart)&&!u.isDisabled),h=e.findIndex(u=>u.isToday&&!u.isDisabled),k=e.findIndex(u=>u.isCurrentMonth&&!u.isDisabled),T=k!==-1?k:e.findIndex(u=>!u.isDisabled),y=u=>{let b=m.current?.querySelectorAll("button")?.[u];b&&!b.disabled&&b.focus()},d=(u,g)=>{let b=null;if(u.key==="ArrowRight"){u.preventDefault();for(let S=g+1;S<e.length;S++)if(!e[S].isDisabled){b=S;break}}else if(u.key==="ArrowLeft"){u.preventDefault();for(let S=g-1;S>=0;S--)if(!e[S].isDisabled){b=S;break}}else if(u.key==="ArrowDown")u.preventDefault(),g+7<e.length&&!e[g+7].isDisabled&&(b=g+7);else if(u.key==="ArrowUp")u.preventDefault(),g-7>=0&&!e[g-7].isDisabled&&(b=g-7);else if(u.key==="Home"){u.preventDefault();let S=g-g%7;for(let R=S;R<S+7&&R<e.length;R++)if(!e[R].isDisabled){b=R;break}}else if(u.key==="End"){u.preventDefault();let S=Math.min(e.length-1,g-g%7+6);for(let R=S;R>=g-g%7;R--)if(!e[R].isDisabled){b=R;break}}else if(u.key==="Enter"||u.key===" "){u.preventDefault();let S=e[g];S&&!S.isDisabled&&t(S.date);return}b!==null&&y(b)};return(0,an.jsxs)("div",{ref:m,role:"grid","aria-label":f.months[e[15]?.month||0],className:"w-full",children:[(0,an.jsxs)("div",{role:"row",className:`grid ${l?"grid-cols-8":"grid-cols-7"} gap-1 mb-1 text-center`,children:[l&&(0,an.jsx)("div",{role:"columnheader","aria-label":f.weekText||"Week",className:`flex items-center justify-center ${c.cellSize} text-neutral-400 ${c.cellText} font-medium`,children:"#"}),v.map(u=>(0,an.jsx)("div",{role:"columnheader","aria-label":u,className:`flex items-center justify-center ${c.cellSize} text-neutral-500 ${c.cellText} font-medium`,children:u},u))]}),(0,an.jsx)("div",{role:"rowgroup",className:`grid ${l?"grid-cols-8":"grid-cols-7"} gap-y-1 gap-x-1`,children:e.map((u,g)=>{let b=g%7===0,S="text-neutral-800 hover:bg-neutral-100",R="";u.isDisabled?S="text-neutral-300 cursor-not-allowed line-through":u.isRangeStart||u.isRangeEnd?(S=`${w.selected} font-semibold shadow-xs`,u.isRangeStart&&u.isRangeEnd?R="":u.isRangeStart?R=`${w.rangeBg} rounded-l-full`:u.isRangeEnd&&(R=`${w.rangeBg} rounded-r-full`)):u.isSelected?S=`${w.selected} font-semibold shadow-xs`:u.isInRange||u.isHoveredRange?(S=`${w.rangeBg} ${w.rangeText} rounded-none`,R=`${w.rangeBg}`):u.isCurrentMonth||(S="text-neutral-400 hover:bg-neutral-100");let D=u.isToday&&!u.isSelected?`ring-1 ${w.todayRing} font-bold`:"",P=`${u.day} ${f.months[u.month]} ${u.year}`,I=!u.isDisabled&&(u.isSelected||u.isRangeStart||!x&&u.isToday&&g===h||!x&&h===-1&&g===T);return(0,an.jsxs)(tc.default.Fragment,{children:[l&&b&&(0,an.jsxs)("div",{className:`flex items-center justify-center ${c.cellSize} text-neutral-400 ${c.cellText} text-[10px] font-mono`,children:["W",u.weekNumber]}),(0,an.jsx)("div",{role:"gridcell","aria-selected":u.isSelected||u.isInRange,className:`relative flex items-center justify-center ${R}`,children:(0,an.jsx)("button",{type:"button",disabled:u.isDisabled,tabIndex:I?0:-1,onKeyDown:E=>d(E,g),onClick:()=>!u.isDisabled&&t(u.date),onMouseEnter:()=>!u.isDisabled&&r?.(u.date),onMouseLeave:()=>r?.(null),"aria-label":P,"aria-current":u.isToday?"date":void 0,"aria-disabled":u.isDisabled,className:`flex items-center justify-center ${c.cellSize} ${c.cellText} ${p} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${S} ${D}`,children:u.day})})]},u.date.toISOString())})})]})}var J0=require("react");var rc=require("react/jsx-runtime");function mi({currentMonth:e,onSelectMonth:t,size:r="md",color:n="primary",radius:o,locale:i,rangeStart:a,rangeEnd:s,hoveredDate:l,onHoverMonth:f}){let c=Dt(i),w=C(r,jr,"md"),p=C(n,Ro,"primary"),m=C(o,Cn,"lg"),v=(0,J0.useRef)(null),x=e.getFullYear(),h=new Date,k=h.getMonth(),T=h.getFullYear(),y=a&&a.getFullYear()===x?a.getMonth():-1,d=y!==-1?y:T===x?k:0,u=b=>{let R=v.current?.querySelectorAll("button")?.[b];R&&R.focus()},g=(b,S)=>{let R=null;if(b.key==="ArrowRight")b.preventDefault(),S+1<c.monthsShort.length&&(R=S+1);else if(b.key==="ArrowLeft")b.preventDefault(),S-1>=0&&(R=S-1);else if(b.key==="ArrowDown")b.preventDefault(),S+3<c.monthsShort.length&&(R=S+3);else if(b.key==="ArrowUp")b.preventDefault(),S-3>=0&&(R=S-3);else if(b.key==="Home")b.preventDefault(),R=0;else if(b.key==="End")b.preventDefault(),R=c.monthsShort.length-1;else if(b.key==="Enter"||b.key===" "){b.preventDefault(),t(S);return}R!==null&&u(R)};return(0,rc.jsx)("div",{ref:v,role:"grid","aria-label":"Ch\u1ECDn th\xE1ng",className:"grid grid-cols-3 gap-2 py-2",onMouseLeave:()=>f?.(null),children:c.monthsShort.map((b,S)=>{let R=new Date(x,S,1),D=R.getTime(),P=a?new Date(a.getFullYear(),a.getMonth(),1).getTime():null,I=s?new Date(s.getFullYear(),s.getMonth(),1).getTime():null,E=l?new Date(l.getFullYear(),l.getMonth(),1).getTime():null,N=!!P&&P===D,M=!!I&&I===D,z=!1,H=!1;P&&I?z=D>P&&D<I:P&&!I&&E&&(E>P?H=D>P&&D<=E:E<P&&(H=D<P&&D>=E));let V=T===x&&k===S,Y=S===d,$="text-neutral-800 hover:bg-neutral-100";return N||M?$=`${p.selected} font-semibold shadow-xs`:z||H?$=`${p.rangeBg} ${p.rangeText}`:V&&($=`ring-1 ${p.todayRing} font-semibold`),(0,rc.jsx)("div",{role:"gridcell","aria-selected":N||M||z,className:"flex items-center justify-center",children:(0,rc.jsx)("button",{type:"button",tabIndex:Y?0:-1,onKeyDown:F=>g(F,S),onClick:()=>t(S),onMouseEnter:()=>f?.(R),"aria-label":`${b} ${x}`,className:`w-full flex items-center justify-center h-10 ${w.cellText} ${m} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${$}`,children:b})},b)})})}var Q0=require("react");var nc=require("react/jsx-runtime");function bi({currentMonth:e,onSelectYear:t,size:r="md",color:n="primary",radius:o,rangeStart:i,rangeEnd:a,hoveredDate:s,onHoverYear:l}){let f=C(r,jr,"md"),c=C(n,Ro,"primary"),w=C(o,Cn,"lg"),p=(0,Q0.useRef)(null),m=e.getFullYear(),v=Math.floor(m/10)*10,x=new Date().getFullYear(),h=[];for(let b=0;b<12;b++)h.push(v+b);let k=i?i.getFullYear():m,T=h.indexOf(k),y=h.indexOf(x),d=T!==-1?T:y!==-1?y:0,u=b=>{let R=p.current?.querySelectorAll("button")?.[b];R&&R.focus()},g=(b,S)=>{let R=null;if(b.key==="ArrowRight")b.preventDefault(),S+1<h.length&&(R=S+1);else if(b.key==="ArrowLeft")b.preventDefault(),S-1>=0&&(R=S-1);else if(b.key==="ArrowDown")b.preventDefault(),S+3<h.length&&(R=S+3);else if(b.key==="ArrowUp")b.preventDefault(),S-3>=0&&(R=S-3);else if(b.key==="Home")b.preventDefault(),R=0;else if(b.key==="End")b.preventDefault(),R=h.length-1;else if(b.key==="Enter"||b.key===" "){b.preventDefault();let D=h[S];D!==void 0&&t(D);return}R!==null&&u(R)};return(0,nc.jsx)("div",{ref:p,role:"grid","aria-label":"Ch\u1ECDn n\u0103m",className:"grid grid-cols-3 gap-2 py-2",onMouseLeave:()=>l?.(null),children:h.map((b,S)=>{let R=i?i.getFullYear():null,D=a?a.getFullYear():null,P=s?s.getFullYear():null,I=R!==null&&b===R,E=D!==null&&b===D,N=!1,M=!1;R!==null&&D!==null?N=b>R&&b<D:R!==null&&D===null&&P!==null&&(P>R?M=b>R&&b<=P:P<R&&(M=b<R&&b>=P));let z=b===x,H=S===d,V="text-neutral-800 hover:bg-neutral-100";return I||E?V=`${c.selected} font-semibold shadow-xs`:N||M?V=`${c.rangeBg} ${c.rangeText}`:z&&(V=`ring-1 ${c.todayRing} font-semibold`),(0,nc.jsx)("div",{role:"gridcell","aria-selected":I||E||N,className:"flex items-center justify-center",children:(0,nc.jsx)("button",{type:"button",tabIndex:H?0:-1,onKeyDown:Y=>g(Y,S),onClick:()=>t(b),onMouseEnter:()=>l?.(new Date(b,0,1)),"aria-label":`${b}`,className:`w-full flex items-center justify-center h-10 ${f.cellText} ${w} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${V}`,children:b})},b)})})}function Ku(e,t,r){if(!t||!r)return!1;let n=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),o=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),i=new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime(),a=Math.min(o,i),s=Math.max(o,i);return n>=a&&n<=s}function ef(e,t){return new Date(e,t+1,0).getDate()}function Wu(e,t,r,n,o,i,a,s,l){let f=n?eo(e,n):!1,c=o?eo(e,o):!1,w=Ku(e,n||null,o||null),p=n&&!o&&i?Ku(e,n,i):!1,m=!1;return a&&ca(e,a)&&(m=!0),s&&ua(e,s)&&(m=!0),l&&l(e)&&(m=!0),{date:e,day:e.getDate(),month:e.getMonth(),year:e.getFullYear(),isCurrentMonth:t,isToday:eo(e,r),isSelected:f||c,isDisabled:m,isRangeStart:f,isRangeEnd:c,isInRange:w,isHoveredRange:p,weekNumber:da(e)}}function ha(e,t,r=1,n,o,i,a,s,l){let f=[],c=new Date,w=new Date(e,t,1).getDay(),p=ef(e,t-1),m=ef(e,t),v=r===1?w===0?6:w-1:w;for(let h=v-1;h>=0;h--){let k=p-h,T=new Date(e,t-1,k);f.push(Wu(T,!1,c,n,o,i,a,s,l))}for(let h=1;h<=m;h++){let k=new Date(e,t,h);f.push(Wu(k,!0,c,n,o,i,a,s,l))}let x=42-f.length;for(let h=1;h<=x;h++){let k=new Date(e,t+1,h);f.push(Wu(k,!1,c,n,o,i,a,s,l))}return f}var Ut=require("react/jsx-runtime");function hi({value:e,onChange:t,view:r="days",onViewChange:n,minDate:o,maxDate:i,isDateDisabled:a,locale:s="vi",firstDayOfWeek:l=1,showWeekNumbers:f=!1,showViewTabs:c=!1,viewTabs:w=["days","months","years"],size:p="md",color:m="primary",radius:v,className:x="",bordered:h=!0}){let k=C(p,jr,"md"),T=C(v,Ql,"lg"),[y,d]=(0,sn.useState)(r),[u,g]=(0,sn.useState)(r);r!==u&&(g(r),d(r));let b=e?e[0]:null,S=e?e[1]:null,[R,D]=(0,sn.useState)(()=>{let L=b||new Date;return new Date(L.getFullYear(),L.getMonth(),1)}),P=Dt(s),I=(0,sn.useMemo)(()=>{let L=P.viewTabs||{days:"Ng\xE0y",months:"Th\xE1ng",years:"N\u0103m"};return(w||["days","months","years"]).map(te=>({key:te,label:L[te]||te}))},[w,P.viewTabs]),E=L=>{let te=L;d(te),F(null),n?.(te)},N=()=>{let L=new Date(R.getFullYear(),R.getMonth()-1,1);D(L)},M=()=>{let L=new Date(R.getFullYear(),R.getMonth()+1,1);D(L)},z=()=>{let L=new Date(R.getFullYear()-1,R.getMonth(),1);D(L)},H=()=>{let L=new Date(R.getFullYear()+1,R.getMonth(),1);D(L)},V=()=>{let L=new Date(R.getFullYear()-10,R.getMonth(),1);D(L)},Y=()=>{let L=new Date(R.getFullYear()+10,R.getMonth(),1);D(L)},[$,F]=(0,sn.useState)(null),[G,A]=(0,sn.useState)(null),j=L=>{if(!$)F(L),t?.([L,null]);else{let te=$,Z=L;L.getTime()<te.getTime()&&(te=L,Z=$),F(null),t?.([te,Z])}},B=(L,te)=>{let Z=new Date(L,te,1);if(D(Z),c&&r==="months")if(!$)F(Z),t?.([Z,null]);else{let he=$,ae=Z;Z.getTime()<he.getTime()&&(he=Z,ae=$),F(null),t?.([he,ae])}else d("days")},X=L=>{let te=new Date(L,0,1);if(D(te),c&&r==="years")if(!$)F(te),t?.([te,null]);else{let Z=$,he=te;te.getTime()<Z.getTime()&&(Z=te,he=$),F(null),t?.([Z,he])}else d("months")},le=jt(o),ne=jt(i),ue=R,ie=(0,sn.useMemo)(()=>y==="months"?new Date(R.getFullYear()+1,R.getMonth(),1):y==="years"?new Date(R.getFullYear()+10,R.getMonth(),1):new Date(R.getFullYear(),R.getMonth()+1,1),[R,y]),Q=$||b,q=$?null:S,ge=(0,sn.useMemo)(()=>ha(ue.getFullYear(),ue.getMonth(),l,Q,q,G,le,ne,a),[ue,l,Q,q,G,le,ne,a]),ke=(0,sn.useMemo)(()=>ha(ie.getFullYear(),ie.getMonth(),l,Q,q,G,le,ne,a),[ie,l,Q,q,G,le,ne,a]);return(0,Ut.jsxs)("div",{className:`inline-flex flex-col ${h?"border-2 border-neutral-200 bg-neutral-white shadow-xl":"border-0 shadow-none bg-transparent"} ${T} overflow-hidden select-none ${x}`,children:[c&&I.length>0&&(0,Ut.jsx)("div",{className:"px-2.5 py-1.5 border-b border-neutral-200",children:(0,Ut.jsx)(xo,{activeKey:r,onChange:E,size:"sm",variant:"solid",color:m,fullWidth:!0,className:"gap-0!",children:(0,Ut.jsx)(vo,{className:"p-0.5",children:I.map(L=>(0,Ut.jsx)(yo,{value:L.key,className:"py-1 px-2 text-xs",children:L.label},L.key))})})}),(0,Ut.jsx)(ba,{month1:ue,month2:ie,view:y,onViewChange:d,onPrevMonth:N,onNextMonth:M,onPrevYear:z,onNextYear:H,onPrevDecade:V,onNextDecade:Y,size:p,color:m,locale:s}),(0,Ut.jsxs)("div",{className:"flex flex-row divide-x divide-neutral-200",children:[(0,Ut.jsxs)("div",{className:`${k.calendarPadding} min-w-70`,children:[y==="days"&&(0,Ut.jsx)(gi,{days:ge,onSelectDate:j,onHoverDate:A,size:p,color:m,radius:v,locale:s,firstDayOfWeek:l,showWeekNumbers:f}),y==="months"&&(0,Ut.jsx)(mi,{currentMonth:ue,onSelectMonth:L=>B(ue.getFullYear(),L),size:p,color:m,radius:v,locale:s,rangeStart:Q,rangeEnd:q,hoveredDate:G,onHoverMonth:A}),y==="years"&&(0,Ut.jsx)(bi,{currentMonth:ue,onSelectYear:X,size:p,color:m,radius:v,rangeStart:Q,rangeEnd:q,hoveredDate:G,onHoverYear:A})]}),(0,Ut.jsxs)("div",{className:`${k.calendarPadding} min-w-70`,children:[y==="days"&&(0,Ut.jsx)(gi,{days:ke,onSelectDate:j,onHoverDate:A,size:p,color:m,radius:v,locale:s,firstDayOfWeek:l,showWeekNumbers:f}),y==="months"&&(0,Ut.jsx)(mi,{currentMonth:ie,onSelectMonth:L=>B(ie.getFullYear(),L),size:p,color:m,radius:v,locale:s,rangeStart:Q,rangeEnd:q,hoveredDate:G,onHoverMonth:A}),y==="years"&&(0,Ut.jsx)(bi,{currentMonth:ie,onSelectYear:X,size:p,color:m,radius:v,rangeStart:Q,rangeEnd:q,hoveredDate:G,onHoverYear:A})]})]})]})}var St=require("react/jsx-runtime");function No({ref:e,value:t,defaultValue:r,onChange:n,separator:o=" - ",format:i="DD/MM/YYYY",displayFormat:a,defaultView:s="days",locale:l="vi",firstDayOfWeek:f=1,minDate:c,maxDate:w,isDateDisabled:p,size:m="md",variant:v="outline",color:x="primary",radius:h,label:k,labelPlacement:T="top",placeholder:y,helperText:d,errorMessage:u,name:g,id:b,autoComplete:S,viewTabs:R=["days","months","years"],view:D,onViewChange:P,onClear:I,placement:E="bottom-start",disabled:N=!1,readOnly:M=!1,portal:z=!0,config:H,className:V="",wrapperClassName:Y="",inputWrapperClassName:$="",labelClassName:F="",helperClassName:G="",popoverClassName:A=""}){let{isRequired:j=!1,isInvalid:B=!1,isLoading:X=!1,showSpinner:le=!1,isClearable:ne=!0,isFullWidth:ue=!1,showWeekNumbers:ie=!1,showViewTabs:Q=!1,closeOnSelect:q=!0}=H??{},ge=(0,Do.useId)(),ke=b||ge,L=`${ke}-error-helper`,te=`${ke}-popover`,Z=D!==void 0,[he,ae]=(0,Do.useState)(s),ve=Z?D:he,Se=a||i,ye=(0,Do.useMemo)(()=>Xl(Se,ve),[Se,ve]),J=t!==void 0,[O,W]=(0,Do.useState)(()=>{let be=r;return be&&Array.isArray(be)?[jt(be[0],i),jt(be[1],i)]:[null,null]}),we=J&&t&&Array.isArray(t)?[jt(t[0],i),jt(t[1],i)]:O,fe=we[0]&&we[1]?`${dr(we[0],ye,l)}${o}${dr(we[1],ye,l)}`:we[0]?`${dr(we[0],ye,l)}${o}`:"",[se,me]=(0,Do.useState)(!1),{refs:{setReference:Re,setFloating:xe},floatingStyles:re,context:de}=(0,Pt.useFloating)({placement:E,open:se&&!N&&!M&&!X,onOpenChange:me,whileElementsMounted:Pt.autoUpdate,transform:!1,middleware:[(0,Pt.offset)(6),(0,Pt.flip)(),(0,Pt.shift)({padding:8})]}),ce=(0,Pt.useDismiss)(de,{escapeKey:!0,outsidePress:!0}),ee=(0,Pt.useRole)(de,{role:"dialog"}),{getReferenceProps:U,getFloatingProps:Ce}=(0,Pt.useInteractions)([ce,ee]),{isMounted:$e,styles:Ee}=rt(de),oe=!!(B||u),Te=oe?"error":x,Pe=C(m,jr,"md"),Qe=C(h,Cn,"lg"),We=C(v,ec,"outline"),Be=v==="other"?"":C(Te,We,"primary"),Oe=!!we[0],Ze=be=>{Z||ae(be),P?.(be)},K=be=>{J||W(be);let[je,pt]=be;if(je&&pt){let st=[dr(je,i,l),dr(pt,i,l)];n?.(st),q&&me(!1)}},_=be=>{N||M||X||(be.key==="ArrowDown"||be.key==="Enter"||be.key===" "?(be.preventDefault(),se||me(!0)):be.key==="Escape"&&se&&(be.preventDefault(),me(!1)))},ze=be=>{be.stopPropagation(),J||W([null,null]),n?.(null),I?.()},pe=y||`${ye}${o}${ye}`,Fe=T==="floating",et=T==="left",Ge=()=>(0,St.jsx)(vt,{htmlFor:ke,label:k,isRequired:j,isFloating:Fe,size:m,color:Te,hasError:oe,cursor:"pointer",className:F}),at=be=>(0,St.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${Pe.icon}`,"aria-hidden":"true",children:be}),tt=["group/field group/daterangepicker relative flex",et?"flex-row items-center gap-3":"flex-col",Fe?"pt-2":"",ue?"w-full":"inline-flex",Y].filter(Boolean).join(" "),Ne=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",Pe.inputHeight,Qe,Be,N?"opacity-50":"",ue?"w-full":"w-auto",$].filter(Boolean).join(" "),Xe=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",Pe.inputText,Pe.inputPadding,V].filter(Boolean).join(" ");return z?(0,St.jsxs)("div",{className:tt,children:[!Fe&&Ge(),(0,St.jsxs)("div",{className:`flex flex-col ${ue?"w-full":""}`,children:[(0,St.jsxs)("div",{ref:Re,...U(),className:Ne,children:[Fe&&Ge(),(0,St.jsx)("input",{ref:e,id:ke,name:g,type:"text",value:fe,onClick:()=>!N&&!M&&!X&&me(be=>!be),onKeyDown:_,readOnly:!0,autoComplete:S,placeholder:pe,disabled:N||X,role:"combobox","aria-expanded":se&&!X,"aria-haspopup":"dialog","aria-controls":te,"aria-required":j,"aria-invalid":oe,"aria-busy":X,"aria-disabled":N||X,"aria-describedby":d||u?L:void 0,"aria-errormessage":u?L:void 0,className:Xe}),(0,St.jsxs)("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[X&&le&&(0,St.jsx)("div",{className:"flex items-center justify-center shrink-0",children:at((0,St.jsx)(De,{}))}),!X&&ne&&!N&&!M&&(0,St.jsx)("button",{type:"button",onClick:ze,"aria-label":"X\xF3a kho\u1EA3ng ng\xE0y",tabIndex:Oe?0:-1,"aria-hidden":!Oe,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${Pe.icon} ${Oe?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,St.jsx)(Ve,{className:"size-full"})}),(0,St.jsx)("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${se?"rotate-180":"rotate-0"}`,children:at((0,St.jsx)(yt,{className:"size-full"}))})]})]}),$e&&(0,St.jsx)(Pt.FloatingPortal,{children:(0,St.jsx)(Pt.FloatingFocusManager,{context:de,modal:!1,returnFocus:!0,children:(0,St.jsx)("div",{ref:xe,id:te,style:{...re,...Ee,zIndex:lt.PICKER},...Ce(),className:A,children:(0,St.jsx)(hi,{value:we,onChange:K,view:ve,onViewChange:Ze,minDate:c,maxDate:w,isDateDisabled:p,locale:l,firstDayOfWeek:f,showWeekNumbers:ie,size:m,color:x,radius:h,showViewTabs:Q,viewTabs:R})})})}),(0,St.jsx)(Le,{id:L,helperText:d,errorMessage:u,sizeClassName:Pe.helper,className:G})]})]}):(0,St.jsx)("div",{className:V,children:(0,St.jsx)(hi,{bordered:!1,value:we,onChange:K,view:ve,onViewChange:Ze,minDate:c,maxDate:w,isDateDisabled:p,locale:l,firstDayOfWeek:f,showWeekNumbers:ie,size:m,color:x,radius:h,showViewTabs:Q,viewTabs:R})})}var ws=require("react"),It=require("@floating-ui/react");var xi=require("react");var Po={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",icon:"size-3",iconSize:12,panelPadding:"p-1.5",columnWidth:"w-12",columnHeight:"h-36",itemHeight:"h-6",itemText:"text-[11px]",headerText:"text-[11px] font-semibold",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",icon:"size-3.5",iconSize:14,panelPadding:"p-2",columnWidth:"w-14",columnHeight:"h-44",itemHeight:"h-7",itemText:"text-xs",headerText:"text-xs font-semibold",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",icon:"size-[18px]",iconSize:16,panelPadding:"p-2.5",columnWidth:"w-16",columnHeight:"h-52",itemHeight:"h-8",itemText:"text-sm",headerText:"text-sm font-semibold",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",icon:"size-5",iconSize:18,panelPadding:"p-3",columnWidth:"w-18",columnHeight:"h-60",itemHeight:"h-9",itemText:"text-base",headerText:"text-base font-semibold",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",icon:"size-6",iconSize:20,panelPadding:"p-3.5",columnWidth:"w-20",columnHeight:"h-68",itemHeight:"h-10",itemText:"text-base",headerText:"text-lg font-semibold",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},oc={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},ic={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},tf={none:"rounded-none",sm:"rounded-xs",md:"rounded-md",lg:"rounded-lg",xl:"rounded-lg",full:"rounded-full"},rf={primary:{selected:"bg-primary-500 text-neutral-white font-semibold shadow-xs hover:bg-primary-600",hoverBg:"hover:bg-primary-100 hover:text-primary-900",activeText:"text-primary-600",accentBg:"bg-primary-500"},secondary:{selected:"bg-secondary-500 text-neutral-white font-semibold shadow-xs hover:bg-secondary-600",hoverBg:"hover:bg-secondary-100 hover:text-secondary-900",activeText:"text-secondary-600",accentBg:"bg-secondary-500"},neutral:{selected:"bg-neutral-800 text-neutral-white font-semibold shadow-xs hover:bg-neutral-900",hoverBg:"hover:bg-neutral-200 hover:text-neutral-900",activeText:"text-neutral-800",accentBg:"bg-neutral-800"},error:{selected:"bg-error-500 text-neutral-white font-semibold shadow-xs hover:bg-error-600",hoverBg:"hover:bg-error-100 hover:text-error-900",activeText:"text-error-600",accentBg:"bg-error-500"},success:{selected:"bg-success-500 text-neutral-white font-semibold shadow-xs hover:bg-success-600",hoverBg:"hover:bg-success-100 hover:text-success-900",activeText:"text-success-600",accentBg:"bg-success-500"},warning:{selected:"bg-warning-500 text-neutral-950 font-semibold shadow-xs hover:bg-warning-600",hoverBg:"hover:bg-warning-100 hover:text-warning-900",activeText:"text-warning-700",accentBg:"bg-warning-500"},info:{selected:"bg-info-500 text-neutral-white font-semibold shadow-xs hover:bg-info-600",hoverBg:"hover:bg-info-100 hover:text-info-900",activeText:"text-info-600",accentBg:"bg-info-500"}};var ac={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"}};function Ur(e){return e<10?`0${e}`:`${e}`}function to(e=!1,t=!0){return e?t?"hh:mm:ss A":"hh:mm A":t?"HH:mm:ss":"HH:mm"}function pr(e){if(!e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:new Date(e);if(typeof e!="string")return null;let t=e.trim();if(!t)return null;if(t.includes("T")){let o=new Date(t);if(!isNaN(o.getTime()))return o}let r=/^(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?(?:\s*([ap]m))?$/i,n=t.match(r);if(n){let o=parseInt(n[1],10),i=parseInt(n[2],10),a=n[3]?parseInt(n[3],10):0,s=n[4]?.toUpperCase();if(s&&(s==="PM"&&o<12&&(o+=12),s==="AM"&&o===12&&(o=0)),o>=0&&o<24&&i>=0&&i<60&&a>=0&&a<60){let l=new Date;return l.setHours(o,i,a,0),l}}return null}function Qt(e,t="HH:mm:ss"){if(!e||isNaN(e.getTime()))return"";let r=e.getHours(),n=e.getMinutes(),o=e.getSeconds(),i=r%12;i===0&&(i=12);let a=r>=12?"PM":"AM";return t.replace(/HH/g,Ur(r)).replace(/H/g,`${r}`).replace(/hh/g,Ur(i)).replace(/h/g,`${i}`).replace(/mm/g,Ur(n)).replace(/m/g,`${n}`).replace(/ss/g,Ur(o)).replace(/s/g,`${o}`).replace(/A/g,a).replace(/a/g,a.toLowerCase())}function _u(e){if(!e)return{hours:0,minutes:0,seconds:0,period:"AM"};let t=e.getHours();return{hours:t,minutes:e.getMinutes(),seconds:e.getSeconds(),period:t>=12?"PM":"AM"}}function zo(e,t,r=0){let n=new Date;return n.setHours(e,t,r,0),n}function Xu(e,t,r=!0){return!e||!t?!1:r?e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes()&&e.getSeconds()===t.getSeconds():e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes()}function qu(e,t){if(!e||!t)return!1;let r=e.getHours()*3600+e.getMinutes()*60+e.getSeconds(),n=t.getHours()*3600+t.getMinutes()*60+t.getSeconds();return r<n}function Zu(e,t){if(!e||!t)return!1;let r=e.getHours()*3600+e.getMinutes()*60+e.getSeconds(),n=t.getHours()*3600+t.getMinutes()*60+t.getSeconds();return r>n}function Io(e,t,r,n,o,i,a,s,l){if(e==="hour"){if(a?.().includes(t)||o&&t<o.getHours()||i&&t>i.getHours())return!0}else if(e==="minute"){if(s?.(r).includes(t)||o&&(r<o.getHours()||r===o.getHours()&&t<o.getMinutes())||i&&(r>i.getHours()||r===i.getHours()&&t>i.getMinutes()))return!0}else if(e==="second"&&(l?.(r,n).includes(t)||o&&(r<o.getHours()||r===o.getHours()&&n<o.getMinutes()||r===o.getHours()&&n===o.getMinutes()&&t<o.getSeconds())||i&&(r>i.getHours()||r===i.getHours()&&n>i.getMinutes()||r===i.getHours()&&n===i.getMinutes()&&t>i.getSeconds())))return!0;return!1}var ys=require("react");var Ju=require("react/jsx-runtime");function ro({items:e,selectedValue:t,onSelect:r,ariaLabel:n,size:o="md",color:i="primary",radius:a,className:s="",itemClassName:l="",selectedItemClassName:f=""}){let c=(0,ys.useRef)(null),w=(0,ys.useRef)(null),p=C(o,Po,"md"),m=C(i,rf,"primary"),v=C(a,tf,"md"),x=e.findIndex(y=>!y.disabled),h=e.some(y=>y.value===t);(0,ys.useEffect)(()=>{if(w.current&&c.current){let y=c.current,d=w.current,u=d.offsetTop-y.offsetTop-(y.clientHeight-d.clientHeight)/2;y.scrollTo({top:Math.max(0,u),behavior:"smooth"}),y.contains(document.activeElement)&&d.focus()}},[t]);let k=y=>{let d=e[y];if(!d||d.disabled)return;r(d.value),c.current?.children[y]?.focus()},T=(y,d)=>{if(e.filter(g=>!g.disabled).length){if(y.key==="ArrowDown"){y.preventDefault();for(let g=d+1;g<e.length;g++)if(!e[g].disabled){k(g);break}}else if(y.key==="ArrowUp"){y.preventDefault();for(let g=d-1;g>=0;g--)if(!e[g].disabled){k(g);break}}else if(y.key==="ArrowRight")y.preventDefault(),c.current?.nextElementSibling?.querySelector('[tabindex="0"], [role="option"]:not([aria-disabled="true"])')?.focus();else if(y.key==="ArrowLeft")y.preventDefault(),c.current?.previousElementSibling?.querySelector('[tabindex="0"], [role="option"]:not([aria-disabled="true"])')?.focus();else if(y.key==="Home"){y.preventDefault();let g=e.findIndex(b=>!b.disabled);g!==-1&&k(g)}else if(y.key==="End"){y.preventDefault();for(let g=e.length-1;g>=0;g--)if(!e[g].disabled){k(g);break}}else if(y.key==="Enter"||y.key===" "){y.preventDefault();let g=e[d];g&&!g.disabled&&k(d)}}};return(0,Ju.jsx)("ul",{ref:c,role:"listbox","aria-label":n,tabIndex:-1,className:`relative flex flex-col overflow-y-auto select-none ${p.columnWidth} ${p.columnHeight} scrollbar-thin scrollbar-thumb-neutral-300 hover:scrollbar-thumb-neutral-400 py-1 focus:outline-none ${s}`,style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e.map((y,d)=>{let u=t===y.value,g=!!y.disabled,b=!g&&(u||!h&&d===x);return(0,Ju.jsx)("li",{ref:u?w:void 0,role:"option","aria-selected":u,"aria-disabled":g,"aria-label":`${y.label} ${n||""}`.trim(),tabIndex:b?0:-1,onKeyDown:S=>T(S,d),onClick:()=>{g||k(d)},className:`flex items-center justify-center shrink-0 transition-colors duration-150 mx-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${v} ${p.itemHeight} ${p.itemText} ${g?"opacity-30 cursor-not-allowed text-neutral-400":u?`${m.selected} cursor-default ${f}`:`text-neutral-700 ${m.hoverBg} cursor-pointer`} ${l}`,children:y.label},`${y.value}`)})})}var kn=require("react/jsx-runtime");function Pr({value:e,onChange:t,ariaLabel:r="Time selector",use12Hours:n=!1,showSeconds:o=!0,hourStep:i=1,minuteStep:a=1,secondStep:s=1,minTime:l,maxTime:f,disabledHours:c,disabledMinutes:w,disabledSeconds:p,size:m="md",color:v="primary",radius:x,className:h=""}){let k=(0,xi.useMemo)(()=>pr(l),[l]),T=(0,xi.useMemo)(()=>pr(f),[f]),y=to(n,o),d=C(x,ic,"lg"),u=C(m,Po,"md"),g=e?e.getHours():0,b=g%12===0?12:g%12,S=e?e.getMinutes():0,R=e?e.getSeconds():0,D=g>=12?"PM":"AM",P=(0,xi.useMemo)(()=>{let $=[];if(n)for(let F=1;F<=12;F+=i){let G=D==="PM"?F===12?12:F+12:F===12?0:F,A=Io("hour",G,g,S,k,T,c,w,p);$.push({value:F,label:Ur(F),disabled:A})}else for(let F=0;F<24;F+=i){let G=Io("hour",F,g,S,k,T,c,w,p);$.push({value:F,label:Ur(F),disabled:G})}return $},[n,i,D,g,S,k,T,c,w,p]),I=(0,xi.useMemo)(()=>{let $=[];for(let F=0;F<60;F+=a){let G=Io("minute",F,g,S,k,T,c,w,p);$.push({value:F,label:Ur(F),disabled:G})}return $},[a,g,S,k,T,c,w,p]),E=(0,xi.useMemo)(()=>{if(!o)return[];let $=[];for(let F=0;F<60;F+=s){let G=Io("second",F,g,S,k,T,c,w,p);$.push({value:F,label:Ur(F),disabled:G})}return $},[o,s,g,S,k,T,c,w,p]),N=(0,xi.useMemo)(()=>[{value:"AM",label:"AM"},{value:"PM",label:"PM"}],[]),M=$=>{let F=Number($);n&&(D==="PM"&&F<12&&(F+=12),D==="AM"&&F===12&&(F=0));let G=zo(F,S,R);t?.(G)},z=$=>{let F=Number($),G=zo(g,F,R);t?.(G)},H=$=>{let F=Number($),G=zo(g,S,F);t?.(G)},V=$=>{let F=$,G=g;F==="AM"&&G>=12?G-=12:F==="PM"&&G<12&&(G+=12);let A=zo(G,S,R);t?.(A)},Y=o?"--:--:--":"--:--";return(0,kn.jsxs)("div",{"aria-label":r,className:`inline-flex flex-col bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden select-none ${d} ${h}`,children:[(0,kn.jsx)("div",{className:"flex items-center justify-center px-4 py-2 border-b border-neutral-200 bg-neutral-50/50",children:(0,kn.jsx)("span",{className:`text-neutral-700 tracking-wider font-mono ${u.headerText}`,children:e?Qt(e,y):Y})}),(0,kn.jsxs)("div",{className:`flex divide-x divide-neutral-200 ${u.panelPadding}`,children:[(0,kn.jsx)(ro,{ariaLabel:"Gi\u1EDD",items:P,selectedValue:n?b:e?g:null,onSelect:M,size:m,color:v,radius:x}),(0,kn.jsx)(ro,{ariaLabel:"Ph\xFAt",items:I,selectedValue:e?S:null,onSelect:z,size:m,color:v,radius:x}),o&&(0,kn.jsx)(ro,{ariaLabel:"Gi\xE2y",items:E,selectedValue:e?R:null,onSelect:H,size:m,color:v,radius:x}),n&&(0,kn.jsx)(ro,{ariaLabel:"Bu\u1ED5i",items:N,selectedValue:e?D:null,onSelect:V,size:m,color:v,radius:x})]})]})}var zt=require("react/jsx-runtime");function sc({ref:e,value:t,defaultValue:r,onChange:n,format:o="HH:mm:ss",displayFormat:i,use12Hours:a=!1,showSeconds:s=!0,hourStep:l=1,minuteStep:f=1,secondStep:c=1,minTime:w,maxTime:p,disabledHours:m,disabledMinutes:v,disabledSeconds:x,size:h="md",variant:k="outline",color:T="primary",radius:y,label:d,labelPlacement:u="top",placeholder:g,helperText:b,errorMessage:S,name:R,id:D,autoComplete:P,onClear:I,placement:E="bottom-start",disabled:N=!1,readOnly:M=!1,config:z,className:H="",wrapperClassName:V="",inputWrapperClassName:Y="",labelClassName:$="",helperClassName:F="",popoverClassName:G=""}){let{isRequired:A=!1,isInvalid:j=!1,isLoading:B=!1,showSpinner:X=!1,isClearable:le=!0,isFullWidth:ne=!1,closeOnSelect:ue=!1}=z??{},ie=(0,ws.useId)(),Q=D||ie,q=`${Q}-error-helper`,ge=`${Q}-popover`,ke=to(a,s),L=o||ke,te=i||L,Z=t!==void 0,[he,ae]=(0,ws.useState)(()=>pr(r)),ve=Z?pr(t):he,Se=ve?Qt(ve,te):"",[ye,J]=(0,ws.useState)(!1),{refs:{setReference:O,setFloating:W},floatingStyles:we,context:fe}=(0,It.useFloating)({placement:E,open:ye&&!N&&!M&&!B,onOpenChange:J,whileElementsMounted:It.autoUpdate,transform:!1,middleware:[(0,It.offset)(6),(0,It.flip)(),(0,It.shift)({padding:8})]}),se=(0,It.useDismiss)(fe,{escapeKey:!0,outsidePress:!0}),me=(0,It.useRole)(fe,{role:"dialog"}),{getReferenceProps:Re,getFloatingProps:xe}=(0,It.useInteractions)([se,me]),{isMounted:re,styles:de}=rt(fe),ce=!!(j||S),ee=ce?"error":T,U=C(h,Po,"md"),Ce=C(y,oc,"lg"),$e=k==="other"?"":C(ee,C(k,ac,"outline"),"primary"),Ee=!!ve,oe=pe=>{Z||ae(pe);let Fe=pe?Qt(pe,L):"";n?.(Fe),ue&&J(!1)},Te=pe=>{N||M||B||(pe.key==="ArrowDown"||pe.key==="Enter"||pe.key===" "?(pe.preventDefault(),ye||J(!0)):pe.key==="Escape"&&ye&&(pe.preventDefault(),J(!1)))},Pe=pe=>{pe.stopPropagation(),Z||ae(null),n?.(null),I?.()},Qe=g||te,We=u==="floating",Be=u==="left",Oe=()=>(0,zt.jsx)(vt,{htmlFor:Q,label:d,isRequired:A,isFloating:We,size:h,color:ee,hasError:ce,cursor:"pointer",className:$}),Ze=pe=>(0,zt.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${U.icon}`,"aria-hidden":"true",children:pe}),K=["group/field group/timepicker relative flex",Be?"flex-row items-center gap-3":"flex-col",We?"pt-2":"",ne?"w-full":"inline-flex",V].filter(Boolean).join(" "),_=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",U.inputHeight,Ce,$e,N?"opacity-50":"",ne?"w-full":"w-auto",Y].filter(Boolean).join(" "),ze=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",U.inputText,U.inputPadding,H].filter(Boolean).join(" ");return(0,zt.jsxs)("div",{className:K,children:[!We&&Oe(),(0,zt.jsxs)("div",{className:`flex flex-col ${ne?"w-full":""}`,children:[(0,zt.jsxs)("div",{ref:O,...Re(),className:_,children:[We&&Oe(),(0,zt.jsx)("input",{ref:e,id:Q,name:R,type:"text",value:Se,onClick:()=>!N&&!M&&!B&&J(pe=>!pe),onKeyDown:Te,readOnly:!0,autoComplete:P,placeholder:Qe,disabled:N||B,role:"combobox","aria-expanded":ye&&!B,"aria-haspopup":"dialog","aria-controls":ge,"aria-required":A,"aria-invalid":ce,"aria-busy":B,"aria-disabled":N||B,"aria-describedby":b||S?q:void 0,"aria-errormessage":S?q:void 0,className:ze}),(0,zt.jsxs)("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[B&&X&&(0,zt.jsx)("div",{className:"flex items-center justify-center shrink-0",children:Ze((0,zt.jsx)(De,{}))}),!B&&le&&!N&&!M&&(0,zt.jsx)("button",{type:"button",onClick:Pe,"aria-label":"X\xF3a th\u1EDDi gian",tabIndex:Ee?0:-1,"aria-hidden":!Ee,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${U.icon} ${Ee?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,zt.jsx)(Ve,{className:"size-full"})}),(0,zt.jsx)("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${ye?"rotate-180":"rotate-0"}`,children:Ze((0,zt.jsx)(yt,{className:"size-full"}))})]})]}),re&&(0,zt.jsx)(It.FloatingPortal,{children:(0,zt.jsx)(It.FloatingFocusManager,{context:fe,modal:!1,returnFocus:!0,children:(0,zt.jsx)("div",{ref:W,id:ge,style:{...we,...de,zIndex:lt.PICKER},...xe(),className:G,children:(0,zt.jsx)(Pr,{value:ve,onChange:oe,ariaLabel:typeof d=="string"?`${d} selector`:"Time selector",use12Hours:a,showSeconds:s,hourStep:l,minuteStep:f,secondStep:c,minTime:w,maxTime:p,disabledHours:m,disabledMinutes:v,disabledSeconds:x,size:h,color:T,radius:y})})})}),(0,zt.jsx)(Le,{id:q,helperText:b,errorMessage:S,sizeClassName:U.helper,className:F})]})]})}var vi=require("react"),Mt=require("@floating-ui/react");var nf=Po,of=oc,af=ic,sf=ac;var mt=require("react/jsx-runtime");function lc({ref:e,value:t,defaultValue:r,onChange:n,format:o,displayFormat:i,separator:a=" - ",startLabel:s="Th\u1EDDi gian b\u1EAFt \u0111\u1EA7u",endLabel:l="Th\u1EDDi gian k\u1EBFt th\xFAc",use12Hours:f=!1,showSeconds:c=!0,hourStep:w=1,minuteStep:p=1,secondStep:m=1,minTime:v,maxTime:x,disabledHours:h,disabledMinutes:k,disabledSeconds:T,size:y="md",variant:d="outline",color:u="primary",radius:g,label:b,labelPlacement:S="top",placeholder:R,placeholders:D,helperText:P,errorMessage:I,name:E,id:N,autoComplete:M,disabled:z=!1,readOnly:H=!1,config:V,onClear:Y,placement:$="bottom-start",className:F="",wrapperClassName:G="",inputWrapperClassName:A="",labelClassName:j="",helperClassName:B="",popoverClassName:X=""}){let{isRequired:le=!1,isInvalid:ne=!1,isLoading:ue=!1,showSpinner:ie=!1,isClearable:Q=!0,isFullWidth:q=!1,closeOnSelect:ge=!1}=V??{},ke=(0,vi.useId)(),L=N||ke,te=`${L}-error-helper`,Z=`${L}-popover`,he=to(f,c),ae=o||he,ve=i||ae,Se=t!==void 0,[ye,J]=(0,vi.useState)(()=>{let be=r;return be&&Array.isArray(be)?[pr(be[0]),pr(be[1])]:[null,null]}),O=Se&&t&&Array.isArray(t)?[pr(t[0]),pr(t[1])]:ye,W=O[0]?Qt(O[0],ve):"",we=O[1]?Qt(O[1],ve):"",fe=(0,vi.useMemo)(()=>W&&we?`${W}${a}${we}`:W?`${W}${a}`:"",[W,we,a]),[se,me]=(0,vi.useState)(!1),{refs:{setReference:Re,setFloating:xe},floatingStyles:re,context:de}=(0,Mt.useFloating)({placement:$,open:se&&!z&&!H&&!ue,onOpenChange:me,whileElementsMounted:Mt.autoUpdate,transform:!1,middleware:[(0,Mt.offset)(6),(0,Mt.flip)(),(0,Mt.shift)({padding:8})]}),ce=(0,Mt.useDismiss)(de,{escapeKey:!0,outsidePress:!0}),ee=(0,Mt.useRole)(de,{role:"dialog"}),{getReferenceProps:U,getFloatingProps:Ce}=(0,Mt.useInteractions)([ce,ee]),{isMounted:$e,styles:Ee}=rt(de),oe=!!(ne||I),Te=oe?"error":u,Pe=C(y,nf,"md"),Qe=C(g,of,"lg"),We=C(g,af,"lg"),Be=d==="other"?"":C(Te,C(d,sf,"outline"),"primary"),Oe=!!(O[0]||O[1]),Ze=be=>{let je=[be,O[1]];Se||J(je);let pt=Qt(be,ae),st=O[1]?Qt(O[1],ae):"";n?.([pt,st])},K=be=>{let je=[O[0],be];Se||J(je);let pt=O[0]?Qt(O[0],ae):"",st=Qt(be,ae);n?.([pt,st]),ge&&me(!1)},_=be=>{z||H||ue||(be.key==="ArrowDown"||be.key==="Enter"||be.key===" "?(be.preventDefault(),se||me(!0)):be.key==="Escape"&&se&&(be.preventDefault(),me(!1)))},ze=be=>{be.stopPropagation(),Se||J([null,null]),n?.(null),Y?.()},pe=R||(D?`${D[0]}${a}${D[1]}`:`${ve}${a}${ve}`),Fe=S==="floating",et=S==="left",Ge=()=>(0,mt.jsx)(vt,{htmlFor:L,label:b,isRequired:le,isFloating:Fe,size:y,color:Te,hasError:oe,cursor:"pointer",className:j}),at=be=>(0,mt.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${Pe.icon}`,"aria-hidden":"true",children:be}),tt=["group/field group/timerangepicker relative flex",et?"flex-row items-center gap-3":"flex-col",Fe?"pt-2":"",q?"w-full":"inline-flex",G].filter(Boolean).join(" "),Ne=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",Pe.inputHeight,Qe,Be,z?"opacity-50":"",q?"w-full":"w-auto",A].filter(Boolean).join(" "),Xe=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",Pe.inputText,Pe.inputPadding,F].filter(Boolean).join(" ");return(0,mt.jsxs)("div",{className:tt,children:[!Fe&&Ge(),(0,mt.jsxs)("div",{className:`flex flex-col ${q?"w-full":""}`,children:[(0,mt.jsxs)("div",{ref:Re,...U(),className:Ne,children:[Fe&&Ge(),(0,mt.jsx)("input",{ref:e,id:L,name:E,type:"text",value:fe,onClick:()=>!z&&!H&&!ue&&me(be=>!be),onKeyDown:_,readOnly:!0,autoComplete:M,placeholder:pe,disabled:z||ue,role:"combobox","aria-expanded":se&&!ue,"aria-haspopup":"dialog","aria-controls":Z,"aria-required":le,"aria-invalid":oe,"aria-busy":ue,"aria-disabled":z||ue,"aria-describedby":P||I?te:void 0,"aria-errormessage":I?te:void 0,className:Xe}),(0,mt.jsxs)("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[ue&&ie&&(0,mt.jsx)("div",{className:"flex items-center justify-center shrink-0",children:at((0,mt.jsx)(De,{}))}),!ue&&Q&&!z&&!H&&(0,mt.jsx)("button",{type:"button",onClick:ze,"aria-label":"X\xF3a kho\u1EA3ng th\u1EDDi gian",tabIndex:Oe?0:-1,"aria-hidden":!Oe,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${Pe.icon} ${Oe?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,mt.jsx)(Ve,{className:"size-full"})}),(0,mt.jsx)("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${se?"rotate-180":"rotate-0"}`,children:at((0,mt.jsx)(yt,{className:"size-full"}))})]})]}),$e&&(0,mt.jsx)(Mt.FloatingPortal,{children:(0,mt.jsx)(Mt.FloatingFocusManager,{context:de,modal:!1,returnFocus:!0,children:(0,mt.jsxs)("div",{ref:xe,id:Z,style:{...re,...Ee,zIndex:lt.PICKER},...Ce(),className:`flex flex-row bg-neutral-white border-2 border-neutral-200 shadow-xl divide-x divide-neutral-200 overflow-hidden select-none ${We} ${X}`,children:[(0,mt.jsxs)("div",{className:"flex flex-col",children:[(0,mt.jsx)("div",{className:"px-3 py-1.5 bg-neutral-50 text-xs font-semibold text-neutral-600 border-b border-neutral-200 text-center",children:s}),(0,mt.jsx)(Pr,{value:O[0],onChange:Ze,ariaLabel:s,use12Hours:f,showSeconds:c,hourStep:w,minuteStep:p,secondStep:m,minTime:v,maxTime:O[1]||x,disabledHours:h,disabledMinutes:k,disabledSeconds:T,size:y,color:u,radius:g,className:"border-none shadow-none"})]}),(0,mt.jsxs)("div",{className:"flex flex-col",children:[(0,mt.jsx)("div",{className:"px-3 py-1.5 bg-neutral-50 text-xs font-semibold text-neutral-600 border-b border-neutral-200 text-center",children:l}),(0,mt.jsx)(Pr,{value:O[1],onChange:K,ariaLabel:l,use12Hours:f,showSeconds:c,hourStep:w,minuteStep:p,secondStep:m,minTime:O[0]||v,maxTime:x,disabledHours:h,disabledMinutes:k,disabledSeconds:T,size:y,color:u,radius:g,className:"border-none shadow-none"})]})]})})}),(0,mt.jsx)(Le,{id:te,helperText:P,errorMessage:I,sizeClassName:Pe.helper,className:B})]})]})}function Qu(e,t,r){if(!e||!t||!r)return!1;let n=e.getHours()*3600+e.getMinutes()*60+e.getSeconds(),o=t.getHours()*3600+t.getMinutes()*60+t.getSeconds(),i=r.getHours()*3600+r.getMinutes()*60+r.getSeconds();return n>=o&&n<=i}var va=require("react"),Ft=require("@floating-ui/react");function no(e=!1,t=!0){return e?t?"DD/MM/YYYY hh:mm:ss A":"DD/MM/YYYY hh:mm A":t?"DD/MM/YYYY HH:mm:ss":"DD/MM/YYYY HH:mm"}function zr(e,t){if(!e&&!t)return null;let r=e?new Date(e):new Date;return t&&(r.setHours(t.getHours()),r.setMinutes(t.getMinutes()),r.setSeconds(t.getSeconds()),r.setMilliseconds(t.getMilliseconds())),r}function Ir(e,t="DD/MM/YYYY HH:mm:ss"){if(!e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:new Date(e.getTime());if(typeof e=="string"||typeof e=="number"){if(typeof e=="string"){let o=xa(e,t);if(o)return o}let n=new Date(e);return isNaN(n.getTime())?null:n}let r=e;return typeof r.toDate=="function"?r.toDate():typeof r.epochMilliseconds=="number"?new Date(r.epochMilliseconds):null}function gr(e,t="DD/MM/YYYY HH:mm:ss",r){return!e||isNaN(e.getTime())?"":dr(e,t,r)}function xa(e,t="DD/MM/YYYY HH:mm:ss"){if(!e||typeof e!="string")return null;let r=e.trim();if(!r)return null;let n=new Date().getFullYear(),o=1,i=1,a=0,s=0,l=0,f=!1,c=!1,w=t.match(/YYYY|YY|MM|M|DD|D|HH|H|hh|h|mm|m|ss|s|A|a/g);if(!w){let x=new Date(r);return isNaN(x.getTime())?null:x}let p="^"+t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");for(let x of w)x==="YYYY"?p=p.replace("YYYY","(\\d{4})"):x==="YY"?p=p.replace("YY","(\\d{2})"):x==="MM"||x==="M"||x==="DD"||x==="D"||x==="HH"||x==="H"||x==="hh"||x==="h"||x==="mm"||x==="m"||x==="ss"||x==="s"?p=p.replace(x,"(\\d{1,2})"):(x==="A"||x==="a")&&(p=p.replace(x,"(AM|PM|am|pm)"));p+="$";let m=new RegExp(p,"i").exec(r);if(!m){let x=new Date(r);return isNaN(x.getTime())?null:x}w.forEach((x,h)=>{let k=m[h+1];if(!k)return;if(x==="A"||x==="a"){f=!0,k.toUpperCase()==="PM"&&(c=!0);return}let T=parseInt(k,10);isNaN(T)||(x==="YYYY"?n=T:x==="YY"?n=2e3+T:x==="MM"||x==="M"?o=T:x==="DD"||x==="D"?i=T:x==="HH"||x==="H"?a=T:x==="hh"||x==="h"?(f=!0,a=T):x==="mm"||x==="m"?s=T:(x==="ss"||x==="s")&&(l=T))}),f&&(c?a<12&&(a+=12):a===12&&(a=0));let v=new Date(n,o-1,i,a,s,l);return isNaN(v.getTime())?null:v}var lf={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},cf={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},uf={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",icon:"size-3",iconSize:12,calendarPadding:"p-2",cellSize:"w-7 h-7",cellText:"text-[11px]",headerText:"text-xs font-semibold",headerButtonSize:"h-6 w-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",icon:"size-3.5",iconSize:14,calendarPadding:"p-2.5",cellSize:"w-8 h-8",cellText:"text-xs",headerText:"text-xs font-semibold",headerButtonSize:"h-7 w-7",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",icon:"size-[18px]",iconSize:16,calendarPadding:"p-3",cellSize:"w-9 h-9",cellText:"text-sm",headerText:"text-sm font-semibold",headerButtonSize:"h-8 w-8",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",icon:"size-5",iconSize:18,calendarPadding:"p-4",cellSize:"w-10 h-10",cellText:"text-base",headerText:"text-base font-semibold",headerButtonSize:"h-9 w-9",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",icon:"size-6",iconSize:20,calendarPadding:"p-4",cellSize:"w-12 h-12",cellText:"text-lg",headerText:"text-lg font-semibold",headerButtonSize:"h-10 w-10",label:"text-lg mb-2",floatingLabel:"text-sm",helper:"text-sm mt-1.5"}};var df={outline:{primary:"bg-neutral-white border-2 border-neutral-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-2 border-neutral-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-2 border-error-500 hover:border-error-600 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-2 border-neutral-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-2 border-neutral-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-2 border-neutral-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-2 border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-2 border-transparent hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-2 border-transparent hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-error-50/60 border-2 border-transparent hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-2 border-transparent hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-2 border-transparent hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-2 border-transparent hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-50/60 border-2 border-transparent hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},ghost:{primary:"bg-transparent border-2 border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-2 border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-transparent border-2 border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-2 border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-2 border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-2 border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-transparent border-2 border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20"}};var wt=require("react/jsx-runtime");function cc({ref:e,value:t,defaultValue:r,onChange:n,format:o,displayFormat:i,layout:a="side-by-side",locale:s="vi",defaultView:l="days",firstDayOfWeek:f=1,minDate:c,maxDate:w,isDateDisabled:p,viewTabs:m,use12Hours:v=!1,showSeconds:x=!0,hourStep:h=1,minuteStep:k=1,secondStep:T=1,minTime:y,maxTime:d,disabledHours:u,disabledMinutes:g,disabledSeconds:b,size:S="md",variant:R="outline",color:D="primary",radius:P,label:I,labelPlacement:E="top",placeholder:N,helperText:M,errorMessage:z,name:H,id:V,autoComplete:Y,disabled:$=!1,readOnly:F=!1,config:G,onClear:A,placement:j="bottom-start",className:B="",wrapperClassName:X="",inputWrapperClassName:le="",labelClassName:ne="",helperClassName:ue="",popoverClassName:ie=""}){let{isRequired:Q=!1,isInvalid:q=!1,isLoading:ge=!1,showSpinner:ke=!1,isClearable:L=!0,isFullWidth:te=!1,closeOnSelect:Z=!1,showWeekNumbers:he=!1,showViewTabs:ae=!1}=G??{},ve=(0,va.useId)(),Se=V||ve,ye=`${Se}-error-helper`,J=`${Se}-popover`,O=no(v,x),W=o||O,we=i||W,fe=t!==void 0,[se,me]=(0,va.useState)(()=>Ir(r,W)),Re=fe?Ir(t,W):se,xe=Re?gr(Re,we,s):"",[re,de]=(0,va.useState)(l),[ce,ee]=(0,va.useState)(!1),{refs:{setReference:U,setFloating:Ce},floatingStyles:$e,context:Ee}=(0,Ft.useFloating)({placement:j,open:ce&&!$&&!F&&!ge,onOpenChange:ee,whileElementsMounted:Ft.autoUpdate,transform:!1,middleware:[(0,Ft.offset)(6),(0,Ft.flip)(),(0,Ft.shift)({padding:8})]}),oe=(0,Ft.useDismiss)(Ee,{escapeKey:!0,outsidePress:!0}),Te=(0,Ft.useRole)(Ee,{role:"dialog"}),{getReferenceProps:Pe,getFloatingProps:Qe}=(0,Ft.useInteractions)([oe,Te]),{isMounted:We,styles:Be}=rt(Ee),Oe=!!(q||z),Ze=Oe?"error":D,K=C(S,uf,"md"),_=C(P,lf,"lg"),ze=C(P,cf,"lg"),pe=R==="other"?"":C(Ze,C(R,df,"outline"),"primary"),Fe=!!Re,et=ht=>{let nr=zr(ht,Re||new Date);fe||me(nr);let Yo=nr?gr(nr,W,s):"";n?.(Yo),Z&&ee(!1)},Ge=ht=>{if(!ht)return;let nr=zr(Re||new Date,ht);fe||me(nr);let Yo=nr?gr(nr,W,s):"";n?.(Yo),Z&&ee(!1)},at=ht=>{$||F||ge||(ht.key==="ArrowDown"||ht.key==="Enter"||ht.key===" "?(ht.preventDefault(),ce||ee(!0)):ht.key==="Escape"&&ce&&(ht.preventDefault(),ee(!1)))},tt=ht=>{ht.stopPropagation(),fe||me(null),n?.(null),A?.()},Ne=N||we,Xe=E==="floating",be=E==="left",je=()=>(0,wt.jsx)(vt,{htmlFor:Se,label:I,isRequired:Q,isFloating:Xe,size:S,color:Ze,hasError:Oe,cursor:"pointer",className:ne}),pt=ht=>(0,wt.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${K.icon}`,"aria-hidden":"true",children:ht}),st=["group/field group/datetimepicker relative flex",be?"flex-row items-center gap-3":"flex-col",Xe?"pt-2":"",te?"w-full":"inline-flex",X].filter(Boolean).join(" "),rr=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",K.inputHeight,_,pe,$?"opacity-50":"",te?"w-full":"w-auto",le].filter(Boolean).join(" "),br=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",K.inputText,K.inputPadding,B].filter(Boolean).join(" ");return(0,wt.jsxs)("div",{className:st,children:[!Xe&&je(),(0,wt.jsxs)("div",{className:`flex flex-col ${te?"w-full":""}`,children:[(0,wt.jsxs)("div",{ref:U,...Pe(),className:rr,children:[Xe&&je(),(0,wt.jsx)("input",{ref:e,id:Se,name:H,type:"text",value:xe,onClick:()=>!$&&!F&&!ge&&ee(ht=>!ht),onKeyDown:at,readOnly:!0,autoComplete:Y,placeholder:Ne,disabled:$||ge,role:"combobox","aria-expanded":ce&&!ge,"aria-haspopup":"dialog","aria-controls":J,"aria-required":Q,"aria-invalid":Oe,"aria-busy":ge,"aria-disabled":$||ge,"aria-describedby":M||z?ye:void 0,"aria-errormessage":z?ye:void 0,className:br}),(0,wt.jsxs)("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[ge&&ke&&(0,wt.jsx)("div",{className:"flex items-center justify-center shrink-0",children:pt((0,wt.jsx)(De,{}))}),!ge&&L&&!$&&!F&&(0,wt.jsx)("button",{type:"button",onClick:tt,"aria-label":"X\xF3a ng\xE0y gi\u1EDD",tabIndex:Fe?0:-1,"aria-hidden":!Fe,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${K.icon} ${Fe?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,wt.jsx)(Ve,{className:"size-full"})}),(0,wt.jsx)("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${ce?"rotate-180":"rotate-0"}`,children:pt((0,wt.jsx)(yt,{className:"size-full"}))})]})]}),We&&(0,wt.jsx)(Ft.FloatingPortal,{children:(0,wt.jsx)(Ft.FloatingFocusManager,{context:Ee,modal:!1,returnFocus:!0,children:(0,wt.jsxs)("div",{ref:Ce,id:J,style:{...$e,...Be,zIndex:lt.PICKER},...Qe(),className:`flex bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden select-none ${ze} ${a==="stacked"?"flex-col divide-y-2 divide-neutral-200":"flex-row divide-x-2 divide-neutral-200"} ${ie}`,children:[(0,wt.jsx)("div",{className:"flex flex-col",children:(0,wt.jsx)(on,{value:Re,onChange:et,view:re,onViewChange:de,minDate:c,maxDate:w,isDateDisabled:p,locale:s,firstDayOfWeek:f,showWeekNumbers:he,size:S,color:D,radius:P,showViewTabs:ae,viewTabs:m,className:"border-none shadow-none rounded-none"})}),(0,wt.jsx)("div",{className:"flex flex-col justify-center items-center p-1 bg-neutral-50/50",children:(0,wt.jsx)(Pr,{value:Re,onChange:Ge,ariaLabel:typeof I=="string"?`${I} time`:"Time selector",use12Hours:v,showSeconds:x,hourStep:h,minuteStep:k,secondStep:T,minTime:y,maxTime:d,disabledHours:u,disabledMinutes:g,disabledSeconds:b,size:S,color:D,radius:P,className:"border-none shadow-none bg-transparent"})})]})})}),(0,wt.jsx)(Le,{id:ye,helperText:M,errorMessage:z,sizeClassName:K.helper,className:ue})]})]})}var oo=require("react"),Et=require("@floating-ui/react");var ff={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",minWidth:"min-w-72",icon:"size-3",iconSize:12,calendarPadding:"p-2",cellSize:"w-7 h-7",cellText:"text-[11px]",headerText:"text-xs font-semibold",headerButtonSize:"h-6 w-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",minWidth:"min-w-80",icon:"size-3.5",iconSize:14,calendarPadding:"p-2.5",cellSize:"w-8 h-8",cellText:"text-xs",headerText:"text-xs font-semibold",headerButtonSize:"h-7 w-7",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",minWidth:"min-w-96",icon:"size-[18px]",iconSize:16,calendarPadding:"p-3",cellSize:"w-9 h-9",cellText:"text-sm",headerText:"text-sm font-semibold",headerButtonSize:"h-8 w-8",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",minWidth:"min-w-105",icon:"size-5",iconSize:18,calendarPadding:"p-4",cellSize:"w-10 h-10",cellText:"text-base",headerText:"text-base font-semibold",headerButtonSize:"h-9 w-9",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",minWidth:"min-w-120",icon:"size-6",iconSize:20,calendarPadding:"p-4",cellSize:"w-12 h-12",cellText:"text-lg",headerText:"text-lg font-semibold",headerButtonSize:"h-10 w-10",label:"text-lg mb-2",floatingLabel:"text-sm",helper:"text-sm mt-1.5"}};var pf={primary:{activeStep:"bg-primary-500 border-primary-500 text-neutral-white shadow-xs",applyButton:"bg-primary-500 hover:bg-primary-600 active:bg-primary-700 text-neutral-white shadow-xs"},secondary:{activeStep:"bg-secondary-500 border-secondary-500 text-neutral-white shadow-xs",applyButton:"bg-secondary-500 hover:bg-secondary-600 active:bg-secondary-700 text-neutral-white shadow-xs"},error:{activeStep:"bg-error-500 border-error-500 text-neutral-white shadow-xs",applyButton:"bg-error-500 hover:bg-error-600 active:bg-error-700 text-neutral-white shadow-xs"},success:{activeStep:"bg-success-500 border-success-500 text-neutral-white shadow-xs",applyButton:"bg-success-500 hover:bg-success-600 active:bg-success-700 text-neutral-white shadow-xs"},warning:{activeStep:"bg-warning-500 border-warning-500 text-neutral-950 shadow-xs",applyButton:"bg-warning-500 hover:bg-warning-600 active:bg-warning-700 text-neutral-950 shadow-xs"},info:{activeStep:"bg-info-500 border-info-500 text-neutral-white shadow-xs",applyButton:"bg-info-500 hover:bg-info-600 active:bg-info-700 text-neutral-white shadow-xs"},neutral:{activeStep:"bg-neutral-800 border-neutral-800 text-neutral-white shadow-xs",applyButton:"bg-neutral-800 hover:bg-neutral-900 active:bg-neutral-950 text-neutral-white shadow-xs"}};var Je=require("react/jsx-runtime");function uc({ref:e,value:t,defaultValue:r,onChange:n,format:o,displayFormat:i,separator:a=" - ",startLabel:s="Th\u1EDDi gian b\u1EAFt \u0111\u1EA7u",endLabel:l="Th\u1EDDi gian k\u1EBFt th\xFAc",layout:f="side-by-side",locale:c="vi",defaultView:w="days",firstDayOfWeek:p=1,minDate:m,maxDate:v,isDateDisabled:x,viewTabs:h,use12Hours:k=!1,showSeconds:T=!0,hourStep:y=1,minuteStep:d=1,secondStep:u=1,minTime:g,maxTime:b,disabledHours:S,disabledMinutes:R,disabledSeconds:D,size:P="md",variant:I="outline",color:E="primary",radius:N,label:M,labelPlacement:z="top",placeholder:H,placeholders:V,helperText:Y,errorMessage:$,name:F,id:G,autoComplete:A,disabled:j=!1,readOnly:B=!1,config:X,onClear:le,placement:ne="bottom-start",className:ue="",wrapperClassName:ie="",inputWrapperClassName:Q="",labelClassName:q="",helperClassName:ge="",popoverClassName:ke=""}){let{isRequired:L=!1,isInvalid:te=!1,isLoading:Z=!1,showSpinner:he=!1,isClearable:ae=!0,isFullWidth:ve=!1,closeOnSelect:Se=!1,showWeekNumbers:ye=!1,showViewTabs:J=!1}=X??{},O=(0,oo.useId)(),W=G||O,we=`${W}-error-helper`,fe=`${W}-popover`,se=no(k,T),me=o||se,Re=i||me,xe=t!==void 0,[re,de]=(0,oo.useState)(()=>{let _e=r;return _e&&Array.isArray(_e)?[Ir(_e[0],me),Ir(_e[1],me)]:[null,null]}),ce=xe?t&&Array.isArray(t)?[Ir(t[0],me),Ir(t[1],me)]:[null,null]:re,[ee,U]=(0,oo.useState)("start"),[Ce,$e]=(0,oo.useState)(w),[Ee,oe]=(0,oo.useState)(!1),Te=ce[0]?gr(ce[0],Re,c):"",Pe=ce[1]?gr(ce[1],Re,c):"",Qe=(0,oo.useMemo)(()=>Te&&Pe?`${Te}${a}${Pe}`:Te?`${Te}${a}`:"",[Te,Pe,a]),{refs:{setReference:We,setFloating:Be},floatingStyles:Oe,context:Ze}=(0,Et.useFloating)({placement:ne,open:Ee&&!j&&!B&&!Z,onOpenChange:oe,whileElementsMounted:Et.autoUpdate,transform:!1,middleware:[(0,Et.offset)(6),(0,Et.flip)(),(0,Et.shift)({padding:8})]}),K=(0,Et.useDismiss)(Ze,{escapeKey:!0,outsidePress:!0}),_=(0,Et.useRole)(Ze,{role:"dialog"}),{getReferenceProps:ze,getFloatingProps:pe}=(0,Et.useInteractions)([K,_]),{isMounted:Fe,styles:et}=rt(Ze),Ge=!!(te||$),at=Ge?"error":E,tt=C(P,ff,"md"),Ne=C(N,Cn,"lg"),Xe=C(N,Ql,"lg"),be=C(at,pf,"primary"),je=I==="other"?"":C(at,C(I,ec,"outline"),"primary"),pt=!!(ce[0]||ce[1]),st=_e=>{xe||de(_e);let or=_e[0]?gr(_e[0],me,c):"",Lr=_e[1]?gr(_e[1],me,c):"";n?.(or||Lr?[or,Lr]:null),Se&&_e[0]&&_e[1]&&oe(!1)},rr=_e=>{if(ee==="start"){let or=zr(_e,ce[0]||new Date),Lr=ce[1];Lr&&or&&or.getTime()>Lr.getTime()&&(Lr=null),st([or,Lr])}else{let or=zr(_e,ce[1]||ce[0]||new Date);st([ce[0],or])}},br=_e=>{if(_e)if(ee==="start"){let or=zr(ce[0]||new Date,_e),Lr=ce[1];Lr&&or&&or.getTime()>Lr.getTime()&&(Lr=null),st([or,Lr])}else{let or=zr(ce[1]||ce[0]||new Date,_e);st([ce[0],or])}},ht=_e=>{j||B||Z||(_e.key==="ArrowDown"||_e.key==="Enter"||_e.key===" "?(_e.preventDefault(),Ee||oe(!0)):_e.key==="Escape"&&Ee&&(_e.preventDefault(),oe(!1)))},nr=_e=>{_e.stopPropagation(),xe||de([null,null]),n?.(null),le?.()},Yo=H||(V?`${V[0]}${a}${V[1]}`:`${Re}${a}${Re}`),Me=z==="floating",Ue=z==="left",Bt=()=>(0,Je.jsx)(vt,{htmlFor:W,label:M,isRequired:L,isFloating:Me,size:P,color:at,hasError:Ge,cursor:"pointer",className:q}),Gt=_e=>(0,Je.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${tt.icon}`,"aria-hidden":"true",children:_e}),Bn=["group/field group/datetimerangepicker relative flex",Ue?"flex-row items-center gap-3":"flex-col",Me?"pt-2":"",ve?"w-full":"inline-flex",ie].filter(Boolean).join(" "),hr=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",tt.inputHeight,Ne,je,j?"opacity-50":"",ve?"w-full":tt.minWidth||"min-w-80",Q].filter(Boolean).join(" "),Mi=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",tt.inputText,tt.inputPadding,ue].filter(Boolean).join(" "),Sd=ee==="start"?ce[0]:ce[1];return(0,Je.jsxs)("div",{className:Bn,children:[!Me&&Bt(),(0,Je.jsxs)("div",{className:`flex flex-col ${ve?"w-full":""}`,children:[(0,Je.jsxs)("div",{ref:We,...ze(),className:hr,children:[Me&&Bt(),(0,Je.jsx)("input",{ref:e,id:W,name:F,type:"text",value:Qe,onClick:()=>!j&&!B&&!Z&&oe(_e=>!_e),onKeyDown:ht,readOnly:!0,autoComplete:A,placeholder:Yo,disabled:j||Z,role:"combobox","aria-expanded":Ee&&!Z,"aria-haspopup":"dialog","aria-controls":fe,"aria-required":L,"aria-invalid":Ge,"aria-busy":Z,"aria-disabled":j||Z,"aria-describedby":Y||$?we:void 0,"aria-errormessage":$?we:void 0,className:Mi}),(0,Je.jsxs)("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[Z&&he&&(0,Je.jsx)("div",{className:"flex items-center justify-center shrink-0",children:Gt((0,Je.jsx)(De,{}))}),!Z&&ae&&!j&&!B&&(0,Je.jsx)("button",{type:"button",onClick:nr,"aria-label":"X\xF3a kho\u1EA3ng ng\xE0y gi\u1EDD",tabIndex:pt?0:-1,"aria-hidden":!pt,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${tt.icon} ${pt?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,Je.jsx)(Ve,{className:"size-full"})}),(0,Je.jsx)("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${Ee?"rotate-180":"rotate-0"}`,children:Gt((0,Je.jsx)(yt,{className:"size-full"}))})]})]}),Fe&&(0,Je.jsx)(Et.FloatingPortal,{children:(0,Je.jsx)(Et.FloatingFocusManager,{context:Ze,modal:!1,returnFocus:!0,children:(0,Je.jsxs)("div",{ref:Be,id:fe,style:{...Oe,...et,zIndex:lt.PICKER},...pe(),className:`flex flex-col bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden select-none ${Xe} ${ke}`,children:[(0,Je.jsxs)("div",{className:`flex ${f==="stacked"?"flex-col divide-y-2 divide-neutral-200":"flex-row divide-x-2 divide-neutral-200"}`,children:[(0,Je.jsx)("div",{className:"flex flex-col",children:(0,Je.jsx)(on,{value:Sd,onChange:rr,view:Ce,onViewChange:$e,minDate:ee==="end"&&ce[0]||m,maxDate:ee==="start"&&ce[1]||v,isDateDisabled:x,locale:c,firstDayOfWeek:p,showWeekNumbers:ye,size:P,color:E,radius:N,showViewTabs:J,viewTabs:h,className:"border-none shadow-none rounded-none"},`calendar-step-${ee}`)}),(0,Je.jsx)("div",{className:"flex flex-col justify-center items-center p-1 bg-neutral-50/50",children:(0,Je.jsx)(Pr,{value:Sd||ce[0],onChange:br,ariaLabel:ee==="start"?`${s} time`:`${l} time`,use12Hours:k,showSeconds:T,hourStep:y,minuteStep:d,secondStep:u,minTime:ee==="end"&&ce[0]||g,maxTime:ee==="start"&&ce[1]||b,disabledHours:S,disabledMinutes:R,disabledSeconds:D,size:P,color:E,radius:N,className:"border-none shadow-none bg-transparent"},`timeview-step-${ee}`)})]}),(0,Je.jsxs)("div",{className:"flex items-center justify-between border-t border-neutral-200 bg-neutral-50 px-3 py-2",children:[(0,Je.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Je.jsxs)("button",{type:"button",onClick:()=>U("start"),className:`px-3 py-1.5 text-xs font-semibold rounded-md border transition-all cursor-pointer ${ee==="start"?be.activeStep:"bg-neutral-white border-neutral-300 hover:bg-neutral-100 text-neutral-700"}`,children:["\u2190 ",s]}),(0,Je.jsxs)("button",{type:"button",onClick:()=>U("end"),className:`px-3 py-1.5 text-xs font-semibold rounded-md border transition-all cursor-pointer ${ee==="end"?be.activeStep:"bg-neutral-white border-neutral-300 hover:bg-neutral-100 text-neutral-700"}`,children:[l," \u2192"]})]}),(0,Je.jsx)("button",{type:"button",onClick:()=>oe(!1),className:`px-3.5 py-1.5 text-xs font-semibold rounded-md transition-colors cursor-pointer ${be.applyButton}`,children:"\xC1p d\u1EE5ng"})]})]})})}),(0,Je.jsx)(Le,{id:we,helperText:Y,errorMessage:$,sizeClassName:tt.helper,className:ge})]})]})}var hf=require("react"),xf=Hn(require("next/image"),1);var gf={sm:{container:"p-3",imageWrapper:"w-16 h-16",defaultImageSize:64,title:"text-xs font-semibold text-neutral-800",description:"text-xs text-neutral-500",gap:"gap-2.5",contentGap:"gap-1",actionsGap:"mt-2"},md:{container:"p-6",imageWrapper:"w-28 h-28",defaultImageSize:112,title:"text-sm font-semibold text-neutral-800",description:"text-xs sm:text-sm text-neutral-500",gap:"gap-4",contentGap:"gap-1.5",actionsGap:"mt-3.5"},lg:{container:"p-10",imageWrapper:"w-40 h-40",defaultImageSize:160,title:"text-base font-semibold text-neutral-900",description:"text-sm text-neutral-500",gap:"gap-6",contentGap:"gap-2",actionsGap:"mt-5"}},mf={vertical:{container:"flex flex-col items-center justify-center text-center",content:"flex flex-col items-center justify-center text-center"},horizontal:{container:"flex flex-row items-center justify-start text-left",content:"flex flex-col items-start justify-center text-left flex-1"}};var ya=require("react/jsx-runtime");function yi({preset:e="default",...t}){switch(e){case"search":return(0,ya.jsx)(hl,{...t});case"error":return(0,ya.jsx)(xl,{...t});case"folder":return(0,ya.jsx)(vl,{...t});case"simple":return(0,ya.jsx)(yl,{...t});default:return(0,ya.jsx)(bl,{...t})}}var bf=["default","search","error","folder","simple"];function ed(e){return typeof e=="string"&&bf.includes(e)}function td(e){return typeof e!="string"?!1:e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")||e.startsWith("./")||e.startsWith("data:")||/\.(png|jpe?g|svg|webp|gif|avif)$/i.test(e)}function rd(e){if(!e)return{};let t=typeof e=="number"?`${e}px`:e;return{width:t,height:t}}var Yr=require("react/jsx-runtime");function Mo({size:e="md",layout:t="vertical",image:r="default",imageSize:n,imageClassName:o="",imageAlt:i="Tr\u1ED1ng",title:a,titleClassName:s="",description:l="Kh\xF4ng c\xF3 d\u1EEF li\u1EC7u",descriptionClassName:f="",actions:c,actionsClassName:w="",children:p,className:m="",role:v="status",ref:x,...h}){let k=C(e,gf,"md"),T=C(t,mf,"vertical"),y=rd(n),d=()=>{if(!r)return null;if(ed(r))return(0,Yr.jsx)(yi,{preset:r});if(td(r)){let P=typeof n=="number"?n:k.defaultImageSize;return(0,Yr.jsx)(xf.default,{src:r,alt:i,width:P,height:P,className:"size-full object-contain pointer-events-none select-none",unoptimized:r.startsWith("data:")||r.endsWith(".svg")})}return(0,hf.isValidElement)(r)?r:(0,Yr.jsx)(yi,{preset:"default"})},u=["flex items-center justify-center shrink-0",n?"":k.imageWrapper,o].filter(Boolean).join(" "),g=["w-full transition-all",T.container,k.container,k.gap,m].filter(Boolean).join(" "),b=[T.content,k.contentGap].filter(Boolean).join(" "),S=[k.title,s].filter(Boolean).join(" "),R=[k.description,f].filter(Boolean).join(" "),D=["flex flex-wrap items-center gap-2",k.actionsGap,t==="vertical"?"justify-center":"justify-start",w].filter(Boolean).join(" ");return(0,Yr.jsxs)("div",{ref:x,role:v,"aria-live":"polite",className:g,...h,children:[r&&(0,Yr.jsx)("div",{className:u,style:y,"aria-hidden":"true",children:d()}),(a||l||c||p)&&(0,Yr.jsxs)("div",{className:b,children:[a&&(0,Yr.jsx)("div",{className:S,children:a}),l&&(0,Yr.jsx)("div",{className:R,children:l}),c&&(0,Yr.jsx)("div",{className:D,children:c}),p&&(0,Yr.jsx)("div",{className:"mt-2 w-full",children:p})]})]})}var Wr=require("react");var Cf=require("react");var wa={xs:{trigger:"min-h-6 text-[11px] px-2 py-0.5",input:"text-[11px] leading-tight",text:"text-[11px]",icon:"size-3",option:"px-2 py-1 text-[11px] min-h-6",gap:"gap-1",badgeSize:"xs",defaultRadius:"sm"},sm:{trigger:"min-h-8 text-xs px-2.5 py-1",input:"text-xs leading-normal",text:"text-xs",icon:"size-3.5",option:"px-2.5 py-1.5 text-xs min-h-7",gap:"gap-1",badgeSize:"xs",defaultRadius:"md"},md:{trigger:"min-h-10 text-sm px-3.5 py-1.5",input:"text-sm leading-normal",text:"text-sm",icon:"size-[18px]",option:"px-3 py-2 text-sm min-h-9",gap:"gap-1.5",badgeSize:"sm",defaultRadius:"lg"},lg:{trigger:"min-h-12 text-base px-4 py-2",input:"text-base leading-normal",text:"text-base",icon:"size-5",option:"px-3.5 py-2.5 text-base min-h-11",gap:"gap-2",badgeSize:"md",defaultRadius:"xl"},xl:{trigger:"min-h-14 text-lg px-5 py-2.5",input:"text-lg leading-normal",text:"text-lg",icon:"size-6",option:"px-4 py-3 text-lg min-h-12",gap:"gap-2",badgeSize:"lg",defaultRadius:"xl"}},Ca={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Cs={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},vf={none:"none",sm:"sm",md:"md",lg:"lg",xl:"xl",full:"full"},ka={outline:{primary:"bg-neutral-white border-primary-400 hover:border-primary-500 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20 text-neutral-900",secondary:"bg-neutral-white border-secondary-400 hover:border-secondary-500 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20 text-neutral-900",error:"bg-neutral-white border-error-500 hover:border-error-600 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20 text-neutral-900",success:"bg-neutral-white border-success-400 hover:border-success-500 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20 text-neutral-900",warning:"bg-neutral-white border-warning-400 hover:border-warning-500 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20 text-neutral-900",info:"bg-neutral-white border-info-400 hover:border-info-500 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20 text-neutral-900",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20 text-neutral-900"},filled:{primary:"bg-primary-50/60 border border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20 text-neutral-900",secondary:"bg-secondary-50/60 border border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20 text-neutral-900",error:"bg-error-50/60 border border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20 text-neutral-900",success:"bg-success-50/60 border border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20 text-neutral-900",warning:"bg-warning-50/60 border border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20 text-neutral-900",info:"bg-info-50/60 border border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20 text-neutral-900",neutral:"bg-neutral-50/60 border border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20 text-neutral-900"},ghost:{primary:"bg-transparent border border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20 text-neutral-900",secondary:"bg-transparent border border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20 text-neutral-900",error:"bg-transparent border border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20 text-neutral-900",success:"bg-transparent border border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20 text-neutral-900",warning:"bg-transparent border border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20 text-neutral-900",info:"bg-transparent border border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20 text-neutral-900",neutral:"bg-transparent border border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20 text-neutral-900"}},yf={primary:"bg-primary-50 text-primary-700 font-medium",secondary:"bg-secondary-50 text-secondary-700 font-medium",error:"bg-error-50 text-error-700 font-medium",success:"bg-success-50 text-success-700 font-medium",warning:"bg-warning-50 text-warning-700 font-medium",info:"bg-info-50 text-info-700 font-medium",neutral:"bg-neutral-100 text-neutral-900 font-medium"},wf={primary:"bg-primary-50/60",secondary:"bg-secondary-50/60",error:"bg-error-50/60",success:"bg-success-50/60",warning:"bg-warning-50/60",info:"bg-info-50/60",neutral:"bg-neutral-100"};var Sn=require("react/jsx-runtime");function Jp({id:e,isOpen:t,disabled:r=!1,isLoading:n=!1,showClear:o=!1,onClear:i,startContent:a,endContent:s,triggerRef:l,getReferenceProps:f,onClick:c,roundedClass:w,currentSize:p,variantStyle:m,className:v="",children:x}){let h=r?"opacity-60 cursor-not-allowed bg-neutral-100 pointer-events-none":"cursor-pointer";return(0,Sn.jsxs)("div",{ref:l,role:"combobox","aria-expanded":t,"aria-haspopup":"listbox","aria-controls":e?`${e}-listbox`:void 0,tabIndex:r?-1:0,onClick:c,"aria-busy":n,"aria-disabled":r||n,...f({id:e,className:`group relative flex items-center justify-between transition-all duration-150 ease-in-out border-2 select-none ${w} ${p.trigger} ${p.gap} ${m} ${h} ${v}`,"aria-expanded":t,"aria-haspopup":"listbox"}),children:[a&&(0,Sn.jsx)("span",{className:"shrink-0 inline-flex items-center text-neutral-400",children:a}),x,(0,Sn.jsxs)("div",{className:"shrink-0 flex items-center gap-1.5 ml-1 text-neutral-400",children:[n&&(0,Sn.jsx)(De,{className:`${p.icon} animate-spin text-current`}),o&&!n&&(0,Sn.jsx)("button",{type:"button","aria-label":"Clear selection",onClick:k=>{k.stopPropagation(),i?.(k)},className:"hover:text-neutral-600 transition-colors p-0.5 rounded-full hover:bg-neutral-100",children:(0,Sn.jsx)(Ve,{className:"size-3.5"})}),s,(0,Sn.jsx)("span",{className:`transition-transform duration-200 ${t?"rotate-180":""}`,"aria-hidden":"true",children:(0,Sn.jsx)(yt,{className:p.icon})})]})]})}var dc=Jp;var Fo=require("react/jsx-runtime");function Qp({id:e,selectedOption:t,isOpen:r,size:n="md",variant:o="outline",color:i="primary",radius:a="md",placeholder:s="Ch\u1ECDn...",disabled:l=!1,readOnly:f=!1,isInvalid:c=!1,searchable:w=!1,searchPlacement:p="trigger",searchValue:m="",onSearchChange:v,onClear:x,clearable:h=!1,isLoading:k=!1,startContent:T,endContent:y,renderValue:d,triggerRef:u,getReferenceProps:g,onKeyDown:b,className:S=""}){let R=(0,Cf.useRef)(null),D=C(n,wa,"md"),P=C(a,Ca,"md"),E=!!c?"error":i,N=o==="other"?"":ka[o]?.[E]||ka.outline.primary,M=w&&(p==="trigger"||p==="both"),z=t!=null,H=h&&(z||m.length>0)&&!l&&!f;return(0,Fo.jsx)(dc,{id:e,isOpen:r,disabled:l,isLoading:k,showClear:H,onClear:x,startContent:T,endContent:y,triggerRef:u,getReferenceProps:g,onClick:()=>{!l&&!f&&!k&&M&&R.current?.focus()},roundedClass:P,currentSize:D,variantStyle:N,className:S,children:d&&z&&t?(0,Fo.jsx)("div",{className:"flex-1 min-w-0 truncate text-neutral-900",children:d(t)}):M&&!l&&!f&&!k?(0,Fo.jsx)("div",{className:"relative flex-1 min-w-0 flex items-center",children:(0,Fo.jsx)("input",{ref:R,type:"text","aria-label":"Search",value:m,placeholder:t?t.label:s,onChange:$=>v?.($.target.value),onKeyDown:b,className:`w-full bg-transparent outline-none border-none p-0 text-neutral-900 ${!m&&t?"placeholder:text-neutral-900 placeholder:font-normal":"placeholder:text-neutral-400"} ${D.input}`})}):(0,Fo.jsx)("div",{className:"flex-1 min-w-0 truncate",children:t?(0,Fo.jsx)("span",{className:"text-neutral-900",children:t.label}):(0,Fo.jsx)("span",{className:"text-neutral-400",children:s})})})}var wi=Qp;var kf=require("@floating-ui/react");var ln=require("react/jsx-runtime");function eg({option:e,isSelected:t,isActive:r,size:n="md",color:o="primary",radius:i="md",disabled:a=!1,renderOption:s,onClick:l,onMouseEnter:f,ref:c}){let w=C(n,wa,"md"),p=C(i,Ca,"md"),m=a||e.disabled;if(s)return(0,ln.jsx)("div",{ref:c,role:"option",tabIndex:-1,"aria-selected":t,"aria-disabled":m,"data-active":r,"data-selected":t,"data-value":e.value,className:`cursor-pointer select-none transition-colors duration-100 ${m?"opacity-50 cursor-not-allowed pointer-events-none":""}`,onClick:m?void 0:l,onMouseEnter:m?void 0:f,children:s(e,{selected:t,active:r})});let v=t?C(o,yf,"primary"):"text-neutral-800 hover:bg-neutral-100",x=r&&!t?C(o,wf,"primary"):"";return(0,ln.jsxs)("div",{ref:c,role:"option",tabIndex:-1,"aria-selected":t,"aria-disabled":m,"data-active":r,"data-selected":t,"data-value":e.value,className:`group flex items-center justify-between gap-2 select-none cursor-pointer transition-colors duration-100 ${p} ${w.option} ${v} ${x} ${m?"opacity-40 cursor-not-allowed pointer-events-none":""}`,onClick:m?void 0:l,onMouseEnter:m?void 0:f,children:[(0,ln.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.icon&&(0,ln.jsx)("span",{className:"shrink-0 inline-flex items-center text-neutral-400",children:e.icon}),(0,ln.jsxs)("div",{className:"flex flex-col min-w-0 flex-1",children:[(0,ln.jsx)("span",{className:"truncate leading-normal font-normal",children:e.label}),e.description&&(0,ln.jsx)("span",{className:"text-[11px] text-neutral-500 truncate font-normal",children:e.description})]})]}),t&&(0,ln.jsx)("span",{className:"shrink-0 flex items-center justify-center text-current","aria-hidden":"true",children:(0,ln.jsx)(Gn,{className:"size-3.5"})})]})}var ks=eg;var Tn=require("react"),ct=require("@floating-ui/react");function Ss(e){let t=new Map;return e.forEach(r=>{t.set(r.value,r)}),t}function nd(e,t,r){return e==null?null:t.find(n=>n.value===e)||r?.get(e)||{value:e,label:String(e)}}function fc(e,t,r){return e.map(n=>t.find(o=>o.value===n)||r?.get(n)||{value:n,label:String(n)})}function od(e,t){let r=t&&t>0?e.slice(0,t):e,n=t&&t>0?Math.max(0,e.length-t):0;return{visibleTags:r,hiddenTagCount:n}}function id(e,t){if(t==null||t==="")return"Ch\u01B0a nh\u1EADp";if(t instanceof Date)return t.toLocaleDateString("vi-VN");if(Array.isArray(t)){if(t.length===0)return"Ch\u01B0a ch\u1ECDn";if(e.type==="date-range"||t[0]instanceof Date||t[1]instanceof Date){let o=s=>s?s instanceof Date?s.toLocaleDateString("vi-VN"):String(s):"",i=o(t[0]),a=o(t[1]);return i&&a?`${i} - ${a}`:i||a||"Ch\u01B0a ch\u1ECDn"}let r=o=>{if(e.options&&e.options.length>0){let i=e.options.find(a=>String(a.value)===String(o));if(i)return String(i.label)}return String(o)};return t.length===1?r(t[0]):`${r(t[0])}, +${t.length-1}`}return String(t)}var He=require("react/jsx-runtime");function tg({field:e,currentValue:t,isOpen:r,onOpenChange:n,onRemove:o,onChange:i,color:a,radius:s}){let{refs:{setFloating:l,setReference:f},floatingStyles:c,context:w}=(0,ct.useFloating)({open:r,onOpenChange:n,placement:"bottom-start",transform:!1,middleware:[(0,ct.offset)(6),(0,ct.flip)(),(0,ct.shift)({padding:8})],whileElementsMounted:ct.autoUpdate}),{isMounted:p,styles:m}=rt(w),v=C(s,Cs,"md"),x=(0,ct.useClick)(w),h=(0,ct.useDismiss)(w,{outsidePress:b=>!b.target?.closest?.("[data-select-filter-popover]")}),{getReferenceProps:k,getFloatingProps:T}=(0,ct.useInteractions)([x,h]),y=(0,Tn.useRef)(null);(0,Tn.useEffect)(()=>{r&&y.current?.focus({preventScroll:!0})},[r]);let d=t!=null&&t!==""&&(!Array.isArray(t)||t.length>0),u=id(e,t),g=()=>{if(e.type==="custom")return e.render?.({value:t,onChange:b=>i(e.name,b)})??null;switch(e.type){case"string":case"text":return(0,He.jsx)(Yt,{ref:y,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Nh\u1EADp t\u1EEB kh\xF3a...",value:t||"",onChange:b=>i(e.name,b.target.value),...e.props||{}});case"number":return(0,He.jsx)(fo,{ref:y,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Nh\u1EADp s\u1ED1...",value:t??"",onChange:b=>{let S=b.target.value;if(S==="")i(e.name,"");else{let R=On(S);i(e.name,R!==void 0?R:S)}},onClear:()=>i(e.name,""),...e.props||{}});case"date":return(0,He.jsx)(To,{portal:!1,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Ch\u1ECDn ng\xE0y",value:t,onChange:b=>i(e.name,b),...e.props||{}});case"date-range":return(0,He.jsx)(No,{portal:!1,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Ch\u1ECDn kho\u1EA3ng ng\xE0y",value:t||[null,null],onChange:b=>i(e.name,b),...e.props||{}});case"checkbox-group":return(0,He.jsx)(bo,{size:"sm",color:a,value:t||[],onChange:b=>i(e.name,b),options:(e.options||[]).map(b=>({value:String(b.value),label:b.label,disabled:b.disabled})),className:"max-h-48 overflow-y-auto py-1 gap-2",...e.props||{}});default:return null}};return(0,He.jsxs)(He.Fragment,{children:[(0,He.jsx)("div",{ref:f,...k({className:"inline-flex items-center"}),children:(0,He.jsxs)(ir,{size:"sm",variant:"soft",color:d||r?a:"neutral",radius:"full",className:`cursor-pointer select-none transition-all duration-150 gap-1 px-3 py-1 rounded-full ${r?"ring-2 ring-primary-500/30":"hover:opacity-90"}`,onDelete:o,deleteAriaLabel:`X\xF3a b\u1ED9 l\u1ECDc ${e.label}`,children:[(0,He.jsxs)("span",{className:"font-semibold",children:[e.label,":"]}),(0,He.jsx)("span",{className:d?"font-medium":"opacity-70 italic",children:u})]})}),p&&(0,He.jsx)(ct.FloatingPortal,{children:(0,He.jsxs)("div",{ref:l,"data-select-filter-popover":"true",style:{...c,...m,zIndex:lt.SELECT_FILTER},...T({className:`bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-700 ${v} p-3 shadow-2xl ${e.type==="date"||e.type==="date-range"?"w-auto min-w-[280px]":"min-w-64 max-w-xs"}`}),children:[(0,He.jsxs)("div",{className:"flex items-center justify-between pb-2 mb-2 border-b border-neutral-100 dark:border-neutral-800",children:[(0,He.jsx)("span",{className:"text-xs font-bold text-neutral-800 dark:text-neutral-200",children:e.label}),(0,He.jsx)("button",{type:"button",onClick:()=>n(!1),className:"text-neutral-400 hover:text-neutral-600 dark:hover:text-neutral-200 p-0.5 rounded transition-colors",title:"\u0110\xF3ng",children:(0,He.jsx)(Ve,{className:"size-3.5"})})]}),(0,He.jsx)("div",{className:"mt-1",children:g()}),(0,He.jsxs)("div",{className:"flex items-center justify-between mt-3 pt-2 border-t border-neutral-100 dark:border-neutral-800",children:[(0,He.jsx)("button",{type:"button",onClick:o,className:"text-[11px] text-red-500 hover:text-red-700 transition-colors",children:"X\xF3a b\u1ED9 l\u1ECDc"}),(0,He.jsx)("button",{type:"button",onClick:()=>n(!1),className:"text-[11px] font-medium text-neutral-700 dark:text-neutral-200 hover:bg-neutral-100 dark:hover:bg-neutral-800 px-3 py-1 rounded-full border border-neutral-200 dark:border-neutral-700 transition-colors cursor-pointer",children:"Xong"})]})]})})]})}function rg({filters:e,values:t,onChange:r,onReset:n,showReset:o=!0,resetText:i="\u0110\u1EB7t l\u1EA1i b\u1ED9 l\u1ECDc",color:a="primary",radius:s="full"}){let[l,f]=(0,Tn.useState)(()=>{let N=[];return e?.forEach(M=>{let z=t?.[M.name]??M.defaultValue;z!=null&&z!==""&&(!Array.isArray(z)||z.length>0)&&N.push(M.name)}),N}),[c,w]=(0,Tn.useState)(null),[p,m]=(0,Tn.useState)(!1),{refs:{setFloating:v,setReference:x},floatingStyles:h,context:k}=(0,ct.useFloating)({open:p,onOpenChange:m,placement:"bottom-start",transform:!1,middleware:[(0,ct.offset)(6),(0,ct.flip)(),(0,ct.shift)({padding:8})],whileElementsMounted:ct.autoUpdate}),{isMounted:T,styles:y}=rt(k,{duration:120}),d=(0,ct.useClick)(k),u=(0,ct.useDismiss)(k,{outsidePress:N=>!N.target?.closest?.("[data-select-filter-popover]")}),{getReferenceProps:g,getFloatingProps:b}=(0,ct.useInteractions)([d,u]),S=N=>{l.includes(N.name)||f(M=>[...M,N.name]),m(!1),w(N.name)},R=N=>{f(M=>M.filter(z=>z!==N)),c===N&&w(null),r(N,void 0)},D=N=>{N.stopPropagation(),f([]),w(null),n?.()},P=(0,Tn.useMemo)(()=>new Set(l),[l]),I=l.length>0,E=C(s,Cs,"md");return!e||e.length===0?null:(0,He.jsx)("div",{onClick:N=>N.stopPropagation(),onMouseDown:N=>N.stopPropagation(),className:"p-2.5 border-b border-neutral-200 dark:border-neutral-700 bg-neutral-50/90 dark:bg-neutral-900/80 rounded-t-lg select-text",children:(0,He.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 min-h-7",children:[(0,He.jsxs)("div",{className:"inline-flex",children:[(0,He.jsxs)("button",{ref:x,type:"button",...g({className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-neutral-700 dark:text-neutral-300 hover:text-neutral-900 dark:hover:text-neutral-100 bg-white dark:bg-neutral-800 border border-neutral-300 dark:border-neutral-700 hover:border-neutral-400 dark:hover:border-neutral-600 rounded-full transition-all shadow-xs hover:shadow-sm cursor-pointer active:scale-95"}),children:[(0,He.jsx)(Zr,{className:"size-3.5 text-neutral-500"}),(0,He.jsx)("span",{children:"B\u1ED9 l\u1ECDc"}),(0,He.jsx)(yt,{className:`size-3 text-neutral-400 transition-transform ${p?"rotate-180":""}`})]}),T&&(0,He.jsx)(ct.FloatingPortal,{children:(0,He.jsxs)("div",{ref:v,"data-select-filter-popover":"true",style:{...h,...y,zIndex:lt.SELECT_FILTER},...b({className:`bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-700 ${E} p-1 shadow-2xl min-w-44`}),children:[(0,He.jsx)("div",{className:"px-2 py-1 text-[11px] font-semibold text-neutral-400 uppercase tracking-wider",children:"Ch\u1ECDn tr\u01B0\u1EDDng c\u1EA7n l\u1ECDc"}),(0,He.jsx)("div",{className:"space-y-0.5 mt-0.5",children:e.map(N=>{let M=P.has(N.name);return(0,He.jsxs)("button",{type:"button",onMouseDown:z=>z.preventDefault(),onClick:z=>{z.preventDefault(),z.stopPropagation(),S(N)},className:`w-full flex items-center justify-between px-2 py-1.5 text-xs rounded text-left transition-colors ${M?"text-primary font-medium bg-primary/5 hover:bg-primary/10":"text-neutral-700 dark:text-neutral-200 hover:bg-neutral-100 dark:hover:bg-neutral-800"}`,children:[(0,He.jsx)("span",{children:N.label}),M&&(0,He.jsx)("span",{className:"text-[10px] text-neutral-400",children:"\u0110ang l\u1ECDc"})]},N.name)})})]})})]}),l.map(N=>{let M=e.find(H=>H.name===N);if(!M)return null;let z=t[N]??M.defaultValue;return(0,He.jsx)(tg,{field:M,currentValue:z,isOpen:c===N,onOpenChange:H=>w(H?N:null),onRemove:()=>R(N),onChange:r,color:a,radius:s},N)}),o&&n&&I&&(0,He.jsxs)("button",{type:"button",onClick:D,className:"inline-flex items-center gap-1 text-[11px] text-neutral-500 hover:text-neutral-800 dark:hover:text-neutral-200 px-2.5 py-1 rounded-full border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-100 dark:hover:bg-neutral-800 transition-colors ml-auto cursor-pointer",title:"\u0110\u1EB7t l\u1EA1i to\xE0n b\u1ED9 b\u1ED9 l\u1ECDc",children:[(0,He.jsx)(cr,{className:"size-3"}),(0,He.jsx)("span",{children:i})]})]})})}var Ts=rg;var er=require("react/jsx-runtime"),ng={};function og({isOpen:e,isMounted:t,animated:r=!0,transitionStyles:n,options:o,selectedValues:i,activeIndex:a,size:s="md",color:l="primary",radius:f="md",isLoading:c=!1,portal:w=!0,maxMenuHeight:p=280,emptyText:m,emptyProps:v,menuHeader:x,menuFooter:h,listFooter:k,menuFilters:T,menuFilterValues:y=ng,menuFilterLayout:d="vertical",menuFilterGridCols:u=2,showResetFilters:g=!0,resetFiltersText:b,onMenuFilterChange:S,onResetFilters:R,renderOption:D,onSelectOption:P,onOptionMouseEnter:I,floatingStyles:E,floatingRef:N,getFloatingProps:M,listElementsRef:z,className:H=""}){if(!(t!==void 0?t:e))return null;let Y=C(f,Cs,"md"),$=(0,er.jsxs)("div",{ref:N,"data-state":e?"open":"closed",style:{...E,...r?n:{},zIndex:lt.SELECT},...M({className:`flex flex-col bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden focus:outline-none min-w-[200px] ${Y} ${H}`}),children:[x,T&&T.length>0&&S&&(0,er.jsx)(Ts,{filters:T,values:y,onChange:S,onReset:R,layout:d,gridCols:u,showReset:g,resetText:b,color:l,radius:f}),(0,er.jsx)("div",{role:"listbox",tabIndex:-1,style:{maxHeight:typeof p=="number"?`${p}px`:p},className:`p-1 overflow-y-auto overflow-x-hidden space-y-0.5 transition-opacity duration-150 ui-scrollbar ${c?"opacity-75":"opacity-100"}`,children:o.length===0?c?(0,er.jsxs)("div",{className:"flex items-center justify-center py-6 gap-2 text-zinc-500 dark:text-zinc-400 text-sm",children:[(0,er.jsx)(De,{className:"size-4 animate-spin text-current"}),(0,er.jsx)("span",{children:"Loading..."})]}):(0,er.jsx)("div",{className:"py-4 px-2",children:(0,er.jsx)(Mo,{size:"sm",image:"search",description:m||"No data found",className:"py-2",...v})}):(0,er.jsxs)(er.Fragment,{children:[(()=>{let F=new Set(i);return o.map((G,A)=>{let j=F.has(G.value);return(0,er.jsx)(ks,{ref:X=>{z.current[A]=X},option:G,isSelected:j,isActive:a===A,size:s,color:l,radius:f,disabled:G.disabled,renderOption:D,onClick:()=>P(G),onMouseEnter:()=>I(A)},String(G.value))})})(),k]})}),h]});return w?(0,er.jsx)(kf.FloatingPortal,{children:$}):$}var Ci=og;var Sf=require("react"),$t=require("@floating-ui/react");function Rs({placement:e="bottom-start",isOpen:t,onOpenChange:r,disabled:n=!1,readOnly:o=!1,isLoading:i=!1,animated:a=!0,animationDuration:s=150,activeIndex:l,onNavigate:f}){let c=(0,Sf.useRef)([]),w=!n&&!o,{refs:p,floatingStyles:m,context:v}=(0,$t.useFloating)({placement:e,open:t&&w,onOpenChange:b=>{w&&(!i||t||!b)&&r(b)},whileElementsMounted:$t.autoUpdate,transform:!1,middleware:[(0,$t.offset)(4),(0,$t.flip)(),(0,$t.shift)({padding:8})]}),x=(0,$t.useClick)(v,{enabled:w&&(!i||t)}),h=(0,$t.useDismiss)(v,{outsidePress:b=>!b.target?.closest?.("[data-select-filter-popover]")}),k=(0,$t.useRole)(v,{role:"listbox"}),T=(0,$t.useListNavigation)(v,{listRef:c,activeIndex:l,onNavigate:f,loop:!0}),{getReferenceProps:y,getFloatingProps:d}=(0,$t.useInteractions)([x,h,k,T]),{isMounted:u,styles:g}=rt(v,{duration:s,animated:a});return{refs:p,floatingStyles:m,transitionStyles:g,isMounted:u,context:v,getReferenceProps:y,getFloatingProps:d,elementsRef:c}}var Ds=require("react");var ig=[];function Ns({options:e,searchMode:t="client",controlledSearchValue:r,onSearchChange:n,searchField:o=["label","value"],menuFilters:i,controlledFilterValues:a,onMenuFilterChange:s,onSearch:l,debounceMs:f=300,filterFn:c,isOpen:w,setIsOpen:p,preserveSelected:m=!1,selectedValues:v=ig,historicalOptions:x}){let[h,k]=(0,Ds.useState)(""),T=r!==void 0,y=T?r:h,[d,u]=(0,Ds.useState)(()=>{let N={};return i?.forEach(M=>{M.defaultValue!==void 0&&(N[M.name]=M.defaultValue)}),N}),g=a??d,{debounced:b,cancel:S}=go((N,M)=>{t==="server"&&l?.(N,M)},f),R=N=>{T||k(N),n?.(N),w||p(!0),b(N,g)},D=()=>{S(),T||k(""),n?.(""),t==="server"&&l?.("",g)},P=(N,M)=>{let z={...g,[N]:M};a||u(z),s?.(z),b(y,z)},I=()=>{let N={};i?.forEach(M=>{M.defaultValue!==void 0&&(N[M.name]=M.defaultValue)}),a||u(N),s?.(N),b(y,N)},E=(0,Ds.useMemo)(()=>{if(t==="server")return e;let N=e,M=y.trim();if(M?c?N=N.filter(z=>c(z,y,g)):N=co(N,M,o):c&&(N=N.filter(z=>c(z,y,g))),m&&M&&v.length>0&&x){let z=new Set(N.map(V=>V.value)),H=[];for(let V of v)if(!z.has(V)){let Y=x.get(V);Y&&H.push(Y)}H.length>0&&(N=[...H,...N])}return N},[e,t,y,c,g,o,m,v,x]);return{searchInput:y,handleSearchChange:R,resetSearch:D,currentFilters:g,handleFilterChange:P,handleResetFilters:I,filteredOptions:E}}var io=require("react/jsx-runtime"),ag=[];function Sa({ref:e,options:t=ag,value:r,defaultValue:n,onChange:o,size:i="md",variant:a="outline",color:s="primary",radius:l="md",id:f,label:c,labelPlacement:w="top",placeholder:p="Ch\u1ECDn...",helperText:m,errorMessage:v,isInvalid:x,isDisabled:h=!1,readOnly:k=!1,isRequired:T=!1,name:y,searchable:d=!1,searchMode:u="client",searchPlacement:g="trigger",searchPlaceholder:b,searchField:S=["label","value"],searchValue:R,onSearchChange:D,menuFilters:P,menuFilterValues:I,menuFilterLayout:E="vertical",menuFilterGridCols:N=2,showResetFilters:M=!0,resetFiltersText:z,onMenuFilterChange:H,menuHeader:V,menuFooter:Y,listFooter:$,onSearch:F,debounceMs:G=300,filterFn:A,isLoading:j=!1,emptyText:B,emptyProps:X,clearable:le=!1,portal:ne=!0,placement:ue="bottom-start",maxMenuHeight:ie=280,animated:Q=!0,animationDuration:q=150,startContent:ge,endContent:ke,renderValue:L,renderOption:te,className:Z="",triggerClassName:he="",menuClassName:ae="",labelClassName:ve="",...Se}){let ye=!!(x??!!v),J=r!==void 0,[O,W]=(0,Wr.useState)(n??null),we=J?r??null:O,[fe,se]=(0,Wr.useState)(()=>Ss(t)),me=(0,Wr.useMemo)(()=>nd(we,t,fe),[we,t,fe]),[Re,xe]=(0,Wr.useState)(!1),[re,de]=(0,Wr.useState)(null),{searchInput:ce,handleSearchChange:ee,resetSearch:U,currentFilters:Ce,handleFilterChange:$e,handleResetFilters:Ee,filteredOptions:oe}=Ns({options:t,searchMode:u,controlledSearchValue:R,onSearchChange:D,searchField:S,menuFilters:P,controlledFilterValues:I,onMenuFilterChange:H,onSearch:F,debounceMs:G,filterFn:A,isOpen:Re,setIsOpen:xe}),{refs:Te,floatingStyles:Pe,transitionStyles:Qe,isMounted:We,getReferenceProps:Be,getFloatingProps:Oe,elementsRef:Ze}=Rs({placement:ue,isOpen:Re,onOpenChange:Ne=>{xe(Ne),Ne||(de(null),U())},disabled:h,readOnly:k,isLoading:j,animated:Q,animationDuration:q,activeIndex:re,onNavigate:de}),K=(0,Wr.useCallback)(Ne=>{Ne.disabled||h||k||(se(Xe=>{if(Xe.has(Ne.value))return Xe;let be=new Map(Xe);return be.set(Ne.value,Ne),be}),J||W(Ne.value),o?.(Ne.value,Ne),xe(!1),U())},[h,k,J,o,U]),_=(0,Wr.useCallback)(Ne=>{Ne.stopPropagation(),!(h||k)&&(J||W(null),o?.(null,null),U())},[h,k,J,o,U]),ze=Ne=>{if(Ne.key==="Enter"&&Re&&re!==null){Ne.preventDefault();let Xe=oe[re];Xe&&K(Xe)}else Ne.key==="ArrowDown"&&!Re&&xe(!0)},pe=w==="floating",Fe=w==="left",et=(0,Wr.useId)(),Ge=f||et,at=`${Ge}-trigger`,tt=()=>(0,io.jsx)(vt,{htmlFor:at,label:c,isRequired:T,isFloating:pe,size:i,color:s,hasError:ye,cursor:"pointer",className:ve});return(0,io.jsxs)("div",{ref:e,id:f,className:`group/field flex ${Fe?"flex-row items-center gap-3":"flex-col"} ${pe?"pt-2":""} ${Z}`,"data-disabled":h,"data-invalid":ye,...Se,children:[!pe&&tt(),(0,io.jsxs)("div",{className:"relative flex-1 min-w-0",children:[pe&&tt(),(0,io.jsx)(wi,{id:at,triggerRef:Te.setReference,getReferenceProps:Be,selectedOption:me,isOpen:Re,size:i,variant:a,color:s,radius:l,placeholder:b||p,disabled:h,readOnly:k,isInvalid:ye,searchable:d,searchPlacement:g,searchValue:ce,onSearchChange:ee,onClear:_,clearable:le,isLoading:j,startContent:ge,endContent:ke,renderValue:L,onKeyDown:ze,className:he}),(0,io.jsx)(Ci,{isOpen:Re,isMounted:We,animated:Q,transitionStyles:Qe,options:oe,selectedValues:we!=null?[we]:[],activeIndex:re,size:i,color:s,radius:l,isLoading:j,portal:ne,maxMenuHeight:ie,emptyText:B,emptyProps:X,menuHeader:V,menuFooter:Y,listFooter:$,menuFilters:P,menuFilterValues:Ce,menuFilterLayout:E,menuFilterGridCols:N,showResetFilters:M,resetFiltersText:z,onMenuFilterChange:$e,onResetFilters:Ee,renderOption:te,onSelectOption:K,onOptionMouseEnter:de,floatingRef:Te.setFloating,floatingStyles:Pe,getFloatingProps:Oe,listElementsRef:Ze,className:ae})]}),y&&we!==null&&we!==void 0&&(0,io.jsx)("input",{type:"hidden",name:y,value:String(we)}),(0,io.jsx)(Le,{id:`${Ge}-helper`,errorMessage:v,helperText:m})]})}var ad=Sa;var Mr=require("react");var Tf=require("react");var Rn=require("react/jsx-runtime");function sg({id:e,selectedOptions:t,isOpen:r,size:n="md",variant:o="outline",color:i="primary",radius:a="md",placeholder:s="Ch\u1ECDn...",disabled:l=!1,readOnly:f=!1,isInvalid:c=!1,maxTagCount:w,searchable:p=!1,searchPlacement:m="trigger",searchValue:v="",onSearchChange:x,onRemoveTag:h,onClear:k,clearable:T=!1,isLoading:y=!1,startContent:d,endContent:u,renderValue:g,triggerRef:b,getReferenceProps:S,onKeyDown:R,className:D=""}){let P=(0,Tf.useRef)(null),I=C(n,wa,"md"),E=C(a,Ca,"md"),N=C(a,vf,"md"),z=!!c?"error":i,H=o==="other"?"":ka[o]?.[z]||ka.outline.primary,V=p&&(m==="trigger"||m==="both"),Y=t.length>0,$=T&&(Y||v.length>0)&&!l&&!f,{visibleTags:F,hiddenTagCount:G}=od(t,w);return(0,Rn.jsx)(dc,{id:e,isOpen:r,disabled:l,isLoading:y,showClear:$,onClear:k,startContent:d,endContent:u,triggerRef:b,getReferenceProps:S,onClick:()=>{!l&&!f&&!y&&V&&P.current?.focus()},roundedClass:E,currentSize:I,variantStyle:H,className:D,children:g&&Y?(0,Rn.jsx)("div",{className:"flex-1 min-w-0 truncate text-neutral-900",children:g(t)}):(0,Rn.jsxs)("div",{className:"flex flex-wrap items-center gap-1 flex-1 min-w-0",children:[F.map(B=>(0,Rn.jsx)(ir,{size:I.badgeSize,variant:"soft",color:i,radius:N,onDelete:!l&&!f&&!y&&h?()=>h(B):void 0,className:"max-w-full truncate",children:(0,Rn.jsx)("span",{className:"truncate",children:B.label})},String(B.value))),G>0&&(0,Rn.jsxs)(ir,{size:I.badgeSize,variant:"soft",color:"neutral",radius:N,children:["+",G]}),V&&!l&&!f&&!y?(0,Rn.jsx)("input",{ref:P,type:"text","aria-label":"Search",value:v,placeholder:Y?"":s,onChange:B=>x?.(B.target.value),onKeyDown:R,className:`bg-transparent outline-none border-none p-0 flex-1 min-w-15 text-neutral-900 placeholder:text-neutral-400 ${I.input}`}):Y?null:(0,Rn.jsx)("span",{className:"text-neutral-400 truncate",children:s})]})})}var Ps=sg;var ao=require("react/jsx-runtime"),lg=[],Rf=[];function cg({ref:e,options:t=lg,value:r,defaultValue:n,onChange:o,size:i="md",variant:a="outline",color:s="primary",radius:l="md",id:f,label:c,labelPlacement:w="top",placeholder:p="Ch\u1ECDn...",helperText:m,errorMessage:v,isInvalid:x,isDisabled:h=!1,readOnly:k=!1,isRequired:T=!1,name:y,maxTagCount:d,searchable:u=!1,searchMode:g="client",searchPlacement:b="trigger",searchPlaceholder:S,searchField:R=["label","value"],preserveSelected:D=!0,searchValue:P,onSearchChange:I,menuFilters:E,menuFilterValues:N,menuFilterLayout:M="vertical",menuFilterGridCols:z=2,showResetFilters:H=!0,resetFiltersText:V,onMenuFilterChange:Y,menuHeader:$,menuFooter:F,listFooter:G,onSearch:A,debounceMs:j=300,filterFn:B,isLoading:X=!1,emptyText:le,emptyProps:ne,clearable:ue=!1,portal:ie=!0,placement:Q="bottom-start",maxMenuHeight:q=280,animated:ge=!0,animationDuration:ke=150,startContent:L,endContent:te,renderValue:Z,renderOption:he,className:ae="",triggerClassName:ve="",menuClassName:Se="",labelClassName:ye="",...J}){let O=!!(x??!!v),W=r!==void 0,[we,fe]=(0,Mr.useState)(n??Rf),se=W?r??Rf:we,[me,Re]=(0,Mr.useState)(()=>Ss(t)),xe=(0,Mr.useMemo)(()=>fc(se,t,me),[se,t,me]),[re,de]=(0,Mr.useState)(!1),[ce,ee]=(0,Mr.useState)(null),{searchInput:U,handleSearchChange:Ce,resetSearch:$e,currentFilters:Ee,handleFilterChange:oe,handleResetFilters:Te,filteredOptions:Pe}=Ns({options:t,searchMode:g,controlledSearchValue:P,onSearchChange:I,searchField:R,menuFilters:E,controlledFilterValues:N,onMenuFilterChange:Y,onSearch:A,debounceMs:j,filterFn:B,isOpen:re,setIsOpen:de,preserveSelected:D,selectedValues:se,historicalOptions:me}),{refs:Qe,floatingStyles:We,transitionStyles:Be,isMounted:Oe,getReferenceProps:Ze,getFloatingProps:K,elementsRef:_}=Rs({placement:Q,isOpen:re,onOpenChange:je=>{de(je),je||ee(null)},disabled:h,readOnly:k,isLoading:X,animated:ge,animationDuration:ke,activeIndex:ce,onNavigate:ee}),ze=(0,Mr.useCallback)(je=>{if(je.disabled||h||k)return;Re(br=>{if(br.has(je.value))return br;let ht=new Map(br);return ht.set(je.value,je),ht});let st=se.includes(je.value)?se.filter(br=>br!==je.value):[...se,je.value];W||fe(st);let rr=fc(st,t,me);o?.(st,rr),$e()},[h,k,se,W,t,o,$e,me]),pe=(0,Mr.useCallback)(je=>{if(h||k)return;let pt=se.filter(rr=>rr!==je.value);W||fe(pt);let st=pt.map(rr=>t.find(br=>br.value===rr)||me.get(rr)||{value:rr,label:String(rr)});o?.(pt,st)},[h,k,se,W,t,o,me]),Fe=(0,Mr.useCallback)(je=>{je.stopPropagation(),!(h||k)&&(W||fe([]),o?.([],[]),$e())},[h,k,W,o,$e]),et=je=>{let pt=je.currentTarget?.value??U;if(je.key==="Backspace"&&(!pt||pt.length===0)&&xe.length>0){je.preventDefault();let st=xe[xe.length-1];st&&pe(st)}else if(je.key==="Enter"&&re&&ce!==null){je.preventDefault();let st=Pe[ce];st&&ze(st)}else je.key==="ArrowDown"&&!re&&de(!0)},Ge=w==="floating",at=w==="left",tt=(0,Mr.useId)(),Ne=f||tt,Xe=`${Ne}-trigger`,be=()=>(0,ao.jsx)(vt,{htmlFor:Xe,label:c,isRequired:T,isFloating:Ge,size:i,color:s,hasError:O,cursor:"pointer",className:ye});return(0,ao.jsxs)("div",{ref:e,id:f,className:`group/field flex ${at?"flex-row items-center gap-3":"flex-col"} ${Ge?"pt-2":""} ${ae}`,"data-disabled":h,"data-invalid":O,...J,children:[!Ge&&be(),(0,ao.jsxs)("div",{className:"relative flex-1 min-w-0",children:[Ge&&be(),(0,ao.jsx)(Ps,{id:Xe,triggerRef:Qe.setReference,getReferenceProps:Ze,selectedOptions:xe,isOpen:re,size:i,variant:a,color:s,radius:l,placeholder:S||p,disabled:h,readOnly:k,isInvalid:O,maxTagCount:d,searchable:u,searchPlacement:b,searchValue:U,onSearchChange:Ce,onRemoveTag:pe,onClear:Fe,clearable:ue,isLoading:X,startContent:L,endContent:te,renderValue:Z,onKeyDown:et,className:ve}),(0,ao.jsx)(Ci,{isOpen:re,isMounted:Oe,animated:ge,transitionStyles:Be,options:Pe,selectedValues:se,activeIndex:ce,size:i,color:s,radius:l,isLoading:X,portal:ie,maxMenuHeight:q,emptyText:le,emptyProps:ne,menuHeader:$,menuFooter:F,listFooter:G,menuFilters:E,menuFilterValues:Ee,menuFilterLayout:M,menuFilterGridCols:z,showResetFilters:H,resetFiltersText:V,onMenuFilterChange:oe,onResetFilters:Te,renderOption:he,onSelectOption:ze,onOptionMouseEnter:ee,floatingRef:Qe.setFloating,floatingStyles:We,getFloatingProps:K,listElementsRef:_,className:Se})]}),y&&se.map((je,pt)=>(0,ao.jsx)("input",{type:"hidden",name:`${y}[]`,value:String(je)},`${y}-${je}-${pt}`)),(0,ao.jsx)(Le,{id:`${Ne}-helper`,errorMessage:v,helperText:m})]})}var sd=cg;var pc=require("react");function Df(e,t=300){let[r,n]=(0,pc.useState)(e);return(0,pc.useEffect)(()=>{let o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}var cn=require("react");function Nf({onLoadMore:e,hasMore:t=!0,isLoading:r=!1,disabled:n=!1,rootMargin:o="100px",threshold:i=0,root:a=null}){let[s,l]=(0,cn.useState)(!1),[f,c]=(0,cn.useState)(null),w=(0,cn.useRef)(!1),p=t&&!r&&!n,m=(0,cn.useCallback)(()=>{if(!(!p||w.current)){w.current=!0;try{let x=e();x&&typeof x.then=="function"?x.finally(()=>{w.current=!1}):w.current=!1}catch{w.current=!1}}},[p,e]),v=(0,cn.useCallback)(x=>{c(x)},[]);return(0,cn.useEffect)(()=>{if(!f||n||!t||typeof window>"u"||!("IntersectionObserver"in window))return;let x=a&&typeof a=="object"&&"current"in a?a.current:a,h=new IntersectionObserver(k=>{let[T]=k;if(!T)return;let y=T.isIntersecting;l(y),y&&m()},{root:x,rootMargin:o,threshold:i});return h.observe(f),()=>{h.disconnect(),l(!1)}},[f,a,o,i,n,t,m]),(0,cn.useEffect)(()=>{p&&s&&m()},[p,s,m]),{sentinelRef:v,isIntersecting:s}}var Mn=require("react"),_f=require("react-dropzone");var gc={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-full"},Pf={primary:"text-primary-500 group-focus-within/field:text-primary-600",secondary:"text-secondary-500 group-focus-within/field:text-secondary-600",neutral:"text-neutral-600 group-focus-within/field:text-neutral-800",error:"text-error-500 group-focus-within/field:text-error-600",success:"text-success-500 group-focus-within/field:text-success-600",warning:"text-warning-500 group-focus-within/field:text-warning-600",info:"text-info-500 group-focus-within/field:text-info-600"},zf={xs:"h-28",sm:"h-36",md:"h-48",lg:"h-60",xl:"h-72"},Ta={xs:{dropzoneHeight:"min-h-[80px]",dropzonePadding:"p-3",avatarSize:"size-12",thumbnailSize:"size-12",iconSize:24,titleSize:"text-[11px]",descSize:"text-[10px]",labelSize:"text-[11px] mb-1",helperSize:"text-[9px] mt-0.5",gap:"gap-1.5"},sm:{dropzoneHeight:"min-h-[100px]",dropzonePadding:"p-4",avatarSize:"size-16",thumbnailSize:"size-16",iconSize:32,titleSize:"text-xs",descSize:"text-[11px]",labelSize:"text-xs mb-1",helperSize:"text-[10px] mt-0.5",gap:"gap-2"},md:{dropzoneHeight:"min-h-[130px]",dropzonePadding:"p-5",avatarSize:"size-24",thumbnailSize:"size-20",iconSize:44,titleSize:"text-sm",descSize:"text-xs",labelSize:"text-sm mb-1.5",helperSize:"text-[11px] mt-1",gap:"gap-3"},lg:{dropzoneHeight:"min-h-[160px]",dropzonePadding:"p-6",avatarSize:"size-28",thumbnailSize:"size-24",iconSize:54,titleSize:"text-base",descSize:"text-xs",labelSize:"text-base mb-1.5",helperSize:"text-xs mt-1",gap:"gap-3.5"},xl:{dropzoneHeight:"min-h-[200px]",dropzonePadding:"p-8",avatarSize:"size-36",thumbnailSize:"size-28",iconSize:64,titleSize:"text-lg",descSize:"text-sm",labelSize:"text-lg mb-2",helperSize:"text-sm mt-1",gap:"gap-4"}},If={outline:{primary:{idle:"bg-neutral-white border-primary-400 hover:border-primary-500 text-neutral-700",active:"bg-primary-50/50 border-primary-500 ring-2 ring-primary-500/20 text-primary-900",iconColor:"text-primary-500",titleHover:"group-hover:text-primary-600"},secondary:{idle:"bg-neutral-white border-secondary-400 hover:border-secondary-500 text-neutral-700",active:"bg-secondary-50/50 border-secondary-500 ring-2 ring-secondary-500/20 text-secondary-900",iconColor:"text-secondary-500",titleHover:"group-hover:text-secondary-600"},neutral:{idle:"bg-neutral-white border-neutral-300 hover:border-neutral-400 text-neutral-700",active:"bg-neutral-100/70 border-neutral-500 ring-2 ring-neutral-500/20 text-neutral-900",iconColor:"text-neutral-500",titleHover:"group-hover:text-neutral-900"},error:{idle:"bg-neutral-white border-error-500 hover:border-error-600 text-neutral-700",active:"bg-error-50/50 border-error-500 ring-2 ring-error-500/20 text-error-900",iconColor:"text-error-500",titleHover:"group-hover:text-error-600"},success:{idle:"bg-neutral-white border-success-400 hover:border-success-500 text-neutral-700",active:"bg-success-50/50 border-success-500 ring-2 ring-success-500/20 text-success-900",iconColor:"text-success-500",titleHover:"group-hover:text-success-600"},warning:{idle:"bg-neutral-white border-warning-400 hover:border-warning-500 text-neutral-700",active:"bg-warning-50/50 border-warning-500 ring-2 ring-warning-500/20 text-warning-900",iconColor:"text-warning-500",titleHover:"group-hover:text-warning-600"},info:{idle:"bg-neutral-white border-info-400 hover:border-info-500 text-neutral-700",active:"bg-info-50/50 border-info-500 ring-2 ring-info-500/20 text-info-900",iconColor:"text-info-500",titleHover:"group-hover:text-info-600"}},filled:{primary:{idle:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 hover:border-primary-400 text-primary-900",active:"bg-primary-100 border-primary-500 ring-2 ring-primary-500/20 text-primary-950",iconColor:"text-primary-600",titleHover:"group-hover:text-primary-700"},secondary:{idle:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 hover:border-secondary-400 text-secondary-900",active:"bg-secondary-100 border-secondary-500 ring-2 ring-secondary-500/20 text-secondary-950",iconColor:"text-secondary-600",titleHover:"group-hover:text-secondary-700"},neutral:{idle:"bg-neutral-100/70 border-neutral-200 hover:bg-neutral-200/70 hover:border-neutral-400 text-neutral-800",active:"bg-neutral-200 border-neutral-500 ring-2 ring-neutral-500/20 text-neutral-900",iconColor:"text-neutral-600",titleHover:"group-hover:text-neutral-950"},error:{idle:"bg-error-50/60 border-error-200 hover:bg-error-100/60 hover:border-error-400 text-error-900",active:"bg-error-100 border-error-500 ring-2 ring-error-500/20 text-error-950",iconColor:"text-error-600",titleHover:"group-hover:text-error-700"},success:{idle:"bg-success-50/60 border-success-200 hover:bg-success-100/60 hover:border-success-400 text-success-900",active:"bg-success-100 border-success-500 ring-2 ring-success-500/20 text-success-950",iconColor:"text-success-600",titleHover:"group-hover:text-success-700"},warning:{idle:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 hover:border-warning-400 text-warning-900",active:"bg-warning-100 border-warning-500 ring-2 ring-warning-500/20 text-warning-950",iconColor:"text-warning-600",titleHover:"group-hover:text-warning-700"},info:{idle:"bg-info-50/60 border-info-200 hover:bg-info-100/60 hover:border-info-400 text-info-900",active:"bg-info-100 border-info-500 ring-2 ring-info-500/20 text-info-950",iconColor:"text-info-600",titleHover:"group-hover:text-info-700"}},ghost:{primary:{idle:"bg-transparent border-transparent hover:bg-primary-50/60 hover:border-primary-300 text-neutral-700",active:"bg-primary-50 border-primary-500 ring-2 ring-primary-500/20 text-primary-900",iconColor:"text-primary-500",titleHover:"group-hover:text-primary-600"},secondary:{idle:"bg-transparent border-transparent hover:bg-secondary-50/60 hover:border-secondary-300 text-neutral-700",active:"bg-secondary-50 border-secondary-500 ring-2 ring-secondary-500/20 text-secondary-900",iconColor:"text-secondary-500",titleHover:"group-hover:text-secondary-600"},neutral:{idle:"bg-transparent border-transparent hover:bg-neutral-100 hover:border-neutral-300 text-neutral-700",active:"bg-neutral-100 border-neutral-500 ring-2 ring-neutral-500/20 text-neutral-900",iconColor:"text-neutral-500",titleHover:"group-hover:text-neutral-900"},error:{idle:"bg-transparent border-transparent hover:bg-error-50/60 hover:border-error-300 text-neutral-700",active:"bg-error-50 border-error-500 ring-2 ring-error-500/20 text-error-900",iconColor:"text-error-500",titleHover:"group-hover:text-error-600"},success:{idle:"bg-transparent border-transparent hover:bg-success-50/60 hover:border-success-300 text-neutral-700",active:"bg-success-50 border-success-500 ring-2 ring-success-500/20 text-success-900",iconColor:"text-success-500",titleHover:"group-hover:text-success-600"},warning:{idle:"bg-transparent border-transparent hover:bg-warning-50/60 hover:border-warning-300 text-neutral-700",active:"bg-warning-50 border-warning-500 ring-2 ring-warning-500/20 text-warning-900",iconColor:"text-warning-500",titleHover:"group-hover:text-warning-600"},info:{idle:"bg-transparent border-transparent hover:bg-info-50/60 hover:border-info-300 text-neutral-700",active:"bg-info-50 border-info-500 ring-2 ring-info-500/20 text-info-900",iconColor:"text-info-500",titleHover:"group-hover:text-info-600"}}};function un(e,t=1){if(!e||!+e)return"0 B";let r=1024,n=t<0?0:t,o=["B","KB","MB","GB","TB"],i=Math.floor(Math.log(e)/Math.log(r));return`${parseFloat((e/Math.pow(r,i)).toFixed(n))} ${o[i]}`}function ki(e){return e?Array.isArray(e)?e.filter(t=>!!t):[e]:[]}var mc={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-full"},Mf={primary:"text-primary-500 group-focus-within/field:text-primary-600",secondary:"text-secondary-500 group-focus-within/field:text-secondary-600",neutral:"text-neutral-600 group-focus-within/field:text-neutral-800",error:"text-error-500 group-focus-within/field:text-error-600",success:"text-success-500 group-focus-within/field:text-success-600",warning:"text-warning-500 group-focus-within/field:text-warning-600",info:"text-info-500 group-focus-within/field:text-info-600"},Ff={xs:"h-28",sm:"h-36",md:"h-48",lg:"h-60",xl:"h-72"},Dn={xs:{dropzoneHeight:"min-h-[80px]",dropzoneMinHeight:"min-h-[80px]",dropzonePadding:"p-3",compactMinHeight:"min-h-[40px]",compactPadding:"px-3 py-2",thumbnailSize:"w-28 h-20",iconSize:24,fileIconSize:28,titleSize:"text-[11px]",descSize:"text-[10px]",fileNameSize:"text-xs",fileMetaSize:"text-[10px]",labelSize:"text-[11px] mb-1",helperSize:"text-[9px] mt-0.5",buttonSize:"xs",actionButtonPadding:"p-1",gap:"gap-1.5",itemPadding:"px-2.5 py-1.5"},sm:{dropzoneHeight:"min-h-[100px]",dropzoneMinHeight:"min-h-[100px]",dropzonePadding:"p-4",compactMinHeight:"min-h-[48px]",compactPadding:"px-3.5 py-2.5",thumbnailSize:"w-32 h-24",iconSize:32,fileIconSize:34,titleSize:"text-xs",descSize:"text-[11px]",fileNameSize:"text-xs font-medium",fileMetaSize:"text-[11px]",labelSize:"text-xs mb-1",helperSize:"text-[10px] mt-0.5",buttonSize:"sm",actionButtonPadding:"p-1.5",gap:"gap-2",itemPadding:"px-3 py-2"},md:{dropzoneHeight:"min-h-[130px]",dropzoneMinHeight:"min-h-[130px]",dropzonePadding:"p-5",compactMinHeight:"min-h-[56px]",compactPadding:"px-4 py-3",thumbnailSize:"w-40 h-28",iconSize:42,fileIconSize:40,titleSize:"text-sm",descSize:"text-xs",fileNameSize:"text-sm font-medium",fileMetaSize:"text-xs",labelSize:"text-sm mb-1.5",helperSize:"text-[11px] mt-1",buttonSize:"md",actionButtonPadding:"p-1.5",gap:"gap-2.5",itemPadding:"px-3.5 py-2.5"},lg:{dropzoneHeight:"min-h-[160px]",dropzoneMinHeight:"min-h-[160px]",dropzonePadding:"p-6",compactMinHeight:"min-h-[64px]",compactPadding:"px-5 py-3.5",thumbnailSize:"w-48 h-32",iconSize:52,fileIconSize:48,titleSize:"text-base",descSize:"text-xs",fileNameSize:"text-base font-medium",fileMetaSize:"text-xs",labelSize:"text-base mb-1.5",helperSize:"text-xs mt-1",buttonSize:"lg",actionButtonPadding:"p-2",gap:"gap-3",itemPadding:"px-4 py-3"},xl:{dropzoneHeight:"min-h-[200px]",dropzoneMinHeight:"min-h-[200px]",dropzonePadding:"p-8",compactMinHeight:"min-h-[72px]",compactPadding:"px-6 py-4",thumbnailSize:"w-56 h-36",iconSize:64,fileIconSize:56,titleSize:"text-lg",descSize:"text-sm",fileNameSize:"text-lg font-medium",fileMetaSize:"text-sm",labelSize:"text-lg mb-2",helperSize:"text-sm mt-1",buttonSize:"xl",actionButtonPadding:"p-2.5",gap:"gap-3.5",itemPadding:"px-5 py-3.5"}},Ef={outline:{primary:{idle:"bg-neutral-white border-primary-400 hover:border-primary-500 text-neutral-700",active:"bg-primary-50/50 border-primary-500 ring-2 ring-primary-500/20 text-primary-900",iconColor:"text-primary-500",titleHover:"group-hover:text-primary-600",itemBg:"bg-white hover:bg-neutral-50/80",itemBorder:"border-neutral-200 hover:border-primary-300"},secondary:{idle:"bg-neutral-white border-secondary-400 hover:border-secondary-500 text-neutral-700",active:"bg-secondary-50/50 border-secondary-500 ring-2 ring-secondary-500/20 text-secondary-900",iconColor:"text-secondary-500",titleHover:"group-hover:text-secondary-600",itemBg:"bg-white hover:bg-neutral-50/80",itemBorder:"border-neutral-200 hover:border-secondary-300"},neutral:{idle:"bg-neutral-white border-neutral-300 hover:border-neutral-400 text-neutral-700",active:"bg-neutral-100/70 border-neutral-500 ring-2 ring-neutral-500/20 text-neutral-900",iconColor:"text-neutral-500",titleHover:"group-hover:text-neutral-900",itemBg:"bg-white hover:bg-neutral-50/80",itemBorder:"border-neutral-200 hover:border-neutral-400"},error:{idle:"bg-neutral-white border-error-500 hover:border-error-600 text-neutral-700",active:"bg-error-50/50 border-error-500 ring-2 ring-error-500/20 text-error-900",iconColor:"text-error-500",titleHover:"group-hover:text-error-600",itemBg:"bg-white hover:bg-error-50/30",itemBorder:"border-error-200 hover:border-error-300"},success:{idle:"bg-neutral-white border-success-400 hover:border-success-500 text-neutral-700",active:"bg-success-50/50 border-success-500 ring-2 ring-success-500/20 text-success-900",iconColor:"text-success-500",titleHover:"group-hover:text-success-600",itemBg:"bg-white hover:bg-success-50/30",itemBorder:"border-success-200 hover:border-success-300"},warning:{idle:"bg-neutral-white border-warning-400 hover:border-warning-500 text-neutral-700",active:"bg-warning-50/50 border-warning-500 ring-2 ring-warning-500/20 text-warning-900",iconColor:"text-warning-500",titleHover:"group-hover:text-warning-600",itemBg:"bg-white hover:bg-warning-50/30",itemBorder:"border-warning-200 hover:border-warning-300"},info:{idle:"bg-neutral-white border-info-400 hover:border-info-500 text-neutral-700",active:"bg-info-50/50 border-info-500 ring-2 ring-info-500/20 text-info-900",iconColor:"text-info-500",titleHover:"group-hover:text-info-600",itemBg:"bg-white hover:bg-info-50/30",itemBorder:"border-info-200 hover:border-info-300"}},filled:{primary:{idle:"border-transparent bg-primary-50/60 hover:bg-primary-100/60",active:"border-primary-500 bg-primary-100 ring-2 ring-primary-500/20",iconColor:"text-primary-600",titleHover:"group-hover:text-primary-700",itemBg:"bg-primary-50/40 hover:bg-primary-50/80",itemBorder:"border-primary-100 hover:border-primary-200"},secondary:{idle:"border-transparent bg-secondary-50/60 hover:bg-secondary-100/60",active:"border-secondary-500 bg-secondary-100 ring-2 ring-secondary-500/20",iconColor:"text-secondary-600",titleHover:"group-hover:text-secondary-700",itemBg:"bg-secondary-50/40 hover:bg-secondary-50/80",itemBorder:"border-secondary-100 hover:border-secondary-200"},neutral:{idle:"border-transparent bg-neutral-100/70 hover:bg-neutral-200/50",active:"border-neutral-400 bg-neutral-200 ring-2 ring-neutral-400/20",iconColor:"text-neutral-600",titleHover:"group-hover:text-neutral-800",itemBg:"bg-neutral-100/50 hover:bg-neutral-100",itemBorder:"border-neutral-200 hover:border-neutral-300"},error:{idle:"border-transparent bg-error-50/70 hover:bg-error-100/70",active:"border-error-500 bg-error-100 ring-2 ring-error-500/20",iconColor:"text-error-600",titleHover:"group-hover:text-error-700",itemBg:"bg-error-50/40 hover:bg-error-50/80",itemBorder:"border-error-100 hover:border-error-200"},success:{idle:"border-transparent bg-success-50/70 hover:bg-success-100/70",active:"border-success-500 bg-success-100 ring-2 ring-success-500/20",iconColor:"text-success-600",titleHover:"group-hover:text-success-700",itemBg:"bg-success-50/40 hover:bg-success-50/80",itemBorder:"border-success-100 hover:border-success-200"},warning:{idle:"border-transparent bg-warning-50/70 hover:bg-warning-100/70",active:"border-warning-500 bg-warning-100 ring-2 ring-warning-500/20",iconColor:"text-warning-600",titleHover:"group-hover:text-warning-700",itemBg:"bg-warning-50/40 hover:bg-warning-50/80",itemBorder:"border-warning-100 hover:border-warning-200"},info:{idle:"border-transparent bg-info-50/70 hover:bg-info-100/70",active:"border-info-500 bg-info-100 ring-2 ring-info-500/20",iconColor:"text-info-600",titleHover:"group-hover:text-info-700",itemBg:"bg-info-50/40 hover:bg-info-50/80",itemBorder:"border-info-100 hover:border-info-200"}},ghost:{primary:{idle:"border-transparent bg-transparent hover:bg-primary-50/30",active:"border-primary-400 bg-primary-50/40 ring-2 ring-primary-400/20",iconColor:"text-primary-500",titleHover:"group-hover:text-primary-600",itemBg:"bg-transparent hover:bg-primary-50/20",itemBorder:"border-transparent hover:border-primary-200"},secondary:{idle:"border-transparent bg-transparent hover:bg-secondary-50/30",active:"border-secondary-400 bg-secondary-50/40 ring-2 ring-secondary-400/20",iconColor:"text-secondary-500",titleHover:"group-hover:text-secondary-600",itemBg:"bg-transparent hover:bg-secondary-50/20",itemBorder:"border-transparent hover:border-secondary-200"},neutral:{idle:"border-transparent bg-transparent hover:bg-neutral-100/40",active:"border-neutral-400 bg-neutral-100/50 ring-2 ring-neutral-400/20",iconColor:"text-neutral-500",titleHover:"group-hover:text-neutral-800",itemBg:"bg-transparent hover:bg-neutral-100/40",itemBorder:"border-transparent hover:border-neutral-300"},error:{idle:"border-transparent bg-transparent hover:bg-error-50/30",active:"border-error-400 bg-error-50/40 ring-2 ring-error-400/20",iconColor:"text-error-500",titleHover:"group-hover:text-error-600",itemBg:"bg-transparent hover:bg-error-50/20",itemBorder:"border-transparent hover:border-error-200"},success:{idle:"border-transparent bg-transparent hover:bg-success-50/30",active:"border-success-400 bg-success-50/40 ring-2 ring-success-400/20",iconColor:"text-success-500",titleHover:"group-hover:text-success-600",itemBg:"bg-transparent hover:bg-success-50/20",itemBorder:"border-transparent hover:border-success-200"},warning:{idle:"border-transparent bg-transparent hover:bg-warning-50/30",active:"border-warning-400 bg-warning-50/40 ring-2 ring-warning-400/20",iconColor:"text-warning-500",titleHover:"group-hover:text-warning-600",itemBg:"bg-transparent hover:bg-warning-50/20",itemBorder:"border-transparent hover:border-warning-200"},info:{idle:"border-transparent bg-transparent hover:bg-info-50/30",active:"border-info-400 bg-info-50/40 ring-2 ring-info-400/20",iconColor:"text-info-500",titleHover:"group-hover:text-info-600",itemBg:"bg-transparent hover:bg-info-50/20",itemBorder:"border-transparent hover:border-info-200"}}},$f={pdf:["pdf"],word:["doc","docx","dot","dotx","odt","rtf"],excel:["xls","xlsx","xlsm","xlsb","csv","ods"],powerpoint:["ppt","pptx","pot","potx","pps","ppsx","odp"],archive:["zip","rar","7z","tar","gz","bz2","xz","iso"],text:["txt","md","markdown","log"],image:["jpg","jpeg","png","gif","webp","svg","bmp","ico","tiff","avif"],audio:["mp3","wav","ogg","aac","flac","m4a","wma"],video:["mp4","webm","mov","avi","mkv","wmv","flv"],code:["js","jsx","ts","tsx","html","css","scss","json","py","java","c","cpp","cs","go","rs","php","sql","sh","yaml","yml","xml"],other:[]},Lf={pdf:{label:"PDF",bg:"bg-error-50",text:"text-error-700",border:"border-error-200"},word:{label:"DOC",bg:"bg-primary-50",text:"text-primary-700",border:"border-primary-200"},excel:{label:"XLS",bg:"bg-success-50",text:"text-success-700",border:"border-success-200"},powerpoint:{label:"PPT",bg:"bg-secondary-50",text:"text-secondary-700",border:"border-secondary-200"},archive:{label:"ZIP",bg:"bg-warning-50",text:"text-warning-800",border:"border-warning-200"},text:{label:"TXT",bg:"bg-neutral-100",text:"text-neutral-700",border:"border-neutral-200"},image:{label:"IMG",bg:"bg-emerald-50",text:"text-emerald-700",border:"border-emerald-200"},audio:{label:"AUD",bg:"bg-purple-50",text:"text-purple-700",border:"border-purple-200"},video:{label:"VID",bg:"bg-cyan-50",text:"text-cyan-700",border:"border-cyan-200"},code:{label:"DEV",bg:"bg-slate-100",text:"text-slate-700",border:"border-slate-200"},other:{label:"FILE",bg:"bg-neutral-100",text:"text-neutral-600",border:"border-neutral-200"}};var zs=["jpg","jpeg","png","gif","webp","svg","bmp","ico","tiff","avif"],Is=["pdf"],Ms=["mp4","webm","ogg","mov","avi","mkv"],Fs=["mp3","wav","ogg","aac","flac","m4a"],Es=["doc","docx","xls","xlsx","ppt","pptx","txt","csv"];function Tt(e){if(!e)return"";if(typeof e=="object"&&!(e instanceof Blob))return e.name?e.name:e.src?Tt(e.src):"";if(e instanceof File)return e.name||"";if(typeof e=="string"){let t=e.split("?")[0]?.split("#")[0]||"",r=t.split("/").pop()||t.split("\\").pop()||"",n=r.lastIndexOf(".");return n<=0?r:r.slice(0,n)}return""}function Ra(e=""){let t=e.split("?")[0]?.split("#")[0]||"",r=t.lastIndexOf(".");return r===-1?"":t.slice(r+1).toLowerCase()}function Si(e=""){let t=Ra(e);return zs.includes(t)?"image":Is.includes(t)?"pdf":Ms.includes(t)?"video":Fs.includes(t)?"audio":Es.includes(t)?"document":"other"}function ld(e){return!e||typeof e!="object"||e instanceof Blob||"height"in e&&"width"in e&&typeof e.height=="number"?!1:"src"in e||"name"in e||"id"in e}function Nn(e){if(!e)return{name:"file",type:"other",file:void 0,serverFile:void 0};if(typeof e=="string"){let n=Tt(e)||"file";return{name:n,type:Si(e),file:void 0,serverFile:{src:e,name:n}}}if(e instanceof File)return{name:Tt(e.name),type:Si(e.name),file:e,serverFile:void 0};let t=e.name??Tt(e?.src),r="other";return e?.src?.startsWith("data:image/")?r="image":e?.src?.startsWith("data:video/")?r="video":e?.src?.startsWith("data:audio/")?r="audio":e?.src?.startsWith("data:application/pdf")?r="pdf":e?.name&&(r=Si(e.name)),r==="other"&&e?.src&&(r=Si(e.src)),{name:t,type:r,file:void 0,serverFile:e}}function dn(e,t){if(!e)return;let r=document.createElement("a");r.href=e;let n=e.split("?")[0]?.split("#")[0]||"",o=n.split("/").pop()||n.split("\\").pop()||"download";r.download=t||o,r.style.display="none",document.body.appendChild(r),r.click(),setTimeout(()=>{try{document.body.removeChild(r)}catch{}},100)}function cd(e){if(e){if(e instanceof File)return e.size;if(typeof e=="object"&&e!==null&&"size"in e){let t=e.size;if(typeof t=="number")return t}}}function ud(e){if(!e||typeof e!="object"||e instanceof File)return{status:"idle"};let t=e,r=typeof t.status=="string"?t.status:void 0,n=typeof t.progress=="number"?t.progress:void 0,o=typeof t.error=="string"?t.error:void 0,i="idle";return r==="uploading"||n!==void 0&&n>=0&&n<100?i="uploading":r==="error"||o?i="error":(r==="success"||r==="done"||n!==void 0&&n>=100)&&(i="success"),{status:i,progress:n,error:o}}function $s(e){if(!e)return"other";let t="",r="";typeof e=="string"?t=e:e instanceof File?(t=e.name,r=e.type):typeof e=="object"&&(t=e.name||(typeof e.src=="string"?e.src:""),typeof e.type=="string"&&(r=e.type));let n=Ra(t);if(n){for(let[o,i]of Object.entries($f))if(i.includes(n))return o}if(r){if(r==="application/pdf")return"pdf";if(r.startsWith("image/"))return"image";if(r.startsWith("audio/"))return"audio";if(r.startsWith("video/"))return"video";if(r.includes("word")||r.includes("document")||r==="application/msword")return"word";if(r.includes("excel")||r.includes("spreadsheet")||r==="text/csv")return"excel";if(r.includes("presentation")||r.includes("powerpoint"))return"powerpoint";if(r.includes("zip")||r.includes("compressed")||r.includes("archive")||r==="application/x-tar")return"archive";if(r.startsWith("text/"))return"text"}return"other"}function Bf(e,t){return typeof e=="object"&&e&&"id"in e&&e.id!=null?String(e.id):e instanceof File?`${e.name}-${e.size}-${e.lastModified}-${t}`:typeof e=="string"?`${e}-${t}`:`${Tt(e)}-${t}`}function Ls(e){if(!e)return;if(typeof e=="object")return e;let t={},r=e.split(",").map(o=>o.trim()).filter(Boolean),n={".pdf":"application/pdf",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".csv":"text/csv",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".zip":"application/zip",".rar":"application/vnd.rar",".7z":"application/x-7z-compressed",".tar":"application/x-tar",".gz":"application/gzip",".txt":"text/plain",".json":"application/json",".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".webp":"image/webp",".gif":"image/gif",".svg":"image/svg+xml",".mp3":"audio/mpeg",".wav":"audio/wav",".mp4":"video/mp4"};for(let o of r)if(o.startsWith(".")){let i=o.toLowerCase(),a=n[i]||"application/octet-stream";t[a]=[...t[a]||[],i]}else t[o]||(t[o]=[]);return t}var hc=require("react");var bc=require("react"),dd=(0,bc.createContext)(null),Bs=()=>(0,bc.useContext)(dd);var Hs=require("react"),Hf=Hn(require("react-easy-crop"),1);var Ht=require("react/jsx-runtime");function Da({zoom:e=1,minZoom:t=.2,maxZoom:r=5,step:n=.05,onZoomChange:o,sliderProps:i,onZoomIn:a,onZoomOut:s,onRotateCw:l,onRotateCcw:f,onFlipHorizontal:c,onReset:w,currentImage:p,tools:m,className:v=""}){let{zoomIn:x=!0,zoomOut:h=!0,zoomSlider:k=!0,reset:T=!0,rotate:y=!0,flip:d=!0,download:u=!0}=m??{},g=Math.round(e*100),b=()=>{p?.src&&dn(p.src,p.name)},S=D=>{if(typeof D=="number"){let P=Math.round(D*100)/100;o?.(P)}},R="p-2 rounded-full text-neutral-600 hover:text-neutral-900 hover:bg-neutral-100 active:scale-95 transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-500 cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed disabled:hover:bg-transparent";return(0,Ht.jsxs)("div",{"data-testid":"image-preview-toolbar",className:`inline-flex items-center gap-1 bg-neutral-white border border-neutral-200 rounded-full px-3 py-1.5 shadow-sm text-neutral-700 select-none pointer-events-auto ${v}`,children:[h&&(0,Ht.jsx)("button",{type:"button","aria-label":"Thu nh\u1ECF",title:"Thu nh\u1ECF (-)",disabled:e<=t,onClick:s,className:R,children:(0,Ht.jsx)(Qo,{width:18,height:18})}),k&&(0,Ht.jsx)("div",{className:"flex items-center px-1","data-testid":"image-preview-zoom-slider",children:(0,Ht.jsx)(Ji,{value:e,min:t,max:r,step:n,size:"sm",color:"primary",config:{isFullWidth:!1},className:"w-20 sm:w-28",disabled:!o&&!i?.onChange,onChange:S,"aria-label":"Thanh tr\u01B0\u1EE3t thu ph\xF3ng",...i})}),x&&(0,Ht.jsx)("button",{type:"button","aria-label":"Ph\xF3ng to",title:"Ph\xF3ng to (+)",disabled:e>=r,onClick:a,className:R,children:(0,Ht.jsx)(Jo,{width:18,height:18})}),T&&(0,Ht.jsxs)("button",{type:"button","aria-label":"\u0110\u1EB7t l\u1EA1i k\xEDch th\u01B0\u1EDBc v\xE0 g\xF3c xoay",title:"\u0110\u1EB7t l\u1EA1i (1:1)",onClick:w,className:"px-2 py-1 text-xs font-semibold text-neutral-700 hover:text-neutral-900 hover:bg-neutral-100 rounded-full transition-colors cursor-pointer",children:[g,"%"]}),(y||d||u)&&(0,Ht.jsx)("div",{className:"w-px h-4 bg-neutral-200 my-auto mx-1"}),y&&(0,Ht.jsx)("button",{type:"button","aria-label":"Xoay ng\u01B0\u1EE3c chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",title:"Xoay ng\u01B0\u1EE3c chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",onClick:f,className:R,children:(0,Ht.jsx)(ei,{width:18,height:18})}),y&&(0,Ht.jsx)("button",{type:"button","aria-label":"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",title:"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3 (r)",onClick:l,className:R,children:(0,Ht.jsx)(Kn,{width:18,height:18})}),d&&(0,Ht.jsx)("button",{type:"button","aria-label":"L\u1EADt ngang",title:"L\u1EADt ngang",onClick:c,className:R,children:(0,Ht.jsx)(ti,{width:18,height:18})}),u&&(0,Ht.jsx)("button",{type:"button","aria-label":"T\u1EA3i \u1EA3nh xu\u1ED1ng",title:"T\u1EA3i \u1EA3nh xu\u1ED1ng",onClick:b,className:R,children:(0,Ht.jsx)(Qr,{width:18,height:18})})]})}var Ti=require("react/jsx-runtime");function Na({src:e,name:t,minZoom:r=.2,maxZoom:n=5,showToolbar:o=!0,toolbarProps:i,children:a}){let[s,l]=(0,Hs.useState)({x:0,y:0}),[f,c]=(0,Hs.useState)(1),[w,p]=(0,Hs.useState)(0),[m,v]=(0,Hs.useState)(!1),x=()=>c(g=>Math.min(n,Math.round((g+.25)*100)/100)),h=()=>c(g=>Math.max(r,Math.round((g-.25)*100)/100)),k=()=>p(g=>(g+90)%360),T=()=>p(g=>(g-90+360)%360),y=()=>v(g=>!g),d=()=>{l({x:0,y:0}),c(1),p(0),v(!1)},u={src:e,name:t};return e?(0,Ti.jsxs)("div",{className:"flex flex-col w-full select-none overflow-hidden",children:[(0,Ti.jsx)("div",{className:"relative w-full h-90 sm:h-105 md:h-115 overflow-hidden bg-neutral-50/70 select-none",children:(0,Ti.jsx)(Hf.default,{image:e,crop:s,zoom:f,rotation:w,minZoom:r,maxZoom:n,zoomSpeed:.5,restrictPosition:!1,showGrid:!1,objectFit:"contain",onCropChange:l,onZoomChange:c,onRotationChange:p,classes:{mediaClassName:m?"scale-x-[-1]":""},style:{containerStyle:{position:"relative",width:"100%",height:"100%",backgroundColor:"transparent"},cropAreaStyle:{display:"none"},mediaStyle:{cursor:"grab"}}})}),o&&(0,Ti.jsx)("div",{className:"w-full flex items-center justify-center py-2.5 sm:py-3 border-t border-neutral-200 bg-neutral-white z-20 overflow-x-auto ui-scrollbar px-2 shrink-0",children:(0,Ti.jsx)(Da,{zoom:f,minZoom:r,maxZoom:n,onZoomChange:c,rotation:w,isFlipped:m,onZoomIn:x,onZoomOut:h,onRotateCw:k,onRotateCcw:T,onFlipHorizontal:y,onReset:d,currentImage:u,...i})}),a]}):null}var fn=require("react/jsx-runtime");function Pn({onDownload:e,imageProps:t,className:r=""}){let n=Bs(),o=n?.file,i=n?.headerTitle,[a,s]=(0,hc.useState)("");(0,hc.useEffect)(()=>{if(!o){s("");return}if(!(o instanceof File)){let p=Nn(o);s(p.serverFile?.src||"");return}let w=URL.createObjectURL(o);return s(w),()=>{URL.revokeObjectURL(w)}},[o]);let l=Nn(o),f=(typeof i=="string"?i:"")||l.name||"file",c=()=>{e&&o&&e(o),a&&dn(a,f)};return l.type==="image"?(0,fn.jsx)(Na,{src:a,name:f,...t}):(0,fn.jsxs)("div",{className:`p-6 text-center ${r}`,children:[(0,fn.jsx)("div",{className:"w-16 h-16 rounded-2xl bg-neutral-100 flex items-center justify-center mx-auto mb-4 text-primary-600",children:(0,fn.jsx)(Qr,{width:32,height:32})}),(0,fn.jsx)("h3",{className:"text-lg font-semibold text-neutral-900 truncate mb-1",title:f,children:i??f}),(0,fn.jsx)("p",{className:"text-sm text-neutral-500 mb-6",children:"\u0110\u1ECBnh d\u1EA1ng file ch\u01B0a h\u1ED7 tr\u1EE3 xem tr\u1EF1c ti\u1EBFp. B\u1EA1n c\xF3 th\u1EC3 t\u1EA3i file v\u1EC1 \u0111\u1EC3 xem."}),(0,fn.jsxs)("button",{type:"button",onClick:c,className:"inline-flex items-center justify-center gap-2 w-full py-2.5 px-4 bg-primary-600 hover:bg-primary-500 text-white font-medium rounded-xl transition-colors shadow-md cursor-pointer",children:[(0,fn.jsx)(Qr,{width:18,height:18}),(0,fn.jsx)("span",{children:"T\u1EA3i xu\u1ED1ng file"})]})]})}var jf=require("react");var Vf=250,Eo={xs:{dialog:"max-w-[320px] p-3 gap-1.5",header:"gap-1.5",body:"text-xs",footer:"gap-1.5 pt-1.5",title:"text-sm font-semibold leading-tight text-neutral-900",description:"text-xs leading-normal text-neutral-600",buttonGap:"gap-1.5",closeButton:"size-5 p-0.5 -mr-1 -mt-1",closeIcon:"size-3.5"},sm:{dialog:"max-w-[400px] p-3.5 gap-2",header:"gap-2",body:"text-sm",footer:"gap-2 pt-2",title:"text-base font-semibold leading-tight text-neutral-900",description:"text-sm leading-normal text-neutral-600",buttonGap:"gap-2",closeButton:"size-6 p-0.5 -mr-1 -mt-1",closeIcon:"size-4"},md:{dialog:"max-w-[540px] p-4 gap-2.5",header:"gap-2.5",body:"text-sm",footer:"gap-2 pt-2",title:"text-lg font-semibold leading-tight text-neutral-900",description:"text-sm leading-relaxed text-neutral-600",buttonGap:"gap-2.5",closeButton:"size-7 p-1 -mr-1 -mt-1",closeIcon:"size-4"},lg:{dialog:"max-w-[720px] p-4.5 gap-3",header:"gap-3",body:"text-base",footer:"gap-2.5 pt-2.5",title:"text-xl font-bold leading-snug text-neutral-900",description:"text-base leading-relaxed text-neutral-600",buttonGap:"gap-3",closeButton:"size-8 p-1 -mr-1 -mt-1",closeIcon:"size-4.5"},xl:{dialog:"max-w-[960px] p-5 gap-3.5",header:"gap-3.5",body:"text-base",footer:"gap-3 pt-3",title:"text-2xl font-bold leading-snug text-neutral-900",description:"text-base leading-relaxed text-neutral-600",buttonGap:"gap-3.5",closeButton:"size-8 p-1 -mr-1 -mt-1",closeIcon:"size-5"},full:{dialog:"max-w-[calc(100vw-2rem)] w-full h-[calc(100vh-2rem)] p-4 gap-2.5",header:"gap-2.5",body:"text-base",footer:"gap-2 pt-2",title:"text-2xl font-bold leading-snug text-neutral-900",description:"text-base leading-relaxed text-neutral-600",buttonGap:"gap-2.5",closeButton:"size-8 p-1 -mr-1 -mt-1",closeIcon:"size-4.5"}},Af={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"};var xc=require("react"),fd=(0,xc.createContext)(null),Fr=()=>(0,xc.useContext)(fd);var Of=require("react/jsx-runtime");function $o({size:e,radius:t,className:r="",children:n,ref:o,...i}){let a=Fr(),s=C(e??a?.size,Eo,"md"),l=C(t,Af,"lg"),f=["relative flex flex-col w-full bg-neutral-white shadow-2xl border-2 border-neutral-200 outline-none text-neutral-900 pointer-events-auto",s.dialog,l,r].filter(Boolean).join(" ");return(0,Of.jsx)("div",{ref:o,tabIndex:-1,className:f,...i,children:n})}var Wt=require("react");var Pa=require("react/jsx-runtime");function Lo({open:e=!1,id:t,size:r,isLoading:n=!1,closeOnOverlayClick:o=!0,closeOnEsc:i=!0,lockScroll:a=!0,overlayClassName:s="",className:l="",children:f,onClose:c,...w}){let p=(0,Wt.useRef)(null),[m,v]=(0,Wt.useState)(!1),x=(0,Wt.useRef)(null),h=(0,Wt.useCallback)(()=>{m||n||(v(!0),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{v(!1),c?.()},Vf))},[m,n,c]),k=(0,Wt.useMemo)(()=>({onClose:h,isLoading:n,size:r}),[h,n,r]);(0,Wt.useEffect)(()=>()=>{x.current&&clearTimeout(x.current)},[]),(0,Wt.useEffect)(()=>{let g=p.current;if(g)if(e||m){if(!g.open)try{g.showModal()}catch{}}else g.open&&g.close()},[e,m]),(0,Wt.useEffect)(()=>{if(!a)return;let g=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=g}},[a]);let T=(0,Wt.useEffectEvent)(g=>{!e||i===!1||g.key==="Escape"&&(g.preventDefault(),g.stopPropagation(),h())});if((0,Wt.useEffect)(()=>(window.addEventListener("keydown",T),()=>{window.removeEventListener("keydown",T)}),[]),!e&&!m)return null;let y=()=>{o&&h()},d=m?"animate-modal-backdrop-out pointer-events-none":"animate-modal-backdrop-in",u=m?"animate-modal-out pointer-events-none":"animate-modal-in";return(0,Pa.jsx)(fd.Provider,{value:k,children:(0,Pa.jsxs)("dialog",{id:t,ref:p,"aria-labelledby":"modal-dialog-title","aria-describedby":"modal-dialog-description",onCancel:g=>{g.preventDefault(),i!==!1&&h()},className:`fixed inset-0 flex items-center justify-center p-4 bg-neutral-950/40 backdrop-blur-xs border-none m-0 max-w-none max-h-none w-screen h-screen overflow-visible backdrop:bg-transparent ${d} ${s}`,...w,children:[(0,Pa.jsx)("div",{"aria-hidden":"true",onClick:y,className:"fixed inset-0 -z-10"}),(0,Pa.jsx)("div",{className:`w-full flex items-center justify-center pointer-events-none ${u} ${l}`,children:f})]})})}var Bo=require("react/jsx-runtime");function Ho({size:e,title:t,description:r,titleClassName:n="",descriptionClassName:o="",showCloseButton:i=!0,onClose:a,closeButtonClassName:s="",className:l="",children:f,...c}){let w=Fr(),p=C(e??w?.size,Eo,"md"),m=w?.isLoading,v=()=>{a?.(),w?.onClose?.()},x=!!(a||w?.onClose);return(0,Bo.jsxs)("div",{className:`flex items-start justify-between w-full border-b border-neutral-100 pb-2 ${p.header} ${l}`,...c,children:[(0,Bo.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[t&&(0,Bo.jsx)("h3",{id:"modal-dialog-title",className:`${p.title} truncate ${n}`,children:t}),r&&(0,Bo.jsx)("p",{id:"modal-dialog-description",className:`${p.description} mt-0.5 ${o}`,children:r}),f]}),i&&x&&(0,Bo.jsx)("button",{type:"button",onClick:v,disabled:m,"aria-label":"\u0110\xF3ng h\u1ED9p tho\u1EA1i","data-testid":"modal-close-button",className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-700 hover:bg-neutral-100 rounded-md transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-neutral-400 ${p.closeButton} ${s}`,children:(0,Bo.jsx)(Ve,{className:p.closeIcon})})]})}var Gf=require("react/jsx-runtime");function Vo({size:e,className:t="",children:r,...n}){let o=Fr(),i=C(e??o?.size,Eo,"md");return(0,Gf.jsx)("div",{className:`w-full max-h-[calc(100vh-8rem)] overflow-y-auto ui-scrollbar ${i.body} ${t}`,...n,children:r})}var Ao=require("react/jsx-runtime");function Kr({open:e=!1,onClose:t,file:r,title:n,description:o,size:i="lg",radius:a="xl",showCloseButton:s=!0,closeOnOverlayClick:l=!0,closeOnEsc:f=!0,lockScroll:c=!0,className:w="",overlayClassName:p="",children:m}){let v=Nn(r),x=n??v?.name,h=(0,jf.useMemo)(()=>({file:r,headerTitle:x}),[r,x]);return(0,Ao.jsx)(Lo,{open:e,onClose:t,size:i,closeOnOverlayClick:l,closeOnEsc:f,lockScroll:c,overlayClassName:p,children:(0,Ao.jsxs)($o,{size:i,radius:a,"data-testid":"image-preview-modal",className:`bg-neutral-white border border-neutral-200 text-neutral-900 shadow-2xl overflow-hidden p-0 ${w}`,children:[(x||s)&&(0,Ao.jsx)(Ho,{title:x,description:o,showCloseButton:s,className:"px-5 py-3.5 border-b border-neutral-200 shrink-0"}),(0,Ao.jsx)(Vo,{className:"p-0 overflow-hidden flex flex-col flex-1 min-h-0",children:(0,Ao.jsx)(dd.Provider,{value:h,children:m||(0,Ao.jsx)(Pn,{})})})]})})}var zn=require("react"),Kf=Hn(require("next/image"),1);var Uf={pulse:"animate-pulse",wave:"skeleton-wave",none:""},vc={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Yf={cover:"object-cover",contain:"object-contain",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"};var Ri=e=>e,Wf=e=>e?typeof e=="string"?e:typeof File<"u"&&e instanceof File?`${e.name}-${e.size}-${e.lastModified}`:typeof Blob<"u"&&e instanceof Blob?`${e.size}-${e.type}`:typeof e=="object"&&"src"in e&&typeof e.src=="string"?e.src:e:"";var yc=require("react/jsx-runtime");function Oo({ref:e,variant:t="pulse",shape:r="rectangle",radius:n="md",width:o,height:i="1rem",lines:a=1,gap:s="0.5rem",className:l="",style:f,...c}){let w=C(t,Uf,"pulse"),p=r==="circle"?"rounded-full":C(n,vc,"md"),m={width:Ri(o),height:Ri(i),...f},v=["bg-neutral-200",w,p].filter(Boolean).join(" ");return a>1?(0,yc.jsx)("div",{ref:e,role:"status","aria-label":"Loading...",className:["flex flex-col",l].filter(Boolean).join(" "),style:{gap:Ri(s),...f},...c,children:Array.from({length:a}).map((x,h)=>{let k=h===a-1;return(0,yc.jsx)("div",{className:v,style:{width:k?"60%":Ri(o)??"100%",height:Ri(i)}},h)})}):(0,yc.jsx)("div",{ref:e,role:"status","aria-label":"Loading...",className:[v,l].filter(Boolean).join(" "),style:m,...c})}var _r=require("react/jsx-runtime");function In({src:e,alt:t="",width:r,height:n,fill:o,skeletonVariant:i="pulse",radius:a="md",objectFit:s="cover",preview:l=!0,className:f="",wrapperClassName:c="",style:w,wrapperStyle:p,onLoad:m,onError:v,onClick:x,ref:h,...k}){let[T,y]=(0,zn.useState)(!1),[d,u]=(0,zn.useState)(!1),[g,b]=(0,zn.useState)(null),[S,R]=(0,zn.useState)(!1),D=Wf(e),[P,I]=(0,zn.useState)(D),E=typeof Blob<"u"&&(e instanceof File||e instanceof Blob),N=ld(e)?e:void 0,M=N?.src,z=E?g:N?M:e,H=E||!!N||typeof z=="string"&&(/^(?:https?:)?\/\//.test(z)||z.startsWith("data:")||z.startsWith("blob:")),V=t||N?.name||"";D!==P&&(I(D),y(!1),u(!1)),(0,zn.useEffect)(()=>{if(!(e instanceof File||e instanceof Blob)){b(null);return}let ne=URL.createObjectURL(e);return b(ne),()=>URL.revokeObjectURL(ne)},[e]);let Y=(0,zn.useMemo)(()=>{if(z)return e instanceof File?e:N?{...N,src:N.src,name:V||"image",type:"image"}:{src:typeof z=="string"?z:z?.src,name:V||"image",type:"image"}},[e,z,N,V]),$=C(a,vc,"md"),F=C(s,Yf,"cover"),G=ne=>{y(!0),m?.(ne)},A=ne=>{u(!0),y(!1),v?.(ne)},j=ne=>{x?.(ne),!ne.defaultPrevented&&l&&T&&!d&&Y&&R(!0)},B=!!(l&&T&&!d||x),X=ne=>{(ne.key==="Enter"||ne.key===" ")&&(ne.preventDefault(),j(ne))},le={...o?{}:{width:r,height:n},...p};return(0,_r.jsxs)(_r.Fragment,{children:[(0,_r.jsxs)("div",{ref:h,role:B?"button":void 0,tabIndex:B?0:void 0,onClick:j,onKeyDown:X,className:["relative overflow-hidden inline-block",$,B?"cursor-pointer":"",c].filter(Boolean).join(" "),style:le,children:[!T&&!d&&(0,_r.jsx)(Oo,{variant:i,radius:a,width:"100%",height:"100%",style:{position:"absolute",inset:0}}),z?(0,_r.jsx)(Kf.default,{src:z,alt:V,width:o?void 0:r,height:o?void 0:n,fill:o,unoptimized:H?!0:k.unoptimized,className:["block w-full h-full transition-opacity duration-200",F,$,T?"opacity-100":"opacity-0",f].filter(Boolean).join(" "),style:w,onLoad:G,onError:A,...k}):null,d&&(0,_r.jsx)("div",{role:"img","aria-label":"Image failed to load",className:["absolute inset-0 flex items-center justify-center","bg-neutral-100 text-neutral-400"].join(" "),children:(0,_r.jsx)(Qa,{width:24,height:24,"aria-hidden":"true"})})]}),S&&Y&&(0,_r.jsx)(Kr,{open:S,onClose:()=>R(!1),file:Y,title:V||"Xem \u1EA3nh",children:(0,_r.jsx)(Pn,{})})]})}var ft=require("react/jsx-runtime");function za({size:e="md",color:t="primary",variant:r="outline",radius:n,shape:o="rectangle",objectFit:i="contain",disabled:a,readOnly:s,isLoading:l,dragStatus:f="idle",isInvalid:c,dropzoneTitle:w,dropzoneDescription:p,icon:m,item:v,onRemove:x,onPreview:h,onTriggerUpload:k,getRootProps:T,className:y="",describedById:d}){let u=C(e,Ta,"md"),g=C(n,gc,"md"),b=o==="square"?"aspect-square w-full":C(e,zf,"md"),S=c?"error":t,R=r!=="other"?C(r,If,"outline"):null,D=R?C(S,R,"primary"):null,P="K\xE9o th\u1EA3 h\xECnh \u1EA3nh v\xE0o \u0111\xE2y, ho\u1EB7c nh\u1EA5n \u0111\u1EC3 duy\u1EC7t file",I="H\u1ED7 tr\u1EE3 \u0111\u1ECBnh d\u1EA1ng PNG, JPG, WEBP, GIF",E=f==="active",N=f==="reject",M=E,z=N?"border-error-500 bg-error-50/50 ring-2 ring-error-500/20 text-error-900":M?D?.active||"border-primary-500 bg-primary-50 ring-2 ring-primary-500/20":D?.idle||"border-neutral-300 bg-neutral-50/50 hover:border-primary-500 hover:bg-primary-50/30",H=v?`group relative w-full ${b} ${g} overflow-hidden border-2 transition-colors duration-150 ease-in-out cursor-pointer select-none ${M?"border-dashed "+z:"border-solid border-neutral-200 hover:border-primary-400"} ${a?"opacity-50 cursor-not-allowed pointer-events-none":""} focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${y}`:`group relative w-full ${o==="square"?"aspect-square w-full":u.dropzoneHeight} ${u.dropzonePadding} ${g} border-2 border-dashed flex flex-col items-center justify-center text-center transition-colors duration-150 ease-in-out cursor-pointer ${z} ${a?"opacity-50 cursor-not-allowed pointer-events-none bg-neutral-100":""} focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${y}`,V=Tt(v),Y={role:"button",tabIndex:a?-1:0,"aria-label":v?`H\xECnh \u1EA3nh \u0111\xE3 t\u1EA3i l\xEAn: ${V}. Nh\u1EA5n \u0111\u1EC3 xem tr\u01B0\u1EDBc, ho\u1EB7c d\xF9ng n\xFAt \u1EDF g\xF3c ph\u1EA3i \u0111\u1EC3 thay \u0111\u1ED5i ho\u1EB7c x\xF3a \u1EA3nh.`:"Khu v\u1EF1c k\xE9o th\u1EA3 v\xE0 t\u1EA3i \u1EA3nh l\xEAn","aria-disabled":a,"aria-invalid":c,"aria-describedby":d,"aria-busy":l,className:H,onClick:()=>{a||l||v&&h?.()},onKeyDown:F=>{a||l||(F.key==="Enter"||F.key===" ")&&v&&(F.preventDefault(),h?.())}},$=T?T(Y):Y;return(0,ft.jsx)("div",{...$,children:v?(0,ft.jsxs)(ft.Fragment,{children:[(0,ft.jsx)(In,{src:v,alt:V,fill:!0,radius:n??"md",objectFit:i,preview:!1,wrapperClassName:"w-full h-full"}),!l&&!a&&(0,ft.jsxs)("div",{className:"absolute top-2.5 right-2.5 flex items-center gap-1.5 z-10",children:[!s&&(0,ft.jsx)("button",{type:"button",onClick:F=>{F.stopPropagation(),k?.()},"aria-label":"Thay \u0111\u1ED5i \u1EA3nh",title:"Thay \u0111\u1ED5i \u1EA3nh",className:"p-1.5 rounded-lg bg-neutral-900/60 hover:bg-neutral-900/80 text-neutral-white backdrop-blur-xs transition-colors shadow-xs cursor-pointer focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden","data-testid":"dropzone-replace-button",children:(0,ft.jsx)(cr,{width:16,height:16})}),!s&&(0,ft.jsx)("button",{type:"button",onClick:F=>{F.stopPropagation(),x?.()},"aria-label":"X\xF3a \u1EA3nh",title:"X\xF3a \u1EA3nh",className:"p-1.5 rounded-lg bg-neutral-900/60 hover:bg-error-600 text-neutral-white backdrop-blur-xs transition-colors shadow-xs cursor-pointer focus-visible:ring-2 focus-visible:ring-error-500 focus-visible:outline-hidden","data-testid":"dropzone-remove-button",children:(0,ft.jsx)(Br,{width:16,height:16})})]}),l&&(0,ft.jsxs)("div",{className:"absolute inset-0 bg-neutral-950/60 flex flex-col items-center justify-center text-neutral-white z-20",children:[(0,ft.jsx)(De,{width:u.iconSize*.8,height:u.iconSize*.8,className:"animate-spin"}),(0,ft.jsx)("span",{className:`${u.titleSize} font-medium mt-1`,children:"\u0110ang x\u1EED l\xFD h\xECnh \u1EA3nh..."})]}),M&&(0,ft.jsxs)("div",{className:"absolute inset-0 bg-primary-950/50 backdrop-blur-xs flex flex-col items-center justify-center text-neutral-white z-20 transition-opacity",children:[(0,ft.jsx)(Zt,{width:u.iconSize,height:u.iconSize,className:"animate-bounce"}),(0,ft.jsx)("span",{className:`${u.titleSize} font-medium mt-1`,children:"Th\u1EA3 h\xECnh \u1EA3nh \u0111\u1EC3 thay th\u1EBF"})]})]}):l?(0,ft.jsxs)("div",{className:`flex flex-col items-center justify-center gap-2 ${D?.iconColor||"text-primary-600"}`,children:[(0,ft.jsx)(De,{width:u.iconSize*.8,height:u.iconSize*.8}),(0,ft.jsx)("span",{className:`${u.titleSize} font-medium`,children:"\u0110ang x\u1EED l\xFD h\xECnh \u1EA3nh..."})]}):(0,ft.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2",children:[(0,ft.jsx)("div",{className:`transition-colors ${D?.iconColor||"text-primary-500"}`,children:m||(0,ft.jsx)(Zt,{width:u.iconSize,height:u.iconSize})}),(0,ft.jsx)("div",{className:`${u.titleSize} font-medium text-neutral-800 ${D?.titleHover||"group-hover:text-primary-600"} transition-colors`,children:w??P}),(0,ft.jsx)("div",{id:d,className:`${u.descSize} text-neutral-500`,children:p??I})]})})}var mr=require("react/jsx-runtime");function Go({items:e,size:t,radius:r,objectFit:n="cover",disabled:o,readOnly:i,maxCount:a,onRemove:s,onPreview:l,onTriggerUpload:f,renderItem:c,showAddButton:w=!0,className:p=""}){let m=C(t,Ta,"md"),v=C(r,gc,"md"),x=!a||e.length<a;return(0,mr.jsxs)("ul",{"aria-label":"Danh s\xE1ch h\xECnh \u1EA3nh \u0111\xE3 t\u1EA3i l\xEAn",className:`flex flex-wrap items-center list-none p-0 m-0 ${m.gap} ${p}`,children:[e.map((h,k)=>{let T=Tt(h),y=typeof h=="object"&&h&&"id"in h&&h.id?String(h.id):h instanceof File?`${h.name}-${h.size}-${h.lastModified}`:typeof h=="string"?h:h?.src||T;return c?(0,mr.jsx)("li",{"data-testid":"upload-image-item",className:"list-none",children:c(h,k,{remove:()=>s(h,k),preview:()=>l(h)})},y):(0,mr.jsxs)("li",{"data-testid":"upload-image-item",tabIndex:o?-1:0,"aria-label":`H\xECnh \u1EA3nh ${T}`,onKeyDown:d=>{o||i||(d.key==="Delete"||d.key==="Backspace")&&(d.preventDefault(),s(h,k))},className:`group relative list-none ${m.thumbnailSize} ${v} border-2 overflow-hidden flex items-center justify-center bg-neutral-100 border-neutral-200 transition-colors duration-150 ease-in-out focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden`,children:[(0,mr.jsx)(In,{src:h,alt:T,width:80,height:80,radius:r,objectFit:n,unoptimized:!0,preview:!1,className:"w-full h-full",wrapperClassName:"w-full h-full"}),!o&&(0,mr.jsxs)("div",{className:"absolute inset-0 bg-neutral-900/40 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity duration-150 flex items-center justify-center gap-1.5 p-1",children:[l&&(0,mr.jsx)("button",{type:"button",onClick:d=>{d.stopPropagation(),l(h)},"aria-label":`Preview image ${T}`,title:"Xem tr\u01B0\u1EDBc",className:"p-1 rounded-md text-neutral-white hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-primary-400 focus-visible:outline-hidden transition-colors cursor-pointer",children:(0,mr.jsx)(Vn,{width:16,height:16})}),!i&&(0,mr.jsx)("button",{type:"button",onClick:d=>{d.stopPropagation(),s(h,k)},"aria-label":`Remove image ${T}`,title:"X\xF3a \u1EA3nh",className:"p-1 rounded-md text-error-300 hover:text-error-200 hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-error-400 focus-visible:outline-hidden transition-colors cursor-pointer",children:(0,mr.jsx)(Br,{width:16,height:16})})]})]},y)}),w&&x&&!i&&(0,mr.jsx)("li",{className:"list-none",children:(0,mr.jsx)("button",{type:"button",disabled:o,onClick:f,"aria-label":"Add image",title:"Th\xEAm h\xECnh \u1EA3nh",className:`${m.thumbnailSize} ${v} border-2 border-dashed border-neutral-300 hover:border-primary-500 hover:bg-primary-50/40 text-neutral-400 hover:text-primary-600 flex flex-col items-center justify-center transition-colors duration-150 ease-in-out cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden`,children:(0,mr.jsx)(Zr,{width:m.iconSize*.5,height:m.iconSize*.5})})})]})}var Rt=require("react/jsx-runtime");function wc({value:e,defaultValue:t,onChange:r,onRemove:n,onPreview:o,multiple:i=!1,maxCount:a,maxSize:s,accept:l="image/*",beforeUpload:f,viewMode:c="dropzone",shape:w="rectangle",objectFit:p,size:m="md",color:v="primary",variant:x="outline",radius:h,label:k,isRequired:T=!1,labelClassName:y="",helperText:d,errorMessage:u,isInvalid:g,disabled:b=!1,readOnly:S=!1,isLoading:R=!1,dropzoneTitle:D,dropzoneDescription:P,icon:I,buttonText:E="T\u1EA3i \u1EA3nh l\xEAn",renderItem:N,className:M="",dropzoneClassName:z="",previewClassName:H="",helperClassName:V=""}){let Y=(0,Mn.useId)(),$=`${Y}-input`,F=`${Y}-error-helper`,G=e!==void 0,[A,j]=(0,Mn.useState)(()=>ki(t)),B=(0,Mn.useMemo)(()=>G?ki(e):A,[G,e,A]),[X,le]=(0,Mn.useState)(null),[ne,ue]=(0,Mn.useState)(null),[ie,Q]=(0,Mn.useState)(""),q=C(m,Ta,"md"),ge=h??"md",ke=!!(g||u||X),L=u||X,Z=ke?"text-error-600":C(ke?"error":v,Pf,"primary"),he=a??(i?void 0:1),ae=!i||he===1,ve=ae&&B.length===1?B[0]:null,Se=xe=>{G||j(xe),r?.(xe)},ye=(0,Mn.useMemo)(()=>Ls(l),[l]),J=c==="dropzone"&&!!ve,{getRootProps:O,getInputProps:W,isDragActive:we,isDragReject:fe,open:se}=(0,_f.useDropzone)({multiple:i,maxSize:s,accept:ye,disabled:b||S||R,noClick:c!=="dropzone"||J,noKeyboard:c!=="dropzone"||J,onDropAccepted:async xe=>{if(b||S||(le(null),xe.length===0))return;let re=xe,de=B.length;if(he!==void 0)if(i){let U=he-de;if(U<=0){let Ce=`Maximum allowed image count reached (${he} images)`;le(Ce),Q(Ce);return}re=xe.slice(0,U)}else{let U=xe[0];if(!U)return;re=[U]}let ce=await Promise.all(re.map(async U=>{if(f)try{let Ce=await f(U);if(Ce===!1||typeof Ce=="string")return{file:null,error:typeof Ce=="string"?Ce:`File ${U.name} was rejected`}}catch(Ce){return{file:null,error:Ce instanceof Error?Ce.message:`Kh\xF4ng th\u1EC3 x\u1EED l\xFD t\u1EC7p ${U.name}`}}return{file:U,error:null}})),ee=[];for(let U of ce)U.error?(le(U.error),Q(`L\u1ED7i: ${U.error}`)):U.file&&ee.push(U.file);if(ee.length>0){let U=i?[...B,...ee]:ee;Se(U),Q(`T\u1EA3i l\xEAn th\xE0nh c\xF4ng ${ee.length} h\xECnh \u1EA3nh. T\u1ED5ng c\u1ED9ng: ${U.length}.`)}},onDropRejected:xe=>{let re=xe[0]?.errors[0];if(!re)return;let de=re.message||"T\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7";re.code==="file-too-large"?de=`K\xEDch th\u01B0\u1EDBc t\u1EC7p v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n t\u1ED1i \u0111a (${un(s||0)})`:re.code==="file-invalid-type"?de=`\u0110\u1ECBnh d\u1EA1ng t\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7. C\xE1c \u0111\u1ECBnh d\u1EA1ng \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3: ${typeof l=="string"?l:Object.keys(l||{}).join(", ")}`:re.code==="too-many-files"&&(de=`S\u1ED1 l\u01B0\u1EE3ng h\xECnh \u1EA3nh v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n cho ph\xE9p (${he} h\xECnh \u1EA3nh)`),le(de),Q(`L\u1ED7i t\u1EC7p: ${de}`)}}),me=(xe,re)=>{if(b||S)return;let de=B.filter((ce,ee)=>ee!==re);Se(de),n?.(xe,re),Q(`\u0110\xE3 x\xF3a h\xECnh \u1EA3nh ${Tt(xe)}`)},Re=xe=>{ue(xe),o?.(xe)};return(0,Rt.jsxs)("div",{className:`group/field relative flex flex-col w-full ${M}`,children:[(0,Rt.jsx)("input",{...W({id:$,disabled:b||R,"aria-hidden":!0,tabIndex:-1,className:"hidden"})}),(0,Rt.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:ie}),k&&(0,Rt.jsxs)("label",{htmlFor:$,className:`block font-medium transition-colors duration-150 ${q.labelSize} ${Z} ${y}`,children:[k,T&&(0,Rt.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),(0,Rt.jsxs)("div",{className:"flex flex-col gap-3",children:[c==="dropzone"&&(0,Rt.jsxs)(Rt.Fragment,{children:[(0,Rt.jsx)(za,{size:m,color:v,variant:x,radius:ge,shape:w,objectFit:p,disabled:b,readOnly:S,isLoading:R,dragStatus:fe?"reject":we?"active":"idle",isInvalid:ke,dropzoneTitle:D,dropzoneDescription:P,icon:I,item:ve,onRemove:()=>ve&&me(ve,0),onPreview:()=>ve&&Re(ve),getRootProps:O,onTriggerUpload:se,className:z,describedById:L||d?F:void 0}),!ae&&B.length>0&&(0,Rt.jsx)(Go,{items:B,size:m,color:v,variant:x,radius:ge,objectFit:p,disabled:b,readOnly:S,maxCount:he,onRemove:me,onPreview:Re,onTriggerUpload:se,renderItem:N,showAddButton:!1,className:H})]}),c==="card-grid"&&(0,Rt.jsx)("div",{...O({className:"w-full focus-visible:outline-hidden"}),children:(0,Rt.jsx)(Go,{items:B,size:m,color:v,variant:x,radius:ge,objectFit:p,disabled:b,readOnly:S,maxCount:he,onRemove:me,onPreview:Re,onTriggerUpload:se,renderItem:N,showAddButton:!0,className:H})}),c==="button"&&(0,Rt.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,Rt.jsx)("div",{className:"flex items-center gap-3",children:(0,Rt.jsx)(xr,{type:"button",size:m,color:ke?"error":v==="neutral"?"secondary":v,variant:x==="other"?"filled":x,radius:h,disabled:b||S||he!==void 0&&B.length>=he,onClick:se,leftIcon:(0,Rt.jsx)(Zt,{width:q.iconSize*.5,height:q.iconSize*.5}),"aria-label":"T\u1EA3i \u1EA3nh l\xEAn",children:E})}),B.length>0&&(0,Rt.jsx)(Go,{items:B,size:m,color:v,variant:x,radius:ge,objectFit:p,disabled:b,readOnly:S,maxCount:he,onRemove:me,onPreview:Re,onTriggerUpload:se,renderItem:N,showAddButton:!1,className:H})]})]}),(0,Rt.jsx)(Le,{id:F,helperText:d,errorMessage:ke?L:void 0,sizeClassName:q.helperSize,className:V}),ne&&(0,Rt.jsx)(Kr,{open:!!ne,onClose:()=>ue(null),file:ne})]})}var Fn=require("react"),ap=require("react-dropzone"),sp=require("@floating-ui/react");var Xf={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},qf={xs:{avatarSize:"size-12",iconSize:20,iconClass:"size-5",label:"text-[11px] mb-1",helper:"text-[9px] mt-0.5",rounded:"rounded"},sm:{avatarSize:"size-16",iconSize:24,iconClass:"size-6",label:"text-xs mb-1",helper:"text-[10px] mt-0.5",rounded:"rounded-md"},md:{avatarSize:"size-20",iconSize:32,iconClass:"size-8",label:"text-sm mb-1.5",helper:"text-[11px] mt-1",rounded:"rounded-lg"},lg:{avatarSize:"size-24",iconSize:40,iconClass:"size-10",label:"text-base mb-1.5",helper:"text-xs mt-1",rounded:"rounded-xl"},xl:{avatarSize:"size-32",iconSize:52,iconClass:"size-12",label:"text-lg mb-2",helper:"text-sm mt-1",rounded:"rounded-2xl"}},Zf={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"}},Jf={primary:"text-primary-500 group-hover/avatar:text-primary-600",secondary:"text-secondary-500 group-hover/avatar:text-secondary-600",neutral:"text-neutral-400 group-hover/avatar:text-neutral-600",error:"text-error-500 group-hover/avatar:text-error-600",success:"text-success-500 group-hover/avatar:text-success-600",warning:"text-warning-500 group-hover/avatar:text-warning-600",info:"text-info-500 group-hover/avatar:text-info-600"},Qf={primary:"text-primary-500 group-focus-within/field:text-primary-600",secondary:"text-secondary-500 group-focus-within/field:text-secondary-600",error:"text-error-500 group-focus-within/field:text-error-600",success:"text-success-500 group-focus-within/field:text-success-600",warning:"text-warning-500 group-focus-within/field:text-warning-600",info:"text-info-500 group-focus-within/field:text-info-600",neutral:"text-neutral-500 group-focus-within/field:text-neutral-600"},ep={primary:"ring-2 ring-primary-500/40 border-primary-500 bg-primary-50/80",secondary:"ring-2 ring-secondary-500/40 border-secondary-500 bg-secondary-50/80",neutral:"ring-2 ring-neutral-500/40 border-neutral-500 bg-neutral-50/80",error:"ring-2 ring-error-500/40 border-error-500 bg-error-50/80",success:"ring-2 ring-success-500/40 border-success-500 bg-success-50/80",warning:"ring-2 ring-warning-500/40 border-warning-500 bg-warning-50/80",info:"ring-2 ring-info-500/40 border-info-500 bg-info-50/80"};function tp(e){if(!e)return;if(typeof e=="object")return e;let t={},r=e.split(",").map(n=>n.trim()).filter(Boolean);for(let n of r)if(n.startsWith(".")){let o=n.toLowerCase();o===".jpg"||o===".jpeg"?t["image/jpeg"]=[...t["image/jpeg"]||[],o]:o===".png"?t["image/png"]=[...t["image/png"]||[],o]:o===".webp"?t["image/webp"]=[...t["image/webp"]||[],o]:o===".gif"?t["image/gif"]=[...t["image/gif"]||[],o]:o===".svg"?t["image/svg+xml"]=[...t["image/svg+xml"]||[],o]:t["application/octet-stream"]=[...t["application/octet-stream"]||[],o]}else t[n]||(t[n]=[]);return t}var tr=require("react"),ip=Hn(require("react-easy-crop"),1);function rp(e){return new Promise((t,r)=>{let n=new Image;n.addEventListener("load",()=>t(n)),n.addEventListener("error",o=>r(o)),n.setAttribute("crossOrigin","anonymous"),n.src=e})}function np(e){return e*Math.PI/180}function op(e,t,r){let n=np(r);return{width:Math.abs(Math.cos(n)*e)+Math.abs(Math.sin(n)*t),height:Math.abs(Math.sin(n)*e)+Math.abs(Math.cos(n)*t)}}async function pd(e,t,r=0,n=!1,o="avatar-cropped.png",i="image/png"){let a=await rp(e),s=document.createElement("canvas"),l=s.getContext("2d");if(!l)throw new Error("No 2d context available on canvas");let f=np(r),c=a.naturalWidth||a.width,w=a.naturalHeight||a.height,{width:p,height:m}=op(c,w,r);s.width=p,s.height=m,l.translate(p/2,m/2),l.rotate(f),l.scale(n?-1:1,1),l.translate(-c/2,-w/2),l.drawImage(a,0,0);let v=document.createElement("canvas"),x=v.getContext("2d");if(!x)throw new Error("No 2d context for cropped canvas");return v.width=t.width,v.height=t.height,x.drawImage(s,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise((h,k)=>{v.toBlob(T=>{if(!T){k(new Error("Canvas is empty or failed to generate blob"));return}let y=new File([T],o,{type:i||"image/png"});h(y)},i||"image/png",.95)})}var Ye=require("react/jsx-runtime");function Cc({imageSrc:e="",file:t,fileName:r="avatar-cropped.png",fileType:n="image/png",aspectRatio:o=1,cropShape:i="round",showGrid:a=!0,minZoom:s=1,maxZoom:l=4,onApply:f,onCancel:c}){let w=(0,tr.useRef)(null),[p,m]=(0,tr.useState)(t??null),[v,x]=(0,tr.useState)(e),h=(0,tr.useRef)(t?.name||r),k=(0,tr.useRef)(t?.type||n),[T,y]=(0,tr.useState)({x:0,y:0}),[d,u]=(0,tr.useState)(1),[g,b]=(0,tr.useState)(0),[S,R]=(0,tr.useState)(!1),D=(0,tr.useRef)(null),[P,I]=(0,tr.useState)(!1);(0,tr.useEffect)(()=>{if(!p)return;let B=URL.createObjectURL(p);return x(B),()=>{URL.revokeObjectURL(B)}},[p]);let E=()=>u(B=>Math.min(l,Math.round((B+.2)*10)/10)),N=()=>u(B=>Math.max(s,Math.round((B-.2)*10)/10)),M=()=>b(B=>(B+90)%360),z=()=>b(B=>(B-90+360)%360),H=()=>R(B=>!B),V=()=>{y({x:0,y:0}),u(1),b(0),R(!1)},Y=()=>{w.current&&(w.current.value="",w.current.click())},$=B=>{if(B.target.files&&B.target.files[0]){let X=B.target.files[0];h.current=X.name,k.current=X.type||"image/png",m(X),V()}},F=(B,X)=>{D.current=X},G=async()=>{if(D.current)try{I(!0);let B=await pd(v,D.current,g,S,h.current,k.current);f(B)}catch(B){console.error("Error cropping avatar:",B)}finally{I(!1)}},A=()=>{c?.()},j="p-1.5 rounded-full text-neutral-600 hover:text-neutral-900 hover:bg-neutral-200/70 transition-colors focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed shrink-0";return(0,Ye.jsxs)("div",{className:"flex flex-col w-full select-none","data-testid":"upload-avatar-crop-modal",children:[(0,Ye.jsx)("input",{ref:w,type:"file",accept:"image/*","aria-hidden":"true",tabIndex:-1,className:"hidden",onChange:$}),(0,Ye.jsx)("div",{className:"relative w-full h-80 md:h-95 bg-neutral-950 overflow-hidden select-none",children:(0,Ye.jsx)(ip.default,{image:v,crop:T,zoom:d,rotation:g,aspect:o,cropShape:i,showGrid:a,minZoom:s,maxZoom:l,onCropChange:y,onZoomChange:u,onRotationChange:b,onCropComplete:F,classes:{mediaClassName:S?"scale-x-[-1]":""},style:{containerStyle:{position:"relative",width:"100%",height:"100%"}}})}),(0,Ye.jsx)("div",{className:"w-full flex items-center justify-center py-2.5 px-3 bg-neutral-white border-t border-neutral-200 overflow-x-auto ui-scrollbar",children:(0,Ye.jsxs)("div",{className:"inline-flex items-center flex-nowrap shrink-0 gap-1 bg-neutral-50 border border-neutral-200 rounded-full px-2.5 py-1 shadow-xs text-neutral-700",children:[(0,Ye.jsx)("button",{type:"button",onClick:Y,"aria-label":"Ch\u1ECDn \u1EA3nh kh\xE1c",title:"Ch\u1ECDn \u1EA3nh kh\xE1c",className:`${j} text-neutral-700 hover:text-primary-600`,"data-testid":"avatar-crop-change-image-button",children:(0,Ye.jsx)(Zt,{width:16,height:16})}),(0,Ye.jsx)("div",{className:"w-px h-3.5 bg-neutral-300 my-auto mx-0.5 shrink-0"}),(0,Ye.jsx)("button",{type:"button",onClick:N,disabled:d<=s,"aria-label":"Thu nh\u1ECF",title:"Thu nh\u1ECF (-)",className:j,children:(0,Ye.jsx)(Qo,{width:16,height:16})}),(0,Ye.jsx)("button",{type:"button",onClick:E,disabled:d>=l,"aria-label":"Ph\xF3ng to",title:"Ph\xF3ng to (+)",className:j,children:(0,Ye.jsx)(Jo,{width:16,height:16})}),(0,Ye.jsx)("button",{type:"button",onClick:z,title:"Xoay ng\u01B0\u1EE3c chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3","aria-label":"Xoay ng\u01B0\u1EE3c chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",className:j,children:(0,Ye.jsx)(ei,{width:16,height:16})}),(0,Ye.jsx)("button",{type:"button",onClick:M,title:"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3","aria-label":"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",className:j,children:(0,Ye.jsx)(Kn,{width:16,height:16})}),(0,Ye.jsx)("button",{type:"button",onClick:H,title:"L\u1EADt ngang","aria-label":"L\u1EADt ngang",className:j,children:(0,Ye.jsx)(ti,{width:16,height:16})}),(0,Ye.jsx)("button",{type:"button",onClick:V,title:"\u0110\u1EB7t l\u1EA1i","aria-label":"\u0110\u1EB7t l\u1EA1i",className:j,children:(0,Ye.jsx)(cr,{width:16,height:16})}),(0,Ye.jsx)("div",{className:"w-px h-3.5 bg-neutral-300 my-auto mx-0.5 shrink-0"}),(0,Ye.jsx)("button",{type:"button",onClick:A,"aria-label":"H\u1EE7y c\u1EAFt \u1EA3nh",title:"H\u1EE7y (Esc)",className:`${j} text-neutral-500 hover:text-error-600`,"data-testid":"avatar-crop-cancel-button",children:(0,Ye.jsx)(Ve,{width:16,height:16})}),(0,Ye.jsx)("button",{type:"button",onClick:G,disabled:P,"aria-label":"\xC1p d\u1EE5ng v\xE0 l\u01B0u \u1EA3nh \u0111\xE3 c\u1EAFt",title:"\xC1p d\u1EE5ng",className:"p-1.5 rounded-full bg-primary-600 hover:bg-primary-500 text-white shadow-xs transition-colors active:scale-95 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden shrink-0","data-testid":"avatar-crop-apply-button",children:P?(0,Ye.jsx)(De,{width:16,height:16}):(0,Ye.jsx)(Gn,{width:16,height:16})})]})})]})}function Vs({open:e=!0,modalTitle:t="C\u1EAFt \u1EA3nh \u0111\u1EA1i di\u1EC7n",onClose:r,onCancel:n,onApply:o,...i}){let a=()=>{n?.(),r?.()};return(0,Ye.jsx)(Lo,{open:e,closeOnOverlayClick:!0,closeOnEsc:!0,onClose:a,children:(0,Ye.jsxs)($o,{size:"lg",radius:"xl",className:"bg-neutral-white border border-neutral-200 shadow-2xl overflow-hidden p-0",children:[(0,Ye.jsx)(Ho,{title:(0,Ye.jsx)("span",{className:"font-semibold text-neutral-900","data-testid":"avatar-crop-modal-title",children:t}),className:"px-5 py-3.5 border-b border-neutral-200",showCloseButton:!0}),(0,Ye.jsx)(Vo,{className:"p-0 overflow-hidden",children:(0,Ye.jsx)(Cc,{...i,onApply:l=>{o(l),r?.()},onCancel:a})})]})})}var bt=require("react/jsx-runtime");function kc({size:e="md",variant:t="outline",color:r="primary",shape:n="circle",radius:o,value:i,defaultValue:a,onChange:s,onRemove:l,onPreview:f,onClear:c,maxSize:w,accept:p="image/*",crop:m=!0,label:v,labelPlacement:x="top",config:h,helperText:k,errorMessage:T,disabled:y=!1,readOnly:d=!1,icon:u,name:g,id:b,className:S="",wrapperClassName:R="",avatarClassName:D="",avatarWrapperClassName:P="",labelClassName:I="",helperClassName:E="",ref:N}){let{isRequired:M=!1,isInvalid:z=!1,isLoading:H=!1,showSpinner:V=!1,isClearable:Y=!1,isFullWidth:$=!1}=h??{},F=(0,Fn.useId)(),G=b||F,A=`${G}-error-helper`,j=i!==void 0,[B,X]=(0,Fn.useState)(a??null),le=j?i??null:B,ne=Nn(le),ue=ne.name,[ie,Q]=(0,Fn.useState)(null),[q,ge]=(0,Fn.useState)(!1),[ke,L]=(0,Fn.useState)(null),[te,Z]=(0,Fn.useState)(""),he=T||ke,ae=!!(z||he),ve=ae?"error":r,Se=C(e,qf,"md"),ye=n==="circle"?"rounded-full":C(o,Xf,"md"),J=t==="other"?"":C(ve,C(t,Zf,"outline"),"primary"),O=C(ve,Jf,"primary"),W=ae?"text-error-600 font-bold":C(ve,Qf,"primary"),we=C(ve,ep,"primary"),fe=K=>{j||X(K),s?.(K)},se=m!==!1,me=typeof m=="object"?m:{},Re=K=>{Q({file:K.file,imageSrc:K.imageSrc,fileName:ue||"avatar.png",fileType:ne.type||"image/png"})},xe=K=>{if(K?.stopPropagation(),!(y||d||H)&&le){let _=le;fe(null),l?.(_),c?.(),Z("\u0110\xE3 x\xF3a \u1EA3nh \u0111\u1EA1i di\u1EC7n.")}},re=K=>{K?.stopPropagation(),le&&(ge(!0),f?.(le))},de=K=>{K?.stopPropagation(),le&&(ne.file?Re({file:ne.file}):ne.serverFile?.src&&Re({imageSrc:ne.serverFile.src}))},{getRootProps:ce,getInputProps:ee,isDragActive:U,isDragReject:Ce,inputRef:$e}=(0,ap.useDropzone)({multiple:!1,maxSize:w,accept:(0,Fn.useMemo)(()=>tp(p),[p]),disabled:y||d||H,onDropAccepted:([K])=>{K&&(L(null),se?Re({file:K}):(fe(K),Z("T\u1EA3i \u1EA3nh \u0111\u1EA1i di\u1EC7n th\xE0nh c\xF4ng.")))},onDropRejected:K=>{let _=K[0]?.errors[0],ze=_?.code==="file-too-large"?`Dung l\u01B0\u1EE3ng t\u1EC7p v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n${w?` ${(w/(1024*1024)).toFixed(1)}MB`:""}.`:_?.code==="file-invalid-type"?"\u0110\u1ECBnh d\u1EA1ng t\u1EC7p kh\xF4ng \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3.":_?.message||"T\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7.";L(ze),Z(`L\u1ED7i t\u1EC7p: ${ze}`)}}),Ee=(0,sp.useMergeRefs)([$e,N]),oe=K=>{y||d||H||le&&(K.key==="Delete"||K.key==="Backspace")&&(K.preventDefault(),K.stopPropagation(),xe())},Te=()=>v?(0,bt.jsxs)("label",{htmlFor:G,className:`inline-flex items-center font-bold transition-colors duration-150 ${Se.label} ${W} ${I}`,children:[v,M&&(0,bt.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):null,Pe="group/avatar relative flex items-center justify-center transition-colors duration-150 ease-in-out border-2 overflow-hidden select-none",Qe=y?"opacity-50":"cursor-pointer",We=Ce?"ring-2 ring-error-500/40 border-error-500 bg-error-50/80":U?we:"",Be=[Pe,Se.avatarSize,ye,J,Qe,We,D||P].filter(Boolean).join(" ");return(0,bt.jsxs)("div",{className:`group/field flex ${x==="left"?"flex-row items-center gap-3":"flex-col"} ${$?"w-full":"inline-flex"} ${R||S}`,children:[(0,bt.jsx)("input",{...ee({id:G,name:g,disabled:y||H,"aria-hidden":!0,tabIndex:-1,className:"hidden"}),ref:Ee}),(0,bt.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:te}),Te(),(0,bt.jsxs)("div",{className:`flex flex-col ${$?"w-full":""}`,children:[(0,bt.jsxs)("div",{...ce({role:"button",tabIndex:y||H?-1:0,"aria-label":"T\u1EA3i l\xEAn \u1EA3nh \u0111\u1EA1i di\u1EC7n","aria-disabled":y||H,"aria-invalid":ae,"aria-required":M,"aria-describedby":T||k||ke?A:void 0,"aria-busy":H,onKeyDown:oe,className:Be}),children:[le?(0,bt.jsx)(In,{src:le,alt:ue||"Avatar",fill:!0,radius:n==="circle"?"full":o,preview:!1,className:"object-cover",wrapperClassName:"w-full h-full"}):(0,bt.jsx)("div",{className:`flex flex-col items-center justify-center transition-colors ${O} ${Se.iconClass}`,children:u||(0,bt.jsx)(rs,{width:Se.iconSize,height:Se.iconSize})}),H&&V&&(0,bt.jsx)("div",{className:"absolute inset-0 bg-neutral-950/60 flex items-center justify-center text-neutral-white z-20",role:"status","aria-label":"\u0110ang t\u1EA3i",children:(0,bt.jsx)(De,{width:Se.iconSize,height:Se.iconSize,className:"animate-spin"})}),!H&&!y&&le&&(0,bt.jsxs)("div",{className:"absolute inset-0 bg-neutral-950/20 opacity-0 group-hover/avatar:opacity-100 group-focus-visible/avatar:opacity-100 transition-opacity flex items-center justify-center gap-1.5 text-neutral-white z-10",children:[(0,bt.jsx)("button",{type:"button",onClick:re,"aria-label":"Xem tr\u01B0\u1EDBc \u1EA3nh \u0111\u1EA1i di\u1EC7n",title:"Xem tr\u01B0\u1EDBc",className:"p-1 rounded-full text-neutral-white hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-neutral-white focus-visible:outline-hidden cursor-pointer","data-testid":"avatar-preview-button",children:(0,bt.jsx)(Vn,{width:14,height:14})}),se&&!d&&(0,bt.jsx)("button",{type:"button",onClick:de,"aria-label":"C\u1EAFt \u1EA3nh \u0111\u1EA1i di\u1EC7n",title:"C\u1EAFt \u1EA3nh",className:"p-1 rounded-full text-neutral-white hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-neutral-white focus-visible:outline-hidden cursor-pointer","data-testid":"avatar-crop-button",children:(0,bt.jsx)(ts,{width:14,height:14})}),(!d||Y)&&(0,bt.jsx)("button",{type:"button",onClick:xe,"aria-label":"X\xF3a \u1EA3nh \u0111\u1EA1i di\u1EC7n",title:"X\xF3a \u1EA3nh",className:"p-1 rounded-full text-error-300 hover:text-error-200 hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-error-400 focus-visible:outline-hidden cursor-pointer","data-testid":"avatar-remove-button",children:(0,bt.jsx)(Br,{width:14,height:14})})]})]}),(0,bt.jsx)(Le,{id:A,helperText:k,errorMessage:he,sizeClassName:Se.helper,className:E}),se&&ie&&(0,bt.jsx)(Vs,{open:!!ie,file:ie.file,imageSrc:ie.imageSrc,fileName:ie.fileName,fileType:ie.fileType,aspectRatio:me.aspectRatio??1,cropShape:me.cropShape??(n==="circle"?"round":"rect"),showGrid:me.showGrid??!0,minZoom:me.minZoom??1,maxZoom:me.maxZoom??4,modalTitle:me.modalTitle||"C\u1EAFt \u1EA3nh \u0111\u1EA1i di\u1EC7n",onClose:()=>Q(null),onApply:K=>{fe(K),Z("\u1EA2nh \u0111\u1EA1i di\u1EC7n \u0111\xE3 \u0111\u01B0\u1EE3c c\u1EADp nh\u1EADt th\xE0nh c\xF4ng."),Q(null)}}),q&&le&&(0,bt.jsx)(Kr,{open:q,onClose:()=>ge(!1),file:le,title:ue||"Xem tr\u01B0\u1EDBc \u1EA3nh \u0111\u1EA1i di\u1EC7n",children:(0,bt.jsx)(Pn,{imageProps:{minZoom:.5,maxZoom:4,toolbarProps:{tools:{rotate:!0,flip:!0,download:!0}}}})})]})]})}var En=require("react"),cp=require("react-dropzone");var Ot=require("react/jsx-runtime");function Di({size:e="md",color:t="primary",variant:r="outline",radius:n,shape:o="rectangle",compact:i=!1,disabled:a=!1,readOnly:s=!1,isLoading:l=!1,showSpinner:f=!1,dragStatus:c="idle",isInvalid:w=!1,dropzoneTitle:p,dropzoneDescription:m,icon:v,onTriggerUpload:x,getRootProps:h,className:k="",describedById:T}){let y=C(e,Dn,"md"),d=C(n,mc,"md"),u=w?"error":t,g=r!=="other"?C(r,Ef,"outline"):null,b=g?C(u,g,"primary"):null,S="K\xE9o th\u1EA3 t\u1EC7p tin v\xE0o \u0111\xE2y, ho\u1EB7c nh\u1EA5n \u0111\u1EC3 duy\u1EC7t file",R="H\u1ED7 tr\u1EE3 t\xE0i li\u1EC7u PDF, Office, t\u1EC7p n\xE9n ZIP, media...",I=c==="reject"?"border-error-500 bg-error-50/50 ring-2 ring-error-500/20 text-error-900":c==="active"?b?.active||"border-primary-500 bg-primary-50 ring-2 ring-primary-500/20":b?.idle||"border-neutral-300 bg-neutral-50/50 hover:border-primary-500 hover:bg-primary-50/30",E=H=>{a||l||s||(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),x?.())};if(i){let H=`group relative w-full ${y.compactMinHeight} ${y.compactPadding} ${d} border-2 border-dashed flex items-center justify-between gap-3 text-left transition-colors duration-150 ease-in-out cursor-pointer select-none ${I} ${a||s?"opacity-50 cursor-not-allowed pointer-events-none bg-neutral-100":""} focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${k}`,V={role:"button",tabIndex:a||s?-1:0,"aria-label":"Khu v\u1EF1c t\u1EA3i t\u1EC7p l\xEAn thu g\u1ECDn","aria-disabled":a||s,"aria-invalid":w,"aria-describedby":T,"aria-busy":l,className:H,onKeyDown:E},Y=h?h(V):V;return(0,Ot.jsxs)("div",{...Y,children:[(0,Ot.jsxs)("div",{className:"flex items-center gap-2.5 min-w-0 flex-1",children:[(0,Ot.jsx)("div",{className:`transition-colors shrink-0 ${b?.iconColor||"text-primary-500"}`,children:l&&f?(0,Ot.jsx)(De,{width:18,height:18,className:"animate-spin text-primary-600"}):v||(0,Ot.jsx)(Zt,{width:18,height:18})}),(0,Ot.jsx)("span",{className:`truncate text-neutral-700 font-medium ${y.descSize}`,children:p||"K\xE9o th\u1EA3 ho\u1EB7c nh\u1EA5n \u0111\u1EC3 t\u1EA3i t\u1EC7p l\xEAn"})]}),(0,Ot.jsx)("span",{className:`shrink-0 text-primary-600 group-hover:text-primary-700 font-semibold ${y.descSize}`,children:"Ch\u1ECDn file"})]})}let N=`group relative w-full ${o==="square"?"aspect-square w-full":C(e,Ff,"md")} ${y.dropzonePadding} ${d} border-2 border-dashed flex flex-col items-center justify-center text-center transition-colors duration-150 ease-in-out cursor-pointer select-none ${I} ${a||s?"opacity-50 cursor-not-allowed pointer-events-none bg-neutral-100":""} focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${k}`,M={role:"button",tabIndex:a||s?-1:0,"aria-label":"Khu v\u1EF1c k\xE9o th\u1EA3 v\xE0 t\u1EA3i t\u1EC7p tin l\xEAn","aria-disabled":a||s,"aria-invalid":w,"aria-describedby":T,"aria-busy":l,className:N,onKeyDown:E},z=h?h(M):M;return(0,Ot.jsx)("div",{...z,children:l&&f?(0,Ot.jsxs)("div",{className:`flex flex-col items-center justify-center gap-2 ${b?.iconColor||"text-primary-600"}`,children:[(0,Ot.jsx)(De,{width:y.iconSize*.8,height:y.iconSize*.8}),(0,Ot.jsx)("span",{className:`${y.titleSize} font-medium`,children:"\u0110ang x\u1EED l\xFD t\u1EC7p tin..."})]}):(0,Ot.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2",children:[(0,Ot.jsx)("div",{className:`transition-colors ${b?.iconColor||"text-primary-500"}`,children:v||(0,Ot.jsx)(Zt,{width:y.iconSize,height:y.iconSize})}),(0,Ot.jsx)("div",{className:`${y.titleSize} font-medium text-neutral-800 ${b?.titleHover||"group-hover:text-primary-600"} transition-colors`,children:l?"\u0110ang x\u1EED l\xFD t\u1EC7p tin...":p??S}),(0,Ot.jsx)("div",{id:T,className:`${y.descSize} text-neutral-500`,children:m??R})]})})}var lp=require("react");var so=require("react/jsx-runtime");function Ni({file:e,fileName:t,category:r,size:n="md",className:o=""}){let i=(0,lp.useMemo)(()=>{if(r)return r;let f=t||(e?Tt(e):"");return $s(e||f)},[r,e,t]),a=C(i,Lf,"other"),s=typeof n=="number"?n:C(n,Dn,"md").fileIconSize,l=Math.max(8,Math.round(s*.22));return(0,so.jsxs)("div",{role:"img","aria-label":`Bi\u1EC3u t\u01B0\u1EE3ng \u0111\u1ECBnh d\u1EA1ng t\u1EC7p ${a.label}`,style:{width:s,height:s},className:`relative inline-flex items-center justify-center shrink-0 select-none ${o}`,children:[(0,so.jsxs)("svg",{viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-full h-full drop-shadow-xs transition-transform",children:[(0,so.jsx)("path",{d:"M8 5C8 3.9 8.9 3 10 3H26L34 11V35C34 36.1 33.1 37 32 37H10C8.9 37 8 36.1 8 35V5Z",className:"fill-neutral-50 stroke-neutral-300 transition-colors",strokeWidth:"1.5",strokeLinejoin:"round"}),(0,so.jsx)("path",{d:"M26 3V10C26 10.55 26.45 11 27 11H34",className:"fill-neutral-200 stroke-neutral-300",strokeWidth:"1.5",strokeLinejoin:"round"}),(0,so.jsx)("line",{x1:"13",y1:"15",x2:"23",y2:"15",className:"stroke-neutral-300",strokeWidth:"1.5",strokeLinecap:"round"}),(0,so.jsx)("line",{x1:"13",y1:"19",x2:"27",y2:"19",className:"stroke-neutral-300",strokeWidth:"1.5",strokeLinecap:"round"})]}),(0,so.jsx)("div",{style:{fontSize:`${l}px`},className:`absolute bottom-1 right-0.5 px-1 py-0.2 rounded font-bold tracking-tight border shadow-2xs leading-none uppercase ${a.bg} ${a.text} ${a.border}`,children:a.label})]})}var Ie=require("react/jsx-runtime");function Ia({item:e,index:t,listType:r="list",size:n="md",radius:o,disabled:i=!1,readOnly:a=!1,showPreviewButton:s=!0,showDownloadButton:l=!0,showRemoveButton:f=!0,onRemove:c,onPreview:w,onDownload:p,onRetry:m,renderItem:v,className:x=""}){let h=C(n,Dn,"md"),k=C(o,mc,"md"),T=Tt(e),y=cd(e),{status:d,progress:u,error:g}=ud(e),b=d==="uploading",S=d==="error",R=()=>{i||a||c?.(e,t)},D=()=>{i||w?.(e)},P=()=>{i||p?.(e)},I=()=>{i||a||m?.(e,t)};if(v)return(0,Ie.jsx)("li",{"data-testid":"upload-file-item",className:"list-none w-full",children:v(e,t,{remove:R,preview:D,download:P})});let E=N=>{i||(N.key==="Delete"||N.key==="Backspace")&&!a&&(N.preventDefault(),R())};return r==="grid"?(0,Ie.jsxs)("li",{"data-testid":"upload-file-item",tabIndex:i?-1:0,onKeyDown:E,"aria-label":`T\u1EC7p tin ${T}`,className:`group relative list-none flex flex-col justify-between p-3 ${k} border border-neutral-200 bg-white hover:border-primary-300 hover:shadow-xs transition-colors duration-150 ease-in-out focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${i?"opacity-50 pointer-events-none bg-neutral-50":""} ${S?"border-error-300 bg-error-50/20":""} ${x}`,children:[(0,Ie.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,Ie.jsx)(Ni,{file:e,size:n}),(0,Ie.jsxs)("div",{className:"flex-1 min-w-0",children:[w&&!i?(0,Ie.jsx)("button",{type:"button",title:T,onClick:D,className:`truncate text-left font-medium text-neutral-800 ${h.fileNameSize} hover:text-primary-600 hover:underline cursor-pointer focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500 rounded-xs block w-full`,children:T}):(0,Ie.jsx)("p",{title:T,className:`truncate font-medium text-neutral-800 ${h.fileNameSize}`,children:T}),(0,Ie.jsx)("p",{className:`text-neutral-500 ${h.fileMetaSize}`,children:S?(0,Ie.jsx)("span",{className:"text-error-600 font-medium truncate block",children:g||"L\u1ED7i t\u1EA3i l\xEAn"}):b?(0,Ie.jsxs)("span",{className:"text-primary-600 flex items-center gap-1 font-medium",children:[(0,Ie.jsx)(De,{width:12,height:12,className:"animate-spin inline"}),"\u0110ang t\u1EA3i... ",u!==void 0?`${u}%`:""]}):y!==void 0?un(y):null})]})]}),b&&u!==void 0&&(0,Ie.jsx)("div",{className:"w-full bg-neutral-100 rounded-full h-1.5 mt-2 overflow-hidden",children:(0,Ie.jsx)("div",{className:"bg-primary-500 h-1.5 rounded-full transition-[width] duration-300 ease-out",style:{width:`${Math.min(100,Math.max(0,u))}%`}})}),(0,Ie.jsxs)("div",{className:"flex items-center justify-end gap-1 mt-2.5 pt-2 border-t border-neutral-100",children:[S&&m&&!a&&(0,Ie.jsx)("button",{type:"button",disabled:i,onClick:I,"aria-label":`Th\u1EED l\u1EA1i t\u1EA3i l\xEAn ${T}`,title:"Th\u1EED l\u1EA1i",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${h.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:(0,Ie.jsx)(cr,{width:14,height:14})}),s&&w&&(0,Ie.jsx)("button",{type:"button",disabled:i,onClick:D,"aria-label":`Xem tr\u01B0\u1EDBc t\u1EC7p ${T}`,title:"Xem tr\u01B0\u1EDBc",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${h.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:(0,Ie.jsx)(Vn,{width:14,height:14})}),l&&(0,Ie.jsx)("button",{type:"button",disabled:i,onClick:P,"aria-label":`T\u1EA3i xu\u1ED1ng t\u1EC7p ${T}`,title:"T\u1EA3i xu\u1ED1ng",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${h.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:(0,Ie.jsx)(Qr,{width:14,height:14})}),f&&!a&&(0,Ie.jsx)("button",{type:"button",disabled:i,onClick:R,"aria-label":`X\xF3a t\u1EC7p ${T}`,title:"X\xF3a t\u1EC7p",className:`text-neutral-400 hover:text-error-600 hover:bg-error-50 ${h.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:(0,Ie.jsx)(Br,{width:14,height:14})})]})]}):(0,Ie.jsxs)("li",{"data-testid":"upload-file-item",tabIndex:i?-1:0,onKeyDown:E,"aria-label":`T\u1EC7p tin ${T}`,className:`group relative list-none flex flex-col w-full ${h.itemPadding} ${k} border border-neutral-200 bg-white hover:border-primary-300 hover:bg-neutral-50/50 transition-colors duration-150 ease-in-out focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${i?"opacity-50 pointer-events-none bg-neutral-50":""} ${S?"border-error-300 bg-error-50/20":""} ${x}`,children:[(0,Ie.jsxs)("div",{className:"flex items-center justify-between gap-3 w-full",children:[(0,Ie.jsxs)("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[(0,Ie.jsx)(Ni,{file:e,size:n}),(0,Ie.jsxs)("div",{className:"flex flex-col min-w-0 flex-1",children:[(0,Ie.jsx)("div",{className:"flex items-center gap-2",children:w&&!i?(0,Ie.jsx)("button",{type:"button",title:T,onClick:D,className:`truncate text-left font-medium text-neutral-800 ${h.fileNameSize} hover:text-primary-600 hover:underline cursor-pointer focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500 rounded-xs`,children:T}):(0,Ie.jsx)("span",{title:T,className:`truncate font-medium text-neutral-800 ${h.fileNameSize}`,children:T})}),(0,Ie.jsx)("div",{className:`flex items-center gap-2 text-neutral-500 ${h.fileMetaSize}`,children:S?(0,Ie.jsx)("span",{className:"text-error-600 font-medium truncate",children:g||"L\u1ED7i t\u1EA3i l\xEAn"}):b?(0,Ie.jsxs)("span",{className:"text-primary-600 flex items-center gap-1 font-medium",children:[(0,Ie.jsx)(De,{width:12,height:12,className:"animate-spin inline"}),"\u0110ang t\u1EA3i l\xEAn... ",u!==void 0?`${u}%`:""]}):y!==void 0?(0,Ie.jsx)("span",{children:un(y)}):null})]})]}),(0,Ie.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[S&&m&&!a&&(0,Ie.jsx)("button",{type:"button",disabled:i,onClick:I,"aria-label":`Th\u1EED l\u1EA1i t\u1EA3i l\xEAn ${T}`,title:"Th\u1EED l\u1EA1i",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${h.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:(0,Ie.jsx)(cr,{width:15,height:15})}),s&&w&&(0,Ie.jsx)("button",{type:"button",disabled:i,onClick:D,"aria-label":`Xem tr\u01B0\u1EDBc t\u1EC7p ${T}`,title:"Xem tr\u01B0\u1EDBc",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${h.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:(0,Ie.jsx)(Vn,{width:15,height:15})}),l&&(0,Ie.jsx)("button",{type:"button",disabled:i,onClick:P,"aria-label":`T\u1EA3i xu\u1ED1ng t\u1EC7p ${T}`,title:"T\u1EA3i xu\u1ED1ng",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${h.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:(0,Ie.jsx)(Qr,{width:15,height:15})}),f&&!a&&(0,Ie.jsx)("button",{type:"button",disabled:i,onClick:R,"aria-label":`X\xF3a t\u1EC7p ${T}`,title:"X\xF3a t\u1EC7p",className:`text-neutral-400 hover:text-error-600 hover:bg-error-50 ${h.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:(0,Ie.jsx)(Br,{width:15,height:15})})]})]}),b&&u!==void 0&&(0,Ie.jsx)("div",{className:"w-full bg-neutral-100 rounded-full h-1 mt-2 overflow-hidden",children:(0,Ie.jsx)("div",{className:"bg-primary-500 h-1 rounded-full transition-[width] duration-300 ease-out",style:{width:`${Math.min(100,Math.max(0,u))}%`}})})]})}var gd=require("react/jsx-runtime");function Ma({items:e,listType:t="list",size:r="md",color:n="primary",radius:o,disabled:i=!1,readOnly:a=!1,showPreviewButton:s=!0,showDownloadButton:l=!0,showRemoveButton:f=!0,onRemove:c,onPreview:w,onDownload:p,onRetry:m,renderItem:v,className:x=""}){let h=C(r,Dn,"md"),k=t==="grid"?`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 ${h.gap} list-none p-0 m-0 ${x}`:`flex flex-col ${h.gap} list-none p-0 m-0 ${x}`;return!e||e.length===0?null:(0,gd.jsx)("ul",{"aria-label":"Danh s\xE1ch t\u1EC7p tin \u0111\xE3 t\u1EA3i l\xEAn",className:k,children:e.map((T,y)=>{let d=Bf(T,y);return(0,gd.jsx)(Ia,{item:T,index:y,listType:t,size:r,radius:o,color:n,disabled:i,readOnly:a,showPreviewButton:s,showDownloadButton:l,showRemoveButton:f,onRemove:c,onPreview:w,onDownload:p,onRetry:m,renderItem:v},d)})})}var Kt=require("react/jsx-runtime");function Sc({value:e,defaultValue:t,onChange:r,onRemove:n,onPreview:o,onDownload:i,onRetry:a,maxCount:s,maxSize:l,minSize:f,accept:c,beforeUpload:w,viewMode:p="dropzone",listType:m="list",shape:v="rectangle",size:x="md",color:h="primary",variant:k="outline",radius:T,label:y,labelClassName:d="",helperText:u,errorMessage:g,disabled:b=!1,readOnly:S=!1,dropzoneTitle:R,dropzoneDescription:D,buttonText:P="T\u1EA3i t\u1EC7p l\xEAn",icon:I,renderItem:E,className:N="",dropzoneClassName:M="",listClassName:z="",previewClassName:H="",helperClassName:V="",config:Y}){let{isRequired:$=!1,isInvalid:F=!1,isLoading:G=!1,showSpinner:A=!1,multiple:j=!1,showFileList:B=!0,showPreviewButton:X=!0,showDownloadButton:le=!0,showRemoveButton:ne=!0}=Y??{},ue=(0,En.useId)(),ie=`${ue}-input`,Q=`${ue}-error-helper`,q=e!==void 0,[ge,ke]=(0,En.useState)(()=>ki(t)),L=(0,En.useMemo)(()=>q?ki(e):ge,[q,e,ge]),[te,Z]=(0,En.useState)(null),[he,ae]=(0,En.useState)(null),[ve,Se]=(0,En.useState)(""),ye=C(x,Dn,"md"),J=T??"md",O=!!(F||g||te),W=g||te,fe=O?"text-error-600":C(O?"error":h,Mf,"primary"),se=s??(j?void 0:1),me=oe=>{q||ke(oe),r?.(oe)},Re=(0,En.useMemo)(()=>Ls(c),[c]),{getRootProps:xe,getInputProps:re,isDragActive:de,isDragReject:ce,open:ee}=(0,cp.useDropzone)({multiple:j,maxSize:l,minSize:f,accept:Re,disabled:b||S||G,noClick:p==="button",noKeyboard:p==="button",onDropAccepted:async oe=>{if(b||S||(Z(null),oe.length===0))return;let Te=oe,Pe=L.length;if(se!==void 0)if(j){let Be=se-Pe;if(Be<=0){let Oe=`S\u1ED1 l\u01B0\u1EE3ng t\u1EC7p \u0111\xE3 \u0111\u1EA1t t\u1ED1i \u0111a (${se} t\u1EC7p)`;Z(Oe),Se(Oe);return}Te=oe.slice(0,Be)}else{let Be=oe[0];if(!Be)return;Te=[Be]}let Qe=await Promise.all(Te.map(async Be=>{if(w)try{let Oe=await w(Be);if(Oe===!1||typeof Oe=="string")return{file:null,error:typeof Oe=="string"?Oe:`T\u1EC7p ${Be.name} \u0111\xE3 b\u1ECB t\u1EEB ch\u1ED1i`}}catch(Oe){return{file:null,error:Oe instanceof Error?Oe.message:`Kh\xF4ng th\u1EC3 x\u1EED l\xFD t\u1EC7p ${Be.name}`}}return{file:Be,error:null}})),We=[];for(let Be of Qe)Be.error?(Z(Be.error),Se(`L\u1ED7i: ${Be.error}`)):Be.file&&We.push(Be.file);if(We.length>0){let Be=j?[...L,...We]:We;me(Be),Se(`\u0110\xE3 th\xEAm ${We.length} t\u1EC7p tin. T\u1ED5ng c\u1ED9ng: ${Be.length} t\u1EC7p.`)}},onDropRejected:oe=>{let Te=oe[0]?.errors[0];if(!Te)return;let Pe=Te.message||"T\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7";Te.code==="file-too-large"?Pe=`K\xEDch th\u01B0\u1EDBc t\u1EC7p v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n cho ph\xE9p (${un(l||0)})`:Te.code==="file-too-small"?Pe=`K\xEDch th\u01B0\u1EDBc t\u1EC7p nh\u1ECF h\u01A1n gi\u1EDBi h\u1EA1n t\u1ED1i thi\u1EC3u (${un(f||0)})`:Te.code==="file-invalid-type"?Pe=`\u0110\u1ECBnh d\u1EA1ng t\u1EC7p kh\xF4ng \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3. C\xE1c \u0111\u1ECBnh d\u1EA1ng cho ph\xE9p: ${typeof c=="string"?c:Object.keys(c||{}).join(", ")}`:Te.code==="too-many-files"&&(Pe=`S\u1ED1 l\u01B0\u1EE3ng t\u1EC7p v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n cho ph\xE9p (${se} t\u1EC7p)`),Z(Pe),Se(`L\u1ED7i t\u1EC7p: ${Pe}`)}}),U=(oe,Te)=>{if(b||S)return;let Pe=L.filter((Qe,We)=>We!==Te);me(Pe),n?.(oe,Te),Se(`\u0110\xE3 x\xF3a t\u1EC7p tin ${Tt(oe)}`)},Ce=oe=>{ae(oe),o?.(oe)},$e=oe=>{i?.(oe);let Te=Tt(oe);if(oe instanceof File){let Pe=URL.createObjectURL(oe);dn(Pe,oe.name),setTimeout(()=>URL.revokeObjectURL(Pe),1e3);return}if(typeof oe=="string"){dn(oe,Te);return}typeof oe=="object"&&oe&&typeof oe.src=="string"&&dn(oe.src,oe.name||Te)},Ee=H||z;return(0,Kt.jsxs)("div",{className:`group/field relative flex flex-col w-full ${N}`,children:[(0,Kt.jsx)("input",{...re({id:ie,disabled:b||G,"aria-hidden":!0,tabIndex:-1,className:"hidden"})}),(0,Kt.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:ve}),y&&(0,Kt.jsxs)("label",{htmlFor:ie,className:`block font-medium transition-colors duration-150 ${ye.labelSize} ${fe} ${d}`,children:[y,$&&(0,Kt.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),(0,Kt.jsxs)("div",{className:"flex flex-col gap-3",children:[p==="dropzone"&&(0,Kt.jsx)(Di,{size:x,color:h,variant:k,radius:J,shape:v,disabled:b,readOnly:S,isLoading:G,showSpinner:A,dragStatus:ce?"reject":de?"active":"idle",isInvalid:O,dropzoneTitle:R,dropzoneDescription:D,icon:I,onTriggerUpload:ee,getRootProps:xe,className:M,describedById:W||u?Q:void 0}),p==="compact"&&(0,Kt.jsx)(Di,{size:x,color:h,variant:k,radius:J,compact:!0,disabled:b,readOnly:S,isLoading:G,showSpinner:A,dragStatus:ce?"reject":de?"active":"idle",isInvalid:O,dropzoneTitle:R,dropzoneDescription:D,icon:I,onTriggerUpload:ee,getRootProps:xe,className:M,describedById:W||u?Q:void 0}),p==="button"&&(0,Kt.jsx)("div",{className:"flex items-center gap-3",children:(0,Kt.jsx)(xr,{type:"button",size:ye.buttonSize,color:O?"error":h==="neutral"?"secondary":h,variant:k==="other"?"filled":k,radius:T,disabled:b||S||G||se!==void 0&&L.length>=se,isLoading:G,showSpinner:A,onClick:ee,leftIcon:(0,Kt.jsx)(Zt,{width:ye.iconSize*.5,height:ye.iconSize*.5}),"aria-label":"T\u1EA3i t\u1EC7p l\xEAn",children:P})}),B&&L.length>0&&(0,Kt.jsx)(Ma,{items:L,listType:m,size:x,color:h,variant:k,radius:J,disabled:b,readOnly:S,maxCount:se,showPreviewButton:X,showDownloadButton:le,showRemoveButton:ne,onRemove:U,onPreview:Ce,onDownload:$e,onRetry:a,renderItem:E,className:Ee})]}),(0,Kt.jsx)(Le,{id:Q,helperText:u,errorMessage:O?W:void 0,sizeClassName:ye.helperSize,className:V}),he&&(0,Kt.jsx)(Kr,{open:!!he,onClose:()=>ae(null),file:he})]})}var up=300,jo={xs:{dialog:"max-w-[320px] p-4 gap-3",header:"gap-2.5",body:"text-xs",footer:"gap-2 pt-2",title:"text-sm font-semibold leading-tight text-neutral-900",description:"text-xs leading-normal text-neutral-600",iconWrapper:"size-7 rounded-full",icon:"size-4",buttonSize:"xs",buttonGap:"gap-2",closeButton:"size-5 p-0.5 -mr-1 -mt-1",closeIcon:"size-3.5"},sm:{dialog:"max-w-[380px] p-5 gap-3.5",header:"gap-3",body:"text-sm",footer:"gap-2.5 pt-2.5",title:"text-base font-semibold leading-tight text-neutral-900",description:"text-sm leading-normal text-neutral-600",iconWrapper:"size-9 rounded-full",icon:"size-5",buttonSize:"sm",buttonGap:"gap-2.5",closeButton:"size-6 p-0.5 -mr-1 -mt-1",closeIcon:"size-4"},md:{dialog:"max-w-[440px] p-6 gap-4",header:"gap-3.5",body:"text-sm",footer:"gap-3 pt-3",title:"text-lg font-semibold leading-tight text-neutral-900",description:"text-sm leading-relaxed text-neutral-600",iconWrapper:"size-10 rounded-full",icon:"size-5",buttonSize:"md",buttonGap:"gap-3",closeButton:"size-7 p-1 -mr-1.5 -mt-1.5",closeIcon:"size-4"},lg:{dialog:"max-w-[520px] p-7 gap-5",header:"gap-4",body:"text-base",footer:"gap-3.5 pt-3.5",title:"text-xl font-semibold leading-snug text-neutral-900",description:"text-base leading-relaxed text-neutral-600",iconWrapper:"size-12 rounded-full",icon:"size-6",buttonSize:"lg",buttonGap:"gap-3.5",closeButton:"size-8 p-1.5 -mr-1.5 -mt-1.5",closeIcon:"size-4.5"},xl:{dialog:"max-w-[600px] p-8 gap-6",header:"gap-4.5",body:"text-lg",footer:"gap-4 pt-4",title:"text-2xl font-bold leading-snug text-neutral-900",description:"text-lg leading-relaxed text-neutral-600",iconWrapper:"size-14 rounded-full",icon:"size-7",buttonSize:"xl",buttonGap:"gap-4",closeButton:"size-9 p-1.5 -mr-2 -mt-2",closeIcon:"size-5"}},dp={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},fp={primary:"bg-primary-50 text-primary-600 border border-primary-200",secondary:"bg-secondary-50 text-secondary-600 border border-secondary-200",neutral:"bg-neutral-100 text-neutral-600 border border-neutral-200",error:"bg-error-50 text-error-600 border border-error-200",success:"bg-success-50 text-success-600 border border-success-200",warning:"bg-warning-50 text-warning-600 border border-warning-200",info:"bg-info-50 text-info-600 border border-info-200"},pp={warning:Xo,error:qo,success:_o,info:Dr,primary:Dr,secondary:Dr,neutral:Dr};var Tc=require("react"),md=(0,Tc.createContext)(null),Er=()=>(0,Tc.useContext)(md);var gp=require("react/jsx-runtime");function Rc({size:e,radius:t,className:r="",children:n,ref:o,...i}){let a=Er(),s=C(e??a?.size,jo,"md"),l=C(t,dp,"lg"),f=["relative flex flex-col w-full bg-neutral-white shadow-2xl border-2 border-neutral-200 outline-none text-neutral-900 pointer-events-auto",s.dialog,l,r].filter(Boolean).join(" ");return(0,gp.jsx)("div",{ref:o,tabIndex:-1,className:f,...i,children:n})}var _t=require("react");var Fa=require("react/jsx-runtime");function Dc({open:e=!1,size:t="md",color:r="warning",isLoading:n=!1,closeOnOverlayClick:o=!0,closeOnEsc:i=!0,lockScroll:a=!0,overlayClassName:s="",className:l="",children:f,onClose:c,...w}){let p=(0,_t.useRef)(null),[m,v]=(0,_t.useState)(!1),x=(0,_t.useRef)(null),h=(0,_t.useCallback)(()=>{m||n||(v(!0),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{v(!1),c?.()},up))},[m,n,c]),k=(0,_t.useMemo)(()=>({onClose:h,isLoading:n,size:t,color:r}),[h,n,t,r]);(0,_t.useEffect)(()=>()=>{x.current&&clearTimeout(x.current)},[]),(0,_t.useEffect)(()=>{let g=p.current;if(g)if(e||m){if(!g.open)try{g.showModal()}catch{}}else g.open&&g.close()},[e,m]),(0,_t.useEffect)(()=>{if(!a)return;let g=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=g}},[a]);let T=(0,_t.useEffectEvent)(g=>{!e||i===!1||g.key==="Escape"&&(g.preventDefault(),g.stopPropagation(),h())});if((0,_t.useEffect)(()=>(window.addEventListener("keydown",T),()=>{window.removeEventListener("keydown",T)}),[]),!e&&!m)return null;let y=()=>{o&&h()},d=m?"animate-confirm-backdrop-out pointer-events-none":"animate-confirm-backdrop-in",u=m?"animate-confirm-out pointer-events-none":"animate-confirm-in";return(0,Fa.jsx)(md.Provider,{value:k,children:(0,Fa.jsxs)("dialog",{ref:p,"aria-labelledby":"confirm-dialog-title","aria-describedby":"confirm-dialog-description",onCancel:g=>{g.preventDefault(),i!==!1&&h()},className:`fixed inset-0 flex items-center justify-center p-4 bg-neutral-950/40 backdrop-blur-xs border-none m-0 max-w-none max-h-none w-screen h-screen overflow-visible backdrop:bg-transparent ${d} ${s}`,...w,children:[(0,Fa.jsx)("div",{"aria-hidden":"true",onClick:y,className:"fixed inset-0 -z-10"}),(0,Fa.jsx)("div",{className:`w-full flex items-center justify-center pointer-events-none ${u} ${l}`,children:f})]})})}var $n=require("react/jsx-runtime");function Nc({size:e,color:t,icon:r=!0,title:n,iconClassName:o="",titleClassName:i="",showCloseButton:a=!1,onClose:s,closeButtonClassName:l="",className:f="",children:c,...w}){let p=Er(),m=C(e??p?.size,jo,"md"),v=C(t??p?.color,fp,"warning"),x=p?.isLoading,h=()=>{s?.(),p?.onClose?.()},k=!!(s||p?.onClose),T=()=>{if(r===!1)return null;if(r!==void 0&&r!==!0)return(0,$n.jsx)("div",{className:`inline-flex items-center justify-center shrink-0 ${m.iconWrapper} ${v} ${o}`,"aria-hidden":"true",children:r});let y=C(t??p?.color,pp,"warning");return(0,$n.jsx)("div",{className:`inline-flex items-center justify-center shrink-0 ${m.iconWrapper} ${v} ${o}`,"aria-hidden":"true",children:(0,$n.jsx)(y,{className:m.icon})})};return(0,$n.jsxs)("div",{className:`flex items-start justify-between w-full ${m.header} ${f}`,...w,children:[(0,$n.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[T(),n&&(0,$n.jsx)("h3",{className:`${m.title} truncate ${i}`,id:"confirm-dialog-title",children:n}),c]}),a&&k&&(0,$n.jsx)("button",{type:"button",onClick:h,disabled:x,"aria-label":"\u0110\xF3ng h\u1ED9p tho\u1EA1i",className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-700 hover:bg-neutral-100 rounded-md transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-neutral-400 ${m.closeButton} ${l}`,children:(0,$n.jsx)(Ve,{className:m.closeIcon})})]})}var zc=require("react/jsx-runtime");function Pc({size:e,description:t,descriptionClassName:r="",className:n="",children:o,...i}){let a=Er(),s=C(e??a?.size,jo,"md");return(0,zc.jsxs)("div",{className:`w-full ${s.body} ${n}`,id:"confirm-dialog-description",...i,children:[t?(0,zc.jsx)("p",{className:`${s.description} ${r}`,children:t}):null,o]})}var Ea=require("react/jsx-runtime");function Ic({size:e,confirmText:t="X\xE1c nh\u1EADn",cancelText:r="H\u1EE7y",confirmVariant:n="filled",cancelVariant:o="outline",confirmColor:i,cancelColor:a="secondary",onConfirm:s,onCancel:l,onClose:f,confirmButtonProps:c,cancelButtonProps:w,className:p="",children:m,...v}){let x=Er(),h=C(e??x?.size,jo,"md"),k=i??x?.color??"warning",T=()=>{f?.(),x?.onClose?.()},y=async()=>{try{let u=s?.();u&&"then"in u&&await u,T()}catch{}},d=()=>{l?.(),T()};return m?(0,Ea.jsx)("div",{className:`flex items-center justify-end w-full ${h.footer} ${h.buttonGap} ${p}`,...v,children:m}):(0,Ea.jsxs)("div",{className:`flex items-center justify-end w-full ${h.footer} ${h.buttonGap} ${p}`,...v,children:[r!==!1&&(0,Ea.jsx)(xr,{size:h.buttonSize,variant:o,color:a,onClick:d,disabled:w?.disabled||x?.isLoading,...w,children:r}),(0,Ea.jsx)(xr,{size:h.buttonSize,variant:n,color:k,isLoading:x?.isLoading||c?.isLoading,disabled:c?.disabled,onClick:y,...c,children:t})]})}var Mc=require("react");var mp=require("react/jsx-runtime");function Fc({children:e,asChild:t=!0,onClick:r,...n}){let o=Er(),i=o?.isLoading,a=s=>{r?.(s),s.defaultPrevented||o?.onClose?.()};if(t&&(0,Mc.isValidElement)(e)){let s=e;return(0,Mc.cloneElement)(s,{disabled:s.props.disabled||i,onClick:l=>{s.props.onClick?.(l),a(l)},...n})}return(0,mp.jsx)("button",{type:"button",onClick:a,disabled:i,...n,children:e})}var bp=require("react/jsx-runtime");function Ec({size:e,className:t="",children:r,...n}){let o=Fr(),i=C(e??o?.size,Eo,"md");return(0,bp.jsx)("div",{className:`flex items-center justify-end w-full border-t border-neutral-100 pt-2 ${i.footer} ${i.buttonGap} ${t}`,...n,children:r})}var $c=require("react");var hp=require("react/jsx-runtime");function Lc({children:e,asChild:t=!0,onClick:r,...n}){let o=Fr(),i=o?.isLoading,a=s=>{r?.(s),s.defaultPrevented||o?.onClose?.()};if(t&&(0,$c.isValidElement)(e)){let s=e;return(0,$c.cloneElement)(s,{disabled:s.props.disabled||i,onClick:l=>{s.props.onClick?.(l),a(l)},...n})}return(0,hp.jsx)("button",{type:"button",onClick:a,disabled:i,...n,children:e})}var $a=require("react");var Bc={sm:{head:"px-3 py-2 text-xs font-semibold",cell:"px-3 py-2 text-xs",text:"text-xs",icon:"w-3.5 h-3.5"},md:{head:"px-4 py-3 text-sm font-semibold",cell:"px-4 py-3 text-sm",text:"text-sm",icon:"w-4 h-4"},lg:{head:"px-5 py-4 text-base font-semibold",cell:"px-5 py-4 text-base",text:"text-base",icon:"w-5 h-5"}},Hc={default:{container:"border border-neutral-200 shadow-xs",table:"border-collapse",head:"bg-neutral-50/80 border-b border-neutral-200 text-neutral-600",row:"border-b border-neutral-200/80 hover:bg-neutral-50/50 transition-colors",cell:"text-neutral-700"},striped:{container:"border border-neutral-200 shadow-xs",table:"border-collapse",head:"bg-neutral-100/80 border-b border-neutral-200 text-neutral-700",row:"border-b border-neutral-200/80 even:bg-neutral-50/60 hover:bg-neutral-100/40 transition-colors",cell:"text-neutral-700"},bordered:{container:"border border-neutral-200 shadow-xs",table:"border-collapse border border-neutral-200",head:"bg-neutral-50 border border-neutral-200 text-neutral-700",row:"border-b border-neutral-200 hover:bg-neutral-50/50 transition-colors",cell:"border border-neutral-200 text-neutral-700"}},Vc={left:"text-left justify-start",center:"text-center justify-center",right:"text-right justify-end"},As=[10,20,50,100],Os=10;var pn=require("react/jsx-runtime"),xp=(0,$a.createContext)({size:"md",variantStyles:Hc.default}),Pi=()=>(0,$a.useContext)(xp);function Gs({variant:e="default",size:t="md",className:r="",containerClassName:n="",wrapperProps:o,children:i,ref:a,...s}){let l=C(e,Hc,"default"),f=(0,$a.useMemo)(()=>({size:t,variantStyles:l}),[t,l]);return(0,pn.jsx)(xp.Provider,{value:f,children:(0,pn.jsx)("div",{className:`w-full overflow-x-auto rounded-lg ${l.container} ${n}`.trim(),...o,children:(0,pn.jsx)("table",{ref:a,className:`w-full text-left caption-bottom ${l.table} ${r}`.trim(),...s,children:i})})})}function js({className:e="",children:t,ref:r,...n}){let{variantStyles:o}=Pi();return(0,pn.jsx)("thead",{ref:r,className:`${o.head} ${e}`.trim(),...n,children:t})}function Us({className:e="",children:t,ref:r,...n}){return(0,pn.jsx)("tbody",{ref:r,className:`divide-y divide-neutral-200/70 ${e}`.trim(),...n,children:t})}function bd({className:e="",children:t,ref:r,...n}){return(0,pn.jsx)("tfoot",{ref:r,className:`border-t border-neutral-200 bg-neutral-50/60 font-medium text-neutral-600 ${e}`.trim(),...n,children:t})}function Uo({isSelected:e=!1,isHoverable:t=!0,className:r="",children:n,ref:o,...i}){let{variantStyles:a}=Pi(),s=e?"bg-primary-50/70 hover:bg-primary-50 text-primary-950 font-medium":"",l=t&&!e?a.row:"";return(0,pn.jsx)("tr",{ref:o,"data-state":e?"selected":void 0,"aria-selected":e,className:`${l} ${s} ${r}`.trim(),...i,children:n})}function lo({align:e="left",className:t="",children:r,ref:n,...o}){let{size:i}=Pi(),a=C(i,Bc,"md"),s=C(e,Vc,"left");return(0,pn.jsx)("th",{ref:n,className:`tracking-wider ${a.head} ${s} ${t}`.trim(),...o,children:r})}function zi({align:e="left",className:t="",children:r,ref:n,...o}){let{size:i,variantStyles:a}=Pi(),s=C(i,Bc,"md"),l=C(e,Vc,"left");return(0,pn.jsx)("td",{ref:n,className:`align-middle ${s.cell} ${a.cell} ${l} ${t}`.trim(),...o,children:r})}function hd({className:e="",children:t,ref:r,...n}){return(0,pn.jsx)("caption",{ref:r,className:`mt-3 text-xs text-neutral-500 ${e}`.trim(),...n,children:t})}var Ln=require("react/jsx-runtime");function Ii({column:e,title:t,className:r="",...n}){if(!e.getCanSort())return(0,Ln.jsx)("div",{className:`font-semibold ${r}`.trim(),...n,children:t});let o=e.getIsSorted(),i=a=>{a.preventDefault();let s=e.getToggleSortingHandler();s&&s(a)};return(0,Ln.jsx)("div",{className:`flex items-center space-x-1.5 ${r}`.trim(),...n,children:(0,Ln.jsxs)("button",{type:"button",onClick:i,className:"group inline-flex items-center gap-1.5 font-semibold text-inherit hover:text-neutral-900 transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 rounded px-1 py-0.5 -mx-1",children:[(0,Ln.jsx)("span",{children:t}),(0,Ln.jsx)("span",{className:"shrink-0 inline-flex items-center justify-center","aria-hidden":"true",children:o==="asc"?(0,Ln.jsx)(as,{className:"w-3.5 h-3.5 text-primary-600"}):o==="desc"?(0,Ln.jsx)(ls,{className:"w-3.5 h-3.5 text-primary-600"}):(0,Ln.jsx)(os,{className:"w-3.5 h-3.5 text-neutral-400 opacity-60 group-hover:opacity-100 transition-opacity"})})]})})}var vp=require("@dnd-kit/sortable"),yp=require("@dnd-kit/utilities");var xd=require("react/jsx-runtime");function vd({header:e,canSort:t=!1,headerContent:r,ariaSort:n,disabled:o=!1,className:i=""}){let a=e.column.id==="_select",s=o||a,{attributes:l,listeners:f,setNodeRef:c,transform:w,transition:p,isDragging:m}=(0,vp.useSortable)({id:e.column.id,disabled:s}),v={transform:yp.CSS.Translate.toString(w),transition:p,opacity:m?.75:1,position:m?"relative":void 0,zIndex:m?20:void 0,whiteSpace:"nowrap"},x=t&&typeof e.column.columnDef.header=="string"?(0,xd.jsx)(Ii,{column:e.column,title:e.column.columnDef.header}):r;return(0,xd.jsx)(lo,{ref:c,style:v,"aria-sort":n,"data-column-id":e.column.id,...s?{}:l,...s?{}:f,className:`
|
|
2
|
+
"use strict";var Ip=Object.create;var nl=Object.defineProperty;var Mp=Object.getOwnPropertyDescriptor;var Fp=Object.getOwnPropertyNames;var Ep=Object.getPrototypeOf,$p=Object.prototype.hasOwnProperty;var Lp=(e,t)=>{for(var r in t)nl(e,r,{get:t[r],enumerable:!0})},Md=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Fp(t))!$p.call(e,n)&&n!==r&&nl(e,n,{get:()=>t[n],enumerable:!(o=Mp(t,n))||o.enumerable});return e};var Ko=(e,t,r)=>(r=e!=null?Ip(Ep(e)):{},Md(t||!e||!e.__esModule?nl(r,"default",{value:e,enumerable:!0}):r,e)),Bp=e=>Md(nl({},"__esModule",{value:!0}),e);var ym={};Lp(ym,{AUDIO_EXTENSIONS:()=>Gs,Alert:()=>fi,AlertCircleIcon:()=>ni,AlertTriangleIcon:()=>oi,ArrowDownIcon:()=>hs,ArrowUpDownIcon:()=>ps,ArrowUpIcon:()=>gs,AvatarIcon:()=>ds,Badge:()=>yr,Button:()=>Ir,Calendar:()=>fo,CalendarHeader:()=>Ca,CalendarIcon:()=>su,Carousel:()=>Su,CarouselContent:()=>ku,CarouselNext:()=>Du,CarouselPagination:()=>Pu,CarouselPrevious:()=>Nu,CarouselSlide:()=>Ru,CheckCircleIcon:()=>ri,CheckIcon:()=>Zo,Checkbox:()=>io,CheckboxGroup:()=>kn,ChevronDownIcon:()=>zt,ChevronLeftIcon:()=>Br,ChevronRightIcon:()=>sr,ClockIcon:()=>lu,CloseIcon:()=>Ue,Collapse:()=>$l,CollapseContent:()=>da,CollapseHeader:()=>ua,CollapsePanel:()=>Hl,Collapsible:()=>Al,Confirm:()=>Fc,ConfirmBody:()=>Lc,ConfirmClose:()=>Ac,ConfirmContainer:()=>Ec,ConfirmFooter:()=>Hc,ConfirmHeader:()=>$c,CropIcon:()=>us,DEFAULT_PAGE_SIZE:()=>qs,DEFAULT_PAGE_SIZE_OPTIONS:()=>Xs,DEFAULT_TOAST_DURATION:()=>so,DOCUMENT_EXTENSIONS:()=>js,DataTable:()=>Id,DatePicker:()=>$n,DateRangeCalendar:()=>ki,DateRangeDayGrid:()=>Ci,DateRangeHeader:()=>Ra,DateRangeMonthGrid:()=>Si,DateRangePicker:()=>Hn,DateRangeYearGrid:()=>Ti,DateTimePicker:()=>xc,DateTimeRangePicker:()=>vc,DayGrid:()=>Sa,DoubleChevronLeftIcon:()=>Qo,DoubleChevronRightIcon:()=>en,DownloadIcon:()=>ao,Dropdown:()=>_l,DropdownGroup:()=>Ou,DropdownHeader:()=>Vu,DropdownItem:()=>Bu,DropdownMenu:()=>Jl,DropdownSeparator:()=>Au,DropdownTrigger:()=>Fu,Empty:()=>Gn,EmptyDefaultIcon:()=>Tl,EmptyErrorIcon:()=>Rl,EmptyFolderIcon:()=>Nl,EmptyIllustration:()=>Di,EmptySearchIcon:()=>kl,EmptySimpleIcon:()=>Dl,EyeIcon:()=>_o,FileContainer:()=>ro,FileIcon:()=>Bi,FilePreview:()=>Vo,FlipHorizontalIcon:()=>ci,IMAGE_EXTENSIONS:()=>Vs,IconButton:()=>vr,ImageIcon:()=>ls,ImagePreview:()=>Ba,ImagePreviewToolbar:()=>La,InfoCircleIcon:()=>Vr,Input:()=>ar,LoadingImage:()=>Oo,MinusIcon:()=>Ja,Modal:()=>Yn,ModalBody:()=>Xn,ModalClose:()=>jc,ModalContainer:()=>Wn,ModalFooter:()=>Oc,ModalHeader:()=>_n,MonthGrid:()=>Ta,MultiInput:()=>gl,MultiSelect:()=>bd,MultiSelectTrigger:()=>Hs,NumberInput:()=>wn,OtpInput:()=>ml,PDF_EXTENSIONS:()=>As,PasswordInput:()=>pl,PlusIcon:()=>no,Popover:()=>ga,PopoverBody:()=>qu,PopoverClose:()=>Qu,PopoverContent:()=>Wu,PopoverFooter:()=>Zu,PopoverHeader:()=>_u,PopoverTrigger:()=>Rs,Radio:()=>qi,RadioDotIcon:()=>es,RadioGroup:()=>Cl,ResetIcon:()=>Tr,RotateCcwIcon:()=>li,RotateCwIcon:()=>rn,SearchIcon:()=>Tn,Select:()=>gd,SelectComponent:()=>Fa,SelectMenu:()=>zi,SelectMenuFilter:()=>Es,SelectOption:()=>Ms,SelectTrigger:()=>Pi,SingleSelectTrigger:()=>Pi,Skeleton:()=>Zn,Slider:()=>la,SliderMarks:()=>ys,SliderStepDots:()=>ws,SliderThumb:()=>ia,SlidersHorizontalIcon:()=>xs,Spinner:()=>Re,Tab:()=>zn,TabList:()=>Pn,TabPanel:()=>Ul,TabPanels:()=>jl,Table:()=>Zs,TableBody:()=>Qs,TableCaption:()=>Td,TableCell:()=>xn,TableColumnHeader:()=>Ai,TableFooter:()=>Sd,TableHead:()=>hn,TableHeader:()=>Js,TablePagination:()=>el,TableRow:()=>bn,TableToolbar:()=>tl,Tabs:()=>Dn,TextArea:()=>bl,TimeColumn:()=>fn,TimePicker:()=>bc,TimeRangePicker:()=>hc,TimeView:()=>Or,Toaster:()=>Rn,Toggle:()=>Sl,Tooltip:()=>na,TrashIcon:()=>Wr,UploadAvatar:()=>Ic,UploadAvatarCropContent:()=>zc,UploadAvatarCropModal:()=>_s,UploadFile:()=>Mc,UploadFileDropzone:()=>Li,UploadFileItemRow:()=>Va,UploadFileList:()=>Aa,UploadIcon:()=>mr,UploadImage:()=>Pc,UploadImageDropzone:()=>Ha,UploadImageList:()=>Jn,VIDEO_EXTENSIONS:()=>Os,YearGrid:()=>ka,ZoomInIcon:()=>ai,ZoomOutIcon:()=>si,checkIsDisabled:()=>On,clamp:()=>Il,combineDateTime:()=>Gr,createDateWithTime:()=>An,createTableColumnHelper:()=>zd,defaultTableFeatures:()=>Kc,downloadFile:()=>xo,formatBytes:()=>ho,formatDate:()=>Rr,formatDateTime:()=>Pr,formatNumberString:()=>Xo,formatTime:()=>br,fuzzyFilter:()=>rl,generateCalendarGrid:()=>Ds,generateRangeCalendarGrid:()=>Na,getDefaultDateTimeFormat:()=>pn,getDefaultFormat:()=>dn,getFileCategory:()=>Us,getFileExtension:()=>$a,getFileName:()=>$t,getFileType:()=>Mi,getISOWeekNumber:()=>wa,getPercentage:()=>aa,getSafeConfig:()=>C,isDateAfter:()=>ya,isDateBefore:()=>va,isSameDay:()=>un,isSameMonth:()=>Ns,isSameTime:()=>nd,isTimeAfter:()=>ad,isTimeBefore:()=>id,isTimeInRange:()=>ld,isValidOtpChar:()=>_a,normalizePreviewFile:()=>Ho,padZero:()=>Qr,parseDate:()=>oc,parseDateTime:()=>Da,parseNumber:()=>qo,parseRawNumberString:()=>Jc,parseTimeToDate:()=>Dr,rankAndFilterItems:()=>vn,resolveLocale:()=>Ot,sanitizeOtpString:()=>Xa,splitTagsFromText:()=>qa,toDate:()=>or,toDateTime:()=>jr,toTimeObject:()=>od,toast:()=>du,useAnimatedError:()=>dl,useCarousel:()=>Cs,useCarouselContext:()=>Xr,useCollapseContext:()=>an,useCollapsePanelContext:()=>bi,useConfirmContext:()=>rt,useDataTable:()=>ol,useDebounce:()=>Ef,useDebouncedCallback:()=>Sn,useDropdownContext:()=>lo,useFileContext:()=>Ws,useFloatingTransition:()=>ct,useInfiniteScroll:()=>$f,useModalContext:()=>tt,usePopoverContext:()=>gr,useTableStyles:()=>Vi,useTabsContext:()=>ln});module.exports=Bp(ym);var il={xs:{button:"h-6 px-2.5 text-[11px] gap-1",iconOnly:"size-6 p-0",icon:"size-3"},sm:{button:"h-8 px-3 text-xs gap-1.5",iconOnly:"size-8 p-0",icon:"size-3.5"},md:{button:"h-10 px-4 text-sm gap-2",iconOnly:"size-10 p-0",icon:"size-4"},lg:{button:"h-12 px-5 text-base gap-2.5",iconOnly:"size-12 p-0",icon:"size-5"},xl:{button:"h-14 px-6 text-lg gap-3",iconOnly:"size-14 p-0",icon:"size-6"}},al={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},sl={filled:{primary:"bg-primary-500 text-neutral-white border-transparent hover:bg-primary-600 active:bg-primary-700 focus-visible:ring-primary-700",secondary:"bg-secondary-500 text-neutral-white border-transparent hover:bg-secondary-600 active:bg-secondary-700 focus-visible:ring-secondary-700",neutral:"bg-neutral-800 text-neutral-white border-transparent hover:bg-neutral-900 active:bg-neutral-950 focus-visible:ring-neutral-700",error:"bg-error-500 text-neutral-white border-transparent hover:bg-error-600 active:bg-error-700 focus-visible:ring-error-700",success:"bg-success-500 text-neutral-white border-transparent hover:bg-success-600 active:bg-success-700 focus-visible:ring-success-700",warning:"bg-warning-500 text-neutral-white border-transparent hover:bg-warning-600 active:bg-warning-700 focus-visible:ring-warning-700",info:"bg-info-500 text-neutral-white border-transparent hover:bg-info-600 active:bg-info-700 focus-visible:ring-info-700"},soft:{primary:"bg-primary-100 text-primary-800 border-primary-200 hover:bg-primary-200 hover:text-primary-900 active:bg-primary-300 focus-visible:ring-primary-700",secondary:"bg-secondary-100 text-secondary-800 border-secondary-200 hover:bg-secondary-200 hover:text-secondary-900 active:bg-secondary-300 focus-visible:ring-secondary-700",neutral:"bg-neutral-100 text-neutral-800 border-neutral-200 hover:bg-neutral-200 hover:text-neutral-900 active:bg-neutral-300 focus-visible:ring-neutral-700",error:"bg-error-100 text-error-800 border-error-200 hover:bg-error-200 hover:text-error-900 active:bg-error-300 focus-visible:ring-error-700",success:"bg-success-100 text-success-800 border-success-200 hover:bg-success-200 hover:text-success-900 active:bg-success-300 focus-visible:ring-success-700",warning:"bg-warning-100 text-warning-800 border-warning-200 hover:bg-warning-200 hover:text-warning-900 active:bg-warning-300 focus-visible:ring-warning-700",info:"bg-info-100 text-info-800 border-info-200 hover:bg-info-200 hover:text-info-900 active:bg-info-300 focus-visible:ring-info-700"},ghost:{primary:"bg-transparent text-primary-700 border-transparent hover:bg-primary-100 hover:text-primary-900 active:bg-primary-200 focus-visible:ring-primary-700",secondary:"bg-transparent text-secondary-700 border-transparent hover:bg-secondary-100 hover:text-secondary-900 active:bg-secondary-200 focus-visible:ring-secondary-700",neutral:"bg-transparent text-neutral-700 border-transparent hover:bg-neutral-100 hover:text-neutral-900 active:bg-neutral-200 focus-visible:ring-neutral-700",error:"bg-transparent text-error-700 border-transparent hover:bg-error-100 hover:text-error-900 active:bg-error-200 focus-visible:ring-error-700",success:"bg-transparent text-success-700 border-transparent hover:bg-success-100 hover:text-success-900 active:bg-success-200 focus-visible:ring-success-700",warning:"bg-transparent text-warning-700 border-transparent hover:bg-warning-100 hover:text-warning-900 active:bg-warning-200 focus-visible:ring-warning-700",info:"bg-transparent text-info-700 border-transparent hover:bg-info-100 hover:text-info-900 active:bg-info-200 focus-visible:ring-info-700"},text:{primary:"bg-transparent text-primary-500 border-transparent px-1 hover:text-primary-600 active:text-primary-700 focus-visible:ring-primary-700",secondary:"bg-transparent text-secondary-500 border-transparent px-1 hover:text-secondary-600 active:text-secondary-700 focus-visible:ring-secondary-700",neutral:"bg-transparent text-neutral-700 border-transparent px-1 hover:text-neutral-800 active:text-neutral-900 focus-visible:ring-neutral-700",error:"bg-transparent text-error-500 border-transparent px-1 hover:text-error-600 active:text-error-700 focus-visible:ring-error-700",success:"bg-transparent text-success-500 border-transparent px-1 hover:text-success-600 active:text-success-700 focus-visible:ring-success-700",warning:"bg-transparent text-warning-500 border-transparent px-1 hover:text-warning-600 active:text-warning-700 focus-visible:ring-warning-700",info:"bg-transparent text-info-500 border-transparent px-1 hover:text-info-600 active:text-info-700 focus-visible:ring-info-700"},outline:{primary:"bg-transparent text-primary-700 border-2 border-primary-400 hover:bg-primary-50 hover:border-primary-500 hover:text-primary-900 active:bg-primary-100 focus-visible:ring-primary-700",secondary:"bg-transparent text-secondary-700 border-2 border-secondary-400 hover:bg-secondary-50 hover:border-secondary-500 hover:text-secondary-900 active:bg-secondary-100 focus-visible:ring-secondary-700",neutral:"bg-transparent text-neutral-700 border-2 border-neutral-300 hover:bg-neutral-50 hover:border-neutral-400 hover:text-neutral-900 active:bg-neutral-100 focus-visible:ring-neutral-700",error:"bg-transparent text-error-700 border-2 border-error-400 hover:bg-error-50 hover:border-error-500 hover:text-error-900 active:bg-error-100 focus-visible:ring-error-700",success:"bg-transparent text-success-700 border-2 border-success-400 hover:bg-success-50 hover:border-success-500 hover:text-success-900 active:bg-success-100 focus-visible:ring-success-700",warning:"bg-transparent text-warning-700 border-2 border-warning-400 hover:bg-warning-50 hover:border-warning-500 hover:text-warning-900 active:bg-warning-100 focus-visible:ring-warning-700",info:"bg-transparent text-info-700 border-2 border-info-400 hover:bg-info-50 hover:border-info-500 hover:text-info-900 active:bg-info-100 focus-visible:ring-info-700"}};var ll=require("@tanstack/match-sorter-utils");function C(e,t,r){return e!=null&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:t[r]}function vn(e,t,r){let o=t.trim();if(!o||!e.length)return e;let n=r?Array.isArray(r)?r:[r]:[],i=[];if(n.length>0)for(let s of n)typeof s=="function"?i.push(l=>{let f=s(l);return f!=null?String(f):""}):i.push(l=>{let f=l,u=f[s];if(u!=null)return String(u);if(f.data&&typeof f.data=="object"){let w=f.data[s];if(w!=null)return String(w)}return""});else i.push(s=>{if(s&&typeof s=="object"){let l=s;return l.label!=null?String(l.label):l.value!=null?String(l.value):""}return s!=null?String(s):""});let a=[];for(let s of e){let l=(0,ll.rankItem)(s,o,{accessors:i});l.passed&&a.push({item:s,info:l})}return a.sort((s,l)=>(0,ll.compareItems)(s.info,l.info)),a.map(s=>s.item)}var Wa=require("react/jsx-runtime");function Re({width:e=16,height:t=16,className:r="",...o}){return(0,Wa.jsxs)("svg",{width:e,height:t,className:`animate-[spin_1s_steps(8)_infinite] ${r}`,viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:[(0,Wa.jsx)("path",{d:"M0 0h25v24H0z",fill:"none"}),(0,Wa.jsx)("path",{fill:"currentColor",d:"M4.818 6.664h-.001a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.277.541h-.029zm-2.97 7.182h-.001a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.278.541h-.031h.002zM12 3.692a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.277.541zM4.818 21.029h-.001a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.276.541h-.031zM19.182 7.125a2.308 2.308 0 1 1 0-4.615a2.308 2.308 0 0 1 0 4.615M12 24a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.277.541zm10.154-9.231h-.048c-.75 0-1.428-.309-1.913-.807l-.001-.001c-.499-.503-.808-1.196-.808-1.961s.308-1.458.808-1.962a2.66 2.66 0 0 1 1.914-.808h.05h-.003h.048c.75 0 1.427.309 1.913.807l.001.001c.499.503.808 1.196.808 1.961s-.308 1.458-.808 1.962a2.66 2.66 0 0 1-1.915.809h-.049zm-2.971 7.643h-.05a3.1 3.1 0 0 1-2.236-.951l-.001-.001c-.584-.584-.945-1.391-.945-2.283s.361-1.698.945-2.283a3.1 3.1 0 0 1 2.234-.945h.054h-.003h.042c.877 0 1.67.362 2.237.944l.001.001c.588.582.952 1.39.952 2.283s-.364 1.7-.952 2.282a3.1 3.1 0 0 1-2.24.953h-.04z"})]})}var Gi=require("react/jsx-runtime");function Ir({size:e,variant:t,color:r,radius:o,leftIcon:n,rightIcon:i,isLoading:a=!1,showSpinner:s=!1,loadingText:l,isFullWidth:f=!1,disabled:u=!1,type:w="button",className:g="",children:m,ref:h,...b}){let x=C(e,il,"md"),S=t==="other"?"":C(r,C(t,sl,"filled"),"primary"),k=C(o,al,"lg"),v=["inline-flex items-center justify-center font-medium leading-none border transition-colors duration-150 cursor-pointer select-none whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:pointer-events-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 active:scale-[0.98] transition-transform",x.button,k,S,f?"w-full":"",u?"opacity-50":"",g].filter(Boolean).join(" "),p=y=>(0,Gi.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${x.icon}`,"aria-hidden":"true",children:y}),d=a&&l?l:m;return(0,Gi.jsxs)("button",{ref:h,type:w,disabled:u||a,"aria-busy":a,"aria-disabled":u||a,className:v,...b,children:[a&&s&&p((0,Gi.jsx)(Re,{})),(!a||!s)&&n&&p(n),d&&(0,Gi.jsx)("span",{className:"leading-none",children:d}),!a&&i&&p(i)]})}var cl=require("react/jsx-runtime");function vr({icon:e,size:t,variant:r,color:o,radius:n,isLoading:i=!1,showSpinner:a=!1,disabled:s=!1,type:l="button",className:f="",ref:u,...w}){let g=C(t,il,"md"),m=r==="other"?"":C(o,C(r,sl,"filled"),"primary"),h=C(n,al,"full"),b=["inline-flex items-center justify-center font-medium leading-none border transition-colors duration-150 active:scale-[0.98] transition-transform cursor-pointer select-none whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:pointer-events-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",g.iconOnly,h,m,s?"opacity-50":"",f].filter(Boolean).join(" "),x=S=>(0,cl.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${g.icon}`,"aria-hidden":"true",children:S});return(0,cl.jsx)("button",{ref:u,type:l,disabled:s||i,"aria-busy":i,"aria-disabled":s||i,className:b,...w,children:x(i&&a?(0,cl.jsx)(Re,{}):e)})}var Fd={xs:{badge:"h-5 px-2 text-[11px] gap-1",icon:"size-3",dot:"size-1.5",deleteIcon:"size-3"},sm:{badge:"h-6 px-2.5 text-xs gap-1.5",icon:"size-3.5",dot:"size-1.5",deleteIcon:"size-3.5"},md:{badge:"h-7 px-3 text-xs font-medium gap-1.5",icon:"size-3.5",dot:"w-2 h-2",deleteIcon:"size-3.5"},lg:{badge:"h-8 px-3.5 text-sm font-medium gap-2",icon:"size-4",dot:"size-2.5",deleteIcon:"size-4"},xl:{badge:"h-9 px-4 text-sm font-semibold gap-2",icon:"size-4.5",dot:"size-2.5",deleteIcon:"size-4.5"}},Ed={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},$d={primary:"bg-primary-500",secondary:"bg-secondary-500",error:"bg-error-500",success:"bg-success-500",warning:"bg-warning-500",info:"bg-info-500",neutral:"bg-neutral-500"},Ld={soft:{primary:"bg-primary-100 text-primary-800 border-primary-200 hover:bg-primary-200",secondary:"bg-secondary-100 text-secondary-800 border-secondary-200 hover:bg-secondary-200",error:"bg-error-100 text-error-800 border-error-200 hover:bg-error-200",success:"bg-success-100 text-success-800 border-success-200 hover:bg-success-200",warning:"bg-warning-100 text-warning-800 border-warning-200 hover:bg-warning-200",info:"bg-info-100 text-info-800 border-info-200 hover:bg-info-200",neutral:"bg-neutral-100 text-neutral-800 border-neutral-200 hover:bg-neutral-200"},filled:{primary:"bg-primary-500 text-neutral-white border-transparent hover:bg-primary-600 active:bg-primary-700",secondary:"bg-secondary-500 text-neutral-white border-transparent hover:bg-secondary-600 active:bg-secondary-700",error:"bg-error-500 text-neutral-white border-transparent hover:bg-error-600 active:bg-error-700",success:"bg-success-500 text-neutral-white border-transparent hover:bg-success-600 active:bg-success-700",warning:"bg-warning-500 text-neutral-950 border-transparent hover:bg-warning-600 active:bg-warning-700",info:"bg-info-500 text-neutral-white border-transparent hover:bg-info-600 active:bg-info-700",neutral:"bg-neutral-800 text-neutral-white border-transparent hover:bg-neutral-900 active:bg-neutral-950"},outline:{primary:"bg-transparent text-primary-700 border-2 border-primary-400 hover:bg-primary-50/70",secondary:"bg-transparent text-secondary-800 border-2 border-secondary-400 hover:bg-secondary-50/70",error:"bg-transparent text-error-700 border-2 border-error-400 hover:bg-error-50/70",success:"bg-transparent text-success-700 border-2 border-success-400 hover:bg-success-50/70",warning:"bg-transparent text-warning-800 border-2 border-warning-400 hover:bg-warning-50/70",info:"bg-transparent text-info-800 border-2 border-info-400 hover:bg-info-50/70",neutral:"bg-transparent text-neutral-700 border-2 border-neutral-300 hover:bg-neutral-100/70"},ghost:{primary:"bg-transparent text-primary-700 border-transparent hover:bg-primary-50",secondary:"bg-transparent text-secondary-800 border-transparent hover:bg-secondary-50",error:"bg-transparent text-error-700 border-transparent hover:bg-error-50",success:"bg-transparent text-success-700 border-transparent hover:bg-success-50",warning:"bg-transparent text-warning-800 border-transparent hover:bg-warning-50",info:"bg-transparent text-info-800 border-transparent hover:bg-info-50",neutral:"bg-transparent text-neutral-700 border-transparent hover:bg-neutral-50"}};var Xc=require("react/jsx-runtime");function Ue({width:e=14,height:t=14,className:r="",...o}){return(0,Xc.jsx)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:(0,Xc.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})})}var yn=require("react/jsx-runtime");function yr({size:e="md",variant:t="soft",color:r="primary",radius:o="full",dot:n=!1,dotPing:i=!1,leftIcon:a,rightIcon:s,onDelete:l,deleteAriaLabel:f="Remove",className:u="",children:w,onClick:g,ref:m,...h}){let b=C(e,Fd,"md"),x=t==="other"?"":C(r,C(t,Ld,"soft"),"primary"),S=C(r,$d,"primary"),k=C(o,Ed,"full"),v=["inline-flex items-center justify-center font-medium leading-none border transition-colors duration-150 whitespace-nowrap",b.badge,k,x,g?"cursor-pointer select-none active:scale-[0.98] transition-transform duration-100":"",u].filter(Boolean).join(" "),p=d=>(0,yn.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${b.icon}`,"aria-hidden":"true",children:d});return(0,yn.jsxs)("span",{ref:m,role:g?"button":void 0,tabIndex:g?0:void 0,className:v,onClick:g,...h,children:[n&&(0,yn.jsx)("span",{className:`relative inline-block shrink-0 rounded-full ${i?"animate-pulse":""} ${b.dot} ${S}`,"aria-hidden":"true"}),a&&p(a),w&&(0,yn.jsx)("span",{className:"leading-none",children:w}),s&&!l&&p(s),l&&(0,yn.jsx)("button",{type:"button",onClick:d=>{d.stopPropagation(),l()},"aria-label":f,className:`inline-flex items-center justify-center shrink-0 rounded-full hover:bg-black/10 active:bg-black/20 transition-colors p-0.5 -mr-0.5 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current ${b.deleteIcon}`,children:(0,yn.jsx)(Ue,{className:"size-full"})})]})}var Ki=require("react"),Od=require("@floating-ui/react");var ul={xs:{wrapper:"h-6 text-[11px]",input:"px-2 py-0.5 text-[11px] leading-tight",icon:"size-3",iconPaddingLeft:"pl-6",iconPaddingRight:"pr-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{wrapper:"h-8 text-xs",input:"px-2.5 py-1 text-xs leading-normal",icon:"size-3.5",iconPaddingLeft:"pl-7.5",iconPaddingRight:"pr-7.5",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{wrapper:"h-10 text-sm",input:"px-3.5 py-2 text-sm leading-normal",icon:"size-[18px]",iconPaddingLeft:"pl-9",iconPaddingRight:"pr-9",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{wrapper:"h-12 text-base",input:"px-4 py-2.5 text-base leading-normal",icon:"size-5",iconPaddingLeft:"pl-11",iconPaddingRight:"pr-11",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{wrapper:"h-14 text-lg",input:"px-5 py-3 text-lg leading-normal",icon:"size-6",iconPaddingLeft:"pl-13",iconPaddingRight:"pr-13",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},ji={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Bd={none:"none",sm:"sm",md:"md",lg:"lg",xl:"xl",full:"full"},Hd={xs:{wrapper:"min-h-6 text-[11px] px-1.5 py-0.5",input:"text-[11px] leading-tight min-w-[50px]",gap:"gap-1",badgeSize:"xs",icon:"size-3",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{wrapper:"min-h-8 text-xs px-2 py-1",input:"text-xs leading-normal min-w-[60px]",gap:"gap-1",badgeSize:"xs",icon:"size-3.5",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{wrapper:"min-h-10 text-sm px-2.5 py-1.5",input:"text-sm leading-normal min-w-[70px]",gap:"gap-1.5",badgeSize:"sm",icon:"size-[18px]",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{wrapper:"min-h-12 text-base px-3 py-2",input:"text-base leading-normal min-w-[80px]",gap:"gap-1.5",badgeSize:"md",icon:"size-5",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{wrapper:"min-h-14 text-lg px-3.5 py-2.5",input:"text-lg leading-normal min-w-[90px]",gap:"gap-2",badgeSize:"lg",icon:"size-6",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},Ui={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"}};var Vd={xs:{slot:"size-6 min-w-6",text:"text-xs",gap:"gap-1",label:"text-[11px] mb-1",helper:"text-[9px] mt-0.5"},sm:{slot:"size-8 min-w-8",text:"text-sm",gap:"gap-1.5",label:"text-xs mb-1",helper:"text-[10px] mt-0.5"},md:{slot:"size-10 min-w-10",text:"text-base font-semibold",gap:"gap-2",label:"text-sm mb-1.5",helper:"text-[11px] mt-1"},lg:{slot:"size-12 min-w-12",text:"text-lg font-semibold",gap:"gap-2.5",label:"text-base mb-1.5",helper:"text-xs mt-1"},xl:{slot:"size-14 min-w-14",text:"text-xl font-bold",gap:"gap-3",label:"text-lg mb-2",helper:"text-sm mt-1"}};var Yi=require("react");function dl(e,t={}){let{exitDuration:r=250}=t,[o,n]=(0,Yi.useState)(e),[i,a]=(0,Yi.useState)(!1),[s,l]=(0,Yi.useState)(e);return e!==s&&(l(e),e?(n(e),a(!1)):a(!0)),(0,Yi.useEffect)(()=>{if(!i)return;let f=setTimeout(()=>{n(void 0),a(!1)},r);return()=>clearTimeout(f)},[r,i]),{displayedError:o,isExiting:i}}var fl=require("react/jsx-runtime");function Ae({id:e,helperText:t,errorMessage:r,sizeClassName:o="text-xs",className:n=""}){let{displayedError:i,isExiting:a}=dl(r),s=i||t,l=!!(i||t),f=!!i;return(0,fl.jsx)("div",{className:`grid transition-[grid-template-rows,opacity,margin] duration-200 ease-out overflow-hidden ${l?"grid-rows-[1fr] opacity-100 mt-1":"grid-rows-[0fr] opacity-0 mt-0 pointer-events-none"}`,"aria-live":"polite",children:(0,fl.jsx)("div",{className:"overflow-hidden",children:(0,fl.jsx)("div",{id:e,role:f?"alert":"status",className:`leading-tight transition-colors duration-200 font-normal ${o} ${f?a?"text-error-600 animate-error-out":"text-error-600 animate-error-in":"text-neutral-500"} ${n}`,children:s||"\xA0"})})})}var Wi=require("react/jsx-runtime"),qc={primary:"text-primary-500 group-focus-within/field:text-primary-600",secondary:"text-secondary-500 group-focus-within/field:text-secondary-600",error:"text-error-500 group-focus-within/field:text-error-600",success:"text-success-500 group-focus-within/field:text-success-600",warning:"text-warning-500 group-focus-within/field:text-warning-600",info:"text-info-500 group-focus-within/field:text-info-600",neutral:"text-neutral-500 group-focus-within/field:text-neutral-600"},Ad={xs:{label:"text-[11px] mb-1",floatingLabel:"text-[10px]"},sm:{label:"text-xs mb-1",floatingLabel:"text-[10px]"},md:{label:"text-sm mb-1.5",floatingLabel:"text-[11px]"},lg:{label:"text-base mb-1.5",floatingLabel:"text-xs"},xl:{label:"text-lg mb-2",floatingLabel:"text-xs"}};function Pt({label:e,children:t,htmlFor:r,id:o,isRequired:n=!1,isFloating:i,placement:a,size:s="md",sizeClassName:l,color:f="primary",hasError:u=!1,isInvalid:w=!1,cursor:g,className:m="",colorConfig:h=qc}){let b=e??t;if(!b)return null;let x=i??a==="floating",S=!!(u||w),k=S?"error":f,v=S?"text-error-600 font-bold":h[k]||qc[k]||qc.primary,p=Ad[s]||Ad.md,d=l||(x?p.floatingLabel:p.label),y=g?`cursor-${g}`:x?"cursor-text":"";return x?(0,Wi.jsxs)("label",{htmlFor:r,id:o,className:`absolute top-0 -translate-y-1/2 left-3 px-1.5 rounded-sm select-none z-10 font-bold bg-neutral-white transition-colors duration-150 ${y} ${d} ${v} ${m}`,children:[b,n&&(0,Wi.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):(0,Wi.jsxs)("label",{htmlFor:r,id:o,className:`inline-flex items-center font-bold transition-colors duration-150 ${y} ${d} ${v} ${m}`,children:[b,n&&(0,Wi.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})}var Jt=require("react/jsx-runtime");function ar({size:e,variant:t,color:r,radius:o,label:n,labelPlacement:i="floating",config:a,helperText:s,errorMessage:l,leftIcon:f,leftAddon:u,rightIcon:w,rightAddon:g,onClear:m,wrapperClassName:h="",inputWrapperClassName:b="",labelClassName:x="",helperClassName:S="",id:k,value:v,defaultValue:p,onChange:d,disabled:y=!1,readOnly:c=!1,className:T="",type:R="text",placeholder:N,ref:D,...M}){let{isRequired:F=!1,isInvalid:P=!1,isLoading:I=!1,showSpinner:z=!1,isClearable:B=!1,isFullWidth:V=!0}=a??{},Y=(0,Ki.useId)(),L=k||Y,E=`${L}-error-helper`,O=(0,Ki.useRef)(null),A=(0,Od.useMergeRefs)([O,D]),U=v!==void 0,[G,K]=(0,Ki.useState)(p),q=U?v:G,X=J=>{U||K(J.target.value),d?.(J)},fe=()=>{U||K(""),m?.()},ae=q!=null?String(q).length>0:!1,_=!!(P||l),Z=_?"error":r,he=C(e,ul,"md"),xe=C(o,ji,"md"),$=t==="other"?"":C(Z,C(t,Ui,"outline"),"primary"),re=J=>(0,Jt.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${he.icon}`,"aria-hidden":"true",children:J}),ee=i==="floating",de=ee&&!!n,ne=()=>(0,Jt.jsx)(Pt,{htmlFor:L,label:n,isRequired:F,isFloating:ee,size:e,color:Z,hasError:_,className:x}),ze=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2",he.wrapper,xe,$,y?"opacity-50":"",V?"w-full":"w-auto",b].filter(Boolean).join(" "),ve=["w-full h-full bg-transparent outline-none border-none text-neutral-900 placeholder:text-neutral-400 disabled:cursor-not-allowed",he.input,f?"pl-1.5":"",w||B||I?"pr-1.5":"",T].filter(Boolean).join(" ");return(0,Jt.jsxs)("div",{className:`group/field relative flex ${i==="left"?"flex-row items-center gap-3":"flex-col"} ${de?"pt-2":""} ${V?"w-full":"inline-flex"} ${h}`,children:[!ee&&ne(),(0,Jt.jsxs)("div",{className:`flex flex-col ${V?"w-full":""}`,children:[(0,Jt.jsxs)("div",{className:"flex items-stretch",children:[u&&(0,Jt.jsx)("div",{className:`inline-flex items-center px-3 text-neutral-600 bg-neutral-100 border border-r-0 border-neutral-300 text-sm font-medium ${xe?`${xe} rounded-r-none`:""}`,children:u}),(0,Jt.jsxs)("div",{className:`${ze} ${u?"rounded-l-none!":""} ${g?"rounded-r-none!":""}`,children:[ee&&ne(),f&&(0,Jt.jsx)("div",{className:"flex items-center justify-center pl-3 shrink-0",children:re(f)}),(0,Jt.jsx)("input",{ref:A,id:L,type:R,value:q,onChange:X,disabled:y||I,readOnly:c,"aria-invalid":_,"aria-required":F,"aria-describedby":l||s?E:void 0,"aria-errormessage":l?E:void 0,"aria-busy":I,"aria-disabled":y||I,placeholder:N,className:ve,...M}),I&&z&&(0,Jt.jsx)("div",{className:"flex items-center justify-center pr-3 shrink-0",children:re((0,Jt.jsx)(Re,{}))}),!I&&B&&!y&&!c&&(0,Jt.jsx)("button",{type:"button",onClick:fe,"aria-label":"X\xF3a n\u1ED9i dung",tabIndex:ae?0:-1,"aria-hidden":!ae,className:`inline-flex items-center justify-center mr-2 shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${he.icon} ${ae?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,Jt.jsx)(Ue,{className:"size-full"})}),!I&&w&&(0,Jt.jsx)("div",{className:"flex items-center justify-center pr-3 shrink-0",children:re(w)})]}),g&&(0,Jt.jsx)("div",{className:`inline-flex items-center px-3 text-neutral-600 bg-neutral-100 border border-l-0 border-neutral-300 text-sm font-medium ${xe?`${xe} rounded-l-none`:""}`,children:g})]}),(0,Jt.jsx)(Ae,{id:E,helperText:s,errorMessage:l,sizeClassName:he.helper,className:S})]})]})}var jd=require("react");var Co=require("react/jsx-runtime");function Zc({width:e=16,height:t=16,className:r="",...o}){return(0,Co.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[(0,Co.jsx)("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),(0,Co.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}function Gd({width:e=16,height:t=16,className:r="",...o}){return(0,Co.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[(0,Co.jsx)("path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24"}),(0,Co.jsx)("path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"}),(0,Co.jsx)("path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61"}),(0,Co.jsx)("line",{x1:"2",x2:"22",y1:"2",y2:"22"})]})}var _o=Zc;var Ka=require("react/jsx-runtime");function pl({defaultVisible:e=!1,toggleAriaLabel:t="Hi\u1EC3n th\u1ECB/\u1EA9n m\u1EADt kh\u1EA9u",onVisibilityChange:r,rightIcon:o,disabled:n,readOnly:i,...a}){let[s,l]=(0,jd.useState)(e);return(0,Ka.jsx)(ar,{type:s?"text":"password",disabled:n,readOnly:i,rightIcon:o||(0,Ka.jsx)("button",{type:"button",onClick:()=>{if(n||i)return;let w=!s;l(w),r?.(w)},disabled:n||i,"aria-label":t,className:"inline-flex items-center justify-center size-full p-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-colors cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded",children:s?(0,Ka.jsx)(Gd,{className:"size-full"}):(0,Ka.jsx)(Zc,{className:"size-full"})}),...a})}var Ud=require("react");function Xo(e,t){if(e==null||e==="")return"";let r=t?.thousandSeparator??".",o=t?.decimalSeparator??",",n=t?.maxDecimalDigits??0,i=t?.min,a=t?.max,s=t?.clampMin??!1,l=t?.allowNegative??(i===void 0||i<0),f=String(e).trim();if(!f)return"";let u=l&&f.startsWith("-");if(u&&f==="-")return"-";if(n>0&&f.includes(o)){let x=f.split(o),S=x[0]?.replace(/\D/g,"")??"",k=x.slice(1).join("").replace(/\D/g,"").slice(0,n);if(S||k){let d=parseFloat(`${S||"0"}.${k||"0"}`);if(u&&(d=-d),a!==void 0&&!isNaN(d)&&d>a)return Xo(a,{...t,max:void 0,min:void 0});if(i!==void 0&&!isNaN(d)&&d<i&&(s||u&&i<0))return Xo(i,{...t,max:void 0,min:void 0})}let v=S?parseInt(S,10).toString().replace(/\B(?=(\d{3})+(?!\d))/g,r):"",p=u?"-":"";return x.length>1&&x[1]===""&&k===""?`${p}${v||"0"}${o}`:k.length>0?`${p}${v||"0"}${o}${k}`:`${p}${v}`}let w=f.replace(/\D/g,"");if(!w)return u?"-":"";let g=parseInt(w,10);if(isNaN(g))return"";u&&(g=-g),a!==void 0&&g>a&&(g=a),i!==void 0&&g<i&&(s||u&&i<0)&&(g=i);let m=g<0?"-":"",h=Math.abs(g).toString().replace(/\B(?=(\d{3})+(?!\d))/g,r);return`${m}${h}`}function Jc(e,t){let r=t?.thousandSeparator??".";return e.split(r).join("")}function qo(e,t){if(!e)return;let r=t?.thousandSeparator??".",o=t?.decimalSeparator??",",n=e.split(r).join("");if(o!=="."&&(n=n.split(o).join(".")),n=n.replace(/[^\d.-]/g,""),!n||n==="."||n==="-")return;let i=parseFloat(n);return isNaN(i)?void 0:i}function Qc(e,t,r,o){let n=o?.decimalSeparator??",",i=0;for(let l=0;l<r&&l<e.length;l++){let f=e.charAt(l);(/\d/.test(f)||f===n||f==="-")&&i++}if(i===0)return 0;let a=t.length,s=0;for(let l=0;l<t.length;l++){let f=t.charAt(l);if((/\d/.test(f)||f===n||f==="-")&&s++,s===i){a=l+1;break}}return Math.min(a,t.length)}function _a(e,t="numeric"){return t==="numeric"?/^\d$/.test(e):t==="alphanumeric"?/^[a-zA-Z0-9]$/.test(e):!0}function Xa(e,t="numeric"){return t==="numeric"?e.replace(/\D/g,""):t==="alphanumeric"?e.replace(/[^a-zA-Z0-9]/g,""):e}function qa(e,t=/[\r\n,;\t]+/,r=!0){return e?e.split(t).map(o=>r?o.trim():o).filter(Boolean):[]}var Yd=require("react/jsx-runtime");function wn({value:e,defaultValue:t,min:r,max:o,thousandSeparator:n=".",decimalSeparator:i=",",maxDecimalDigits:a=0,allowNegative:s,onChange:l,onClear:f,onBlur:u,ref:w,...g}){let m={max:o,min:r,thousandSeparator:n,decimalSeparator:i,maxDecimalDigits:a,allowNegative:s},h=e!==void 0,[b,x]=(0,Ud.useState)(t),S=h?e:b,k=Xo(S,m),v=()=>{h||x(""),f?.()},p=y=>{let c=y.target,T=c.value,R=c.selectionStart||0,N=Xo(T,m),D=Qc(T,N,R,{decimalSeparator:i});if(h||x(N),c.value=N,l){let M={...y,target:c,currentTarget:c};l(M)}requestAnimationFrame(()=>{c&&c.setSelectionRange&&c.setSelectionRange(D,D)})},d=y=>{if(r!==void 0&&S!==void 0&&S!==null&&S!==""){let c=qo(String(S),{thousandSeparator:n,decimalSeparator:i});if(c!==void 0&&c<r){let T=Xo(r,{...m,clampMin:!0});if(h||x(T),l){y.target.value=T;let R={...y,target:y.target,currentTarget:y.target};l(R)}}}u?.(y)};return(0,Yd.jsx)(ar,{ref:w,type:"text",inputMode:a>0?"decimal":"numeric",value:k,onChange:p,onBlur:d,onClear:v,...g})}var So=require("react");var wr=require("react/jsx-runtime");function ml({ref:e,config:t,id:r,name:o,length:n=6,value:i,defaultValue:a="",onChange:s,onComplete:l,type:f="numeric",mask:u=!1,size:w="md",variant:g="outline",color:m="primary",radius:h,autoFocus:b=!1,disabled:x=!1,readOnly:S=!1,groupSize:k,separator:v="-",ariaLabel:p="One-time password",getSlotAriaLabel:d,allowOneTimeCode:y=!0,label:c,labelPlacement:T="top",helperText:R,errorMessage:N,className:D="",slotClassName:M="",wrapperClassName:F="",labelClassName:P="",helperClassName:I=""}){let{isRequired:z=!1,isInvalid:B=!1,isLoading:V=!1,showSpinner:Y=!1}=t??{},L=(0,So.useId)(),E=r||L,O=`${E}-slot-0`,A=`${E}-error-helper`,[U,G]=(0,So.useState)(()=>{let J=(i!==void 0?i:a).split("");return Array.from({length:n},(j,oe)=>J[oe]||"")}),K=(0,So.useRef)([]),q=i!==void 0,X=q?Array.from({length:n},(J,j)=>i&&i[j]!==void 0?i[j]:""):U,fe=!!(B||N),ae=fe?"error":m;(0,So.useEffect)(()=>{if(b&&!x&&!S){let J=X.findIndex(oe=>!oe),j=J!==-1?J:0;K.current[j]?.focus()}},[b,X,x,S]),(0,So.useImperativeHandle)(e,()=>({getValue:()=>X.join(""),clear:()=>{let J=Array(n).fill("");q||G(J),s?.(""),!x&&!S&&K.current[0]?.focus()},focus:(J=0)=>{let j=Math.max(0,Math.min(J,n-1));K.current[j]?.focus()}}),[X,n,q,s,x,S]);let _=J=>{q||G(J);let j=J.join("");s?.(j),J.every(oe=>oe.length>0)&&J.length===n&&l?.(j)},Z=(J,j)=>{let oe=Xa(J,f);if(!oe)return;let ye=[...X],ue=oe.length>=n?0:j,ce=oe.slice(0,n-ue).split("");ce.forEach((Te,pe)=>{ue+pe<n&&(ye[ue+pe]=Te)}),_(ye);let ke=Math.min(ue+ce.length,n-1);K.current[ke]?.focus()},he=(J,j)=>{if(x||S||V)return;let oe=J.target.value;if(!oe){let ue=[...X];ue[j]="",_(ue);return}if(oe.length>1){Z(oe,j);return}let ye=oe.slice(-1);if(_a(ye,f)){let ue=[...X];ue[j]=ye,_(ue),j<n-1&&K.current[j+1]?.focus()}},xe=(J,j)=>{if(!(x||S||V)){if(J.key==="Backspace"){J.preventDefault();let oe=[...X];X[j]?(oe[j]="",_(oe)):j>0&&(oe[j-1]="",_(oe),K.current[j-1]?.focus())}else if(J.key==="Delete"){J.preventDefault();let oe=[...X];oe[j]="",_(oe)}else if(J.key==="ArrowLeft")J.preventDefault(),j>0&&K.current[j-1]?.focus();else if(J.key==="ArrowRight")J.preventDefault(),j<n-1&&K.current[j+1]?.focus();else if((J.ctrlKey||J.metaKey)&&J.key.toLowerCase()==="c"){let oe=X.join("");oe&&navigator.clipboard?.writeText(oe)}else if((J.ctrlKey||J.metaKey)&&J.key.toLowerCase()==="x"){J.preventDefault();let oe=X.join("");oe&&navigator.clipboard?.writeText(oe);let ye=Array(n).fill("");_(ye),K.current[0]?.focus()}}},$=(J,j)=>{if(x||S||V)return;J.preventDefault();let oe=J.clipboardData.getData("text/plain");Z(oe,j)},re=C(w,Vd,"md"),ee=C(w,ul,"md"),de=C(h,ji,"md"),ne=g==="other"?"":C(ae,C(g,Ui,"outline"),"primary"),ze=x?"opacity-50":"",ve=()=>c?(0,wr.jsxs)("label",{htmlFor:O,className:`block font-medium text-neutral-700 select-none ${re.label} ${P}`,children:[c,z&&(0,wr.jsx)("span",{className:"text-error-500 ml-0.5",children:"*"})]}):null;return(0,wr.jsxs)("div",{className:`group/otp flex ${T==="left"?"flex-row items-start gap-3":"flex-col"} ${F}`,children:[ve(),(0,wr.jsxs)("div",{className:"flex flex-col",children:[(0,wr.jsxs)("div",{role:"group","aria-label":p,"aria-describedby":N||R?A:void 0,className:`inline-flex items-center ${re.gap} ${D}`,children:[Array.from({length:n}).map((J,j)=>{let oe=!!(u||f==="password"),ye=d?d(j,n):`K\xFD t\u1EF1 ${j+1} tr\xEAn ${n}`,ue=!!(k&&k>0)&&(j+1)%(k||1)===0&&j<n-1;return(0,wr.jsxs)("div",{className:"inline-flex items-center gap-1.5",children:[(0,wr.jsx)("input",{id:`${E}-slot-${j}`,ref:ce=>{K.current[j]=ce},type:oe?"password":"text",inputMode:f==="numeric"?"numeric":"text",pattern:f==="numeric"?"[0-9]*":void 0,maxLength:1,value:X[j]||"",onFocus:ce=>ce.target.select(),onChange:ce=>he(ce,j),onKeyDown:ce=>xe(ce,j),onPaste:ce=>$(ce,j),disabled:x||V,readOnly:S,"aria-label":ye,"aria-invalid":fe,"aria-required":z,"aria-busy":V,"aria-disabled":x||V,autoComplete:y?"one-time-code":"off",autoCorrect:"off",autoCapitalize:"none",spellCheck:!1,"data-1p-ignore":"true","data-lpignore":"true","data-form-type":"other",className:`border-2 text-center p-0 outline-none transition-all duration-150 ease-in-out text-neutral-900 ${re.slot} ${re.text} ${de} ${ne} ${ze} ${M}`}),ue&&(0,wr.jsx)("span",{"aria-hidden":"true",className:"inline-flex items-center justify-center text-neutral-400 select-none font-bold shrink-0",children:v})]},`${E}-slot-${j}`)}),V&&Y&&(0,wr.jsx)("div",{role:"status","aria-label":"\u0110ang t\u1EA3i",className:"inline-flex items-center justify-center pl-1.5 shrink-0 text-neutral-400",children:(0,wr.jsx)(Re,{className:`animate-spin ${ee.icon}`})})]}),(0,wr.jsx)(Ae,{id:A,helperText:R,errorMessage:N,sizeClassName:re.helper,className:I}),o&&(0,wr.jsx)("input",{type:"hidden",name:o,value:X.join(""),disabled:x||V})]})]})}var Cn=require("react"),Wd=require("@floating-ui/react");var Za=require("react/jsx-runtime");function no({width:e=14,height:t=14,className:r="",...o}){return(0,Za.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[(0,Za.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,Za.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}var Qe=require("react/jsx-runtime");function gl({size:e,variant:t,color:r,radius:o,label:n,labelPlacement:i="floating",config:a,helperText:s,errorMessage:l,leftIcon:f,leftAddon:u,rightIcon:w,rightAddon:g,onClear:m,wrapperClassName:h="",inputWrapperClassName:b="",labelClassName:x="",helperClassName:S="",id:k,name:v,value:p,defaultValue:d=[],onChange:y,inputValue:c,onInputValueChange:T,delimiters:R=["Enter"],showAddButton:N=!1,renderAddButton:D,addOnBlur:M=!1,addOnPaste:F=!0,pasteSplitRegex:P=/[\r\n,;\t]+/,trimValues:I=!0,allowDuplicates:z=!1,onDuplicate:B,maxTags:V,onMaxTagsReached:Y,maxTagLength:L,validateTag:E,onValidateError:O,maxTagCount:A,renderTag:U,tagVariant:G,tagColor:K,tagRadius:q,tagSize:X,tagClassName:fe="",addButtonClassName:ae="",disabled:_=!1,readOnly:Z=!1,className:he="",placeholder:xe="Nh\u1EADp v\xE0 nh\u1EA5n Enter...",autoFocus:$=!1,ref:re}){let{isRequired:ee=!1,isInvalid:de=!1,isLoading:ne=!1,showSpinner:ze=!1,isClearable:ve=!1,isFullWidth:Ce=!0}=a??{},J=(0,Cn.useId)(),j=k||J,oe=`${j}-error-helper`,ye=n?`${j}-label`:void 0,ue=(0,Cn.useRef)(null),ce=(0,Wd.useMergeRefs)([ue,re]),ke=p!==void 0,[Te,pe]=(0,Cn.useState)(d),W=ke?p||[]:Te,me=c!==void 0,[De,ie]=(0,Cn.useState)(""),H=me?c||"":De,[se,Ie]=(0,Cn.useState)(""),je=be=>{me||ie(be),T?.(be)},le=be=>{ke||pe(be),y?.(be)},ge=be=>{if(_||Z||ne)return!1;let Se=I?be.trim():be;if(!Se)return!1;if(L&&L>0&&Se.length>L&&(Se=Se.slice(0,L)),V!==void 0&&W.length>=V)return Y?.(Se),Ie(`Maximum limit of ${V} tags reached`),!1;if(!z&&W.includes(Se))return B?.(Se),Ie(`Tag "${Se}" already exists`),!1;if(E){let lt=E(Se);if(lt===!1||typeof lt=="string")return O?.(Se,typeof lt=="string"?lt:void 0),Ie(`Tag "${Se}" is invalid`),!1}let it=[...W,Se];return le(it),je(""),Ie(`Added tag "${Se}"`),!0},Ee=be=>{if(_||Z||ne)return;let Se=[...W],it=new Set(W),lt=0;for(let te of be){let Q=I?te.trim():te;if(Q){if(L&&L>0&&Q.length>L&&(Q=Q.slice(0,L)),V!==void 0&&Se.length>=V){Y?.(Q);break}if(!z&&it.has(Q)){B?.(Q);continue}if(E){let _e=E(Q);if(_e===!1||typeof _e=="string"){O?.(Q,typeof _e=="string"?_e:void 0);continue}}Se.push(Q),it.add(Q),lt++}}le(Se),je(""),lt>0&&Ie(`Added ${lt} tags`)},He=be=>{if(_||Z||ne)return;let Se=W[be],it=W.filter((lt,te)=>te!==be);le(it),Se&&Ie(`Removed tag "${Se}"`)},Oe=be=>{be?.stopPropagation(),!(_||Z||ne)&&(le([]),je(""),Ie("Removed all tags"),m?.(),ue.current?.focus())},Ve=be=>{if(_||Z||ne)return;R.includes(be.key)||R.includes("Enter")&&be.key==="Enter"||R.includes("Comma")&&(be.key===","||be.key==="Comma")||R.includes("Tab")&&be.key==="Tab"||R.includes("Space")&&(be.key===" "||be.key==="Space")?H&&(be.preventDefault(),ge(H)):be.key==="Backspace"&&H===""&&W.length>0&&(be.preventDefault(),He(W.length-1))},Ke=be=>{if(!(_||Z||ne)&&F){let Se=be.clipboardData.getData("text");if(Se){let it=qa(Se,P,I);(it.length>1||P.test(Se))&&(be.preventDefault(),Ee(it))}}},Ct=()=>{M&&H.trim()&&ge(H)},Ne=W.length>0||H.length>0,Je=!!(de||l),ot=Je?"error":r,bt=C(e,Hd,"md"),dt=C(o,ji,"md"),Bt=q||C(o,Bd,"md"),$e=X||bt.badgeSize||"sm",Ht=K||r,Rt=G||t,Nt=t==="other"?"":C(ot,C(t,Ui,"outline"),"primary"),st=i==="floating",tr=st&&!!n,We=be=>(0,Qe.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${bt.icon}`,"aria-hidden":"true",children:be}),St=()=>(0,Qe.jsx)(Pt,{id:ye,htmlFor:j,label:n,isRequired:ee,isFloating:st,size:e,color:ot,hasError:Je,className:x}),we=A&&A>0?W.slice(0,A):W,Xe=A&&A>0?Math.max(0,W.length-A):0,Vt=_?"opacity-50 cursor-not-allowed pointer-events-none":"cursor-text",qe=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2",bt.wrapper,dt,Nt,Vt,Ce?"w-full":"w-auto min-w-[200px]",b].filter(Boolean).join(" "),rr=i==="left",ir=V===void 0||W.length<V,Me=N&&!_&&!Z;return(0,Qe.jsxs)("div",{role:"group","aria-labelledby":ye,className:`group/field relative flex ${rr?"flex-row items-center gap-3":"flex-col"} ${tr?"pt-2":""} ${Ce?"w-full":"inline-flex"} ${h}`,children:[(0,Qe.jsx)("span",{className:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true",children:se}),!st&&St(),(0,Qe.jsxs)("div",{className:`flex flex-col ${Ce?"w-full":""}`,children:[(0,Qe.jsxs)("div",{className:"flex items-stretch",children:[u&&(0,Qe.jsx)("div",{className:`inline-flex items-center px-3 text-neutral-600 bg-neutral-100 border border-r-0 border-neutral-300 text-sm font-medium ${dt?`${dt} rounded-r-none`:""}`,children:u}),(0,Qe.jsxs)("div",{className:`${qe} ${u?"rounded-l-none!":""} ${g?"rounded-r-none!":""}`,children:[st&&St(),f&&(0,Qe.jsx)("div",{className:"flex items-center justify-center pl-1 pr-1.5 shrink-0",children:We(f)}),(0,Qe.jsxs)("div",{className:`flex flex-wrap items-center flex-1 min-w-0 ${bt.gap}`,children:[(()=>{let be=new Map;return we.map((Se,it)=>{let lt=(be.get(Se)??0)+1;be.set(Se,lt);let te=`${Se}_${lt}`;return U?(0,Qe.jsx)("span",{className:"inline-flex shrink-0",children:U({value:Se,index:it,onRemove:()=>He(it),disabled:_,readOnly:Z})},te):(0,Qe.jsx)("span",{className:"inline-flex shrink-0",children:(0,Qe.jsx)(yr,{size:$e,variant:Rt,color:Ht,radius:Bt,deleteAriaLabel:`Remove tag ${Se}`,onDelete:!_&&!Z?()=>He(it):void 0,className:`shrink-0 max-w-full truncate select-none ${fe}`,children:Se})},te)})})(),Xe>0&&(0,Qe.jsx)("span",{className:"inline-flex shrink-0",children:(0,Qe.jsxs)(yr,{size:$e,variant:"filled",color:"neutral",radius:Bt,className:"shrink-0 font-medium select-none",children:["+",Xe]})}),ir?(0,Qe.jsx)("input",{ref:ce,id:j,type:"text",value:H,onChange:be=>je(be.target.value),onKeyDown:Ve,onPaste:Ke,onBlur:Ct,disabled:_||ne,readOnly:Z,autoFocus:$,"aria-invalid":Je,"aria-required":ee,"aria-describedby":l||s?oe:void 0,"aria-errormessage":l?oe:void 0,"aria-busy":ne,"aria-disabled":_||ne,"aria-autocomplete":"none",placeholder:W.length===0?xe:"",className:`flex-1 bg-transparent outline-none border-none text-neutral-900 placeholder:text-neutral-400 disabled:cursor-not-allowed ${bt.input} ${he}`}):null]}),Me&&(0,Qe.jsx)("div",{className:"flex items-center justify-center pl-1.5 shrink-0",children:D?D({onAdd:()=>ge(H),disabled:!H.trim()||!ir}):(0,Qe.jsx)("button",{type:"button",onClick:be=>{be.stopPropagation(),H.trim()&&ir?ge(H):ue.current?.focus()},disabled:!H.trim()||!ir,"aria-label":"Th\xEAm th\u1EBB",className:`inline-flex items-center justify-center p-1 rounded hover:bg-neutral-200 active:scale-95 disabled:opacity-40 disabled:pointer-events-none transition-all cursor-pointer text-neutral-600 hover:text-neutral-900 ${ae}`,children:(0,Qe.jsx)(no,{className:bt.icon})})}),ne&&ze&&(0,Qe.jsx)("div",{className:"flex items-center justify-center pl-1.5 shrink-0",role:"status","aria-label":"\u0110ang t\u1EA3i",children:We((0,Qe.jsx)(Re,{}))}),!ne&&ve&&!_&&!Z&&(0,Qe.jsx)("button",{type:"button",onClick:Oe,"aria-label":"X\xF3a t\u1EA5t c\u1EA3 c\xE1c th\u1EBB",tabIndex:Ne?0:-1,"aria-hidden":!Ne,className:`inline-flex items-center justify-center pl-1.5 shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${bt.icon} ${Ne?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,Qe.jsx)(Ue,{className:"size-full"})}),!ne&&w&&(0,Qe.jsx)("div",{className:"flex items-center justify-center pl-1.5 shrink-0",children:We(w)})]}),g&&(0,Qe.jsx)("div",{className:`inline-flex items-center px-3 text-neutral-600 bg-neutral-100 border border-l-0 border-neutral-300 text-sm font-medium ${dt?`${dt} rounded-l-none`:""}`,children:g})]}),(0,Qe.jsx)(Ae,{id:oe,helperText:s,errorMessage:l,sizeClassName:bt.helper,className:S}),v&&(()=>{let be=new Map;return(0,Qe.jsxs)(Qe.Fragment,{children:[W.map(Se=>{let it=(be.get(Se)??0)+1;be.set(Se,it);let lt=`${Se}_${it}`;return(0,Qe.jsx)("input",{type:"hidden",name:`${v}[]`,value:Se,disabled:_||ne},`hidden_${lt}`)}),W.length===0&&(0,Qe.jsx)("input",{type:"hidden",name:v,value:"",disabled:_||ne})]})})()]})]})}var _i=require("react"),Zd=Ko(require("react-textarea-autosize"),1),Jd=require("@floating-ui/react");var Kd={xs:{textarea:"text-[11px] px-2 py-1 leading-tight",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{textarea:"text-xs px-2.5 py-1.5 leading-normal",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{textarea:"text-sm px-3.5 py-2 leading-normal",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{textarea:"text-base px-4 py-2.5 leading-normal",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{textarea:"text-lg px-5 py-3 leading-normal",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},_d={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Xd={none:"resize-none",vertical:"resize-y",horizontal:"resize-x",both:"resize"},qd={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-error-50/60 border border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-50/60 border border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},ghost:{primary:"bg-transparent border border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-transparent border border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-transparent border border-transparent hover:bg-neutral-100/50 focus-within:bg-neutral-100/50 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"}};var Cr=require("react/jsx-runtime");function bl({size:e,variant:t,color:r,radius:o,label:n,labelPlacement:i="floating",config:a,helperText:s,errorMessage:l,onClear:f,minRows:u=3,maxRows:w,onHeightChange:g,cacheMeasurements:m,resize:h="none",wrapperClassName:b="",textareaWrapperClassName:x="",labelClassName:S="",helperClassName:k="",countClassName:v="",id:p,value:d,defaultValue:y,onChange:c,disabled:T=!1,readOnly:R=!1,className:N="",placeholder:D,maxLength:M,ref:F,style:P,...I}){let{isRequired:z=!1,isInvalid:B=!1,isLoading:V=!1,showSpinner:Y=!1,isClearable:L=!1,showCount:E=!1,isFullWidth:O=!0,autoResize:A=!0}=a??{},U=(0,_i.useId)(),G=p||U,K=`${G}-error-helper`,q=(0,_i.useRef)(null),[X,fe]=(0,_i.useState)(y),ae=(0,Jd.useMergeRefs)([q,F]),_=d!==void 0,Z=_?d:X,he=!!(B||l),xe=he?"error":r,$=C(e,Kd,"md"),re=C(o,_d,"md"),ee=A?"resize-none":C(h,Xd,"none"),de=t==="other"?"":C(xe,C(t,qd,"outline"),"primary"),ne=Z!=null?String(Z).length:0,ze=ne>0,ve=pe=>{let W=pe.target.value;M!==void 0&&W.length>M&&(W=W.slice(0,M),pe.target.value=W),_||fe(W),c?.(pe)},Ce=()=>{_||fe(""),f?.()},J=i==="floating",j=J&&!!n,oe=()=>(0,Cr.jsx)(Pt,{htmlFor:G,label:n,isRequired:z,isFloating:J,size:e,color:xe,hasError:he,className:S}),ye=["group/textarea relative flex flex-col transition-all duration-150 ease-in-out border-2",re,de,T?"opacity-50":"",O?"w-full":"w-auto",x].filter(Boolean).join(" "),ue=L||V&&Y,ce=["w-full bg-transparent outline-none border-none text-neutral-900 placeholder:text-neutral-400 disabled:cursor-not-allowed ui-scrollbar",$.textarea,ue?"pr-8":"",E?"pb-6":"",ee,N].filter(Boolean).join(" "),ke=i==="left",Te={id:G,value:Z,onChange:ve,disabled:T||V,readOnly:R,maxLength:M,"aria-invalid":he,"aria-required":z,"aria-describedby":l||s?K:void 0,"aria-errormessage":l?K:void 0,"aria-busy":V,"aria-disabled":T||V,placeholder:D,className:ce,style:P,...I};return(0,Cr.jsxs)("div",{className:`group/field relative flex ${ke?"flex-row items-start gap-3":"flex-col"} ${j?"pt-2":""} ${O?"w-full":"inline-flex"} ${b}`,children:[!J&&oe(),(0,Cr.jsxs)("div",{className:`flex flex-col ${O?"w-full":""}`,children:[(0,Cr.jsxs)("div",{className:ye,children:[J&&oe(),A?(0,Cr.jsx)(Zd.default,{ref:ae,minRows:u,maxRows:w,onHeightChange:g,cacheMeasurements:m,...Te}):(0,Cr.jsx)("textarea",{ref:ae,rows:u,...Te}),V&&Y&&(0,Cr.jsx)("div",{className:"absolute top-2.5 right-2.5 text-neutral-400 size-4 select-none pointer-events-none",children:(0,Cr.jsx)(Re,{className:"size-full animate-spin"})}),!V&&L&&!T&&!R&&(0,Cr.jsx)("button",{type:"button",onClick:Ce,"aria-label":"X\xF3a n\u1ED9i dung",tabIndex:ze?0:-1,"aria-hidden":!ze,className:`absolute top-2.5 right-2.5 inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full size-4 ${ze?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,Cr.jsx)(Ue,{className:"size-full"})}),E&&(0,Cr.jsxs)("div",{className:`absolute bottom-2 right-2.5 text-[11px] font-mono select-none pointer-events-none z-10 text-neutral-400 ${v}`,children:[ne,M!==void 0&&`/${M}`]})]}),(0,Cr.jsx)(Ae,{id:K,helperText:s,errorMessage:l,sizeClassName:$.helper,className:k})]})]})}var xl=require("react");var hl={xs:{box:"size-3.5",icon:"size-2.5",label:"text-xs leading-4",gap:"gap-1.5",helper:"text-[10px]"},sm:{box:"size-4",icon:"size-3",label:"text-sm leading-4",gap:"gap-2",helper:"text-[11px]"},md:{box:"size-5",icon:"size-3.5",label:"text-sm leading-5",gap:"gap-2.5",helper:"text-xs"},lg:{box:"size-6",icon:"size-4",label:"text-base leading-6",gap:"gap-3",helper:"text-xs"},xl:{box:"size-7",icon:"size-5",label:"text-lg leading-7",gap:"gap-3.5",helper:"text-sm"}},Qd={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},e0={filled:{primary:"bg-primary-600 text-neutral-white border-primary-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-secondary-600 text-neutral-white border-secondary-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-error-600 text-neutral-white border-error-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-success-600 text-neutral-white border-success-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-warning-500 text-neutral-950 border-warning-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-info-600 text-neutral-white border-info-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-neutral-800 text-neutral-white border-neutral-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"},outline:{primary:"bg-transparent text-primary-600 border-2 border-primary-600 hover:bg-primary-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-transparent text-secondary-600 border-2 border-secondary-600 hover:bg-secondary-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-transparent text-error-600 border-2 border-error-600 hover:bg-error-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-transparent text-success-600 border-2 border-success-600 hover:bg-success-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-transparent text-warning-700 border-2 border-warning-500 hover:bg-warning-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-transparent text-info-600 border-2 border-info-600 hover:bg-info-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-transparent text-neutral-800 border-2 border-neutral-800 hover:bg-neutral-100/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"},soft:{primary:"bg-primary-100 text-primary-800 border-primary-300 hover:bg-primary-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-secondary-100 text-secondary-800 border-secondary-300 hover:bg-secondary-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-error-100 text-error-800 border-error-300 hover:bg-error-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-success-100 text-success-800 border-success-300 hover:bg-success-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-warning-100 text-warning-900 border-warning-300 hover:bg-warning-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-info-100 text-info-800 border-info-300 hover:bg-info-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-neutral-100 text-neutral-800 border-neutral-300 hover:bg-neutral-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"}},t0={horizontal:"flex flex-row flex-wrap gap-4 items-center",vertical:"flex flex-col gap-2.5"},r0={xs:"sm",sm:"sm",md:"md",lg:"md",xl:"lg"};var eu=require("react/jsx-runtime");function Zo({width:e=14,height:t=14,className:r="",...o}){return(0,eu.jsx)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:(0,eu.jsx)("polyline",{points:"20 6 9 17 4 12"})})}var tu=require("react/jsx-runtime");function Ja({width:e=14,height:t=14,className:r="",...o}){return(0,tu.jsx)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:(0,tu.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})}var fr=require("react/jsx-runtime");function io({size:e="md",variant:t="filled",color:r="primary",radius:o,config:n,label:i,children:a,helperText:s,errorMessage:l,labelPlacement:f="right",icon:u,indeterminateIcon:w,wrapperClassName:g="",boxClassName:m="",labelClassName:h="",helperClassName:b="",className:x="",checked:S,defaultChecked:k,disabled:v=!1,readOnly:p=!1,onChange:d,value:y,id:c,name:T,ref:R,...N}){let{isRequired:D=!1,isInvalid:M=!1,isLoading:F=!1,showSpinner:P=!1,indeterminate:I=!1}=n??{},z=i||a,B=(0,xl.useId)(),V=c||B,Y=`${V}-helper`,L=!!(M??!!l),E=S!==void 0,[O,A]=(0,xl.useState)(k??!1),U=E?S:O,G=ee=>{v||p||F||(E||A(ee.target.checked),d?.(ee))},K=C(e,hl,"md"),q=C(o,Qd,"md"),X=U||I,fe=C(t==="other"?"filled":t,e0,"filled"),ae;t==="other"?ae="":X?ae=C(r,fe,"primary"):ae="bg-neutral-white border-neutral-300 hover:border-neutral-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",L&&(ae=X?C("error",fe,"primary"):"bg-neutral-white border-error-500 hover:border-error-600 text-error-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500");let _=["inline-flex items-center justify-center shrink-0 border transition-all duration-150 select-none",K.box,q,ae,!v&&!p&&!F?"active:scale-95":"",m].filter(Boolean).join(" "),Z=["select-none font-medium text-neutral-900 transition-colors",K.label,v?"opacity-60":"",h].filter(Boolean).join(" "),he=["group inline-flex relative",f==="left"?"flex-row-reverse justify-between":"flex-row",K.gap,v?"opacity-50":"cursor-pointer",g,x].filter(Boolean).join(" "),xe=()=>F&&P?(0,fr.jsx)("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${K.icon}`,"aria-hidden":"true",children:(0,fr.jsx)(Re,{className:"size-full animate-spin"})}):I?(0,fr.jsx)("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${K.icon}`,"aria-hidden":"true",children:w||(0,fr.jsx)(Ja,{className:"size-full"})}):U?(0,fr.jsx)("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${K.icon}`,"aria-hidden":"true",children:u||(0,fr.jsx)(Zo,{className:"size-full"})}):null,$=!!z,re=ee=>{(v||p||F)&&ee.preventDefault()};return(0,fr.jsxs)("div",{className:`inline-flex flex-col ${x}`.trim(),children:[(0,fr.jsxs)("label",{className:he,onClick:re,children:[(0,fr.jsx)("input",{ref:R,type:"checkbox",id:V,name:T,value:y,checked:U,disabled:v||F,readOnly:p,required:D,"aria-checked":I?"mixed":U,"aria-invalid":L,"aria-required":D,"aria-busy":F,"aria-disabled":v||F,"aria-describedby":l||s?Y:void 0,onChange:G,className:"sr-only peer",...N}),(0,fr.jsx)("span",{className:_,"aria-hidden":"true",children:xe()}),$&&(0,fr.jsxs)("span",{className:Z,children:[z,D&&(0,fr.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})]}),(0,fr.jsx)(Ae,{id:Y,helperText:s,errorMessage:l,sizeClassName:K.helper,className:b})]})}var Fr=require("react");var pt={BASE:0,STICKY:10,DROPDOWN:50,POPOVER:50,SELECT:50,PICKER:50,TOOLTIP:60,SELECT_FILTER:100,MAX:99999};var Jo=require("react");function Sn(e,t=300){let r=(0,Jo.useRef)(e),o=(0,Jo.useRef)(null);(0,Jo.useEffect)(()=>{r.current=e},[e]);let n=(0,Jo.useCallback)(()=>{o.current&&(clearTimeout(o.current),o.current=null)},[]);return(0,Jo.useEffect)(()=>n,[n]),{debounced:(0,Jo.useCallback)((...a)=>{n(),o.current=setTimeout(()=>{r.current(...a)},t)},[n,t]),cancel:n}}var Qa=require("react/jsx-runtime");function Hp({width:e=16,height:t=16,className:r="",...o}){return(0,Qa.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[(0,Qa.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,Qa.jsx)("line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65"})]})}var Tn=Hp;var Mr=require("react/jsx-runtime"),Vp=[],Ap=[];function kn({value:e,defaultValue:t=Ap,onChange:r,size:o="md",color:n="primary",variant:i="filled",radius:a,disabled:s=!1,label:l,helperText:f,errorMessage:u,orientation:w="vertical",labelPlacement:g="right",className:m="",wrapperClassName:h="",labelClassName:b="",helperClassName:x="",options:S=Vp,config:k,searchMode:v="client",searchPlaceholder:p="T\xECm ki\u1EBFm...",searchValue:d,defaultSearchValue:y="",onSearchChange:c,searchClassName:T="",searchField:R="label",filterFn:N,onSearch:D,debounceMs:M=300,emptyText:F="Kh\xF4ng t\xECm th\u1EA5y k\u1EBFt qu\u1EA3",children:P,ref:I,...z}){let{isRequired:B=!1,isInvalid:V,isLoading:Y=!1,showSpinner:L=!1,isReadOnly:E=!1,searchable:O=!1,preserveSelected:A=!0,isSearching:U}=k??{},G=(0,Fr.useId)(),K=`${G}-label`,q=`${G}-helper`,X=`${G}-search`,fe=e!==void 0,[ae,_]=(0,Fr.useState)(t),Z=fe?e:ae,he=!!(V??!!u),xe=d!==void 0,[$,re]=(0,Fr.useState)(y),ee=xe?d:$,[de,ne]=(0,Fr.useState)(null),[ze,ve]=(0,Fr.useState)(!1),Ce=!!(U??ze),[J,j]=(0,Fr.useState)(()=>{let ie=new Map;return S.forEach(H=>{ie.set(String(H.value),H)}),ie}),{debounced:oe}=Sn(async ie=>{if(!(v!=="server"||!D))try{ve(!0);let H=await D(ie);Array.isArray(H)&&ne(H)}catch(H){console.error("Error fetching search options:",H)}finally{ve(!1)}},M),ye=ie=>{let H=ie.target.value;xe||re(H),c?.(H),v==="server"&&oe(H)},ue=()=>{xe||re(""),c?.(""),v==="server"&&oe("")},ce=(0,Fr.useMemo)(()=>{let ie=ee.trim(),H=v==="server"&&de?de:S;if(!O||!ie)return H;let se;if(v==="server"?se=H:N?se=H.filter(le=>N(le,ie)):se=vn(H,ie,R),!A)return se;let Ie=new Set(se.map(le=>String(le.value))),je=[];for(let le of Z)if(!Ie.has(le)){let ge=J.get(le);ge?je.push(ge):je.push({value:le,label:le})}return[...je,...se]},[O,ee,v,de,S,N,R,A,Z,J]),ke=(0,Fr.useCallback)((ie,H)=>{if(s||E||Y)return;if(H){let je=(v==="server"&&de?de:S).find(le=>String(le.value)===ie);je&&j(le=>{if(le.has(ie))return le;let ge=new Map(le);return ge.set(ie,je),ge})}let se;H?se=[...Z,ie]:se=Z.filter(Ie=>Ie!==ie),fe||_(se),r?.(se)},[s,E,Y,Z,fe,r,S,v,de]),Te=C(w,t0,"vertical"),pe=["text-sm font-semibold text-neutral-900 mb-1.5 select-none",s?"opacity-60":"",b].filter(Boolean).join(" "),W=C(o,hl,"md"),me=C(o,r0,"md"),De=(0,Fr.useMemo)(()=>new Set(Z.map(String)),[Z]);return(0,Mr.jsxs)("div",{ref:I,role:"group","aria-labelledby":l?K:void 0,"aria-describedby":u||f?q:void 0,"aria-disabled":s||Y?"true":void 0,"aria-busy":Y||Ce?"true":void 0,className:`inline-flex flex-col ${h}`,...z,children:[l&&(0,Mr.jsxs)("span",{id:K,className:pe,children:[l,B&&(0,Mr.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),O&&(0,Mr.jsx)("div",{className:`mb-2.5 ${T}`,children:(0,Mr.jsx)(ar,{id:X,variant:"outline",size:me,color:n,value:ee,onChange:ye,placeholder:p,disabled:s,leftIcon:(0,Mr.jsx)(Tn,{className:"size-4 text-neutral-400"}),rightIcon:Ce?(0,Mr.jsx)(Re,{className:"size-4 animate-spin text-neutral-400"}):void 0,onClear:ue,"aria-label":typeof l=="string"?`T\xECm ki\u1EBFm ${l}`:"T\xECm ki\u1EBFm",config:{isClearable:!Ce,isFullWidth:!0}})}),(0,Mr.jsx)("div",{className:`${Te} ${m}`,children:P||(ce.length>0?ce.map(ie=>{let H=String(ie.value),se=De.has(H);return(0,Mr.jsx)(io,{value:ie.value,label:ie.label,helperText:ie.description,disabled:s||!!ie.disabled,readOnly:E||!!ie.isReadOnly,size:o,color:n,variant:i,radius:a,labelPlacement:g,checked:se,onChange:Ie=>ke(H,Ie.target.checked),config:{indeterminate:ie.indeterminate,isLoading:Y,showSpinner:L,isInvalid:he,isRequired:B}},ie.value)}):(0,Mr.jsx)("div",{className:"py-2 text-xs text-neutral-500 italic",children:!ee.trim()&&v==="server"?"Nh\u1EADp t\u1EEB kh\xF3a \u0111\u1EC3 t\xECm ki\u1EBFm...":F}))}),(0,Mr.jsx)(Ae,{id:q,helperText:f,errorMessage:u,sizeClassName:W.helper,className:x})]})}var wl=require("react");var vl={xs:{box:"size-3.5",dot:"size-1.5",label:"text-xs leading-4",gap:"gap-1.5",helper:"text-[10px]"},sm:{box:"size-4",dot:"size-2",label:"text-sm leading-4",gap:"gap-2",helper:"text-[11px]"},md:{box:"size-5",dot:"size-2.5",label:"text-sm leading-5",gap:"gap-2.5",helper:"text-xs"},lg:{box:"size-6",dot:"size-3",label:"text-base leading-6",gap:"gap-3",helper:"text-xs"},xl:{box:"size-7",dot:"size-3.5",label:"text-lg leading-7",gap:"gap-3.5",helper:"text-sm"}},yl={filled:{primary:"bg-primary-600 text-neutral-white border-primary-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-secondary-600 text-neutral-white border-secondary-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-error-600 text-neutral-white border-error-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-success-600 text-neutral-white border-success-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-warning-500 text-neutral-950 border-warning-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-info-600 text-neutral-white border-info-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-neutral-800 text-neutral-white border-neutral-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"},outline:{primary:"bg-transparent text-primary-600 border-2 border-primary-600 hover:bg-primary-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-transparent text-secondary-600 border-2 border-secondary-600 hover:bg-secondary-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-transparent text-error-600 border-2 border-error-600 hover:bg-error-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-transparent text-success-600 border-2 border-success-600 hover:bg-success-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-transparent text-warning-700 border-2 border-warning-500 hover:bg-warning-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-transparent text-info-600 border-2 border-info-600 hover:bg-info-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-transparent text-neutral-800 border-2 border-neutral-800 hover:bg-neutral-100/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"},soft:{primary:"bg-primary-100 text-primary-800 border-primary-300 hover:bg-primary-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-secondary-100 text-secondary-800 border-secondary-300 hover:bg-secondary-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-error-100 text-error-800 border-error-300 hover:bg-error-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-success-100 text-success-800 border-success-300 hover:bg-success-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-warning-100 text-warning-900 border-warning-300 hover:bg-warning-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-info-100 text-info-800 border-info-300 hover:bg-info-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-neutral-100 text-neutral-800 border-neutral-300 hover:bg-neutral-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"}},o0={horizontal:"flex flex-row flex-wrap gap-4 items-center",vertical:"flex flex-col gap-2.5"},n0={xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"xl"};var ru=require("react/jsx-runtime");function es({className:e}){return(0,ru.jsx)("svg",{viewBox:"0 0 10 10",className:e,fill:"currentColor","aria-hidden":"true",children:(0,ru.jsx)("circle",{cx:"5",cy:"5",r:"5"})})}var Er=require("react/jsx-runtime");function qi({size:e="md",variant:t="filled",color:r="primary",disabled:o=!1,readOnly:n=!1,config:i,labelPlacement:a="right",label:s,helperText:l,errorMessage:f,dotIcon:u,wrapperClassName:w="",boxClassName:g="",labelClassName:m="",helperClassName:h="",className:b="",checked:x,defaultChecked:S=!1,onChange:k,value:v,id:p,name:d,ref:y,...c}){let{isRequired:T=!1,isInvalid:R=!1,isLoading:N=!1}=i??{},D=(0,wl.useId)(),M=p||D,F=`${M}-helper`,P=x!==void 0,[I,z]=(0,wl.useState)(S),B=P?x:I,V=!!(R||f),Y=ae=>{o||n||N||(P||z(ae.target.checked),k?.(ae))},L=C(e,vl,"md"),E=t==="other"?"":C(r,C(t,yl,"filled"),"primary"),O=V?yl[t==="other"?"filled":t]?.error||yl.filled.error:B?E:"bg-neutral-white border-neutral-300 hover:border-neutral-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",A=["inline-flex items-center justify-center shrink-0 border rounded-full transition-all duration-150 select-none",L.box,O,!o&&!n&&!N?"active:scale-95":"",g].filter(Boolean).join(" "),U=["select-none font-medium text-neutral-900 transition-colors",L.label,o?"opacity-60":"",m].filter(Boolean).join(" "),G=["group inline-flex relative",a==="left"?"flex-row-reverse justify-between":"flex-row",L.gap,o?"cursor-not-allowed opacity-60":"cursor-pointer",w,b].filter(Boolean).join(" "),K=()=>N?(0,Er.jsx)("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${L.dot}`,"aria-hidden":"true",children:(0,Er.jsx)(Re,{className:"size-full animate-spin"})}):B?(0,Er.jsx)("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${L.dot}`,"aria-hidden":"true",children:u||(0,Er.jsx)(es,{className:"size-full"})}):null,q=!!s;return(0,Er.jsxs)("div",{className:"inline-flex flex-col",children:[(0,Er.jsxs)("label",{className:G,onClick:ae=>{(o||n||N)&&ae.preventDefault()},children:[(0,Er.jsx)("input",{ref:y,type:"radio",id:M,name:d,value:v,checked:B,disabled:o||N,readOnly:n,required:T,"aria-busy":N,"aria-disabled":o||N,"aria-describedby":f||l?F:void 0,onChange:Y,onClick:ae=>{if(o||n||N){ae.preventDefault();return}c.onClick?.(ae)},className:"sr-only peer",...c}),(0,Er.jsx)("span",{className:A,"aria-hidden":"true",children:K()}),q&&(0,Er.jsxs)("span",{className:U,children:[s,T&&(0,Er.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})]}),(0,Er.jsx)(Ae,{id:F,helperText:l,errorMessage:f,sizeClassName:L.helper,className:h})]})}var Lr=require("react");var $r=require("react/jsx-runtime"),Op=[];function Cl({options:e=Op,value:t,defaultValue:r=null,onChange:o,size:n="md",color:i="primary",variant:a="filled",disabled:s=!1,label:l,helperText:f,errorMessage:u,orientation:w="vertical",labelPlacement:g="right",className:m="",wrapperClassName:h="",labelClassName:b="",helperClassName:x="",config:S,searchPlaceholder:k="T\xECm ki\u1EBFm...",searchValue:v,onSearchChange:p,searchMode:d="client",searchField:y="label",filterFn:c,onSearch:T,debounceMs:R=300,emptyText:N="Kh\xF4ng t\xECm th\u1EA5y k\u1EBFt qu\u1EA3",searchClassName:D="",searchInputSize:M,ref:F,...P}){let{isRequired:I=!1,isInvalid:z,isLoading:B=!1,isReadOnly:V=!1,searchable:Y=!1,preserveSelected:L=!0,isSearching:E}=S??{},O=(0,Lr.useId)(),A=`${O}-label`,U=`${O}-helper`,G=`${O}-search`,K=(0,Lr.useId)(),q=t!==void 0,[X,fe]=(0,Lr.useState)(r??null),ae=q?t:X,_=!!(z||u),Z=v!==void 0,[he,xe]=(0,Lr.useState)(""),$=Z?v:he,[re,ee]=(0,Lr.useState)(!1),de=E??re,[ne,ze]=(0,Lr.useState)(null),[ve,Ce]=(0,Lr.useState)(()=>{let W=new Map;return e.forEach(me=>{W.set(String(me.value),me)}),W}),{debounced:J}=Sn(async W=>{if(!(d!=="server"||!T))try{ee(!0);let me=await T(W);Array.isArray(me)&&ze(me)}catch(me){console.error("Error fetching radio search options:",me)}finally{ee(!1)}},R),j=W=>{let me=W.target.value;Z||xe(me),p?.(me),d==="server"&&J(me)},oe=()=>{Z||xe(""),p?.(""),d==="server"&&ze(null)},ye=(0,Lr.useMemo)(()=>{let W=$.trim(),me=d==="server"&&ne?ne:e;if(!Y||!W)return me;let De;if(d==="server"?De=me:c?De=me.filter(se=>c(se,W)):De=vn(me,W,y),!L||ae===null||ae===void 0)return De;let ie=String(ae);if(!De.some(se=>String(se.value)===ie)){let se=ve.get(ie);return se?[se,...De]:[{value:ie,label:ie},...De]}return De},[Y,$,d,ne,e,c,y,L,ae,ve]),ue=(0,Lr.useCallback)(W=>{if(s||V||B)return;let De=(d==="server"&&ne?ne:e).find(ie=>String(ie.value)===W);De&&Ce(ie=>{if(ie.has(W))return ie;let H=new Map(ie);return H.set(W,De),H}),q||fe(W),o?.(W)},[s,V,B,q,o,e,d,ne]),ce=C(w,o0,"vertical"),ke=C(n,vl,"md"),Te=M??C(n,n0,"md"),pe=["text-sm font-semibold text-neutral-900 mb-1.5 select-none",s?"opacity-60":"",b].filter(Boolean).join(" ");return(0,$r.jsxs)("div",{ref:F,role:"radiogroup","aria-labelledby":l?A:void 0,"aria-describedby":u||f?U:void 0,"aria-errormessage":u?U:void 0,"aria-orientation":w,"aria-required":I?"true":void 0,"aria-invalid":_?"true":void 0,"aria-disabled":s?"true":void 0,"aria-readonly":V?"true":void 0,"aria-busy":B?"true":void 0,className:`inline-flex flex-col ${h}`,...P,children:[l&&(0,$r.jsxs)("span",{id:A,className:pe,children:[l,I&&(0,$r.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),Y&&(0,$r.jsx)("div",{className:`mb-2.5 ${D}`,children:(0,$r.jsx)(ar,{id:G,variant:"outline",size:Te,color:i,value:$,onChange:j,placeholder:k,disabled:s||B,leftIcon:(0,$r.jsx)(Tn,{className:"size-4 text-neutral-400"}),rightIcon:de?(0,$r.jsx)(Re,{className:"size-4 animate-spin text-neutral-400"}):void 0,onClear:oe,"aria-label":typeof l=="string"?`T\xECm ki\u1EBFm ${l}`:"T\xECm ki\u1EBFm",config:{isClearable:!de,isFullWidth:!0}})}),(0,$r.jsx)("div",{className:`${ce} ${m}`,children:ye.length>0?ye.map(W=>{let me=String(W.value),De=ae!=null&&String(ae)===me;return(0,$r.jsx)(qi,{name:K,value:W.value,checked:De,onChange:()=>ue(me),label:W.label,helperText:W.description,disabled:s||!!W.disabled,readOnly:V||!!W.isReadOnly,size:n,color:i,variant:a,labelPlacement:g,config:{isLoading:B,isInvalid:_,isRequired:I}},W.value)}):(0,$r.jsx)("div",{className:"py-3 text-center text-sm text-neutral-400 select-none",children:!$.trim()&&d==="server"?"Nh\u1EADp t\u1EEB kh\xF3a \u0111\u1EC3 t\xECm ki\u1EBFm s\u1EA3n ph\u1EA9m...":N})}),(0,$r.jsx)(Ae,{id:U,helperText:f,errorMessage:u,sizeClassName:ke.helper,className:x})]})}var Zi=require("react"),s0=require("@floating-ui/react");var i0={xs:{track:"w-7 h-4 p-0.5",thumb:"size-3",translate:"translate-x-3",icon:"size-2",content:"text-[9px]",label:"text-xs leading-4",gap:"gap-1.5",helper:"text-[10px]"},sm:{track:"w-9 h-5 p-0.5",thumb:"size-4",translate:"translate-x-4",icon:"size-2.5",content:"text-[10px]",label:"text-sm leading-4",gap:"gap-2",helper:"text-[11px]"},md:{track:"w-11 h-6 p-0.5",thumb:"size-5",translate:"translate-x-5",icon:"size-3",content:"text-xs",label:"text-sm leading-5",gap:"gap-2.5",helper:"text-xs"},lg:{track:"w-13 h-7 p-0.5",thumb:"size-6",translate:"translate-x-6",icon:"size-3.5",content:"text-xs",label:"text-base leading-6",gap:"gap-3",helper:"text-xs"},xl:{track:"w-16 h-9 p-1",thumb:"size-7",translate:"translate-x-7",icon:"size-4",content:"text-sm",label:"text-lg leading-7",gap:"gap-3.5",helper:"text-sm"}},ou={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},a0={filled:{primary:{checked:{track:"bg-primary-600 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-neutral-white text-primary-600 shadow-sm"},unchecked:{track:"bg-neutral-200 border-transparent hover:bg-neutral-300 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}},secondary:{checked:{track:"bg-secondary-600 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-neutral-white text-secondary-600 shadow-sm"},unchecked:{track:"bg-neutral-200 border-transparent hover:bg-neutral-300 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}},error:{checked:{track:"bg-error-600 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-neutral-white text-error-600 shadow-sm"},unchecked:{track:"bg-neutral-200 border-transparent hover:bg-neutral-300 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}},success:{checked:{track:"bg-success-600 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-neutral-white text-success-600 shadow-sm"},unchecked:{track:"bg-neutral-200 border-transparent hover:bg-neutral-300 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}},warning:{checked:{track:"bg-warning-500 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-neutral-white text-warning-500 shadow-sm"},unchecked:{track:"bg-neutral-200 border-transparent hover:bg-neutral-300 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}},info:{checked:{track:"bg-info-600 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-neutral-white text-info-600 shadow-sm"},unchecked:{track:"bg-neutral-200 border-transparent hover:bg-neutral-300 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}},neutral:{checked:{track:"bg-neutral-800 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-white text-neutral-800 shadow-sm"},unchecked:{track:"bg-neutral-200 border-transparent hover:bg-neutral-300 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}}},outline:{primary:{checked:{track:"bg-primary-50 border-2 border-primary-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-primary-600 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 hover:border-neutral-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-neutral-400 text-neutral-white shadow-sm"}},secondary:{checked:{track:"bg-secondary-50 border-2 border-secondary-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-secondary-600 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 hover:border-neutral-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-neutral-400 text-neutral-white shadow-sm"}},error:{checked:{track:"bg-error-50 border-2 border-error-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-error-600 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 hover:border-neutral-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-neutral-400 text-neutral-white shadow-sm"}},success:{checked:{track:"bg-success-50 border-2 border-success-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-success-600 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 hover:border-neutral-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-neutral-400 text-neutral-white shadow-sm"}},warning:{checked:{track:"bg-warning-50 border-2 border-warning-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-warning-500 text-neutral-950 shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 hover:border-neutral-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-neutral-400 text-neutral-white shadow-sm"}},info:{checked:{track:"bg-info-50 border-2 border-info-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-info-600 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 hover:border-neutral-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-neutral-400 text-neutral-white shadow-sm"}},neutral:{checked:{track:"bg-neutral-100 border-2 border-neutral-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-800 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 hover:border-neutral-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-400 text-neutral-white shadow-sm"}}},soft:{primary:{checked:{track:"bg-primary-100 border border-primary-200 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-primary-600 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 border border-neutral-200 hover:bg-neutral-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}},secondary:{checked:{track:"bg-secondary-100 border border-secondary-200 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-secondary-600 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 border border-neutral-200 hover:bg-neutral-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}},error:{checked:{track:"bg-error-100 border border-error-200 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-error-600 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 border border-neutral-200 hover:bg-neutral-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}},success:{checked:{track:"bg-success-100 border border-success-200 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-success-600 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 border border-neutral-200 hover:bg-neutral-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}},warning:{checked:{track:"bg-warning-100 border border-warning-200 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-warning-500 text-neutral-950 shadow-sm"},unchecked:{track:"bg-neutral-100 border border-neutral-200 hover:bg-neutral-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}},info:{checked:{track:"bg-info-100 border border-info-200 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-info-600 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 border border-neutral-200 hover:bg-neutral-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}},neutral:{checked:{track:"bg-neutral-200 border border-neutral-300 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-800 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 border border-neutral-200 hover:bg-neutral-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}}}};var pr=require("react/jsx-runtime");function Sl({size:e,variant:t,color:r,radius:o,thumbRadius:n,config:i,label:a,helperText:s,errorMessage:l,labelPlacement:f="right",thumbIcon:u,startContent:w,endContent:g,wrapperClassName:m="",trackClassName:h="",thumbClassName:b="",labelClassName:x="",helperClassName:S="",className:k="",checked:v,defaultChecked:p,disabled:d=!1,readOnly:y=!1,onChange:c,onClick:T,value:R,id:N,name:D,ref:M,...F}){let{isRequired:P=!1,isInvalid:I=!1,isLoading:z=!1,showSpinner:B=!1}=i??{},V=(0,Zi.useId)(),Y=N||V,L=`${Y}-error-helper`,E=(0,Zi.useRef)(null),O=(0,s0.useMergeRefs)([E,M]),A=v!==void 0,[U,G]=(0,Zi.useState)(p??!1),K=A?!!v:U,q=oe=>{d||y||z||(A||G(oe.target.checked),c?.(oe))},X=oe=>{if(d||y||z){oe.preventDefault();return}T?.(oe)},fe=oe=>{(d||y||z)&&oe.preventDefault()},ae=!!(I||l),_=ae?"error":r,Z=C(e,i0,"md"),he=C(o,ou,"full"),xe=C(n,ou,"full"),$=t==="other"?void 0:C(_,C(t,a0,"filled"),"primary"),re=$?K?$.checked.track:$.unchecked.track:"",ee=$?K?$.checked.thumb:$.unchecked.thumb:"",de=["relative inline-flex items-center shrink-0 border box-border transition-colors duration-200 ease-in-out cursor-pointer select-none",Z.track,he,re,d?"opacity-50":"",h].filter(Boolean).join(" "),ne=["pointer-events-none inline-flex items-center justify-center transition-transform duration-200 ease-in-out select-none",Z.thumb,xe,ee,K?Z.translate:"translate-x-0",b].filter(Boolean).join(" "),ze=["select-none font-medium text-neutral-900 transition-colors",Z.label,d?"opacity-50":"",x].filter(Boolean).join(" "),Ce=["group inline-flex items-center relative",f==="left"?"flex-row-reverse justify-between":"flex-row",Z.gap,d?"cursor-not-allowed opacity-60":"cursor-pointer",m,k].filter(Boolean).join(" "),J=()=>z&&B?(0,pr.jsx)("span",{className:`inline-flex items-center justify-center ${Z.icon}`,"aria-hidden":"true",children:(0,pr.jsx)(Re,{className:"size-full animate-spin"})}):typeof u=="function"?u({isChecked:K,className:Z.icon}):u?(0,pr.jsx)("span",{className:`inline-flex items-center justify-center ${Z.icon}`,"aria-hidden":"true",children:u}):null,j=()=>a?(0,pr.jsxs)("span",{className:ze,children:[a,P&&(0,pr.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):null;return(0,pr.jsxs)("div",{className:"inline-flex flex-col",children:[(0,pr.jsxs)("label",{className:Ce,onClick:fe,children:[(0,pr.jsx)("input",{ref:O,type:"checkbox",role:"switch",id:Y,name:D,value:R,checked:K,onChange:q,onClick:X,disabled:d||z,readOnly:y,required:P,"aria-checked":K,"aria-invalid":ae,"aria-required":P,"aria-describedby":l||s?L:void 0,"aria-errormessage":l?L:void 0,"aria-busy":z,"aria-disabled":d||z,className:"sr-only peer",...F}),(0,pr.jsxs)("span",{className:de,"aria-hidden":"true",children:[w&&(0,pr.jsx)("span",{className:`absolute left-1.5 inline-flex items-center justify-center select-none font-medium transition-opacity duration-200 ${Z.content} ${K?"opacity-100":"opacity-0"}`,children:w}),(0,pr.jsx)("span",{className:ne,children:J()}),g&&(0,pr.jsx)("span",{className:`absolute right-1.5 inline-flex items-center justify-center select-none font-medium transition-opacity duration-200 ${Z.content} ${K?"opacity-0":"opacity-100"}`,children:g})]}),j()]}),(0,pr.jsx)(Ae,{id:L,helperText:s,errorMessage:l,sizeClassName:Z.helper,className:S})]})}var nu=require("react/jsx-runtime");function zt({width:e=16,height:t=16,className:r="",...o}){return(0,nu.jsx)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:(0,nu.jsx)("path",{d:"m6 9 6 6 6-6"})})}var iu=require("react/jsx-runtime");function Br({width:e=16,height:t=16,className:r="",...o}){return(0,iu.jsx)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:(0,iu.jsx)("path",{d:"m15 18-6-6 6-6"})})}var au=require("react/jsx-runtime");function sr({width:e=16,height:t=16,className:r="",...o}){return(0,au.jsx)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:(0,au.jsx)("path",{d:"m9 18 6-6-6-6"})})}var ei=require("react/jsx-runtime");function su({width:e=16,height:t=16,className:r="",...o}){return(0,ei.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[(0,ei.jsx)("path",{d:"M8 2v4"}),(0,ei.jsx)("path",{d:"M16 2v4"}),(0,ei.jsx)("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),(0,ei.jsx)("path",{d:"M3 10h18"})]})}var ts=require("react/jsx-runtime");function lu({width:e=16,height:t=16,className:r="",...o}){return(0,ts.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[(0,ts.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,ts.jsx)("polyline",{points:"12 6 12 12 16 14"})]})}var rs=require("react/jsx-runtime");function Qo({width:e=16,height:t=16,className:r="",...o}){return(0,rs.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[(0,rs.jsx)("path",{d:"m11 17-5-5 5-5"}),(0,rs.jsx)("path",{d:"m18 17-5-5 5-5"})]})}var os=require("react/jsx-runtime");function en({width:e=16,height:t=16,className:r="",...o}){return(0,os.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[(0,os.jsx)("path",{d:"m6 17 5-5-5-5"}),(0,os.jsx)("path",{d:"m13 17 5-5-5-5"})]})}var Sr=require("react/jsx-runtime");function Gp(e){return(0,Sr.jsxs)("svg",{viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[(0,Sr.jsx)("ellipse",{cx:"48",cy:"80",rx:"36",ry:"8",className:"fill-neutral-200/60"}),(0,Sr.jsx)("ellipse",{cx:"48",cy:"80",rx:"22",ry:"4.5",className:"fill-neutral-300/50"}),(0,Sr.jsx)("path",{d:"M24 38L16 32L40 22L48 28L24 38Z",className:"fill-primary-100/80 stroke-primary-300",strokeWidth:"1.5",strokeLinejoin:"round"}),(0,Sr.jsx)("path",{d:"M72 38L80 32L56 22L48 28L72 38Z",className:"fill-primary-100/80 stroke-primary-300",strokeWidth:"1.5",strokeLinejoin:"round"}),(0,Sr.jsx)("path",{d:"M24 38L48 28V52L24 62V38Z",className:"fill-primary-300/80 stroke-primary-300/40",strokeWidth:"1",strokeLinejoin:"round"}),(0,Sr.jsx)("path",{d:"M72 38L48 28V52L72 62V38Z",className:"fill-primary-300/60 stroke-primary-300/40",strokeWidth:"1",strokeLinejoin:"round"}),(0,Sr.jsx)("path",{d:"M48 52L72 62L48 72L24 62L48 52Z",className:"fill-primary-400/40 stroke-primary-400/30",strokeWidth:"1",strokeLinejoin:"round"}),(0,Sr.jsx)("path",{d:"M24 38V64L48 76V50L24 38Z",className:"fill-primary-100 stroke-primary-400",strokeWidth:"1.8",strokeLinejoin:"round"}),(0,Sr.jsx)("path",{d:"M72 38V64L48 76V50L72 38Z",className:"fill-primary-200/90 stroke-primary-400",strokeWidth:"1.8",strokeLinejoin:"round"}),(0,Sr.jsx)("path",{d:"M24 38L48 50L38 60L14 48L24 38Z",className:"fill-primary-50 stroke-primary-300",strokeWidth:"1.5",strokeLinejoin:"round"}),(0,Sr.jsx)("path",{d:"M72 38L48 50L58 60L82 48L72 38Z",className:"fill-primary-100/90 stroke-primary-300",strokeWidth:"1.5",strokeLinejoin:"round"})]})}var Tl=Gp;var Hr=require("react/jsx-runtime");function jp(e){return(0,Hr.jsxs)("svg",{viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[(0,Hr.jsx)("ellipse",{cx:"60",cy:"100",rx:"42",ry:"10",className:"fill-neutral-200/50"}),(0,Hr.jsx)("rect",{x:"32",y:"24",width:"44",height:"56",rx:"6",className:"fill-white stroke-neutral-300",strokeWidth:"2"}),(0,Hr.jsx)("line",{x1:"42",y1:"36",x2:"66",y2:"36",className:"stroke-neutral-200",strokeWidth:"2.5",strokeLinecap:"round"}),(0,Hr.jsx)("line",{x1:"42",y1:"44",x2:"60",y2:"44",className:"stroke-neutral-200",strokeWidth:"2.5",strokeLinecap:"round"}),(0,Hr.jsx)("line",{x1:"42",y1:"52",x2:"52",y2:"52",className:"stroke-neutral-200",strokeWidth:"2.5",strokeLinecap:"round"}),(0,Hr.jsxs)("g",{transform:"translate(48, 38)",children:[(0,Hr.jsx)("circle",{cx:"28",cy:"28",r:"20",className:"fill-primary-50/80 stroke-primary-500",strokeWidth:"3"}),(0,Hr.jsx)("path",{d:"M18 20A14 14 0 0 1 34 16",className:"stroke-primary-300",strokeWidth:"2",strokeLinecap:"round"}),(0,Hr.jsx)("path",{d:"M24 24L32 32M32 24L24 32",className:"stroke-neutral-400",strokeWidth:"2",strokeLinecap:"round"}),(0,Hr.jsx)("path",{d:"M42 42L58 58",className:"stroke-primary-700",strokeWidth:"5",strokeLinecap:"round"})]})]})}var kl=jp;var To=require("react/jsx-runtime");function Up(e){return(0,To.jsxs)("svg",{viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[(0,To.jsx)("ellipse",{cx:"60",cy:"100",rx:"42",ry:"10",className:"fill-neutral-200/50"}),(0,To.jsx)("circle",{cx:"60",cy:"52",r:"32",className:"fill-error-50 stroke-error-200",strokeWidth:"2"}),(0,To.jsx)("path",{d:"M60 30L78 64H42L60 30Z",className:"fill-error-100 stroke-error-500",strokeWidth:"2.5",strokeLinejoin:"round"}),(0,To.jsx)("line",{x1:"60",y1:"42",x2:"60",y2:"52",className:"stroke-error-600",strokeWidth:"2.5",strokeLinecap:"round"}),(0,To.jsx)("circle",{cx:"60",cy:"58",r:"1.5",className:"fill-error-600"}),(0,To.jsx)("path",{d:"M22 66L32 60",className:"stroke-neutral-300",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"3 3"}),(0,To.jsx)("path",{d:"M98 66L88 60",className:"stroke-neutral-300",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"3 3"})]})}var Rl=Up;var tn=require("react/jsx-runtime");function Yp(e){return(0,tn.jsxs)("svg",{viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[(0,tn.jsx)("ellipse",{cx:"60",cy:"98",rx:"42",ry:"10",className:"fill-neutral-200/50"}),(0,tn.jsx)("path",{d:"M24 40C24 36.69 26.69 34 30 34H48L56 42H90C93.31 42 96 44.69 96 48V78C96 81.31 93.31 84 90 84H30C26.69 84 24 81.31 24 78V40Z",className:"fill-primary-200/70 stroke-primary-300",strokeWidth:"2"}),(0,tn.jsx)("rect",{x:"36",y:"30",width:"48",height:"40",rx:"4",className:"fill-white stroke-neutral-200",strokeWidth:"1.5"}),(0,tn.jsx)("line",{x1:"44",y1:"40",x2:"68",y2:"40",className:"stroke-neutral-200",strokeWidth:"2",strokeLinecap:"round"}),(0,tn.jsx)("line",{x1:"44",y1:"48",x2:"60",y2:"48",className:"stroke-neutral-200",strokeWidth:"2",strokeLinecap:"round"}),(0,tn.jsx)("path",{d:"M24 52H96V80C96 83.31 93.31 86 90 86H30C26.69 86 24 83.31 24 80V52Z",className:"fill-primary-300/80 stroke-primary-400",strokeWidth:"2"})]})}var Nl=Yp;var ti=require("react/jsx-runtime");function Wp(e){return(0,ti.jsxs)("svg",{viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[(0,ti.jsx)("ellipse",{cx:"32",cy:"54",rx:"24",ry:"5",className:"fill-neutral-200/50"}),(0,ti.jsx)("path",{d:"M12 24L32 14L52 24L32 34L12 24Z",className:"fill-neutral-100 stroke-neutral-400",strokeWidth:"2",strokeLinejoin:"round"}),(0,ti.jsx)("path",{d:"M12 24V40L32 50V34L12 24Z",className:"fill-neutral-200 stroke-neutral-400",strokeWidth:"2",strokeLinejoin:"round"}),(0,ti.jsx)("path",{d:"M52 24V40L32 50V34L52 24Z",className:"fill-neutral-300 stroke-neutral-400",strokeWidth:"2",strokeLinejoin:"round"})]})}var Dl=Wp;var Ji=require("react/jsx-runtime");function Vr({width:e=20,height:t=20,className:r="",...o}){return(0,Ji.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[(0,Ji.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,Ji.jsx)("path",{d:"M12 16v-4"}),(0,Ji.jsx)("path",{d:"M12 8h.01"})]})}var ns=require("react/jsx-runtime");function ri({width:e=20,height:t=20,className:r="",...o}){return(0,ns.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[(0,ns.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,ns.jsx)("path",{d:"m9 12 2 2 4-4"})]})}var Qi=require("react/jsx-runtime");function oi({width:e=20,height:t=20,className:r="",...o}){return(0,Qi.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[(0,Qi.jsx)("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"}),(0,Qi.jsx)("path",{d:"M12 9v4"}),(0,Qi.jsx)("path",{d:"M12 17h.01"})]})}var ea=require("react/jsx-runtime");function ni({width:e=20,height:t=20,className:r="",...o}){return(0,ea.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[(0,ea.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,ea.jsx)("path",{d:"M12 8v4"}),(0,ea.jsx)("path",{d:"M12 16h.01"})]})}var ii=require("react/jsx-runtime");function ai({width:e=20,height:t=20,className:r="",...o}){return(0,ii.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[(0,ii.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,ii.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),(0,ii.jsx)("line",{x1:"11",y1:"8",x2:"11",y2:"14"}),(0,ii.jsx)("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})}var ta=require("react/jsx-runtime");function si({width:e=20,height:t=20,className:r="",...o}){return(0,ta.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[(0,ta.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,ta.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),(0,ta.jsx)("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})}var is=require("react/jsx-runtime");function rn({width:e=20,height:t=20,className:r="",...o}){return(0,is.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[(0,is.jsx)("path",{d:"M21 2v6h-6"}),(0,is.jsx)("path",{d:"M21 8A10 10 0 1 0 22 13"})]})}var as=require("react/jsx-runtime");function li({width:e=20,height:t=20,className:r="",...o}){return(0,as.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[(0,as.jsx)("path",{d:"M3 2v6h6"}),(0,as.jsx)("path",{d:"M3 8a10 10 0 1 1-1 5"})]})}var on=require("react/jsx-runtime");function ci({width:e=20,height:t=20,className:r="",...o}){return(0,on.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[(0,on.jsx)("path",{d:"m3 7 5 5-5 5V7z"}),(0,on.jsx)("path",{d:"m21 7-5 5 5 5V7z"}),(0,on.jsx)("path",{d:"M12 20v2"}),(0,on.jsx)("path",{d:"M12 14v2"}),(0,on.jsx)("path",{d:"M12 8v2"}),(0,on.jsx)("path",{d:"M12 2v2"})]})}var ra=require("react/jsx-runtime");function ao({width:e=20,height:t=20,className:r="",...o}){return(0,ra.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[(0,ra.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,ra.jsx)("polyline",{points:"7 10 12 15 17 10"}),(0,ra.jsx)("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}var ss=require("react/jsx-runtime");function Tr({width:e=20,height:t=20,className:r="",...o}){return(0,ss.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[(0,ss.jsx)("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),(0,ss.jsx)("path",{d:"M3 3v5h5"})]})}var oa=require("react/jsx-runtime");function ls({width:e=20,height:t=20,className:r="",...o}){return(0,oa.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[(0,oa.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),(0,oa.jsx)("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),(0,oa.jsx)("polyline",{points:"21 15 16 10 5 21"})]})}var cs=require("react/jsx-runtime");function us({width:e=16,height:t=16,className:r="",...o}){return(0,cs.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[(0,cs.jsx)("path",{d:"M6 2v14a2 2 0 0 0 2 2h14"}),(0,cs.jsx)("path",{d:"M18 22V8a2 2 0 0 0-2-2H2"})]})}var ui=require("react/jsx-runtime");function Wr({width:e=16,height:t=16,className:r="",...o}){return(0,ui.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[(0,ui.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,ui.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),(0,ui.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,ui.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}var cu=require("react/jsx-runtime");function mr({width:e=24,height:t=24,className:r="",...o}){return(0,cu.jsx)("svg",{width:e,height:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:r,...o,children:(0,cu.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95C8.08 7.14 9.94 6 12 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11c1.56.1 2.78 1.41 2.78 2.96 0 1.65-1.35 3-3 3M8 13h2.55v3h2.9v-3H16l-4-4z"})})}var di=require("react/jsx-runtime");function ds({width:e=24,height:t=24,variant:r="solid",className:o="",...n}){return r==="outline"?(0,di.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o,...n,children:[(0,di.jsx)("path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}),(0,di.jsx)("circle",{cx:"12",cy:"7",r:"4"})]}):(0,di.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:o,...n,children:(0,di.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.5 6a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM3.751 20.105a8.25 8.25 0 0 1 16.498 0 .75.75 0 0 1-.437.695A18.683 18.683 0 0 1 12 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 0 1-.437-.695Z"})})}var fs=require("react/jsx-runtime");function ps({width:e=16,height:t=16,className:r="",...o}){return(0,fs.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[(0,fs.jsx)("path",{d:"m7 15 5 5 5-5"}),(0,fs.jsx)("path",{d:"m7 9 5-5 5 5"})]})}var ms=require("react/jsx-runtime");function gs({width:e=16,height:t=16,className:r="",...o}){return(0,ms.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[(0,ms.jsx)("path",{d:"m5 12 7-7 7 7"}),(0,ms.jsx)("path",{d:"M12 19V5"})]})}var bs=require("react/jsx-runtime");function hs({width:e=16,height:t=16,className:r="",...o}){return(0,bs.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[(0,bs.jsx)("path",{d:"M12 5v14"}),(0,bs.jsx)("path",{d:"m19 12-7 7-7-7"})]})}var Kr=require("react/jsx-runtime");function xs({width:e=16,height:t=16,className:r="",...o}){return(0,Kr.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[(0,Kr.jsx)("line",{x1:"21",x2:"14",y1:"4",y2:"4"}),(0,Kr.jsx)("line",{x1:"10",x2:"3",y1:"4",y2:"4"}),(0,Kr.jsx)("line",{x1:"21",x2:"12",y1:"12",y2:"12"}),(0,Kr.jsx)("line",{x1:"8",x2:"3",y1:"12",y2:"12"}),(0,Kr.jsx)("line",{x1:"21",x2:"16",y1:"20",y2:"20"}),(0,Kr.jsx)("line",{x1:"12",x2:"3",y1:"20",y2:"20"}),(0,Kr.jsx)("line",{x1:"14",x2:"14",y1:"2",y2:"6"}),(0,Kr.jsx)("line",{x1:"8",x2:"8",y1:"10",y2:"14"}),(0,Kr.jsx)("line",{x1:"16",x2:"16",y1:"18",y2:"22"})]})}var l0={xs:{container:"p-2 gap-2 text-xs",title:"text-xs font-semibold leading-tight",description:"text-[11px] leading-tight",icon:"size-3.5 mt-0.5",closeButton:"size-4 p-0.5 -mr-0.5",closeIcon:"size-3",action:"gap-1.5 text-xs"},sm:{container:"p-2.5 gap-2.5 text-xs",title:"text-sm font-semibold leading-tight",description:"text-xs leading-normal",icon:"size-4 mt-0.5",closeButton:"size-5 p-0.5 -mr-0.5",closeIcon:"size-3.5",action:"gap-1.5 text-xs"},md:{container:"p-3.5 gap-3 text-sm",title:"text-sm font-semibold leading-tight",description:"text-sm leading-normal",icon:"size-5 mt-0.5",closeButton:"size-6 p-1 -mr-1",closeIcon:"size-4",action:"gap-2 text-sm"},lg:{container:"p-4 gap-3.5 text-base",title:"text-base font-semibold leading-snug",description:"text-sm leading-normal",icon:"size-6 mt-0.5",closeButton:"size-7 p-1.5 -mr-1.5",closeIcon:"size-4.5",action:"gap-2.5 text-sm"},xl:{container:"p-5 gap-4 text-lg",title:"text-lg font-semibold leading-snug",description:"text-base leading-normal",icon:"size-7 mt-0.5",closeButton:"size-8 p-1.5 -mr-1.5",closeIcon:"size-5",action:"gap-3 text-base"}},c0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},u0={soft:{primary:"bg-primary-50 text-primary-900 border-2 border-primary-200",secondary:"bg-secondary-50 text-secondary-900 border-2 border-secondary-200",neutral:"bg-neutral-100 text-neutral-900 border-2 border-neutral-200",error:"bg-error-50 text-error-900 border-2 border-error-200",success:"bg-success-50 text-success-900 border-2 border-success-200",warning:"bg-warning-50 text-warning-900 border-2 border-warning-200",info:"bg-info-50 text-info-900 border-2 border-info-200"},filled:{primary:"bg-primary-600 text-white border-2 border-primary-600",secondary:"bg-secondary-600 text-white border-2 border-secondary-600",neutral:"bg-neutral-700 text-white border-2 border-neutral-700",error:"bg-error-600 text-white border-2 border-error-600",success:"bg-success-600 text-white border-2 border-success-600",warning:"bg-warning-500 text-neutral-950 border-2 border-warning-500",info:"bg-info-600 text-white border-2 border-info-600"},outline:{primary:"bg-neutral-white text-primary-700 border-2 border-primary-400",secondary:"bg-neutral-white text-secondary-700 border-2 border-secondary-400",neutral:"bg-neutral-white text-neutral-700 border-2 border-neutral-300",error:"bg-neutral-white text-error-700 border-2 border-error-500",success:"bg-neutral-white text-success-700 border-2 border-success-400",warning:"bg-neutral-white text-warning-800 border-2 border-warning-400",info:"bg-neutral-white text-info-700 border-2 border-info-400"},"accent-left":{primary:"bg-primary-50/70 text-primary-900 border-2 border-primary-200 border-l-4 border-l-primary-500",secondary:"bg-secondary-50/70 text-secondary-900 border-2 border-secondary-200 border-l-4 border-l-secondary-500",neutral:"bg-neutral-50/70 text-neutral-900 border-2 border-neutral-200 border-l-4 border-l-neutral-500",error:"bg-error-50/70 text-error-900 border-2 border-error-200 border-l-4 border-l-error-500",success:"bg-success-50/70 text-success-900 border-2 border-success-200 border-l-4 border-l-success-500",warning:"bg-warning-50/70 text-warning-900 border-2 border-warning-200 border-l-4 border-l-warning-500",info:"bg-info-50/70 text-info-900 border-2 border-info-200 border-l-4 border-l-info-500"},ghost:{primary:"bg-transparent text-primary-800 border-2 border-transparent",secondary:"bg-transparent text-secondary-800 border-2 border-transparent",neutral:"bg-transparent text-neutral-800 border-2 border-transparent",error:"bg-transparent text-error-700 border-2 border-transparent",success:"bg-transparent text-success-700 border-2 border-transparent",warning:"bg-transparent text-warning-800 border-2 border-transparent",info:"bg-transparent text-info-800 border-2 border-transparent"}},d0={soft:{primary:"text-primary-600",secondary:"text-secondary-600",neutral:"text-neutral-600",error:"text-error-600",success:"text-success-600",warning:"text-warning-600",info:"text-info-600"},filled:{primary:"text-white",secondary:"text-white",neutral:"text-white",error:"text-white",success:"text-white",warning:"text-neutral-950",info:"text-white"},outline:{primary:"text-primary-600",secondary:"text-secondary-600",neutral:"text-neutral-600",error:"text-error-600",success:"text-success-600",warning:"text-warning-600",info:"text-info-600"},"accent-left":{primary:"text-primary-600",secondary:"text-secondary-600",neutral:"text-neutral-600",error:"text-error-600",success:"text-success-600",warning:"text-warning-600",info:"text-info-600"},ghost:{primary:"text-primary-600",secondary:"text-secondary-600",neutral:"text-neutral-600",error:"text-error-600",success:"text-success-600",warning:"text-warning-600",info:"text-info-600"}},f0={primary:Vr,secondary:Vr,neutral:Vr,info:Vr,success:ri,warning:oi,error:ni};var _r=require("react/jsx-runtime");function fi({size:e,variant:t,color:r,radius:o,title:n,description:i,icon:a=!0,action:s,closable:l=!0,onClose:f,closeAriaLabel:u="\u0110\xF3ng c\u1EA3nh b\xE1o",banner:w=!1,titleClassName:g="",descriptionClassName:m="",actionClassName:h="",iconClassName:b="",closeButtonClassName:x="",className:S="",children:k,role:v,ref:p,...d}){let y=C(e,l0,"md"),c=w?"rounded-none border-x-0 w-full":C(o,c0,"lg"),T=t==="other"?"":C(r,C(t,u0,"soft"),"info"),R=t==="other"?"":C(r,C(t,d0,"soft"),"info"),N=l||!!f,D=Y=>{Y.stopPropagation(),f?.()},F=v||(r==="error"||r==="warning"?"alert":"status"),P=r==="error"||r==="warning"?"assertive":"polite",I=i??k,z=!!I,B=()=>{if(a===!1)return null;if(a!==!0&&a!==void 0)return(0,_r.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${y.icon} ${b}`,"aria-hidden":"true",children:a});let Y=C(r,f0,"info");return(0,_r.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${y.icon} ${R} ${b}`,"aria-hidden":"true",children:(0,_r.jsx)(Y,{className:"size-full"})})},V=["relative flex w-full",y.container,c,T,S].filter(Boolean).join(" ");return(0,_r.jsxs)("div",{ref:p,role:F,"aria-live":P,className:V,...d,children:[B(),(0,_r.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[n&&(0,_r.jsx)("div",{className:`${y.title} ${g}`,children:n}),z&&(0,_r.jsx)("div",{className:`${y.description} ${n?"mt-0.5":""} ${m}`,children:I})]}),s&&(0,_r.jsx)("div",{className:`inline-flex items-center shrink-0 ${y.action} ${h}`,children:s}),N&&(0,_r.jsx)("button",{type:"button",onClick:D,"aria-label":u,className:`inline-flex items-center justify-center shrink-0 rounded-md transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-current opacity-70 hover:opacity-100 ${t==="filled"?"hover:bg-white/20 active:bg-white/30":"hover:bg-black/5 active:bg-black/10"} ${y.closeButton} ${x}`,children:(0,_r.jsx)(Ue,{className:y.closeIcon})})]})}var p0=require("sonner");var so=4e3;var m0=require("react/jsx-runtime");function Rn({position:e="top-right",visibleToasts:t=3,expand:r=!1,duration:o=4e3,closeButton:n=!1,className:i="",toastOptions:a,...s}){return(0,m0.jsx)(p0.Toaster,{position:e,visibleToasts:t,expand:r,duration:o,closeButton:n,className:`toaster group ${i}`,toastOptions:{unstyled:!0,className:"w-full max-w-md pointer-events-auto",...a},...s})}var g0=require("react"),pi=require("sonner");var Pl=require("react/jsx-runtime");function Nn(e,t="info",r="soft",o,n={},i){let{duration:a,position:s,onDismiss:l,onAutoClose:f,...u}=n;return pi.toast.custom(w=>(0,Pl.jsx)(fi,{color:t,variant:r,title:e,description:o,closable:u.closable??!0,onClose:()=>{u.onClose?.(),pi.toast.dismiss(w)},...u}),{id:i,duration:a??4e3,position:s,onDismiss:l,onAutoClose:f})}function Kp(e){return typeof e=="object"&&e!==null&&!(0,g0.isValidElement)(e)&&!Array.isArray(e)&&("title"in e||"description"in e||"color"in e||"variant"in e)}function uu(e,t,r){return Kp(e)?{title:e.title??"",description:e.description,color:e.color??t,variant:e.variant??r}:{title:e,description:void 0,color:t,variant:r}}var ko=((e,t,r)=>{let o=r||{};return Nn(e,o.color||"info",o.variant||"soft",t,o)});ko.custom=(e,t={})=>{if(typeof e=="function")return pi.toast.custom(s=>e(s),{duration:t.duration??4e3,position:t.position,onDismiss:t.onDismiss,onAutoClose:t.onAutoClose});let{duration:r,position:o,onDismiss:n,onAutoClose:i,...a}=e;return pi.toast.custom(s=>(0,Pl.jsx)(fi,{closable:a.closable??!0,onClose:()=>{a.onClose?.(),pi.toast.dismiss(s)},...a}),{duration:r??4e3,position:o,onDismiss:n,onAutoClose:i})};ko.success=(e,t,r)=>{let o=r||{};return Nn(e,o.color||"success",o.variant||"soft",t,o)};ko.error=(e,t,r)=>{let o=r||{};return Nn(e,o.color||"error",o.variant||"soft",t,o)};ko.warning=(e,t,r)=>{let o=r||{};return Nn(e,o.color||"warning",o.variant||"soft",t,o)};ko.info=(e,t,r)=>{let o=r||{};return Nn(e,o.color||"info",o.variant||"soft",t,o)};ko.loading=(e,t,r)=>{let o=r||{};return Nn(e,o.color||"info",o.variant||"soft",t,{...o,icon:o.icon??(0,Pl.jsx)(Re,{className:"size-full animate-spin"}),duration:o.duration??1/0,closable:o.closable??!1})};ko.promise=async(e,t)=>{let r=typeof e=="function"?e():e,{title:o,description:n}=uu(t.loading,"info",t.variant||"soft"),i=ko.loading(o,n,{size:t.size,variant:t.variant,radius:t.radius});try{let a=await r,s=typeof t.success=="function"?t.success(a):t.success,{title:l,description:f,color:u,variant:w}=uu(s,"success",t.variant||"soft");return Nn(l,u,w,f,{duration:t.duration??4e3,size:t.size,radius:t.radius},i),a}catch(a){let s=typeof t.error=="function"?t.error(a):t.error,{title:l,description:f,color:u,variant:w}=uu(s,"error",t.variant||"soft");throw Nn(l,u,w,f,{duration:t.duration??4e3,size:t.size,radius:t.radius},i),a}finally{t.finally&&await t.finally()}};ko.dismiss=e=>pi.toast.dismiss(e);var du=ko;var nn=require("react"),ut=require("@floating-ui/react");var b0=require("@floating-ui/react");function ct(e,t={}){let{duration:r=150,offset:o=4,scale:n=.96,animated:i=!0}=t;return(0,b0.useTransitionStyles)(e,{duration:i?r:0,initial:({side:a})=>({opacity:0,transform:a==="top"?`translateY(${o}px) scale(${n})`:a==="bottom"?`translateY(-${o}px) scale(${n})`:a==="left"?`translateX(${o}px) scale(${n})`:`translateX(-${o}px) scale(${n})`}),open:{opacity:1,transform:"translate(0px, 0px) scale(1)"},close:({side:a})=>({opacity:0,transform:a==="top"?`translateY(${o}px) scale(${n})`:a==="bottom"?`translateY(-${o}px) scale(${n})`:a==="left"?`translateX(${o}px) scale(${n})`:`translateX(-${o}px) scale(${n})`})})}var h0={xs:{box:"px-2 py-0.5 text-[11px] leading-tight font-medium",arrowWidth:8,arrowHeight:4},sm:{box:"px-2.5 py-1 text-xs leading-tight font-medium",arrowWidth:10,arrowHeight:5},md:{box:"px-3 py-1.5 text-xs leading-normal font-medium",arrowWidth:12,arrowHeight:6},lg:{box:"px-3.5 py-2 text-sm leading-normal font-medium",arrowWidth:14,arrowHeight:7},xl:{box:"px-4 py-2.5 text-base leading-normal font-semibold",arrowWidth:16,arrowHeight:8}},x0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},v0={filled:{primary:"bg-primary-500 text-neutral-white border border-transparent shadow-md",secondary:"bg-secondary-500 text-neutral-white border border-transparent shadow-md",error:"bg-error-500 text-neutral-white border border-transparent shadow-md",success:"bg-success-500 text-neutral-white border border-transparent shadow-md",warning:"bg-warning-500 text-neutral-950 border border-transparent shadow-md",info:"bg-info-500 text-neutral-white border border-transparent shadow-md",neutral:"bg-neutral-800 text-neutral-white border border-transparent shadow-md"},soft:{primary:"bg-primary-100 text-primary-800 border border-primary-200 shadow-sm",secondary:"bg-secondary-100 text-secondary-800 border border-secondary-200 shadow-sm",error:"bg-error-100 text-error-800 border border-error-200 shadow-sm",success:"bg-success-100 text-success-800 border border-success-200 shadow-sm",warning:"bg-warning-100 text-warning-800 border border-warning-200 shadow-sm",info:"bg-info-100 text-info-800 border border-info-200 shadow-sm",neutral:"bg-neutral-100 text-neutral-800 border border-neutral-200 shadow-sm"},outline:{primary:"bg-neutral-white text-primary-700 border border-primary-400 shadow-md",secondary:"bg-neutral-white text-secondary-800 border border-secondary-400 shadow-md",error:"bg-neutral-white text-error-700 border border-error-400 shadow-md",success:"bg-neutral-white text-success-700 border border-success-400 shadow-md",warning:"bg-neutral-white text-warning-800 border border-warning-400 shadow-md",info:"bg-neutral-white text-info-800 border border-info-400 shadow-md",neutral:"bg-neutral-white text-neutral-800 border border-neutral-300 shadow-md"}},y0={filled:{primary:"fill-primary-500",secondary:"fill-secondary-500",error:"fill-error-500",success:"fill-success-500",warning:"fill-warning-500",info:"fill-info-500",neutral:"fill-neutral-800"},soft:{primary:"fill-primary-100 stroke-primary-200",secondary:"fill-secondary-100 stroke-secondary-200",error:"fill-error-100 stroke-error-200",success:"fill-success-100 stroke-success-200",warning:"fill-warning-100 stroke-warning-200",info:"fill-info-100 stroke-info-200",neutral:"fill-neutral-100 stroke-neutral-200"},outline:{primary:"fill-neutral-white stroke-primary-400",secondary:"fill-neutral-white stroke-secondary-400",error:"fill-neutral-white stroke-error-400",success:"fill-neutral-white stroke-success-400",warning:"fill-neutral-white stroke-warning-400",info:"fill-neutral-white stroke-info-400",neutral:"fill-neutral-white stroke-neutral-300"}};var Ro=require("react/jsx-runtime");function _p({children:e,ref:t,disabled:r,className:o="",...n}){let i=(0,nn.isValidElement)(e)?e.props?.ref:void 0,a=(0,ut.useMergeRefs)([t,i]);if(!(0,nn.isValidElement)(e))return null;let s=e.props||{};return(0,nn.cloneElement)(e,{...n,...s,ref:a,disabled:r?!0:s.disabled,className:[s.className,o].filter(Boolean).join(" ")})}function na({content:e,children:t,placement:r="top",variant:o,color:n,size:i,radius:a,hasArrow:s=!0,offset:l=8,flip:f=!0,shift:u=!0,delay:w={open:200,close:150},disabled:g=!1,animated:m=!0,animationDuration:h=150,open:b,defaultOpen:x=!1,onOpenChange:S,className:k="",arrowClassName:v="",zIndex:p=pt.TOOLTIP}){let[d,y]=(0,nn.useState)(x),[c,T]=(0,nn.useState)(null),R=b!==void 0,N=R?b:d,D=Z=>{R||y(Z),S?.(Z)},M=[(0,ut.offset)(l),f?(0,ut.flip)():void 0,u?(0,ut.shift)({padding:8}):void 0,s?(0,ut.arrow)({element:c}):void 0].filter(Boolean),{refs:{setReference:F,setFloating:P},floatingStyles:I,context:z,placement:B}=(0,ut.useFloating)({placement:r,open:N&&!g,onOpenChange:D,whileElementsMounted:ut.autoUpdate,transform:!1,middleware:M}),V=(0,ut.useHover)(z,{move:!1,delay:w,enabled:!g}),Y=(0,ut.useFocus)(z,{enabled:!g}),L=(0,ut.useDismiss)(z),E=(0,ut.useRole)(z,{role:"tooltip"}),{getReferenceProps:O,getFloatingProps:A}=(0,ut.useInteractions)([V,Y,L,E]),{isMounted:U,styles:G}=ct(z,{duration:h,animated:m}),K=C(i,h0,"md"),q=C(a,x0,"md"),X=o==="other"?"":C(n,C(o,v0,"filled"),"neutral"),fe=o==="other"?"":C(n,C(o,y0,"filled"),"neutral"),ae=["select-none pointer-events-none max-w-xs break-words",K.box,q,X,k].filter(Boolean).join(" "),_=O();return(0,Ro.jsxs)(Ro.Fragment,{children:[(0,nn.isValidElement)(t)?(0,Ro.jsx)(_p,{ref:F,disabled:g,..._,children:t}):(0,Ro.jsx)("span",{ref:F,..._,children:t}),(0,Ro.jsx)(ut.FloatingPortal,{children:U&&!g&&e&&(0,Ro.jsxs)("div",{ref:P,style:{...I,...m?G:{},zIndex:p},className:ae,"data-state":N?"open":"closed","data-placement":B,...A(),children:[e,s&&(0,Ro.jsx)(ut.FloatingArrow,{ref:T,context:z,width:K.arrowWidth,height:K.arrowHeight,strokeWidth:o==="outline"||o==="soft"?1:0,className:[fe,v].filter(Boolean).join(" ")})]})})]})}var Ml=require("react"),sa=Ko(require("@radix-ui/react-slider"),1);var mi={xs:{trackHorizontal:"h-1",trackVertical:"w-1",thumb:"w-3 h-3",thumbSizePx:12,label:"text-xs font-medium",value:"text-xs font-semibold",helper:"text-[11px]",markText:"text-[10px]",gap:"gap-1",stepDot:"w-1 h-1",tooltipSize:"xs"},sm:{trackHorizontal:"h-1.5",trackVertical:"w-1.5",thumb:"w-4 h-4",thumbSizePx:16,label:"text-xs font-medium",value:"text-xs font-semibold",helper:"text-xs",markText:"text-[11px]",gap:"gap-1.5",stepDot:"w-1.5 h-1.5",tooltipSize:"xs"},md:{trackHorizontal:"h-2",trackVertical:"w-2",thumb:"w-5 h-5",thumbSizePx:20,label:"text-sm font-medium",value:"text-sm font-semibold",helper:"text-xs",markText:"text-xs",gap:"gap-2",stepDot:"w-2 h-2",tooltipSize:"sm"},lg:{trackHorizontal:"h-2.5",trackVertical:"w-2.5",thumb:"w-6 h-6",thumbSizePx:24,label:"text-base font-medium",value:"text-base font-semibold",helper:"text-sm",markText:"text-xs",gap:"gap-2.5",stepDot:"w-2.5 h-2.5",tooltipSize:"md"},xl:{trackHorizontal:"h-3",trackVertical:"w-3",thumb:"w-7 h-7",thumbSizePx:28,label:"text-lg font-medium",value:"text-lg font-semibold",helper:"text-sm",markText:"text-sm",gap:"gap-3",stepDot:"w-3 h-3",tooltipSize:"md"}},fu={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},w0={filled:{primary:{track:"bg-neutral-200",filler:"bg-primary-500",thumb:"bg-white border-2 border-primary-500 text-primary-600 focus-visible:ring-2 focus-visible:ring-primary-500/50 shadow-sm"},secondary:{track:"bg-neutral-200",filler:"bg-secondary-500",thumb:"bg-white border-2 border-secondary-500 text-secondary-600 focus-visible:ring-2 focus-visible:ring-secondary-500/50 shadow-sm"},error:{track:"bg-neutral-200",filler:"bg-error-500",thumb:"bg-white border-2 border-error-500 text-error-600 focus-visible:ring-2 focus-visible:ring-error-500/50 shadow-sm"},success:{track:"bg-neutral-200",filler:"bg-success-500",thumb:"bg-white border-2 border-success-500 text-success-600 focus-visible:ring-2 focus-visible:ring-success-500/50 shadow-sm"},warning:{track:"bg-neutral-200",filler:"bg-warning-500",thumb:"bg-white border-2 border-warning-500 text-warning-600 focus-visible:ring-2 focus-visible:ring-warning-500/50 shadow-sm"},info:{track:"bg-neutral-200",filler:"bg-info-500",thumb:"bg-white border-2 border-info-500 text-info-600 focus-visible:ring-2 focus-visible:ring-info-500/50 shadow-sm"},neutral:{track:"bg-neutral-200",filler:"bg-neutral-800",thumb:"bg-white border-2 border-neutral-800 text-neutral-800 focus-visible:ring-2 focus-visible:ring-neutral-500/50 shadow-sm"}},soft:{primary:{track:"bg-primary-100",filler:"bg-primary-400",thumb:"bg-white border-2 border-primary-400 text-primary-500 focus-visible:ring-2 focus-visible:ring-primary-400/50 shadow-sm"},secondary:{track:"bg-secondary-100",filler:"bg-secondary-400",thumb:"bg-white border-2 border-secondary-400 text-secondary-500 focus-visible:ring-2 focus-visible:ring-secondary-400/50 shadow-sm"},error:{track:"bg-error-100",filler:"bg-error-400",thumb:"bg-white border-2 border-error-400 text-error-500 focus-visible:ring-2 focus-visible:ring-error-400/50 shadow-sm"},success:{track:"bg-success-100",filler:"bg-success-400",thumb:"bg-white border-2 border-success-400 text-success-500 focus-visible:ring-2 focus-visible:ring-success-400/50 shadow-sm"},warning:{track:"bg-warning-100",filler:"bg-warning-400",thumb:"bg-white border-2 border-warning-400 text-warning-500 focus-visible:ring-2 focus-visible:ring-warning-400/50 shadow-sm"},info:{track:"bg-info-100",filler:"bg-info-400",thumb:"bg-white border-2 border-info-400 text-info-500 focus-visible:ring-2 focus-visible:ring-info-400/50 shadow-sm"},neutral:{track:"bg-neutral-200",filler:"bg-neutral-600",thumb:"bg-white border-2 border-neutral-600 text-neutral-600 focus-visible:ring-2 focus-visible:ring-neutral-400/50 shadow-sm"}},outline:{primary:{track:"bg-transparent border border-neutral-300",filler:"bg-primary-500",thumb:"bg-white border-2 border-primary-500 text-primary-600 focus-visible:ring-2 focus-visible:ring-primary-500/50 shadow-sm"},secondary:{track:"bg-transparent border border-neutral-300",filler:"bg-secondary-500",thumb:"bg-white border-2 border-secondary-500 text-secondary-600 focus-visible:ring-2 focus-visible:ring-secondary-500/50 shadow-sm"},error:{track:"bg-transparent border border-neutral-300",filler:"bg-error-500",thumb:"bg-white border-2 border-error-500 text-error-600 focus-visible:ring-2 focus-visible:ring-error-500/50 shadow-sm"},success:{track:"bg-transparent border border-neutral-300",filler:"bg-success-500",thumb:"bg-white border-2 border-success-500 text-success-600 focus-visible:ring-2 focus-visible:ring-success-500/50 shadow-sm"},warning:{track:"bg-transparent border border-neutral-300",filler:"bg-warning-500",thumb:"bg-white border-2 border-warning-500 text-warning-600 focus-visible:ring-2 focus-visible:ring-warning-500/50 shadow-sm"},info:{track:"bg-transparent border border-neutral-300",filler:"bg-info-500",thumb:"bg-white border-2 border-info-500 text-info-600 focus-visible:ring-2 focus-visible:ring-info-500/50 shadow-sm"},neutral:{track:"bg-transparent border border-neutral-300",filler:"bg-neutral-800",thumb:"bg-white border-2 border-neutral-800 text-neutral-800 focus-visible:ring-2 focus-visible:ring-neutral-500/50 shadow-sm"}},other:{primary:{track:"",filler:"",thumb:""},secondary:{track:"",filler:"",thumb:""},error:{track:"",filler:"",thumb:""},success:{track:"",filler:"",thumb:""},warning:{track:"",filler:"",thumb:""},info:{track:"",filler:"",thumb:""},neutral:{track:"",filler:"",thumb:""}}};var zl=require("react"),C0=Ko(require("@radix-ui/react-slider"),1);var vs=require("react/jsx-runtime");function ia({id:e,thumbIdx:t,value:r,orientation:o,size:n,thumbRadiusClass:i,thumbThemeStyles:a,thumbClassName:s="",tooltipClassName:l="",state:f,label:u,helperId:w,tooltipMode:g="none",tooltipPlacement:m,formatTooltip:h}){let{isLoading:b=!1,showSpinner:x=!1,disabled:S=!1,readOnly:k=!1,isRequired:v=!1,isInvalid:p=!1,isRange:d=!1,hasDescription:y=!1}=f??{},c=C(n,mi,"md"),[T,R]=(0,zl.useState)(!1),[N,D]=(0,zl.useState)(!1),[M,F]=(0,zl.useState)(!1),P;g==="always"?P=!0:g==="active"?P=M||N:g==="hover"?P=T||M||N:g==="none"&&(P=!1);let I=m||(o==="vertical"?"right":"top"),z=h?h(r):r.toString(),B=typeof z=="string"||typeof z=="number"?String(z):void 0,V=(0,vs.jsx)(C0.Thumb,{id:`${e}-thumb-${t}`,tabIndex:S||b?-1:0,"aria-busy":b,"aria-disabled":S||b,"aria-readonly":k,"aria-required":v,"aria-invalid":p,"aria-errormessage":p?w:void 0,"aria-describedby":y?w:void 0,"aria-valuetext":B,"aria-orientation":o,"aria-label":typeof u=="string"?`${u} ${d?t===0?"minimum":"maximum":""}`:`Slider ${d?t===0?"min":"max":""}`,onFocus:()=>D(!0),onBlur:()=>D(!1),onPointerEnter:()=>R(!0),onPointerLeave:()=>R(!1),onPointerDown:()=>F(!0),onPointerUp:()=>F(!1),className:`block relative z-10 select-none outline-none transition-transform duration-100 ease-out ${S||k?"cursor-not-allowed opacity-60 shadow-none":"cursor-grab active:cursor-grabbing hover:scale-105"} ${c.thumb} ${i} ${a} ${M&&!S&&!b?"scale-110 ring-4 ring-primary-500/20":""} ${s}`,children:b&&x&&(0,vs.jsx)("div",{className:"absolute inset-0 flex items-center justify-center p-0.5","aria-hidden":"true",children:(0,vs.jsx)(Re,{className:"size-full animate-spin text-current"})})});return g!=="none"?(0,vs.jsx)(na,{content:z,placement:I,open:P,size:c.tooltipSize,className:l,disabled:S||b,children:V}):V}function Il(e,t,r){return Math.min(Math.max(e,t),r)}function aa(e,t,r){return r<=t?0:Il((e-t)/(r-t)*100,0,100)}var gi=require("react/jsx-runtime");function ys({marks:e,min:t,max:r,step:o,orientation:n,size:i,markClassName:a=""}){if(!e)return null;let s=[];if(Array.isArray(e))s=e;else if(e===!0&&o>0){let f=Math.floor((r-t)/o);if(f<=20)for(let u=0;u<=f;u++){let w=t+u*o;s.push({value:w,label:w.toString()})}}if(!s.length)return null;let l=C(i,mi,"md");return(0,gi.jsx)("div",{className:`relative w-full ${n==="vertical"?"h-full":"mt-2"}`,"aria-hidden":"true",children:s.map(f=>{let u=aa(f.value,t,r);return(0,gi.jsx)("div",{className:`absolute flex items-center justify-center select-none text-neutral-500 ${l.markText} ${a}`,style:n==="vertical"?{bottom:`${u}%`,left:"100%",transform:"translateY(50%) translateX(6px)"}:{left:`${u}%`,transform:"translateX(-50%)"},children:f.label??f.value},f.value)})})}function ws({showSteps:e,min:t,max:r,step:o,orientation:n,size:i,isRange:a,currentValues:s}){if(!e||o<=0)return null;let l=Math.floor((r-t)/o);if(l>100)return null;let f=C(i,mi,"md"),u=[];for(let w=0;w<=l;w++){let g=t+w*o,m=aa(g,t,r),h=a?g>=(s[0]??t)&&g<=(s[1]??r):g<=(s[0]??t);u.push((0,gi.jsx)("span",{"aria-hidden":"true",className:`absolute rounded-full -translate-x-1/2 -translate-y-1/2 pointer-events-none transition-colors duration-150 ${f.stepDot} ${h?"bg-white/80":"bg-neutral-400/60"}`,style:n==="vertical"?{bottom:`${m}%`,left:"50%"}:{left:`${m}%`,top:"50%"}},`step-dot-${g}`))}return(0,gi.jsx)(gi.Fragment,{children:u})}var vt=require("react/jsx-runtime");function la({config:e,value:t,defaultValue:r,min:o=0,max:n=100,step:i=1,minStepsBetweenThumbs:a=0,inverted:s=!1,size:l,variant:f,color:u,radius:w,thumbRadius:g,orientation:m="horizontal",label:h,labelPlacement:b="top",formatValue:x,showTooltip:S="none",tooltipPlacement:k,formatTooltip:v,marks:p=!1,startContent:d,endContent:y,disabled:c=!1,readOnly:T=!1,helperText:R,errorMessage:N,name:D,id:M,onChange:F,onChangeEnd:P,className:I="",wrapperClassName:z="",trackWrapperClassName:B="",trackClassName:V="",fillerClassName:Y="",thumbClassName:L="",labelClassName:E="",valueClassName:O="",helperClassName:A="",tooltipClassName:U="",markClassName:G="",ref:K}){let{isRequired:q=!1,isInvalid:X=!1,isLoading:fe=!1,showSpinner:ae=!1,showSteps:_=!1,showValue:Z=!1,isFullWidth:he=!0}=e??{},xe=(0,Ml.useId)(),$=M||xe,re=`${$}-helper`,ee=!!(X||N),de=ee?"error":u,ne=Array.isArray(t??r),ze=t!==void 0,[ve,Ce]=(0,Ml.useState)(()=>r!==void 0?Array.isArray(r)?r:[r]:ne?[o,n]:[o]),J=ze?Array.isArray(t)?t:t!==void 0?[t]:void 0:void 0,j=ze?Array.isArray(t)?[t[0]??o,t[1]??n]:[t??o,0]:ne?[ve[0]??o,ve[1]??n]:[ve[0]??o,0],oe=H=>{if(c||T||fe)return;ze||Ce(H);let se=ne?[H[0]??o,H[1]??n]:H[0]??o;F?.(se)},ye=H=>{if(c||T||fe)return;let se=ne?[H[0]??o,H[1]??n]:H[0]??o;P?.(se)},ue=C(l,mi,"md"),ce=C(w,fu,"full"),ke=C(g,fu,"full"),Te=f==="other"?{track:"",filler:"",thumb:""}:C(de,C(f,w0,"filled"),"primary"),pe=Te.track,W=Te.filler,me=Te.thumb,De=()=>{if(!h&&!Z)return null;let H="";x?H=x(ne?j:j[0]):ne?H=`${j[0]} - ${j[1]}`:H=`${j[0]}`;let se=ee?"text-error-600 font-medium":"text-neutral-900";return(0,vt.jsxs)("div",{className:"flex items-center justify-between gap-2 mb-1.5 select-none",children:[h&&(0,vt.jsxs)("label",{htmlFor:`${$}-thumb-0`,className:`font-medium ${se} ${ue.label} ${c?"opacity-60 cursor-not-allowed":"cursor-pointer"} ${E}`,children:[h,q&&(0,vt.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),Z&&(0,vt.jsx)("span",{className:`select-none text-neutral-700 ${ue.value} ${O}`,"aria-hidden":"true",children:H})]})},ie=ne?[j[0],j[1]]:[j[0]];return(0,vt.jsxs)("div",{ref:K,className:`group/field flex flex-col ${he?"w-full":"inline-flex"} ${c?"opacity-60 cursor-not-allowed":""} ${z||I}`,children:[b==="top"&&De(),(0,vt.jsxs)("div",{className:`flex items-center ${ue.gap} ${m==="vertical"?"flex-col h-48":"flex-row w-full"} ${B}`,children:[b==="left"&&De(),d&&(0,vt.jsx)("div",{className:"inline-flex shrink-0 items-center justify-center select-none text-neutral-500","aria-hidden":"true",children:d}),(0,vt.jsxs)(sa.Root,{min:o,max:n,step:i,minStepsBetweenThumbs:a,inverted:s,orientation:m,disabled:c||fe||T,value:J,defaultValue:r!==void 0?Array.isArray(r)?r:[r]:void 0,onValueChange:oe,onValueCommit:ye,className:`relative flex items-center select-none touch-none ${m==="vertical"?"flex-col h-full w-auto justify-center":"w-full h-auto justify-center"} ${c||T?"cursor-not-allowed":"cursor-pointer"}`,children:[(0,vt.jsxs)(sa.Track,{className:`relative overflow-hidden ${m==="vertical"?`${ue.trackVertical} h-full`:`${ue.trackHorizontal} w-full`} ${ce} ${pe} ${V}`,children:[(0,vt.jsx)(ws,{showSteps:_,min:o,max:n,step:i,orientation:m,size:l||"md",isRange:ne,currentValues:j}),(0,vt.jsx)(sa.Range,{className:`absolute ${W} ${ce} ${Y}`})]}),ie.map((H,se)=>{let Ie=ne?se===0?`${$}-thumb-min`:`${$}-thumb-max`:`${$}-thumb-single`;return(0,vt.jsx)(ia,{id:$,thumbIdx:se,value:H,orientation:m,size:l||"md",thumbRadiusClass:ke,thumbThemeStyles:me,thumbClassName:L,tooltipClassName:U,state:{isLoading:fe,showSpinner:ae,disabled:c,readOnly:T,isRequired:q,isInvalid:ee,isRange:ne,hasDescription:!!(ee||R)},label:h,helperId:re,tooltipMode:S,tooltipPlacement:k,formatTooltip:v},Ie)})]}),y&&(0,vt.jsx)("div",{className:"inline-flex shrink-0 items-center justify-center select-none text-neutral-500","aria-hidden":"true",children:y}),b==="right"&&De()]}),(0,vt.jsx)(ys,{marks:p,min:o,max:n,step:i,orientation:m,size:l||"md",markClassName:G}),(0,vt.jsx)(Ae,{id:re,helperText:R,errorMessage:N,sizeClassName:ue.helper,className:A}),D&&(0,vt.jsx)(vt.Fragment,{children:ne?(0,vt.jsxs)(vt.Fragment,{children:[(0,vt.jsx)("input",{type:"hidden",name:`${D}[0]`,value:j[0],disabled:c}),(0,vt.jsx)("input",{type:"hidden",name:`${D}[1]`,value:j[1],disabled:c})]}):(0,vt.jsx)("input",{type:"hidden",name:D,value:j[0],disabled:c})})]})}var hi=require("react");var Fl={sm:{header:"py-2.5 px-3.5 text-sm",content:"px-3.5 pb-3 text-sm text-neutral-600",title:"font-medium leading-snug",description:"text-xs text-neutral-500 mt-0.5",icon:"size-4",startIcon:"size-4",gap:"gap-2.5"},md:{header:"py-3.5 px-4 text-base",content:"px-4 pb-4 text-sm text-neutral-600",title:"font-semibold leading-snug",description:"text-xs text-neutral-500 mt-1",icon:"size-4.5",startIcon:"size-4.5",gap:"gap-3"},lg:{header:"py-4.5 px-5 text-lg",content:"px-5 pb-5 text-base text-neutral-600",title:"font-semibold leading-snug",description:"text-sm text-neutral-500 mt-1",icon:"size-5",startIcon:"size-5",gap:"gap-3.5"}},El={none:"rounded-none",sm:"rounded-md",md:"rounded-xl",lg:"rounded-2xl",xl:"rounded-3xl",full:"rounded-3xl"},S0={outlined:{primary:"border border-primary-200 bg-white divide-y divide-primary-100 overflow-hidden",secondary:"border border-secondary-200 bg-white divide-y divide-secondary-100 overflow-hidden",neutral:"border border-neutral-200 bg-white divide-y divide-neutral-200 overflow-hidden",error:"border border-error-200 bg-white divide-y divide-error-100 overflow-hidden",success:"border border-success-200 bg-white divide-y divide-success-100 overflow-hidden",warning:"border border-warning-200 bg-white divide-y divide-warning-100 overflow-hidden",info:"border border-info-200 bg-white divide-y divide-info-100 overflow-hidden"},filled:{primary:"bg-primary-50/40 border border-primary-100 divide-y divide-primary-100/80 overflow-hidden",secondary:"bg-secondary-50/40 border border-secondary-100 divide-y divide-secondary-100/80 overflow-hidden",neutral:"bg-neutral-50 border border-neutral-200/60 divide-y divide-neutral-200/60 overflow-hidden",error:"bg-error-50/40 border border-error-100 divide-y divide-error-100/80 overflow-hidden",success:"bg-success-50/40 border border-success-100 divide-y divide-success-100/80 overflow-hidden",warning:"bg-warning-50/40 border border-warning-100 divide-y divide-warning-100/80 overflow-hidden",info:"bg-info-50/40 border border-info-100 divide-y divide-info-100/80 overflow-hidden"},separated:{primary:"bg-transparent border-0 space-y-3",secondary:"bg-transparent border-0 space-y-3",neutral:"bg-transparent border-0 space-y-3",error:"bg-transparent border-0 space-y-3",success:"bg-transparent border-0 space-y-3",warning:"bg-transparent border-0 space-y-3",info:"bg-transparent border-0 space-y-3"},ghost:{primary:"bg-transparent border-0 divide-y divide-neutral-200/70",secondary:"bg-transparent border-0 divide-y divide-neutral-200/70",neutral:"bg-transparent border-0 divide-y divide-neutral-200/70",error:"bg-transparent border-0 divide-y divide-neutral-200/70",success:"bg-transparent border-0 divide-y divide-neutral-200/70",warning:"bg-transparent border-0 divide-y divide-neutral-200/70",info:"bg-transparent border-0 divide-y divide-neutral-200/70"}},T0={outlined:{primary:"",secondary:"",neutral:"",error:"",success:"",warning:"",info:""},filled:{primary:"",secondary:"",neutral:"",error:"",success:"",warning:"",info:""},ghost:{primary:"",secondary:"",neutral:"",error:"",success:"",warning:"",info:""},separated:{primary:"bg-white border border-primary-200 shadow-xs overflow-hidden",secondary:"bg-white border border-secondary-200 shadow-xs overflow-hidden",neutral:"bg-white border border-neutral-200 shadow-xs overflow-hidden",error:"bg-white border border-error-200 shadow-xs overflow-hidden",success:"bg-white border border-success-200 shadow-xs overflow-hidden",warning:"bg-white border border-warning-200 shadow-xs overflow-hidden",info:"bg-white border border-info-200 shadow-xs overflow-hidden"}},k0={outlined:{primary:"bg-primary-50/40",secondary:"bg-secondary-50/40",neutral:"bg-neutral-50/80",error:"bg-error-50/40",success:"bg-success-50/40",warning:"bg-warning-50/40",info:"bg-info-50/40"},filled:{primary:"bg-primary-50/80",secondary:"bg-secondary-50/80",neutral:"bg-neutral-100/70",error:"bg-error-50/80",success:"bg-success-50/80",warning:"bg-warning-50/80",info:"bg-info-50/80"},separated:{primary:"bg-primary-50/40",secondary:"bg-secondary-50/40",neutral:"bg-neutral-50/80",error:"bg-error-50/40",success:"bg-success-50/40",warning:"bg-warning-50/40",info:"bg-info-50/40"},ghost:{primary:"bg-transparent",secondary:"bg-transparent",neutral:"bg-transparent",error:"bg-transparent",success:"bg-transparent",warning:"bg-transparent",info:"bg-transparent"}},R0={primary:{focusRing:"focus-visible:ring-primary-500",title:"text-primary-700",activeIndicator:"text-primary-600"},secondary:{focusRing:"focus-visible:ring-secondary-500",title:"text-secondary-700",activeIndicator:"text-secondary-600"},neutral:{focusRing:"focus-visible:ring-neutral-500",title:"text-neutral-900",activeIndicator:"text-neutral-700"},error:{focusRing:"focus-visible:ring-error-500",title:"text-error-700",activeIndicator:"text-error-600"},success:{focusRing:"focus-visible:ring-success-500",title:"text-success-700",activeIndicator:"text-success-600"},warning:{focusRing:"focus-visible:ring-warning-500",title:"text-warning-700",activeIndicator:"text-warning-600"},info:{focusRing:"focus-visible:ring-info-500",title:"text-info-700",activeIndicator:"text-info-600"}};var ca=require("react"),pu=(0,ca.createContext)(null),mu=(0,ca.createContext)(null);function an(){let e=(0,ca.useContext)(pu);if(!e)throw new Error("Collapse compound components must be rendered within a <Collapse> provider");return e}function bi(){let e=(0,ca.useContext)(mu);if(!e)throw new Error("Collapse subcomponents (CollapseHeader, CollapseContent) must be rendered within a <CollapsePanel>");return e}var gu=require("react/jsx-runtime");function N0(e){return e==null?[]:Array.isArray(e)?e:[e]}function $l({activeKey:e,defaultActiveKey:t,onChange:r,accordion:o=!1,size:n="md",variant:i="outlined",color:a="primary",radius:s="md",expandIconPosition:l="right",expandIcon:f,destroyInactivePanel:u=!1,className:w="",style:g,children:m,ref:h,...b}){let x=e!==void 0,[S,k]=(0,hi.useState)(()=>N0(t)),v=(0,hi.useMemo)(()=>new Set(x?N0(e):S),[x,e,S]),p=(0,hi.useCallback)(R=>{let N,D=v.has(R);if(o)N=D?[]:[R];else{let M=Array.from(v);D?N=M.filter(F=>F!==R):N=[...M,R]}x||k(N),r?.(o?N[0]??"":N)},[o,v,x,r]),d=i==="other"?"":C(a,C(i,S0,"outlined"),"primary"),y=i!=="separated"&&i!=="ghost"?C(s,El,"md"):"",c=["w-full transition-colors",d,y,w].filter(Boolean).join(" "),T=(0,hi.useMemo)(()=>({activeKeys:v,handleToggle:p,accordion:o,size:n,variant:i,color:a,radius:s,expandIconPosition:l,expandIcon:f,destroyInactivePanel:u}),[v,p,o,n,i,a,s,l,f,u]);return(0,gu.jsx)(pu.Provider,{value:T,children:(0,gu.jsx)("div",{ref:h,className:c,style:g,...b,children:m})})}var Bl=require("react");var kr=require("react/jsx-runtime");function ua({startIcon:e,description:t,extra:r,showArrow:o=!0,children:n,className:i="",ref:a,onClick:s,onKeyDown:l,...f}){let{size:u,variant:w,color:g,expandIconPosition:m,expandIcon:h}=an(),{isActive:b,disabled:x,headerId:S,panelId:k,onToggle:v}=bi(),p=C(u,Fl,"md"),d=C(g,R0,"primary"),y=w==="other"?"":C(g,C(w,k0,"outlined"),"primary"),c=o&&m!=="none",T=()=>c?typeof h=="function"?(0,kr.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 transition-transform duration-200 text-neutral-400 ${b?"rotate-180":"rotate-0"}`,"aria-hidden":"true",children:h({isActive:b,disabled:x})}):h?(0,kr.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 transition-transform duration-200 text-neutral-400 ${b?"rotate-180":"rotate-0"}`,"aria-hidden":"true",children:h}):(0,kr.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 transition-transform duration-200 text-neutral-400 ${b?"rotate-180 text-neutral-700":"rotate-0"}`,"aria-hidden":"true",children:(0,kr.jsx)(zt,{className:p.icon})}):null,R=["w-full flex items-center justify-between transition-colors duration-150 select-none",p.header,p.gap,x?"cursor-not-allowed opacity-60":y,i].filter(Boolean).join(" "),N=["flex items-center flex-1 min-w-0 text-left outline-none cursor-pointer bg-transparent border-0 p-0",p.gap,x?"cursor-not-allowed pointer-events-none":`${d.focusRing} focus-visible:ring-2 focus-visible:ring-offset-1 rounded-lg`].filter(Boolean).join(" ");return(0,kr.jsxs)("div",{className:R,children:[(0,kr.jsxs)("button",{ref:a,id:S,type:"button","aria-expanded":b,"aria-controls":k,"aria-disabled":x?!0:void 0,disabled:x,onClick:D=>{v(),s?.(D)},onKeyDown:D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),v()),l?.(D)},className:N,...f,children:[m==="left"&&T(),(0,kr.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e&&(0,kr.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 ${d.activeIndicator} ${p.startIcon}`,"aria-hidden":"true",children:e}),(0,kr.jsxs)("div",{className:"flex flex-col min-w-0 flex-1",children:[(0,kr.jsx)("span",{className:`truncate ${p.title} ${d.title}`,children:n}),t&&(0,kr.jsx)("span",{className:`line-clamp-2 ${p.description}`,children:t})]})]}),m==="right"&&!r&&T()]}),r&&(0,kr.jsxs)("div",{className:"inline-flex items-center gap-2.5 shrink-0 ml-3",children:[r,m==="right"&&T()]})]})}var Ll=require("react/jsx-runtime");function da({destroyInactivePanel:e,children:t,className:r="",style:o,ref:n,...i}){let{size:a,destroyInactivePanel:s}=an(),{isActive:l,headerId:f,panelId:u}=bi(),w=C(a,Fl,"md");return(0,Ll.jsx)("div",{ref:n,id:u,role:"region","aria-labelledby":f,"aria-hidden":!l,"data-state":l?"open":"closed",className:`grid transition-[grid-template-rows] duration-200 ease-in-out ${l?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,style:o,...i,children:(0,Ll.jsx)("div",{className:"overflow-hidden",children:(!(e??s)||l)&&(0,Ll.jsx)("div",{className:`${w.content} ${r}`,children:t})})})}var sn=require("react/jsx-runtime");function Hl({value:e,label:t,description:r,startIcon:o,extra:n,disabled:i=!1,showArrow:a=!0,headerClassName:s="",contentClassName:l="",destroyInactivePanel:f,className:u="",children:w,ref:g,...m}){let h=(0,Bl.useId)(),{activeKeys:b,handleToggle:x,variant:S,color:k,radius:v}=an(),p=b.has(e),d=`collapse-header-${e??h}`,y=`collapse-panel-${e??h}`,c=(0,Bl.useMemo)(()=>({value:e,isActive:p,disabled:i,headerId:d,panelId:y,onToggle:()=>!i&&x(e)}),[e,p,i,d,y,x]),T=S==="separated"?C(v,El,"md"):"",N=["group",S==="other"?"":C(k,C(S,T0,"outlined"),"primary"),T,i?"opacity-50 cursor-not-allowed":"",u].filter(Boolean).join(" ");return(0,sn.jsx)(mu.Provider,{value:c,children:(0,sn.jsx)("div",{ref:g,className:N,"data-state":p?"open":"closed",...m,children:t!==void 0?(0,sn.jsxs)(sn.Fragment,{children:[(0,sn.jsx)(ua,{startIcon:o,description:r,extra:n,showArrow:a,className:s,children:t}),(0,sn.jsx)(da,{destroyInactivePanel:f,className:l,children:w})]}):w})})}var Vl=require("react"),bu=require("react/jsx-runtime");function Al({open:e,defaultOpen:t=!1,destroyInactivePanel:r=!1,className:o="",children:n,ref:i,...a}){let s=(0,Vl.useId)(),l=e!==void 0,[f]=(0,Vl.useState)(t),u=l?e:f;return(0,bu.jsx)("div",{ref:i,id:s,role:"region","aria-hidden":!u,"data-state":u?"open":"closed",className:`grid transition-[grid-template-rows] duration-200 ease-in-out ${u?"grid-rows-[1fr]":"grid-rows-[0fr]"} ${o}`,...a,children:(0,bu.jsx)("div",{className:"overflow-hidden",children:(!r||u)&&n})})}var xi=require("react");var Ol=require("react"),hu=(0,Ol.createContext)(null);function ln(){let e=(0,Ol.useContext)(hu);if(!e)throw new Error("Tabs compound components must be used within <Tabs>");return e}var xu=require("react/jsx-runtime");function Dn({activeKey:e,defaultActiveKey:t,onChange:r,onClose:o,size:n="md",variant:i="line",color:a="primary",radius:s="md",orientation:l="horizontal",placement:f="top",fullWidth:u=!1,disabled:w=!1,destroyInactiveTabPane:g=!1,className:m="",children:h,ref:b,...x}){let S=e!==void 0,[k,v]=(0,xi.useState)(t),p=S?e:k,d=(0,xi.useCallback)(D=>{S||v(D),r?.(D)},[S,r]),y=(0,xi.useCallback)(D=>{o?.(D)},[o]),c=(0,xi.useMemo)(()=>({activeKey:p,setActiveKey:d,size:n,variant:i,color:a,radius:s,orientation:l,placement:f,fullWidth:u,disabled:w,destroyInactiveTabPane:g,onCloseTab:y}),[p,d,n,i,a,s,l,f,u,w,g,y]),T=l==="vertical",R;T?R=f==="right"?"flex flex-row-reverse gap-4 items-start":"flex flex-row gap-4 items-start":R=f==="bottom"?"flex flex-col-reverse gap-3":"flex flex-col gap-3";let N=["w-full",R,m].filter(Boolean).join(" ");return(0,xu.jsx)("div",{ref:b,className:N,...x,children:(0,xu.jsx)(hu.Provider,{value:c,children:h})})}var E0=require("@floating-ui/react");var D0={sm:{tab:"px-3 py-1.5 text-xs font-medium",icon:"size-3.5",gap:"gap-1.5",badge:"text-[10px] px-1.5 py-0.5 min-w-4 h-4",closeBtn:"size-3.5 -mr-1 p-0.5"},md:{tab:"px-4 py-2 text-sm font-medium",icon:"size-4",gap:"gap-2",badge:"text-xs px-2 py-0.5 min-w-5 h-5",closeBtn:"size-4 -mr-1 p-0.5"},lg:{tab:"px-5 py-2.5 text-base font-medium",icon:"size-5",gap:"gap-2.5",badge:"text-xs px-2.5 py-0.5 min-w-5.5 h-5.5",closeBtn:"size-4.5 -mr-1.5 p-0.5"}},Gl={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-full"},P0={line:(e,t)=>e==="vertical"?t==="right"?"border-l border-neutral-200 gap-1":"border-r border-neutral-200 gap-1":t==="bottom"?"border-t border-neutral-200 gap-2":"border-b border-neutral-200 gap-2",solid:()=>"bg-neutral-100 p-1 gap-1",bordered:()=>"border border-neutral-200 p-1 gap-1 bg-neutral-50/50",flat:()=>"bg-neutral-100/60 p-1 gap-1"},z0={primary:{line:{active:"text-primary-700 font-semibold",inactive:"text-neutral-600 hover:text-primary-600"},solid:{active:"text-primary-700 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},bordered:{active:"text-primary-700 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},flat:{active:"text-primary-700 font-semibold",inactive:"text-neutral-600 hover:text-primary-700"}},secondary:{line:{active:"text-secondary-700 font-semibold",inactive:"text-neutral-600 hover:text-secondary-600"},solid:{active:"text-secondary-700 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},bordered:{active:"text-secondary-700 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},flat:{active:"text-secondary-700 font-semibold",inactive:"text-neutral-600 hover:text-secondary-700"}},neutral:{line:{active:"text-neutral-950 font-semibold",inactive:"text-neutral-600 hover:text-neutral-950"},solid:{active:"text-neutral-950 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},bordered:{active:"text-neutral-950 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},flat:{active:"text-neutral-950 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"}},error:{line:{active:"text-error-700 font-semibold",inactive:"text-neutral-600 hover:text-error-600"},solid:{active:"text-error-700 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},bordered:{active:"text-error-700 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},flat:{active:"text-error-700 font-semibold",inactive:"text-neutral-600 hover:text-error-700"}},success:{line:{active:"text-success-700 font-semibold",inactive:"text-neutral-600 hover:text-success-600"},solid:{active:"text-success-700 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},bordered:{active:"text-success-700 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},flat:{active:"text-success-700 font-semibold",inactive:"text-neutral-600 hover:text-success-700"}},warning:{line:{active:"text-warning-700 font-semibold",inactive:"text-neutral-600 hover:text-warning-600"},solid:{active:"text-warning-700 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},bordered:{active:"text-warning-700 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},flat:{active:"text-warning-700 font-semibold",inactive:"text-neutral-600 hover:text-warning-700"}},info:{line:{active:"text-info-700 font-semibold",inactive:"text-neutral-600 hover:text-info-600"},solid:{active:"text-info-700 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},bordered:{active:"text-info-700 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},flat:{active:"text-info-700 font-semibold",inactive:"text-neutral-600 hover:text-info-700"}}},I0={line:{primary:"bg-primary-600",secondary:"bg-secondary-600",neutral:"bg-neutral-900",error:"bg-error-600",success:"bg-success-600",warning:"bg-warning-600",info:"bg-info-600"},solid:{primary:"bg-white shadow-xs border border-neutral-200/70",secondary:"bg-white shadow-xs border border-neutral-200/70",neutral:"bg-white shadow-xs border border-neutral-200/70",error:"bg-white shadow-xs border border-neutral-200/70",success:"bg-white shadow-xs border border-neutral-200/70",warning:"bg-white shadow-xs border border-neutral-200/70",info:"bg-white shadow-xs border border-neutral-200/70"},bordered:{primary:"bg-white border border-neutral-300 shadow-xs",secondary:"bg-white border border-neutral-300 shadow-xs",neutral:"bg-white border border-neutral-300 shadow-xs",error:"bg-white border border-neutral-300 shadow-xs",success:"bg-white border border-neutral-300 shadow-xs",warning:"bg-white border border-neutral-300 shadow-xs",info:"bg-white border border-neutral-300 shadow-xs"},flat:{primary:"bg-primary-100/90",secondary:"bg-secondary-100/90",neutral:"bg-neutral-200/90",error:"bg-error-100/90",success:"bg-success-100/90",warning:"bg-warning-100/90",info:"bg-info-100/90"}};var Ar=require("react"),M0=typeof window<"u"?Ar.useLayoutEffect:Ar.useEffect;function F0({activeKey:e,orientation:t="horizontal",placement:r="top",variant:o="line",color:n="primary",radius:i="md"}={}){let a=(0,Ar.useRef)(null),[s,l]=(0,Ar.useState)({opacity:0}),[f,u]=(0,Ar.useState)(!1),[w,g]=(0,Ar.useState)(!1),m=(0,Ar.useCallback)(()=>{if(!a.current||t==="vertical"){u(!1),g(!1);return}let{scrollLeft:k,scrollWidth:v,clientWidth:p}=a.current,d=v-p;u(k>1),g(k<d-1)},[t]),h=(0,Ar.useCallback)(()=>{if(!a.current)return;m();let k=a.current.querySelector('[role="tab"][aria-selected="true"]');if(!k){l(T=>({...T,opacity:0}));return}let v=k.closest("[data-tab-wrapper]")||k;v.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"});let{offsetLeft:p,offsetTop:d,offsetWidth:y,offsetHeight:c}=v;l(o==="line"?t==="vertical"?{transform:`translate3d(0, ${d}px, 0)`,height:`${c}px`,width:"2px",top:0,left:r==="right"?0:void 0,right:r!=="right"?0:void 0,opacity:1}:{transform:`translate3d(${p}px, 0, 0)`,width:`${y}px`,height:"2px",left:0,top:r==="bottom"?0:void 0,bottom:r!=="bottom"?0:void 0,opacity:1}:{transform:`translate3d(${p}px, ${d}px, 0)`,width:`${y}px`,height:`${c}px`,top:0,left:0,opacity:1})},[m,t,r,o]);return M0(()=>{h()},[h,e,o,t,r,n,i]),M0(()=>{h();let k=requestAnimationFrame(h),v=new ResizeObserver(h);if(a.current){v.observe(a.current);let d=a.current.querySelectorAll("[data-tab-wrapper], [role='tab']");for(let y of d)v.observe(y)}let p=()=>h();return window.addEventListener("resize",p),()=>{cancelAnimationFrame(k),v.disconnect(),window.removeEventListener("resize",p)}},[h]),{listRef:a,indicatorStyle:s,canScrollLeft:f,canScrollRight:w,checkScroll:m,handleScrollLeft:()=>{a.current&&a.current.scrollBy({left:-200,behavior:"smooth"})},handleScrollRight:()=>{a.current&&a.current.scrollBy({left:200,behavior:"smooth"})},handleKeyDown:k=>{if(!a.current)return;let v=Array.from(a.current.querySelectorAll('[role="tab"]:not([disabled])'));if(!v.length)return;let p=v.findIndex(R=>R===document.activeElement||R.getAttribute("aria-selected")==="true"),d=-1,y=t==="horizontal",c=y?"ArrowRight":"ArrowDown",T=y?"ArrowLeft":"ArrowUp";k.key===c?(k.preventDefault(),d=(p+1)%v.length):k.key===T?(k.preventDefault(),d=(p-1+v.length)%v.length):k.key==="Home"?(k.preventDefault(),d=0):k.key==="End"&&(k.preventDefault(),d=v.length-1),d>=0&&v[d]&&(v[d]?.focus(),v[d]?.click())}}}var No=require("react/jsx-runtime");function Pn({children:e,className:t="",extra:r,centered:o=!1,ref:n,...i}){let{activeKey:a,orientation:s="horizontal",placement:l="top",variant:f="line",color:u="primary",radius:w="md",fullWidth:g=!1}=ln(),{listRef:m,indicatorStyle:h,canScrollLeft:b,canScrollRight:x,checkScroll:S,handleScrollLeft:k,handleScrollRight:v,handleKeyDown:p}=F0({activeKey:a,orientation:s,placement:l,variant:f,color:u,radius:w}),d=(0,E0.useMergeRefs)([m,n]),y=C(w,Gl,"md"),c=f==="other"?"":C(f,P0,"line"),T=typeof c=="function"?c(s,l):"",R=f==="other"?"":C(u,C(f,I0,"line"),"primary"),N=s==="vertical",D=b||x,F=["relative flex-1 min-w-0",N?"flex flex-col items-stretch justify-start w-full":`flex flex-row items-center overflow-x-auto overflow-y-hidden [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden scroll-smooth ${g?"w-full":""}`,o&&!N?"justify-center":"",f!=="line"?y:"",T,t].filter(Boolean).join(" "),P=["absolute pointer-events-none z-0 transition-all duration-300 ease-out",f!=="line"?y:"",R].filter(Boolean).join(" ");return(0,No.jsxs)("div",{className:N?"flex flex-col items-start gap-2 shrink-0 min-w-44":"flex items-center justify-between gap-1 w-full min-w-0",children:[!N&&D&&(0,No.jsx)("button",{type:"button","aria-label":"Scroll tabs left",disabled:!b,onClick:k,className:"shrink-0 flex items-center justify-center size-7 rounded-md text-neutral-500 hover:text-neutral-900 hover:bg-neutral-100 disabled:opacity-20 disabled:pointer-events-none transition-colors cursor-pointer focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500",children:(0,No.jsx)(Br,{className:"size-4"})}),(0,No.jsxs)("div",{ref:d,role:"tablist","aria-orientation":s,onKeyDown:p,onScroll:S,className:F,...i,children:[(0,No.jsx)("div",{"aria-hidden":"true",className:P,style:h}),e]}),!N&&D&&(0,No.jsx)("button",{type:"button","aria-label":"Scroll tabs right",disabled:!x,onClick:v,className:"shrink-0 flex items-center justify-center size-7 rounded-md text-neutral-500 hover:text-neutral-900 hover:bg-neutral-100 disabled:opacity-20 disabled:pointer-events-none transition-colors cursor-pointer focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500",children:(0,No.jsx)(sr,{className:"size-4"})}),r&&(0,No.jsx)("div",{className:N?"w-full mt-1":"shrink-0 ml-auto pl-1",children:r})]})}var $0=require("react"),L0=require("@floating-ui/react");var Do=require("react/jsx-runtime");function zn({value:e,label:t,startIcon:r,endIcon:o,badge:n,disabled:i=!1,closable:a=!1,onClose:s,className:l="",children:f,onClick:u,onKeyDown:w,ref:g,...m}){let{activeKey:h,setActiveKey:b,size:x,variant:S,color:k,radius:v,orientation:p,fullWidth:d,disabled:y,onCloseTab:c}=ln(),T=(0,$0.useRef)(null),R=(0,L0.useMergeRefs)([T,g]),N=y||i,D=h===e,M=G=>{N||(b(e),u?.(G))},F=G=>{G.stopPropagation(),!N&&(s?.(G),c?.(e))},P=C(x,D0,"md"),I=C(v,Gl,"md"),z=C(k,z0,"primary"),B=S==="other"?{active:"",inactive:""}:C(S,z,"line"),V=`tab-${e}`,Y=`tabpanel-${e}`,L=D?B.active:B.inactive,E=p==="vertical",O=["group relative z-10 inline-flex items-center select-none",E?"justify-start text-left w-full":"justify-center text-center",S!=="line"?I:"",d&&!E?"flex-1 text-center":"",N?"opacity-40 cursor-not-allowed pointer-events-none":"",l].filter(Boolean).join(" "),A=["inline-flex items-center cursor-pointer select-none bg-transparent",E?"justify-start text-left w-full":"justify-center text-center","transition-colors duration-200 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2",S!=="line"?I:"",P.tab,P.gap,a?"pr-1.5":"",d&&!E?"flex-1 text-center":"",L,N?"opacity-40 cursor-not-allowed pointer-events-none":""].filter(Boolean).join(" ");return(0,Do.jsxs)("div",{"data-tab-wrapper":!0,className:O,children:[(0,Do.jsxs)("button",{ref:R,id:V,type:"button",role:"tab","aria-selected":D,"aria-controls":Y,"aria-disabled":N?"true":void 0,tabIndex:D?0:-1,disabled:N,onClick:M,onKeyDown:G=>{if(a&&(G.key==="Delete"||G.key==="Backspace")){if(G.preventDefault(),G.stopPropagation(),N)return;s?.(G),c?.(e)}w?.(G)},className:A,...m,children:[r&&(0,Do.jsx)("span",{className:`shrink-0 inline-flex items-center justify-center transition-colors duration-200 ${P.icon}`,"aria-hidden":"true",children:r}),(0,Do.jsx)("span",{className:`truncate ${E?"flex-1 text-left":""}`,children:t||f}),n!=null&&(0,Do.jsx)("span",{className:`inline-flex items-center justify-center font-medium rounded-full bg-neutral-200/80 text-neutral-700 transition-colors duration-200 ${P.badge}`,children:n}),o&&(0,Do.jsx)("span",{className:`shrink-0 inline-flex items-center justify-center transition-colors duration-200 ${P.icon}`,"aria-hidden":"true",children:o})]}),a&&(0,Do.jsx)("button",{type:"button","aria-label":"Close tab",disabled:N,tabIndex:D?0:-1,onClick:F,className:`shrink-0 cursor-pointer rounded-full hover:bg-neutral-200/80 text-neutral-400 hover:text-neutral-700 transition-colors inline-flex items-center justify-center focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500 mr-2 ${P.closeBtn}`,children:(0,Do.jsx)(Ue,{className:"size-full pointer-events-none"})})]})}var B0=require("react/jsx-runtime");function jl({children:e,className:t="",ref:r,...o}){return(0,B0.jsx)("div",{ref:r,className:`w-full ${t}`,...o,children:e})}var H0=require("react/jsx-runtime");function Ul({value:e,children:t,className:r="",destroyInactiveTabPane:o,ref:n,...i}){let{activeKey:a,destroyInactiveTabPane:s}=ln(),l=a===e;if((o??s)&&!l)return null;let u=`tab-${e}`,w=`tabpanel-${e}`,g=["focus-visible:outline-hidden",l?"":"hidden",r].filter(Boolean).join(" ");return(0,H0.jsx)("div",{ref:n,id:w,role:"tabpanel",tabIndex:0,"aria-labelledby":u,hidden:!l,className:g,...i,children:t})}var Yl=require("react"),vu=(0,Yl.createContext)(null);function Xr(){let e=(0,Yl.useContext)(vu);if(!e)throw new Error("Carousel compound components (CarouselContent, CarouselSlide, CarouselPrevious, CarouselNext, CarouselPagination) must be used within <Carousel>");return e}var nt=require("react");function Cs({currentIndex:e,defaultIndex:t=0,onIndexChange:r,loop:o=!1,slidesToShow:n=1,slidesToScroll:i=1,spacing:a=0,autoPlay:s=!0,interval:l=3e3,transitionDuration:f=650,pauseOnHover:u=!0,pauseOnFocus:w=!0,draggable:g=!0,size:m="md",radius:h="md"}={}){let[b,x]=(0,nt.useState)(t),[S,k]=(0,nt.useState)(0),[v,p]=(0,nt.useState)(!1),[d,y]=(0,nt.useState)(0),[c,T]=(0,nt.useState)(!1),[R,N]=(0,nt.useState)(!1),D=(0,nt.useRef)(new Set),M=(0,nt.useRef)(null),F=(0,nt.useRef)(null),P=(0,nt.useRef)(0),I=(0,nt.useRef)(0),z=e!==void 0,B=z?e:b,V=Math.max(0,o?S-1:S-n),Y=(0,nt.useCallback)($=>{let re=$;o?S>0?re=(re+S)%S:re=0:re=Math.max(0,Math.min(re,V)),z||x(re),r?.(re)},[z,o,V,r,S]),L=o?S>1:B>0,E=o?S>1:B<S-n,O=(0,nt.useCallback)(()=>{L&&Y(B-i)},[B,L,Y,i]),A=(0,nt.useCallback)(()=>{E&&Y(B+i)},[B,E,Y,i]),U=(0,nt.useCallback)($=>{Y($)},[Y]),G=(0,nt.useCallback)($=>{D.current.add($),k(D.current.size)},[]),K=(0,nt.useCallback)($=>{D.current.delete($),k(D.current.size)},[]);(0,nt.useEffect)(()=>{if(!s||S<=n||u&&c||w&&R||v)return;let $=setInterval(()=>{o||B<S-n?A():U(0)},l);return()=>clearInterval($)},[B,s,l,v,R,c,o,w,u,A,U,n,S]);let q=(0,nt.useCallback)($=>{if(!g||S<=n||$.button!==0)return;let re=$.clientX;P.current=re,I.current=re,p(!0),y(0);let ee=$.currentTarget;try{ee.setPointerCapture($.pointerId)}catch{}},[g,n,S]),X=(0,nt.useCallback)($=>{if(!v)return;let re=$.clientX;I.current=re;let ee=re-P.current;if(!o){if(B===0&&ee>0){y(ee*.3);return}if(B>=S-n&&ee<0){y(ee*.3);return}}y(ee)},[B,v,o,n,S]),fe=(0,nt.useCallback)($=>{if(!v)return;p(!1);let re=I.current-P.current;Math.abs(re)>40&&(re>0?O():A()),y(0);try{$.currentTarget.releasePointerCapture($.pointerId)}catch{}},[v,A,O]),ae=(0,nt.useCallback)($=>{$.key==="ArrowLeft"?($.preventDefault(),O()):$.key==="ArrowRight"?($.preventDefault(),A()):$.key==="Home"?($.preventDefault(),U(0)):$.key==="End"&&($.preventDefault(),U(V))},[V,A,O,U]),_=(0,nt.useCallback)(()=>T(!0),[]),Z=(0,nt.useCallback)(()=>T(!1),[]),he=(0,nt.useCallback)(()=>N(!0),[]),xe=(0,nt.useCallback)(()=>N(!1),[]);return{currentIndex:B,totalSlides:S,slidesToShow:n,slidesToScroll:i,spacing:a,loop:o,canScrollPrev:L,canScrollNext:E,size:m,radius:h,transitionDuration:f,isDragging:v,dragOffset:d,scrollPrev:O,scrollNext:A,scrollTo:U,registerSlide:G,unregisterSlide:K,setTotalSlides:k,viewportRef:M,containerRef:F,handlePointerDown:q,handlePointerMove:X,handlePointerUp:fe,handlePointerCancel:fe,handleKeyDown:ae,handleMouseEnter:_,handleMouseLeave:Z,handleFocus:he,handleBlur:xe}}var Ss={sm:{arrowBtn:"size-6 p-0.5 text-xs",arrowIcon:"size-3",dot:"size-1.5",activeDot:"size-1.5",line:"w-3.5 h-1",activeLine:"w-6 h-1",fraction:"text-xs px-2 py-0.5",paginationWrapper:"px-2 py-1 gap-1.5",edgeInset:"left-1.5 right-1.5"},md:{arrowBtn:"size-8 p-1.5 text-sm",arrowIcon:"size-3.5",dot:"size-2",activeDot:"size-2",line:"w-5 h-1.5",activeLine:"w-8 h-1.5",fraction:"text-xs px-2.5 py-0.5 font-medium",paginationWrapper:"px-2.5 py-1 gap-2",edgeInset:"left-2 right-2"},lg:{arrowBtn:"size-9 p-2 text-sm",arrowIcon:"size-4",dot:"size-2.5",activeDot:"size-2.5",line:"w-7 h-2",activeLine:"w-11 h-2",fraction:"text-sm px-3 py-1 font-medium",paginationWrapper:"px-3 py-1.5 gap-2.5",edgeInset:"left-2.5 right-2.5"}},V0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},yu={glass:"bg-white/40 backdrop-blur-md border border-white/40 text-primary-950 shadow-md hover:bg-white/70 active:scale-90 disabled:opacity-25 disabled:pointer-events-none",filled:"bg-primary-600 text-white shadow-md hover:bg-primary-700 active:bg-primary-800 disabled:bg-neutral-300 disabled:text-neutral-500 disabled:opacity-50",outline:"border border-primary-600 text-primary-600 bg-white/70 backdrop-blur-sm hover:bg-primary-50 disabled:border-neutral-300 disabled:text-neutral-400",ghost:"text-primary-600 hover:bg-primary-100/60 active:bg-primary-200/60 disabled:text-neutral-400"},wu="bg-black/25 backdrop-blur-md border border-white/20 shadow-sm rounded-full",Ts={active:"bg-primary-600 shadow-sm",inactive:"bg-white/60 hover:bg-white/90 transition-colors"};var Cu=require("react/jsx-runtime");function Su({currentIndex:e,defaultIndex:t=0,onIndexChange:r,loop:o=!1,slidesToShow:n=1,slidesToScroll:i=1,spacing:a=0,autoPlay:s=!0,interval:l=3e3,transitionDuration:f=650,pauseOnHover:u=!0,pauseOnFocus:w=!0,draggable:g=!0,size:m="md",radius:h="md",children:b,className:x="",style:S,ref:k,...v}){let p=Cs({currentIndex:e,defaultIndex:t,onIndexChange:r,loop:o,slidesToShow:n,slidesToScroll:i,spacing:a,autoPlay:s,interval:l,transitionDuration:f,pauseOnHover:u,pauseOnFocus:w,draggable:g,size:m,radius:h}),d=C(h,V0,"md");return(0,Cu.jsx)(vu.Provider,{value:p,children:(0,Cu.jsx)("div",{ref:k,role:"region","aria-roledescription":"carousel","aria-label":"B\u0103ng chuy\u1EC1n",tabIndex:0,onKeyDown:p.handleKeyDown,onMouseEnter:p.handleMouseEnter,onMouseLeave:p.handleMouseLeave,onFocus:p.handleFocus,onBlur:p.handleBlur,className:`relative overflow-hidden group focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${d} ${x}`,style:S,...v,children:b})})}var Tu=require("react/jsx-runtime");function ku({children:e,className:t="",style:r,ref:o,...n}){let{currentIndex:i,slidesToShow:a,spacing:s,transitionDuration:l,isDragging:f,dragOffset:u,viewportRef:w,handlePointerDown:g,handlePointerMove:m,handlePointerUp:h,handlePointerCancel:b}=Xr(),x=typeof s=="number"?`${s}px`:s||"0px",S=`translateX(calc(-${i} * ((100% + ${x}) / ${a}) + ${u}px))`,k={display:"flex",flexDirection:"row",gap:x,transform:S,transition:f?"none":`transform ${l}ms cubic-bezier(0.25, 1, 0.5, 1)`,touchAction:"pan-y",width:"100%"};return(0,Tu.jsx)("div",{ref:w,className:`overflow-hidden relative w-full h-full cursor-grab ${f?"cursor-grabbing select-none":""}`,onPointerDown:g,onPointerMove:m,onPointerUp:h,onPointerCancel:b,children:(0,Tu.jsx)("div",{ref:o,role:"presentation",className:`flex ${t}`,style:{...k,...r},...n,children:e})})}var Wl=require("react");var A0=require("react/jsx-runtime");function Ru({children:e,className:t="",style:r,ref:o,...n}){let i=(0,Wl.useId)(),{slidesToShow:a,spacing:s,registerSlide:l,unregisterSlide:f}=Xr();(0,Wl.useEffect)(()=>(l(i),()=>{f(i)}),[i,l,f]);let u=typeof s=="number"?`${s}px`:s||"0px",w={...r};return a>1||u!=="0px"?w.flex=`0 0 calc((100% - ${a-1} * ${u}) / ${a})`:w.flex="0 0 100%",(0,A0.jsx)("div",{ref:o,role:"group","aria-roledescription":"slide",className:`min-w-0 shrink-0 grow-0 select-none box-border relative overflow-hidden ${t}`,style:w,...n,children:e})}var ks=require("react/jsx-runtime");function Nu({variant:e="glass",icon:t,className:r="",disabled:o,onClick:n,ref:i,...a}){let{scrollPrev:s,canScrollPrev:l,size:f}=Xr(),u=o!==void 0?o:!l,w=C(f,Ss,"md"),g=C(e,yu,"glass"),m=(0,ks.jsx)(Br,{className:w.arrowIcon}),h=["absolute left-2 top-1/2 -translate-y-1/2 inline-flex items-center justify-center font-medium leading-none rounded-full transition-all duration-200 cursor-pointer select-none outline-none disabled:cursor-not-allowed disabled:pointer-events-none disabled:opacity-25 focus-visible:ring-2 focus-visible:ring-primary-500/50 active:scale-90 z-10",g,w.arrowBtn,r].filter(Boolean).join(" ");return(0,ks.jsx)("button",{ref:i,type:"button","aria-label":"Slide tr\u01B0\u1EDBc",disabled:u,onClick:b=>{s(),n?.(b)},className:h,...a,children:t||m})}function Du({variant:e="glass",icon:t,className:r="",disabled:o,onClick:n,ref:i,...a}){let{scrollNext:s,canScrollNext:l,size:f}=Xr(),u=o!==void 0?o:!l,w=C(f,Ss,"md"),g=C(e,yu,"glass"),m=(0,ks.jsx)(sr,{className:w.arrowIcon}),h=["absolute right-2 top-1/2 -translate-y-1/2 inline-flex items-center justify-center font-medium leading-none rounded-full transition-all duration-200 cursor-pointer select-none outline-none disabled:cursor-not-allowed disabled:pointer-events-none disabled:opacity-25 focus-visible:ring-2 focus-visible:ring-primary-500/50 active:scale-90 z-10",g,w.arrowBtn,r].filter(Boolean).join(" ");return(0,ks.jsx)("button",{ref:i,type:"button","aria-label":"Slide ti\u1EBFp theo",disabled:u,onClick:b=>{s(),n?.(b)},className:h,...a,children:t||m})}var vi=require("react/jsx-runtime");function Pu({type:e="dots",clickable:t=!0,className:r="",ref:o,...n}){let{currentIndex:i,totalSlides:a,slidesToShow:s,loop:l,scrollTo:f,size:u}=Xr();if(e==="none"||a<=1)return null;let w=C(u,Ss,"md"),g=l?a:Math.max(1,a-s+1);return e==="fraction"?(0,vi.jsx)("div",{ref:o,role:"status","aria-live":"polite",className:`absolute z-10 bottom-2.5 left-1/2 -translate-x-1/2 inline-flex items-center justify-center font-medium ${wu} text-white ${w.fraction} ${r}`,...n,children:(0,vi.jsxs)("span",{children:[Math.min(i+1,g)," / ",g]})}):(0,vi.jsx)("div",{ref:o,role:"tablist","aria-label":"Ph\xE2n trang b\u0103ng chuy\u1EC1n",className:`absolute z-10 bottom-2.5 left-1/2 -translate-x-1/2 inline-flex items-center justify-center ${wu} ${w.paginationWrapper} ${r}`,...n,children:Array.from({length:g}).map((m,h)=>{let b=h===i;return e==="line"?(0,vi.jsx)("button",{type:"button",role:"tab","aria-selected":b,"aria-label":`Chuy\u1EC3n \u0111\u1EBFn slide ${h+1}`,disabled:!t,onClick:()=>t&&f(h),className:`transition-all duration-300 rounded-full outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${b?`${w.activeLine} ${Ts.active}`:`${w.line} ${Ts.inactive}`} ${t?"cursor-pointer":"cursor-default"}`},h):(0,vi.jsx)("button",{type:"button",role:"tab","aria-selected":b,"aria-label":`Chuy\u1EC3n \u0111\u1EBFn slide ${h+1}`,disabled:!t,onClick:()=>t&&f(h),className:`transition-colors duration-200 rounded-full outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${w.dot} ${b?Ts.active:Ts.inactive} ${t?"cursor-pointer":"cursor-default"}`},h)})})}var co=require("react"),ht=require("@floating-ui/react");var Kl=require("react"),zu=(0,Kl.createContext)(null),lo=()=>{let e=(0,Kl.useContext)(zu);if(!e)throw new Error("Dropdown compound components must be used within a <Dropdown> component.");return e};var O0=require("react/jsx-runtime");function _l({children:e,open:t,defaultOpen:r=!1,onOpenChange:o,trigger:n="click",placement:i="bottom-start",offset:a=4,flip:s=!0,shift:l=!0,size:f="md",radius:u="md",color:w="primary",disabled:g=!1,animated:m=!0,animationDuration:h=150,closeOnSelect:b=!0}){let[x,S]=(0,co.useState)(r),[k,v]=(0,co.useState)(null),p=(0,co.useRef)([]),d=(0,co.useRef)([]),y=t!==void 0,c=y?t:x,T=(0,co.useCallback)(U=>{y||S(U),U||v(null),o?.(U)},[y,o]),R=(0,co.useMemo)(()=>[(0,ht.offset)(a),s?(0,ht.flip)():void 0,l?(0,ht.shift)({padding:8}):void 0].filter(Boolean),[a,s,l]),{refs:N,floatingStyles:D,context:M,placement:F}=(0,ht.useFloating)({placement:i,open:c&&!g,onOpenChange:T,whileElementsMounted:ht.autoUpdate,transform:!1,middleware:R}),P=(0,ht.useClick)(M,{enabled:!g&&n==="click"}),I=(0,ht.useHover)(M,{enabled:!g&&n==="hover",delay:{open:100,close:150},handleClose:(0,ht.safePolygon)()}),z=(0,ht.useDismiss)(M),B=(0,ht.useRole)(M,{role:"menu"}),V=(0,ht.useListNavigation)(M,{listRef:p,activeIndex:k,onNavigate:v,loop:!0}),Y=(0,ht.useTypeahead)(M,{listRef:d,activeIndex:k,onMatch:c?v:void 0}),{getReferenceProps:L,getFloatingProps:E,getItemProps:O}=(0,ht.useInteractions)([P,I,z,B,V,Y]),A=(0,co.useMemo)(()=>({isOpen:c,setIsOpen:T,refs:N,floatingStyles:D,context:M,getReferenceProps:L,getFloatingProps:E,getItemProps:O,elementsRef:p,labelsRef:d,activeIndex:k,setActiveIndex:v,size:f,radius:u,color:w,disabled:g,animated:m,animationDuration:h,closeOnSelect:b,computedPlacement:F}),[c,T,N,D,M,L,E,O,p,d,k,v,f,u,w,g,m,h,b,F]);return(0,O0.jsx)(zu.Provider,{value:A,children:e})}var fa=require("react");var Mu=require("@floating-ui/react"),Iu=require("react/jsx-runtime");function Xp({children:e,ref:t,disabled:r,className:o="",...n}){let i=(0,fa.isValidElement)(e)?e.props?.ref:void 0,a=(0,Mu.useMergeRefs)([t,i]);if(!(0,fa.isValidElement)(e))return null;let s=e.props||{};return(0,fa.cloneElement)(e,{...n,...s,ref:a,disabled:r?!0:s.disabled,className:[s.className,o].filter(Boolean).join(" ")})}function qp({ref:e,children:t,className:r="",asChild:o=!1,...n}){let{refs:i,getReferenceProps:a,isOpen:s,disabled:l}=lo(),f=(0,Mu.useMergeRefs)([i.setReference,e]),u=a({...n,"aria-expanded":s,"aria-haspopup":"menu",className:r});return(0,fa.isValidElement)(t)&&(o||!0)?(0,Iu.jsx)(Xp,{ref:f,disabled:l,...u,children:t}):(0,Iu.jsx)("button",{ref:f,type:"button",disabled:l,"aria-expanded":s,"aria-haspopup":"menu",className:r,...u,children:t})}var Fu=qp;var ma=require("@floating-ui/react");var pa={xs:{menu:"p-1 min-w-36 text-xs",item:"px-2 py-1 text-xs rounded",itemGap:"gap-1.5",icon:"size-3.5",header:"px-2 py-1 text-[10px]",description:"text-[10px]",shortcut:"text-[10px] px-1 py-0.5"},sm:{menu:"p-1.5 min-w-44 text-xs",item:"px-2.5 py-1.5 text-xs rounded-md",itemGap:"gap-2",icon:"size-4",header:"px-2.5 py-1 text-xs",description:"text-[11px]",shortcut:"text-[11px] px-1.5 py-0.5"},md:{menu:"p-1.5 min-w-52 text-sm",item:"px-3 py-2 text-sm rounded-lg",itemGap:"gap-2.5",icon:"size-4.5",header:"px-3 py-1.5 text-xs",description:"text-xs",shortcut:"text-xs px-1.5 py-0.5"},lg:{menu:"p-2 min-w-60 text-base",item:"px-3.5 py-2.5 text-base rounded-xl",itemGap:"gap-3",icon:"size-5",header:"px-3.5 py-1.5 text-sm",description:"text-sm",shortcut:"text-sm px-2 py-0.5"},xl:{menu:"p-2.5 min-w-72 text-lg",item:"px-4 py-3 text-lg rounded-2xl",itemGap:"gap-3.5",icon:"size-6",header:"px-4 py-2 text-base",description:"text-base",shortcut:"text-base px-2 py-1"}},G0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-3xl"},j0={primary:{active:"bg-primary-50 text-primary-900",selected:"bg-primary-100 text-primary-900 font-medium",focus:"focus:bg-primary-50 focus:text-primary-900"},secondary:{active:"bg-secondary-50 text-secondary-900",selected:"bg-secondary-100 text-secondary-900 font-medium",focus:"focus:bg-secondary-50 focus:text-secondary-900"},neutral:{active:"bg-neutral-100 text-neutral-900",selected:"bg-neutral-200 text-neutral-900 font-medium",focus:"focus:bg-neutral-100 focus:text-neutral-900"},error:{active:"bg-error-50 text-error-900",selected:"bg-error-100 text-error-900 font-medium",focus:"focus:bg-error-50 focus:text-error-900"},success:{active:"bg-success-50 text-success-900",selected:"bg-success-100 text-success-900 font-medium",focus:"focus:bg-success-50 focus:text-success-900"},warning:{active:"bg-warning-50 text-warning-900",selected:"bg-warning-100 text-warning-900 font-medium",focus:"focus:bg-warning-50 focus:text-warning-900"},info:{active:"bg-info-50 text-info-900",selected:"bg-info-100 text-info-900 font-medium",focus:"focus:bg-info-50 focus:text-info-900"}},Eu={default:"text-error-600 hover:bg-error-50 hover:text-error-700",active:"bg-error-50 text-error-700",focus:"focus:bg-error-50 focus:text-error-700"};var Xl=require("react"),$u=(0,Xl.createContext)(null),tt=()=>(0,Xl.useContext)($u);var ql=require("react"),Lu=(0,ql.createContext)(null),rt=()=>(0,ql.useContext)(Lu);var Zl=require("react/jsx-runtime");function Jl({ref:e,children:t,className:r="",style:o,minWidth:n,zIndex:i=pt.DROPDOWN,...a}){let{isOpen:s,refs:l,floatingStyles:f,context:u,getFloatingProps:w,elementsRef:g,labelsRef:m,size:h,radius:b,animated:x,animationDuration:S,computedPlacement:k}=lo(),v=(0,ma.useMergeRefs)([l.setFloating,e]),{isMounted:p,styles:d}=ct(u,{duration:S,animated:x}),y=tt(),c=rt();if(!p)return null;let T=C(h,pa,"md"),R=C(b,G0,"md"),N=["bg-neutral-white border-2 border-neutral-200 shadow-lg outline-none focus:outline-none flex flex-col",T.menu,R,r].filter(Boolean).join(" "),D=y?.dialogRef??c?.dialogRef;return(0,Zl.jsx)(ma.FloatingPortal,{root:D,children:(0,Zl.jsx)("div",{ref:v,style:{...f,...x?d:{},minWidth:n,zIndex:i,...o},className:N,"data-state":s?"open":"closed","data-placement":k,...w(a),children:(0,Zl.jsx)(ma.FloatingList,{elementsRef:g,labelsRef:m,children:t})})})}var Ql=require("@floating-ui/react");var cn=require("react/jsx-runtime");function Zp({ref:e,children:t,onClick:r,disabled:o=!1,danger:n=!1,selected:i=!1,startIcon:a,endIcon:s,shortcut:l,description:f,className:u="",closeOnSelect:w,...g}){let{getItemProps:m,activeIndex:h,setIsOpen:b,color:x,size:S,closeOnSelect:k}=lo(),v=typeof t=="string"?t:void 0,{ref:p,index:d}=(0,Ql.useListItem)({label:v}),y=(0,Ql.useMergeRefs)([p,e]),c=h===d,T=C(S,pa,"md"),R=C(x,j0,"primary"),N=F=>{if(o){F.preventDefault();return}r?.(F),(w??k)&&b(!1)},D=o?"opacity-50 cursor-not-allowed text-neutral-400 select-none":n?`${Eu.default} ${c?Eu.active:""} cursor-pointer`:i?`${R.selected} cursor-pointer`:`${c?R.active:"text-neutral-700 hover:bg-neutral-100 hover:text-neutral-900"} cursor-pointer`,M=["w-full text-left flex items-center select-none transition-colors duration-100 outline-none focus:outline-none",T.item,T.itemGap,D,u].filter(Boolean).join(" ");return(0,cn.jsxs)("button",{ref:y,type:"button",role:"menuitem",disabled:o,"aria-disabled":o,tabIndex:c?0:-1,...m({...g,onClick:N,className:M}),children:[a&&(0,cn.jsx)("span",{className:`flex items-center justify-center shrink-0 ${T.icon}`,children:a}),(0,cn.jsxs)("div",{className:"flex-1 flex flex-col min-w-0",children:[(0,cn.jsx)("span",{className:"truncate",children:t}),f&&(0,cn.jsx)("span",{className:`text-neutral-500 truncate ${T.description}`,children:f})]}),l&&(0,cn.jsx)("kbd",{className:`shrink-0 rounded border border-neutral-200 bg-neutral-50 font-mono text-neutral-500 tracking-wider ${T.shortcut}`,children:l}),s&&(0,cn.jsx)("span",{className:`flex items-center justify-center shrink-0 ${T.icon}`,children:s})]})}var Bu=Zp;var U0=require("react/jsx-runtime");function Hu({children:e,className:t="",...r}){let{size:o}=lo(),n=C(o,pa,"md");return(0,U0.jsx)("div",{role:"presentation",className:["font-semibold text-neutral-500 uppercase tracking-wider select-none",n.header,t].filter(Boolean).join(" "),...r,children:e})}var Vu=Hu;var Y0=require("react/jsx-runtime");function Jp({className:e="",...t}){return(0,Y0.jsx)("hr",{className:["-mx-1 my-1 h-px border-0 bg-neutral-200",e].filter(Boolean).join(" "),...t})}var Au=Jp;var ec=require("react/jsx-runtime");function Qp({children:e,label:t,className:r="",...o}){return(0,ec.jsxs)("div",{role:"group",className:["flex flex-col",r].filter(Boolean).join(" "),...o,children:[t&&(0,ec.jsx)(Hu,{children:t}),e]})}var Ou=Qp;var yi=require("react"),Mt=require("@floating-ui/react");var tc=require("react"),Gu=(0,tc.createContext)(null),gr=()=>{let e=(0,tc.useContext)(Gu);if(!e)throw new Error("Popover compound components must be used within a <Popover> component.");return e};var W0=require("react/jsx-runtime");function ga({children:e,open:t,defaultOpen:r=!1,onOpenChange:o,trigger:n="click",placement:i="bottom",offset:a=8,flip:s=!0,shift:l=!0,size:f="md",radius:u="md",color:w="neutral",disabled:g=!1,animated:m=!0,animationDuration:h=150,modal:b=!1,closeOnEsc:x=!0,closeOnClickOutside:S=!0}){let[k,v]=(0,yi.useState)(r),p=t!==void 0,d=p?t:k,y=(0,yi.useCallback)(Y=>{p||v(Y),o?.(Y)},[p,o]),c=(0,yi.useMemo)(()=>[(0,Mt.offset)(a),s?(0,Mt.flip)():void 0,l?(0,Mt.shift)({padding:8}):void 0].filter(Boolean),[a,s,l]),{refs:T,floatingStyles:R,context:N,placement:D}=(0,Mt.useFloating)({placement:i,open:d&&!g,onOpenChange:y,whileElementsMounted:Mt.autoUpdate,transform:!1,middleware:c}),M=(0,Mt.useClick)(N,{enabled:!g&&n==="click"}),F=(0,Mt.useHover)(N,{enabled:!g&&n==="hover",delay:{open:100,close:150},handleClose:(0,Mt.safePolygon)()}),P=(0,Mt.useDismiss)(N,{escapeKey:x,outsidePress:S}),I=(0,Mt.useRole)(N,{role:"dialog"}),{getReferenceProps:z,getFloatingProps:B}=(0,Mt.useInteractions)([M,F,P,I]),V=(0,yi.useMemo)(()=>({isOpen:d,setIsOpen:y,refs:T,floatingStyles:R,context:N,getReferenceProps:z,getFloatingProps:B,size:f,radius:u,color:w,disabled:g,animated:m,animationDuration:h,modal:b,computedPlacement:D}),[d,y,T,R,N,z,B,f,u,w,g,m,h,b,D]);return(0,W0.jsx)(Gu.Provider,{value:V,children:e})}var ba=require("react");var Uu=require("@floating-ui/react"),ju=require("react/jsx-runtime");function em({children:e,ref:t,disabled:r,className:o="",...n}){let i=(0,ba.isValidElement)(e)?e.props?.ref:void 0,a=(0,Uu.useMergeRefs)([t,i]);if(!(0,ba.isValidElement)(e))return null;let s=e.props||{};return(0,ba.cloneElement)(e,{...n,...s,ref:a,disabled:r?!0:s.disabled,className:[s.className,o].filter(Boolean).join(" ")})}function tm({ref:e,children:t,className:r="",asChild:o=!1,...n}){let{refs:i,getReferenceProps:a,isOpen:s,disabled:l}=gr(),f=(0,Uu.useMergeRefs)([i.setReference,e]),u=a({...n,"aria-expanded":s,"aria-haspopup":"dialog",className:r});return(0,ba.isValidElement)(t)&&(o||!0)?(0,ju.jsx)(em,{ref:f,disabled:l,...u,children:t}):(0,ju.jsx)("button",{ref:f,type:"button",disabled:l,"aria-expanded":s,"aria-haspopup":"dialog",className:r,...u,children:t})}var Rs=tm;var ha=require("@floating-ui/react");var In={xs:{container:"min-w-44 text-xs",header:"px-2.5 py-1.5 text-xs font-semibold",body:"px-2.5 py-2 text-xs",footer:"px-2.5 py-1.5 text-xs"},sm:{container:"min-w-56 text-xs",header:"px-3 py-2 text-xs font-semibold",body:"px-3 py-2.5 text-xs",footer:"px-3 py-2 text-xs"},md:{container:"min-w-64 text-sm",header:"px-4 py-3 text-sm font-semibold",body:"px-4 py-3 text-sm",footer:"px-4 py-2.5 text-sm"},lg:{container:"min-w-80 text-base",header:"px-5 py-3.5 text-base font-semibold",body:"px-5 py-4 text-base",footer:"px-5 py-3 text-base"},xl:{container:"min-w-96 text-lg",header:"px-6 py-4 text-lg font-semibold",body:"px-6 py-5 text-lg",footer:"px-6 py-4 text-lg"}},K0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-3xl"};var rc=require("react/jsx-runtime");function Yu({ref:e,children:t,className:r="",style:o,minWidth:n,maxWidth:i,zIndex:a=pt.POPOVER,...s}){let{isOpen:l,refs:f,floatingStyles:u,context:w,getFloatingProps:g,size:m,radius:h,animated:b,animationDuration:x,modal:S,computedPlacement:k}=gr(),v=(0,ha.useMergeRefs)([f.setFloating,e]),{isMounted:p,styles:d}=ct(w,{duration:x,animated:b}),y=tt(),c=rt();if(!p)return null;let T=C(m,In,"md"),R=C(h,K0,"md"),D=["bg-neutral-white shadow-xl outline-none focus:outline-none flex flex-col border-2 border-neutral-200",T.container,R,r].filter(Boolean).join(" "),M=(0,rc.jsx)(ha.FloatingFocusManager,{context:w,modal:S,children:(0,rc.jsx)("div",{ref:v,style:{...u,...b?d:{},minWidth:n,maxWidth:i,zIndex:a,...o},className:D,"data-state":l?"open":"closed","data-placement":k,...g(s),children:t})}),F=y?.dialogRef??c?.dialogRef;return(0,rc.jsx)(ha.FloatingPortal,{root:F,children:M})}var Wu=Yu;var _0=require("react/jsx-runtime");function Ku({children:e,className:t="",...r}){let{size:o}=gr(),n=C(o,In,"md");return(0,_0.jsx)("h2",{className:["text-neutral-900 border-b border-neutral-100 font-semibold",n.header,t].filter(Boolean).join(" "),...r,children:e})}var _u=Ku;var X0=require("react/jsx-runtime");function Xu({children:e,className:t="",...r}){let{size:o}=gr(),n=C(o,In,"md");return(0,X0.jsx)("div",{className:["text-neutral-700",n.body,t].filter(Boolean).join(" "),...r,children:e})}var qu=Xu;var q0=require("react/jsx-runtime");function rm({children:e,className:t="",...r}){let{size:o}=gr(),n=C(o,In,"md");return(0,q0.jsx)("div",{className:["border-t border-neutral-100 bg-neutral-50/50",n.footer,t].filter(Boolean).join(" "),...r,children:e})}var Zu=rm;var xa=require("react");var Z0=require("@floating-ui/react"),Ju=require("react/jsx-runtime");function om({children:e,ref:t,className:r="",onClick:o,...n}){let i=(0,xa.isValidElement)(e)?e.props?.ref:void 0,a=(0,Z0.useMergeRefs)([t,i]);if(!(0,xa.isValidElement)(e))return null;let s=e.props||{};return(0,xa.cloneElement)(e,{...n,...s,ref:a,className:[s.className,r].filter(Boolean).join(" "),onClick:l=>{s.onClick?.(l),o?.(l)}})}function nm({ref:e,children:t,className:r="",asChild:o=!1,onClick:n,...i}){let{setIsOpen:a}=gr(),s=l=>{n?.(l),l.defaultPrevented||a(!1)};return(0,xa.isValidElement)(t)&&o?(0,Ju.jsx)(om,{ref:e,className:r,onClick:s,...i,children:t}):(0,Ju.jsx)("button",{ref:e,type:"button",className:r,onClick:s,...i,children:t})}var Qu=nm;var En=require("react"),Gt=require("@floating-ui/react");var wi=require("react");var J0={months:["Th\xE1ng 1","Th\xE1ng 2","Th\xE1ng 3","Th\xE1ng 4","Th\xE1ng 5","Th\xE1ng 6","Th\xE1ng 7","Th\xE1ng 8","Th\xE1ng 9","Th\xE1ng 10","Th\xE1ng 11","Th\xE1ng 12"],monthsShort:["Thg 1","Thg 2","Thg 3","Thg 4","Thg 5","Thg 6","Thg 7","Thg 8","Thg 9","Thg 10","Thg 11","Thg 12"],weekdays:["Ch\u1EE7 Nh\u1EADt","Th\u1EE9 Hai","Th\u1EE9 Ba","Th\u1EE9 T\u01B0","Th\u1EE9 N\u0103m","Th\u1EE9 S\xE1u","Th\u1EE9 B\u1EA3y"],weekdaysShort:["CN","T2","T3","T4","T5","T6","T7"],weekdaysMin:["CN","T2","T3","T4","T5","T6","T7"],todayText:"H\xF4m nay",clearText:"X\xF3a",weekText:"Tu\u1EA7n",viewTabs:{days:"Ng\xE0y",months:"Th\xE1ng",years:"N\u0103m"}},Q0={months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],todayText:"Today",clearText:"Clear",weekText:"Week",viewTabs:{days:"Day",months:"Month",years:"Year"}},qr={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",icon:"size-3",iconSize:12,calendarPadding:"p-2",cellSize:"w-7 h-7",cellText:"text-[11px]",headerText:"text-xs font-semibold",headerButtonSize:"h-6 w-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",icon:"size-3.5",iconSize:14,calendarPadding:"p-2.5",cellSize:"w-8 h-8",cellText:"text-xs",headerText:"text-xs font-semibold",headerButtonSize:"h-7 w-7",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",icon:"size-[18px]",iconSize:16,calendarPadding:"p-3",cellSize:"w-9 h-9",cellText:"text-sm",headerText:"text-sm font-semibold",headerButtonSize:"h-8 w-8",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",icon:"size-5",iconSize:18,calendarPadding:"p-4",cellSize:"w-10 h-10",cellText:"text-base",headerText:"text-base font-semibold",headerButtonSize:"h-9 w-9",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",icon:"size-6",iconSize:20,calendarPadding:"p-4.5",cellSize:"w-11 h-11",cellText:"text-base",headerText:"text-lg font-semibold",headerButtonSize:"h-10 w-10",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}};var Mn={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},ef={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},Fn={primary:{selected:"bg-primary-500 text-neutral-white hover:bg-primary-600",selectedText:"text-neutral-white",rangeBg:"bg-primary-100 text-primary-900",rangeText:"text-primary-900",hoverBg:"hover:bg-primary-200 hover:text-primary-900",todayRing:"border-primary-500 text-primary-500",activeText:"text-primary-500",accentBg:"bg-primary-500"},secondary:{selected:"bg-secondary-500 text-neutral-white hover:bg-secondary-600",selectedText:"text-neutral-white",rangeBg:"bg-secondary-100 text-secondary-900",rangeText:"text-secondary-900",hoverBg:"hover:bg-secondary-200 hover:text-secondary-900",todayRing:"border-secondary-500 text-secondary-500",activeText:"text-secondary-500",accentBg:"bg-secondary-500"},neutral:{selected:"bg-neutral-800 text-neutral-white hover:bg-neutral-900",selectedText:"text-neutral-white",rangeBg:"bg-neutral-200 text-neutral-900",rangeText:"text-neutral-900",hoverBg:"hover:bg-neutral-300 hover:text-neutral-900",todayRing:"border-neutral-600 text-neutral-600",activeText:"text-neutral-800",accentBg:"bg-neutral-800"},error:{selected:"bg-error-500 text-neutral-white hover:bg-error-600",selectedText:"text-neutral-white",rangeBg:"bg-error-100 text-error-900",rangeText:"text-error-900",hoverBg:"hover:bg-error-200 hover:text-error-900",todayRing:"border-error-500 text-error-500",activeText:"text-error-500",accentBg:"bg-error-500"},success:{selected:"bg-success-500 text-neutral-white hover:bg-success-600",selectedText:"text-neutral-white",rangeBg:"bg-success-100 text-success-900",rangeText:"text-success-900",hoverBg:"hover:bg-success-200 hover:text-success-900",todayRing:"border-success-500 text-success-500",activeText:"text-success-500",accentBg:"bg-success-500"},warning:{selected:"bg-warning-500 text-neutral-950 hover:bg-warning-600",selectedText:"text-neutral-950",rangeBg:"bg-warning-100 text-warning-900",rangeText:"text-warning-900",hoverBg:"hover:bg-warning-200 hover:text-warning-900",todayRing:"border-warning-500 text-warning-700",activeText:"text-warning-700",accentBg:"bg-warning-500"},info:{selected:"bg-info-500 text-neutral-white hover:bg-info-600",selectedText:"text-neutral-white",rangeBg:"bg-info-100 text-info-900",rangeText:"text-info-900",hoverBg:"hover:bg-info-200 hover:text-info-900",todayRing:"border-info-500 text-info-500",activeText:"text-info-500",accentBg:"bg-info-500"}},tf={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"}};function Ot(e){return!e||e==="vi"?J0:e==="en"?Q0:e}function or(e,t){if(!e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:new Date(e.getTime());if(typeof e=="string"){let r=e.trim();if(!r)return null;if(t){let n=oc(r,t);if(n)return n}let o=new Date(r);return isNaN(o.getTime())?null:o}if(typeof e=="number"){let r=new Date(e);return isNaN(r.getTime())?null:r}return null}function un(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Ns(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}function va(e,t){let r=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),o=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return r<o}function ya(e,t){let r=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),o=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return r>o}function wa(e){let t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())),r=t.getUTCDay()||7;t.setUTCDate(t.getUTCDate()+4-r);let o=new Date(Date.UTC(t.getUTCFullYear(),0,1));return Math.ceil(((t.getTime()-o.getTime())/864e5+1)/7)}function rf(e,t){return new Date(e,t+1,0).getDate()}function Ds(e,t,r=1,o,n,i,a){let s=[],l=new Date,f=new Date(e,t,1).getDay(),u=rf(e,t-1),w=rf(e,t),g=r===1?f===0?6:f-1:f;for(let h=g-1;h>=0;h--){let b=u-h,x=new Date(e,t-1,b);s.push(ed(x,!1,l,o,n,i,a))}for(let h=1;h<=w;h++){let b=new Date(e,t,h);s.push(ed(b,!0,l,o,n,i,a))}let m=42-s.length;for(let h=1;h<=m;h++){let b=new Date(e,t+1,h);s.push(ed(b,!1,l,o,n,i,a))}return s}function ed(e,t,r,o,n,i,a){let s=o?un(e,o):!1,l=!1;return n&&va(e,n)&&(l=!0),i&&ya(e,i)&&(l=!0),a&&a(e)&&(l=!0),{date:e,day:e.getDate(),month:e.getMonth(),year:e.getFullYear(),isCurrentMonth:t,isToday:un(e,r),isSelected:s,isDisabled:l,weekNumber:wa(e)}}function Rr(e,t="DD/MM/YYYY",r){if(!e||isNaN(e.getTime()))return"";let o=Ot(r),n=e.getFullYear(),i=e.getMonth(),a=e.getDate(),s=e.getHours(),l=e.getMinutes(),f=e.getSeconds(),u=e.getDay(),w=b=>String(b).padStart(2,"0"),g=s%12||12,m=s>=12?"PM":"AM",h={YYYY:String(n),YY:String(n).slice(-2),MMMM:o.months[i]??"",MMM:o.monthsShort[i]??"",MM:w(i+1),M:String(i+1),DD:w(a),D:String(a),dddd:o.weekdays[u]??"",ddd:o.weekdaysShort[u]??"",dd:o.weekdaysMin[u]??"",HH:w(s),H:String(s),hh:w(g),h:String(g),mm:w(l),m:String(l),ss:w(f),s:String(f),A:m,a:m.toLowerCase()};return t.replace(/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|ddd|dd|HH|H|hh|h|mm|m|ss|s|A|a/g,b=>h[b]??b)}function oc(e,t="DD/MM/YYYY"){if(!e||typeof e!="string")return null;let r=e.trim();if(!r)return null;let o=new Date().getFullYear(),n=1,i=1,a=0,s=0,l=0,f=t.match(/YYYY|YY|MM|M|DD|D|HH|H|hh|h|mm|m|ss|s/g);if(!f){let m=new Date(r);return isNaN(m.getTime())?null:m}let u="^"+t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");for(let m of f)m==="YYYY"?u=u.replace("YYYY","(\\d{4})"):m==="YY"?u=u.replace("YY","(\\d{2})"):(m==="MM"||m==="M"||m==="DD"||m==="D"||m==="HH"||m==="H"||m==="hh"||m==="h"||m==="mm"||m==="m"||m==="ss"||m==="s")&&(u=u.replace(m,"(\\d{1,2})"));u+="$";let w=new RegExp(u).exec(r);if(!w){let m=new Date(r);return isNaN(m.getTime())?null:m}f.forEach((m,h)=>{let b=w[h+1];if(!b)return;let x=parseInt(b,10);isNaN(x)||(m==="YYYY"?o=x:m==="YY"?o=2e3+x:m==="MM"||m==="M"?n=x:m==="DD"||m==="D"?i=x:m==="HH"||m==="H"||m==="hh"||m==="h"?a=x:m==="mm"||m==="m"?s=x:(m==="ss"||m==="s")&&(l=x))});let g=new Date(o,n-1,i,a,s,l);return isNaN(g.getTime())?null:g}function nc(e,t="days"){if(t==="days")return e;if(t==="years")return e.includes("YYYY")?"YYYY":e.includes("YY")?"YY":"YYYY";if(t==="months"){let r=e.replace(/(?:DD|D|dddd|ddd|dd)\s*[-/.,\s]+\s*/,"");return r=r.replace(/\s*[-/.,\s]+\s*(?:DD|D|dddd|ddd|dd)/,""),r=r.replace(/[-/.,\s]{2,}/g,o=>o.charAt(0)).trim(),!r||!r.includes("M")&&!r.includes("Y")?e.includes("-")?"MM-YYYY":"MM/YYYY":r}return e}var Nr=require("react/jsx-runtime");function Ca({currentMonth:e,view:t,onViewChange:r,onPrevMonth:o,onNextMonth:n,onPrevYear:i,onNextYear:a,onPrevDecade:s,onNextDecade:l,size:f="md",color:u="primary",locale:w,showMonthButtons:g=!0}){let m=Ot(w),h=C(f,qr,"md"),b=C(u,Fn,"primary"),x=e.getFullYear(),S=e.getMonth(),k=Math.floor(x/10)*10,v=k+9,p=()=>{t==="days"?r("months"):t==="months"?r("years"):t==="years"&&r("days")},d=()=>{t==="years"?s?s():i():t==="months"?i():o()},y=()=>{t==="years"?l?l():a():t==="months"?a():n()},c=()=>t==="years"?`${k} - ${v}`:t==="months"?`${x}`:`${m.months[S]} ${x}`;return(0,Nr.jsxs)("div",{className:"flex items-center justify-between px-1 pb-1.5 border-b border-neutral-200",children:[(0,Nr.jsxs)("div",{className:"flex items-center space-x-0.5",children:[t==="days"&&(0,Nr.jsx)("button",{type:"button",onClick:i,"aria-label":"N\u0103m tr\u01B0\u1EDBc",className:`flex items-center justify-center ${h.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:(0,Nr.jsx)(Qo,{width:14,height:14})}),g&&(0,Nr.jsx)("button",{type:"button",onClick:d,"aria-label":"Th\xE1ng tr\u01B0\u1EDBc",className:`flex items-center justify-center ${h.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:(0,Nr.jsx)(Br,{width:14,height:14})})]}),(0,Nr.jsx)("button",{type:"button",onClick:p,className:`${h.headerText} px-2 py-1 rounded-md text-neutral-800 hover:bg-neutral-100 hover:${b.activeText} transition-colors cursor-pointer`,children:c()}),(0,Nr.jsxs)("div",{className:"flex items-center space-x-0.5",children:[g&&(0,Nr.jsx)("button",{type:"button",onClick:y,"aria-label":"Th\xE1ng ti\u1EBFp theo",className:`flex items-center justify-center ${h.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:(0,Nr.jsx)(sr,{width:14,height:14})}),t==="days"&&(0,Nr.jsx)("button",{type:"button",onClick:a,"aria-label":"N\u0103m ti\u1EBFp theo",className:`flex items-center justify-center ${h.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:(0,Nr.jsx)(en,{width:14,height:14})})]})]})}var ic=Ko(require("react"),1);var uo=require("react/jsx-runtime");function Sa({days:e,onSelectDate:t,size:r="md",color:o="primary",radius:n,locale:i,firstDayOfWeek:a=1,showWeekNumbers:s=!1}){let l=Ot(i),f=C(r,qr,"md"),u=C(o,Fn,"primary"),w=C(n,Mn,"lg"),g=(0,ic.useRef)(null),m=[...l.weekdaysShort];if(a===1){let p=m.shift();m.push(p)}let h=e.some(p=>p.isSelected&&!p.isDisabled),b=e.findIndex(p=>p.isToday&&!p.isDisabled),x=e.findIndex(p=>p.isCurrentMonth&&!p.isDisabled),S=x!==-1?x:e.findIndex(p=>!p.isDisabled),k=p=>{let y=g.current?.querySelectorAll("button")?.[p];y&&!y.disabled&&y.focus()},v=(p,d)=>{let y=null;if(p.key==="ArrowRight"){p.preventDefault();for(let c=d+1;c<e.length;c++)if(!e[c].isDisabled){y=c;break}}else if(p.key==="ArrowLeft"){p.preventDefault();for(let c=d-1;c>=0;c--)if(!e[c].isDisabled){y=c;break}}else if(p.key==="ArrowDown")p.preventDefault(),d+7<e.length&&!e[d+7].isDisabled&&(y=d+7);else if(p.key==="ArrowUp")p.preventDefault(),d-7>=0&&!e[d-7].isDisabled&&(y=d-7);else if(p.key==="Home"){p.preventDefault();let c=d-d%7;for(let T=c;T<c+7&&T<e.length;T++)if(!e[T].isDisabled){y=T;break}}else if(p.key==="End"){p.preventDefault();let c=Math.min(e.length-1,d-d%7+6);for(let T=c;T>=d-d%7;T--)if(!e[T].isDisabled){y=T;break}}else if(p.key==="Enter"||p.key===" "){p.preventDefault();let c=e[d];c&&!c.isDisabled&&t(c.date);return}y!==null&&k(y)};return(0,uo.jsxs)("div",{ref:g,role:"grid","aria-label":l.months[e[15]?.month||0],className:"w-full",children:[(0,uo.jsxs)("div",{role:"row",className:`grid ${s?"grid-cols-8":"grid-cols-7"} gap-1 mb-1 text-center`,children:[s&&(0,uo.jsx)("div",{role:"columnheader","aria-label":l.weekText||"Week",className:`flex items-center justify-center ${f.cellSize} text-neutral-400 ${f.cellText} font-medium`,children:"#"}),m.map(p=>(0,uo.jsx)("div",{role:"columnheader","aria-label":p,className:`flex items-center justify-center ${f.cellSize} text-neutral-500 ${f.cellText} font-medium`,children:p},p))]}),(0,uo.jsx)("div",{role:"rowgroup",className:`grid ${s?"grid-cols-8":"grid-cols-7"} gap-y-1 gap-x-1`,children:e.map((p,d)=>{let y=d%7===0,c="text-neutral-800 hover:bg-neutral-100";p.isDisabled?c="text-neutral-300 cursor-not-allowed line-through":p.isSelected?c=`${u.selected} font-semibold shadow-xs`:p.isCurrentMonth||(c="text-neutral-400 hover:bg-neutral-100");let T=p.isToday&&!p.isSelected?`ring-1 ${u.todayRing} font-bold`:"",R=`${p.day} ${l.months[p.month]} ${p.year}`,N=!p.isDisabled&&(p.isSelected||!h&&p.isToday&&d===b||!h&&b===-1&&d===S);return(0,uo.jsxs)(ic.default.Fragment,{children:[s&&y&&(0,uo.jsxs)("div",{className:`flex items-center justify-center ${f.cellSize} text-neutral-400 ${f.cellText} text-[10px] font-mono`,children:["W",p.weekNumber]}),(0,uo.jsx)("div",{role:"gridcell","aria-selected":p.isSelected,className:"flex items-center justify-center",children:(0,uo.jsx)("button",{type:"button",disabled:p.isDisabled,tabIndex:N?0:-1,onKeyDown:D=>v(D,d),onClick:()=>!p.isDisabled&&t(p.date),"aria-label":R,"aria-current":p.isToday?"date":void 0,"aria-disabled":p.isDisabled,className:`flex items-center justify-center ${f.cellSize} ${f.cellText} ${w} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${c} ${T}`,children:p.day})})]},p.date.toISOString())})})]})}var of=require("react");var ac=require("react/jsx-runtime");function Ta({currentMonth:e,selectedDate:t,onSelectMonth:r,size:o="md",color:n="primary",radius:i,locale:a}){let s=Ot(a),l=C(o,qr,"md"),f=C(n,Fn,"primary"),u=C(i,Mn,"lg"),w=(0,of.useRef)(null),g=e.getFullYear(),m=new Date,h=m.getMonth(),b=m.getFullYear(),x=t&&t.getFullYear()===g?t.getMonth():-1,S=x!==-1?x:b===g?h:0,k=p=>{let y=w.current?.querySelectorAll("button")?.[p];y&&y.focus()},v=(p,d)=>{let y=null;if(p.key==="ArrowRight")p.preventDefault(),d+1<s.monthsShort.length&&(y=d+1);else if(p.key==="ArrowLeft")p.preventDefault(),d-1>=0&&(y=d-1);else if(p.key==="ArrowDown")p.preventDefault(),d+3<s.monthsShort.length&&(y=d+3);else if(p.key==="ArrowUp")p.preventDefault(),d-3>=0&&(y=d-3);else if(p.key==="Home")p.preventDefault(),y=0;else if(p.key==="End")p.preventDefault(),y=s.monthsShort.length-1;else if(p.key==="Enter"||p.key===" "){p.preventDefault(),r(d);return}y!==null&&k(y)};return(0,ac.jsx)("div",{ref:w,role:"grid","aria-label":"Ch\u1ECDn th\xE1ng",className:"grid grid-cols-3 gap-2 py-2",children:s.monthsShort.map((p,d)=>{let y=new Date(g,d,1),c=t?Ns(y,t):!1,T=b===g&&h===d,R=d===S,N="text-neutral-800 hover:bg-neutral-100";return c?N=`${f.selected} font-semibold shadow-xs`:T&&(N=`ring-1 ${f.todayRing} font-semibold`),(0,ac.jsx)("div",{role:"gridcell","aria-selected":c,className:"flex items-center justify-center",children:(0,ac.jsx)("button",{type:"button",tabIndex:R?0:-1,onKeyDown:D=>v(D,d),onClick:()=>r(d),"aria-label":`${p} ${g}`,className:`w-full flex items-center justify-center h-10 ${l.cellText} ${u} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${N}`,children:p})},p)})})}var nf=require("react");var sc=require("react/jsx-runtime");function ka({currentMonth:e,selectedDate:t,onSelectYear:r,size:o="md",color:n="primary",radius:i}){let a=C(o,qr,"md"),s=C(n,Fn,"primary"),l=C(i,Mn,"lg"),f=(0,nf.useRef)(null),u=e.getFullYear(),w=t?t.getFullYear():u,g=Math.floor(u/10)*10,m=new Date().getFullYear(),h=[];for(let p=0;p<12;p++)h.push(g+p);let b=h.indexOf(w),x=h.indexOf(m),S=b!==-1?b:x!==-1?x:0,k=p=>{let y=f.current?.querySelectorAll("button")?.[p];y&&y.focus()},v=(p,d)=>{let y=null;if(p.key==="ArrowRight")p.preventDefault(),d+1<h.length&&(y=d+1);else if(p.key==="ArrowLeft")p.preventDefault(),d-1>=0&&(y=d-1);else if(p.key==="ArrowDown")p.preventDefault(),d+3<h.length&&(y=d+3);else if(p.key==="ArrowUp")p.preventDefault(),d-3>=0&&(y=d-3);else if(p.key==="Home")p.preventDefault(),y=0;else if(p.key==="End")p.preventDefault(),y=h.length-1;else if(p.key==="Enter"||p.key===" "){p.preventDefault();let c=h[d];c!==void 0&&r(c);return}y!==null&&k(y)};return(0,sc.jsx)("div",{ref:f,role:"grid","aria-label":"Ch\u1ECDn n\u0103m",className:"grid grid-cols-3 gap-2 py-2",children:h.map((p,d)=>{let y=p===w,c=p===m,T=d===S,R="text-neutral-800 hover:bg-neutral-100";return y?R=`${s.selected} font-semibold shadow-xs`:c&&(R=`ring-1 ${s.todayRing} font-semibold`),(0,sc.jsx)("div",{role:"gridcell","aria-selected":y,className:"flex items-center justify-center",children:(0,sc.jsx)("button",{type:"button",tabIndex:T?0:-1,onKeyDown:N=>v(N,d),onClick:()=>r(p),"aria-label":`${p}`,className:`w-full flex items-center justify-center h-10 ${a.cellText} ${l} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${R}`,children:p})},p)})})}var Zr=require("react/jsx-runtime");function fo({value:e,onChange:t,view:r="days",onViewChange:o,minDate:n,maxDate:i,isDateDisabled:a,locale:s="vi",firstDayOfWeek:l=1,showWeekNumbers:f=!1,showViewTabs:u=!1,viewTabs:w=["days","months","years"],size:g="md",color:m="primary",radius:h,className:b="",bordered:x=!0}){let S=C(g,qr,"md"),k=C(h,ef,"lg"),[v,p]=(0,wi.useState)(r),[d,y]=(0,wi.useState)(r);r!==d&&(y(r),p(r));let[c,T]=(0,wi.useState)(()=>{let A=e||new Date;return new Date(A.getFullYear(),A.getMonth(),1)}),R=Ot(s),N=(0,wi.useMemo)(()=>{let A=R.viewTabs||{days:"Ng\xE0y",months:"Th\xE1ng",years:"N\u0103m"};return(w||["days","months","years"]).map(U=>({key:U,label:A[U]||U}))},[w,R.viewTabs]),D=A=>{let U=A;p(U),o?.(U)},M=()=>{let A=new Date(c.getFullYear(),c.getMonth()-1,1);T(A)},F=()=>{let A=new Date(c.getFullYear(),c.getMonth()+1,1);T(A)},P=()=>{let A=new Date(c.getFullYear()-1,c.getMonth(),1);T(A)},I=()=>{let A=new Date(c.getFullYear()+1,c.getMonth(),1);T(A)},z=()=>{let A=new Date(c.getFullYear()-10,c.getMonth(),1);T(A)},B=()=>{let A=new Date(c.getFullYear()+10,c.getMonth(),1);T(A)},V=A=>{let U=new Date(c.getFullYear(),A,1);T(U),r==="months"?t?.(U):p("days")},Y=A=>{let U=new Date(A,c.getMonth(),1);T(U),r==="years"?t?.(U):p("months")},L=or(n),E=or(i),O=(0,wi.useMemo)(()=>Ds(c.getFullYear(),c.getMonth(),l,e,L,E,a),[c,l,e,L,E,a]);return(0,Zr.jsxs)("div",{className:`inline-flex flex-col ${x?"border-2 border-neutral-200 bg-neutral-white shadow-xl":"border-0 shadow-none bg-transparent"} ${k} overflow-hidden select-none ${b}`,children:[u&&N.length>0&&(0,Zr.jsx)("div",{className:"px-2.5 py-1.5 border-b border-neutral-200",children:(0,Zr.jsx)(Dn,{activeKey:r,onChange:D,size:"sm",variant:"solid",color:m,fullWidth:!0,className:"gap-0!",children:(0,Zr.jsx)(Pn,{className:"p-0.5",children:N.map(A=>(0,Zr.jsx)(zn,{value:A.key,className:"py-1 px-2 text-xs",children:A.label},A.key))})})}),(0,Zr.jsxs)("div",{className:`${S.calendarPadding} min-w-70`,children:[(0,Zr.jsx)(Ca,{currentMonth:c,view:v,onViewChange:p,onPrevMonth:M,onNextMonth:F,onPrevYear:P,onNextYear:I,onPrevDecade:z,onNextDecade:B,size:g,color:m,locale:s,showMonthButtons:!0}),v==="days"&&(0,Zr.jsx)(Sa,{days:O,onSelectDate:A=>t?.(A),size:g,color:m,radius:h,locale:s,firstDayOfWeek:l,showWeekNumbers:f}),v==="months"&&(0,Zr.jsx)(Ta,{currentMonth:c,selectedDate:e,onSelectMonth:V,size:g,color:m,radius:h,locale:s}),v==="years"&&(0,Zr.jsx)(ka,{currentMonth:c,selectedDate:e,onSelectYear:Y,size:g,color:m,radius:h})]})]})}var Ft=require("react/jsx-runtime");function $n({ref:e,value:t,defaultValue:r,onChange:o,format:n="DD/MM/YYYY",displayFormat:i,defaultView:a="days",locale:s="vi",firstDayOfWeek:l=1,minDate:f,maxDate:u,isDateDisabled:w,size:g="md",variant:m="outline",color:h="primary",radius:b,label:x,labelPlacement:S="floating",placeholder:k,helperText:v,errorMessage:p,name:d,id:y,autoComplete:c,viewTabs:T=["days","months","years"],view:R,onViewChange:N,onClear:D,placement:M="bottom-start",disabled:F=!1,readOnly:P=!1,portal:I=!0,config:z,className:B="",wrapperClassName:V="",inputWrapperClassName:Y="",labelClassName:L="",helperClassName:E="",popoverClassName:O=""}){let A=tt(),U=rt(),{isRequired:G=!1,isInvalid:K=!1,isLoading:q=!1,showSpinner:X=!1,isClearable:fe=!0,isFullWidth:ae=!0,showWeekNumbers:_=!1,showViewTabs:Z=!1,closeOnSelect:he=!0}=z??{},xe=(0,En.useId)(),$=y||xe,re=`${$}-error-helper`,ee=`${$}-popover`,de=R!==void 0,[ne,ze]=(0,En.useState)(a),ve=de?R:ne,Ce=i||n,J=(0,En.useMemo)(()=>nc(Ce,ve),[Ce,ve]),j=t!==void 0,[oe,ye]=(0,En.useState)(()=>or(r,n)),ue=j?or(t,n):oe,ce=ue?Rr(ue,J,s):"",[ke,Te]=(0,En.useState)(!1),{refs:{setReference:pe,setFloating:W},floatingStyles:me,context:De}=(0,Gt.useFloating)({placement:M,open:ke&&!F&&!P&&!q,onOpenChange:Te,whileElementsMounted:Gt.autoUpdate,transform:!1,middleware:[(0,Gt.offset)(6),(0,Gt.flip)(),(0,Gt.shift)({padding:8})]}),ie=(0,Gt.useDismiss)(De,{escapeKey:!0,outsidePress:!0}),H=(0,Gt.useRole)(De,{role:"dialog"}),{getReferenceProps:se,getFloatingProps:Ie}=(0,Gt.useInteractions)([ie,H]),{isMounted:je,styles:le}=ct(De),ge=!!(K||p),Ee=ge?"error":h,He=C(g,qr,"md"),Oe=C(b,Mn,"lg"),Ve=m==="other"?"":C(Ee,C(m,tf,"outline"),"primary"),Ke=!!ue,Ct=We=>{de||ze(We),N?.(We)},Ne=We=>{j||ye(We);let St=We?Rr(We,n,s):"";o?.(St),he&&Te(!1)},Je=We=>{F||P||q||(We.key==="ArrowDown"||We.key==="Enter"||We.key===" "?(We.preventDefault(),ke||Te(!0)):We.key==="Escape"&&ke&&(We.preventDefault(),Te(!1)))},ot=We=>{We.stopPropagation(),j||ye(null),o?.(null),D?.()},bt=k||J,dt=S==="floating",Bt=S==="left",$e=()=>(0,Ft.jsx)(Pt,{htmlFor:$,label:x,isRequired:G,isFloating:dt,size:g,color:Ee,hasError:ge,cursor:"pointer",className:L}),Ht=We=>(0,Ft.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${He.icon}`,"aria-hidden":"true",children:We}),Nt=["group/field group/datepicker relative flex",Bt?"flex-row items-center gap-3":"flex-col",dt&&!!x?"pt-2":"",ae?"w-full":"inline-flex",V].filter(Boolean).join(" "),st=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",He.inputHeight,Oe,Ve,F?"opacity-50":"",ae?"w-full":"w-auto",Y].filter(Boolean).join(" "),tr=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",He.inputText,He.inputPadding,B].filter(Boolean).join(" ");return I?(0,Ft.jsxs)("div",{className:Nt,children:[!dt&&$e(),(0,Ft.jsxs)("div",{className:`flex flex-col ${ae?"w-full":""}`,children:[(0,Ft.jsxs)("div",{ref:pe,...se(),className:st,children:[dt&&$e(),(0,Ft.jsx)("input",{ref:e,id:$,name:d,type:"text",value:ce,onClick:()=>!F&&!P&&!q&&Te(We=>!We),onKeyDown:Je,readOnly:!0,autoComplete:c,placeholder:bt,disabled:F||q,role:"combobox","aria-expanded":ke&&!q,"aria-haspopup":"dialog","aria-controls":ee,"aria-required":G,"aria-invalid":ge,"aria-busy":q,"aria-disabled":F||q,"aria-describedby":v||p?re:void 0,"aria-errormessage":p?re:void 0,className:tr}),(0,Ft.jsxs)("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[q&&X&&(0,Ft.jsx)("div",{className:"flex items-center justify-center shrink-0",children:Ht((0,Ft.jsx)(Re,{}))}),!q&&fe&&!F&&!P&&(0,Ft.jsx)("button",{type:"button",onClick:ot,"aria-label":"X\xF3a ng\xE0y",tabIndex:Ke?0:-1,"aria-hidden":!Ke,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${He.icon} ${Ke?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,Ft.jsx)(Ue,{className:"size-full"})}),(0,Ft.jsx)("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${ke?"rotate-180":"rotate-0"}`,children:Ht((0,Ft.jsx)(zt,{className:"size-full"}))})]})]}),je&&(0,Ft.jsx)(Gt.FloatingPortal,{root:A?.dialogRef??U?.dialogRef,children:(0,Ft.jsx)(Gt.FloatingFocusManager,{context:De,modal:!1,returnFocus:!0,children:(0,Ft.jsx)("div",{ref:W,id:ee,style:{...me,...le,zIndex:pt.PICKER},...Ie(),className:O,children:(0,Ft.jsx)(fo,{value:ue,onChange:Ne,view:ve,onViewChange:Ct,minDate:f,maxDate:u,isDateDisabled:w,locale:s,firstDayOfWeek:l,showWeekNumbers:_,size:g,color:h,radius:b,showViewTabs:Z,viewTabs:T})})})}),(0,Ft.jsx)(Ae,{id:re,helperText:v,errorMessage:p,sizeClassName:He.helper,className:E})]})]}):(0,Ft.jsx)("div",{className:B,children:(0,Ft.jsx)(fo,{bordered:!1,value:ue,onChange:Ne,view:ve,onViewChange:Ct,minDate:f,maxDate:u,isDateDisabled:w,locale:s,firstDayOfWeek:l,showWeekNumbers:_,size:g,color:h,radius:b,showViewTabs:Z,viewTabs:T})})}var Bn=require("react"),jt=require("@floating-ui/react");var mo=require("react");var Jr={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",icon:"size-3",iconSize:12,calendarPadding:"p-2",cellSize:"w-7 h-7",cellText:"text-[11px]",headerText:"text-xs font-semibold",headerButtonSize:"h-6 w-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",icon:"size-3.5",iconSize:14,calendarPadding:"p-2.5",cellSize:"w-8 h-8",cellText:"text-xs",headerText:"text-xs font-semibold",headerButtonSize:"h-7 w-7",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",icon:"size-[18px]",iconSize:16,calendarPadding:"p-3",cellSize:"w-9 h-9",cellText:"text-sm",headerText:"text-sm font-semibold",headerButtonSize:"h-8 w-8",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",icon:"size-5",iconSize:18,calendarPadding:"p-4",cellSize:"w-10 h-10",cellText:"text-base",headerText:"text-base font-semibold",headerButtonSize:"h-9 w-9",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",icon:"size-6",iconSize:20,calendarPadding:"p-4.5",cellSize:"w-11 h-11",cellText:"text-base",headerText:"text-lg font-semibold",headerButtonSize:"h-10 w-10",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},Po={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},lc={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},Ln={primary:{selected:"bg-primary-500 text-neutral-white hover:bg-primary-600",rangeBg:"bg-primary-100",rangeText:"text-primary-900",hoverBg:"hover:bg-primary-200 hover:text-primary-900",todayRing:"ring-primary-500 text-primary-600",activeText:"text-primary-600",badge:"bg-primary-100 text-primary-700"},secondary:{selected:"bg-secondary-500 text-neutral-white hover:bg-secondary-600",rangeBg:"bg-secondary-100",rangeText:"text-secondary-900",hoverBg:"hover:bg-secondary-200 hover:text-secondary-900",todayRing:"ring-secondary-500 text-secondary-600",activeText:"text-secondary-600",badge:"bg-secondary-100 text-secondary-700"},neutral:{selected:"bg-neutral-800 text-neutral-white hover:bg-neutral-900",rangeBg:"bg-neutral-200",rangeText:"text-neutral-900",hoverBg:"hover:bg-neutral-300 hover:text-neutral-900",todayRing:"ring-neutral-800 text-neutral-800",activeText:"text-neutral-800",badge:"bg-neutral-200 text-neutral-800"},error:{selected:"bg-error-500 text-neutral-white hover:bg-error-600",rangeBg:"bg-error-100",rangeText:"text-error-900",hoverBg:"hover:bg-error-200 hover:text-error-900",todayRing:"ring-error-500 text-error-600",activeText:"text-error-600",badge:"bg-error-100 text-error-700"},success:{selected:"bg-success-500 text-neutral-white hover:bg-success-600",rangeBg:"bg-success-100",rangeText:"text-success-900",hoverBg:"hover:bg-success-200 hover:text-success-900",todayRing:"ring-success-500 text-success-600",activeText:"text-success-600",badge:"bg-success-100 text-success-700"},warning:{selected:"bg-warning-500 text-neutral-950 hover:bg-warning-600",rangeBg:"bg-warning-100",rangeText:"text-warning-900",hoverBg:"hover:bg-warning-200 hover:text-warning-900",todayRing:"ring-warning-500 text-warning-700",activeText:"text-warning-700",badge:"bg-warning-100 text-warning-700"},info:{selected:"bg-info-500 text-neutral-white hover:bg-info-600",rangeBg:"bg-info-100",rangeText:"text-info-900",hoverBg:"hover:bg-info-200 hover:text-info-900",todayRing:"ring-info-500 text-info-600",activeText:"text-info-600",badge:"bg-info-100 text-info-700"}},cc={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"},other:{primary:"",secondary:"",neutral:"",error:"",success:"",warning:"",info:""}};var Qt=require("react/jsx-runtime");function Ra({month1:e,month2:t,view:r,onViewChange:o,onPrevMonth:n,onNextMonth:i,onPrevYear:a,onNextYear:s,onPrevDecade:l,onNextDecade:f,size:u="md",color:w="primary",locale:g}){let m=Ot(g),h=C(u,Jr,"md"),b=C(w,Ln,"primary"),x=m.months[e.getMonth()],S=e.getFullYear(),k=Math.floor(S/10)*10,v=k+9,p=`${x} ${S}`;r==="months"&&(p=`${S}`),r==="years"&&(p=`${k} - ${v}`);let d=m.months[t.getMonth()],y=t.getFullYear(),c=Math.floor(y/10)*10,T=c+9,R=`${d} ${y}`;r==="months"&&(R=`${y}`),r==="years"&&(R=`${c} - ${T}`);let N=()=>{r==="days"?o("months"):r==="months"?o("years"):r==="years"&&o("days")},D=()=>{r==="days"?n():r==="months"?a():r==="years"&&(l?l():a())},M=()=>{r==="days"?i():r==="months"?s():r==="years"&&(f?f():s())};return(0,Qt.jsxs)("div",{className:"flex items-center justify-between px-2 py-1.5 border-b border-neutral-200",children:[(0,Qt.jsxs)("div",{className:"flex items-center space-x-0.5",children:[r==="days"&&(0,Qt.jsx)("button",{type:"button",onClick:a,"aria-label":"N\u0103m tr\u01B0\u1EDBc",className:`flex items-center justify-center ${h.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:(0,Qt.jsx)(Qo,{width:14,height:14})}),(0,Qt.jsx)("button",{type:"button",onClick:D,"aria-label":"Th\xE1ng tr\u01B0\u1EDBc",className:`flex items-center justify-center ${h.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:(0,Qt.jsx)(Br,{width:h.iconSize,height:h.iconSize})})]}),(0,Qt.jsxs)("div",{className:"grid grid-cols-2 flex-1 text-center divide-x divide-transparent px-2",children:[(0,Qt.jsx)("div",{className:"flex items-center justify-center",children:(0,Qt.jsx)("button",{type:"button",onClick:N,"aria-label":"\u0110\u1ED5i ch\u1EBF \u0111\u1ED9 xem l\u1ECBch",className:`font-semibold text-neutral-800 hover:${b.activeText} hover:bg-neutral-100 rounded-md px-2 py-1 transition-colors cursor-pointer ${h.headerText}`,children:p})}),(0,Qt.jsx)("div",{className:"flex items-center justify-center",children:(0,Qt.jsx)("button",{type:"button",onClick:N,"aria-label":"\u0110\u1ED5i ch\u1EBF \u0111\u1ED9 xem l\u1ECBch",className:`font-semibold text-neutral-800 hover:${b.activeText} hover:bg-neutral-100 rounded-md px-2 py-1 transition-colors cursor-pointer ${h.headerText}`,children:R})})]}),(0,Qt.jsxs)("div",{className:"flex items-center space-x-0.5",children:[(0,Qt.jsx)("button",{type:"button",onClick:M,"aria-label":"Th\xE1ng ti\u1EBFp theo",className:`flex items-center justify-center ${h.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:(0,Qt.jsx)(sr,{width:h.iconSize,height:h.iconSize})}),r==="days"&&(0,Qt.jsx)("button",{type:"button",onClick:s,"aria-label":"N\u0103m ti\u1EBFp theo",className:`flex items-center justify-center ${h.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:(0,Qt.jsx)(en,{width:14,height:14})})]})]})}var uc=Ko(require("react"),1);var po=require("react/jsx-runtime");function Ci({days:e,onSelectDate:t,onHoverDate:r,size:o="md",color:n="primary",radius:i,locale:a,firstDayOfWeek:s=1,showWeekNumbers:l=!1}){let f=Ot(a),u=C(o,Jr,"md"),w=C(n,Ln,"primary"),g=C(i,Po,"lg"),m=(0,uc.useRef)(null),h=[...f.weekdaysShort];if(s===1){let d=h.shift();h.push(d)}let b=e.some(d=>(d.isSelected||d.isRangeStart)&&!d.isDisabled),x=e.findIndex(d=>d.isToday&&!d.isDisabled),S=e.findIndex(d=>d.isCurrentMonth&&!d.isDisabled),k=S!==-1?S:e.findIndex(d=>!d.isDisabled),v=d=>{let c=m.current?.querySelectorAll("button")?.[d];c&&!c.disabled&&c.focus()},p=(d,y)=>{let c=null;if(d.key==="ArrowRight"){d.preventDefault();for(let T=y+1;T<e.length;T++)if(!e[T].isDisabled){c=T;break}}else if(d.key==="ArrowLeft"){d.preventDefault();for(let T=y-1;T>=0;T--)if(!e[T].isDisabled){c=T;break}}else if(d.key==="ArrowDown")d.preventDefault(),y+7<e.length&&!e[y+7].isDisabled&&(c=y+7);else if(d.key==="ArrowUp")d.preventDefault(),y-7>=0&&!e[y-7].isDisabled&&(c=y-7);else if(d.key==="Home"){d.preventDefault();let T=y-y%7;for(let R=T;R<T+7&&R<e.length;R++)if(!e[R].isDisabled){c=R;break}}else if(d.key==="End"){d.preventDefault();let T=Math.min(e.length-1,y-y%7+6);for(let R=T;R>=y-y%7;R--)if(!e[R].isDisabled){c=R;break}}else if(d.key==="Enter"||d.key===" "){d.preventDefault();let T=e[y];T&&!T.isDisabled&&t(T.date);return}c!==null&&v(c)};return(0,po.jsxs)("div",{ref:m,role:"grid","aria-label":f.months[e[15]?.month||0],className:"w-full",children:[(0,po.jsxs)("div",{role:"row",className:`grid ${l?"grid-cols-8":"grid-cols-7"} gap-1 mb-1 text-center`,children:[l&&(0,po.jsx)("div",{role:"columnheader","aria-label":f.weekText||"Week",className:`flex items-center justify-center ${u.cellSize} text-neutral-400 ${u.cellText} font-medium`,children:"#"}),h.map(d=>(0,po.jsx)("div",{role:"columnheader","aria-label":d,className:`flex items-center justify-center ${u.cellSize} text-neutral-500 ${u.cellText} font-medium`,children:d},d))]}),(0,po.jsx)("div",{role:"rowgroup",className:`grid ${l?"grid-cols-8":"grid-cols-7"} gap-y-1 gap-x-1`,children:e.map((d,y)=>{let c=y%7===0,T="text-neutral-800 hover:bg-neutral-100",R="";d.isDisabled?T="text-neutral-300 cursor-not-allowed line-through":d.isRangeStart||d.isRangeEnd?(T=`${w.selected} font-semibold shadow-xs`,d.isRangeStart&&d.isRangeEnd?R="":d.isRangeStart?R=`${w.rangeBg} rounded-l-full`:d.isRangeEnd&&(R=`${w.rangeBg} rounded-r-full`)):d.isSelected?T=`${w.selected} font-semibold shadow-xs`:d.isInRange||d.isHoveredRange?(T=`${w.rangeBg} ${w.rangeText} rounded-none`,R=`${w.rangeBg}`):d.isCurrentMonth||(T="text-neutral-400 hover:bg-neutral-100");let N=d.isToday&&!d.isSelected?`ring-1 ${w.todayRing} font-bold`:"",D=`${d.day} ${f.months[d.month]} ${d.year}`,M=!d.isDisabled&&(d.isSelected||d.isRangeStart||!b&&d.isToday&&y===x||!b&&x===-1&&y===k);return(0,po.jsxs)(uc.default.Fragment,{children:[l&&c&&(0,po.jsxs)("div",{className:`flex items-center justify-center ${u.cellSize} text-neutral-400 ${u.cellText} text-[10px] font-mono`,children:["W",d.weekNumber]}),(0,po.jsx)("div",{role:"gridcell","aria-selected":d.isSelected||d.isInRange,className:`relative flex items-center justify-center ${R}`,children:(0,po.jsx)("button",{type:"button",disabled:d.isDisabled,tabIndex:M?0:-1,onKeyDown:F=>p(F,y),onClick:()=>!d.isDisabled&&t(d.date),onMouseEnter:()=>!d.isDisabled&&r?.(d.date),onMouseLeave:()=>r?.(null),"aria-label":D,"aria-current":d.isToday?"date":void 0,"aria-disabled":d.isDisabled,className:`flex items-center justify-center ${u.cellSize} ${u.cellText} ${g} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${T} ${N}`,children:d.day})})]},d.date.toISOString())})})]})}var af=require("react");var dc=require("react/jsx-runtime");function Si({currentMonth:e,onSelectMonth:t,size:r="md",color:o="primary",radius:n,locale:i,rangeStart:a,rangeEnd:s,hoveredDate:l,onHoverMonth:f}){let u=Ot(i),w=C(r,Jr,"md"),g=C(o,Ln,"primary"),m=C(n,Po,"lg"),h=(0,af.useRef)(null),b=e.getFullYear(),x=new Date,S=x.getMonth(),k=x.getFullYear(),v=a&&a.getFullYear()===b?a.getMonth():-1,p=v!==-1?v:k===b?S:0,d=c=>{let R=h.current?.querySelectorAll("button")?.[c];R&&R.focus()},y=(c,T)=>{let R=null;if(c.key==="ArrowRight")c.preventDefault(),T+1<u.monthsShort.length&&(R=T+1);else if(c.key==="ArrowLeft")c.preventDefault(),T-1>=0&&(R=T-1);else if(c.key==="ArrowDown")c.preventDefault(),T+3<u.monthsShort.length&&(R=T+3);else if(c.key==="ArrowUp")c.preventDefault(),T-3>=0&&(R=T-3);else if(c.key==="Home")c.preventDefault(),R=0;else if(c.key==="End")c.preventDefault(),R=u.monthsShort.length-1;else if(c.key==="Enter"||c.key===" "){c.preventDefault(),t(T);return}R!==null&&d(R)};return(0,dc.jsx)("div",{ref:h,role:"grid","aria-label":"Ch\u1ECDn th\xE1ng",className:"grid grid-cols-3 gap-2 py-2",onMouseLeave:()=>f?.(null),children:u.monthsShort.map((c,T)=>{let R=new Date(b,T,1),N=R.getTime(),D=a?new Date(a.getFullYear(),a.getMonth(),1).getTime():null,M=s?new Date(s.getFullYear(),s.getMonth(),1).getTime():null,F=l?new Date(l.getFullYear(),l.getMonth(),1).getTime():null,P=!!D&&D===N,I=!!M&&M===N,z=!1,B=!1;D&&M?z=N>D&&N<M:D&&!M&&F&&(F>D?B=N>D&&N<=F:F<D&&(B=N<D&&N>=F));let V=k===b&&S===T,Y=T===p,L="text-neutral-800 hover:bg-neutral-100";return P||I?L=`${g.selected} font-semibold shadow-xs`:z||B?L=`${g.rangeBg} ${g.rangeText}`:V&&(L=`ring-1 ${g.todayRing} font-semibold`),(0,dc.jsx)("div",{role:"gridcell","aria-selected":P||I||z,className:"flex items-center justify-center",children:(0,dc.jsx)("button",{type:"button",tabIndex:Y?0:-1,onKeyDown:E=>y(E,T),onClick:()=>t(T),onMouseEnter:()=>f?.(R),"aria-label":`${c} ${b}`,className:`w-full flex items-center justify-center h-10 ${w.cellText} ${m} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${L}`,children:c})},c)})})}var sf=require("react");var fc=require("react/jsx-runtime");function Ti({currentMonth:e,onSelectYear:t,size:r="md",color:o="primary",radius:n,rangeStart:i,rangeEnd:a,hoveredDate:s,onHoverYear:l}){let f=C(r,Jr,"md"),u=C(o,Ln,"primary"),w=C(n,Po,"lg"),g=(0,sf.useRef)(null),m=e.getFullYear(),h=Math.floor(m/10)*10,b=new Date().getFullYear(),x=[];for(let c=0;c<12;c++)x.push(h+c);let S=i?i.getFullYear():m,k=x.indexOf(S),v=x.indexOf(b),p=k!==-1?k:v!==-1?v:0,d=c=>{let R=g.current?.querySelectorAll("button")?.[c];R&&R.focus()},y=(c,T)=>{let R=null;if(c.key==="ArrowRight")c.preventDefault(),T+1<x.length&&(R=T+1);else if(c.key==="ArrowLeft")c.preventDefault(),T-1>=0&&(R=T-1);else if(c.key==="ArrowDown")c.preventDefault(),T+3<x.length&&(R=T+3);else if(c.key==="ArrowUp")c.preventDefault(),T-3>=0&&(R=T-3);else if(c.key==="Home")c.preventDefault(),R=0;else if(c.key==="End")c.preventDefault(),R=x.length-1;else if(c.key==="Enter"||c.key===" "){c.preventDefault();let N=x[T];N!==void 0&&t(N);return}R!==null&&d(R)};return(0,fc.jsx)("div",{ref:g,role:"grid","aria-label":"Ch\u1ECDn n\u0103m",className:"grid grid-cols-3 gap-2 py-2",onMouseLeave:()=>l?.(null),children:x.map((c,T)=>{let R=i?i.getFullYear():null,N=a?a.getFullYear():null,D=s?s.getFullYear():null,M=R!==null&&c===R,F=N!==null&&c===N,P=!1,I=!1;R!==null&&N!==null?P=c>R&&c<N:R!==null&&N===null&&D!==null&&(D>R?I=c>R&&c<=D:D<R&&(I=c<R&&c>=D));let z=c===b,B=T===p,V="text-neutral-800 hover:bg-neutral-100";return M||F?V=`${u.selected} font-semibold shadow-xs`:P||I?V=`${u.rangeBg} ${u.rangeText}`:z&&(V=`ring-1 ${u.todayRing} font-semibold`),(0,fc.jsx)("div",{role:"gridcell","aria-selected":M||F||P,className:"flex items-center justify-center",children:(0,fc.jsx)("button",{type:"button",tabIndex:B?0:-1,onKeyDown:Y=>y(Y,T),onClick:()=>t(c),onMouseEnter:()=>l?.(new Date(c,0,1)),"aria-label":`${c}`,className:`w-full flex items-center justify-center h-10 ${f.cellText} ${w} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${V}`,children:c})},c)})})}function rd(e,t,r){if(!t||!r)return!1;let o=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),n=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),i=new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime(),a=Math.min(n,i),s=Math.max(n,i);return o>=a&&o<=s}function lf(e,t){return new Date(e,t+1,0).getDate()}function td(e,t,r,o,n,i,a,s,l){let f=o?un(e,o):!1,u=n?un(e,n):!1,w=rd(e,o||null,n||null),g=o&&!n&&i?rd(e,o,i):!1,m=!1;return a&&va(e,a)&&(m=!0),s&&ya(e,s)&&(m=!0),l&&l(e)&&(m=!0),{date:e,day:e.getDate(),month:e.getMonth(),year:e.getFullYear(),isCurrentMonth:t,isToday:un(e,r),isSelected:f||u,isDisabled:m,isRangeStart:f,isRangeEnd:u,isInRange:w,isHoveredRange:g,weekNumber:wa(e)}}function Na(e,t,r=1,o,n,i,a,s,l){let f=[],u=new Date,w=new Date(e,t,1).getDay(),g=lf(e,t-1),m=lf(e,t),h=r===1?w===0?6:w-1:w;for(let x=h-1;x>=0;x--){let S=g-x,k=new Date(e,t-1,S);f.push(td(k,!1,u,o,n,i,a,s,l))}for(let x=1;x<=m;x++){let S=new Date(e,t,x);f.push(td(S,!0,u,o,n,i,a,s,l))}let b=42-f.length;for(let x=1;x<=b;x++){let S=new Date(e,t+1,x);f.push(td(S,!1,u,o,n,i,a,s,l))}return f}var nr=require("react/jsx-runtime");function ki({value:e,onChange:t,view:r="days",onViewChange:o,minDate:n,maxDate:i,isDateDisabled:a,locale:s="vi",firstDayOfWeek:l=1,showWeekNumbers:f=!1,showViewTabs:u=!1,viewTabs:w=["days","months","years"],size:g="md",color:m="primary",radius:h,className:b="",bordered:x=!0}){let S=C(g,Jr,"md"),k=C(h,lc,"lg"),[v,p]=(0,mo.useState)(r),[d,y]=(0,mo.useState)(r);r!==d&&(y(r),p(r));let c=e?e[0]:null,T=e?e[1]:null,[R,N]=(0,mo.useState)(()=>{let $=c||new Date;return new Date($.getFullYear(),$.getMonth(),1)}),D=Ot(s),M=(0,mo.useMemo)(()=>{let $=D.viewTabs||{days:"Ng\xE0y",months:"Th\xE1ng",years:"N\u0103m"};return(w||["days","months","years"]).map(re=>({key:re,label:$[re]||re}))},[w,D.viewTabs]),F=$=>{let re=$;p(re),E(null),o?.(re)},P=()=>{let $=new Date(R.getFullYear(),R.getMonth()-1,1);N($)},I=()=>{let $=new Date(R.getFullYear(),R.getMonth()+1,1);N($)},z=()=>{let $=new Date(R.getFullYear()-1,R.getMonth(),1);N($)},B=()=>{let $=new Date(R.getFullYear()+1,R.getMonth(),1);N($)},V=()=>{let $=new Date(R.getFullYear()-10,R.getMonth(),1);N($)},Y=()=>{let $=new Date(R.getFullYear()+10,R.getMonth(),1);N($)},[L,E]=(0,mo.useState)(null),[O,A]=(0,mo.useState)(null),U=$=>{if(!L)E($),t?.([$,null]);else{let re=L,ee=$;$.getTime()<re.getTime()&&(re=$,ee=L),E(null),t?.([re,ee])}},G=($,re)=>{let ee=new Date($,re,1);if(N(ee),u&&r==="months")if(!L)E(ee),t?.([ee,null]);else{let de=L,ne=ee;ee.getTime()<de.getTime()&&(de=ee,ne=L),E(null),t?.([de,ne])}else p("days")},K=$=>{let re=new Date($,0,1);if(N(re),u&&r==="years")if(!L)E(re),t?.([re,null]);else{let ee=L,de=re;re.getTime()<ee.getTime()&&(ee=re,de=L),E(null),t?.([ee,de])}else p("months")},q=or(n),X=or(i),fe=R,ae=(0,mo.useMemo)(()=>v==="months"?new Date(R.getFullYear()+1,R.getMonth(),1):v==="years"?new Date(R.getFullYear()+10,R.getMonth(),1):new Date(R.getFullYear(),R.getMonth()+1,1),[R,v]),_=L||c,Z=L?null:T,he=(0,mo.useMemo)(()=>Na(fe.getFullYear(),fe.getMonth(),l,_,Z,O,q,X,a),[fe,l,_,Z,O,q,X,a]),xe=(0,mo.useMemo)(()=>Na(ae.getFullYear(),ae.getMonth(),l,_,Z,O,q,X,a),[ae,l,_,Z,O,q,X,a]);return(0,nr.jsxs)("div",{className:`inline-flex flex-col ${x?"border-2 border-neutral-200 bg-neutral-white shadow-xl":"border-0 shadow-none bg-transparent"} ${k} overflow-hidden select-none ${b}`,children:[u&&M.length>0&&(0,nr.jsx)("div",{className:"px-2.5 py-1.5 border-b border-neutral-200",children:(0,nr.jsx)(Dn,{activeKey:r,onChange:F,size:"sm",variant:"solid",color:m,fullWidth:!0,className:"gap-0!",children:(0,nr.jsx)(Pn,{className:"p-0.5",children:M.map($=>(0,nr.jsx)(zn,{value:$.key,className:"py-1 px-2 text-xs",children:$.label},$.key))})})}),(0,nr.jsx)(Ra,{month1:fe,month2:ae,view:v,onViewChange:p,onPrevMonth:P,onNextMonth:I,onPrevYear:z,onNextYear:B,onPrevDecade:V,onNextDecade:Y,size:g,color:m,locale:s}),(0,nr.jsxs)("div",{className:"flex flex-row divide-x divide-neutral-200",children:[(0,nr.jsxs)("div",{className:`${S.calendarPadding} min-w-70`,children:[v==="days"&&(0,nr.jsx)(Ci,{days:he,onSelectDate:U,onHoverDate:A,size:g,color:m,radius:h,locale:s,firstDayOfWeek:l,showWeekNumbers:f}),v==="months"&&(0,nr.jsx)(Si,{currentMonth:fe,onSelectMonth:$=>G(fe.getFullYear(),$),size:g,color:m,radius:h,locale:s,rangeStart:_,rangeEnd:Z,hoveredDate:O,onHoverMonth:A}),v==="years"&&(0,nr.jsx)(Ti,{currentMonth:fe,onSelectYear:K,size:g,color:m,radius:h,rangeStart:_,rangeEnd:Z,hoveredDate:O,onHoverYear:A})]}),(0,nr.jsxs)("div",{className:`${S.calendarPadding} min-w-70`,children:[v==="days"&&(0,nr.jsx)(Ci,{days:xe,onSelectDate:U,onHoverDate:A,size:g,color:m,radius:h,locale:s,firstDayOfWeek:l,showWeekNumbers:f}),v==="months"&&(0,nr.jsx)(Si,{currentMonth:ae,onSelectMonth:$=>G(ae.getFullYear(),$),size:g,color:m,radius:h,locale:s,rangeStart:_,rangeEnd:Z,hoveredDate:O,onHoverMonth:A}),v==="years"&&(0,nr.jsx)(Ti,{currentMonth:ae,onSelectYear:K,size:g,color:m,radius:h,rangeStart:_,rangeEnd:Z,hoveredDate:O,onHoverYear:A})]})]})]})}var Et=require("react/jsx-runtime");function Hn({ref:e,value:t,defaultValue:r,onChange:o,separator:n=" - ",format:i="DD/MM/YYYY",displayFormat:a,defaultView:s="days",locale:l="vi",firstDayOfWeek:f=1,minDate:u,maxDate:w,isDateDisabled:g,size:m="md",variant:h="outline",color:b="primary",radius:x,label:S,labelPlacement:k="floating",placeholder:v,helperText:p,errorMessage:d,name:y,id:c,autoComplete:T,viewTabs:R=["days","months","years"],view:N,onViewChange:D,onClear:M,placement:F="bottom-start",disabled:P=!1,readOnly:I=!1,portal:z=!0,config:B,className:V="",wrapperClassName:Y="",inputWrapperClassName:L="",labelClassName:E="",helperClassName:O="",popoverClassName:A=""}){let U=tt(),G=rt(),{isRequired:K=!1,isInvalid:q=!1,isLoading:X=!1,showSpinner:fe=!1,isClearable:ae=!0,isFullWidth:_=!0,showWeekNumbers:Z=!1,showViewTabs:he=!1,closeOnSelect:xe=!0}=B??{},$=(0,Bn.useId)(),re=c||$,ee=`${re}-error-helper`,de=`${re}-popover`,ne=N!==void 0,[ze,ve]=(0,Bn.useState)(s),Ce=ne?N:ze,J=a||i,j=(0,Bn.useMemo)(()=>nc(J,Ce),[J,Ce]),oe=t!==void 0,[ye,ue]=(0,Bn.useState)(()=>{let we=r;return we&&Array.isArray(we)?[or(we[0],i),or(we[1],i)]:[null,null]}),ce=oe&&t&&Array.isArray(t)?[or(t[0],i),or(t[1],i)]:ye,ke=ce[0]&&ce[1]?`${Rr(ce[0],j,l)}${n}${Rr(ce[1],j,l)}`:ce[0]?`${Rr(ce[0],j,l)}${n}`:"",[Te,pe]=(0,Bn.useState)(!1),{refs:{setReference:W,setFloating:me},floatingStyles:De,context:ie}=(0,jt.useFloating)({placement:F,open:Te&&!P&&!I&&!X,onOpenChange:pe,whileElementsMounted:jt.autoUpdate,transform:!1,middleware:[(0,jt.offset)(6),(0,jt.flip)(),(0,jt.shift)({padding:8})]}),H=(0,jt.useDismiss)(ie,{escapeKey:!0,outsidePress:!0}),se=(0,jt.useRole)(ie,{role:"dialog"}),{getReferenceProps:Ie,getFloatingProps:je}=(0,jt.useInteractions)([H,se]),{isMounted:le,styles:ge}=ct(ie),Ee=!!(q||d),He=Ee?"error":b,Oe=C(m,Jr,"md"),Ve=C(x,Po,"lg"),Ke=C(h,cc,"outline"),Ct=h==="other"?"":C(He,Ke,"primary"),Ne=!!ce[0],Je=we=>{ne||ve(we),D?.(we)},ot=we=>{oe||ue(we);let[Xe,Vt]=we;if(Xe&&Vt){let qe=[Rr(Xe,i,l),Rr(Vt,i,l)];o?.(qe),xe&&pe(!1)}},bt=we=>{P||I||X||(we.key==="ArrowDown"||we.key==="Enter"||we.key===" "?(we.preventDefault(),Te||pe(!0)):we.key==="Escape"&&Te&&(we.preventDefault(),pe(!1)))},dt=we=>{we.stopPropagation(),oe||ue([null,null]),o?.(null),M?.()},Bt=v||`${j}${n}${j}`,$e=k==="floating",Ht=k==="left",Rt=()=>(0,Et.jsx)(Pt,{htmlFor:re,label:S,isRequired:K,isFloating:$e,size:m,color:He,hasError:Ee,cursor:"pointer",className:E}),Nt=we=>(0,Et.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${Oe.icon}`,"aria-hidden":"true",children:we}),tr=["group/field group/daterangepicker relative flex",Ht?"flex-row items-center gap-3":"flex-col",$e&&!!S?"pt-2":"",_?"w-full":"inline-flex",Y].filter(Boolean).join(" "),We=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",Oe.inputHeight,Ve,Ct,P?"opacity-50":"",_?"w-full":"w-auto",L].filter(Boolean).join(" "),St=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",Oe.inputText,Oe.inputPadding,V].filter(Boolean).join(" ");return z?(0,Et.jsxs)("div",{className:tr,children:[!$e&&Rt(),(0,Et.jsxs)("div",{className:`flex flex-col ${_?"w-full":""}`,children:[(0,Et.jsxs)("div",{ref:W,...Ie(),className:We,children:[$e&&Rt(),(0,Et.jsx)("input",{ref:e,id:re,name:y,type:"text",value:ke,onClick:()=>!P&&!I&&!X&&pe(we=>!we),onKeyDown:bt,readOnly:!0,autoComplete:T,placeholder:Bt,disabled:P||X,role:"combobox","aria-expanded":Te&&!X,"aria-haspopup":"dialog","aria-controls":de,"aria-required":K,"aria-invalid":Ee,"aria-busy":X,"aria-disabled":P||X,"aria-describedby":p||d?ee:void 0,"aria-errormessage":d?ee:void 0,className:St}),(0,Et.jsxs)("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[X&&fe&&(0,Et.jsx)("div",{className:"flex items-center justify-center shrink-0",children:Nt((0,Et.jsx)(Re,{}))}),!X&&ae&&!P&&!I&&(0,Et.jsx)("button",{type:"button",onClick:dt,"aria-label":"X\xF3a kho\u1EA3ng ng\xE0y",tabIndex:Ne?0:-1,"aria-hidden":!Ne,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${Oe.icon} ${Ne?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,Et.jsx)(Ue,{className:"size-full"})}),(0,Et.jsx)("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${Te?"rotate-180":"rotate-0"}`,children:Nt((0,Et.jsx)(zt,{className:"size-full"}))})]})]}),le&&(0,Et.jsx)(jt.FloatingPortal,{root:U?.dialogRef??G?.dialogRef,children:(0,Et.jsx)(jt.FloatingFocusManager,{context:ie,modal:!1,returnFocus:!0,children:(0,Et.jsx)("div",{ref:me,id:de,style:{...De,...ge,zIndex:pt.PICKER},...je(),className:A,children:(0,Et.jsx)(ki,{value:ce,onChange:ot,view:Ce,onViewChange:Je,minDate:u,maxDate:w,isDateDisabled:g,locale:l,firstDayOfWeek:f,showWeekNumbers:Z,size:m,color:b,radius:x,showViewTabs:he,viewTabs:R})})})}),(0,Et.jsx)(Ae,{id:ee,helperText:p,errorMessage:d,sizeClassName:Oe.helper,className:O})]})]}):(0,Et.jsx)("div",{className:V,children:(0,Et.jsx)(ki,{bordered:!1,value:ce,onChange:ot,view:Ce,onViewChange:Je,minDate:u,maxDate:w,isDateDisabled:g,locale:l,firstDayOfWeek:f,showWeekNumbers:Z,size:m,color:b,radius:x,showViewTabs:he,viewTabs:R})})}var zs=require("react"),Yt=require("@floating-ui/react");var Ri=require("react");var Vn={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",icon:"size-3",iconSize:12,panelPadding:"p-1.5",columnWidth:"w-12",columnHeight:"h-36",itemHeight:"h-6",itemText:"text-[11px]",headerText:"text-[11px] font-semibold",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",icon:"size-3.5",iconSize:14,panelPadding:"p-2",columnWidth:"w-14",columnHeight:"h-44",itemHeight:"h-7",itemText:"text-xs",headerText:"text-xs font-semibold",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",icon:"size-[18px]",iconSize:16,panelPadding:"p-2.5",columnWidth:"w-16",columnHeight:"h-52",itemHeight:"h-8",itemText:"text-sm",headerText:"text-sm font-semibold",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",icon:"size-5",iconSize:18,panelPadding:"p-3",columnWidth:"w-18",columnHeight:"h-60",itemHeight:"h-9",itemText:"text-base",headerText:"text-base font-semibold",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",icon:"size-6",iconSize:20,panelPadding:"p-3.5",columnWidth:"w-20",columnHeight:"h-68",itemHeight:"h-10",itemText:"text-base",headerText:"text-lg font-semibold",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},pc={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},mc={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},cf={none:"rounded-none",sm:"rounded-xs",md:"rounded-md",lg:"rounded-lg",xl:"rounded-lg",full:"rounded-full"},uf={primary:{selected:"bg-primary-500 text-neutral-white font-semibold shadow-xs hover:bg-primary-600",hoverBg:"hover:bg-primary-100 hover:text-primary-900",activeText:"text-primary-600",accentBg:"bg-primary-500"},secondary:{selected:"bg-secondary-500 text-neutral-white font-semibold shadow-xs hover:bg-secondary-600",hoverBg:"hover:bg-secondary-100 hover:text-secondary-900",activeText:"text-secondary-600",accentBg:"bg-secondary-500"},neutral:{selected:"bg-neutral-800 text-neutral-white font-semibold shadow-xs hover:bg-neutral-900",hoverBg:"hover:bg-neutral-200 hover:text-neutral-900",activeText:"text-neutral-800",accentBg:"bg-neutral-800"},error:{selected:"bg-error-500 text-neutral-white font-semibold shadow-xs hover:bg-error-600",hoverBg:"hover:bg-error-100 hover:text-error-900",activeText:"text-error-600",accentBg:"bg-error-500"},success:{selected:"bg-success-500 text-neutral-white font-semibold shadow-xs hover:bg-success-600",hoverBg:"hover:bg-success-100 hover:text-success-900",activeText:"text-success-600",accentBg:"bg-success-500"},warning:{selected:"bg-warning-500 text-neutral-950 font-semibold shadow-xs hover:bg-warning-600",hoverBg:"hover:bg-warning-100 hover:text-warning-900",activeText:"text-warning-700",accentBg:"bg-warning-500"},info:{selected:"bg-info-500 text-neutral-white font-semibold shadow-xs hover:bg-info-600",hoverBg:"hover:bg-info-100 hover:text-info-900",activeText:"text-info-600",accentBg:"bg-info-500"}};var gc={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"}};function Qr(e){return e<10?`0${e}`:`${e}`}function dn(e=!1,t=!0){return e?t?"hh:mm:ss A":"hh:mm A":t?"HH:mm:ss":"HH:mm"}function Dr(e){if(!e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:new Date(e);if(typeof e!="string")return null;let t=e.trim();if(!t)return null;if(t.includes("T")){let n=new Date(t);if(!isNaN(n.getTime()))return n}let r=/^(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?(?:\s*([ap]m))?$/i,o=t.match(r);if(o){let n=parseInt(o[1],10),i=parseInt(o[2],10),a=o[3]?parseInt(o[3],10):0,s=o[4]?.toUpperCase();if(s&&(s==="PM"&&n<12&&(n+=12),s==="AM"&&n===12&&(n=0)),n>=0&&n<24&&i>=0&&i<60&&a>=0&&a<60){let l=new Date;return l.setHours(n,i,a,0),l}}return null}function br(e,t="HH:mm:ss"){if(!e||isNaN(e.getTime()))return"";let r=e.getHours(),o=e.getMinutes(),n=e.getSeconds(),i=r%12;i===0&&(i=12);let a=r>=12?"PM":"AM";return t.replace(/HH/g,Qr(r)).replace(/H/g,`${r}`).replace(/hh/g,Qr(i)).replace(/h/g,`${i}`).replace(/mm/g,Qr(o)).replace(/m/g,`${o}`).replace(/ss/g,Qr(n)).replace(/s/g,`${n}`).replace(/A/g,a).replace(/a/g,a.toLowerCase())}function od(e){if(!e)return{hours:0,minutes:0,seconds:0,period:"AM"};let t=e.getHours();return{hours:t,minutes:e.getMinutes(),seconds:e.getSeconds(),period:t>=12?"PM":"AM"}}function An(e,t,r=0){let o=new Date;return o.setHours(e,t,r,0),o}function nd(e,t,r=!0){return!e||!t?!1:r?e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes()&&e.getSeconds()===t.getSeconds():e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes()}function id(e,t){if(!e||!t)return!1;let r=e.getHours()*3600+e.getMinutes()*60+e.getSeconds(),o=t.getHours()*3600+t.getMinutes()*60+t.getSeconds();return r<o}function ad(e,t){if(!e||!t)return!1;let r=e.getHours()*3600+e.getMinutes()*60+e.getSeconds(),o=t.getHours()*3600+t.getMinutes()*60+t.getSeconds();return r>o}function On(e,t,r,o,n,i,a,s,l){if(e==="hour"){if(a?.().includes(t)||n&&t<n.getHours()||i&&t>i.getHours())return!0}else if(e==="minute"){if(s?.(r).includes(t)||n&&(r<n.getHours()||r===n.getHours()&&t<n.getMinutes())||i&&(r>i.getHours()||r===i.getHours()&&t>i.getMinutes()))return!0}else if(e==="second"&&(l?.(r,o).includes(t)||n&&(r<n.getHours()||r===n.getHours()&&o<n.getMinutes()||r===n.getHours()&&o===n.getMinutes()&&t<n.getSeconds())||i&&(r>i.getHours()||r===i.getHours()&&o>i.getMinutes()||r===i.getHours()&&o===i.getMinutes()&&t>i.getSeconds())))return!0;return!1}var Ps=require("react");var sd=require("react/jsx-runtime");function fn({items:e,selectedValue:t,onSelect:r,ariaLabel:o,size:n="md",color:i="primary",radius:a,className:s="",itemClassName:l="",selectedItemClassName:f=""}){let u=(0,Ps.useRef)(null),w=(0,Ps.useRef)(null),g=C(n,Vn,"md"),m=C(i,uf,"primary"),h=C(a,cf,"md"),b=e.findIndex(v=>!v.disabled),x=e.some(v=>v.value===t);(0,Ps.useEffect)(()=>{if(w.current&&u.current){let v=u.current,p=w.current,d=p.offsetTop-v.offsetTop-(v.clientHeight-p.clientHeight)/2;v.scrollTo({top:Math.max(0,d),behavior:"smooth"}),v.contains(document.activeElement)&&p.focus()}},[t]);let S=v=>{let p=e[v];if(!p||p.disabled)return;r(p.value),u.current?.children[v]?.focus()},k=(v,p)=>{if(e.filter(y=>!y.disabled).length){if(v.key==="ArrowDown"){v.preventDefault();for(let y=p+1;y<e.length;y++)if(!e[y].disabled){S(y);break}}else if(v.key==="ArrowUp"){v.preventDefault();for(let y=p-1;y>=0;y--)if(!e[y].disabled){S(y);break}}else if(v.key==="ArrowRight")v.preventDefault(),u.current?.nextElementSibling?.querySelector('[tabindex="0"], [role="option"]:not([aria-disabled="true"])')?.focus();else if(v.key==="ArrowLeft")v.preventDefault(),u.current?.previousElementSibling?.querySelector('[tabindex="0"], [role="option"]:not([aria-disabled="true"])')?.focus();else if(v.key==="Home"){v.preventDefault();let y=e.findIndex(c=>!c.disabled);y!==-1&&S(y)}else if(v.key==="End"){v.preventDefault();for(let y=e.length-1;y>=0;y--)if(!e[y].disabled){S(y);break}}else if(v.key==="Enter"||v.key===" "){v.preventDefault();let y=e[p];y&&!y.disabled&&S(p)}}};return(0,sd.jsx)("ul",{ref:u,role:"listbox","aria-label":o,tabIndex:-1,className:`relative flex flex-col overflow-y-auto select-none ${g.columnWidth} ${g.columnHeight} scrollbar-thin scrollbar-thumb-neutral-300 hover:scrollbar-thumb-neutral-400 py-1 focus:outline-none ${s}`,style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e.map((v,p)=>{let d=t===v.value,y=!!v.disabled,c=!y&&(d||!x&&p===b);return(0,sd.jsx)("li",{ref:d?w:void 0,role:"option","aria-selected":d,"aria-disabled":y,"aria-label":`${v.label} ${o||""}`.trim(),tabIndex:c?0:-1,onKeyDown:T=>k(T,p),onClick:()=>{y||S(p)},className:`flex items-center justify-center shrink-0 transition-colors duration-150 mx-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${h} ${g.itemHeight} ${g.itemText} ${y?"opacity-30 cursor-not-allowed text-neutral-400":d?`${m.selected} cursor-default ${f}`:`text-neutral-700 ${m.hoverBg} cursor-pointer`} ${l}`,children:v.label},`${v.value}`)})})}var zo=require("react/jsx-runtime");function Or({value:e,onChange:t,ariaLabel:r="Time selector",use12Hours:o=!1,showSeconds:n=!0,hourStep:i=1,minuteStep:a=1,secondStep:s=1,minTime:l,maxTime:f,disabledHours:u,disabledMinutes:w,disabledSeconds:g,size:m="md",color:h="primary",radius:b,className:x=""}){let S=(0,Ri.useMemo)(()=>Dr(l),[l]),k=(0,Ri.useMemo)(()=>Dr(f),[f]),v=dn(o,n),p=C(b,mc,"lg"),d=C(m,Vn,"md"),y=e?e.getHours():0,c=y%12===0?12:y%12,T=e?e.getMinutes():0,R=e?e.getSeconds():0,N=y>=12?"PM":"AM",D=(0,Ri.useMemo)(()=>{let L=[];if(o)for(let E=1;E<=12;E+=i){let O=N==="PM"?E===12?12:E+12:E===12?0:E,A=On("hour",O,y,T,S,k,u,w,g);L.push({value:E,label:Qr(E),disabled:A})}else for(let E=0;E<24;E+=i){let O=On("hour",E,y,T,S,k,u,w,g);L.push({value:E,label:Qr(E),disabled:O})}return L},[o,i,N,y,T,S,k,u,w,g]),M=(0,Ri.useMemo)(()=>{let L=[];for(let E=0;E<60;E+=a){let O=On("minute",E,y,T,S,k,u,w,g);L.push({value:E,label:Qr(E),disabled:O})}return L},[a,y,T,S,k,u,w,g]),F=(0,Ri.useMemo)(()=>{if(!n)return[];let L=[];for(let E=0;E<60;E+=s){let O=On("second",E,y,T,S,k,u,w,g);L.push({value:E,label:Qr(E),disabled:O})}return L},[n,s,y,T,S,k,u,w,g]),P=(0,Ri.useMemo)(()=>[{value:"AM",label:"AM"},{value:"PM",label:"PM"}],[]),I=L=>{let E=Number(L);o&&(N==="PM"&&E<12&&(E+=12),N==="AM"&&E===12&&(E=0));let O=An(E,T,R);t?.(O)},z=L=>{let E=Number(L),O=An(y,E,R);t?.(O)},B=L=>{let E=Number(L),O=An(y,T,E);t?.(O)},V=L=>{let E=L,O=y;E==="AM"&&O>=12?O-=12:E==="PM"&&O<12&&(O+=12);let A=An(O,T,R);t?.(A)},Y=n?"--:--:--":"--:--";return(0,zo.jsxs)("div",{"aria-label":r,className:`inline-flex flex-col bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden select-none ${p} ${x}`,children:[(0,zo.jsx)("div",{className:"flex items-center justify-center px-4 py-2 border-b border-neutral-200 bg-neutral-50/50",children:(0,zo.jsx)("span",{className:`text-neutral-700 tracking-wider font-mono ${d.headerText}`,children:e?br(e,v):Y})}),(0,zo.jsxs)("div",{className:`flex divide-x divide-neutral-200 ${d.panelPadding}`,children:[(0,zo.jsx)(fn,{ariaLabel:"Gi\u1EDD",items:D,selectedValue:o?c:e?y:null,onSelect:I,size:m,color:h,radius:b}),(0,zo.jsx)(fn,{ariaLabel:"Ph\xFAt",items:M,selectedValue:e?T:null,onSelect:z,size:m,color:h,radius:b}),n&&(0,zo.jsx)(fn,{ariaLabel:"Gi\xE2y",items:F,selectedValue:e?R:null,onSelect:B,size:m,color:h,radius:b}),o&&(0,zo.jsx)(fn,{ariaLabel:"Bu\u1ED5i",items:P,selectedValue:e?N:null,onSelect:V,size:m,color:h,radius:b})]})]})}var Ut=require("react/jsx-runtime");function bc({ref:e,value:t,defaultValue:r,onChange:o,format:n="HH:mm:ss",displayFormat:i,use12Hours:a=!1,showSeconds:s=!0,hourStep:l=1,minuteStep:f=1,secondStep:u=1,minTime:w,maxTime:g,disabledHours:m,disabledMinutes:h,disabledSeconds:b,size:x="md",variant:S="outline",color:k="primary",radius:v,label:p,labelPlacement:d="floating",placeholder:y,helperText:c,errorMessage:T,name:R,id:N,autoComplete:D,onClear:M,placement:F="bottom-start",disabled:P=!1,readOnly:I=!1,config:z,className:B="",wrapperClassName:V="",inputWrapperClassName:Y="",labelClassName:L="",helperClassName:E="",popoverClassName:O=""}){let A=tt(),U=rt(),{isRequired:G=!1,isInvalid:K=!1,isLoading:q=!1,showSpinner:X=!1,isClearable:fe=!0,isFullWidth:ae=!0,closeOnSelect:_=!1}=z??{},Z=(0,zs.useId)(),he=N||Z,xe=`${he}-error-helper`,$=`${he}-popover`,re=dn(a,s),ee=n||re,de=i||ee,ne=t!==void 0,[ze,ve]=(0,zs.useState)(()=>Dr(r)),Ce=ne?Dr(t):ze,J=Ce?br(Ce,de):"",[j,oe]=(0,zs.useState)(!1),{refs:{setReference:ye,setFloating:ue},floatingStyles:ce,context:ke}=(0,Yt.useFloating)({placement:F,open:j&&!P&&!I&&!q,onOpenChange:oe,whileElementsMounted:Yt.autoUpdate,transform:!1,middleware:[(0,Yt.offset)(6),(0,Yt.flip)(),(0,Yt.shift)({padding:8})]}),Te=(0,Yt.useDismiss)(ke,{escapeKey:!0,outsidePress:!0}),pe=(0,Yt.useRole)(ke,{role:"dialog"}),{getReferenceProps:W,getFloatingProps:me}=(0,Yt.useInteractions)([Te,pe]),{isMounted:De,styles:ie}=ct(ke),H=!!(K||T),se=H?"error":k,Ie=C(x,Vn,"md"),je=C(v,pc,"lg"),le=S==="other"?"":C(se,C(S,gc,"outline"),"primary"),ge=!!Ce,Ee=$e=>{ne||ve($e);let Ht=$e?br($e,ee):"";o?.(Ht),_&&oe(!1)},He=$e=>{P||I||q||($e.key==="ArrowDown"||$e.key==="Enter"||$e.key===" "?($e.preventDefault(),j||oe(!0)):$e.key==="Escape"&&j&&($e.preventDefault(),oe(!1)))},Oe=$e=>{$e.stopPropagation(),ne||ve(null),o?.(null),M?.()},Ve=y||de,Ke=d==="floating",Ct=d==="left",Ne=()=>(0,Ut.jsx)(Pt,{htmlFor:he,label:p,isRequired:G,isFloating:Ke,size:x,color:se,hasError:H,cursor:"pointer",className:L}),Je=$e=>(0,Ut.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${Ie.icon}`,"aria-hidden":"true",children:$e}),bt=["group/field group/timepicker relative flex",Ct?"flex-row items-center gap-3":"flex-col",Ke&&!!p?"pt-2":"",ae?"w-full":"inline-flex",V].filter(Boolean).join(" "),dt=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",Ie.inputHeight,je,le,P?"opacity-50":"",ae?"w-full":"w-auto",Y].filter(Boolean).join(" "),Bt=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",Ie.inputText,Ie.inputPadding,B].filter(Boolean).join(" ");return(0,Ut.jsxs)("div",{className:bt,children:[!Ke&&Ne(),(0,Ut.jsxs)("div",{className:`flex flex-col ${ae?"w-full":""}`,children:[(0,Ut.jsxs)("div",{ref:ye,...W(),className:dt,children:[Ke&&Ne(),(0,Ut.jsx)("input",{ref:e,id:he,name:R,type:"text",value:J,onClick:()=>!P&&!I&&!q&&oe($e=>!$e),onKeyDown:He,readOnly:!0,autoComplete:D,placeholder:Ve,disabled:P||q,role:"combobox","aria-expanded":j&&!q,"aria-haspopup":"dialog","aria-controls":$,"aria-required":G,"aria-invalid":H,"aria-busy":q,"aria-disabled":P||q,"aria-describedby":c||T?xe:void 0,"aria-errormessage":T?xe:void 0,className:Bt}),(0,Ut.jsxs)("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[q&&X&&(0,Ut.jsx)("div",{className:"flex items-center justify-center shrink-0",children:Je((0,Ut.jsx)(Re,{}))}),!q&&fe&&!P&&!I&&(0,Ut.jsx)("button",{type:"button",onClick:Oe,"aria-label":"X\xF3a th\u1EDDi gian",tabIndex:ge?0:-1,"aria-hidden":!ge,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${Ie.icon} ${ge?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,Ut.jsx)(Ue,{className:"size-full"})}),(0,Ut.jsx)("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${j?"rotate-180":"rotate-0"}`,children:Je((0,Ut.jsx)(zt,{className:"size-full"}))})]})]}),De&&(0,Ut.jsx)(Yt.FloatingPortal,{root:A?.dialogRef??U?.dialogRef,children:(0,Ut.jsx)(Yt.FloatingFocusManager,{context:ke,modal:!1,returnFocus:!0,children:(0,Ut.jsx)("div",{ref:ue,id:$,style:{...ce,...ie,zIndex:pt.PICKER},...me(),className:O,children:(0,Ut.jsx)(Or,{value:Ce,onChange:Ee,ariaLabel:typeof p=="string"?`${p} selector`:"Time selector",use12Hours:a,showSeconds:s,hourStep:l,minuteStep:f,secondStep:u,minTime:w,maxTime:g,disabledHours:m,disabledMinutes:h,disabledSeconds:b,size:x,color:k,radius:v})})})}),(0,Ut.jsx)(Ae,{id:xe,helperText:c,errorMessage:T,sizeClassName:Ie.helper,className:E})]})]})}var Ni=require("react"),Wt=require("@floating-ui/react");var df=Vn,ff=pc,pf=mc,mf=gc;var yt=require("react/jsx-runtime");function hc({ref:e,value:t,defaultValue:r,onChange:o,format:n,displayFormat:i,separator:a=" - ",startLabel:s="Th\u1EDDi gian b\u1EAFt \u0111\u1EA7u",endLabel:l="Th\u1EDDi gian k\u1EBFt th\xFAc",use12Hours:f=!1,showSeconds:u=!0,hourStep:w=1,minuteStep:g=1,secondStep:m=1,minTime:h,maxTime:b,disabledHours:x,disabledMinutes:S,disabledSeconds:k,size:v="md",variant:p="outline",color:d="primary",radius:y,label:c,labelPlacement:T="floating",placeholder:R,placeholders:N,helperText:D,errorMessage:M,name:F,id:P,autoComplete:I,disabled:z=!1,readOnly:B=!1,config:V,onClear:Y,placement:L="bottom-start",className:E="",wrapperClassName:O="",inputWrapperClassName:A="",labelClassName:U="",helperClassName:G="",popoverClassName:K=""}){let q=tt(),X=rt(),{isRequired:fe=!1,isInvalid:ae=!1,isLoading:_=!1,showSpinner:Z=!1,isClearable:he=!0,isFullWidth:xe=!0,closeOnSelect:$=!1}=V??{},re=(0,Ni.useId)(),ee=P||re,de=`${ee}-error-helper`,ne=`${ee}-popover`,ze=dn(f,u),ve=n||ze,Ce=i||ve,J=t!==void 0,[j,oe]=(0,Ni.useState)(()=>{let we=r;return we&&Array.isArray(we)?[Dr(we[0]),Dr(we[1])]:[null,null]}),ye=J&&t&&Array.isArray(t)?[Dr(t[0]),Dr(t[1])]:j,ue=ye[0]?br(ye[0],Ce):"",ce=ye[1]?br(ye[1],Ce):"",ke=(0,Ni.useMemo)(()=>ue&&ce?`${ue}${a}${ce}`:ue?`${ue}${a}`:"",[ue,ce,a]),[Te,pe]=(0,Ni.useState)(!1),{refs:{setReference:W,setFloating:me},floatingStyles:De,context:ie}=(0,Wt.useFloating)({placement:L,open:Te&&!z&&!B&&!_,onOpenChange:pe,whileElementsMounted:Wt.autoUpdate,transform:!1,middleware:[(0,Wt.offset)(6),(0,Wt.flip)(),(0,Wt.shift)({padding:8})]}),H=(0,Wt.useDismiss)(ie,{escapeKey:!0,outsidePress:!0}),se=(0,Wt.useRole)(ie,{role:"dialog"}),{getReferenceProps:Ie,getFloatingProps:je}=(0,Wt.useInteractions)([H,se]),{isMounted:le,styles:ge}=ct(ie),Ee=!!(ae||M),He=Ee?"error":d,Oe=C(v,df,"md"),Ve=C(y,ff,"lg"),Ke=C(y,pf,"lg"),Ct=p==="other"?"":C(He,C(p,mf,"outline"),"primary"),Ne=!!(ye[0]||ye[1]),Je=we=>{let Xe=[we,ye[1]];J||oe(Xe);let Vt=br(we,ve),qe=ye[1]?br(ye[1],ve):"";o?.([Vt,qe])},ot=we=>{let Xe=[ye[0],we];J||oe(Xe);let Vt=ye[0]?br(ye[0],ve):"",qe=br(we,ve);o?.([Vt,qe]),$&&pe(!1)},bt=we=>{z||B||_||(we.key==="ArrowDown"||we.key==="Enter"||we.key===" "?(we.preventDefault(),Te||pe(!0)):we.key==="Escape"&&Te&&(we.preventDefault(),pe(!1)))},dt=we=>{we.stopPropagation(),J||oe([null,null]),o?.(null),Y?.()},Bt=R||(N?`${N[0]}${a}${N[1]}`:`${Ce}${a}${Ce}`),$e=T==="floating",Ht=T==="left",Rt=()=>(0,yt.jsx)(Pt,{htmlFor:ee,label:c,isRequired:fe,isFloating:$e,size:v,color:He,hasError:Ee,cursor:"pointer",className:U}),Nt=we=>(0,yt.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${Oe.icon}`,"aria-hidden":"true",children:we}),tr=["group/field group/timerangepicker relative flex",Ht?"flex-row items-center gap-3":"flex-col",$e&&!!c?"pt-2":"",xe?"w-full":"inline-flex",O].filter(Boolean).join(" "),We=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",Oe.inputHeight,Ve,Ct,z?"opacity-50":"",xe?"w-full":"w-auto",A].filter(Boolean).join(" "),St=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",Oe.inputText,Oe.inputPadding,E].filter(Boolean).join(" ");return(0,yt.jsxs)("div",{className:tr,children:[!$e&&Rt(),(0,yt.jsxs)("div",{className:`flex flex-col ${xe?"w-full":""}`,children:[(0,yt.jsxs)("div",{ref:W,...Ie(),className:We,children:[$e&&Rt(),(0,yt.jsx)("input",{ref:e,id:ee,name:F,type:"text",value:ke,onClick:()=>!z&&!B&&!_&&pe(we=>!we),onKeyDown:bt,readOnly:!0,autoComplete:I,placeholder:Bt,disabled:z||_,role:"combobox","aria-expanded":Te&&!_,"aria-haspopup":"dialog","aria-controls":ne,"aria-required":fe,"aria-invalid":Ee,"aria-busy":_,"aria-disabled":z||_,"aria-describedby":D||M?de:void 0,"aria-errormessage":M?de:void 0,className:St}),(0,yt.jsxs)("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[_&&Z&&(0,yt.jsx)("div",{className:"flex items-center justify-center shrink-0",children:Nt((0,yt.jsx)(Re,{}))}),!_&&he&&!z&&!B&&(0,yt.jsx)("button",{type:"button",onClick:dt,"aria-label":"X\xF3a kho\u1EA3ng th\u1EDDi gian",tabIndex:Ne?0:-1,"aria-hidden":!Ne,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${Oe.icon} ${Ne?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,yt.jsx)(Ue,{className:"size-full"})}),(0,yt.jsx)("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${Te?"rotate-180":"rotate-0"}`,children:Nt((0,yt.jsx)(zt,{className:"size-full"}))})]})]}),le&&(0,yt.jsx)(Wt.FloatingPortal,{root:q?.dialogRef??X?.dialogRef,children:(0,yt.jsx)(Wt.FloatingFocusManager,{context:ie,modal:!1,returnFocus:!0,children:(0,yt.jsxs)("div",{ref:me,id:ne,style:{...De,...ge,zIndex:pt.PICKER},...je(),className:`flex flex-row bg-neutral-white border-2 border-neutral-200 shadow-xl divide-x divide-neutral-200 overflow-hidden select-none ${Ke} ${K}`,children:[(0,yt.jsxs)("div",{className:"flex flex-col",children:[(0,yt.jsx)("div",{className:"px-3 py-1.5 bg-neutral-50 text-xs font-semibold text-neutral-600 border-b border-neutral-200 text-center",children:s}),(0,yt.jsx)(Or,{value:ye[0],onChange:Je,ariaLabel:s,use12Hours:f,showSeconds:u,hourStep:w,minuteStep:g,secondStep:m,minTime:h,maxTime:ye[1]||b,disabledHours:x,disabledMinutes:S,disabledSeconds:k,size:v,color:d,radius:y,className:"border-none shadow-none"})]}),(0,yt.jsxs)("div",{className:"flex flex-col",children:[(0,yt.jsx)("div",{className:"px-3 py-1.5 bg-neutral-50 text-xs font-semibold text-neutral-600 border-b border-neutral-200 text-center",children:l}),(0,yt.jsx)(Or,{value:ye[1],onChange:ot,ariaLabel:l,use12Hours:f,showSeconds:u,hourStep:w,minuteStep:g,secondStep:m,minTime:ye[0]||h,maxTime:b,disabledHours:x,disabledMinutes:S,disabledSeconds:k,size:v,color:d,radius:y,className:"border-none shadow-none"})]})]})})}),(0,yt.jsx)(Ae,{id:de,helperText:D,errorMessage:M,sizeClassName:Oe.helper,className:G})]})]})}function ld(e,t,r){if(!e||!t||!r)return!1;let o=e.getHours()*3600+e.getMinutes()*60+e.getSeconds(),n=t.getHours()*3600+t.getMinutes()*60+t.getSeconds(),i=r.getHours()*3600+r.getMinutes()*60+r.getSeconds();return o>=n&&o<=i}var Pa=require("react"),Kt=require("@floating-ui/react");function pn(e=!1,t=!0){return e?t?"DD/MM/YYYY hh:mm:ss A":"DD/MM/YYYY hh:mm A":t?"DD/MM/YYYY HH:mm:ss":"DD/MM/YYYY HH:mm"}function Gr(e,t){if(!e&&!t)return null;let r=e?new Date(e):new Date;return t&&(r.setHours(t.getHours()),r.setMinutes(t.getMinutes()),r.setSeconds(t.getSeconds()),r.setMilliseconds(t.getMilliseconds())),r}function jr(e,t="DD/MM/YYYY HH:mm:ss"){if(!e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:new Date(e.getTime());if(typeof e=="string"||typeof e=="number"){if(typeof e=="string"){let n=Da(e,t);if(n)return n}let o=new Date(e);return isNaN(o.getTime())?null:o}let r=e;return typeof r.toDate=="function"?r.toDate():typeof r.epochMilliseconds=="number"?new Date(r.epochMilliseconds):null}function Pr(e,t="DD/MM/YYYY HH:mm:ss",r){return!e||isNaN(e.getTime())?"":Rr(e,t,r)}function Da(e,t="DD/MM/YYYY HH:mm:ss"){if(!e||typeof e!="string")return null;let r=e.trim();if(!r)return null;let o=new Date().getFullYear(),n=1,i=1,a=0,s=0,l=0,f=!1,u=!1,w=t.match(/YYYY|YY|MM|M|DD|D|HH|H|hh|h|mm|m|ss|s|A|a/g);if(!w){let b=new Date(r);return isNaN(b.getTime())?null:b}let g="^"+t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");for(let b of w)b==="YYYY"?g=g.replace("YYYY","(\\d{4})"):b==="YY"?g=g.replace("YY","(\\d{2})"):b==="MM"||b==="M"||b==="DD"||b==="D"||b==="HH"||b==="H"||b==="hh"||b==="h"||b==="mm"||b==="m"||b==="ss"||b==="s"?g=g.replace(b,"(\\d{1,2})"):(b==="A"||b==="a")&&(g=g.replace(b,"(AM|PM|am|pm)"));g+="$";let m=new RegExp(g,"i").exec(r);if(!m){let b=new Date(r);return isNaN(b.getTime())?null:b}w.forEach((b,x)=>{let S=m[x+1];if(!S)return;if(b==="A"||b==="a"){f=!0,S.toUpperCase()==="PM"&&(u=!0);return}let k=parseInt(S,10);isNaN(k)||(b==="YYYY"?o=k:b==="YY"?o=2e3+k:b==="MM"||b==="M"?n=k:b==="DD"||b==="D"?i=k:b==="HH"||b==="H"?a=k:b==="hh"||b==="h"?(f=!0,a=k):b==="mm"||b==="m"?s=k:(b==="ss"||b==="s")&&(l=k))}),f&&(u?a<12&&(a+=12):a===12&&(a=0));let h=new Date(o,n-1,i,a,s,l);return isNaN(h.getTime())?null:h}var gf={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},bf={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},hf={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",icon:"size-3",iconSize:12,calendarPadding:"p-2",cellSize:"w-7 h-7",cellText:"text-[11px]",headerText:"text-xs font-semibold",headerButtonSize:"h-6 w-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",icon:"size-3.5",iconSize:14,calendarPadding:"p-2.5",cellSize:"w-8 h-8",cellText:"text-xs",headerText:"text-xs font-semibold",headerButtonSize:"h-7 w-7",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",icon:"size-[18px]",iconSize:16,calendarPadding:"p-3",cellSize:"w-9 h-9",cellText:"text-sm",headerText:"text-sm font-semibold",headerButtonSize:"h-8 w-8",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",icon:"size-5",iconSize:18,calendarPadding:"p-4",cellSize:"w-10 h-10",cellText:"text-base",headerText:"text-base font-semibold",headerButtonSize:"h-9 w-9",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",icon:"size-6",iconSize:20,calendarPadding:"p-4",cellSize:"w-12 h-12",cellText:"text-lg",headerText:"text-lg font-semibold",headerButtonSize:"h-10 w-10",label:"text-lg mb-2",floatingLabel:"text-sm",helper:"text-sm mt-1.5"}};var xf={outline:{primary:"bg-neutral-white border-2 border-neutral-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-2 border-neutral-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-2 border-error-500 hover:border-error-600 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-2 border-neutral-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-2 border-neutral-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-2 border-neutral-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-2 border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-2 border-transparent hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-2 border-transparent hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-error-50/60 border-2 border-transparent hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-2 border-transparent hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-2 border-transparent hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-2 border-transparent hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-50/60 border-2 border-transparent hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},ghost:{primary:"bg-transparent border-2 border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-2 border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-transparent border-2 border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-2 border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-2 border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-2 border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-transparent border-2 border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20"}};var It=require("react/jsx-runtime");function xc({ref:e,value:t,defaultValue:r,onChange:o,format:n,displayFormat:i,layout:a="side-by-side",locale:s="vi",defaultView:l="days",firstDayOfWeek:f=1,minDate:u,maxDate:w,isDateDisabled:g,viewTabs:m,use12Hours:h=!1,showSeconds:b=!0,hourStep:x=1,minuteStep:S=1,secondStep:k=1,minTime:v,maxTime:p,disabledHours:d,disabledMinutes:y,disabledSeconds:c,size:T="md",variant:R="outline",color:N="primary",radius:D,label:M,labelPlacement:F="floating",placeholder:P,helperText:I,errorMessage:z,name:B,id:V,autoComplete:Y,disabled:L=!1,readOnly:E=!1,config:O,onClear:A,placement:U="bottom-start",className:G="",wrapperClassName:K="",inputWrapperClassName:q="",labelClassName:X="",helperClassName:fe="",popoverClassName:ae=""}){let _=tt(),Z=rt(),{isRequired:he=!1,isInvalid:xe=!1,isLoading:$=!1,showSpinner:re=!1,isClearable:ee=!0,isFullWidth:de=!0,closeOnSelect:ne=!1,showWeekNumbers:ze=!1,showViewTabs:ve=!1}=O??{},Ce=(0,Pa.useId)(),J=V||Ce,j=`${J}-error-helper`,oe=`${J}-popover`,ye=pn(h,b),ue=n||ye,ce=i||ue,ke=t!==void 0,[Te,pe]=(0,Pa.useState)(()=>jr(r,ue)),W=ke?jr(t,ue):Te,me=W?Pr(W,ce,s):"",[De,ie]=(0,Pa.useState)(l),[H,se]=(0,Pa.useState)(!1),{refs:{setReference:Ie,setFloating:je},floatingStyles:le,context:ge}=(0,Kt.useFloating)({placement:U,open:H&&!L&&!E&&!$,onOpenChange:se,whileElementsMounted:Kt.autoUpdate,transform:!1,middleware:[(0,Kt.offset)(6),(0,Kt.flip)(),(0,Kt.shift)({padding:8})]}),Ee=(0,Kt.useDismiss)(ge,{escapeKey:!0,outsidePress:!0}),He=(0,Kt.useRole)(ge,{role:"dialog"}),{getReferenceProps:Oe,getFloatingProps:Ve}=(0,Kt.useInteractions)([Ee,He]),{isMounted:Ke,styles:Ct}=ct(ge),Ne=!!(xe||z),Je=Ne?"error":N,ot=C(T,hf,"md"),bt=C(D,gf,"lg"),dt=C(D,bf,"lg"),Bt=R==="other"?"":C(Je,C(R,xf,"outline"),"primary"),$e=!!W,Ht=Me=>{let be=Gr(Me,W||new Date);ke||pe(be);let Se=be?Pr(be,ue,s):"";o?.(Se),ne&&se(!1)},Rt=Me=>{if(!Me)return;let be=Gr(W||new Date,Me);ke||pe(be);let Se=be?Pr(be,ue,s):"";o?.(Se),ne&&se(!1)},Nt=Me=>{L||E||$||(Me.key==="ArrowDown"||Me.key==="Enter"||Me.key===" "?(Me.preventDefault(),H||se(!0)):Me.key==="Escape"&&H&&(Me.preventDefault(),se(!1)))},st=Me=>{Me.stopPropagation(),ke||pe(null),o?.(null),A?.()},tr=P||ce,We=F==="floating",St=F==="left",we=()=>(0,It.jsx)(Pt,{htmlFor:J,label:M,isRequired:he,isFloating:We,size:T,color:Je,hasError:Ne,cursor:"pointer",className:X}),Xe=Me=>(0,It.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${ot.icon}`,"aria-hidden":"true",children:Me}),qe=["group/field group/datetimepicker relative flex",St?"flex-row items-center gap-3":"flex-col",We&&!!M?"pt-2":"",de?"w-full":"inline-flex",K].filter(Boolean).join(" "),rr=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",ot.inputHeight,bt,Bt,L?"opacity-50":"",de?"w-full":"w-auto",q].filter(Boolean).join(" "),ir=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",ot.inputText,ot.inputPadding,G].filter(Boolean).join(" ");return(0,It.jsxs)("div",{className:qe,children:[!We&&we(),(0,It.jsxs)("div",{className:`flex flex-col ${de?"w-full":""}`,children:[(0,It.jsxs)("div",{ref:Ie,...Oe(),className:rr,children:[We&&we(),(0,It.jsx)("input",{ref:e,id:J,name:B,type:"text",value:me,onClick:()=>!L&&!E&&!$&&se(Me=>!Me),onKeyDown:Nt,readOnly:!0,autoComplete:Y,placeholder:tr,disabled:L||$,role:"combobox","aria-expanded":H&&!$,"aria-haspopup":"dialog","aria-controls":oe,"aria-required":he,"aria-invalid":Ne,"aria-busy":$,"aria-disabled":L||$,"aria-describedby":I||z?j:void 0,"aria-errormessage":z?j:void 0,className:ir}),(0,It.jsxs)("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[$&&re&&(0,It.jsx)("div",{className:"flex items-center justify-center shrink-0",children:Xe((0,It.jsx)(Re,{}))}),!$&&ee&&!L&&!E&&(0,It.jsx)("button",{type:"button",onClick:st,"aria-label":"X\xF3a ng\xE0y gi\u1EDD",tabIndex:$e?0:-1,"aria-hidden":!$e,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${ot.icon} ${$e?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,It.jsx)(Ue,{className:"size-full"})}),(0,It.jsx)("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${H?"rotate-180":"rotate-0"}`,children:Xe((0,It.jsx)(zt,{className:"size-full"}))})]})]}),Ke&&(0,It.jsx)(Kt.FloatingPortal,{root:_?.dialogRef??Z?.dialogRef,children:(0,It.jsx)(Kt.FloatingFocusManager,{context:ge,modal:!1,returnFocus:!0,children:(0,It.jsxs)("div",{ref:je,id:oe,style:{...le,...Ct,zIndex:pt.PICKER},...Ve(),className:`flex bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden select-none ${dt} ${a==="stacked"?"flex-col divide-y-2 divide-neutral-200":"flex-row divide-x-2 divide-neutral-200"} ${ae}`,children:[(0,It.jsx)("div",{className:"flex flex-col",children:(0,It.jsx)(fo,{value:W,onChange:Ht,view:De,onViewChange:ie,minDate:u,maxDate:w,isDateDisabled:g,locale:s,firstDayOfWeek:f,showWeekNumbers:ze,size:T,color:N,radius:D,showViewTabs:ve,viewTabs:m,className:"border-none shadow-none rounded-none"})}),(0,It.jsx)("div",{className:"flex flex-col justify-center items-center p-1 bg-neutral-50/50",children:(0,It.jsx)(Or,{value:W,onChange:Rt,ariaLabel:typeof M=="string"?`${M} time`:"Time selector",use12Hours:h,showSeconds:b,hourStep:x,minuteStep:S,secondStep:k,minTime:v,maxTime:p,disabledHours:d,disabledMinutes:y,disabledSeconds:c,size:T,color:N,radius:D,className:"border-none shadow-none bg-transparent"})})]})})}),(0,It.jsx)(Ae,{id:j,helperText:I,errorMessage:z,sizeClassName:ot.helper,className:fe})]})]})}var mn=require("react"),_t=require("@floating-ui/react");var vf={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",minWidth:"min-w-72",icon:"size-3",iconSize:12,calendarPadding:"p-2",cellSize:"w-7 h-7",cellText:"text-[11px]",headerText:"text-xs font-semibold",headerButtonSize:"h-6 w-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",minWidth:"min-w-80",icon:"size-3.5",iconSize:14,calendarPadding:"p-2.5",cellSize:"w-8 h-8",cellText:"text-xs",headerText:"text-xs font-semibold",headerButtonSize:"h-7 w-7",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",minWidth:"min-w-96",icon:"size-[18px]",iconSize:16,calendarPadding:"p-3",cellSize:"w-9 h-9",cellText:"text-sm",headerText:"text-sm font-semibold",headerButtonSize:"h-8 w-8",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",minWidth:"min-w-105",icon:"size-5",iconSize:18,calendarPadding:"p-4",cellSize:"w-10 h-10",cellText:"text-base",headerText:"text-base font-semibold",headerButtonSize:"h-9 w-9",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",minWidth:"min-w-120",icon:"size-6",iconSize:20,calendarPadding:"p-4",cellSize:"w-12 h-12",cellText:"text-lg",headerText:"text-lg font-semibold",headerButtonSize:"h-10 w-10",label:"text-lg mb-2",floatingLabel:"text-sm",helper:"text-sm mt-1.5"}};var yf={primary:{activeStep:"bg-primary-500 border-primary-500 text-neutral-white shadow-xs",applyButton:"bg-primary-500 hover:bg-primary-600 active:bg-primary-700 text-neutral-white shadow-xs"},secondary:{activeStep:"bg-secondary-500 border-secondary-500 text-neutral-white shadow-xs",applyButton:"bg-secondary-500 hover:bg-secondary-600 active:bg-secondary-700 text-neutral-white shadow-xs"},error:{activeStep:"bg-error-500 border-error-500 text-neutral-white shadow-xs",applyButton:"bg-error-500 hover:bg-error-600 active:bg-error-700 text-neutral-white shadow-xs"},success:{activeStep:"bg-success-500 border-success-500 text-neutral-white shadow-xs",applyButton:"bg-success-500 hover:bg-success-600 active:bg-success-700 text-neutral-white shadow-xs"},warning:{activeStep:"bg-warning-500 border-warning-500 text-neutral-950 shadow-xs",applyButton:"bg-warning-500 hover:bg-warning-600 active:bg-warning-700 text-neutral-950 shadow-xs"},info:{activeStep:"bg-info-500 border-info-500 text-neutral-white shadow-xs",applyButton:"bg-info-500 hover:bg-info-600 active:bg-info-700 text-neutral-white shadow-xs"},neutral:{activeStep:"bg-neutral-800 border-neutral-800 text-neutral-white shadow-xs",applyButton:"bg-neutral-800 hover:bg-neutral-900 active:bg-neutral-950 text-neutral-white shadow-xs"}};var at=require("react/jsx-runtime");function vc({ref:e,value:t,defaultValue:r,onChange:o,format:n,displayFormat:i,separator:a=" - ",startLabel:s="Th\u1EDDi gian b\u1EAFt \u0111\u1EA7u",endLabel:l="Th\u1EDDi gian k\u1EBFt th\xFAc",layout:f="side-by-side",locale:u="vi",defaultView:w="days",firstDayOfWeek:g=1,minDate:m,maxDate:h,isDateDisabled:b,viewTabs:x,use12Hours:S=!1,showSeconds:k=!0,hourStep:v=1,minuteStep:p=1,secondStep:d=1,minTime:y,maxTime:c,disabledHours:T,disabledMinutes:R,disabledSeconds:N,size:D="md",variant:M="outline",color:F="primary",radius:P,label:I,labelPlacement:z="floating",placeholder:B,placeholders:V,helperText:Y,errorMessage:L,name:E,id:O,autoComplete:A,disabled:U=!1,readOnly:G=!1,config:K,onClear:q,placement:X="bottom-start",className:fe="",wrapperClassName:ae="",inputWrapperClassName:_="",labelClassName:Z="",helperClassName:he="",popoverClassName:xe=""}){let $=tt(),re=rt(),{isRequired:ee=!1,isInvalid:de=!1,isLoading:ne=!1,showSpinner:ze=!1,isClearable:ve=!0,isFullWidth:Ce=!0,closeOnSelect:J=!1,showWeekNumbers:j=!1,showViewTabs:oe=!1}=K??{},ye=(0,mn.useId)(),ue=O||ye,ce=`${ue}-error-helper`,ke=`${ue}-popover`,Te=pn(S,k),pe=n||Te,W=i||pe,me=t!==void 0,[De,ie]=(0,mn.useState)(()=>{let Pe=r;return Pe&&Array.isArray(Pe)?[jr(Pe[0],pe),jr(Pe[1],pe)]:[null,null]}),H=me?t&&Array.isArray(t)?[jr(t[0],pe),jr(t[1],pe)]:[null,null]:De,[se,Ie]=(0,mn.useState)("start"),[je,le]=(0,mn.useState)(w),[ge,Ee]=(0,mn.useState)(!1),He=H[0]?Pr(H[0],W,u):"",Oe=H[1]?Pr(H[1],W,u):"",Ve=(0,mn.useMemo)(()=>He&&Oe?`${He}${a}${Oe}`:He?`${He}${a}`:"",[He,Oe,a]),{refs:{setReference:Ke,setFloating:Ct},floatingStyles:Ne,context:Je}=(0,_t.useFloating)({placement:X,open:ge&&!U&&!G&&!ne,onOpenChange:Ee,whileElementsMounted:_t.autoUpdate,transform:!1,middleware:[(0,_t.offset)(6),(0,_t.flip)(),(0,_t.shift)({padding:8})]}),ot=(0,_t.useDismiss)(Je,{escapeKey:!0,outsidePress:!0}),bt=(0,_t.useRole)(Je,{role:"dialog"}),{getReferenceProps:dt,getFloatingProps:Bt}=(0,_t.useInteractions)([ot,bt]),{isMounted:$e,styles:Ht}=ct(Je),Rt=!!(de||L),Nt=Rt?"error":F,st=C(D,vf,"md"),tr=C(P,Po,"lg"),We=C(P,lc,"lg"),St=C(Nt,yf,"primary"),we=M==="other"?"":C(Nt,C(M,cc,"outline"),"primary"),Xe=!!(H[0]||H[1]),Vt=Pe=>{me||ie(Pe);let ft=Pe[0]?Pr(Pe[0],pe,u):"",Dt=Pe[1]?Pr(Pe[1],pe,u):"";o?.(ft||Dt?[ft,Dt]:null),J&&Pe[0]&&Pe[1]&&Ee(!1)},qe=Pe=>{if(se==="start"){let ft=Gr(Pe,H[0]||new Date),Dt=H[1];Dt&&ft&&ft.getTime()>Dt.getTime()&&(Dt=null),Vt([ft,Dt])}else{let ft=Gr(Pe,H[1]||H[0]||new Date);Vt([H[0],ft])}},rr=Pe=>{if(Pe)if(se==="start"){let ft=Gr(H[0]||new Date,Pe),Dt=H[1];Dt&&ft&&ft.getTime()>Dt.getTime()&&(Dt=null),Vt([ft,Dt])}else{let ft=Gr(H[1]||H[0]||new Date,Pe);Vt([H[0],ft])}},ir=Pe=>{U||G||ne||(Pe.key==="ArrowDown"||Pe.key==="Enter"||Pe.key===" "?(Pe.preventDefault(),ge||Ee(!0)):Pe.key==="Escape"&&ge&&(Pe.preventDefault(),Ee(!1)))},Me=Pe=>{Pe.stopPropagation(),me||ie([null,null]),o?.(null),q?.()},be=B||(V?`${V[0]}${a}${V[1]}`:`${W}${a}${W}`),Se=z==="floating",it=z==="left",lt=()=>(0,at.jsx)(Pt,{htmlFor:ue,label:I,isRequired:ee,isFloating:Se,size:D,color:Nt,hasError:Rt,cursor:"pointer",className:Z}),te=Pe=>(0,at.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${st.icon}`,"aria-hidden":"true",children:Pe}),_e=["group/field group/datetimerangepicker relative flex",it?"flex-row items-center gap-3":"flex-col",Se&&!!I?"pt-2":"",Ce?"w-full":"inline-flex",ae].filter(Boolean).join(" "),Le=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",st.inputHeight,tr,we,U?"opacity-50":"",Ce?"w-full":st.minWidth||"min-w-80",_].filter(Boolean).join(" "),Tt=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",st.inputText,st.inputPadding,fe].filter(Boolean).join(" "),At=se==="start"?H[0]:H[1];return(0,at.jsxs)("div",{className:_e,children:[!Se&<(),(0,at.jsxs)("div",{className:`flex flex-col ${Ce?"w-full":""}`,children:[(0,at.jsxs)("div",{ref:Ke,...dt(),className:Le,children:[Se&<(),(0,at.jsx)("input",{ref:e,id:ue,name:E,type:"text",value:Ve,onClick:()=>!U&&!G&&!ne&&Ee(Pe=>!Pe),onKeyDown:ir,readOnly:!0,autoComplete:A,placeholder:be,disabled:U||ne,role:"combobox","aria-expanded":ge&&!ne,"aria-haspopup":"dialog","aria-controls":ke,"aria-required":ee,"aria-invalid":Rt,"aria-busy":ne,"aria-disabled":U||ne,"aria-describedby":Y||L?ce:void 0,"aria-errormessage":L?ce:void 0,className:Tt}),(0,at.jsxs)("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[ne&&ze&&(0,at.jsx)("div",{className:"flex items-center justify-center shrink-0",children:te((0,at.jsx)(Re,{}))}),!ne&&ve&&!U&&!G&&(0,at.jsx)("button",{type:"button",onClick:Me,"aria-label":"X\xF3a kho\u1EA3ng ng\xE0y gi\u1EDD",tabIndex:Xe?0:-1,"aria-hidden":!Xe,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${st.icon} ${Xe?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,at.jsx)(Ue,{className:"size-full"})}),(0,at.jsx)("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${ge?"rotate-180":"rotate-0"}`,children:te((0,at.jsx)(zt,{className:"size-full"}))})]})]}),$e&&(0,at.jsx)(_t.FloatingPortal,{root:$?.dialogRef??re?.dialogRef,children:(0,at.jsx)(_t.FloatingFocusManager,{context:Je,modal:!1,returnFocus:!0,children:(0,at.jsxs)("div",{ref:Ct,id:ke,style:{...Ne,...Ht,zIndex:pt.PICKER},...Bt(),className:`flex flex-col bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden select-none ${We} ${xe}`,children:[(0,at.jsxs)("div",{className:`flex ${f==="stacked"?"flex-col divide-y-2 divide-neutral-200":"flex-row divide-x-2 divide-neutral-200"}`,children:[(0,at.jsx)("div",{className:"flex flex-col",children:(0,at.jsx)(fo,{value:At,onChange:qe,view:je,onViewChange:le,minDate:se==="end"&&H[0]||m,maxDate:se==="start"&&H[1]||h,isDateDisabled:b,locale:u,firstDayOfWeek:g,showWeekNumbers:j,size:D,color:F,radius:P,showViewTabs:oe,viewTabs:x,className:"border-none shadow-none rounded-none"},`calendar-step-${se}`)}),(0,at.jsx)("div",{className:"flex flex-col justify-center items-center p-1 bg-neutral-50/50",children:(0,at.jsx)(Or,{value:At||H[0],onChange:rr,ariaLabel:se==="start"?`${s} time`:`${l} time`,use12Hours:S,showSeconds:k,hourStep:v,minuteStep:p,secondStep:d,minTime:se==="end"&&H[0]||y,maxTime:se==="start"&&H[1]||c,disabledHours:T,disabledMinutes:R,disabledSeconds:N,size:D,color:F,radius:P,className:"border-none shadow-none bg-transparent"},`timeview-step-${se}`)})]}),(0,at.jsxs)("div",{className:"flex items-center justify-between border-t border-neutral-200 bg-neutral-50 px-3 py-2",children:[(0,at.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,at.jsxs)("button",{type:"button",onClick:()=>Ie("start"),className:`px-3 py-1.5 text-xs font-semibold rounded-md border transition-all cursor-pointer ${se==="start"?St.activeStep:"bg-neutral-white border-neutral-300 hover:bg-neutral-100 text-neutral-700"}`,children:["\u2190 ",s]}),(0,at.jsxs)("button",{type:"button",onClick:()=>Ie("end"),className:`px-3 py-1.5 text-xs font-semibold rounded-md border transition-all cursor-pointer ${se==="end"?St.activeStep:"bg-neutral-white border-neutral-300 hover:bg-neutral-100 text-neutral-700"}`,children:[l," \u2192"]})]}),(0,at.jsx)("button",{type:"button",onClick:()=>Ee(!1),className:`px-3.5 py-1.5 text-xs font-semibold rounded-md transition-colors cursor-pointer ${St.applyButton}`,children:"\xC1p d\u1EE5ng"})]})]})})}),(0,at.jsx)(Ae,{id:ce,helperText:Y,errorMessage:L,sizeClassName:st.helper,className:he})]})]})}var Tf=require("react"),kf=Ko(require("next/image"),1);var wf={sm:{container:"p-3",imageWrapper:"w-16 h-16",defaultImageSize:64,title:"text-xs font-semibold text-neutral-800",description:"text-xs text-neutral-500",gap:"gap-2.5",contentGap:"gap-1",actionsGap:"mt-2"},md:{container:"p-6",imageWrapper:"w-28 h-28",defaultImageSize:112,title:"text-sm font-semibold text-neutral-800",description:"text-xs sm:text-sm text-neutral-500",gap:"gap-4",contentGap:"gap-1.5",actionsGap:"mt-3.5"},lg:{container:"p-10",imageWrapper:"w-40 h-40",defaultImageSize:160,title:"text-base font-semibold text-neutral-900",description:"text-sm text-neutral-500",gap:"gap-6",contentGap:"gap-2",actionsGap:"mt-5"}},Cf={vertical:{container:"flex flex-col items-center justify-center text-center",content:"flex flex-col items-center justify-center text-center"},horizontal:{container:"flex flex-row items-center justify-start text-left",content:"flex flex-col items-start justify-center text-left flex-1"}};var za=require("react/jsx-runtime");function Di({preset:e="default",...t}){switch(e){case"search":return(0,za.jsx)(kl,{...t});case"error":return(0,za.jsx)(Rl,{...t});case"folder":return(0,za.jsx)(Nl,{...t});case"simple":return(0,za.jsx)(Dl,{...t});default:return(0,za.jsx)(Tl,{...t})}}var Sf=["default","search","error","folder","simple"];function cd(e){return typeof e=="string"&&Sf.includes(e)}function ud(e){return typeof e!="string"?!1:e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")||e.startsWith("./")||e.startsWith("data:")||/\.(png|jpe?g|svg|webp|gif|avif)$/i.test(e)}function dd(e){if(!e)return{};let t=typeof e=="number"?`${e}px`:e;return{width:t,height:t}}var eo=require("react/jsx-runtime");function Gn({size:e="md",layout:t="vertical",image:r="default",imageSize:o,imageClassName:n="",imageAlt:i="Tr\u1ED1ng",title:a,titleClassName:s="",description:l="Kh\xF4ng c\xF3 d\u1EEF li\u1EC7u",descriptionClassName:f="",actions:u,actionsClassName:w="",children:g,className:m="",role:h="status",ref:b,...x}){let S=C(e,wf,"md"),k=C(t,Cf,"vertical"),v=dd(o),p=()=>{if(!r)return null;if(cd(r))return(0,eo.jsx)(Di,{preset:r});if(ud(r)){let D=typeof o=="number"?o:S.defaultImageSize;return(0,eo.jsx)(kf.default,{src:r,alt:i,width:D,height:D,className:"size-full object-contain pointer-events-none select-none",unoptimized:r.startsWith("data:")||r.endsWith(".svg")})}return(0,Tf.isValidElement)(r)?r:(0,eo.jsx)(Di,{preset:"default"})},d=["flex items-center justify-center shrink-0",o?"":S.imageWrapper,n].filter(Boolean).join(" "),y=["w-full transition-all",k.container,S.container,S.gap,m].filter(Boolean).join(" "),c=[k.content,S.contentGap].filter(Boolean).join(" "),T=[S.title,s].filter(Boolean).join(" "),R=[S.description,f].filter(Boolean).join(" "),N=["flex flex-wrap items-center gap-2",S.actionsGap,t==="vertical"?"justify-center":"justify-start",w].filter(Boolean).join(" ");return(0,eo.jsxs)("div",{ref:b,role:h,"aria-live":"polite",className:y,...x,children:[r&&(0,eo.jsx)("div",{className:d,style:v,"aria-hidden":"true",children:p()}),(a||l||u||g)&&(0,eo.jsxs)("div",{className:c,children:[a&&(0,eo.jsx)("div",{className:T,children:a}),l&&(0,eo.jsx)("div",{className:R,children:l}),u&&(0,eo.jsx)("div",{className:N,children:u}),g&&(0,eo.jsx)("div",{className:"mt-2 w-full",children:g})]})]})}var to=require("react");var Pf=require("react");var Io={xs:{trigger:"min-h-6 text-[11px] px-2 py-0.5",input:"text-[11px] leading-tight",text:"text-[11px]",icon:"size-3",option:"px-2 py-1 text-[11px] min-h-6",gap:"gap-1",badgeSize:"xs",defaultRadius:"sm",helper:"text-[9px] mt-0.5"},sm:{trigger:"min-h-8 text-xs px-2.5 py-1",input:"text-xs leading-normal",text:"text-xs",icon:"size-3.5",option:"px-2.5 py-1.5 text-xs min-h-7",gap:"gap-1",badgeSize:"xs",defaultRadius:"md",helper:"text-[10px] mt-0.5"},md:{trigger:"min-h-10 text-sm px-3.5 py-1.5",input:"text-sm leading-normal",text:"text-sm",icon:"size-[18px]",option:"px-3 py-2 text-sm min-h-9",gap:"gap-1.5",badgeSize:"sm",defaultRadius:"lg",helper:"text-[11px] mt-1"},lg:{trigger:"min-h-12 text-base px-4 py-2",input:"text-base leading-normal",text:"text-base",icon:"size-5",option:"px-3.5 py-2.5 text-base min-h-11",gap:"gap-2",badgeSize:"md",defaultRadius:"xl",helper:"text-xs mt-1"},xl:{trigger:"min-h-14 text-lg px-5 py-2.5",input:"text-lg leading-normal",text:"text-lg",icon:"size-6",option:"px-4 py-3 text-lg min-h-12",gap:"gap-2",badgeSize:"lg",defaultRadius:"xl",helper:"text-sm mt-1"}},Ia={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Is={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},Rf={none:"none",sm:"sm",md:"md",lg:"lg",xl:"xl",full:"full"},Ma={outline:{primary:"bg-neutral-white border-primary-400 hover:border-primary-500 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20 text-neutral-900",secondary:"bg-neutral-white border-secondary-400 hover:border-secondary-500 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20 text-neutral-900",error:"bg-neutral-white border-error-500 hover:border-error-600 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20 text-neutral-900",success:"bg-neutral-white border-success-400 hover:border-success-500 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20 text-neutral-900",warning:"bg-neutral-white border-warning-400 hover:border-warning-500 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20 text-neutral-900",info:"bg-neutral-white border-info-400 hover:border-info-500 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20 text-neutral-900",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20 text-neutral-900"},filled:{primary:"bg-primary-50/60 border border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20 text-neutral-900",secondary:"bg-secondary-50/60 border border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20 text-neutral-900",error:"bg-error-50/60 border border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20 text-neutral-900",success:"bg-success-50/60 border border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20 text-neutral-900",warning:"bg-warning-50/60 border border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20 text-neutral-900",info:"bg-info-50/60 border border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20 text-neutral-900",neutral:"bg-neutral-50/60 border border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20 text-neutral-900"},ghost:{primary:"bg-transparent border border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20 text-neutral-900",secondary:"bg-transparent border border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20 text-neutral-900",error:"bg-transparent border border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20 text-neutral-900",success:"bg-transparent border border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20 text-neutral-900",warning:"bg-transparent border border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20 text-neutral-900",info:"bg-transparent border border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20 text-neutral-900",neutral:"bg-transparent border border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20 text-neutral-900"}},Nf={primary:"bg-primary-50 text-primary-700 font-medium",secondary:"bg-secondary-50 text-secondary-700 font-medium",error:"bg-error-50 text-error-700 font-medium",success:"bg-success-50 text-success-700 font-medium",warning:"bg-warning-50 text-warning-700 font-medium",info:"bg-info-50 text-info-700 font-medium",neutral:"bg-neutral-100 text-neutral-900 font-medium"},Df={primary:"bg-primary-50/60",secondary:"bg-secondary-50/60",error:"bg-error-50/60",success:"bg-success-50/60",warning:"bg-warning-50/60",info:"bg-info-50/60",neutral:"bg-neutral-100"};var Mo=require("react/jsx-runtime");function im({id:e,isOpen:t,disabled:r=!1,isLoading:o=!1,showSpinner:n=!1,showClear:i=!1,onClear:a,startContent:s,endContent:l,triggerRef:f,getReferenceProps:u,onClick:w,roundedClass:g,currentSize:m,variantStyle:h,className:b="",children:x}){let S=r?"opacity-60 cursor-not-allowed bg-neutral-100 pointer-events-none":"cursor-pointer";return(0,Mo.jsxs)("div",{ref:f,role:"combobox","aria-expanded":t,"aria-haspopup":"listbox","aria-controls":e?`${e}-listbox`:void 0,tabIndex:r?-1:0,onClick:w,"aria-busy":o,"aria-disabled":r||o,...u({id:e,className:`group relative flex items-center justify-between transition-all duration-150 ease-in-out border-2 select-none ${g} ${m.trigger} ${m.gap} ${h} ${S} ${b}`,"aria-expanded":t,"aria-haspopup":"listbox"}),children:[s&&(0,Mo.jsx)("span",{className:"shrink-0 inline-flex items-center text-neutral-400",children:s}),x,(0,Mo.jsxs)("div",{className:"shrink-0 flex items-center gap-1.5 ml-1 text-neutral-400",children:[o&&n&&(0,Mo.jsx)(Re,{className:`${m.icon} animate-spin text-current`}),i&&!o&&(0,Mo.jsx)("button",{type:"button","aria-label":"Clear selection",onClick:k=>{k.stopPropagation(),a?.(k)},className:"hover:text-neutral-600 transition-colors p-0.5 rounded-full hover:bg-neutral-100",children:(0,Mo.jsx)(Ue,{className:"size-3.5"})}),l,(0,Mo.jsx)("span",{className:`transition-transform duration-200 ${t?"rotate-180":""}`,"aria-hidden":"true",children:(0,Mo.jsx)(zt,{className:m.icon})})]})]})}var yc=im;var jn=require("react/jsx-runtime");function am({id:e,selectedOption:t,isOpen:r,size:o="md",variant:n="outline",color:i="primary",radius:a="md",placeholder:s="Ch\u1ECDn...",disabled:l=!1,readOnly:f=!1,isInvalid:u=!1,searchable:w=!1,searchPlacement:g="trigger",searchValue:m="",onSearchChange:h,onClear:b,clearable:x=!1,isLoading:S=!1,showSpinner:k=!1,startContent:v,endContent:p,renderValue:d,triggerRef:y,getReferenceProps:c,onKeyDown:T,className:R=""}){let N=(0,Pf.useRef)(null),D=C(o,Io,"md"),M=C(a,Ia,"md"),P=!!u?"error":i,I=n==="other"?"":Ma[n]?.[P]||Ma.outline.primary,z=w&&(g==="trigger"||g==="both"),B=t!=null,V=x&&(B||m.length>0)&&!l&&!f;return(0,jn.jsx)(yc,{id:e,isOpen:r,disabled:l,isLoading:S,showSpinner:k,showClear:V,onClear:b,startContent:v,endContent:p,triggerRef:y,getReferenceProps:c,onClick:()=>{!l&&!f&&!S&&z&&N.current?.focus()},roundedClass:M,currentSize:D,variantStyle:I,className:R,children:d&&B&&t?(0,jn.jsx)("div",{className:"flex-1 min-w-0 truncate text-neutral-900",children:d(t)}):z&&!l&&!f&&!S?(0,jn.jsx)("div",{className:"relative flex-1 min-w-0 flex items-center",children:(0,jn.jsx)("input",{ref:N,type:"text","aria-label":"Search",value:m,placeholder:t?t.label:s,onChange:E=>h?.(E.target.value),onKeyDown:T,className:`w-full bg-transparent outline-none border-none p-0 text-neutral-900 ${!m&&t?"placeholder:text-neutral-900 placeholder:font-normal":"placeholder:text-neutral-400"} ${D.input}`})}):(0,jn.jsx)("div",{className:"flex-1 min-w-0 truncate",children:t?(0,jn.jsx)("span",{className:"text-neutral-900",children:t.label}):(0,jn.jsx)("span",{className:"text-neutral-400",children:s})})})}var Pi=am;var zf=require("@floating-ui/react");var go=require("react/jsx-runtime");function sm({option:e,isSelected:t,isActive:r,size:o="md",color:n="primary",radius:i="md",disabled:a=!1,renderOption:s,onClick:l,onMouseEnter:f,ref:u}){let w=C(o,Io,"md"),g=C(i,Ia,"md"),m=a||e.disabled;if(s)return(0,go.jsx)("div",{ref:u,role:"option",tabIndex:-1,"aria-selected":t,"aria-disabled":m,"data-active":r,"data-selected":t,"data-value":e.value,className:`cursor-pointer select-none transition-colors duration-100 ${m?"opacity-50 cursor-not-allowed pointer-events-none":""}`,onClick:m?void 0:l,onMouseEnter:m?void 0:f,children:s(e,{selected:t,active:r})});let h=t?C(n,Nf,"primary"):"text-neutral-800 hover:bg-neutral-100",b=r&&!t?C(n,Df,"primary"):"";return(0,go.jsxs)("div",{ref:u,role:"option",tabIndex:-1,"aria-selected":t,"aria-disabled":m,"data-active":r,"data-selected":t,"data-value":e.value,className:`group flex items-center justify-between gap-2 select-none cursor-pointer transition-colors duration-100 ${g} ${w.option} ${h} ${b} ${m?"opacity-40 cursor-not-allowed pointer-events-none":""}`,onClick:m?void 0:l,onMouseEnter:m?void 0:f,children:[(0,go.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.icon&&(0,go.jsx)("span",{className:"shrink-0 inline-flex items-center text-neutral-400",children:e.icon}),(0,go.jsxs)("div",{className:"flex flex-col min-w-0 flex-1",children:[(0,go.jsx)("span",{className:"truncate leading-normal font-normal",children:e.label}),e.description&&(0,go.jsx)("span",{className:"text-[11px] text-neutral-500 truncate font-normal",children:e.description})]})]}),t&&(0,go.jsx)("span",{className:"shrink-0 flex items-center justify-center text-current","aria-hidden":"true",children:(0,go.jsx)(Zo,{className:"size-3.5"})})]})}var Ms=sm;var Fo=require("react"),mt=require("@floating-ui/react");function Fs(e){let t=new Map;return e.forEach(r=>{t.set(r.value,r)}),t}function fd(e,t,r){return e==null?null:t.find(o=>o.value===e)||r?.get(e)||{value:e,label:String(e)}}function wc(e,t,r){return e.map(o=>t.find(n=>n.value===o)||r?.get(o)||{value:o,label:String(o)})}function pd(e,t){let r=t&&t>0?e.slice(0,t):e,o=t&&t>0?Math.max(0,e.length-t):0;return{visibleTags:r,hiddenTagCount:o}}function md(e,t){if(t==null||t==="")return"Ch\u01B0a nh\u1EADp";if(t instanceof Date)return t.toLocaleDateString("vi-VN");if(Array.isArray(t)){if(t.length===0)return"Ch\u01B0a ch\u1ECDn";if(e.type==="date-range"||t[0]instanceof Date||t[1]instanceof Date){let n=s=>s?s instanceof Date?s.toLocaleDateString("vi-VN"):String(s):"",i=n(t[0]),a=n(t[1]);return i&&a?`${i} - ${a}`:i||a||"Ch\u01B0a ch\u1ECDn"}let r=n=>{if(e.options&&e.options.length>0){let i=e.options.find(a=>String(a.value)===String(n));if(i)return String(i.label)}return String(n)};return t.length===1?r(t[0]):`${r(t[0])}, +${t.length-1}`}return String(t)}var Ge=require("react/jsx-runtime");function lm({field:e,currentValue:t,isOpen:r,onOpenChange:o,onRemove:n,onChange:i,color:a,radius:s}){let{refs:{setFloating:l,setReference:f},floatingStyles:u,context:w}=(0,mt.useFloating)({open:r,onOpenChange:o,placement:"bottom-start",transform:!1,middleware:[(0,mt.offset)(6),(0,mt.flip)(),(0,mt.shift)({padding:8})],whileElementsMounted:mt.autoUpdate}),{isMounted:g,styles:m}=ct(w),h=C(s,Is,"md"),b=(0,mt.useClick)(w),x=(0,mt.useDismiss)(w,{outsidePress:c=>!c.target?.closest?.("[data-select-filter-popover]")}),{getReferenceProps:S,getFloatingProps:k}=(0,mt.useInteractions)([b,x]),v=(0,Fo.useRef)(null);(0,Fo.useEffect)(()=>{r&&v.current?.focus({preventScroll:!0})},[r]);let p=t!=null&&t!==""&&(!Array.isArray(t)||t.length>0),d=md(e,t),y=()=>{if(e.type==="custom")return e.render?.({value:t,onChange:c=>i(e.name,c)})??null;switch(e.type){case"string":case"text":return(0,Ge.jsx)(ar,{ref:v,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Nh\u1EADp t\u1EEB kh\xF3a...",value:t||"",onChange:c=>i(e.name,c.target.value),...e.props||{}});case"number":return(0,Ge.jsx)(wn,{ref:v,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Nh\u1EADp s\u1ED1...",value:t??"",onChange:c=>{let T=c.target.value;if(T==="")i(e.name,"");else{let R=qo(T);i(e.name,R!==void 0?R:T)}},onClear:()=>i(e.name,""),...e.props||{}});case"date":return(0,Ge.jsx)($n,{portal:!1,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Ch\u1ECDn ng\xE0y",value:t,onChange:c=>i(e.name,c),...e.props||{}});case"date-range":return(0,Ge.jsx)(Hn,{portal:!1,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Ch\u1ECDn kho\u1EA3ng ng\xE0y",value:t||[null,null],onChange:c=>i(e.name,c),...e.props||{}});case"checkbox-group":return(0,Ge.jsx)(kn,{size:"sm",color:a,value:t||[],onChange:c=>i(e.name,c),options:(e.options||[]).map(c=>({value:String(c.value),label:c.label,disabled:c.disabled})),className:"max-h-48 overflow-y-auto py-1 gap-2",...e.props||{}});default:return null}};return(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)("div",{ref:f,...S({className:"inline-flex items-center"}),children:(0,Ge.jsxs)(yr,{size:"sm",variant:"soft",color:p||r?a:"neutral",radius:"full",className:`cursor-pointer select-none transition-all duration-150 gap-1 px-3 py-1 rounded-full ${r?"ring-2 ring-primary-500/30":"hover:opacity-90"}`,onDelete:n,deleteAriaLabel:`X\xF3a b\u1ED9 l\u1ECDc ${e.label}`,children:[(0,Ge.jsxs)("span",{className:"font-semibold",children:[e.label,":"]}),(0,Ge.jsx)("span",{className:p?"font-medium":"opacity-70 italic",children:d})]})}),g&&(0,Ge.jsx)(mt.FloatingPortal,{children:(0,Ge.jsxs)("div",{ref:l,"data-select-filter-popover":"true",style:{...u,...m,zIndex:pt.SELECT_FILTER},...k({className:`bg-white border border-neutral-200 ${h} p-3 shadow-2xl ${e.type==="date"||e.type==="date-range"?"w-auto min-w-[280px]":"min-w-64 max-w-xs"}`}),children:[(0,Ge.jsxs)("div",{className:"flex items-center justify-between pb-2 mb-2 border-b border-neutral-100",children:[(0,Ge.jsx)("span",{className:"text-xs font-bold text-neutral-800",children:e.label}),(0,Ge.jsx)("button",{type:"button",onClick:()=>o(!1),className:"text-neutral-400 hover:text-neutral-600 p-0.5 rounded transition-colors",title:"\u0110\xF3ng",children:(0,Ge.jsx)(Ue,{className:"size-3.5"})})]}),(0,Ge.jsx)("div",{className:"mt-1",children:y()}),(0,Ge.jsxs)("div",{className:"flex items-center justify-between mt-3 pt-2 border-t border-neutral-100",children:[(0,Ge.jsx)("button",{type:"button",onClick:n,className:"text-[11px] text-red-500 hover:text-red-700 transition-colors",children:"X\xF3a b\u1ED9 l\u1ECDc"}),(0,Ge.jsx)("button",{type:"button",onClick:()=>o(!1),className:"text-[11px] font-medium text-neutral-700 hover:bg-neutral-100 px-3 py-1 rounded-full border border-neutral-200 transition-colors cursor-pointer",children:"Xong"})]})]})})]})}function cm({filters:e,values:t,onChange:r,onReset:o,showReset:n=!0,resetText:i="\u0110\u1EB7t l\u1EA1i b\u1ED9 l\u1ECDc",color:a="primary",radius:s="full"}){let[l,f]=(0,Fo.useState)(()=>{let P=[];return e?.forEach(I=>{let z=t?.[I.name]??I.defaultValue;z!=null&&z!==""&&(!Array.isArray(z)||z.length>0)&&P.push(I.name)}),P}),[u,w]=(0,Fo.useState)(null),[g,m]=(0,Fo.useState)(!1),{refs:{setFloating:h,setReference:b},floatingStyles:x,context:S}=(0,mt.useFloating)({open:g,onOpenChange:m,placement:"bottom-start",transform:!1,middleware:[(0,mt.offset)(6),(0,mt.flip)(),(0,mt.shift)({padding:8})],whileElementsMounted:mt.autoUpdate}),{isMounted:k,styles:v}=ct(S,{duration:120}),p=(0,mt.useClick)(S),d=(0,mt.useDismiss)(S,{outsidePress:P=>!P.target?.closest?.("[data-select-filter-popover]")}),{getReferenceProps:y,getFloatingProps:c}=(0,mt.useInteractions)([p,d]),T=P=>{l.includes(P.name)||f(I=>[...I,P.name]),m(!1),w(P.name)},R=P=>{f(I=>I.filter(z=>z!==P)),u===P&&w(null),r(P,void 0)},N=P=>{P.stopPropagation(),f([]),w(null),o?.()},D=(0,Fo.useMemo)(()=>new Set(l),[l]),M=l.length>0,F=C(s,Is,"md");return!e||e.length===0?null:(0,Ge.jsx)("div",{onClick:P=>P.stopPropagation(),onMouseDown:P=>P.stopPropagation(),className:"p-2.5 border-b border-neutral-200 bg-neutral-50/90 rounded-t-lg select-text",children:(0,Ge.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 min-h-7",children:[(0,Ge.jsxs)("div",{className:"inline-flex",children:[(0,Ge.jsxs)("button",{ref:b,type:"button",...y({className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-neutral-700 hover:text-neutral-900 bg-white border border-neutral-300 hover:border-neutral-400 rounded-full transition-all shadow-xs hover:shadow-sm cursor-pointer active:scale-95"}),children:[(0,Ge.jsx)(no,{className:"size-3.5 text-neutral-500"}),(0,Ge.jsx)("span",{children:"B\u1ED9 l\u1ECDc"}),(0,Ge.jsx)(zt,{className:`size-3 text-neutral-400 transition-transform ${g?"rotate-180":""}`})]}),k&&(0,Ge.jsx)(mt.FloatingPortal,{children:(0,Ge.jsxs)("div",{ref:h,"data-select-filter-popover":"true",style:{...x,...v,zIndex:pt.SELECT_FILTER},...c({className:`bg-white border border-neutral-200 ${F} p-1 shadow-2xl min-w-44`}),children:[(0,Ge.jsx)("div",{className:"px-2 py-1 text-[11px] font-semibold text-neutral-400 uppercase tracking-wider",children:"Ch\u1ECDn tr\u01B0\u1EDDng c\u1EA7n l\u1ECDc"}),(0,Ge.jsx)("div",{className:"space-y-0.5 mt-0.5",children:e.map(P=>{let I=D.has(P.name);return(0,Ge.jsxs)("button",{type:"button",onMouseDown:z=>z.preventDefault(),onClick:z=>{z.preventDefault(),z.stopPropagation(),T(P)},className:`w-full flex items-center justify-between px-2 py-1.5 text-xs rounded text-left transition-colors ${I?"text-primary font-medium bg-primary/5 hover:bg-primary/10":"text-neutral-700 hover:bg-neutral-100"}`,children:[(0,Ge.jsx)("span",{children:P.label}),I&&(0,Ge.jsx)("span",{className:"text-[10px] text-neutral-400",children:"\u0110ang l\u1ECDc"})]},P.name)})})]})})]}),l.map(P=>{let I=e.find(B=>B.name===P);if(!I)return null;let z=t[P]??I.defaultValue;return(0,Ge.jsx)(lm,{field:I,currentValue:z,isOpen:u===P,onOpenChange:B=>w(B?P:null),onRemove:()=>R(P),onChange:r,color:a,radius:s},P)}),n&&o&&M&&(0,Ge.jsxs)("button",{type:"button",onClick:N,className:"inline-flex items-center gap-1 text-[11px] text-neutral-500 hover:text-neutral-800 px-2.5 py-1 rounded-full border border-neutral-200 hover:bg-neutral-100 transition-colors ml-auto cursor-pointer",title:"\u0110\u1EB7t l\u1EA1i to\xE0n b\u1ED9 b\u1ED9 l\u1ECDc",children:[(0,Ge.jsx)(Tr,{className:"size-3"}),(0,Ge.jsx)("span",{children:i})]})]})})}var Es=cm;var hr=require("react/jsx-runtime"),um={};function dm({isOpen:e,isMounted:t,animated:r=!0,transitionStyles:o,options:n,selectedValues:i,activeIndex:a,size:s="md",color:l="primary",radius:f="md",isLoading:u=!1,portal:w=!0,portalRoot:g,maxMenuHeight:m=280,emptyText:h,emptyProps:b,menuHeader:x,menuFooter:S,listFooter:k,menuFilters:v,menuFilterValues:p=um,menuFilterLayout:d="vertical",menuFilterGridCols:y=2,showResetFilters:c=!0,resetFiltersText:T,onMenuFilterChange:R,onResetFilters:N,renderOption:D,onSelectOption:M,onOptionMouseEnter:F,floatingStyles:P,floatingRef:I,getFloatingProps:z,listElementsRef:B,className:V=""}){let Y=tt(),L=rt();if(!(t!==void 0?t:e))return null;let O=C(f,Is,"md"),A=(0,hr.jsxs)("div",{ref:I,"data-state":e?"open":"closed",style:{...P,...r?o:{},zIndex:pt.SELECT},...z({className:`flex flex-col bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden focus:outline-none min-w-[200px] ${O} ${V}`}),children:[x,v&&v.length>0&&R&&(0,hr.jsx)(Es,{filters:v,values:p,onChange:R,onReset:N,layout:d,gridCols:y,showReset:c,resetText:T,color:l,radius:f}),(0,hr.jsx)("div",{role:"listbox",tabIndex:-1,style:{maxHeight:typeof m=="number"?`${m}px`:m},className:`p-1 overflow-y-auto overflow-x-hidden space-y-0.5 transition-opacity duration-150 ui-scrollbar ${u?"opacity-75":"opacity-100"}`,children:n.length===0?u?(0,hr.jsxs)("div",{className:"flex items-center justify-center py-6 gap-2 text-zinc-500 text-sm",children:[(0,hr.jsx)(Re,{className:"size-4 animate-spin text-current"}),(0,hr.jsx)("span",{children:"Loading..."})]}):(0,hr.jsx)("div",{className:"py-4 px-2",children:(0,hr.jsx)(Gn,{size:"sm",image:"search",description:h||"No data found",className:"py-2",...b})}):(0,hr.jsxs)(hr.Fragment,{children:[(()=>{let G=new Set(i);return n.map((K,q)=>{let X=G.has(K.value);return(0,hr.jsx)(Ms,{ref:ae=>{B.current[q]=ae},option:K,isSelected:X,isActive:a===q,size:s,color:l,radius:f,disabled:K.disabled,renderOption:D,onClick:()=>M(K),onMouseEnter:()=>F(q)},String(K.value))})})(),k]})}),S]}),U=g??Y?.dialogRef??L?.dialogRef;return w?(0,hr.jsx)(zf.FloatingPortal,{root:U,children:A}):A}var zi=dm;var If=require("react"),Xt=require("@floating-ui/react");function $s({placement:e="bottom-start",isOpen:t,onOpenChange:r,disabled:o=!1,readOnly:n=!1,isLoading:i=!1,animated:a=!0,animationDuration:s=150,activeIndex:l,onNavigate:f}){let u=(0,If.useRef)([]),w=!o&&!n,{refs:g,floatingStyles:m,context:h}=(0,Xt.useFloating)({placement:e,open:t&&w,onOpenChange:c=>{w&&(!i||t||!c)&&r(c)},whileElementsMounted:Xt.autoUpdate,transform:!1,middleware:[(0,Xt.offset)(4),(0,Xt.flip)(),(0,Xt.shift)({padding:8})]}),b=(0,Xt.useClick)(h,{enabled:w&&(!i||t)}),x=(0,Xt.useDismiss)(h,{outsidePress:c=>!c.target?.closest?.("[data-select-filter-popover]")}),S=(0,Xt.useRole)(h,{role:"listbox"}),k=(0,Xt.useListNavigation)(h,{listRef:u,activeIndex:l,onNavigate:f,loop:!0}),{getReferenceProps:v,getFloatingProps:p}=(0,Xt.useInteractions)([b,x,S,k]),{isMounted:d,styles:y}=ct(h,{duration:s,animated:a});return{refs:g,floatingStyles:m,transitionStyles:y,isMounted:d,context:h,getReferenceProps:v,getFloatingProps:p,elementsRef:u}}var Ls=require("react");var fm=[];function Bs({options:e,searchMode:t="client",controlledSearchValue:r,onSearchChange:o,searchField:n=["label","value"],menuFilters:i,controlledFilterValues:a,onMenuFilterChange:s,onSearch:l,debounceMs:f=300,filterFn:u,isOpen:w,setIsOpen:g,preserveSelected:m=!1,selectedValues:h=fm,historicalOptions:b}){let[x,S]=(0,Ls.useState)(""),k=r!==void 0,v=k?r:x,[p,d]=(0,Ls.useState)(()=>{let P={};return i?.forEach(I=>{I.defaultValue!==void 0&&(P[I.name]=I.defaultValue)}),P}),y=a??p,{debounced:c,cancel:T}=Sn((P,I)=>{t==="server"&&l?.(P,I)},f),R=P=>{k||S(P),o?.(P),w||g(!0),c(P,y)},N=()=>{T(),k||S(""),o?.(""),t==="server"&&l?.("",y)},D=(P,I)=>{let z={...y,[P]:I};a||d(z),s?.(z),c(v,z)},M=()=>{let P={};i?.forEach(I=>{I.defaultValue!==void 0&&(P[I.name]=I.defaultValue)}),a||d(P),s?.(P),c(v,P)},F=(0,Ls.useMemo)(()=>{if(t==="server")return e;let P=e,I=v.trim();if(I?u?P=P.filter(z=>u(z,v,y)):P=vn(P,I,n):u&&(P=P.filter(z=>u(z,v,y))),m&&I&&h.length>0&&b){let z=new Set(P.map(V=>V.value)),B=[];for(let V of h)if(!z.has(V)){let Y=b.get(V);Y&&B.push(Y)}B.length>0&&(P=[...B,...P])}return P},[e,t,v,u,y,n,m,h,b]);return{searchInput:v,handleSearchChange:R,resetSearch:N,currentFilters:y,handleFilterChange:D,handleResetFilters:M,filteredOptions:F}}var Eo=require("react/jsx-runtime"),pm=[];function Fa({ref:e,options:t=pm,value:r,defaultValue:o,onChange:n,size:i="md",variant:a="outline",color:s="primary",radius:l="md",id:f,label:u,labelPlacement:w="floating",placeholder:g="Ch\u1ECDn...",helperText:m,errorMessage:h,isDisabled:b=!1,readOnly:x=!1,name:S,searchable:k=!1,searchMode:v="client",searchPlacement:p="trigger",searchPlaceholder:d,searchField:y=["label","value"],searchValue:c,onSearchChange:T,menuFilters:R,menuFilterValues:N,menuFilterLayout:D="vertical",menuFilterGridCols:M=2,showResetFilters:F=!0,resetFiltersText:P,onMenuFilterChange:I,menuHeader:z,menuFooter:B,listFooter:V,onSearch:Y,debounceMs:L=300,filterFn:E,emptyText:O,emptyProps:A,portal:U=!0,portalRoot:G,placement:K="bottom-start",maxMenuHeight:q=280,animated:X=!0,animationDuration:fe=150,startContent:ae,endContent:_,renderValue:Z,renderOption:he,config:xe,className:$="",triggerClassName:re="",menuClassName:ee="",labelClassName:de="",helperClassName:ne="",...ze}){let{isRequired:ve=!1,isInvalid:Ce=!1,isLoading:J=!1,showSpinner:j=!1,isClearable:oe=!1,isFullWidth:ye=!0}=xe??{},ue=!!(Ce??!!h),ce=oe,ke=C(i,Io,"md"),Te=r!==void 0,[pe,W]=(0,to.useState)(o??null),me=Te?r??null:pe,[De,ie]=(0,to.useState)(()=>Fs(t)),H=(0,to.useMemo)(()=>fd(me,t,De),[me,t,De]),[se,Ie]=(0,to.useState)(!1),[je,le]=(0,to.useState)(null),{searchInput:ge,handleSearchChange:Ee,resetSearch:He,currentFilters:Oe,handleFilterChange:Ve,handleResetFilters:Ke,filteredOptions:Ct}=Bs({options:t,searchMode:v,controlledSearchValue:c,onSearchChange:T,searchField:y,menuFilters:R,controlledFilterValues:N,onMenuFilterChange:I,onSearch:Y,debounceMs:L,filterFn:E,isOpen:se,setIsOpen:Ie}),{refs:Ne,floatingStyles:Je,transitionStyles:ot,isMounted:bt,getReferenceProps:dt,getFloatingProps:Bt,elementsRef:$e}=$s({placement:K,isOpen:se,onOpenChange:qe=>{Ie(qe),qe||(le(null),He())},disabled:b,readOnly:x,isLoading:J,animated:X,animationDuration:fe,activeIndex:je,onNavigate:le}),Ht=(0,to.useCallback)(qe=>{qe.disabled||b||x||(ie(rr=>{if(rr.has(qe.value))return rr;let ir=new Map(rr);return ir.set(qe.value,qe),ir}),Te||W(qe.value),n?.(qe.value,qe),Ie(!1),He())},[b,x,Te,n,He]),Rt=(0,to.useCallback)(qe=>{qe.stopPropagation(),!(b||x)&&(Te||W(null),n?.(null,null),He())},[b,x,Te,n,He]),Nt=qe=>{if(qe.key==="Enter"&&se&&je!==null){qe.preventDefault();let rr=Ct[je];rr&&Ht(rr)}else qe.key==="ArrowDown"&&!se&&Ie(!0)},st=w==="floating",tr=w==="left",We=(0,to.useId)(),St=f||We,we=`${St}-trigger`,Xe=()=>(0,Eo.jsx)(Pt,{htmlFor:we,label:u,isRequired:ve,isFloating:st,size:i,color:s,hasError:ue,cursor:"pointer",className:de});return(0,Eo.jsxs)("div",{ref:e,id:f,className:`group/field relative flex ${tr?"flex-row items-center gap-3":"flex-col"} ${st&&!!u?"pt-2":""} ${ye?"w-full":"inline-flex"} ${$}`,"data-disabled":b,"data-invalid":ue,...ze,children:[!st&&Xe(),(0,Eo.jsxs)("div",{className:`flex flex-col ${ye?"w-full":"flex-1 min-w-0"}`,children:[(0,Eo.jsxs)("div",{className:"relative w-full",children:[st&&Xe(),(0,Eo.jsx)(Pi,{id:we,triggerRef:Ne.setReference,getReferenceProps:dt,selectedOption:H,isOpen:se,size:i,variant:a,color:s,radius:l,placeholder:d||g,disabled:b,readOnly:x,isInvalid:ue,searchable:k,searchPlacement:p,searchValue:ge,onSearchChange:Ee,onClear:Rt,clearable:ce,isLoading:J,showSpinner:j,startContent:ae,endContent:_,renderValue:Z,onKeyDown:Nt,className:re}),(0,Eo.jsx)(zi,{isOpen:se,isMounted:bt,animated:X,transitionStyles:ot,options:Ct,selectedValues:me!=null?[me]:[],activeIndex:je,size:i,color:s,radius:l,isLoading:J,portal:U,portalRoot:G,maxMenuHeight:q,emptyText:O,emptyProps:A,menuHeader:z,menuFooter:B,listFooter:V,menuFilters:R,menuFilterValues:Oe,menuFilterLayout:D,menuFilterGridCols:M,showResetFilters:F,resetFiltersText:P,onMenuFilterChange:Ve,onResetFilters:Ke,renderOption:he,onSelectOption:Ht,onOptionMouseEnter:le,floatingRef:Ne.setFloating,floatingStyles:Je,getFloatingProps:Bt,listElementsRef:$e,className:ee})]}),S&&me!==null&&me!==void 0&&(0,Eo.jsx)("input",{type:"hidden",name:S,value:String(me)}),(0,Eo.jsx)(Ae,{id:`${St}-helper`,errorMessage:h,helperText:m,sizeClassName:ke.helper,className:ne})]})]})}var gd=Fa;var Ur=require("react");var Mf=require("react");var $o=require("react/jsx-runtime");function mm({id:e,selectedOptions:t,isOpen:r,size:o="md",variant:n="outline",color:i="primary",radius:a="md",placeholder:s="Ch\u1ECDn...",disabled:l=!1,readOnly:f=!1,isInvalid:u=!1,maxTagCount:w,searchable:g=!1,searchPlacement:m="trigger",searchValue:h="",onSearchChange:b,onRemoveTag:x,onClear:S,clearable:k=!1,isLoading:v=!1,showSpinner:p=!1,startContent:d,endContent:y,renderValue:c,triggerRef:T,getReferenceProps:R,onKeyDown:N,className:D=""}){let M=(0,Mf.useRef)(null),F=C(o,Io,"md"),P=C(a,Ia,"md"),I=C(a,Rf,"md"),B=!!u?"error":i,V=n==="other"?"":Ma[n]?.[B]||Ma.outline.primary,Y=g&&(m==="trigger"||m==="both"),L=t.length>0,E=k&&(L||h.length>0)&&!l&&!f,{visibleTags:O,hiddenTagCount:A}=pd(t,w);return(0,$o.jsx)(yc,{id:e,isOpen:r,disabled:l,isLoading:v,showSpinner:p,showClear:E,onClear:S,startContent:d,endContent:y,triggerRef:T,getReferenceProps:R,onClick:()=>{!l&&!f&&!v&&Y&&M.current?.focus()},roundedClass:P,currentSize:F,variantStyle:V,className:D,children:c&&L?(0,$o.jsx)("div",{className:"flex-1 min-w-0 truncate text-neutral-900",children:c(t)}):(0,$o.jsxs)("div",{className:"flex flex-wrap items-center gap-1 flex-1 min-w-0",children:[O.map(K=>(0,$o.jsx)(yr,{size:F.badgeSize,variant:"soft",color:i,radius:I,onDelete:!l&&!f&&!v&&x?()=>x(K):void 0,className:"max-w-full truncate",children:(0,$o.jsx)("span",{className:"truncate",children:K.label})},String(K.value))),A>0&&(0,$o.jsxs)(yr,{size:F.badgeSize,variant:"soft",color:"neutral",radius:I,children:["+",A]}),Y&&!l&&!f&&!v?(0,$o.jsx)("input",{ref:M,type:"text","aria-label":"Search",value:h,placeholder:L?"":s,onChange:K=>b?.(K.target.value),onKeyDown:N,className:`bg-transparent outline-none border-none p-0 flex-1 min-w-15 text-neutral-900 placeholder:text-neutral-400 ${F.input}`}):L?null:(0,$o.jsx)("span",{className:"text-neutral-400 truncate",children:s})]})})}var Hs=mm;var Lo=require("react/jsx-runtime"),gm=[],Ff=[];function bm({ref:e,options:t=gm,value:r,defaultValue:o,onChange:n,size:i="md",variant:a="outline",color:s="primary",radius:l="md",id:f,label:u,labelPlacement:w="floating",placeholder:g="Ch\u1ECDn...",helperText:m,errorMessage:h,isDisabled:b=!1,readOnly:x=!1,name:S,maxTagCount:k,searchable:v=!1,searchMode:p="client",searchPlacement:d="trigger",searchPlaceholder:y,searchField:c=["label","value"],preserveSelected:T=!0,searchValue:R,onSearchChange:N,menuFilters:D,menuFilterValues:M,menuFilterLayout:F="vertical",menuFilterGridCols:P=2,showResetFilters:I=!0,resetFiltersText:z,onMenuFilterChange:B,menuHeader:V,menuFooter:Y,listFooter:L,onSearch:E,debounceMs:O=300,filterFn:A,emptyText:U,emptyProps:G,portal:K=!0,portalRoot:q,placement:X="bottom-start",maxMenuHeight:fe=280,animated:ae=!0,animationDuration:_=150,startContent:Z,endContent:he,renderValue:xe,renderOption:$,config:re,className:ee="",triggerClassName:de="",menuClassName:ne="",labelClassName:ze="",helperClassName:ve="",...Ce}){let{isRequired:J=!1,isInvalid:j=!1,isLoading:oe=!1,showSpinner:ye=!1,isClearable:ue=!1,isFullWidth:ce=!0}=re??{},ke=!!(j??!!h),Te=ue,pe=C(i,Io,"md"),W=r!==void 0,[me,De]=(0,Ur.useState)(o??Ff),ie=W?r??Ff:me,[H,se]=(0,Ur.useState)(()=>Fs(t)),Ie=(0,Ur.useMemo)(()=>wc(ie,t,H),[ie,t,H]),[je,le]=(0,Ur.useState)(!1),[ge,Ee]=(0,Ur.useState)(null),{searchInput:He,handleSearchChange:Oe,resetSearch:Ve,currentFilters:Ke,handleFilterChange:Ct,handleResetFilters:Ne,filteredOptions:Je}=Bs({options:t,searchMode:p,controlledSearchValue:R,onSearchChange:N,searchField:c,menuFilters:D,controlledFilterValues:M,onMenuFilterChange:B,onSearch:E,debounceMs:O,filterFn:A,isOpen:je,setIsOpen:le,preserveSelected:T,selectedValues:ie,historicalOptions:H}),{refs:ot,floatingStyles:bt,transitionStyles:dt,isMounted:Bt,getReferenceProps:$e,getFloatingProps:Ht,elementsRef:Rt}=$s({placement:X,isOpen:je,onOpenChange:Me=>{le(Me),Me||Ee(null)},disabled:b,readOnly:x,isLoading:oe,animated:ae,animationDuration:_,activeIndex:ge,onNavigate:Ee}),Nt=(0,Ur.useCallback)(Me=>{if(Me.disabled||b||x)return;se(lt=>{if(lt.has(Me.value))return lt;let te=new Map(lt);return te.set(Me.value,Me),te});let Se=ie.includes(Me.value)?ie.filter(lt=>lt!==Me.value):[...ie,Me.value];W||De(Se);let it=wc(Se,t,H);n?.(Se,it),Ve()},[b,x,ie,W,t,n,Ve,H]),st=(0,Ur.useCallback)(Me=>{if(b||x)return;let be=ie.filter(it=>it!==Me.value);W||De(be);let Se=be.map(it=>t.find(lt=>lt.value===it)||H.get(it)||{value:it,label:String(it)});n?.(be,Se)},[b,x,ie,W,t,n,H]),tr=(0,Ur.useCallback)(Me=>{Me.stopPropagation(),!(b||x)&&(W||De([]),n?.([],[]),Ve())},[b,x,W,n,Ve]),We=Me=>{let be=Me.currentTarget?.value??He;if(Me.key==="Backspace"&&(!be||be.length===0)&&Ie.length>0){Me.preventDefault();let Se=Ie[Ie.length-1];Se&&st(Se)}else if(Me.key==="Enter"&&je&&ge!==null){Me.preventDefault();let Se=Je[ge];Se&&Nt(Se)}else Me.key==="ArrowDown"&&!je&&le(!0)},St=w==="floating",we=St&&!!u,Xe=w==="left",Vt=(0,Ur.useId)(),qe=f||Vt,rr=`${qe}-trigger`,ir=()=>(0,Lo.jsx)(Pt,{htmlFor:rr,label:u,isRequired:J,isFloating:St,size:i,color:s,hasError:ke,cursor:"pointer",className:ze});return(0,Lo.jsxs)("div",{ref:e,id:f,className:`group/field relative flex ${Xe?"flex-row items-center gap-3":"flex-col"} ${we?"pt-2":""} ${ce?"w-full":"inline-flex"} ${ee}`,"data-disabled":b,"data-invalid":ke,...Ce,children:[!St&&ir(),(0,Lo.jsxs)("div",{className:`flex flex-col ${ce?"w-full":"flex-1 min-w-0"}`,children:[(0,Lo.jsxs)("div",{className:"relative w-full",children:[St&&ir(),(0,Lo.jsx)(Hs,{id:rr,triggerRef:ot.setReference,getReferenceProps:$e,selectedOptions:Ie,isOpen:je,size:i,variant:a,color:s,radius:l,placeholder:y||g,disabled:b,readOnly:x,isInvalid:ke,maxTagCount:k,searchable:v,searchPlacement:d,searchValue:He,onSearchChange:Oe,onRemoveTag:st,onClear:tr,clearable:Te,isLoading:oe,showSpinner:ye,startContent:Z,endContent:he,renderValue:xe,onKeyDown:We,className:de}),(0,Lo.jsx)(zi,{isOpen:je,isMounted:Bt,animated:ae,transitionStyles:dt,options:Je,selectedValues:ie,activeIndex:ge,size:i,color:s,radius:l,isLoading:oe,portal:K,portalRoot:q,maxMenuHeight:fe,emptyText:U,emptyProps:G,menuHeader:V,menuFooter:Y,listFooter:L,menuFilters:D,menuFilterValues:Ke,menuFilterLayout:F,menuFilterGridCols:P,showResetFilters:I,resetFiltersText:z,onMenuFilterChange:Ct,onResetFilters:Ne,renderOption:$,onSelectOption:Nt,onOptionMouseEnter:Ee,floatingRef:ot.setFloating,floatingStyles:bt,getFloatingProps:Ht,listElementsRef:Rt,className:ne})]}),S&&ie.map((Me,be)=>(0,Lo.jsx)("input",{type:"hidden",name:`${S}[]`,value:String(Me)},`${S}-${Me}-${be}`)),(0,Lo.jsx)(Ae,{id:`${qe}-helper`,errorMessage:h,helperText:m,sizeClassName:pe.helper,className:ve})]})]})}var bd=bm;var Cc=require("react");function Ef(e,t=300){let[r,o]=(0,Cc.useState)(e);return(0,Cc.useEffect)(()=>{let n=setTimeout(()=>{o(e)},t);return()=>{clearTimeout(n)}},[e,t]),r}var bo=require("react");function $f({onLoadMore:e,hasMore:t=!0,isLoading:r=!1,disabled:o=!1,rootMargin:n="100px",threshold:i=0,root:a=null}){let[s,l]=(0,bo.useState)(!1),[f,u]=(0,bo.useState)(null),w=(0,bo.useRef)(!1),g=t&&!r&&!o,m=(0,bo.useCallback)(()=>{if(!(!g||w.current)){w.current=!0;try{let b=e();b&&typeof b.then=="function"?b.finally(()=>{w.current=!1}):w.current=!1}catch{w.current=!1}}},[g,e]),h=(0,bo.useCallback)(b=>{u(b)},[]);return(0,bo.useEffect)(()=>{if(!f||o||!t||typeof window>"u"||!("IntersectionObserver"in window))return;let b=a&&typeof a=="object"&&"current"in a?a.current:a,x=new IntersectionObserver(S=>{let[k]=S;if(!k)return;let v=k.isIntersecting;l(v),v&&m()},{root:b,rootMargin:n,threshold:i});return x.observe(f),()=>{x.disconnect(),l(!1)}},[f,a,n,i,o,t,m]),(0,bo.useEffect)(()=>{g&&s&&m()},[g,s,m]),{sentinelRef:h,isIntersecting:s}}var Go=require("react"),tp=require("react-dropzone");var Sc={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-full"},Lf={primary:"text-primary-500 group-focus-within/field:text-primary-600",secondary:"text-secondary-500 group-focus-within/field:text-secondary-600",neutral:"text-neutral-600 group-focus-within/field:text-neutral-800",error:"text-error-500 group-focus-within/field:text-error-600",success:"text-success-500 group-focus-within/field:text-success-600",warning:"text-warning-500 group-focus-within/field:text-warning-600",info:"text-info-500 group-focus-within/field:text-info-600"},Bf={xs:"h-28",sm:"h-36",md:"h-48",lg:"h-60",xl:"h-72"},Ea={xs:{dropzoneHeight:"min-h-[80px]",dropzonePadding:"p-3",avatarSize:"size-12",thumbnailSize:"size-12",iconSize:24,titleSize:"text-[11px]",descSize:"text-[10px]",labelSize:"text-[11px] mb-1",helperSize:"text-[9px] mt-0.5",gap:"gap-1.5"},sm:{dropzoneHeight:"min-h-[100px]",dropzonePadding:"p-4",avatarSize:"size-16",thumbnailSize:"size-16",iconSize:32,titleSize:"text-xs",descSize:"text-[11px]",labelSize:"text-xs mb-1",helperSize:"text-[10px] mt-0.5",gap:"gap-2"},md:{dropzoneHeight:"min-h-[130px]",dropzonePadding:"p-5",avatarSize:"size-24",thumbnailSize:"size-20",iconSize:44,titleSize:"text-sm",descSize:"text-xs",labelSize:"text-sm mb-1.5",helperSize:"text-[11px] mt-1",gap:"gap-3"},lg:{dropzoneHeight:"min-h-[160px]",dropzonePadding:"p-6",avatarSize:"size-28",thumbnailSize:"size-24",iconSize:54,titleSize:"text-base",descSize:"text-xs",labelSize:"text-base mb-1.5",helperSize:"text-xs mt-1",gap:"gap-3.5"},xl:{dropzoneHeight:"min-h-[200px]",dropzonePadding:"p-8",avatarSize:"size-36",thumbnailSize:"size-28",iconSize:64,titleSize:"text-lg",descSize:"text-sm",labelSize:"text-lg mb-2",helperSize:"text-sm mt-1",gap:"gap-4"}},Hf={outline:{primary:{idle:"bg-neutral-white border-primary-400 hover:border-primary-500 text-neutral-700",active:"bg-primary-50/50 border-primary-500 ring-2 ring-primary-500/20 text-primary-900",iconColor:"text-primary-500",titleHover:"group-hover:text-primary-600"},secondary:{idle:"bg-neutral-white border-secondary-400 hover:border-secondary-500 text-neutral-700",active:"bg-secondary-50/50 border-secondary-500 ring-2 ring-secondary-500/20 text-secondary-900",iconColor:"text-secondary-500",titleHover:"group-hover:text-secondary-600"},neutral:{idle:"bg-neutral-white border-neutral-300 hover:border-neutral-400 text-neutral-700",active:"bg-neutral-100/70 border-neutral-500 ring-2 ring-neutral-500/20 text-neutral-900",iconColor:"text-neutral-500",titleHover:"group-hover:text-neutral-900"},error:{idle:"bg-neutral-white border-error-500 hover:border-error-600 text-neutral-700",active:"bg-error-50/50 border-error-500 ring-2 ring-error-500/20 text-error-900",iconColor:"text-error-500",titleHover:"group-hover:text-error-600"},success:{idle:"bg-neutral-white border-success-400 hover:border-success-500 text-neutral-700",active:"bg-success-50/50 border-success-500 ring-2 ring-success-500/20 text-success-900",iconColor:"text-success-500",titleHover:"group-hover:text-success-600"},warning:{idle:"bg-neutral-white border-warning-400 hover:border-warning-500 text-neutral-700",active:"bg-warning-50/50 border-warning-500 ring-2 ring-warning-500/20 text-warning-900",iconColor:"text-warning-500",titleHover:"group-hover:text-warning-600"},info:{idle:"bg-neutral-white border-info-400 hover:border-info-500 text-neutral-700",active:"bg-info-50/50 border-info-500 ring-2 ring-info-500/20 text-info-900",iconColor:"text-info-500",titleHover:"group-hover:text-info-600"}},filled:{primary:{idle:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 hover:border-primary-400 text-primary-900",active:"bg-primary-100 border-primary-500 ring-2 ring-primary-500/20 text-primary-950",iconColor:"text-primary-600",titleHover:"group-hover:text-primary-700"},secondary:{idle:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 hover:border-secondary-400 text-secondary-900",active:"bg-secondary-100 border-secondary-500 ring-2 ring-secondary-500/20 text-secondary-950",iconColor:"text-secondary-600",titleHover:"group-hover:text-secondary-700"},neutral:{idle:"bg-neutral-100/70 border-neutral-200 hover:bg-neutral-200/70 hover:border-neutral-400 text-neutral-800",active:"bg-neutral-200 border-neutral-500 ring-2 ring-neutral-500/20 text-neutral-900",iconColor:"text-neutral-600",titleHover:"group-hover:text-neutral-950"},error:{idle:"bg-error-50/60 border-error-200 hover:bg-error-100/60 hover:border-error-400 text-error-900",active:"bg-error-100 border-error-500 ring-2 ring-error-500/20 text-error-950",iconColor:"text-error-600",titleHover:"group-hover:text-error-700"},success:{idle:"bg-success-50/60 border-success-200 hover:bg-success-100/60 hover:border-success-400 text-success-900",active:"bg-success-100 border-success-500 ring-2 ring-success-500/20 text-success-950",iconColor:"text-success-600",titleHover:"group-hover:text-success-700"},warning:{idle:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 hover:border-warning-400 text-warning-900",active:"bg-warning-100 border-warning-500 ring-2 ring-warning-500/20 text-warning-950",iconColor:"text-warning-600",titleHover:"group-hover:text-warning-700"},info:{idle:"bg-info-50/60 border-info-200 hover:bg-info-100/60 hover:border-info-400 text-info-900",active:"bg-info-100 border-info-500 ring-2 ring-info-500/20 text-info-950",iconColor:"text-info-600",titleHover:"group-hover:text-info-700"}},ghost:{primary:{idle:"bg-transparent border-transparent hover:bg-primary-50/60 hover:border-primary-300 text-neutral-700",active:"bg-primary-50 border-primary-500 ring-2 ring-primary-500/20 text-primary-900",iconColor:"text-primary-500",titleHover:"group-hover:text-primary-600"},secondary:{idle:"bg-transparent border-transparent hover:bg-secondary-50/60 hover:border-secondary-300 text-neutral-700",active:"bg-secondary-50 border-secondary-500 ring-2 ring-secondary-500/20 text-secondary-900",iconColor:"text-secondary-500",titleHover:"group-hover:text-secondary-600"},neutral:{idle:"bg-transparent border-transparent hover:bg-neutral-100 hover:border-neutral-300 text-neutral-700",active:"bg-neutral-100 border-neutral-500 ring-2 ring-neutral-500/20 text-neutral-900",iconColor:"text-neutral-500",titleHover:"group-hover:text-neutral-900"},error:{idle:"bg-transparent border-transparent hover:bg-error-50/60 hover:border-error-300 text-neutral-700",active:"bg-error-50 border-error-500 ring-2 ring-error-500/20 text-error-900",iconColor:"text-error-500",titleHover:"group-hover:text-error-600"},success:{idle:"bg-transparent border-transparent hover:bg-success-50/60 hover:border-success-300 text-neutral-700",active:"bg-success-50 border-success-500 ring-2 ring-success-500/20 text-success-900",iconColor:"text-success-500",titleHover:"group-hover:text-success-600"},warning:{idle:"bg-transparent border-transparent hover:bg-warning-50/60 hover:border-warning-300 text-neutral-700",active:"bg-warning-50 border-warning-500 ring-2 ring-warning-500/20 text-warning-900",iconColor:"text-warning-500",titleHover:"group-hover:text-warning-600"},info:{idle:"bg-transparent border-transparent hover:bg-info-50/60 hover:border-info-300 text-neutral-700",active:"bg-info-50 border-info-500 ring-2 ring-info-500/20 text-info-900",iconColor:"text-info-500",titleHover:"group-hover:text-info-600"}}};function ho(e,t=1){if(!e||!+e)return"0 B";let r=1024,o=t<0?0:t,n=["B","KB","MB","GB","TB"],i=Math.floor(Math.log(e)/Math.log(r));return`${parseFloat((e/Math.pow(r,i)).toFixed(o))} ${n[i]}`}function Ii(e){return e?Array.isArray(e)?e.filter(t=>!!t):[e]:[]}var Tc={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-full"},Vf={primary:"text-primary-500 group-focus-within/field:text-primary-600",secondary:"text-secondary-500 group-focus-within/field:text-secondary-600",neutral:"text-neutral-600 group-focus-within/field:text-neutral-800",error:"text-error-500 group-focus-within/field:text-error-600",success:"text-success-500 group-focus-within/field:text-success-600",warning:"text-warning-500 group-focus-within/field:text-warning-600",info:"text-info-500 group-focus-within/field:text-info-600"},Af={xs:"h-28",sm:"h-36",md:"h-48",lg:"h-60",xl:"h-72"},Bo={xs:{dropzoneHeight:"min-h-[80px]",dropzoneMinHeight:"min-h-[80px]",dropzonePadding:"p-3",compactMinHeight:"min-h-[40px]",compactPadding:"px-3 py-2",thumbnailSize:"w-28 h-20",iconSize:24,fileIconSize:28,titleSize:"text-[11px]",descSize:"text-[10px]",fileNameSize:"text-xs",fileMetaSize:"text-[10px]",labelSize:"text-[11px] mb-1",helperSize:"text-[9px] mt-0.5",buttonSize:"xs",actionButtonPadding:"p-1",gap:"gap-1.5",itemPadding:"px-2.5 py-1.5"},sm:{dropzoneHeight:"min-h-[100px]",dropzoneMinHeight:"min-h-[100px]",dropzonePadding:"p-4",compactMinHeight:"min-h-[48px]",compactPadding:"px-3.5 py-2.5",thumbnailSize:"w-32 h-24",iconSize:32,fileIconSize:34,titleSize:"text-xs",descSize:"text-[11px]",fileNameSize:"text-xs font-medium",fileMetaSize:"text-[11px]",labelSize:"text-xs mb-1",helperSize:"text-[10px] mt-0.5",buttonSize:"sm",actionButtonPadding:"p-1.5",gap:"gap-2",itemPadding:"px-3 py-2"},md:{dropzoneHeight:"min-h-[130px]",dropzoneMinHeight:"min-h-[130px]",dropzonePadding:"p-5",compactMinHeight:"min-h-[56px]",compactPadding:"px-4 py-3",thumbnailSize:"w-40 h-28",iconSize:42,fileIconSize:40,titleSize:"text-sm",descSize:"text-xs",fileNameSize:"text-sm font-medium",fileMetaSize:"text-xs",labelSize:"text-sm mb-1.5",helperSize:"text-[11px] mt-1",buttonSize:"md",actionButtonPadding:"p-1.5",gap:"gap-2.5",itemPadding:"px-3.5 py-2.5"},lg:{dropzoneHeight:"min-h-[160px]",dropzoneMinHeight:"min-h-[160px]",dropzonePadding:"p-6",compactMinHeight:"min-h-[64px]",compactPadding:"px-5 py-3.5",thumbnailSize:"w-48 h-32",iconSize:52,fileIconSize:48,titleSize:"text-base",descSize:"text-xs",fileNameSize:"text-base font-medium",fileMetaSize:"text-xs",labelSize:"text-base mb-1.5",helperSize:"text-xs mt-1",buttonSize:"lg",actionButtonPadding:"p-2",gap:"gap-3",itemPadding:"px-4 py-3"},xl:{dropzoneHeight:"min-h-[200px]",dropzoneMinHeight:"min-h-[200px]",dropzonePadding:"p-8",compactMinHeight:"min-h-[72px]",compactPadding:"px-6 py-4",thumbnailSize:"w-56 h-36",iconSize:64,fileIconSize:56,titleSize:"text-lg",descSize:"text-sm",fileNameSize:"text-lg font-medium",fileMetaSize:"text-sm",labelSize:"text-lg mb-2",helperSize:"text-sm mt-1",buttonSize:"xl",actionButtonPadding:"p-2.5",gap:"gap-3.5",itemPadding:"px-5 py-3.5"}},Of={outline:{primary:{idle:"bg-neutral-white border-primary-400 hover:border-primary-500 text-neutral-700",active:"bg-primary-50/50 border-primary-500 ring-2 ring-primary-500/20 text-primary-900",iconColor:"text-primary-500",titleHover:"group-hover:text-primary-600",itemBg:"bg-white hover:bg-neutral-50/80",itemBorder:"border-neutral-200 hover:border-primary-300"},secondary:{idle:"bg-neutral-white border-secondary-400 hover:border-secondary-500 text-neutral-700",active:"bg-secondary-50/50 border-secondary-500 ring-2 ring-secondary-500/20 text-secondary-900",iconColor:"text-secondary-500",titleHover:"group-hover:text-secondary-600",itemBg:"bg-white hover:bg-neutral-50/80",itemBorder:"border-neutral-200 hover:border-secondary-300"},neutral:{idle:"bg-neutral-white border-neutral-300 hover:border-neutral-400 text-neutral-700",active:"bg-neutral-100/70 border-neutral-500 ring-2 ring-neutral-500/20 text-neutral-900",iconColor:"text-neutral-500",titleHover:"group-hover:text-neutral-900",itemBg:"bg-white hover:bg-neutral-50/80",itemBorder:"border-neutral-200 hover:border-neutral-400"},error:{idle:"bg-neutral-white border-error-500 hover:border-error-600 text-neutral-700",active:"bg-error-50/50 border-error-500 ring-2 ring-error-500/20 text-error-900",iconColor:"text-error-500",titleHover:"group-hover:text-error-600",itemBg:"bg-white hover:bg-error-50/30",itemBorder:"border-error-200 hover:border-error-300"},success:{idle:"bg-neutral-white border-success-400 hover:border-success-500 text-neutral-700",active:"bg-success-50/50 border-success-500 ring-2 ring-success-500/20 text-success-900",iconColor:"text-success-500",titleHover:"group-hover:text-success-600",itemBg:"bg-white hover:bg-success-50/30",itemBorder:"border-success-200 hover:border-success-300"},warning:{idle:"bg-neutral-white border-warning-400 hover:border-warning-500 text-neutral-700",active:"bg-warning-50/50 border-warning-500 ring-2 ring-warning-500/20 text-warning-900",iconColor:"text-warning-500",titleHover:"group-hover:text-warning-600",itemBg:"bg-white hover:bg-warning-50/30",itemBorder:"border-warning-200 hover:border-warning-300"},info:{idle:"bg-neutral-white border-info-400 hover:border-info-500 text-neutral-700",active:"bg-info-50/50 border-info-500 ring-2 ring-info-500/20 text-info-900",iconColor:"text-info-500",titleHover:"group-hover:text-info-600",itemBg:"bg-white hover:bg-info-50/30",itemBorder:"border-info-200 hover:border-info-300"}},filled:{primary:{idle:"border-transparent bg-primary-50/60 hover:bg-primary-100/60",active:"border-primary-500 bg-primary-100 ring-2 ring-primary-500/20",iconColor:"text-primary-600",titleHover:"group-hover:text-primary-700",itemBg:"bg-primary-50/40 hover:bg-primary-50/80",itemBorder:"border-primary-100 hover:border-primary-200"},secondary:{idle:"border-transparent bg-secondary-50/60 hover:bg-secondary-100/60",active:"border-secondary-500 bg-secondary-100 ring-2 ring-secondary-500/20",iconColor:"text-secondary-600",titleHover:"group-hover:text-secondary-700",itemBg:"bg-secondary-50/40 hover:bg-secondary-50/80",itemBorder:"border-secondary-100 hover:border-secondary-200"},neutral:{idle:"border-transparent bg-neutral-100/70 hover:bg-neutral-200/50",active:"border-neutral-400 bg-neutral-200 ring-2 ring-neutral-400/20",iconColor:"text-neutral-600",titleHover:"group-hover:text-neutral-800",itemBg:"bg-neutral-100/50 hover:bg-neutral-100",itemBorder:"border-neutral-200 hover:border-neutral-300"},error:{idle:"border-transparent bg-error-50/70 hover:bg-error-100/70",active:"border-error-500 bg-error-100 ring-2 ring-error-500/20",iconColor:"text-error-600",titleHover:"group-hover:text-error-700",itemBg:"bg-error-50/40 hover:bg-error-50/80",itemBorder:"border-error-100 hover:border-error-200"},success:{idle:"border-transparent bg-success-50/70 hover:bg-success-100/70",active:"border-success-500 bg-success-100 ring-2 ring-success-500/20",iconColor:"text-success-600",titleHover:"group-hover:text-success-700",itemBg:"bg-success-50/40 hover:bg-success-50/80",itemBorder:"border-success-100 hover:border-success-200"},warning:{idle:"border-transparent bg-warning-50/70 hover:bg-warning-100/70",active:"border-warning-500 bg-warning-100 ring-2 ring-warning-500/20",iconColor:"text-warning-600",titleHover:"group-hover:text-warning-700",itemBg:"bg-warning-50/40 hover:bg-warning-50/80",itemBorder:"border-warning-100 hover:border-warning-200"},info:{idle:"border-transparent bg-info-50/70 hover:bg-info-100/70",active:"border-info-500 bg-info-100 ring-2 ring-info-500/20",iconColor:"text-info-600",titleHover:"group-hover:text-info-700",itemBg:"bg-info-50/40 hover:bg-info-50/80",itemBorder:"border-info-100 hover:border-info-200"}},ghost:{primary:{idle:"border-transparent bg-transparent hover:bg-primary-50/30",active:"border-primary-400 bg-primary-50/40 ring-2 ring-primary-400/20",iconColor:"text-primary-500",titleHover:"group-hover:text-primary-600",itemBg:"bg-transparent hover:bg-primary-50/20",itemBorder:"border-transparent hover:border-primary-200"},secondary:{idle:"border-transparent bg-transparent hover:bg-secondary-50/30",active:"border-secondary-400 bg-secondary-50/40 ring-2 ring-secondary-400/20",iconColor:"text-secondary-500",titleHover:"group-hover:text-secondary-600",itemBg:"bg-transparent hover:bg-secondary-50/20",itemBorder:"border-transparent hover:border-secondary-200"},neutral:{idle:"border-transparent bg-transparent hover:bg-neutral-100/40",active:"border-neutral-400 bg-neutral-100/50 ring-2 ring-neutral-400/20",iconColor:"text-neutral-500",titleHover:"group-hover:text-neutral-800",itemBg:"bg-transparent hover:bg-neutral-100/40",itemBorder:"border-transparent hover:border-neutral-300"},error:{idle:"border-transparent bg-transparent hover:bg-error-50/30",active:"border-error-400 bg-error-50/40 ring-2 ring-error-400/20",iconColor:"text-error-500",titleHover:"group-hover:text-error-600",itemBg:"bg-transparent hover:bg-error-50/20",itemBorder:"border-transparent hover:border-error-200"},success:{idle:"border-transparent bg-transparent hover:bg-success-50/30",active:"border-success-400 bg-success-50/40 ring-2 ring-success-400/20",iconColor:"text-success-500",titleHover:"group-hover:text-success-600",itemBg:"bg-transparent hover:bg-success-50/20",itemBorder:"border-transparent hover:border-success-200"},warning:{idle:"border-transparent bg-transparent hover:bg-warning-50/30",active:"border-warning-400 bg-warning-50/40 ring-2 ring-warning-400/20",iconColor:"text-warning-500",titleHover:"group-hover:text-warning-600",itemBg:"bg-transparent hover:bg-warning-50/20",itemBorder:"border-transparent hover:border-warning-200"},info:{idle:"border-transparent bg-transparent hover:bg-info-50/30",active:"border-info-400 bg-info-50/40 ring-2 ring-info-400/20",iconColor:"text-info-500",titleHover:"group-hover:text-info-600",itemBg:"bg-transparent hover:bg-info-50/20",itemBorder:"border-transparent hover:border-info-200"}}},Gf={pdf:["pdf"],word:["doc","docx","dot","dotx","odt","rtf"],excel:["xls","xlsx","xlsm","xlsb","csv","ods"],powerpoint:["ppt","pptx","pot","potx","pps","ppsx","odp"],archive:["zip","rar","7z","tar","gz","bz2","xz","iso"],text:["txt","md","markdown","log"],image:["jpg","jpeg","png","gif","webp","svg","bmp","ico","tiff","avif"],audio:["mp3","wav","ogg","aac","flac","m4a","wma"],video:["mp4","webm","mov","avi","mkv","wmv","flv"],code:["js","jsx","ts","tsx","html","css","scss","json","py","java","c","cpp","cs","go","rs","php","sql","sh","yaml","yml","xml"],other:[]},jf={pdf:{label:"PDF",bg:"bg-error-50",text:"text-error-700",border:"border-error-200"},word:{label:"DOC",bg:"bg-primary-50",text:"text-primary-700",border:"border-primary-200"},excel:{label:"XLS",bg:"bg-success-50",text:"text-success-700",border:"border-success-200"},powerpoint:{label:"PPT",bg:"bg-secondary-50",text:"text-secondary-700",border:"border-secondary-200"},archive:{label:"ZIP",bg:"bg-warning-50",text:"text-warning-800",border:"border-warning-200"},text:{label:"TXT",bg:"bg-neutral-100",text:"text-neutral-700",border:"border-neutral-200"},image:{label:"IMG",bg:"bg-emerald-50",text:"text-emerald-700",border:"border-emerald-200"},audio:{label:"AUD",bg:"bg-purple-50",text:"text-purple-700",border:"border-purple-200"},video:{label:"VID",bg:"bg-cyan-50",text:"text-cyan-700",border:"border-cyan-200"},code:{label:"DEV",bg:"bg-slate-100",text:"text-slate-700",border:"border-slate-200"},other:{label:"FILE",bg:"bg-neutral-100",text:"text-neutral-600",border:"border-neutral-200"}};var Vs=["jpg","jpeg","png","gif","webp","svg","bmp","ico","tiff","avif"],As=["pdf"],Os=["mp4","webm","ogg","mov","avi","mkv"],Gs=["mp3","wav","ogg","aac","flac","m4a"],js=["doc","docx","xls","xlsx","ppt","pptx","txt","csv"];function $t(e){if(!e)return"";if(typeof e=="object"&&!(e instanceof Blob))return e.name?e.name:e.src?$t(e.src):"";if(e instanceof File)return e.name||"";if(typeof e=="string"){let t=e.split("?")[0]?.split("#")[0]||"",r=t.split("/").pop()||t.split("\\").pop()||"",o=r.lastIndexOf(".");return o<=0?r:r.slice(0,o)}return""}function $a(e=""){let t=e.split("?")[0]?.split("#")[0]||"",r=t.lastIndexOf(".");return r===-1?"":t.slice(r+1).toLowerCase()}function Mi(e=""){let t=$a(e);return Vs.includes(t)?"image":As.includes(t)?"pdf":Os.includes(t)?"video":Gs.includes(t)?"audio":js.includes(t)?"document":"other"}function hd(e){return!e||typeof e!="object"||e instanceof Blob||"height"in e&&"width"in e&&typeof e.height=="number"?!1:"src"in e||"name"in e||"id"in e}function Ho(e){if(!e)return{name:"file",type:"other",file:void 0,serverFile:void 0};if(typeof e=="string"){let o=$t(e)||"file";return{name:o,type:Mi(e),file:void 0,serverFile:{src:e,name:o}}}if(e instanceof File)return{name:$t(e.name),type:Mi(e.name),file:e,serverFile:void 0};let t=e.name??$t(e?.src),r="other";return e?.src?.startsWith("data:image/")?r="image":e?.src?.startsWith("data:video/")?r="video":e?.src?.startsWith("data:audio/")?r="audio":e?.src?.startsWith("data:application/pdf")?r="pdf":e?.name&&(r=Mi(e.name)),r==="other"&&e?.src&&(r=Mi(e.src)),{name:t,type:r,file:void 0,serverFile:e}}function xo(e,t){if(!e)return;let r=document.createElement("a");r.href=e;let o=e.split("?")[0]?.split("#")[0]||"",n=o.split("/").pop()||o.split("\\").pop()||"download";r.download=t||n,r.style.display="none",document.body.appendChild(r),r.click(),setTimeout(()=>{try{document.body.removeChild(r)}catch{}},100)}function xd(e){if(e){if(e instanceof File)return e.size;if(typeof e=="object"&&e!==null&&"size"in e){let t=e.size;if(typeof t=="number")return t}}}function vd(e){if(!e||typeof e!="object"||e instanceof File)return{status:"idle"};let t=e,r=typeof t.status=="string"?t.status:void 0,o=typeof t.progress=="number"?t.progress:void 0,n=typeof t.error=="string"?t.error:void 0,i="idle";return r==="uploading"||o!==void 0&&o>=0&&o<100?i="uploading":r==="error"||n?i="error":(r==="success"||r==="done"||o!==void 0&&o>=100)&&(i="success"),{status:i,progress:o,error:n}}function Us(e){if(!e)return"other";let t="",r="";typeof e=="string"?t=e:e instanceof File?(t=e.name,r=e.type):typeof e=="object"&&(t=e.name||(typeof e.src=="string"?e.src:""),typeof e.type=="string"&&(r=e.type));let o=$a(t);if(o){for(let[n,i]of Object.entries(Gf))if(i.includes(o))return n}if(r){if(r==="application/pdf")return"pdf";if(r.startsWith("image/"))return"image";if(r.startsWith("audio/"))return"audio";if(r.startsWith("video/"))return"video";if(r.includes("word")||r.includes("document")||r==="application/msword")return"word";if(r.includes("excel")||r.includes("spreadsheet")||r==="text/csv")return"excel";if(r.includes("presentation")||r.includes("powerpoint"))return"powerpoint";if(r.includes("zip")||r.includes("compressed")||r.includes("archive")||r==="application/x-tar")return"archive";if(r.startsWith("text/"))return"text"}return"other"}function Uf(e,t){return typeof e=="object"&&e&&"id"in e&&e.id!=null?String(e.id):e instanceof File?`${e.name}-${e.size}-${e.lastModified}-${t}`:typeof e=="string"?`${e}-${t}`:`${$t(e)}-${t}`}function Ys(e){if(!e)return;if(typeof e=="object")return e;let t={},r=e.split(",").map(n=>n.trim()).filter(Boolean),o={".pdf":"application/pdf",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".csv":"text/csv",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".zip":"application/zip",".rar":"application/vnd.rar",".7z":"application/x-7z-compressed",".tar":"application/x-tar",".gz":"application/gzip",".txt":"text/plain",".json":"application/json",".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".webp":"image/webp",".gif":"image/gif",".svg":"image/svg+xml",".mp3":"audio/mpeg",".wav":"audio/wav",".mp4":"video/mp4"};for(let n of r)if(n.startsWith(".")){let i=n.toLowerCase(),a=o[i]||"application/octet-stream";t[a]=[...t[a]||[],i]}else t[n]||(t[n]=[]);return t}var Rc=require("react");var kc=require("react"),yd=(0,kc.createContext)(null),Ws=()=>(0,kc.useContext)(yd);var Ks=require("react"),Yf=Ko(require("react-easy-crop"),1);var Zt=require("react/jsx-runtime");function La({zoom:e=1,minZoom:t=.2,maxZoom:r=5,step:o=.05,onZoomChange:n,sliderProps:i,onZoomIn:a,onZoomOut:s,onRotateCw:l,onRotateCcw:f,onFlipHorizontal:u,onReset:w,currentImage:g,tools:m,className:h=""}){let{zoomIn:b=!0,zoomOut:x=!0,zoomSlider:S=!0,reset:k=!0,rotate:v=!0,flip:p=!0,download:d=!0}=m??{},y=Math.round(e*100),c=()=>{g?.src&&xo(g.src,g.name)},T=N=>{if(typeof N=="number"){let D=Math.round(N*100)/100;n?.(D)}},R="p-2 rounded-full text-neutral-600 hover:text-neutral-900 hover:bg-neutral-100 active:scale-95 transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-500 cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed disabled:hover:bg-transparent";return(0,Zt.jsxs)("div",{"data-testid":"image-preview-toolbar",className:`inline-flex items-center gap-1 bg-neutral-white border border-neutral-200 rounded-full px-3 py-1.5 shadow-sm text-neutral-700 select-none pointer-events-auto ${h}`,children:[x&&(0,Zt.jsx)("button",{type:"button","aria-label":"Thu nh\u1ECF",title:"Thu nh\u1ECF (-)",disabled:e<=t,onClick:s,className:R,children:(0,Zt.jsx)(si,{width:18,height:18})}),S&&(0,Zt.jsx)("div",{className:"flex items-center px-1","data-testid":"image-preview-zoom-slider",children:(0,Zt.jsx)(la,{value:e,min:t,max:r,step:o,size:"sm",color:"primary",config:{isFullWidth:!1},className:"w-20 sm:w-28",disabled:!n&&!i?.onChange,onChange:T,"aria-label":"Thanh tr\u01B0\u1EE3t thu ph\xF3ng",...i})}),b&&(0,Zt.jsx)("button",{type:"button","aria-label":"Ph\xF3ng to",title:"Ph\xF3ng to (+)",disabled:e>=r,onClick:a,className:R,children:(0,Zt.jsx)(ai,{width:18,height:18})}),k&&(0,Zt.jsxs)("button",{type:"button","aria-label":"\u0110\u1EB7t l\u1EA1i k\xEDch th\u01B0\u1EDBc v\xE0 g\xF3c xoay",title:"\u0110\u1EB7t l\u1EA1i (1:1)",onClick:w,className:"px-2 py-1 text-xs font-semibold text-neutral-700 hover:text-neutral-900 hover:bg-neutral-100 rounded-full transition-colors cursor-pointer",children:[y,"%"]}),(v||p||d)&&(0,Zt.jsx)("div",{className:"w-px h-4 bg-neutral-200 my-auto mx-1"}),v&&(0,Zt.jsx)("button",{type:"button","aria-label":"Xoay ng\u01B0\u1EE3c chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",title:"Xoay ng\u01B0\u1EE3c chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",onClick:f,className:R,children:(0,Zt.jsx)(li,{width:18,height:18})}),v&&(0,Zt.jsx)("button",{type:"button","aria-label":"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",title:"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3 (r)",onClick:l,className:R,children:(0,Zt.jsx)(rn,{width:18,height:18})}),p&&(0,Zt.jsx)("button",{type:"button","aria-label":"L\u1EADt ngang",title:"L\u1EADt ngang",onClick:u,className:R,children:(0,Zt.jsx)(ci,{width:18,height:18})}),d&&(0,Zt.jsx)("button",{type:"button","aria-label":"T\u1EA3i \u1EA3nh xu\u1ED1ng",title:"T\u1EA3i \u1EA3nh xu\u1ED1ng",onClick:c,className:R,children:(0,Zt.jsx)(ao,{width:18,height:18})})]})}var Fi=require("react/jsx-runtime");function Ba({src:e,name:t,minZoom:r=.2,maxZoom:o=5,showToolbar:n=!0,toolbarProps:i,children:a}){let[s,l]=(0,Ks.useState)({x:0,y:0}),[f,u]=(0,Ks.useState)(1),[w,g]=(0,Ks.useState)(0),[m,h]=(0,Ks.useState)(!1),b=()=>u(y=>Math.min(o,Math.round((y+.25)*100)/100)),x=()=>u(y=>Math.max(r,Math.round((y-.25)*100)/100)),S=()=>g(y=>(y+90)%360),k=()=>g(y=>(y-90+360)%360),v=()=>h(y=>!y),p=()=>{l({x:0,y:0}),u(1),g(0),h(!1)},d={src:e,name:t};return e?(0,Fi.jsxs)("div",{className:"flex flex-col w-full select-none overflow-hidden",children:[(0,Fi.jsx)("div",{className:"relative w-full h-90 sm:h-105 md:h-115 overflow-hidden bg-neutral-50/70 select-none",children:(0,Fi.jsx)(Yf.default,{image:e,crop:s,zoom:f,rotation:w,minZoom:r,maxZoom:o,zoomSpeed:.5,restrictPosition:!1,showGrid:!1,objectFit:"contain",onCropChange:l,onZoomChange:u,onRotationChange:g,classes:{mediaClassName:m?"scale-x-[-1]":""},style:{containerStyle:{position:"relative",width:"100%",height:"100%",backgroundColor:"transparent"},cropAreaStyle:{display:"none"},mediaStyle:{cursor:"grab"}}})}),n&&(0,Fi.jsx)("div",{className:"w-full flex items-center justify-center py-2.5 sm:py-3 border-t border-neutral-200 bg-neutral-white z-20 overflow-x-auto ui-scrollbar px-2 shrink-0",children:(0,Fi.jsx)(La,{zoom:f,minZoom:r,maxZoom:o,onZoomChange:u,rotation:w,isFlipped:m,onZoomIn:b,onZoomOut:x,onRotateCw:S,onRotateCcw:k,onFlipHorizontal:v,onReset:p,currentImage:d,...i})}),a]}):null}var vo=require("react/jsx-runtime");function Vo({onDownload:e,imageProps:t,className:r=""}){let o=Ws(),n=o?.file,i=o?.headerTitle,[a,s]=(0,Rc.useState)("");(0,Rc.useEffect)(()=>{if(!n){s("");return}if(!(n instanceof File)){let g=Ho(n);s(g.serverFile?.src||"");return}let w=URL.createObjectURL(n);return s(w),()=>{URL.revokeObjectURL(w)}},[n]);let l=Ho(n),f=(typeof i=="string"?i:"")||l.name||"file",u=()=>{e&&n&&e(n),a&&xo(a,f)};return l.type==="image"?(0,vo.jsx)(Ba,{src:a,name:f,...t}):(0,vo.jsxs)("div",{className:`p-6 text-center ${r}`,children:[(0,vo.jsx)("div",{className:"w-16 h-16 rounded-2xl bg-neutral-100 flex items-center justify-center mx-auto mb-4 text-primary-600",children:(0,vo.jsx)(ao,{width:32,height:32})}),(0,vo.jsx)("h3",{className:"text-lg font-semibold text-neutral-900 truncate mb-1",title:f,children:i??f}),(0,vo.jsx)("p",{className:"text-sm text-neutral-500 mb-6",children:"\u0110\u1ECBnh d\u1EA1ng file ch\u01B0a h\u1ED7 tr\u1EE3 xem tr\u1EF1c ti\u1EBFp. B\u1EA1n c\xF3 th\u1EC3 t\u1EA3i file v\u1EC1 \u0111\u1EC3 xem."}),(0,vo.jsxs)("button",{type:"button",onClick:u,className:"inline-flex items-center justify-center gap-2 w-full py-2.5 px-4 bg-primary-600 hover:bg-primary-500 text-white font-medium rounded-xl transition-colors shadow-md cursor-pointer",children:[(0,vo.jsx)(ao,{width:18,height:18}),(0,vo.jsx)("span",{children:"T\u1EA3i xu\u1ED1ng file"})]})]})}var qf=require("react");var Wf=250,Un={xs:{dialog:"max-w-[320px] p-3 gap-1.5",header:"gap-1.5",body:"text-xs",footer:"gap-1.5 pt-1.5",title:"text-sm font-semibold leading-tight text-neutral-900",description:"text-xs leading-normal text-neutral-600",buttonGap:"gap-1.5",closeButton:"size-5 p-0.5 -mr-1 -mt-1",closeIcon:"size-3.5"},sm:{dialog:"max-w-[400px] p-3.5 gap-2",header:"gap-2",body:"text-sm",footer:"gap-2 pt-2",title:"text-base font-semibold leading-tight text-neutral-900",description:"text-sm leading-normal text-neutral-600",buttonGap:"gap-2",closeButton:"size-6 p-0.5 -mr-1 -mt-1",closeIcon:"size-4"},md:{dialog:"max-w-[540px] p-4 gap-2.5",header:"gap-2.5",body:"text-sm",footer:"gap-2 pt-2",title:"text-lg font-semibold leading-tight text-neutral-900",description:"text-sm leading-relaxed text-neutral-600",buttonGap:"gap-2.5",closeButton:"size-7 p-1 -mr-1 -mt-1",closeIcon:"size-4"},lg:{dialog:"max-w-[720px] p-4.5 gap-3",header:"gap-3",body:"text-base",footer:"gap-2.5 pt-2.5",title:"text-xl font-bold leading-snug text-neutral-900",description:"text-base leading-relaxed text-neutral-600",buttonGap:"gap-3",closeButton:"size-8 p-1 -mr-1 -mt-1",closeIcon:"size-4.5"},xl:{dialog:"max-w-[960px] p-5 gap-3.5",header:"gap-3.5",body:"text-base",footer:"gap-3 pt-3",title:"text-2xl font-bold leading-snug text-neutral-900",description:"text-base leading-relaxed text-neutral-600",buttonGap:"gap-3.5",closeButton:"size-8 p-1 -mr-1 -mt-1",closeIcon:"size-5"},full:{dialog:"max-w-[calc(100vw-2rem)] w-full h-[calc(100vh-2rem)] p-4 gap-2.5",header:"gap-2.5",body:"text-base",footer:"gap-2 pt-2",title:"text-2xl font-bold leading-snug text-neutral-900",description:"text-base leading-relaxed text-neutral-600",buttonGap:"gap-2.5",closeButton:"size-8 p-1 -mr-1 -mt-1",closeIcon:"size-4.5"}},Kf={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"};var _f=require("react/jsx-runtime");function Yn({size:e,radius:t,className:r="",children:o,ref:n,...i}){let a=tt(),s=C(e??a?.size,Un,"md"),l=C(t,Kf,"lg"),f=["relative flex flex-col w-full bg-neutral-white shadow-2xl border-2 border-neutral-200 outline-none text-neutral-900 pointer-events-auto",s.dialog,l,r].filter(Boolean).join(" ");return(0,_f.jsx)("div",{ref:n,tabIndex:-1,className:f,...i,children:o})}var lr=require("react");var Ei=require("react/jsx-runtime");function Wn({open:e=!1,id:t,size:r,isLoading:o=!1,closeOnOverlayClick:n=!0,closeOnEsc:i=!0,lockScroll:a=!0,overlayClassName:s="",className:l="",toaster:f=!0,children:u,onClose:w,...g}){let m=(0,lr.useRef)(null),[h,b]=(0,lr.useState)(!1),x=(0,lr.useRef)(null),S=(0,lr.useCallback)(()=>{h||o||(b(!0),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{b(!1),w?.()},Wf))},[h,o,w]),k=(0,lr.useMemo)(()=>({onClose:S,isLoading:o,size:r,dialogRef:m}),[S,o,r]);(0,lr.useEffect)(()=>()=>{x.current&&clearTimeout(x.current)},[]),(0,lr.useEffect)(()=>{let c=m.current;if(c)if(e||h){if(!c.open)try{c.showModal()}catch{}}else c.open&&c.close()},[e,h]),(0,lr.useEffect)(()=>{if(!a)return;let c=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=c}},[a]);let v=(0,lr.useEffectEvent)(c=>{!e||i===!1||c.key==="Escape"&&(c.preventDefault(),c.stopPropagation(),S())});if((0,lr.useEffect)(()=>(window.addEventListener("keydown",v),()=>{window.removeEventListener("keydown",v)}),[]),!e&&!h)return null;let p=()=>{n&&S()},d=h?"animate-modal-backdrop-out pointer-events-none":"animate-modal-backdrop-in",y=h?"animate-modal-out pointer-events-none":"animate-modal-in";return(0,Ei.jsx)($u.Provider,{value:k,children:(0,Ei.jsxs)("dialog",{id:t,ref:m,"aria-labelledby":"modal-dialog-title","aria-describedby":"modal-dialog-description",onCancel:c=>{c.preventDefault(),i!==!1&&S()},className:`fixed inset-0 flex items-center justify-center p-4 bg-neutral-950/40 backdrop-blur-xs border-none m-0 max-w-none max-h-none w-screen h-screen overflow-visible backdrop:bg-transparent ${d} ${s}`,...g,children:[f!==!1&&(0,Ei.jsx)(Rn,{position:"top-right",...typeof f=="object"?f:{}}),(0,Ei.jsx)("div",{"aria-hidden":"true",onClick:p,className:"fixed inset-0 -z-10"}),(0,Ei.jsx)("div",{className:`w-full flex items-center justify-center pointer-events-none ${y} ${l}`,children:u})]})})}var Kn=require("react/jsx-runtime");function _n({size:e,title:t,description:r,titleClassName:o="",descriptionClassName:n="",showCloseButton:i=!0,onClose:a,closeButtonClassName:s="",className:l="",children:f,...u}){let w=tt(),g=C(e??w?.size,Un,"md"),m=w?.isLoading,h=()=>{a?.(),w?.onClose?.()},b=!!(a||w?.onClose);return(0,Kn.jsxs)("div",{className:`flex items-start justify-between w-full border-b border-neutral-100 pb-2 ${g.header} ${l}`,...u,children:[(0,Kn.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[t&&(0,Kn.jsx)("h3",{id:"modal-dialog-title",className:`${g.title} truncate ${o}`,children:t}),r&&(0,Kn.jsx)("p",{id:"modal-dialog-description",className:`${g.description} mt-0.5 ${n}`,children:r}),f]}),i&&b&&(0,Kn.jsx)("button",{type:"button",onClick:h,disabled:m,"aria-label":"\u0110\xF3ng h\u1ED9p tho\u1EA1i","data-testid":"modal-close-button",className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-700 hover:bg-neutral-100 rounded-md transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-neutral-400 ${g.closeButton} ${s}`,children:(0,Kn.jsx)(Ue,{className:g.closeIcon})})]})}var Xf=require("react/jsx-runtime");function Xn({size:e,className:t="",children:r,...o}){let n=tt(),i=C(e??n?.size,Un,"md");return(0,Xf.jsx)("div",{className:`w-full max-h-[calc(100vh-8rem)] overflow-y-auto ui-scrollbar ${i.body} ${t}`,...o,children:r})}var qn=require("react/jsx-runtime");function ro({open:e=!1,onClose:t,file:r,title:o,description:n,size:i="lg",radius:a="xl",showCloseButton:s=!0,closeOnOverlayClick:l=!0,closeOnEsc:f=!0,lockScroll:u=!0,className:w="",overlayClassName:g="",children:m}){let h=Ho(r),b=o??h?.name,x=(0,qf.useMemo)(()=>({file:r,headerTitle:b}),[r,b]);return(0,qn.jsx)(Wn,{open:e,onClose:t,size:i,closeOnOverlayClick:l,closeOnEsc:f,lockScroll:u,overlayClassName:g,children:(0,qn.jsxs)(Yn,{size:i,radius:a,"data-testid":"image-preview-modal",className:`bg-neutral-white border border-neutral-200 text-neutral-900 shadow-2xl overflow-hidden p-0 ${w}`,children:[(b||s)&&(0,qn.jsx)(_n,{title:b,description:n,showCloseButton:s,className:"px-5 py-3.5 border-b border-neutral-200 shrink-0"}),(0,qn.jsx)(Xn,{className:"p-0 overflow-hidden flex flex-col flex-1 min-h-0",children:(0,qn.jsx)(yd.Provider,{value:x,children:m||(0,qn.jsx)(Vo,{})})})]})})}var Ao=require("react"),ep=Ko(require("next/image"),1);var Zf={pulse:"animate-pulse",wave:"skeleton-wave",none:""},Nc={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Jf={cover:"object-cover",contain:"object-contain",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"};var $i=e=>e,Qf=e=>e?typeof e=="string"?e:typeof File<"u"&&e instanceof File?`${e.name}-${e.size}-${e.lastModified}`:typeof Blob<"u"&&e instanceof Blob?`${e.size}-${e.type}`:typeof e=="object"&&"src"in e&&typeof e.src=="string"?e.src:e:"";var Dc=require("react/jsx-runtime");function Zn({ref:e,variant:t="pulse",shape:r="rectangle",radius:o="md",width:n,height:i="1rem",lines:a=1,gap:s="0.5rem",className:l="",style:f,...u}){let w=C(t,Zf,"pulse"),g=r==="circle"?"rounded-full":C(o,Nc,"md"),m={width:$i(n),height:$i(i),...f},h=["bg-neutral-200",w,g].filter(Boolean).join(" ");return a>1?(0,Dc.jsx)("div",{ref:e,role:"status","aria-label":"Loading...",className:["flex flex-col",l].filter(Boolean).join(" "),style:{gap:$i(s),...f},...u,children:Array.from({length:a}).map((b,x)=>{let S=x===a-1;return(0,Dc.jsx)("div",{className:h,style:{width:S?"60%":$i(n)??"100%",height:$i(i)}},x)})}):(0,Dc.jsx)("div",{ref:e,role:"status","aria-label":"Loading...",className:[h,l].filter(Boolean).join(" "),style:m,...u})}var oo=require("react/jsx-runtime");function Oo({src:e,alt:t="",width:r,height:o,fill:n,skeletonVariant:i="pulse",radius:a="md",objectFit:s="cover",preview:l=!0,className:f="",wrapperClassName:u="",style:w,wrapperStyle:g,onLoad:m,onError:h,onClick:b,ref:x,...S}){let[k,v]=(0,Ao.useState)(!1),[p,d]=(0,Ao.useState)(!1),[y,c]=(0,Ao.useState)(null),[T,R]=(0,Ao.useState)(!1),N=Qf(e),[D,M]=(0,Ao.useState)(N),F=typeof Blob<"u"&&(e instanceof File||e instanceof Blob),P=hd(e)?e:void 0,I=P?.src,z=F?y:P?I:e,B=F||!!P||typeof z=="string"&&(/^(?:https?:)?\/\//.test(z)||z.startsWith("data:")||z.startsWith("blob:")),V=t||P?.name||"";N!==D&&(M(N),v(!1),d(!1)),(0,Ao.useEffect)(()=>{if(!(e instanceof File||e instanceof Blob)){c(null);return}let X=URL.createObjectURL(e);return c(X),()=>URL.revokeObjectURL(X)},[e]);let Y=(0,Ao.useMemo)(()=>{if(z)return e instanceof File?e:P?{...P,src:P.src,name:V||"image",type:"image"}:{src:typeof z=="string"?z:z?.src,name:V||"image",type:"image"}},[e,z,P,V]),L=C(a,Nc,"md"),E=C(s,Jf,"cover"),O=X=>{v(!0),m?.(X)},A=X=>{d(!0),v(!1),h?.(X)},U=X=>{b?.(X),!X.defaultPrevented&&l&&k&&!p&&Y&&R(!0)},G=!!(l&&k&&!p||b),K=X=>{(X.key==="Enter"||X.key===" ")&&(X.preventDefault(),U(X))},q={...n?{}:{width:r,height:o},...g};return(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsxs)("div",{ref:x,role:G?"button":void 0,tabIndex:G?0:void 0,onClick:U,onKeyDown:K,className:["relative overflow-hidden inline-block",L,G?"cursor-pointer":"",u].filter(Boolean).join(" "),style:q,children:[!k&&!p&&(0,oo.jsx)(Zn,{variant:i,radius:a,width:"100%",height:"100%",style:{position:"absolute",inset:0}}),z?(0,oo.jsx)(ep.default,{src:z,alt:V,width:n?void 0:r,height:n?void 0:o,fill:n,unoptimized:B?!0:S.unoptimized,className:["block w-full h-full transition-opacity duration-200",E,L,k?"opacity-100":"opacity-0",f].filter(Boolean).join(" "),style:w,onLoad:O,onError:A,...S}):null,p&&(0,oo.jsx)("div",{role:"img","aria-label":"Image failed to load",className:["absolute inset-0 flex items-center justify-center","bg-neutral-100 text-neutral-400"].join(" "),children:(0,oo.jsx)(ls,{width:24,height:24,"aria-hidden":"true"})})]}),T&&Y&&(0,oo.jsx)(ro,{open:T,onClose:()=>R(!1),file:Y,title:V||"Xem \u1EA3nh",children:(0,oo.jsx)(Vo,{})})]})}var xt=require("react/jsx-runtime");function Ha({size:e="md",color:t="primary",variant:r="outline",radius:o,shape:n="rectangle",objectFit:i="contain",disabled:a,readOnly:s,isLoading:l,dragStatus:f="idle",isInvalid:u,dropzoneTitle:w,dropzoneDescription:g,icon:m,item:h,onRemove:b,onPreview:x,onTriggerUpload:S,getRootProps:k,className:v="",describedById:p}){let d=C(e,Ea,"md"),y=C(o,Sc,"md"),c=n==="square"?"aspect-square w-full":C(e,Bf,"md"),T=u?"error":t,R=r!=="other"?C(r,Hf,"outline"):null,N=R?C(T,R,"primary"):null,D="K\xE9o th\u1EA3 h\xECnh \u1EA3nh v\xE0o \u0111\xE2y, ho\u1EB7c nh\u1EA5n \u0111\u1EC3 duy\u1EC7t file",M="H\u1ED7 tr\u1EE3 \u0111\u1ECBnh d\u1EA1ng PNG, JPG, WEBP, GIF",F=f==="active",P=f==="reject",I=F,z=P?"border-error-500 bg-error-50/50 ring-2 ring-error-500/20 text-error-900":I?N?.active||"border-primary-500 bg-primary-50 ring-2 ring-primary-500/20":N?.idle||"border-neutral-300 bg-neutral-50/50 hover:border-primary-500 hover:bg-primary-50/30",B=h?`group relative w-full ${c} ${y} overflow-hidden border-2 transition-colors duration-150 ease-in-out cursor-pointer select-none ${I?"border-dashed "+z:"border-solid border-neutral-200 hover:border-primary-400"} ${a?"opacity-50 cursor-not-allowed pointer-events-none":""} focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${v}`:`group relative w-full ${n==="square"?"aspect-square w-full":d.dropzoneHeight} ${d.dropzonePadding} ${y} border-2 border-dashed flex flex-col items-center justify-center text-center transition-colors duration-150 ease-in-out cursor-pointer ${z} ${a?"opacity-50 cursor-not-allowed pointer-events-none bg-neutral-100":""} focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${v}`,V=$t(h),Y={role:"button",tabIndex:a?-1:0,"aria-label":h?`H\xECnh \u1EA3nh \u0111\xE3 t\u1EA3i l\xEAn: ${V}. Nh\u1EA5n \u0111\u1EC3 xem tr\u01B0\u1EDBc, ho\u1EB7c d\xF9ng n\xFAt \u1EDF g\xF3c ph\u1EA3i \u0111\u1EC3 thay \u0111\u1ED5i ho\u1EB7c x\xF3a \u1EA3nh.`:"Khu v\u1EF1c k\xE9o th\u1EA3 v\xE0 t\u1EA3i \u1EA3nh l\xEAn","aria-disabled":a,"aria-invalid":u,"aria-describedby":p,"aria-busy":l,className:B,onClick:()=>{a||l||h&&x?.()},onKeyDown:E=>{a||l||(E.key==="Enter"||E.key===" ")&&h&&(E.preventDefault(),x?.())}},L=k?k(Y):Y;return(0,xt.jsx)("div",{...L,children:h?(0,xt.jsxs)(xt.Fragment,{children:[(0,xt.jsx)(Oo,{src:h,alt:V,fill:!0,radius:o??"md",objectFit:i,preview:!1,wrapperClassName:"w-full h-full"}),!l&&!a&&(0,xt.jsxs)("div",{className:"absolute top-2.5 right-2.5 flex items-center gap-1.5 z-10",children:[!s&&(0,xt.jsx)("button",{type:"button",onClick:E=>{E.stopPropagation(),S?.()},"aria-label":"Thay \u0111\u1ED5i \u1EA3nh",title:"Thay \u0111\u1ED5i \u1EA3nh",className:"p-1.5 rounded-lg bg-neutral-900/60 hover:bg-neutral-900/80 text-neutral-white backdrop-blur-xs transition-colors shadow-xs cursor-pointer focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden","data-testid":"dropzone-replace-button",children:(0,xt.jsx)(Tr,{width:16,height:16})}),!s&&(0,xt.jsx)("button",{type:"button",onClick:E=>{E.stopPropagation(),b?.()},"aria-label":"X\xF3a \u1EA3nh",title:"X\xF3a \u1EA3nh",className:"p-1.5 rounded-lg bg-neutral-900/60 hover:bg-error-600 text-neutral-white backdrop-blur-xs transition-colors shadow-xs cursor-pointer focus-visible:ring-2 focus-visible:ring-error-500 focus-visible:outline-hidden","data-testid":"dropzone-remove-button",children:(0,xt.jsx)(Wr,{width:16,height:16})})]}),l&&(0,xt.jsxs)("div",{className:"absolute inset-0 bg-neutral-950/60 flex flex-col items-center justify-center text-neutral-white z-20",children:[(0,xt.jsx)(Re,{width:d.iconSize*.8,height:d.iconSize*.8,className:"animate-spin"}),(0,xt.jsx)("span",{className:`${d.titleSize} font-medium mt-1`,children:"\u0110ang x\u1EED l\xFD h\xECnh \u1EA3nh..."})]}),I&&(0,xt.jsxs)("div",{className:"absolute inset-0 bg-primary-950/50 backdrop-blur-xs flex flex-col items-center justify-center text-neutral-white z-20 transition-opacity",children:[(0,xt.jsx)(mr,{width:d.iconSize,height:d.iconSize,className:"animate-bounce"}),(0,xt.jsx)("span",{className:`${d.titleSize} font-medium mt-1`,children:"Th\u1EA3 h\xECnh \u1EA3nh \u0111\u1EC3 thay th\u1EBF"})]})]}):l?(0,xt.jsxs)("div",{className:`flex flex-col items-center justify-center gap-2 ${N?.iconColor||"text-primary-600"}`,children:[(0,xt.jsx)(Re,{width:d.iconSize*.8,height:d.iconSize*.8}),(0,xt.jsx)("span",{className:`${d.titleSize} font-medium`,children:"\u0110ang x\u1EED l\xFD h\xECnh \u1EA3nh..."})]}):(0,xt.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2",children:[(0,xt.jsx)("div",{className:`transition-colors ${N?.iconColor||"text-primary-500"}`,children:m||(0,xt.jsx)(mr,{width:d.iconSize,height:d.iconSize})}),(0,xt.jsx)("div",{className:`${d.titleSize} font-medium text-neutral-800 ${N?.titleHover||"group-hover:text-primary-600"} transition-colors`,children:w??D}),(0,xt.jsx)("div",{id:p,className:`${d.descSize} text-neutral-500`,children:g??M})]})})}var zr=require("react/jsx-runtime");function Jn({items:e,size:t,radius:r,objectFit:o="cover",disabled:n,readOnly:i,maxCount:a,onRemove:s,onPreview:l,onTriggerUpload:f,renderItem:u,showAddButton:w=!0,className:g=""}){let m=C(t,Ea,"md"),h=C(r,Sc,"md"),b=!a||e.length<a;return(0,zr.jsxs)("ul",{"aria-label":"Danh s\xE1ch h\xECnh \u1EA3nh \u0111\xE3 t\u1EA3i l\xEAn",className:`flex flex-wrap items-center list-none p-0 m-0 ${m.gap} ${g}`,children:[e.map((x,S)=>{let k=$t(x),v=typeof x=="object"&&x&&"id"in x&&x.id?String(x.id):x instanceof File?`${x.name}-${x.size}-${x.lastModified}`:typeof x=="string"?x:x?.src||k;return u?(0,zr.jsx)("li",{"data-testid":"upload-image-item",className:"list-none",children:u(x,S,{remove:()=>s(x,S),preview:()=>l(x)})},v):(0,zr.jsxs)("li",{"data-testid":"upload-image-item",tabIndex:n?-1:0,"aria-label":`H\xECnh \u1EA3nh ${k}`,onKeyDown:p=>{n||i||(p.key==="Delete"||p.key==="Backspace")&&(p.preventDefault(),s(x,S))},className:`group relative list-none ${m.thumbnailSize} ${h} border-2 overflow-hidden flex items-center justify-center bg-neutral-100 border-neutral-200 transition-colors duration-150 ease-in-out focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden`,children:[(0,zr.jsx)(Oo,{src:x,alt:k,width:80,height:80,radius:r,objectFit:o,unoptimized:!0,preview:!1,className:"w-full h-full",wrapperClassName:"w-full h-full"}),!n&&(0,zr.jsxs)("div",{className:"absolute inset-0 bg-neutral-900/40 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity duration-150 flex items-center justify-center gap-1.5 p-1",children:[l&&(0,zr.jsx)("button",{type:"button",onClick:p=>{p.stopPropagation(),l(x)},"aria-label":`Preview image ${k}`,title:"Xem tr\u01B0\u1EDBc",className:"p-1 rounded-md text-neutral-white hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-primary-400 focus-visible:outline-hidden transition-colors cursor-pointer",children:(0,zr.jsx)(_o,{width:16,height:16})}),!i&&(0,zr.jsx)("button",{type:"button",onClick:p=>{p.stopPropagation(),s(x,S)},"aria-label":`Remove image ${k}`,title:"X\xF3a \u1EA3nh",className:"p-1 rounded-md text-error-300 hover:text-error-200 hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-error-400 focus-visible:outline-hidden transition-colors cursor-pointer",children:(0,zr.jsx)(Wr,{width:16,height:16})})]})]},v)}),w&&b&&!i&&(0,zr.jsx)("li",{className:"list-none",children:(0,zr.jsx)("button",{type:"button",disabled:n,onClick:f,"aria-label":"Add image",title:"Th\xEAm h\xECnh \u1EA3nh",className:`${m.thumbnailSize} ${h} border-2 border-dashed border-neutral-300 hover:border-primary-500 hover:bg-primary-50/40 text-neutral-400 hover:text-primary-600 flex flex-col items-center justify-center transition-colors duration-150 ease-in-out cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden`,children:(0,zr.jsx)(no,{width:m.iconSize*.5,height:m.iconSize*.5})})})]})}var Lt=require("react/jsx-runtime");function Pc({value:e,defaultValue:t,onChange:r,onRemove:o,onPreview:n,multiple:i=!1,maxCount:a,maxSize:s,accept:l="image/*",beforeUpload:f,viewMode:u="dropzone",shape:w="rectangle",objectFit:g,size:m="md",color:h="primary",variant:b="outline",radius:x,label:S,isRequired:k=!1,labelClassName:v="",helperText:p,errorMessage:d,isInvalid:y,disabled:c=!1,readOnly:T=!1,isLoading:R=!1,dropzoneTitle:N,dropzoneDescription:D,icon:M,buttonText:F="T\u1EA3i \u1EA3nh l\xEAn",renderItem:P,className:I="",dropzoneClassName:z="",previewClassName:B="",helperClassName:V=""}){let Y=(0,Go.useId)(),L=`${Y}-input`,E=`${Y}-error-helper`,O=e!==void 0,[A,U]=(0,Go.useState)(()=>Ii(t)),G=(0,Go.useMemo)(()=>O?Ii(e):A,[O,e,A]),[K,q]=(0,Go.useState)(null),[X,fe]=(0,Go.useState)(null),[ae,_]=(0,Go.useState)(""),Z=C(m,Ea,"md"),he=x??"md",xe=!!(y||d||K),$=d||K,ee=xe?"text-error-600":C(xe?"error":h,Lf,"primary"),de=a??(i?void 0:1),ne=!i||de===1,ze=ne&&G.length===1?G[0]:null,ve=pe=>{O||U(pe),r?.(pe)},Ce=(0,Go.useMemo)(()=>Ys(l),[l]),J=u==="dropzone"&&!!ze,{getRootProps:j,getInputProps:oe,isDragActive:ye,isDragReject:ue,open:ce}=(0,tp.useDropzone)({multiple:i,maxSize:s,accept:Ce,disabled:c||T||R,noClick:u!=="dropzone"||J,noKeyboard:u!=="dropzone"||J,onDropAccepted:async pe=>{if(c||T||(q(null),pe.length===0))return;let W=pe,me=G.length;if(de!==void 0)if(i){let H=de-me;if(H<=0){let se=`Maximum allowed image count reached (${de} images)`;q(se),_(se);return}W=pe.slice(0,H)}else{let H=pe[0];if(!H)return;W=[H]}let De=await Promise.all(W.map(async H=>{if(f)try{let se=await f(H);if(se===!1||typeof se=="string")return{file:null,error:typeof se=="string"?se:`File ${H.name} was rejected`}}catch(se){return{file:null,error:se instanceof Error?se.message:`Kh\xF4ng th\u1EC3 x\u1EED l\xFD t\u1EC7p ${H.name}`}}return{file:H,error:null}})),ie=[];for(let H of De)H.error?(q(H.error),_(`L\u1ED7i: ${H.error}`)):H.file&&ie.push(H.file);if(ie.length>0){let H=i?[...G,...ie]:ie;ve(H),_(`T\u1EA3i l\xEAn th\xE0nh c\xF4ng ${ie.length} h\xECnh \u1EA3nh. T\u1ED5ng c\u1ED9ng: ${H.length}.`)}},onDropRejected:pe=>{let W=pe[0]?.errors[0];if(!W)return;let me=W.message||"T\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7";W.code==="file-too-large"?me=`K\xEDch th\u01B0\u1EDBc t\u1EC7p v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n t\u1ED1i \u0111a (${ho(s||0)})`:W.code==="file-invalid-type"?me=`\u0110\u1ECBnh d\u1EA1ng t\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7. C\xE1c \u0111\u1ECBnh d\u1EA1ng \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3: ${typeof l=="string"?l:Object.keys(l||{}).join(", ")}`:W.code==="too-many-files"&&(me=`S\u1ED1 l\u01B0\u1EE3ng h\xECnh \u1EA3nh v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n cho ph\xE9p (${de} h\xECnh \u1EA3nh)`),q(me),_(`L\u1ED7i t\u1EC7p: ${me}`)}}),ke=(pe,W)=>{if(c||T)return;let me=G.filter((De,ie)=>ie!==W);ve(me),o?.(pe,W),_(`\u0110\xE3 x\xF3a h\xECnh \u1EA3nh ${$t(pe)}`)},Te=pe=>{fe(pe),n?.(pe)};return(0,Lt.jsxs)("div",{className:`group/field relative flex flex-col w-full ${I}`,children:[(0,Lt.jsx)("input",{...oe({id:L,disabled:c||R,"aria-hidden":!0,tabIndex:-1,className:"hidden"})}),(0,Lt.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:ae}),S&&(0,Lt.jsxs)("label",{htmlFor:L,className:`block font-medium transition-colors duration-150 ${Z.labelSize} ${ee} ${v}`,children:[S,k&&(0,Lt.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),(0,Lt.jsxs)("div",{className:"flex flex-col gap-3",children:[u==="dropzone"&&(0,Lt.jsxs)(Lt.Fragment,{children:[(0,Lt.jsx)(Ha,{size:m,color:h,variant:b,radius:he,shape:w,objectFit:g,disabled:c,readOnly:T,isLoading:R,dragStatus:ue?"reject":ye?"active":"idle",isInvalid:xe,dropzoneTitle:N,dropzoneDescription:D,icon:M,item:ze,onRemove:()=>ze&&ke(ze,0),onPreview:()=>ze&&Te(ze),getRootProps:j,onTriggerUpload:ce,className:z,describedById:$||p?E:void 0}),!ne&&G.length>0&&(0,Lt.jsx)(Jn,{items:G,size:m,color:h,variant:b,radius:he,objectFit:g,disabled:c,readOnly:T,maxCount:de,onRemove:ke,onPreview:Te,onTriggerUpload:ce,renderItem:P,showAddButton:!1,className:B})]}),u==="card-grid"&&(0,Lt.jsx)("div",{...j({className:"w-full focus-visible:outline-hidden"}),children:(0,Lt.jsx)(Jn,{items:G,size:m,color:h,variant:b,radius:he,objectFit:g,disabled:c,readOnly:T,maxCount:de,onRemove:ke,onPreview:Te,onTriggerUpload:ce,renderItem:P,showAddButton:!0,className:B})}),u==="button"&&(0,Lt.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,Lt.jsx)("div",{className:"flex items-center gap-3",children:(0,Lt.jsx)(Ir,{type:"button",size:m,color:xe?"error":h==="neutral"?"secondary":h,variant:b==="other"?"filled":b,radius:x,disabled:c||T||de!==void 0&&G.length>=de,onClick:ce,leftIcon:(0,Lt.jsx)(mr,{width:Z.iconSize*.5,height:Z.iconSize*.5}),"aria-label":"T\u1EA3i \u1EA3nh l\xEAn",children:F})}),G.length>0&&(0,Lt.jsx)(Jn,{items:G,size:m,color:h,variant:b,radius:he,objectFit:g,disabled:c,readOnly:T,maxCount:de,onRemove:ke,onPreview:Te,onTriggerUpload:ce,renderItem:P,showAddButton:!1,className:B})]})]}),(0,Lt.jsx)(Ae,{id:E,helperText:p,errorMessage:xe?$:void 0,sizeClassName:Z.helperSize,className:V}),X&&(0,Lt.jsx)(ro,{open:!!X,onClose:()=>fe(null),file:X})]})}var jo=require("react"),pp=require("react-dropzone"),mp=require("@floating-ui/react");var rp={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},op={xs:{avatarSize:"size-12",iconSize:20,iconClass:"size-5",label:"text-[11px] mb-1",helper:"text-[9px] mt-0.5",rounded:"rounded"},sm:{avatarSize:"size-16",iconSize:24,iconClass:"size-6",label:"text-xs mb-1",helper:"text-[10px] mt-0.5",rounded:"rounded-md"},md:{avatarSize:"size-20",iconSize:32,iconClass:"size-8",label:"text-sm mb-1.5",helper:"text-[11px] mt-1",rounded:"rounded-lg"},lg:{avatarSize:"size-24",iconSize:40,iconClass:"size-10",label:"text-base mb-1.5",helper:"text-xs mt-1",rounded:"rounded-xl"},xl:{avatarSize:"size-32",iconSize:52,iconClass:"size-12",label:"text-lg mb-2",helper:"text-sm mt-1",rounded:"rounded-2xl"}},np={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"}},ip={primary:"text-primary-500 group-hover/avatar:text-primary-600",secondary:"text-secondary-500 group-hover/avatar:text-secondary-600",neutral:"text-neutral-400 group-hover/avatar:text-neutral-600",error:"text-error-500 group-hover/avatar:text-error-600",success:"text-success-500 group-hover/avatar:text-success-600",warning:"text-warning-500 group-hover/avatar:text-warning-600",info:"text-info-500 group-hover/avatar:text-info-600"},ap={primary:"text-primary-500 group-focus-within/field:text-primary-600",secondary:"text-secondary-500 group-focus-within/field:text-secondary-600",error:"text-error-500 group-focus-within/field:text-error-600",success:"text-success-500 group-focus-within/field:text-success-600",warning:"text-warning-500 group-focus-within/field:text-warning-600",info:"text-info-500 group-focus-within/field:text-info-600",neutral:"text-neutral-500 group-focus-within/field:text-neutral-600"},sp={primary:"ring-2 ring-primary-500/40 border-primary-500 bg-primary-50/80",secondary:"ring-2 ring-secondary-500/40 border-secondary-500 bg-secondary-50/80",neutral:"ring-2 ring-neutral-500/40 border-neutral-500 bg-neutral-50/80",error:"ring-2 ring-error-500/40 border-error-500 bg-error-50/80",success:"ring-2 ring-success-500/40 border-success-500 bg-success-50/80",warning:"ring-2 ring-warning-500/40 border-warning-500 bg-warning-50/80",info:"ring-2 ring-info-500/40 border-info-500 bg-info-50/80"};function lp(e){if(!e)return;if(typeof e=="object")return e;let t={},r=e.split(",").map(o=>o.trim()).filter(Boolean);for(let o of r)if(o.startsWith(".")){let n=o.toLowerCase();n===".jpg"||n===".jpeg"?t["image/jpeg"]=[...t["image/jpeg"]||[],n]:n===".png"?t["image/png"]=[...t["image/png"]||[],n]:n===".webp"?t["image/webp"]=[...t["image/webp"]||[],n]:n===".gif"?t["image/gif"]=[...t["image/gif"]||[],n]:n===".svg"?t["image/svg+xml"]=[...t["image/svg+xml"]||[],n]:t["application/octet-stream"]=[...t["application/octet-stream"]||[],n]}else t[o]||(t[o]=[]);return t}var xr=require("react"),fp=Ko(require("react-easy-crop"),1);function cp(e){return new Promise((t,r)=>{let o=new Image;o.addEventListener("load",()=>t(o)),o.addEventListener("error",n=>r(n)),o.setAttribute("crossOrigin","anonymous"),o.src=e})}function up(e){return e*Math.PI/180}function dp(e,t,r){let o=up(r);return{width:Math.abs(Math.cos(o)*e)+Math.abs(Math.sin(o)*t),height:Math.abs(Math.sin(o)*e)+Math.abs(Math.cos(o)*t)}}async function wd(e,t,r=0,o=!1,n="avatar-cropped.png",i="image/png"){let a=await cp(e),s=document.createElement("canvas"),l=s.getContext("2d");if(!l)throw new Error("No 2d context available on canvas");let f=up(r),u=a.naturalWidth||a.width,w=a.naturalHeight||a.height,{width:g,height:m}=dp(u,w,r);s.width=g,s.height=m,l.translate(g/2,m/2),l.rotate(f),l.scale(o?-1:1,1),l.translate(-u/2,-w/2),l.drawImage(a,0,0);let h=document.createElement("canvas"),b=h.getContext("2d");if(!b)throw new Error("No 2d context for cropped canvas");return h.width=t.width,h.height=t.height,b.drawImage(s,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise((x,S)=>{h.toBlob(k=>{if(!k){S(new Error("Canvas is empty or failed to generate blob"));return}let v=new File([k],n,{type:i||"image/png"});x(v)},i||"image/png",.95)})}var Ze=require("react/jsx-runtime");function zc({imageSrc:e="",file:t,fileName:r="avatar-cropped.png",fileType:o="image/png",aspectRatio:n=1,cropShape:i="round",showGrid:a=!0,minZoom:s=1,maxZoom:l=4,onApply:f,onCancel:u}){let w=(0,xr.useRef)(null),[g,m]=(0,xr.useState)(t??null),[h,b]=(0,xr.useState)(e),x=(0,xr.useRef)(t?.name||r),S=(0,xr.useRef)(t?.type||o),[k,v]=(0,xr.useState)({x:0,y:0}),[p,d]=(0,xr.useState)(1),[y,c]=(0,xr.useState)(0),[T,R]=(0,xr.useState)(!1),N=(0,xr.useRef)(null),[D,M]=(0,xr.useState)(!1);(0,xr.useEffect)(()=>{if(!g)return;let G=URL.createObjectURL(g);return b(G),()=>{URL.revokeObjectURL(G)}},[g]);let F=()=>d(G=>Math.min(l,Math.round((G+.2)*10)/10)),P=()=>d(G=>Math.max(s,Math.round((G-.2)*10)/10)),I=()=>c(G=>(G+90)%360),z=()=>c(G=>(G-90+360)%360),B=()=>R(G=>!G),V=()=>{v({x:0,y:0}),d(1),c(0),R(!1)},Y=()=>{w.current&&(w.current.value="",w.current.click())},L=G=>{if(G.target.files&&G.target.files[0]){let K=G.target.files[0];x.current=K.name,S.current=K.type||"image/png",m(K),V()}},E=(G,K)=>{N.current=K},O=async()=>{if(N.current)try{M(!0);let G=await wd(h,N.current,y,T,x.current,S.current);f(G)}catch(G){console.error("Error cropping avatar:",G)}finally{M(!1)}},A=()=>{u?.()},U="p-1.5 rounded-full text-neutral-600 hover:text-neutral-900 hover:bg-neutral-200/70 transition-colors focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed shrink-0";return(0,Ze.jsxs)("div",{className:"flex flex-col w-full select-none","data-testid":"upload-avatar-crop-modal",children:[(0,Ze.jsx)("input",{ref:w,type:"file",accept:"image/*","aria-hidden":"true",tabIndex:-1,className:"hidden",onChange:L}),(0,Ze.jsx)("div",{className:"relative w-full h-80 md:h-95 bg-neutral-950 overflow-hidden select-none",children:(0,Ze.jsx)(fp.default,{image:h,crop:k,zoom:p,rotation:y,aspect:n,cropShape:i,showGrid:a,minZoom:s,maxZoom:l,onCropChange:v,onZoomChange:d,onRotationChange:c,onCropComplete:E,classes:{mediaClassName:T?"scale-x-[-1]":""},style:{containerStyle:{position:"relative",width:"100%",height:"100%"}}})}),(0,Ze.jsx)("div",{className:"w-full flex items-center justify-center py-2.5 px-3 bg-neutral-white border-t border-neutral-200 overflow-x-auto ui-scrollbar",children:(0,Ze.jsxs)("div",{className:"inline-flex items-center flex-nowrap shrink-0 gap-1 bg-neutral-50 border border-neutral-200 rounded-full px-2.5 py-1 shadow-xs text-neutral-700",children:[(0,Ze.jsx)("button",{type:"button",onClick:Y,"aria-label":"Ch\u1ECDn \u1EA3nh kh\xE1c",title:"Ch\u1ECDn \u1EA3nh kh\xE1c",className:`${U} text-neutral-700 hover:text-primary-600`,"data-testid":"avatar-crop-change-image-button",children:(0,Ze.jsx)(mr,{width:16,height:16})}),(0,Ze.jsx)("div",{className:"w-px h-3.5 bg-neutral-300 my-auto mx-0.5 shrink-0"}),(0,Ze.jsx)("button",{type:"button",onClick:P,disabled:p<=s,"aria-label":"Thu nh\u1ECF",title:"Thu nh\u1ECF (-)",className:U,children:(0,Ze.jsx)(si,{width:16,height:16})}),(0,Ze.jsx)("button",{type:"button",onClick:F,disabled:p>=l,"aria-label":"Ph\xF3ng to",title:"Ph\xF3ng to (+)",className:U,children:(0,Ze.jsx)(ai,{width:16,height:16})}),(0,Ze.jsx)("button",{type:"button",onClick:z,title:"Xoay ng\u01B0\u1EE3c chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3","aria-label":"Xoay ng\u01B0\u1EE3c chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",className:U,children:(0,Ze.jsx)(li,{width:16,height:16})}),(0,Ze.jsx)("button",{type:"button",onClick:I,title:"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3","aria-label":"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",className:U,children:(0,Ze.jsx)(rn,{width:16,height:16})}),(0,Ze.jsx)("button",{type:"button",onClick:B,title:"L\u1EADt ngang","aria-label":"L\u1EADt ngang",className:U,children:(0,Ze.jsx)(ci,{width:16,height:16})}),(0,Ze.jsx)("button",{type:"button",onClick:V,title:"\u0110\u1EB7t l\u1EA1i","aria-label":"\u0110\u1EB7t l\u1EA1i",className:U,children:(0,Ze.jsx)(Tr,{width:16,height:16})}),(0,Ze.jsx)("div",{className:"w-px h-3.5 bg-neutral-300 my-auto mx-0.5 shrink-0"}),(0,Ze.jsx)("button",{type:"button",onClick:A,"aria-label":"H\u1EE7y c\u1EAFt \u1EA3nh",title:"H\u1EE7y (Esc)",className:`${U} text-neutral-500 hover:text-error-600`,"data-testid":"avatar-crop-cancel-button",children:(0,Ze.jsx)(Ue,{width:16,height:16})}),(0,Ze.jsx)("button",{type:"button",onClick:O,disabled:D,"aria-label":"\xC1p d\u1EE5ng v\xE0 l\u01B0u \u1EA3nh \u0111\xE3 c\u1EAFt",title:"\xC1p d\u1EE5ng",className:"p-1.5 rounded-full bg-primary-600 hover:bg-primary-500 text-white shadow-xs transition-colors active:scale-95 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden shrink-0","data-testid":"avatar-crop-apply-button",children:D?(0,Ze.jsx)(Re,{width:16,height:16}):(0,Ze.jsx)(Zo,{width:16,height:16})})]})})]})}function _s({open:e=!0,modalTitle:t="C\u1EAFt \u1EA3nh \u0111\u1EA1i di\u1EC7n",onClose:r,onCancel:o,onApply:n,...i}){let a=()=>{o?.(),r?.()};return(0,Ze.jsx)(Wn,{open:e,closeOnOverlayClick:!0,closeOnEsc:!0,onClose:a,children:(0,Ze.jsxs)(Yn,{size:"lg",radius:"xl",className:"bg-neutral-white border border-neutral-200 shadow-2xl overflow-hidden p-0",children:[(0,Ze.jsx)(_n,{title:(0,Ze.jsx)("span",{className:"font-semibold text-neutral-900","data-testid":"avatar-crop-modal-title",children:t}),className:"px-5 py-3.5 border-b border-neutral-200",showCloseButton:!0}),(0,Ze.jsx)(Xn,{className:"p-0 overflow-hidden",children:(0,Ze.jsx)(zc,{...i,onApply:l=>{n(l),r?.()},onCancel:a})})]})})}var wt=require("react/jsx-runtime");function Ic({size:e="md",variant:t="outline",color:r="primary",shape:o="circle",radius:n,value:i,defaultValue:a,onChange:s,onRemove:l,onPreview:f,onClear:u,maxSize:w,accept:g="image/*",crop:m=!0,label:h,labelPlacement:b="top",config:x,helperText:S,errorMessage:k,disabled:v=!1,readOnly:p=!1,icon:d,name:y,id:c,className:T="",wrapperClassName:R="",avatarClassName:N="",avatarWrapperClassName:D="",labelClassName:M="",helperClassName:F="",ref:P}){let{isRequired:I=!1,isInvalid:z=!1,isLoading:B=!1,showSpinner:V=!1,isClearable:Y=!1,isFullWidth:L=!1}=x??{},E=(0,jo.useId)(),O=c||E,A=`${O}-error-helper`,U=i!==void 0,[G,K]=(0,jo.useState)(a??null),q=U?i??null:G,X=Ho(q),fe=X.name,[ae,_]=(0,jo.useState)(null),[Z,he]=(0,jo.useState)(!1),[xe,$]=(0,jo.useState)(null),[re,ee]=(0,jo.useState)(""),de=k||xe,ne=!!(z||de),ze=ne?"error":r,ve=C(e,op,"md"),Ce=o==="circle"?"rounded-full":C(n,rp,"md"),J=t==="other"?"":C(ze,C(t,np,"outline"),"primary"),j=C(ze,ip,"primary"),oe=ne?"text-error-600 font-bold":C(ze,ap,"primary"),ye=C(ze,sp,"primary"),ue=Ne=>{U||K(Ne),s?.(Ne)},ce=m!==!1,ke=typeof m=="object"?m:{},Te=Ne=>{_({file:Ne.file,imageSrc:Ne.imageSrc,fileName:fe||"avatar.png",fileType:X.type||"image/png"})},pe=Ne=>{if(Ne?.stopPropagation(),!(v||p||B)&&q){let Je=q;ue(null),l?.(Je),u?.(),ee("\u0110\xE3 x\xF3a \u1EA3nh \u0111\u1EA1i di\u1EC7n.")}},W=Ne=>{Ne?.stopPropagation(),q&&(he(!0),f?.(q))},me=Ne=>{Ne?.stopPropagation(),q&&(X.file?Te({file:X.file}):X.serverFile?.src&&Te({imageSrc:X.serverFile.src}))},{getRootProps:De,getInputProps:ie,isDragActive:H,isDragReject:se,inputRef:Ie}=(0,pp.useDropzone)({multiple:!1,maxSize:w,accept:(0,jo.useMemo)(()=>lp(g),[g]),disabled:v||p||B,onDropAccepted:([Ne])=>{Ne&&($(null),ce?Te({file:Ne}):(ue(Ne),ee("T\u1EA3i \u1EA3nh \u0111\u1EA1i di\u1EC7n th\xE0nh c\xF4ng.")))},onDropRejected:Ne=>{let Je=Ne[0]?.errors[0],ot=Je?.code==="file-too-large"?`Dung l\u01B0\u1EE3ng t\u1EC7p v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n${w?` ${(w/(1024*1024)).toFixed(1)}MB`:""}.`:Je?.code==="file-invalid-type"?"\u0110\u1ECBnh d\u1EA1ng t\u1EC7p kh\xF4ng \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3.":Je?.message||"T\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7.";$(ot),ee(`L\u1ED7i t\u1EC7p: ${ot}`)}}),je=(0,mp.useMergeRefs)([Ie,P]),le=Ne=>{v||p||B||q&&(Ne.key==="Delete"||Ne.key==="Backspace")&&(Ne.preventDefault(),Ne.stopPropagation(),pe())},ge=()=>h?(0,wt.jsxs)("label",{htmlFor:O,className:`inline-flex items-center font-bold transition-colors duration-150 ${ve.label} ${oe} ${M}`,children:[h,I&&(0,wt.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):null,Ee="group/avatar relative flex items-center justify-center transition-colors duration-150 ease-in-out border-2 overflow-hidden select-none",He=v?"opacity-50":"cursor-pointer",Oe=se?"ring-2 ring-error-500/40 border-error-500 bg-error-50/80":H?ye:"",Ve=[Ee,ve.avatarSize,Ce,J,He,Oe,N||D].filter(Boolean).join(" ");return(0,wt.jsxs)("div",{className:`group/field flex ${b==="left"?"flex-row items-center gap-3":"flex-col"} ${L?"w-full":"inline-flex"} ${R||T}`,children:[(0,wt.jsx)("input",{...ie({id:O,name:y,disabled:v||B,"aria-hidden":!0,tabIndex:-1,className:"hidden"}),ref:je}),(0,wt.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:re}),ge(),(0,wt.jsxs)("div",{className:`flex flex-col ${L?"w-full":""}`,children:[(0,wt.jsxs)("div",{...De({role:"button",tabIndex:v||B?-1:0,"aria-label":"T\u1EA3i l\xEAn \u1EA3nh \u0111\u1EA1i di\u1EC7n","aria-disabled":v||B,"aria-invalid":ne,"aria-required":I,"aria-describedby":k||S||xe?A:void 0,"aria-busy":B,onKeyDown:le,className:Ve}),children:[q?(0,wt.jsx)(Oo,{src:q,alt:fe||"Avatar",fill:!0,radius:o==="circle"?"full":n,preview:!1,className:"object-cover",wrapperClassName:"w-full h-full"}):(0,wt.jsx)("div",{className:`flex flex-col items-center justify-center transition-colors ${j} ${ve.iconClass}`,children:d||(0,wt.jsx)(ds,{width:ve.iconSize,height:ve.iconSize})}),B&&V&&(0,wt.jsx)("div",{className:"absolute inset-0 bg-neutral-950/60 flex items-center justify-center text-neutral-white z-20",role:"status","aria-label":"\u0110ang t\u1EA3i",children:(0,wt.jsx)(Re,{width:ve.iconSize,height:ve.iconSize,className:"animate-spin"})}),!B&&!v&&q&&(0,wt.jsxs)("div",{className:"absolute inset-0 bg-neutral-950/20 opacity-0 group-hover/avatar:opacity-100 group-focus-visible/avatar:opacity-100 transition-opacity flex items-center justify-center gap-1.5 text-neutral-white z-10",children:[(0,wt.jsx)("button",{type:"button",onClick:W,"aria-label":"Xem tr\u01B0\u1EDBc \u1EA3nh \u0111\u1EA1i di\u1EC7n",title:"Xem tr\u01B0\u1EDBc",className:"p-1 rounded-full text-neutral-white hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-neutral-white focus-visible:outline-hidden cursor-pointer","data-testid":"avatar-preview-button",children:(0,wt.jsx)(_o,{width:14,height:14})}),ce&&!p&&(0,wt.jsx)("button",{type:"button",onClick:me,"aria-label":"C\u1EAFt \u1EA3nh \u0111\u1EA1i di\u1EC7n",title:"C\u1EAFt \u1EA3nh",className:"p-1 rounded-full text-neutral-white hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-neutral-white focus-visible:outline-hidden cursor-pointer","data-testid":"avatar-crop-button",children:(0,wt.jsx)(us,{width:14,height:14})}),(!p||Y)&&(0,wt.jsx)("button",{type:"button",onClick:pe,"aria-label":"X\xF3a \u1EA3nh \u0111\u1EA1i di\u1EC7n",title:"X\xF3a \u1EA3nh",className:"p-1 rounded-full text-error-300 hover:text-error-200 hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-error-400 focus-visible:outline-hidden cursor-pointer","data-testid":"avatar-remove-button",children:(0,wt.jsx)(Wr,{width:14,height:14})})]})]}),(0,wt.jsx)(Ae,{id:A,helperText:S,errorMessage:de,sizeClassName:ve.helper,className:F}),ce&&ae&&(0,wt.jsx)(_s,{open:!!ae,file:ae.file,imageSrc:ae.imageSrc,fileName:ae.fileName,fileType:ae.fileType,aspectRatio:ke.aspectRatio??1,cropShape:ke.cropShape??(o==="circle"?"round":"rect"),showGrid:ke.showGrid??!0,minZoom:ke.minZoom??1,maxZoom:ke.maxZoom??4,modalTitle:ke.modalTitle||"C\u1EAFt \u1EA3nh \u0111\u1EA1i di\u1EC7n",onClose:()=>_(null),onApply:Ne=>{ue(Ne),ee("\u1EA2nh \u0111\u1EA1i di\u1EC7n \u0111\xE3 \u0111\u01B0\u1EE3c c\u1EADp nh\u1EADt th\xE0nh c\xF4ng."),_(null)}}),Z&&q&&(0,wt.jsx)(ro,{open:Z,onClose:()=>he(!1),file:q,title:fe||"Xem tr\u01B0\u1EDBc \u1EA3nh \u0111\u1EA1i di\u1EC7n",children:(0,wt.jsx)(Vo,{imageProps:{minZoom:.5,maxZoom:4,toolbarProps:{tools:{rotate:!0,flip:!0,download:!0}}}})})]})]})}var Uo=require("react"),bp=require("react-dropzone");var er=require("react/jsx-runtime");function Li({size:e="md",color:t="primary",variant:r="outline",radius:o,shape:n="rectangle",compact:i=!1,disabled:a=!1,readOnly:s=!1,isLoading:l=!1,showSpinner:f=!1,dragStatus:u="idle",isInvalid:w=!1,dropzoneTitle:g,dropzoneDescription:m,icon:h,onTriggerUpload:b,getRootProps:x,className:S="",describedById:k}){let v=C(e,Bo,"md"),p=C(o,Tc,"md"),d=w?"error":t,y=r!=="other"?C(r,Of,"outline"):null,c=y?C(d,y,"primary"):null,T="K\xE9o th\u1EA3 t\u1EC7p tin v\xE0o \u0111\xE2y, ho\u1EB7c nh\u1EA5n \u0111\u1EC3 duy\u1EC7t file",R="H\u1ED7 tr\u1EE3 t\xE0i li\u1EC7u PDF, Office, t\u1EC7p n\xE9n ZIP, media...",M=u==="reject"?"border-error-500 bg-error-50/50 ring-2 ring-error-500/20 text-error-900":u==="active"?c?.active||"border-primary-500 bg-primary-50 ring-2 ring-primary-500/20":c?.idle||"border-neutral-300 bg-neutral-50/50 hover:border-primary-500 hover:bg-primary-50/30",F=B=>{a||l||s||(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),b?.())};if(i){let B=`group relative w-full ${v.compactMinHeight} ${v.compactPadding} ${p} border-2 border-dashed flex items-center justify-between gap-3 text-left transition-colors duration-150 ease-in-out cursor-pointer select-none ${M} ${a||s?"opacity-50 cursor-not-allowed pointer-events-none bg-neutral-100":""} focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${S}`,V={role:"button",tabIndex:a||s?-1:0,"aria-label":"Khu v\u1EF1c t\u1EA3i t\u1EC7p l\xEAn thu g\u1ECDn","aria-disabled":a||s,"aria-invalid":w,"aria-describedby":k,"aria-busy":l,className:B,onKeyDown:F},Y=x?x(V):V;return(0,er.jsxs)("div",{...Y,children:[(0,er.jsxs)("div",{className:"flex items-center gap-2.5 min-w-0 flex-1",children:[(0,er.jsx)("div",{className:`transition-colors shrink-0 ${c?.iconColor||"text-primary-500"}`,children:l&&f?(0,er.jsx)(Re,{width:18,height:18,className:"animate-spin text-primary-600"}):h||(0,er.jsx)(mr,{width:18,height:18})}),(0,er.jsx)("span",{className:`truncate text-neutral-700 font-medium ${v.descSize}`,children:g||"K\xE9o th\u1EA3 ho\u1EB7c nh\u1EA5n \u0111\u1EC3 t\u1EA3i t\u1EC7p l\xEAn"})]}),(0,er.jsx)("span",{className:`shrink-0 text-primary-600 group-hover:text-primary-700 font-semibold ${v.descSize}`,children:"Ch\u1ECDn file"})]})}let P=`group relative w-full ${n==="square"?"aspect-square w-full":C(e,Af,"md")} ${v.dropzonePadding} ${p} border-2 border-dashed flex flex-col items-center justify-center text-center transition-colors duration-150 ease-in-out cursor-pointer select-none ${M} ${a||s?"opacity-50 cursor-not-allowed pointer-events-none bg-neutral-100":""} focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${S}`,I={role:"button",tabIndex:a||s?-1:0,"aria-label":"Khu v\u1EF1c k\xE9o th\u1EA3 v\xE0 t\u1EA3i t\u1EC7p tin l\xEAn","aria-disabled":a||s,"aria-invalid":w,"aria-describedby":k,"aria-busy":l,className:P,onKeyDown:F},z=x?x(I):I;return(0,er.jsx)("div",{...z,children:l&&f?(0,er.jsxs)("div",{className:`flex flex-col items-center justify-center gap-2 ${c?.iconColor||"text-primary-600"}`,children:[(0,er.jsx)(Re,{width:v.iconSize*.8,height:v.iconSize*.8}),(0,er.jsx)("span",{className:`${v.titleSize} font-medium`,children:"\u0110ang x\u1EED l\xFD t\u1EC7p tin..."})]}):(0,er.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2",children:[(0,er.jsx)("div",{className:`transition-colors ${c?.iconColor||"text-primary-500"}`,children:h||(0,er.jsx)(mr,{width:v.iconSize,height:v.iconSize})}),(0,er.jsx)("div",{className:`${v.titleSize} font-medium text-neutral-800 ${c?.titleHover||"group-hover:text-primary-600"} transition-colors`,children:l?"\u0110ang x\u1EED l\xFD t\u1EC7p tin...":g??T}),(0,er.jsx)("div",{id:k,className:`${v.descSize} text-neutral-500`,children:m??R})]})})}var gp=require("react");var gn=require("react/jsx-runtime");function Bi({file:e,fileName:t,category:r,size:o="md",className:n=""}){let i=(0,gp.useMemo)(()=>{if(r)return r;let f=t||(e?$t(e):"");return Us(e||f)},[r,e,t]),a=C(i,jf,"other"),s=typeof o=="number"?o:C(o,Bo,"md").fileIconSize,l=Math.max(8,Math.round(s*.22));return(0,gn.jsxs)("div",{role:"img","aria-label":`Bi\u1EC3u t\u01B0\u1EE3ng \u0111\u1ECBnh d\u1EA1ng t\u1EC7p ${a.label}`,style:{width:s,height:s},className:`relative inline-flex items-center justify-center shrink-0 select-none ${n}`,children:[(0,gn.jsxs)("svg",{viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-full h-full drop-shadow-xs transition-transform",children:[(0,gn.jsx)("path",{d:"M8 5C8 3.9 8.9 3 10 3H26L34 11V35C34 36.1 33.1 37 32 37H10C8.9 37 8 36.1 8 35V5Z",className:"fill-neutral-50 stroke-neutral-300 transition-colors",strokeWidth:"1.5",strokeLinejoin:"round"}),(0,gn.jsx)("path",{d:"M26 3V10C26 10.55 26.45 11 27 11H34",className:"fill-neutral-200 stroke-neutral-300",strokeWidth:"1.5",strokeLinejoin:"round"}),(0,gn.jsx)("line",{x1:"13",y1:"15",x2:"23",y2:"15",className:"stroke-neutral-300",strokeWidth:"1.5",strokeLinecap:"round"}),(0,gn.jsx)("line",{x1:"13",y1:"19",x2:"27",y2:"19",className:"stroke-neutral-300",strokeWidth:"1.5",strokeLinecap:"round"})]}),(0,gn.jsx)("div",{style:{fontSize:`${l}px`},className:`absolute bottom-1 right-0.5 px-1 py-0.2 rounded font-bold tracking-tight border shadow-2xs leading-none uppercase ${a.bg} ${a.text} ${a.border}`,children:a.label})]})}var Fe=require("react/jsx-runtime");function Va({item:e,index:t,listType:r="list",size:o="md",radius:n,disabled:i=!1,readOnly:a=!1,showPreviewButton:s=!0,showDownloadButton:l=!0,showRemoveButton:f=!0,onRemove:u,onPreview:w,onDownload:g,onRetry:m,renderItem:h,className:b=""}){let x=C(o,Bo,"md"),S=C(n,Tc,"md"),k=$t(e),v=xd(e),{status:p,progress:d,error:y}=vd(e),c=p==="uploading",T=p==="error",R=()=>{i||a||u?.(e,t)},N=()=>{i||w?.(e)},D=()=>{i||g?.(e)},M=()=>{i||a||m?.(e,t)};if(h)return(0,Fe.jsx)("li",{"data-testid":"upload-file-item",className:"list-none w-full",children:h(e,t,{remove:R,preview:N,download:D})});let F=P=>{i||(P.key==="Delete"||P.key==="Backspace")&&!a&&(P.preventDefault(),R())};return r==="grid"?(0,Fe.jsxs)("li",{"data-testid":"upload-file-item",tabIndex:i?-1:0,onKeyDown:F,"aria-label":`T\u1EC7p tin ${k}`,className:`group relative list-none flex flex-col justify-between p-3 ${S} border border-neutral-200 bg-white hover:border-primary-300 hover:shadow-xs transition-colors duration-150 ease-in-out focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${i?"opacity-50 pointer-events-none bg-neutral-50":""} ${T?"border-error-300 bg-error-50/20":""} ${b}`,children:[(0,Fe.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,Fe.jsx)(Bi,{file:e,size:o}),(0,Fe.jsxs)("div",{className:"flex-1 min-w-0",children:[w&&!i?(0,Fe.jsx)("button",{type:"button",title:k,onClick:N,className:`truncate text-left font-medium text-neutral-800 ${x.fileNameSize} hover:text-primary-600 hover:underline cursor-pointer focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500 rounded-xs block w-full`,children:k}):(0,Fe.jsx)("p",{title:k,className:`truncate font-medium text-neutral-800 ${x.fileNameSize}`,children:k}),(0,Fe.jsx)("p",{className:`text-neutral-500 ${x.fileMetaSize}`,children:T?(0,Fe.jsx)("span",{className:"text-error-600 font-medium truncate block",children:y||"L\u1ED7i t\u1EA3i l\xEAn"}):c?(0,Fe.jsxs)("span",{className:"text-primary-600 flex items-center gap-1 font-medium",children:[(0,Fe.jsx)(Re,{width:12,height:12,className:"animate-spin inline"}),"\u0110ang t\u1EA3i... ",d!==void 0?`${d}%`:""]}):v!==void 0?ho(v):null})]})]}),c&&d!==void 0&&(0,Fe.jsx)("div",{className:"w-full bg-neutral-100 rounded-full h-1.5 mt-2 overflow-hidden",children:(0,Fe.jsx)("div",{className:"bg-primary-500 h-1.5 rounded-full transition-[width] duration-300 ease-out",style:{width:`${Math.min(100,Math.max(0,d))}%`}})}),(0,Fe.jsxs)("div",{className:"flex items-center justify-end gap-1 mt-2.5 pt-2 border-t border-neutral-100",children:[T&&m&&!a&&(0,Fe.jsx)("button",{type:"button",disabled:i,onClick:M,"aria-label":`Th\u1EED l\u1EA1i t\u1EA3i l\xEAn ${k}`,title:"Th\u1EED l\u1EA1i",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${x.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:(0,Fe.jsx)(Tr,{width:14,height:14})}),s&&w&&(0,Fe.jsx)("button",{type:"button",disabled:i,onClick:N,"aria-label":`Xem tr\u01B0\u1EDBc t\u1EC7p ${k}`,title:"Xem tr\u01B0\u1EDBc",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${x.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:(0,Fe.jsx)(_o,{width:14,height:14})}),l&&(0,Fe.jsx)("button",{type:"button",disabled:i,onClick:D,"aria-label":`T\u1EA3i xu\u1ED1ng t\u1EC7p ${k}`,title:"T\u1EA3i xu\u1ED1ng",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${x.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:(0,Fe.jsx)(ao,{width:14,height:14})}),f&&!a&&(0,Fe.jsx)("button",{type:"button",disabled:i,onClick:R,"aria-label":`X\xF3a t\u1EC7p ${k}`,title:"X\xF3a t\u1EC7p",className:`text-neutral-400 hover:text-error-600 hover:bg-error-50 ${x.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:(0,Fe.jsx)(Wr,{width:14,height:14})})]})]}):(0,Fe.jsxs)("li",{"data-testid":"upload-file-item",tabIndex:i?-1:0,onKeyDown:F,"aria-label":`T\u1EC7p tin ${k}`,className:`group relative list-none flex flex-col w-full ${x.itemPadding} ${S} border border-neutral-200 bg-white hover:border-primary-300 hover:bg-neutral-50/50 transition-colors duration-150 ease-in-out focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${i?"opacity-50 pointer-events-none bg-neutral-50":""} ${T?"border-error-300 bg-error-50/20":""} ${b}`,children:[(0,Fe.jsxs)("div",{className:"flex items-center justify-between gap-3 w-full",children:[(0,Fe.jsxs)("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[(0,Fe.jsx)(Bi,{file:e,size:o}),(0,Fe.jsxs)("div",{className:"flex flex-col min-w-0 flex-1",children:[(0,Fe.jsx)("div",{className:"flex items-center gap-2",children:w&&!i?(0,Fe.jsx)("button",{type:"button",title:k,onClick:N,className:`truncate text-left font-medium text-neutral-800 ${x.fileNameSize} hover:text-primary-600 hover:underline cursor-pointer focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500 rounded-xs`,children:k}):(0,Fe.jsx)("span",{title:k,className:`truncate font-medium text-neutral-800 ${x.fileNameSize}`,children:k})}),(0,Fe.jsx)("div",{className:`flex items-center gap-2 text-neutral-500 ${x.fileMetaSize}`,children:T?(0,Fe.jsx)("span",{className:"text-error-600 font-medium truncate",children:y||"L\u1ED7i t\u1EA3i l\xEAn"}):c?(0,Fe.jsxs)("span",{className:"text-primary-600 flex items-center gap-1 font-medium",children:[(0,Fe.jsx)(Re,{width:12,height:12,className:"animate-spin inline"}),"\u0110ang t\u1EA3i l\xEAn... ",d!==void 0?`${d}%`:""]}):v!==void 0?(0,Fe.jsx)("span",{children:ho(v)}):null})]})]}),(0,Fe.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[T&&m&&!a&&(0,Fe.jsx)("button",{type:"button",disabled:i,onClick:M,"aria-label":`Th\u1EED l\u1EA1i t\u1EA3i l\xEAn ${k}`,title:"Th\u1EED l\u1EA1i",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${x.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:(0,Fe.jsx)(Tr,{width:15,height:15})}),s&&w&&(0,Fe.jsx)("button",{type:"button",disabled:i,onClick:N,"aria-label":`Xem tr\u01B0\u1EDBc t\u1EC7p ${k}`,title:"Xem tr\u01B0\u1EDBc",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${x.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:(0,Fe.jsx)(_o,{width:15,height:15})}),l&&(0,Fe.jsx)("button",{type:"button",disabled:i,onClick:D,"aria-label":`T\u1EA3i xu\u1ED1ng t\u1EC7p ${k}`,title:"T\u1EA3i xu\u1ED1ng",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${x.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:(0,Fe.jsx)(ao,{width:15,height:15})}),f&&!a&&(0,Fe.jsx)("button",{type:"button",disabled:i,onClick:R,"aria-label":`X\xF3a t\u1EC7p ${k}`,title:"X\xF3a t\u1EC7p",className:`text-neutral-400 hover:text-error-600 hover:bg-error-50 ${x.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:(0,Fe.jsx)(Wr,{width:15,height:15})})]})]}),c&&d!==void 0&&(0,Fe.jsx)("div",{className:"w-full bg-neutral-100 rounded-full h-1 mt-2 overflow-hidden",children:(0,Fe.jsx)("div",{className:"bg-primary-500 h-1 rounded-full transition-[width] duration-300 ease-out",style:{width:`${Math.min(100,Math.max(0,d))}%`}})})]})}var Cd=require("react/jsx-runtime");function Aa({items:e,listType:t="list",size:r="md",color:o="primary",radius:n,disabled:i=!1,readOnly:a=!1,showPreviewButton:s=!0,showDownloadButton:l=!0,showRemoveButton:f=!0,onRemove:u,onPreview:w,onDownload:g,onRetry:m,renderItem:h,className:b=""}){let x=C(r,Bo,"md"),S=t==="grid"?`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 ${x.gap} list-none p-0 m-0 ${b}`:`flex flex-col ${x.gap} list-none p-0 m-0 ${b}`;return!e||e.length===0?null:(0,Cd.jsx)("ul",{"aria-label":"Danh s\xE1ch t\u1EC7p tin \u0111\xE3 t\u1EA3i l\xEAn",className:S,children:e.map((k,v)=>{let p=Uf(k,v);return(0,Cd.jsx)(Va,{item:k,index:v,listType:t,size:r,radius:n,color:o,disabled:i,readOnly:a,showPreviewButton:s,showDownloadButton:l,showRemoveButton:f,onRemove:u,onPreview:w,onDownload:g,onRetry:m,renderItem:h},p)})})}var cr=require("react/jsx-runtime");function Mc({value:e,defaultValue:t,onChange:r,onRemove:o,onPreview:n,onDownload:i,onRetry:a,maxCount:s,maxSize:l,minSize:f,accept:u,beforeUpload:w,viewMode:g="dropzone",listType:m="list",shape:h="rectangle",size:b="md",color:x="primary",variant:S="outline",radius:k,label:v,labelClassName:p="",helperText:d,errorMessage:y,disabled:c=!1,readOnly:T=!1,dropzoneTitle:R,dropzoneDescription:N,buttonText:D="T\u1EA3i t\u1EC7p l\xEAn",icon:M,renderItem:F,className:P="",dropzoneClassName:I="",listClassName:z="",previewClassName:B="",helperClassName:V="",config:Y}){let{isRequired:L=!1,isInvalid:E=!1,isLoading:O=!1,showSpinner:A=!1,multiple:U=!1,showFileList:G=!0,showPreviewButton:K=!0,showDownloadButton:q=!0,showRemoveButton:X=!0}=Y??{},fe=(0,Uo.useId)(),ae=`${fe}-input`,_=`${fe}-error-helper`,Z=e!==void 0,[he,xe]=(0,Uo.useState)(()=>Ii(t)),$=(0,Uo.useMemo)(()=>Z?Ii(e):he,[Z,e,he]),[re,ee]=(0,Uo.useState)(null),[de,ne]=(0,Uo.useState)(null),[ze,ve]=(0,Uo.useState)(""),Ce=C(b,Bo,"md"),J=k??"md",j=!!(E||y||re),oe=y||re,ue=j?"text-error-600":C(j?"error":x,Vf,"primary"),ce=s??(U?void 0:1),ke=le=>{Z||xe(le),r?.(le)},Te=(0,Uo.useMemo)(()=>Ys(u),[u]),{getRootProps:pe,getInputProps:W,isDragActive:me,isDragReject:De,open:ie}=(0,bp.useDropzone)({multiple:U,maxSize:l,minSize:f,accept:Te,disabled:c||T||O,noClick:g==="button",noKeyboard:g==="button",onDropAccepted:async le=>{if(c||T||(ee(null),le.length===0))return;let ge=le,Ee=$.length;if(ce!==void 0)if(U){let Ve=ce-Ee;if(Ve<=0){let Ke=`S\u1ED1 l\u01B0\u1EE3ng t\u1EC7p \u0111\xE3 \u0111\u1EA1t t\u1ED1i \u0111a (${ce} t\u1EC7p)`;ee(Ke),ve(Ke);return}ge=le.slice(0,Ve)}else{let Ve=le[0];if(!Ve)return;ge=[Ve]}let He=await Promise.all(ge.map(async Ve=>{if(w)try{let Ke=await w(Ve);if(Ke===!1||typeof Ke=="string")return{file:null,error:typeof Ke=="string"?Ke:`T\u1EC7p ${Ve.name} \u0111\xE3 b\u1ECB t\u1EEB ch\u1ED1i`}}catch(Ke){return{file:null,error:Ke instanceof Error?Ke.message:`Kh\xF4ng th\u1EC3 x\u1EED l\xFD t\u1EC7p ${Ve.name}`}}return{file:Ve,error:null}})),Oe=[];for(let Ve of He)Ve.error?(ee(Ve.error),ve(`L\u1ED7i: ${Ve.error}`)):Ve.file&&Oe.push(Ve.file);if(Oe.length>0){let Ve=U?[...$,...Oe]:Oe;ke(Ve),ve(`\u0110\xE3 th\xEAm ${Oe.length} t\u1EC7p tin. T\u1ED5ng c\u1ED9ng: ${Ve.length} t\u1EC7p.`)}},onDropRejected:le=>{let ge=le[0]?.errors[0];if(!ge)return;let Ee=ge.message||"T\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7";ge.code==="file-too-large"?Ee=`K\xEDch th\u01B0\u1EDBc t\u1EC7p v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n cho ph\xE9p (${ho(l||0)})`:ge.code==="file-too-small"?Ee=`K\xEDch th\u01B0\u1EDBc t\u1EC7p nh\u1ECF h\u01A1n gi\u1EDBi h\u1EA1n t\u1ED1i thi\u1EC3u (${ho(f||0)})`:ge.code==="file-invalid-type"?Ee=`\u0110\u1ECBnh d\u1EA1ng t\u1EC7p kh\xF4ng \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3. C\xE1c \u0111\u1ECBnh d\u1EA1ng cho ph\xE9p: ${typeof u=="string"?u:Object.keys(u||{}).join(", ")}`:ge.code==="too-many-files"&&(Ee=`S\u1ED1 l\u01B0\u1EE3ng t\u1EC7p v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n cho ph\xE9p (${ce} t\u1EC7p)`),ee(Ee),ve(`L\u1ED7i t\u1EC7p: ${Ee}`)}}),H=(le,ge)=>{if(c||T)return;let Ee=$.filter((He,Oe)=>Oe!==ge);ke(Ee),o?.(le,ge),ve(`\u0110\xE3 x\xF3a t\u1EC7p tin ${$t(le)}`)},se=le=>{ne(le),n?.(le)},Ie=le=>{i?.(le);let ge=$t(le);if(le instanceof File){let Ee=URL.createObjectURL(le);xo(Ee,le.name),setTimeout(()=>URL.revokeObjectURL(Ee),1e3);return}if(typeof le=="string"){xo(le,ge);return}typeof le=="object"&&le&&typeof le.src=="string"&&xo(le.src,le.name||ge)},je=B||z;return(0,cr.jsxs)("div",{className:`group/field relative flex flex-col w-full ${P}`,children:[(0,cr.jsx)("input",{...W({id:ae,disabled:c||O,"aria-hidden":!0,tabIndex:-1,className:"hidden"})}),(0,cr.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:ze}),v&&(0,cr.jsxs)("label",{htmlFor:ae,className:`block font-medium transition-colors duration-150 ${Ce.labelSize} ${ue} ${p}`,children:[v,L&&(0,cr.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),(0,cr.jsxs)("div",{className:"flex flex-col gap-3",children:[g==="dropzone"&&(0,cr.jsx)(Li,{size:b,color:x,variant:S,radius:J,shape:h,disabled:c,readOnly:T,isLoading:O,showSpinner:A,dragStatus:De?"reject":me?"active":"idle",isInvalid:j,dropzoneTitle:R,dropzoneDescription:N,icon:M,onTriggerUpload:ie,getRootProps:pe,className:I,describedById:oe||d?_:void 0}),g==="compact"&&(0,cr.jsx)(Li,{size:b,color:x,variant:S,radius:J,compact:!0,disabled:c,readOnly:T,isLoading:O,showSpinner:A,dragStatus:De?"reject":me?"active":"idle",isInvalid:j,dropzoneTitle:R,dropzoneDescription:N,icon:M,onTriggerUpload:ie,getRootProps:pe,className:I,describedById:oe||d?_:void 0}),g==="button"&&(0,cr.jsx)("div",{className:"flex items-center gap-3",children:(0,cr.jsx)(Ir,{type:"button",size:Ce.buttonSize,color:j?"error":x==="neutral"?"secondary":x,variant:S==="other"?"filled":S,radius:k,disabled:c||T||O||ce!==void 0&&$.length>=ce,isLoading:O,showSpinner:A,onClick:ie,leftIcon:(0,cr.jsx)(mr,{width:Ce.iconSize*.5,height:Ce.iconSize*.5}),"aria-label":"T\u1EA3i t\u1EC7p l\xEAn",children:D})}),G&&$.length>0&&(0,cr.jsx)(Aa,{items:$,listType:m,size:b,color:x,variant:S,radius:J,disabled:c,readOnly:T,maxCount:ce,showPreviewButton:K,showDownloadButton:q,showRemoveButton:X,onRemove:H,onPreview:se,onDownload:Ie,onRetry:a,renderItem:F,className:je})]}),(0,cr.jsx)(Ae,{id:_,helperText:d,errorMessage:j?oe:void 0,sizeClassName:Ce.helperSize,className:V}),de&&(0,cr.jsx)(ro,{open:!!de,onClose:()=>ne(null),file:de})]})}var hp=300,Qn={xs:{dialog:"max-w-[320px] p-4 gap-3",header:"gap-2.5",body:"text-xs",footer:"gap-2 pt-2",title:"text-sm font-semibold leading-tight text-neutral-900",description:"text-xs leading-normal text-neutral-600",iconWrapper:"size-7 rounded-full",icon:"size-4",buttonSize:"xs",buttonGap:"gap-2",closeButton:"size-5 p-0.5 -mr-1 -mt-1",closeIcon:"size-3.5"},sm:{dialog:"max-w-[380px] p-5 gap-3.5",header:"gap-3",body:"text-sm",footer:"gap-2.5 pt-2.5",title:"text-base font-semibold leading-tight text-neutral-900",description:"text-sm leading-normal text-neutral-600",iconWrapper:"size-9 rounded-full",icon:"size-5",buttonSize:"sm",buttonGap:"gap-2.5",closeButton:"size-6 p-0.5 -mr-1 -mt-1",closeIcon:"size-4"},md:{dialog:"max-w-[440px] p-6 gap-4",header:"gap-3.5",body:"text-sm",footer:"gap-3 pt-3",title:"text-lg font-semibold leading-tight text-neutral-900",description:"text-sm leading-relaxed text-neutral-600",iconWrapper:"size-10 rounded-full",icon:"size-5",buttonSize:"md",buttonGap:"gap-3",closeButton:"size-7 p-1 -mr-1.5 -mt-1.5",closeIcon:"size-4"},lg:{dialog:"max-w-[520px] p-7 gap-5",header:"gap-4",body:"text-base",footer:"gap-3.5 pt-3.5",title:"text-xl font-semibold leading-snug text-neutral-900",description:"text-base leading-relaxed text-neutral-600",iconWrapper:"size-12 rounded-full",icon:"size-6",buttonSize:"lg",buttonGap:"gap-3.5",closeButton:"size-8 p-1.5 -mr-1.5 -mt-1.5",closeIcon:"size-4.5"},xl:{dialog:"max-w-[600px] p-8 gap-6",header:"gap-4.5",body:"text-lg",footer:"gap-4 pt-4",title:"text-2xl font-bold leading-snug text-neutral-900",description:"text-lg leading-relaxed text-neutral-600",iconWrapper:"size-14 rounded-full",icon:"size-7",buttonSize:"xl",buttonGap:"gap-4",closeButton:"size-9 p-1.5 -mr-2 -mt-2",closeIcon:"size-5"}},xp={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},vp={primary:"bg-primary-50 text-primary-600 border border-primary-200",secondary:"bg-secondary-50 text-secondary-600 border border-secondary-200",neutral:"bg-neutral-100 text-neutral-600 border border-neutral-200",error:"bg-error-50 text-error-600 border border-error-200",success:"bg-success-50 text-success-600 border border-success-200",warning:"bg-warning-50 text-warning-600 border border-warning-200",info:"bg-info-50 text-info-600 border border-info-200"},yp={warning:oi,error:ni,success:ri,info:Vr,primary:Vr,secondary:Vr,neutral:Vr};var wp=require("react/jsx-runtime");function Fc({size:e,radius:t,className:r="",children:o,ref:n,...i}){let a=rt(),s=C(e??a?.size,Qn,"md"),l=C(t,xp,"lg"),f=["relative flex flex-col w-full bg-neutral-white shadow-2xl border-2 border-neutral-200 outline-none text-neutral-900 pointer-events-auto",s.dialog,l,r].filter(Boolean).join(" ");return(0,wp.jsx)("div",{ref:n,tabIndex:-1,className:f,...i,children:o})}var ur=require("react");var Hi=require("react/jsx-runtime");function Ec({open:e=!1,size:t="md",color:r="warning",isLoading:o=!1,closeOnOverlayClick:n=!0,closeOnEsc:i=!0,lockScroll:a=!0,overlayClassName:s="",className:l="",toaster:f=!0,children:u,onClose:w,...g}){let m=(0,ur.useRef)(null),[h,b]=(0,ur.useState)(!1),x=(0,ur.useRef)(null),S=(0,ur.useCallback)(()=>{h||o||(b(!0),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{b(!1),w?.()},hp))},[h,o,w]),k=(0,ur.useMemo)(()=>({onClose:S,isLoading:o,size:t,color:r,dialogRef:m}),[S,o,t,r]);(0,ur.useEffect)(()=>()=>{x.current&&clearTimeout(x.current)},[]),(0,ur.useEffect)(()=>{let c=m.current;if(c)if(e||h){if(!c.open)try{c.showModal()}catch{}}else c.open&&c.close()},[e,h]),(0,ur.useEffect)(()=>{if(!a)return;let c=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=c}},[a]);let v=(0,ur.useEffectEvent)(c=>{!e||i===!1||c.key==="Escape"&&(c.preventDefault(),c.stopPropagation(),S())});if((0,ur.useEffect)(()=>(window.addEventListener("keydown",v),()=>{window.removeEventListener("keydown",v)}),[]),!e&&!h)return null;let p=()=>{n&&S()},d=h?"animate-confirm-backdrop-out pointer-events-none":"animate-confirm-backdrop-in",y=h?"animate-confirm-out pointer-events-none":"animate-confirm-in";return(0,Hi.jsx)(Lu.Provider,{value:k,children:(0,Hi.jsxs)("dialog",{ref:m,"aria-labelledby":"confirm-dialog-title","aria-describedby":"confirm-dialog-description",onCancel:c=>{c.preventDefault(),i!==!1&&S()},className:`fixed inset-0 flex items-center justify-center p-4 bg-neutral-950/40 backdrop-blur-xs border-none m-0 max-w-none max-h-none w-screen h-screen overflow-visible backdrop:bg-transparent ${d} ${s}`,...g,children:[f!==!1&&(0,Hi.jsx)(Rn,{position:"top-right",...typeof f=="object"?f:{}}),(0,Hi.jsx)("div",{"aria-hidden":"true",onClick:p,className:"fixed inset-0 -z-10"}),(0,Hi.jsx)("div",{className:`w-full flex items-center justify-center pointer-events-none ${y} ${l}`,children:u})]})})}var Yo=require("react/jsx-runtime");function $c({size:e,color:t,icon:r=!0,title:o,iconClassName:n="",titleClassName:i="",showCloseButton:a=!1,onClose:s,closeButtonClassName:l="",className:f="",children:u,...w}){let g=rt(),m=C(e??g?.size,Qn,"md"),h=C(t??g?.color,vp,"warning"),b=g?.isLoading,x=()=>{s?.(),g?.onClose?.()},S=!!(s||g?.onClose),k=()=>{if(r===!1)return null;if(r!==void 0&&r!==!0)return(0,Yo.jsx)("div",{className:`inline-flex items-center justify-center shrink-0 ${m.iconWrapper} ${h} ${n}`,"aria-hidden":"true",children:r});let v=C(t??g?.color,yp,"warning");return(0,Yo.jsx)("div",{className:`inline-flex items-center justify-center shrink-0 ${m.iconWrapper} ${h} ${n}`,"aria-hidden":"true",children:(0,Yo.jsx)(v,{className:m.icon})})};return(0,Yo.jsxs)("div",{className:`flex items-start justify-between w-full ${m.header} ${f}`,...w,children:[(0,Yo.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[k(),o&&(0,Yo.jsx)("h3",{className:`${m.title} truncate ${i}`,id:"confirm-dialog-title",children:o}),u]}),a&&S&&(0,Yo.jsx)("button",{type:"button",onClick:x,disabled:b,"aria-label":"\u0110\xF3ng h\u1ED9p tho\u1EA1i",className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-700 hover:bg-neutral-100 rounded-md transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-neutral-400 ${m.closeButton} ${l}`,children:(0,Yo.jsx)(Ue,{className:m.closeIcon})})]})}var Bc=require("react/jsx-runtime");function Lc({size:e,description:t,descriptionClassName:r="",className:o="",children:n,...i}){let a=rt(),s=C(e??a?.size,Qn,"md");return(0,Bc.jsxs)("div",{className:`w-full ${s.body} ${o}`,id:"confirm-dialog-description",...i,children:[t?(0,Bc.jsx)("p",{className:`${s.description} ${r}`,children:t}):null,n]})}var Oa=require("react/jsx-runtime");function Hc({size:e,confirmText:t="X\xE1c nh\u1EADn",cancelText:r="H\u1EE7y",confirmVariant:o="filled",cancelVariant:n="outline",confirmColor:i,cancelColor:a="secondary",onConfirm:s,onCancel:l,onClose:f,confirmButtonProps:u,cancelButtonProps:w,className:g="",children:m,...h}){let b=rt(),x=C(e??b?.size,Qn,"md"),S=i??b?.color??"warning",k=()=>{f?.(),b?.onClose?.()},v=async()=>{try{let d=s?.();d&&"then"in d&&await d,k()}catch{}},p=()=>{l?.(),k()};return m?(0,Oa.jsx)("div",{className:`flex items-center justify-end w-full ${x.footer} ${x.buttonGap} ${g}`,...h,children:m}):(0,Oa.jsxs)("div",{className:`flex items-center justify-end w-full ${x.footer} ${x.buttonGap} ${g}`,...h,children:[r!==!1&&(0,Oa.jsx)(Ir,{size:x.buttonSize,variant:n,color:a,onClick:p,disabled:w?.disabled||b?.isLoading,...w,children:r}),(0,Oa.jsx)(Ir,{size:x.buttonSize,variant:o,color:S,isLoading:b?.isLoading||u?.isLoading,disabled:u?.disabled,onClick:v,...u,children:t})]})}var Vc=require("react");var Cp=require("react/jsx-runtime");function Ac({children:e,asChild:t=!0,onClick:r,...o}){let n=rt(),i=n?.isLoading,a=s=>{r?.(s),s.defaultPrevented||n?.onClose?.()};if(t&&(0,Vc.isValidElement)(e)){let s=e;return(0,Vc.cloneElement)(s,{disabled:s.props.disabled||i,onClick:l=>{s.props.onClick?.(l),a(l)},...o})}return(0,Cp.jsx)("button",{type:"button",onClick:a,disabled:i,...o,children:e})}var Sp=require("react/jsx-runtime");function Oc({size:e,className:t="",children:r,...o}){let n=tt(),i=C(e??n?.size,Un,"md");return(0,Sp.jsx)("div",{className:`flex items-center justify-end w-full border-t border-neutral-100 pt-2 ${i.footer} ${i.buttonGap} ${t}`,...o,children:r})}var Gc=require("react");var Tp=require("react/jsx-runtime");function jc({children:e,asChild:t=!0,onClick:r,...o}){let n=tt(),i=n?.isLoading,a=s=>{r?.(s),s.defaultPrevented||n?.onClose?.()};if(t&&(0,Gc.isValidElement)(e)){let s=e;return(0,Gc.cloneElement)(s,{disabled:s.props.disabled||i,onClick:l=>{s.props.onClick?.(l),a(l)},...o})}return(0,Tp.jsx)("button",{type:"button",onClick:a,disabled:i,...o,children:e})}var Ga=require("react");var Uc={sm:{head:"px-3 py-2 text-xs font-semibold",cell:"px-3 py-2 text-xs",text:"text-xs",icon:"w-3.5 h-3.5"},md:{head:"px-4 py-3 text-sm font-semibold",cell:"px-4 py-3 text-sm",text:"text-sm",icon:"w-4 h-4"},lg:{head:"px-5 py-4 text-base font-semibold",cell:"px-5 py-4 text-base",text:"text-base",icon:"w-5 h-5"}},Yc={default:{container:"border border-neutral-200 shadow-xs",table:"border-collapse",head:"bg-neutral-50/80 border-b border-neutral-200 text-neutral-600",row:"border-b border-neutral-200/80 hover:bg-neutral-50/50 transition-colors",cell:"text-neutral-700"},striped:{container:"border border-neutral-200 shadow-xs",table:"border-collapse",head:"bg-neutral-100/80 border-b border-neutral-200 text-neutral-700",row:"border-b border-neutral-200/80 even:bg-neutral-50/60 hover:bg-neutral-100/40 transition-colors",cell:"text-neutral-700"},bordered:{container:"border border-neutral-200 shadow-xs",table:"border-collapse border border-neutral-200",head:"bg-neutral-50 border border-neutral-200 text-neutral-700",row:"border-b border-neutral-200 hover:bg-neutral-50/50 transition-colors",cell:"border border-neutral-200 text-neutral-700"}},Wc={left:"text-left justify-start",center:"text-center justify-center",right:"text-right justify-end"},Xs=[10,20,50,100],qs=10;var yo=require("react/jsx-runtime"),kp=(0,Ga.createContext)({size:"md",variantStyles:Yc.default}),Vi=()=>(0,Ga.useContext)(kp);function Zs({variant:e="default",size:t="md",className:r="",containerClassName:o="",wrapperProps:n,children:i,ref:a,...s}){let l=C(e,Yc,"default"),f=(0,Ga.useMemo)(()=>({size:t,variantStyles:l}),[t,l]);return(0,yo.jsx)(kp.Provider,{value:f,children:(0,yo.jsx)("div",{className:`w-full overflow-x-auto rounded-lg ${l.container} ${o}`.trim(),...n,children:(0,yo.jsx)("table",{ref:a,className:`w-full text-left caption-bottom ${l.table} ${r}`.trim(),...s,children:i})})})}function Js({className:e="",children:t,ref:r,...o}){let{variantStyles:n}=Vi();return(0,yo.jsx)("thead",{ref:r,className:`${n.head} ${e}`.trim(),...o,children:t})}function Qs({className:e="",children:t,ref:r,...o}){return(0,yo.jsx)("tbody",{ref:r,className:`divide-y divide-neutral-200/70 ${e}`.trim(),...o,children:t})}function Sd({className:e="",children:t,ref:r,...o}){return(0,yo.jsx)("tfoot",{ref:r,className:`border-t border-neutral-200 bg-neutral-50/60 font-medium text-neutral-600 ${e}`.trim(),...o,children:t})}function bn({isSelected:e=!1,isHoverable:t=!0,className:r="",children:o,ref:n,...i}){let{variantStyles:a}=Vi(),s=e?"bg-primary-50/70 hover:bg-primary-50 text-primary-950 font-medium":"",l=t&&!e?a.row:"";return(0,yo.jsx)("tr",{ref:n,"data-state":e?"selected":void 0,"aria-selected":e,className:`${l} ${s} ${r}`.trim(),...i,children:o})}function hn({align:e="left",className:t="",children:r,ref:o,...n}){let{size:i}=Vi(),a=C(i,Uc,"md"),s=C(e,Wc,"left");return(0,yo.jsx)("th",{ref:o,className:`tracking-wider ${a.head} ${s} ${t}`.trim(),...n,children:r})}function xn({align:e="left",className:t="",children:r,ref:o,...n}){let{size:i,variantStyles:a}=Vi(),s=C(i,Uc,"md"),l=C(e,Wc,"left");return(0,yo.jsx)("td",{ref:o,className:`align-middle ${s.cell} ${a.cell} ${l} ${t}`.trim(),...n,children:r})}function Td({className:e="",children:t,ref:r,...o}){return(0,yo.jsx)("caption",{ref:r,className:`mt-3 text-xs text-neutral-500 ${e}`.trim(),...o,children:t})}var Wo=require("react/jsx-runtime");function Ai({column:e,title:t,className:r="",...o}){if(!e.getCanSort())return(0,Wo.jsx)("div",{className:`font-semibold ${r}`.trim(),...o,children:t});let n=e.getIsSorted(),i=a=>{a.preventDefault();let s=e.getToggleSortingHandler();s&&s(a)};return(0,Wo.jsx)("div",{className:`flex items-center space-x-1.5 ${r}`.trim(),...o,children:(0,Wo.jsxs)("button",{type:"button",onClick:i,className:"group inline-flex items-center gap-1.5 font-semibold text-inherit hover:text-neutral-900 transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 rounded px-1 py-0.5 -mx-1",children:[(0,Wo.jsx)("span",{children:t}),(0,Wo.jsx)("span",{className:"shrink-0 inline-flex items-center justify-center","aria-hidden":"true",children:n==="asc"?(0,Wo.jsx)(gs,{className:"w-3.5 h-3.5 text-primary-600"}):n==="desc"?(0,Wo.jsx)(hs,{className:"w-3.5 h-3.5 text-primary-600"}):(0,Wo.jsx)(ps,{className:"w-3.5 h-3.5 text-neutral-400 opacity-60 group-hover:opacity-100 transition-opacity"})})]})})}var Rp=require("@dnd-kit/sortable"),Np=require("@dnd-kit/utilities");var kd=require("react/jsx-runtime");function Rd({header:e,canSort:t=!1,headerContent:r,ariaSort:o,disabled:n=!1,className:i=""}){let a=e.column.id==="_select"||e.column.id==="_expand",s=n||a,{attributes:l,listeners:f,setNodeRef:u,transform:w,transition:g,isDragging:m}=(0,Rp.useSortable)({id:e.column.id,disabled:s}),h={transform:Np.CSS.Translate.toString(w),transition:g,opacity:m?.75:1,position:m?"relative":void 0,zIndex:m?20:void 0,whiteSpace:"nowrap"},b=t&&typeof e.column.columnDef.header=="string"?(0,kd.jsx)(Ai,{column:e.column,title:e.column.columnDef.header}):r;return(0,kd.jsx)(hn,{ref:u,style:h,"aria-sort":o,"data-column-id":e.column.id,...s?{}:l,...s?{}:f,className:`
|
|
3
3
|
${s?"":"select-none cursor-grab active:cursor-grabbing transition-colors"}
|
|
4
4
|
${m?"bg-neutral-100 shadow-md ring-1 ring-primary-500/30":""}
|
|
5
5
|
${i}
|
|
6
|
-
`.trim(),children:x})}var yd=require("react");var Lt=require("react/jsx-runtime");function ug(e,t){return t<=7?Array.from({length:t},(r,n)=>n+1):e<=4?[1,2,3,4,5,"...",t]:e>=t-3?[1,"...",t-4,t-3,t-2,t-1,t]:[1,"...",e-1,e,e+1,"...",t]}function Ys({table:e,pageSizeOptions:t=As,showPageSizeSelector:r=!0,className:n=""}){let o=e.state.pagination,i=o?.pageIndex??0,a=o?.pageSize??10,s=e.getPageCount(),l=Math.max(s,1),f=i+1,c=e.getCanPreviousPage(),w=e.getCanNextPage(),p=(0,yd.useMemo)(()=>t.map(v=>({label:`${v}`,value:v})),[t]),m=(0,yd.useMemo)(()=>ug(f,l),[f,l]);return(0,Lt.jsxs)("div",{className:`flex flex-col sm:flex-row items-center justify-between gap-4 px-2 py-3 text-xs text-neutral-600 ${n}`.trim(),children:[r?(0,Lt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Lt.jsx)("span",{className:"whitespace-nowrap",children:"S\u1ED1 d\xF2ng/trang:"}),(0,Lt.jsx)("div",{className:"w-20","data-testid":"table-page-size-selector",children:(0,Lt.jsx)(Sa,{size:"sm",options:p,value:a,onChange:v=>{v!=null&&e.setPageSize(Number(v))},searchable:!1,clearable:!1,"aria-label":"S\u1ED1 d\xF2ng m\u1ED7i trang"})})]}):(0,Lt.jsx)("div",{}),(0,Lt.jsxs)("div",{className:"flex items-center gap-1 ml-auto sm:ml-0",children:[(0,Lt.jsx)(qr,{icon:(0,Lt.jsx)(Un,{className:"w-3.5 h-3.5"}),"aria-label":"Trang \u0111\u1EA7u",size:"sm",variant:"outline",color:"neutral",disabled:!c,onClick:()=>e.firstPage()}),(0,Lt.jsx)(qr,{icon:(0,Lt.jsx)(Sr,{className:"w-3.5 h-3.5"}),"aria-label":"Trang tr\u01B0\u1EDBc",size:"sm",variant:"outline",color:"neutral",disabled:!c,onClick:()=>e.previousPage()}),(0,Lt.jsx)("div",{className:"flex items-center gap-1 px-1",children:m.map((v,x)=>{if(v==="...")return(0,Lt.jsx)("span",{className:"w-8 h-8 flex items-center justify-center text-xs text-neutral-400 select-none",children:"..."},`ellipsis-${x}`);let h=Number(v),k=h===f;return(0,Lt.jsx)("button",{type:"button",onClick:()=>e.setPageIndex(h-1),"aria-label":`Trang ${h}`,"aria-current":k?"page":void 0,className:`w-8 h-8 rounded-full flex items-center justify-center text-xs transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 ${k?"border-2 border-primary-600 text-primary-600 font-semibold bg-primary-50/50":"text-neutral-700 hover:text-neutral-900 hover:bg-neutral-100 font-medium"}`,children:h},h)})}),(0,Lt.jsx)(qr,{icon:(0,Lt.jsx)(Tr,{className:"w-3.5 h-3.5"}),"aria-label":"Trang sau",size:"sm",variant:"outline",color:"neutral",disabled:!w,onClick:()=>e.nextPage()}),(0,Lt.jsx)(qr,{icon:(0,Lt.jsx)(Yn,{className:"w-3.5 h-3.5"}),"aria-label":"Trang cu\u1ED1i",size:"sm",variant:"outline",color:"neutral",disabled:!w,onClick:()=>e.lastPage()})]})]})}var gn=require("react"),ut=require("@floating-ui/react");var Ae=require("react/jsx-runtime");function wp(e,t){if(t==null||t==="")return"Ch\u01B0a nh\u1EADp";if(t instanceof Date)return t.toLocaleDateString("vi-VN");if(Array.isArray(t)){if(t.length===0)return"Ch\u01B0a ch\u1ECDn";if(e.type==="date-range"||t[0]instanceof Date||t[1]instanceof Date){let o=s=>{if(!s)return"";if(s instanceof Date)return s.toLocaleDateString("vi-VN");let l=new Date(s);return isNaN(l.getTime())?String(s):l.toLocaleDateString("vi-VN")},i=o(t[0]),a=o(t[1]);return i&&a?`${i} - ${a}`:i||a||"Ch\u01B0a ch\u1ECDn"}let r=o=>{if(e.options&&e.options.length>0){let i=e.options.find(a=>String(a.value)===String(o));if(i)return String(i.label)}return String(o)};return t.length===1?r(t[0]):`${r(t[0])}, +${t.length-1}`}if(e.options&&e.options.length>0){let r=e.options.find(n=>String(n.value)===String(t));if(r)return String(r.label)}return String(t)}function dg({field:e,currentValue:t,isOpen:r,onOpenChange:n,onRemove:o,onChange:i}){let a=e.name,{refs:{setFloating:s,setReference:l},floatingStyles:f,context:c}=(0,ut.useFloating)({open:r,onOpenChange:n,placement:"bottom-start",transform:!1,middleware:[(0,ut.offset)(6),(0,ut.flip)(),(0,ut.shift)({padding:8})],whileElementsMounted:ut.autoUpdate}),{isMounted:w,styles:p}=rt(c),m=(0,ut.useClick)(c),v=(0,ut.useDismiss)(c,{outsidePress:g=>!g.target?.closest?.("[data-table-filter-popover]")}),{getReferenceProps:x,getFloatingProps:h}=(0,ut.useInteractions)([m,v]),k=(0,gn.useRef)(null);(0,gn.useEffect)(()=>{r&&k.current?.focus({preventScroll:!0})},[r]);let T=t!=null&&t!==""&&(!Array.isArray(t)||t.length>0&&(t[0]!=null||t[1]!=null)),y=wp(e,t),d=e.type==="date"||e.type==="date-range",u=()=>e.type==="custom"?e.render?.({value:t,onChange:g=>i(a,g)})??null:e.type==="date-range"?(0,Ae.jsx)(No,{portal:!1,size:"sm",radius:"md",placeholder:e.placeholder||"Ch\u1ECDn kho\u1EA3ng ng\xE0y",value:t||[null,null],onChange:g=>i(a,g),...e.props||{}}):e.type==="date"?(0,Ae.jsx)(To,{portal:!1,size:"sm",radius:"md",placeholder:e.placeholder||"Ch\u1ECDn ng\xE0y",value:t,onChange:g=>i(a,g),...e.props||{}}):e.type==="number"?(0,Ae.jsx)(fo,{ref:k,size:"sm",radius:"full",placeholder:e.placeholder||"Nh\u1EADp s\u1ED1...",value:t??"",onChange:g=>{let b=g.target.value;if(b==="")i(a,"");else{let S=On(b);i(a,S!==void 0?S:b)}},onClear:()=>i(a,""),...e.props||{}}):e.type==="select"||e.type==="checkbox-group"?(0,Ae.jsx)(bo,{size:"sm",value:t||[],onChange:g=>i(a,g),options:(e.options||[]).map(g=>({value:String(g.value),label:g.label,disabled:g.disabled})),className:"max-h-48 overflow-y-auto py-1 gap-2",...e.props||{}}):(0,Ae.jsx)(Yt,{ref:k,size:"sm",radius:"full",placeholder:e.placeholder||"Nh\u1EADp t\u1EEB kh\xF3a...",value:t||"",onChange:g=>i(a,g.target.value),...e.props||{}});return(0,Ae.jsxs)(Ae.Fragment,{children:[(0,Ae.jsx)("div",{ref:l,...x({className:"inline-flex items-center"}),children:(0,Ae.jsxs)(ir,{size:"sm",variant:"soft",color:T||r?"primary":"neutral",radius:"full","data-testid":`filter-chip-${a}`,className:`cursor-pointer select-none transition-all duration-150 gap-1 px-3 py-1 rounded-full ${r?"ring-2 ring-primary-500/30":"hover:opacity-90"}`,onDelete:o,deleteAriaLabel:`X\xF3a b\u1ED9 l\u1ECDc ${e.label}`,children:[(0,Ae.jsxs)("span",{className:"font-semibold",children:[e.label,":"]}),(0,Ae.jsx)("span",{"data-testid":`filter-chip-val-${a}`,className:T?"font-medium":"opacity-70 italic",children:y})]})}),w&&(0,Ae.jsx)(ut.FloatingPortal,{children:(0,Ae.jsxs)("div",{ref:s,"data-table-filter-popover":"true","data-testid":`filter-popover-${a}`,style:{...f,...p,zIndex:lt.SELECT_FILTER},...h({className:`bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-700 rounded-lg p-3 shadow-2xl ${d?"w-auto min-w-[280px]":"min-w-64 max-w-xs"}`}),children:[(0,Ae.jsxs)("div",{className:"flex items-center justify-between pb-2 mb-2 border-b border-neutral-100 dark:border-neutral-800",children:[(0,Ae.jsx)("span",{className:"text-xs font-bold text-neutral-800 dark:text-neutral-200",children:e.label}),(0,Ae.jsx)("button",{type:"button",onClick:()=>n(!1),className:"text-neutral-400 hover:text-neutral-600 dark:hover:text-neutral-200 p-0.5 rounded transition-colors cursor-pointer",title:"\u0110\xF3ng",children:(0,Ae.jsx)(Ve,{className:"w-3.5 h-3.5"})})]}),(0,Ae.jsx)("div",{className:"mt-1",children:u()}),(0,Ae.jsxs)("div",{className:"flex items-center justify-between mt-3 pt-2 border-t border-neutral-100 dark:border-neutral-800",children:[(0,Ae.jsx)("button",{type:"button",onClick:o,className:"text-[11px] text-red-500 hover:text-red-700 transition-colors cursor-pointer font-medium",children:"X\xF3a b\u1ED9 l\u1ECDc"}),(0,Ae.jsx)("button",{type:"button",onClick:()=>n(!1),className:"text-[11px] font-medium text-neutral-700 dark:text-neutral-200 hover:bg-neutral-100 dark:hover:bg-neutral-800 px-2 py-0.5 rounded border border-neutral-200 dark:border-neutral-700 transition-colors cursor-pointer",children:"Xong"})]})]})})]})}function wd({filters:e,values:t,onChange:r,onReset:n,className:o=""}){let[i,a]=(0,gn.useState)([]),s=(0,gn.useMemo)(()=>{let P=[],I=new Set;return e?.forEach(E=>{let N=t?.[E.name];N!=null&&N!==""&&(!Array.isArray(N)||N.length>0&&(N[0]!=null||N[1]!=null))&&(P.push(E.name),I.add(E.name))}),i.forEach(E=>{I.has(E)||(P.push(E),I.add(E))}),P},[e,t,i]),l=(0,gn.useMemo)(()=>new Set(s),[s]),[f,c]=(0,gn.useState)(null),[w,p]=(0,gn.useState)(!1),{refs:{setFloating:m,setReference:v},floatingStyles:x,context:h}=(0,ut.useFloating)({open:w,onOpenChange:p,placement:"bottom-start",transform:!1,middleware:[(0,ut.offset)(6),(0,ut.flip)(),(0,ut.shift)({padding:8})],whileElementsMounted:ut.autoUpdate}),{isMounted:k,styles:T}=rt(h,{duration:120}),y=(0,ut.useClick)(h),d=(0,ut.useDismiss)(h,{outsidePress:P=>!P.target?.closest?.("[data-table-filter-popover]")}),{getReferenceProps:u,getFloatingProps:g}=(0,ut.useInteractions)([y,d]),b=P=>{l.has(P.name)||a(I=>[...I,P.name]),p(!1),c(P.name)},S=P=>{a(I=>I.filter(E=>E!==P)),f===P&&c(null),r(P,void 0)},R=P=>{P.stopPropagation(),a([]),c(null),n?.()},D=s.length>0;return!e||e.length===0?null:(0,Ae.jsxs)("div",{onClick:P=>P.stopPropagation(),onMouseDown:P=>P.stopPropagation(),className:`inline-flex flex-wrap items-center gap-2 ${o}`.trim(),children:[(0,Ae.jsxs)("div",{className:"inline-flex",children:[(0,Ae.jsxs)("button",{ref:v,type:"button","data-testid":"table-add-filter-button",...u({className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-neutral-700 dark:text-neutral-300 hover:text-neutral-900 dark:hover:text-neutral-100 bg-white dark:bg-neutral-800 border border-neutral-300 dark:border-neutral-700 hover:border-neutral-400 dark:hover:border-neutral-600 rounded-full transition-all shadow-xs hover:shadow-sm cursor-pointer active:scale-95"}),children:[(0,Ae.jsx)(Zr,{className:"w-3.5 h-3.5 text-neutral-500"}),(0,Ae.jsx)("span",{children:"B\u1ED9 l\u1ECDc"}),(0,Ae.jsx)(yt,{className:`w-3 h-3 text-neutral-400 transition-transform ${w?"rotate-180":""}`})]}),k&&(0,Ae.jsx)(ut.FloatingPortal,{children:(0,Ae.jsxs)("div",{ref:m,"data-table-filter-popover":"true","data-testid":"table-add-filter-menu",style:{...x,...T,zIndex:lt.SELECT_FILTER},...g({className:"bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-700 rounded-lg p-1.5 shadow-xl min-w-48"}),children:[(0,Ae.jsx)("div",{className:"px-2 py-1 text-[11px] font-semibold text-neutral-400 uppercase tracking-wider",children:"Ch\u1ECDn tr\u01B0\u1EDDng c\u1EA7n l\u1ECDc"}),(0,Ae.jsx)("div",{className:"space-y-0.5 mt-0.5",children:e.map(P=>{let I=l.has(P.name);return(0,Ae.jsxs)("button",{type:"button","data-testid":`filter-option-${P.name}`,onClick:E=>{E.preventDefault(),E.stopPropagation(),b(P)},className:`w-full flex items-center justify-between px-2.5 py-1.5 text-xs rounded-md text-left transition-colors cursor-pointer ${I?"text-primary-600 font-medium bg-primary-50 dark:bg-primary-950/40":"text-neutral-700 dark:text-neutral-200 hover:bg-neutral-100 dark:hover:bg-neutral-800"}`,children:[(0,Ae.jsx)("span",{children:P.label}),I&&(0,Ae.jsx)("span",{className:"text-[10px] text-neutral-400",children:"\u0110ang l\u1ECDc"})]},P.name)})})]})})]}),e.map(P=>{if(!l.has(P.name))return null;let I=t?.[P.name],E=f===P.name;return(0,Ae.jsx)(dg,{field:P,currentValue:I,isOpen:E,onOpenChange:N=>{c(N?P.name:null)},onRemove:()=>S(P.name),onChange:r},P.name)}),D&&(0,Ae.jsxs)("button",{type:"button","data-testid":"table-filter-reset-button",onClick:R,className:"inline-flex items-center gap-1 px-2 py-1 text-xs font-medium text-neutral-500 hover:text-red-600 dark:hover:text-red-400 transition-colors cursor-pointer",title:"\u0110\u1EB7t l\u1EA1i to\xE0n b\u1ED9 b\u1ED9 l\u1ECDc",children:[(0,Ae.jsx)(cr,{className:"w-3.5 h-3.5"}),(0,Ae.jsx)("span",{children:"\u0110\u1EB7t l\u1EA1i"})]})]})}var xt=require("react/jsx-runtime"),fg={};function Ws({table:e,searchPlaceholder:t="T\xECm ki\u1EBFm trong b\u1EA3ng...",enableGlobalFilter:r=!0,enableColumnVisibility:n=!0,isRefresh:o=!1,onRefresh:i,actions:a,selectedActions:s,filters:l,filterValues:f=fg,onFilterChange:c,onFilterReset:w,className:p=""}){let m=e.state.globalFilter??"",v=e.getAllLeafColumns().filter(y=>y.getCanHide()),x=e.getSelectedRowModel?.()?.rows??[],h=x.length,k=y=>{e.setGlobalFilter(y.target.value)},T=()=>{e.setGlobalFilter("")};return(0,xt.jsxs)("div",{className:`flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-3 pb-3 ${p}`.trim(),children:[(0,xt.jsxs)("div",{className:"flex flex-1 flex-wrap items-center gap-3",children:[r&&(0,xt.jsxs)("div",{className:"relative w-full sm:w-64 max-w-xs",children:[(0,xt.jsx)("span",{className:"absolute inset-y-0 left-0 flex items-center pl-2.5 pointer-events-none text-neutral-400",children:(0,xt.jsx)(mo,{className:"w-4 h-4"})}),(0,xt.jsx)("input",{type:"text",value:m,onChange:k,placeholder:t,"data-testid":"table-search-input",className:"w-full h-9 pl-8 pr-8 rounded-full border border-neutral-300 bg-white text-xs sm:text-sm text-neutral-800 placeholder:text-neutral-400 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500 shadow-xs transition-colors"}),m&&(0,xt.jsx)("button",{type:"button",onClick:T,"aria-label":"X\xF3a t\xECm ki\u1EBFm","data-testid":"table-clear-search-button",className:"absolute inset-y-0 right-0 flex items-center pr-2.5 text-neutral-400 hover:text-neutral-600 cursor-pointer",children:(0,xt.jsx)(Ve,{className:"w-3.5 h-3.5"})})]}),l&&l.length>0&&c&&(0,xt.jsx)(wd,{filters:l,values:f,onChange:c,onReset:w}),h>0&&s&&(0,xt.jsx)("div",{className:"flex items-center gap-2 animate-in fade-in-50 duration-200",children:s(x)})]}),(0,xt.jsxs)("div",{className:"flex items-center gap-2 self-end sm:self-auto",children:[(o||!!i)&&(0,xt.jsx)(qr,{icon:(0,xt.jsx)(Kn,{className:"w-3.5 h-3.5"}),"aria-label":"L\xE0m m\u1EDBi d\u1EEF li\u1EC7u",title:"L\xE0m m\u1EDBi d\u1EEF li\u1EC7u",size:"sm",variant:"outline",color:"neutral",onClick:i,"data-testid":"table-refresh-button"}),n&&v.length>0&&(0,xt.jsxs)(ia,{size:"sm",placement:"bottom-end",children:[(0,xt.jsx)(hs,{asChild:!0,children:(0,xt.jsx)(xr,{variant:"outline",size:"sm",color:"neutral",leftIcon:(0,xt.jsx)(cs,{className:"w-3.5 h-3.5"}),children:"C\u1ED9t"})}),(0,xt.jsxs)(Lu,{className:"w-56 p-0 shadow-lg border border-neutral-200",children:[(0,xt.jsx)(Hu,{className:"px-3 py-2 text-xs font-semibold text-neutral-700 border-b border-neutral-100",children:"Hi\u1EC3n th\u1ECB c\u1ED9t"}),(0,xt.jsx)(Au,{className:"max-h-60 overflow-y-auto p-1.5 flex flex-col gap-0.5",children:v.map(y=>{let d=typeof y.columnDef.header=="string"?y.columnDef.header:y.id;return(0,xt.jsx)("div",{className:"w-full",children:(0,xt.jsx)(Jr,{size:"sm",label:d,checked:y.getIsVisible(),onChange:y.getToggleVisibilityHandler(),className:"w-full",wrapperClassName:"w-full flex items-center px-2 py-1.5 rounded-md hover:bg-neutral-100/80 cursor-pointer select-none",labelClassName:"text-xs text-neutral-700 font-medium truncate"})},y.id)})})]})]}),a]})]})}var Xr=require("react"),Oc=require("@tanstack/react-table"),$r=require("@dnd-kit/core"),kp=require("@dnd-kit/modifiers"),La=require("@dnd-kit/sortable");var ot=require("@tanstack/react-table");var Cp=require("@tanstack/match-sorter-utils"),Ks=(e,t,r,n)=>{let o=(0,Cp.rankItem)(e.getValue(t),String(r??""));return n?.({itemRank:o}),o.passed};var Ac=(0,ot.tableFeatures)({rowSortingFeature:ot.rowSortingFeature,rowPaginationFeature:ot.rowPaginationFeature,rowSelectionFeature:ot.rowSelectionFeature,columnFilteringFeature:ot.columnFilteringFeature,globalFilteringFeature:ot.globalFilteringFeature,columnVisibilityFeature:ot.columnVisibilityFeature,columnPinningFeature:ot.columnPinningFeature,columnOrderingFeature:ot.columnOrderingFeature,sortedRowModel:(0,ot.createSortedRowModel)(),paginatedRowModel:(0,ot.createPaginatedRowModel)(),filteredRowModel:(0,ot.createFilteredRowModel)(),filterFns:{fuzzy:Ks}});function Cd(){return(0,ot.createColumnHelper)()}function _s(e){let{features:t=Ac,columns:r,...n}=e;return(0,ot.useTable)({features:t,columns:r,...n})}var it=require("react/jsx-runtime");function kd({columns:e,data:t,variant:r="default",size:n="md",isLoading:o=!1,isRefresh:i=!1,onRefresh:a,loadingRowsCount:s=5,emptyText:l,emptyIllustration:f,enableSorting:c=!0,enableFiltering:w=!0,enablePagination:p=!0,enableRowSelection:m=!1,enableColumnVisibility:v=!0,enableColumnOrdering:x=!1,filters:h,searchPlaceholder:k,toolbarActions:T,renderBulkActions:y,pageSizeOptions:d,initialPageSize:u=Os,manualPagination:g=!1,manualSorting:b=!1,manualFiltering:S=!1,pageCount:R,rowCount:D,pagination:P,onPaginationChange:I,sorting:E,onSortingChange:N,rowSelection:M,onRowSelectionChange:z,columnVisibility:H,onColumnVisibilityChange:V,columnOrder:Y,onColumnOrderChange:$,globalFilter:F,onGlobalFilterChange:G,globalFilterFn:A,columnFilters:j,onColumnFiltersChange:B,onRowClick:X,className:le="",containerClassName:ne=""}){let[ue,ie]=(0,Xr.useState)([]),[Q,q]=(0,Xr.useState)({pageIndex:0,pageSize:u}),[ge,ke]=(0,Xr.useState)({}),[L,te]=(0,Xr.useState)({}),[Z,he]=(0,Xr.useState)([]),[ae,ve]=(0,Xr.useState)(""),[Se,ye]=(0,Xr.useState)(()=>{if(!h)return[];let K=[];return h.forEach(_=>{_.defaultValue!==void 0&&_.defaultValue!==null&&_.defaultValue!==""&&(!Array.isArray(_.defaultValue)||_.defaultValue.length>0)&&K.push({id:_.name,value:_.defaultValue})}),K}),J=E??ue,O=K=>{let _=typeof K=="function"?K(J):K;N?N(_):ie(_)},W=P??Q,we=K=>{let _=typeof K=="function"?K(W):K;I?I(_):q(_)},fe=M??ge,se=K=>{let _=typeof K=="function"?K(fe):K;z?z(_):ke(_)},me=H??L,Re=K=>{let _=typeof K=="function"?K(me):K;V?V(_):te(_)},xe=Y??Z,re=K=>{let _=typeof K=="function"?K(xe):K;$?$(_):he(_)},de=F??ae,ce=K=>{let _=typeof K=="function"?K(de):K;G?G(String(_??"")):ve(String(_??""))},ee=j??Se,U=(0,Xr.useMemo)(()=>{let K={};return ee.forEach(_=>{K[_.id]=_.value}),K},[ee]),Ce=(K,_)=>{let ze=ee.filter(Fe=>Fe.id!==K);_!=null&&_!==""&&(!Array.isArray(_)||_.length>0)&&ze.push({id:K,value:_}),B?B(ze):ye(ze)},$e=()=>{B?B([]):ye([])},Ee=(0,Xr.useMemo)(()=>{let K=e;return!S&&h&&h.length>0&&(K=K.map(_=>{let ze=_.id??_.accessorKey,pe=h.find(Fe=>Fe.name===ze);return!pe||_.filterFn?_:pe.type==="select"||pe.type==="checkbox-group"?{..._,filterFn:(Fe,et,Ge)=>{if(!Ge||Array.isArray(Ge)&&Ge.length===0)return!0;let at=Fe.getValue(et);return Array.isArray(Ge)?Ge.some(tt=>String(tt).toLowerCase()===String(at).toLowerCase()):String(at).toLowerCase()===String(Ge).toLowerCase()}}:pe.type==="date-range"?{..._,filterFn:(Fe,et,Ge)=>{if(!Ge||!Array.isArray(Ge))return!0;let[at,tt]=Ge;if(!at&&!tt)return!0;let Ne=Fe.getValue(et);if(!Ne)return!1;let Xe=Ne instanceof Date?Ne:new Date(Ne);if(isNaN(Xe.getTime()))return!1;if(at){let be=new Date(at);if(be.setHours(0,0,0,0),Xe<be)return!1}if(tt){let be=new Date(tt);if(be.setHours(23,59,59,999),Xe>be)return!1}return!0}}:_})),m&&!e.some(ze=>ze.id==="_select")?[{id:"_select",header:({table:pe})=>(0,it.jsx)("div",{className:"flex items-center justify-center",children:(0,it.jsx)(Jr,{size:"sm",checked:pe.getIsAllPageRowsSelected(),config:{indeterminate:pe.getIsSomePageRowsSelected()},onChange:pe.getToggleAllPageRowsSelectedHandler(),"aria-label":"Ch\u1ECDn t\u1EA5t c\u1EA3 c\xE1c d\xF2ng tr\xEAn trang n\xE0y"})}),cell:({row:pe})=>(0,it.jsx)("div",{className:"flex items-center justify-center",children:(0,it.jsx)(Jr,{size:"sm",checked:pe.getIsSelected(),disabled:!pe.getCanSelect(),onChange:pe.getToggleSelectedHandler(),"aria-label":`Ch\u1ECDn d\xF2ng ${pe.id}`})}),enableSorting:!1,enableHiding:!1},...K]:K},[e,m,S,h]),oe=_s({data:t,columns:Ee,state:{sorting:J,pagination:W,rowSelection:fe,columnVisibility:me,columnOrder:xe,globalFilter:de,columnFilters:S?[]:ee},enableSorting:c,enableRowSelection:m,manualPagination:g,manualSorting:b,manualFiltering:!1,globalFilterFn:A??"fuzzy",pageCount:R,rowCount:D,onSortingChange:O,onPaginationChange:we,onRowSelectionChange:se,onColumnVisibilityChange:Re,onColumnOrderChange:re,onGlobalFilterChange:ce}),Te=oe.getVisibleLeafColumns().length,Pe=p?oe.getRowModel().rows:oe.getPrePaginatedRowModel?.()?.rows??oe.getRowModel().rows,Qe=w||v||!!(h&&h.length>0)||!!(i||a)||!!T||!!y,We=(0,$r.useSensors)((0,$r.useSensor)($r.PointerSensor,{activationConstraint:{distance:8}}),(0,$r.useSensor)($r.KeyboardSensor)),Be=(0,Xr.useMemo)(()=>oe.getVisibleLeafColumns().map(K=>K.id),[oe]),Oe=K=>{let{active:_,over:ze}=K;if(_&&ze&&_.id!==ze.id){if(_.id==="_select"||ze.id==="_select")return;let pe=oe.getVisibleLeafColumns().map(Ge=>Ge.id),Fe=pe.indexOf(_.id),et=pe.indexOf(ze.id);if(Fe!==-1&&et!==-1){let Ge=(0,La.arrayMove)(pe,Fe,et);re(Ge)}}},Ze=(0,it.jsxs)(Gs,{variant:r,size:n,containerClassName:ne,children:[(0,it.jsx)(js,{children:oe.getHeaderGroups().map(K=>(0,it.jsx)(Uo,{isHoverable:!1,children:x?(0,it.jsx)(La.SortableContext,{items:Be,strategy:La.horizontalListSortingStrategy,children:K.headers.map(_=>{if(_.isPlaceholder)return(0,it.jsx)(lo,{},_.id);let ze=_.column.getCanSort()&&c,pe=_.column.getIsSorted(),Fe=ze?pe==="asc"?"ascending":pe==="desc"?"descending":"none":void 0,et=(0,Oc.flexRender)(_.column.columnDef.header,_.getContext());return(0,it.jsx)(vd,{header:_,canSort:ze,ariaSort:Fe,headerContent:et},_.id)})}):K.headers.map(_=>{if(_.isPlaceholder)return(0,it.jsx)(lo,{},_.id);let ze=_.column.getCanSort()&&c,pe=_.column.getIsSorted(),Fe=ze?pe==="asc"?"ascending":pe==="desc"?"descending":"none":void 0,et=(0,Oc.flexRender)(_.column.columnDef.header,_.getContext());return(0,it.jsx)(lo,{"aria-sort":Fe,"data-column-id":_.column.id,children:ze&&typeof _.column.columnDef.header=="string"?(0,it.jsx)(Ii,{column:_.column,title:_.column.columnDef.header}):et},_.id)})},K.id))}),(0,it.jsx)(Us,{children:o||i?Array.from({length:s}).map((K,_)=>(0,it.jsx)(Uo,{isHoverable:!1,children:Array.from({length:Te}).map((ze,pe)=>(0,it.jsx)(zi,{children:(0,it.jsx)(Oo,{className:"h-4 w-full rounded"})},`skeleton-cell-${_}-${pe}`))},`skeleton-row-${_}`)):Pe.length===0?(0,it.jsx)(Uo,{isHoverable:!1,children:(0,it.jsx)(zi,{colSpan:Te,className:"py-12 text-center",children:f??(0,it.jsx)(Mo,{size:"sm",image:de?"search":"default",description:l||(de?"Kh\xF4ng t\xECm th\u1EA5y k\u1EBFt qu\u1EA3 ph\xF9 h\u1EE3p v\u1EDBi t\u1EEB kh\xF3a":"Kh\xF4ng c\xF3 d\u1EEF li\u1EC7u hi\u1EC3n th\u1ECB")})})}):Pe.map(K=>{let _=K.getIsSelected();return(0,it.jsx)(Uo,{isSelected:_,isHoverable:!0,onClick:()=>X?.(K),className:X?"cursor-pointer":void 0,children:K.getVisibleCells().map(ze=>(0,it.jsx)(zi,{children:(0,Oc.flexRender)(ze.column.columnDef.cell,ze.getContext())},ze.id))},K.id)})})]});return(0,it.jsxs)("div",{className:`w-full space-y-2 ${le}`.trim(),children:[Qe&&(0,it.jsx)(Ws,{table:oe,searchPlaceholder:k,enableGlobalFilter:w,enableColumnVisibility:v,isRefresh:i,onRefresh:a,actions:T,selectedActions:y,filters:h,filterValues:U,onFilterChange:Ce,onFilterReset:$e}),x?(0,it.jsx)($r.DndContext,{collisionDetection:$r.closestCenter,modifiers:[kp.restrictToHorizontalAxis],onDragEnd:Oe,sensors:We,children:Ze}):Ze,p&&!o&&Pe.length>0&&(0,it.jsx)(Ys,{table:oe,pageSizeOptions:d})]})}0&&(module.exports={AUDIO_EXTENSIONS,Alert,AlertCircleIcon,AlertTriangleIcon,ArrowDownIcon,ArrowUpDownIcon,ArrowUpIcon,AvatarIcon,Badge,Button,Calendar,CalendarHeader,CalendarIcon,Carousel,CarouselContent,CarouselNext,CarouselPagination,CarouselPrevious,CarouselSlide,CheckCircleIcon,CheckIcon,Checkbox,CheckboxGroup,ChevronDownIcon,ChevronLeftIcon,ChevronRightIcon,ClockIcon,CloseIcon,Collapse,CollapseContent,CollapseHeader,CollapsePanel,Collapsible,Confirm,ConfirmBody,ConfirmClose,ConfirmContainer,ConfirmFooter,ConfirmHeader,CropIcon,DEFAULT_PAGE_SIZE,DEFAULT_PAGE_SIZE_OPTIONS,DEFAULT_TOAST_DURATION,DOCUMENT_EXTENSIONS,DataTable,DatePicker,DateRangeCalendar,DateRangeDayGrid,DateRangeHeader,DateRangeMonthGrid,DateRangePicker,DateRangeYearGrid,DateTimePicker,DateTimeRangePicker,DayGrid,DoubleChevronLeftIcon,DoubleChevronRightIcon,DownloadIcon,Dropdown,DropdownGroup,DropdownHeader,DropdownItem,DropdownMenu,DropdownSeparator,DropdownTrigger,Empty,EmptyDefaultIcon,EmptyErrorIcon,EmptyFolderIcon,EmptyIllustration,EmptySearchIcon,EmptySimpleIcon,EyeIcon,FileContainer,FileIcon,FilePreview,FlipHorizontalIcon,IMAGE_EXTENSIONS,IconButton,ImageIcon,ImagePreview,ImagePreviewToolbar,InfoCircleIcon,Input,LoadingImage,MinusIcon,Modal,ModalBody,ModalClose,ModalContainer,ModalFooter,ModalHeader,MonthGrid,MultiInput,MultiSelect,MultiSelectTrigger,NumberInput,OtpInput,PDF_EXTENSIONS,PasswordInput,PlusIcon,Popover,PopoverBody,PopoverClose,PopoverContent,PopoverFooter,PopoverHeader,PopoverTrigger,Radio,RadioDotIcon,RadioGroup,ResetIcon,RotateCcwIcon,RotateCwIcon,SearchIcon,Select,SelectComponent,SelectMenu,SelectMenuFilter,SelectOption,SelectTrigger,SingleSelectTrigger,Skeleton,Slider,SliderMarks,SliderStepDots,SliderThumb,SlidersHorizontalIcon,Spinner,Tab,TabList,TabPanel,TabPanels,Table,TableBody,TableCaption,TableCell,TableColumnHeader,TableFooter,TableHead,TableHeader,TablePagination,TableRow,TableToolbar,Tabs,TextArea,TimeColumn,TimePicker,TimeRangePicker,TimeView,Toaster,Toggle,Tooltip,TrashIcon,UploadAvatar,UploadAvatarCropContent,UploadAvatarCropModal,UploadFile,UploadFileDropzone,UploadFileItemRow,UploadFileList,UploadIcon,UploadImage,UploadImageDropzone,UploadImageList,VIDEO_EXTENSIONS,YearGrid,ZoomInIcon,ZoomOutIcon,checkIsDisabled,clamp,combineDateTime,createDateWithTime,createTableColumnHelper,defaultTableFeatures,downloadFile,formatBytes,formatDate,formatDateTime,formatNumberString,formatTime,fuzzyFilter,generateCalendarGrid,generateRangeCalendarGrid,getDefaultDateTimeFormat,getDefaultFormat,getFileCategory,getFileExtension,getFileName,getFileType,getISOWeekNumber,getPercentage,getSafeConfig,isDateAfter,isDateBefore,isSameDay,isSameMonth,isSameTime,isTimeAfter,isTimeBefore,isTimeInRange,isValidOtpChar,normalizePreviewFile,padZero,parseDate,parseDateTime,parseNumber,parseRawNumberString,parseTimeToDate,rankAndFilterItems,resolveLocale,sanitizeOtpString,splitTagsFromText,toDate,toDateTime,toTimeObject,toast,useAnimatedError,useCarousel,useCarouselContext,useCollapseContext,useCollapsePanelContext,useConfirmContext,useDataTable,useDebounce,useDebouncedCallback,useDropdownContext,useFileContext,useFloatingTransition,useInfiniteScroll,useModalContext,usePopoverContext,useTableStyles,useTabsContext});
|
|
6
|
+
`.trim(),children:b})}var Nd=require("react");var qt=require("react/jsx-runtime");function hm(e,t){return t<=7?Array.from({length:t},(r,o)=>o+1):e<=4?[1,2,3,4,5,"...",t]:e>=t-3?[1,"...",t-4,t-3,t-2,t-1,t]:[1,"...",e-1,e,e+1,"...",t]}function el({table:e,pageSizeOptions:t=Xs,showPageSizeSelector:r=!0,className:o=""}){let n=e.state.pagination,i=n?.pageIndex??0,a=n?.pageSize??10,s=e.getPageCount(),l=Math.max(s,1),f=i+1,u=e.getCanPreviousPage(),w=e.getCanNextPage(),g=(0,Nd.useMemo)(()=>t.map(h=>({label:`${h}`,value:h})),[t]),m=(0,Nd.useMemo)(()=>hm(f,l),[f,l]);return(0,qt.jsxs)("div",{className:`flex flex-col sm:flex-row items-center justify-between gap-4 px-2 py-3 text-xs text-neutral-600 ${o}`.trim(),children:[r?(0,qt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qt.jsx)("span",{className:"whitespace-nowrap",children:"S\u1ED1 d\xF2ng/trang:"}),(0,qt.jsx)("div",{className:"w-20","data-testid":"table-page-size-selector",children:(0,qt.jsx)(Fa,{size:"sm",options:g,value:a,onChange:h=>{h!=null&&e.setPageSize(Number(h))},searchable:!1,"aria-label":"S\u1ED1 d\xF2ng m\u1ED7i trang"})})]}):(0,qt.jsx)("div",{}),(0,qt.jsxs)("div",{className:"flex items-center gap-1 ml-auto sm:ml-0",children:[(0,qt.jsx)(vr,{icon:(0,qt.jsx)(Qo,{className:"w-3.5 h-3.5"}),"aria-label":"Trang \u0111\u1EA7u",size:"sm",variant:"outline",color:"neutral",disabled:!u,onClick:()=>e.firstPage()}),(0,qt.jsx)(vr,{icon:(0,qt.jsx)(Br,{className:"w-3.5 h-3.5"}),"aria-label":"Trang tr\u01B0\u1EDBc",size:"sm",variant:"outline",color:"neutral",disabled:!u,onClick:()=>e.previousPage()}),(0,qt.jsx)("div",{className:"flex items-center gap-1 px-1",children:m.map((h,b)=>{if(h==="...")return(0,qt.jsx)("span",{className:"w-8 h-8 flex items-center justify-center text-xs text-neutral-400 select-none",children:"..."},`ellipsis-${b}`);let x=Number(h),S=x===f;return(0,qt.jsx)("button",{type:"button",onClick:()=>e.setPageIndex(x-1),"aria-label":`Trang ${x}`,"aria-current":S?"page":void 0,className:`w-8 h-8 rounded-full flex items-center justify-center text-xs transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 ${S?"border-2 border-primary-600 text-primary-600 font-semibold bg-primary-50/50":"text-neutral-700 hover:text-neutral-900 hover:bg-neutral-100 font-medium"}`,children:x},x)})}),(0,qt.jsx)(vr,{icon:(0,qt.jsx)(sr,{className:"w-3.5 h-3.5"}),"aria-label":"Trang sau",size:"sm",variant:"outline",color:"neutral",disabled:!w,onClick:()=>e.nextPage()}),(0,qt.jsx)(vr,{icon:(0,qt.jsx)(en,{className:"w-3.5 h-3.5"}),"aria-label":"Trang cu\u1ED1i",size:"sm",variant:"outline",color:"neutral",disabled:!w,onClick:()=>e.lastPage()})]})]})}var wo=require("react"),gt=require("@floating-ui/react");var Ye=require("react/jsx-runtime");function Dp(e,t){if(t==null||t==="")return"Ch\u01B0a nh\u1EADp";if(t instanceof Date)return t.toLocaleDateString("vi-VN");if(Array.isArray(t)){if(t.length===0)return"Ch\u01B0a ch\u1ECDn";if(e.type==="date-range"||t[0]instanceof Date||t[1]instanceof Date){let n=s=>{if(!s)return"";if(s instanceof Date)return s.toLocaleDateString("vi-VN");let l=new Date(s);return isNaN(l.getTime())?String(s):l.toLocaleDateString("vi-VN")},i=n(t[0]),a=n(t[1]);return i&&a?`${i} - ${a}`:i||a||"Ch\u01B0a ch\u1ECDn"}let r=n=>{if(e.options&&e.options.length>0){let i=e.options.find(a=>String(a.value)===String(n));if(i)return String(i.label)}return String(n)};return t.length===1?r(t[0]):`${r(t[0])}, +${t.length-1}`}if(e.options&&e.options.length>0){let r=e.options.find(o=>String(o.value)===String(t));if(r)return String(r.label)}return String(t)}function xm({field:e,currentValue:t,isOpen:r,onOpenChange:o,onRemove:n,onChange:i}){let a=e.name,{refs:{setFloating:s,setReference:l},floatingStyles:f,context:u}=(0,gt.useFloating)({open:r,onOpenChange:o,placement:"bottom-start",transform:!1,middleware:[(0,gt.offset)(6),(0,gt.flip)(),(0,gt.shift)({padding:8})],whileElementsMounted:gt.autoUpdate}),{isMounted:w,styles:g}=ct(u),m=(0,gt.useClick)(u),h=(0,gt.useDismiss)(u,{outsidePress:y=>!y.target?.closest?.("[data-table-filter-popover]")}),{getReferenceProps:b,getFloatingProps:x}=(0,gt.useInteractions)([m,h]),S=(0,wo.useRef)(null);(0,wo.useEffect)(()=>{r&&S.current?.focus({preventScroll:!0})},[r]);let k=t!=null&&t!==""&&(!Array.isArray(t)||t.length>0&&(t[0]!=null||t[1]!=null)),v=Dp(e,t),p=e.type==="date"||e.type==="date-range",d=()=>e.type==="custom"?e.render?.({value:t,onChange:y=>i(a,y)})??null:e.type==="date-range"?(0,Ye.jsx)(Hn,{portal:!1,size:"sm",radius:"md",placeholder:e.placeholder||"Ch\u1ECDn kho\u1EA3ng ng\xE0y",value:t||[null,null],onChange:y=>i(a,y),...e.props||{}}):e.type==="date"?(0,Ye.jsx)($n,{portal:!1,size:"sm",radius:"md",placeholder:e.placeholder||"Ch\u1ECDn ng\xE0y",value:t,onChange:y=>i(a,y),...e.props||{}}):e.type==="number"?(0,Ye.jsx)(wn,{ref:S,size:"sm",radius:"full",placeholder:e.placeholder||"Nh\u1EADp s\u1ED1...",value:t??"",onChange:y=>{let c=y.target.value;if(c==="")i(a,"");else{let T=qo(c);i(a,T!==void 0?T:c)}},onClear:()=>i(a,""),...e.props||{}}):e.type==="select"||e.type==="checkbox-group"?(0,Ye.jsx)(kn,{size:"sm",value:t||[],onChange:y=>i(a,y),options:(e.options||[]).map(y=>({value:String(y.value),label:y.label,disabled:y.disabled})),className:"max-h-48 overflow-y-auto py-1 gap-2",...e.props||{}}):(0,Ye.jsx)(ar,{ref:S,size:"sm",radius:"full",placeholder:e.placeholder||"Nh\u1EADp t\u1EEB kh\xF3a...",value:t||"",onChange:y=>i(a,y.target.value),...e.props||{}});return(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsx)("div",{ref:l,...b({className:"inline-flex items-center"}),children:(0,Ye.jsxs)(yr,{size:"sm",variant:"soft",color:k||r?"primary":"neutral",radius:"full","data-testid":`filter-chip-${a}`,className:`cursor-pointer select-none transition-all duration-150 gap-1 px-3 py-1 rounded-full ${r?"ring-2 ring-primary-500/30":"hover:opacity-90"}`,onDelete:n,deleteAriaLabel:`X\xF3a b\u1ED9 l\u1ECDc ${e.label}`,children:[(0,Ye.jsxs)("span",{className:"font-semibold",children:[e.label,":"]}),(0,Ye.jsx)("span",{"data-testid":`filter-chip-val-${a}`,className:k?"font-medium":"opacity-70 italic",children:v})]})}),w&&(0,Ye.jsx)(gt.FloatingPortal,{children:(0,Ye.jsxs)("div",{ref:s,"data-table-filter-popover":"true","data-testid":`filter-popover-${a}`,style:{...f,...g,zIndex:pt.SELECT_FILTER},...x({className:`bg-white border border-neutral-200 rounded-lg p-3 shadow-2xl ${p?"w-auto min-w-[280px]":"min-w-64 max-w-xs"}`}),children:[(0,Ye.jsxs)("div",{className:"flex items-center justify-between pb-2 mb-2 border-b border-neutral-100",children:[(0,Ye.jsx)("span",{className:"text-xs font-bold text-neutral-800",children:e.label}),(0,Ye.jsx)("button",{type:"button",onClick:()=>o(!1),className:"text-neutral-400 hover:text-neutral-600 p-0.5 rounded transition-colors cursor-pointer",title:"\u0110\xF3ng",children:(0,Ye.jsx)(Ue,{className:"w-3.5 h-3.5"})})]}),(0,Ye.jsx)("div",{className:"mt-1",children:d()}),(0,Ye.jsxs)("div",{className:"flex items-center justify-between mt-3 pt-2 border-t border-neutral-100",children:[(0,Ye.jsx)("button",{type:"button",onClick:n,className:"text-[11px] text-red-500 hover:text-red-700 transition-colors cursor-pointer font-medium",children:"X\xF3a b\u1ED9 l\u1ECDc"}),(0,Ye.jsx)("button",{type:"button",onClick:()=>o(!1),className:"text-[11px] font-medium text-neutral-700 hover:bg-neutral-100 px-2 py-0.5 rounded border border-neutral-200 transition-colors cursor-pointer",children:"Xong"})]})]})})]})}function Dd({filters:e,values:t,onChange:r,onReset:o,className:n=""}){let[i,a]=(0,wo.useState)([]),s=(0,wo.useMemo)(()=>{let D=[],M=new Set;return e?.forEach(F=>{let P=t?.[F.name];P!=null&&P!==""&&(!Array.isArray(P)||P.length>0&&(P[0]!=null||P[1]!=null))&&(D.push(F.name),M.add(F.name))}),i.forEach(F=>{M.has(F)||(D.push(F),M.add(F))}),D},[e,t,i]),l=(0,wo.useMemo)(()=>new Set(s),[s]),[f,u]=(0,wo.useState)(null),[w,g]=(0,wo.useState)(!1),{refs:{setFloating:m,setReference:h},floatingStyles:b,context:x}=(0,gt.useFloating)({open:w,onOpenChange:g,placement:"bottom-start",transform:!1,middleware:[(0,gt.offset)(6),(0,gt.flip)(),(0,gt.shift)({padding:8})],whileElementsMounted:gt.autoUpdate}),{isMounted:S,styles:k}=ct(x,{duration:120}),v=(0,gt.useClick)(x),p=(0,gt.useDismiss)(x,{outsidePress:D=>!D.target?.closest?.("[data-table-filter-popover]")}),{getReferenceProps:d,getFloatingProps:y}=(0,gt.useInteractions)([v,p]),c=D=>{l.has(D.name)||a(M=>[...M,D.name]),g(!1),u(D.name)},T=D=>{a(M=>M.filter(F=>F!==D)),f===D&&u(null),r(D,void 0)},R=D=>{D.stopPropagation(),a([]),u(null),o?.()},N=s.length>0;return!e||e.length===0?null:(0,Ye.jsxs)("div",{onClick:D=>D.stopPropagation(),onMouseDown:D=>D.stopPropagation(),className:`inline-flex flex-wrap items-center gap-2 ${n}`.trim(),children:[(0,Ye.jsxs)("div",{className:"inline-flex",children:[(0,Ye.jsxs)("button",{ref:h,type:"button","data-testid":"table-add-filter-button",...d({className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-neutral-700 hover:text-neutral-900 bg-white border border-neutral-300 hover:border-neutral-400 rounded-full transition-all shadow-xs hover:shadow-sm cursor-pointer active:scale-95"}),children:[(0,Ye.jsx)(no,{className:"w-3.5 h-3.5 text-neutral-500"}),(0,Ye.jsx)("span",{children:"B\u1ED9 l\u1ECDc"}),(0,Ye.jsx)(zt,{className:`w-3 h-3 text-neutral-400 transition-transform ${w?"rotate-180":""}`})]}),S&&(0,Ye.jsx)(gt.FloatingPortal,{children:(0,Ye.jsxs)("div",{ref:m,"data-table-filter-popover":"true","data-testid":"table-add-filter-menu",style:{...b,...k,zIndex:pt.SELECT_FILTER},...y({className:"bg-white border border-neutral-200 rounded-lg p-1.5 shadow-xl min-w-48"}),children:[(0,Ye.jsx)("div",{className:"px-2 py-1 text-[11px] font-semibold text-neutral-400 uppercase tracking-wider",children:"Ch\u1ECDn tr\u01B0\u1EDDng c\u1EA7n l\u1ECDc"}),(0,Ye.jsx)("div",{className:"space-y-0.5 mt-0.5",children:e.map(D=>{let M=l.has(D.name);return(0,Ye.jsxs)("button",{type:"button","data-testid":`filter-option-${D.name}`,onClick:F=>{F.preventDefault(),F.stopPropagation(),c(D)},className:`w-full flex items-center justify-between px-2.5 py-1.5 text-xs rounded-md text-left transition-colors cursor-pointer ${M?"text-primary-600 font-medium bg-primary-50":"text-neutral-700 hover:bg-neutral-100"}`,children:[(0,Ye.jsx)("span",{children:D.label}),M&&(0,Ye.jsx)("span",{className:"text-[10px] text-neutral-400",children:"\u0110ang l\u1ECDc"})]},D.name)})})]})})]}),e.map(D=>{if(!l.has(D.name))return null;let M=t?.[D.name],F=f===D.name;return(0,Ye.jsx)(xm,{field:D,currentValue:M,isOpen:F,onOpenChange:P=>{u(P?D.name:null)},onRemove:()=>T(D.name),onChange:r},D.name)}),N&&(0,Ye.jsxs)("button",{type:"button","data-testid":"table-filter-reset-button",onClick:R,className:"inline-flex items-center gap-1 px-2 py-1 text-xs font-medium text-neutral-500 hover:text-red-600 transition-colors cursor-pointer",title:"\u0110\u1EB7t l\u1EA1i to\xE0n b\u1ED9 b\u1ED9 l\u1ECDc",children:[(0,Ye.jsx)(Tr,{className:"w-3.5 h-3.5"}),(0,Ye.jsx)("span",{children:"\u0110\u1EB7t l\u1EA1i"})]})]})}var kt=require("react/jsx-runtime"),vm={};function tl({table:e,searchPlaceholder:t="T\xECm ki\u1EBFm trong b\u1EA3ng...",enableGlobalFilter:r=!0,enableColumnVisibility:o=!0,isRefresh:n=!1,onRefresh:i,actions:a,selectedActions:s,filters:l,filterValues:f=vm,onFilterChange:u,onFilterReset:w,className:g=""}){let m=e.state.globalFilter??"",h=e.getAllLeafColumns().filter(v=>v.getCanHide()),b=e.getSelectedRowModel?.()?.rows??[],x=b.length,S=v=>{e.setGlobalFilter(v.target.value)},k=()=>{e.setGlobalFilter("")};return(0,kt.jsxs)("div",{className:`flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-3 pb-3 ${g}`.trim(),children:[(0,kt.jsxs)("div",{className:"flex flex-1 flex-wrap items-center gap-3",children:[r&&(0,kt.jsxs)("div",{className:"relative w-full sm:w-64 max-w-xs",children:[(0,kt.jsx)("span",{className:"absolute inset-y-0 left-0 flex items-center pl-2.5 pointer-events-none text-neutral-400",children:(0,kt.jsx)(Tn,{className:"w-4 h-4"})}),(0,kt.jsx)("input",{type:"text",value:m,onChange:S,placeholder:t,"data-testid":"table-search-input",className:"w-full h-9 pl-8 pr-8 rounded-full border border-neutral-300 bg-white text-xs sm:text-sm text-neutral-800 placeholder:text-neutral-400 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500 shadow-xs transition-colors"}),m&&(0,kt.jsx)("button",{type:"button",onClick:k,"aria-label":"X\xF3a t\xECm ki\u1EBFm","data-testid":"table-clear-search-button",className:"absolute inset-y-0 right-0 flex items-center pr-2.5 text-neutral-400 hover:text-neutral-600 cursor-pointer",children:(0,kt.jsx)(Ue,{className:"w-3.5 h-3.5"})})]}),l&&l.length>0&&u&&(0,kt.jsx)(Dd,{filters:l,values:f,onChange:u,onReset:w}),x>0&&s&&(0,kt.jsx)("div",{className:"flex items-center gap-2 animate-in fade-in-50 duration-200",children:s(b)})]}),(0,kt.jsxs)("div",{className:"flex items-center gap-2 self-end sm:self-auto",children:[(n||!!i)&&(0,kt.jsx)(vr,{icon:(0,kt.jsx)(rn,{className:"w-3.5 h-3.5"}),"aria-label":"L\xE0m m\u1EDBi d\u1EEF li\u1EC7u",title:"L\xE0m m\u1EDBi d\u1EEF li\u1EC7u",size:"sm",variant:"outline",color:"neutral",onClick:i,"data-testid":"table-refresh-button"}),o&&h.length>0&&(0,kt.jsxs)(ga,{size:"sm",placement:"bottom-end",children:[(0,kt.jsx)(Rs,{asChild:!0,children:(0,kt.jsx)(Ir,{variant:"outline",size:"sm",color:"neutral",leftIcon:(0,kt.jsx)(xs,{className:"w-3.5 h-3.5"}),children:"C\u1ED9t"})}),(0,kt.jsxs)(Yu,{className:"w-56 p-0 shadow-lg border border-neutral-200",children:[(0,kt.jsx)(Ku,{className:"px-3 py-2 text-xs font-semibold text-neutral-700 border-b border-neutral-100",children:"Hi\u1EC3n th\u1ECB c\u1ED9t"}),(0,kt.jsx)(Xu,{className:"max-h-60 overflow-y-auto p-1.5 flex flex-col gap-0.5",children:h.map(v=>{let p=typeof v.columnDef.header=="string"?v.columnDef.header:v.id;return(0,kt.jsx)("div",{className:"w-full",children:(0,kt.jsx)(io,{size:"sm",label:p,checked:v.getIsVisible(),onChange:v.getToggleVisibilityHandler(),className:"w-full",wrapperClassName:"w-full flex items-center px-2 py-1.5 rounded-md hover:bg-neutral-100/80 cursor-pointer select-none",labelClassName:"text-xs text-neutral-700 font-medium truncate"})},v.id)})})]})]}),a]})]})}var dr=require("react"),_c=require("@tanstack/react-table"),Yr=require("@dnd-kit/core"),zp=require("@dnd-kit/modifiers"),ja=require("@dnd-kit/sortable");var et=require("@tanstack/react-table");var Pd=require("@tanstack/match-sorter-utils");function Pp(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/đ/g,"d").replace(/Đ/g,"D")}var rl=(e,t,r,o)=>{let n=String(e.getValue(t)??""),i=String(r??""),a=(0,Pd.rankItem)(n,i);if(!a.passed){let s=Pp(n),l=Pp(i);a=(0,Pd.rankItem)(s,l)}return o?.({itemRank:a}),a.passed};var Kc=(0,et.tableFeatures)({rowSortingFeature:et.rowSortingFeature,rowPaginationFeature:et.rowPaginationFeature,rowSelectionFeature:et.rowSelectionFeature,columnFilteringFeature:et.columnFilteringFeature,globalFilteringFeature:et.globalFilteringFeature,columnVisibilityFeature:et.columnVisibilityFeature,columnPinningFeature:et.columnPinningFeature,columnOrderingFeature:et.columnOrderingFeature,rowExpandingFeature:et.rowExpandingFeature,sortedRowModel:(0,et.createSortedRowModel)(),paginatedRowModel:(0,et.createPaginatedRowModel)(),filteredRowModel:(0,et.createFilteredRowModel)(),expandedRowModel:(0,et.createExpandedRowModel)(),filterFns:{fuzzy:rl}});function zd(){return(0,et.createColumnHelper)()}function ol(e){let{features:t=Kc,columns:r,...o}=e;return(0,et.useTable)({features:t,columns:r,...o})}var Be=require("react/jsx-runtime");function Id({columns:e,data:t,variant:r="default",size:o="md",isLoading:n=!1,isRefresh:i=!1,onRefresh:a,loadingRowsCount:s=5,emptyText:l,emptyIllustration:f,enableSorting:u=!0,enableFiltering:w=!0,enablePagination:g=!0,enableRowSelection:m=!1,enableColumnVisibility:h=!0,enableColumnOrdering:b=!1,enableExpanding:x,enableExpandingAnimation:S=!0,expanded:k,onExpandedChange:v,getSubRows:p,getRowCanExpand:d,manualExpanding:y=!1,autoResetExpanded:c=!1,paginateExpandedRows:T=!0,renderExpandedRow:R,showExpandColumn:N,expandColumnMode:D="integrated",expandColumnId:M,expandColumnPosition:F="start",maxIndentDepth:P=4,indentSize:I=1.25,filters:z,searchPlaceholder:B,toolbarActions:V,renderBulkActions:Y,pageSizeOptions:L,initialPageSize:E=qs,manualPagination:O=!1,manualSorting:A=!1,manualFiltering:U=!1,pageCount:G,rowCount:K,debounceMs:q=300,pagination:X,onPaginationChange:fe,sorting:ae,onSortingChange:_,rowSelection:Z,onRowSelectionChange:he,columnVisibility:xe,onColumnVisibilityChange:$,columnOrder:re,onColumnOrderChange:ee,globalFilter:de,onGlobalFilterChange:ne,globalFilterFn:ze,columnFilters:ve,onColumnFiltersChange:Ce,onRowClick:J,className:j="",containerClassName:oe=""}){let[ye,ue]=(0,dr.useState)([]),[ce,ke]=(0,dr.useState)({pageIndex:0,pageSize:E}),[Te,pe]=(0,dr.useState)({}),[W,me]=(0,dr.useState)({}),[De,ie]=(0,dr.useState)([]),[H,se]=(0,dr.useState)(""),[Ie,je]=(0,dr.useState)({}),le=x??!!(R||p||k),ge=(N??le)&&D!=="none",[Ee,He]=(0,dr.useState)(()=>{if(!z)return[];let te=[];return z.forEach(Q=>{Q.defaultValue!==void 0&&Q.defaultValue!==null&&Q.defaultValue!==""&&(!Array.isArray(Q.defaultValue)||Q.defaultValue.length>0)&&te.push({id:Q.name,value:Q.defaultValue})}),te}),Oe=ae??ye,Ve=te=>{let Q=typeof te=="function"?te(Oe):te;_?_(Q):ue(Q)},Ke=X??ce,Ct=te=>{let Q=typeof te=="function"?te(Ke):te;fe?fe(Q):ke(Q)},Ne=Z??Te,Je=te=>{let Q=typeof te=="function"?te(Ne):te;he?he(Q):pe(Q)},ot=xe??W,bt=te=>{let Q=typeof te=="function"?te(ot):te;$?$(Q):me(Q)},dt=re??De,Bt=te=>{let Q=typeof te=="function"?te(dt):te;ee?ee(Q):ie(Q)},$e=de??H,Ht=te=>{let Q=typeof te=="function"?te($e):te;ne?ne(String(Q??"")):se(String(Q??""))},Rt=ve??Ee,Nt=k??Ie,st=te=>{let Q=typeof te=="function"?te(Nt):te;v?v(Q):je(Q)},tr=(0,dr.useMemo)(()=>{let te={};return Rt.forEach(Q=>{te[Q.id]=Q.value}),te},[Rt]),We=(te,Q)=>{let _e=Rt.filter(Tt=>Tt.id!==te);Q!=null&&Q!==""&&(!Array.isArray(Q)||Q.length>0)&&_e.push({id:te,value:Q}),Ce?Ce(_e):He(_e)},St=()=>{Ce?Ce([]):He([])},we=(0,dr.useMemo)(()=>{let te=e;if(!U&&z&&z.length>0&&(te=te.map(Q=>{let _e=Q.id??Q.accessorKey,Le=z.find(Tt=>Tt.name===_e);return!Le||Q.filterFn?Q:Le.type==="select"||Le.type==="checkbox-group"?{...Q,filterFn:(Tt,At,Pe)=>{if(!Pe||Array.isArray(Pe)&&Pe.length===0)return!0;let ft=Tt.getValue(At);return Array.isArray(Pe)?Pe.some(Dt=>String(Dt).toLowerCase()===String(ft).toLowerCase()):String(ft).toLowerCase()===String(Pe).toLowerCase()}}:Le.type==="date-range"?{...Q,filterFn:(Tt,At,Pe)=>{if(!Pe||!Array.isArray(Pe))return!0;let[ft,Dt]=Pe;if(!ft&&!Dt)return!0;let Oi=Tt.getValue(At);if(!Oi)return!1;let Ua=Oi instanceof Date?Oi:new Date(Oi);if(isNaN(Ua.getTime()))return!1;if(ft){let Ya=new Date(ft);if(Ya.setHours(0,0,0,0),Ua<Ya)return!1}if(Dt){let Ya=new Date(Dt);if(Ya.setHours(23,59,59,999),Ua>Ya)return!1}return!0}}:Q})),m&&(e.some(_e=>_e.id==="_select")||(te=[{id:"_select",header:({table:Le})=>(0,Be.jsx)("div",{className:"flex items-center justify-center",children:(0,Be.jsx)(io,{size:"sm",checked:Le.getIsAllPageRowsSelected(),config:{indeterminate:Le.getIsSomePageRowsSelected()},onChange:Le.getToggleAllPageRowsSelectedHandler(),"aria-label":"Ch\u1ECDn t\u1EA5t c\u1EA3 c\xE1c d\xF2ng tr\xEAn trang n\xE0y"})}),cell:({row:Le})=>(0,Be.jsx)("div",{className:"flex items-center justify-center",onClick:Tt=>Tt.stopPropagation(),children:(0,Be.jsx)(io,{size:"sm",checked:Le.getIsSelected(),disabled:!Le.getCanSelect(),onChange:Le.getToggleSelectedHandler(),"aria-label":`Ch\u1ECDn d\xF2ng ${Le.id}`})}),enableSorting:!1,enableHiding:!1},...te])),le&&ge&&D==="standalone"&&!e.some(_e=>_e.id==="_expand")){let _e={id:"_expand",header:()=>null,cell:({row:Le})=>{let Tt=Le.getCanExpand(),At=Le.getIsExpanded(),Pe=Math.min(Le.depth,P),ft=Pe>0?`${Pe*I}rem`:void 0;return(0,Be.jsx)("div",{className:"flex items-center",style:{paddingLeft:ft},children:Tt?(0,Be.jsx)(vr,{icon:(0,Be.jsx)(sr,{className:`w-3.5 h-3.5 transition-transform duration-200 ${At?"rotate-90 text-primary-600":""}`}),size:"xs",variant:"ghost",color:"neutral",radius:"sm",onClick:Dt=>{Dt.stopPropagation(),Le.toggleExpanded()},"aria-expanded":At,"aria-label":At?`Thu g\u1ECDn d\xF2ng ${Le.id}`:`M\u1EDF r\u1ED9ng d\xF2ng ${Le.id}`,"data-testid":`table-row-expand-button-${Le.id}`}):Le.depth>0?(0,Be.jsx)("span",{className:"inline-flex items-center justify-center w-6 h-6 text-neutral-300 select-none text-xs","aria-hidden":"true",children:"\u21B3"}):(0,Be.jsx)("span",{className:"w-6 h-6 inline-block","aria-hidden":"true"})})},enableSorting:!1,enableHiding:!1};if(F==="end")te=[...te,_e];else{let Le=te.findIndex(Tt=>Tt.id==="_select");Le!==-1?te=[...te.slice(0,Le+1),_e,...te.slice(Le+1)]:te=[_e,...te]}}return te},[e,m,U,z,le,ge,D,F,P,I]),Xe=ol({data:t,columns:we,state:{sorting:Oe,pagination:Ke,rowSelection:Ne,columnVisibility:ot,columnOrder:dt,globalFilter:$e,columnFilters:U?[]:Rt,expanded:Nt},enableSorting:u,enableRowSelection:m,enableExpanding:le,manualPagination:O,manualSorting:A,manualFiltering:!1,manualExpanding:y,autoResetExpanded:c,paginateExpandedRows:T,getSubRows:p,getRowCanExpand:d??(R?()=>!0:void 0),globalFilterFn:ze??"fuzzy",pageCount:G,rowCount:K,onSortingChange:Ve,onPaginationChange:Ct,onRowSelectionChange:Je,onColumnVisibilityChange:bt,onColumnOrderChange:Bt,onGlobalFilterChange:Ht,onExpandedChange:st}),Vt=Xe.getVisibleLeafColumns().length,qe=g?Xe.getRowModel().rows:Xe.getPrePaginatedRowModel?.()?.rows??Xe.getRowModel().rows,rr=(0,dr.useMemo)(()=>!le||!ge||D!=="integrated"?void 0:M||Xe.getVisibleLeafColumns().find(Q=>Q.id!=="_select"&&Q.id!=="_expand")?.id,[le,ge,D,M,Xe]),ir=Xe.getCanSomeRowsExpand?.()??!1,Me=w||h||!!(z&&z.length>0)||!!(i||a)||!!V||!!Y,be=(0,Yr.useSensors)((0,Yr.useSensor)(Yr.PointerSensor,{activationConstraint:{distance:8}}),(0,Yr.useSensor)(Yr.KeyboardSensor)),Se=(0,dr.useMemo)(()=>Xe.getVisibleLeafColumns().map(te=>te.id),[Xe]),it=te=>{let{active:Q,over:_e}=te;if(Q&&_e&&Q.id!==_e.id){if(Q.id==="_select"||_e.id==="_select"||Q.id==="_expand"||_e.id==="_expand")return;let Le=Xe.getVisibleLeafColumns().map(Pe=>Pe.id),Tt=Le.indexOf(Q.id),At=Le.indexOf(_e.id);if(Tt!==-1&&At!==-1){let Pe=(0,ja.arrayMove)(Le,Tt,At);Bt(Pe)}}},lt=(0,Be.jsxs)(Zs,{variant:r,size:o,containerClassName:oe,children:[(0,Be.jsx)(Js,{children:Xe.getHeaderGroups().map(te=>(0,Be.jsx)(bn,{isHoverable:!1,children:b?(0,Be.jsx)(ja.SortableContext,{items:Se,strategy:ja.horizontalListSortingStrategy,children:te.headers.map(Q=>{if(Q.isPlaceholder)return(0,Be.jsx)(hn,{},Q.id);let _e=Q.column.getCanSort()&&u,Le=Q.column.getIsSorted(),Tt=_e?Le==="asc"?"ascending":Le==="desc"?"descending":"none":void 0,At=(0,_c.flexRender)(Q.column.columnDef.header,Q.getContext());return(0,Be.jsx)(Rd,{header:Q,canSort:_e,ariaSort:Tt,headerContent:At},Q.id)})}):te.headers.map(Q=>{if(Q.isPlaceholder)return(0,Be.jsx)(hn,{},Q.id);let _e=Q.column.getCanSort()&&u,Le=Q.column.getIsSorted(),Tt=_e?Le==="asc"?"ascending":Le==="desc"?"descending":"none":void 0,At=(0,_c.flexRender)(Q.column.columnDef.header,Q.getContext()),Pe=_e&&typeof Q.column.columnDef.header=="string"?(0,Be.jsx)(Ai,{column:Q.column,title:Q.column.columnDef.header}):At;return(0,Be.jsx)(hn,{"aria-sort":Tt,"data-column-id":Q.column.id,children:Pe},Q.id)})},te.id))}),(0,Be.jsx)(Qs,{children:n||i?Array.from({length:s}).map((te,Q)=>(0,Be.jsx)(bn,{isHoverable:!1,children:Array.from({length:Vt}).map((_e,Le)=>(0,Be.jsx)(xn,{children:(0,Be.jsx)(Zn,{className:"h-4 w-full rounded"})},`skeleton-cell-${Q}-${Le}`))},`skeleton-row-${Q}`)):qe.length===0?(0,Be.jsx)(bn,{isHoverable:!1,children:(0,Be.jsx)(xn,{colSpan:Vt,className:"py-12 text-center",children:f??(0,Be.jsx)(Gn,{size:"sm",image:$e?"search":"default",description:l||($e?"Kh\xF4ng t\xECm th\u1EA5y k\u1EBFt qu\u1EA3 ph\xF9 h\u1EE3p v\u1EDBi t\u1EEB kh\xF3a":"Kh\xF4ng c\xF3 d\u1EEF li\u1EC7u hi\u1EC3n th\u1ECB")})})}):qe.map(te=>{let Q=te.getIsSelected(),_e=te.getIsExpanded();return(0,Be.jsxs)(dr.Fragment,{children:[(0,Be.jsx)(bn,{isSelected:Q,isHoverable:!0,onClick:()=>J?.(te),className:`
|
|
7
|
+
${J?"cursor-pointer":""}
|
|
8
|
+
${S&&te.depth>0?"animate-table-subrow-in":""}
|
|
9
|
+
`.trim()||void 0,"data-expanded":_e?"true":void 0,children:te.getVisibleCells().map(Le=>{let Tt=le&&ge&&D==="integrated"&&Le.column.id===rr,At=(0,_c.flexRender)(Le.column.columnDef.cell,Le.getContext());if(!Tt)return(0,Be.jsx)(xn,{children:At},Le.id);let Pe=te.getCanExpand(),ft=te.getIsExpanded(),Dt=Math.min(te.depth,P),Oi=Dt>0?`${Dt*I}rem`:void 0;return(0,Be.jsx)(xn,{children:(0,Be.jsxs)("div",{className:"flex items-center gap-1.5",style:{paddingLeft:Oi},children:[Pe?(0,Be.jsx)(vr,{icon:(0,Be.jsx)(sr,{className:`w-3.5 h-3.5 transition-transform duration-200 ${ft?"rotate-90 text-primary-600":""}`}),size:"xs",variant:"ghost",color:"neutral",radius:"sm",className:"shrink-0",onClick:Ua=>{Ua.stopPropagation(),te.toggleExpanded()},"aria-expanded":ft,"aria-label":ft?`Thu g\u1ECDn d\xF2ng ${te.id}`:`M\u1EDF r\u1ED9ng d\xF2ng ${te.id}`,"data-testid":`table-row-expand-button-${te.id}`}):te.depth>0?(0,Be.jsx)("span",{className:"inline-flex items-center justify-center w-5 h-5 text-neutral-300 select-none text-xs shrink-0","aria-hidden":"true",children:"\u21B3"}):ir?(0,Be.jsx)("span",{className:"w-5 h-5 shrink-0 inline-block","aria-hidden":"true"}):null,(0,Be.jsx)("div",{className:"min-w-0 flex-1",children:At})]})},Le.id)})}),_e&&R&&(0,Be.jsx)(bn,{isHoverable:!1,className:"bg-neutral-50/70 border-b border-neutral-200/80 transition-colors","data-testid":`table-expanded-row-${te.id}`,children:(0,Be.jsx)(xn,{colSpan:Vt,className:"p-0 border-none",children:(0,Be.jsx)("div",{className:S?"animate-table-expand-wrapper overflow-hidden":void 0,children:(0,Be.jsx)("div",{className:S?"p-4 animate-table-expand-content":"p-4",children:R(te)})})})},`${te.id}-expanded`)]},te.id)})})]});return(0,Be.jsxs)("div",{className:`w-full space-y-2 ${j}`.trim(),children:[Me&&(0,Be.jsx)(tl,{table:Xe,searchPlaceholder:B,enableGlobalFilter:w,enableColumnVisibility:h,isRefresh:i,onRefresh:a,actions:V,selectedActions:Y,filters:z,filterValues:tr,onFilterChange:We,onFilterReset:St}),b?(0,Be.jsx)(Yr.DndContext,{collisionDetection:Yr.closestCenter,modifiers:[zp.restrictToHorizontalAxis],onDragEnd:it,sensors:be,children:lt}):lt,g&&!n&&qe.length>0&&(0,Be.jsx)(el,{table:Xe,pageSizeOptions:L})]})}0&&(module.exports={AUDIO_EXTENSIONS,Alert,AlertCircleIcon,AlertTriangleIcon,ArrowDownIcon,ArrowUpDownIcon,ArrowUpIcon,AvatarIcon,Badge,Button,Calendar,CalendarHeader,CalendarIcon,Carousel,CarouselContent,CarouselNext,CarouselPagination,CarouselPrevious,CarouselSlide,CheckCircleIcon,CheckIcon,Checkbox,CheckboxGroup,ChevronDownIcon,ChevronLeftIcon,ChevronRightIcon,ClockIcon,CloseIcon,Collapse,CollapseContent,CollapseHeader,CollapsePanel,Collapsible,Confirm,ConfirmBody,ConfirmClose,ConfirmContainer,ConfirmFooter,ConfirmHeader,CropIcon,DEFAULT_PAGE_SIZE,DEFAULT_PAGE_SIZE_OPTIONS,DEFAULT_TOAST_DURATION,DOCUMENT_EXTENSIONS,DataTable,DatePicker,DateRangeCalendar,DateRangeDayGrid,DateRangeHeader,DateRangeMonthGrid,DateRangePicker,DateRangeYearGrid,DateTimePicker,DateTimeRangePicker,DayGrid,DoubleChevronLeftIcon,DoubleChevronRightIcon,DownloadIcon,Dropdown,DropdownGroup,DropdownHeader,DropdownItem,DropdownMenu,DropdownSeparator,DropdownTrigger,Empty,EmptyDefaultIcon,EmptyErrorIcon,EmptyFolderIcon,EmptyIllustration,EmptySearchIcon,EmptySimpleIcon,EyeIcon,FileContainer,FileIcon,FilePreview,FlipHorizontalIcon,IMAGE_EXTENSIONS,IconButton,ImageIcon,ImagePreview,ImagePreviewToolbar,InfoCircleIcon,Input,LoadingImage,MinusIcon,Modal,ModalBody,ModalClose,ModalContainer,ModalFooter,ModalHeader,MonthGrid,MultiInput,MultiSelect,MultiSelectTrigger,NumberInput,OtpInput,PDF_EXTENSIONS,PasswordInput,PlusIcon,Popover,PopoverBody,PopoverClose,PopoverContent,PopoverFooter,PopoverHeader,PopoverTrigger,Radio,RadioDotIcon,RadioGroup,ResetIcon,RotateCcwIcon,RotateCwIcon,SearchIcon,Select,SelectComponent,SelectMenu,SelectMenuFilter,SelectOption,SelectTrigger,SingleSelectTrigger,Skeleton,Slider,SliderMarks,SliderStepDots,SliderThumb,SlidersHorizontalIcon,Spinner,Tab,TabList,TabPanel,TabPanels,Table,TableBody,TableCaption,TableCell,TableColumnHeader,TableFooter,TableHead,TableHeader,TablePagination,TableRow,TableToolbar,Tabs,TextArea,TimeColumn,TimePicker,TimeRangePicker,TimeView,Toaster,Toggle,Tooltip,TrashIcon,UploadAvatar,UploadAvatarCropContent,UploadAvatarCropModal,UploadFile,UploadFileDropzone,UploadFileItemRow,UploadFileList,UploadIcon,UploadImage,UploadImageDropzone,UploadImageList,VIDEO_EXTENSIONS,YearGrid,ZoomInIcon,ZoomOutIcon,checkIsDisabled,clamp,combineDateTime,createDateWithTime,createTableColumnHelper,defaultTableFeatures,downloadFile,formatBytes,formatDate,formatDateTime,formatNumberString,formatTime,fuzzyFilter,generateCalendarGrid,generateRangeCalendarGrid,getDefaultDateTimeFormat,getDefaultFormat,getFileCategory,getFileExtension,getFileName,getFileType,getISOWeekNumber,getPercentage,getSafeConfig,isDateAfter,isDateBefore,isSameDay,isSameMonth,isSameTime,isTimeAfter,isTimeBefore,isTimeInRange,isValidOtpChar,normalizePreviewFile,padZero,parseDate,parseDateTime,parseNumber,parseRawNumberString,parseTimeToDate,rankAndFilterItems,resolveLocale,sanitizeOtpString,splitTagsFromText,toDate,toDateTime,toTimeObject,toast,useAnimatedError,useCarousel,useCarouselContext,useCollapseContext,useCollapsePanelContext,useConfirmContext,useDataTable,useDebounce,useDebouncedCallback,useDropdownContext,useFileContext,useFloatingTransition,useInfiniteScroll,useModalContext,usePopoverContext,useTableStyles,useTabsContext});
|
|
7
10
|
//# sourceMappingURL=index.cjs.map
|