import{r as s,j as e}from"./vendor-react-Dp9pL_Wn.js";import{w as a,u as r,J as o,v as t,K as i,M as n,h as m,B as d,T as l}from"./c2ee0272b-DPDuX889.js";import{u as c,M as j}from"./vendor-intl-D2wGIp4M.js";import{Y as v,Z as p}from"./index-XoaBlZfC.js";import{B as u,I as h}from"./vendor-ant-cds-BLsR_p72.js";import"./vendor-base-ui-N1VQ4ctE.js";import"./vendor-radix-Dv3qPI0v.js";import"./vendor-base-5_f7mmWg.js";import"./vendor-zod-B8MhECV7.js";import"./vendor-zustand-BeF8W8xk.js";import"./vendor-icons-DGChWNxR.js";import"./vendor-lodash-BvMLws5K.js";import"./vendor-router-qG5OCEmI.js";import"./vendor-query-CRl6sF7K.js";import"./vendor-zod-v3-CZy0YPWu.js";import"./vendor-motion-EDlUw66k.js";import"./vendor-luxon-CZxT8ieM.js";import"./vendor-infra-DayZK7Ds.js";import"./vendor-growthbook-HDTqppl-.js";import"./c9a5287df-D_Z7ffFR.js";import"./c51e217b4-CQax1dv1.js";import"./c627fcdb6-1_bsVTpt.js";import"./vendor-virtual-DRz8lJfQ.js";const x=s.memo(({currentName:s,onDismiss:a,onStartNewChat:r,onNever:o})=>{const t=c();return e.jsx(d,{variant:"neutral",icon:e.jsx(h,{name:"ChatAdd",size:"md"}),className:"w-full mb-3 !items-start",children:e.jsxs("div",{className:"flex w-full items-start justify-between gap-4",children:[e.jsx("div",{className:"min-w-0",children:e.jsx(j,{defaultMessage:"Switched to {currentName}. A fresh chat gets you faster replies that use less of your message limit.",id:"Fx6BT4eqau",values:{currentName:s}})}),e.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-2",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(u,{variant:"secondary",onClick:a,children:t.formatMessage({defaultMessage:"Keep going",id:"JiaScEwUsv"})}),e.jsx(u,{variant:"primary",onClick:r,children:t.formatMessage({defaultMessage:"Start new chat",id:"KcA+xo4hhh"})})]}),e.jsx(l,{onClick:o,className:"text-xs text-text-400",children:e.jsx(j,{defaultMessage:"Don\u2019t ask me again",id:"+xRY6yy3uz"})})]})]})})}),f=s.memo(({enabled:d,onDismiss:l,onAction:c})=>{const j=a(),{conversation:u}=r(),h=u?.id,f=o(),{nameFor:g,hasModel:w}=t("chat");i(s=>s.model);const N=n(h??"")?.model,{dismiss:b}=m(),M=v(s=>h?s.initialModelByConversation.get(h):void 0),k=s.useCallback(()=>{c({action:"start_new_chat"}),j.push(f?`/project/${f}`:"/new")},[c,f,j]),y=s.useCallback(()=>{b(p),l()},[b,l]),C=g(N);return d&&w(N)&&M&&N!==M?e.jsx(x,{currentName:C,onDismiss:l,onStartNewChat:k,onNever:y}):null});export{f as ModelSwitchedChatBanner,x as ModelSwitchedChatBannerContent};
