1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,54943,e=>{"use strict";let t=(0,e.i(75254).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["default",()=>t])},15288,64659,e=>{"use strict";var t=e.i(43476),r=e.i(75157);function a({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,r.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...a})}function s({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,r.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...a})}function n({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,r.cn)("leading-none font-semibold",e),...a})}function l({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,r.cn)("text-muted-foreground text-sm",e),...a})}function o({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,r.cn)("px-6",e),...a})}e.s(["Card",()=>a,"CardContent",()=>o,"CardDescription",()=>l,"CardHeader",()=>s,"CardTitle",()=>n],15288);var i=e.i(31171);e.s(["ChevronDown",()=>i.default],64659)},77572,55436,e=>{"use strict";var t=e.i(43476),r=e.i(25913),a=e.i(71645),s=e.i(81140),n=e.i(30030),l=e.i(75830),o=e.i(20783),i=e.i(10772);e.i(74080);var d=e.i(91918),c=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{let s=(0,d.createSlot)(`Primitive.${r}`),n=a.forwardRef((e,a)=>{let{asChild:n,...l}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(n?s:r,{...l,ref:a})});return n.displayName=`Primitive.${r}`,{...e,[r]:n}},{}),u=e.i(30207),m=e.i(69340),p=e.i(86318),f="rovingFocusGroup.onEntryFocus",h={bubbles:!1,cancelable:!0},x="RovingFocusGroup",[g,v,b]=(0,l.createCollection)(x),[j,y]=(0,n.createContextScope)(x,[b]),[w,N]=j(x),C=a.forwardRef((e,r)=>(0,t.jsx)(g.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,t.jsx)(g.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,t.jsx)(_,{...e,ref:r})})}));C.displayName=x;var _=a.forwardRef((e,r)=>{let{__scopeRovingFocusGroup:n,orientation:l,loop:i=!1,dir:d,currentTabStopId:g,defaultCurrentTabStopId:b,onCurrentTabStopIdChange:j,onEntryFocus:y,preventScrollOnEntryFocus:N=!1,...C}=e,_=a.useRef(null),S=(0,o.useComposedRefs)(r,_),R=(0,p.useDirection)(d),[k,T]=(0,m.useControllableState)({prop:g,defaultProp:b??null,onChange:j,caller:x}),[A,P]=a.useState(!1),E=(0,u.useCallbackRef)(y),D=v(n),I=a.useRef(!1),[F,O]=a.useState(0);return a.useEffect(()=>{let e=_.current;if(e)return e.addEventListener(f,E),()=>e.removeEventListener(f,E)},[E]),(0,t.jsx)(w,{scope:n,orientation:l,dir:R,loop:i,currentTabStopId:k,onItemFocus:a.useCallback(e=>T(e),[T]),onItemShiftTab:a.useCallback(()=>P(!0),[]),onFocusableItemAdd:a.useCallback(()=>O(e=>e+1),[]),onFocusableItemRemove:a.useCallback(()=>O(e=>e-1),[]),children:(0,t.jsx)(c.div,{tabIndex:A||0===F?-1:0,"data-orientation":l,...C,ref:S,style:{outline:"none",...e.style},onMouseDown:(0,s.composeEventHandlers)(e.onMouseDown,()=>{I.current=!0}),onFocus:(0,s.composeEventHandlers)(e.onFocus,e=>{let t=!I.current;if(e.target===e.currentTarget&&t&&!A){let t=new CustomEvent(f,h);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=D().filter(e=>e.focusable);M([e.find(e=>e.active),e.find(e=>e.id===k),...e].filter(Boolean).map(e=>e.ref.current),N)}}I.current=!1}),onBlur:(0,s.composeEventHandlers)(e.onBlur,()=>P(!1))})})}),S="RovingFocusGroupItem",R=a.forwardRef((e,r)=>{let{__scopeRovingFocusGroup:n,focusable:l=!0,active:o=!1,tabStopId:d,children:u,...m}=e,p=(0,i.useId)(),f=d||p,h=N(S,n),x=h.currentTabStopId===f,b=v(n),{onFocusableItemAdd:j,onFocusableItemRemove:y,currentTabStopId:w}=h;return a.useEffect(()=>{if(l)return j(),()=>y()},[l,j,y]),(0,t.jsx)(g.ItemSlot,{scope:n,id:f,focusable:l,active:o,children:(0,t.jsx)(c.span,{tabIndex:x?0:-1,"data-orientation":h.orientation,...m,ref:r,onMouseDown:(0,s.composeEventHandlers)(e.onMouseDown,e=>{l?h.onItemFocus(f):e.preventDefault()}),onFocus:(0,s.composeEventHandlers)(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:(0,s.composeEventHandlers)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void h.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,r){var a;let s=(a=e.key,"rtl"!==r?a:"ArrowLeft"===a?"ArrowRight":"ArrowRight"===a?"ArrowLeft":a);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(s))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(s)))return k[s]}(e,h.orientation,h.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let s=b().filter(e=>
1e.focusable).map(e=>e.ref.current);if("last"===t)s.reverse();else if("prev"===t||"next"===t){var r,a;"prev"===t&&s.reverse();let n=s.indexOf(e.currentTarget);s=h.loop?(r=s,a=n+1,r.map((e,t)=>r[(a+t)%r.length])):s.slice(n+1)}setTimeout(()=>M(s))}}),children:"function"==typeof u?u({isCurrentTabStop:x,hasTabStop:null!=w}):u})})});R.displayName=S;var k={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function M(e,t=!1){let r=document.activeElement;for(let a of e)if(a===r||(a.focus({preventScroll:t}),document.activeElement!==r))return}var T=e.i(96626),A=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{let s=(0,d.createSlot)(`Primitive.${r}`),n=a.forwardRef((e,a)=>{let{asChild:n,...l}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(n?s:r,{...l,ref:a})});return n.displayName=`Primitive.${r}`,{...e,[r]:n}},{}),P="Tabs",[E,D]=(0,n.createContextScope)(P,[y]),I=y(),[F,O]=E(P),B=a.forwardRef((e,r)=>{let{__scopeTabs:a,value:s,onValueChange:n,defaultValue:l,orientation:o="horizontal",dir:d,activationMode:c="automatic",...u}=e,f=(0,p.useDirection)(d),[h,x]=(0,m.useControllableState)({prop:s,onChange:n,defaultProp:l??"",caller:P});return(0,t.jsx)(F,{scope:a,baseId:(0,i.useId)(),value:h,onValueChange:x,orientation:o,dir:f,activationMode:c,children:(0,t.jsx)(A.div,{dir:f,"data-orientation":o,...u,ref:r})})});B.displayName=P;var G="TabsList",L=a.forwardRef((e,r)=>{let{__scopeTabs:a,loop:s=!0,...n}=e,l=O(G,a),o=I(a);return(0,t.jsx)(C,{asChild:!0,...o,orientation:l.orientation,dir:l.dir,loop:s,children:(0,t.jsx)(A.div,{role:"tablist","aria-orientation":l.orientation,...n,ref:r})})});L.displayName=G;var $="TabsTrigger",z=a.forwardRef((e,r)=>{let{__scopeTabs:a,value:n,disabled:l=!1,...o}=e,i=O($,a),d=I(a),c=H(i.baseId,n),u=V(i.baseId,n),m=n===i.value;return(0,t.jsx)(R,{asChild:!0,...d,focusable:!l,active:m,children:(0,t.jsx)(A.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":u,"data-state":m?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:c,...o,ref:r,onMouseDown:(0,s.composeEventHandlers)(e.onMouseDown,e=>{l||0!==e.button||!1!==e.ctrlKey?e.preventDefault():i.onValueChange(n)}),onKeyDown:(0,s.composeEventHandlers)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&i.onValueChange(n)}),onFocus:(0,s.composeEventHandlers)(e.onFocus,()=>{let e="manual"!==i.activationMode;m||l||!e||i.onValueChange(n)})})})});z.displayName=$;var q="TabsContent",U=a.forwardRef((e,r)=>{let{__scopeTabs:s,value:n,forceMount:l,children:o,...i}=e,d=O(q,s),c=H(d.baseId,n),u=V(d.baseId,n),m=n===d.value,p=a.useRef(m);return a.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,t.jsx)(T.Presence,{present:l||m,children:({present:a})=>(0,t.jsx)(A.div,{"data-state":m?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":c,hidden:!a,id:u,tabIndex:0,...i,ref:r,style:{...e.style,animationDuration:p.current?"0s":void 0},children:a&&o})})});function H(e,t){return`${e}-trigger-${t}`}function V(e,t){return`${e}-content-${t}`}U.displayName=q,e.s(["Content",()=>U,"List",()=>L,"Root",()=>B,"Tabs",()=>B,"TabsContent",()=>U,"TabsList",()=>L,"TabsTrigger",()=>z,"Trigger",()=>z,"createTabsScope",()=>D],26209);var K=e.i(26209),K=K,Q=e.i(75157);function W({className:e,orientation:r="horizontal",...a}){return(0,t.jsx)(K.Root,{"data-slot":"tabs","data-orientation":r,orientation:r,className:(0,Q.cn)("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...a})}let X=(0,r.cva)("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Y({className:e,variant:r="default",...a}){return(0,t.jsx)(K.List,{"data-slot":"tabs-list","data-variant":r,className:(0,Q.cn)(X({variant:r}),e),...a})}function J({className:e,...r}){return(0,t.jsx)(K.Trigger,{"data-slot":"tabs-trigger",className:(0,Q.cn)("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground
1/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...r})}function Z({className:e,...r}){return(0,t.jsx)(K.Content,{"data-slot":"tabs-content",className:(0,Q.cn)("flex-1 outline-none",e),...r})}e.s(["Tabs",()=>W,"TabsContent",()=>Z,"TabsList",()=>Y,"TabsTrigger",()=>J],77572);var ee=e.i(54943);e.s(["Search",()=>ee.default],55436)},31278,17056,37822,43531,84774,20480,e=>{"use strict";let t=(0,e.i(75254).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",()=>t],31278);var r=e.i(43476),a=/[\\\/_+.#"@\[\(\{&]/,s=/[\\\/_+.#"@\[\(\{&]/g,n=/[\s-]/,l=/[\s-]/g;function o(e){return e.toLowerCase().replace(l," ")}var i=e.i(71645),d=e.i(81140),c=e.i(20783),u=e.i(30030),m=e.i(10772),p=e.i(69340),f=e.i(26330),h=e.i(65491),x=e.i(74606),g=e.i(96626);e.i(74080);var v=e.i(91918),b=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let a=(0,v.createSlot)(`Primitive.${t}`),s=i.forwardRef((e,s)=>{let{asChild:n,...l}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,r.jsx)(n?a:t,{...l,ref:s})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{}),j=e.i(3536),y=e.i(85369),w=e.i(86312),N="Dialog",[C,_]=(0,u.createContextScope)(N),[S,R]=C(N),k=e=>{let{__scopeDialog:t,children:a,open:s,defaultOpen:n,onOpenChange:l,modal:o=!0}=e,d=i.useRef(null),c=i.useRef(null),[u,f]=(0,p.useControllableState)({prop:s,defaultProp:n??!1,onChange:l,caller:N});return(0,r.jsx)(S,{scope:t,triggerRef:d,contentRef:c,contentId:(0,m.useId)(),titleId:(0,m.useId)(),descriptionId:(0,m.useId)(),open:u,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(e=>!e),[f]),modal:o,children:a})};k.displayName=N;var M="DialogTrigger",T=i.forwardRef((e,t)=>{let{__scopeDialog:a,...s}=e,n=R(M,a),l=(0,c.useComposedRefs)(t,n.triggerRef);return(0,r.jsx)(b.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":X(n.open),...s,ref:l,onClick:(0,d.composeEventHandlers)(e.onClick,n.onOpenToggle)})});T.displayName=M;var A="DialogPortal",[P,E]=C(A,{forceMount:void 0}),D=e=>{let{__scopeDialog:t,forceMount:a,children:s,container:n}=e,l=R(A,t);return(0,r.jsx)(P,{scope:t,forceMount:a,children:i.Children.map(s,e=>(0,r.jsx)(g.Presence,{present:a||l.open,children:(0,r.jsx)(x.Portal,{asChild:!0,container:n,children:e})}))})};D.displayName=A;var I="DialogOverlay",F=i.forwardRef((e,t)=>{let a=E(I,e.__scopeDialog),{forceMount:s=a.forceMount,...n}=e,l=R(I,e.__scopeDialog);return l.modal?(0,r.jsx)(g.Presence,{present:s||l.open,children:(0,r.jsx)(B,{...n,ref:t})}):null});F.displayName=I;var O=(0,v.createSlot)("DialogOverlay.RemoveScroll"),B=i.forwardRef((e,t)=>
1{let{__scopeDialog:a,...s}=e,n=R(I,a);return(0,r.jsx)(y.RemoveScroll,{as:O,allowPinchZoom:!0,shards:[n.contentRef],children:(0,r.jsx)(b.div,{"data-state":X(n.open),...s,ref:t,style:{pointerEvents:"auto",...s.style}})})}),G="DialogContent",L=i.forwardRef((e,t)=>{let a=E(G,e.__scopeDialog),{forceMount:s=a.forceMount,...n}=e,l=R(G,e.__scopeDialog);return(0,r.jsx)(g.Presence,{present:s||l.open,children:l.modal?(0,r.jsx)($,{...n,ref:t}):(0,r.jsx)(z,{...n,ref:t})})});L.displayName=G;var $=i.forwardRef((e,t)=>{let a=R(G,e.__scopeDialog),s=i.useRef(null),n=(0,c.useComposedRefs)(t,a.contentRef,s);return i.useEffect(()=>{let e=s.current;if(e)return(0,w.hideOthers)(e)},[]),(0,r.jsx)(q,{...e,ref:n,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,d.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:(0,d.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:(0,d.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault())})}),z=i.forwardRef((e,t)=>{let a=R(G,e.__scopeDialog),s=i.useRef(!1),n=i.useRef(!1);return(0,r.jsx)(q,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(s.current||a.triggerRef.current?.focus(),t.preventDefault()),s.current=!1,n.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(s.current=!0,"pointerdown"===t.detail.originalEvent.type&&(n.current=!0));let r=t.target;a.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&n.current&&t.preventDefault()}})}),q=i.forwardRef((e,t)=>{let{__scopeDialog:a,trapFocus:s,onOpenAutoFocus:n,onCloseAutoFocus:l,...o}=e,d=R(G,a),u=i.useRef(null),m=(0,c.useComposedRefs)(t,u);return(0,j.useFocusGuards)(),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.FocusScope,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:n,onUnmountAutoFocus:l,children:(0,r.jsx)(f.DismissableLayer,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":X(d.open),...o,ref:m,onDismiss:()=>d.onOpenChange(!1)})}),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ee,{titleId:d.titleId}),(0,r.jsx)(et,{contentRef:u,descriptionId:d.descriptionId})]})]})}),U="DialogTitle",H=i.forwardRef((e,t)=>{let{__scopeDialog:a,...s}=e,n=R(U,a);return(0,r.jsx)(b.h2,{id:n.titleId,...s,ref:t})});H.displayName=U;var V="DialogDescription",K=i.forwardRef((e,t)=>{let{__scopeDialog:a,...s}=e,n=R(V,a);return(0,r.jsx)(b.p,{id:n.descriptionId,...s,ref:t})});K.displayName=V;var Q="DialogClose",W=i.forwardRef((e,t)=>{let{__scopeDialog:a,...s}=e,n=R(Q,a);return(0,r.jsx)(b.button,{type:"button",...s,ref:t,onClick:(0,d.composeEventHandlers)(e.onClick,()=>n.onOpenChange(!1))})});function X(e){return e?"open":"closed"}W.displayName=Q;var Y="DialogTitleWarning",[J,Z]=(0,u.createContext)(Y,{contentName:G,titleName:U,docsSlug:"dialog"}),ee=({titleId:e})=>{let t=Z(Y),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 2 3If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 4 5For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return i.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},et=({contentRef:e,descriptionId:t})=>{let r=Z("DialogDescriptionWarning"),a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r.contentName}}.`;return i.useEffect(()=>{let r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null};e.s(["Close",()=>W,"Content",()=>L,"Description",()=>K,"Dialog",()=>k,"DialogClose",()=>W,"DialogContent",()=>L,"DialogDescription",()=>K,"DialogOverlay",()=>F,"DialogPortal",()=>D,"DialogTitle",()=>H,"DialogTrigger",()=>T,"Overlay",()=>F,"Portal",()=>D,"Root",()=>k,"Title",()=>H,"Trigger",()=>T,"WarningProvider",()=>J,"createDialogScope",()=>_],26999);var er=Symbol.for("react.lazy"),ea=i[" use ".trim().toString()];function es(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===er&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var en=Symbol("radix.slottable");function el(e){return i.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===en}var eo=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>
5{var a,s;let n,l,o,d=(s=a=`Primitive.${t}`,(n=i.forwardRef((e,t)=>{let{children:r,...a}=e;if(es(r)&&"function"==typeof ea&&(r=ea(r._payload)),i.isValidElement(r)){var s;let e,n,l=(s=r,(n=(e=Object.getOwnPropertyDescriptor(s.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.ref:(n=(e=Object.getOwnPropertyDescriptor(s,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.props.ref:s.props.ref||s.ref),o=function(e,t){let r={...t};for(let a in t){let s=e[a],n=t[a];/^on[A-Z]/.test(a)?s&&n?r[a]=(...e)=>{let t=n(...e);return s(...e),t}:s&&(r[a]=s):"style"===a?r[a]={...s,...n}:"className"===a&&(r[a]=[s,n].filter(Boolean).join(" "))}return{...e,...r}}(a,r.props);return r.type!==i.Fragment&&(o.ref=t?(0,c.composeRefs)(t,l):l),i.cloneElement(r,o)}return i.Children.count(r)>1?i.Children.only(null):null})).displayName=`${s}.SlotClone`,l=n,(o=i.forwardRef((e,t)=>{let{children:a,...s}=e;es(a)&&"function"==typeof ea&&(a=ea(a._payload));let n=i.Children.toArray(a),o=n.find(el);if(o){let e=o.props.children,a=n.map(t=>t!==o?t:i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null);return(0,r.jsx)(l,{...s,ref:t,children:i.isValidElement(e)?i.cloneElement(e,void 0,a):null})}return(0,r.jsx)(l,{...s,ref:t,children:a})})).displayName=`${a}.Slot`,o),u=i.forwardRef((e,a)=>{let{asChild:s,...n}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,r.jsx)(s?d:t,{...n,ref:a})});return u.displayName=`Primitive.${t}`,{...e,[t]:u}},{}),ei='[cmdk-group=""]',ed='[cmdk-group-items=""]',ec='[cmdk-item=""]',eu=`${ec}:not([aria-disabled="true"])`,em="cmdk-item-select",ep="data-value",ef=(e,t,r)=>{var i;return i=e,function e(t,r,o,i,d,c,u){if(c===r.length)return d===t.length?1:.99;var m=`${d},${c}`;if(void 0!==u[m])return u[m];for(var p,f,h,x,g=i.charAt(c),v=o.indexOf(g,d),b=0;v>=0;)(p=e(t,r,o,i,v+1,c+1,u))>b&&(v===d?p*=1:a.test(t.charAt(v-1))?(p*=.8,(h=t.slice(d,v-1).match(s))&&d>0&&(p*=Math.pow(.999,h.length))):n.test(t.charAt(v-1))?(p*=.9,(x=t.slice(d,v-1).match(l))&&d>0&&(p*=Math.pow(.999,x.length))):(p*=.17,d>0&&(p*=Math.pow(.999,v-d))),t.charAt(v)!==r.charAt(c)&&(p*=.9999)),(p<.1&&o.charAt(v-1)===i.charAt(c+1)||i.charAt(c+1)===i.charAt(c)&&o.charAt(v-1)!==i.charAt(c))&&.1*(f=e(t,r,o,i,v+1,c+2,u))>p&&(p=.1*f),p>b&&(b=p),v=o.indexOf(g,v+1);return u[m]=b,b}(i=r&&r.length>0?`${i+" "+r.join(" ")}`:i,t,o(i),o(t),0,0,{})},eh=i.createContext(void 0),ex=i.createContext(void 0),eg=i.createContext(void 0),ev=i.forwardRef((e,t)=>{let r=ek(()=>{var t,r;return{search:"",value:null!=(r=null!=(t=e.value)?t:e.defaultValue)?r:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=ek(()=>new Set),s=ek(()=>new Map),n=ek(()=>new Map),l=ek(()=>new Set),o=eS(e),{label:d,children:c,value:u,onValueChange:p,filter:f,shouldFilter:h,loop:x,disablePointerSelection:g=!1,vimBindings:v=!0,...b}=e,j=(0,m.useId)(),y=(0,m.useId)(),w=(0,m.useId)(),N=i.useRef(null),C=eA();eR(()=>{if(void 0!==u){let e=u.trim();r.current.value=e,_.emit()}},[u]),eR(()=>{C(6,A)},[]);let _=i.useMemo(()=>({subscribe:e=>(l.current.add(e),()=>l.current.delete(e)),snapshot:()=>r.current,setState:(e,t,a)=>{var s,n,l,i;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)T(),k(),C(1,M);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(w);e?e.focus():null==(s=document.getElementById(j))||s.focus()}if(C(7,()=>{var e;r.current.selectedItemId=null==(e=P())?void 0:e.id,_.emit()}),a||C(5,A),(null==(n=o.current)?void 0:n.value)!==void 0){null==(i=(l=o.current).onValueChange)||i.call(l,null!=t?t:"");return}}_.emit()}},emit:()=>{l.current.forEach(e=>e())}}),[]),S=i.useMemo(()=>({value:(e,t,a)=>{var s;t!==(null==(s=n.current.get(e))?void 0:s.value)&&(n.current.set(e,{value:t,keywords:a}),r.current.filtered.items.set(e,R(t,a)),C(2,()=>{k(),_.emit()}))},item:(e,t)=>(a.current.add(e),t&&(s.current.has(t)?s.current.get(t).add(e):s.current.set(t,new Set([e]))),C(3,()=>{T(),k(),r.current.value||M(),_.emit()}),()=>{n.current.delete(e),a.current.delete(e),r.current.filtered.items.delete(e);let t=P();C(4,()=>{T(),(null==t?void 0:t.getAttribute("id"))===e&&M(),_.emit()})}),group:e=>(s.current.has(e)||s.current.set(e,new Set),()=>{n.current.delete(e),s.current.delete(e)}),filter:()=>o.current.shouldFilter,label:d||e["aria-label"],getDisablePointerSelection:()=>o.current.disablePointerSelection,listId:j,inputId:w,labelId:y,listInnerRef:N}),[]);function R(e,t){var a,s;let n=null!=(s=null==(a=o.current)?void 0:a.filter)?s:ef;return e?n(e,r.current.search,t):0}function k(){if(!r.current.search||!1===o.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach(r=>{let a=s.current.get(r),n=0;a.forEach(t=>{n=Math.max(e.get(t),n)}),t.push([r,n])});let a=N.current;E().sort((t,r)=>{var a,s;let n=t.getAttribute("id"),l=r.getAttribute("id");return(null!=(a=e.get(l))?a:0)-(null!=(s=e.get(n))?s:0)}
5).forEach(e=>{let t=e.closest(ed);t?t.appendChild(e.parentElement===t?e:e.closest(`${ed} > *`)):a.appendChild(e.parentElement===a?e:e.closest(`${ed} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let r=null==(t=N.current)?void 0:t.querySelector(`${ei}[${ep}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function M(){let e=E().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(ep);_.setState("value",t||void 0)}function T(){var e,t,l,i;if(!r.current.search||!1===o.current.shouldFilter){r.current.filtered.count=a.current.size;return}r.current.filtered.groups=new Set;let d=0;for(let s of a.current){let a=R(null!=(t=null==(e=n.current.get(s))?void 0:e.value)?t:"",null!=(i=null==(l=n.current.get(s))?void 0:l.keywords)?i:[]);r.current.filtered.items.set(s,a),a>0&&d++}for(let[e,t]of s.current)for(let a of t)if(r.current.filtered.items.get(a)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=d}function A(){var e,t,r;let a=P();a&&((null==(e=a.parentElement)?void 0:e.firstChild)===a&&(null==(r=null==(t=a.closest(ei))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function P(){var e;return null==(e=N.current)?void 0:e.querySelector(`${ec}[aria-selected="true"]`)}function E(){var e;return Array.from((null==(e=N.current)?void 0:e.querySelectorAll(eu))||[])}function D(e){let t=E()[e];t&&_.setState("value",t.getAttribute(ep))}function I(e){var t;let r=P(),a=E(),s=a.findIndex(e=>e===r),n=a[s+e];null!=(t=o.current)&&t.loop&&(n=s+e<0?a[a.length-1]:s+e===a.length?a[0]:a[s+e]),n&&_.setState("value",n.getAttribute(ep))}function F(e){let t=P(),r=null==t?void 0:t.closest(ei),a;for(;r&&!a;)a=null==(r=e>0?function(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}(r,ei):function(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}(r,ei))?void 0:r.querySelector(eu);a?_.setState("value",a.getAttribute(ep)):I(e)}let O=()=>D(E().length-1),B=e=>{e.preventDefault(),e.metaKey?O():e.altKey?F(1):I(1)},G=e=>{e.preventDefault(),e.metaKey?D(0):e.altKey?F(-1):I(-1)};return i.createElement(eo.div,{ref:t,tabIndex:-1,...b,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=b.onKeyDown)||t.call(b,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!(e.defaultPrevented||r))switch(e.key){case"n":case"j":v&&e.ctrlKey&&B(e);break;case"ArrowDown":B(e);break;case"p":case"k":v&&e.ctrlKey&&G(e);break;case"ArrowUp":G(e);break;case"Home":e.preventDefault(),D(0);break;case"End":e.preventDefault(),O();break;case"Enter":{e.preventDefault();let t=P();if(t){let e=new Event(em);t.dispatchEvent(e)}}}}},i.createElement("label",{"cmdk-label":"",htmlFor:S.inputId,id:S.labelId,style:eE},d),eP(e,e=>i.createElement(ex.Provider,{value:_},i.createElement(eh.Provider,{value:S},e))))}),eb=i.forwardRef((e,t)=>{var r,a;let s=(0,m.useId)(),n=i.useRef(null),l=i.useContext(eg),o=i.useContext(eh),d=eS(e),u=null!=(a=null==(r=d.current)?void 0:r.forceMount)?a:null==l?void 0:l.forceMount;eR(()=>{if(!u)return o.item(s,null==l?void 0:l.id)},[u]);let p=eT(s,n,[e.value,e.children,n],e.keywords),f=i.useContext(ex),h=eM(e=>e.value&&e.value===p.current),x=eM(e=>!!u||!1===o.filter()||!e.search||e.filtered.items.get(s)>0);function g(){var e,t;v(),null==(t=(e=d.current).onSelect)||t.call(e,p.current)}function v(){f.setState("value",p.current,!0)}if(i.useEffect(()=>{let t=n.current;if(!(!t||e.disabled))return t.addEventListener(em,g),()=>t.removeEventListener(em,g)},[x,e.onSelect,e.disabled]),!x)return null;let{disabled:b,value:j,onSelect:y,forceMount:w,keywords:N,...C}=e;return i.createElement(eo.div,{ref:(0,c.composeRefs)(n,t),...C,id:s,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!h,"data-disabled":!!b,"data-selected":!!h,onPointerMove:b||o.getDisablePointerSelection()?void 0:v,onClick:b?void 0:g},e.children)}),ej=i.forwardRef((e,t)=>{let{heading:r,children:a,forceMount:s,...n}=e,l=(0,m.useId)(),o=i.useRef(null),d=i.useRef(null),u=(0,m.useId)(),p=i.useContext(eh),f=eM(e=>!!s||!1===p.filter()||!e.search||e.filtered.groups.has(l));eR(()=>p.group(l),[]),eT(l,o,[e.value,e.heading,d]);let h=i.useMemo(()=>({id:l,forceMount:s}),[s]);return i.createElement(eo.div,{ref:(0,c.composeRefs)(o,t),...n,"cmdk-group":"",role:"presentation",hidden:!f||void 0},r&&i.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),eP(e,e=>i.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},i.createElement(eg.Provider,{value:h},e))))}),ey=i.forwardRef((e,t)=>
5{let{alwaysRender:r,...a}=e,s=i.useRef(null),n=eM(e=>!e.search);return r||n?i.createElement(eo.div,{ref:(0,c.composeRefs)(s,t),...a,"cmdk-separator":"",role:"separator"}):null}),ew=i.forwardRef((e,t)=>{let{onValueChange:r,...a}=e,s=null!=e.value,n=i.useContext(ex),l=eM(e=>e.search),o=eM(e=>e.selectedItemId),d=i.useContext(eh);return i.useEffect(()=>{null!=e.value&&n.setState("search",e.value)},[e.value]),i.createElement(eo.input,{ref:t,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":d.listId,"aria-labelledby":d.labelId,"aria-activedescendant":o,id:d.inputId,type:"text",value:s?e.value:l,onChange:e=>{s||n.setState("search",e.target.value),null==r||r(e.target.value)}})}),eN=i.forwardRef((e,t)=>{let{children:r,label:a="Suggestions",...s}=e,n=i.useRef(null),l=i.useRef(null),o=eM(e=>e.selectedItemId),d=i.useContext(eh);return i.useEffect(()=>{if(l.current&&n.current){let e=l.current,t=n.current,r,a=new ResizeObserver(()=>{r=requestAnimationFrame(()=>{let r=e.offsetHeight;t.style.setProperty("--cmdk-list-height",r.toFixed(1)+"px")})});return a.observe(e),()=>{cancelAnimationFrame(r),a.unobserve(e)}}},[]),i.createElement(eo.div,{ref:(0,c.composeRefs)(n,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":o,"aria-label":a,id:d.listId},eP(e,e=>i.createElement("div",{ref:(0,c.composeRefs)(l,d.listInnerRef),"cmdk-list-sizer":""},e)))}),eC=i.forwardRef((e,t)=>{let{open:r,onOpenChange:a,overlayClassName:s,contentClassName:n,container:l,...o}=e;return i.createElement(k,{open:r,onOpenChange:a},i.createElement(D,{container:l},i.createElement(F,{"cmdk-overlay":"",className:s}),i.createElement(L,{"aria-label":e.label,"cmdk-dialog":"",className:n},i.createElement(ev,{ref:t,...o}))))}),e_=Object.assign(ev,{List:eN,Item:eb,Input:ew,Group:ej,Separator:ey,Dialog:eC,Empty:i.forwardRef((e,t)=>eM(e=>0===e.filtered.count)?i.createElement(eo.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Loading:i.forwardRef((e,t)=>{let{progress:r,children:a,label:s="Loading...",...n}=e;return i.createElement(eo.div,{ref:t,...n,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},eP(e,e=>i.createElement("div",{"aria-hidden":!0},e)))})});function eS(e){let t=i.useRef(e);return eR(()=>{t.current=e}),t}var eR="u"<typeof window?i.useEffect:i.useLayoutEffect;function ek(e){let t=i.useRef();return void 0===t.current&&(t.current=e()),t}function eM(e){let t=i.useContext(ex),r=()=>e(t.snapshot());return i.useSyncExternalStore(t.subscribe,r,r)}function eT(e,t,r,a=[]){let s=i.useRef(),n=i.useContext(eh);return eR(()=>{var l;let o=(()=>{var e;for(let t of r){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():s.current}})(),i=a.map(e=>e.trim());n.value(e,o,i),null==(l=t.current)||l.setAttribute(ep,o),s.current=o}),s}var eA=()=>{let[e,t]=i.useState(),r=ek(()=>new Map);return eR(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,a)=>{r.current.set(e,a),t({})}};function eP({asChild:e,children:t},r){let a;return e&&i.isValidElement(t)?i.cloneElement("function"==typeof(a=t.type)?a(t.props):"render"in a?a.render(t.props):t,{ref:t.ref},r(t.props.children)):r(t)}var eE={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},eD=e.i(54943),eD=eD,eI=e.i(75157);function eF({className:e,...t}){return(0,r.jsx)(e_,{"data-slot":"command",className:(0,eI.cn)("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function eO({className:e,...t}){return(0,r.jsxs)("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[(0,r.jsx)(eD.default,{className:"size-4 shrink-0 opacity-50"}),(0,r.jsx)(e_.Input,{"data-slot":"command-input",className:(0,eI.cn)("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function eB({className:e,...t}){return(0,r.jsx)(e_.List,{"data-slot":"command-list",className:(0,eI.cn)("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function eG({...e}){return(0,r.jsx)(e_.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function eL({className:e,...t}){return(0,r.jsx)(e_.Group,{"data-slot":"command-group",className:(0,eI.cn)("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function e$({className:e,...t}){return(0,r.jsx)(e_.Item,{"data-slot":"command-item",className:(0,eI.cn)("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}
5e.i(41947),e.i(26999),e.i(19455),e.s(["Command",()=>eF,"CommandEmpty",()=>eG,"CommandGroup",()=>eL,"CommandInput",()=>eO,"CommandItem",()=>e$,"CommandList",()=>eB],17056);var ez=e.i(53660),eq=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let a=(0,v.createSlot)(`Primitive.${t}`),s=i.forwardRef((e,s)=>{let{asChild:n,...l}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,r.jsx)(n?a:t,{...l,ref:s})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{}),eU="Popover",[eH,eV]=(0,u.createContextScope)(eU,[ez.createPopperScope]),eK=(0,ez.createPopperScope)(),[eQ,eW]=eH(eU),eX=e=>{let{__scopePopover:t,children:a,open:s,defaultOpen:n,onOpenChange:l,modal:o=!1}=e,d=eK(t),c=i.useRef(null),[u,f]=i.useState(!1),[h,x]=(0,p.useControllableState)({prop:s,defaultProp:n??!1,onChange:l,caller:eU});return(0,r.jsx)(ez.Root,{...d,children:(0,r.jsx)(eQ,{scope:t,contentId:(0,m.useId)(),triggerRef:c,open:h,onOpenChange:x,onOpenToggle:i.useCallback(()=>x(e=>!e),[x]),hasCustomAnchor:u,onCustomAnchorAdd:i.useCallback(()=>f(!0),[]),onCustomAnchorRemove:i.useCallback(()=>f(!1),[]),modal:o,children:a})})};eX.displayName=eU;var eY="PopoverAnchor",eJ=i.forwardRef((e,t)=>{let{__scopePopover:a,...s}=e,n=eW(eY,a),l=eK(a),{onCustomAnchorAdd:o,onCustomAnchorRemove:d}=n;return i.useEffect(()=>(o(),()=>d()),[o,d]),(0,r.jsx)(ez.Anchor,{...l,...s,ref:t})});eJ.displayName=eY;var eZ="PopoverTrigger",e0=i.forwardRef((e,t)=>{let{__scopePopover:a,...s}=e,n=eW(eZ,a),l=eK(a),o=(0,c.useComposedRefs)(t,n.triggerRef),i=(0,r.jsx)(eq.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":ts(n.open),...s,ref:o,onClick:(0,d.composeEventHandlers)(e.onClick,n.onOpenToggle)});return n.hasCustomAnchor?i:(0,r.jsx)(ez.Anchor,{asChild:!0,...l,children:i})});e0.displayName=eZ;var e1="PopoverPortal",[e2,e4]=eH(e1,{forceMount:void 0}),e5=e=>{let{__scopePopover:t,forceMount:a,children:s,container:n}=e,l=eW(e1,t);return(0,r.jsx)(e2,{scope:t,forceMount:a,children:(0,r.jsx)(g.Presence,{present:a||l.open,children:(0,r.jsx)(x.Portal,{asChild:!0,container:n,children:s})})})};e5.displayName=e1;var e3="PopoverContent",e6=i.forwardRef((e,t)=>{let a=e4(e3,e.__scopePopover),{forceMount:s=a.forceMount,...n}=e,l=eW(e3,e.__scopePopover);return(0,r.jsx)(g.Presence,{present:s||l.open,children:l.modal?(0,r.jsx)(e7,{...n,ref:t}):(0,r.jsx)(e9,{...n,ref:t})})});e6.displayName=e3;var e8=(0,v.createSlot)("PopoverContent.RemoveScroll"),e7=i.forwardRef((e,t)=>{let a=eW(e3,e.__scopePopover),s=i.useRef(null),n=(0,c.useComposedRefs)(t,s),l=i.useRef(!1);return i.useEffect(()=>{let e=s.current;if(e)return(0,w.hideOthers)(e)},[]),(0,r.jsx)(y.RemoveScroll,{as:e8,allowPinchZoom:!0,children:(0,r.jsx)(te,{...e,ref:n,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,d.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),l.current||a.triggerRef.current?.focus()}),onPointerDownOutside:(0,d.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;l.current=2===t.button||r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,d.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),e9=i.forwardRef((e,t)=>{let a=eW(e3,e.__scopePopover),s=i.useRef(!1),n=i.useRef(!1);return(0,r.jsx)(te,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(s.current||a.triggerRef.current?.focus(),t.preventDefault()),s.current=!1,n.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(s.current=!0,"pointerdown"===t.detail.originalEvent.type&&(n.current=!0));let r=t.target;a.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&n.current&&t.preventDefault()}})}),te=i.forwardRef((e,t)=>{let{__scopePopover:a,trapFocus:s,onOpenAutoFocus:n,onCloseAutoFocus:l,disableOutsidePointerEvents:o,onEscapeKeyDown:i,onPointerDownOutside:d,onFocusOutside:c,onInteractOutside:u,...m}=e,p=eW(e3,a),x=eK(a);return(0,j.useFocusGuards)(),(0,r.jsx)(h.FocusScope,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:n,onUnmountAutoFocus:l,children:(0,r.jsx)(f.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:i,onPointerDownOutside:d,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1),children:(0,r.jsx)(ez.Content,{"data-state":ts(p.open),role:"dialog",id:p.contentId,...x,...m,ref:t,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),tt="PopoverClose",tr=i.forwardRef((e,t)=>
5{let{__scopePopover:a,...s}=e,n=eW(tt,a);return(0,r.jsx)(eq.button,{type:"button",...s,ref:t,onClick:(0,d.composeEventHandlers)(e.onClick,()=>n.onOpenChange(!1))})});tr.displayName=tt;var ta=i.forwardRef((e,t)=>{let{__scopePopover:a,...s}=e,n=eK(a);return(0,r.jsx)(ez.Arrow,{...n,...s,ref:t})});function ts(e){return e?"open":"closed"}ta.displayName="PopoverArrow",e.s(["Anchor",()=>eJ,"Arrow",()=>ta,"Close",()=>tr,"Content",()=>e6,"Popover",()=>eX,"PopoverAnchor",()=>eJ,"PopoverArrow",()=>ta,"PopoverClose",()=>tr,"PopoverContent",()=>e6,"PopoverPortal",()=>e5,"PopoverTrigger",()=>e0,"Portal",()=>e5,"Root",()=>eX,"Trigger",()=>e0,"createPopoverScope",()=>eV],78761);var tn=e.i(78761),tn=tn;function tl({...e}){return(0,r.jsx)(tn.Root,{"data-slot":"popover",...e})}function to({...e}){return(0,r.jsx)(tn.Trigger,{"data-slot":"popover-trigger",...e})}function ti({className:e,align:t="center",sideOffset:a=4,...s}){return(0,r.jsx)(tn.Portal,{children:(0,r.jsx)(tn.Content,{"data-slot":"popover-content",align:t,sideOffset:a,className:(0,eI.cn)("bg-popover text-popover-foreground 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...s})})}e.s(["Popover",()=>tl,"PopoverContent",()=>ti,"PopoverTrigger",()=>to],37822);var td=e.i(78745);function tc({className:e,...t}){return(0,r.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,r.jsx)("table",{"data-slot":"table",className:(0,eI.cn)("w-full caption-bottom text-sm",e),...t})})}function tu({className:e,...t}){return(0,r.jsx)("thead",{"data-slot":"table-header",className:(0,eI.cn)("[&_tr]:border-b",e),...t})}function tm({className:e,...t}){return(0,r.jsx)("tbody",{"data-slot":"table-body",className:(0,eI.cn)("[&_tr:last-child]:border-0",e),...t})}function tp({className:e,...t}){return(0,r.jsx)("tr",{"data-slot":"table-row",className:(0,eI.cn)("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function tf({className:e,...t}){return(0,r.jsx)("th",{"data-slot":"table-head",className:(0,eI.cn)("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function th({className:e,...t}){return(0,r.jsx)("td",{"data-slot":"table-cell",className:(0,eI.cn)("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function tx(e){let t=[];if("apple"!==e.vendor){let r,a;t.push({url:e.affiliate_amazon_url??(r=encodeURIComponent(`${e.brand} ${e.model} GPU`),`https://www.amazon.com/s?k=${r}&tag=canirunllm-20`),label:"Buy on Amazon",provider:"amazon"}),t.push({url:e.affiliate_bhphoto_url??(a=encodeURIComponent(`${e.brand} ${e.model}`),`https://www.bhphotovideo.com/c/search?q=${a}`),label:"Buy on B&H Photo",provider:"bhphoto"})}return t.push({url:e.affiliate_runpod_url??"https://runpod.io?ref=canirunthisllm",label:"Rent Cloud GPU",provider:"runpod"}),t}e.s(["Check",()=>td.default],43531),e.s(["Table",()=>tc,"TableBody",()=>tm,"TableCell",()=>th,"TableHead",()=>tf,"TableHeader",()=>tu,"TableRow",()=>tp],84774),e.s(["AFFILIATE_REL",0,"nofollow sponsored","AFFILIATE_TARGET",0,"_blank","getAffiliateLinks",()=>tx],20480)},63320,e=>{"use strict";var t=e.i(43476),r=e.i(71645),a=e.i(19455),s=e.i(15288),n=e.i(72436),l=e.i(75157),o=e.i(17056),i=e.i(37822),d=e.i(64659),c=e.i(43531);let u={nvidia:"NVIDIA",amd:"AMD",apple:"Apple Silicon",intel:"Intel"};function m({gpus:e,value:s,onSelect:n}){let[l,m]=(0,r.useState)(!1),p=e.find(e=>e.slug===s),f=e.reduce((e,t)=>{let r=t.vendor;return e[r]||(e[r]=[]),e[r].push(t),e},{});return(0,t.jsxs)(i.Popover,{open:l,onOpenChange:m,children:[(0,t.jsx)(i.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)(a.Button,{variant:"outline",role:"combobox","aria-expanded":l,className:"w-full justify-between h-12 text-left",children:[p?(0,t.jsxs)("span",{className:"truncate",children:[p.brand," ",p.model,(0,t.jsxs)("span",{className:"text-muted-foreground ml-2",children:["(",p.vram_gb,"GB)"]})]}):(0,t.jsx)("span",{className:"text-muted-foreground",children:"Select your GPU..."}
5),(0,t.jsx)(d.ChevronDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(i.PopoverContent,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:(0,t.jsxs)(o.Command,{children:[(0,t.jsx)(o.CommandInput,{placeholder:"Search GPUs..."}),(0,t.jsxs)(o.CommandList,{children:[(0,t.jsx)(o.CommandEmpty,{children:"No GPU found."}),Object.entries(f).map(([e,r])=>(0,t.jsx)(o.CommandGroup,{heading:u[e]??e,children:r.map(e=>(0,t.jsxs)(o.CommandItem,{value:`${e.brand} ${e.model}`,onSelect:()=>{n(e.slug),m(!1)},children:[(0,t.jsx)(c.Check,{className:`mr-2 h-4 w-4 ${s===e.slug?"opacity-100":"opacity-0"}`}),(0,t.jsxs)("span",{children:[e.brand," ",e.model]}),(0,t.jsxs)("span",{className:"ml-auto text-xs text-muted-foreground",children:[e.vram_gb,"GB"]})]},e.slug))},e))]})]})})]})}let p={"Apple M1":{8:{ramOptions:[8,16],bandwidth:68.25,computeTflops:2.6,gpuCoresRange:"7-8"}},"Apple M1 Pro":{8:{ramOptions:[16],bandwidth:200,computeTflops:5.2,gpuCoresRange:"14"},10:{ramOptions:[16,32],bandwidth:200,computeTflops:5.2,gpuCoresRange:"14-16"}},"Apple M1 Max":{10:{ramOptions:[32,64],bandwidth:400,computeTflops:10.4,gpuCoresRange:"24-32"}},"Apple M1 Ultra":{20:{ramOptions:[64,128],bandwidth:800,computeTflops:20.8,gpuCoresRange:"48-64"}},"Apple M2":{8:{ramOptions:[8,16,24],bandwidth:100,computeTflops:3.6,gpuCoresRange:"8-10"}},"Apple M2 Pro":{10:{ramOptions:[16,32],bandwidth:200,computeTflops:7,gpuCoresRange:"16"},12:{ramOptions:[16,32],bandwidth:200,computeTflops:7,gpuCoresRange:"19"}},"Apple M2 Max":{12:{ramOptions:[32,64,96],bandwidth:400,computeTflops:13.5,gpuCoresRange:"30-38"}},"Apple M2 Ultra":{24:{ramOptions:[64,128,192],bandwidth:800,computeTflops:27.2,gpuCoresRange:"60-76"}},"Apple M3":{8:{ramOptions:[8,16,24],bandwidth:100,computeTflops:3.6,gpuCoresRange:"8-10"}},"Apple M3 Pro":{11:{ramOptions:[18,36],bandwidth:150,computeTflops:5,gpuCoresRange:"14"},12:{ramOptions:[18,36],bandwidth:150,computeTflops:7,gpuCoresRange:"18"}},"Apple M3 Max":{14:{ramOptions:[36,48],bandwidth:300,computeTflops:14.2,gpuCoresRange:"30"},16:{ramOptions:[48,64,128],bandwidth:400,computeTflops:14.2,gpuCoresRange:"40"}},"Apple M4":{8:{ramOptions:[8,16],bandwidth:120,computeTflops:4,gpuCoresRange:"8"},10:{ramOptions:[16,24,32],bandwidth:120,computeTflops:4,gpuCoresRange:"10"}},"Apple M4 Pro":{12:{ramOptions:[24,48],bandwidth:273,computeTflops:8,gpuCoresRange:"16"},14:{ramOptions:[24,48,64],bandwidth:273,computeTflops:10,gpuCoresRange:"20"}},"Apple M4 Max":{14:{ramOptions:[36,48,64],bandwidth:410,computeTflops:16,gpuCoresRange:"32"},16:{ramOptions:[48,64,128],bandwidth:546,computeTflops:20,gpuCoresRange:"40"}},"Apple M4 Ultra":{28:{ramOptions:[128,192,256],bandwidth:820,computeTflops:32,gpuCoresRange:"64"},32:{ramOptions:[192,256,384],bandwidth:1092,computeTflops:40,gpuCoresRange:"80"}},"Apple M5":{10:{ramOptions:[16,24,32],bandwidth:153,computeTflops:4.5,gpuCoresRange:"10"}}},f={8:["Apple M4","Apple M3","Apple M2","Apple M1"],10:["Apple M4","Apple M1 Pro","Apple M2 Pro","Apple M1 Max"],11:["Apple M3 Pro"],12:["Apple M4 Pro","Apple M3 Pro","Apple M2 Pro","Apple M2 Max"],14:["Apple M4 Pro","Apple M4 Max","Apple M3 Max"],16:["Apple M4 Max","Apple M3 Max"],20:["Apple M1 Ultra"],24:["Apple M2 Ultra"],28:["Apple M4 Ultra"],32:["Apple M4 Ultra"]},h=[8,16,18,24,32,36,48,64,96,128,192,256,384,512];async function x(){if(!("gpu"in navigator))return{renderer:null,vendor:null};try{let e=navigator.gpu,t=await e.requestAdapter();if(!t)return{renderer:null,vendor:null};let r="",a="";if(t.info)r=t.info.device??"",a=t.info.vendor??"";else if("function"==typeof t.requestAdapterInfo){let e=await t.requestAdapterInfo();r=e.device??"",a=e.vendor??""}let s=t.limits?.maxBufferSize??void 0;return{renderer:r||null,vendor:a||null,maxBufferSize:s}}catch{return{renderer:null,vendor:null}}}function g(e,t){if(!e||e<=0)return;let r=e/0x40000000;if(t&&t.length>0){let e=t.map(e=>{let t=e/r,a=Math.pow(2,Math.round(Math.log2(t))),s=Math.abs(t-a);return{ram:e,score:t>0&&(t&t-1)==0?0:s}}),a=Math.min(...e.map(e=>e.score)),s=e.filter(e=>e.score===a).map(e=>e.ram),n=Math.floor(s.length/2);return s.length>1?s[n]:s[0]}let a=h[0],s=1/0;for(let e of[4,8,16,32]){let t=r*e,n=h.reduce((e,r)=>
5Math.abs(r-t)<Math.abs(e-t)?r:e),l=Math.abs(n-t);l<s&&(s=l,a=n)}return a}function v(e){if(!e)return"unknown";let t=e.toLowerCase();return t.includes("apple")?"apple":t.includes("nvidia")?"nvidia":t.includes("amd")||t.includes("ati")?"amd":t.includes("intel")?"intel":"unknown"}async function b(){let e,[t,r]=await Promise.allSettled([x(),Promise.resolve(function(){let e=document.createElement("canvas"),t=e.getContext("webgl2")??e.getContext("webgl");if(!t)return{renderer:null,vendor:null};let r=t.getExtension("WEBGL_debug_renderer_info");if(!r)return e.remove(),{renderer:null,vendor:null};let a=t.getParameter(r.UNMASKED_RENDERER_WEBGL),s=t.getParameter(r.UNMASKED_VENDOR_WEBGL);return e.remove(),{renderer:a||null,vendor:s||null}}())]),a="fulfilled"===t.status?t.value:{renderer:null,vendor:null},s="fulfilled"===r.status?r.value:{renderer:null,vendor:null},n=navigator.hardwareConcurrency||0,l=navigator.deviceMemory,o="",i="",d="manual",c=a.maxBufferSize;if(a.renderer?(o=a.renderer,i=a.vendor??"",d="webgpu"):s.renderer&&(o=s.renderer,i=s.vendor??"",d="webgl"),!o)return{renderer:"",vendor:"unknown",chipName:"",method:"manual",confidence:0,cpuCores:0,isUnifiedMemory:!1,cpuCores:n,deviceMemory:l};let u="unknown"!==v(i)?v(i):v(o),m=function(e,t){if("apple"===t){let t=e.match(/(Apple\s+M\d+(?:\s+(?:Pro|Max|Ultra))?)/i);return t?t[1]:e}if("nvidia"===t){let t=e.match(/(NVIDIA\s+GeForce\s+(?:RTX|GTX)\s+\d{4}(?:\s+(?:Ti|SUPER|Ti\s+SUPER))?)/i);if(t)return t[1];let r=e.match(/((?:RTX|GTX)\s+\d{4}(?:\s+(?:Ti|SUPER|Ti\s+SUPER))?)/i);return r?`NVIDIA GeForce ${r[1]}`:e}if("amd"===t){let t=e.match(/((?:AMD\s+)?Radeon\s+RX\s+\d{4}\s*\w*)/i);return t?t[1]:e}if("intel"===t){let t=e.match(/(Intel\s+Arc\s+(?:A|B)\d{3,4}\w*)/i);if(t)return t[1]}return e}(o,u);if("apple"===u){let t=p[m]?.[n],r=t?.ramOptions;if(c&&r&&r.length>0?e=g(c,r):c&&(e=g(c)),!e&&t&&t.ramOptions.length>0){let r=Math.floor(t.ramOptions.length/2);e=t.ramOptions[r]}}else e=c?g(c):void 0;if("apple"===u){let t=function(e,t,r){var a;if("apple gpu"!==e.toLowerCase()&&"gpu"!==e.toLowerCase()){let a=p[e]?.[t];return a?{chipName:e,confidence:r&&a.ramOptions.includes(r)?.95:.85,possibleRamOptions:a.ramOptions,config:a}:{chipName:e,confidence:.7}}let s=f[t]??[];if(0===s.length)return{chipName:"unknown-apple",confidence:.3,possibleChips:[]};if(1===s.length){let e=(a=s[0],p[a]?.[t]);return{chipName:s[0],confidence:.75,possibleRamOptions:e?.ramOptions,possibleChips:s,config:e??void 0}}return{chipName:"unknown-apple",confidence:.4,possibleChips:s}}(m,n,e);return{renderer:o,vendor:u,chipName:t.chipName,method:d,confidence:t.confidence,cpuCores:n,maxBufferSize:c,deviceMemory:l,isUnifiedMemory:!0,possibleRamOptions:t.possibleRamOptions,suggestedRam:e,possibleChips:t.possibleChips,appleSiliconConfig:t.config}}let h="webgpu"===d?.9:.8;return"webgl"===d&&("nvidia"===u||"amd"===u)&&(h=.9),{renderer:o,vendor:u,chipName:m,method:d,confidence:h,cpuCores:n,maxBufferSize:c,deviceMemory:l,isUnifiedMemory:!1,suggestedRam:void 0}}var j=e.i(75254);let y=(0,j.default)("scan",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]]),w=(0,j.default)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);function N({onDetected:e}){let[s,n]=(0,r.useState)(!1),[l,o]=(0,r.useState)(null),[i,d]=(0,r.useState)(null),[c,u]=(0,r.useState)(null),[m,p]=(0,r.useState)(!1),f=(0,r.useCallback)(()=>{p(!0);let e=setTimeout(()=>p(!1),2e3);return()=>clearTimeout(e)},[]);async function h(){n(!0),u(null);try{let t=await b();if(o(t),t.renderer){let r=function(e){let t=e.toLowerCase();if(t.includes("nvidia")||t.includes("geforce")||t.includes("rtx")||t.includes("gtx")){let t=e.match(/(?:NVIDIA\s+)?(?:GeForce\s+)?((?:RTX|GTX)\s+\d{4}(?:\s+(?:Ti|SUPER|Ti\s+SUPER))?)/i);return{vendor:"nvidia",model:t?.[1]??e}}if(t.includes("amd")||t.includes("radeon")||t.includes("rx ")){let t=e.match(/(?:AMD\s+)?(?:Radeon\s+)?(RX\s+\d{4}\s*\w*)/i);return{vendor:"amd",model:t?.[1]??e}}if(t.includes("apple")||t.includes("m1")||t.includes("m2")||t.includes("m3")||t.includes("m4")||t.includes("m5")){let t=e.match(/(Apple\s+M\d+(?:\s+(?:Pro|Max|Ultra))?)/i);return{vendor:"apple",model:t?.[1]??e}}if(t.includes("intel")||t.includes("arc ")){let t=e.match(/(?:Intel\s+)?(?:Arc\s+)?((?:A|B)\d{3,4}\w*)/i);return{vendor:"intel",model:t?.[1]??e}}return{vendor:null,model:null}}(t.renderer);if(r.vendor&&r.model){let a={vendor:r.vendor,model:r.model,renderer:t.renderer,possibleRamOptions:t.possibleRamOptions,suggestedRam:t.suggestedRam,cpuCores:t.cpuCores,isUnifiedMemory:t.isUnifiedMemory};d(a),e(a),f()}else u(`Detected "${t.renderer}" but couldn't identify the GPU model.`)}else u("Could not detect GPU. Please select manually.")}catch{u("GPU detection failed. Please select manually.")}finally{n(!1)}}return(0,r.useEffect)(()=>
5{if(!m)return;let e=setTimeout(()=>p(!1),2e3);return()=>clearTimeout(e)},[m]),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(a.Button,{variant:"outline",size:"sm",onClick:h,disabled:s,className:"gap-2",children:[(0,t.jsx)(y,{className:"h-4 w-4"}),s?"Detecting...":"Auto-detect GPU"]}),i&&!c&&(0,t.jsxs)("div",{className:`flex items-center gap-2 rounded-md border px-3 py-1.5 transition-all duration-500 ${m?"border-green-500/50 bg-green-500/10 shadow-[0_0_12px_rgba(34,197,94,0.15)]":"border-border bg-transparent"}`,children:[(0,t.jsx)(w,{className:"h-4 w-4 shrink-0 text-green-500"}),(0,t.jsxs)("div",{className:"flex items-baseline gap-1.5 text-sm",children:[(0,t.jsx)("span",{className:"font-medium text-foreground",children:i.model}),i.suggestedRam&&(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["· ",i.suggestedRam,"GB"," ",(0,t.jsx)("span",{className:"text-green-500/80",children:"detected"})]})]}),(0,t.jsx)("span",{className:"ml-auto text-[10px] uppercase tracking-wider text-muted-foreground/50",children:l?.method})]}),c&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:c})]})}var C=e.i(70152),_=e.i(81140),S=e.i(20783),R=e.i(30030),k=e.i(69340),M=e.i(86318),T=e.i(99682),A=e.i(35804);e.i(74080);var P=e.i(91918),E=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,a)=>{let s=(0,P.createSlot)(`Primitive.${a}`),n=r.forwardRef((e,r)=>{let{asChild:n,...l}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(n?s:a,{...l,ref:r})});return n.displayName=`Primitive.${a}`,{...e,[a]:n}},{}),D=e.i(75830),I=["PageUp","PageDown"],F=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],O={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},B="Slider",[G,L,$]=(0,D.createCollection)(B),[z,q]=(0,R.createContextScope)(B,[$]),[U,H]=z(B),V=r.forwardRef((e,a)=>{let{name:s,min:n=0,max:l=100,step:o=1,orientation:i="horizontal",disabled:d=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[n],value:m,onValueChange:p=()=>{},onValueCommit:f=()=>{},inverted:h=!1,form:x,...g}=e,v=r.useRef(new Set),b=r.useRef(0),j="horizontal"===i,[y=[],w]=(0,k.useControllableState)({prop:m,defaultProp:u,onChange:e=>{let t=[...v.current];t[b.current]?.focus(),p(e)}}),N=r.useRef(y);function S(e,t,{commit:r}={commit:!1}){let a,s=(String(o).split(".")[1]||"").length,i=Math.round((Math.round((e-n)/o)*o+n)*(a=Math.pow(10,s)))/a,d=(0,C.clamp)(i,[n,l]);w((e=[])=>{let a=function(e=[],t,r){let a=[...e];return a[r]=t,a.sort((e,t)=>e-t)}(e,d,t);if(!function(e,t){if(t>0)return Math.min(...e.slice(0,-1).map((t,r)=>e[r+1]-t))>=t;return!0}(a,c*o))return e;{b.current=a.indexOf(d);let t=String(a)!==String(e);return t&&r&&f(a),t?a:e}})}return(0,t.jsx)(U,{scope:e.__scopeSlider,name:s,disabled:d,min:n,max:l,valueIndexToChangeRef:b,thumbs:v.current,values:y,orientation:i,form:x,children:(0,t.jsx)(G.Provider,{scope:e.__scopeSlider,children:(0,t.jsx)(G.Slot,{scope:e.__scopeSlider,children:(0,t.jsx)(j?W:X,{"aria-disabled":d,"data-disabled":d?"":void 0,...g,ref:a,onPointerDown:(0,_.composeEventHandlers)(g.onPointerDown,()=>{d||(N.current=y)}),min:n,max:l,inverted:h,onSlideStart:d?void 0:function(e){let t=function(e,t){if(1===e.length)return 0;let r=e.map(e=>Math.abs(e-t)),a=Math.min(...r);return r.indexOf(a)}(y,e);S(e,t)},onSlideMove:d?void 0:function(e){S(e,b.current)},onSlideEnd:d?void 0:function(){let e=N.current[b.current];y[b.current]!==e&&f(y)},onHomeKeyDown:()=>!d&&S(n,0,{commit:!0}),onEndKeyDown:()=>!d&&S(l,y.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!d){let r=I.includes(e.key)||e.shiftKey&&F.includes(e.key),a=b.current;S(y[a]+o*(r?10:1)*t,a,{commit:!0})}}})})})})});V.displayName=B;var[K,Q]=z(B,{startEdge:"left",endEdge:"right",size:"width",direction:1}),W=r.forwardRef((e,a)=>{let{min:s,max:n,dir:l,inverted:o,onSlideStart:i,onSlideMove:d,onSlideEnd:c,onStepKeyDown:u,...m}=e,[p,f]=r.useState(null),h=(0,S.useComposedRefs)(a,e=>f(e)),x=r.useRef(void 0),g=(0,M.useDirection)(l),v="ltr"===g,b=v&&!o||!v&&o;function j(e){let t=x.current||p.getBoundingClientRect(),r=eo([0,t.width],b?[s,n]:[n,s]);return x.current=t,r(e-t.left)}return(0,t.jsx)(K,{scope:e.__scopeSlider,startEdge:b?"left":"right",endEdge:b?"right":"left",direction:b?1:-1,size:"width",children:(0,t.jsx)(Y,{dir:g,"data-orientation":"horizontal",...m,ref:h,style:{...m.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{let t=j(e.clientX);i?.(t)},onSlideMove:e=>{let t=j(e.clientX);d?.(t)},onSlideEnd:()=>{x.current=void 0,c?.()},onStepKeyDown:e=>
5{let t=O[b?"from-left":"from-right"].includes(e.key);u?.({event:e,direction:t?-1:1})}})})}),X=r.forwardRef((e,a)=>{let{min:s,max:n,inverted:l,onSlideStart:o,onSlideMove:i,onSlideEnd:d,onStepKeyDown:c,...u}=e,m=r.useRef(null),p=(0,S.useComposedRefs)(a,m),f=r.useRef(void 0),h=!l;function x(e){let t=f.current||m.current.getBoundingClientRect(),r=eo([0,t.height],h?[n,s]:[s,n]);return f.current=t,r(e-t.top)}return(0,t.jsx)(K,{scope:e.__scopeSlider,startEdge:h?"bottom":"top",endEdge:h?"top":"bottom",size:"height",direction:h?1:-1,children:(0,t.jsx)(Y,{"data-orientation":"vertical",...u,ref:p,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{let t=x(e.clientY);o?.(t)},onSlideMove:e=>{let t=x(e.clientY);i?.(t)},onSlideEnd:()=>{f.current=void 0,d?.()},onStepKeyDown:e=>{let t=O[h?"from-bottom":"from-top"].includes(e.key);c?.({event:e,direction:t?-1:1})}})})}),Y=r.forwardRef((e,r)=>{let{__scopeSlider:a,onSlideStart:s,onSlideMove:n,onSlideEnd:l,onHomeKeyDown:o,onEndKeyDown:i,onStepKeyDown:d,...c}=e,u=H(B,a);return(0,t.jsx)(E.span,{...c,ref:r,onKeyDown:(0,_.composeEventHandlers)(e.onKeyDown,e=>{"Home"===e.key?(o(e),e.preventDefault()):"End"===e.key?(i(e),e.preventDefault()):I.concat(F).includes(e.key)&&(d(e),e.preventDefault())}),onPointerDown:(0,_.composeEventHandlers)(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():s(e)}),onPointerMove:(0,_.composeEventHandlers)(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&n(e)}),onPointerUp:(0,_.composeEventHandlers)(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),l(e))})})}),J="SliderTrack",Z=r.forwardRef((e,r)=>{let{__scopeSlider:a,...s}=e,n=H(J,a);return(0,t.jsx)(E.span,{"data-disabled":n.disabled?"":void 0,"data-orientation":n.orientation,...s,ref:r})});Z.displayName=J;var ee="SliderRange",et=r.forwardRef((e,a)=>{let{__scopeSlider:s,...n}=e,l=H(ee,s),o=Q(ee,s),i=r.useRef(null),d=(0,S.useComposedRefs)(a,i),c=l.values.length,u=l.values.map(e=>el(e,l.min,l.max)),m=c>1?Math.min(...u):0,p=100-Math.max(...u);return(0,t.jsx)(E.span,{"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,...n,ref:d,style:{...e.style,[o.startEdge]:m+"%",[o.endEdge]:p+"%"}})});et.displayName=ee;var er="SliderThumb",ea=r.forwardRef((e,a)=>{let s=L(e.__scopeSlider),[n,l]=r.useState(null),o=(0,S.useComposedRefs)(a,e=>l(e)),i=r.useMemo(()=>n?s().findIndex(e=>e.ref.current===n):-1,[s,n]);return(0,t.jsx)(es,{...e,ref:o,index:i})}),es=r.forwardRef((e,a)=>{var s,n,l,o,i;let d,c,{__scopeSlider:u,index:m,name:p,...f}=e,h=H(er,u),x=Q(er,u),[g,v]=r.useState(null),b=(0,S.useComposedRefs)(a,e=>v(e)),j=!g||h.form||!!g.closest("form"),y=(0,A.useSize)(g),w=h.values[m],N=void 0===w?0:el(w,h.min,h.max),C=(s=m,(n=h.values.length)>2?`Value ${s+1} of ${n}`:2===n?["Minimum","Maximum"][s]:void 0),R=y?.[x.size],k=R?(l=R,o=N,i=x.direction,c=eo([0,50],[0,d=l/2]),(d-c(o)*i)*i):0;return r.useEffect(()=>{if(g)return h.thumbs.add(g),()=>{h.thumbs.delete(g)}},[g,h.thumbs]),(0,t.jsxs)("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[x.startEdge]:`calc(${N}% + ${k}px)`},children:[(0,t.jsx)(G.ItemSlot,{scope:e.__scopeSlider,children:(0,t.jsx)(E.span,{role:"slider","aria-label":e["aria-label"]||C,"aria-valuemin":h.min,"aria-valuenow":w,"aria-valuemax":h.max,"aria-orientation":h.orientation,"data-orientation":h.orientation,"data-disabled":h.disabled?"":void 0,tabIndex:h.disabled?void 0:0,...f,ref:b,style:void 0===w?{display:"none"}:e.style,onFocus:(0,_.composeEventHandlers)(e.onFocus,()=>{h.valueIndexToChangeRef.current=m})})}),j&&(0,t.jsx)(en,{name:p??(h.name?h.name+(h.values.length>1?"[]":""):void 0),form:h.form,value:w},m)]})});ea.displayName=er;var en=r.forwardRef(({__scopeSlider:e,value:a,...s},n)=>{let l=r.useRef(null),o=(0,S.useComposedRefs)(l,n),i=(0,T.usePrevious)(a);return r.useEffect(()=>{let e=l.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value").set;if(i!==a&&t){let r=new Event("input",{bubbles:!0});t.call(e,a),e.dispatchEvent(r)}},[i,a]),(0,t.jsx)(E.input,{style:{display:"none"},...s,ref:o,defaultValue:a})});function el(e,t,r){return(0,C.clamp)(100/(r-t)*(e-t),[0,100])}function eo(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let a=(t[1]-t[0])/(e[1]-e[0]);return t[0]+a*(r-e[0])}}en.displayName="RadioBubbleInput",e.s(["Range",()=>et,"Root",()=>V,"Slider",()=>V,"SliderRange",()=>et,"SliderThumb",()=>ea,"SliderTrack",()=>Z,"Thumb",()=>ea,"Track",()=>Z,"createSliderScope",()=>q],44729);var ei=e.i(44729),ei=ei;function ed({className:e,defaultValue:a,value:s,min:n=0,max:o=100,...i}){let d=r.useMemo(()=>Array.isArray(s)?s:Array.isArray(a)?a:[n,o],[s,a,n,o]);return(0,t.jsxs)(ei.Root,{"data-slot":"slider",defaultValue:a,value:s,min:n,max:o,className:(0,l.cn)("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...i,children:[(0,t.jsx)(ei.Track,{"data-slot":"slider-track",className:(0,l.cn)("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:(0,t.jsx)(ei.Range,{"data-slot":"slider-range",className:(0,l.cn)("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:d.length},(e,r)=>(0,t.jsx)(ei.Thumb,{"data-slot":"slider-thumb",className:"border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},r))]})}let ec=[8,16,32,64,128];
5function eu({value:e,onChange:r,showPresets:s=!0}){return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:"System RAM"}),(0,t.jsxs)("span",{className:"text-sm font-mono text-muted-foreground",children:[e," GB"]})]}),(0,t.jsx)(ed,{value:[e],onValueChange:([e])=>r(e),min:4,max:192,step:4,className:"w-full"}),s&&(0,t.jsx)("div",{className:"flex gap-2",children:ec.map(s=>(0,t.jsxs)(a.Button,{variant:e===s?"default":"outline",size:"sm",className:"text-xs flex-1",onClick:()=>r(s),children:[s,"GB"]},s))})]})}function em({className:e,...r}){return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,l.cn)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...r})}var ep=e.i(77572);let ef=(0,j.default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),eh='system_profiler SPHardwareDataType | grep -E "Chip|Memory"';function ex({onParsed:e}){let[s,n]=(0,r.useState)(!1),[l,o]=(0,r.useState)(!1),[i,u]=(0,r.useState)(null),[m,p]=(0,r.useState)(!1);async function f(){try{await navigator.clipboard.writeText(eh),o(!0),setTimeout(()=>o(!1),2e3)}catch{}}return(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>n(!s),className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[(0,t.jsx)(d.ChevronDown,{className:`h-3.5 w-3.5 transition-transform duration-200 ${s?"rotate-180":""}`}),"Need 100% accuracy?"]}),s&&(0,t.jsx)("div",{className:"mt-3 p-4 rounded-lg border border-border bg-muted/30",children:(0,t.jsxs)(ep.Tabs,{defaultValue:"simple",children:[(0,t.jsxs)(ep.TabsList,{children:[(0,t.jsx)(ep.TabsTrigger,{value:"simple",children:"Easy Way"}),(0,t.jsx)(ep.TabsTrigger,{value:"terminal",children:"Terminal"})]}),(0,t.jsx)(ep.TabsContent,{value:"simple",children:(0,t.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground mt-3",children:[(0,t.jsx)("p",{children:"On your Mac:"}),(0,t.jsxs)("ol",{className:"list-decimal list-inside space-y-1",children:[(0,t.jsxs)("li",{children:["Click the ",(0,t.jsx)("strong",{className:"text-foreground",children:"Apple menu"})," in the top-left corner"]}),(0,t.jsxs)("li",{children:["Select ",(0,t.jsx)("strong",{className:"text-foreground",children:'"About This Mac"'})]}),(0,t.jsxs)("li",{children:["Look for ",(0,t.jsx)("strong",{className:"text-foreground",children:'"Chip"'})," and"," ",(0,t.jsx)("strong",{className:"text-foreground",children:'"Memory"'})]})]}),(0,t.jsx)("p",{className:"text-xs mt-2",children:"Then select the matching values above."})]})}),(0,t.jsx)(ep.TabsContent,{value:"terminal",children:(0,t.jsxs)("div",{className:"space-y-3 mt-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("code",{className:"flex-1 text-xs bg-background p-2 rounded border border-border font-mono overflow-x-auto",children:eh}),(0,t.jsx)(a.Button,{variant:"outline",size:"sm",onClick:f,className:"shrink-0 gap-1.5",children:l?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.Check,{className:"h-3.5 w-3.5"}),"Copied"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ef,{className:"h-3.5 w-3.5"}),"Copy"]})})]}),(0,t.jsx)(em,{placeholder:"Paste the output here...",className:"font-mono text-xs h-20",onChange:t=>(function(t){let r,a;if(u(null),p(!1),!t.trim())return;let s=(r=t.match(/Chip:\s*(Apple\s+M\d+(?:\s+(?:Pro|Max|Ultra))?)/i),a=t.match(/Memory:\s*(\d+)\s*GB/i),r&&a?{chipName:r[1],ramGb:parseInt(a[1])}:null);s?(e(s.chipName,s.ramGb),p(!0)):u("Could not parse the output. Make sure you pasted the full result.")})(t.target.value)}),i&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:i}),m&&(0,t.jsx)("p",{className:"text-xs text-green-500",children:"Detected! Hardware updated automatically."})]})})]})})]})}var eg=e.i(55436);let ev=(0,j.default)("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]),eb=(0,j.default)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]),ej=(0,j.default)("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]);var ey=e.i(99219),ey=ey;function ew({className:e,type:r,...a}){return(0,t.jsx)("input",{type:r,"data-slot":"input",className:(0,l.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...a})}var eN=e.i(67489),eC=e.i(84774),e_=e.i(46798),eS=e.i(23392),eR=e.i(74389);let ek=(0,j.default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),eM={F16:{bits:"16-bit",quality:"Perfect",note:"Full precision, huge VRAM requirement"}
5,Q8_0:{bits:"~8.5-bit",quality:"Excellent",note:"Near-lossless, 2x smaller than F16"},Q6_K:{bits:"~6.5-bit",quality:"Very good",note:"Minimal quality loss"},Q5_K_M:{bits:"~5.5-bit",quality:"Good+",note:"Slight quality loss, good balance"},Q5_0:{bits:"5-bit",quality:"Good",note:"Basic 5-bit quantization"},Q4_K_M:{bits:"~4.5-bit",quality:"Good",note:"Community standard -- best speed/quality"},Q4_0:{bits:"4-bit",quality:"Decent",note:"Basic 4-bit, slightly less quality"},IQ4_XS:{bits:"~4-bit",quality:"Good",note:"imatrix 4-bit, better than Q4_0"},Q3_K_M:{bits:"~3.5-bit",quality:"Noticeable",note:"Quality loss visible, still usable"},IQ3_XXS:{bits:"~3-bit",quality:"Poor",note:"imatrix 3-bit, significant loss"},Q2_K:{bits:"~2.5-bit",quality:"Degraded",note:"Major quality loss -- last resort"},IQ2_XXS:{bits:"~2.25-bit",quality:"Minimum",note:"Absolute minimum viable quantization"}};function eT({quant:e}){let r=eM[e];return(0,t.jsxs)(e_.Tooltip,{children:[(0,t.jsx)(e_.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 cursor-default",children:[(0,t.jsx)("span",{className:"font-mono font-medium",children:e}),(0,t.jsx)(ek,{className:"size-3 text-muted-foreground/60"})]})}),(0,t.jsxs)(e_.TooltipContent,{side:"top",className:"max-w-[260px] space-y-1.5",children:[r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"text-xs font-medium",children:[e," (",r.bits,")"]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Quality: ",(0,t.jsx)("span",{className:"text-foreground",children:r.quality})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:r.note})]}):(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[e," quantization"]}),"Q4_K_M"===e&&(0,t.jsx)("p",{className:"text-xs text-primary font-medium",children:"Recommended for most users"})]})]})}function eA({result:e}){var r;let a,{model:n,level:l,recommended_quant:o,vram_required_gb:i,vram_available_gb:d,fits_in_vram:c,estimated_tps_min:u,estimated_tps_max:m,notes:p}=e,f=n.release_date?isNaN((a=new Date(n.release_date)).getTime())?"":a.toLocaleDateString("en-US",{month:"short",year:"numeric"}):null;return(0,t.jsxs)(s.Card,{className:`transition-all hover:border-primary/30 ${!c?"opacity-60":""}`,children:[(0,t.jsxs)(s.CardHeader,{className:"pb-3",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,t.jsx)(s.CardTitle,{className:"text-base leading-tight break-words min-w-0",children:n.name}),f&&(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground/60 whitespace-nowrap flex-shrink-0",children:f})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 mt-1",children:[(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[n.params_b,"B params · ",n.family]}),(0,t.jsx)(eS.ScoreBadge,{level:l})]})]}),(0,t.jsxs)(s.CardContent,{className:"space-y-3",children:[(0,t.jsx)(eR.PerformanceBar,{min:u,max:m}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground italic",children:(r=(u+m)/2)<5?"Very slow -- text appears word by word, not practical for conversation":r<15?"Usable -- like a thoughtful response, noticeable delay between words":r<30?"Smooth -- feels like a natural conversation, similar to ChatGPT":r<60?"Fast -- instant responses, great for coding and chat":"Lightning fast -- agent-ready, can handle complex multi-step tasks"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-xs",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Quant."}),(0,t.jsx)("p",{children:(0,t.jsx)(eT,{quant:o})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"VRAM"}),(0,t.jsxs)("p",{className:"font-mono font-medium",children:[i.toFixed(1)," / ",d.toFixed(0)," GB"]})]})]}),n.is_moe&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["MoE: ",n.active_experts,"/",n.num_experts," experts active"]}),p.length>0&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground space-y-1 border-t border-border/40 pt-2",children:p.map((e,r)=>(0,t.jsx)("p",{children:e},r))})]})]})}let eP=(0,j.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]),eE=(0,j.default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]),eD=(0,j.default)("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]),eI=(0,j.default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594
51.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]),eF=(0,j.default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),eO=new Set(["llama","qwen","deepseek","mistral","gemma","phi","command-r"]),eB=["nemotron","hermes","dolphin","openhermes","nous","wizardlm","neural-chat","starling","openchat","tulu","orca","vicuna"];function eG(e){let t,r=0,a=e.model.family.toLowerCase();return eO.has(a)&&(t=e.model.name.toLowerCase(),!eB.some(e=>t.includes(e)))&&(r+=200),r+=Math.min(2*((e.estimated_tps_min+e.estimated_tps_max)/2),120),e.model.release_date&&(r+=Math.max(0,80-8*((Date.now()-new Date(e.model.release_date).getTime())/2592e6))),e.model.params_b>=7&&e.model.params_b<=32?r+=40:e.model.params_b>=3&&e.model.params_b<7&&(r+=20),r}function eL({results:e}){let a=(0,r.useMemo)(()=>(function(e){let r=e.filter(e=>"unusable"!==e.level&&e.model.params_b>=3);if(0===r.length)return[];let a=[],s=new Set,n=r.filter(e=>e.model.use_cases.includes("coding")).sort((e,t)=>eG(t)-eG(e));if(n.length>0){let e=n[0];a.push({result:e,label:"Best for Coding",icon:(0,t.jsx)(eP,{className:"h-3.5 w-3.5"})}),s.add(e.model.slug)}let l=r.filter(e=>e.model.use_cases.includes("reasoning")&&!s.has(e.model.slug)).sort((e,t)=>eG(t)-eG(e));if(l.length>0){let e=l[0];a.push({result:e,label:"Best for Reasoning",icon:(0,t.jsx)(eD,{className:"h-3.5 w-3.5"})}),s.add(e.model.slug)}let o=r.filter(e=>!s.has(e.model.slug)).sort((e,t)=>eG(t)-eG(e));if(o.length>0){let e=o[0];a.push({result:e,label:"Best Overall",icon:(0,t.jsx)(eE,{className:"h-3.5 w-3.5"})}),s.add(e.model.slug)}let i=r.filter(e=>!s.has(e.model.slug)).sort((e,t)=>{let r=(e.estimated_tps_min+e.estimated_tps_max)/2;return(t.estimated_tps_min+t.estimated_tps_max)/2-r});if(i.length>0){let e=i[0];a.push({result:e,label:"Fastest on Your GPU",icon:(0,t.jsx)(eF,{className:"h-3.5 w-3.5"})}),s.add(e.model.slug)}return a.slice(0,4)})(e),[e]);return 0===a.length?null:(0,t.jsxs)("div",{className:"mb-8",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eI,{className:"h-4 w-4 text-primary"}),(0,t.jsx)("h3",{className:"text-sm font-semibold",children:"Recommended for Your Hardware"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:a.map(e=>(0,t.jsx)(s.Card,{className:"border-primary/20 bg-primary/[0.03] hover:border-primary/40 transition-colors",children:(0,t.jsxs)(s.CardContent,{className:"p-4 space-y-2.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-primary",children:[e.icon,(0,t.jsx)("span",{className:"text-[11px] font-medium uppercase tracking-wider",children:e.label})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-sm font-semibold leading-snug",children:e.result.model.name}),(0,t.jsx)(eS.ScoreBadge,{level:e.result.level})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{children:[e.result.model.params_b,"B · ",e.result.model.family]}),(0,t.jsxs)("span",{className:"font-mono tabular-nums",children:[e.result.estimated_tps_min.toFixed(0),"-",e.result.estimated_tps_max.toFixed(0)," tok/s"]})]})]})},e.result.model.slug))})]})}let e$=(0,j.default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),ez=[{value:"all",label:"All Models",icon:null,useCases:null},{value:"coding",label:"Coding",icon:(0,t.jsx)(eP,{className:"h-3.5 w-3.5"}),useCases:["coding"]},{value:"reasoning",label:"Reasoning",icon:(0,t.jsx)(eD,{className:"h-3.5 w-3.5"}),useCases:["reasoning","math"]},{value:"vision",label:"Vision",icon:(0,t.jsx)(e$,{className:"h-3.5 w-3.5"}),useCases:["vision"]}],eq=[{value:"all",label:"All",levels:null},{value:"great",label:"Runs Great",levels:["agent-ready"]},{value:"well",label:"Runs Well",levels:["satisfying"]},{value:"can",label:"Can Run",levels:["functional"]},{value:"cannot",label:"Cannot Run",levels:["unusable"]}],eU=[{value:"newest",label:"Newest"},{value:"popular",label:"Most Popular"},{value:"performance",label:"Best Performance"},{value:"name",label:"Name A-Z"},{value:"size",label:"Largest Model"}
5],eH={"agent-ready":4,satisfying:3,functional:2,unusable:1},eV={llama:"flagship",qwen:"flagship",deepseek:"flagship",mistral:"flagship",gemma:"flagship",phi:"flagship","command-r":"popular",yi:"popular",glm:"popular",kimi:"popular",minimax:"popular",codellama:"popular",granite:"popular",ernie:"popular"},eK={flagship:200,popular:100,niche:30},eQ=["nemotron","hermes","dolphin","openhermes","nous","wizardlm","neural-chat","starling","openchat","tulu","orca","vicuna"];function eW(e){let t,r=0,a=e.model.family.toLowerCase();(t=e.model.name.toLowerCase(),eQ.some(e=>t.includes(e)))?r+=eK.niche:r+=eK[eV[a]??"niche"],r+=({llama:50,qwen:45,deepseek:42,mistral:38,gemma:35,phi:30})[a]??0,e.model.release_date&&(r+=Math.max(0,60-8*((Date.now()-new Date(e.model.release_date).getTime())/2592e6)));let s=e.model.params_b;return s>=7&&s<=32?r+=40:s>=3&&s<7?r+=25:s>32&&s<=72&&(r+=20),"agent-ready"===e.level?r+=30:"satisfying"===e.level?r+=20:"functional"===e.level&&(r+=10),r}function eX({label:e,column:r,currentColumn:a,currentDirection:s,onSort:n,className:l}){let o=a===r;return(0,t.jsx)(eC.TableHead,{className:l,children:(0,t.jsxs)("button",{onClick:()=>n(r),className:"flex items-center gap-1 hover:text-foreground transition-colors cursor-pointer select-none",children:[e,o?"asc"===s?(0,t.jsx)(ey.default,{className:"h-3.5 w-3.5"}):(0,t.jsx)(d.ChevronDown,{className:"h-3.5 w-3.5"}):(0,t.jsx)(ev,{className:"h-3 w-3 opacity-40"})]})})}function eY({results:e}){let[s,n]=(0,r.useState)("all"),[l,o]=(0,r.useState)(""),[i,d]=(0,r.useState)("popular"),[c,u]=(0,r.useState)("grid"),[m,p]=(0,r.useState)("all"),[f,h]=(0,r.useState)("performance"),[x,g]=(0,r.useState)("desc"),v=e=>{f===e?g(e=>"asc"===e?"desc":"asc"):(h(e),g("desc"))},b=(0,r.useMemo)(()=>{if("all"===m)return e;let t=ez.find(e=>e.value===m);return t?.useCases?e.filter(e=>e.model.use_cases.some(e=>t.useCases.includes(e))):e},[e,m]),j=(0,r.useMemo)(()=>{if(!l)return b;let e=l.toLowerCase();return b.filter(t=>`${t.model.name} ${t.model.family} ${t.model.provider}`.toLowerCase().includes(e))},[b,l]),y=(0,r.useMemo)(()=>{var e;return e="all"===s?j:j.filter(e=>{let t=eq.find(e=>e.value===s);return t?.levels?.includes(e.level)}),[...e].sort((e,t)=>{switch(i){case"newest":{let r=e.model.release_date,a=t.model.release_date;if(r&&a)return new Date(a).getTime()-new Date(r).getTime();if(r)return -1;if(a)return 1;return(t.estimated_tps_min+t.estimated_tps_max)/2-(e.estimated_tps_min+e.estimated_tps_max)/2}case"popular":return eW(t)-eW(e);case"performance":{let r=(e.estimated_tps_min+e.estimated_tps_max)/2;return(t.estimated_tps_min+t.estimated_tps_max)/2-r}case"name":return e.model.name.localeCompare(t.model.name);case"size":return t.model.params_b-e.model.params_b;default:return 0}})},[j,s,i]),w=(0,r.useMemo)(()=>{var e;let t;return e="all"===s?j:j.filter(e=>{let t=eq.find(e=>e.value===s);return t?.levels?.includes(e.level)}),t="asc"===x?1:-1,[...e].sort((e,r)=>{switch(f){case"name":return t*e.model.name.localeCompare(r.model.name);case"date":return t*((e.model.release_date?new Date(e.model.release_date).getTime():0)-(r.model.release_date?new Date(r.model.release_date).getTime():0));case"performance":return t*((e.estimated_tps_min+e.estimated_tps_max)/2-(r.estimated_tps_min+r.estimated_tps_max)/2);case"quant":return t*e.recommended_quant.localeCompare(r.recommended_quant);case"vram":return t*(e.vram_required_gb-r.vram_required_gb);case"status":return t*(eH[e.level]-eH[r.level]);default:return 0}})},[j,s,f,x]),N=(0,r.useMemo)(()=>({all:j.length,great:j.filter(e=>"agent-ready"===e.level).length,well:j.filter(e=>"satisfying"===e.level).length,can:j.filter(e=>"functional"===e.level).length,cannot:j.filter(e=>"unusable"===e.level).length}),[j]),C=(0,r.useMemo)(()=>({all:e.length,coding:e.filter(e=>e.model.use_cases.some(e=>["coding"].includes(e))).length,reasoning:e.filter(e=>e.model.use_cases.some(e=>["reasoning","math"].includes(e))).length,vision:e.filter(e=>e.model.use_cases.some(e=>["vision"].includes(e))).length}),[e]),_="grid"===c?y:w;return(0,t.jsxs)("div",{children:[!l&&"all"===m&&"all"===s&&(0,t.jsx)(eL,{results:e}),(0,t.jsx)("div",{className:"flex items-center gap-2 mb-4 flex-wrap",children:ez.map(e=>(0,t.jsxs)("button",{onClick:()=>p(e.value),className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-medium transition-colors ${m===e.value?"bg-primary text-primary-foreground":"bg-muted/50 text-muted-foreground hover:bg-muted hover:text-foreground"}`,children:[e.icon,e.label,(0,t.jsx)("span",{className:`ml-0.5 ${m===e.value?"text-primary-foreground
5/70":"text-muted-foreground/60"}`,children:C[e.value]})]},e.value))}),(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,t.jsxs)("div",{className:"relative flex-1",children:[(0,t.jsx)(eg.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,t.jsx)(ew,{placeholder:"Search models...",value:l,onChange:e=>o(e.target.value),className:"pl-9 h-10 bg-muted/30 border-border/50 focus-visible:border-primary/50 focus-visible:ring-primary/20"})]}),"grid"===c&&(0,t.jsxs)(eN.Select,{value:i,onValueChange:e=>d(e),children:[(0,t.jsxs)(eN.SelectTrigger,{size:"sm",className:"h-10 gap-1.5 text-xs text-muted-foreground border-border/50 bg-muted/30",children:[(0,t.jsx)(ev,{className:"h-3.5 w-3.5"}),(0,t.jsx)(eN.SelectValue,{})]}),(0,t.jsx)(eN.SelectContent,{position:"popper",align:"end",children:eU.map(e=>(0,t.jsx)(eN.SelectItem,{value:e.value,className:"text-xs",children:e.label},e.value))})]}),(0,t.jsxs)("div",{className:"flex items-center border border-border/50 rounded-md bg-muted/30 p-0.5",children:[(0,t.jsx)(a.Button,{variant:"grid"===c?"secondary":"ghost",size:"icon-sm",onClick:()=>u("grid"),"aria-label":"Grid view",className:"h-8 w-8",children:(0,t.jsx)(eb,{className:"h-4 w-4"})}),(0,t.jsx)(a.Button,{variant:"list"===c?"secondary":"ghost",size:"icon-sm",onClick:()=>u("list"),"aria-label":"List view",className:"h-8 w-8",children:(0,t.jsx)(ej,{className:"h-4 w-4"})})]})]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mb-3",children:[_.length," model",1!==_.length?"s":"",l&&(0,t.jsxs)("span",{children:[" ","matching ",(0,t.jsxs)("span",{className:"text-foreground/70",children:["â",l,"â"]})]})]}),(0,t.jsxs)(ep.Tabs,{value:s,onValueChange:n,children:[(0,t.jsx)(ep.TabsList,{className:"mb-6 bg-muted/40 p-1",children:eq.map(e=>(0,t.jsxs)(ep.TabsTrigger,{value:e.value,className:"text-xs sm:text-sm data-[state=active]:bg-background data-[state=active]:shadow-sm",children:[e.label,(0,t.jsx)("span",{className:"ml-1.5 text-muted-foreground font-normal",children:N[e.value]})]},e.value))}),eq.map(e=>(0,t.jsx)(ep.TabsContent,{value:e.value,children:0===_.length?(0,t.jsxs)("div",{className:"text-center py-12",children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:"No models in this category for your GPU."}),l&&(0,t.jsx)("button",{onClick:()=>o(""),className:"mt-2 text-xs text-primary hover:underline",children:"Clear search"})]}):"grid"===c?(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:y.map(e=>(0,t.jsx)(eA,{result:e},e.model.slug))}):(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(eC.Table,{children:[(0,t.jsx)(eC.TableHeader,{children:(0,t.jsxs)(eC.TableRow,{children:[(0,t.jsx)(eX,{label:"Model",column:"name",currentColumn:f,currentDirection:x,onSort:v}),(0,t.jsx)(eX,{label:"Date",column:"date",currentColumn:f,currentDirection:x,onSort:v,className:"hidden sm:table-cell"}),(0,t.jsx)(eX,{label:"Performance",column:"performance",currentColumn:f,currentDirection:x,onSort:v}),(0,t.jsx)(eX,{label:"Quant",column:"quant",currentColumn:f,currentDirection:x,onSort:v,className:"hidden md:table-cell"}),(0,t.jsx)(eX,{label:"VRAM",column:"vram",currentColumn:f,currentDirection:x,onSort:v}),(0,t.jsx)(eX,{label:"Status",column:"status",currentColumn:f,currentDirection:x,onSort:v})]})}),(0,t.jsx)(eC.TableBody,{children:w.map((e,r)=>{var a;let s;return(0,t.jsxs)(eC.TableRow,{className:`${r%2==1?"bg-muted/20":""} ${!e.fits_in_vram?"opacity-60":""}`,children:[(0,t.jsx)(eC.TableCell,{className:"font-medium",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-sm",children:e.model.name}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground ml-2",children:[e.model.params_b,"B"]})]})}),(0,t.jsx)(eC.TableCell,{className:"text-xs text-muted-foreground hidden sm:table-cell",children:e.model.release_date?isNaN((s=new Date(e.model.release_date)).getTime())?"":s.toLocaleDateString("en-US",{month:"short",year:"numeric"}):"-"}),(0,t.jsx)(eC.TableCell,{children:(0,t.jsxs)(e_.Tooltip,{children:[(0,t.jsx)(e_.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("span",{className:"cursor-default",children:[(0,t.jsxs)("span",{className:"font-mono text-sm tabular-nums",children:[e.estimated_tps_min.toFixed(0),"-",e.estimated_tps_max.toFixed(0)]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground ml-1",children:"tok/s"})]})}),(0,t.jsx)(e_.TooltipContent,{children:(0,t.jsx)("p",{className:"text-xs italic",children:(a=(e.estimated_tps_min+e.estimated_tps_max)/2)<5?"Very slow -- text appears word by word, not practical for conversation":a<15?"Usable -- like a thoughtful response, noticeable delay between words":a<30?"Smooth -- feels like a natural conversation, similar to ChatGPT":a<60?"Fast -- instant responses, great for coding and chat":"Lightning fast -- agent-ready, can handle complex multi-step tasks"})})]})}),(0,t.jsx)(eC.TableCell,{className:"text-xs hidden md:table-cell",children:(0,t.jsx)(eT,{quant:e.recommended_quant})}),(0,t.jsxs)(eC.TableCell,{className:"font-mono text-xs tabular-nums",children:[e.vram_required_gb.toFixed(1),"/",e.vram_available_gb.toFixed(0)," GB"]}),(0,t.jsx)(eC.TableCell,{children:(0,t.jsx)(eS.ScoreBadge,{level:e.level})})]},e.model.slug)})})]})})},e.value))]})]})}let eJ={entry:"stroke-score-unusable",capable:"stroke-score-functional",powerful:"stroke-score-satisfying",elite:"stroke-score-agent-ready"},eZ={entry:"Entry Level",capable:"AI Capable",powerful:"AI Powerful",elite:"AI Elite"},e0={entry:"Score 0-39. Basic hardware that can run only small quantized models with limited speed.",capable:"Score 40-64. Can handle mid-size models (7-13B) at reasonable speeds for personal use.",powerful:"Score 65-84. Runs large models (30B+) comfortably. Great for development and experimentation.",elite:"Score 85-100. Top-tier hardware capable of running the largest open models and autonomous agents."};function e1({score:e}){let[a,s]=(0,r.useState)(0),n=2*Math.PI*80;return(0,r.useEffect)(()=>{let t=setTimeout(()=>s(e.total),100);return()=>clearTimeout(t)},[e.total]),(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)("svg",{width:"200",height:"200",viewBox:"0 0 200 200",className:"-rotate-90",children:[(0,t.jsx)("circle",{cx:"100",cy:"100",r:80,fill:"none",stroke:"currentColor",strokeWidth:"12",className:"text-muted/30"}),(0,t.jsx)("circle",{cx:"100",cy:"100",r:80,fill:"none",strokeWidth:"12",strokeLinecap:"round",className:`${eJ[e.tier]} transition-all duration-1000 ease-out`,strokeDasharray:n,strokeDashoffset:n-a/100*n})]}),(0,t.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[(0,t.jsx)("span",{className:"text-4xl font-bold tabular-nums",children:a}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"/ 100"})]})]}),(0,t.jsxs)("p",{className:"text-sm font-medium inline-flex items-center gap-1",children:[eZ[e.tier],(0,t.jsxs)(e_.Tooltip,{children:[(0,t.jsx)(e_.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:"inline-flex items-center text-muted-foreground
5/60 hover:text-muted-foreground transition-colors","aria-label":`Info about ${eZ[e.tier]} tier`,children:(0,t.jsx)(ek,{className:"size-3.5"})})}),(0,t.jsx)(e_.TooltipContent,{side:"bottom",sideOffset:4,className:"max-w-[250px] text-xs leading-relaxed",children:e0[e.tier]})]})]})]})}var e2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,a)=>{let s=(0,P.createSlot)(`Primitive.${a}`),n=r.forwardRef((e,r)=>{let{asChild:n,...l}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(n?s:a,{...l,ref:r})});return n.displayName=`Primitive.${a}`,{...e,[a]:n}},{}),e4="Progress",[e5,e3]=(0,R.createContextScope)(e4),[e6,e8]=e5(e4),e7=r.forwardRef((e,r)=>{var a,s;let{__scopeProgress:n,value:l=null,max:o,getValueLabel:i=tt,...d}=e;(o||0===o)&&!ts(o)&&console.error((a=`${o}`,`Invalid prop \`max\` of value \`${a}\` supplied to \`Progress\`. Only numbers greater than 0 are valid max values. Defaulting to \`100\`.`));let c=ts(o)?o:100;null===l||tn(l,c)||console.error((s=`${l}`,`Invalid prop \`value\` of value \`${s}\` supplied to \`Progress\`. The \`value\` prop must be: 6 - a positive number 7 - less than the value passed to \`max\` (or 100 if no \`max\` prop is set) 8 - \`null\` or \`undefined\` if the progress is indeterminate. 9 10Defaulting to \`null\`.`));let u=tn(l,c)?l:null,m=ta(u)?i(u,c):void 0;return(0,t.jsx)(e6,{scope:n,value:u,max:c,children:(0,t.jsx)(e2.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":ta(u)?u:void 0,"aria-valuetext":m,role:"progressbar","data-state":tr(u,c),"data-value":u??void 0,"data-max":c,...d,ref:r})})});e7.displayName=e4;var e9="ProgressIndicator",te=r.forwardRef((e,r)=>{let{__scopeProgress:a,...s}=e,n=e8(e9,a);return(0,t.jsx)(e2.div,{"data-state":tr(n.value,n.max),"data-value":n.value??void 0,"data-max":n.max,...s,ref:r})});function tt(e,t){return`${Math.round(e/t*100)}%`}function tr(e,t){return null==e?"indeterminate":e===t?"complete":"loading"}function ta(e){return"number"==typeof e}function ts(e){return ta(e)&&!isNaN(e)&&e>0}function tn(e,t){return ta(e)&&!isNaN(e)&&e<=t&&e>=0}te.displayName=e9,e.s(["Indicator",()=>te,"Progress",()=>e7,"ProgressIndicator",()=>te,"Root",()=>e7,"createProgressScope",()=>e3],76027);var tl=e.i(76027),tl=tl;function to({className:e,value:r,...a}){return(0,t.jsx)(tl.Root,{"data-slot":"progress",className:(0,l.cn)("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",e),...a,children:(0,t.jsx)(tl.Indicator,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(r||0)}%)`}})})}let ti={bandwidth:35,vram:30,compute:15,ecosystem:10,thermal:5,ram:5},td={bandwidth:"Memory Bandwidth",vram:"VRAM Capacity",compute:"Compute Power",ecosystem:"Software Ecosystem",thermal:"Thermal Design",ram:"System RAM"},tc={bandwidth:"How fast your GPU can read/write data. Higher bandwidth = faster token generation. Measured in GB/s.",vram:"Total GPU memory available for loading AI models. More VRAM = larger models you can run.",compute:"Raw processing power (TFLOPS). Affects prompt processing speed and batch operations.",ecosystem:"Compatibility with AI frameworks (CUDA, Metal, ROCm, Vulkan). Better ecosystem = more software support.",thermal:"Power efficiency and thermal headroom. Lower TDP chips can sustain peak performance longer.",ram:"Total system memory. Important for unified memory architectures (Apple Silicon) where RAM = VRAM."};function tu({breakdown:e}){let r=Object.entries(e);return(0,t.jsx)("div",{className:"space-y-3 w-full max-w-md",children:r.map(([e,r])=>{let a=ti[e],s=r/a*100;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs mb-1",children:[(0,t.jsxs)("span",{className:"text-muted-foreground inline-flex items-center gap-1",children:[td[e],(0,t.jsxs)(e_.Tooltip,{children:[(0,t.jsx)(e_.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:"inline-flex items-center text-muted-foreground/60 hover:text-muted-foreground transition-colors","aria-label":`Info about ${td[e]}`,children:(0,t.jsx)(ek,{className:"size-3.5"})})}),(0,t.jsx)(e_.TooltipContent,{side:"top",sideOffset:4,className:"max-w-[250px] text-xs leading-relaxed",children:tc[e]})]})]}),(0,t.jsxs)("span",{className:"font-mono",children:[r.toFixed(1)," / ",a]})]}),(0,t.jsx)(to,{value:s,className:"h-1.5"})]},e)})})}var tm=e.i(20480),tp=e.i(78917);function tf({gpu:e}){let r=(0,tm.getAffiliateLinks)(e);return 0===r.length?null:(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:r.map(e=>(0,t.jsx)(a.Button,{variant:"outline",size:"sm",asChild:!0,children:(0,t.jsxs)("a",{href:e.url,rel:tm.AFFILIATE_REL,target:tm.AFFILIATE_TARGET,className:"gap-2",children:[e.label,(0,t.jsx)(tp.ExternalLink,{className:"h-3 w-3"})]})},e.provider))})}var th=e.i(31278);let tx="canirunthisllm-hardware";function tg(e){try{let t={...e,timestamp:Date.now()};localStorage.setItem(tx,JSON.stringify(t))}catch{}}function tv(e,t){let r=e.replace(/Apple\s+/i,"").toLowerCase().replace(/\s+/g,"-");return`${r}-${t}gb`}
10let tb={m1:[8,16],"m1-pro":[16,32],"m1-max":[32,64],"m1-ultra":[64,128],m2:[8,16,24],"m2-pro":[16,32],"m2-max":[32,64,96],"m2-ultra":[64,128,192],m3:[8,16,24],"m3-pro":[18,36],"m3-max":[36,48,64,128],m4:[16,24,32],"m4-pro":[24,48],"m4-max":[36,64,128],"m4-ultra":[128,192,256]};function tj(e){return e.replace(/Apple\s+/i,"").toLowerCase().replace(/\s+/g,"-")}function ty(e){return tb[tj(e)]??null}function tw({gpus:e}){let[o,i]=(0,r.useState)(null),[d,c]=(0,r.useState)(16),[u,p]=(0,r.useState)(!1),[f,h]=(0,r.useState)(null),[x,g]=(0,r.useState)(null),[v,b]=(0,r.useState)(!1),[j,y]=(0,r.useState)(null),[w,C]=(0,r.useState)(null),[_,S]=(0,r.useState)(null),R=e.find(e=>e.slug===o);(0,r.useEffect)(()=>{let t=function(){try{let e=localStorage.getItem(tx);if(!e)return null;let t=JSON.parse(e);if((Date.now()-t.timestamp)/864e5>30)return localStorage.removeItem(tx),null;return t}catch{return null}}();if(t){let r=e.find(e=>e.slug===t.gpuSlug);if(r&&(i(t.gpuSlug),c(t.ramGb),"apple"===r.vendor&&r.is_unified_memory)){b(!0),y(t.chipName),S(t.ramGb);let e=ty(t.chipName);e&&C(e)}}},[e]);let k=(0,r.useCallback)(t=>{if(S(t),c(t),j){let r=tv(j,t),a=e.find(e=>e.slug===r);if(a)i(a.slug),tg({gpuSlug:a.slug,ramGb:t,chipName:j});else{let r=tj(j),a=e.find(e=>e.slug.startsWith(r)&&e.vram_gb===t);a&&(i(a.slug),tg({gpuSlug:a.slug,ramGb:t,chipName:j}))}}},[j,e]);async function M(){if(o){p(!0),g(null);try{let e=await fetch("/api/calculate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gpu_slug:o,ram_gb:d})});if(!e.ok)throw Error(`API error: ${e.status}`);let t=await e.json();h(t)}catch(e){g(e instanceof Error?e.message:"Something went wrong")}finally{p(!1)}}}let T=v&&w&&w.length>0,A=!v&&R?.is_unified_memory&&!T;return(0,t.jsxs)("div",{className:"space-y-8",children:[(0,t.jsxs)(s.Card,{children:[(0,t.jsxs)(s.CardHeader,{children:[(0,t.jsx)(s.CardTitle,{children:"Check Your Hardware"}),(0,t.jsx)(s.CardDescription,{children:"Select your GPU and system RAM to see which LLMs you can run locally."})]}),(0,t.jsxs)(s.CardContent,{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:"GPU"}),(0,t.jsx)(m,{gpus:e,value:o,onSelect:t=>{i(t);let r=e.find(e=>e.slug===t);r&&"apple"!==r.vendor&&(b(!1),y(null),C(null),S(null))}}),(0,t.jsx)(N,{onDetected:function(t){let r="apple"===t.vendor;if(b(r),r){y(t.model);let r=t.possibleRamOptions??ty(t.model);C(r);let a=t.suggestedRam&&r?.includes(t.suggestedRam)?t.suggestedRam:r&&1===r.length?r[0]:null;if(a){S(a),c(a);let r=tv(t.model,a),s=e.find(e=>e.slug===r);if(s)i(s.slug),tg({gpuSlug:s.slug,ramGb:a,chipName:t.model});else{let r=tj(t.model),s=e.find(e=>e.slug.startsWith(r)&&e.vram_gb===a);s&&(i(s.slug),tg({gpuSlug:s.slug,ramGb:a,chipName:t.model}))}}}else{y(null),C(null),S(null);let r=e.find(e=>`${e.brand} ${e.model}`.toLowerCase().includes(t.model.toLowerCase()));r&&i(r.slug)}}})]}),T&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:"How much RAM does your Mac have?"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"On Apple Silicon, system RAM = GPU memory (unified architecture)"}),(0,t.jsx)("div",{className:"flex gap-2 flex-wrap",children:w.map(e=>(0,t.jsxs)("button",{onClick:()=>k(e),className:(0,l.cn)("px-4 py-2.5 rounded-lg border text-sm font-medium transition-colors",_===e?"border-primary bg-primary/10 text-primary":"border-border hover:border-primary/50"),children:[e,"GB"]},e))})]}),v&&(0,t.jsx)(ex,{onParsed:function(t,r){b(!0),y(t);let a=ty(t);a?C(a):C([r]),S(r),c(r);let s=tv(t,r),n=e.find(e=>e.slug===s);if(n)i(n.slug),tg({gpuSlug:n.slug,ramGb:r,chipName:t});else{let a=tj(t),s=e.find(e=>e.slug.startsWith(a)&&e.vram_gb===r);s&&(i(s.slug),tg({gpuSlug:s.slug,ramGb:r,chipName:t}))}}}),A&&(0,t.jsx)(eu,{value:d,onChange:c}),!R?.is_unified_memory&&o&&!v&&(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Discrete GPU with ",R?.vram_gb,"GB VRAM detected. System RAM is secondary."]}),(0,t.jsx)(a.Button,{onClick:M,disabled:!o||u,className:"w-full h-12 text-base",size:"lg",children:u?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(th.Loader2,{className:"mr-2 h-5 w-5 animate-spin"}),"Calculating..."]}):"Check Compatibility"}),x&&(0,t.jsx)("p",{className:"text-sm text-destructive text-center",children:x})]})]}),f&&(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{className:"flex flex-col lg:flex-row gap-8 items-start",children:[(0,t.jsxs)("div",{className:"flex-1 w-full",children:[(0,t.jsxs)("h2",{className:"text-2xl font-bold mb-2",children:[f.gpu.brand," ",f.gpu.model," â LLM Compatibility"]}),(0,t.jsxs)("p",{className:"text-muted-foreground mb-6",children:[f.results.length," models tested against ",f.gpu.vram_gb,"GB VRAM"]}),(0,t.jsx)(eY,{results:f.results})]}),(0,t.jsxs)("div",{className:"lg:sticky lg:top-24 w-full lg:w-80 space-y-6",children:[(0,t.jsxs)(s.Card,{children:[(0,t.jsx)(s.CardHeader,{children:(0,t.jsx)(s.CardTitle,{className:"text-center",children:"AI-Ready Score"})}),(0,t.jsxs)(s.CardContent,{className:"flex flex-col items-center gap-6",children:[(0,t.jsx)(e1,{score:f.ai_ready_score}),(0,t.jsx)(n.Separator,{}),(0,t.jsx)(tu,{breakdown:f.ai_ready_score.breakdown})]})]}),(0,t.jsxs)(s.Card,{children:[(0,t.jsx)(s.CardHeader,{children:(0,t.jsx)(s.CardTitle,{className:"text-sm",children:"Get This GPU"})}),(0,t.jsx)(s.CardContent,{children:(0,t.jsx)(tf,{gpu:f.gpu})})]})]})]})})]})}e.s(["HardwareForm",()=>tw],63320)},51445,e=>{"use strict";
10let t=(0,e.i(75254).default)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);e.s(["Monitor",()=>t],51445)},46575,e=>{"use strict";var t=e.i(43476),r=e.i(71645),a=e.i(19455),s=e.i(15288),n=e.i(87486),l=e.i(72436),o=e.i(31278),i=e.i(51445),d=e.i(17056),c=e.i(37822),u=e.i(64659),m=e.i(43531);function p({models:e,value:s,onSelect:n}){let[l,o]=(0,r.useState)(!1),i=e.find(e=>e.slug===s),p=e.reduce((e,t)=>{let r=t.family;return e[r]||(e[r]=[]),e[r].push(t),e},{}),f=Object.keys(p).sort();return(0,t.jsxs)(c.Popover,{open:l,onOpenChange:o,children:[(0,t.jsx)(c.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)(a.Button,{variant:"outline",role:"combobox","aria-expanded":l,className:"w-full justify-between h-12 text-left",children:[i?(0,t.jsxs)("span",{className:"truncate",children:[i.name,(0,t.jsxs)("span",{className:"text-muted-foreground ml-2",children:["(",i.params_b,"B)"]})]}):(0,t.jsx)("span",{className:"text-muted-foreground",children:"Search for a model..."}),(0,t.jsx)(u.ChevronDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(c.PopoverContent,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:(0,t.jsxs)(d.Command,{children:[(0,t.jsx)(d.CommandInput,{placeholder:"Search models..."}),(0,t.jsxs)(d.CommandList,{children:[(0,t.jsx)(d.CommandEmpty,{children:"No model found."}),f.map(e=>(0,t.jsx)(d.CommandGroup,{heading:e,children:p[e].map(e=>(0,t.jsxs)(d.CommandItem,{value:`${e.name} ${e.family} ${e.provider}`,onSelect:()=>{n(e.slug),o(!1)},children:[(0,t.jsx)(m.Check,{className:`mr-2 h-4 w-4 ${s===e.slug?"opacity-100":"opacity-0"}`}),(0,t.jsx)("span",{children:e.name}),(0,t.jsxs)("span",{className:"ml-auto text-xs text-muted-foreground",children:[e.params_b,"B"]})]},e.slug))},e))]})]})})]})}var f=e.i(84774);function h({vramByQuant:e,userVramGb:r}){return(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(f.Table,{children:[(0,t.jsx)(f.TableHeader,{children:(0,t.jsxs)(f.TableRow,{children:[(0,t.jsx)(f.TableHead,{children:"Quantization"}),(0,t.jsx)(f.TableHead,{className:"text-right",children:"Model"}),(0,t.jsx)(f.TableHead,{className:"text-right",children:"KV Cache"}),(0,t.jsx)(f.TableHead,{className:"text-right",children:"Total VRAM"}),void 0!==r&&(0,t.jsx)(f.TableHead,{className:"text-right",children:"Fits?"})]})}),(0,t.jsx)(f.TableBody,{children:e.map(e=>{let a=void 0!==r?e.total_gb<=r:null;return(0,t.jsxs)(f.TableRow,{className:!1===a?"opacity-50":"",children:[(0,t.jsx)(f.TableCell,{className:"font-mono text-sm font-medium",children:e.quantization}),(0,t.jsxs)(f.TableCell,{className:"text-right font-mono text-sm tabular-nums",children:[e.model_vram_gb.toFixed(1)," GB"]}),(0,t.jsxs)(f.TableCell,{className:"text-right font-mono text-sm tabular-nums",children:[e.kv_cache_gb.toFixed(1)," GB"]}),(0,t.jsxs)(f.TableCell,{className:"text-right font-mono text-sm tabular-nums font-medium",children:[e.total_gb.toFixed(1)," GB"]}),void 0!==r&&(0,t.jsx)(f.TableCell,{className:"text-right",children:a?(0,t.jsx)(n.Badge,{variant:"outline",className:"bg-score-satisfying/20 text-score-satisfying border-score-satisfying/30",children:"Yes"}):(0,t.jsx)(n.Badge,{variant:"outline",className:"bg-score-unusable/20 text-score-unusable border-score-unusable/30",children:"No"})})]},e.quantization)})})]})})}var x=e.i(78917),g=e.i(23392),v=e.i(20480);function b({recommendations:e,minGpu:r}){return 0===e.length?(0,t.jsx)("div",{className:"text-center py-8",children:(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"No GPU in our database can run this model locally. Consider a cloud GPU or waiting for hardware with more VRAM."})}):(0,t.jsxs)("div",{className:"space-y-4",children:[r&&(0,t.jsxs)("div",{className:"text-sm text-muted-foreground mb-2",children:["Minimum GPU:"," ",(0,t.jsxs)("span",{className:"text-foreground font-medium",children:[r.gpu.brand," ",r.gpu.model]})," ","(",r.gpu.vram_gb,"GB VRAM",r.gpu.msrp_usd?`, ~$${r.gpu.msrp_usd}`:"",")"]}
10),(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground/70 leading-relaxed",children:"Performance depends on memory bandwidth, not just VRAM size. A data center GPU with less VRAM can outperform a larger consumer GPU because it transfers data faster."}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-3",children:e.slice(0,5).map(e=>{let r=(0,v.getAffiliateLinks)(e.gpu);return(0,t.jsx)(s.Card,{className:"transition-all hover:border-primary/30",children:(0,t.jsx)(s.CardContent,{className:"py-4",children:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsxs)("span",{className:"font-medium text-sm truncate",children:[e.gpu.brand," ",e.gpu.model]}),(0,t.jsxs)(n.Badge,{variant:"outline",className:"text-xs flex-shrink-0",children:[e.gpu.vram_gb,"GB"]}),(0,t.jsx)(g.ScoreBadge,{level:e.level})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 mt-1.5 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"font-mono tabular-nums",children:[e.estimated_tps_min.toFixed(0),"-",e.estimated_tps_max.toFixed(0)," tok/s"]}),(0,t.jsx)("span",{className:"font-mono",children:e.best_quant}),e.gpu.memory_bandwidth_gbs&&(0,t.jsxs)("span",{className:"font-mono",children:[e.gpu.memory_bandwidth_gbs," GB/s"]}),e.gpu.msrp_usd&&(0,t.jsxs)("span",{children:["~$",e.gpu.msrp_usd]})]})]}),r.length>0&&(0,t.jsx)("div",{className:"flex gap-1.5 flex-shrink-0",children:r.slice(0,2).map(e=>(0,t.jsx)(a.Button,{variant:"outline",size:"sm",asChild:!0,className:"h-7 text-xs px-2",children:(0,t.jsxs)("a",{href:e.url,rel:v.AFFILIATE_REL,target:v.AFFILIATE_TARGET,children:["amazon"===e.provider?"Amazon":"bhphoto"===e.provider?"B&H":"Cloud",(0,t.jsx)(x.Exter
10nalLink,{className:"ml-1 h-3 w-3"})]})},e.provider))})]})})},e.gpu.slug)})})]})}var j=e.i(74389);function y({result:e,gpu:r,suggestions:a}){let n=e.fits_in_vram&&"unusable"!==e.level;return(0,t.jsxs)(s.Card,{className:n?"border-score-satisfying/40":"border-score-unusable/40",children:[(0,t.jsxs)(s.CardHeader,{className:"pb-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)(s.CardTitle,{className:"text-base",children:n?"Yes, you can run it!":"Not quite yet"}),(0,t.jsx)(g.ScoreBadge,{level:e.level})]}),(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:["On your"," ",(0,t.jsxs)("span",{className:"text-foreground font-medium",children:[r.brand," ",r.model]})," ","(",e.vram_available_gb.toFixed(0),"GB available)"]})]}),(0,t.jsxs)(s.CardContent,{className:"space-y-4",children:[n&&(0,t.jsx)(j.PerformanceBar,{min:e.estimated_tps_min,max:e.estimated_tps_max}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-xs",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Best Quantization"}),(0,t.jsx)("p",{className:"font-mono font-medium",children:e.recommended_quant})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"VRAM Required"}),(0,t.jsxs)("p",{className:"font-mono font-medium",children:[e.vram_required_gb.toFixed(1)," / ",e.vram_available_gb.toFixed(0)," GB"]})]})]}),!e.fits_in_vram&&(0,t.jsxs)("div",{className:"rounded-lg bg-score-unusable/10 border border-score-unusable/20 p-3",children:[(0,t.jsxs)("p",{className:"text-sm font-medium text-score-unusable mb-1",children:["Needs ",(e.vram_required_gb-e.vram_available_gb).toFixed(1),"GB more VRAM"]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Even at ",e.recommended_quant,", this model requires"," ",e.vram_required_gb.toFixed(1),"GB but you only have"," ",e.vram_available_gb.toFixed(0),"GB available."]})]}),a.length>0&&(0,t.jsx)("div",{className:"space-y-2 border-t border-border/40 pt-3",children:a.map((e,r)=>(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e},r))}),e.notes.length>0&&(0,t.jsx)("div",{className:"space-y-1 border-t border-border/40 pt-3",children:e.notes.map((e,r)=>(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e},r))})]})]})}let w="canirunthisllm-hardware";function N({models:e,gpus:d}){let[c,u]=(0,r.useState)(null),[m,f]=(0,r.useState)(null),[x,g]=(0,r.useState)(null),[v,j]=(0,r.useState)(null),[N,C]=(0,r.useState)(null);e.find(e=>e.slug===c),(0,r.useEffect)(()=>{let e=function(){try{let e=localStorage.getItem(w);if(!e)return null;let t=JSON.parse(e);if((Date.now()-t.timestamp)/864e5>30)return localStorage.removeItem(w),null;return t}catch{return null}}();e&&d.find(t=>t.slug===e.gpuSlug)&&C(e)},[d]);let _=(0,r.useCallback)(async e=>{if(c){f(e?"hardware":"requirements"),j(null);try{let t={model_slug:c};e&&N&&(t.gpu_slug=N.gpuSlug,t.ram_gb=N.ramGb);let r=await fetch("/api/model-check",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!r.ok)throw Error(`API error: ${r.status}`);let a=await r.json();g(a)}catch(e){j(e instanceof Error?e.message:"Something went wrong")}finally{f(null)}}},[c,N]),S=(0,r.useCallback)(e=>{u(e),g(null),j(null)},[]),R=N?d.find(e=>e.slug===N.gpuSlug):null;return(0,t.jsxs)("div",{className:"space-y-8",children:[(0,t.jsxs)(s.Card,{children:[(0,t.jsxs)(s.CardHeader,{children:[(0,t.jsx)(s.CardTitle,{children:"Can I Run This Model?"}),(0,t.jsx)(s.CardDescription,{children:"Search for an AI model to see its VRAM requirements, compatible GPUs, and whether your hardware can handle it."})]}),(0,t.jsxs)(s.CardContent,{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:"Model"}),(0,t.jsx)(p,{models:e,value:c,onSelect:S})]}),R&&(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground bg-muted/30 rounded-lg px-3 py-2",children:[(0,t.jsx)(i.Monitor,{className:"h-4 w-4 flex-shrink-0"}),(0,t.jsxs)("span",{children:["Detected hardware:"," ",(0,t.jsxs)("span",{className:"text-foreground font-medium",children:[R.brand," ",R.model]})," ","(",N.ramGb,"GB)"]})]}),(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)(a.Button,{onClick:()=>_(!1),disabled:!c||null!==m,className:"flex-1 h-12 text-base",size:"lg",variant:R?"outline":"default",children:"requirements"===m?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Loader2,{className:"mr-2 h-5 w-5 animate-spin"}),"Checking..."]}):"Show Requirements"}),R&&(0,t.jsx)(a.Button,{onClick:()=>_(!0),disabled:!c||null!==m,className:"flex-1 h-12 text-base",size:"lg",children:"hardware"===m?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Loader2,{className:"mr-2 h-5 w-5 animate-spin"}),"Checking..."]}):"Check My Hardware"})]}),v&&(0,t.jsx)("p",{className:"text-sm text-destructive text-center",children:v})]})]}),x&&(0,t.jsxs)("div",{className:"space-y-8",children:[(0,t.jsxs)(s.Card,{children:[(0,t.jsxs)(s.CardHeader,{children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,t.jsx)(s.CardTitle,{className:"text-xl",children:x.model.name}),(0,t.jsxs)(n.Badge,{variant:"outline",className:"flex-shrink-0",children:[x.model.params_b,"B params"]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground flex-wrap",children:[(0,t.jsx)("span",{children:x.model.family}),(0,t.jsx)("span",{children:"·"}),(0,t.jsx)("span",{children:x.model.provider}),(0,t.jsx)("span",{children:"·"}),(0,t.jsx)("span",{children:"moe"===x.model.architecture_type?`MoE (${x.model.active_experts}/${x.model.num_experts} experts)`:"Dense"}),x.model.release_date&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),(0,t.jsx)("span",{children:new Date(x.model.release_date).toLocaleDateString("en-US",{month:"short",year:"numeric"})})]})]}),x.model.use_cases.length>0&&(0,t.jsx)("div",{className:"flex gap-1.5 flex-wrap mt-2",children:x.model.use_cases.map(e=>(0,t.jsx)(n.Badge,{variant:"secondary",className:"text-xs",children:e},e))})]}),(0,t.jsx)(s.CardContent,{children:(0,t.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4 text-center",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Parameters"}),(0,t.jsxs)("p",{className:"text-lg font-bold font-mono tabular-nums",children:[x.model.params_b,"B"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Context"}),(0,t.jsxs)("p",{className:"text-lg font-bold font-mono tabular-nums",children:[(x.model.max_context_length/1024).toFixed(0),"K"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Min VRAM (Q4)"}),(0,t.jsx)("p",{className:"text-lg font-bold font-mono tabular-nums",children:x.vram_by_quant.length>0?`${x.vram_by_quant[0].total_gb.toFixed(1)}GB`:"N/A"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Compatible GPUs"}),(0,t.jsx)("p",{className:"text-lg font-bold font-mono tabular-nums",children:x.compatible_gpus.length})]})]})})]}),x.user_result&&x.user_gpu&&(0,t.jsx)(y,{result:x.user_result,gpu:x.user_gpu,suggestions:x.suggestions}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-lg font-semibold mb-3",children:"VRAM Requirements by Quantization"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mb-4",children:"Lower quantization = less VRAM needed but slightly lower quality. Q4_K_M is the sweet spot for most users."}),(0,t.jsx)(h,{vramByQuant:x.vram_by_quant,userVramGb:x.user_result?x.user_result.vram_available_gb:void 0})]}),(0,t.jsx)(l.Separator,{}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"text-lg font-semibold mb-3",children:["GPUs That Can Run ",x.model.name]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mb-4",children:"Sorted by best performance. Showing GPUs that can run this model at any quantization level."}),(0,t.jsx)(b,{recommendations:x.compatible_gpus,minGpu:x.min_gpu})]})]})]})}e.s(["ModelSearch",()=>N],46575)},64837,e=>{"use strict";var t=e.i(43476),r=e.i(37869),a=e.i(71645),s=e.i(15288),n=e.i(64659),l=e.i(75157),o=e.i(87486),i=e.i(19455),d=e.i(78917),c=e.i(23392),u=e.i(78414);
10function m({results:e,maxItems:r=5}){let a=(0,u.selectTopModelsForMac)(e,r);return 0===a.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"No models can run comfortably on this config."}):(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Top Models"}),(0,t.jsx)("ul",{className:"space-y-1.5",children:a.map(e=>(0,t.jsxs)("li",{className:"flex items-center justify-between gap-2 text-sm",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,t.jsx)("span",{className:"truncate",children:e.model.name}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:[e.model.params_b,"B"]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,t.jsxs)("span",{className:"text-xs font-mono tabular-nums text-muted-foreground",children:[e.estimated_tps_min.toFixed(0),"-",e.estimated_tps_max.toFixed(0)," tok/s"]}),(0,t.jsx)(c.ScoreBadge,{level:e.level})]})]},e.model.slug))})]})}function p({config:e,results:a,aiReadyScore:s,onSelect:c,loading:u,expanded:p}){let f=a?a.filter(e=>"unusable"!==e.level).length:null,h=a?a.filter(e=>"agent-ready"===e.level).length:null;return(0,t.jsxs)("div",{className:"rounded-lg border border-border/50 bg-muted/20 overflow-hidden",children:[(0,t.jsxs)("button",{onClick:c,disabled:u,className:"w-full text-left p-4 cursor-pointer hover:bg-muted/30 transition-colors",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsx)("h4",{className:"font-semibold text-sm",children:e.chip}),(0,t.jsxs)(o.Badge,{variant:"outline",className:"text-xs",children:[e.ramGb,"GB"]}),e.bestValue&&(0,t.jsx)(o.Badge,{className:"bg-primary/20 text-primary border-primary/30 text-xs",children:"Best Value"}),e.bestPerformance&&(0,t.jsx)(o.Badge,{className:"bg-score-agent-ready/20 text-score-agent-ready border-score-agent-ready/30 text-xs",children:"Best Performance"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:e.tagline})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("p",{className:"text-sm font-bold",children:(0,r.formatPrice)(e.priceUsd)}),s&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Score: ",(0,t.jsx)("span",{className:"text-foreground font-medium",children:s.total}),"/100"]})]}),(0,t.jsx)(n.ChevronDown,{className:(0,l.cn)("h-4 w-4 text-muted-foreground transition-transform",p&&"rotate-180",u&&"animate-pulse")})]})]}),null!==f&&(0,t.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground mt-2",children:[(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"text-foreground font-medium",children:f})," models runnable"]}),null!==h&&h>0&&(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"text-score-agent-ready font-medium",children:h})," agent-ready"]})]}),!a&&!u&&(0,t.jsx)("p",{className:"text-xs text-primary mt-2",children:"Click to see compatible models"}),u&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Loading..."})]}),p&&a&&(0,t.jsxs)("div",{className:"px-4 pb-4 border-t border-border/30 pt-3 space-y-3",children:[(0,t.jsx)(m,{results:a}),(0,t.jsx)("div",{className:"flex gap-2",children:(0,t.jsx)(i.Button,{asChild:!0,variant:"outline",size:"sm",className:"flex-1",children:(0,t.jsxs)("a",{href:e.appleUrl,target:"_blank",rel:"noopener noreferrer",children:["Buy on Apple",(0,t.jsx)(d.ExternalLink,{className:"ml-1.5 h-3 w-3"})]})})})]})]})}function f({productLine:e,configs:r}){let[o,i]=(0,a.useState)(!1),[d,c]=(0,a.useState)({}),[u,m]=(0,a.useState)(new Set),[f,h]=(0,a.useState)(null),x=(0,a.useCallback)(async e=>{if(d[e.id])return void h(t=>t===e.id?null:e.id);m(t=>new Set(t).add(e.id));try{let t=await fetch("/api/calculate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gpu_slug:e.gpuSlug,ram_gb:e.ramGb})});if(!t.ok)throw Error("API error");let r=await t.json();c(t=>
10({...t,[e.id]:{results:r.results,aiReadyScore:r.ai_ready_score}})),h(e.id)}catch{}finally{m(t=>{let r=new Set(t);return r.delete(e.id),r})}},[d]);return(0,t.jsxs)(s.Card,{className:"overflow-hidden",children:[(0,t.jsx)("button",{onClick:()=>i(e=>!e),className:"w-full text-left cursor-pointer",children:(0,t.jsx)(s.CardContent,{className:"p-0",children:(0,t.jsxs)("div",{className:"flex items-center gap-4 p-4 sm:p-6",children:[(0,t.jsx)("div",{className:"relative w-20 h-20 sm:w-24 sm:h-24 flex-shrink-0 rounded-lg bg-muted/30 overflow-hidden",children:(0,t.jsx)("img",{src:e.imagePath,alt:e.name,className:"w-full h-full object-contain p-2"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("h3",{className:"text-lg font-bold",children:e.name}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-2",children:e.description}),(0,t.jsxs)("div",{className:"flex items-center gap-3 mt-2 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{className:"font-medium text-foreground",children:e.priceRange}),(0,t.jsx)("span",{children:e.chipRange})]})]}),(0,t.jsx)(n.ChevronDown,{className:(0,l.cn)("h-5 w-5 text-muted-foreground transition-transform flex-shrink-0",o&&"rotate-180")})]})})}),o&&(0,t.jsx)("div",{className:"px-4 pb-4 sm:px-6 sm:pb-6 space-y-3 border-t border-border/30 pt-4",children:r.map(e=>(0,t.jsx)(p,{config:e,results:d[e.id]?.results??null,aiReadyScore:d[e.id]?.aiReadyScore??null,onSelect:()=>x(e),loading:u.has(e.id),expanded:f===e.id},e.id))})]})}function h(){return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"text-center space-y-2",children:[(0,t.jsx)("h2",{className:"text-xl font-bold",children:"Which Mac for AI?"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground max-w-lg mx-auto",children:"Pick a Mac, see exactly which AI models it can run. Real performance numbers, not marketing."})]}),(0,t.jsx)("div",{className:"space-y-4",children:r.PRODUCT_LINES.map(e=>(0,t.jsx)(f,{productLine:e,configs:(0,r.getConfigsByProductLine)(e.id)},e.id))})]})}e.s(["WhichMacPanel",()=>h],64837)},58196,e=>{"use strict";var t=e.i(43476),r=e.i(77572),a=e.i(51445),s=e.i(55436);let n=(0,e.i(75254).default)("shopping-bag",[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]]);function l({hardwareForm:e,modelSearch:l,whichMac:o}){return(0,t.jsxs)(r.Tabs,{defaultValue:"hardware",className:"w-full",children:[(0,t.jsxs)(r.TabsList,{className:"w-full mb-8 bg-muted/40 p-1 h-auto",children:[(0,t.jsxs)(r.TabsTrigger,{value:"hardware",className:"flex-1 gap-2 py-2.5 text-sm data-[state=active]:bg-background data-[state=active]:shadow-sm",children:[(0,t.jsx)(a.Monitor,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Check My Hardware"}),(0,t.jsx)("span",{className:"sm:hidden",children:"My Hardware"})]}),(0,t.jsxs)(r.TabsTrigger,{value:"model",className:"flex-1 gap-2 py-2.5 text-sm data-[state=active]:bg-background data-[state=active]:shadow-sm",children:[(0,t.jsx)(s.Search,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Can I Run This Model?"}),(0,t.jsx)("span",{className:"sm:hidden",children:"Find Model"})]}),o&&(0,t.jsxs)(r.TabsTrigger,{value:"which-mac",className:"flex-1 gap-2 py-2.5 text-sm data-[state=active]:bg-background data-[state=active]:shadow-sm",children:[(0,t.jsx)(n,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Which Mac for AI?"}),(0,t.jsx)("span",{className:"sm:hidden",children:"Which Mac?"})]})]}),(0,t.jsx)(r.TabsContent,{value:"hardware",forceMount:!0,className:"data-[state=inactive]:hidden",children:e}),(0,t.jsx)(r.TabsContent,{value:"model",forceMount:!0,className:"data-[state=inactive]:hidden",children:l}),o&&(0,t.jsx)(r.TabsContent,{value:"which-mac",forceMount:!0,className:"data-[state=inactive]:hidden",children:o})]})}e.s(["FlowTabs",()=>l],58196)}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.