tarsk 0.4.30 → 0.5.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +768 -289
- package/dist/public/assets/{account-view-wqPOnMfW.js → account-view-DjLjq8T6.js} +1 -1
- package/dist/public/assets/alert-dialog-BWqb8ENe.js +1 -0
- package/dist/public/assets/api-BbUzw5rb.js +1 -0
- package/dist/public/assets/{browser-tab-BjqSmZHm.js → browser-tab-BVsBMyo3.js} +1 -1
- package/dist/public/assets/chat-input-container-Dh5eJPNP.js +22 -0
- package/dist/public/assets/commit-dialog-CfjW1f6P.js +1 -0
- package/dist/public/assets/{context-menu-XD6khGRr.js → context-menu-D_gX85jr.js} +1 -1
- package/dist/public/assets/conversation-history-view-CKiv8CxD.js +1 -0
- package/dist/public/assets/create-repo-dialog-ByvOv7em.js +1 -0
- package/dist/public/assets/{dialogs-config-BXDglGdB.js → dialogs-config-CV8HzCCA.js} +3 -3
- package/dist/public/assets/diff-view-CuEdnFtI.js +3 -0
- package/dist/public/assets/{explorer-tab-view-DbMBihAH.js → explorer-tab-view-CiDUcvE2.js} +2 -2
- package/dist/public/assets/explorer-tree-cxPx2HiW.js +1 -0
- package/dist/public/assets/{explorer-view-CL_9lhkq.js → explorer-view-BCQNEBOZ.js} +1 -1
- package/dist/public/assets/git-history-dialog-DKey5IQa.js +1 -0
- package/dist/public/assets/history-view-DDpROJvQ.js +1 -0
- package/dist/public/assets/index-BZwvl9X4.js +29 -0
- package/dist/public/assets/index-CihB-pLh.css +1 -0
- package/dist/public/assets/markdown-renderer-B1teF28W.js +10 -0
- package/dist/public/assets/mcp-server-card-CY-VLPhS.js +1 -0
- package/dist/public/assets/merged-pr-dialog-BfwdsytN.js +1 -0
- package/dist/public/assets/onboarding-BEy4bi0g.js +1 -0
- package/dist/public/assets/onboarding-dialog-GjczsXqi.js +1 -0
- package/dist/public/assets/page-toolbar-rWocuukR.js +1 -0
- package/dist/public/assets/{project-settings-view-CRRJPGNL.js → project-settings-view-wlaXVds9.js} +1 -1
- package/dist/public/assets/providers-list-view-BJsp9sta.js +1 -0
- package/dist/public/assets/pull-request-dialog-DDxX2W8n.js +1 -0
- package/dist/public/assets/pull-with-changes-dialog-BtXHWQ3k.js +1 -0
- package/dist/public/assets/push-before-pr-dialog-Cs54Vb76.js +1 -0
- package/dist/public/assets/radio-group-D2kNbZM6.js +1 -0
- package/dist/public/assets/react-vendor-DV_DP0Qd.js +22 -0
- package/dist/public/assets/{resizable-BLhzHL_f.js → resizable-jxPFsLog.js} +1 -1
- package/dist/public/assets/{run-stop-button-CIuDOHFg.js → run-stop-button-N1JNjOlD.js} +2 -2
- package/dist/public/assets/settings-general-view-BKcgxF5z.js +1 -0
- package/dist/public/assets/{settings-instructions-view-B-uTQrNZ.js → settings-instructions-view-DbQ3c3f1.js} +1 -1
- package/dist/public/assets/settings-mcp-servers-view-D2_Brac1.js +5 -0
- package/dist/public/assets/{settings-models-skeleton-CffyGIvJ.js → settings-models-skeleton-BSV1GmZQ.js} +1 -1
- package/dist/public/assets/settings-models-view-BhFuBHAE.js +1 -0
- package/dist/public/assets/settings-rules-view-qL__Zcav.js +8 -0
- package/dist/public/assets/settings-skills-view-Ccj8tTR9.js +2 -0
- package/dist/public/assets/{settings-slash-commands-view-BoT1nCir.js → settings-slash-commands-view-DyXAbQIp.js} +1 -1
- package/dist/public/assets/settings-subagents-view-LcaON0Dq.js +2 -0
- package/dist/public/assets/{settings-view-CS-RnV6J.js → settings-view-cLrxaSw4.js} +2 -2
- package/dist/public/assets/{side-panel-container-B33_hnhc.js → side-panel-container-CCaF3ZtX.js} +2 -2
- package/dist/public/assets/skeleton-DNfHG6mv.js +1 -0
- package/dist/public/assets/standard-list-item-PWOXi212.js +1 -0
- package/dist/public/assets/store-9Wm6Zyve.js +4 -0
- package/dist/public/assets/{tab-context-BUUT3x3d.js → tab-context-BdML89mQ.js} +1 -1
- package/dist/public/assets/tabs-BVcV8raO.js +1 -0
- package/dist/public/assets/{terminal-panel-BCHLDUbD.js → terminal-panel-BG8UFUSX.js} +2 -2
- package/dist/public/assets/textarea-CU-XhvgE.js +1 -0
- package/dist/public/assets/todos-view-DLC_0wx_.js +1 -0
- package/dist/public/assets/use-font-size-Bqn2rvp_.js +1 -0
- package/dist/public/assets/{use-toast-C5s-Xnwi.js → use-toast-CGSBJJb0.js} +1 -1
- package/dist/public/assets/{utils-CDrGT12s.js → utils-Dt4Hs5eF.js} +1 -1
- package/dist/public/assets/{whisper-wasm-C_Ot631g.js → whisper-wasm-BCJQtWoU.js} +2 -2
- package/dist/public/busy.svg +3 -0
- package/dist/public/index.html +22 -22
- package/package.json +1 -1
- package/dist/public/assets/alert-dialog-Dj0hDlZC.js +0 -1
- package/dist/public/assets/api-RbLAI1bg.js +0 -1
- package/dist/public/assets/chat-input-container-BNOl7YtC.js +0 -21
- package/dist/public/assets/conversation-history-view-BRSNoBYn.js +0 -1
- package/dist/public/assets/diff-view-DiNlWcSj.js +0 -3
- package/dist/public/assets/explorer-tree-D0P-HUYS.js +0 -1
- package/dist/public/assets/history-view-i7fGKCkc.js +0 -1
- package/dist/public/assets/index-BeLCtY82.css +0 -1
- package/dist/public/assets/index-CZZ6Jb9i.js +0 -29
- package/dist/public/assets/markdown-renderer-CPSKOcqK.js +0 -10
- package/dist/public/assets/mcp-server-card-DFATg_Ie.js +0 -1
- package/dist/public/assets/onboarding-5CTkrfwe.js +0 -1
- package/dist/public/assets/onboarding-dialog-gcZ9aKKp.js +0 -1
- package/dist/public/assets/page-toolbar-CbwENcML.js +0 -1
- package/dist/public/assets/providers-list-view-D3CIB4ou.js +0 -1
- package/dist/public/assets/radio-group-qCcnwXV3.js +0 -1
- package/dist/public/assets/react-vendor-Bpg1hd5i.js +0 -22
- package/dist/public/assets/settings-general-view-7Y0c9534.js +0 -1
- package/dist/public/assets/settings-mcp-servers-view-nAMQQWHb.js +0 -5
- package/dist/public/assets/settings-models-view-CMZh5LlR.js +0 -1
- package/dist/public/assets/settings-rules-view-BaNccq1v.js +0 -8
- package/dist/public/assets/settings-skills-view-DBX7obT7.js +0 -2
- package/dist/public/assets/settings-subagents-view-Cy87X2bs.js +0 -2
- package/dist/public/assets/skeleton-n47_ST9G.js +0 -1
- package/dist/public/assets/standard-list-item-BLTOBGFa.js +0 -1
- package/dist/public/assets/store-B9rEO6q-.js +0 -4
- package/dist/public/assets/tabs--5y6mYhG.js +0 -1
- package/dist/public/assets/textarea-CwXpBxom.js +0 -1
- package/dist/public/assets/todos-view-k0k8R9NT.js +0 -1
- package/dist/public/assets/use-font-size-BJl84s49.js +0 -1
- /package/dist/public/assets/{dist-CAVGqbBm.js → dist-2eORHB3M.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{$ as t,Ci as n,Cr as r,Dr as i,Ei as a,Er as o,Fr as s,Gi as c,Gn as l,Hn as u,Jn as d,Kn as f,Ln as p,Nr as m,Qt as h,Sr as g,Ui as _,Un as v,Wi as y,Wn as b,Z as x,_a as S,cr as C,dn as w,fa as T,ha as E,hr as D,j as ee,jt as te,k as ne,ma as O,na as re,qi as k,qn as ie,sa as A,un as ae,wr as j,yr as M}from"./dialogs-config-BXDglGdB.js";import{_ as N,a as P,c as F,i as oe,l as I,n as L,o as R,r as z,s as B,u as V}from"./history-view-i7fGKCkc.js";var H=e(S(),1),U=E(),W=m();function G(e){if(!e)return`Unknown Model`;let t=(e.split(`/`).filter(Boolean).pop()??e).replace(/[-_]+/g,` `).trim();return t?t.split(/\s+/g).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `):e}var K=`Checkbox`,[se,ce]=g(K),[le,q]=se(K);function ue(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=M({prop:n,defaultProp:i??!1,onChange:c,caller:K}),[m,h]=H.useState(null),[g,_]=H.useState(null),v=H.useRef(!1),y=m?!!o||!!m.closest(`form`):!0,b={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:v,required:l,defaultChecked:Y(i)?!1:i,isFormControl:y,bubbleInput:g,setBubbleInput:_};return(0,W.jsx)(le,{scope:t,...b,children:_e(d)?d(b):r})}var de=`CheckboxTrigger`,fe=H.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...i},a)=>{let{control:o,value:c,disabled:l,checked:u,required:d,setControl:f,setChecked:p,hasConsumerStoppedPropagationRef:m,isFormControl:h,bubbleInput:g}=q(de,e),_=s(a,f),v=H.useRef(u);return H.useEffect(()=>{let e=o?.form;if(e){let t=()=>p(v.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[o,p]),(0,W.jsx)(D.button,{type:`button`,role:`checkbox`,"aria-checked":Y(u)?`mixed`:u,"aria-required":d,"data-state":ve(u),"data-disabled":l?``:void 0,disabled:l,value:c,...i,ref:_,onKeyDown:r(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:r(n,e=>{p(e=>Y(e)?!0:!e),g&&h&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})});fe.displayName=de;var J=H.forwardRef((e,t)=>{let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,W.jsx)(ue,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(fe,{...d,ref:t,__scopeCheckbox:n}),e&&(0,W.jsx)(ge,{__scopeCheckbox:n})]})})});J.displayName=K;var pe=`CheckboxIndicator`,me=H.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:r,...i}=e,a=q(pe,n);return(0,W.jsx)(C,{present:r||Y(a.checked)||a.checked===!0,children:(0,W.jsx)(D.span,{"data-state":ve(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})});me.displayName=pe;var he=`CheckboxBubbleInput`,ge=H.forwardRef(({__scopeCheckbox:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:o,required:c,disabled:l,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:m}=q(he,e),h=s(n,m),g=R(a),_=N(r);H.useEffect(()=>{let e=p;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!i.current;if(g!==a&&n){let t=new Event(`click`,{bubbles:r});e.indeterminate=Y(a),n.call(e,Y(a)?!1:a),e.dispatchEvent(t)}},[p,g,a,i]);let v=H.useRef(Y(a)?!1:a);return(0,W.jsx)(D.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:o??v.current,required:c,disabled:l,name:u,value:d,form:f,...t,tabIndex:-1,ref:h,style:{...t.style,..._,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});ge.displayName=he;function _e(e){return typeof e==`function`}function Y(e){return e===`indeterminate`}function ve(e){return Y(e)?`indeterminate`:e?`checked`:`unchecked`}var X=H.forwardRef((e,t)=>{let n=(0,U.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=o(`peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground`,r),n[3]=r,n[4]=a);let s;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,W.jsx)(me,{className:o(`flex items-center justify-center text-current`),children:(0,W.jsx)(A,{className:`h-4 w-4`})}),n[5]=s):s=n[5];let c;return n[6]!==i||n[7]!==t||n[8]!==a?(c=(0,W.jsx)(J,{ref:t,className:a,...i,children:s}),n[6]=i,n[7]=t,n[8]=a,n[9]=c):c=n[9],c});X.displayName=J.displayName;function ye({selectedProvider:e,onProviderChange:t,showApiKeyInput:r=!0,onApiKeyChange:i,isLoading:a,error:o,variant:s=`dropdown`}){let[l,u]=(0,H.useState)([]),[d,f]=(0,H.useState)(!1),p=async e=>{try{await h(e)}catch(e){console.error(`Failed to open provider website:`,e)}};return(0,H.useEffect)(()=>{(async()=>{f(!0);try{let n=await te();u(n),n.length>0&&!e&&t(n[0])}catch(e){console.error(`Failed to load providers:`,e)}finally{f(!1)}})()},[e,t]),d?(0,W.jsx)(`div`,{className:`flex items-center justify-center py-4`,children:(0,W.jsx)(n,{className:`h-4 w-4 animate-spin text-muted-foreground`})}):s===`dropdown`?(0,W.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[o&&(0,W.jsx)(`p`,{className:`text-sm text-destructive`,children:o}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(`label`,{className:`text-sm font-medium`,children:`AI Provider`}),(0,W.jsxs)(L,{value:e?.name??``,onValueChange:e=>{let n=l.find(t=>t.name===e);n&&t(n)},children:[(0,W.jsx)(P,{children:e?e.name:`Select a provider`}),(0,W.jsx)(z,{children:l.map(e=>(0,W.jsx)(oe,{value:e.name,children:e.name},e.name))})]})]}),e?.url&&(0,W.jsx)(I,{children:(0,W.jsxs)(B,{children:[(0,W.jsx)(V,{asChild:!0,children:(0,W.jsxs)(j,{variant:`ghost`,size:`sm`,onClick:()=>p(e.url),className:`flex items-center gap-1 text-sm text-brand h-auto p-0`,children:[`Visit provider website `,(0,W.jsx)(c,{className:`h-3.5 w-3.5`})]})}),(0,W.jsx)(F,{children:(0,W.jsx)(`p`,{children:e.url})})]})}),r&&e&&(0,W.jsx)(be,{provider:e,value:e.apiKey??``,onChange:i,isLoading:a})]}):null}function be(e){let t=(0,U.c)(24),{provider:n,value:r,onChange:i,isLoading:o}=e,[s,c]=(0,H.useState)(!1);if(n.authType!==`APIKey`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This provider uses OAuth for authentication.`}),t[0]=e):e=t[0];let r;return t[1]===n.name?r=t[2]:(r=(0,W.jsxs)(`div`,{className:`rounded-md bg-muted/30 p-4 text-center`,children:[e,(0,W.jsxs)(j,{variant:`outline`,size:`sm`,className:`mt-2`,disabled:!0,children:[`Sign in with `,n.name]})]}),t[1]=n.name,t[2]=r),r}let l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,W.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,W.jsx)(I,{children:(0,W.jsxs)(B,{children:[(0,W.jsx)(V,{asChild:!0,children:(0,W.jsx)(`label`,{htmlFor:`api-key`,className:`text-sm font-medium cursor-help`,children:`API Key`})}),(0,W.jsx)(F,{children:`Your API key is stored locally and never shared.`})]})})}),t[3]=l):l=t[3];let d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,W.jsx)(a,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground`}),t[4]=d):d=t[4];let f=s?`text`:`password`,p=n.keyName??`Enter API Key`,m;t[5]===i?m=t[6]:(m=e=>i?.(e.target.value),t[5]=i,t[6]=m);let h;t[7]!==o||t[8]!==f||t[9]!==p||t[10]!==m||t[11]!==r?(h=(0,W.jsx)(u,{id:`api-key`,type:f,placeholder:p,className:`pl-10 pr-10`,value:r,onChange:m,disabled:o}),t[7]=o,t[8]=f,t[9]=p,t[10]=m,t[11]=r,t[12]=h):h=t[12];let g;t[13]===s?g=t[14]:(g=()=>c(!s),t[13]=s,t[14]=g);let v=(o??!1)||!r,b;t[15]===s?b=t[16]:(b=s?(0,W.jsx)(y,{className:`h-4 w-4 text-muted-foreground`}):(0,W.jsx)(_,{className:`h-4 w-4 text-muted-foreground`}),t[15]=s,t[16]=b);let x;t[17]!==g||t[18]!==v||t[19]!==b?(x=(0,W.jsx)(j,{type:`button`,variant:`ghost`,size:`sm`,className:`absolute right-1 top-1/2 -translate-y-1/2 h-8 w-8 p-0`,onClick:g,disabled:v,children:b}),t[17]=g,t[18]=v,t[19]=b,t[20]=x):x=t[20];let S;return t[21]!==x||t[22]!==h?(S=(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[l,(0,W.jsxs)(`div`,{className:`relative`,children:[d,h,x]})]}),t[21]=x,t[22]=h,t[23]=S):S=t[23],S}function xe({provider:e,onModelsChange:r,isLoading:a,disabled:s,displayMode:c=`grid`}){let[l,u]=(0,H.useState)([]),[d,f]=(0,H.useState)(new Set),[p,m]=(0,H.useState)(new Map),[h,g]=(0,H.useState)(!1),[_,v]=(0,H.useState)(``),[y,b]=(0,H.useState)(`alphabetical`);(0,H.useEffect)(()=>{x()},[e]);let x=async()=>{g(!0),v(``),b(`alphabetical`);try{let n=await t(e);u(n.models),f(new Set(n.enabledModelIds)),m(new Map)}catch(t){console.error(`Failed to load models for ${e}:`,t),u([]),f(new Set)}finally{g(!1)}},S=(e,t)=>{let n=new Set(e);l.forEach(e=>{t.has(e.id)&&(t.get(e.id)?n.add(e.id):n.delete(e.id))}),r?.(n)},C=e=>{m(t=>{let n=new Map(t),r=d.has(e),i=n.has(e),a=n.get(e),o=!(i?a:r);return o===r?n.delete(e):n.set(e,o),S(d,n),n})},w=e=>{m(t=>{let n=new Map(t);return l.forEach(t=>{let r=d.has(t.id);e?r?n.delete(t.id):n.set(t.id,!0):r?n.set(t.id,!1):n.delete(t.id)}),S(d,n),n})},T=e=>G(e.id),E=l.filter(e=>{let t=_.toLowerCase(),n=T(e);return e.name.toLowerCase().includes(t)||e.id.toLowerCase().includes(t)||n.toLowerCase().includes(t)}).sort((e,t)=>{let n=+!d.has(e.id),r=+!d.has(t.id);if(n!==r)return n-r;if(y===`price-low`){let n=!!e.pricing;return n===!!t.pricing?!e.pricing||!t.pricing?0:((e.pricing.prompt??0)+(e.pricing.completion??0))/2-((t.pricing.prompt??0)+(t.pricing.completion??0))/2:n?-1:1}if(y===`price-high`){let n=!!e.pricing;if(n!==!!t.pricing)return n?-1:1;if(!e.pricing||!t.pricing)return 0;let r=((e.pricing.prompt??0)+(e.pricing.completion??0))/2;return((t.pricing.prompt??0)+(t.pricing.completion??0))/2-r}return T(e).localeCompare(T(t))});return h||a?(0,W.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,W.jsx)(n,{className:`h-5 w-5 animate-spin text-muted-foreground`})}):l.length===0?(0,W.jsx)(`div`,{className:`text-center py-8`,children:(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No models available for this provider.`})}):c===`compact`?(0,W.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,W.jsxs)(`div`,{className:o(`flex items-center justify-between`,s&&`opacity-25`),children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(X,{id:`select-all-models`,disabled:s,checked:l.every(e=>{let t=p.has(e.id),n=p.get(e.id);return t?n:d.has(e.id)}),onCheckedChange:e=>w(e===!0)}),(0,W.jsx)(`label`,{htmlFor:`select-all-models`,className:`text-sm cursor-pointer`,children:`Select all models`})]}),(0,W.jsx)(I,{children:(0,W.jsxs)(`div`,{className:`flex items-center rounded-md border border-border p-0.5`,children:[(0,W.jsxs)(B,{children:[(0,W.jsx)(V,{asChild:!0,children:(0,W.jsx)(j,{type:`button`,variant:y===`alphabetical`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>b(`alphabetical`),disabled:s,children:(0,W.jsx)(O,{className:`h-4 w-4`})})}),(0,W.jsx)(F,{children:`Sort A–Z`})]}),(0,W.jsxs)(B,{children:[(0,W.jsx)(V,{asChild:!0,children:(0,W.jsx)(j,{type:`button`,variant:y===`price-low`||y===`price-high`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>{b(y===`price-low`?`price-high`:`price-low`)},disabled:s,children:(0,W.jsx)(k,{className:`h-4 w-4`})})}),(0,W.jsx)(F,{children:`Sort by price`})]})]})})]}),(0,W.jsx)(I,{children:(0,W.jsx)(`div`,{className:`grid grid-cols-1 gap-0 border border-border rounded-md overflow-hidden`,children:E.length===0?(0,W.jsx)(`div`,{className:`text-center py-4`,children:(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No models available.`})}):E.map(e=>{let t=d.has(e.id),n=p.has(e.id),r=p.get(e.id),a=n?r:t,c=e.pricing;return(0,W.jsxs)(B,{children:[(0,W.jsx)(V,{asChild:!0,children:(0,W.jsxs)(`div`,{className:o(`flex items-center space-x-3 p-3 hover:bg-muted/30 transition-colors cursor-default border-b border-border last:border-b-0`,s&&`opacity-25`),children:[(0,W.jsx)(X,{id:e.id,disabled:s,checked:a??!1,onCheckedChange:()=>C(e.id),className:`mt-0`}),(0,W.jsxs)(`div`,{className:`flex-1 flex items-center justify-between gap-3 leading-none`,children:[(0,W.jsx)(`label`,{htmlFor:e.id,className:`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer truncate flex-1 w-0`,children:T(e)}),c&&(0,W.jsx)(`span`,{className:`text-xs text-muted-foreground whitespace-nowrap flex-shrink-0`,children:(c.prompt??0)<=0&&(c.completion??0)<=0?`Free`:`${i(c.prompt??0)} in | ${i(c.completion??0)} out`})]})]})}),e.description&&(0,W.jsx)(F,{side:`top`,className:`max-w-xs`,children:(0,W.jsx)(`p`,{className:`text-sm`,children:e.description})})]},e.id)})})})]}):null}function Se(e){return`${e.slug.toUpperCase().replace(/-/g,`_`)}_API_URL`}function Z(e){let t=e.env??[];return t.find(e=>/resource_name$/i.test(e))??t[0]??``}function Ce(e){if(e.apiKeyEnv)return e.apiKeyEnv;if(e.keyName)return e.keyName;let t=e.env??[];return t.find(e=>/api_key$/i.test(e))??t[t.length-1]??``}function Q(e){let t=Ce(e);return(e.env??[]).filter(e=>e!==t)}function $(e){return e.replace(/^AZURE_/,``).replace(/_/g,` `).toLowerCase().replace(/\b\w/g,e=>e.toUpperCase())}function we(e,t){let n=Se(e),r=t[n]??e.envValues?.[n]??``;if(r)return r;if(e.slug===`azure`){let n=Z(e),r=t[n]??e.envValues?.[n]??``;if(r)return`https://${r}.openai.azure.com/openai/v1`}return e.api.replace(/\$\{([A-Z0-9_]+)\}/gi,(n,r)=>t[r]??e.envValues?.[r]??``)}function Te({open:e,onOpenChange:r,onComplete:i}){let[a,s]=(0,H.useState)(`git-check`),[u,m]=(0,H.useState)(null),[h,g]=(0,H.useState)(!1),[_,y]=(0,H.useState)([]),[S,C]=(0,H.useState)(null),[E,D]=(0,H.useState)(``),[O,k]=(0,H.useState)({}),[M,N]=(0,H.useState)(!1),[P,F]=(0,H.useState)(``),[oe,I]=(0,H.useState)(new Set),[L,R]=(0,H.useState)(!1),[z,B]=(0,H.useState)(!1);(0,H.useEffect)(()=>{e&&a===`git-check`&&V()},[e,a]),(0,H.useEffect)(()=>{e&&a===`provider-selection`&&_.length===0&&U()},[e,a,_.length]),(0,H.useEffect)(()=>{e&&a===`model-selection`&&S&&G()},[e,a,S]);let V=async()=>{g(!0);try{m((await ne()).gitInstalled)}catch(e){console.error(`Failed to check git installation:`,e),m(!1)}finally{g(!1)}},U=async()=>{try{let e=await te();y(e),e.length>0&&!S&&C(e[0])}catch(e){console.error(`Failed to load providers:`,e)}},G=async()=>{if(S){R(!0);try{await t(S.name),I(new Set)}catch(e){console.error(`Failed to load models:`,e)}finally{R(!1)}}},K=async()=>{if(!S||!E.trim()){F(`Please enter an API key`);return}let e=Q(S),t=e.find(e=>!O[e]?.trim());if(t){F(`Please enter ${$(t)}`);return}N(!0),F(``);try{e.length>0&&await ae(Object.fromEntries(e.map(e=>[e,O[e].trim()]))),await w(S.slug,E),s(`model-selection`)}catch(e){F(e instanceof Error?e.message:`Failed to validate API key`)}finally{N(!1)}},se=async()=>{if(S){B(!0);try{for(let e of oe)await x(S.name,e);await ee(),i?.(),r(!1)}catch(e){console.error(`Failed to complete onboarding:`,e)}finally{B(!1)}}},ce=async()=>{B(!0);try{await ee(),i?.(),r(!1)}catch(e){console.error(`Failed to skip onboarding:`,e)}finally{B(!1)}},le=e=>{C(e),D(e.apiKey??``),k(e.envValues??{}),F(``)},q=(e,t)=>{k(n=>({...n,[e]:t}))};return(0,W.jsx)(v,{open:e,onOpenChange:r,children:(0,W.jsxs)(b,{className:`max-w-2xl h-[min(42rem,90dvh)] flex flex-col p-0 overflow-hidden`,children:[(0,W.jsxs)(`div`,{className:`px-6 pt-6 pb-2`,children:[(0,W.jsxs)(`div`,{className:`w-1/2 mx-auto flex items-center gap-2 mb-6`,children:[(0,W.jsx)(`div`,{className:o(`flex items-center justify-center h-8 w-8 rounded-full text-sm font-medium`,a===`git-check`?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground`),children:`1`}),(0,W.jsx)(`div`,{className:o(`h-0.5 flex-1`,a===`provider-selection`||a===`model-selection`?`bg-primary`:`bg-muted`)}),(0,W.jsx)(`div`,{className:o(`flex items-center justify-center h-8 w-8 rounded-full text-sm font-medium`,a===`provider-selection`?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground`),children:`2`}),(0,W.jsx)(`div`,{className:o(`h-0.5 flex-1`,a===`model-selection`?`bg-primary`:`bg-muted`)}),(0,W.jsx)(`div`,{className:o(`flex items-center justify-center h-8 w-8 rounded-full text-sm font-medium`,a===`model-selection`?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground`),children:`3`})]}),(0,W.jsxs)(ie,{children:[a===`git-check`&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(d,{children:`Let's get started`}),(0,W.jsx)(l,{children:`First, we need to check that Git is installed on your system.`})]}),a===`provider-selection`&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(d,{children:`Select an AI Provider`}),(0,W.jsx)(l,{children:`Choose your preferred AI provider and enter your API key.`})]}),a===`model-selection`&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(d,{children:`Select Models`}),(0,W.jsx)(l,{children:`Choose which models you want to use with this provider.`})]})]})]}),(0,W.jsx)(p,{className:`flex-1 min-h-0 overflow-hidden`,children:(0,W.jsxs)(`div`,{className:`px-6 py-4`,children:[a===`git-check`&&(0,W.jsx)(`div`,{className:`space-y-4`,children:h?(0,W.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,W.jsx)(n,{className:`h-5 w-5 animate-spin text-muted-foreground`})}):u?(0,W.jsxs)(`div`,{className:`rounded-lg border border-green-200 bg-green-50 p-4 flex items-start gap-3`,children:[(0,W.jsx)(A,{className:`h-5 w-5 text-green-600 flex-shrink-0 mt-0.5`}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h4`,{className:`font-medium text-green-900`,children:`Git is installed`}),(0,W.jsx)(`p`,{className:`text-sm text-green-800`,children:`You're all set to use Git features in Tarsk.`})]})]}):(0,W.jsxs)(`div`,{className:`rounded-lg border border-yellow-200 bg-yellow-50 p-4 flex items-start gap-3`,children:[(0,W.jsx)(re,{className:`h-5 w-5 text-yellow-600 flex-shrink-0 mt-0.5`}),(0,W.jsxs)(`div`,{className:`flex-1`,children:[(0,W.jsx)(`h4`,{className:`font-medium text-yellow-900`,children:`Git is not installed`}),(0,W.jsx)(`p`,{className:`text-sm text-yellow-800 mt-1`,children:`Git is required for some features in Tarsk. You can continue without it, but we recommend installing it.`}),(0,W.jsxs)(`a`,{href:`https://git-scm.com/downloads`,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-sm text-blue-600 hover:underline mt-2`,children:[`Download Git `,(0,W.jsx)(c,{className:`h-3 w-3`})]})]})]})}),a===`provider-selection`&&(0,W.jsx)(`div`,{className:`space-y-4`,children:S&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(ye,{selectedProvider:S,onProviderChange:le,showApiKeyInput:!0,onApiKeyChange:D,variant:`dropdown`,isLoading:M}),Q(S).map(e=>(0,W.jsxs)(`div`,{className:`space-y-2`,children:[(0,W.jsx)(`label`,{htmlFor:e,className:`text-sm font-medium`,children:$(e)}),(0,W.jsx)(`input`,{id:e,value:O[e]??``,onChange:t=>q(e,t.target.value),className:`h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm`,placeholder:e,spellCheck:!1,autoCorrect:`off`,autoCapitalize:`off`}),S.slug===`azure`&&e===Z(S)&&(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground break-all`,children:we(S,O)||S.api})]},e)),P&&(0,W.jsx)(`div`,{className:`rounded-md bg-destructive/10 p-3 text-sm text-destructive`,children:P})]})}),a===`model-selection`&&S&&(0,W.jsx)(`div`,{className:`space-y-4`,children:(0,W.jsx)(xe,{provider:S.slug,isLoading:L,displayMode:`compact`,disabled:!1,onModelsChange:I})})]})}),(0,W.jsx)(`div`,{className:`px-6 py-4 border-t border-border bg-muted/10`,children:(0,W.jsxs)(f,{className:`flex items-center justify-between`,children:[(0,W.jsx)(`div`,{children:a===`provider-selection`&&(0,W.jsx)(j,{variant:`ghost`,onClick:()=>ce(),disabled:z,children:`Skip for now`})}),(0,W.jsxs)(`div`,{className:`flex gap-3`,children:[a!==`git-check`&&(0,W.jsx)(j,{variant:`outline`,onClick:()=>{a===`provider-selection`?s(`git-check`):a===`model-selection`&&s(`provider-selection`)},disabled:z,children:`Back`}),a===`git-check`&&(0,W.jsxs)(j,{onClick:()=>{s(`provider-selection`)},disabled:h,className:`gap-2`,children:[`Continue `,(0,W.jsx)(T,{className:`h-4 w-4`})]}),a===`provider-selection`&&(0,W.jsx)(j,{onClick:K,disabled:M||!E.trim()||!S,className:`gap-2`,children:M?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(n,{className:`h-4 w-4 animate-spin`}),`Validating...`]}):(0,W.jsxs)(W.Fragment,{children:[`Next `,(0,W.jsx)(T,{className:`h-4 w-4`})]})}),a===`model-selection`&&(0,W.jsx)(j,{onClick:se,disabled:z,className:`gap-2`,children:z?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(n,{className:`h-4 w-4 animate-spin`}),`Finishing...`]}):(0,W.jsxs)(W.Fragment,{children:[`Finish `,(0,W.jsx)(A,{className:`h-4 w-4`})]})})]})]})})]})})}export{we as a,Z as i,$ as n,X as o,Q as r,G as s,Te as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./onboarding-5CTkrfwe.js";export{e as OnboardingDialog,e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Er as e,Nr as t,ha as n}from"./dialogs-config-BXDglGdB.js";var r=n(),i=t();function a(t){let n=(0,r.c)(5),{children:a,className:o}=t,s;n[0]===o?s=n[1]:(s=e(`flex min-h-[71px] shrink-0 items-center gap-2 px-4 py-2 electrobun-webkit-app-region-drag`,o),n[0]=o,n[1]=s);let c;return n[2]!==a||n[3]!==s?(c=(0,i.jsx)(`header`,{className:s,children:a}),n[2]=a,n[3]=s,n[4]=c):c=n[4],c}export{a as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{$ as t,At as n,Ci as r,Dr as i,Ei as a,Er as o,Gi as s,Gn as c,Hn as l,J as u,Jn as d,Ln as f,Nr as p,Q as m,Qt as h,Ui as g,Un as _,Wi as v,Wn as y,X as b,Xr as x,Y as S,Yi as C,Z as w,_a as T,dn as E,ha as D,ji as O,jr as k,jt as A,kt as ee,la as j,ma as M,n as N,ot as te,qi as ne,r as P,ri as re,un as ie,wr as F}from"./dialogs-config-BXDglGdB.js";import{c as I,l as L,s as R,u as z}from"./history-view-i7fGKCkc.js";import{a as ae,i as oe,n as se,o as ce,r as le,s as ue}from"./onboarding-5CTkrfwe.js";import{i as de,n as fe,r as pe,t as me}from"./tabs--5y6mYhG.js";import{t as B}from"./skeleton-n47_ST9G.js";var V=D(),H=e(T(),1),U=p(),he=k(`inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground hover:bg-primary/80`,secondary:`border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80`,destructive:`border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80`,outline:`text-foreground`}},defaultVariants:{variant:`default`}});function W(e){let t=(0,V.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,variant:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==i?(a=o(he({variant:i}),n),t[4]=n,t[5]=i,t[6]=a):a=t[6];let s;return t[7]!==r||t[8]!==a?(s=(0,U.jsx)(`div`,{className:a,...r}),t[7]=r,t[8]=a,t[9]=s):s=t[9],s}function G({selectedProviderName:e,providerData:n,className:c}){let[d,p]=(0,H.useState)(null),[_,y]=(0,H.useState)(``),[C,T]=(0,H.useState)(!1),[D,O]=(0,H.useState)(null),[k,j]=(0,H.useState)(``),[N,te]=(0,H.useState)([]),[P,B]=(0,H.useState)(new Set),[V,he]=(0,H.useState)(new Set),[W,G]=(0,H.useState)(new Map),[K,q]=(0,H.useState)(``),[J,Y]=(0,H.useState)(`alphabetical`),[ge,_e]=(0,H.useState)(`all`),[ve,ye]=(0,H.useState)(!1),[be,X]=(0,H.useState)(``),[xe,Se]=(0,H.useState)(``),[Ce,we]=(0,H.useState)(`coding`),[Z,Te]=(0,H.useState)([]),[Ee,De]=(0,H.useState)(new Set),[Oe,ke]=(0,H.useState)(new Set),[Ae,je]=(0,H.useState)(new Map),[Me,Ne]=(0,H.useState)({}),Q=e=>ue(e.id);(0,H.useEffect)(()=>{(async()=>{if(j(``),n&&n.name===e){p(n),Se(n.apiKey??``),y(n.apiKey??``),Ne(n.envValues??{}),Fe(n.slug),Pe(n.slug);return}try{let t=await A();if(e){let n=t.find(t=>t.name===e);p(n??null),Se(n?.apiKey??``),y(n?.apiKey??``),Ne(n?.envValues??{}),n&&(Fe(n.slug),Pe(n.slug))}}catch(e){j(e instanceof Error?e.message:`Failed to load providers`)}})()},[e,n]);let Pe=async e=>{O(null);try{let t=await ee(e);t.status===`success`&&O(t.balance)}catch(t){console.error(`Failed to load balance for ${e}:`,t)}},Fe=async e=>{T(!0),q(``),Y(`alphabetical`),_e(`all`),we(`coding`);try{let[n,r]=await Promise.all([t(e),m(e)]);te(n.models),Te(r.models);let i=new Set(n.enabledModelIds);B(i),he(i);let a=new Set(r.enabledModelIds);De(a),ke(a),G(new Map),je(new Map)}catch(t){console.error(`Failed to load models for ${e}:`,t),te([]),Te([]),B(new Set),he(new Set),De(new Set),ke(new Set)}finally{T(!1)}},Ie=(e,t)=>{d?.name===e&&(y(t),Re(t))},Le=(e,t)=>{Ne(n=>({...n,[e]:t})),d&&(async()=>{try{await ie({[e]:t}),X(`${se(e)} saved successfully`),setTimeout(()=>X(``),3e3)}catch(e){X(e instanceof Error?e.message:`Failed to save provider settings`)}})()},Re=async e=>{if(!(!d||e===xe))try{await E(d.slug,e),Se(e),X(`API key saved successfully`),setTimeout(()=>X(``),3e3)}catch(e){X(e instanceof Error?e.message:`Failed to save API key`)}},ze=(e,t)=>{t===`image`?je(t=>{let n=new Map(t),r=Ee.has(e),i=n.has(e),a=n.get(e),o=!(i?a:r);return o===r?n.delete(e):n.set(e,o),Be(e,(n.has(e)?n.get(e):r)??!1,`image`),n}):G(t=>{let n=new Map(t),r=P.has(e),i=n.has(e),a=n.get(e),o=!(i?a:r);return o===r?n.delete(e):n.set(e,o),Be(e,(n.has(e)?n.get(e):r)??!1,`coding`),n})},Be=async(e,t,n=`coding`)=>{if(d)try{n===`image`?(t?(await b(d.slug,e),De(t=>new Set([...t,e]))):(await u(d.slug,e),De(t=>{let n=new Set(t);return n.delete(e),n})),je(t=>{let n=new Map(t);return n.delete(e),n})):(t?(await w(d.slug,e),B(t=>new Set([...t,e]))):(await S(d.slug,e),B(t=>{let n=new Set(t);return n.delete(e),n})),G(t=>{let n=new Map(t);return n.delete(e),n})),X(`Model preferences saved successfully`),setTimeout(()=>X(``),3e3)}catch(e){X(e instanceof Error?e.message:`Failed to save model changes`)}},Ve=(e,t=`coding`)=>{let n=t===`image`?Z:N,r=t===`image`?Ee:P;n.forEach(n=>{r.has(n.id)!==e&&Be(n.id,e,t)}),t===`image`?je(new Map):G(new Map)},He=async e=>{try{await h(e)}catch(e){console.error(`Failed to open provider website:`,e)}},$=_!==void 0&&_.trim().length>0,Ue=e=>e?e<20?1:e<30?2:e<40?3:e<50?4:5:0,We=({codingIndex:e,modelName:t})=>{let n=Ue(e);return n===0?null:(0,U.jsx)(L,{children:(0,U.jsxs)(R,{children:[(0,U.jsx)(z,{asChild:!0,children:(0,U.jsx)(`div`,{className:`flex items-center gap-0.5`,children:[1,2,3,4,5].map(e=>(0,U.jsx)(x,{className:`h-3 w-3 ${e<=n?`fill-yellow-400 text-yellow-400`:`text-gray-300`}`},e))})}),(0,U.jsx)(I,{children:(0,U.jsxs)(`p`,{className:`text-sm`,children:[t,` was indexed `,e,` for coding intelligence`]})})]})})},Ge=N.filter(e=>{let t=K.toLowerCase(),n=Q(e),r=e.name.toLowerCase().includes(t)||e.id.toLowerCase().includes(t)||n.toLowerCase().includes(t);if(ge===`free`){let t=e.pricing?.prompt===0&&e.pricing?.completion===0;return r&&t}return r}).sort((e,t)=>{let n=+!V.has(e.id),r=+!V.has(t.id);if(n!==r)return n-r;if(J===`price-low`){let n=!!e.pricing;return n===!!t.pricing?!e.pricing||!t.pricing?0:((e.pricing.prompt??0)+(e.pricing.completion??0))/2-((t.pricing.prompt??0)+(t.pricing.completion??0))/2:n?-1:1}if(J===`price-high`){let n=!!e.pricing;if(n!==!!t.pricing)return n?-1:1;if(!e.pricing||!t.pricing)return 0;let r=((e.pricing.prompt??0)+(e.pricing.completion??0))/2;return((t.pricing.prompt??0)+(t.pricing.completion??0))/2-r}if(J===`coding-index`){let n=e.coding_index!==void 0&&e.coding_index!==null;return n===(t.coding_index!==void 0&&t.coding_index!==null)?!e.coding_index||!t.coding_index?0:t.coding_index-e.coding_index:n?-1:1}return Q(e).localeCompare(Q(t))}),Ke=Z.filter(e=>{let t=K.toLowerCase(),n=Q(e),r=e.name.toLowerCase().includes(t)||e.id.toLowerCase().includes(t)||n.toLowerCase().includes(t);if(ge===`free`){let t=e.pricing?.prompt===0&&e.pricing?.completion===0;return r&&t}return r}).sort((e,t)=>{let n=+!Oe.has(e.id),r=+!Oe.has(t.id);if(n!==r)return n-r;if(J===`price-low`){let n=!!e.pricing;return n===!!t.pricing?!e.pricing||!t.pricing?0:((e.pricing.prompt??0)+(e.pricing.completion??0))/2-((t.pricing.prompt??0)+(t.pricing.completion??0))/2:n?-1:1}if(J===`price-high`){let n=!!e.pricing;return n===!!t.pricing?!e.pricing||!t.pricing?0:((t.pricing.prompt??0)+(t.pricing.completion??0))/2-((e.pricing.prompt??0)+(e.pricing.completion??0))/2:n?-1:1}return Q(e).localeCompare(Q(t))});return k?(0,U.jsxs)(`div`,{className:o(`flex flex-1 flex-col items-center justify-center gap-2`,c),children:[(0,U.jsx)(`p`,{className:`text-sm text-destructive`,children:k}),(0,U.jsx)(F,{variant:`outline`,size:`sm`,onClick:()=>window.location.reload(),children:`Retry`})]}):d?(0,U.jsx)(f,{className:o(`flex-1`,c),children:(0,U.jsxs)(`div`,{className:`max-w-2xl mx-auto p-6`,children:[(0,U.jsxs)(`div`,{className:`mb-6`,children:[(0,U.jsxs)(`h1`,{className:`text-2xl font-bold`,children:[d.name,` Settings`]}),(0,U.jsx)(`p`,{className:`text-muted-foreground`,children:`Configure API keys and models for this provider.`})]}),(0,U.jsxs)(`div`,{className:`space-y-6`,children:[(0,U.jsx)(`div`,{className:`flex flex-col gap-2`,children:(0,U.jsxs)(`div`,{className:`flex items-center justify-between min-h-[20px]`,children:[(0,U.jsx)(`div`,{className:`flex items-center gap-2`,children:D===null?(0,U.jsx)(`div`,{className:`h-[20px] w-[1px]`}):(0,U.jsxs)(`span`,{className:`text-xs font-medium text-green-600 bg-green-50 px-2.5 py-1 rounded-full border border-green-100 flex items-center gap-1.5`,children:[(0,U.jsx)(`div`,{className:`h-1.5 w-1.5 rounded-full bg-green-500`}),`$`,i(D),` `,`balance`]})}),d.url?(0,U.jsx)(L,{children:(0,U.jsxs)(R,{children:[(0,U.jsx)(z,{asChild:!0,children:(0,U.jsxs)(F,{variant:`ghost`,size:`sm`,onClick:()=>He(d.url),className:`flex items-center gap-1 text-xs text-brand h-auto p-3`,children:[`Visit provider website `,(0,U.jsx)(s,{className:`h-3 w-3`})]})}),(0,U.jsx)(I,{children:(0,U.jsx)(`p`,{children:d.url})})]})}):(0,U.jsx)(`div`,{className:`h-[20px] w-[1px]`})]})}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,U.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,U.jsx)(L,{children:(0,U.jsxs)(R,{children:[(0,U.jsx)(z,{asChild:!0,children:(0,U.jsx)(`span`,{className:`text-sm font-medium cursor-help`,children:`API Key`})}),(0,U.jsx)(I,{children:`Your API key is stored locally and never shared.`})]})})}),d.authType===`APIKey`?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(a,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground`}),(0,U.jsx)(l,{type:ve?`text`:`password`,placeholder:d.keyName||`Enter API Key`,className:`pl-10 pr-10`,value:_,onChange:e=>{Ie(d.name,e.target.value)}}),(0,U.jsx)(F,{type:`button`,variant:`ghost`,size:`sm`,className:`absolute right-1 top-1/2 -translate-y-1/2 h-8 w-8 p-0`,onClick:()=>ye(!ve),disabled:!_,children:ve?(0,U.jsx)(v,{className:`h-4 w-4 text-muted-foreground`}):(0,U.jsx)(g,{className:`h-4 w-4 text-muted-foreground`})})]}),(0,U.jsx)(`div`,{className:`space-y-4 mt-4`,children:le(d).map(e=>(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,U.jsx)(L,{children:(0,U.jsxs)(R,{children:[(0,U.jsx)(z,{asChild:!0,children:(0,U.jsx)(`span`,{className:`text-sm font-medium cursor-help`,children:se(e)})}),(0,U.jsx)(I,{children:e})]})})}),(0,U.jsx)(l,{id:e,value:Me[e]??``,onChange:t=>Le(e,t.target.value),placeholder:e,spellCheck:!1,autoCorrect:`off`,autoCapitalize:`off`}),d.slug===`azure`&&e===oe(d)&&(0,U.jsx)(`p`,{className:`text-xs text-muted-foreground break-all`,children:ae(d,Me)||d.api})]},e))})]}):(0,U.jsxs)(`div`,{className:`rounded-md bg-muted/30 p-4 text-center`,children:[(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This provider uses OAuth for authentication.`}),(0,U.jsxs)(F,{variant:`outline`,size:`sm`,className:`mt-2`,disabled:!0,children:[`Sign in with `,d.name]})]})]}),(0,U.jsxs)(me,{value:Ce,onValueChange:e=>{we(e),q(``),Y(`alphabetical`)},children:[(0,U.jsxs)(pe,{className:`mb-4`,children:[(0,U.jsx)(de,{value:`coding`,children:`Coding`}),d?.name.toLowerCase()===`openrouter`&&(0,U.jsx)(de,{value:`image`,children:`Image`})]}),(0,U.jsx)(fe,{value:`coding`,children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[!C&&N.length>0&&(0,U.jsxs)(`div`,{className:o(`flex items-center justify-between gap-3`,!$&&`opacity-25`),children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(ce,{id:`select-all-models`,disabled:!$,checked:N.every(e=>{let t=W.has(e.id),n=W.get(e.id);return t?n:P.has(e.id)}),onCheckedChange:e=>Ve(e===!0,`coding`)}),(0,U.jsx)(`label`,{htmlFor:`select-all-models`,className:`text-sm cursor-pointer whitespace-nowrap`,children:`Select all models`})]}),(0,U.jsxs)(`div`,{className:`flex-1 relative`,children:[(0,U.jsx)(re,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground pointer-events-none`}),(0,U.jsx)(l,{placeholder:`Search models...`,className:`pl-10 h-8`,value:K,onChange:e=>q(e.target.value),disabled:!$})]}),(0,U.jsx)(L,{children:(0,U.jsxs)(`div`,{className:`flex items-center rounded-md border border-border p-0.5`,children:[(0,U.jsxs)(R,{children:[(0,U.jsx)(z,{asChild:!0,children:(0,U.jsx)(F,{type:`button`,variant:J===`alphabetical`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>Y(`alphabetical`),children:(0,U.jsx)(M,{className:`h-4 w-4`})})}),(0,U.jsx)(I,{children:`Sort A–Z`})]}),(0,U.jsxs)(R,{children:[(0,U.jsx)(z,{asChild:!0,children:(0,U.jsx)(F,{type:`button`,variant:J===`price-low`||J===`price-high`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>Y(`price-low`),children:(0,U.jsx)(ne,{className:`h-4 w-4`})})}),(0,U.jsx)(I,{children:`Sort by price`})]}),(0,U.jsxs)(R,{children:[(0,U.jsx)(z,{asChild:!0,children:(0,U.jsx)(F,{type:`button`,variant:J===`coding-index`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>Y(`coding-index`),children:(0,U.jsx)(x,{className:`h-4 w-4`})})}),(0,U.jsx)(I,{children:`Sort by coding intelligence`})]})]})})]}),C?(0,U.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,U.jsx)(r,{className:`h-5 w-5 animate-spin text-muted-foreground`})}):N.length===0?(0,U.jsx)(`div`,{className:`text-center py-8`,children:(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No models available for this provider.`})}):(0,U.jsx)(L,{children:(0,U.jsx)(`div`,{className:`grid grid-cols-1 gap-0 border border-border rounded-md overflow-hidden`,children:Ge.length===0?(0,U.jsx)(`div`,{className:`text-center py-8`,children:(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No models matching your filters.`})}):Ge.map(e=>{let t=P.has(e.id),n=W.has(e.id),r=W.get(e.id),a=n?r:t,o=e.pricing;return(0,U.jsxs)(`div`,{className:`flex items-center space-x-3 p-3 hover:bg-muted/30 transition-colors cursor-default border-b border-border last:border-b-0 ${$?``:`opacity-25`}`,children:[(0,U.jsx)(ce,{id:e.id,disabled:!$,checked:a??!1,onCheckedChange:()=>ze(e.id,`coding`),className:`mt-0`}),(0,U.jsxs)(`div`,{className:`flex-1 flex items-center justify-between gap-3 leading-none`,children:[(0,U.jsx)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0`,children:(0,U.jsx)(`label`,{htmlFor:e.id,className:`text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer truncate`,children:Q(e)})}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 flex-shrink-0`,children:[J===`coding-index`&&(0,U.jsx)(We,{codingIndex:e.coding_index,modelName:Q(e)}),o&&(0,U.jsx)(`span`,{className:`text-xs text-muted-foreground whitespace-nowrap`,children:(o.prompt??0)===0&&(o.completion??0)===0?``:`$${i(o.prompt??0)} in | $${i(o.completion??0)} out`})]})]})]},e.id)})})})]})}),(0,U.jsx)(fe,{value:`image`,children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[!C&&Z.length>0&&(0,U.jsxs)(`div`,{className:o(`flex items-center justify-between gap-3`,!$&&`opacity-25`),children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(ce,{id:`select-all-image-models`,disabled:!$,checked:Z.every(e=>{let t=Ae.has(e.id),n=Ae.get(e.id);return t?n:Ee.has(e.id)}),onCheckedChange:e=>Ve(e===!0,`image`)}),(0,U.jsx)(`label`,{htmlFor:`select-all-image-models`,className:`text-sm cursor-pointer whitespace-nowrap`,children:`Select all models`})]}),(0,U.jsxs)(`div`,{className:`flex-1 relative`,children:[(0,U.jsx)(re,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground pointer-events-none`}),(0,U.jsx)(l,{placeholder:`Search models...`,className:`pl-10 h-8`,value:K,onChange:e=>q(e.target.value),disabled:!$})]}),(0,U.jsx)(L,{children:(0,U.jsxs)(`div`,{className:`flex items-center rounded-md border border-border p-0.5`,children:[(0,U.jsxs)(R,{children:[(0,U.jsx)(z,{asChild:!0,children:(0,U.jsx)(F,{type:`button`,variant:J===`alphabetical`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>Y(`alphabetical`),children:(0,U.jsx)(M,{className:`h-4 w-4`})})}),(0,U.jsx)(I,{children:`Sort A–Z`})]}),(0,U.jsxs)(R,{children:[(0,U.jsx)(z,{asChild:!0,children:(0,U.jsx)(F,{type:`button`,variant:J===`price-low`||J===`price-high`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>Y(`price-low`),children:(0,U.jsx)(ne,{className:`h-4 w-4`})})}),(0,U.jsx)(I,{children:`Sort by price`})]})]})})]}),C?(0,U.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,U.jsx)(r,{className:`h-5 w-5 animate-spin text-muted-foreground`})}):Z.length===0?(0,U.jsx)(`div`,{className:`text-center py-8`,children:(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No image models available for this provider.`})}):(0,U.jsx)(L,{children:(0,U.jsx)(`div`,{className:`grid grid-cols-1 gap-0 border border-border rounded-md overflow-hidden`,children:Ke.length===0?(0,U.jsx)(`div`,{className:`text-center py-8`,children:(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No models matching your filters.`})}):Ke.map(e=>{let t=Ee.has(e.id),n=Ae.has(e.id),r=Ae.get(e.id),a=n?r:t,o=e.pricing;return(0,U.jsxs)(`div`,{className:`flex items-center space-x-3 p-3 hover:bg-muted/30 transition-colors cursor-default border-b border-border last:border-b-0 ${$?``:`opacity-25`}`,children:[(0,U.jsx)(ce,{id:`image-${e.id}`,disabled:!$,checked:a??!1,onCheckedChange:()=>ze(e.id,`image`),className:`mt-0`}),(0,U.jsxs)(`div`,{className:`flex-1 flex items-center justify-between gap-3 leading-none`,children:[(0,U.jsx)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0`,children:(0,U.jsx)(`label`,{htmlFor:`image-${e.id}`,className:`text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer truncate`,children:Q(e)})}),o&&(0,U.jsx)(`span`,{className:`text-xs text-muted-foreground whitespace-nowrap flex-shrink-0`,children:(o.prompt??0)===0&&(o.completion??0)===0?``:`$${i(o.prompt??0)} in | $${i(o.completion??0)} out`})]})]},e.id)})})})]})})]}),be&&(0,U.jsx)(`div`,{className:`text-sm p-2 rounded-md ${be.includes(`error`)||be.includes(`Failed`)?`text-destructive bg-destructive/10`:`text-green-600 bg-green-50`}`,children:be})]})]})}):(0,U.jsx)(`div`,{className:o(`flex flex-1 items-center justify-center h-screen`,c),children:(0,U.jsxs)(`div`,{className:`text-center`,children:[(0,U.jsx)(`h2`,{className:`text-lg font-semibold text-muted-foreground mb-2`,children:`Select a Provider`}),(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Choose a provider from the sidebar to configure its settings.`})]})})}function K(e){let t=(0,V.c)(13),{providerName:n,provider:r,onClose:i}=e,a=n!==null,o;t[0]===i?o=t[1]:(o=e=>{e||i()},t[0]=i,t[1]=o);let s,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,U.jsx)(d,{className:`sr-only`,children:`Provider Setup`}),l=(0,U.jsx)(c,{className:`sr-only`,children:`Configure API keys and models for this provider.`}),t[2]=s,t[3]=l):(s=t[2],l=t[3]);let u;t[4]!==r||t[5]!==n?(u=n&&(0,U.jsx)(G,{selectedProviderName:n,providerData:r,className:`h-full`}),t[4]=r,t[5]=n,t[6]=u):u=t[6];let f;t[7]===u?f=t[8]:(f=(0,U.jsxs)(y,{className:`max-w-2xl h-[85vh] overflow-hidden p-0`,children:[s,l,u]}),t[7]=u,t[8]=f);let p;return t[9]!==a||t[10]!==o||t[11]!==f?(p=(0,U.jsx)(_,{open:a,onOpenChange:o,children:f}),t[9]=a,t[10]=o,t[11]=f,t[12]=p):p=t[12],p}function q(){let e=(0,V.c)(62),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let[n,r]=(0,H.useState)(t),i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i={},e[1]=i):i=e[1];let[a,o]=(0,H.useState)(i),[s,c]=(0,H.useState)(!0),[u,d]=(0,H.useState)(``),[f,p]=(0,H.useState)(null),[m,h]=(0,H.useState)(``),g,_;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{(function(){c(!0),d(``),Promise.all([A(),te().catch(ve)]).then(e=>{let[t,n]=e;r(t);let i={};for(let[e,t]of Object.entries(n))i[e]=t.length;o(i)}).catch(e=>{d(e instanceof Error?e.message:`Failed to load providers`)}).finally(()=>{c(!1)})})()},_=[],e[2]=g,e[3]=_):(g=e[2],_=e[3]),(0,H.useEffect)(g,_);let v,y,b,x,S,C,w,T,E;if(e[4]!==a||e[5]!==u||e[6]!==s||e[7]!==n||e[8]!==m){b=Symbol.for(`react.early_return_sentinel`);bb0:{let t;e[18]===m?t=e[19]:(t=e=>{let t=m.toLowerCase();return e.name.toLowerCase().includes(t)},e[18]=m,e[19]=t);let r;e[20]===a?r=e[21]:(r=(e,t)=>{let n=(a[e.slug]??0)>0,r=(a[t.slug]??0)>0;return n&&!r?-1:!n&&r?1:e.name.localeCompare(t.name)},e[20]=a,e[21]=r);let i=n.filter(_e).filter(t).sort(r),o;e[22]===m?o=e[23]:(o=e=>{let t=m.toLowerCase();return e.name.toLowerCase().includes(t)},e[22]=m,e[23]=o);let c=n.filter(ge).filter(o).sort(Y),d;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>{p(e)},e[24]=d):d=e[24];let f=d,g;if(e[25]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{p(null)},e[25]=g):g=e[25],v=g,s){let t;e[26]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,U.jsxs)(`div`,{className:`mb-6`,children:[(0,U.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Providers`}),(0,U.jsx)(`p`,{className:`text-muted-foreground`,children:`Manage your AI provider connections and API keys.`})]}),e[26]=t):t=e[26];let n;e[27]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,U.jsx)(`h2`,{className:`text-sm font-semibold text-muted-foreground uppercase tracking-wider mb-3`,children:`Connected Providers`}),e[27]=n):n=e[27];let r,i;e[28]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,U.jsxs)(`div`,{children:[n,(0,U.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:[(0,U.jsx)(B,{className:`h-24 rounded-lg`}),(0,U.jsx)(B,{className:`h-24 rounded-lg`})]})]}),i=(0,U.jsx)(`h2`,{className:`text-sm font-semibold text-muted-foreground uppercase tracking-wider mb-3`,children:`Available Providers`}),e[28]=r,e[29]=i):(r=e[28],i=e[29]);let a;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,U.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,U.jsxs)(`div`,{className:`max-w-4xl mx-auto p-6`,children:[t,(0,U.jsxs)(`div`,{className:`space-y-8`,children:[r,(0,U.jsxs)(`div`,{children:[i,(0,U.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:[(0,U.jsx)(B,{className:`h-24 rounded-lg`}),(0,U.jsx)(B,{className:`h-24 rounded-lg`}),(0,U.jsx)(B,{className:`h-24 rounded-lg`}),(0,U.jsx)(B,{className:`h-24 rounded-lg`})]})]})]})]})}),e[30]=a):a=e[30],b=a;break bb0}if(u){let t;e[31]===u?t=e[32]:(t=(0,U.jsx)(`p`,{className:`text-sm text-destructive mb-2`,children:u}),e[31]=u,e[32]=t);let n;e[33]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,U.jsx)(F,{variant:`outline`,size:`sm`,onClick:J,children:`Retry`}),e[33]=n):n=e[33];let r;e[34]===t?r=e[35]:(r=(0,U.jsx)(`div`,{className:`flex flex-1 items-center justify-center h-full`,children:(0,U.jsxs)(`div`,{className:`text-center`,children:[t,n]})}),e[34]=t,e[35]=r),b=r;break bb0}E=`flex-1 overflow-auto`,C=`max-w-4xl mx-auto p-6`,e[36]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,U.jsxs)(`div`,{className:`mb-6`,children:[(0,U.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Providers`}),(0,U.jsx)(`p`,{className:`text-muted-foreground`,children:`Manage your AI provider connections and API keys.`})]}),e[36]=w):w=e[36];let _;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,U.jsx)(re,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground pointer-events-none`}),e[37]=_):_=e[37];let D;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>h(e.target.value),e[38]=D):D=e[38],e[39]===m?T=e[40]:(T=(0,U.jsx)(`div`,{className:`mb-6`,children:(0,U.jsxs)(`div`,{className:`relative`,children:[_,(0,U.jsx)(l,{placeholder:`Search providers...`,className:`pl-10`,value:m,onChange:D})]})}),e[39]=m,e[40]=T),x=`space-y-8`;let O;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,U.jsx)(`h2`,{className:`text-sm font-semibold text-muted-foreground uppercase tracking-wider mb-3`,children:`Connected Providers`}),e[41]=O):O=e[41];let k=i.length===0?(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground py-4`,children:m?`No connected providers match your search.`:`No providers connected yet. Add an API key to get started.`}):(0,U.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:i.map(e=>(0,U.jsx)(ye,{provider:e,isConnected:!0,modelCount:a[e.slug]??0,onClick:f},e.name))});e[42]===k?S=e[43]:(S=(0,U.jsxs)(`section`,{children:[O,k]}),e[42]=k,e[43]=S);let A;e[44]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,U.jsx)(`h2`,{className:`text-sm font-semibold text-muted-foreground uppercase tracking-wider mb-3`,children:`Available Providers`}),e[44]=A):A=e[44],y=(0,U.jsxs)(`section`,{children:[A,c.length===0?(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground py-4`,children:m?`No available providers match your search.`:`All providers are connected.`}):(0,U.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:c.map(e=>(0,U.jsx)(ye,{provider:e,modelCount:a[e.slug]??0,onClick:f},e.name))})]})}e[4]=a,e[5]=u,e[6]=s,e[7]=n,e[8]=m,e[9]=v,e[10]=y,e[11]=b,e[12]=x,e[13]=S,e[14]=C,e[15]=w,e[16]=T,e[17]=E}else v=e[9],y=e[10],b=e[11],x=e[12],S=e[13],C=e[14],w=e[15],T=e[16],E=e[17];if(b!==Symbol.for(`react.early_return_sentinel`))return b;let D;e[45]!==y||e[46]!==x||e[47]!==S?(D=(0,U.jsxs)(`div`,{className:x,children:[S,y]}),e[45]=y,e[46]=x,e[47]=S,e[48]=D):D=e[48];let O;e[49]!==D||e[50]!==C||e[51]!==w||e[52]!==T?(O=(0,U.jsxs)(`div`,{className:C,children:[w,T,D]}),e[49]=D,e[50]=C,e[51]=w,e[52]=T,e[53]=O):O=e[53];let k=f?.name??null,ee=f??void 0,j;e[54]!==v||e[55]!==k||e[56]!==ee?(j=(0,U.jsx)(K,{providerName:k,provider:ee,onClose:v}),e[54]=v,e[55]=k,e[56]=ee,e[57]=j):j=e[57];let M;return e[58]!==O||e[59]!==j||e[60]!==E?(M=(0,U.jsxs)(`div`,{className:E,children:[O,j]}),e[58]=O,e[59]=j,e[60]=E,e[61]=M):M=e[61],M}function J(){return window.location.reload()}function Y(e,t){return e.name.localeCompare(t.name)}function ge(e){return!e.apiKey}function _e(e){return e.apiKey}function ve(){return{}}function ye(e){let t=(0,V.c)(27),{provider:r,isConnected:i,modelCount:o,onClick:c}=e,l=i===void 0?!1:i,u=o===void 0?0:o,[d,f]=(0,H.useState)(!1),p;t[0]!==c||t[1]!==r?(p=()=>c(r),t[0]=c,t[1]=r,t[2]=p):p=t[2];let m;t[3]!==d||t[4]!==r.name||t[5]!==r.slug?(m=(0,U.jsx)(`div`,{className:`flex-shrink-0 h-10 w-10 rounded-full bg-muted flex items-center justify-center overflow-hidden`,children:d?(0,U.jsx)(C,{className:`h-5 w-5 text-muted-foreground`}):(0,U.jsx)(`img`,{src:n(r.slug),alt:`${r.name} logo`,className:`h-6 w-6 dark:invert`,onError:()=>f(!0)})}),t[3]=d,t[4]=r.name,t[5]=r.slug,t[6]=m):m=t[6];let h;t[7]===r.name?h=t[8]:(h=(0,U.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,U.jsx)(`span`,{className:`font-medium text-sm truncate`,children:r.name})}),t[7]=r.name,t[8]=h);let g;t[9]===l?g=t[10]:(g=!l&&(0,U.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-muted-foreground mt-0.5`,children:[(0,U.jsx)(s,{className:`h-3 w-3`}),(0,U.jsx)(`span`,{children:`Click to configure`})]}),t[9]=l,t[10]=g);let _;t[11]!==h||t[12]!==g?(_=(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[h,g]}),t[11]=h,t[12]=g,t[13]=_):_=t[13];let v;t[14]!==m||t[15]!==_?(v=(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[m,_]}),t[14]=m,t[15]=_,t[16]=v):v=t[16];let y;t[17]!==l||t[18]!==u||t[19]!==r.isEnv?(y=l&&(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[r.isEnv?(0,U.jsxs)(W,{variant:`secondary`,className:`gap-1 text-xs px-2 py-0.5`,children:[(0,U.jsx)(O,{className:`h-3 w-3`}),`Environment`]}):(0,U.jsxs)(W,{variant:`secondary`,className:`gap-1 text-xs px-2 py-0.5`,children:[(0,U.jsx)(a,{className:`h-3 w-3`}),`API Key`]}),u>0&&(0,U.jsxs)(W,{variant:`default`,className:`gap-1 text-xs px-2 py-0.5`,children:[(0,U.jsx)(j,{className:`h-3 w-3`}),u,` `,u===1?`Model`:`Models`]})]}),t[17]=l,t[18]=u,t[19]=r.isEnv,t[20]=y):y=t[20];let b;t[21]!==v||t[22]!==y?(b=(0,U.jsxs)(P,{className:`p-4 flex flex-col gap-3`,children:[v,y]}),t[21]=v,t[22]=y,t[23]=b):b=t[23];let x;return t[24]!==b||t[25]!==p?(x=(0,U.jsx)(N,{className:`cursor-pointer transition-all hover:border-primary/50 hover:shadow-md`,onClick:p,children:b}),t[24]=b,t[25]=p,t[26]=x):x=t[26],x}export{q as ProvidersListView,q as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{$i as t,Er as n,Nr as r,_a as i,ha as a}from"./dialogs-config-BXDglGdB.js";import{a as o,i as s,o as c}from"./react-vendor-Bpg1hd5i.js";var l=a(),u=e(i(),1),d=r(),f=u.forwardRef((e,t)=>{let r=(0,l.c)(9),i,a;r[0]===e?(i=r[1],a=r[2]):({className:i,...a}=e,r[0]=e,r[1]=i,r[2]=a);let o;r[3]===i?o=r[4]:(o=n(`grid gap-2`,i),r[3]=i,r[4]=o);let s;return r[5]!==a||r[6]!==t||r[7]!==o?(s=(0,d.jsx)(c,{className:o,...a,ref:t}),r[5]=a,r[6]=t,r[7]=o,r[8]=s):s=r[8],s});f.displayName=c.displayName;var p=u.forwardRef((e,r)=>{let i=(0,l.c)(10),a,c;i[0]===e?(a=i[1],c=i[2]):({className:a,...c}=e,i[0]=e,i[1]=a,i[2]=c);let u;i[3]===a?u=i[4]:(u=n(`aspect-square h-4 w-4 rounded-full border border-brand text-brand ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,a),i[3]=a,i[4]=u);let f;i[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,d.jsx)(s,{className:`flex items-center justify-center`,children:(0,d.jsx)(t,{className:`h-2.5 w-2.5 fill-current text-current`})}),i[5]=f):f=i[5];let p;return i[6]!==c||i[7]!==r||i[8]!==u?(p=(0,d.jsx)(o,{ref:r,className:u,...c,children:f}),i[6]=c,i[7]=r,i[8]=u,i[9]=p):p=i[9],p});p.displayName=o.displayName;export{p as n,f as t};
|