import{i as e}from"./chunk-62oNxeRG.js";import{h as t,n,o as r,r as i}from"./index-sVS3Pihd.js";var a=e(t(),1);function o(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function s(...e){return t=>{let n=!1,r=e.map(e=>{let r=o(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():o(e[t],null)}}}}function c(...e){return a.useCallback(s(...e),e)}var l=r(),u=Symbol.for(`react.lazy`),d=a.use;function f(e){return typeof e==`object`&&!!e&&`then`in e}function p(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===u&&`_payload`in e&&f(e._payload)}function m(e){let t=g(e),n=a.forwardRef((e,n)=>{let{children:r,...i}=e;p(r)&&typeof d==`function`&&(r=d(r._payload));let o=a.Children.toArray(r),s=o.find(v);if(s){let e=s.props.children,r=o.map(t=>t===s?a.Children.count(e)>1?a.Children.only(null):a.isValidElement(e)?e.props.children:null:t);return(0,l.jsx)(t,{...i,ref:n,children:a.isValidElement(e)?a.cloneElement(e,void 0,r):null})}return(0,l.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var h=m(`Slot`);function g(e){let t=a.forwardRef((e,t)=>{let{children:n,...r}=e;if(p(n)&&typeof d==`function`&&(n=d(n._payload)),a.isValidElement(n)){let e=b(n),i=y(r,n.props);return n.type!==a.Fragment&&(i.ref=t?s(t,e):e),a.cloneElement(n,i)}return a.Children.count(n)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var _=Symbol(`radix.slottable`);function v(e){return a.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===_}function y(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function b(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var x=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,S=i,C=(e,t)=>n=>{if(t?.variants==null)return S(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=x(t)||x(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return S(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},w=C(`focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-colors duration-200 outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive dark:bg-destructive/60 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-white hover:bg-red-700 hover:shadow-lg dark:hover:bg-red-500`,outline:`bg-background dark:bg-input/30 dark:border-input border shadow-xs hover:bg-gray-100 dark:hover:bg-white/[0.08]`,secondary:`bg-secondary text-secondary-foreground dark:bg-secondary hover:bg-gray-300 dark:hover:bg-white/[0.15]`,ghost:`hover:bg-gray-100 dark:hover:bg-white/[0.08]`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,sm:`h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function T({className:e,variant:t=`default`,size:r=`default`,asChild:i=!1,...a}){return(0,l.jsx)(i?h:`button`,{"data-slot":`button`,"data-variant":t,"data-size":r,className:n(w({variant:t,size:r,className:e})),...a})}export{c as a,s as i,C as n,m as r,T as t};