try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="edee5f4d-9a47-4401-89f7-240efd689e6d",e._sentryDebugIdIdentifier="sentry-dbid-edee5f4d-9a47-4401-89f7-240efd689e6d")}catch(e){}{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=Object.assign({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:anthropic-apps":!0})}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[38480],{0x25ffe7a2:(e,t,n)=>{n.d(t,{a:()=>s});var r=n(0x2b8c35fe),i=n(0x9f369389);function s(){let e=(0,r.F)("claudeai_cowork_fusion");return!!(null===i.CI||void 0===i.CI?void 0:i.CI.getPlugins)&&!!(null===i.CI||void 0===i.CI?void 0:i.CI.uploadPlugin)&&!!(null===i.CI||void 0===i.CI?void 0:i.CI.deletePlugin)&&!!(null===i.CI||void 0===i.CI?void 0:i.CI.setPluginEnabled)&&e}},0x2b8c35fe:(e,t,n)=>{n.d(t,{F:()=>s});var r=n(0xa5acf583),i=n(0xac309a83);let s=e=>{let{serverGateNames:t}=(0,r._r)(),n=(0,i.fS)(e);return!!t&&n&&t.includes(e)}},0xab432de1:(e,t,n)=>{function r(e){return e.replace(/(^|\n)(\s?)•(\s?)/g,"$1$2- ")}function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"markdown-document",n=e.indexOf("```");if(-1===n||-1===e.indexOf("```",n+3))return e;let r=[...e.matchAll(/^(\s*)(```+)(.*)$/gm)];if(0===r.length)return e;let i=new Map,s=e=>{let t=i.get(e);return void 0===t&&(t="`".repeat(e),i.set(e,t)),t},a=[];for(let e of r){var o;let[t,n,r,i]=e,s=null!=(o=e.index)?o:0;a.push({index:s,length:t.length,backtickCount:r.length,indent:n,info:i.trim(),depth:0})}let u=[];for(let e=0;e=r.backtickCount){i=!1;break}}}i?(n.depth=u.length-1,r.closingFenceIndex=e,u.pop()):(n.depth=u.length,u.push(e))}let c=new Map,l=0;for(let e of a){let t=c.get(e.depth)||3;c.set(e.depth,Math.max(t,e.backtickCount)),l=Math.max(l,e.depth)}for(let e=l-1;e>=0;e--){let t=c.get(e)||3,n=c.get(e+1)||0;n>=t&&c.set(e,n+1)}let d=new Map;for(let e of a){let t=c.get(e.depth)||3;if(t>e.backtickCount&&d.set(e.index,{index:e.index,length:e.length,replacement:"".concat(e.indent).concat(s(t)).concat(e.info)}),void 0!==e.closingFenceIndex){let n=a[e.closingFenceIndex];n.backtickCount!==t&&d.set(n.index,{index:n.index,length:n.length,replacement:"".concat(n.indent).concat(s(t))})}}if(0===d.size)return e;if(1===d.size){let[{index:t,length:n,replacement:r}]=d.values();return e.slice(0,t)+r+e.slice(t+n)}let h=Array.from(d.values()).sort((e,t)=>e.index-t.index),m=[],f=0;for(let{index:t,length:n,replacement:r}of h)m.push(e.slice(f,t)),m.push(r),f=t+n;return m.push(e.slice(f)),m.join("")}function s(e){return e.replace(/\\/g,"\\\\")}n.d(t,{Dn:()=>a,Gm:()=>s,UT:()=>i,tH:()=>r});let a=e=>{let t=e.match(/\n+/g),n=t?t.length:0,r=e.match(/\n{2,}/g),i=r?r.length:0;return{multipleNewlineCount:i,singleNewlineCount:n-i}}},0x2504fdeeb:(e,t,n)=>{n.d(t,{PerformanceMetricsProvider:()=>w,B:()=>M});var r=n(0x22102fd88),i=n(0xf32c56dd),s=n(0x9845e38c);class a extends Error{}class o{add(e){this.buffer[this.head]=e,this.head=(this.head+1)%this.maxSize,this.currentSize0?this._mean:0}get variance(){return this.count>1?this._m2/(this.count-1):0}get stdDev(){return Math.sqrt(this.variance)}calculate(){let e=this._tail-this._mean;this._mean+=e/this.count;let t=this._tail-this._mean;this._m2+=e*t}getSummary(){return{count:this.count,sum:this.sum,min:this.min,max:this.max,mean:this.mean,variance:this.variance,stdDev:this.stdDev}}reset(){this.count=0,this.sum=0,this.min=1/0,this.max=-1/0,this._mean=0,this._m2=0}add(e){this.count+=1,this.sum+=e,this.min=Math.min(this.min,e),this.max=Math.max(this.max,e),this._tail=e,this.calculate()}constructor(){this.count=0,this.sum=0,this.min=1/0,this.max=-1/0,this._tail=0,this._mean=0,this._m2=0,this.reset()}}class d{init(){if(this.shouldReportMemory=(0,u.Y)(),"PerformanceLongTaskTiming"in window)try{this.events.longTask.observer=this.initLongTaskObserver()}catch(e){s.v.error(s.u.O11Y_INTERNALS,"PerfMon LongTaskObserver failed to init")}if("PerformanceEventTiming"in window)try{this.events.inputDelay.observer=this.initInputDelayObserver()}catch(e){s.v.error(s.u.O11Y_INTERNALS,"PerfMon EventTimingObserver failed to init")}if("PerformanceLongAnimationFrameTiming"in window)try{this.events.longAnimationFrame.observer=this.initLongAnimationFrameObserver()}catch(e){s.v.error(s.u.O11Y_INTERNALS,"PerfMon EventTimingObserver failed to init")}this.startReportMetricsInterval(),this.registerVisibilityHandlers()}initLongTaskObserver(){let e=new PerformanceObserver(e=>{for(let n of e.getEntries()){let{attribution:e}=n;if(this.events.longTask.stats.add(n.duration),n.duration>=250){var t;this.events.longTask.buffer.add({start_time:n.startTime,duration_ms:n.duration,attribution_count:null!=(t=null==e?void 0:e.length)?t:0})}}});return e.observe({entryTypes:["longtask"]}),e}initInputDelayObserver(){let e=new PerformanceObserver(e=>{for(let n of e.getEntries()){let e=n.processingStart?n.processingStart-n.startTime:0;if(e>100){this.events.inputDelay.stats.add(n.duration);let r=Number(n.processingEnd)-Number(n.processingStart);if(e>250||r>250){var t;this.events.inputDelay.buffer.add({start_time:n.startTime,duration_ms:e,processing_duration_ms:r,inp_duration_ms:n.duration,event_name:n.name,event_target_id:(null==(t=n.target)?void 0:t.id)||"unknown_target",is_fid:"first-input"===n.entryType})}}}});return e.observe({entryTypes:["event","first-input"]}),e}initLongAnimationFrameObserver(){let e=new PerformanceObserver(e=>{for(let t of e.getEntries()){let{blockingDuration:e}=t;if(this.events.longAnimationFrame.stats.add(t.duration),t.duration>=250){let n={start_time:t.startTime,duration_ms:t.duration,blocking_duration_ms:e||0};this.events.longAnimationFrame.buffer.add(n)}}});return e.observe({entryTypes:["long-animation-frame"]}),e}startReportMetricsInterval(){let e=()=>{this.reportMetricsTimeoutId=window.setTimeout(()=>{this.reportMetrics(),this.isActive&&e()},12e4)};e()}registerVisibilityHandlers(){document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&this.reportMetrics()},{passive:!0}),window.addEventListener("pagehide",()=>this.reportMetrics(),{passive:!0})}reportNavigationTiming(){try{let e=performance.getEntriesByType("navigation");if(0===e.length)return;let t=e[0],n={time_to_dom_interactive_ms:Math.round(t.domInteractive-t.fetchStart),time_to_dom_content_loaded_ms:Math.round(t.domContentLoadedEventEnd-t.fetchStart),time_to_load_complete_ms:Math.round(t.loadEventEnd-t.fetchStart),dns_lookup_duration_ms:Math.round(t.domainLookupEnd-t.domainLookupStart),tcp_connection_duration_ms:Math.round(t.connectEnd-t.connectStart),request_duration_ms:Math.round(t.responseStart-t.requestStart),response_download_duration_ms:Math.round(t.responseEnd-t.responseStart),document_processing_duration_ms:Math.round(t.domComplete-t.responseEnd),dom_content_loaded_duration_ms:Math.round(t.domContentLoadedEventEnd-t.domContentLoadedEventStart),load_event_duration_ms:Math.round(t.loadEventEnd-t.loadEventStart),unload_duration_ms:Math.round(t.unloadEventEnd-t.unloadEventStart),redirect_duration_ms:Math.round(t.redirectEnd-t.redirectStart),redirect_count:t.redirectCount,navigation_type:t.type};t.secureConnectionStart>0&&(n.tls_duration_ms=Math.round(t.connectEnd-t.secureConnectionStart)),t.workerStart>0&&(n.service_worker_duration_ms=Math.round(t.fetchStart-t.workerStart)),(0,c.r)("page.navigation_timing",{metricType:"navigation_timing",performanceAttributes:n})}catch(e){s.v.error(s.u.O11Y_INTERNALS,"Failed to report navigation timing")}}reportMetrics(){this.isActive&&(this.shouldReportMemory&&(0,c.r)("events.memory_snapshot",{metricType:"memory_snapshot"}),Object.values(this.events).forEach(e=>{let{name:t,stats:n,buffer:r}=e;0!==n.mean&&((0,c.r)("events.".concat(t,".summary"),{metricType:"".concat(t,"_summary"),performanceAttributes:{...n.getSummary()}}),r.toArray().forEach(e=>{let{duration_ms:n,...r}=e;(0,c.r)("events.".concat(t),{metricType:"".concat(t,"_event"),duration:n,performanceAttributes:{...r}})}),n.reset(),r.flush())}))}destroy(){this.isActive=!1,Object.values(this.events).forEach(e=>{var t;null==(t=e.observer)||t.disconnect(),e.observer=void 0}),clearTimeout(this.reportMetricsTimeoutId),this.reportMetricsTimeoutId=void 0,this.reportMetrics()}forceReport(){this.reportMetrics()}constructor(){this.isActive=!0,this.shouldReportMemory=!1,this.events={longTask:{name:"long_task",stats:new l,buffer:new o(100)},inputDelay:{name:"input_delay",stats:new l,buffer:new o(100)},longAnimationFrame:{name:"loaf",stats:new l,buffer:new o(100)}},this.init(),this.reportNavigationTiming()}}var h=n(0x1cd6706d8);class m{initPerfMon(){this.perfMon||(this.perfMon=new d)}trackNewChatInputReady(e){(0,c.r)("page.new_chat_input_ready",{duration:e.duration,attributes:{is_first_load:e.isFirstLoad,is_prog_chat_input:e.isProgChatInput,prog_chat_input_perf_mark_missing:e.progChatInputPerfMarkMissing}}),h.C.clearParentContext()}trackTTFT(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object.fromEntries(Object.entries(t).filter(e=>{let[,t]=e;return void 0!==t}).map(e=>{let[t,n]=e;return["chat.".concat(t),n]}));(0,c.r)("chat.time_to_first_token",{metricType:"ttft",duration:e,attributes:n})}trackProjectConversationsReady(e){(0,c.r)("page.project_conversations_ready",{duration:e})}trackMembersListReady(e){(0,c.r)("page.members_list_ready",{duration:e})}trackCodeSessionOpenTime(e,t){(0,c.r)("page.code_session_open_time",{duration:e,attributes:{session_type:t.session_type,is_new_session:t.is_new_session}})}constructor(){this.perfMon=null}}let f=new m;var _=n(0x19405b970),p=n(0x4d348f95),g=n(0xfc89b4a4),v=n(0x24b0d7515);let b="prog_chat_input_ready",y=(0,v.p9)("progressively_enhanced_chat_input"),k=(0,g.createContext)(null);function w(e){let{children:t}=e,n=(0,p.usePathname)(),{track:s}=(0,i.st)(),a=(0,g.useRef)(!0),o=(0,g.useRef)(null),u=(0,g.useRef)(!1),c=(0,g.useRef)(null),l=(0,g.useRef)(null),d=(0,g.useRef)(null),h=(0,g.useRef)(void 0),m=(0,g.useRef)(!1),v=(0,g.useRef)(!1),w=(0,g.useRef)(null),M=(0,g.useRef)(null),x=(0,g.useRef)(!1),C=(0,g.useRef)(null),T=(0,g.useRef)(!1),S=(0,g.useRef)(null),E=(0,g.useRef)(null);(0,g.useEffect)(()=>{f.initPerfMon()},[]),(0,g.useEffect)(()=>{"/new"===n?(o.current=a.current?0:performance.now(),u.current=!1):(null==n?void 0:n.startsWith("/project/"))?(M.current=performance.now(),x.current=!1):"/settings/members"===n&&(C.current=performance.now(),T.current=!1);let e=null!==c.current&&!m.current&&!v.current,t="/new"===w.current&&(null==n?void 0:n.startsWith("/chat/"));if(e&&!t&&w.current&&null!==c.current){let e=performance.now()-c.current,t=l.current;s({event_key:"claudeai.message.streaming_abandoned",time_before_abandon_ms:Math.round(e),conversation_uuid:null==t?void 0:t.conversation_uuid,is_new_conversation:null==t?void 0:t.is_new_conversation,is_retry:null==t?void 0:t.is_retry,abandoned_from:w.current,navigated_to:n}),c.current=null,l.current=null,m.current=!1,v.current=!1}w.current=n,a.current=!1},[n,s]);let I=(0,g.useCallback)(()=>{if(u.current||null===o.current)return;u.current=!0;let e=0===o.current,{duration:t,isProgChatInput:n,progChatInputPerfMarkMissing:r}=function(e,t){let n,r=performance.getEntriesByName(b,"mark")[0],i="true"===(0,_.ul)().getItem(y),s=!1;return r&&t?(n=r.startTime,performance.clearMarks(b)):(n=performance.now()-e,i&&t&&(s=!0)),{duration:n,isProgChatInput:i,progChatInputPerfMarkMissing:s}}(o.current,e);f.trackNewChatInputReady({duration:t,isFirstLoad:e,isProgChatInput:n,progChatInputPerfMarkMissing:r}),o.current=null},[]),R=(0,g.useCallback)(e=>{c.current=performance.now(),l.current=e,m.current=!1,v.current=!1},[]),P=(0,g.useCallback)(e=>{if(null===c.current||v.current)return;m.current=!0;let t=performance.now()-c.current,n={...l.current,model:null==e?void 0:e.model,first_content_type:null==e?void 0:e.first_content_type};h.current=null==e?void 0:e.model,f.trackTTFT(t,n)},[]),A=(0,g.useCallback)(e=>{var t,n;if(null===c.current||v.current)return;v.current=!0;let r=performance.now()-c.current,i=l.current;if(!i){c.current=null,l.current=null;return}let a=d.current;s({event_key:"claudeai.message.perceived_ttft",perceived_ttft_ms:Math.round(r),conversation_uuid:i.conversation_uuid,message_length:i.message_length,message_index:i.message_index,is_new_conversation:i.is_new_conversation,is_retry:i.is_retry,is_incognito:i.is_incognito,is_yukon_gold:i.is_yukon_gold,document_attachment_count:i.document_attachment_count,image_attachment_count:i.image_attachment_count,thinking_mode:i.thinking_mode,research_mode:i.research_mode,tool_count:i.tool_count,enabled_web_search:i.enabled_web_search,used_inline_conversation_create:i.used_inline_conversation_create,first_content_type:e.firstContentType,model:h.current,human_message_uuid:null!=(t=null==a?void 0:a.humanMessageUuid)?t:void 0,assistant_message_uuid:null!=(n=null==a?void 0:a.assistantMessageUuid)?n:void 0}),c.current=null,l.current=null,d.current=null,h.current=void 0,m.current=!1},[s]),O=(0,g.useCallback)(()=>{if(x.current||null===M.current)return;x.current=!0;let e=performance.now()-M.current;f.trackProjectConversationsReady(e),M.current=null},[]),z=(0,g.useCallback)(()=>{if(T.current||null===C.current)return;T.current=!0;let e=performance.now()-C.current;f.trackMembersListReady(e),C.current=null},[]),L=(0,g.useCallback)(e=>{d.current=e},[]),F=(0,g.useCallback)(e=>{S.current=performance.now(),E.current=e},[]),N=(0,g.useCallback)(e=>{var t;if(null===S.current)return;let n=E.current;if(!n||n.sessionId&&n.sessionId!==e)return;let r=performance.now()-S.current;S.current=null,E.current=null,r>6e4||f.trackCodeSessionOpenTime(r,{session_type:n.sessionType,is_new_session:null!=(t=n.isNewSession)&&t})},[]),D=(0,g.useMemo)(()=>({markEditorReady:I,markMessageSent:R,markFirstTokenReceived:P,setStreamStartMetadata:L,markPerceivedFirstToken:A,markProjectConversationsReady:O,markMembersListReady:z,markCodeSessionOpenStart:F,markCodeSessionOpenReady:N}),[I,R,P,L,A,O,z,F,N]);return(0,r.jsx)(k.Provider,{value:D,children:t})}function M(){let e=(0,g.useContext)(k);if(!e)throw Error("usePerformanceMetrics must be used within a PerformanceMetricsProvider");return e}}}]);