import{r as e,j as t}from"./vendor-react-RSDKEZ60.js";import{bb as s,kp as n,a9 as a,y as o,h as i,kq as l,kr as r,I as c,ks as d,m as u,kt as p,ku as m,g6 as f,en as x,kv as g,k0 as h,kw as w,kx as j,h2 as y,f as v,V as b,ky as M,an as k,eE as A,eO as _,kz as N,eP as C,kA as I,kB as S,cK as R,kC as $,kD as T,hD as z,cO as U,b$ as O,kE as E}from"./c818056db-BBpc4u6S.js";import{v as D,w as F,x as q,y as B,z as P,A as L,B as K,C as Z}from"./vendor-icons-CjJMeNuY.js";import{u as G,M as H,d as W}from"./vendor-intl-BNW8a19h.js";import{u as X,C as V}from"./cc2dfdfd3-DnAU5kEX.js";import{C as Y,a as J}from"./c85adc124-D_vRw5L5.js";import{B as Q,I as ee,M as te,T as se,i as ne}from"./vendor-ant-cds-CBh5POw1.js";import{C as ae}from"./c5669b8e4-Crc1rGjx.js";import{r as oe,o as ie,s as le}from"./vendor-zod-D1-NLVm9.js";import{c as re}from"./vendor-zustand-IIUY2Tf-.js";function ce(){const[t,s]=e.useState(!1);return e.useEffect(()=>s(!0),[]),t}const de=e=>t.jsx(s,{...e,children:t.jsx("path",{d:"M16.134 6.16a.5.5 0 1 1 .732.68l-6.5 7-.077.068a.5.5 0 0 1-.655-.068l-6.5-7-.062-.08a.5.5 0 0 1 .718-.667l.076.067L10 12.767z"})});function ue(e,t,s){return`/api/organizations/${e}/cowork/sessions/${encodeURIComponent(t)}/download-file?path=${encodeURIComponent(s)}`}function pe(e,t){return`/api/organizations/${e}/files/${encodeURIComponent(t)}/contents`}function me(e,t){return`/api/${e}/files/${encodeURIComponent(t)}/preview`}function fe(e){return!!e&&!0!==e.server.isBuiltIn}function xe(e,t){return!!fe(t)||void 0!==n(e)&&void 0===t}function ge(e){if(!e?.content)return;const t=e.content.find(e=>"image"===e.type);if(t&&"image"===t.type){if("file_uuid"in t&&t.file_uuid)return{type:"file_uuid",fileUuid:t.file_uuid};if("source"in t&&t.source&&"object"==typeof t.source){const e=t.source;if("base64"===e.type&&e.data)return{type:"base64",base64Data:e.data,mediaType:e.media_type??"image/png"}}}}const he=new Set(["image/jpeg","image/png","image/gif","image/webp"]);function we(e,t){if(e){if("file_uuid"===e.type&&e.fileUuid&&t)return me(t,e.fileUuid);if("base64"===e.type&&e.base64Data){const t=e.mediaType??"image/png";if(!he.has(t))return;return`data:${t};base64,${e.base64Data}`}}}function je(e){if(!e||"object"!=typeof e)return;const t=e,s=t.action,n="left_click"===s||"right_click"===s||"double_click"===s||"triple_click"===s,a="hover"===s;if(!n&&!a&&!("scroll"===s||"scroll_to"===s))return;const o=t.coordinate;return o&&Array.isArray(o)&&o.length>=2?{x:o[0],y:o[1],type:n?"click":a?"hover":"scroll"}:void 0}const ye=new Set(["ca_policy_block","mfa_required","device_noncompliant","consent_required"]);function ve(e,t){return!(!e||!ye.has(e))||"provider_redirect"===e&&!!t}function be(e,t,s=null,n=null){return"success"===e||"access_denied"!==t||ve(s,n)?{result:e,failure_type:Me(e,t)}:{result:"access_denied",failure_type:void 0}}function Me(e,t){if(e&&"success"!==e)return t?"callback_error":"start_error"===e?"start_auth":"end_error"===e?"token_exchange":"unspecified"}const ke=new Map;function Ae({serverId:t,onAuthSuccess:s,analyticsSource:n,backendRetryParams:y,afterAuthRejection:v=!1}){const b=y?.conversation_uuid,M=y?.tool_use_id,k=G(),{addSuccess:A,addError:_}=a(),{track:N}=o(),{activeOrganization:C}=i(),I=C?.uuid,S=l(),R=r(),$=c(),T=d(),z=u("claudeai_desktop_interstitial_main"),U=e.useRef(null),O=e.useRef(void 0),E=e.useRef(null),[D,F]=e.useState(!1);e.useEffect(()=>{if(!D)return;let e=null;return"undefined"!=typeof BroadcastChannel&&(e=new BroadcastChannel(p),e.onmessage=e=>{const n=e.data;n?.type===m&&n.serverId===t&&(e=>{const n=E.current===ke.get(t);if(n){ke.delete(t);const s=be(e.step,e.oauthError??null,e.oauthErrorSubtype??null,e.entraAadstsCode??null);x("claudeai.mcp.auth.completed",{attributes:{result:s.result,uuid:t,redacted_url:w(f.getState().remoteServers[t]?.url),failure_type:s.failure_type,prior_auth_status:O.current}})}U.current&&!U.current.closed&&setTimeout(()=>{U.current?.close(),U.current=null},2e3),F(!1),"success"===e.step?(A(k.formatMessage({defaultMessage:"Authentication successful",id:"Fh0QP1M2C8"})),n&&S&&I&&j(I,{serverUuid:t}),s()):_(k.formatMessage({defaultMessage:"Authentication failed. You can try connecting again.",id:"UvWS/5AQSR"}),{messageForLogging:"Authentication failed. You can try connecting again."})})(n)}),()=>{e?.close()}},[D,t,I,S,s,A,_,k]);return{connect:e.useCallback(()=>{if(U.current&&!U.current.closed)return void U.current.focus();F(!0);const e=f.getState().remoteConnectionStates[t]?.authStatus;O.current=e;const s=Symbol();E.current=s,ke.set(t,s),N({event_key:"claudeai.mcp.auth.init",uuid:t,redacted_url:void 0,source:n,prior_auth_status:e}),x("claudeai.mcp.auth.init",{attributes:{uuid:t,redacted_url:void 0,source:n,prior_auth_status:e}});const a=b&&M?`&conversation_uuid=${encodeURIComponent(b)}&tool_use_id=${encodeURIComponent(M)}`:"",o=v?"&after_auth_rejection=true":"";if($){const e="ClaudeNest"===g()?.build,s=e?"claude-nest":"claude";let n=s,i=window.location.origin;const l=z&&n===s?`/desktop/connected/mcp-auth-callback/${encodeURIComponent(t)}?_=1${e?"&nest=1":""}`:`${n}://claude.ai/mcp-auth-callback/${encodeURIComponent(t)}?_=1`;window.location.href=`${i}${R(t,l)}${a}${o}`}else{const e=`${window.location.origin}/connector/${encodeURIComponent(t)}/auth_done?_=1`,s=`${window.location.origin}${R(t,e)}${a}${o}&popup=1`,n=600,i=700,l=window.screenX+(window.outerWidth-n)/2,r=window.screenY+(window.outerHeight-i)/2,c=h(s);c&&(U.current=window.open(c,"mcp-auth",`width=${n},height=${i},left=${l},top=${r},popup=1`))}},[t,b,M,v,n,R,N,$,T,z]),isConnecting:D}}function _e({mcpAuthRequired:e,onAuthSuccess:s}){const{connect:n,isConnecting:a}=Ae({serverId:e.server_id,onAuthSuccess:s,analyticsSource:y.ToolUseFooter,afterAuthRejection:!0,backendRetryParams:e.conversation_uuid?{conversation_uuid:e.conversation_uuid,tool_use_id:e.tool_use_id}:void 0});return t.jsxs("div",{className:"flex items-center justify-between gap-3 p-3 pt-0",children:[t.jsx("span",{className:"text-sm text-text-300",children:t.jsx(H,{defaultMessage:"Authentication required to use this tool",id:"S3Gpcjmuj1"})}),t.jsx(Q,{variant:"primary",onClick:n,busy:a,children:t.jsx(H,{defaultMessage:"Connect",id:"+vVZ/G11Zg"})})]})}function Ne(t,s,n){const a=e.useRef(null),o=e.useRef(s);return o.current=s,e.useEffect(()=>{if(!1===n?.enabled)return;const e=n?.element||a.current||document,s=e=>{o.current(e)};return e.addEventListener(t,s,!0),()=>{e.removeEventListener(t,s,!0)}},[t,n?.element,n?.enabled]),a}function Ce({tool:s,dimmed:n,labelId:a,controls:o,resourceMeta:i}){const l=G(),r=s.title||s.annotations?.title||s.displayName||s.name,[c,d]=e.useState(!1),[u,p]=e.useState(!1),m=e.useMemo(()=>{const e=s.inputSchema?.properties??{},t=new Set(s.inputSchema?.required??[]);return Object.entries(e).map(([e,s])=>{const n=s,a=n.type;let o;if(Array.isArray(a)){const e=a.filter(e=>"null"!==e);o=e.length>0?e.join(" | "):void 0}else"string"==typeof a&&(o=a);return{name:e,description:"string"==typeof n.description?n.description:void 0,type:o,required:t.has(e)}})},[s.inputSchema]),f=m.length>0,x=e.useMemo(()=>{if(!f)return"";const e=m.slice(0,3).map(e=>e.name),t=m.length-e.length,s=e.join(", ");return t>0?l.formatMessage({defaultMessage:"{names}, +{remaining} more",id:"UUtwvdZ1Jv"},{names:s,remaining:t}):s},[f,m,l]);return t.jsxs("div",{className:"flex flex-col",children:[t.jsxs("div",{className:"flex gap-4 items-start",children:[t.jsxs("div",{className:v("flex-1 min-w-0 flex flex-col gap-1",n&&"opacity-50"),children:[t.jsx("span",{id:a,className:"text-sm font-normal text-text-300",children:r}),s.description&&t.jsx("p",{className:v("text-xs text-text-500 leading-normal",!c&&"line-clamp-2"),children:s.description}),s.description&&s.description.length>120&&t.jsx("button",{type:"button",onClick:()=>d(e=>!e),"aria-expanded":c,className:"w-fit text-xs text-text-500 hover:text-text-300",children:c?t.jsx(H,{defaultMessage:"Less",id:"mFYgAXM/x4"}):t.jsx(H,{defaultMessage:"...More",id:"ouI1WNBB6t"})}),t.jsx(Se,{resourceMeta:i}),f&&t.jsxs("button",{type:"button",onClick:()=>p(e=>!e),"aria-expanded":u,className:"flex items-center gap-1 w-fit text-xs text-text-500 hover:text-text-300 mt-0.5",children:[u?t.jsx(de,{size:12}):t.jsx(ae,{size:12}),u?l.formatMessage({defaultMessage:"Hide parameters",id:"b1o4tU8Isz"}):l.formatMessage({defaultMessage:"{count, plural, one {# parameter} other {# parameters}}: {preview}",id:"dXJhpHIjV5"},{count:m.length,preview:x})]})]}),o]}),f&&u&&t.jsx("div",{className:v("pt-2 pb-3 flex flex-col gap-1.5 ps-4",n&&"opacity-50"),children:m.map(e=>t.jsxs("div",{className:"flex items-baseline gap-1.5 flex-wrap",children:[t.jsx("code",{className:"text-xs font-mono text-text-200 bg-bg-100 px-1 py-0.5 rounded shrink-0",children:e.name}),e.type&&t.jsx("span",{className:"text-xs font-mono text-text-500 italic shrink-0",children:e.type}),e.required&&t.jsx("span",{className:"text-xs text-text-500 shrink-0",children:l.formatMessage({defaultMessage:"required",id:"+gRnOaBZi9"})}),e.description&&t.jsx("span",{className:"text-xs text-text-500 leading-normal",children:e.description})]},e.name))})]})}const Ie=W({camera:{defaultMessage:"camera access",id:"cnpzreanQA"},microphone:{defaultMessage:"microphone access",id:"lYz2zeDIGQ"},geolocation:{defaultMessage:"location access",id:"MUzTqyqAz0"},clipboardWrite:{defaultMessage:"writing to clipboard",id:"VnxnBDhLZr"}});function Se({resourceMeta:e}){if(!e)return null;if(e.isLoading)return t.jsx("span",{role:"status",className:"text-xs text-text-500 italic mt-0.5",children:t.jsx(H,{defaultMessage:"Loading resource details...",id:"R3OkkXiIEO"})});const{meta:s}=e;if(!s)return null;const n=s.permissions?Object.keys(s.permissions).sort():[],a=[...new Set([...s.csp?.connectDomains??[]].sort())];return 0===n.length&&0===a.length?null:t.jsxs("div",{className:"flex flex-col gap-1 mt-1",children:[n.length>0&&t.jsx(Re,{keys:n}),a.length>0&&t.jsx(Te,{domains:a})]})}function Re({keys:e}){const s=G();return t.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[t.jsx("span",{className:"text-xs text-text-500",children:t.jsx(H,{defaultMessage:"Permissions:",id:"a2VLth0fNI"})}),e.map(e=>t.jsx("span",{className:"text-xs text-text-500 bg-bg-100 border border-border-300 px-1.5 py-0.5 rounded",children:Object.hasOwn(Ie,e)?s.formatMessage(Ie[e]):e},e))]})}function $e(e){return e.replace(/^[a-z]+:\/\//,"")}function Te({domains:s}){const n=G(),[a,o]=e.useState(!1),i=e.useMemo(()=>s.map($e),[s]),l=e.useMemo(()=>{const e=i.slice(0,3),t=i.length-e.length,s=e.join(", ");return t>0?n.formatMessage({defaultMessage:"{names}, +{remaining} more",id:"UUtwvdZ1Jv"},{names:s,remaining:t}):s},[i,n]);return t.jsxs(t.Fragment,{children:[t.jsxs("button",{type:"button",onClick:()=>o(e=>!e),"aria-expanded":a,className:"flex items-center gap-1 max-w-full text-xs text-text-500 hover:text-text-300",children:[t.jsx("span",{className:"shrink-0",children:a?t.jsx(de,{size:12}):t.jsx(ae,{size:12})}),t.jsx("span",{className:"truncate",children:a?n.formatMessage({defaultMessage:"Hide domains",id:"asztJcpOma"}):n.formatMessage({defaultMessage:"{count, plural, one {# domain} other {# domains}}: {preview}",id:"G9fQ4Ya1zc"},{count:i.length,preview:l})})]}),a&&t.jsx("p",{className:"text-xs text-text-500 font-mono leading-relaxed ps-4",children:s.join(", ")})]})}function ze({submitToolApproval:s,showAlwaysAllowed:n,coworkWriteToolWarning:a,coworkAlwaysAllowDisabledByOrg:o,alwaysAllowHint:i,alwaysAllowDisabledReason:l,alwaysAllowLoading:r,tool:c,resourceMeta:d,onAllowForAllScheduledRuns:u,onAllowForThisTask:p,disableKeyboardShortcuts:m,setIsExpanded:f,stacked:x=!1}){const g=G(),h=!0===r,[w,j]=e.useState(!1),[y,v]=e.useState(!1),k=e=>{"always"===e&&h||(s(e),f(!1))},A=u?()=>{u(),f(!1)}:void 0,_=a?t.jsx(H,{defaultMessage:"Allow for all tasks",id:"0xIGAXr2i7"}):t.jsx(H,{defaultMessage:"Always allow",id:"lr3QX/nctD"}),N=p?{label:t.jsx(H,{defaultMessage:"Allow for this task",id:"X2n9R87ZBD"}),onClick:p,showAlwaysAllowInDropdown:n&&!o,loading:!1,allowOnceAsStandalone:!0,isAlwaysAllow:!1}:A?{label:t.jsx(H,{defaultMessage:"Allow for all scheduled runs",id:"jq4WKOmptI"}),onClick:A,showAlwaysAllowInDropdown:n,loading:!1,allowOnceAsStandalone:!1,isAlwaysAllow:!1}:n&&!o?{label:_,onClick:()=>k("always"),showAlwaysAllowInDropdown:!1,loading:h,allowOnceAsStandalone:!1,isAlwaysAllow:!0}:null,C=N&&(N.showAlwaysAllowInDropdown||!N.allowOnceAsStandalone),I=!N||N.loading||m?void 0:"enter";Ne("keydown",e=>{if("Escape"===e.key)return e.preventDefault(),e.stopPropagation(),void k("deny");if("Enter"===e.key){const t=document.activeElement;if(t&&t!==document.body)return;e.metaKey||e.ctrlKey?(e.preventDefault(),e.stopPropagation(),k("once")):(e.preventDefault(),e.stopPropagation(),N?N.loading||N.onClick():k("once"))}},{enabled:!m&&!w});const S=x?"w-full [&>div>button:first-of-type]:flex-1 [&>div>button:first-of-type]:pl-[calc(var(--cds-pad-md)+25px)]":void 0,R=x?"w-full justify-center":void 0;return t.jsxs("div",{className:ne("flex flex-col gap-3 compact:gap-2",x?"w-full":"p-3 pt-0 compact:p-2 compact:pt-0"),children:[a&&t.jsxs("div",{className:"flex gap-2 text-body text-secondary",children:[t.jsx(ee,{name:"Warning",size:"sm",className:"shrink-0 mt-0.5"}),t.jsx("span",{children:t.jsx(H,{defaultMessage:"Allowing this action comes with risks. Malicious instructions in files, emails, and web content could trick Claude into unintended actions. <a>Learn more</a>",id:"ps3MQ4ugIl",values:{a:e=>t.jsx(b,{external:!0,href:"https://support.claude.com/en/articles/13364135-use-cowork-safely#h_66ba46aa5e",children:e})}})})]}),t.jsxs("div",{className:ne("flex gap-2",x&&"flex-col w-full"),children:[N?C?t.jsx(Ue,{tooltipContent:N.isAlwaysAllow?i:void 0,wrapperClassName:x?"w-full":void 0,children:t.jsx(M,{variant:"primary",className:S,open:w,onOpenChange:j,label:N.label,shortcut:I,menuLabel:g.formatMessage({defaultMessage:"More allow options",id:"neJ+WAvag5"}),busy:N.loading,onPrimaryClick:N.onClick,items:t.jsxs(t.Fragment,{children:[N.showAlwaysAllowInDropdown&&t.jsx(te.Item,{disabled:h,onClick:()=>k("always"),children:i?t.jsxs("span",{className:"whitespace-normal flex flex-col",children:[t.jsx("span",{children:_}),t.jsx("span",{className:"text-footnote text-muted",children:i})]}):_}),!N.allowOnceAsStandalone&&t.jsx(te.Item,{onClick:()=>k("once"),shortcut:m?void 0:"cmd+enter",children:t.jsx(H,{defaultMessage:"Allow once",id:"O2tb5KUxpc"})})]})})}):t.jsx(Q,{variant:"primary",className:R,busy:N.loading,onClick:N.onClick,shortcut:I,children:N.label}):t.jsx(Q,{variant:"primary",className:R,onClick:()=>k("once"),shortcut:m?void 0:"enter",children:t.jsx(H,{defaultMessage:"Allow once",id:"O2tb5KUxpc"})}),N?.allowOnceAsStandalone&&t.jsx(Q,{variant:"secondary",className:R,onClick:()=>k("once"),shortcut:m?void 0:"cmd+enter",children:t.jsx(H,{defaultMessage:"Allow once",id:"O2tb5KUxpc"})}),o&&!A&&t.jsx(se,{multiline:!0,content:l??t.jsx(H,{defaultMessage:"Your admin hasn't enabled this option. Ask them to turn it on in Organization settings \u2192 Cowork.",id:"N1Cf7XEjX9"}),children:t.jsx("span",{className:ne("inline-flex",x&&"w-full"),children:t.jsx(Q,{variant:"secondary",className:R,disabled:!0,children:_})})}),t.jsx(Q,{variant:"secondary",className:R,onClick:()=>k("deny"),shortcut:m?void 0:"esc",children:t.jsx(H,{defaultMessage:"Deny",id:"htvX+Z11l+"})}),c&&!x&&t.jsx(Q,{variant:"ghost",size:"sm",className:"ml-auto",icon:y?"CaretDown":"CaretRight",onClick:()=>v(e=>!e),"aria-expanded":y,children:y?t.jsx(H,{defaultMessage:"Hide",id:"VA/Z1SW3vH"}):t.jsx(H,{defaultMessage:"Inspect tool",id:"iYfZ6Hl5ud"})})]}),c&&y&&t.jsx("div",{className:"pt-1",children:t.jsx(Ce,{tool:c,resourceMeta:d})})]})}function Ue({tooltipContent:e,wrapperClassName:s,children:n}){return e?t.jsx(se,{multiline:!0,content:e,children:t.jsx("span",{className:ne("inline-flex",s),children:n})}):n}const Oe=oe(ie({name:le(),icon:le()})),Ee={FileMagnifyingGlass:Z,FilePlus:K,FileText:L,ListChecks:P,MagnifyingGlass:B,PencilSimple:q,Table:F,Terminal:D};const De=e.memo(function({input:s,toolResult:n}){const a=G(),{activeOrganization:o}=i(),l=o?.uuid,r=e.useMemo(()=>{if(void 0===s)return"";let e;try{e=JSON.stringify(s,null,2)}catch{return String(s)}return e=e.replace(/\\n/g,"\n").replace(/\\t/g,"\t"),e=e.replace(/(?<!\\)"/g,"`"),e},[s]);return t.jsxs("div",{className:"flex flex-col gap-3 p-3 pt-1 compact:gap-2 compact:p-2 compact:pt-0.5",children:[t.jsx(V,{title:a.formatMessage({defaultMessage:"Request",id:"p1P+hQq6tY"}),language:"javascript",code:r}),n?.content.map((e,s)=>{if("text"===e.type)return t.jsx(V,{title:a.formatMessage({defaultMessage:"Response",id:"MgdnPiJHcj"}),language:"json",code:e.text},s);if("image"===e.type){const n=we(ge({content:[e]}),l);return n?t.jsx("img",{src:n,alt:a.formatMessage({defaultMessage:"Tool result",id:"OJmR+3dTK6"}),className:"max-w-md max-h-md h-auto rounded-md",loading:"lazy",decoding:"async"},s):null}})]})});De.displayName="ToolResultBlock";const Fe=e.memo(function({toolName:s,toolMessage:n,integrationName:a,integrationIcon:o,iconName:i,approvalData:l,...r}){const{input:c,toolResult:d,groupItemKey:u,autoscrollRef:p,shareType:m,mcpAuthRequired:f}=r,x=ce(),g=e.useRef(!1),h=!!l?.approvalRequired,[w,j]=e.useState(!1),y=h||!!f&&!w,{isExpanded:v,setIsExpanded:b,snappyTransition:M}=X(!1,u,y),O=y||!!m,E=k("claudeai_yukon_gold_tool_display",{},Oe)[s],D=A(s)?void 0:_(s),F=E?.name||N(s,c,{suppressInternalMcp:xe(s,D)})||D?.tool?.displayName||C(s)?.toolName||s.split(":").pop()||s,q=E?.icon?Ee[E.icon]:void 0,B=I(),P=S(h?s:"");R();const L=e.useCallback(()=>{j(!0),b(!1)},[b]),K=$(s)?T(s):F,Z=h?a?t.jsx(H,{defaultMessage:"Claude wants to use {toolName} from {integrationName}",id:"wPBSjwhfE4",values:{toolName:K,integrationName:a}}):t.jsx(H,{defaultMessage:"Claude wants to use {toolName}",id:"ZNLjFNb5bD",values:{toolName:K}}):n??F,G=d?.content?.[0];return t.jsx(Y,{isExpanded:x&&v,setIsExpanded:b,isExpandingDisabled:O,text:Z,isError:d?.is_error,errorMessage:"text"===G?.type?G.text:void 0,icon:q?t.jsx(z,{size:16,children:t.jsx(q,{size:12,className:"text-text-300"})}):t.jsx(U,{size:16,type:D?D.server.iconType:"favicon",src:D?D.server.iconSrc:o,name:a||F}),...r,children:t.jsx(J,{isExpanded:x&&v,snappyTransition:M,onAnimationComplete:()=>{y&&!g.current&&(p?.current?.scrollToBottom("smooth",{onlyIfPinned:!0}),g.current=!0)},isScrollable:!0,footer:h?t.jsx(ze,{...l,tool:B?D?.tool:void 0,resourceMeta:B?P:void 0,alwaysAllowLoading:B?P.isKeyPending:void 0,setIsExpanded:b}):f&&!w?t.jsx(_e,{mcpAuthRequired:f,onAuthSuccess:L}):null,children:t.jsx(De,{input:c,toolResult:d})})})});Fe.displayName="GenericToolUseCell";const qe=re(e=>({isFullscreen:!1,setIsFullscreen:t=>e({isFullscreen:t}),fullscreenMessageUuid:null,setFullscreenMessageUuid:t=>e({fullscreenMessageUuid:t}),fullscreenToolUseId:null,requestFullscreen:t=>e({fullscreenToolUseId:t,isFullscreen:null!==t,pendingFullscreen:null}),pendingFullscreen:null,setPendingFullscreen:t=>e({pendingFullscreen:t}),chatInputTopToViewportBottom:0,setChatInputTopToViewportBottom:t=>e({chatInputTopToViewportBottom:t})}));function Be(t){const[s,n]=e.useState(!1),[a,o]=e.useState(null),i=t?.root,l=t?.rootMargin,r=t?.threshold;return e.useEffect(()=>{if(s||!a)return;const e=new IntersectionObserver(([t])=>{t.isIntersecting&&(n(!0),e.disconnect())},{root:i?.current??null,rootMargin:l,threshold:r});return e.observe(a),()=>e.disconnect()},[a,s,i,l,r]),{ref:o,isIntersecting:s}}const Pe=12,Le=52,Ke=16;function Ze(e){return e?`${O}px`:`${E}px`}function Ge(e){return{top:`calc(${e} + 0.5px)`,left:0,right:0,bottom:0}}function He(e){return{top:`calc(${e} + 65px)`,left:12.5,right:12.5,bottom:12.5}}export{de as C,Le as F,Fe as G,_e as M,De as T,Ae as a,qe as b,ce as c,Be as d,ze as e,He as f,me as g,Ge as h,Ze as i,Ke as j,Pe as k,we as l,ge as m,pe as n,fe as o,Ce as p,ve as q,be as r,xe as s,ue as t,Ne as u,je as v};
