UNPKG

@anyreach/component-library-ui

Version:

React component library built on shadcn/ui foundation following atomic design principles

30 lines (28 loc) 66 kB
(function(i,Ce){typeof exports=="object"&&typeof module<"u"?Ce(exports,require("clsx"),require("tailwind-merge"),require("react"),require("@radix-ui/react-slot"),require("class-variance-authority"),require("lucide-react"),require("@radix-ui/react-label"),require("@radix-ui/react-checkbox"),require("@radix-ui/react-radio-group"),require("@radix-ui/react-select"),require("date-fns"),require("@radix-ui/react-dialog"),require("@radix-ui/react-toast")):typeof define=="function"&&define.amd?define(["exports","clsx","tailwind-merge","react","@radix-ui/react-slot","class-variance-authority","lucide-react","@radix-ui/react-label","@radix-ui/react-checkbox","@radix-ui/react-radio-group","@radix-ui/react-select","date-fns","@radix-ui/react-dialog","@radix-ui/react-toast"],Ce):(i=typeof globalThis<"u"?globalThis:i||self,Ce(i.ComponentLibraryUI={},i.clsx,i.tailwindMerge,i.React,i.reactSlot,i.ClassVarianceAuthority,i.LucideReact,i.LabelPrimitive,i.CheckboxPrimitive,i.RadioGroupPrimitive,i.SelectPrimitive,i.dateFns,i.DialogPrimitive,i.ToastPrimitives))})(this,function(i,Ce,Et,Ve,Pt,l,x,Dt,It,Ot,Mt,B,zt,Vt){"use strict";function ve(s){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(a,t,c.get?c:{enumerable:!0,get:()=>s[t]})}}return a.default=s,Object.freeze(a)}const d=ve(Ve),dr=ve(Dt),Fe=ve(It),ke=ve(Ot),F=ve(Mt),z=ve(zt),te=ve(Vt);function n(...s){return Et.twMerge(Ce.clsx(s))}var Le={exports:{}},Se={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var cr;function Ft(){if(cr)return Se;cr=1;var s=Ve,a=Symbol.for("react.element"),t=Symbol.for("react.fragment"),c=Object.prototype.hasOwnProperty,f=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0};function S(w,j,R){var b,C={},N=null,O=null;R!==void 0&&(N=""+R),j.key!==void 0&&(N=""+j.key),j.ref!==void 0&&(O=j.ref);for(b in j)c.call(j,b)&&!m.hasOwnProperty(b)&&(C[b]=j[b]);if(w&&w.defaultProps)for(b in j=w.defaultProps,j)C[b]===void 0&&(C[b]=j[b]);return{$$typeof:a,type:w,key:N,ref:O,props:C,_owner:f.current}}return Se.Fragment=t,Se.jsx=S,Se.jsxs=S,Se}var Te={};/** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var ur;function Lt(){return ur||(ur=1,process.env.NODE_ENV!=="production"&&function(){var s=Ve,a=Symbol.for("react.element"),t=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),w=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),W=Symbol.iterator,ie="@@iterator";function K(r){if(r===null||typeof r!="object")return null;var o=W&&r[W]||r[ie];return typeof o=="function"?o:null}var q=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function I(r){{for(var o=arguments.length,u=new Array(o>1?o-1:0),g=1;g<o;g++)u[g-1]=arguments[g];X("error",r,u)}}function X(r,o,u){{var g=q.ReactDebugCurrentFrame,D=g.getStackAddendum();D!==""&&(o+="%s",u=u.concat([D]));var M=u.map(function(_){return String(_)});M.unshift("Warning: "+o),Function.prototype.apply.call(console[r],console,M)}}var $=!1,ae=!1,oe=!1,ce=!1,Y=!1,h;h=Symbol.for("react.module.reference");function pe(r){return!!(typeof r=="string"||typeof r=="function"||r===c||r===m||Y||r===f||r===R||r===b||ce||r===O||$||ae||oe||typeof r=="object"&&r!==null&&(r.$$typeof===N||r.$$typeof===C||r.$$typeof===S||r.$$typeof===w||r.$$typeof===j||r.$$typeof===h||r.getModuleId!==void 0))}function ue(r,o,u){var g=r.displayName;if(g)return g;var D=o.displayName||o.name||"";return D!==""?u+"("+D+")":u}function J(r){return r.displayName||"Context"}function A(r){if(r==null)return null;if(typeof r.tag=="number"&&I("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case c:return"Fragment";case t:return"Portal";case m:return"Profiler";case f:return"StrictMode";case R:return"Suspense";case b:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case w:var o=r;return J(o)+".Consumer";case S:var u=r;return J(u._context)+".Provider";case j:return ue(r,r.render,"ForwardRef");case C:var g=r.displayName||null;return g!==null?g:A(r.type)||"Memo";case N:{var D=r,M=D._payload,_=D._init;try{return A(_(M))}catch{return null}}}return null}var se=Object.assign,le=0,y,G,ne,ee,v,k,L;function V(){}V.__reactDisabledLog=!0;function p(){{if(le===0){y=console.log,G=console.info,ne=console.warn,ee=console.error,v=console.group,k=console.groupCollapsed,L=console.groupEnd;var r={configurable:!0,enumerable:!0,value:V,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}le++}}function P(){{if(le--,le===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:se({},r,{value:y}),info:se({},r,{value:G}),warn:se({},r,{value:ne}),error:se({},r,{value:ee}),group:se({},r,{value:v}),groupCollapsed:se({},r,{value:k}),groupEnd:se({},r,{value:L})})}le<0&&I("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var E=q.ReactCurrentDispatcher,fe;function Ne(r,o,u){{if(fe===void 0)try{throw Error()}catch(D){var g=D.stack.trim().match(/\n( *(at )?)/);fe=g&&g[1]||""}return` `+fe+r}}var me=!1,Oe;{var gs=typeof WeakMap=="function"?WeakMap:Map;Oe=new gs}function vt(r,o){if(!r||me)return"";{var u=Oe.get(r);if(u!==void 0)return u}var g;me=!0;var D=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var M;M=E.current,E.current=null,p();try{if(o){var _=function(){throw Error()};if(Object.defineProperty(_.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_,[])}catch(re){g=re}Reflect.construct(r,[],_)}else{try{_.call()}catch(re){g=re}r.call(_.prototype)}}else{try{throw Error()}catch(re){g=re}r()}}catch(re){if(re&&g&&typeof re.stack=="string"){for(var T=re.stack.split(` `),Z=g.stack.split(` `),U=T.length-1,H=Z.length-1;U>=1&&H>=0&&T[U]!==Z[H];)H--;for(;U>=1&&H>=0;U--,H--)if(T[U]!==Z[H]){if(U!==1||H!==1)do if(U--,H--,H<0||T[U]!==Z[H]){var de=` `+T[U].replace(" at new "," at ");return r.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",r.displayName)),typeof r=="function"&&Oe.set(r,de),de}while(U>=1&&H>=0);break}}}finally{me=!1,E.current=M,P(),Error.prepareStackTrace=D}var we=r?r.displayName||r.name:"",ge=we?Ne(we):"";return typeof r=="function"&&Oe.set(r,ge),ge}function hs(r,o,u){return vt(r,!1)}function bs(r){var o=r.prototype;return!!(o&&o.isReactComponent)}function Me(r,o,u){if(r==null)return"";if(typeof r=="function")return vt(r,bs(r));if(typeof r=="string")return Ne(r);switch(r){case R:return Ne("Suspense");case b:return Ne("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case j:return hs(r.render);case C:return Me(r.type,o,u);case N:{var g=r,D=g._payload,M=g._init;try{return Me(M(D),o,u)}catch{}}}return""}var Pe=Object.prototype.hasOwnProperty,xt={},gt=q.ReactDebugCurrentFrame;function ze(r){if(r){var o=r._owner,u=Me(r.type,r._source,o?o.type:null);gt.setExtraStackFrame(u)}else gt.setExtraStackFrame(null)}function js(r,o,u,g,D){{var M=Function.call.bind(Pe);for(var _ in r)if(M(r,_)){var T=void 0;try{if(typeof r[_]!="function"){var Z=Error((g||"React class")+": "+u+" type `"+_+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[_]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Z.name="Invariant Violation",Z}T=r[_](o,_,g,u,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(U){T=U}T&&!(T instanceof Error)&&(ze(D),I("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",g||"React class",u,_,typeof T),ze(null)),T instanceof Error&&!(T.message in xt)&&(xt[T.message]=!0,ze(D),I("Failed %s type: %s",u,T.message),ze(null))}}}var Ns=Array.isArray;function sr(r){return Ns(r)}function ys(r){{var o=typeof Symbol=="function"&&Symbol.toStringTag,u=o&&r[Symbol.toStringTag]||r.constructor.name||"Object";return u}}function ws(r){try{return ht(r),!1}catch{return!0}}function ht(r){return""+r}function bt(r){if(ws(r))return I("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ys(r)),ht(r)}var jt=q.ReactCurrentOwner,Cs={key:!0,ref:!0,__self:!0,__source:!0},Nt,yt;function ks(r){if(Pe.call(r,"ref")){var o=Object.getOwnPropertyDescriptor(r,"ref").get;if(o&&o.isReactWarning)return!1}return r.ref!==void 0}function Ss(r){if(Pe.call(r,"key")){var o=Object.getOwnPropertyDescriptor(r,"key").get;if(o&&o.isReactWarning)return!1}return r.key!==void 0}function Ts(r,o){typeof r.ref=="string"&&jt.current}function Rs(r,o){{var u=function(){Nt||(Nt=!0,I("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",o))};u.isReactWarning=!0,Object.defineProperty(r,"key",{get:u,configurable:!0})}}function _s(r,o){{var u=function(){yt||(yt=!0,I("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",o))};u.isReactWarning=!0,Object.defineProperty(r,"ref",{get:u,configurable:!0})}}var Es=function(r,o,u,g,D,M,_){var T={$$typeof:a,type:r,key:o,ref:u,props:_,_owner:M};return T._store={},Object.defineProperty(T._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(T,"_self",{configurable:!1,enumerable:!1,writable:!1,value:g}),Object.defineProperty(T,"_source",{configurable:!1,enumerable:!1,writable:!1,value:D}),Object.freeze&&(Object.freeze(T.props),Object.freeze(T)),T};function Ps(r,o,u,g,D){{var M,_={},T=null,Z=null;u!==void 0&&(bt(u),T=""+u),Ss(o)&&(bt(o.key),T=""+o.key),ks(o)&&(Z=o.ref,Ts(o,D));for(M in o)Pe.call(o,M)&&!Cs.hasOwnProperty(M)&&(_[M]=o[M]);if(r&&r.defaultProps){var U=r.defaultProps;for(M in U)_[M]===void 0&&(_[M]=U[M])}if(T||Z){var H=typeof r=="function"?r.displayName||r.name||"Unknown":r;T&&Rs(_,H),Z&&_s(_,H)}return Es(r,T,Z,D,g,jt.current,_)}}var nr=q.ReactCurrentOwner,wt=q.ReactDebugCurrentFrame;function ye(r){if(r){var o=r._owner,u=Me(r.type,r._source,o?o.type:null);wt.setExtraStackFrame(u)}else wt.setExtraStackFrame(null)}var ir;ir=!1;function or(r){return typeof r=="object"&&r!==null&&r.$$typeof===a}function Ct(){{if(nr.current){var r=A(nr.current.type);if(r)return` Check the render method of \``+r+"`."}return""}}function Ds(r){return""}var kt={};function Is(r){{var o=Ct();if(!o){var u=typeof r=="string"?r:r.displayName||r.name;u&&(o=` Check the top-level render call using <`+u+">.")}return o}}function St(r,o){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var u=Is(o);if(kt[u])return;kt[u]=!0;var g="";r&&r._owner&&r._owner!==nr.current&&(g=" It was passed a child from "+A(r._owner.type)+"."),ye(r),I('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',u,g),ye(null)}}function Tt(r,o){{if(typeof r!="object")return;if(sr(r))for(var u=0;u<r.length;u++){var g=r[u];or(g)&&St(g,o)}else if(or(r))r._store&&(r._store.validated=!0);else if(r){var D=K(r);if(typeof D=="function"&&D!==r.entries)for(var M=D.call(r),_;!(_=M.next()).done;)or(_.value)&&St(_.value,o)}}}function Os(r){{var o=r.type;if(o==null||typeof o=="string")return;var u;if(typeof o=="function")u=o.propTypes;else if(typeof o=="object"&&(o.$$typeof===j||o.$$typeof===C))u=o.propTypes;else return;if(u){var g=A(o);js(u,r.props,"prop",g,r)}else if(o.PropTypes!==void 0&&!ir){ir=!0;var D=A(o);I("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",D||"Unknown")}typeof o.getDefaultProps=="function"&&!o.getDefaultProps.isReactClassApproved&&I("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ms(r){{for(var o=Object.keys(r.props),u=0;u<o.length;u++){var g=o[u];if(g!=="children"&&g!=="key"){ye(r),I("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",g),ye(null);break}}r.ref!==null&&(ye(r),I("Invalid attribute `ref` supplied to `React.Fragment`."),ye(null))}}var Rt={};function _t(r,o,u,g,D,M){{var _=pe(r);if(!_){var T="";(r===void 0||typeof r=="object"&&r!==null&&Object.keys(r).length===0)&&(T+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Z=Ds();Z?T+=Z:T+=Ct();var U;r===null?U="null":sr(r)?U="array":r!==void 0&&r.$$typeof===a?(U="<"+(A(r.type)||"Unknown")+" />",T=" Did you accidentally export a JSX literal instead of a component?"):U=typeof r,I("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",U,T)}var H=Ps(r,o,u,D,M);if(H==null)return H;if(_){var de=o.children;if(de!==void 0)if(g)if(sr(de)){for(var we=0;we<de.length;we++)Tt(de[we],r);Object.freeze&&Object.freeze(de)}else I("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Tt(de,r)}if(Pe.call(o,"key")){var ge=A(r),re=Object.keys(o).filter(function($s){return $s!=="key"}),lr=re.length>0?"{key: someKey, "+re.join(": ..., ")+": ...}":"{key: someKey}";if(!Rt[ge+lr]){var Bs=re.length>0?"{"+re.join(": ..., ")+": ...}":"{}";I(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`,lr,ge,Bs,ge),Rt[ge+lr]=!0}}return r===c?Ms(H):Os(H),H}}function zs(r,o,u){return _t(r,o,u,!0)}function Vs(r,o,u){return _t(r,o,u,!1)}var Fs=Vs,Ls=zs;Te.Fragment=c,Te.jsx=Fs,Te.jsxs=Ls}()),Te}process.env.NODE_ENV==="production"?Le.exports=Ft():Le.exports=Lt();var e=Le.exports;const fr=l.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-4 py-2",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Q=d.forwardRef(({className:s,variant:a,size:t,asChild:c=!1,icon:f,loading:m=!1,children:S,disabled:w,...j},R)=>{const b=c?Pt.Slot:"button",C=f?d.cloneElement(f,{className:n("h-4 w-4",f.props.className)}):null,N=t==="icon"||!S&&(C||m)?"icon":t,O=w||m;return e.jsxs(b,{className:n(fr({variant:a,size:N,className:s})),ref:R,disabled:O,...j,children:[m?e.jsx(x.Loader2,{className:"h-4 w-4 animate-spin"}):C,S]})});Q.displayName="Button";const Be=l.cva("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",{variants:{variant:{default:"",search:""}},defaultVariants:{variant:"default"}}),De=d.forwardRef(({className:s,type:a,variant:t,icon:c,...f},m)=>{const S=c?d.cloneElement(c,{className:n("h-4 w-4 text-muted-foreground",c.props.className)}):null,w=t==="search"&&!S?e.jsx(x.Search,{className:"h-4 w-4 text-muted-foreground"}):null,j=S||w;return j?e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:t==="search"?"search":a,className:n(Be({variant:t,className:s}),"pr-10"),ref:m,...f}),e.jsx("div",{className:"absolute right-3 top-1/2 transform -translate-y-1/2 pointer-events-none",children:j})]}):e.jsx("input",{type:t==="search"?"search":a,className:n(Be({variant:t,className:s})),ref:m,...f})});De.displayName="Input";const Bt=l.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),mr=d.forwardRef(({className:s,...a},t)=>e.jsx(dr.Root,{ref:t,className:n(Bt(),s),...a}));mr.displayName=dr.Root.displayName;const pr=d.forwardRef(({className:s,...a},t)=>e.jsx(Fe.Root,{ref:t,className:n("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground",s),...a,children:e.jsx(Fe.Indicator,{className:n("flex items-center justify-center text-current"),children:a.checked==="indeterminate"?e.jsx(x.Minus,{className:"h-4 w-4"}):e.jsx(x.Check,{className:"h-4 w-4"})})}));pr.displayName=Fe.Root.displayName;const vr=d.forwardRef(({className:s,...a},t)=>e.jsx(ke.Root,{className:n("grid gap-2",s),...a,ref:t}));vr.displayName=ke.Root.displayName;const xr=d.forwardRef(({className:s,...a},t)=>e.jsx(ke.Item,{ref:t,className:n("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),...a,children:e.jsx(ke.Indicator,{className:"flex items-center justify-center",children:e.jsx(x.Circle,{className:"h-2.5 w-2.5 fill-current text-current"})})}));xr.displayName=ke.Item.displayName;const gr=l.cva("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",{variants:{state:{default:"",required:"border-destructive focus-visible:ring-destructive",disabled:"cursor-not-allowed opacity-50"}},defaultVariants:{state:"default"}}),hr=d.forwardRef(({className:s,state:a,required:t,disabled:c,...f},m)=>{const S=c?"disabled":t?"required":"default";return e.jsx("textarea",{className:n(gr({state:S,className:s})),ref:m,required:t,disabled:c,...f})});hr.displayName="Textarea";const br=l.cva("relative flex w-full touch-none select-none items-center",{variants:{state:{default:"",disabled:"cursor-not-allowed opacity-50"}},defaultVariants:{state:"default"}}),$t=l.cva("relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",{variants:{state:{default:"",disabled:"opacity-50"}},defaultVariants:{state:"default"}}),Yt=l.cva("absolute h-full bg-primary",{variants:{state:{default:"",disabled:"opacity-50"}},defaultVariants:{state:"default"}}),Ut=l.cva("block h-5 w-5 rounded-full border-2 border-primary bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{state:{default:"",disabled:"cursor-not-allowed opacity-50"}},defaultVariants:{state:"default"}}),jr=d.forwardRef(({className:s,state:a,value:t=0,onValueChange:c,min:f=0,max:m=100,step:S=1,disabled:w,...j},R)=>{const[b,C]=d.useState(t),N=w?"disabled":"default",O=(b-f)/(m-f)*100,W=ie=>{const K=Number(ie.target.value);C(K),c==null||c(K)};return d.useEffect(()=>{C(t)},[t]),e.jsxs("div",{className:n(br({state:N,className:s})),children:[e.jsx("div",{className:n($t({state:N})),children:e.jsx("div",{className:n(Yt({state:N})),style:{width:`${O}%`}})}),e.jsx("input",{ref:R,type:"range",value:b,onChange:W,min:f,max:m,step:S,disabled:w,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer disabled:cursor-not-allowed",...j}),e.jsx("div",{className:n(Ut({state:N})),style:{left:`calc(${O}% - 10px)`,position:"absolute",top:"50%",transform:"translateY(-50%)"}})]})});jr.displayName="Slider";const Nr=l.cva("relative flex shrink-0 overflow-hidden rounded-full",{variants:{size:{sm:"h-8 w-8",md:"h-10 w-10",lg:"h-12 w-12"}},defaultVariants:{size:"md"}}),Gt=l.cva("aspect-square h-full w-full object-cover"),Ht=l.cva("flex h-full w-full items-center justify-center rounded-full bg-muted text-muted-foreground font-medium",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),qt=l.cva("absolute bottom-0 right-0 h-3 w-3 rounded-full border-2 border-background",{variants:{status:{online:"bg-green-500",offline:"bg-gray-500",away:"bg-yellow-500",busy:"bg-red-500"}}}),$e=d.forwardRef(({className:s,size:a,src:t,alt:c,fallback:f,status:m,...S},w)=>{const[j,R]=d.useState(!1),b=N=>N.split(" ").map(O=>O.charAt(0).toUpperCase()).slice(0,2).join(""),C=()=>{R(!0)};return e.jsxs("div",{ref:w,className:n(Nr({size:a,className:s})),...S,children:[t&&!j?e.jsx("img",{src:t,alt:c||"Avatar",className:n(Gt()),onError:C}):e.jsx("div",{className:n(Ht({size:a})),children:f?b(f):"?"}),m&&e.jsx("div",{className:n(qt({status:m}))})]})});$e.displayName="Avatar";const yr=l.cva("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-zinc-50 text-zinc-900 shadow hover:bg-zinc-100 dark:bg-zinc-800 dark:text-zinc-100 dark:hover:bg-zinc-700",info:"border-transparent bg-blue-50 text-blue-900 shadow hover:bg-blue-100 dark:bg-blue-900/20 dark:text-blue-100 dark:hover:bg-blue-900/30",success:"border-transparent bg-green-50 text-green-900 shadow hover:bg-green-100 dark:bg-green-900/20 dark:text-green-100 dark:hover:bg-green-900/30",warning:"border-transparent bg-amber-50 text-amber-900 shadow hover:bg-amber-100 dark:bg-amber-900/20 dark:text-amber-100 dark:hover:bg-amber-900/30",danger:"border-transparent bg-red-50 text-red-900 shadow hover:bg-red-100 dark:bg-red-900/20 dark:text-red-100 dark:hover:bg-red-900/30"}},defaultVariants:{variant:"default"}});function Wt({className:s,variant:a,...t}){return e.jsx("div",{className:n(yr({variant:a}),s),...t})}const wr=l.cva("relative h-2 w-full overflow-hidden rounded-full bg-secondary",{variants:{size:{sm:"h-1",md:"h-2",lg:"h-3"}},defaultVariants:{size:"md"}}),Jt=l.cva("h-full w-full flex-1 bg-primary transition-all duration-300 ease-in-out"),Ye=d.forwardRef(({className:s,value:a=0,max:t=100,size:c,...f},m)=>{const S=Math.min(Math.max(a/t*100,0),100);return e.jsx("div",{ref:m,className:n(wr({size:c,className:s})),...f,children:e.jsx("div",{className:n(Jt()),style:{transform:`translateX(-${100-S}%)`}})})});Ye.displayName="Progress";const Cr=l.cva("shrink-0 bg-border",{variants:{orientation:{horizontal:"h-[1px] w-full",vertical:"h-full w-[1px]"}},defaultVariants:{orientation:"horizontal"}}),Ie=d.forwardRef(({className:s,orientation:a,...t},c)=>e.jsx("div",{ref:c,className:n(Cr({orientation:a}),s),...t}));Ie.displayName="Separator";const kr=l.cva("rounded-lg border bg-card text-card-foreground shadow-md",{variants:{variant:{default:"bg-background",active:"bg-zinc-50 dark:bg-zinc-800/50"}},defaultVariants:{variant:"default"}}),Xt=l.cva("flex flex-col space-y-1.5 p-6"),Kt=l.cva("text-2xl font-semibold leading-none tracking-tight"),Zt=l.cva("text-sm text-muted-foreground"),Qt=l.cva("p-6 pt-0"),At=l.cva("flex items-center p-6 pt-0"),Ue=d.forwardRef(({className:s,variant:a,...t},c)=>e.jsx("div",{ref:c,className:n(kr({variant:a,className:s})),...t}));Ue.displayName="Card";const Ge=d.forwardRef(({className:s,...a},t)=>e.jsx("div",{ref:t,className:n(Xt(),s),...a}));Ge.displayName="CardHeader";const Sr=d.forwardRef(({className:s,...a},t)=>e.jsx("h3",{ref:t,className:n(Kt(),s),...a}));Sr.displayName="CardTitle";const Tr=d.forwardRef(({className:s,...a},t)=>e.jsx("p",{ref:t,className:n(Zt(),s),...a}));Tr.displayName="CardDescription";const He=d.forwardRef(({className:s,...a},t)=>e.jsx("div",{ref:t,className:n(Qt(),s),...a}));He.displayName="CardContent";const Rr=d.forwardRef(({className:s,...a},t)=>e.jsx("div",{ref:t,className:n(At(),s),...a}));Rr.displayName="CardFooter";const _r=l.cva("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground"),ea=l.cva("inline-flex items-center gap-1.5"),ra=l.cva("transition-colors hover:text-foreground"),ta=l.cva("font-normal text-foreground"),aa=l.cva("text-muted-foreground"),sa=l.cva("flex h-9 w-9 items-center justify-center"),qe=d.forwardRef(({className:s,...a},t)=>e.jsx("nav",{ref:t,"aria-label":"breadcrumb",...a,children:e.jsx("ol",{className:n(_r(),s),...a})}));qe.displayName="Breadcrumb";const We=d.forwardRef(({className:s,...a},t)=>e.jsx("ol",{ref:t,className:n(_r(),s),...a}));We.displayName="BreadcrumbList";const Je=d.forwardRef(({className:s,...a},t)=>e.jsx("li",{ref:t,className:n(ea(),s),...a}));Je.displayName="BreadcrumbItem";const Xe=d.forwardRef(({className:s,...a},t)=>e.jsx("a",{ref:t,className:n(ra(),s),...a}));Xe.displayName="BreadcrumbLink";const Ke=d.forwardRef(({className:s,...a},t)=>e.jsx("span",{ref:t,role:"link","aria-disabled":"true","aria-current":"page",className:n(ta(),s),...a}));Ke.displayName="BreadcrumbPage";const Ze=d.forwardRef(({className:s,children:a,...t},c)=>e.jsx("li",{ref:c,role:"presentation","aria-hidden":"true",className:n(aa(),s),...t,children:a??e.jsx(x.ChevronRight,{className:"h-4 w-4"})}));Ze.displayName="BreadcrumbSeparator";const Er=d.forwardRef(({className:s,...a},t)=>e.jsxs("span",{ref:t,role:"presentation","aria-hidden":"true",className:n(sa(),s),...a,children:[e.jsx(x.MoreHorizontal,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"More"})]}));Er.displayName="BreadcrumbEllipsis";const na=l.cva("mx-auto flex w-full justify-center"),ia=l.cva("flex flex-row items-center gap-1"),oa=l.cva("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2",ghost:"hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2",current:"border border-input bg-background text-foreground h-10 px-4 py-2 bg-primary text-primary-foreground hover:bg-primary/90"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"ghost",size:"default"}}),Qe=({className:s,...a})=>e.jsx("nav",{role:"navigation","aria-label":"pagination",className:n(na(),s),...a});Qe.displayName="Pagination";const Ae=d.forwardRef(({className:s,...a},t)=>e.jsx("ul",{ref:t,className:n(ia(),s),...a}));Ae.displayName="PaginationContent";const he=d.forwardRef(({className:s,...a},t)=>e.jsx("li",{ref:t,className:n("",s),...a}));he.displayName="PaginationItem";const Re=d.forwardRef(({className:s,isActive:a,size:t="icon",variant:c,...f},m)=>e.jsx("a",{ref:m,"aria-current":a?"page":void 0,className:n(oa({variant:a?"current":c||"ghost",size:t}),s),...f}));Re.displayName="PaginationLink";const er=d.forwardRef(({className:s,...a},t)=>e.jsxs(Re,{ref:t,"aria-label":"Go to previous page",size:"default",className:n("gap-1 pl-2.5",s),...a,children:[e.jsx(x.ChevronLeft,{className:"h-4 w-4"}),e.jsx("span",{children:"Previous"})]}));er.displayName="PaginationPrevious";const rr=d.forwardRef(({className:s,...a},t)=>e.jsxs(Re,{ref:t,"aria-label":"Go to next page",size:"default",className:n("gap-1 pr-2.5",s),...a,children:[e.jsx("span",{children:"Next"}),e.jsx(x.ChevronRight,{className:"h-4 w-4"})]}));rr.displayName="PaginationNext";const tr=d.forwardRef(({className:s,...a},t)=>e.jsxs("span",{ref:t,"aria-hidden":!0,className:n("flex h-9 w-9 items-center justify-center",s),...a,children:[e.jsx(x.MoreHorizontal,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"More pages"})]}));tr.displayName="PaginationEllipsis";const la=l.cva("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",{variants:{variant:{default:""}},defaultVariants:{variant:"default"}}),da=l.cva("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"),ca=l.cva("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50"),ua=l.cva("-mx-1 my-1 h-px bg-muted"),fa=l.cva("py-1.5 pl-8 pr-2 text-sm font-semibold"),_e=F.Root,ma=F.Group,Ee=F.Value,be=d.forwardRef(({className:s,variant:a,children:t,...c},f)=>e.jsxs(F.Trigger,{ref:f,className:n(la({variant:a,className:s})),...c,children:[t,e.jsx(F.Icon,{asChild:!0,children:e.jsx(x.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));be.displayName=F.Trigger.displayName;const Pr=d.forwardRef(({className:s,...a},t)=>e.jsx(F.ScrollUpButton,{ref:t,className:n("flex cursor-default items-center justify-center py-1",s),...a,children:e.jsx(x.ChevronUp,{className:"h-4 w-4"})}));Pr.displayName=F.ScrollUpButton.displayName;const Dr=d.forwardRef(({className:s,...a},t)=>e.jsx(F.ScrollDownButton,{ref:t,className:n("flex cursor-default items-center justify-center py-1",s),...a,children:e.jsx(x.ChevronDown,{className:"h-4 w-4"})}));Dr.displayName=F.ScrollDownButton.displayName;const je=d.forwardRef(({className:s,children:a,position:t="popper",...c},f)=>e.jsx(F.Portal,{children:e.jsxs(F.Content,{ref:f,className:n(da(),s),position:t,...c,children:[e.jsx(Pr,{}),e.jsx(F.Viewport,{className:n("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:a}),e.jsx(Dr,{})]})}));je.displayName=F.Content.displayName;const Ir=d.forwardRef(({className:s,...a},t)=>e.jsx(F.Label,{ref:t,className:n(fa(),s),...a}));Ir.displayName=F.Label.displayName;const xe=d.forwardRef(({className:s,children:a,...t},c)=>e.jsxs(F.Item,{ref:c,className:n(ca(),s),...t,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(F.ItemIndicator,{children:e.jsx(x.Check,{className:"h-4 w-4"})})}),e.jsx(F.ItemText,{children:a})]}));xe.displayName=F.Item.displayName;const Or=d.forwardRef(({className:s,...a},t)=>e.jsx(F.Separator,{ref:t,className:n(ua(),s),...a}));Or.displayName=F.Separator.displayName;const Mr=l.cva("p-3 bg-background border rounded-lg shadow-sm"),pa=l.cva("flex items-center justify-between w-full mb-4"),zr=l.cva("grid grid-cols-7 gap-1"),va=l.cva("h-8 w-8 text-center text-sm font-medium text-muted-foreground flex items-center justify-center"),xa=l.cva("h-8 w-8 text-center text-sm p-0 font-normal aria-selected:opacity-100 relative flex items-center justify-center cursor-pointer rounded-sm transition-colors",{variants:{variant:{default:"hover:bg-accent hover:text-accent-foreground",selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",today:"bg-accent text-accent-foreground",outside:"text-muted-foreground opacity-50",disabled:"text-muted-foreground opacity-50 cursor-not-allowed",range:"bg-accent text-accent-foreground",rangeStart:"bg-primary text-primary-foreground rounded-l-sm rounded-r-none",rangeEnd:"bg-primary text-primary-foreground rounded-r-sm rounded-l-none",rangeMiddle:"bg-accent text-accent-foreground rounded-none"}},defaultVariants:{variant:"default"}}),Vr=d.forwardRef(({className:s,selected:a,onSelect:t,keepRange:c=!1,disabled:f,showOutsideDays:m=!0,showDropdowns:S=!0,...w},j)=>{const[R,b]=d.useState(a instanceof Date?a:new Date),[C,N]=d.useState(null),O=B.startOfMonth(R),W=B.endOfMonth(O),ie=B.startOfWeek(O),K=B.endOfWeek(W),q="d",I=[];let X=[],$=ie,ae="";const oe=v=>a?Array.isArray(a)?a.some(k=>B.isSameDay(k,v)):B.isSameDay(a,v):!1,ce=v=>{if(!c||!Array.isArray(a)||a.length!==2)return!1;const[k,L]=a.sort((V,p)=>V.getTime()-p.getTime());return v>=k&&v<=L},Y=v=>{if(!c||!Array.isArray(a)||a.length!==2)return!1;const[k]=a.sort((L,V)=>L.getTime()-V.getTime());return B.isSameDay(v,k)},h=v=>{if(!c||!Array.isArray(a)||a.length!==2)return!1;const[,k]=a.sort((L,V)=>L.getTime()-V.getTime());return B.isSameDay(v,k)},pe=v=>{if(!(f!=null&&f(v))){if(!c){t==null||t(v);return}if(!C)N(v),t==null||t([v]);else{const k=[C,v].sort((L,V)=>L.getTime()-V.getTime());t==null||t(k),N(null)}}},ue=v=>{const k=parseInt(v);b(B.setMonth(R,k))},J=v=>{const k=parseInt(v);b(B.setYear(R,k))},A=["January","February","March","April","May","June","July","August","September","October","November","December"],se=B.getYear(new Date),le=1900,y=se+10,G=Array.from({length:y-le+1},(v,k)=>le+k).reverse(),ne=v=>{if(f!=null&&f(v))return"disabled";if(!B.isSameMonth(v,O))return"outside";if(B.isToday(v))return"today";if(c){if(Y(v))return"rangeStart";if(h(v))return"rangeEnd";if(ce(v))return"rangeMiddle"}return oe(v)?"selected":"default"};for(;$<=K;){for(let v=0;v<7;v++){ae=B.format($,q);const k=new Date($),L=ne(k),V=m||B.isSameMonth($,O);X.push(e.jsx("div",{className:n(xa({variant:L}),!V&&"invisible"),onClick:()=>V&&pe(k),children:e.jsx("span",{children:ae})},$.toString())),$=B.addDays($,1)}I.push(e.jsx("div",{className:n(zr()),children:X},$.toString())),X=[]}const ee=["Su","Mo","Tu","We","Th","Fr","Sa"];return e.jsxs("div",{ref:j,className:n(Mr(),s),...w,children:[e.jsxs("div",{className:n(pa()),children:[e.jsx(Q,{variant:"ghost",size:"icon",onClick:()=>b(B.subMonths(R,1)),children:e.jsx(x.ChevronLeft,{className:"h-4 w-4"})}),S?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(_e,{value:B.getMonth(R).toString(),onValueChange:ue,children:[e.jsx(be,{className:"w-[140px]",children:e.jsx(Ee,{})}),e.jsx(je,{children:A.map((v,k)=>e.jsx(xe,{value:k.toString(),children:v},v))})]}),e.jsxs(_e,{value:B.getYear(R).toString(),onValueChange:J,children:[e.jsx(be,{className:"w-[80px]",children:e.jsx(Ee,{})}),e.jsx(je,{children:G.map(v=>e.jsx(xe,{value:v.toString(),children:v},v))})]})]}):e.jsx("div",{className:"font-semibold",children:B.format(R,"MMMM yyyy")}),e.jsx(Q,{variant:"ghost",size:"icon",onClick:()=>b(B.addMonths(R,1)),children:e.jsx(x.ChevronRight,{className:"h-4 w-4"})})]}),e.jsx("div",{className:n(zr()),children:ee.map(v=>e.jsx("div",{className:n(va()),children:v},v))}),e.jsx("div",{className:"space-y-1",children:I})]})});Vr.displayName="Calendar";const Fr=l.cva("relative w-full"),ga=l.cva("border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition-colors",{variants:{variant:{default:"border-border hover:border-border/80 hover:bg-accent/50",active:"border-primary bg-primary/5",error:"border-destructive bg-destructive/5"}},defaultVariants:{variant:"default"}}),ha=l.cva("mt-4 space-y-2"),ba=l.cva("flex items-center gap-3 p-3 border rounded-lg bg-background"),ja=l.cva("w-10 h-10 rounded bg-muted flex items-center justify-center flex-shrink-0"),Na=l.cva("flex-1 min-w-0"),ya=l.cva("text-sm font-medium truncate"),wa=l.cva("text-xs text-muted-foreground"),Lr=d.forwardRef(({className:s,onFilesChange:a,onFileUpload:t,allowMultiple:c=!1,allowDragDrop:f=!0,allowClickToSelect:m=!0,accept:S,maxSize:w,showProgress:j=!0,showPreviews:R=!0,disabled:b,...C},N)=>{const[O,W]=d.useState([]),[ie,K]=d.useState(!1),[q,I]=d.useState(null),X=d.useRef(null),$=y=>{if(y===0)return"0 Bytes";const G=1024,ne=["Bytes","KB","MB","GB"],ee=Math.floor(Math.log(y)/Math.log(G));return parseFloat((y/Math.pow(G,ee)).toFixed(2))+" "+ne[ee]},ae=y=>w&&y.size>w?`File size exceeds ${$(w)}`:null,oe=()=>Math.random().toString(36).substring(2,15),ce=y=>{I(null);const G=[];let ne=!1;for(const v of y){const k=ae(v);if(k){I(k),ne=!0;break}G.push(v)}if(ne)return;const ee=G.map(v=>({file:v,progress:0,status:"uploading",id:oe()}));W(c?v=>[...v,...ee]:ee),a==null||a(G),t&&ee.forEach(async v=>{try{const k=setInterval(()=>{W(L=>L.map(V=>V.id===v.id?{...V,progress:Math.min(V.progress+10,90)}:V))},200);await t(v.file),clearInterval(k),W(L=>L.map(V=>V.id===v.id?{...V,progress:100,status:"success"}:V))}catch{W(k=>k.map(L=>L.id===v.id?{...L,status:"error"}:L))}})},Y=y=>{if(y.preventDefault(),K(!1),b||!f)return;const G=Array.from(y.dataTransfer.files);ce(G)},h=y=>{y.preventDefault(),!b&&f&&K(!0)},pe=y=>{y.preventDefault(),K(!1)},ue=y=>{const G=Array.from(y.target.files||[]);G.length>0&&ce(G)},J=()=>{var y;b||!m||(y=X.current)==null||y.click()},A=y=>{W(G=>G.filter(ne=>ne.id!==y))},se=y=>y.type.startsWith("image/"),le=()=>q?"error":ie?"active":"default";return e.jsxs("div",{ref:N,className:n(Fr(),s),children:[e.jsxs("div",{className:n(ga({variant:le()})),onDrop:Y,onDragOver:h,onDragLeave:pe,onClick:J,children:[e.jsx("input",{ref:X,type:"file",multiple:c,accept:S,onChange:ue,disabled:b,className:"hidden",...C}),e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(x.Upload,{className:"h-8 w-8 text-muted-foreground"}),e.jsxs("div",{className:"text-sm",children:[f&&m&&e.jsxs("span",{children:["Drag & drop files here, or"," ",e.jsx("span",{className:"font-medium text-primary",children:"click to select"})]}),f&&!m&&e.jsx("span",{children:"Drag & drop files here"}),!f&&m&&e.jsx("span",{children:e.jsx("span",{className:"font-medium text-primary",children:"Click to select files"})})]}),S&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Supported formats: ",S]}),w&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Max size: ",$(w)]})]})]}),q&&e.jsx("div",{className:"mt-2 text-sm text-destructive",children:q}),O.length>0&&e.jsx("div",{className:n(ha()),children:O.map(y=>e.jsxs("div",{className:n(ba()),children:[R&&e.jsx("div",{className:n(ja()),children:se(y.file)?e.jsx(x.Image,{className:"h-5 w-5 text-muted-foreground"}):e.jsx(x.File,{className:"h-5 w-5 text-muted-foreground"})}),e.jsxs("div",{className:n(Na()),children:[e.jsx("div",{className:n(ya()),children:y.file.name}),e.jsxs("div",{className:n(wa()),children:[$(y.file.size),y.status==="success"&&" • Uploaded",y.status==="error"&&" • Failed"]}),j&&y.status==="uploading"&&e.jsx("div",{className:"mt-1",children:e.jsx(Ye,{value:y.progress,size:"sm"})})]}),e.jsx(Q,{variant:"ghost",size:"icon",onClick:()=>A(y.id),className:"h-8 w-8",children:e.jsx(x.X,{className:"h-4 w-4"})})]},y.id))})]})});Lr.displayName="FileInput";const Ca=l.cva("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg border-muted",{variants:{size:{default:"max-w-lg",sm:"max-w-md",lg:"max-w-2xl",xl:"max-w-4xl"}},defaultVariants:{size:"default"}}),ka=l.cva("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),Sa=l.cva("flex flex-col space-y-1.5 text-center sm:text-left"),Ta=l.cva("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2"),Ra=l.cva("text-lg font-semibold leading-none tracking-tight"),_a=l.cva("text-sm text-muted-foreground"),Ea=z.Root,Pa=z.Trigger,Da=z.Portal,Ia=z.Close,Br=d.forwardRef(({className:s,...a},t)=>e.jsx(z.Overlay,{ref:t,className:n(ka(),s),...a}));Br.displayName=z.Overlay.displayName;const $r=d.forwardRef(({className:s,size:a,children:t,...c},f)=>e.jsxs(Da,{children:[e.jsx(Br,{}),e.jsxs(z.Content,{ref:f,className:n(Ca({size:a,className:s})),...c,children:[t,e.jsxs(z.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(x.X,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));$r.displayName=z.Content.displayName;const Yr=d.forwardRef(({className:s,...a},t)=>e.jsx("div",{ref:t,className:n(Sa(),s),...a}));Yr.displayName="ModalHeader";const Ur=d.forwardRef(({className:s,...a},t)=>e.jsx("div",{ref:t,className:n(Ta(),s),...a}));Ur.displayName="ModalFooter";const Gr=d.forwardRef(({className:s,...a},t)=>e.jsx(z.Title,{ref:t,className:n(Ra(),s),...a}));Gr.displayName=z.Title.displayName;const Hr=d.forwardRef(({className:s,...a},t)=>e.jsx(z.Description,{ref:t,className:n(_a(),s),...a}));Hr.displayName=z.Description.displayName;const Oa=l.cva("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom"}},defaultVariants:{side:"right"}}),Ma=l.cva("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),za=l.cva("flex flex-col space-y-2 text-center sm:text-left"),Va=l.cva("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2"),Fa=l.cva("text-lg font-semibold text-foreground"),La=l.cva("text-sm text-muted-foreground"),Ba=z.Root,$a=z.Trigger,Ya=z.Close,Ua=z.Portal,qr=d.forwardRef(({className:s,...a},t)=>e.jsx(z.Overlay,{className:n(Ma(),s),...a,ref:t}));qr.displayName=z.Overlay.displayName;const Wr=d.forwardRef(({side:s="right",className:a,children:t,...c},f)=>e.jsxs(Ua,{children:[e.jsx(qr,{}),e.jsxs(z.Content,{ref:f,className:n(Oa({side:s}),a),...c,children:[t,e.jsxs(z.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[e.jsx(x.X,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Wr.displayName=z.Content.displayName;const Jr=d.forwardRef(({className:s,...a},t)=>e.jsx("div",{ref:t,className:n(za(),s),...a}));Jr.displayName="SheetHeader";const Xr=d.forwardRef(({className:s,...a},t)=>e.jsx("div",{ref:t,className:n(Va(),s),...a}));Xr.displayName="SheetFooter";const Kr=d.forwardRef(({className:s,...a},t)=>e.jsx(z.Title,{ref:t,className:n(Fa(),s),...a}));Kr.displayName=z.Title.displayName;const Zr=d.forwardRef(({className:s,...a},t)=>e.jsx(z.Description,{ref:t,className:n(La(),s),...a}));Zr.displayName=z.Description.displayName;const Ga=l.cva("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{info:"border bg-blue-50 text-blue-900 dark:bg-blue-900/20 dark:text-blue-100",success:"border bg-green-50 text-green-900 dark:bg-green-900/20 dark:text-green-100",error:"border bg-red-50 text-red-900 dark:bg-red-900/20 dark:text-red-100"}},defaultVariants:{variant:"info"}}),Ha=l.cva("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]"),qa=l.cva("text-sm font-semibold"),Wa=l.cva("text-sm opacity-90"),Ja=l.cva("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-xs font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.info]:border-blue-200 group-[.info]:hover:border-blue-300 group-[.success]:border-green-200 group-[.success]:hover:border-green-300 group-[.error]:border-red-200 group-[.error]:hover:border-red-300"),Xa=l.cva("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100"),Ka=te.Provider,Qr=d.forwardRef(({className:s,...a},t)=>e.jsx(te.Viewport,{ref:t,className:n(Ha(),s),...a}));Qr.displayName=te.Viewport.displayName;const Ar=d.forwardRef(({className:s,variant:a,...t},c)=>{const f=a==="success"?x.CheckCircle:a==="error"?x.AlertCircle:x.Info;return e.jsx(te.Root,{ref:c,className:n(Ga({variant:a}),s),duration:5e3,...t,children:e.jsxs("div",{className:"flex items-start space-x-3",children:[e.jsx(f,{className:"h-5 w-5 mt-0.5 flex-shrink-0"}),e.jsx("div",{className:"flex-1",children:t.children})]})})});Ar.displayName=te.Root.displayName;const et=d.forwardRef(({className:s,...a},t)=>e.jsx(te.Action,{ref:t,className:n(Ja(),s),...a}));et.displayName=te.Action.displayName;const rt=d.forwardRef(({className:s,...a},t)=>e.jsx(te.Close,{ref:t,className:n(Xa(),s),"toast-close":"",...a,children:e.jsx(x.X,{className:"h-4 w-4"})}));rt.displayName=te.Close.displayName;const tt=d.forwardRef(({className:s,...a},t)=>e.jsx(te.Title,{ref:t,className:n(qa(),s),...a}));tt.displayName=te.Title.displayName;const at=d.forwardRef(({className:s,...a},t)=>e.jsx(te.Description,{ref:t,className:n(Wa(),s),...a}));at.displayName=te.Description.displayName;const st=l.cva("w-full border-collapse rounded-md border border-border",{variants:{variant:{default:"bg-background"}},defaultVariants:{variant:"default"}}),Za=l.cva("bg-zinc-100 dark:bg-zinc-800 border-b border-border"),Qa=l.cva("px-4 py-3 text-left text-sm font-medium text-foreground"),Aa=l.cva("border-b border-border transition-colors hover:bg-muted/50",{variants:{variant:{default:"",selected:"bg-muted"}},defaultVariants:{variant:"default"}}),nt=l.cva("px-4 py-3 text-sm text-foreground"),ar=d.forwardRef(({className:s,variant:a,data:t,columns:c,totalCount:f,loading:m=!1,keepSearch:S=!0,keepFilters:w=!0,keepPagination:j=!0,keepSort:R=!0,pageSize:b=10,actionButtons:C=[],onRowClick:N,selectedRows:O=[],onSelectionChange:W,filterOptions:ie={},initialState:K={},onStateChange:q,onSearchChange:I,onFilterChange:X,onSortChange:$,onPageChange:ae,onPageSizeChange:oe,...ce},Y)=>{const[h,pe]=d.useState({search:"",filters:{},sortColumn:null,sortDirection:"asc",currentPage:1,pageSize:b,...K}),ue=d.useRef(),J=d.useCallback(p=>{pe(p),q==null||q(p)},[q]),A=d.useCallback(p=>{const P={...h,search:p,currentPage:1};ue.current&&clearTimeout(ue.current),ue.current=setTimeout(()=>{J(P),I==null||I(p,P)},300),pe(P)},[h,J,I]),se=d.useCallback((p,P)=>{const E={...h.filters};P==="__all__"||P===""?delete E[p]:E[p]=P;const fe={...h,filters:E,currentPage:1};J(fe),X==null||X(E,fe)},[h,J,X]),le=d.useCallback(p=>{if(!R)return;const P=h.sortColumn===p&&h.sortDirection==="asc"?"desc":"asc",E={...h,sortColumn:p,sortDirection:P};J(E),$==null||$(p,P,E)},[h,R,J,$]),y=d.useCallback(p=>{const P={...h,currentPage:p};J(P),ae==null||ae(p,P)},[h,J,ae]),G=d.useCallback(p=>{const P={...h,pageSize:p,currentPage:1};J(P),oe==null||oe(p,P)},[h,J,oe]),ne=p=>h.sortColumn!==p?null:h.sortDirection==="asc"?e.jsx(x.ChevronUp,{className:"h-4 w-4"}):e.jsx(x.ChevronDown,{className:"h-4 w-4"}),ee=c.filter(p=>p.filterable),v=f??t.length,k=Math.ceil(v/h.pageSize),L=(h.currentPage-1)*h.pageSize+1,V=Math.min(h.currentPage*h.pageSize