@vetc-miniapp/ui-react 0.0.34 → 0.0.35

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.
@@ -3,16 +3,16 @@
3
3
  * Figma: filled/outlined/elevated/ghost styles
4
4
  * Large: h=48px, radius=12px, font=16px/600
5
5
  * Small: h=32px, radius=8px, font=14px/600
6
- * style: filled | outlined | elevated | ghost | danger | danger-outlined
6
+ * type: filled | outlined | elevated | ghost | danger | danger-outlined
7
7
  * variant: brand (green) | neutral (gray-90)
8
8
  */
9
9
  import React from 'react';
10
- export type ButtonStyle = 'filled' | 'outlined' | 'elevated' | 'ghost' | 'danger' | 'danger-outlined';
10
+ export type ButtonType = 'filled' | 'outlined' | 'elevated' | 'ghost' | 'danger' | 'danger-outlined';
11
11
  export type ButtonVariant = 'brand' | 'neutral';
12
12
  export type ButtonSize = 'lg' | 'sm';
13
13
  export type ButtonShape = 'rounded' | 'pill';
14
14
  export interface ButtonProps {
15
- style?: ButtonStyle;
15
+ type?: ButtonType;
16
16
  variant?: ButtonVariant;
17
17
  size?: ButtonSize;
18
18
  shape?: ButtonShape;
@@ -28,5 +28,5 @@ export interface ButtonProps {
28
28
  css?: React.CSSProperties;
29
29
  id?: string;
30
30
  }
31
- export declare function Button({ style, variant, size, shape, block, disabled, loading, icon, iconRight, onClick, children, htmlType, className, css, id, }: ButtonProps): import("react/jsx-runtime").JSX.Element;
31
+ export declare function Button({ type, variant, size, shape, block, disabled, loading, icon, iconRight, onClick, children, htmlType, className, css, id, }: ButtonProps): import("react/jsx-runtime").JSX.Element;
32
32
  export default Button;
@@ -1,2 +1,2 @@
1
1
  export { Button } from './Button';
2
- export type { ButtonProps, ButtonStyle, ButtonVariant, ButtonSize, ButtonShape } from './Button';
2
+ export type { ButtonProps, ButtonType, ButtonVariant, ButtonSize, ButtonShape } from './Button';
@@ -3,13 +3,13 @@
3
3
  * Figma: Chip page (7 types × 3 styles)
4
4
  */
5
5
  import React from 'react';
6
- export type ChipStyle = 'filled' | 'outlined' | 'tinted';
7
- export type ChipType = 'default' | 'positive' | 'negative' | 'warning' | 'info';
6
+ export type ChipType = 'filled' | 'outlined' | 'tinted';
7
+ export type ChipStatus = 'default' | 'positive' | 'negative' | 'warning' | 'info';
8
8
  export type ChipVariant = 'brand' | 'neutral';
9
9
  export type ChipShape = 'pill' | 'rounded';
10
10
  export interface ChipProps {
11
- style?: ChipStyle;
12
11
  type?: ChipType;
12
+ status?: ChipStatus;
13
13
  variant?: ChipVariant;
14
14
  shape?: ChipShape;
15
15
  size?: 'md' | 'sm';
@@ -22,5 +22,5 @@ export interface ChipProps {
22
22
  css?: React.CSSProperties;
23
23
  id?: string;
24
24
  }
25
- export declare function Chip({ style, type, variant, shape, size, icon, closable, onClose, onClick, children, className, css, id, }: ChipProps): import("react/jsx-runtime").JSX.Element;
25
+ export declare function Chip({ type, status, variant, shape, size, icon, closable, onClose, onClick, children, className, css, id, }: ChipProps): import("react/jsx-runtime").JSX.Element;
26
26
  export default Chip;
@@ -1,2 +1,2 @@
1
1
  export { Chip } from './Chip';
2
- export type { ChipProps, ChipStyle, ChipType, ChipShape } from './Chip';
2
+ export type { ChipProps, ChipType, ChipStatus, ChipVariant, ChipShape } from './Chip';
@@ -28,6 +28,8 @@ export interface NavigationBarProps {
28
28
  backgroundColor?: string;
29
29
  divider?: boolean;
30
30
  transparent?: boolean;
31
+ /** Portal mode — true = portal to document.body; HTMLElement = portal to specific container. Auto-applies position:fixed top:0 */
32
+ portal?: boolean | HTMLElement;
31
33
  className?: string;
32
34
  style?: React.CSSProperties;
33
35
  id?: string;
@@ -40,5 +42,5 @@ export interface NavigationBarProps {
40
42
  left?: React.ReactNode;
41
43
  right?: React.ReactNode;
42
44
  }
43
- export declare function NavigationBar({ title, leading, leadingIcon, onLeadingPress, actions, leftSlot, rightSlot, backgroundColor, divider, transparent, className, style, id, showBack, backIcon, onBack, left, right, }: NavigationBarProps): import("react/jsx-runtime").JSX.Element;
45
+ export declare function NavigationBar({ title, leading, leadingIcon, onLeadingPress, actions, leftSlot, rightSlot, backgroundColor, divider, transparent, portal, className, style, id, showBack, backIcon, onBack, left, right, }: NavigationBarProps): import("react/jsx-runtime").JSX.Element;
44
46
  export default NavigationBar;
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ export { colorGlobal, colorAlias } from './tokens/colors';
4
4
  export { fontFamily, fontWeight, fontSize, lineHeight, letterSpacing, textStyle } from './tokens/typography';
5
5
  export { spacing, borderRadius, componentHeight, shadow } from './tokens/spacing';
6
6
  export { Button } from './components/button';
7
- export type { ButtonProps, ButtonStyle, ButtonVariant, ButtonSize, ButtonShape } from './components/button';
7
+ export type { ButtonProps, ButtonType, ButtonVariant, ButtonSize, ButtonShape } from './components/button';
8
8
  export { ButtonGroup } from './components/button-group';
9
9
  export type { ButtonGroupProps, ButtonGroupAction, ButtonGroupLayout, ButtonGroupVariant } from './components/button-group';
10
10
  export { Typography, Display, Headline, Title, Label, Body } from './components/typography';
@@ -22,7 +22,7 @@ export type { RadioProps, RadioGroupProps, RadioOption, RadioVariant } from './c
22
22
  export { Switch } from './components/switch';
23
23
  export type { SwitchProps, SwitchVariant } from './components/switch';
24
24
  export { Chip } from './components/chip';
25
- export type { ChipProps, ChipStyle, ChipType, ChipShape } from './components/chip';
25
+ export type { ChipProps, ChipType, ChipStatus, ChipVariant, ChipShape } from './components/chip';
26
26
  export { Badge } from './components/badge';
27
27
  export type { BadgeProps } from './components/badge';
28
28
  export { Avatar } from './components/avatar';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{ConfigProvider as i,theme as n,App as o,Input as a,Tag as l,Avatar as c,Card as d,Divider as s,Skeleton as v,Spin as g,Modal as h}from"antd";import p,{useState as f,useRef as u,useCallback as b,useEffect as m,useMemo as y}from"react";import{createPortal as x}from"react-dom";import{LoadingOutlined as w}from"@ant-design/icons";function k(e,t){return t||("success"===e?"positive":"error"===e?"negative":"neutral")}let S=0,C=()=>{};function z(e){const t=e.duration??3,r=e.type??"default";C({type:r,variant:k(r,e.variant),placement:e.placement??"bottom",duration:t,message:e.message,description:e.description,icon:e.icon,action:e.action,closable:e.closable??0===t,onClose:e.onClose,id:++S,exiting:!1})}const H={show:e=>z(e),success:(e,t)=>z({message:e,description:t,type:"success"}),error:(e,t)=>z({message:e,description:t,type:"error"}),warning:(e,t)=>z({message:e,description:t,type:"warning"}),info:(e,t)=>z({message:e,description:t,type:"info"})};function W(){return{contextHolder:null,toast:H}}const L={neutral:"var(--vetc-toast-bg)",positive:"var(--vetc-toast-positive-bg)",negative:"var(--vetc-toast-negative-bg)"};function B(){return t("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[e("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),e("path",{d:"M10 9v5M10 6.5v.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function M(){return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e("path",{d:"M12 4L4 12M4 4l8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}const I={default:e(B,{}),success:e(function(){return t("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[e("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),e("path",{d:"M6 10l3 3 5-5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},{}),error:e(function(){return t("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[e("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),e("path",{d:"M13 7L7 13M7 7l6 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})},{}),warning:e(function(){return t("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[e("path",{d:"M10 3L2 17h16L10 3z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),e("path",{d:"M10 9v3M10 14v.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})},{}),info:e(B,{})};function T({item:r,onDismiss:i}){const n=r.icon??I[r.type],o=Boolean(r.action)||r.closable;return t("div",{role:"alert","aria-live":"polite",style:{display:"flex",alignItems:"stretch",minHeight:40,borderRadius:"var(--vetc-toast-radius)",backgroundColor:L[r.variant],boxShadow:"var(--vetc-toast-shadow)",overflow:"hidden",fontFamily:"var(--vetc-font-family)",willChange:"opacity, transform",animation:r.exiting?"vetc-toast-out 200ms ease forwards":"vetc-toast-in 250ms ease"},children:[t("div",{style:{flex:1,display:"flex",alignItems:"center",gap:n?8:0,paddingTop:8,paddingBottom:8,paddingLeft:16,paddingRight:o?12:16,minWidth:0},children:[n&&e("span",{style:{flexShrink:0,display:"flex",width:20,height:20,color:"rgba(255,255,255,1)"},children:n}),t("div",{style:{flex:1,minWidth:0},children:[e("div",{style:{fontSize:"var(--vetc-font-size-sm)",fontWeight:400,color:"var(--vetc-toast-text)",lineHeight:"20px",wordBreak:"break-word"},children:r.message}),r.description&&e("div",{style:{fontSize:"var(--vetc-font-size-xs)",color:"rgba(255,255,255,0.7)",lineHeight:"18px",marginTop:2},children:r.description})]})]}),o&&e("div",{style:{width:1,flexShrink:0,alignSelf:"stretch",margin:"8px 0",backgroundColor:"var(--vetc-toast-divider)"}}),r.action&&e("button",{onClick:()=>{r.action.onClick(),i(r.id)},style:{flexShrink:0,background:"none",border:"none",cursor:"pointer",minWidth:64,height:32,borderRadius:"var(--vetc-radius-md)",padding:r.closable?"0 8px 0 12px":"0 16px 0 12px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"var(--vetc-font-size-sm)",lineHeight:"20px",fontWeight:600,color:"var(--vetc-toast-text)",fontFamily:"var(--vetc-font-family)",whiteSpace:"nowrap",margin:"0 0 0 0",alignSelf:"center"},children:r.action.label}),r.closable&&e("button",{onClick:()=>{r.onClose?.(),i(r.id)},"aria-label":"Đóng",style:{flexShrink:0,background:"none",border:"none",cursor:"pointer",width:32,height:32,margin:"0 8px 0 4px",padding:0,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--vetc-toast-text)",borderRadius:"var(--vetc-radius-md)",alignSelf:"center"},children:e(M,{})})]})}function F(){const[i,n]=f([]),o=u(new Map),a=b(e=>{n(t=>t.map(t=>t.id===e?{...t,exiting:!0}:t));const t=setTimeout(()=>{n(t=>t.filter(t=>t.id!==e)),o.current.delete(e)},200);o.current.set(e,t)},[]);if(m(()=>(C=e=>{if(n(t=>[...t.slice(-2),e]),e.duration>0){const t=setTimeout(()=>a(e.id),1e3*e.duration);o.current.set(e.id,t)}},()=>{C=()=>{},o.current.forEach(clearTimeout)}),[a]),!i.length)return null;const l=i.filter(e=>"top"!==e.placement),c=i.filter(e=>"top"===e.placement),d=(t,r)=>e("div",{style:{position:"fixed",..."bottom"===r?{bottom:"calc(16px + var(--safe-area-inset-bottom, 0px))"}:{top:"calc(16px + var(--safe-area-inset-top, 0px))"},left:16,right:16,zIndex:1e4,display:"flex",flexDirection:"bottom"===r?"column-reverse":"column",gap:8,pointerEvents:"none"},children:t.map(t=>e("div",{style:{pointerEvents:"auto"},children:e(T,{item:t,onDismiss:a})},t.id))});return x(t(r,{children:[l.length>0&&d(l,"bottom"),c.length>0&&d(c,"top"),e("style",{children:"\n @keyframes vetc-toast-in {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes vetc-toast-out {\n from { opacity: 1; transform: translateY(0); }\n to { opacity: 0; transform: translateY(4px); }\n }\n "})]}),document.body)}const R={white:"#ffffff",black:"#000000",blue02:"#f4fbff",blue05:"#e4f4ff",blue10:"#cae9ff",blue15:"#afddff",blue20:"#95d1ff",blue25:"#7ac4fb",blue30:"#60b6f4",blue35:"#45a8eb",blue40:"#2b99df",blue45:"#108ad1",blue50:"#007ac1",blue60:"#005c9e",blue70:"#004179",blue80:"#002853",blue90:"#00122a",green02:"#f2fef2",green05:"#dffbdf",green10:"#bff4bf",green15:"#9feca7",green20:"#82e194",green25:"#68d583",green30:"#50c775",green35:"#39b669",green40:"#25a45e",green45:"#23965b",green50:"#208758",green60:"#1b6b4d",green70:"#15503f",green80:"#0f342d",green90:"#081a18",gray02:"#f9fafa",gray05:"#f1f1f2",gray10:"#e3e4e6",gray15:"#d4d6d9",gray20:"#c6c8cc",gray25:"#b8babf",gray30:"#abacb2",gray35:"#9d9ea5",gray40:"#8f9098",gray45:"#82828a",gray50:"#74747d",gray60:"#5e5d64",gray70:"#47464b",gray80:"#2f2f32",gray90:"#181719",red02:"#fff6f9",red05:"#ffe7f0",red10:"#ffd0de",red15:"#ffb8cc",red20:"#ffa1b8",red25:"#ff89a3",red30:"#fb718d",red35:"#f55c78",red40:"#ee4b62",red45:"#e53b4d",red50:"#da2c39",red60:"#b4211f",red70:"#852419",red80:"#571f12",red90:"#2b130a",orange02:"#fffbf0",orange05:"#fff3da",orange10:"#ffe3b4",orange15:"#ffd08f",orange20:"#ffbb69",orange25:"#ffa447",orange30:"#ff8c2f",orange35:"#ef7720",orange40:"#dd6e1d",orange45:"#cb651b",orange50:"#b85c18",orange60:"#934913",orange70:"#6f370f",orange80:"#4a250a",orange90:"#251205",yellow02:"#fff8e7",yellow05:"#ffefbc",yellow10:"#ffe374",yellow15:"#ffd62b",yellow20:"#f9c600",yellow25:"#e9b900",yellow30:"#daaa00",yellow35:"#ca9b00",yellow40:"#bb8b00",yellow45:"#ab7b00",yellow50:"#9c6b00",yellow60:"#7c4b00",yellow70:"#5d2f00",yellow80:"#3e1800",yellow90:"#1f0700"},N={brand:R.green40,brandDark:R.green50,brandLight:R.green05,positive:R.green50,positiveVariant:R.green05,onPositive:R.white,onPositiveVariant:R.green60,negative:R.red50,onNegative:R.white,warning:R.orange30,onWarning:R.white,outline:R.gray50,outlineVariant:R.gray10,outlineInverse:R.gray40,theme:R.white,themeVariant:R.gray05,inverseTheme:R.gray90,primaryOnTheme:R.gray90,secondaryOnTheme:R.gray60,primaryOnInverseTheme:R.white,secondaryOnInverseTheme:R.gray20,disabledBackground:R.gray10,disabledContent:R.gray30,disabledOutline:R.gray20,overlay:"rgba(0, 0, 0, 0.4)",overlayVariant:"rgba(0, 0, 0, 0.16)",skeleton:"rgba(0, 0, 0, 0.1)"},A={token:{colorPrimary:N.brand,colorPrimaryHover:R.green35,colorPrimaryActive:N.brandDark,colorPrimaryBg:R.green02,colorPrimaryBgHover:R.green05,colorError:N.negative,colorErrorHover:R.red60,colorErrorBg:R.red02,colorWarning:N.warning,colorWarningBg:R.orange02,colorSuccess:N.positive,colorSuccessBg:R.green02,colorText:N.primaryOnTheme,colorTextSecondary:N.secondaryOnTheme,colorTextDisabled:N.disabledContent,colorTextPlaceholder:R.gray50,colorBgContainer:N.theme,colorBgLayout:N.themeVariant,colorBgSpotlight:N.inverseTheme,colorBorder:R.gray20,colorBorderSecondary:R.gray10,colorSplit:R.gray10,colorFill:R.gray05,colorFillSecondary:R.gray10,colorFillTertiary:R.gray15,fontFamily:'"Roboto", system-ui, -apple-system, sans-serif',fontSize:16,fontSizeSM:13,fontSizeLG:18,fontSizeXL:19,fontSizeHeading1:32,fontSizeHeading2:28,fontSizeHeading3:24,fontSizeHeading4:19,fontSizeHeading5:16,fontWeightStrong:600,lineHeight:1.5,borderRadius:8,borderRadiusSM:6,borderRadiusLG:12,borderRadiusXS:4,controlHeight:48,controlHeightSM:32,controlHeightLG:56,paddingXS:8,paddingSM:12,padding:16,paddingMD:16,paddingLG:24,motionDurationFast:"150ms",motionDurationMid:"250ms"},components:{Button:{primaryColor:"#ffffff",defaultBorderColor:R.gray20,defaultColor:N.primaryOnTheme,borderRadius:12,borderRadiusSM:8,borderRadiusLG:12,controlHeight:48,controlHeightSM:32,paddingInline:16,paddingInlineSM:12,fontWeight:600},Input:{borderRadius:8,controlHeight:48,paddingInline:12,colorBorder:R.gray20,hoverBorderColor:N.outline,activeBorderColor:N.brand,colorBgContainer:N.theme,hoverBg:N.theme,activeBg:N.theme},Select:{borderRadius:8,controlHeight:48},Checkbox:{borderRadius:4,controlInteractiveSize:20},Radio:{radioSize:20,dotSize:8},Switch:{trackHeight:32,trackMinWidth:52,handleSize:28,colorPrimary:N.brand},Modal:{borderRadiusLG:16,paddingContentHorizontalLG:16,paddingMD:16},Card:{borderRadius:16,paddingLG:16}}};function $({children:r}){return e(i,{theme:{...A,algorithm:n.defaultAlgorithm},children:t(o,{children:[r,e(F,{})]})})}const D={primary:'"Roboto", system-ui, -apple-system, sans-serif'},j={regular:400,medium:500,semibold:600,bold:700,black:900},O={"2xs":"10px",xs:"12px",sm:"14px",base:"16px",lg:"20px",xl:"24px","2xl":"28px","3xl":"32px","4xl":"36px"},E={tight:"120%",normal:"140%",relaxed:"150%"},P={none:"0",sm:"0.1px",md:"0.25px",lg:"0.5px"},X={display4xl:{fontSize:O["4xl"],fontWeight:j.bold,lineHeight:E.tight},display3xl:{fontSize:O["3xl"],fontWeight:j.bold,lineHeight:E.tight},display2xl:{fontSize:O["2xl"],fontWeight:j.bold,lineHeight:E.tight},headlineXl:{fontSize:O.xl,fontWeight:j.bold,lineHeight:E.normal},headlineLg:{fontSize:O.lg,fontWeight:j.semibold,lineHeight:E.normal},titleBase:{fontSize:O.base,fontWeight:j.semibold,lineHeight:E.relaxed,letterSpacing:P.sm},titleSm:{fontSize:O.sm,fontWeight:j.semibold,lineHeight:E.relaxed,letterSpacing:P.sm},labelBase:{fontSize:O.base,fontWeight:j.semibold,lineHeight:E.relaxed},labelSm:{fontSize:O.sm,fontWeight:j.semibold,lineHeight:E.relaxed,letterSpacing:P.lg},labelXs:{fontSize:O.xs,fontWeight:j.semibold,lineHeight:E.relaxed,letterSpacing:P.lg},bodyBase:{fontSize:O.base,fontWeight:j.regular,lineHeight:E.relaxed,letterSpacing:P.sm},bodySm:{fontSize:O.sm,fontWeight:j.regular,lineHeight:E.relaxed,letterSpacing:P.md},bodyXs:{fontSize:O.xs,fontWeight:j.regular,lineHeight:E.relaxed,letterSpacing:P.lg},body2xs:{fontSize:O["2xs"],fontWeight:j.regular,lineHeight:E.relaxed,letterSpacing:P.lg}},V={0:"0px",1:"1px",2:"2px",4:"4px",6:"6px",8:"8px",10:"10px",12:"12px",14:"14px",16:"16px",20:"20px",24:"24px",32:"32px",40:"40px",48:"48px",56:"56px",64:"64px",72:"72px",80:"80px"},Y={none:"0px",xs:"4px",sm:"6px",md:"8px",lg:"12px",xl:"16px","2xl":"24px",pill:"1000px"},q={buttonLg:"48px",buttonSm:"32px",input:"48px",navBar:"56px",bottomNav:"56px",tabBar:"56px",listItem:"56px",chip:"32px",chipSm:"24px",iconStd:"24px",iconSm:"20px"},_={none:"none",sm:"0 1px 4px rgba(0, 0, 0, 0.08)",md:"0 2px 8px rgba(0, 0, 0, 0.12)",lg:"0 4px 16px rgba(0, 0, 0, 0.16)"},G={filled:{bg:"var(--vetc-color-brand)",bgHover:"var(--vetc-color-brand-hover)",bgActive:"var(--vetc-color-brand-active)",text:"var(--vetc-white)",border:"transparent",shadow:"none"},outlined:{bg:"transparent",bgHover:"var(--vetc-green-02)",bgActive:"var(--vetc-green-05)",text:"var(--vetc-color-brand)",border:"var(--vetc-color-brand)",shadow:"none"},elevated:{bg:"var(--vetc-color-bg)",bgHover:"var(--vetc-color-bg-hover)",bgActive:"var(--vetc-color-bg-pressed)",text:"var(--vetc-color-brand)",border:"transparent",shadow:"var(--vetc-shadow-md)"},ghost:{bg:"transparent",bgHover:"var(--vetc-color-bg-hover)",bgActive:"var(--vetc-color-bg-pressed)",text:"var(--vetc-color-brand)",border:"transparent",shadow:"none"},danger:{bg:"var(--vetc-color-negative)",bgHover:"var(--vetc-red-60)",bgActive:"var(--vetc-red-60)",text:"var(--vetc-white)",border:"transparent",shadow:"none"},"danger-outlined":{bg:"transparent",bgHover:"var(--vetc-red-02)",bgActive:"var(--vetc-red-05)",text:"var(--vetc-color-negative)",border:"var(--vetc-color-negative)",shadow:"none"}},Q={filled:{bg:"var(--vetc-gray-90)",bgHover:"var(--vetc-gray-80)",bgActive:"var(--vetc-gray-70)",text:"var(--vetc-white)",border:"transparent",shadow:"none"},outlined:{bg:"transparent",bgHover:"var(--vetc-gray-05)",bgActive:"var(--vetc-gray-10)",text:"var(--vetc-gray-90)",border:"var(--vetc-gray-90)",shadow:"none"},elevated:{bg:"var(--vetc-color-bg)",bgHover:"var(--vetc-color-bg-hover)",bgActive:"var(--vetc-color-bg-pressed)",text:"var(--vetc-color-text-primary)",border:"transparent",shadow:"var(--vetc-shadow-md)"},ghost:{bg:"transparent",bgHover:"var(--vetc-color-bg-hover)",bgActive:"var(--vetc-color-bg-pressed)",text:"var(--vetc-color-text-primary)",border:"transparent",shadow:"none"},danger:{bg:"var(--vetc-color-negative)",bgHover:"var(--vetc-red-60)",bgActive:"var(--vetc-red-60)",text:"var(--vetc-white)",border:"transparent",shadow:"none"},"danger-outlined":{bg:"transparent",bgHover:"var(--vetc-red-02)",bgActive:"var(--vetc-red-05)",text:"var(--vetc-color-negative)",border:"var(--vetc-color-negative)",shadow:"none"}},K=({color:r})=>t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",style:{animation:"vetc-btn-spin 0.6s linear infinite",flexShrink:0},"aria-hidden":"true",children:[e("circle",{cx:"8",cy:"8",r:"6",stroke:r,strokeOpacity:"0.25",strokeWidth:"2"}),e("path",{d:"M8 2a6 6 0 016 6",stroke:r,strokeWidth:"2",strokeLinecap:"round"})]});function U({style:i="filled",variant:n="brand",size:o="lg",shape:a="rounded",block:l=!1,disabled:c=!1,loading:d=!1,icon:s,iconRight:v,onClick:g,children:h,htmlType:p="button",className:u="",css:b,id:m}){const[y,x]=f(!1),[w,k]=f(!1),S=("neutral"===n?Q:G)[i],C=c||d,z="lg"===o?"var(--vetc-btn-height-lg)":"var(--vetc-btn-height-sm)",H="lg"===o?"var(--vetc-btn-font-size-lg)":"var(--vetc-btn-font-size-sm)",W="lg"===o?"var(--vetc-btn-padding-x-lg)":"var(--vetc-btn-padding-x-sm)",L="pill"===a?"var(--vetc-btn-radius-pill)":"lg"===o?"var(--vetc-btn-radius-lg)":"var(--vetc-btn-radius-sm)";let B=S.bg,M=S.border,I=S.shadow;C?(B="var(--vetc-btn-disabled-bg)",M="var(--vetc-btn-disabled-border)",I="none"):y?B=S.bgActive:w&&(B=S.bgHover);const T=C?"var(--vetc-btn-disabled-text)":S.text,F=C?"var(--vetc-gray-30)":S.text;return t(r,{children:[t("button",{id:m,type:p,disabled:C,onClick:g,onMouseEnter:()=>k(!0),onMouseLeave:()=>{k(!1),x(!1)},onMouseDown:()=>x(!0),onMouseUp:()=>x(!1),className:`vetc-btn vetc-btn--${i} vetc-btn--${n} vetc-btn--${o} ${u}`,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"var(--vetc-space-8)",height:z,width:l?"100%":void 0,paddingInline:W,borderRadius:L,border:`1px solid ${M}`,backgroundColor:B,boxShadow:I,color:T,fontSize:H,fontWeight:"var(--vetc-btn-font-weight)",fontFamily:"var(--vetc-font-family)",lineHeight:"var(--vetc-line-height-relaxed)",cursor:C?"not-allowed":"pointer",transition:"background-color var(--vetc-transition-fast), box-shadow var(--vetc-transition-fast)",userSelect:"none",outline:"none",whiteSpace:"nowrap",WebkitTapHighlightColor:"transparent",...b},children:[d?e(K,{color:F}):s&&e("span",{style:{display:"inline-flex",flexShrink:0},children:s}),h&&e("span",{children:h}),v&&!d&&e("span",{style:{display:"inline-flex",flexShrink:0},children:v})]}),e("style",{children:"@keyframes vetc-btn-spin { to { transform: rotate(360deg); } }"})]})}function J({primary:i,secondary:n=[],content:o,layout:a="inline",variant:l="none"}){const c="inline"===a,d="bounding"===l?{backgroundColor:"var(--vetc-btn-group-bg)",borderTop:"1px solid var(--vetc-btn-group-border-color)",padding:"var(--vetc-btn-group-padding)",fontFamily:"var(--vetc-font-family)"}:{fontFamily:"var(--vetc-font-family)"},s=c?{display:"flex",gap:"var(--vetc-btn-group-gap)",alignItems:"stretch"}:{display:"flex",flexDirection:"column",gap:"var(--vetc-btn-group-gap)"},v=n.map((t,r)=>e(U,{style:"outlined",variant:"neutral",block:!c,loading:t.loading,disabled:t.disabled,onClick:t.onClick,css:c?{flex:1}:void 0,children:t.label},r)),g=e(U,{style:i.danger?"danger":"filled",variant:i.variant??"brand",block:!c,loading:i.loading,disabled:i.disabled,onClick:i.onClick,css:c?{flex:1}:void 0,children:i.label});return t("div",{style:d,children:[o&&e("div",{style:{marginBottom:"var(--vetc-btn-group-padding)"},children:o}),e("div",{style:s,children:t(r,c?{children:[v,g]}:{children:[g,v]})})]})}const Z={display4xl:{fontSize:"var(--vetc-font-size-4xl)",fontWeight:"var(--vetc-font-weight-bold)",lineHeight:"var(--vetc-line-height-tight)"},display3xl:{fontSize:"var(--vetc-font-size-3xl)",fontWeight:"var(--vetc-font-weight-bold)",lineHeight:"var(--vetc-line-height-tight)"},display2xl:{fontSize:"var(--vetc-font-size-2xl)",fontWeight:"var(--vetc-font-weight-bold)",lineHeight:"var(--vetc-line-height-tight)"},headlineXl:{fontSize:"var(--vetc-font-size-xl)",fontWeight:"var(--vetc-font-weight-bold)",lineHeight:"var(--vetc-line-height-normal)"},headlineLg:{fontSize:"var(--vetc-font-size-lg)",fontWeight:"var(--vetc-font-weight-semibold)",lineHeight:"var(--vetc-line-height-normal)"},titleBase:{fontSize:"var(--vetc-font-size-base)",fontWeight:"var(--vetc-font-weight-semibold)",lineHeight:"var(--vetc-line-height-relaxed)",letterSpacing:"var(--vetc-letter-spacing-sm)"},titleSm:{fontSize:"var(--vetc-font-size-sm)",fontWeight:"var(--vetc-font-weight-semibold)",lineHeight:"var(--vetc-line-height-relaxed)",letterSpacing:"var(--vetc-letter-spacing-sm)"},labelBase:{fontSize:"var(--vetc-font-size-base)",fontWeight:"var(--vetc-font-weight-semibold)",lineHeight:"var(--vetc-line-height-relaxed)"},labelSm:{fontSize:"var(--vetc-font-size-sm)",fontWeight:"var(--vetc-font-weight-semibold)",lineHeight:"var(--vetc-line-height-relaxed)",letterSpacing:"var(--vetc-letter-spacing-lg)"},labelXs:{fontSize:"var(--vetc-font-size-xs)",fontWeight:"var(--vetc-font-weight-semibold)",lineHeight:"var(--vetc-line-height-relaxed)",letterSpacing:"var(--vetc-letter-spacing-lg)"},labelXxs:{fontSize:"var(--vetc-font-size-2xs)",fontWeight:"var(--vetc-font-weight-semibold)",lineHeight:"var(--vetc-line-height-relaxed)",letterSpacing:"var(--vetc-letter-spacing-lg)"},bodyBase:{fontSize:"var(--vetc-font-size-base)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",letterSpacing:"var(--vetc-letter-spacing-sm)"},bodySm:{fontSize:"var(--vetc-font-size-sm)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",letterSpacing:"var(--vetc-letter-spacing-md)"},bodyXs:{fontSize:"var(--vetc-font-size-xs)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",letterSpacing:"var(--vetc-letter-spacing-lg)"},body2xs:{fontSize:"var(--vetc-font-size-2xs)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",letterSpacing:"var(--vetc-letter-spacing-lg)"}},ee={primary:"var(--vetc-color-text-primary)",secondary:"var(--vetc-color-text-secondary)",tertiary:"var(--vetc-color-text-tertiary)",disabled:"var(--vetc-color-text-disabled)",brand:"var(--vetc-color-brand)",error:"var(--vetc-color-text-error)",warning:"var(--vetc-color-warning)",success:"var(--vetc-color-positive)",inherit:"inherit"};function te({variant:t="bodyBase",color:r="primary",strikethrough:i=!1,underline:n=!1,truncate:o=!1,lines:a,as:l="span",children:c,className:d="",style:s,id:v}){const g={fontFamily:"var(--vetc-font-family)",margin:0,padding:0,...Z[t]??Z.bodyBase,color:ee[r],textDecoration:i?"line-through":n?"underline":"none",...o&&!a?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:{},...a?{display:"-webkit-box",WebkitLineClamp:a,WebkitBoxOrient:"vertical",overflow:"hidden"}:{},...s};return e(l,{id:v,className:`vetc-text vetc-text--${t} ${d}`,style:g,children:c})}function re({level:t="2xl",...r}){return e(te,{...r,variant:`display${t}`,as:r.as??"h1"})}function ie({level:t="xl",...r}){return e(te,{...r,variant:"xl"===t?"headlineXl":"headlineLg",as:r.as??"h2"})}function ne({size:t="base",...r}){return e(te,{...r,variant:"base"===t?"titleBase":"titleSm",as:r.as??"h3"})}function oe({size:t="base",...r}){return e(te,{...r,variant:{base:"labelBase",sm:"labelSm",xs:"labelXs",xxs:"labelXxs"}[t],as:r.as??"span"})}function ae({size:t="base",...r}){return e(te,{...r,variant:{base:"bodyBase",sm:"bodySm",xs:"bodyXs","2xs":"body2xs"}[t],as:r.as??"p"})}function le({htmlFor:r,required:i,disabled:n,children:o}){return t("label",{htmlFor:r,style:{fontFamily:"var(--vetc-font-family)",fontSize:"var(--vetc-input-label-font-size)",fontWeight:"var(--vetc-input-label-font-weight)",lineHeight:"var(--vetc-line-height-relaxed)",color:n?"var(--vetc-color-text-disabled)":"var(--vetc-input-label-color)",display:"block"},children:[o,i&&e("span",{style:{color:"var(--vetc-color-negative)",marginLeft:"var(--vetc-space-2)"},children:"*"})]})}function ce({color:t,children:r}){return e("span",{style:{fontFamily:"var(--vetc-font-family)",fontSize:"var(--vetc-input-helper-font-size)",lineHeight:"var(--vetc-line-height-relaxed)",color:t},children:r})}const de={height:"var(--vetc-input-height)",borderRadius:"var(--vetc-input-radius)",paddingInline:"var(--vetc-input-padding-x)",fontSize:"var(--vetc-input-font-size)",fontFamily:"var(--vetc-font-family)",backgroundColor:"var(--vetc-input-bg)",transition:"border-color 150ms ease, box-shadow 150ms ease",WebkitTapHighlightColor:"transparent"};function se({label:r,placeholder:i,value:n,defaultValue:o,helperText:l,status:c="default",error:d,disabled:s=!1,readOnly:v=!1,maxLength:g,showCount:h=!1,prefix:p,suffix:f,allowClear:u=!1,onChange:b,onFocus:m,onBlur:y,onPressEnter:x,type:w="text",id:k,name:S,className:C="",style:z,required:H=!1}){const W=!!d?"error":c,L="error"===W?"error":void 0,B=d??l,M="error"===W?"var(--vetc-input-helper-color-error)":"var(--vetc-input-helper-color)";return t("div",{className:`vetc-input-wrapper ${C}`,style:{display:"flex",flexDirection:"column",gap:"var(--vetc-input-gap)",...z},children:[r&&e(le,{htmlFor:k,required:H,disabled:s,children:r}),e(a,{id:k,name:S,type:w,value:n,defaultValue:o,placeholder:i,disabled:s,readOnly:v,maxLength:g,showCount:h,prefix:p,suffix:f,allowClear:u,status:L,onChange:e=>b?.(e.target.value,e),onFocus:m,onBlur:y,onPressEnter:x,style:de}),B&&e(ce,{color:M,children:B})]})}function ve({label:r,placeholder:i,value:n,defaultValue:o,helperText:l,status:c="default",error:d,disabled:s=!1,readOnly:v=!1,maxLength:g,onChange:h,onFocus:p,onBlur:f,id:u,name:b,className:m="",style:y,required:x=!1}){const w=!!d,k="error"===(w?"error":c)?"error":void 0,S=d??l,C=w?"var(--vetc-input-helper-color-error)":"var(--vetc-input-helper-color)";return t("div",{className:`vetc-input-wrapper ${m??""}`,style:{display:"flex",flexDirection:"column",gap:"var(--vetc-input-gap)",...y},children:[r&&e(le,{htmlFor:u,required:x,disabled:s,children:r}),e(a.Password,{id:u,name:b,value:n,defaultValue:o,placeholder:i,disabled:s,readOnly:v,maxLength:g,status:k,onChange:e=>h?.(e.target.value,e),onFocus:p,onBlur:f,style:de}),S&&e(ce,{color:C,children:S})]})}const{TextArea:ge}=a;function he({htmlFor:r,required:i,disabled:n,children:o}){return t("label",{htmlFor:r,style:{fontFamily:"var(--vetc-font-family)",fontSize:"var(--vetc-input-label-font-size)",fontWeight:"var(--vetc-input-label-font-weight)",lineHeight:"var(--vetc-line-height-relaxed)",color:n?"var(--vetc-color-text-disabled)":"var(--vetc-input-label-color)",display:"block"},children:[o,i&&e("span",{style:{color:"var(--vetc-color-negative)",marginLeft:"var(--vetc-space-2)"},children:"*"})]})}function pe({label:r,placeholder:i,value:n,defaultValue:o,helperText:a,error:l,disabled:c=!1,readOnly:d=!1,maxLength:s,showCount:v=!1,rows:g=4,autoSize:h,onChange:p,onFocus:f,onBlur:u,id:b,name:m,className:y="",style:x,required:w=!1}){const k=!!l,S=l??a,C=k?"var(--vetc-input-helper-color-error)":"var(--vetc-input-helper-color)";return t("div",{className:`vetc-textarea-wrapper ${y}`,style:{display:"flex",flexDirection:"column",gap:"var(--vetc-input-gap)",...x},children:[r&&e(he,{htmlFor:b,required:w,disabled:c,children:r}),e(ge,{id:b,name:m,value:n,defaultValue:o,placeholder:i,disabled:c,readOnly:d,maxLength:s,showCount:v,rows:g,autoSize:h,status:k?"error":void 0,onChange:e=>p?.(e.target.value),onFocus:f,onBlur:u,style:{borderRadius:"var(--vetc-input-radius)",padding:"var(--vetc-input-padding-x)",fontSize:"var(--vetc-input-font-size)",fontFamily:"var(--vetc-font-family)",resize:"vertical"}}),S&&e("span",{style:{fontFamily:"var(--vetc-font-family)",fontSize:"var(--vetc-input-helper-font-size)",lineHeight:"var(--vetc-line-height-relaxed)",color:C},children:S})]})}function fe({open:i,title:n,children:o,footer:a,maskClosable:l=!0,showHandle:c=!1,swipeToClose:d=!0,maxHeight:s="90vh",onClose:v,className:g="",style:h,id:p}){const y=u(null),x=u(null),w=u(null),k=u(0),[S,C]=f(0),[z,H]=f(!1);m(()=>(document.body.style.overflow=i?"hidden":"",()=>{document.body.style.overflow=""}),[i]),m(()=>{i||(C(0),H(!1))},[i]);const W=b(()=>{H(!0),setTimeout(()=>{C(0),v?.()},300)},[v]);if(!i&&!z)return null;const L=S>0&&!z,B=z?"translateY(calc(100% + 8px))":L?`translateY(${S}px)`:"translateY(0)",M=z?"transform 300ms cubic-bezier(0.32, 0.72, 0, 1)":L?"none":"transform 0.28s cubic-bezier(0.32, 0.72, 0, 1)",I=L||z?"none":"vetc-slide-up var(--vetc-transition-slow) cubic-bezier(0.32, 0.72, 0, 1)",T=z?0:L?Math.max(0,1-S/240):1;return t(r,{children:[e("div",{className:"vetc-bottom-sheet-overlay","aria-hidden":"true",onClick:()=>l&&!z&&v?.(),style:{position:"fixed",inset:0,backgroundColor:"var(--vetc-sheet-overlay)",zIndex:1e3,opacity:T,transition:z?"opacity 300ms":L?"none":void 0,animation:L||z?"none":"vetc-fade-in var(--vetc-transition-base)"}}),t("div",{ref:y,id:p,role:"dialog","aria-modal":"true",className:`vetc-bottom-sheet ${g}`,onTouchStart:e=>{d&&(x.current&&x.current.scrollTop>0||(w.current=e.touches[0].clientY,k.current=0))},onTouchMove:e=>{if(!d||null===w.current)return;const t=e.touches[0].clientY-w.current;t<0?w.current=null:(k.current=t,C(t))},onTouchEnd:()=>{d&&null!==w.current&&(w.current=null,k.current>=120?W():C(0))},style:{position:"fixed",left:8,right:8,backgroundColor:"var(--vetc-sheet-bg)",borderRadius:"var(--vetc-sheet-radius)",maxHeight:s,display:"flex",flexDirection:"column",overflow:"hidden",zIndex:1001,fontFamily:"var(--vetc-font-family)",transform:B,transition:M,animation:I,willChange:"transform",...h},children:[c&&e("div",{style:{display:"flex",justifyContent:"center",paddingTop:"var(--vetc-space-8)",paddingBottom:"var(--vetc-space-4)",cursor:d?"grab":void 0,flexShrink:0},children:e("div",{style:{width:"var(--vetc-sheet-handle-width)",height:"var(--vetc-sheet-handle-height)",borderRadius:"var(--vetc-radius-pill)",backgroundColor:"var(--vetc-sheet-handle-color)"}})}),n&&t("div",{style:{display:"flex",alignItems:"center",padding:8,flexShrink:0},children:[e("div",{style:{width:32,height:32,flexShrink:0}}),e("div",{style:{flex:1,textAlign:"center",padding:"4px 8px"},children:e("span",{style:{fontSize:"var(--vetc-font-size-base)",fontWeight:600,color:"var(--vetc-color-text-primary)",lineHeight:"var(--vetc-line-height-relaxed)",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n})}),v?e("button",{onClick:v,"aria-label":"Đóng",style:{width:32,height:32,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",color:"var(--vetc-color-icon-muted)",borderRadius:"var(--vetc-radius-sm)",transition:"background-color var(--vetc-transition-fast)"},children:e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:e("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}):e("div",{style:{width:32,height:32,flexShrink:0}})]}),e("div",{ref:x,style:{flex:1,overflowY:"auto",minHeight:0,padding:"0 var(--vetc-sheet-padding) var(--vetc-sheet-padding)"},children:o}),a&&e("div",{style:{flexShrink:0,borderTop:"1px solid var(--vetc-sheet-border)",padding:"var(--vetc-sheet-padding)"},children:a})]}),e("style",{children:"\n @keyframes vetc-fade-in {\n from { opacity: 0 }\n to { opacity: 1 }\n }\n @keyframes vetc-slide-up {\n from { transform: translateY(calc(100% + 8px)) }\n to { transform: translateY(0) }\n }\n "})]})}const ue=()=>e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e("path",{d:"M4 6l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),be=()=>t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),e("path",{d:"M5 8l2 2 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),me=()=>e("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:e("path",{d:"M9 3L3 9M3 3l6 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),ye=()=>t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e("circle",{cx:"7",cy:"7",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),e("path",{d:"M11 11l2.5 2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]});function xe({label:r,selected:i,disabled:n,showDivider:o,onClick:a}){const[l,c]=f(!1);return t("div",{role:"option","aria-selected":i,onClick:n?void 0:a,onMouseDown:()=>!n&&c(!0),onMouseUp:()=>c(!1),onMouseLeave:()=>c(!1),onTouchStart:()=>!n&&c(!0),onTouchEnd:()=>c(!1),style:{display:"flex",alignItems:"center",padding:"var(--vetc-space-12) var(--vetc-space-16)",borderBottom:o?"1px solid var(--vetc-color-border-variant)":"none",cursor:n?"not-allowed":"pointer",backgroundColor:l?"var(--vetc-color-bg-pressed)":"transparent",transition:"background-color 0.15s",userSelect:"none",WebkitTapHighlightColor:"transparent"},children:[e("span",{style:{flex:1,fontSize:"var(--vetc-font-size-sm)",lineHeight:"20px",fontWeight:i?600:400,color:n?"var(--vetc-color-text-disabled)":"var(--vetc-color-text-primary)",fontFamily:"var(--vetc-font-family)"},children:r}),i&&e("span",{style:{color:"var(--vetc-color-brand)",lineHeight:0,flexShrink:0,marginLeft:"var(--vetc-space-8)"},children:e(be,{})})]})}function we(e){return null==e?[]:Array.isArray(e)?e:[e]}function ke({label:r,placeholder:i="Chọn...",value:n,defaultValue:o,options:a=[],helperText:l,error:c,disabled:d=!1,multiple:s=!1,searchable:v=!1,allowClear:g=!1,loading:h,popupMatchSelectWidth:p,onChange:u,onSearch:b,required:x=!1,id:w,className:k="",style:S}){const[C,z]=f(!1),[H,W]=f(""),[L,B]=f(()=>we(void 0!==n?n:o));m(()=>{void 0!==n&&B(we(n))},[n]);const M=y(()=>void 0!==n?we(n):L,[n,L]),I=y(()=>v&&H?a.filter(e=>String(e.label).toLowerCase().includes(H.toLowerCase())):a,[a,H,v]),T=y(()=>a.filter(e=>M.includes(e.value)),[a,M]),F=T.length>0?T.map(e=>e.label).join(", "):void 0,R=!!c,N=c??l,A=R?"var(--vetc-input-border-error)":d?"var(--vetc-input-border-disabled)":"var(--vetc-input-border)";return t("div",{className:`vetc-select-wrapper ${k}`,style:{display:"flex",flexDirection:"column",gap:"var(--vetc-input-gap)",fontFamily:"var(--vetc-font-family)",...S},children:[r&&t("label",{htmlFor:w,style:{fontSize:"var(--vetc-input-label-font-size)",fontWeight:"var(--vetc-input-label-font-weight)",lineHeight:"var(--vetc-line-height-relaxed)",color:d?"var(--vetc-color-text-disabled)":"var(--vetc-input-label-color)",display:"block"},children:[r,x&&e("span",{style:{color:"var(--vetc-color-negative)",marginLeft:"var(--vetc-space-2)"},children:"*"})]}),t("button",{id:w,type:"button",disabled:d,"aria-haspopup":"listbox","aria-expanded":C,onClick:()=>z(!0),style:{height:"var(--vetc-input-height)",width:"100%",display:"flex",alignItems:"center",gap:"var(--vetc-space-8)",paddingInline:"var(--vetc-input-padding-x)",borderRadius:"var(--vetc-input-radius)",border:`1px solid ${A}`,backgroundColor:d?"var(--vetc-input-bg-disabled)":"var(--vetc-input-bg)",cursor:d?"not-allowed":"pointer",textAlign:"left",fontFamily:"var(--vetc-font-family)",fontSize:"var(--vetc-input-font-size)",transition:"border-color 0.15s",WebkitTapHighlightColor:"transparent"},children:[e("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:F?d?"var(--vetc-input-text-disabled)":"var(--vetc-input-text)":"var(--vetc-input-text-placeholder)"},children:F??i}),g&&M.length>0&&!d&&e("span",{role:"button","aria-label":"Xóa",onClick:e=>{e.stopPropagation(),void 0===n&&B([]),u?.(s?[]:void 0,s?[]:void 0)},style:{display:"flex",alignItems:"center",color:"var(--vetc-color-text-secondary)",flexShrink:0,lineHeight:0},children:e(me,{})}),e("span",{style:{display:"flex",alignItems:"center",color:d?"var(--vetc-color-text-disabled)":"var(--vetc-color-text-secondary)",flexShrink:0,lineHeight:0,transform:C?"rotate(180deg)":"none",transition:"transform 0.2s ease"},children:e(ue,{})})]}),N&&e("span",{style:{fontSize:"var(--vetc-input-helper-font-size)",lineHeight:"var(--vetc-line-height-relaxed)",color:R?"var(--vetc-input-helper-color-error)":"var(--vetc-input-helper-color)"},children:N}),t(fe,{open:C,title:r,onClose:()=>{z(!1),W("")},children:[v&&e("div",{style:{position:"sticky",top:0,zIndex:1,backgroundColor:"var(--vetc-color-bg)",paddingBottom:"var(--vetc-space-8)",marginInline:"calc(-1 * var(--vetc-sheet-padding))",paddingInline:"var(--vetc-sheet-padding)"},children:t("div",{style:{display:"flex",alignItems:"center",gap:"var(--vetc-space-8)",height:40,paddingInline:"var(--vetc-input-padding-x)",borderRadius:"var(--vetc-input-radius)",border:"1px solid var(--vetc-input-border)",backgroundColor:"var(--vetc-input-bg)"},children:[e("span",{style:{color:"var(--vetc-color-text-secondary)",lineHeight:0,flexShrink:0},children:e(ye,{})}),e("input",{type:"text",placeholder:"Tìm kiếm...",value:H,onChange:e=>{return t=e.target.value,W(t),void b?.(t);var t},style:{flex:1,border:"none",outline:"none",background:"transparent",fontFamily:"var(--vetc-font-family)",fontSize:"var(--vetc-font-size-sm)",color:"var(--vetc-color-text-primary)",lineHeight:"20px"}})]})}),e("div",{style:{marginInline:"calc(-1 * var(--vetc-sheet-padding))"},children:0===I.length?e("div",{style:{padding:"var(--vetc-space-24) var(--vetc-space-16)",textAlign:"center",color:"var(--vetc-color-text-secondary)",fontSize:"var(--vetc-font-size-sm)",fontFamily:"var(--vetc-font-family)"},children:"Không tìm thấy kết quả"}):I.map((t,r)=>e(xe,{label:String(t.label),selected:M.includes(t.value),disabled:t.disabled,showDivider:r<I.length-1,onClick:()=>(e=>{let t;s?t=M.includes(e)?M.filter(t=>t!==e):[...M,e]:(t=[e],z(!1),W("")),void 0===n&&B(t);const r=a.filter(e=>t.includes(e.value));u?.(s?t:t[0],s?r:r[0])})(t.value)},String(t.value)))})]})]})}const Se=()=>e("svg",{width:"12",height:"9",viewBox:"0 0 12 9",fill:"none","aria-hidden":"true",children:e("path",{d:"M1 4L4.5 7.5L11 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Ce=()=>e("svg",{width:"10",height:"2",viewBox:"0 0 10 2",fill:"none","aria-hidden":"true",children:e("path",{d:"M1 1H9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})});function ze({label:r,description:i,checked:n,defaultChecked:o=!1,indeterminate:a=!1,disabled:l=!1,variant:c="brand",onChange:d,value:s,id:v,className:g="",style:h}){const[p,u]=f(o),[b,m]=f(!1),y=void 0!==n,x=y?n:p,w="brand"===c?"var(--vetc-color-brand)":"var(--vetc-gray-90)";let k="transparent",S=l?"var(--vetc-color-border-disabled)":b?w:"var(--vetc-color-border)",C="var(--vetc-white)";return(x||a)&&(k=l?"var(--vetc-color-bg-disabled)":w,S=l?"var(--vetc-color-border-disabled)":b?"brand"===c?"var(--vetc-color-brand-hover)":"var(--vetc-gray-70)":w,C=l?"var(--vetc-color-text-disabled)":"var(--vetc-white)",l&&(k="var(--vetc-color-bg-disabled)")),t("label",{htmlFor:v,className:`vetc-checkbox ${g}`,onMouseEnter:()=>!l&&m(!0),onMouseLeave:()=>m(!1),style:{display:"inline-flex",alignItems:i?"flex-start":"center",gap:"var(--vetc-space-12)",cursor:l?"not-allowed":"pointer",userSelect:"none",fontFamily:"var(--vetc-font-family)",WebkitTapHighlightColor:"transparent",...h},children:[e("input",{id:v,type:"checkbox",checked:x,disabled:l,value:s,onChange:()=>{if(l)return;const e=!x;y||u(e),d?.(e)},style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-checked":a?"mixed":x}),t("span",{"aria-hidden":"true",style:{width:"20px",height:"20px",flexShrink:0,borderRadius:"var(--vetc-radius-xs)",border:`1.5px solid ${S}`,backgroundColor:k,display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color var(--vetc-transition-fast), border-color var(--vetc-transition-fast)",color:C,marginTop:i?"2px":0},children:[x&&!a&&e(Se,{}),a&&e(Ce,{})]}),(r||i)&&t("span",{style:{display:"flex",flexDirection:"column",gap:"var(--vetc-space-2)"},children:[r&&e("span",{style:{fontSize:"var(--vetc-font-size-base)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",color:l?"var(--vetc-color-text-disabled)":"var(--vetc-color-text-primary)"},children:r}),i&&e("span",{style:{fontSize:"var(--vetc-font-size-sm)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",color:l?"var(--vetc-color-text-disabled)":"var(--vetc-color-text-secondary)"},children:i})]})]})}function He({options:t,value:r,defaultValue:i=[],direction:n="vertical",disabled:o=!1,variant:a="brand",onChange:l,className:c="",style:d}){const[s,v]=f(i),g=void 0!==r,h=g?r:s;return e("div",{className:`vetc-checkbox-group ${c}`,style:{display:"flex",flexDirection:"vertical"===n?"column":"row",flexWrap:"horizontal"===n?"wrap":void 0,gap:"vertical"===n?"var(--vetc-space-12)":"var(--vetc-space-16)",fontFamily:"var(--vetc-font-family)",...d},children:t.map(t=>e(ze,{label:t.label,description:t.description,checked:h.includes(t.value),disabled:t.disabled??o,variant:a,value:t.value,onChange:e=>((e,t)=>{const r=t?[...h,e]:h.filter(t=>t!==e);g||v(r),l?.(r)})(t.value,e)},String(t.value)))})}function We({label:r,description:i,checked:n,defaultChecked:o=!1,disabled:a=!1,variant:l="brand",onChange:c,value:d,id:s,className:v="",style:g}){const[h,p]=f(o),[u,b]=f(!1),m=void 0!==n,y=m?n:h,x="brand"===l?"var(--vetc-color-brand)":"var(--vetc-gray-90)",w=a?"var(--vetc-color-border-disabled)":y?u?"brand"===l?"var(--vetc-color-brand-hover)":"var(--vetc-gray-70)":x:u?x:"var(--vetc-color-border)",k=a?"var(--vetc-color-text-disabled)":x;return t("label",{htmlFor:s,className:`vetc-radio ${v}`,onMouseEnter:()=>!a&&b(!0),onMouseLeave:()=>b(!1),style:{display:"inline-flex",alignItems:i?"flex-start":"center",gap:"var(--vetc-space-12)",cursor:a?"not-allowed":"pointer",userSelect:"none",fontFamily:"var(--vetc-font-family)",WebkitTapHighlightColor:"transparent",...g},children:[e("input",{id:s,type:"radio",checked:y,disabled:a,value:d,onChange:()=>{a||y||(m||p(!0),c?.(!0))},style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"}}),e("span",{"aria-hidden":"true",style:{width:"20px",height:"20px",flexShrink:0,borderRadius:"50%",border:`1.5px solid ${w}`,backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",transition:"border-color var(--vetc-transition-fast)",marginTop:i?"2px":0},children:y&&e("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:k,flexShrink:0}})}),(r||i)&&t("span",{style:{display:"flex",flexDirection:"column",gap:"var(--vetc-space-2)"},children:[r&&e("span",{style:{fontSize:"var(--vetc-font-size-base)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",color:a?"var(--vetc-color-text-disabled)":"var(--vetc-color-text-primary)"},children:r}),i&&e("span",{style:{fontSize:"var(--vetc-font-size-sm)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",color:a?"var(--vetc-color-text-disabled)":"var(--vetc-color-text-secondary)"},children:i})]})]})}function Le({options:t,value:r,defaultValue:i,direction:n="vertical",disabled:o=!1,variant:a="brand",onChange:l,className:c="",style:d}){const[s,v]=f(i),g=void 0!==r,h=g?r:s;return e("div",{role:"radiogroup",className:`vetc-radio-group ${c}`,style:{display:"flex",flexDirection:"vertical"===n?"column":"row",flexWrap:"horizontal"===n?"wrap":void 0,gap:"vertical"===n?"var(--vetc-space-12)":"var(--vetc-space-16)",fontFamily:"var(--vetc-font-family)",...d},children:t.map(t=>e(We,{label:t.label,description:t.description,checked:h===t.value,disabled:t.disabled??o,variant:a,value:t.value,onChange:()=>{return e=t.value,g||v(e),void l?.(e);var e}},String(t.value)))})}function Be({label:i,description:n,labelPosition:o="right",checked:a,defaultChecked:l=!1,disabled:c=!1,loading:d=!1,variant:s="brand",onChange:v,id:g,className:h="",style:p}){const[u,b]=f(l),m=void 0!==a,y=m?a:u,x=c||d,w=()=>{if(x)return;const e=!y;m||b(e),v?.(e)},k=t("button",{id:g,type:"button",role:"switch","aria-checked":y,disabled:x,onClick:w,className:`vetc-switch ${h}`,style:{position:"relative",display:"inline-flex",alignItems:"center",width:"var(--vetc-switch-width)",height:"var(--vetc-switch-height)",borderRadius:"var(--vetc-radius-pill)",backgroundColor:x?"var(--vetc-color-bg-disabled)":y?"brand"===s?"var(--vetc-switch-on-bg)":"var(--vetc-gray-90)":"var(--vetc-switch-off-bg)",border:"none",cursor:x?"not-allowed":"pointer",padding:0,flexShrink:0,transition:"background-color var(--vetc-transition-fast)",outline:"none",WebkitTapHighlightColor:"transparent",...i||n?{}:p},children:[e("span",{style:{position:"absolute",left:y?"calc(100% - 30px)":"2px",width:"var(--vetc-switch-thumb-size)",height:"var(--vetc-switch-thumb-size)",borderRadius:"50%",backgroundColor:x?"var(--vetc-gray-20)":"var(--vetc-white)",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",transition:"left var(--vetc-transition-fast)",display:"flex",alignItems:"center",justifyContent:"center"},children:d&&t("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",style:{animation:"vetc-btn-spin 0.6s linear infinite"},"aria-hidden":"true",children:[e("circle",{cx:"6",cy:"6",r:"4",stroke:"var(--vetc-gray-30)",strokeWidth:"1.5"}),e("path",{d:"M6 2a4 4 0 014 4",stroke:"var(--vetc-color-brand)",strokeWidth:"1.5",strokeLinecap:"round"})]})}),e("style",{children:"@keyframes vetc-btn-spin { to { transform: rotate(360deg); } }"})]});if(!i&&!n)return k;const S=t("span",{style:{display:"flex",flexDirection:"column",gap:"var(--vetc-space-2)",flex:1},children:[i&&e("span",{style:{fontSize:"var(--vetc-font-size-base)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",color:x?"var(--vetc-color-text-disabled)":"var(--vetc-color-text-primary)"},children:i}),n&&e("span",{style:{fontSize:"var(--vetc-font-size-sm)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",color:x?"var(--vetc-color-text-disabled)":"var(--vetc-color-text-secondary)"},children:n})]});return e("div",{style:{display:"flex",alignItems:"center",gap:"var(--vetc-space-12)",flexDirection:"left"===o?"row-reverse":"row",fontFamily:"var(--vetc-font-family)",cursor:x?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent",...p},onClick:w,children:t(r,"right"===o?{children:[k,S]}:{children:[S,k]})})}const Me={default:{bg:"var(--vetc-chip-default-bg)",border:"var(--vetc-chip-default-border)",text:"var(--vetc-chip-default-text)",filledBg:"var(--vetc-chip-default-filled-bg)"},positive:{bg:"var(--vetc-chip-positive-bg)",border:"var(--vetc-chip-positive-border)",text:"var(--vetc-chip-positive-text)",filledBg:"var(--vetc-chip-positive-filled-bg)"},negative:{bg:"var(--vetc-chip-negative-bg)",border:"var(--vetc-chip-negative-border)",text:"var(--vetc-chip-negative-text)",filledBg:"var(--vetc-chip-negative-filled-bg)"},warning:{bg:"var(--vetc-chip-warning-bg)",border:"var(--vetc-chip-warning-border)",text:"var(--vetc-chip-warning-text)",filledBg:"var(--vetc-chip-warning-filled-bg)"},info:{bg:"var(--vetc-chip-info-bg)",border:"var(--vetc-chip-info-border)",text:"var(--vetc-chip-info-text)",filledBg:"var(--vetc-chip-info-filled-bg)"}},Ie={brand:{bg:"var(--vetc-chip-brand-bg)",border:"var(--vetc-chip-brand-border)",text:"var(--vetc-chip-brand-text)",filledBg:"var(--vetc-chip-brand-filled-bg)"},neutral:{bg:"var(--vetc-chip-neutral-bg)",border:"var(--vetc-chip-neutral-border)",text:"var(--vetc-chip-neutral-text)",filledBg:"var(--vetc-chip-neutral-filled-bg)"}};function Te({style:t="tinted",type:r="default",variant:i,shape:n="pill",size:o="md",icon:a,closable:c=!1,onClose:d,onClick:s,children:v,className:g="",css:h,id:p}){const f=i?Ie[i]:Me[r],u="md"===o?"var(--vetc-chip-height-md)":"var(--vetc-chip-height-sm)",b="md"===o?"var(--vetc-chip-padding-x-md)":"var(--vetc-chip-padding-x-sm)",m="md"===o?"var(--vetc-chip-font-size-md)":"var(--vetc-chip-font-size-sm)",y="pill"===n?"var(--vetc-chip-radius-pill)":"var(--vetc-chip-radius-rounded)";let x=f.bg,w=`1px solid ${f.border}`,k=f.text;return"filled"===t?(x=f.filledBg,w="none",k="var(--vetc-white)"):"outlined"===t&&(x="transparent",w=`1px solid ${f.border}`,k=f.text),e(l,{id:p,closable:c,onClose:e=>{e.preventDefault(),d?.()},onClick:s,icon:a,className:`vetc-chip vetc-chip--${t} vetc-chip--${r} ${g}`,style:{display:"inline-flex",alignItems:"center",height:u,padding:`0 ${b}`,borderRadius:y,background:x,border:w,color:k,fontSize:m,fontWeight:"var(--vetc-chip-font-weight)",fontFamily:"var(--vetc-font-family)",cursor:s?"pointer":"default",userSelect:"none",lineHeight:1,gap:"var(--vetc-space-4)",transition:"var(--vetc-transition-fast)",...h},children:v})}const Fe={display:"inline-block",width:"var(--vetc-badge-dot-size)",height:"var(--vetc-badge-dot-size)",borderRadius:"var(--vetc-badge-radius)",background:"var(--vetc-badge-bg)",flexShrink:0},Re={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"var(--vetc-badge-size)",height:"var(--vetc-badge-size)",padding:"0 5px",borderRadius:"var(--vetc-badge-radius)",background:"var(--vetc-badge-bg)",color:"var(--vetc-badge-text)",fontSize:"var(--vetc-badge-font-size)",fontWeight:"var(--vetc-badge-font-weight)",lineHeight:"16px",whiteSpace:"nowrap",fontFamily:"var(--vetc-font-family)"};function Ne({dot:r=!1,count:i,label:n,overflowCount:o=99,outline:a=!1,children:l,className:c,style:d}){const s=r||void 0===i&&void 0===n;let v=null;s||(void 0!==i?v=i>o?`${o}+`:String(i):void 0!==n&&(v=n));const g=e("span",{className:c,style:{...s?Fe:Re,...a?{boxShadow:"0 0 0 var(--vetc-badge-outline-width) var(--vetc-badge-outline-color)"}:{},...d},children:v});return l?t("span",{style:{position:"relative",display:"inline-flex"},children:[l,e("span",{style:{position:"absolute",top:0,right:0,transform:"translate(50%, -50%)",zIndex:1},children:g})]}):g}const Ae={xl:"var(--vetc-avatar-size-xl)",lg:"var(--vetc-avatar-size-lg)",md:"var(--vetc-avatar-size-md)",sm:"var(--vetc-avatar-size-sm)",xs:"var(--vetc-avatar-size-xs)"},$e={xl:56,lg:48,md:40,sm:32,xs:24},De={xl:"var(--vetc-font-size-2xl)",lg:"var(--vetc-font-size-xl)",md:"var(--vetc-font-size-base)",sm:"var(--vetc-font-size-sm)",xs:"var(--vetc-font-size-2xs)"};function je({src:t,alt:r,initials:i,icon:n,size:o="md",shape:a="circle",color:l,className:d="",style:s,onClick:v,id:g}){return e("span",{id:g,style:{display:"inline-flex",flexShrink:0,width:Ae[o],height:Ae[o]},children:e(c,{src:t,alt:r,icon:t||i?void 0:n,size:$e[o],shape:a,onClick:v,className:`vetc-avatar vetc-avatar--${o} ${d}`,style:{backgroundColor:t?void 0:l??"var(--vetc-avatar-bg-default)",fontSize:De[o],fontWeight:"var(--vetc-font-weight-bold)",fontFamily:"var(--vetc-font-family)",color:"var(--vetc-avatar-text-color)",cursor:v?"pointer":"default",flexShrink:0,...s},children:!t&&i?i.slice(0,2).toUpperCase():void 0})})}function Oe({elevation:t="outlined",title:r,extra:i,children:n,onClick:o,className:a="",style:l,bodyStyle:c,id:s}){return e(d,{id:s,title:r,extra:i,onClick:o,className:`vetc-card vetc-card--${t} ${a}`,styles:{body:{padding:"var(--vetc-card-padding)",fontFamily:"var(--vetc-font-family)",...c},header:r?{borderBottom:"1px solid var(--vetc-card-border)",padding:"var(--vetc-space-12) var(--vetc-card-padding)"}:void 0},style:{borderRadius:"var(--vetc-card-radius)",border:{flat:"none",raised:"none",outlined:"1px solid var(--vetc-card-border)"}[t],boxShadow:{flat:"var(--vetc-shadow-none)",raised:"var(--vetc-card-shadow-raised)",outlined:"var(--vetc-shadow-none)"}[t],cursor:o?"pointer":"default",overflow:"hidden",backgroundColor:"var(--vetc-card-bg)",fontFamily:"var(--vetc-font-family)",transition:"box-shadow var(--vetc-transition-fast)",...l},children:n})}function Ee({disabled:t}){return e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:e("path",{d:"M7.5 5L12.5 10L7.5 15",stroke:t?"var(--vetc-color-icon-disabled)":"var(--vetc-color-icon-muted)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Pe({leading:r,title:i,description:n,trailing:o,arrow:a=!1,divider:l=!0,onClick:c,disabled:d=!1,className:s="",style:v,id:g}){const h=!!c&&!d;return t("div",{id:g,role:h?"button":void 0,tabIndex:h?0:void 0,className:`vetc-list-item ${s}`,onClick:d?void 0:c,onKeyDown:h?e=>{"Enter"!==e.key&&" "!==e.key||c?.()}:void 0,style:{display:"flex",alignItems:"center",minHeight:"var(--vetc-list-item-height)",padding:"0 var(--vetc-list-item-padding-x)",gap:"var(--vetc-list-item-gap)",cursor:h?"pointer":"default",borderBottom:l?"1px solid var(--vetc-list-item-border)":"none",backgroundColor:"var(--vetc-list-item-bg)",opacity:d?.5:1,fontFamily:"var(--vetc-font-family)",transition:"background-color var(--vetc-transition-fast)",outline:"none",...v},onMouseEnter:e=>{h&&(e.currentTarget.style.backgroundColor="var(--vetc-list-item-bg-hover)")},onMouseLeave:e=>{h&&(e.currentTarget.style.backgroundColor="var(--vetc-list-item-bg)")},children:[r&&e("div",{style:{flexShrink:0,display:"flex",alignItems:"center",color:"var(--vetc-list-item-icon-color)"},children:r}),t("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:"var(--vetc-space-2)"},children:[e("span",{style:{fontSize:"var(--vetc-list-item-title-size)",fontWeight:"var(--vetc-list-item-title-weight)",color:d?"var(--vetc-color-text-disabled)":"var(--vetc-list-item-title-color)",lineHeight:"var(--vetc-line-height-relaxed)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i}),n&&e("span",{style:{fontSize:"var(--vetc-list-item-desc-size)",fontWeight:"var(--vetc-font-weight-regular)",color:d?"var(--vetc-color-text-disabled)":"var(--vetc-list-item-desc-color)",lineHeight:"var(--vetc-line-height-relaxed)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n})]}),(o||a)&&t("div",{style:{flexShrink:0,display:"flex",alignItems:"center",gap:"var(--vetc-space-8)",color:"var(--vetc-list-item-icon-color)"},children:[o,a&&e(Ee,{disabled:d})]})]})}function Xe({items:t,renderItem:r,bordered:i=!1,className:n="",style:o,id:a}){return e("div",{id:a,className:`vetc-list ${n}`,style:{border:i?"1px solid var(--vetc-color-border-variant)":"none",borderRadius:i?"var(--vetc-card-radius)":0,overflow:"hidden",backgroundColor:"var(--vetc-color-bg)",...o},children:t.map((t,i)=>e(p.Fragment,{children:r(t,i)},i))})}function Ve({orientation:t="horizontal",label:r,labelAlign:i="center",thickness:n=1,color:o,margin:a,className:l="",style:c}){const d="vertical"===t;return e(s,{type:d?"vertical":"horizontal",orientationMargin:"center"!==i?0:void 0,orientation:"center"!==i?i:void 0,className:`vetc-divider ${l}`,style:{borderColor:o??"var(--vetc-divider-color)",borderTopWidth:d?void 0:n,borderLeftWidth:d?n:void 0,margin:a??(d?"0 var(--vetc-divider-margin-v)":"var(--vetc-divider-margin-h) 0"),fontFamily:"var(--vetc-font-family)",fontSize:"var(--vetc-divider-label-size)",color:"var(--vetc-divider-label-color)",...c},children:r})}const Ye={sm:16,md:24,lg:40};function qe({size:t="md",color:r,fullscreen:i=!1,tip:n,children:o,spinning:a=!0,className:l="",style:c}){const d=e(w,{style:{fontSize:Ye[t],color:r??"var(--vetc-spinner-color)"},spin:!0});return o?e(g,{spinning:a,indicator:d,tip:n,className:`vetc-spinner ${l}`,style:c,children:o}):e("div",i?{className:`vetc-spinner-overlay ${l}`,style:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--vetc-color-overlay)",zIndex:9999,...c},children:e(g,{spinning:a,indicator:d,tip:n})}:{className:`vetc-spinner ${l}`,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",...c},children:e(g,{spinning:a,indicator:d,tip:n})})}function _e({rows:t=3,avatar:r=!1,avatarSize:i=40,title:n=!0,loading:o=!0,className:a="",style:l,children:c}){return e(v,{active:!0,loading:o,avatar:!!r&&{size:i,shape:"circle"},title:n,paragraph:{rows:t},className:`vetc-skeleton ${a}`,style:l,children:c})}const Ge={height:"var(--vetc-btn-height-lg)",borderRadius:"var(--vetc-btn-radius-lg)",fontWeight:"var(--vetc-btn-font-weight)",fontSize:"var(--vetc-btn-font-size-lg)",fontFamily:"var(--vetc-font-family)"};function Qe({open:t,title:r,children:i,footer:n,okText:o="Xác nhận",cancelText:a="Hủy",okDisabled:l=!1,okLoading:c=!1,okDanger:d=!1,onOk:s,onCancel:v,maskClosable:g=!0,closable:p=!0,width:f,className:u="",style:b,id:m}){return e(h,{open:t,title:r,okText:o,cancelText:a,okButtonProps:{disabled:l,loading:c,danger:d,style:Ge},cancelButtonProps:{style:Ge},footer:null===n?null:n,onOk:s,onCancel:v,maskClosable:g,closable:p,width:f??"var(--vetc-modal-width)",centered:!0,className:`vetc-modal ${u}`,style:{fontFamily:"var(--vetc-font-family)",...b},styles:{header:{padding:"var(--vetc-modal-padding) var(--vetc-modal-padding) 0",borderBottom:"none"},body:{padding:"var(--vetc-space-8) var(--vetc-modal-padding) var(--vetc-modal-padding)"},footer:{padding:"0 var(--vetc-modal-padding) var(--vetc-modal-padding)",borderTop:"none"},mask:{backgroundColor:"var(--vetc-modal-overlay)"}},children:i})}function Ke(){return{confirm:e=>{h.confirm({title:e.title,content:e.content,okText:e.okText??"Xác nhận",cancelText:e.cancelText??"Hủy",okButtonProps:{danger:e.okDanger,style:{...Ge,height:40}},cancelButtonProps:{style:{...Ge,height:40}},centered:!0,onOk:e.onOk,onCancel:e.onCancel,styles:{mask:{backgroundColor:"var(--vetc-modal-overlay)"}}})}}}const Ue=()=>e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function Je({open:i,imageOnly:n=!1,image:o,title:a,description:l,okText:c="Xác nhận",cancelText:d="Hủy",okDisabled:s=!1,okLoading:v=!1,okDanger:g=!1,onOk:h,onCancel:p,maskClosable:f=!0}){if(m(()=>(document.body.style.overflow=i?"hidden":"",()=>{document.body.style.overflow=""}),[i]),!i)return null;const u=!!(a||l||o);return e(r,{children:x(e("div",{style:{position:"fixed",inset:0,backgroundColor:"var(--vetc-color-overlay)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,padding:"0 var(--vetc-space-24)"},onClick:f?p:void 0,children:t("div",n?{style:{position:"relative",width:"100%",maxWidth:"var(--vetc-dialog-width)",borderRadius:"var(--vetc-dialog-radius)",overflow:"hidden"},onClick:e=>e.stopPropagation(),children:[o&&e("img",{src:o,alt:"",style:{width:"100%",display:"block",aspectRatio:"1",objectFit:"cover"}}),p&&e("button",{"aria-label":"Đóng",onClick:p,style:{position:"absolute",top:12,right:12,width:40,height:40,border:"none",borderRadius:"50%",backgroundColor:"var(--vetc-color-bg)",boxShadow:"var(--vetc-shadow-md)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"var(--vetc-color-text-primary)",padding:0},children:e(Ue,{})})]}:{style:{width:"100%",maxWidth:"var(--vetc-dialog-width)",backgroundColor:"var(--vetc-dialog-bg)",borderRadius:"var(--vetc-dialog-radius)",overflow:"hidden",boxShadow:"var(--vetc-shadow-lg)",fontFamily:"var(--vetc-font-family)"},onClick:e=>e.stopPropagation(),children:[p&&e("div",{style:{display:"flex",justifyContent:"flex-end",padding:"8px 8px 0"},children:e("button",{"aria-label":"Đóng",onClick:p,style:{width:32,height:32,border:"none",background:"transparent",borderRadius:"var(--vetc-radius-md)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"var(--vetc-color-text-secondary)",padding:0},children:e(Ue,{})})}),u&&t("div",{style:{padding:(p?"var(--vetc-space-8)":"var(--vetc-space-20)")+" var(--vetc-space-16) 0",textAlign:o?"center":"left"},children:[o&&e("div",{style:{display:"flex",justifyContent:"center",marginBottom:"var(--vetc-space-12)"},children:e("img",{src:o,alt:"",style:{width:"var(--vetc-dialog-image-size)",height:"var(--vetc-dialog-image-size)",borderRadius:"var(--vetc-dialog-radius)",objectFit:"cover",display:"block"}})}),a&&e("div",{style:{fontSize:"var(--vetc-dialog-title-size)",fontWeight:"var(--vetc-dialog-title-weight)",lineHeight:"var(--vetc-dialog-title-line-height)",color:"var(--vetc-color-text-primary)",marginBottom:l?"var(--vetc-space-8)":0},children:a}),l&&e("div",{style:{fontSize:"var(--vetc-dialog-desc-size)",lineHeight:"var(--vetc-dialog-desc-line-height)",color:"var(--vetc-dialog-desc-color)"},children:l})]}),t("div",{style:{display:"flex",gap:"var(--vetc-dialog-btn-gap)",padding:"var(--vetc-space-12) var(--vetc-space-16) var(--vetc-space-16)"},children:[p&&e(U,{block:!0,style:"outlined",variant:"neutral",onClick:p,children:d}),e(U,{block:!0,style:g?"danger":"filled",loading:v,disabled:s,onClick:h,children:c})]})]})}),document.body)})}const Ze=()=>e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function et(e,t){const r="var(--vetc-tooltip-bg)",i={position:"absolute",width:0,height:0};return"top"===e?(i.bottom=-6,i.borderLeft="6px solid transparent",i.borderRight="6px solid transparent",i.borderTop=`6px solid ${r}`):"bottom"===e?(i.top=-6,i.borderLeft="6px solid transparent",i.borderRight="6px solid transparent",i.borderBottom=`6px solid ${r}`):"left"===e?(i.right=-6,i.borderTop="6px solid transparent",i.borderBottom="6px solid transparent",i.borderLeft=`6px solid ${r}`):(i.left=-6,i.borderTop="6px solid transparent",i.borderBottom="6px solid transparent",i.borderRight=`6px solid ${r}`),"top"===e||"bottom"===e?"center"===t?(i.left="50%",i.transform="translateX(-50%)"):"start"===t?i.left=12:i.right=12:"center"===t?(i.top="50%",i.transform="translateY(-50%)"):"start"===t?i.top=12:i.bottom=12,i}function tt({content:i,placement:n="top",align:o="center",closable:a=!1,open:l,defaultOpen:c=!1,onClose:d,children:s,style:v,className:g}){const h=u(null),p=u(null),[y,w]=f(c),[k,S]=f({top:-9999,left:-9999}),C=void 0!==l,z=C?l:y,H=b(()=>{if(!h.current||!p.current)return;const e=h.current.getBoundingClientRect(),t=p.current.getBoundingClientRect();S(function(e,t,r,i,n){let o=0,a=0;switch(t){case"top":o=e.top-n-8;break;case"bottom":o=e.bottom+8;break;case"left":a=e.left-i-8;break;case"right":a=e.right+8}return"top"===t||"bottom"===t?a="center"===r?e.left+e.width/2-i/2:"start"===r?e.left:e.right-i:o="center"===r?e.top+e.height/2-n/2:"start"===r?e.top:e.bottom-n,{top:o,left:a}}(e,n,o,t.width,t.height))},[n,o]);m(()=>{z?requestAnimationFrame(H):S({top:-9999,left:-9999})},[z,H]);const W=b(()=>{C||w(!1),d?.()},[C,d]);m(()=>{if(!z)return;const e=e=>{const t=e.target;h.current?.contains(t)||p.current?.contains(t)||W()};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}},[z,W]);return t(r,{children:[e("span",{ref:h,style:{display:"inline-block"},onClick:e=>{s.props.onClick?.(e),C||w(e=>!e)},children:s}),z&&x(t("div",{ref:p,role:"tooltip",className:g,style:{position:"fixed",top:k.top,left:k.left,zIndex:9999,background:"var(--vetc-tooltip-bg)",color:"var(--vetc-tooltip-text)",borderRadius:"var(--vetc-tooltip-radius)",boxShadow:"var(--vetc-tooltip-shadow)",minWidth:"var(--vetc-tooltip-min-width)",minHeight:"var(--vetc-tooltip-min-height)",fontSize:"var(--vetc-tooltip-font-size)",lineHeight:"var(--vetc-tooltip-line-height)",WebkitTapHighlightColor:"transparent",overflow:"hidden",...v},children:[e("div",{style:et(n,o)}),a?t("div",{style:{display:"flex",alignItems:"center"},children:[e("div",{style:{flex:1,padding:"5px 8px 5px 12px"},children:i}),e("div",{style:{width:1,alignSelf:"stretch",background:"var(--vetc-tooltip-divider)",flexShrink:0}}),e("button",{onClick:W,"aria-label":"Đóng",style:{width:"var(--vetc-tooltip-close-size)",height:"var(--vetc-tooltip-close-size)",borderRadius:"var(--vetc-tooltip-radius)",background:"none",border:"none",cursor:"pointer",color:"var(--vetc-tooltip-text)",display:"flex",alignItems:"center",justifyContent:"center",padding:0,flexShrink:0},children:e(Ze,{})})]}):e("div",{style:{padding:"5px 12px"},children:i})]}),document.body)]})}function rt(){return e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:e("path",{d:"M15 19L8 12L15 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function it(){return e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:e("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}const nt={background:"none",border:"none",cursor:"pointer",width:"var(--vetc-nav-icon-btn-size)",height:"var(--vetc-nav-icon-btn-size)",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"var(--vetc-radius-pill)",color:"var(--vetc-nav-icon-color)",flexShrink:0,padding:0,transition:"background-color var(--vetc-transition-fast)"};function ot({title:r,leading:i="none",leadingIcon:n,onLeadingPress:o,actions:a=[],leftSlot:l,rightSlot:c,backgroundColor:d,divider:s=!0,transparent:v=!1,className:g="",style:h,id:p,showBack:f,backIcon:u,onBack:b,left:m,right:y}){const x=f?"back":i,w=n??u,k=o??b;return t("header",{id:p,className:`vetc-nav-bar ${g}`,style:{display:"flex",alignItems:"center",height:"var(--vetc-nav-height)",padding:"0 var(--vetc-nav-padding-x)",backgroundColor:v?"transparent":d??"var(--vetc-nav-bg)",borderBottom:s&&!v?"1px solid var(--vetc-nav-border)":"none",fontFamily:"var(--vetc-font-family)",position:"relative",...h},children:[e("div",{style:{display:"flex",alignItems:"center",minWidth:"var(--vetc-nav-icon-btn-size)",zIndex:1},children:(()=>{if(void 0!==l||void 0!==m)return l??m;if("none"===x)return null;const t=w??e("close"===x?it:rt,{});return e("button",{onClick:k,style:nt,"aria-label":"close"===x?"Đóng":"Quay lại",children:t})})()}),r&&e("div",{style:{position:"absolute",left:0,right:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:e("span",{style:{fontSize:"var(--vetc-nav-title-size)",fontWeight:"var(--vetc-nav-title-weight)",color:"var(--vetc-nav-title-color)",lineHeight:"var(--vetc-line-height-normal)",maxWidth:"60%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r})}),e("div",{style:{display:"flex",alignItems:"center",gap:"var(--vetc-space-4)",marginLeft:"auto",zIndex:1},children:void 0!==c||void 0!==y?c??y:a.slice(0,2).map((t,r)=>e("button",{id:t.id,onClick:t.onClick,disabled:t.disabled,"aria-label":t.label,style:{...nt,opacity:t.disabled?.4:1},children:t.icon},r))})]})}function at({items:r,activeKey:i,onChange:n,variant:o="brand",backgroundColor:a,divider:l=!0,className:c="",style:d,id:s}){const v="brand"===o?"var(--vetc-tab-color-active)":"var(--vetc-color-text-primary)";return e("nav",{id:s,className:`vetc-tab-bar ${c}`,style:{display:"flex",alignItems:"stretch",height:"var(--vetc-tab-height)",backgroundColor:a??"var(--vetc-tab-bg)",borderTop:l?"1px solid var(--vetc-tab-border)":"none",fontFamily:"var(--vetc-font-family)",...d},children:r.map(r=>{const o=r.key===i,a=r.disabled?"var(--vetc-tab-color-disabled)":o?v:"var(--vetc-tab-color-inactive)";return t("button",{disabled:r.disabled,onClick:()=>!r.disabled&&n?.(r.key),"aria-current":o?"page":void 0,"aria-label":r.label,className:"vetc-tab-bar__item"+(o?" vetc-tab-bar__item--active":""),style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"var(--vetc-space-2)",background:"none",border:"none",cursor:r.disabled?"not-allowed":"pointer",padding:"var(--vetc-space-6) 0",position:"relative",opacity:r.disabled?.5:1,transition:"color var(--vetc-transition-fast)",color:a},children:[t("div",{style:{position:"relative",display:"inline-flex"},children:[e("span",{style:{color:a,display:"flex",fontSize:"24px",lineHeight:1},children:o&&r.activeIcon?r.activeIcon:r.icon}),void 0!==r.badge&&e("span",{style:{position:"absolute",top:"calc(-1 * var(--vetc-space-4))",right:"calc(-1 * var(--vetc-space-8))",minWidth:"var(--vetc-tab-badge-size)",height:"var(--vetc-tab-badge-size)",backgroundColor:"var(--vetc-tab-badge-bg)",borderRadius:"var(--vetc-radius-pill)",fontSize:"var(--vetc-tab-badge-font-size)",fontWeight:"var(--vetc-font-weight-semibold)",color:"var(--vetc-tab-badge-text)",display:"flex",alignItems:"center",justifyContent:"center",padding:"0 var(--vetc-space-4)",lineHeight:1},children:r.badge})]}),e("span",{style:{fontSize:"var(--vetc-tab-label-size)",fontWeight:"var(--vetc-tab-label-weight)",color:a,lineHeight:"var(--vetc-line-height-relaxed)"},children:r.label})]},r.key)})})}const lt="undefined"!=typeof window,ct=(e,t={})=>{const r=lt&&window.flutter_inappwebview&&window.flutter_inappwebview.callHandler&&"function"==typeof window.flutter_inappwebview.callHandler?window.flutter_inappwebview:null;return r?r.callHandler("MiniAppBridge",{action:e,payload:t}):Promise.resolve({ok:!1,error:"BRIDGE_CALL_FAILED"})};let dt=new Map,st="/";function vt(){return dt.get(st)}function gt(e){st=e}function ht({config:t}){const[r,i]=f(null);if(m(()=>{!function(e){dt=new Map(e.pages.map(e=>[e.path,e]))}(t);gt((window.location.pathname||"/").replace("/miniapp","")||"/");let e=vt()??null;if(!e){if(0===t.pages.length)return void console.error("[App] config.pages is empty — no pages to render.");gt(t.pages[0].path),e=vt()??null}i(e),ct("registerAppConfig",{config:t}).catch(e=>{console.error("[App] registerAppConfigError:",e)})},[t]),!r)return e("div",{});const n=r.Component;return e(n,{})}function pt(e){const t=u(e);m(()=>{t.current=e},[e]),m(()=>{if("undefined"==typeof window||!window.MiniApp)return;const e=window.MiniApp,r=()=>{try{t.current?.()}catch(e){console.error("[useAppResume error]",e)}};return e.on("appResume",r),()=>e.off("appResume",r)},[])}function ft(e){const t=u(e);m(()=>{t.current=e},[e]),m(()=>{if("undefined"==typeof window||!window.MiniApp)return;const e=window.MiniApp,r=()=>{try{t.current?.()}catch(e){console.error("[useAppPause error]",e)}};return e.on("appPause",r),()=>e.off("appPause",r)},[])}function ut(e,t){const r=u(t);m(()=>{r.current=t},[t]),m(()=>{if("undefined"==typeof window||!window.MiniApp)return;const t=window.MiniApp,i=t=>{t?.route===e&&r.current?.(t)};return t.on("didShow",i),()=>t.off("didShow",i)},[e])}function bt(e,t){const r=u(t);m(()=>{r.current=t},[t]),m(()=>{if("undefined"==typeof window||!window.MiniApp)return;const t=window.MiniApp,i=t=>{t?.route===e&&r.current?.(t)};return t.on("didHide",i),()=>t.off("didHide",i)},[e])}function mt(e,t){const r=u(t);m(()=>{r.current=t},[t]),m(()=>{if("undefined"==typeof window||!window.MiniApp)return;const t=window.MiniApp,i=t=>{t?.route===e&&r.current?.(t)};return t.on("onTapAppBar",i),()=>t.off("onTapAppBar",i)},[e])}function yt(){return(e,t={},r={})=>{"number"!=typeof e?ct("navigate",{type:"native",action:"push",route:e,params:t,options:r}).catch(console.error):ct("navigate",{type:"native",action:"pop",delta:Math.abs(e)})}}function xt(e){const t=u(e);m(()=>{t.current=e},[e]),m(()=>{if("undefined"==typeof window||!window.MiniApp)return;const e=window.MiniApp,r=e=>{try{t.current?.(e)}catch(e){console.error("[useListenerScanQr error]",e)}};return e.on("scanQrResult",r),()=>e.off("scanQrResult",r)},[])}export{ht as App,je as Avatar,Ne as Badge,ae as Body,fe as BottomSheet,U as Button,J as ButtonGroup,Oe as Card,ze as Checkbox,He as CheckboxGroup,Te as Chip,Je as Dialog,re as Display,Ve as Divider,ke as Dropdown,ie as Headline,se as Input,oe as Label,Xe as List,Pe as ListItem,Qe as Modal,ot as NavigationBar,ve as PasswordInput,We as Radio,Le as RadioGroup,_e as SkeletonLoader,qe as Spinner,Be as Switch,at as TabBar,pe as Textarea,ne as Title,F as ToastContainer,tt as Tooltip,te as Typography,$ as VETCProvider,Y as borderRadius,N as colorAlias,R as colorGlobal,q as componentHeight,D as fontFamily,O as fontSize,j as fontWeight,P as letterSpacing,E as lineHeight,_ as shadow,V as spacing,X as textStyle,H as toast,ft as useAppPause,pt as useAppResume,Ke as useConfirm,bt as useDidHide,ut as useDidShow,xt as useListenerScanQr,yt as useNavigate,mt as useTapAppBar,W as useToast,A as vetcAntdTheme};
1
+ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{ConfigProvider as i,theme as n,App as o,Input as a,Tag as l,Avatar as c,Card as d,Divider as s,Skeleton as v,Spin as g,Modal as h}from"antd";import p,{useState as f,useRef as u,useCallback as b,useEffect as m,useMemo as y}from"react";import{createPortal as x}from"react-dom";import{LoadingOutlined as w}from"@ant-design/icons";function k(e,t){return t||("success"===e?"positive":"error"===e?"negative":"neutral")}let S=0,C=()=>{};function z(e){const t=e.duration??3,r=e.type??"default";C({type:r,variant:k(r,e.variant),placement:e.placement??"bottom",duration:t,message:e.message,description:e.description,icon:e.icon,action:e.action,closable:e.closable??0===t,onClose:e.onClose,id:++S,exiting:!1})}const H={show:e=>z(e),success:(e,t)=>z({message:e,description:t,type:"success"}),error:(e,t)=>z({message:e,description:t,type:"error"}),warning:(e,t)=>z({message:e,description:t,type:"warning"}),info:(e,t)=>z({message:e,description:t,type:"info"})};function W(){return{contextHolder:null,toast:H}}const L={neutral:"var(--vetc-toast-bg)",positive:"var(--vetc-toast-positive-bg)",negative:"var(--vetc-toast-negative-bg)"};function B(){return t("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[e("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),e("path",{d:"M10 9v5M10 6.5v.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function I(){return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e("path",{d:"M12 4L4 12M4 4l8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}const M={default:e(B,{}),success:e(function(){return t("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[e("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),e("path",{d:"M6 10l3 3 5-5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},{}),error:e(function(){return t("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[e("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),e("path",{d:"M13 7L7 13M7 7l6 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})},{}),warning:e(function(){return t("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[e("path",{d:"M10 3L2 17h16L10 3z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),e("path",{d:"M10 9v3M10 14v.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})},{}),info:e(B,{})};function T({item:r,onDismiss:i}){const n=r.icon??M[r.type],o=Boolean(r.action)||r.closable;return t("div",{role:"alert","aria-live":"polite",style:{display:"flex",alignItems:"stretch",minHeight:40,borderRadius:"var(--vetc-toast-radius)",backgroundColor:L[r.variant],boxShadow:"var(--vetc-toast-shadow)",overflow:"hidden",fontFamily:"var(--vetc-font-family)",willChange:"opacity, transform",animation:r.exiting?"vetc-toast-out 200ms ease forwards":"vetc-toast-in 250ms ease"},children:[t("div",{style:{flex:1,display:"flex",alignItems:"center",gap:n?8:0,paddingTop:8,paddingBottom:8,paddingLeft:16,paddingRight:o?12:16,minWidth:0},children:[n&&e("span",{style:{flexShrink:0,display:"flex",width:20,height:20,color:"rgba(255,255,255,1)"},children:n}),t("div",{style:{flex:1,minWidth:0},children:[e("div",{style:{fontSize:"var(--vetc-font-size-sm)",fontWeight:400,color:"var(--vetc-toast-text)",lineHeight:"20px",wordBreak:"break-word"},children:r.message}),r.description&&e("div",{style:{fontSize:"var(--vetc-font-size-xs)",color:"rgba(255,255,255,0.7)",lineHeight:"18px",marginTop:2},children:r.description})]})]}),o&&e("div",{style:{width:1,flexShrink:0,alignSelf:"stretch",margin:"8px 0",backgroundColor:"var(--vetc-toast-divider)"}}),r.action&&e("button",{onClick:()=>{r.action.onClick(),i(r.id)},style:{flexShrink:0,background:"none",border:"none",cursor:"pointer",minWidth:64,height:32,borderRadius:"var(--vetc-radius-md)",padding:r.closable?"0 8px 0 12px":"0 16px 0 12px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"var(--vetc-font-size-sm)",lineHeight:"20px",fontWeight:600,color:"var(--vetc-toast-text)",fontFamily:"var(--vetc-font-family)",whiteSpace:"nowrap",margin:"0 0 0 0",alignSelf:"center"},children:r.action.label}),r.closable&&e("button",{onClick:()=>{r.onClose?.(),i(r.id)},"aria-label":"Đóng",style:{flexShrink:0,background:"none",border:"none",cursor:"pointer",width:32,height:32,margin:"0 8px 0 4px",padding:0,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--vetc-toast-text)",borderRadius:"var(--vetc-radius-md)",alignSelf:"center"},children:e(I,{})})]})}function F(){const[i,n]=f([]),o=u(new Map),a=b(e=>{n(t=>t.map(t=>t.id===e?{...t,exiting:!0}:t));const t=setTimeout(()=>{n(t=>t.filter(t=>t.id!==e)),o.current.delete(e)},200);o.current.set(e,t)},[]);if(m(()=>(C=e=>{if(n(t=>[...t.slice(-2),e]),e.duration>0){const t=setTimeout(()=>a(e.id),1e3*e.duration);o.current.set(e.id,t)}},()=>{C=()=>{},o.current.forEach(clearTimeout)}),[a]),!i.length)return null;const l=i.filter(e=>"top"!==e.placement),c=i.filter(e=>"top"===e.placement),d=(t,r)=>e("div",{style:{position:"fixed",..."bottom"===r?{bottom:"calc(16px + var(--safe-area-inset-bottom, 0px))"}:{top:"calc(16px + var(--safe-area-inset-top, 0px))"},left:16,right:16,zIndex:1e4,display:"flex",flexDirection:"bottom"===r?"column-reverse":"column",gap:8,pointerEvents:"none"},children:t.map(t=>e("div",{style:{pointerEvents:"auto"},children:e(T,{item:t,onDismiss:a})},t.id))});return x(t(r,{children:[l.length>0&&d(l,"bottom"),c.length>0&&d(c,"top"),e("style",{children:"\n @keyframes vetc-toast-in {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes vetc-toast-out {\n from { opacity: 1; transform: translateY(0); }\n to { opacity: 0; transform: translateY(4px); }\n }\n "})]}),document.body)}const R={white:"#ffffff",black:"#000000",blue02:"#f4fbff",blue05:"#e4f4ff",blue10:"#cae9ff",blue15:"#afddff",blue20:"#95d1ff",blue25:"#7ac4fb",blue30:"#60b6f4",blue35:"#45a8eb",blue40:"#2b99df",blue45:"#108ad1",blue50:"#007ac1",blue60:"#005c9e",blue70:"#004179",blue80:"#002853",blue90:"#00122a",green02:"#f2fef2",green05:"#dffbdf",green10:"#bff4bf",green15:"#9feca7",green20:"#82e194",green25:"#68d583",green30:"#50c775",green35:"#39b669",green40:"#25a45e",green45:"#23965b",green50:"#208758",green60:"#1b6b4d",green70:"#15503f",green80:"#0f342d",green90:"#081a18",gray02:"#f9fafa",gray05:"#f1f1f2",gray10:"#e3e4e6",gray15:"#d4d6d9",gray20:"#c6c8cc",gray25:"#b8babf",gray30:"#abacb2",gray35:"#9d9ea5",gray40:"#8f9098",gray45:"#82828a",gray50:"#74747d",gray60:"#5e5d64",gray70:"#47464b",gray80:"#2f2f32",gray90:"#181719",red02:"#fff6f9",red05:"#ffe7f0",red10:"#ffd0de",red15:"#ffb8cc",red20:"#ffa1b8",red25:"#ff89a3",red30:"#fb718d",red35:"#f55c78",red40:"#ee4b62",red45:"#e53b4d",red50:"#da2c39",red60:"#b4211f",red70:"#852419",red80:"#571f12",red90:"#2b130a",orange02:"#fffbf0",orange05:"#fff3da",orange10:"#ffe3b4",orange15:"#ffd08f",orange20:"#ffbb69",orange25:"#ffa447",orange30:"#ff8c2f",orange35:"#ef7720",orange40:"#dd6e1d",orange45:"#cb651b",orange50:"#b85c18",orange60:"#934913",orange70:"#6f370f",orange80:"#4a250a",orange90:"#251205",yellow02:"#fff8e7",yellow05:"#ffefbc",yellow10:"#ffe374",yellow15:"#ffd62b",yellow20:"#f9c600",yellow25:"#e9b900",yellow30:"#daaa00",yellow35:"#ca9b00",yellow40:"#bb8b00",yellow45:"#ab7b00",yellow50:"#9c6b00",yellow60:"#7c4b00",yellow70:"#5d2f00",yellow80:"#3e1800",yellow90:"#1f0700"},N={brand:R.green40,brandDark:R.green50,brandLight:R.green05,positive:R.green50,positiveVariant:R.green05,onPositive:R.white,onPositiveVariant:R.green60,negative:R.red50,onNegative:R.white,warning:R.orange30,onWarning:R.white,outline:R.gray50,outlineVariant:R.gray10,outlineInverse:R.gray40,theme:R.white,themeVariant:R.gray05,inverseTheme:R.gray90,primaryOnTheme:R.gray90,secondaryOnTheme:R.gray60,primaryOnInverseTheme:R.white,secondaryOnInverseTheme:R.gray20,disabledBackground:R.gray10,disabledContent:R.gray30,disabledOutline:R.gray20,overlay:"rgba(0, 0, 0, 0.4)",overlayVariant:"rgba(0, 0, 0, 0.16)",skeleton:"rgba(0, 0, 0, 0.1)"},A={token:{colorPrimary:N.brand,colorPrimaryHover:R.green35,colorPrimaryActive:N.brandDark,colorPrimaryBg:R.green02,colorPrimaryBgHover:R.green05,colorError:N.negative,colorErrorHover:R.red60,colorErrorBg:R.red02,colorWarning:N.warning,colorWarningBg:R.orange02,colorSuccess:N.positive,colorSuccessBg:R.green02,colorText:N.primaryOnTheme,colorTextSecondary:N.secondaryOnTheme,colorTextDisabled:N.disabledContent,colorTextPlaceholder:R.gray50,colorBgContainer:N.theme,colorBgLayout:N.themeVariant,colorBgSpotlight:N.inverseTheme,colorBorder:R.gray20,colorBorderSecondary:R.gray10,colorSplit:R.gray10,colorFill:R.gray05,colorFillSecondary:R.gray10,colorFillTertiary:R.gray15,fontFamily:'"Roboto", system-ui, -apple-system, sans-serif',fontSize:16,fontSizeSM:13,fontSizeLG:18,fontSizeXL:19,fontSizeHeading1:32,fontSizeHeading2:28,fontSizeHeading3:24,fontSizeHeading4:19,fontSizeHeading5:16,fontWeightStrong:600,lineHeight:1.5,borderRadius:8,borderRadiusSM:6,borderRadiusLG:12,borderRadiusXS:4,controlHeight:48,controlHeightSM:32,controlHeightLG:56,paddingXS:8,paddingSM:12,padding:16,paddingMD:16,paddingLG:24,motionDurationFast:"150ms",motionDurationMid:"250ms"},components:{Button:{primaryColor:"#ffffff",defaultBorderColor:R.gray20,defaultColor:N.primaryOnTheme,borderRadius:12,borderRadiusSM:8,borderRadiusLG:12,controlHeight:48,controlHeightSM:32,paddingInline:16,paddingInlineSM:12,fontWeight:600},Input:{borderRadius:8,controlHeight:48,paddingInline:12,colorBorder:R.gray20,hoverBorderColor:N.outline,activeBorderColor:N.brand,colorBgContainer:N.theme,hoverBg:N.theme,activeBg:N.theme},Select:{borderRadius:8,controlHeight:48},Checkbox:{borderRadius:4,controlInteractiveSize:20},Radio:{radioSize:20,dotSize:8},Switch:{trackHeight:32,trackMinWidth:52,handleSize:28,colorPrimary:N.brand},Modal:{borderRadiusLG:16,paddingContentHorizontalLG:16,paddingMD:16},Card:{borderRadius:16,paddingLG:16}}};function $({children:r}){return e(i,{theme:{...A,algorithm:n.defaultAlgorithm},children:t(o,{children:[r,e(F,{})]})})}const D={primary:'"Roboto", system-ui, -apple-system, sans-serif'},j={regular:400,medium:500,semibold:600,bold:700,black:900},O={"2xs":"10px",xs:"12px",sm:"14px",base:"16px",lg:"20px",xl:"24px","2xl":"28px","3xl":"32px","4xl":"36px"},E={tight:"120%",normal:"140%",relaxed:"150%"},P={none:"0",sm:"0.1px",md:"0.25px",lg:"0.5px"},X={display4xl:{fontSize:O["4xl"],fontWeight:j.bold,lineHeight:E.tight},display3xl:{fontSize:O["3xl"],fontWeight:j.bold,lineHeight:E.tight},display2xl:{fontSize:O["2xl"],fontWeight:j.bold,lineHeight:E.tight},headlineXl:{fontSize:O.xl,fontWeight:j.bold,lineHeight:E.normal},headlineLg:{fontSize:O.lg,fontWeight:j.semibold,lineHeight:E.normal},titleBase:{fontSize:O.base,fontWeight:j.semibold,lineHeight:E.relaxed,letterSpacing:P.sm},titleSm:{fontSize:O.sm,fontWeight:j.semibold,lineHeight:E.relaxed,letterSpacing:P.sm},labelBase:{fontSize:O.base,fontWeight:j.semibold,lineHeight:E.relaxed},labelSm:{fontSize:O.sm,fontWeight:j.semibold,lineHeight:E.relaxed,letterSpacing:P.lg},labelXs:{fontSize:O.xs,fontWeight:j.semibold,lineHeight:E.relaxed,letterSpacing:P.lg},bodyBase:{fontSize:O.base,fontWeight:j.regular,lineHeight:E.relaxed,letterSpacing:P.sm},bodySm:{fontSize:O.sm,fontWeight:j.regular,lineHeight:E.relaxed,letterSpacing:P.md},bodyXs:{fontSize:O.xs,fontWeight:j.regular,lineHeight:E.relaxed,letterSpacing:P.lg},body2xs:{fontSize:O["2xs"],fontWeight:j.regular,lineHeight:E.relaxed,letterSpacing:P.lg}},V={0:"0px",1:"1px",2:"2px",4:"4px",6:"6px",8:"8px",10:"10px",12:"12px",14:"14px",16:"16px",20:"20px",24:"24px",32:"32px",40:"40px",48:"48px",56:"56px",64:"64px",72:"72px",80:"80px"},Y={none:"0px",xs:"4px",sm:"6px",md:"8px",lg:"12px",xl:"16px","2xl":"24px",pill:"1000px"},q={buttonLg:"48px",buttonSm:"32px",input:"48px",navBar:"56px",bottomNav:"56px",tabBar:"56px",listItem:"56px",chip:"32px",chipSm:"24px",iconStd:"24px",iconSm:"20px"},_={none:"none",sm:"0 1px 4px rgba(0, 0, 0, 0.08)",md:"0 2px 8px rgba(0, 0, 0, 0.12)",lg:"0 4px 16px rgba(0, 0, 0, 0.16)"},G={filled:{bg:"var(--vetc-color-brand)",bgHover:"var(--vetc-color-brand-hover)",bgActive:"var(--vetc-color-brand-active)",text:"var(--vetc-white)",border:"transparent",shadow:"none"},outlined:{bg:"transparent",bgHover:"var(--vetc-green-02)",bgActive:"var(--vetc-green-05)",text:"var(--vetc-color-brand)",border:"var(--vetc-color-brand)",shadow:"none"},elevated:{bg:"var(--vetc-color-bg)",bgHover:"var(--vetc-color-bg-hover)",bgActive:"var(--vetc-color-bg-pressed)",text:"var(--vetc-color-brand)",border:"transparent",shadow:"var(--vetc-shadow-md)"},ghost:{bg:"transparent",bgHover:"var(--vetc-color-bg-hover)",bgActive:"var(--vetc-color-bg-pressed)",text:"var(--vetc-color-brand)",border:"transparent",shadow:"none"},danger:{bg:"var(--vetc-color-negative)",bgHover:"var(--vetc-red-60)",bgActive:"var(--vetc-red-60)",text:"var(--vetc-white)",border:"transparent",shadow:"none"},"danger-outlined":{bg:"transparent",bgHover:"var(--vetc-red-02)",bgActive:"var(--vetc-red-05)",text:"var(--vetc-color-negative)",border:"var(--vetc-color-negative)",shadow:"none"}},Q={filled:{bg:"var(--vetc-gray-90)",bgHover:"var(--vetc-gray-80)",bgActive:"var(--vetc-gray-70)",text:"var(--vetc-white)",border:"transparent",shadow:"none"},outlined:{bg:"transparent",bgHover:"var(--vetc-gray-05)",bgActive:"var(--vetc-gray-10)",text:"var(--vetc-gray-90)",border:"var(--vetc-gray-90)",shadow:"none"},elevated:{bg:"var(--vetc-color-bg)",bgHover:"var(--vetc-color-bg-hover)",bgActive:"var(--vetc-color-bg-pressed)",text:"var(--vetc-color-text-primary)",border:"transparent",shadow:"var(--vetc-shadow-md)"},ghost:{bg:"transparent",bgHover:"var(--vetc-color-bg-hover)",bgActive:"var(--vetc-color-bg-pressed)",text:"var(--vetc-color-text-primary)",border:"transparent",shadow:"none"},danger:{bg:"var(--vetc-color-negative)",bgHover:"var(--vetc-red-60)",bgActive:"var(--vetc-red-60)",text:"var(--vetc-white)",border:"transparent",shadow:"none"},"danger-outlined":{bg:"transparent",bgHover:"var(--vetc-red-02)",bgActive:"var(--vetc-red-05)",text:"var(--vetc-color-negative)",border:"var(--vetc-color-negative)",shadow:"none"}},K=({color:r})=>t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",style:{animation:"vetc-btn-spin 0.6s linear infinite",flexShrink:0},"aria-hidden":"true",children:[e("circle",{cx:"8",cy:"8",r:"6",stroke:r,strokeOpacity:"0.25",strokeWidth:"2"}),e("path",{d:"M8 2a6 6 0 016 6",stroke:r,strokeWidth:"2",strokeLinecap:"round"})]});function U({type:i="filled",variant:n="brand",size:o="lg",shape:a="rounded",block:l=!1,disabled:c=!1,loading:d=!1,icon:s,iconRight:v,onClick:g,children:h,htmlType:p="button",className:u="",css:b,id:m}){const[y,x]=f(!1),[w,k]=f(!1),S=("neutral"===n?Q:G)[i],C=c||d,z="lg"===o?"var(--vetc-btn-height-lg)":"var(--vetc-btn-height-sm)",H="lg"===o?"var(--vetc-btn-font-size-lg)":"var(--vetc-btn-font-size-sm)",W="lg"===o?"var(--vetc-btn-padding-x-lg)":"var(--vetc-btn-padding-x-sm)",L="pill"===a?"var(--vetc-btn-radius-pill)":"lg"===o?"var(--vetc-btn-radius-lg)":"var(--vetc-btn-radius-sm)";let B=S.bg,I=S.border,M=S.shadow;C?(B="var(--vetc-btn-disabled-bg)",I="var(--vetc-btn-disabled-border)",M="none"):y?B=S.bgActive:w&&(B=S.bgHover);const T=C?"var(--vetc-btn-disabled-text)":S.text,F=C?"var(--vetc-gray-30)":S.text;return t(r,{children:[t("button",{id:m,type:p,disabled:C,onClick:g,onMouseEnter:()=>k(!0),onMouseLeave:()=>{k(!1),x(!1)},onMouseDown:()=>x(!0),onMouseUp:()=>x(!1),className:`vetc-btn vetc-btn--${i} vetc-btn--${n} vetc-btn--${o} ${u}`,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"var(--vetc-space-8)",height:z,width:l?"100%":void 0,paddingInline:W,borderRadius:L,border:`1px solid ${I}`,backgroundColor:B,boxShadow:M,color:T,fontSize:H,fontWeight:"var(--vetc-btn-font-weight)",fontFamily:"var(--vetc-font-family)",lineHeight:"var(--vetc-line-height-relaxed)",cursor:C?"not-allowed":"pointer",transition:"background-color var(--vetc-transition-fast), box-shadow var(--vetc-transition-fast)",userSelect:"none",outline:"none",whiteSpace:"nowrap",WebkitTapHighlightColor:"transparent",...b},children:[d?e(K,{color:F}):s&&e("span",{style:{display:"inline-flex",flexShrink:0},children:s}),h&&e("span",{children:h}),v&&!d&&e("span",{style:{display:"inline-flex",flexShrink:0},children:v})]}),e("style",{children:"@keyframes vetc-btn-spin { to { transform: rotate(360deg); } }"})]})}function J({primary:i,secondary:n=[],content:o,layout:a="inline",variant:l="none"}){const c="inline"===a,d="bounding"===l?{backgroundColor:"var(--vetc-btn-group-bg)",borderTop:"1px solid var(--vetc-btn-group-border-color)",padding:"var(--vetc-btn-group-padding)",fontFamily:"var(--vetc-font-family)"}:{fontFamily:"var(--vetc-font-family)"},s=c?{display:"flex",gap:"var(--vetc-btn-group-gap)",alignItems:"stretch"}:{display:"flex",flexDirection:"column",gap:"var(--vetc-btn-group-gap)"},v=n.map((t,r)=>e(U,{type:"outlined",variant:"neutral",block:!c,loading:t.loading,disabled:t.disabled,onClick:t.onClick,css:c?{flex:1}:void 0,children:t.label},r)),g=e(U,{type:i.danger?"danger":"filled",variant:i.variant??"brand",block:!c,loading:i.loading,disabled:i.disabled,onClick:i.onClick,css:c?{flex:1}:void 0,children:i.label});return t("div",{style:d,children:[o&&e("div",{style:{marginBottom:"var(--vetc-btn-group-padding)"},children:o}),e("div",{style:s,children:t(r,c?{children:[v,g]}:{children:[g,v]})})]})}const Z={display4xl:{fontSize:"var(--vetc-font-size-4xl)",fontWeight:"var(--vetc-font-weight-bold)",lineHeight:"var(--vetc-line-height-tight)"},display3xl:{fontSize:"var(--vetc-font-size-3xl)",fontWeight:"var(--vetc-font-weight-bold)",lineHeight:"var(--vetc-line-height-tight)"},display2xl:{fontSize:"var(--vetc-font-size-2xl)",fontWeight:"var(--vetc-font-weight-bold)",lineHeight:"var(--vetc-line-height-tight)"},headlineXl:{fontSize:"var(--vetc-font-size-xl)",fontWeight:"var(--vetc-font-weight-bold)",lineHeight:"var(--vetc-line-height-normal)"},headlineLg:{fontSize:"var(--vetc-font-size-lg)",fontWeight:"var(--vetc-font-weight-semibold)",lineHeight:"var(--vetc-line-height-normal)"},titleBase:{fontSize:"var(--vetc-font-size-base)",fontWeight:"var(--vetc-font-weight-semibold)",lineHeight:"var(--vetc-line-height-relaxed)",letterSpacing:"var(--vetc-letter-spacing-sm)"},titleSm:{fontSize:"var(--vetc-font-size-sm)",fontWeight:"var(--vetc-font-weight-semibold)",lineHeight:"var(--vetc-line-height-relaxed)",letterSpacing:"var(--vetc-letter-spacing-sm)"},labelBase:{fontSize:"var(--vetc-font-size-base)",fontWeight:"var(--vetc-font-weight-semibold)",lineHeight:"var(--vetc-line-height-relaxed)"},labelSm:{fontSize:"var(--vetc-font-size-sm)",fontWeight:"var(--vetc-font-weight-semibold)",lineHeight:"var(--vetc-line-height-relaxed)",letterSpacing:"var(--vetc-letter-spacing-lg)"},labelXs:{fontSize:"var(--vetc-font-size-xs)",fontWeight:"var(--vetc-font-weight-semibold)",lineHeight:"var(--vetc-line-height-relaxed)",letterSpacing:"var(--vetc-letter-spacing-lg)"},labelXxs:{fontSize:"var(--vetc-font-size-2xs)",fontWeight:"var(--vetc-font-weight-semibold)",lineHeight:"var(--vetc-line-height-relaxed)",letterSpacing:"var(--vetc-letter-spacing-lg)"},bodyBase:{fontSize:"var(--vetc-font-size-base)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",letterSpacing:"var(--vetc-letter-spacing-sm)"},bodySm:{fontSize:"var(--vetc-font-size-sm)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",letterSpacing:"var(--vetc-letter-spacing-md)"},bodyXs:{fontSize:"var(--vetc-font-size-xs)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",letterSpacing:"var(--vetc-letter-spacing-lg)"},body2xs:{fontSize:"var(--vetc-font-size-2xs)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",letterSpacing:"var(--vetc-letter-spacing-lg)"}},ee={primary:"var(--vetc-color-text-primary)",secondary:"var(--vetc-color-text-secondary)",tertiary:"var(--vetc-color-text-tertiary)",disabled:"var(--vetc-color-text-disabled)",brand:"var(--vetc-color-brand)",error:"var(--vetc-color-text-error)",warning:"var(--vetc-color-warning)",success:"var(--vetc-color-positive)",inherit:"inherit"};function te({variant:t="bodyBase",color:r="primary",strikethrough:i=!1,underline:n=!1,truncate:o=!1,lines:a,as:l="span",children:c,className:d="",style:s,id:v}){const g={fontFamily:"var(--vetc-font-family)",margin:0,padding:0,...Z[t]??Z.bodyBase,color:ee[r],textDecoration:i?"line-through":n?"underline":"none",...o&&!a?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:{},...a?{display:"-webkit-box",WebkitLineClamp:a,WebkitBoxOrient:"vertical",overflow:"hidden"}:{},...s};return e(l,{id:v,className:`vetc-text vetc-text--${t} ${d}`,style:g,children:c})}function re({level:t="2xl",...r}){return e(te,{...r,variant:`display${t}`,as:r.as??"h1"})}function ie({level:t="xl",...r}){return e(te,{...r,variant:"xl"===t?"headlineXl":"headlineLg",as:r.as??"h2"})}function ne({size:t="base",...r}){return e(te,{...r,variant:"base"===t?"titleBase":"titleSm",as:r.as??"h3"})}function oe({size:t="base",...r}){return e(te,{...r,variant:{base:"labelBase",sm:"labelSm",xs:"labelXs",xxs:"labelXxs"}[t],as:r.as??"span"})}function ae({size:t="base",...r}){return e(te,{...r,variant:{base:"bodyBase",sm:"bodySm",xs:"bodyXs","2xs":"body2xs"}[t],as:r.as??"p"})}function le({htmlFor:r,required:i,disabled:n,children:o}){return t("label",{htmlFor:r,style:{fontFamily:"var(--vetc-font-family)",fontSize:"var(--vetc-input-label-font-size)",fontWeight:"var(--vetc-input-label-font-weight)",lineHeight:"var(--vetc-line-height-relaxed)",color:n?"var(--vetc-color-text-disabled)":"var(--vetc-input-label-color)",display:"block"},children:[o,i&&e("span",{style:{color:"var(--vetc-color-negative)",marginLeft:"var(--vetc-space-2)"},children:"*"})]})}function ce({color:t,children:r}){return e("span",{style:{fontFamily:"var(--vetc-font-family)",fontSize:"var(--vetc-input-helper-font-size)",lineHeight:"var(--vetc-line-height-relaxed)",color:t},children:r})}const de={height:"var(--vetc-input-height)",borderRadius:"var(--vetc-input-radius)",paddingInline:"var(--vetc-input-padding-x)",fontSize:"var(--vetc-input-font-size)",fontFamily:"var(--vetc-font-family)",backgroundColor:"var(--vetc-input-bg)",transition:"border-color 150ms ease, box-shadow 150ms ease",WebkitTapHighlightColor:"transparent"};function se({label:r,placeholder:i,value:n,defaultValue:o,helperText:l,status:c="default",error:d,disabled:s=!1,readOnly:v=!1,maxLength:g,showCount:h=!1,prefix:p,suffix:f,allowClear:u=!1,onChange:b,onFocus:m,onBlur:y,onPressEnter:x,type:w="text",id:k,name:S,className:C="",style:z,required:H=!1}){const W=!!d?"error":c,L="error"===W?"error":void 0,B=d??l,I="error"===W?"var(--vetc-input-helper-color-error)":"var(--vetc-input-helper-color)";return t("div",{className:`vetc-input-wrapper ${C}`,style:{display:"flex",flexDirection:"column",gap:"var(--vetc-input-gap)",...z},children:[r&&e(le,{htmlFor:k,required:H,disabled:s,children:r}),e(a,{id:k,name:S,type:w,value:n,defaultValue:o,placeholder:i,disabled:s,readOnly:v,maxLength:g,showCount:h,prefix:p,suffix:f,allowClear:u,status:L,onChange:e=>b?.(e.target.value,e),onFocus:m,onBlur:y,onPressEnter:x,style:de}),B&&e(ce,{color:I,children:B})]})}function ve({label:r,placeholder:i,value:n,defaultValue:o,helperText:l,status:c="default",error:d,disabled:s=!1,readOnly:v=!1,maxLength:g,onChange:h,onFocus:p,onBlur:f,id:u,name:b,className:m="",style:y,required:x=!1}){const w=!!d,k="error"===(w?"error":c)?"error":void 0,S=d??l,C=w?"var(--vetc-input-helper-color-error)":"var(--vetc-input-helper-color)";return t("div",{className:`vetc-input-wrapper ${m??""}`,style:{display:"flex",flexDirection:"column",gap:"var(--vetc-input-gap)",...y},children:[r&&e(le,{htmlFor:u,required:x,disabled:s,children:r}),e(a.Password,{id:u,name:b,value:n,defaultValue:o,placeholder:i,disabled:s,readOnly:v,maxLength:g,status:k,onChange:e=>h?.(e.target.value,e),onFocus:p,onBlur:f,style:de}),S&&e(ce,{color:C,children:S})]})}const{TextArea:ge}=a;function he({htmlFor:r,required:i,disabled:n,children:o}){return t("label",{htmlFor:r,style:{fontFamily:"var(--vetc-font-family)",fontSize:"var(--vetc-input-label-font-size)",fontWeight:"var(--vetc-input-label-font-weight)",lineHeight:"var(--vetc-line-height-relaxed)",color:n?"var(--vetc-color-text-disabled)":"var(--vetc-input-label-color)",display:"block"},children:[o,i&&e("span",{style:{color:"var(--vetc-color-negative)",marginLeft:"var(--vetc-space-2)"},children:"*"})]})}function pe({label:r,placeholder:i,value:n,defaultValue:o,helperText:a,error:l,disabled:c=!1,readOnly:d=!1,maxLength:s,showCount:v=!1,rows:g=4,autoSize:h,onChange:p,onFocus:f,onBlur:u,id:b,name:m,className:y="",style:x,required:w=!1}){const k=!!l,S=l??a,C=k?"var(--vetc-input-helper-color-error)":"var(--vetc-input-helper-color)";return t("div",{className:`vetc-textarea-wrapper ${y}`,style:{display:"flex",flexDirection:"column",gap:"var(--vetc-input-gap)",...x},children:[r&&e(he,{htmlFor:b,required:w,disabled:c,children:r}),e(ge,{id:b,name:m,value:n,defaultValue:o,placeholder:i,disabled:c,readOnly:d,maxLength:s,showCount:v,rows:g,autoSize:h,status:k?"error":void 0,onChange:e=>p?.(e.target.value),onFocus:f,onBlur:u,style:{borderRadius:"var(--vetc-input-radius)",padding:"var(--vetc-input-padding-x)",fontSize:"var(--vetc-input-font-size)",fontFamily:"var(--vetc-font-family)",resize:"vertical"}}),S&&e("span",{style:{fontFamily:"var(--vetc-font-family)",fontSize:"var(--vetc-input-helper-font-size)",lineHeight:"var(--vetc-line-height-relaxed)",color:C},children:S})]})}function fe({open:i,title:n,children:o,footer:a,maskClosable:l=!0,showHandle:c=!1,swipeToClose:d=!0,maxHeight:s="90vh",onClose:v,className:g="",style:h,id:p}){const y=u(null),x=u(null),w=u(null),k=u(0),[S,C]=f(0),[z,H]=f(!1);m(()=>(document.body.style.overflow=i?"hidden":"",()=>{document.body.style.overflow=""}),[i]),m(()=>{i||(C(0),H(!1))},[i]);const W=b(()=>{H(!0),setTimeout(()=>{C(0),v?.()},300)},[v]);if(!i&&!z)return null;const L=S>0&&!z,B=z?"translateY(calc(100% + 8px))":L?`translateY(${S}px)`:"translateY(0)",I=z?"transform 300ms cubic-bezier(0.32, 0.72, 0, 1)":L?"none":"transform 0.28s cubic-bezier(0.32, 0.72, 0, 1)",M=L||z?"none":"vetc-slide-up var(--vetc-transition-slow) cubic-bezier(0.32, 0.72, 0, 1)",T=z?0:L?Math.max(0,1-S/240):1;return t(r,{children:[e("div",{className:"vetc-bottom-sheet-overlay","aria-hidden":"true",onClick:()=>l&&!z&&v?.(),style:{position:"fixed",inset:0,backgroundColor:"var(--vetc-sheet-overlay)",zIndex:1e3,opacity:T,transition:z?"opacity 300ms":L?"none":void 0,animation:L||z?"none":"vetc-fade-in var(--vetc-transition-base)"}}),t("div",{ref:y,id:p,role:"dialog","aria-modal":"true",className:`vetc-bottom-sheet ${g}`,onTouchStart:e=>{d&&(x.current&&x.current.scrollTop>0||(w.current=e.touches[0].clientY,k.current=0))},onTouchMove:e=>{if(!d||null===w.current)return;const t=e.touches[0].clientY-w.current;t<0?w.current=null:(k.current=t,C(t))},onTouchEnd:()=>{d&&null!==w.current&&(w.current=null,k.current>=120?W():C(0))},style:{position:"fixed",left:8,right:8,backgroundColor:"var(--vetc-sheet-bg)",borderRadius:"var(--vetc-sheet-radius)",maxHeight:s,display:"flex",flexDirection:"column",overflow:"hidden",zIndex:1001,fontFamily:"var(--vetc-font-family)",transform:B,transition:I,animation:M,willChange:"transform",...h},children:[c&&e("div",{style:{display:"flex",justifyContent:"center",paddingTop:"var(--vetc-space-8)",paddingBottom:"var(--vetc-space-4)",cursor:d?"grab":void 0,flexShrink:0},children:e("div",{style:{width:"var(--vetc-sheet-handle-width)",height:"var(--vetc-sheet-handle-height)",borderRadius:"var(--vetc-radius-pill)",backgroundColor:"var(--vetc-sheet-handle-color)"}})}),n&&t("div",{style:{display:"flex",alignItems:"center",padding:8,flexShrink:0},children:[e("div",{style:{width:32,height:32,flexShrink:0}}),e("div",{style:{flex:1,textAlign:"center",padding:"4px 8px"},children:e("span",{style:{fontSize:"var(--vetc-font-size-base)",fontWeight:600,color:"var(--vetc-color-text-primary)",lineHeight:"var(--vetc-line-height-relaxed)",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n})}),v?e("button",{onClick:v,"aria-label":"Đóng",style:{width:32,height:32,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",color:"var(--vetc-color-icon-muted)",borderRadius:"var(--vetc-radius-sm)",transition:"background-color var(--vetc-transition-fast)"},children:e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:e("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}):e("div",{style:{width:32,height:32,flexShrink:0}})]}),e("div",{ref:x,style:{flex:1,overflowY:"auto",minHeight:0,padding:"0 var(--vetc-sheet-padding) var(--vetc-sheet-padding)"},children:o}),a&&e("div",{style:{flexShrink:0,borderTop:"1px solid var(--vetc-sheet-border)",padding:"var(--vetc-sheet-padding)"},children:a})]}),e("style",{children:"\n @keyframes vetc-fade-in {\n from { opacity: 0 }\n to { opacity: 1 }\n }\n @keyframes vetc-slide-up {\n from { transform: translateY(calc(100% + 8px)) }\n to { transform: translateY(0) }\n }\n "})]})}const ue=()=>e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e("path",{d:"M4 6l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),be=()=>t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),e("path",{d:"M5 8l2 2 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),me=()=>e("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:e("path",{d:"M9 3L3 9M3 3l6 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),ye=()=>t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e("circle",{cx:"7",cy:"7",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),e("path",{d:"M11 11l2.5 2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]});function xe({label:r,selected:i,disabled:n,showDivider:o,onClick:a}){const[l,c]=f(!1);return t("div",{role:"option","aria-selected":i,onClick:n?void 0:a,onMouseDown:()=>!n&&c(!0),onMouseUp:()=>c(!1),onMouseLeave:()=>c(!1),onTouchStart:()=>!n&&c(!0),onTouchEnd:()=>c(!1),style:{display:"flex",alignItems:"center",padding:"var(--vetc-space-12) var(--vetc-space-16)",borderBottom:o?"1px solid var(--vetc-color-border-variant)":"none",cursor:n?"not-allowed":"pointer",backgroundColor:l?"var(--vetc-color-bg-pressed)":"transparent",transition:"background-color 0.15s",userSelect:"none",WebkitTapHighlightColor:"transparent"},children:[e("span",{style:{flex:1,fontSize:"var(--vetc-font-size-sm)",lineHeight:"20px",fontWeight:i?600:400,color:n?"var(--vetc-color-text-disabled)":"var(--vetc-color-text-primary)",fontFamily:"var(--vetc-font-family)"},children:r}),i&&e("span",{style:{color:"var(--vetc-color-brand)",lineHeight:0,flexShrink:0,marginLeft:"var(--vetc-space-8)"},children:e(be,{})})]})}function we(e){return null==e?[]:Array.isArray(e)?e:[e]}function ke({label:r,placeholder:i="Chọn...",value:n,defaultValue:o,options:a=[],helperText:l,error:c,disabled:d=!1,multiple:s=!1,searchable:v=!1,allowClear:g=!1,loading:h,popupMatchSelectWidth:p,onChange:u,onSearch:b,required:x=!1,id:w,className:k="",style:S}){const[C,z]=f(!1),[H,W]=f(""),[L,B]=f(()=>we(void 0!==n?n:o));m(()=>{void 0!==n&&B(we(n))},[n]);const I=y(()=>void 0!==n?we(n):L,[n,L]),M=y(()=>v&&H?a.filter(e=>String(e.label).toLowerCase().includes(H.toLowerCase())):a,[a,H,v]),T=y(()=>a.filter(e=>I.includes(e.value)),[a,I]),F=T.length>0?T.map(e=>e.label).join(", "):void 0,R=!!c,N=c??l,A=R?"var(--vetc-input-border-error)":d?"var(--vetc-input-border-disabled)":"var(--vetc-input-border)";return t("div",{className:`vetc-select-wrapper ${k}`,style:{display:"flex",flexDirection:"column",gap:"var(--vetc-input-gap)",fontFamily:"var(--vetc-font-family)",...S},children:[r&&t("label",{htmlFor:w,style:{fontSize:"var(--vetc-input-label-font-size)",fontWeight:"var(--vetc-input-label-font-weight)",lineHeight:"var(--vetc-line-height-relaxed)",color:d?"var(--vetc-color-text-disabled)":"var(--vetc-input-label-color)",display:"block"},children:[r,x&&e("span",{style:{color:"var(--vetc-color-negative)",marginLeft:"var(--vetc-space-2)"},children:"*"})]}),t("button",{id:w,type:"button",disabled:d,"aria-haspopup":"listbox","aria-expanded":C,onClick:()=>z(!0),style:{height:"var(--vetc-input-height)",width:"100%",display:"flex",alignItems:"center",gap:"var(--vetc-space-8)",paddingInline:"var(--vetc-input-padding-x)",borderRadius:"var(--vetc-input-radius)",border:`1px solid ${A}`,backgroundColor:d?"var(--vetc-input-bg-disabled)":"var(--vetc-input-bg)",cursor:d?"not-allowed":"pointer",textAlign:"left",fontFamily:"var(--vetc-font-family)",fontSize:"var(--vetc-input-font-size)",transition:"border-color 0.15s",WebkitTapHighlightColor:"transparent"},children:[e("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:F?d?"var(--vetc-input-text-disabled)":"var(--vetc-input-text)":"var(--vetc-input-text-placeholder)"},children:F??i}),g&&I.length>0&&!d&&e("span",{role:"button","aria-label":"Xóa",onClick:e=>{e.stopPropagation(),void 0===n&&B([]),u?.(s?[]:void 0,s?[]:void 0)},style:{display:"flex",alignItems:"center",color:"var(--vetc-color-text-secondary)",flexShrink:0,lineHeight:0},children:e(me,{})}),e("span",{style:{display:"flex",alignItems:"center",color:d?"var(--vetc-color-text-disabled)":"var(--vetc-color-text-secondary)",flexShrink:0,lineHeight:0,transform:C?"rotate(180deg)":"none",transition:"transform 0.2s ease"},children:e(ue,{})})]}),N&&e("span",{style:{fontSize:"var(--vetc-input-helper-font-size)",lineHeight:"var(--vetc-line-height-relaxed)",color:R?"var(--vetc-input-helper-color-error)":"var(--vetc-input-helper-color)"},children:N}),t(fe,{open:C,title:r,onClose:()=>{z(!1),W("")},children:[v&&e("div",{style:{position:"sticky",top:0,zIndex:1,backgroundColor:"var(--vetc-color-bg)",paddingBottom:"var(--vetc-space-8)",marginInline:"calc(-1 * var(--vetc-sheet-padding))",paddingInline:"var(--vetc-sheet-padding)"},children:t("div",{style:{display:"flex",alignItems:"center",gap:"var(--vetc-space-8)",height:40,paddingInline:"var(--vetc-input-padding-x)",borderRadius:"var(--vetc-input-radius)",border:"1px solid var(--vetc-input-border)",backgroundColor:"var(--vetc-input-bg)"},children:[e("span",{style:{color:"var(--vetc-color-text-secondary)",lineHeight:0,flexShrink:0},children:e(ye,{})}),e("input",{type:"text",placeholder:"Tìm kiếm...",value:H,onChange:e=>{return t=e.target.value,W(t),void b?.(t);var t},style:{flex:1,border:"none",outline:"none",background:"transparent",fontFamily:"var(--vetc-font-family)",fontSize:"var(--vetc-font-size-sm)",color:"var(--vetc-color-text-primary)",lineHeight:"20px"}})]})}),e("div",{style:{marginInline:"calc(-1 * var(--vetc-sheet-padding))"},children:0===M.length?e("div",{style:{padding:"var(--vetc-space-24) var(--vetc-space-16)",textAlign:"center",color:"var(--vetc-color-text-secondary)",fontSize:"var(--vetc-font-size-sm)",fontFamily:"var(--vetc-font-family)"},children:"Không tìm thấy kết quả"}):M.map((t,r)=>e(xe,{label:String(t.label),selected:I.includes(t.value),disabled:t.disabled,showDivider:r<M.length-1,onClick:()=>(e=>{let t;s?t=I.includes(e)?I.filter(t=>t!==e):[...I,e]:(t=[e],z(!1),W("")),void 0===n&&B(t);const r=a.filter(e=>t.includes(e.value));u?.(s?t:t[0],s?r:r[0])})(t.value)},String(t.value)))})]})]})}const Se=()=>e("svg",{width:"12",height:"9",viewBox:"0 0 12 9",fill:"none","aria-hidden":"true",children:e("path",{d:"M1 4L4.5 7.5L11 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Ce=()=>e("svg",{width:"10",height:"2",viewBox:"0 0 10 2",fill:"none","aria-hidden":"true",children:e("path",{d:"M1 1H9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})});function ze({label:r,description:i,checked:n,defaultChecked:o=!1,indeterminate:a=!1,disabled:l=!1,variant:c="brand",onChange:d,value:s,id:v,className:g="",style:h}){const[p,u]=f(o),[b,m]=f(!1),y=void 0!==n,x=y?n:p,w="brand"===c?"var(--vetc-color-brand)":"var(--vetc-gray-90)";let k="transparent",S=l?"var(--vetc-color-border-disabled)":b?w:"var(--vetc-color-border)",C="var(--vetc-white)";return(x||a)&&(k=l?"var(--vetc-color-bg-disabled)":w,S=l?"var(--vetc-color-border-disabled)":b?"brand"===c?"var(--vetc-color-brand-hover)":"var(--vetc-gray-70)":w,C=l?"var(--vetc-color-text-disabled)":"var(--vetc-white)",l&&(k="var(--vetc-color-bg-disabled)")),t("label",{htmlFor:v,className:`vetc-checkbox ${g}`,onMouseEnter:()=>!l&&m(!0),onMouseLeave:()=>m(!1),style:{display:"inline-flex",alignItems:i?"flex-start":"center",gap:"var(--vetc-space-12)",cursor:l?"not-allowed":"pointer",userSelect:"none",fontFamily:"var(--vetc-font-family)",WebkitTapHighlightColor:"transparent",...h},children:[e("input",{id:v,type:"checkbox",checked:x,disabled:l,value:s,onChange:()=>{if(l)return;const e=!x;y||u(e),d?.(e)},style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-checked":a?"mixed":x}),t("span",{"aria-hidden":"true",style:{width:"20px",height:"20px",flexShrink:0,borderRadius:"var(--vetc-radius-xs)",border:`1.5px solid ${S}`,backgroundColor:k,display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color var(--vetc-transition-fast), border-color var(--vetc-transition-fast)",color:C,marginTop:i?"2px":0},children:[x&&!a&&e(Se,{}),a&&e(Ce,{})]}),(r||i)&&t("span",{style:{display:"flex",flexDirection:"column",gap:"var(--vetc-space-2)"},children:[r&&e("span",{style:{fontSize:"var(--vetc-font-size-base)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",color:l?"var(--vetc-color-text-disabled)":"var(--vetc-color-text-primary)"},children:r}),i&&e("span",{style:{fontSize:"var(--vetc-font-size-sm)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",color:l?"var(--vetc-color-text-disabled)":"var(--vetc-color-text-secondary)"},children:i})]})]})}function He({options:t,value:r,defaultValue:i=[],direction:n="vertical",disabled:o=!1,variant:a="brand",onChange:l,className:c="",style:d}){const[s,v]=f(i),g=void 0!==r,h=g?r:s;return e("div",{className:`vetc-checkbox-group ${c}`,style:{display:"flex",flexDirection:"vertical"===n?"column":"row",flexWrap:"horizontal"===n?"wrap":void 0,gap:"vertical"===n?"var(--vetc-space-12)":"var(--vetc-space-16)",fontFamily:"var(--vetc-font-family)",...d},children:t.map(t=>e(ze,{label:t.label,description:t.description,checked:h.includes(t.value),disabled:t.disabled??o,variant:a,value:t.value,onChange:e=>((e,t)=>{const r=t?[...h,e]:h.filter(t=>t!==e);g||v(r),l?.(r)})(t.value,e)},String(t.value)))})}function We({label:r,description:i,checked:n,defaultChecked:o=!1,disabled:a=!1,variant:l="brand",onChange:c,value:d,id:s,className:v="",style:g}){const[h,p]=f(o),[u,b]=f(!1),m=void 0!==n,y=m?n:h,x="brand"===l?"var(--vetc-color-brand)":"var(--vetc-gray-90)",w=a?"var(--vetc-color-border-disabled)":y?u?"brand"===l?"var(--vetc-color-brand-hover)":"var(--vetc-gray-70)":x:u?x:"var(--vetc-color-border)",k=a?"var(--vetc-color-text-disabled)":x;return t("label",{htmlFor:s,className:`vetc-radio ${v}`,onMouseEnter:()=>!a&&b(!0),onMouseLeave:()=>b(!1),style:{display:"inline-flex",alignItems:i?"flex-start":"center",gap:"var(--vetc-space-12)",cursor:a?"not-allowed":"pointer",userSelect:"none",fontFamily:"var(--vetc-font-family)",WebkitTapHighlightColor:"transparent",...g},children:[e("input",{id:s,type:"radio",checked:y,disabled:a,value:d,onChange:()=>{a||y||(m||p(!0),c?.(!0))},style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"}}),e("span",{"aria-hidden":"true",style:{width:"20px",height:"20px",flexShrink:0,borderRadius:"50%",border:`1.5px solid ${w}`,backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",transition:"border-color var(--vetc-transition-fast)",marginTop:i?"2px":0},children:y&&e("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:k,flexShrink:0}})}),(r||i)&&t("span",{style:{display:"flex",flexDirection:"column",gap:"var(--vetc-space-2)"},children:[r&&e("span",{style:{fontSize:"var(--vetc-font-size-base)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",color:a?"var(--vetc-color-text-disabled)":"var(--vetc-color-text-primary)"},children:r}),i&&e("span",{style:{fontSize:"var(--vetc-font-size-sm)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",color:a?"var(--vetc-color-text-disabled)":"var(--vetc-color-text-secondary)"},children:i})]})]})}function Le({options:t,value:r,defaultValue:i,direction:n="vertical",disabled:o=!1,variant:a="brand",onChange:l,className:c="",style:d}){const[s,v]=f(i),g=void 0!==r,h=g?r:s;return e("div",{role:"radiogroup",className:`vetc-radio-group ${c}`,style:{display:"flex",flexDirection:"vertical"===n?"column":"row",flexWrap:"horizontal"===n?"wrap":void 0,gap:"vertical"===n?"var(--vetc-space-12)":"var(--vetc-space-16)",fontFamily:"var(--vetc-font-family)",...d},children:t.map(t=>e(We,{label:t.label,description:t.description,checked:h===t.value,disabled:t.disabled??o,variant:a,value:t.value,onChange:()=>{return e=t.value,g||v(e),void l?.(e);var e}},String(t.value)))})}function Be({label:i,description:n,labelPosition:o="right",checked:a,defaultChecked:l=!1,disabled:c=!1,loading:d=!1,variant:s="brand",onChange:v,id:g,className:h="",style:p}){const[u,b]=f(l),m=void 0!==a,y=m?a:u,x=c||d,w=()=>{if(x)return;const e=!y;m||b(e),v?.(e)},k=t("button",{id:g,type:"button",role:"switch","aria-checked":y,disabled:x,onClick:w,className:`vetc-switch ${h}`,style:{position:"relative",display:"inline-flex",alignItems:"center",width:"var(--vetc-switch-width)",height:"var(--vetc-switch-height)",borderRadius:"var(--vetc-radius-pill)",backgroundColor:x?"var(--vetc-color-bg-disabled)":y?"brand"===s?"var(--vetc-switch-on-bg)":"var(--vetc-gray-90)":"var(--vetc-switch-off-bg)",border:"none",cursor:x?"not-allowed":"pointer",padding:0,flexShrink:0,transition:"background-color var(--vetc-transition-fast)",outline:"none",WebkitTapHighlightColor:"transparent",...i||n?{}:p},children:[e("span",{style:{position:"absolute",left:y?"calc(100% - 30px)":"2px",width:"var(--vetc-switch-thumb-size)",height:"var(--vetc-switch-thumb-size)",borderRadius:"50%",backgroundColor:x?"var(--vetc-gray-20)":"var(--vetc-white)",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",transition:"left var(--vetc-transition-fast)",display:"flex",alignItems:"center",justifyContent:"center"},children:d&&t("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",style:{animation:"vetc-btn-spin 0.6s linear infinite"},"aria-hidden":"true",children:[e("circle",{cx:"6",cy:"6",r:"4",stroke:"var(--vetc-gray-30)",strokeWidth:"1.5"}),e("path",{d:"M6 2a4 4 0 014 4",stroke:"var(--vetc-color-brand)",strokeWidth:"1.5",strokeLinecap:"round"})]})}),e("style",{children:"@keyframes vetc-btn-spin { to { transform: rotate(360deg); } }"})]});if(!i&&!n)return k;const S=t("span",{style:{display:"flex",flexDirection:"column",gap:"var(--vetc-space-2)",flex:1},children:[i&&e("span",{style:{fontSize:"var(--vetc-font-size-base)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",color:x?"var(--vetc-color-text-disabled)":"var(--vetc-color-text-primary)"},children:i}),n&&e("span",{style:{fontSize:"var(--vetc-font-size-sm)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",color:x?"var(--vetc-color-text-disabled)":"var(--vetc-color-text-secondary)"},children:n})]});return e("div",{style:{display:"flex",alignItems:"center",gap:"var(--vetc-space-12)",flexDirection:"left"===o?"row-reverse":"row",fontFamily:"var(--vetc-font-family)",cursor:x?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent",...p},onClick:w,children:t(r,"right"===o?{children:[k,S]}:{children:[S,k]})})}const Ie={default:{bg:"var(--vetc-chip-default-bg)",border:"var(--vetc-chip-default-border)",text:"var(--vetc-chip-default-text)",filledBg:"var(--vetc-chip-default-filled-bg)"},positive:{bg:"var(--vetc-chip-positive-bg)",border:"var(--vetc-chip-positive-border)",text:"var(--vetc-chip-positive-text)",filledBg:"var(--vetc-chip-positive-filled-bg)"},negative:{bg:"var(--vetc-chip-negative-bg)",border:"var(--vetc-chip-negative-border)",text:"var(--vetc-chip-negative-text)",filledBg:"var(--vetc-chip-negative-filled-bg)"},warning:{bg:"var(--vetc-chip-warning-bg)",border:"var(--vetc-chip-warning-border)",text:"var(--vetc-chip-warning-text)",filledBg:"var(--vetc-chip-warning-filled-bg)"},info:{bg:"var(--vetc-chip-info-bg)",border:"var(--vetc-chip-info-border)",text:"var(--vetc-chip-info-text)",filledBg:"var(--vetc-chip-info-filled-bg)"}},Me={brand:{bg:"var(--vetc-chip-brand-bg)",border:"var(--vetc-chip-brand-border)",text:"var(--vetc-chip-brand-text)",filledBg:"var(--vetc-chip-brand-filled-bg)"},neutral:{bg:"var(--vetc-chip-neutral-bg)",border:"var(--vetc-chip-neutral-border)",text:"var(--vetc-chip-neutral-text)",filledBg:"var(--vetc-chip-neutral-filled-bg)"}};function Te({type:t="tinted",status:r="default",variant:i,shape:n="pill",size:o="md",icon:a,closable:c=!1,onClose:d,onClick:s,children:v,className:g="",css:h,id:p}){const f=i?Me[i]:Ie[r],u="md"===o?"var(--vetc-chip-height-md)":"var(--vetc-chip-height-sm)",b="md"===o?"var(--vetc-chip-padding-x-md)":"var(--vetc-chip-padding-x-sm)",m="md"===o?"var(--vetc-chip-font-size-md)":"var(--vetc-chip-font-size-sm)",y="pill"===n?"var(--vetc-chip-radius-pill)":"var(--vetc-chip-radius-rounded)";let x=f.bg,w=`1px solid ${f.border}`,k=f.text;return"filled"===t?(x=f.filledBg,w="none",k="var(--vetc-white)"):"outlined"===t&&(x="transparent",w=`1px solid ${f.border}`,k=f.text),e(l,{id:p,closable:c,onClose:e=>{e.preventDefault(),d?.()},onClick:s,icon:a,className:`vetc-chip vetc-chip--${t} vetc-chip--${r} ${g}`,style:{display:"inline-flex",alignItems:"center",height:u,padding:`0 ${b}`,borderRadius:y,background:x,border:w,color:k,fontSize:m,fontWeight:"var(--vetc-chip-font-weight)",fontFamily:"var(--vetc-font-family)",cursor:s?"pointer":"default",userSelect:"none",lineHeight:1,gap:"var(--vetc-space-4)",transition:"var(--vetc-transition-fast)",...h},children:v})}const Fe={display:"inline-block",width:"var(--vetc-badge-dot-size)",height:"var(--vetc-badge-dot-size)",borderRadius:"var(--vetc-badge-radius)",background:"var(--vetc-badge-bg)",flexShrink:0},Re={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"var(--vetc-badge-size)",height:"var(--vetc-badge-size)",padding:"0 5px",borderRadius:"var(--vetc-badge-radius)",background:"var(--vetc-badge-bg)",color:"var(--vetc-badge-text)",fontSize:"var(--vetc-badge-font-size)",fontWeight:"var(--vetc-badge-font-weight)",lineHeight:"16px",whiteSpace:"nowrap",fontFamily:"var(--vetc-font-family)"};function Ne({dot:r=!1,count:i,label:n,overflowCount:o=99,outline:a=!1,children:l,className:c,style:d}){const s=r||void 0===i&&void 0===n;let v=null;s||(void 0!==i?v=i>o?`${o}+`:String(i):void 0!==n&&(v=n));const g=e("span",{className:c,style:{...s?Fe:Re,...a?{boxShadow:"0 0 0 var(--vetc-badge-outline-width) var(--vetc-badge-outline-color)"}:{},...d},children:v});return l?t("span",{style:{position:"relative",display:"inline-flex"},children:[l,e("span",{style:{position:"absolute",top:0,right:0,transform:"translate(50%, -50%)",zIndex:1},children:g})]}):g}const Ae={xl:"var(--vetc-avatar-size-xl)",lg:"var(--vetc-avatar-size-lg)",md:"var(--vetc-avatar-size-md)",sm:"var(--vetc-avatar-size-sm)",xs:"var(--vetc-avatar-size-xs)"},$e={xl:56,lg:48,md:40,sm:32,xs:24},De={xl:"var(--vetc-font-size-2xl)",lg:"var(--vetc-font-size-xl)",md:"var(--vetc-font-size-base)",sm:"var(--vetc-font-size-sm)",xs:"var(--vetc-font-size-2xs)"};function je({src:t,alt:r,initials:i,icon:n,size:o="md",shape:a="circle",color:l,className:d="",style:s,onClick:v,id:g}){return e("span",{id:g,style:{display:"inline-flex",flexShrink:0,width:Ae[o],height:Ae[o]},children:e(c,{src:t,alt:r,icon:t||i?void 0:n,size:$e[o],shape:a,onClick:v,className:`vetc-avatar vetc-avatar--${o} ${d}`,style:{backgroundColor:t?void 0:l??"var(--vetc-avatar-bg-default)",fontSize:De[o],fontWeight:"var(--vetc-font-weight-bold)",fontFamily:"var(--vetc-font-family)",color:"var(--vetc-avatar-text-color)",cursor:v?"pointer":"default",flexShrink:0,...s},children:!t&&i?i.slice(0,2).toUpperCase():void 0})})}function Oe({elevation:t="outlined",title:r,extra:i,children:n,onClick:o,className:a="",style:l,bodyStyle:c,id:s}){return e(d,{id:s,title:r,extra:i,onClick:o,className:`vetc-card vetc-card--${t} ${a}`,styles:{body:{padding:"var(--vetc-card-padding)",fontFamily:"var(--vetc-font-family)",...c},header:r?{borderBottom:"1px solid var(--vetc-card-border)",padding:"var(--vetc-space-12) var(--vetc-card-padding)"}:void 0},style:{borderRadius:"var(--vetc-card-radius)",border:{flat:"none",raised:"none",outlined:"1px solid var(--vetc-card-border)"}[t],boxShadow:{flat:"var(--vetc-shadow-none)",raised:"var(--vetc-card-shadow-raised)",outlined:"var(--vetc-shadow-none)"}[t],cursor:o?"pointer":"default",overflow:"hidden",backgroundColor:"var(--vetc-card-bg)",fontFamily:"var(--vetc-font-family)",transition:"box-shadow var(--vetc-transition-fast)",...l},children:n})}function Ee({disabled:t}){return e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:e("path",{d:"M7.5 5L12.5 10L7.5 15",stroke:t?"var(--vetc-color-icon-disabled)":"var(--vetc-color-icon-muted)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Pe({leading:r,title:i,description:n,trailing:o,arrow:a=!1,divider:l=!0,onClick:c,disabled:d=!1,className:s="",style:v,id:g}){const h=!!c&&!d;return t("div",{id:g,role:h?"button":void 0,tabIndex:h?0:void 0,className:`vetc-list-item ${s}`,onClick:d?void 0:c,onKeyDown:h?e=>{"Enter"!==e.key&&" "!==e.key||c?.()}:void 0,style:{display:"flex",alignItems:"center",minHeight:"var(--vetc-list-item-height)",padding:"0 var(--vetc-list-item-padding-x)",gap:"var(--vetc-list-item-gap)",cursor:h?"pointer":"default",borderBottom:l?"1px solid var(--vetc-list-item-border)":"none",backgroundColor:"var(--vetc-list-item-bg)",opacity:d?.5:1,fontFamily:"var(--vetc-font-family)",transition:"background-color var(--vetc-transition-fast)",outline:"none",...v},onMouseEnter:e=>{h&&(e.currentTarget.style.backgroundColor="var(--vetc-list-item-bg-hover)")},onMouseLeave:e=>{h&&(e.currentTarget.style.backgroundColor="var(--vetc-list-item-bg)")},children:[r&&e("div",{style:{flexShrink:0,display:"flex",alignItems:"center",color:"var(--vetc-list-item-icon-color)"},children:r}),t("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:"var(--vetc-space-2)"},children:[e("span",{style:{fontSize:"var(--vetc-list-item-title-size)",fontWeight:"var(--vetc-list-item-title-weight)",color:d?"var(--vetc-color-text-disabled)":"var(--vetc-list-item-title-color)",lineHeight:"var(--vetc-line-height-relaxed)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i}),n&&e("span",{style:{fontSize:"var(--vetc-list-item-desc-size)",fontWeight:"var(--vetc-font-weight-regular)",color:d?"var(--vetc-color-text-disabled)":"var(--vetc-list-item-desc-color)",lineHeight:"var(--vetc-line-height-relaxed)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n})]}),(o||a)&&t("div",{style:{flexShrink:0,display:"flex",alignItems:"center",gap:"var(--vetc-space-8)",color:"var(--vetc-list-item-icon-color)"},children:[o,a&&e(Ee,{disabled:d})]})]})}function Xe({items:t,renderItem:r,bordered:i=!1,className:n="",style:o,id:a}){return e("div",{id:a,className:`vetc-list ${n}`,style:{border:i?"1px solid var(--vetc-color-border-variant)":"none",borderRadius:i?"var(--vetc-card-radius)":0,overflow:"hidden",backgroundColor:"var(--vetc-color-bg)",...o},children:t.map((t,i)=>e(p.Fragment,{children:r(t,i)},i))})}function Ve({orientation:t="horizontal",label:r,labelAlign:i="center",thickness:n=1,color:o,margin:a,className:l="",style:c}){const d="vertical"===t;return e(s,{type:d?"vertical":"horizontal",orientationMargin:"center"!==i?0:void 0,orientation:"center"!==i?i:void 0,className:`vetc-divider ${l}`,style:{borderColor:o??"var(--vetc-divider-color)",borderTopWidth:d?void 0:n,borderLeftWidth:d?n:void 0,margin:a??(d?"0 var(--vetc-divider-margin-v)":"var(--vetc-divider-margin-h) 0"),fontFamily:"var(--vetc-font-family)",fontSize:"var(--vetc-divider-label-size)",color:"var(--vetc-divider-label-color)",...c},children:r})}const Ye={sm:16,md:24,lg:40};function qe({size:t="md",color:r,fullscreen:i=!1,tip:n,children:o,spinning:a=!0,className:l="",style:c}){const d=e(w,{style:{fontSize:Ye[t],color:r??"var(--vetc-spinner-color)"},spin:!0});return o?e(g,{spinning:a,indicator:d,tip:n,className:`vetc-spinner ${l}`,style:c,children:o}):e("div",i?{className:`vetc-spinner-overlay ${l}`,style:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--vetc-color-overlay)",zIndex:9999,...c},children:e(g,{spinning:a,indicator:d,tip:n})}:{className:`vetc-spinner ${l}`,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",...c},children:e(g,{spinning:a,indicator:d,tip:n})})}function _e({rows:t=3,avatar:r=!1,avatarSize:i=40,title:n=!0,loading:o=!0,className:a="",style:l,children:c}){return e(v,{active:!0,loading:o,avatar:!!r&&{size:i,shape:"circle"},title:n,paragraph:{rows:t},className:`vetc-skeleton ${a}`,style:l,children:c})}const Ge={height:"var(--vetc-btn-height-lg)",borderRadius:"var(--vetc-btn-radius-lg)",fontWeight:"var(--vetc-btn-font-weight)",fontSize:"var(--vetc-btn-font-size-lg)",fontFamily:"var(--vetc-font-family)"};function Qe({open:t,title:r,children:i,footer:n,okText:o="Xác nhận",cancelText:a="Hủy",okDisabled:l=!1,okLoading:c=!1,okDanger:d=!1,onOk:s,onCancel:v,maskClosable:g=!0,closable:p=!0,width:f,className:u="",style:b,id:m}){return e(h,{open:t,title:r,okText:o,cancelText:a,okButtonProps:{disabled:l,loading:c,danger:d,style:Ge},cancelButtonProps:{style:Ge},footer:null===n?null:n,onOk:s,onCancel:v,maskClosable:g,closable:p,width:f??"var(--vetc-modal-width)",centered:!0,className:`vetc-modal ${u}`,style:{fontFamily:"var(--vetc-font-family)",...b},styles:{header:{padding:"var(--vetc-modal-padding) var(--vetc-modal-padding) 0",borderBottom:"none"},body:{padding:"var(--vetc-space-8) var(--vetc-modal-padding) var(--vetc-modal-padding)"},footer:{padding:"0 var(--vetc-modal-padding) var(--vetc-modal-padding)",borderTop:"none"},mask:{backgroundColor:"var(--vetc-modal-overlay)"}},children:i})}function Ke(){return{confirm:e=>{h.confirm({title:e.title,content:e.content,okText:e.okText??"Xác nhận",cancelText:e.cancelText??"Hủy",okButtonProps:{danger:e.okDanger,style:{...Ge,height:40}},cancelButtonProps:{style:{...Ge,height:40}},centered:!0,onOk:e.onOk,onCancel:e.onCancel,styles:{mask:{backgroundColor:"var(--vetc-modal-overlay)"}}})}}}const Ue=()=>e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function Je({open:i,imageOnly:n=!1,image:o,title:a,description:l,okText:c="Xác nhận",cancelText:d="Hủy",okDisabled:s=!1,okLoading:v=!1,okDanger:g=!1,onOk:h,onCancel:p,maskClosable:f=!0}){if(m(()=>(document.body.style.overflow=i?"hidden":"",()=>{document.body.style.overflow=""}),[i]),!i)return null;const u=!!(a||l||o);return e(r,{children:x(e("div",{style:{position:"fixed",inset:0,backgroundColor:"var(--vetc-color-overlay)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,padding:"0 var(--vetc-space-24)"},onClick:f?p:void 0,children:t("div",n?{style:{position:"relative",width:"100%",maxWidth:"var(--vetc-dialog-width)",borderRadius:"var(--vetc-dialog-radius)",overflow:"hidden"},onClick:e=>e.stopPropagation(),children:[o&&e("img",{src:o,alt:"",style:{width:"100%",display:"block",aspectRatio:"1",objectFit:"cover"}}),p&&e("button",{"aria-label":"Đóng",onClick:p,style:{position:"absolute",top:12,right:12,width:40,height:40,border:"none",borderRadius:"50%",backgroundColor:"var(--vetc-color-bg)",boxShadow:"var(--vetc-shadow-md)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"var(--vetc-color-text-primary)",padding:0},children:e(Ue,{})})]}:{style:{width:"100%",maxWidth:"var(--vetc-dialog-width)",backgroundColor:"var(--vetc-dialog-bg)",borderRadius:"var(--vetc-dialog-radius)",overflow:"hidden",boxShadow:"var(--vetc-shadow-lg)",fontFamily:"var(--vetc-font-family)"},onClick:e=>e.stopPropagation(),children:[p&&e("div",{style:{display:"flex",justifyContent:"flex-end",padding:"8px 8px 0"},children:e("button",{"aria-label":"Đóng",onClick:p,style:{width:32,height:32,border:"none",background:"transparent",borderRadius:"var(--vetc-radius-md)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"var(--vetc-color-text-secondary)",padding:0},children:e(Ue,{})})}),u&&t("div",{style:{padding:(p?"var(--vetc-space-8)":"var(--vetc-space-20)")+" var(--vetc-space-16) 0",textAlign:o?"center":"left"},children:[o&&e("div",{style:{display:"flex",justifyContent:"center",marginBottom:"var(--vetc-space-12)"},children:e("img",{src:o,alt:"",style:{width:"var(--vetc-dialog-image-size)",height:"var(--vetc-dialog-image-size)",borderRadius:"var(--vetc-dialog-radius)",objectFit:"cover",display:"block"}})}),a&&e("div",{style:{fontSize:"var(--vetc-dialog-title-size)",fontWeight:"var(--vetc-dialog-title-weight)",lineHeight:"var(--vetc-dialog-title-line-height)",color:"var(--vetc-color-text-primary)",marginBottom:l?"var(--vetc-space-8)":0},children:a}),l&&e("div",{style:{fontSize:"var(--vetc-dialog-desc-size)",lineHeight:"var(--vetc-dialog-desc-line-height)",color:"var(--vetc-dialog-desc-color)"},children:l})]}),t("div",{style:{display:"flex",gap:"var(--vetc-dialog-btn-gap)",padding:"var(--vetc-space-12) var(--vetc-space-16) var(--vetc-space-16)"},children:[p&&e(U,{block:!0,type:"outlined",variant:"neutral",onClick:p,children:d}),e(U,{block:!0,type:g?"danger":"filled",loading:v,disabled:s,onClick:h,children:c})]})]})}),document.body)})}const Ze=()=>e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function et(e,t){const r="var(--vetc-tooltip-bg)",i={position:"absolute",width:0,height:0};return"top"===e?(i.bottom=-6,i.borderLeft="6px solid transparent",i.borderRight="6px solid transparent",i.borderTop=`6px solid ${r}`):"bottom"===e?(i.top=-6,i.borderLeft="6px solid transparent",i.borderRight="6px solid transparent",i.borderBottom=`6px solid ${r}`):"left"===e?(i.right=-6,i.borderTop="6px solid transparent",i.borderBottom="6px solid transparent",i.borderLeft=`6px solid ${r}`):(i.left=-6,i.borderTop="6px solid transparent",i.borderBottom="6px solid transparent",i.borderRight=`6px solid ${r}`),"top"===e||"bottom"===e?"center"===t?(i.left="50%",i.transform="translateX(-50%)"):"start"===t?i.left=12:i.right=12:"center"===t?(i.top="50%",i.transform="translateY(-50%)"):"start"===t?i.top=12:i.bottom=12,i}function tt({content:i,placement:n="top",align:o="center",closable:a=!1,open:l,defaultOpen:c=!1,onClose:d,children:s,style:v,className:g}){const h=u(null),p=u(null),[y,w]=f(c),[k,S]=f({top:-9999,left:-9999}),C=void 0!==l,z=C?l:y,H=b(()=>{if(!h.current||!p.current)return;const e=h.current.getBoundingClientRect(),t=p.current.getBoundingClientRect();S(function(e,t,r,i,n){let o=0,a=0;switch(t){case"top":o=e.top-n-8;break;case"bottom":o=e.bottom+8;break;case"left":a=e.left-i-8;break;case"right":a=e.right+8}return"top"===t||"bottom"===t?a="center"===r?e.left+e.width/2-i/2:"start"===r?e.left:e.right-i:o="center"===r?e.top+e.height/2-n/2:"start"===r?e.top:e.bottom-n,{top:o,left:a}}(e,n,o,t.width,t.height))},[n,o]);m(()=>{z?requestAnimationFrame(H):S({top:-9999,left:-9999})},[z,H]);const W=b(()=>{C||w(!1),d?.()},[C,d]);m(()=>{if(!z)return;const e=e=>{const t=e.target;h.current?.contains(t)||p.current?.contains(t)||W()};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}},[z,W]);return t(r,{children:[e("span",{ref:h,style:{display:"inline-block"},onClick:e=>{s.props.onClick?.(e),C||w(e=>!e)},children:s}),z&&x(t("div",{ref:p,role:"tooltip",className:g,style:{position:"fixed",top:k.top,left:k.left,zIndex:9999,background:"var(--vetc-tooltip-bg)",color:"var(--vetc-tooltip-text)",borderRadius:"var(--vetc-tooltip-radius)",boxShadow:"var(--vetc-tooltip-shadow)",minWidth:"var(--vetc-tooltip-min-width)",minHeight:"var(--vetc-tooltip-min-height)",fontSize:"var(--vetc-tooltip-font-size)",lineHeight:"var(--vetc-tooltip-line-height)",WebkitTapHighlightColor:"transparent",overflow:"hidden",...v},children:[e("div",{style:et(n,o)}),a?t("div",{style:{display:"flex",alignItems:"center"},children:[e("div",{style:{flex:1,padding:"5px 8px 5px 12px"},children:i}),e("div",{style:{width:1,alignSelf:"stretch",background:"var(--vetc-tooltip-divider)",flexShrink:0}}),e("button",{onClick:W,"aria-label":"Đóng",style:{width:"var(--vetc-tooltip-close-size)",height:"var(--vetc-tooltip-close-size)",borderRadius:"var(--vetc-tooltip-radius)",background:"none",border:"none",cursor:"pointer",color:"var(--vetc-tooltip-text)",display:"flex",alignItems:"center",justifyContent:"center",padding:0,flexShrink:0},children:e(Ze,{})})]}):e("div",{style:{padding:"5px 12px"},children:i})]}),document.body)]})}function rt(){return e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:e("path",{d:"M15 19L8 12L15 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function it(){return e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:e("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}const nt={background:"none",border:"none",cursor:"pointer",width:"var(--vetc-nav-icon-btn-size)",height:"var(--vetc-nav-icon-btn-size)",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"var(--vetc-radius-pill)",color:"var(--vetc-nav-icon-color)",flexShrink:0,padding:0,transition:"background-color var(--vetc-transition-fast)"};function ot({title:r,leading:i="none",leadingIcon:n,onLeadingPress:o,actions:a=[],leftSlot:l,rightSlot:c,backgroundColor:d,divider:s=!0,transparent:v=!1,portal:g,className:h="",style:p,id:f,showBack:u,backIcon:b,onBack:m,left:y,right:w}){const k=u?"back":i,S=n??b,C=o??m,z=!0===g?"undefined"!=typeof document?document.body:null:g||null,H=t("header",{id:f,className:`vetc-nav-bar ${h}`,style:{display:"flex",alignItems:"center",height:"var(--vetc-nav-height)",padding:"0 var(--vetc-nav-padding-x)",backgroundColor:v?"transparent":d??"var(--vetc-nav-bg)",borderBottom:s&&!v?"1px solid var(--vetc-nav-border)":"none",fontFamily:"var(--vetc-font-family)",position:g?"fixed":"relative",...g?{top:0,left:0,right:0,zIndex:999}:{},...p},children:[e("div",{style:{display:"flex",alignItems:"center",minWidth:"var(--vetc-nav-icon-btn-size)",zIndex:1},children:(()=>{if(void 0!==l||void 0!==y)return l??y;if("none"===k)return null;const t=S??e("close"===k?it:rt,{});return e("button",{onClick:C,style:nt,"aria-label":"close"===k?"Đóng":"Quay lại",children:t})})()}),r&&e("div",{style:{position:"absolute",left:0,right:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:e("span",{style:{fontSize:"var(--vetc-nav-title-size)",fontWeight:"var(--vetc-nav-title-weight)",color:"var(--vetc-nav-title-color)",lineHeight:"var(--vetc-line-height-normal)",maxWidth:"60%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r})}),e("div",{style:{display:"flex",alignItems:"center",gap:"var(--vetc-space-4)",marginLeft:"auto",zIndex:1},children:void 0!==c||void 0!==w?c??w:a.slice(0,2).map((t,r)=>e("button",{id:t.id,onClick:t.onClick,disabled:t.disabled,"aria-label":t.label,style:{...nt,opacity:t.disabled?.4:1},children:t.icon},r))})]});return z?x(H,z):H}function at({items:r,activeKey:i,onChange:n,variant:o="brand",backgroundColor:a,divider:l=!0,className:c="",style:d,id:s}){const v="brand"===o?"var(--vetc-tab-color-active)":"var(--vetc-color-text-primary)";return e("nav",{id:s,className:`vetc-tab-bar ${c}`,style:{display:"flex",alignItems:"stretch",height:"var(--vetc-tab-height)",backgroundColor:a??"var(--vetc-tab-bg)",borderTop:l?"1px solid var(--vetc-tab-border)":"none",fontFamily:"var(--vetc-font-family)",...d},children:r.map(r=>{const o=r.key===i,a=r.disabled?"var(--vetc-tab-color-disabled)":o?v:"var(--vetc-tab-color-inactive)";return t("button",{disabled:r.disabled,onClick:()=>!r.disabled&&n?.(r.key),"aria-current":o?"page":void 0,"aria-label":r.label,className:"vetc-tab-bar__item"+(o?" vetc-tab-bar__item--active":""),style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"var(--vetc-space-2)",background:"none",border:"none",cursor:r.disabled?"not-allowed":"pointer",padding:"var(--vetc-space-6) 0",position:"relative",opacity:r.disabled?.5:1,transition:"color var(--vetc-transition-fast)",color:a},children:[t("div",{style:{position:"relative",display:"inline-flex"},children:[e("span",{style:{color:a,display:"flex",fontSize:"24px",lineHeight:1},children:o&&r.activeIcon?r.activeIcon:r.icon}),void 0!==r.badge&&e("span",{style:{position:"absolute",top:"calc(-1 * var(--vetc-space-4))",right:"calc(-1 * var(--vetc-space-8))",minWidth:"var(--vetc-tab-badge-size)",height:"var(--vetc-tab-badge-size)",backgroundColor:"var(--vetc-tab-badge-bg)",borderRadius:"var(--vetc-radius-pill)",fontSize:"var(--vetc-tab-badge-font-size)",fontWeight:"var(--vetc-font-weight-semibold)",color:"var(--vetc-tab-badge-text)",display:"flex",alignItems:"center",justifyContent:"center",padding:"0 var(--vetc-space-4)",lineHeight:1},children:r.badge})]}),e("span",{style:{fontSize:"var(--vetc-tab-label-size)",fontWeight:"var(--vetc-tab-label-weight)",color:a,lineHeight:"var(--vetc-line-height-relaxed)"},children:r.label})]},r.key)})})}const lt="undefined"!=typeof window,ct=(e,t={})=>{const r=lt&&window.flutter_inappwebview&&window.flutter_inappwebview.callHandler&&"function"==typeof window.flutter_inappwebview.callHandler?window.flutter_inappwebview:null;return r?r.callHandler("MiniAppBridge",{action:e,payload:t}):Promise.resolve({ok:!1,error:"BRIDGE_CALL_FAILED"})};let dt=new Map,st="/";function vt(){return dt.get(st)}function gt(e){st=e}function ht({config:t}){const[r,i]=f(null);if(m(()=>{!function(e){dt=new Map(e.pages.map(e=>[e.path,e]))}(t);gt((window.location.pathname||"/").replace("/miniapp","")||"/");let e=vt()??null;if(!e){if(0===t.pages.length)return void console.error("[App] config.pages is empty — no pages to render.");gt(t.pages[0].path),e=vt()??null}i(e),ct("registerAppConfig",{config:t}).catch(e=>{console.error("[App] registerAppConfigError:",e)})},[t]),!r)return e("div",{});const n=r.Component;return e(n,{})}function pt(e){const t=u(e);m(()=>{t.current=e},[e]),m(()=>{if("undefined"==typeof window||!window.MiniApp)return;const e=window.MiniApp,r=()=>{try{t.current?.()}catch(e){console.error("[useAppResume error]",e)}};return e.on("appResume",r),()=>e.off("appResume",r)},[])}function ft(e){const t=u(e);m(()=>{t.current=e},[e]),m(()=>{if("undefined"==typeof window||!window.MiniApp)return;const e=window.MiniApp,r=()=>{try{t.current?.()}catch(e){console.error("[useAppPause error]",e)}};return e.on("appPause",r),()=>e.off("appPause",r)},[])}function ut(e,t){const r=u(t);m(()=>{r.current=t},[t]),m(()=>{if("undefined"==typeof window||!window.MiniApp)return;const t=window.MiniApp,i=t=>{t?.route===e&&r.current?.(t)};return t.on("didShow",i),()=>t.off("didShow",i)},[e])}function bt(e,t){const r=u(t);m(()=>{r.current=t},[t]),m(()=>{if("undefined"==typeof window||!window.MiniApp)return;const t=window.MiniApp,i=t=>{t?.route===e&&r.current?.(t)};return t.on("didHide",i),()=>t.off("didHide",i)},[e])}function mt(e,t){const r=u(t);m(()=>{r.current=t},[t]),m(()=>{if("undefined"==typeof window||!window.MiniApp)return;const t=window.MiniApp,i=t=>{t?.route===e&&r.current?.(t)};return t.on("onTapAppBar",i),()=>t.off("onTapAppBar",i)},[e])}function yt(){return(e,t={},r={})=>{"number"!=typeof e?ct("navigate",{type:"native",action:"push",route:e,params:t,options:r}).catch(console.error):ct("navigate",{type:"native",action:"pop",delta:Math.abs(e)})}}function xt(e){const t=u(e);m(()=>{t.current=e},[e]),m(()=>{if("undefined"==typeof window||!window.MiniApp)return;const e=window.MiniApp,r=e=>{try{t.current?.(e)}catch(e){console.error("[useListenerScanQr error]",e)}};return e.on("scanQrResult",r),()=>e.off("scanQrResult",r)},[])}export{ht as App,je as Avatar,Ne as Badge,ae as Body,fe as BottomSheet,U as Button,J as ButtonGroup,Oe as Card,ze as Checkbox,He as CheckboxGroup,Te as Chip,Je as Dialog,re as Display,Ve as Divider,ke as Dropdown,ie as Headline,se as Input,oe as Label,Xe as List,Pe as ListItem,Qe as Modal,ot as NavigationBar,ve as PasswordInput,We as Radio,Le as RadioGroup,_e as SkeletonLoader,qe as Spinner,Be as Switch,at as TabBar,pe as Textarea,ne as Title,F as ToastContainer,tt as Tooltip,te as Typography,$ as VETCProvider,Y as borderRadius,N as colorAlias,R as colorGlobal,q as componentHeight,D as fontFamily,O as fontSize,j as fontWeight,P as letterSpacing,E as lineHeight,_ as shadow,V as spacing,X as textStyle,H as toast,ft as useAppPause,pt as useAppResume,Ke as useConfirm,bt as useDidHide,ut as useDidShow,xt as useListenerScanQr,yt as useNavigate,mt as useTapAppBar,W as useToast,A as vetcAntdTheme};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vetc-miniapp/ui-react",
3
- "version": "0.0.34",
3
+ "version": "0.0.35",
4
4
  "description": "MiniApp Platform UI React",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",