@nextclaw/ui 0.15.19 → 0.15.20
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/CHANGELOG.md +18 -0
- package/dist/assets/{api-O5yEgzBt.js → api-tWUa6l9J.js} +3 -3
- package/dist/assets/app-presenter-provider-s-FrOinZ.js +106 -0
- package/dist/assets/appearance-settings-page-dMRBD7ni.js +1 -0
- package/dist/assets/{book-open-HtUSPwoS.js → book-open-BQ29ZmDE.js} +1 -1
- package/dist/assets/card-CtKueklV.js +1 -0
- package/dist/assets/{channels-list-page-Bspr1Jp4.js → channels-list-page-C8y3rqYt.js} +2 -2
- package/dist/assets/{chat-page-BKQ89f4s.js → chat-page-MXBltS3G.js} +1 -1
- package/dist/assets/config-split-page-uC6d_r9c.js +1 -0
- package/dist/assets/confirm-dialog-C1pbqHZX.js +5 -0
- package/dist/assets/desktop-update-config-DssP8LCk.js +1 -0
- package/dist/assets/{dist-CZx9Q6jc.js → dist-rYHnBo8t.js} +1 -1
- package/dist/assets/doc-browser-AXF1zRsM.js +1 -0
- package/dist/assets/{doc-browser-B4l0Xu7u.js → doc-browser-D8ng4EUc.js} +1 -1
- package/dist/assets/{doc-browser-context-Dy7EhLI8.js → doc-browser-context-CPHNzQ8m.js} +1 -1
- package/dist/assets/{eye-DU7p1-7X.js → eye-CiJz3ODY.js} +1 -1
- package/dist/assets/form-actions-BnZVzLZf.js +1 -0
- package/dist/assets/{index-6pHX0DZH.js → index-CocHWEsI.js} +2 -2
- package/dist/assets/loader-circle-AOpK5kkW.js +1 -0
- package/dist/assets/logo-badge-BXI-Kdhd.js +1 -0
- package/dist/assets/mcp-marketplace-page-5ogeBHnl.js +1 -0
- package/dist/assets/{mcp-marketplace-page-Dg03SZX1.js → mcp-marketplace-page-CxNe-Q9Q.js} +3 -3
- package/dist/assets/{model-config-page-DOBqLZoQ.js → model-config-page-CR_mgEVp.js} +1 -1
- package/dist/assets/{navigation-link-Ct6xtnVM.js → navigation-link-C1cvB7y4.js} +1 -1
- package/dist/assets/plus-DI37QuHc.js +1 -0
- package/dist/assets/{popover-C2oIpGBF.js → popover-ZoDwVwwd.js} +1 -1
- package/dist/assets/provider-scoped-model-input-DIL6Ex_d.js +1 -0
- package/dist/assets/{providers-config-page-BAVPJKpx.js → providers-config-page-D2NXVctW.js} +1 -1
- package/dist/assets/react-39CDNZlM.js +8 -0
- package/dist/assets/{refresh-cw-BZ8giusN.js → refresh-cw-DKewcdAl.js} +1 -1
- package/dist/assets/remote-DYOOO1YG.js +1 -0
- package/dist/assets/rotate-cw-PmqA8LQT.js +1 -0
- package/dist/assets/{runtime-config-page-D0244uxJ.js → runtime-config-page-0lb5NyKc.js} +1 -1
- package/dist/assets/{save-CSzFGRse.js → save-BrckuAXY.js} +1 -1
- package/dist/assets/{search-BmSWsiG2.js → search-BhXQB2TO.js} +1 -1
- package/dist/assets/{search-config-page-CrL1pUzy.js → search-config-page-DFOQ6SDJ.js} +1 -1
- package/dist/assets/{secrets-config-page-BlgsD0-L.js → secrets-config-page-BqqeClqE.js} +1 -1
- package/dist/assets/security-config-13AtPIlm.js +1 -0
- package/dist/assets/{select-CklWb6Rs.js → select-CVzGGT38.js} +1 -1
- package/dist/assets/{settings-2-BSZf8327.js → settings-2-BP6L2enG.js} +1 -1
- package/dist/assets/skeleton-OwCNQJ7M.js +1 -0
- package/dist/assets/{tabs-Cah5klko.js → tabs-B-QWjKCL.js} +1 -1
- package/dist/assets/{tag-chip-DcrirDgN.js → tag-chip-C88mxjwx.js} +1 -1
- package/dist/assets/{trash-2-BLQOULWD.js → trash-2-ck3t33I3.js} +1 -1
- package/dist/assets/{use-config-CuFIsUVG.js → use-config-BAr5bH2c.js} +1 -1
- package/dist/assets/use-confirm-dialog-C4e0nG_4.js +1 -0
- package/dist/assets/{use-viewport-layout-DU29bUJS.js → use-viewport-layout-k1isXfNm.js} +1 -1
- package/dist/assets/x-C1ijNWcE.js +1 -0
- package/dist/index.html +27 -27
- package/package.json +9 -9
- package/src/features/chat/features/conversation/hooks/__tests__/use-session-run-queue.test.tsx +28 -0
- package/src/features/chat/features/conversation/hooks/use-session-run-queue.ts +4 -5
- package/src/features/chat/features/input/hooks/__tests__/use-chat-input-surface-state.test.tsx +13 -0
- package/src/features/chat/features/input/hooks/use-chat-input-surface-state.ts +31 -8
- package/src/features/chat/features/input/input-surface-plugins/__tests__/context-reference-plugin.test.ts +79 -9
- package/src/features/chat/features/input/input-surface-plugins/__tests__/slash-command-plugin.test.ts +16 -4
- package/src/features/chat/features/input/input-surface-plugins/chat-input-product-plugin-adapters.types.ts +10 -2
- package/src/features/chat/features/input/input-surface-plugins/context-reference-items.utils.ts +240 -0
- package/src/features/chat/features/input/input-surface-plugins/context-reference-plugin.utils.ts +62 -173
- package/src/features/chat/features/input/utils/__tests__/chat-inline-token.utils.test.ts +29 -0
- package/src/features/chat/features/input/utils/chat-composer-token-protocol.utils.ts +5 -0
- package/src/features/chat/features/input/utils/chat-inline-token.utils.ts +26 -5
- package/src/features/chat/features/message/components/__tests__/chat-message-list.container.test.tsx +12 -1
- package/src/features/chat/features/message/components/chat-message-list.container.tsx +9 -5
- package/src/features/chat/pages/__tests__/ncp-chat-page.test.ts +26 -0
- package/src/shared/hooks/use-projects.ts +2 -1
- package/src/shared/lib/i18n/locales/en-US/chat.json +13 -4
- package/src/shared/lib/i18n/locales/zh-CN/chat.json +13 -4
- package/dist/assets/app-presenter-provider-DXTYtH78.js +0 -106
- package/dist/assets/appearance-settings-page-BuGxSvlJ.js +0 -1
- package/dist/assets/card-GkBc-UMw.js +0 -1
- package/dist/assets/config-split-page-CvLXSFSC.js +0 -1
- package/dist/assets/confirm-dialog-BVH7haN0.js +0 -5
- package/dist/assets/desktop-update-config-C9ZUI8UW.js +0 -1
- package/dist/assets/doc-browser-DsVF1DrS.js +0 -1
- package/dist/assets/form-actions-aM9_jSJC.js +0 -1
- package/dist/assets/loader-circle-Dd6jw700.js +0 -1
- package/dist/assets/logo-badge-2-iV1pkr.js +0 -1
- package/dist/assets/mcp-marketplace-page-C-d0RMfg.js +0 -1
- package/dist/assets/plus-CsgeRId8.js +0 -1
- package/dist/assets/provider-scoped-model-input-DDqCdnTU.js +0 -1
- package/dist/assets/react-CeMr9V52.js +0 -8
- package/dist/assets/remote-C-r0SHcz.js +0 -1
- package/dist/assets/rotate-cw-DVdRfMSO.js +0 -1
- package/dist/assets/security-config-cDrdpMJW.js +0 -1
- package/dist/assets/skeleton-DG9u1BmA.js +0 -1
- package/dist/assets/use-confirm-dialog-CcySmkWp.js +0 -1
- package/dist/assets/x-BVoeXny1.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DseTPa7n.js";import{C as t,E as n,O as r,i,r as a}from"./react-CeMr9V52.js";import{S as o,T as s,a as c,v as l}from"./app-presenter-provider-DXTYtH78.js";import{Bt as u,Ht as d,Ut as f,Vt as p,wt as m}from"./api-O5yEgzBt.js";import{a as h,i as g,n as _,r as v,t as y,w as b}from"./select-CklWb6Rs.js";import{r as x}from"./use-confirm-dialog-CcySmkWp.js";var S=e(r(),1);function C(){let{language:e,setLanguage:t}=x();return{currentLanguage:e,currentLanguageLabel:i.find(t=>t.value===e)?.label??e,languageOptions:i,selectLanguage:(0,S.useCallback)(n=>{e!==n&&(t(n),window.location.reload())},[e,t])}}var w=n(),T=[{value:`card`,labelKey:`chatMessageLayoutCard`,descriptionKey:`chatMessageLayoutCardDescription`},{value:`flat`,labelKey:`chatMessageLayoutFlat`,descriptionKey:`chatMessageLayoutFlatDescription`}];function E(){let{theme:e,setTheme:n}=l(),{currentLanguage:r,languageOptions:i,selectLanguage:x}=C(),S=s(e=>e.layout),E=s(e=>e.setLayout),D=c(e=>e.isVisible),O=c(e=>e.setVisible);return(0,w.jsx)(f,{title:a(`appearance`),children:(0,w.jsx)(d,{children:(0,w.jsxs)(p,{children:[(0,w.jsx)(u,{title:a(`theme`),control:(0,w.jsxs)(y,{value:e,onValueChange:e=>n(e),children:[(0,w.jsx)(g,{"aria-label":a(`theme`),className:`w-36 sm:w-44`,children:(0,w.jsx)(h,{})}),(0,w.jsx)(_,{children:o.map(e=>(0,w.jsx)(v,{value:e.value,children:a(e.labelKey)},e.value))})]})}),(0,w.jsx)(u,{title:a(`language`),control:(0,w.jsxs)(y,{value:r,onValueChange:e=>x(e),children:[(0,w.jsx)(g,{"aria-label":a(`language`),className:`w-36 sm:w-44`,children:(0,w.jsx)(h,{})}),(0,w.jsx)(_,{children:i.map(e=>(0,w.jsx)(v,{value:e.value,children:e.label},e.value))})]})}),(0,w.jsx)(u,{title:a(`chatMessageLayoutTitle`),description:a(`chatMessageLayoutDescription`),layout:`stacked`,children:(0,w.jsx)(`div`,{role:`radiogroup`,"aria-label":a(`chatMessageLayoutTitle`),className:`grid gap-1 rounded-xl bg-background/65 p-1 sm:grid-cols-2`,children:T.map(e=>{let n=e.value===S;return(0,w.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":n,onClick:()=>E(e.value),className:t(`flex min-w-0 items-start gap-3 rounded-lg px-3 py-2.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,n?`bg-card text-foreground shadow-sm`:`text-muted-foreground hover:bg-card/60 hover:text-foreground`),children:[(0,w.jsx)(`span`,{className:t(`mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full ring-1`,n?`bg-primary text-primary-foreground ring-primary`:`bg-background ring-border`),children:n?(0,w.jsx)(b,{className:`h-2.5 w-2.5`,strokeWidth:3}):null}),(0,w.jsxs)(`span`,{className:`min-w-0`,children:[(0,w.jsx)(`span`,{className:`block text-sm font-medium`,children:a(e.labelKey)}),(0,w.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-muted-foreground`,children:a(e.descriptionKey)})]})]},e.value)})})}),(0,w.jsx)(u,{title:a(`sideDockVisibilityTitle`),description:a(`sideDockVisibilityDescription`),control:(0,w.jsx)(m,{id:`appearance-side-dock-visible`,"aria-label":a(`sideDockVisibilityTitle`),checked:D,onCheckedChange:O})})]})})})}export{E as AppearanceSettingsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DseTPa7n.js";import{C as t,E as n,O as r}from"./react-CeMr9V52.js";import{c as i}from"./dist-CZx9Q6jc.js";var a=i(`Download`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`7 10 12 15 17 10`,key:`2ggqvy`}],[`line`,{x1:`12`,x2:`12`,y1:`15`,y2:`3`,key:`1vk2je`}]]),o=e(r(),1),s=n(),c=o.forwardRef(({className:e,hover:n=!0,surface:r=`raised`,...i},a)=>(0,s.jsx)(`div`,{ref:a,className:t(`rounded-2xl border bg-card text-card-foreground transition-colors duration-base`,r===`raised`?`border-border shadow-card`:`border-border/75 shadow-none`,n&&r===`raised`&&`hover:border-primary/25 hover:shadow-card-hover`,n&&r===`flat`&&`hover:bg-muted/40`,e),...i}));c.displayName=`Card`;var l=o.forwardRef(({className:e,...n},r)=>(0,s.jsx)(`div`,{ref:r,className:t(`flex flex-col space-y-1.5 p-6`,e),...n}));l.displayName=`CardHeader`;var u=o.forwardRef(({className:e,...n},r)=>(0,s.jsx)(`h3`,{ref:r,className:t(`text-[15px] font-semibold leading-tight tracking-tight text-foreground`,e),...n}));u.displayName=`CardTitle`;var d=o.forwardRef(({className:e,...n},r)=>(0,s.jsx)(`p`,{ref:r,className:t(`text-[13px] text-muted-foreground leading-relaxed`,e),...n}));d.displayName=`CardDescription`;var f=o.forwardRef(({className:e,...n},r)=>(0,s.jsx)(`div`,{ref:r,className:t(`p-6 pt-0`,e),...n}));f.displayName=`CardContent`;var p=o.forwardRef(({className:e,...n},r)=>(0,s.jsx)(`div`,{ref:r,className:t(`flex items-center justify-between p-6 pt-0`,e),...n}));p.displayName=`CardFooter`;export{u as a,l as i,f as n,a as o,d as r,c as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DseTPa7n.js";import{C as t,E as n,O as r,r as i}from"./react-CeMr9V52.js";import{n as a}from"./search-BmSWsiG2.js";var o=e(r(),1),s=n(),c=`min-w-0 overflow-hidden bg-card/70 text-card-foreground md:h-[calc(100vh-180px)] md:max-h-[860px]`,l=`min-h-0 overflow-hidden rounded-2xl bg-muted/30 ring-1 ring-border/45`,u=640;function d({className:e,children:n,compactView:r,onMobileBack:c,mobileListLabel:d,...f}){let p=(0,o.useRef)(null),[m,h]=(0,o.useState)(!1),[g,_,...v]=o.Children.toArray(n);(0,o.useEffect)(()=>{let e=p.current;if(!e||!r||typeof ResizeObserver>`u`)return;let t=()=>h(e.clientWidth>0&&e.clientWidth<u),n=new ResizeObserver(t);return n.observe(e),t(),()=>n.disconnect()},[r]);let y=!!(m&&r&&g&&_);return(0,s.jsx)(`div`,{ref:p,className:t(`min-h-0 md:flex-1`,e),...f,children:y?(0,s.jsxs)(`div`,{className:`space-y-3`,children:[r===`detail`?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(`button`,{type:`button`,onClick:c,className:`inline-flex items-center gap-2 rounded-lg px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,children:[(0,s.jsx)(a,{className:`h-4 w-4`}),(0,s.jsx)(`span`,{children:d??i(`backToMain`)})]}),(0,s.jsx)(`div`,{className:l,children:_})]}):(0,s.jsx)(`div`,{className:l,children:g}),v]}):(0,s.jsx)(`div`,{className:t(l,`grid grid-cols-1 md:grid-cols-[minmax(240px,30%)_minmax(0,1fr)]`),children:n})})}function f({className:e,...n}){return(0,s.jsx)(`section`,{className:t(c,`flex flex-col md:border-r md:border-border/55`,e),...n})}function p({className:e,...n}){return(0,s.jsx)(`section`,{className:t(c,`flex flex-col`,e),...n})}function m({className:e,...n}){return(0,s.jsx)(`section`,{className:t(c,`flex items-center justify-center px-6 py-12 text-center`,e),...n})}function h({className:e,...n}){return(0,s.jsx)(`div`,{className:t(`shrink-0 border-b border-border/70`,e),...n})}function g({className:e,scrollOnDesktop:n=!0,...r}){return(0,s.jsx)(`div`,{className:t(`min-h-0 flex-1`,n&&`overflow-visible md:overflow-y-auto md:overscroll-contain`,e),...r})}function _({className:e,...n}){return(0,s.jsx)(`div`,{className:t(`shrink-0 border-t border-border/70 px-4 py-2.5`,e),...n})}function v({active:e=!1,className:n,type:r=`button`,...i}){return(0,s.jsx)(`button`,{type:r,className:t(`w-full rounded-xl p-2.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,e?`bg-background/95 text-foreground shadow-sm`:`bg-transparent text-muted-foreground hover:bg-background/65 hover:text-foreground`,n),...i})}function y({icon:e,title:n,description:r,className:i,...a}){return(0,s.jsxs)(`div`,{className:t(`flex min-h-[220px] flex-col items-center justify-center rounded-xl bg-background/55 px-4 py-10 text-center`,i),...a,children:[(0,s.jsx)(`div`,{className:`mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-card`,children:(0,s.jsx)(e,{className:`h-5 w-5 text-muted-foreground/45`})}),(0,s.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:n}),r?(0,s.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:r}):null]})}export{d as a,h as c,y as i,f as l,p as n,g as o,m as r,_ as s,v as t};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DseTPa7n.js";import{C as t,E as n,O as r,r as i}from"./react-CeMr9V52.js";import{qt as a}from"./api-O5yEgzBt.js";import{C as o,S as s,T as c,_ as l,b as u,d,f as ee,g as f,l as te,m as ne,p as re,u as ie,w as p,y as ae}from"./dist-CZx9Q6jc.js";import{d as m}from"./popover-C2oIpGBF.js";import{t as oe}from"./x-BVoeXny1.js";var h=e(r(),1),g=n(),_=`Dialog`,[v,se]=o(_),[ce,y]=v(_),b=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=h.useRef(null),c=h.useRef(null),[l,d]=ae({prop:r,defaultProp:i??!1,onChange:a,caller:_});return(0,g.jsx)(ce,{scope:t,triggerRef:s,contentRef:c,contentId:u(),titleId:u(),descriptionId:u(),open:l,onOpenChange:d,onOpenToggle:h.useCallback(()=>d(e=>!e),[d]),modal:o,children:n})};b.displayName=_;var x=`DialogTrigger`,S=h.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=y(x,n),a=p(t,i.triggerRef);return(0,g.jsx)(f.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":L(i.open),...r,ref:a,onClick:c(e.onClick,i.onOpenToggle)})});S.displayName=x;var C=`DialogPortal`,[le,w]=v(C,{forceMount:void 0}),T=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=y(C,t);return(0,g.jsx)(le,{scope:t,forceMount:n,children:h.Children.map(r,e=>(0,g.jsx)(m,{present:n||a.open,children:(0,g.jsx)(ee,{asChild:!0,container:i,children:e})}))})};T.displayName=C;var E=`DialogOverlay`,D=h.forwardRef((e,t)=>{let n=w(E,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=y(E,e.__scopeDialog);return a.modal?(0,g.jsx)(m,{present:r||a.open,children:(0,g.jsx)(de,{...i,ref:t})}):null});D.displayName=E;var ue=l(`DialogOverlay.RemoveScroll`),de=h.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=y(E,n);return(0,g.jsx)(ie,{as:ue,allowPinchZoom:!0,shards:[i.contentRef],children:(0,g.jsx)(f.div,{"data-state":L(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),O=`DialogContent`,k=h.forwardRef((e,t)=>{let n=w(O,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=y(O,e.__scopeDialog);return(0,g.jsx)(m,{present:r||a.open,children:a.modal?(0,g.jsx)(fe,{...i,ref:t}):(0,g.jsx)(pe,{...i,ref:t})})});k.displayName=O;var fe=h.forwardRef((e,t)=>{let n=y(O,e.__scopeDialog),r=h.useRef(null),i=p(t,n.contentRef,r);return h.useEffect(()=>{let e=r.current;if(e)return te(e)},[]),(0,g.jsx)(A,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:c(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:c(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:c(e.onFocusOutside,e=>e.preventDefault())})}),pe=h.forwardRef((e,t)=>{let n=y(O,e.__scopeDialog),r=h.useRef(!1),i=h.useRef(!1);return(0,g.jsx)(A,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),A=h.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=y(O,n),c=h.useRef(null),l=p(t,c);return d(),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(re,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,g.jsx)(ne,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":L(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(he,{titleId:s.titleId}),(0,g.jsx)(_e,{contentRef:c,descriptionId:s.descriptionId})]})]})}),j=`DialogTitle`,M=h.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=y(j,n);return(0,g.jsx)(f.h2,{id:i.titleId,...r,ref:t})});M.displayName=j;var N=`DialogDescription`,P=h.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=y(N,n);return(0,g.jsx)(f.p,{id:i.descriptionId,...r,ref:t})});P.displayName=N;var F=`DialogClose`,I=h.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=y(F,n);return(0,g.jsx)(f.button,{type:`button`,...r,ref:t,onClick:c(e.onClick,()=>i.onOpenChange(!1))})});I.displayName=F;function L(e){return e?`open`:`closed`}var R=`DialogTitleWarning`,[me,z]=s(R,{contentName:O,titleName:j,docsSlug:`dialog`}),he=({titleId:e})=>{let t=z(R),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
2
|
-
|
|
3
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
4
|
-
|
|
5
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},ge=`DialogDescriptionWarning`,_e=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${z(ge).contentName}}.`;return h.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},B=b,ve=S,V=T,H=D,U=k,W=M,G=P,K=I,q=B,ye=V,J=h.forwardRef(({className:e,...n},r)=>(0,g.jsx)(H,{ref:r,className:t(`fixed inset-0 z-[var(--z-modal-backdrop,10000)] bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...n}));J.displayName=H.displayName;var Y=h.forwardRef(({className:e,children:n,...r},i)=>(0,g.jsxs)(ye,{children:[(0,g.jsx)(J,{}),(0,g.jsxs)(U,{ref:i,className:t(`fixed left-[50%] top-[50%] z-[var(--z-modal,10050)] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-2xl border border-border bg-popover p-6 text-popover-foreground shadow-xl duration-base data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]`,e),...r,children:[n,(0,g.jsxs)(K,{className:`absolute right-4 top-4 rounded-lg p-1 opacity-70 transition-all duration-fast hover:bg-accent hover:text-accent-foreground hover:opacity-100 focus:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:pointer-events-none`,children:[(0,g.jsx)(oe,{className:`h-4 w-4 text-muted-foreground`}),(0,g.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));Y.displayName=U.displayName;var X=({className:e,...n})=>(0,g.jsx)(`div`,{className:t(`flex flex-col space-y-2 text-center sm:text-left`,e),...n});X.displayName=`DialogHeader`;var Z=({className:e,...n})=>(0,g.jsx)(`div`,{className:t(`flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-3`,e),...n});Z.displayName=`DialogFooter`;var Q=h.forwardRef(({className:e,...n},r)=>(0,g.jsx)(W,{ref:r,className:t(`text-lg font-semibold leading-tight tracking-tight text-foreground`,e),...n}));Q.displayName=W.displayName;var $=h.forwardRef(({className:e,...n},r)=>(0,g.jsx)(G,{ref:r,className:t(`text-sm text-muted-foreground leading-relaxed`,e),...n}));$.displayName=G.displayName;var be=({open:e,onOpenChange:t,title:n,description:r,confirmLabel:o=i(`confirm`),cancelLabel:s=i(`cancel`),variant:c=`default`,onConfirm:l,onCancel:u})=>(0,g.jsx)(q,{open:e,onOpenChange:t,children:(0,g.jsxs)(Y,{className:`[&>:last-child]:hidden`,onCloseAutoFocus:e=>e.preventDefault(),children:[(0,g.jsxs)(X,{children:[(0,g.jsx)(Q,{children:n}),r?(0,g.jsx)($,{children:r}):null]}),(0,g.jsxs)(Z,{className:`gap-2 sm:gap-0`,children:[(0,g.jsx)(a,{type:`button`,variant:`outline`,onClick:()=>{u(),t(!1)},children:s}),(0,g.jsx)(a,{type:`button`,variant:c===`destructive`?`destructive`:`default`,onClick:()=>{l(),t(!1)},children:o})]})]})});export{Z as a,K as c,H as d,V as f,ve as h,$ as i,U as l,W as m,q as n,X as o,B as p,Y as r,Q as s,be as t,G as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as e,E as t,a as n,n as r,r as i}from"./react-CeMr9V52.js";import{$t as a,At as o,Bt as s,Dt as c,Et as l,Ht as u,Ot as d,Ut as f,Vt as p,jt as m,qt as h}from"./api-O5yEgzBt.js";import{a as g,i as _,n as v,r as y,t as b}from"./select-CklWb6Rs.js";import{a as x,i as S,n as C,o as w,r as T,t as E}from"./card-GkBc-UMw.js";import{t as D}from"./navigation-link-Ct6xtnVM.js";import{t as O}from"./refresh-cw-BZ8giusN.js";import{t as k}from"./rotate-cw-DVdRfMSO.js";var A=t(),j={checking:`desktopUpdatesStatusChecking`,"update-available":`desktopUpdatesStatusAvailable`,downloading:`desktopUpdatesStatusDownloading`,downloaded:`desktopUpdatesStatusDownloaded`,"up-to-date":`desktopUpdatesStatusUpToDate`,blocked:`desktopUpdatesStatusBlocked`,failed:`desktopUpdatesStatusFailed`},M={feature:`desktopUpdatesReleaseNotesFeature`,enhancement:`desktopUpdatesReleaseNotesEnhancement`,fix:`desktopUpdatesReleaseNotesFix`,compatibility:`desktopUpdatesReleaseNotesCompatibility`};function N({snapshot:t}){return(0,A.jsx)(`span`,{className:e(`inline-flex rounded-full px-3 py-1 text-xs font-medium ring-1`,H(t.status)),children:V(t)})}function P({label:e,value:t}){return(0,A.jsxs)(`div`,{className:`rounded-lg bg-background/70 p-3`,children:[(0,A.jsx)(`p`,{className:`text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground`,children:e}),(0,A.jsx)(`p`,{className:`mt-1 text-sm font-semibold text-foreground`,children:t})]})}function F({snapshot:e}){if(e.status!==`downloading`)return null;let t=e.progress?.percent,n=t==null?i(`desktopUpdatesDownloadProgressUnknown`):i(`desktopUpdatesDownloadProgressPercent`).replace(`{percent}`,String(t)),r=R(e.progress?.downloadedBytes??0,e.progress?.totalBytes??null);return(0,A.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 p-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-amber-800`,children:n}),(0,A.jsx)(`p`,{className:`text-xs font-medium text-amber-700`,children:r})]}),(0,A.jsx)(`div`,{className:`mt-3 h-2 overflow-hidden rounded-full bg-amber-100`,children:(0,A.jsx)(`div`,{className:`h-full rounded-full bg-amber-500 transition-[width]`,style:{width:`${t??0}%`}})})]})}function I(e){return e?.trim()||`-`}function L(e){return e?r(e):`-`}function R(e,t){let n=z(e);return t&&t>0?`${n} / ${z(t)}`:n}function z(e){if(!Number.isFinite(e)||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n>=10||r===0?n.toFixed(0):n.toFixed(1)} ${t[r]}`}function B(e){return i(e===`beta`?`desktopUpdatesChannelBeta`:`desktopUpdatesChannelStable`)}function V(e){return e.status===`failed`&&e.failureStage?i(`desktopUpdatesFailureStage.${e.failureStage}`):i(j[e.status]??`desktopUpdatesStatusIdle`)}function H(e){return e===`downloaded`?`bg-emerald-50 text-emerald-700 ring-emerald-100`:e===`update-available`||e===`downloading`||e===`checking`?`bg-amber-50 text-amber-700 ring-amber-100`:e===`failed`||e===`blocked`?`bg-red-50 text-red-700 ring-red-100`:`bg-gray-100 text-gray-700 ring-gray-200`}function U(){return n()===`zh`?`zh-CN`:`en-US`}function W(e,t){return c(e.title,t)??i(M[e.kind]??`desktopUpdatesReleaseNotesEnhancement`)}function G({snapshot:e}){let t=d(e),n=U(),r=a({queryKey:[`runtime-release-notes`,t],queryFn:async()=>await l(t??``),enabled:!!t,retry:!1,staleTime:300*1e3}),o=r.data,s=c(o?.title,n)??i(`desktopUpdatesReleaseNotesPreviewTitle`),u=c(o?.summary,n)??i(`desktopUpdatesReleaseNotesPreviewDescription`);return e.releaseNotesUrl?(0,A.jsxs)(E,{children:[(0,A.jsx)(S,{children:(0,A.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,A.jsxs)(`div`,{className:`space-y-1`,children:[(0,A.jsx)(x,{children:s}),(0,A.jsx)(T,{children:u})]}),(0,A.jsx)(D,{href:e.releaseNotesUrl,external:!0,children:i(`desktopUpdatesReleaseNotes`)})]})}),(0,A.jsxs)(C,{className:`space-y-4`,children:[r.isLoading?(0,A.jsx)(`p`,{className:`text-sm text-gray-500`,children:i(`desktopUpdatesReleaseNotesPreviewLoading`)}):null,!t||r.isError?(0,A.jsx)(`p`,{className:`text-sm text-gray-500`,children:i(`desktopUpdatesReleaseNotesPreviewUnavailable`)}):null,o?(0,A.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:o.sections.map(e=>(0,A.jsxs)(`div`,{className:`rounded-xl border border-gray-200 bg-gray-50/60 p-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:W(e,n)}),(0,A.jsx)(`ul`,{className:`mt-3 space-y-3`,children:e.items.map((t,r)=>{let i=c(t.title,n),a=c(t.body,n);return(0,A.jsxs)(`li`,{className:`space-y-1`,children:[i?(0,A.jsx)(`p`,{className:`text-sm font-medium text-gray-800`,children:i}):null,a?(0,A.jsx)(`p`,{className:`text-sm leading-5 text-gray-600`,children:a}):null]},`${i??e.kind}-${r}`)})})]},e.kind))}):null]})]}):null}function K(){return(0,A.jsx)(f,{title:i(`runtimeUpdatesPageTitle`),description:i(`runtimeUpdatesPageDescription`),children:(0,A.jsx)(u,{title:i(`runtimeUpdatesUnavailableTitle`),description:i(`runtimeUpdatesUnavailableDescription`),children:(0,A.jsx)(p,{children:(0,A.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground`,children:i(`runtimeUpdatesUnavailableHint`)})})})})}function q(){let{supported:t,initialized:n,busyAction:r,snapshot:a}=m();if(!n)return(0,A.jsx)(f,{title:i(`runtimeUpdatesPageTitle`),description:i(`runtimeUpdatesPageDescription`),children:(0,A.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:i(`loading`)})});if(!t||!a)return(0,A.jsx)(K,{});let c=r===`checking`,l=r===`downloading`,d=r===`applying`,x=r===`switching-channel`,S=a.status===`update-available`&&!l&&!d,C=a.status===`downloaded`&&!d,T=[[i(`runtimeUpdatesHostVersion`),I(a.hostVersion)],[i(`desktopUpdatesCurrentBundleVersion`),I(a.currentVersion)],[i(`desktopUpdatesAvailableVersion`),I(a.availableVersion)],[i(`desktopUpdatesLastCheckedAt`),L(a.lastCheckedAt)],[i(`desktopUpdatesCurrentChannel`),B(a.channel)]];return(0,A.jsxs)(f,{title:i(`runtimeUpdatesPageTitle`),description:i(`runtimeUpdatesPageDescription`),actions:(0,A.jsxs)(h,{variant:`outline`,onClick:()=>void o.checkForUpdates(),disabled:c||l||d,children:[(0,A.jsx)(O,{className:e(`mr-2 h-4 w-4`,c&&`animate-spin`)}),i(`desktopUpdatesCheckNow`)]}),children:[(0,A.jsx)(u,{title:i(`desktopUpdatesOverviewTitle`),description:i(`desktopUpdatesOverviewDescription`),children:(0,A.jsx)(p,{children:(0,A.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,A.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:i(`desktopUpdatesStatusLabel`)}),(0,A.jsx)(N,{snapshot:a})]}),(0,A.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-5`,children:T.map(([e,t])=>(0,A.jsx)(P,{label:e,value:t},e))}),a.channel===`beta`?(0,A.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 p-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-amber-800`,children:i(`desktopUpdatesBetaBadgeTitle`)}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-amber-700`,children:i(`desktopUpdatesBetaBadgeDescription`)})]}):null,a.downloadedVersion?(0,A.jsxs)(`div`,{className:`rounded-2xl border border-emerald-200 bg-emerald-50/70 p-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-emerald-800`,children:i(`desktopUpdatesDownloadedBannerTitle`)}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-emerald-700`,children:i(`runtimeUpdatesDownloadedBannerDescription`).replace(`{version}`,a.downloadedVersion)})]}):null,(0,A.jsx)(F,{snapshot:a}),a.status===`blocked`?(0,A.jsxs)(`div`,{className:`rounded-2xl border border-red-200 bg-red-50/70 p-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-red-800`,children:i(`desktopUpdatesBlockedTitle`)}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-red-700`,children:a.errorMessage??i(`desktopUpdatesBlockedDescription`)}),a.recoveryCommand?(0,A.jsx)(`code`,{className:`mt-3 block rounded-lg bg-white/70 px-3 py-2 text-xs text-red-800`,children:a.recoveryCommand}):null]}):null,a.errorMessage&&a.status!==`blocked`?(0,A.jsx)(`div`,{className:`rounded-2xl border border-red-200 bg-red-50/70 p-4 text-sm text-red-700`,children:a.errorMessage}):null]})})}),(0,A.jsx)(G,{snapshot:a}),(0,A.jsx)(u,{title:i(`desktopUpdatesChannelSettingsTitle`),description:i(`desktopUpdatesChannelSettingsDescription`),children:(0,A.jsx)(p,{children:(0,A.jsx)(s,{title:i(`desktopUpdatesReleaseChannel`),description:i(`desktopUpdatesReleaseChannelHelp`),layout:`stacked`,children:(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsxs)(b,{value:a.channel,disabled:x||c||l||d,onValueChange:e=>void o.updateChannel(e),children:[(0,A.jsx)(_,{className:`w-full max-w-sm`,children:(0,A.jsx)(g,{placeholder:i(`desktopUpdatesReleaseChannel`)})}),(0,A.jsxs)(v,{children:[(0,A.jsx)(y,{value:`stable`,children:i(`desktopUpdatesChannelStable`)}),(0,A.jsx)(y,{value:`beta`,children:i(`desktopUpdatesChannelBeta`)})]})]}),(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i(`desktopUpdatesReleaseChannelDowngradeHint`)})]})})})}),(0,A.jsx)(u,{title:i(`desktopUpdatesActionsTitle`),description:i(`runtimeUpdatesActionsDescription`),children:(0,A.jsx)(p,{children:(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 p-4`,children:[(0,A.jsxs)(h,{variant:`outline`,onClick:()=>void o.checkForUpdates(),disabled:c||l||d,children:[(0,A.jsx)(O,{className:e(`mr-2 h-4 w-4`,c&&`animate-spin`)}),i(`desktopUpdatesCheckNow`)]}),(0,A.jsxs)(h,{onClick:()=>void o.downloadUpdate(),disabled:!S,children:[(0,A.jsx)(w,{className:e(`mr-2 h-4 w-4`,l&&`animate-bounce`)}),i(`desktopUpdatesDownloadNow`)]}),(0,A.jsxs)(h,{variant:`secondary`,onClick:()=>void o.applyDownloadedUpdate(),disabled:!C,children:[(0,A.jsx)(k,{className:e(`mr-2 h-4 w-4`,d&&`animate-spin`)}),i(`runtimeUpdatesApplyNow`)]})]})})})]})}export{q as DesktopUpdateConfig};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./doc-browser-B4l0Xu7u.js";export{e as DocBrowser};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as e,E as t}from"./react-CeMr9V52.js";var n=t();function r({align:t=`end`,className:r,...i}){return(0,n.jsx)(`div`,{className:e(`flex flex-wrap items-center gap-2`,t===`start`&&`justify-start`,t===`end`&&`justify-end`,t===`between`&&`justify-between`,r),...i})}export{r as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e}from"./dist-CZx9Q6jc.js";var t=e(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DseTPa7n.js";import{C as t,E as n,O as r}from"./react-CeMr9V52.js";var i=n(),a={active:{dot:`bg-emerald-500`,text:`text-emerald-600`,bg:`bg-emerald-50`},ready:{dot:`bg-emerald-500`,text:`text-emerald-600`,bg:`bg-emerald-50`},inactive:{dot:`bg-gray-300`,text:`text-gray-400`,bg:`bg-gray-100/80`},setup:{dot:`bg-gray-300`,text:`text-gray-400`,bg:`bg-gray-100/80`},warning:{dot:`bg-amber-400`,text:`text-amber-600`,bg:`bg-amber-50`}};function o({status:e,label:n,className:r}){let o=a[e];return(0,i.jsxs)(`div`,{className:t(`inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full px-2 py-0.5`,o.bg,r),children:[(0,i.jsx)(`span`,{className:t(`h-1.5 w-1.5 rounded-full`,o.dot)}),(0,i.jsx)(`span`,{className:t(`text-[11px] font-medium`,o.text),children:n})]})}var s=e(r(),1);function c({name:e,src:n,className:r,imgClassName:a,fallback:o}){let[c,l]=(0,s.useState)(!1),u=!!n&&!c;return(0,i.jsx)(`div`,{className:t(`inline-flex shrink-0 items-center justify-center overflow-hidden`,r),children:u?(0,i.jsx)(`img`,{src:n,alt:`${e} logo`,className:t(`block h-6 w-6 object-contain`,a),onError:()=>l(!0),draggable:!1}):o??(0,i.jsx)(`span`,{className:`text-lg font-bold uppercase`,children:e.slice(0,1)})})}export{o as n,c as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./mcp-marketplace-page-Dg03SZX1.js";export{e as McpMarketplacePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e}from"./dist-CZx9Q6jc.js";var t=e(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DseTPa7n.js";import{C as t,E as n,O as r,r as i}from"./react-CeMr9V52.js";import{Kt as a}from"./api-O5yEgzBt.js";import{c as o}from"./dist-CZx9Q6jc.js";import{a as s,n as c,r as l,t as u}from"./popover-C2oIpGBF.js";import{a as d,i as f,n as p,r as m,t as h,w as g}from"./select-CklWb6Rs.js";import{i as _,l as v,r as y}from"./provider-models-CXUgDxGR.js";var b=o(`ChevronsUpDown`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),x=e(r(),1),S=n(),C=s(`15rem`);function w(e){return[...new Set(e.map(e=>e.trim()).filter(Boolean))]}function T({id:e,value:n,onChange:r,options:i,disabled:o=!1,placeholder:s,className:d,inputClassName:f,emptyText:p,createText:m,toggleLabel:h,maxItems:_=1/0,onEnter:v}){let[y,T]=(0,x.useState)(!1),E=(0,x.useRef)(null);(0,x.useEffect)(()=>{o&&y&&T(!1)},[o,y]);let D=(0,x.useMemo)(()=>w(i),[i]),O=n.trim().toLowerCase(),k=(0,x.useMemo)(()=>{let e=D.map((e,t)=>({option:e,index:t}));O.length>0&&e.sort((e,t)=>{let n=e.option.toLowerCase(),r=t.option.toLowerCase(),i=n===O?0:n.startsWith(O)?1:n.includes(O)?2:3,a=r===O?0:r.startsWith(O)?1:r.includes(O)?2:3;return i===a?e.index-t.index:i-a});let t=e.map(e=>e.option);return Number.isFinite(_)?t.slice(0,Math.max(1,_)):t},[D,O,_]),A=n.trim().length>0&&D.some(e=>e===n.trim()),j=()=>T(!1);return(0,S.jsxs)(u,{open:y&&!o,onOpenChange:e=>T(!o&&e),children:[(0,S.jsx)(c,{asChild:!0,children:(0,S.jsxs)(`div`,{ref:E,className:t(`relative`,d),children:[(0,S.jsx)(a,{id:e,value:n,disabled:o,onFocus:()=>{o||T(!0)},onChange:e=>{r(e.target.value),!y&&!o&&T(!0)},onKeyDown:e=>{e.key===`Enter`&&(v&&(e.preventDefault(),v()),j())},placeholder:s,className:t(`pr-10`,f)}),(0,S.jsx)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>T(e=>!e),disabled:o,className:t(`absolute inset-y-0 right-0 inline-flex w-10 items-center justify-center`,o?`cursor-not-allowed text-gray-300`:`text-gray-400 hover:text-gray-600`),"aria-label":h,children:(0,S.jsx)(b,{className:`h-4 w-4`})})]})}),(0,S.jsx)(l,{align:`start`,className:`flex w-[var(--radix-popover-trigger-width)] min-w-[12rem] flex-col overflow-hidden rounded-xl border border-gray-200 p-0 shadow-lg`,onInteractOutside:e=>{e.target instanceof Node&&E.current?.contains(e.target)&&e.preventDefault()},onOpenAutoFocus:e=>e.preventDefault(),style:{maxHeight:C},children:(0,S.jsxs)(`div`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto py-1`,children:[!A&&n.trim().length>0&&(0,S.jsxs)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>{r(n.trim()),j()},className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-gray-50`,children:[(0,S.jsx)(g,{className:`h-4 w-4 text-transparent`}),(0,S.jsx)(`span`,{className:`truncate text-gray-700`,children:m.replace(`{value}`,n.trim())})]}),k.map(e=>(0,S.jsxs)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>{r(e),j()},className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-gray-50`,children:[(0,S.jsx)(g,{className:t(`h-4 w-4`,e===n.trim()?`text-primary`:`text-transparent`)}),(0,S.jsx)(`span`,{className:`truncate text-gray-700`,children:e})]},e)),k.length===0&&n.trim().length===0&&(0,S.jsx)(`div`,{className:`px-3 py-2 text-sm text-gray-500`,children:p})]})})]})}var E=`provider/model`;function D(e){let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}return[...t]}function O({id:e,value:t,onChange:n,providerCatalog:r,disabled:o=!1,providerPlaceholder:s,modelPlaceholder:c,className:l}){let[u,g]=(0,x.useState)(``),[b,C]=(0,x.useState)(``),w=r.length>0,O=c??E,k=(0,x.useMemo)(()=>new Map(r.map(e=>[e.name,e])),[r]),A=k.get(u),j=(0,x.useMemo)(()=>A?.aliases??[],[A]),M=(0,x.useMemo)(()=>D(A?.models??[]),[A]);return(0,x.useEffect)(()=>{let e=t.trim();if(!w){g(``),C(e);return}if(!e){C(``),g(e=>k.has(e)?e:``);return}let n=_(e,r)??``,i=k.get(n)?.aliases??[];g(n),C(n?v(e,i):e)},[w,r,k,t]),w?(0,S.jsxs)(`div`,{className:l,children:[(0,S.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,children:[(0,S.jsx)(`div`,{className:`sm:w-[38%] sm:min-w-[170px]`,children:(0,S.jsxs)(h,{value:u,onValueChange:e=>{let t=D(k.get(e)?.models??[])[0]??``;if(g(e),C(t),!t){n(``);return}n(y(k.get(e)?.prefix??e,t))},disabled:o,children:[(0,S.jsx)(f,{className:`h-10 w-full rounded-xl`,children:(0,S.jsx)(d,{placeholder:s??i(`providersSelectPlaceholder`)})}),(0,S.jsx)(p,{children:r.map(e=>(0,S.jsx)(m,{value:e.name,children:e.displayName},e.name))})]})}),(0,S.jsx)(`span`,{className:`hidden h-10 items-center justify-center leading-none text-lg font-semibold text-gray-300 sm:inline-flex`,children:`/`}),(0,S.jsx)(T,{id:e,value:b,onChange:e=>{if(!A){let t=e.trim();C(t),n(t);return}let t=v(e,j);C(t),n(t?y(A.prefix,t):``)},options:M,disabled:o||!u,placeholder:O,className:`sm:flex-1`,inputClassName:`h-10 rounded-xl`,emptyText:i(`modelPickerNoOptions`),createText:i(`modelPickerUseCustom`),toggleLabel:i(`modelPickerToggleOptions`)},u)]}),(0,S.jsx)(`p`,{className:`mt-2 text-xs text-gray-500`,children:i(`modelInputCustomHint`)})]}):(0,S.jsxs)(`div`,{className:l,children:[(0,S.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 px-4 py-3`,children:[(0,S.jsx)(`p`,{className:`text-sm font-semibold text-amber-950`,children:i(`providersEmptyTitle`)}),(0,S.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-amber-900`,children:i(`providersEmptyDescription`)})]}),(0,S.jsx)(a,{id:e,value:t,disabled:o,onChange:e=>n(e.target.value),placeholder:O,className:`mt-3 h-10 rounded-xl`}),(0,S.jsx)(`p`,{className:`mt-2 text-xs text-gray-500`,children:i(`modelInputCustomHint`)})]})}export{O as t};
|