1import{u as E,a as N,m as O,C as U}from"./useReferencedSessions-EdCUTvr4.js";import{Y as L,v,c as s,r as H,o as z,S as V,J as W,U as S,a5 as B,W as G,p as F}from"./vendor-core-BXbNC1oJ.js";import{u as Y}from"./preSessionTask-C_-aU_oN.js";import{Y as $}from"./main-CTluKosS.js";import{c as j}from"./_plugin-vue_export-helper-DeaGEAu3.js";import{e as J,i as y}from"./analytics-BAV65Dpj.js";import"./useSideMenu-BQzssVUO.js";import"./index-Bfn_wroP.js";import"./preload-helper-fwxmMx4o.js";import"./acceptLanguage-D3Gg3e8c.js";import"./index-B2aZD4kB.js";import"./appOrigin-BaJgmYZD.js";import"./onboarding-DLWqg9qi.js";import"./vendor-sentry-9vP2hbkd.js";import"./loader-circle-KuQW9MGi.js";import"./env-MvOdH_iN.js";import"./PhSparkle.vue-BXUnpE1-.js";import"./CreditBalanceButton-CN9pWjPA.js";import"./useUpgradeButton-Df8A0LRn.js";import"./desktopDeepLink-By92AL15.js";import"./vendor-product-analytics-BqLDAa5u.js";import"./useUseCaseIconUrlState-DMs-Of8M.js";import"./ChatVoiceRecorder-LhWFk_pj.js";import"./attachmentTypeLabel-CYmJxhBZ.js";import"./search-gX4LJN4-.js";import"./artifactLibrary-Dj79ThSn.js";import"./naive-ui-uezjBets.js";import"./vendor-utils-DKuW2T68.js";import"./play-CGwhTe1B.js";import"./trash-2-BWNWd2MH.js";import"./arrow-up-DR9J15oo.js";import"./vendor-livekit-w_4IrL6H.js";try{let n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new n.Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="a7841074-8a6d-411a-8a9e-4c8052535387",n._sentryDebugIdIdentifier="sentry-dbid-a7841074-8a6d-411a-8a9e-4c8052535387")}catch{}const C=j("PreSessionChatContext");function Q(){const n=L(),e=Y(),t=v(e.hasDraft?[...e.libraryReferences]:[]),{attachments:r,attachmentsSize:f,uploadingAttachments:u,isUploadingAttachment:m,isDraggingOver:o,handleDragover:l,handleDrop:p,handleDragLeave:D,handleSelectFile:w,handleRemoveAttachment:R,handlePaste:x}=E({getReservedAttachmentCount:()=>t.value.length}),{referencedSessions:h,addReferencedSession:T,removeReferencedSession:I,getReferencedSessionIds:A}=N();r.value=e.hasDraft?[...e.attachments]:[],f.value=X(r.value),h.value=e.hasDraft?[...e.referencedSessions]:[];const c=v(e.hasDraft?e.prompt:""),g=v(e.hasDraft?e.useCase:null),P=a=>{c.value=typeof a=="string"?a:""},M=a=>{const i=String(a?.id||"").trim(),d=String(a?.title||"").trim();g.value=i||d?{id:i,title:d,isOneTime:a?.promptType==="one_time"}:null},_=async(a={})=>{const i=String(a?.contentOverride??c.value).trim();if(!i&&!r.value.length&&!t.value.length||m.value||!e.beginTask({attachments:r.value,libraryReferences:t.value,prompt:i,referencedSessions:h.value,useCase:g.value}))return!1;C.info("Deferred task submit â routing to /chat/new to allocate a session");try{return await n.replace({name:"chat-new"}),!0}catch(k){return e.restoreDraft(),C.error("Failed to route to new task creation",{error:k}),!1}};return{chatContext:{inputMessage:s(()=>c.value||""),handleChangeInputMessage:P,handleSendMessage:_,placeholder:s(()=>""),disableSend:s(()=>!c.value.trim()&&!r.value.length&&!t.value.length||m.value||e.status==="creating"),inputState:s(()=>$.WAITING_INPUT),isSessionStale:s(()=>!1),isWaitingResponse:s(()=>!1),sessionId:"",attachments:s(()=>r.value),libraryReferences:s(()=>t.value),uploadingAttachments:s(()=>u.value),referencedSessions:s(()=>h.value),isDraggingOver:s(()=>o.value),handleDragover:l,handleDrop:p,handleDragLeave:D,handleSelectFile:w,handleRemoveAttachment:R,addLibraryReferences:a=>{t.value=O({currentReferences:t.value,incomingReferences:a,localAttachmentCount:r.value.length+u.value.length})},handleRemoveLibraryReference:a=>{t.value=t.value.filter((i,d)=>d!==a)},handleRemoveReferencedSession:I,setQuotedMessage:()=>{},handlePaste:x,getReferencedSessionIds:A,addReferencedSession:T,scrollToElement:()=>{}},startTask:_,inputMessage:c,selectUseCase:M,selectedUseCase:g}}function X(n){return n.reduce((e,t)=>e+(t?.blob?.size||t?.size||0),0)}const q={class:"chat-start-view flex flex-col flex-1 overflow-hidden"},K={class:"chat-body flex h-full min-h-0 flex-1 justify-center overflow-y-auto p-12 md:overflow-hidden md:pb-0 lg:px-40"},b=56,Z=8,Ee={__name:"ChatStartView",setup(n){const{chatContext:e,selectUseCase:t}=Q();F("chatContext",e);const r=H(0),f=o=>{r.value=Math.max(0,Math.min(Number(o)||0,1))},u=s(()=>
1{if(r.value<=0)return;const o=b-(b-Z)*r.value;return{paddingTop:`${Math.round(o)}px`}}),m=o=>{t(o);const l=String(o?.id||"").trim(),p={use_case_id:l||void 0,title:o?.title};y("home_use_case",p),y(`home_use_case_${l||"unknown"}`,p)};return z(()=>{J("chat_start")}),(o,l)=>(W(),V("div",q,[S("div",K,[S("div",{class:"max-w-1200 w-full pt-56 md:flex md:h-full md:min-h-0 md:flex-col md:overflow-hidden lg:w-[85%]",style:B(u.value)},[G(U,{onUseCase:m,onIntroCollapse:f})],4)])]))}};export{Ee as default}; 2//# sourceMappingURL=ChatStartView-CPRm6Oox.js.map
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.