import{s as e}from"./chunk-Bj-mKKzh.js";import{H as t,R as n,W as r,ut as i}from"./app-server-manager-signals-Yn0WSnoY.js";import{n as a}from"./jsx-runtime-CiQ1k8xo.js";import{F as o,I as s,P as c,f as l,h as u,lt as d}from"./vscode-api-DjORcpSo.js";import{g as f}from"./persisted-signal-CweW-bgN.js";import{o as p}from"./statsig-BP9zNYqZ.js";import{t as m}from"./route-scope-CLteRG86.js";import{h}from"./process-manager-target-n7BvYgee.js";import{a as g,i as _,n as v,r as y,t as b}from"./heartbeat-automation-permissions-C6rvEuUG.js";var x=d(),S=e(a(),1);function C(e){let i=(0,x.c)(17),{conversationId:a}=e,d=o(u),f=p(`1488233300`),m=c(h,a),C=c(n,a),w=c(g,a),T=s(_)?.[a],E;i[0]!==T||i[1]!==a||i[2]!==m.isEligible||i[3]!==m.reason||i[4]!==f||i[5]!==C||i[6]!==d?(E=()=>{let e=d.get(r,a),n=d.get(t,a),i=v(e,n),o=y(e,n,T);f&&i!=null&&d.set(_,e=>b(e??{},a,i)),l.dispatchMessage(`heartbeat-automation-thread-state-changed`,{threadId:f?a:null,isEligible:f&&m.isEligible,collaborationMode:f?C:null,permissions:f?o:null,reason:f?m.reason:null})},i[0]=T,i[1]=a,i[2]=m.isEligible,i[3]=m.reason,i[4]=f,i[5]=C,i[6]=d,i[7]=E):E=i[7];let D;return i[8]!==T||i[9]!==a||i[10]!==m.isEligible||i[11]!==m.reason||i[12]!==f||i[13]!==w||i[14]!==C||i[15]!==d?(D=[T,a,m.isEligible,m.reason,w,f,C,d],i[8]=T,i[9]=a,i[10]=m.isEligible,i[11]=m.reason,i[12]=f,i[13]=w,i[14]=C,i[15]=d,i[16]=D):D=i[16],(0,S.useEffect)(E,D),null}function w(e){let t=(0,x.c)(4),{conversationId:n}=e,r=o(m),a,s;return t[0]!==n||t[1]!==r?(a=()=>{let e=!1;return r.watch(t=>{let{get:a}=t,o=a(i,n);o==null||e||(e=!0,f(r,{eventName:`codex_thread_open_stream_role_resolved`,metadata:{stream_role:o.role}}))})},s=[n,r],t[0]=n,t[1]=r,t[2]=a,t[3]=s):(a=t[2],s=t[3]),(0,S.useEffect)(a,s),null}export{C as n,w as t};
//# sourceMappingURL=local-conversation-stream-role-product-event-BuFEhC-l.js.map