1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3725,9878],{10432:function(e,t,a){a.r(t),a.d(t,{ChatItem:function(){return v},ChatList:function(){return C}});var n=a(57437),s=a(15592),c=a(71869),i=a.n(c),l=a(84717),r=a(44922),d=a(13894),o=a(59208),h=a(75591),m=a(83921),u=a(2265),x=a(65878),p=a(92944);function v(e){let t=(0,u.useRef)(null);(0,u.useEffect)(()=>{if(e.selected&&t.current){var a;null===(a=t.current)||void 0===a||a.scrollIntoView({block:"center"})}},[e.selected]);let{pathname:a}=(0,o.TH)();return(0,n.jsx)(l._l,{draggableId:"".concat(e.id),index:e.index,children:c=>(0,n.jsxs)("div",{className:"".concat(i()["chat-item"]," ").concat(e.selected&&(a===h.y$.Chat||a===h.y$.Home)&&i()["chat-item-selected"]),onClick:e.onClick,ref:e=>{t.current=e,c.innerRef(e)},...c.draggableProps,...c.dragHandleProps,title:"".concat(e.title,"\n").concat(d.ZP.ChatItem.ChatItemCount(e.count)),children:[e.narrow?(0,n.jsxs)("div",{className:i()["chat-item-narrow"],children:[(0,n.jsx)("div",{className:i()["chat-item-avatar"]+" no-dark",children:(0,n.jsx)(m.MaskAvatar,{avatar:e.mask.avatar,model:e.mask.modelConfig.model})}),(0,n.jsx)("div",{className:i()["chat-item-narrow-count"],children:e.count})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:i()["chat-item-title"],children:e.title}),(0,n.jsxs)("div",{className:i()["chat-item-info"],children:[(0,n.jsx)("div",{className:i()["chat-item-count"],children:d.ZP.ChatItem.ChatItemCount(e.count)}),(0,n.jsx)("div",{className:i()["chat-item-date"],children:e.time})]})]}),(0,n.jsx)("div",{className:i()["chat-item-delete"],onClickCapture:t=>{var a;null===(a=e.onDelete)||void 0===a||a.call(e),t.preventDefault(),t.stopPropagation()},children:(0,n.jsx)(s.Z,{})})]})})}function C(e){let[t,a,s,c]=(0,r.aK)(e=>[e.sessions,e.currentSessionIndex,e.selectSession,e.moveSession]),m=(0,r.aK)(),u=(0,o.s0)(),C=(0,p.S0)();return(0,n.jsx)(l.Z5,{onDragEnd:e=>{let{destination:t,source:a}=e;t&&(t.droppableId!==a.droppableId||t.index!==a.index)&&c(a.index,t.index)},children:(0,n.jsx)(l.bK,{droppableId:"chat-list",children:c=>(0,n.jsxs)("div",{className:i()["chat-list"],ref:c.innerRef,...c.droppableProps,children:[t.map((t,c)=>(0,n.jsx)(v,{title:t.topic,time:new Date(t.lastUpdate).toLocaleString(),count:t.messages.length,id:t.id,index:c,selected:c===a,onClick:()=>{u(h.y$.Chat),s(c)},onDelete:async()=>{(!e.narrow&&!C||await (0,x.i0)(d.ZP.Home.DeleteChat))&&m.deleteSession(c)},narrow:e.narrow,mask:t.mask},t.id)),c.placeholder]})})})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.