PageSourceSearch

https://beebro.com/app/assets/ConversationListItem-3sy7bMiA.js

js beebro.com collected 2026-09-24 14:40:14 UTC 36,058 bytes, 1 lines download raw bytes

1import{o as e,t}from"./react-B8HINTYZ.js";import{c as n,l as r}from"./chunk-OE4NN4TA-yuhGJTpF.js";import{t as i}from"./useQuery-eUuiyF0g.js";import{t as a}from"./useMutation-BxaOQ-QX.js";import{i as o}from"./bundle-mjs-C77yRssA.js";import{n as s}from"./QueryClientProvider-CL16TmWP.js";import{t as c}from"./queryOptions-C6eUkPeV.js";import{a as l,c as u,o as d}from"./i18n-Uclp8k7f.js";import{n as f,t as p}from"./Button-Cl7lg8gb.js";import{t as m}from"./copy-CcNw6Njb.js";import{t as h}from"./Sheet-CNX3uLfs.js";import{a as g,c as _,d as v,f as y,i as b,l as x,o as S,r as C,t as w}from"./schemas-yJwYz_QM.js";import{s as T,t as E}from"./client-J73iV5Wt.js";import{t as D}from"./queryKeys-DQZ5qimK.js";import{a as O,i as k,n as A,r as j,t as M}from"./DropdownMenu-DKPPzT2A.js";import{i as N,n as P,r as F,t as I}from"./ActionMenu-CP0LT40j.js";import{t as L}from"./Tabs-Bc2zilS2.js";import{t as R}from"./useIsDesktop-9b3sPBP2.js";import{t as z}from"./Input-LoIG2X4y.js";import{n as B}from"./toast-KtWpL_Zq.js";import{n as V}from"./routes-ulGhPE5B.js";import{a as H,c as U,d as ee,f as te,i as W,l as G,o as K,r as q,s as ne}from"./shares-Df_yuJ1x.js";import{t as J}from"./Modal-CHmmt9Vy.js";import{c as re,l as ie,r as ae,s as oe,t as se}from"./conversations-DBUlJnUD.js";import{t as ce}from"./Switch-ByZ6b0Oh.js";var le=d(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),ue=d(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Y=e(t(),1),de=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='15'%20height='15'%20viewBox='0%200%2015%2015'%20fill='none'%3e%3cpath%20d='M5.625%202.5H3.125C2.79348%202.5%202.47554%202.6317%202.24112%202.86612C2.0067%203.10054%201.875%203.41848%201.875%203.75V10.625C1.875%2010.9565%202.0067%2011.2745%202.24112%2011.5089C2.47554%2011.7433%202.79348%2011.875%203.125%2011.875H11.875C12.2065%2011.875%2012.5245%2011.7433%2012.7589%2011.5089C12.9933%2011.2745%2013.125%2010.9565%2013.125%2010.625V5.625C13.125%205.29348%2012.9933%204.97554%2012.7589%204.74112C12.5245%204.5067%2012.2065%204.375%2011.875%204.375H7.5L5.625%202.5Z'%20stroke='%23D0D0D3'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'%20/%3e%3c/svg%3e`,fe=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='15'%20height='15'%20viewBox='0%200%2015%2015'%20fill='none'%3e%3cpath%20d='M5.625%202.5H3.125C2.79348%202.5%202.47554%202.6317%202.24112%202.86612C2.0067%203.10054%201.875%203.41848%201.875%203.75V10.625C1.875%2010.9565%202.0067%2011.2745%202.24112%2011.5089C2.47554%2011.7433%202.79348%2011.875%203.125%2011.875H11.875C12.2065%2011.875%2012.5245%2011.7433%2012.7589%2011.5089C12.9933%2011.2745%2013.125%2010.9565%2013.125%2010.625V5.625C13.125%205.29348%2012.9933%204.97554%2012.7589%204.74112C12.5245%204.5067%2012.2065%204.375%2011.875%204.375H7.5L5.625%202.5Z'%20stroke='%23D0D0D3'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'%20/%3e%3ccircle%20cx='7.5'%20cy='7.5'%20r='1.15'%20stroke='%23D0D0D3'%20stroke-width='1.1'%20/%3e%3cpath%20d='M5.5%2010.75C5.5%209.7835%206.395%209%207.5%209C8.605%209%209.5%209.7835%209.5%2010.75'%20stroke='%23D0D0D3'%20stroke-width='1.1'%20stroke-linecap='round'%20/%3e%3c/svg%3e`,X=o(),pe=10;function me(e,t=pe){let n=(0,Y.useRef)(null);return{handlers:{onPointerDown(e){n.current={x:e.clientX,y:e.clientY,moved:!1}},onPointerMove(e){let r=n.current;if(!r||r.moved)return;let i=Math.abs(e.clientX-r.x),a=Math.abs(e.clientY-r.y);(i>t||a>t)&&(r.moved=!0)},onPointerCancel(){n.current=null},onClick(t){let r=n.current;if(n.current=null,r?.moved){t.preventDefault(),t.stopPropagation();return}e()}}}}var Z=x({id:v(),title:v(),description:v().nullable().optional(),chats_count:_(),has_shares:b().optional(),is_owner:b().optional(),created_at:_(),updated_at:_().optional()}
1),he=x({projects:C(Z)}),ge=x({project:Z}),_e=x({ok:S(!0)}),ve=x({sha:v(),sha_short:v(),title:v(),created_at:_()}),ye=x({id:v(),name:v(),kind:w([`file`,`folder`]),size:_().nullable(),mime:v().nullable(),updated_at:v(),starred:b(),color:v().nullable(),thumbnail_url:v().nullish()}),be=x({project:Z,chats:x({items:C(se),total:_()}),commits:x({items:C(ve),total:_()}),files:x({items:C(ye),total:_()}),viewer_state:x({can_edit:b(),requires_premium:b().optional(),owner_is_premium:b().optional(),viewer_is_premium:b().optional()}).optional()}),xe=x({commits:C(ve),total:_(),limit:_()}),Se=x({reverted:x({commit_id:_(),sha:v(),sha_short:v()}),head:x({sha:v(),sha_short:v(),title:v()}),wip:x({sha:v().nullable(),sha_short:v().nullable()})}),Ce=x({path:v(),items:C(ye),total:_(),limit:_(),cursor:_(),next_cursor:_().nullable()}),we=x({kind:v(),host:v(),user:v().nullable().optional(),name:v().nullable().optional(),port:y([_(),v()]).nullable().optional(),managed:b().optional(),secret_ref:v().nullable().optional(),label:v().nullable().optional(),has_secret:b().optional()}),Te=x({id:v().optional(),name:v(),title:v().nullable().optional(),url:v().nullable().optional(),subdomain:v().nullable().optional(),engine:v().nullable().optional(),engine_version:v().nullable().optional(),entry_file:v().nullable().optional(),status:v().nullable().optional(),has_database:b().optional(),last_deploy_at:v().nullable().optional(),hosting:v().nullable().optional(),domain:v().nullable().optional(),access:C(we).default([])}),Ee=x({source:w([`file`,`db`]).optional(),format_version:y([_(),v()]).optional(),sites:C(Te).default([]),hosting:x({id:v(),domain:v(),status:v(),subdomain:v().nullable(),engine:w([`php`,`node`,`static`]).nullable(),last_deploy_at:v().nullable().optional(),project_status:w([`pending`,`deploying`,`active`,`failed`])}).nullable(),domain:x({id:v(),domain_name:v(),status:v()}).nullable(),database:x({id:v(),db_name:v(),db_user:v(),charset:v().nullable().optional(),size_bytes:_().nullable().optional(),last_synced_at:v().nullable().optional()}).nullable(),version:x({sha:v(),short_sha:v(),title:v(),committed_at:v()}).nullable()}),De=x({site:v(),kind:v(),host:v(),user:v().nullable().optional(),secret_ref:v().nullable().optional(),secret:v()}),Oe=x({id:v(),db_name:v(),db_user:v(),password:v(),host:v()});x({conversation:x({id:v(),project:x({id:v(),title:v()}).nullable()})});var ke=g(()=>x({id:v(),title:v(),status:v(),hint:v().nullish(),depth:_().optional(),children:C(ke).default([])})),Q=x({done:_(),total:_()}),$=x({goals:C(ke),stats:x({root:Q,all:Q})}),Ae=x({status:w([`accepted`,`declined`]),project:Z.optional(),goals:C(ke).optional(),stats:x({root:Q,all:Q}).optional()});async function je(){return(await E(`/api/projects`,{},he)).projects}async function Me(e){return E(`/api/projects`,{method:`POST`,body:JSON.stringify(e)},ge)}async function Ne(e){return await E(`/api/projects/${e}`,{},be)}async function Pe(e){return E(`/api/projects/${e}/placement`,{},Ee)}async function Fe(e){return E(`/api/projects/${e}/placement/db-password`,{},Oe)}async function Ie(e,t){return E(`/api/projects/${e}/placement/secret?${new URLSearchParams({site:t.site,kind:t.kind,host:t.host}).toString()}`,{},De)}async function Le(e){return E(`/api/projects/${e}/goals`,{},$)}async function Re(e,t){return E(`/api/projects/${e}/goals`,{method:`POST`,body:JSON.stringify(t)},$)}async function ze(e,t,n){return E(`/api/projects/${e}/goals/${t}`,{method:`PATCH`,body:JSON.stringify(n)},$)}async function Be(e,t,n){return E(`/api/projects/${e}/goals/${t}/move`,{method:`POST`,body:JSON.stringify(n)},$)}async function Ve(e,t){return E(`/api/goal-suggestions/${e}/answer`,{method:`POST`,body:JSON.stringify(t)},Ae)}async function He(e,t){return E(`/api/projects/${e}/goals/${t}`,{method:`DELETE`},$)}async function Ue(e,t={}){let n=new URLSearchParams;t.limit!==void 0&&n.set(`limit`,String(t.limit));let r=n.toString();return E(`/api/projects/${e}/commits${r?`?${r}`:``}`,{},xe)}async function We(e,t){return E(`/api/projects/${e}/commits/${t}/revert`,{method:`POST`,body:`{}`},Se)}async function Ge(e,t={}){let n=new URLSearchParams;for(let[e,r]of Object.entries(t))r!=null&&r!==``&&n.set(e,String(r));let r=n.toString();return E(`/api/projects/${e}/files${r?`?${r}`:``}`,{},Ce)}async function Ke(e,t){return E(`/api/projects/${e}`,{method:`PATCH`,body:JSON.stringify(t)},ge)}async function qe(e){return E(`/api/projects/${e}`,{method:`DELETE`},_e)}async function Je(e){return E(`/api/projects/${e}/leave`,{method:`POST`},_e)}async function Ye(e,t,n){let r={...`toUserId`in t?{to_user_id:t.toUserId}:{share_id:t.shareId},...n?.releasePlacement?{release_placement:!0}:{}};await E(`/api/projects/${e}/transfer`,{method:`POST`,body:JSON.stringify(r)},x({}).passthrough())}var Xe=x({conversation:se});async function Ze(e,t,n){return(await E(`/api/projects/${e}/conversations/${t}/pin`,{method:`PATCH`,body:JSON.stringify({pinned:n})},Xe)).conversation}var Qe={getProjectsQueryOptions:()=>c({queryKey:D.projects.all,queryFn:je}),getProjectQueryOptions:e=>c({queryKey:D.projects.detail(e),queryFn:()=>Ne(e),enabled:!!e}),getProjectPlacementQueryOptions:e=>c({queryKey:D.projects.placement(e),queryFn:()=>Pe(e),enabled:!!e}),getProjectFilesQueryOptions:(e,t={})=>c({queryKey:D.projects.files(e,t),queryFn:()=>Ge(e,t),enabled:!!e}),getProjectGoalsQueryOptions:e=>c({queryKey:D.projects.goals(e),queryFn:()=>Le(e),enabled:!!e,staleTime:0}),getProjectCommitsQueryOptions:(e,t={})=>c({queryKey:D.projects.commits(e),queryFn:()=>Ue(e,t),enabled:!!e})};
1function $e({title:e,subtitle:t,badges:n,menu:r}){return(0,X.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-[5px]`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`min-w-0 truncate font-ui text-body font-medium text-foreground`,children:e}),n.length>0&&(0,X.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:n.map(e=>(0,X.jsx)(`span`,{className:`rounded-[4px] bg-surface-bee px-[5px] py-1 font-ui text-[10px] leading-none text-text-dim`,children:e},e))})]}),(0,X.jsx)(`span`,{className:`truncate font-ui text-body font-medium text-text-dim`,children:t})]}),r?(0,X.jsx)(`div`,{className:`shrink-0`,children:r}):null]})}function et({owner:e,shares:t,directMembers:n=[],isLoading:r,isResending:i,isDeleting:a,onGrant:o,onResend:s,onEdit:c,onDelete:u,grantLabel:d,onTransfer:f,onTransferRecipient:m,onEditRecipient:h,onDeleteRecipient:g,onTransferDirectMember:_}){let v=l();return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsx)(`p`,{className:`font-ui text-body font-medium text-text-dim`,children:v(`shareUsersWithAccess`)}),e?(0,X.jsx)($e,{title:`${e.name} ${v(`shareYouSuffix`)}`,subtitle:e.email,badges:[v(`shareOwnerBadge`)]}):null,t.map(e=>{let t=e.joined??e.status===`active`;return(0,X.jsxs)(Y.Fragment,{children:[e.type===`email`?(0,X.jsx)($e,{title:e.name,subtitle:e.email??``,badges:[v(t?`shareStatusActive`:`shareStatusInactive`),e.can_edit?v(`shareCanEditBadge`):v(`shareViewBadge`)],menu:(0,X.jsxs)(I,{children:[(0,X.jsx)(N,{iconClassName:`text-icon-faint`}),(0,X.jsxs)(P,{align:`end`,children:[(0,X.jsx)(F,{icon:`chat-action-share`,label:v(`shareMenuResend`),disabled:i,onClick:()=>s(e)}),(0,X.jsx)(F,{icon:`chat-action-rename`,label:v(`shareMenuEdit`),onClick:()=>c(e)}),f&&t?(0,X.jsx)(F,{icon:`transfer-ownership`,label:v(`shareTransferMenu`),onClick:()=>f(e)}):null,(0,X.jsx)(F,{icon:`chat-action-delete`,label:v(`shareMenuDelete`),destructive:!0,disabled:a,onClick:()=>u(e)})]})]})}):null,e.joined_users?.map(t=>{let n=t.can_edit??e.can_edit,r=!!(h||g||m);return(0,X.jsx)($e,{title:t.name,subtitle:t.email,badges:[v(`shareStatusActive`),v(n?`shareCanEditBadge`:`shareViewBadge`)],menu:r?(0,X.jsxs)(I,{children:[(0,X.jsx)(N,{iconClassName:`text-icon-faint`}),(0,X.jsxs)(P,{align:`end`,children:[h?(0,X.jsx)(F,{icon:`chat-action-rename`,label:v(`shareMenuEdit`),onClick:()=>h(e,t)}):null,m?(0,X.jsx)(F,{icon:`transfer-ownership`,label:v(`shareTransferMenu`),onClick:()=>m(e,t)}):null,g?(0,X.jsx)(F,{icon:`chat-action-delete`,label:v(`shareMenuDelete`),destructive:!0,disabled:a,onClick:()=>g(e,t)}):null]})]}):void 0},t.id)})]},e.id)}),n.map(e=>(0,X.jsx)($e,{title:e.name??e.email??``,subtitle:e.email??``,badges:[v(`shareStatusActive`),e.can_edit?v(`shareCanEditBadge`):v(`shareViewBadge`)],menu:_?(0,X.jsxs)(I,{children:[(0,X.jsx)(N,{iconClassName:`text-icon-faint`}),(0,X.jsx)(P,{align:`end`,children:(0,X.jsx)(F,{icon:`transfer-ownership`,label:v(`shareTransferMenu`),onClick:()=>_(e)})})]}):void 0},e.id)),r&&!e?(0,X.jsx)(`p`,{className:`font-ui text-body font-medium text-text-dim`,children:v(`loading`)}):null]}),(0,X.jsx)(p,{type:`button`,className:`w-full`,onClick:o,children:d??v(`shareGrantAccess`)})]})}function tt({linkPanel:e,emailBusy:t,onSubmitEmail:n}){let r=l(),[i,a]=(0,Y.useState)(`link`),[o,s]=(0,Y.useState)(``),[c,u]=(0,Y.useState)(!1),[d,f]=(0,Y.useState)(!1);return(0,X.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,X.jsx)(L,{value:i,onValueChange:a,items:[{value:`link`,label:r(`shareTabLink`)},{value:`email`,label:r(`shareTabEmail`)}]}),i===`link`?e:(0,X.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-[10px]`,children:[(0,X.jsx)(`label`,{className:`font-ui text-body font-medium text-foreground`,children:r(`shareEmailLabel`)}),(0,X.jsx)(z,{variant:`secondary`,type:`email`,value:o,placeholder:r(`shareEmailPlaceholder`),"aria-invalid":d||void 0,className:`aria-invalid:border aria-invalid:border-danger`,onChange:e=>{s(e.target.value),f(!1)}})]}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,X.jsx)(`span`,{className:`font-ui text-body font-medium text-foreground`,children:r(`shareEditToggle`)}),(0,X.jsx)(ce,{checked:c,onChange:u})]}),(0,X.jsx)(p,{type:`button`,className:`w-full`,loading:t,onClick:()=>
1{if(!t){if(o.trim().length===0){f(!0),B.error(r(`shareFormError`));return}f(!1),n(o.trim(),c)}},children:r(`shareGrantAccess`)})]})]})}function nt({name:e,email:t,joined:n,initialCanEdit:r,busy:i,onSave:a}){let o=l(),[s,c]=(0,Y.useState)(r);return(0,X.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-[5px]`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`font-ui text-body font-medium text-foreground`,children:e}),(0,X.jsx)(`span`,{className:`rounded-[4px] bg-surface-bee px-[5px] py-1 font-ui text-[10px] leading-none text-text-dim`,children:o(n?`shareStatusActive`:`shareStatusInactive`)})]}),(0,X.jsx)(`span`,{className:`truncate font-ui text-body font-medium text-text-dim`,children:t})]}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,X.jsx)(`span`,{className:`font-ui text-body font-medium text-foreground`,children:o(`shareEditToggle`)}),(0,X.jsx)(ce,{checked:s,onChange:c})]}),(0,X.jsx)(p,{type:`button`,className:`w-full`,loading:i,onClick:()=>!i&&a(s),children:o(`shareSave`)})]})}function rt({name:e,email:t,busy:n,releaseMode:r=!1,onConfirm:i}){let a=l(),[o,s]=(0,Y.useState)(!1),c=t?`${e} (${t})`:e;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-10`,children:[(0,X.jsxs)(`p`,{className:`font-ui text-body font-medium leading-[1.4] tracking-[-0.28px] text-text-dim`,children:[a(`shareTransferQuestion`),(0,X.jsxs)(`span`,{className:`text-foreground`,children:[c,`?`]})]}),r?(0,X.jsxs)(`div`,{className:`rounded-2xl border border-line bg-surface-bee px-4 py-3`,children:[(0,X.jsx)(`p`,{className:`font-ui text-body font-medium leading-[1.45] text-foreground`,children:a(`shareTransferReleaseTitle`)}),(0,X.jsx)(`p`,{className:`mt-1 font-ui text-body font-medium leading-[1.45] text-text-dim`,children:a(`shareTransferReleaseText`)})]}):null,(0,X.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,X.jsx)(`span`,{className:`font-ui text-body font-medium text-foreground`,children:a(`shareTransferConfirm`)}),(0,X.jsx)(ce,{checked:o,onChange:s})]}),(0,X.jsx)(p,{type:`button`,className:`w-full`,loading:n,disabled:!o,onClick:()=>o&&!n&&i(),children:a(`shareTransferSubmit`)})]})]})}function it({label:e,url:t,spinning:n,onCopy:r,onRegenerate:i,copyLabel:a,regenerateLabel:o}){return(0,X.jsxs)(`div`,{className:`flex flex-col gap-[10px]`,children:[(0,X.jsx)(`label`,{className:`font-ui text-body font-medium text-foreground`,children:e}),(0,X.jsxs)(`div`,{className:`flex items-center gap-[10px]`,children:[(0,X.jsxs)(`div`,{className:`flex h-[42px] min-w-0 flex-1 items-center gap-2 rounded-card bg-surface-bee px-[14px] py-[10px]`,children:[(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-ui text-body font-medium text-foreground`,children:t}),(0,X.jsx)(`button`,{type:`button`,className:`shrink-0 text-text-dim transition-opacity hover:opacity-70`,"aria-label":a,onClick:r,children:(0,X.jsx)(m,{className:`size-[18px] stroke-[1.8]`})})]}),(0,X.jsx)(`button`,{type:`button`,className:`flex size-[42px] shrink-0 items-center justify-center rounded-card bg-surface-bee text-foreground transition-opacity hover:opacity-70 disabled:opacity-50`,"aria-label":o,onClick:i,disabled:n,children:(0,X.jsx)(le,{className:u(`size-[18px] stroke-[1.8]`,n&&`animate-spin`)})})]})]})}function at({links:e,isLoading:t,regenerating:n,onCopy:r,onRegenerate:i}){let a=l();return t&&!e?(0,X.jsx)(`p`,{className:`font-ui text-body font-medium text-text-dim`,children:a(`loading`)}):e?(0,X.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,X.jsx)(it,{label:a(`shareLinkViewLabel`),url:e.view.url,spinning:n===`view`,onCopy:()=>r(e.view.url),onRegenerate:()=>i(`view`),copyLabel:a(`shareMenuCopyLink`),regenerateLabel:a(`shareLinkRegenerate`)}),(0,X.jsx)(it,{label:a(`shareLinkEditLabel`),url:e.edit.url,spinning:n===`edit`,onCopy:()=>r(e.edit.url),onRegenerate:()=>i(`edit`),copyLabel:a(`shareMenuCopyLink`),regenerateLabel:a(`shareLinkRegenerate`)})]}):null}function ot({open:e,onOpenChange:t,adapter:n}){let r=l(),o=R(),c=s(),[u,d]=(0,Y.useState)(`list`),[f,p]=(0,Y.useState)(null),[m,g]=(0,Y.useState)(null),[_,v]=(0,Y.useState)(null),[y,b]=(0,Y.useState)(null),x=e=>{e||(d(`list`),p(null),g(null),v(null),P(!1)),t(e)},S=i({queryKey:n.sharesQueryKey,queryFn:n.fetchShares,enabled:e}),C=i({queryKey:n.linksQueryKey,queryFn:n.fetchLinks,enabled:e}),w=async()=>{await c.invalidateQueries({queryKey:n.sharesQueryKey});for(let e of n.extraInvalidateKeys??[])await c.invalidateQueries({queryKey:e})},E=a({mutationFn:({email:e,canEdit:t})=>n.createEmail(e,t),onSuccess:async()=>{await w(),B.success(r(`toastShareGranted`)),d(`list`)},onError:()=>B.error(r(`toastShareCreateFailed`))}),D=a({mutationFn:({grant:e,canEdit:t})=>n.updateEmail(e,t),onSuccess:async()=>{await w(),B.success(r(`toastShareUpdated`)),d(`list`)},onError:()=>B.error(r(`toastShareUpdateFailed`))}),O=a({mutationFn:e=>n.removeGrant(e),onSuccess:async()=>{await w(),B.success(r(`toastShareDeleted`))},onError:()=>B.error(r(`toastShareDeleteFailed`))}),k=a({mutationFn:e=>n.resendGrant(e),onSuccess:()=>B.success(r(`toastShareResent`)),onError:()=>B.error(r(`toastShareResendFailed`))}),A=a({mutationFn:({grant:e,user:t})=>n.removeRecipient(e,t),onSuccess:async()=>{await w(),B.success(r(`toastShareDeleted`))},onError:()=>B.error(r(`toastShareDeleteFailed`))}),j=a({mutationFn:({grant:e,user:t,canEdit:r})=>n.updateRecipient(e,t,r),onSuccess:async()=>{await w(),B.success(r(`toastShareUpdated`)),d(`list`),g(null)},onError:()=>B.error(r(`toastShareUpdateFailed`))}),M=e=>{switch(T(e)?e.code:void 0){case`has_placement`:return r(`toastTransferHasPlacement`);case`release_failed`:return r(`toastTransferReleaseFailed`);case`project_too_large`:return r(`toastTransferTooLarge`);case`slug_conflict`:return r(`toastTransferSlugConflict`);case`project_busy`:return r(`toastTransferBusy`);case`not_a_participant`:return r(`toastTransferNotParticipant`);case`transfer_failed`:return r(`toastTransferFilesFailed`);default:return r(`toastTransferFailed`)}},[N,P]=(0,Y.useState)(!1),F=a({mutationFn:({target:e,release:t})=>n.transferOwnership(e,t?{releasePlacement:!0}:void 0),onSuccess:async()=>{await w(),B.success(r(`toastTransferSuccess`)),x(!1)},onError:(e,t)=>
1{if((T(e)?e.code:void 0)===`has_placement`&&!t.release){P(!0);return}B.error(M(e))}}),I=a({mutationFn:e=>n.regenerateLink(e),onMutate:e=>b(e),onSuccess:async()=>{await c.invalidateQueries({queryKey:n.linksQueryKey}),B.success(r(`shareLinkRegenerated`))},onError:()=>B.error(r(`toastShareUpdateFailed`)),onSettled:()=>b(null)}),L=async e=>{try{await navigator.clipboard.writeText(e),B.success(r(`shareLinkCopied`))}catch{B.info(e)}},z=u===`new`?n.createTitle??r(`shareNewAccessTitle`):u===`edit`?r(`shareEditAccessTitle`):u===`transfer`?n.transferTitle??r(`shareTransferTitle`):n.listTitle,V=S.data?.owner??void 0,H=S.data?.shares??[],U=S.data?.direct_members??[];return(0,X.jsx)(h,{mode:`modal`,open:e,onOpenChange:x,title:z,showBack:u!==`list`||!o,onBack:u===`list`?void 0:()=>{d(`list`),p(null),g(null)},children:(0,X.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[500px] flex-col gap-8 px-4 lg:px-0`,children:[(0,X.jsx)(`h2`,{className:`hidden font-ui text-[28px] font-bold leading-none tracking-[-0.02em] text-foreground lg:block`,style:{fontFeatureSettings:`'liga' 0`},children:z}),u===`list`?(0,X.jsx)(et,{owner:V,shares:H,directMembers:U,isLoading:S.isLoading,isResending:k.isPending,isDeleting:O.isPending,onGrant:()=>d(`new`),grantLabel:n.grantLabel,onResend:e=>k.mutate(e),onEdit:e=>{p(e),d(`edit`)},onDelete:e=>O.mutate(e),onTransfer:n.transferOwnership?e=>{v({name:e.name,email:e.email??``,grant:e}),P(!1),d(`transfer`)}:void 0,onTransferRecipient:n.transferOwnership?(e,t)=>{v({name:t.name,email:t.email,grant:e,user:t}),P(!1),d(`transfer`)}:void 0,onTransferDirectMember:n.transferOwnership?e=>{v({name:e.name??e.email??``,email:e.email??``,directMember:e}),P(!1),d(`transfer`)}:void 0,onEditRecipient:n.updateRecipient?(e,t)=>{p(null),g({share:e,user:t}),d(`edit`)}:void 0,onDeleteRecipient:n.removeRecipient?(e,t)=>A.mutate({grant:e,user:t}):void 0}):u===`new`?(0,X.jsx)(tt,{linkPanel:(0,X.jsx)(at,{links:C.data,isLoading:C.isLoading,regenerating:y,onCopy:e=>void L(e),onRegenerate:e=>I.mutate(e)}),emailBusy:E.isPending,onSubmitEmail:(e,t)=>E.mutate({email:e,canEdit:t})}):u===`edit`&&m?(0,X.jsx)(nt,{name:m.user.name,email:m.user.email,joined:!0,initialCanEdit:m.user.can_edit??m.share.can_edit,busy:j.isPending,onSave:e=>j.mutate({grant:m.share,user:m.user,canEdit:e})},m.user.id):u===`edit`&&f?(0,X.jsx)(nt,{name:f.name,email:f.email??``,joined:f.joined??f.status===`active`,initialCanEdit:f.can_edit,busy:D.isPending,onSave:e=>D.mutate({grant:f,canEdit:e})},f.id):u===`transfer`&&_?(0,X.jsx)(rt,{name:_.name,email:_.email,busy:F.isPending,releaseMode:N,onConfirm:()=>F.mutate({target:_,release:N})},_.directMember?.id??_.user?.id??_.grant?.id??`transfer`):null]})})}function st({open:e,onOpenChange:t,conversationId:n}){return(0,X.jsx)(ot,{open:e,onOpenChange:t,adapter:{listTitle:l()(`shareModalTitle`),sharesQueryKey:D.shares.list(`conversation`,n),fetchShares:()=>K(`conversation`,n),linksQueryKey:D.shares.links(`conversation`,n),fetchLinks:()=>H(`conversation`,n),regenerateLink:e=>ne(`conversation`,n,e),createEmail:async(e,t)=>{await q(`conversation`,n,{type:`email`,email:e,can_edit:t})},updateEmail:async(e,t)=>{await ee(`conversation`,n,e.id,{can_edit:t})},removeGrant:e=>W(`conversation`,n,e.id),resendGrant:e=>G(`conversation`,n,e.id),removeRecipient:(e,t)=>U(`conversation`,n,e.id,t.id),updateRecipient:(e,t,r)=>te(`conversation`,n,e.id,t.id,r),extraInvalidateKeys:[D.conversations.all]}})}function ct({open:e,onOpenChange:t,projectId:n}){let r=l();return(0,X.jsx)(ot,{open:e,onOpenChange:t,adapter:{listTitle:r(`shareProjectUsersTitle`),createTitle:r(`shareNewUserTitle`),grantLabel:r(`shareAddUser`),transferTitle:r(`shareTransferTitle`),sharesQueryKey:D.shares.list(`project`,n),fetchShares:()=>K(`project`,n),linksQueryKey:D.shares.links(`project`,n),fetchLinks:()=>H(`project`,n),regenerateLink:e=>ne(`project`,n,e),createEmail:async(e,t)=>{await q(`project`,n,{type:`email`,email:e,can_edit:t})},updateEmail:async(e,t)=>{await ee(`project`,n,e.id,{can_edit:t})},removeGrant:e=>W(`project`,n,e.id),resendGrant:e=>G(`project`,n,e.id),removeRecipient:(e,t)=>
1U(`project`,n,e.id,t.id),updateRecipient:(e,t,r)=>te(`project`,n,e.id,t.id,r),transferOwnership:(e,t)=>Ye(n,e.directMember?{toUserId:e.directMember.id}:e.user?{toUserId:e.user.id}:{shareId:e.grant.id},t),extraInvalidateKeys:[D.projects.all]}})}function lt({conversation:e,onDeleted:t,onRenameRequested:i,alwaysVisible:o=!1,enlargedTrigger:c=!1,headerTrigger:u=!1,projectId:d,onOpenChange:m}){let[h,g]=(0,Y.useState)(!1),[_,v]=(0,Y.useState)(!1),[y,b]=(0,Y.useState)(!1),[x,S]=(0,Y.useState)(!1),[C,w]=(0,Y.useState)(!1),[T,E]=(0,Y.useState)(!1),N=s(),P=r(),F=n(`/chat/:conversationId`)?.params.conversationId??null,I=l(),L=async()=>{await N.cancelQueries({queryKey:D.conversations.detail(e.id)}),N.removeQueries({queryKey:D.conversations.detail(e.id),exact:!0}),await N.invalidateQueries({queryKey:D.conversations.all})},R=a({mutationFn:()=>ie(e.id,{pinned:!e.is_pinned}),onSuccess:async()=>{await N.invalidateQueries({queryKey:D.conversations.all}),B.success(e.is_pinned?I(`toastConversationUnpinned`):I(`toastConversationPinned`)),g(!1)},onError:()=>B.error(I(`toastConversationPinFailed`))}),z=a({mutationFn:()=>Ze(d,e.id,!e.project_pinned),onSuccess:async()=>{await N.invalidateQueries({queryKey:D.conversations.all}),d&&await N.invalidateQueries({queryKey:D.projects.detail(d)}),B.success(e.project_pinned?I(`toastConversationUnpinned`):I(`toastConversationPinned`)),g(!1)},onError:()=>B.error(I(`toastConversationPinFailed`))}),H=a({mutationFn:()=>ae(e.id),onSuccess:async()=>{let n=F===e.id;v(!1),g(!1),n&&P(V.chat),t(e.id),await L(),B.success(I(`toastConversationDeleted`))},onError:()=>B.error(I(`toastConversationDeleteFailed`))}),U=a({mutationFn:()=>oe(e.id),onSuccess:async()=>{let n=F===e.id;b(!1),g(!1),n&&P(V.chat),t(e.id),await L(),B.success(I(`toastConversationLeft`))},onError:()=>B.error(I(`toastConversationLeaveSharedFailed`))}),ee=e.type===`group`,te=e.is_owner===!1,W=R.isPending||H.isPending||U.isPending,G=e.project?.id??d??null,K=`flex h-[38px] w-full items-center gap-2 rounded-md px-control py-0 text-left font-ui text-body font-medium text-foreground transition-colors hover:bg-surface-bee cursor-default outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,q=`flex h-[38px] w-full items-center gap-2 rounded-md px-control py-0 text-left font-ui text-body font-medium text-destructive transition-colors hover:bg-destructive-soft cursor-default outline-none select-none`;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(M,{open:h,onOpenChange:e=>{g(e),m?.(e)},children:[u?(0,X.jsx)(O,{"aria-label":I(`chatConversationActionsOpen`),className:`flex size-9 shrink-0 items-center justify-center rounded-chat-pill bg-surface-bee text-foreground outline-none transition-opacity hover:opacity-70 data-[state=open]:opacity-70`,children:(0,X.jsx)(f,{name:`more`,className:`size-[22px]`})}):(0,X.jsx)(`div`,{className:`shrink-0 transition-[width,opacity,margin] duration-150 ease-out ${o?`w-[15px] overflow-visible opacity-100`:h?`w-[15px] overflow-hidden opacity-100`:`-ml-2 w-0 overflow-hidden opacity-0 group-hover:ml-0 group-hover:w-[15px] group-hover:opacity-100`}`,onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:(0,X.jsx)(O,{"aria-label":I(`chatConversationActionsOpen`),className:c?`relative flex size-[15px] items-center justify-center rounded-sm text-icon-faint outline-none hover:bg-transparent data-[state=open]:text-icon-faint before:absolute before:-inset-[10px] before:content-['']`:`flex size-[15px] items-center justify-center rounded-sm text-icon-faint outline-none hover:bg-transparent data-[state=open]:text-icon-faint`,children:(0,X.jsx)(f,{name:`more`,className:`size-[15px] text-icon-faint`})})}),(0,X.jsx)(A,{side:`bottom`,align:u?`end`:`start`,sideOffset:4,onClick:e=>e.stopPropagation(),className:`w-[240px] rounded-lg border border-line bg-background p-2 font-ui text-body text-foreground shadow-account-popover`,children:(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[e.is_owner!==!1&&(0,X.jsxs)(j,{className:K,onSelect:()=>{g(!1),G?w(!0):S(!0)},children:[(0,X.jsx)(f,{name:`chat-action-share`,className:`size-[18px] shrink-0`}),I(`chatConversationShare`)]}),e.is_owner!==!1&&(0,X.jsxs)(j,{className:K,onSelect:()=>{g(!1),i(e)},children:[(0,X.jsx)(f,{name:`chat-action-rename`,className:`size-[18px] shrink-0`}),I(`chatConversationRename`)]}),e.is_owner!==!1&&(0,X.jsx)(k,{}),d&&!ee?(0,X.jsxs)(j,{className:K,onSelect:()=>z.mutate(),children:[(0,X.jsx)(f,{name:e.project_pinned?`chat-action-unpin`:`chat-action-pin`,className:`size-[18px] shrink-0`}),e.project_pinned?I(`projectsUnpinChat`):I(`projectsPinChat`)]}):(0,X.jsxs)(j,{className:K,onSelect:()=>R.mutate(),children:[(0,X.jsx)(f,{name:e.is_pinned?`chat-action-unpin`:`chat-action-pin`,className:`size-[18px] shrink-0`}),e.is_pinned?I(`chatConversationUnpin`):I(`chatConversationPin`)]}),te?(0,X.jsxs)(j,{className:q,onSelect:()=>{g(!1),b(!0)},children:[(0,X.jsx)(f,{name:`chat-action-leave`,className:`size-[18px] shrink-0`}),I(`chatConversationLeave`)]}):(0,X.jsxs)(j,{className:q,onSelect:()=>{g(!1),v(!0)},children:[(0,X.jsx)(f,{name:`chat-action-delete`,className:`size-[18px] shrink-0`}),I(`chatConversationDelete`)]})]})})]}),(0,X.jsx)(J,{open:_,onOpenChange:v,onClick:e=>e.stopPropagation(),title:I(`chatConversationDeleteDialogTitle`),description:I(`chatConversationDeleteDialogDescription`),descriptionClassName:`mt-4`,actions:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(p,{type:`button`,className:`flex-1`,onClick:()=>H.mutate(),disabled:W,loading:H.isPending,variant:`secondary`,children:I(`chatConversationConfirm`)}),(0,X.jsx)(p,{type:`button`,className:`flex-1`,onClick:()=>v(!1),children:I(`chatConversationCancel`)})]})}),(0,X.jsx)(J,{open:y,onOpenChange:b,onClick:e=>e.stopPropagation(),title:I(`chatConversationLeaveDialogTitle`),description:I(`chatConversationLeaveDialogDescription`),descriptionClassName:`mt-4`,actions:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(p,{type:`button`,className:`flex-1`,onClick:()=>U.mutate(),disabled:W,loading:U.isPending,variant:`secondary`,children:I(`chatConversationLeaveConfirm`)}),(0,X.jsx)(p,{type:`button`,className:`flex-1`,onClick:()=>b(!1),children:I(`chatConversationCancel`)})]})}),(0,X.jsx)(J,{open:C,onOpenChange:w,onClick:e=>e.stopPropagation(),title:I(`shareChoiceTitle`),description:I(`shareChoiceDescription`),descriptionClassName:`mt-2`,actionsClassName:`flex-col gap-2.5`,actions:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(p,{type:`button`,className:`w-full`,onClick:()=>{w(!1),S(!0)},children:I(`shareChoiceChat`)}),(0,X.jsx)(p,{type:`button`,variant:`secondary`,className:`w-full`,onClick:()=>{w(!1),E(!0)},children:I(`shareChoiceProject`)})]})}),(0,X.jsx)(st,{open:x,onOpenChange:S,conversationId:e.id}),G?(0,X.jsx)(ct,{open:T,onOpenChange:E,projectId:G}):null]})}function ut({conversation:e,isCurrent:t=!1,alwaysShowActions:n=!1,enlargedActions:r=!1,className:i,titleClassName:o,leadingIcon:c,projectId:d,streaming:m=!1,renameVariant:h=`modal`,onOpenConversation:g,onDeleted:_,onActiveChange:v}){let y=l(),b=s(),[x,S]=(0,Y.useState)(!1),[C,w]=(0,Y.useState)(!1),[T,E]=(0,Y.useState)(``),[O,k]=(0,Y.useState)(!1),A=O||C||x;(0,Y.useEffect)(()=>{v?.(e.id,A)},[A,e.id,v]),(0,Y.useEffect)(()=>()=>v?.(e.id,!1),[e.id,v]);let j=()=>{S(!1),w(!1),E(``)},M=a({mutationFn:({id:e,title:t})=>re(e,{title:t}),onSuccess:async(e,t)=>{await Promise.all([b.invalidateQueries({queryKey:D.conversations.all}),b.invalidateQueries({queryKey:D.conversations.detail(t.id)})]),B.success(y(`toastConversationRenameSuccess`)),j()},onError:()=>B.error(y(`toastConversationRenameFailed`))}),N=me(()=>{C||g(e.id)}),P=(0,Y.useCallback)(e=>{e&&(e.focus(),e.select())},[]),F=e=>{E(e.title),h===`inline`?w(!0):S(!0)},I=()=>{let t=T.trim();if(t.length===0||t===e.title){j();return}M.mutate({id:e.id,title:t})},L=e.is_active||m,R=!C&&!d&&e.project?e.is_owner===!1?fe:de:null,V=!C&&R!==`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='15'%20height='15'%20viewBox='0%200%2015%2015'%20fill='none'%3e%3cpath%20d='M5.625%202.5H3.125C2.79348%202.5%202.47554%202.6317%202.24112%202.86612C2.0067%203.10054%201.875%203.41848%201.875%203.75V10.625C1.875%2010.9565%202.0067%2011.2745%202.24112%2011.5089C2.47554%2011.7433%202.79348%2011.875%203.125%2011.875H11.875C12.2065%2011.875%2012.5245%2011.7433%2012.7589%2011.5089C12.9933%2011.2745%2013.125%2010.9565%2013.125%2010.625V5.625C13.125%205.29348%2012.9933%204.97554%2012.7589%204.74112C12.5245%204.5067%2012.2065%204.375%2011.875%204.375H7.5L5.625%202.5Z'%20stroke='%23D0D0D3'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'%20/%3e%3ccircle%20cx='7.5'%20cy='7.5'%20r='1.15'%20stroke='%23D0D0D3'%20stroke-width='1.1'%20/%3e%3cpath%20d='M5.5%2010.75C5.5%209.7835%206.395%209%207.5%209C8.605%209%209.5%209.7835%209.5%2010.75'%20stroke='%23D0D0D3'%20stroke-width='1.1'%20stroke-linecap='round'%20/%3e%3c/svg%3e`&&(e.has_shares||e.is_owner===!1&&!e.project);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:u(`group relative flex items-center gap-2`,i,A&&`bg-surface-bee`,C&&`cursor-default`),...
1N.handlers,children:[c,C?(0,X.jsx)(z,{ref:P,value:T,onChange:e=>E(e.target.value),onClick:e=>e.stopPropagation(),onBlur:I,onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),I()):e.key===`Escape`&&(e.preventDefault(),j())},disabled:M.isPending,maxLength:120,variant:`inline`,className:u(`flex-1`,o)}):(0,X.jsx)(`button`,{type:`button`,className:`min-w-0 flex-1 text-left`,children:(0,X.jsx)(`span`,{className:u(`block min-w-0 truncate font-ui font-medium text-body!`,t?`text-foreground`:`text-text-muted`,o),children:e.title})}),V?(0,X.jsx)(ue,{className:`size-[15px] shrink-0 text-icon-faint`,strokeWidth:1.8,"aria-hidden":`true`}):null,e.pending_question?(0,X.jsx)(`span`,{role:`img`,"aria-label":y(`chatConversationPendingQuestion`),className:`pointer-events-none absolute left-[3px] top-1/2 h-2 w-[3px] -translate-y-1/2 rounded-chat-pill bg-attention`}):null,!C&&(d?e.project_pinned:e.is_pinned)?(0,X.jsx)(f,{name:`pin`,className:`size-[15px] shrink-0 text-icon-faint`}):null,R?(0,X.jsx)(`img`,{src:R,alt:``,className:`size-[15px] shrink-0`,"aria-hidden":`true`}):null,C?null:(0,X.jsx)(lt,{conversation:e,alwaysVisible:n,enlargedTrigger:r,projectId:d,onOpenConversation:g,onDeleted:e=>_?.(e),onRenameRequested:F,onOpenChange:k}),!C&&L?(0,X.jsx)(f,{name:`tool-spinner`,className:`size-[15px] shrink-0 animate-spinner text-icon-faint`}):null]}),h===`modal`?(0,X.jsx)(J,{open:x,onOpenChange:S,title:y(`chatConversationRenameDialogTitle`),description:y(`chatConversationRenameDialogDescription`),descriptionClassName:`mt-4`,actions:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(p,{type:`button`,variant:`secondary`,className:`h-[42px] flex-1 px-[10px] text-xs`,onClick:()=>S(!1),children:y(`chatConversationCancel`)}),(0,X.jsx)(p,{type:`button`,className:`h-[42px] flex-1 bg-foreground px-[10px] text-xs text-white hover:bg-foreground
1/90`,onClick:I,disabled:M.isPending,loading:M.isPending,children:y(`chatConversationConfirm`)})]}),children:(0,X.jsx)(z,{value:T,onChange:e=>E(e.target.value),placeholder:y(`chatConversationRenamePlaceholder`),maxLength:120,disabled:M.isPending,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),I())}})}):null]})}export{le as S,ze as _,Ve as a,de as b,qe as c,Ie as d,Je as f,We as g,Ke as h,ot as i,He as l,Qe as m,lt as n,Me as o,Be as p,ct as r,Re as s,ut as t,Fe as u,me as v,ue as x,fe as y};

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.