codex-mobile-re 0.1.131 → 0.1.133

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/dist/assets/{AutomationsPanel-CZ_k1aNL.js → AutomationsPanel-B9A37CNa.js} +1 -1
  2. package/dist/assets/DirectoryHub-D_TdDpHF.js +2 -0
  3. package/dist/assets/{QueuedMessages-DSxRli0y.js → QueuedMessages-CsAVexKb.js} +1 -1
  4. package/dist/assets/{ReviewPane-DO60w4j5.js → ReviewPane-XhRr3646.js} +1 -1
  5. package/dist/assets/{RightFilePreview-B2tx1lOm.js → RightFilePreview-Ch_neGS2.js} +1 -1
  6. package/dist/assets/RightFilesPanel-5fMx5J84.js +1 -0
  7. package/dist/assets/RightGitPanel-irYPFJZZ.js +2 -0
  8. package/dist/assets/{SettingsDialog-D9kB2mzO.js → SettingsDialog-Dg10TF-D.js} +3 -3
  9. package/dist/assets/ThreadConversation-8TMOUqdg.js +25 -0
  10. package/dist/assets/ThreadConversation-Dx1ZKW94.css +1 -0
  11. package/dist/assets/{ThreadPendingRequestPanel-DGbhyPFH.js → ThreadPendingRequestPanel-DorbAtp9.js} +1 -1
  12. package/dist/assets/{ThreadTerminalPanel-DhYhXg8u.js → ThreadTerminalPanel-CKhCiseu.js} +1 -1
  13. package/dist/assets/index-CMrfiiel.js +98 -0
  14. package/dist/assets/index-Dm1iQsik.css +1 -0
  15. package/dist/index.html +2 -2
  16. package/dist-cli/index.js +257 -221
  17. package/dist-cli/index.js.map +1 -1
  18. package/package.json +1 -1
  19. package/dist/assets/DirectoryHub-Yd0fIqxf.js +0 -2
  20. package/dist/assets/RightFilesPanel-r9ijJqw4.js +0 -1
  21. package/dist/assets/RightGitPanel-BxZdreeN.js +0 -2
  22. package/dist/assets/ThreadConversation-CVVohemt.js +0 -39
  23. package/dist/assets/ThreadConversation-D1JHRys4.css +0 -1
  24. package/dist/assets/index-ClI-fbXf.js +0 -83
  25. package/dist/assets/index-DthBwStG.css +0 -1
@@ -1,3 +1,3 @@
1
- import{e as P,f as c,i as r,F as C,l as w,j as t,t as s,k as m,v as D,_ as K,u as n,n as f,h as H,w as B,p as F,I as Z,af as M,aM as E,aa as $,Q as T,T as Q,r as q}from"./index-ClI-fbXf.js";const X={key:0,class:"rate-limit-status","aria-live":"polite"},j=["title"],z={class:"rate-limit-card-header"},J={class:"rate-limit-card-title"},Y={key:0,class:"rate-limit-card-plan"},_={class:"rate-limit-card-metrics"},ee={key:0,class:"rate-limit-card-footer"},te=P({__name:"RateLimitStatus",props:{snapshots:{}},setup(e){const{t:b}=D();function o(l){var d,g;return((d=l.limitId)==null?void 0:d.trim())||((g=l.limitName)==null?void 0:g.trim())||"__default__"}function h(l){var d,g;return((d=l.limitName)==null?void 0:d.trim())||((g=l.limitId)==null?void 0:g.trim())||b("Rate limits")}function u(l){const d=l.trim();return d?d.replace(/[_-]+/g," ").replace(/\b\w/g,g=>g.toUpperCase()):""}function v(l){return!l||l<=0?b("Window"):l%1440===0?`${l/1440}d`:l%60===0?`${l/60}h`:l<60?`${l}m`:`${Math.round(l/60*10)/10}h`}function I(l){const d=Math.max(0,Math.min(100,100-l));return`${Math.round(d)}% ${b("left")}`}function p(l){return`${Math.round(l)}%`}function a(l,d){return{key:d,label:`${v(l.windowDurationMins)} ${I(l.usedPercent)}`}}function R(l){const d=[];return l.primary&&d.push(a(l.primary,"primary")),l.secondary&&d.push(a(l.secondary,"secondary")),d}function i(l){if(!l)return"";const d=new Date(l*1e3),g=d.getMonth()+1,y=String(d.getDate()).padStart(2,"0"),A=String(d.getHours()).padStart(2,"0"),S=String(d.getMinutes()).padStart(2,"0");return`${g}.${y} ${A}:${S}`}function k(l){if(!(l!=null&&l.resetsAt))return"";const d=l.resetsAt*1e3-Date.now();if(d<=0)return b("Resetting now");const g=Math.round(d/6e4);if(g<60)return`${b("Resets in")} ${g}m`;const y=Math.round(g/60);if(y<24)return`${b("Resets in")} ${y}h`;const A=Math.round(y/24);return`${b("Resets in")} ${A}d`}function L(l){return[l.primary,l.secondary].filter(d=>d!==null)}function O(l){const d=L(l);return d.length===0?null:[...d].sort((g,y)=>{const A=g.windowDurationMins??Number.MAX_SAFE_INTEGER,S=y.windowDurationMins??Number.MAX_SAFE_INTEGER;return A!==S?A-S:(g.resetsAt??Number.MAX_SAFE_INTEGER)-(y.resetsAt??Number.MAX_SAFE_INTEGER)})[0]}function N(l){const d=L(l);if(d.length===0)return"";const g=[...d].sort((A,S)=>{const U=A.windowDurationMins??-1,W=S.windowDurationMins??-1;return U!==W?W-U:(S.resetsAt??-1)-(A.resetsAt??-1)})[0],y=i(g.resetsAt);return y||""}function G(l){const d=l.credits;return d?d.unlimited?b("Unlimited credits"):d.balance?`${b("Credits")} ${d.balance}`:d.hasCredits?b("Credits available"):"":""}function x(l){return[k(O(l)),N(l),G(l)].filter(d=>d.length>0)}function V(l){const d=[h(l)];for(const g of R(l))d.push(g.label);for(const g of L(l))d.push(`${v(g.windowDurationMins)} used ${p(g.usedPercent)}`);for(const g of x(l))d.push(g);return d.join(`
2
- `)}return(l,d)=>e.snapshots.length>0?(c(),r("aside",X,[(c(!0),r(C,null,w(e.snapshots,g=>(c(),r("div",{key:o(g),class:"rate-limit-card",title:V(g)},[t("div",z,[t("span",J,s(h(g)),1),g.planType?(c(),r("span",Y,s(u(g.planType)),1)):m("",!0)]),t("div",_,[(c(!0),r(C,null,w(R(g),y=>(c(),r("span",{key:y.key,class:"rate-limit-card-metric"},s(y.label),1))),128))]),x(g).length>0?(c(),r("div",ee,s(x(g).join(" | ")),1)):m("",!0)],8,j))),128))])):m("",!0)}}),ne=K(te,[["__scopeId","data-v-f4d179d1"]]),oe={class:"sidebar-settings-account-section"},se={class:"sidebar-settings-account-header"},ie={class:"sidebar-settings-account-header-main"},ae=["aria-expanded","title"],le={class:"sidebar-settings-account-collapse-icon"},de={class:"sidebar-settings-account-title"},ce={class:"sidebar-settings-account-count"},re=["disabled"],ue={key:0,class:"sidebar-settings-account-error visible-error-with-feedback"},ge=["href"],be={class:"sidebar-settings-account-login"},me=["disabled"],he=["href"],ve={key:1,class:"sidebar-settings-account-empty"},ye={key:2,class:"sidebar-settings-account-list"},Ce=["title","onMouseenter","onMouseleave"],fe={class:"sidebar-settings-account-main"},ke={class:"sidebar-settings-account-email"},Ae={class:"sidebar-settings-account-meta"},Se={class:"sidebar-settings-account-quota"},Fe={class:"sidebar-settings-account-id"},we={class:"sidebar-settings-account-actions"},Re=["disabled","onClick"],Le=["disabled","onClick"],pe=P({__name:"SettingsAccountsPanel",props:{accounts:{},isAccountsSectionCollapsed:{type:Boolean},isRefreshingAccounts:{type:Boolean},isSwitchingAccounts:{type:Boolean},isStartingCodexLogin:{type:Boolean},isCompletingCodexLogin:{type:Boolean},accountActionError:{},codexLoginUrl:{},feedbackMailto:{},isAccountUnavailable:{type:Function},isRemoveConfirmationActive:{type:Function},isRemoveVisible:{type:Function},buildAccountTitle:{type:Function},formatAccountMeta:{type:Function},formatAccountQuota:{type:Function},shortAccountId:{type:Function},isAccountActionDisabled:{type:Function},getAccountSwitchLabel:{type:Function},getAccountRemoveLabel:{type:Function},onRefreshAccounts:{type:Function},onStartCodexLogin:{type:Function},onSwitchAccount:{type:Function},onRemoveAccount:{type:Function},onAccountCardPointerEnter:{type:Function},onAccountCardPointerLeave:{type:Function},toggleAccountsSectionCollapsed:{type:Function},prepareFeedbackLink:{type:Function}},setup(e){const{t:b}=D();return(o,h)=>(c(),r("div",oe,[t("div",se,[t("div",ie,[t("button",{class:"sidebar-settings-account-collapse",type:"button","aria-expanded":!e.isAccountsSectionCollapsed,title:e.isAccountsSectionCollapsed?n(b)("Expand accounts"):n(b)("Collapse accounts"),onClick:h[0]||(h[0]=(...u)=>e.toggleAccountsSectionCollapsed&&e.toggleAccountsSectionCollapsed(...u))},[t("span",le,s(e.isAccountsSectionCollapsed?"▸":"▾"),1)],8,ae),t("span",de,s(n(b)("Accounts")),1),t("span",ce,s(e.accounts.length),1)]),t("button",{class:"sidebar-settings-account-refresh",type:"button",disabled:e.isRefreshingAccounts||e.isSwitchingAccounts||e.isStartingCodexLogin||e.isCompletingCodexLogin,onClick:h[1]||(h[1]=(...u)=>e.onRefreshAccounts&&e.onRefreshAccounts(...u))},s(e.isRefreshingAccounts?n(b)("Reloading…"):n(b)("Reload")),9,re)]),e.isAccountsSectionCollapsed?m("",!0):(c(),r(C,{key:0},[e.accountActionError?(c(),r("div",ue,[t("span",null,s(e.accountActionError),1),t("a",{class:"visible-error-feedback",href:e.feedbackMailto,onClick:h[2]||(h[2]=u=>e.prepareFeedbackLink(u,e.accountActionError))},s(n(b)("Send feedback")),9,ge)])):m("",!0),t("div",be,[t("button",{class:"sidebar-settings-account-login-button",type:"button",disabled:e.isRefreshingAccounts||e.isSwitchingAccounts||e.isStartingCodexLogin||e.isCompletingCodexLogin,onClick:h[3]||(h[3]=(...u)=>e.onStartCodexLogin&&e.onStartCodexLogin(...u))},s(e.isStartingCodexLogin?n(b)("Starting login…"):n(b)("Login")),9,me),e.codexLoginUrl?(c(),r("a",{key:0,class:"sidebar-settings-account-login-link",href:e.codexLoginUrl,target:"_blank",rel:"noreferrer"},s(n(b)("Open login URL")),9,he)):m("",!0)]),e.accounts.length===0?(c(),r("p",ve,s(n(b)("Click Login, or run `codex login`, then click reload.")),1)):(c(),r("div",ye,[(c(!0),r(C,null,w(e.accounts,u=>(c(),r("article",{key:u.storageId,class:f(["sidebar-settings-account-item",{"is-active":u.isActive,"is-unavailable":e.isAccountUnavailable(u),"is-confirming-remove":e.isRemoveConfirmationActive(u),"is-remove-visible":e.isRemoveVisible(u)}]),title:e.buildAccountTitle(u),onMouseenter:v=>e.onAccountCardPointerEnter(u.storageId),onMouseleave:v=>e.onAccountCardPointerLeave(u.storageId)},[t("div",fe,[t("p",ke,s(u.email||n(b)("Account")),1),t("p",Ae,s(e.formatAccountMeta(u)),1),t("p",Se,s(e.formatAccountQuota(u)),1),t("p",Fe," Workspace "+s(e.shortAccountId(u.accountId)),1)]),t("div",we,[t("button",{class:"sidebar-settings-account-switch",type:"button",disabled:e.isAccountActionDisabled(u)||u.isActive||e.isAccountUnavailable(u),onClick:v=>e.onSwitchAccount(u.storageId)},s(e.getAccountSwitchLabel(u)),9,Re),t("button",{class:f(["sidebar-settings-account-remove",{"is-visible":e.isRemoveVisible(u),"is-confirming":e.isRemoveConfirmationActive(u)}]),type:"button",disabled:e.isAccountActionDisabled(u),onClick:v=>e.onRemoveAccount(u.storageId)},s(e.getAccountRemoveLabel(u)),11,Le)])],42,Ce))),128))]))],64))]))}}),Me=K(pe,[["__scopeId","data-v-6f39e97f"]]),Ee=["aria-label"],$e={class:"settings-dialog-header"},Te={class:"settings-dialog-title"},Ie=["aria-label","title"],xe={class:"settings-dialog-body"},Pe=["aria-label"],De=["aria-current","onClick"],Ke={class:"settings-group-content"},Ue=["title"],We={class:"sidebar-settings-label"},Be=["title"],Oe={class:"sidebar-settings-label"},Ne={class:"sidebar-settings-value"},Ge=["title"],Ve={class:"sidebar-settings-label"},He={class:"sidebar-settings-value"},Ze=["title"],Qe={class:"sidebar-settings-label"},qe=["title"],Xe={class:"sidebar-settings-label"},je={class:"sidebar-settings-value"},ze=["title"],Je={class:"sidebar-settings-label"},Ye=["title"],_e={class:"sidebar-settings-label"},et=["title"],tt={class:"sidebar-settings-label"},nt=["title"],ot={class:"sidebar-settings-label"},st=["href"],it={class:"sidebar-settings-label"},at={class:"sidebar-settings-value"},lt=["title"],dt={class:"sidebar-settings-label"},ct={key:0,class:"sidebar-settings-row sidebar-settings-error"},rt=["href"],ut={key:1,class:"sidebar-settings-row sidebar-settings-row--input"},gt={class:"sidebar-settings-provider-info"},bt={class:"sidebar-settings-label"},mt={class:"sidebar-settings-provider-link",href:"https://openrouter.ai/keys",target:"_blank",rel:"noopener noreferrer"},ht={class:"sidebar-settings-key-group"},vt={class:"sidebar-settings-key-masked"},yt=["disabled","title"],Ct=["model-value","placeholder"],ft=["disabled"],kt={class:"sidebar-settings-row sidebar-settings-row--select",style:{"margin-top":"4px",padding:"0"}},At={class:"sidebar-settings-label"},St=["aria-label"],Ft=["disabled"],wt=["disabled"],Rt={key:2,class:"sidebar-settings-row sidebar-settings-row--input"},Lt={class:"sidebar-settings-provider-info"},pt={class:"sidebar-settings-label"},Mt={class:"sidebar-settings-provider-link",href:"https://opencode.ai/auth",target:"_blank",rel:"noopener noreferrer"},Et={class:"sidebar-settings-key-group"},$t=["model-value","placeholder"],Tt=["disabled"],It={key:3,class:"sidebar-settings-row sidebar-settings-row--input"},xt={class:"sidebar-settings-label"},Pt={class:"sidebar-settings-key-group"},Dt=["model-value","placeholder"],Kt={class:"sidebar-settings-label",style:{"margin-top":"4px"}},Ut={class:"sidebar-settings-key-group"},Wt=["model-value","placeholder"],Bt=["disabled"],Ot={class:"sidebar-settings-row sidebar-settings-row--select",style:{"margin-top":"4px",padding:"0"}},Nt={class:"sidebar-settings-label"},Gt=["aria-label"],Vt={class:"sidebar-settings-label"},Ht={class:"sidebar-settings-value"},Zt={key:0,class:"sidebar-settings-telegram-panel"},Qt={class:"sidebar-settings-field"},qt={class:"sidebar-settings-field-label"},Xt=["value"],jt={class:"sidebar-settings-field"},zt={class:"sidebar-settings-field-label"},Jt=["value"],Yt={class:"sidebar-settings-field-help"},_t={key:0,class:"sidebar-settings-telegram-error"},en=["href"],tn={class:"sidebar-settings-telegram-actions"},nn=["disabled"],on={class:"sidebar-settings-hooks-section"},sn={class:"sidebar-settings-hooks-header"},an={class:"sidebar-settings-hooks-title"},ln=["disabled","title"],dn={key:0,class:"sidebar-settings-hooks-empty"},cn={key:0,class:"sidebar-settings-hooks-empty"},rn={key:1,class:"sidebar-settings-hooks-empty"},un={key:2,class:"sidebar-settings-hooks-list"},gn={class:"sidebar-settings-hooks-cwd"},bn={class:"sidebar-settings-hooks-event"},mn={class:"sidebar-settings-hooks-command"},hn={class:"sidebar-settings-remote-section"},vn={class:"sidebar-settings-remote-header"},yn={class:"sidebar-settings-remote-title"},Cn=["disabled","title"],fn={class:"sidebar-settings-remote-toggle-label"},kn={key:0,class:"sidebar-settings-remote-empty"},An={key:0,class:"sidebar-settings-remote-error"},Sn={key:1,class:"sidebar-settings-remote-notice"},Fn={key:2,class:"sidebar-settings-remote-empty"},wn=["disabled"],Rn={class:"sidebar-settings-remote-label"},Ln={class:"sidebar-settings-remote-value"},pn={class:"sidebar-settings-remote-clients"},Mn={class:"sidebar-settings-remote-clients-header"},En={class:"sidebar-settings-remote-label"},$n=["disabled"],Tn={key:0,class:"sidebar-settings-remote-empty"},In={class:"sidebar-settings-remote-client-name"},xn=["disabled","onClick"],Pn={class:"sidebar-settings-rate-limits"},Dn=["aria-label"],Kn=P({__name:"SettingsDialog",props:{activeSettingsGroup:{},accounts:{},isAccountsSectionCollapsed:{type:Boolean},isRefreshingAccounts:{type:Boolean},isSwitchingAccounts:{type:Boolean},isStartingCodexLogin:{type:Boolean},isCompletingCodexLogin:{type:Boolean},accountActionError:{},codexLoginUrl:{},feedbackMailto:{},isAccountUnavailable:{type:Function},isRemoveConfirmationActive:{type:Function},isRemoveVisible:{type:Function},buildAccountTitle:{type:Function},formatAccountMeta:{type:Function},formatAccountQuota:{type:Function},shortAccountId:{type:Function},isAccountActionDisabled:{type:Function},getAccountSwitchLabel:{type:Function},getAccountRemoveLabel:{type:Function},onRefreshAccounts:{type:Function},onStartCodexLogin:{type:Function},onSwitchAccount:{type:Function},onRemoveAccount:{type:Function},onAccountCardPointerEnter:{type:Function},onAccountCardPointerLeave:{type:Function},toggleAccountsSectionCollapsed:{type:Function},prepareFeedbackLink:{type:Function},sendWithEnter:{type:Boolean},inProgressSendMode:{},darkMode:{},uiLanguage:{},uiLanguageOptions:{},chatWidthLabel:{},dictationClickToToggle:{type:Boolean},dictationAutoSend:{type:Boolean},dictationLanguage:{},dictationLanguageOptions:{},autoCompactThreshold:{},autoCompactThresholdOptions:{},hasVisibleFeedbackError:{type:Boolean},selectedProvider:{},providerDropdownOptions:{},freeModeLoading:{type:Boolean},providerError:{},freeModeHasCustomKey:{type:Boolean},freeModeCustomKey:{},freeModeCustomKeyMasked:{},freeModeCustomKeySaving:{type:Boolean},openRouterWireApi:{},opencodeZenKey:{},customEndpointUrl:{},customEndpointKey:{},customEndpointWireApi:{},isTelegramConfigOpen:{type:Boolean},telegramStatusText:{},telegramBotTokenDraft:{},telegramAllowedUserIdsDraft:{},telegramConfigError:{},isTelegramSaving:{type:Boolean},supportsHooks:{type:Boolean},isHooksLoading:{type:Boolean},hooksList:{},supportsRemoteControl:{type:Boolean},remoteControlStatus:{},isRemoteControlActionInFlight:{type:Boolean},remoteControlError:{},remoteControlNotice:{},isRemoteControlLoading:{type:Boolean},remoteControlActionName:{},pairingCode:{},accountRateLimitSnapshots:{},worktreeName:{},appVersion:{},onClose:{type:Function},onActiveSettingsGroupChange:{type:Function},toggleSendWithEnter:{type:Function},cycleInProgressSendMode:{type:Function},cycleDarkMode:{type:Function},onUiLanguageChange:{type:Function},cycleChatWidth:{type:Function},toggleDictationClickToToggle:{type:Function},toggleDictationAutoSend:{type:Function},onDictationLanguageChange:{type:Function},onAutoCompactThresholdChange:{type:Function},onProviderChange:{type:Function},onFreeModeCustomKeyChange:{type:Function},clearFreeModeCustomKey:{type:Function},saveFreeModeCustomKey:{type:Function},setOpenRouterWireApi:{type:Function},onOpencodeZenKeyChange:{type:Function},saveOpencodeZen:{type:Function},onCustomEndpointUrlChange:{type:Function},onCustomEndpointKeyChange:{type:Function},saveCustomEndpoint:{type:Function},onCustomEndpointWireApiChange:{type:Function},onTelegramConfigOpenChange:{type:Function},onTelegramBotTokenDraftChange:{type:Function},onTelegramAllowedUserIdsDraftChange:{type:Function},saveTelegramConfig:{type:Function},refreshHooks:{type:Function},toggleRemoteControl:{type:Function},startRemotePairing:{type:Function},refreshRemoteClients:{type:Function},revokeRemoteClient:{type:Function}},setup(e,{expose:b}){const{t:o}=D(),h=q(null),u=[{id:"general",label:"General settings"},{id:"models",label:"Models & providers"},{id:"integrations",label:"Integrations"},{id:"usage",label:"Usage & about"}],v={sendWithEnter:o("When enabled, press Enter to send. When disabled, use Command+Enter to send."),inProgressSendMode:o("If a turn is still running, choose whether a new prompt should steer the current turn or be queued."),appearance:o("Switch between system theme, light mode, and dark mode."),chatWidth:o("Choose how wide the conversation column and composer can grow on desktop screens."),dictationClickToToggle:o("Use click-to-start and click-to-stop dictation instead of hold-to-talk."),dictationAutoSend:o("Automatically send transcribed dictation when recording stops."),dictationLanguage:o("Choose transcription language or keep auto-detect.")};function I(p){var a;return((a=h.value)==null?void 0:a.contains(p))??!1}return b({containsTarget:I}),(p,a)=>{var R;return c(),H(Q,{to:"body"},[t("div",{class:"settings-dialog-backdrop",role:"presentation",onClick:a[36]||(a[36]=B((...i)=>e.onClose&&e.onClose(...i),["self"]))},[t("div",{ref_key:"settingsPanelRef",ref:h,class:"sidebar-settings-panel",role:"dialog","aria-modal":"true","aria-label":n(o)("Settings"),onClick:a[35]||(a[35]=B(()=>{},["stop"]))},[t("div",$e,[t("h2",Te,s(n(o)("Settings")),1),t("button",{class:"settings-dialog-close",type:"button","aria-label":n(o)("Close"),title:n(o)("Close"),onClick:a[0]||(a[0]=(...i)=>e.onClose&&e.onClose(...i))},[F(Z,{class:"settings-dialog-close-icon"})],8,Ie)]),t("div",xe,[t("nav",{class:"settings-group-nav","aria-label":n(o)("Settings groups")},[(c(),r(C,null,w(u,i=>t("button",{key:i.id,type:"button",class:f(["settings-group-nav-item",{"is-active":e.activeSettingsGroup===i.id}]),"aria-current":e.activeSettingsGroup===i.id?"true":void 0,onClick:k=>e.onActiveSettingsGroupChange(i.id)},s(n(o)(i.label)),11,De)),64))],8,Pe),t("div",Ke,[M(t("div",null,[F(Me,{accounts:e.accounts,"is-accounts-section-collapsed":e.isAccountsSectionCollapsed,"is-refreshing-accounts":e.isRefreshingAccounts,"is-switching-accounts":e.isSwitchingAccounts,"is-starting-codex-login":e.isStartingCodexLogin,"is-completing-codex-login":e.isCompletingCodexLogin,"account-action-error":e.accountActionError,"codex-login-url":e.codexLoginUrl,"feedback-mailto":e.feedbackMailto,"is-account-unavailable":e.isAccountUnavailable,"is-remove-confirmation-active":e.isRemoveConfirmationActive,"is-remove-visible":e.isRemoveVisible,"build-account-title":e.buildAccountTitle,"format-account-meta":e.formatAccountMeta,"format-account-quota":e.formatAccountQuota,"short-account-id":e.shortAccountId,"is-account-action-disabled":e.isAccountActionDisabled,"get-account-switch-label":e.getAccountSwitchLabel,"get-account-remove-label":e.getAccountRemoveLabel,"on-refresh-accounts":e.onRefreshAccounts,"on-start-codex-login":e.onStartCodexLogin,"on-switch-account":e.onSwitchAccount,"on-remove-account":e.onRemoveAccount,"on-account-card-pointer-enter":e.onAccountCardPointerEnter,"on-account-card-pointer-leave":e.onAccountCardPointerLeave,"toggle-accounts-section-collapsed":e.toggleAccountsSectionCollapsed,"prepare-feedback-link":e.prepareFeedbackLink},null,8,["accounts","is-accounts-section-collapsed","is-refreshing-accounts","is-switching-accounts","is-starting-codex-login","is-completing-codex-login","account-action-error","codex-login-url","feedback-mailto","is-account-unavailable","is-remove-confirmation-active","is-remove-visible","build-account-title","format-account-meta","format-account-quota","short-account-id","is-account-action-disabled","get-account-switch-label","get-account-remove-label","on-refresh-accounts","on-start-codex-login","on-switch-account","on-remove-account","on-account-card-pointer-enter","on-account-card-pointer-leave","toggle-accounts-section-collapsed","prepare-feedback-link"]),t("button",{class:"sidebar-settings-row",type:"button",title:v.sendWithEnter,onClick:a[1]||(a[1]=(...i)=>e.toggleSendWithEnter&&e.toggleSendWithEnter(...i))},[t("span",We,s(n(o)("Require ⌘ + enter to send")),1),t("span",{class:f(["sidebar-settings-toggle",{"is-on":!e.sendWithEnter}])},null,2)],8,Ue),t("button",{class:"sidebar-settings-row",type:"button",title:v.inProgressSendMode,onClick:a[2]||(a[2]=(...i)=>e.cycleInProgressSendMode&&e.cycleInProgressSendMode(...i))},[t("span",Oe,s(n(o)("When busy, send as")),1),t("span",Ne,s(e.inProgressSendMode==="steer"?n(o)("Steer"):n(o)("Queue")),1)],8,Be),t("button",{class:"sidebar-settings-row",type:"button",title:v.appearance,onClick:a[3]||(a[3]=(...i)=>e.cycleDarkMode&&e.cycleDarkMode(...i))},[t("span",Ve,s(n(o)("Appearance")),1),t("span",He,s(e.darkMode==="system"?n(o)("System"):e.darkMode==="dark"?n(o)("Dark"):n(o)("Light")),1)],8,Ge),t("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:n(o)("Choose the interface language for the app.")},[t("span",Qe,s(n(o)("UI language")),1),F($,{class:"sidebar-settings-provider-dropdown","model-value":e.uiLanguage,options:e.uiLanguageOptions,placeholder:n(o)("UI language"),"menu-align":"end","onUpdate:modelValue":a[4]||(a[4]=i=>e.onUiLanguageChange(i))},null,8,["model-value","options","placeholder"])],8,Ze),t("button",{class:"sidebar-settings-row",type:"button",title:v.chatWidth,onClick:a[5]||(a[5]=(...i)=>e.cycleChatWidth&&e.cycleChatWidth(...i))},[t("span",Xe,s(n(o)("Chat width")),1),t("span",je,s(e.chatWidthLabel),1)],8,qe),t("button",{class:"sidebar-settings-row",type:"button",title:v.dictationClickToToggle,onClick:a[6]||(a[6]=(...i)=>e.toggleDictationClickToToggle&&e.toggleDictationClickToToggle(...i))},[t("span",Je,s(n(o)("Click to toggle dictation")),1),t("span",{class:f(["sidebar-settings-toggle",{"is-on":e.dictationClickToToggle}])},null,2)],8,ze),t("button",{class:"sidebar-settings-row",type:"button",title:v.dictationAutoSend,onClick:a[7]||(a[7]=(...i)=>e.toggleDictationAutoSend&&e.toggleDictationAutoSend(...i))},[t("span",_e,s(n(o)("Auto send dictation")),1),t("span",{class:f(["sidebar-settings-toggle",{"is-on":e.dictationAutoSend}])},null,2)],8,Ye),t("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:v.dictationLanguage},[t("span",tt,s(n(o)("Dictation language")),1),F($,{class:"sidebar-settings-language-dropdown","model-value":e.dictationLanguage,options:e.dictationLanguageOptions,placeholder:n(o)("Auto-detect"),"open-direction":"up","enable-search":!0,"search-placeholder":n(o)("Search language..."),"onUpdate:modelValue":e.onDictationLanguageChange},null,8,["model-value","options","placeholder","search-placeholder","onUpdate:modelValue"])],8,et),t("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:n(o)("Auto-compact at or below remaining context percentage. 0 disables auto-compaction and falls back to server-side compaction.")},[t("span",ot,s(n(o)("Auto-compact before send")),1),F($,{class:"sidebar-settings-auto-compact-dropdown","model-value":String(e.autoCompactThreshold),options:e.autoCompactThresholdOptions,placeholder:n(o)("Off"),"menu-align":"end","onUpdate:modelValue":e.onAutoCompactThresholdChange},null,8,["model-value","options","placeholder","onUpdate:modelValue"])],8,nt),e.hasVisibleFeedbackError?(c(),r("a",{key:0,class:"sidebar-settings-row sidebar-settings-feedback-row",href:e.feedbackMailto,onClick:a[8]||(a[8]=(...i)=>e.prepareFeedbackLink&&e.prepareFeedbackLink(...i))},[t("span",it,s(n(o)("Send feedback")),1),t("span",at,s(n(o)("Issue detected")),1)],8,st)):m("",!0)],512),[[E,e.activeSettingsGroup==="general"]]),M(t("div",null,[t("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:n(o)("Choose the API provider for the Codex backend")},[t("span",dt,s(n(o)("Provider")),1),F($,{class:"sidebar-settings-provider-dropdown","model-value":e.selectedProvider,options:e.providerDropdownOptions,placeholder:n(o)("Provider"),disabled:e.freeModeLoading,"menu-align":"end","onUpdate:modelValue":e.onProviderChange},null,8,["model-value","options","placeholder","disabled","onUpdate:modelValue"])],8,lt),e.providerError?(c(),r("div",ct,[t("span",null,s(e.providerError),1),t("a",{class:"visible-error-feedback",href:e.feedbackMailto,onClick:a[9]||(a[9]=i=>e.prepareFeedbackLink(i,e.providerError))},s(n(o)("Send feedback")),9,rt)])):m("",!0),e.selectedProvider==="openrouter"?(c(),r("div",ut,[t("div",gt,[t("span",bt,s(n(o)("OpenRouter API key")),1),t("a",mt,s(n(o)("Get API key")),1)]),t("div",ht,[e.freeModeHasCustomKey&&!e.freeModeCustomKey?(c(),r(C,{key:0},[t("span",vt,s(e.freeModeCustomKeyMasked),1),t("button",{class:"sidebar-settings-key-clear",type:"button",disabled:e.freeModeCustomKeySaving,title:n(o)("Remove custom key, use community keys"),onClick:a[10]||(a[10]=(...i)=>e.clearFreeModeCustomKey&&e.clearFreeModeCustomKey(...i))},"✕",8,yt)],64)):(c(),r(C,{key:1},[t("input",{"model-value":e.freeModeCustomKey,onInput:a[11]||(a[11]=i=>e.onFreeModeCustomKeyChange(i.target.value)),class:"sidebar-settings-key-input",type:"password",placeholder:n(o)("sk-or-v1-... (optional, uses free keys if empty)"),onKeydown:a[12]||(a[12]=T((...i)=>e.saveFreeModeCustomKey&&e.saveFreeModeCustomKey(...i),["enter"]))},null,40,Ct),t("button",{class:"sidebar-settings-key-save",type:"button",disabled:e.freeModeCustomKeySaving||!e.freeModeCustomKey.trim(),onClick:a[13]||(a[13]=(...i)=>e.saveFreeModeCustomKey&&e.saveFreeModeCustomKey(...i))},s(e.freeModeCustomKeySaving?"...":n(o)("Set")),9,ft)],64))]),t("div",kt,[t("span",At,s(n(o)("API format")),1),t("div",{class:"sidebar-settings-segmented",role:"group","aria-label":n(o)("OpenRouter API format")},[t("button",{type:"button",class:f(["sidebar-settings-segmented-option",{"is-active":e.openRouterWireApi==="responses"}]),disabled:e.freeModeCustomKeySaving||e.freeModeLoading,onClick:a[14]||(a[14]=i=>e.setOpenRouterWireApi("responses"))},s(n(o)("Responses")),11,Ft),t("button",{type:"button",class:f(["sidebar-settings-segmented-option",{"is-active":e.openRouterWireApi==="chat"}]),disabled:e.freeModeCustomKeySaving||e.freeModeLoading,onClick:a[15]||(a[15]=i=>e.setOpenRouterWireApi("chat"))},s(n(o)("Completions")),11,wt)],8,St)])])):m("",!0),e.selectedProvider==="opencode-zen"?(c(),r("div",Rt,[t("div",Lt,[t("span",pt,s(n(o)("OpenCode Zen API key")),1),t("a",Mt,s(n(o)("Get API key")),1)]),t("div",Et,[t("input",{"model-value":e.opencodeZenKey,onInput:a[16]||(a[16]=i=>e.onOpencodeZenKeyChange(i.target.value)),class:"sidebar-settings-key-input",type:"password",placeholder:n(o)("sk-..."),onKeydown:a[17]||(a[17]=T((...i)=>e.saveOpencodeZen&&e.saveOpencodeZen(...i),["enter"]))},null,40,$t),t("button",{class:"sidebar-settings-key-save",type:"button",disabled:e.freeModeCustomKeySaving||!e.opencodeZenKey.trim(),onClick:a[18]||(a[18]=(...i)=>e.saveOpencodeZen&&e.saveOpencodeZen(...i))},s(e.freeModeCustomKeySaving?"...":n(o)("Save")),9,Tt)])])):m("",!0),e.selectedProvider==="custom"?(c(),r("div",It,[t("span",xt,s(n(o)("Custom endpoint URL")),1),t("div",Pt,[t("input",{"model-value":e.customEndpointUrl,onInput:a[19]||(a[19]=i=>e.onCustomEndpointUrlChange(i.target.value)),class:"sidebar-settings-key-input",type:"url",placeholder:n(o)("https://api.example.com/v1"),onKeydown:a[20]||(a[20]=T((...i)=>e.saveCustomEndpoint&&e.saveCustomEndpoint(...i),["enter"]))},null,40,Dt)]),t("span",Kt,s(n(o)("API key")),1),t("div",Ut,[t("input",{"model-value":e.customEndpointKey,onInput:a[21]||(a[21]=i=>e.onCustomEndpointKeyChange(i.target.value)),class:"sidebar-settings-key-input",type:"password",placeholder:n(o)("Bearer token (optional)"),onKeydown:a[22]||(a[22]=T((...i)=>e.saveCustomEndpoint&&e.saveCustomEndpoint(...i),["enter"]))},null,40,Wt),t("button",{class:"sidebar-settings-key-save",type:"button",disabled:e.freeModeCustomKeySaving||!e.customEndpointUrl.trim(),onClick:a[23]||(a[23]=(...i)=>e.saveCustomEndpoint&&e.saveCustomEndpoint(...i))},s(e.freeModeCustomKeySaving?"...":n(o)("Save")),9,Bt)]),t("div",Ot,[t("span",Nt,s(n(o)("API format")),1),t("div",{class:"sidebar-settings-segmented",role:"group","aria-label":n(o)("Custom endpoint API format")},[t("button",{type:"button",class:f(["sidebar-settings-segmented-option",{"is-active":e.customEndpointWireApi==="responses"}]),onClick:a[24]||(a[24]=i=>e.onCustomEndpointWireApiChange("responses"))},s(n(o)("Responses")),3),t("button",{type:"button",class:f(["sidebar-settings-segmented-option",{"is-active":e.customEndpointWireApi==="chat"}]),onClick:a[25]||(a[25]=i=>e.onCustomEndpointWireApiChange("chat"))},s(n(o)("Completions")),3)],8,Gt)])])):m("",!0)],512),[[E,e.activeSettingsGroup==="models"]]),M(t("div",null,[t("button",{class:"sidebar-settings-row",type:"button","aria-live":"polite",onClick:a[26]||(a[26]=i=>e.onTelegramConfigOpenChange(!e.isTelegramConfigOpen))},[t("span",Vt,s(n(o)("Telegram")),1),t("span",Ht,s(e.telegramStatusText),1)]),e.isTelegramConfigOpen?(c(),r("div",Zt,[t("label",Qt,[t("span",qt,s(n(o)("Bot token")),1),t("input",{value:e.telegramBotTokenDraft,onInput:a[27]||(a[27]=i=>e.onTelegramBotTokenDraftChange(i.target.value)),class:"sidebar-settings-input",type:"password",placeholder:"123456:ABCDEF",autocomplete:"off",spellcheck:"false"},null,40,Xt)]),t("label",jt,[t("span",zt,s(n(o)("Allowed Telegram user IDs")),1),t("textarea",{value:e.telegramAllowedUserIdsDraft,onInput:a[28]||(a[28]=i=>e.onTelegramAllowedUserIdsDraftChange(i.target.value)),class:"sidebar-settings-textarea",rows:"3",placeholder:`123456789
3
- 987654321`,spellcheck:"false"},null,40,Jt)]),t("div",Yt,s(n(o)("Put one Telegram user ID per line or separate them with commas. Use `*` to allow all Telegram users. Unauthorized users will see their own ID in the rejection message so they can copy it here.")),1),e.telegramConfigError?(c(),r("div",_t,[t("span",null,s(e.telegramConfigError),1),t("a",{class:"visible-error-feedback",href:e.feedbackMailto,onClick:a[29]||(a[29]=i=>e.prepareFeedbackLink(i,e.telegramConfigError))},s(n(o)("Send feedback")),9,en)])):m("",!0),t("div",tn,[t("button",{class:"sidebar-settings-telegram-save",type:"button",disabled:e.isTelegramSaving,onClick:a[30]||(a[30]=(...i)=>e.saveTelegramConfig&&e.saveTelegramConfig(...i))},s(e.isTelegramSaving?n(o)("Saving…"):n(o)("Save Telegram config")),9,nn)])])):m("",!0),t("div",on,[t("div",sn,[t("span",an,s(n(o)("Hooks")),1),t("button",{class:"sidebar-settings-hooks-reload",type:"button",disabled:e.isHooksLoading,title:n(o)("Reload lifecycle hooks"),onClick:a[31]||(a[31]=i=>e.refreshHooks({force:!0}))},s(e.isHooksLoading?n(o)("Reloading…"):n(o)("Reload")),9,ln)]),e.supportsHooks?(c(),r(C,{key:1},[e.isHooksLoading?(c(),r("p",cn,s(n(o)("Loading hooks…")),1)):e.hooksList.length===0?(c(),r("p",rn,s(n(o)("No hooks registered.")),1)):(c(),r("div",un,[(c(!0),r(C,null,w(e.hooksList,i=>(c(),r("div",{key:i.cwd||"__global__",class:"sidebar-settings-hooks-entry"},[t("p",gn,s(i.cwd||n(o)("Global")),1),(c(!0),r(C,null,w(i.hooks,(k,L)=>(c(),r("div",{key:`${i.cwd}:${k.event}:${L}`,class:"sidebar-settings-hooks-item"},[t("span",{class:f(["sidebar-settings-hooks-state",{"is-on":k.enabled!==!1}])},s(k.enabled===!1?n(o)("Disabled"):n(o)("Enabled")),3),t("span",bn,s(k.event),1),t("code",mn,s(k.command),1)]))),128))]))),128))]))],64)):(c(),r("p",dn,s(n(o)("Hooks are not supported by this Codex version.")),1))]),t("div",hn,[t("div",vn,[t("span",yn,s(n(o)("Remote control")),1),t("button",{class:"sidebar-settings-remote-toggle",type:"button",disabled:e.isRemoteControlActionInFlight||e.isRemoteControlLoading,title:n(o)("Enable or disable remote control"),onClick:a[32]||(a[32]=(...i)=>e.toggleRemoteControl&&e.toggleRemoteControl(...i))},[t("span",{class:f(["sidebar-settings-remote-toggle-track",{"is-on":e.remoteControlStatus.enabled}])},[...a[37]||(a[37]=[t("span",{class:"sidebar-settings-remote-toggle-thumb"},null,-1)])],2),t("span",fn,s(e.remoteControlStatus.enabled?n(o)("Enabled"):n(o)("Disabled")),1)],8,Cn)]),e.supportsRemoteControl?(c(),r(C,{key:1},[e.remoteControlError?(c(),r("p",An,s(e.remoteControlError),1)):m("",!0),e.remoteControlNotice?(c(),r("p",Sn,s(e.remoteControlNotice),1)):m("",!0),e.isRemoteControlLoading?(c(),r("p",Fn,s(n(o)("Loading…")),1)):(c(),r(C,{key:3},[t("button",{class:"sidebar-settings-remote-row",type:"button",disabled:!e.remoteControlStatus.enabled||e.isRemoteControlActionInFlight,onClick:a[33]||(a[33]=(...i)=>e.startRemotePairing&&e.startRemotePairing(...i))},[t("span",Rn,s(n(o)("Pair a new device")),1),t("span",Ln,s(e.remoteControlActionName==="pairing"?n(o)("Starting…"):(R=e.pairingCode)!=null&&R.pairingCode?e.pairingCode.pairingCode:n(o)("Generate code")),1)],8,wn),t("div",pn,[t("div",Mn,[t("span",En,s(n(o)("Paired devices")),1),t("button",{class:"sidebar-settings-remote-reload",type:"button",disabled:e.isRemoteControlActionInFlight,onClick:a[34]||(a[34]=(...i)=>e.refreshRemoteClients&&e.refreshRemoteClients(...i))},s(e.remoteControlActionName==="clients"?n(o)("Reloading…"):n(o)("Reload")),9,$n)]),e.remoteControlStatus.clients.length===0?(c(),r("p",Tn,s(n(o)("No paired devices.")),1)):m("",!0),(c(!0),r(C,null,w(e.remoteControlStatus.clients,i=>(c(),r("div",{key:i.clientId,class:"sidebar-settings-remote-client"},[t("span",In,s(i.deviceName||i.clientId),1),t("button",{class:"sidebar-settings-remote-client-revoke",type:"button",disabled:e.isRemoteControlActionInFlight,onClick:k=>e.revokeRemoteClient(i.clientId)},s(e.remoteControlActionName===`revoke:${i.clientId}`?n(o)("Removing…"):n(o)("Revoke")),9,xn)]))),128))])],64))],64)):(c(),r("p",kn,s(n(o)("Remote control is not supported by this Codex version.")),1))])],512),[[E,e.activeSettingsGroup==="integrations"]]),M(t("div",null,[t("div",Pn,[F(ne,{snapshots:e.accountRateLimitSnapshots},null,8,["snapshots"])]),t("div",{class:"sidebar-settings-build-label","aria-label":n(o)("Worktree name and version")}," WT "+s(e.worktreeName)+" · v"+s(e.appVersion),9,Dn)],512),[[E,e.activeSettingsGroup==="usage"]])])])],8,Ee)])])}}}),Wn=K(Kn,[["__scopeId","data-v-f5f657a8"]]);export{Wn as default};
1
+ import{h as P,i as c,k as r,F as C,q as w,l as t,t as s,p as m,z as D,_ as K,u as n,m as f,j as H,w as B,v as F,I as Z,Y as M,aW as E,ak as $,Z as T,T as q,b as Q}from"./index-CMrfiiel.js";const X={key:0,class:"rate-limit-status","aria-live":"polite"},j=["title"],z={class:"rate-limit-card-header"},Y={class:"rate-limit-card-title"},J={key:0,class:"rate-limit-card-plan"},_={class:"rate-limit-card-metrics"},ee={key:0,class:"rate-limit-card-footer"},te=P({__name:"RateLimitStatus",props:{snapshots:{}},setup(e){const{t:b}=D();function o(l){var d,g;return((d=l.limitId)==null?void 0:d.trim())||((g=l.limitName)==null?void 0:g.trim())||"__default__"}function h(l){var d,g;return((d=l.limitName)==null?void 0:d.trim())||((g=l.limitId)==null?void 0:g.trim())||b("Rate limits")}function u(l){const d=l.trim();return d?d.replace(/[_-]+/g," ").replace(/\b\w/g,g=>g.toUpperCase()):""}function v(l){return!l||l<=0?b("Window"):l%1440===0?`${l/1440}d`:l%60===0?`${l/60}h`:l<60?`${l}m`:`${Math.round(l/60*10)/10}h`}function I(l){const d=Math.max(0,Math.min(100,100-l));return`${Math.round(d)}% ${b("left")}`}function p(l){return`${Math.round(l)}%`}function a(l,d){return{key:d,label:`${v(l.windowDurationMins)} ${I(l.usedPercent)}`}}function R(l){const d=[];return l.primary&&d.push(a(l.primary,"primary")),l.secondary&&d.push(a(l.secondary,"secondary")),d}function i(l){if(!l)return"";const d=new Date(l*1e3),g=d.getMonth()+1,y=String(d.getDate()).padStart(2,"0"),A=String(d.getHours()).padStart(2,"0"),S=String(d.getMinutes()).padStart(2,"0");return`${g}.${y} ${A}:${S}`}function k(l){if(!(l!=null&&l.resetsAt))return"";const d=l.resetsAt*1e3-Date.now();if(d<=0)return b("Resetting now");const g=Math.round(d/6e4);if(g<60)return`${b("Resets in")} ${g}m`;const y=Math.round(g/60);if(y<24)return`${b("Resets in")} ${y}h`;const A=Math.round(y/24);return`${b("Resets in")} ${A}d`}function L(l){return[l.primary,l.secondary].filter(d=>d!==null)}function O(l){const d=L(l);return d.length===0?null:[...d].sort((g,y)=>{const A=g.windowDurationMins??Number.MAX_SAFE_INTEGER,S=y.windowDurationMins??Number.MAX_SAFE_INTEGER;return A!==S?A-S:(g.resetsAt??Number.MAX_SAFE_INTEGER)-(y.resetsAt??Number.MAX_SAFE_INTEGER)})[0]}function N(l){const d=L(l);if(d.length===0)return"";const g=[...d].sort((A,S)=>{const W=A.windowDurationMins??-1,U=S.windowDurationMins??-1;return W!==U?U-W:(S.resetsAt??-1)-(A.resetsAt??-1)})[0],y=i(g.resetsAt);return y||""}function G(l){const d=l.credits;return d?d.unlimited?b("Unlimited credits"):d.balance?`${b("Credits")} ${d.balance}`:d.hasCredits?b("Credits available"):"":""}function x(l){return[k(O(l)),N(l),G(l)].filter(d=>d.length>0)}function V(l){const d=[h(l)];for(const g of R(l))d.push(g.label);for(const g of L(l))d.push(`${v(g.windowDurationMins)} used ${p(g.usedPercent)}`);for(const g of x(l))d.push(g);return d.join(`
2
+ `)}return(l,d)=>e.snapshots.length>0?(c(),r("aside",X,[(c(!0),r(C,null,w(e.snapshots,g=>(c(),r("div",{key:o(g),class:"rate-limit-card",title:V(g)},[t("div",z,[t("span",Y,s(h(g)),1),g.planType?(c(),r("span",J,s(u(g.planType)),1)):m("",!0)]),t("div",_,[(c(!0),r(C,null,w(R(g),y=>(c(),r("span",{key:y.key,class:"rate-limit-card-metric"},s(y.label),1))),128))]),x(g).length>0?(c(),r("div",ee,s(x(g).join(" | ")),1)):m("",!0)],8,j))),128))])):m("",!0)}}),ne=K(te,[["__scopeId","data-v-f4d179d1"]]),oe={class:"sidebar-settings-account-section"},se={class:"sidebar-settings-account-header"},ie={class:"sidebar-settings-account-header-main"},ae=["aria-expanded","title"],le={class:"sidebar-settings-account-collapse-icon"},de={class:"sidebar-settings-account-title"},ce={class:"sidebar-settings-account-count"},re=["disabled"],ue={key:0,class:"sidebar-settings-account-error visible-error-with-feedback"},ge=["href"],be={class:"sidebar-settings-account-login"},me=["disabled"],he=["href"],ve={key:1,class:"sidebar-settings-account-empty"},ye={key:2,class:"sidebar-settings-account-list"},Ce=["title","onMouseenter","onMouseleave"],fe={class:"sidebar-settings-account-main"},ke={class:"sidebar-settings-account-email"},Ae={class:"sidebar-settings-account-meta"},Se={class:"sidebar-settings-account-quota"},Fe={class:"sidebar-settings-account-id"},we={class:"sidebar-settings-account-actions"},Re=["disabled","onClick"],Le=["disabled","onClick"],pe=P({__name:"SettingsAccountsPanel",props:{accounts:{},isAccountsSectionCollapsed:{type:Boolean},isRefreshingAccounts:{type:Boolean},isSwitchingAccounts:{type:Boolean},isStartingCodexLogin:{type:Boolean},isCompletingCodexLogin:{type:Boolean},accountActionError:{},codexLoginUrl:{},feedbackMailto:{},isAccountUnavailable:{type:Function},isRemoveConfirmationActive:{type:Function},isRemoveVisible:{type:Function},buildAccountTitle:{type:Function},formatAccountMeta:{type:Function},formatAccountQuota:{type:Function},shortAccountId:{type:Function},isAccountActionDisabled:{type:Function},getAccountSwitchLabel:{type:Function},getAccountRemoveLabel:{type:Function},onRefreshAccounts:{type:Function},onStartCodexLogin:{type:Function},onSwitchAccount:{type:Function},onRemoveAccount:{type:Function},onAccountCardPointerEnter:{type:Function},onAccountCardPointerLeave:{type:Function},toggleAccountsSectionCollapsed:{type:Function},prepareFeedbackLink:{type:Function}},setup(e){const{t:b}=D();return(o,h)=>(c(),r("div",oe,[t("div",se,[t("div",ie,[t("button",{class:"sidebar-settings-account-collapse",type:"button","aria-expanded":!e.isAccountsSectionCollapsed,title:e.isAccountsSectionCollapsed?n(b)("Expand accounts"):n(b)("Collapse accounts"),onClick:h[0]||(h[0]=(...u)=>e.toggleAccountsSectionCollapsed&&e.toggleAccountsSectionCollapsed(...u))},[t("span",le,s(e.isAccountsSectionCollapsed?"▸":"▾"),1)],8,ae),t("span",de,s(n(b)("Accounts")),1),t("span",ce,s(e.accounts.length),1)]),t("button",{class:"sidebar-settings-account-refresh",type:"button",disabled:e.isRefreshingAccounts||e.isSwitchingAccounts||e.isStartingCodexLogin||e.isCompletingCodexLogin,onClick:h[1]||(h[1]=(...u)=>e.onRefreshAccounts&&e.onRefreshAccounts(...u))},s(e.isRefreshingAccounts?n(b)("Reloading…"):n(b)("Reload")),9,re)]),e.isAccountsSectionCollapsed?m("",!0):(c(),r(C,{key:0},[e.accountActionError?(c(),r("div",ue,[t("span",null,s(e.accountActionError),1),t("a",{class:"visible-error-feedback",href:e.feedbackMailto,onClick:h[2]||(h[2]=u=>e.prepareFeedbackLink(u,e.accountActionError))},s(n(b)("Send feedback")),9,ge)])):m("",!0),t("div",be,[t("button",{class:"sidebar-settings-account-login-button",type:"button",disabled:e.isRefreshingAccounts||e.isSwitchingAccounts||e.isStartingCodexLogin||e.isCompletingCodexLogin,onClick:h[3]||(h[3]=(...u)=>e.onStartCodexLogin&&e.onStartCodexLogin(...u))},s(e.isStartingCodexLogin?n(b)("Starting login…"):n(b)("Login")),9,me),e.codexLoginUrl?(c(),r("a",{key:0,class:"sidebar-settings-account-login-link",href:e.codexLoginUrl,target:"_blank",rel:"noreferrer"},s(n(b)("Open login URL")),9,he)):m("",!0)]),e.accounts.length===0?(c(),r("p",ve,s(n(b)("Click Login, or run `codex login`, then click reload.")),1)):(c(),r("div",ye,[(c(!0),r(C,null,w(e.accounts,u=>(c(),r("article",{key:u.storageId,class:f(["sidebar-settings-account-item",{"is-active":u.isActive,"is-unavailable":e.isAccountUnavailable(u),"is-confirming-remove":e.isRemoveConfirmationActive(u),"is-remove-visible":e.isRemoveVisible(u)}]),title:e.buildAccountTitle(u),onMouseenter:v=>e.onAccountCardPointerEnter(u.storageId),onMouseleave:v=>e.onAccountCardPointerLeave(u.storageId)},[t("div",fe,[t("p",ke,s(u.email||n(b)("Account")),1),t("p",Ae,s(e.formatAccountMeta(u)),1),t("p",Se,s(e.formatAccountQuota(u)),1),t("p",Fe," Workspace "+s(e.shortAccountId(u.accountId)),1)]),t("div",we,[t("button",{class:"sidebar-settings-account-switch",type:"button",disabled:e.isAccountActionDisabled(u)||u.isActive||e.isAccountUnavailable(u),onClick:v=>e.onSwitchAccount(u.storageId)},s(e.getAccountSwitchLabel(u)),9,Re),t("button",{class:f(["sidebar-settings-account-remove",{"is-visible":e.isRemoveVisible(u),"is-confirming":e.isRemoveConfirmationActive(u)}]),type:"button",disabled:e.isAccountActionDisabled(u),onClick:v=>e.onRemoveAccount(u.storageId)},s(e.getAccountRemoveLabel(u)),11,Le)])],42,Ce))),128))]))],64))]))}}),Me=K(pe,[["__scopeId","data-v-6f39e97f"]]),Ee=["aria-label"],$e={class:"settings-dialog-header"},Te={class:"settings-dialog-title"},Ie=["aria-label","title"],xe={class:"settings-dialog-body"},Pe=["aria-label"],De=["aria-current","onClick"],Ke={class:"settings-group-content"},We=["title"],Ue={class:"sidebar-settings-label"},Be=["title"],Oe={class:"sidebar-settings-label"},Ne={class:"sidebar-settings-value"},Ge=["title"],Ve={class:"sidebar-settings-label"},He={class:"sidebar-settings-value"},Ze=["title"],qe={class:"sidebar-settings-label"},Qe=["title"],Xe={class:"sidebar-settings-label"},je={class:"sidebar-settings-value"},ze=["title"],Ye={class:"sidebar-settings-label"},Je=["title"],_e={class:"sidebar-settings-label"},et=["title"],tt={class:"sidebar-settings-label"},nt=["title"],ot={class:"sidebar-settings-label"},st=["href"],it={class:"sidebar-settings-label"},at={class:"sidebar-settings-value"},lt=["title"],dt={class:"sidebar-settings-label"},ct={key:0,class:"sidebar-settings-row sidebar-settings-error"},rt=["href"],ut={key:1,class:"sidebar-settings-row sidebar-settings-row--input"},gt={class:"sidebar-settings-provider-info"},bt={class:"sidebar-settings-label"},mt={class:"sidebar-settings-provider-link",href:"https://openrouter.ai/keys",target:"_blank",rel:"noopener noreferrer"},ht={class:"sidebar-settings-key-group"},vt={class:"sidebar-settings-key-masked"},yt=["disabled","title"],Ct=["model-value","placeholder"],ft=["disabled"],kt={class:"sidebar-settings-row sidebar-settings-row--select",style:{"margin-top":"4px",padding:"0"}},At={class:"sidebar-settings-label"},St=["aria-label"],Ft=["disabled"],wt=["disabled"],Rt={key:2,class:"sidebar-settings-row sidebar-settings-row--input"},Lt={class:"sidebar-settings-provider-info"},pt={class:"sidebar-settings-label"},Mt={class:"sidebar-settings-provider-link",href:"https://opencode.ai/auth",target:"_blank",rel:"noopener noreferrer"},Et={class:"sidebar-settings-key-group"},$t=["model-value","placeholder"],Tt=["disabled"],It={key:3,class:"sidebar-settings-row sidebar-settings-row--input"},xt={class:"sidebar-settings-label"},Pt={class:"sidebar-settings-key-group"},Dt=["model-value","placeholder"],Kt={class:"sidebar-settings-label",style:{"margin-top":"4px"}},Wt={class:"sidebar-settings-key-group"},Ut=["model-value","placeholder"],Bt=["disabled"],Ot={class:"sidebar-settings-row sidebar-settings-row--select",style:{"margin-top":"4px",padding:"0"}},Nt={class:"sidebar-settings-label"},Gt=["aria-label"],Vt={class:"sidebar-settings-label"},Ht={class:"sidebar-settings-value"},Zt={key:0,class:"sidebar-settings-telegram-panel"},qt={class:"sidebar-settings-field"},Qt={class:"sidebar-settings-field-label"},Xt=["value"],jt={class:"sidebar-settings-field"},zt={class:"sidebar-settings-field-label"},Yt=["value"],Jt={class:"sidebar-settings-field-help"},_t={key:0,class:"sidebar-settings-telegram-error"},en=["href"],tn={class:"sidebar-settings-telegram-actions"},nn=["disabled"],on={class:"sidebar-settings-hooks-section"},sn={class:"sidebar-settings-hooks-header"},an={class:"sidebar-settings-hooks-title"},ln=["disabled","title"],dn={key:0,class:"sidebar-settings-hooks-empty"},cn={key:0,class:"sidebar-settings-hooks-empty"},rn={key:1,class:"sidebar-settings-hooks-empty"},un={key:2,class:"sidebar-settings-hooks-list"},gn={class:"sidebar-settings-hooks-cwd"},bn={class:"sidebar-settings-hooks-event"},mn={class:"sidebar-settings-hooks-command"},hn={class:"sidebar-settings-remote-section"},vn={class:"sidebar-settings-remote-header"},yn={class:"sidebar-settings-remote-title"},Cn=["disabled","title"],fn={class:"sidebar-settings-remote-toggle-label"},kn={key:0,class:"sidebar-settings-remote-empty"},An={key:0,class:"sidebar-settings-remote-error"},Sn={key:1,class:"sidebar-settings-remote-notice"},Fn={key:2,class:"sidebar-settings-remote-empty"},wn=["disabled"],Rn={class:"sidebar-settings-remote-label"},Ln={class:"sidebar-settings-remote-value"},pn={class:"sidebar-settings-remote-clients"},Mn={class:"sidebar-settings-remote-clients-header"},En={class:"sidebar-settings-remote-label"},$n=["disabled"],Tn={key:0,class:"sidebar-settings-remote-empty"},In={class:"sidebar-settings-remote-client-name"},xn=["disabled","onClick"],Pn={class:"sidebar-settings-rate-limits"},Dn=["aria-label"],Kn=P({__name:"SettingsDialog",props:{activeSettingsGroup:{},accounts:{},isAccountsSectionCollapsed:{type:Boolean},isRefreshingAccounts:{type:Boolean},isSwitchingAccounts:{type:Boolean},isStartingCodexLogin:{type:Boolean},isCompletingCodexLogin:{type:Boolean},accountActionError:{},codexLoginUrl:{},feedbackMailto:{},isAccountUnavailable:{type:Function},isRemoveConfirmationActive:{type:Function},isRemoveVisible:{type:Function},buildAccountTitle:{type:Function},formatAccountMeta:{type:Function},formatAccountQuota:{type:Function},shortAccountId:{type:Function},isAccountActionDisabled:{type:Function},getAccountSwitchLabel:{type:Function},getAccountRemoveLabel:{type:Function},onRefreshAccounts:{type:Function},onStartCodexLogin:{type:Function},onSwitchAccount:{type:Function},onRemoveAccount:{type:Function},onAccountCardPointerEnter:{type:Function},onAccountCardPointerLeave:{type:Function},toggleAccountsSectionCollapsed:{type:Function},prepareFeedbackLink:{type:Function},sendWithEnter:{type:Boolean},inProgressSendMode:{},darkMode:{},uiLanguage:{},uiLanguageOptions:{},chatWidthLabel:{},dictationClickToToggle:{type:Boolean},dictationAutoSend:{type:Boolean},dictationLanguage:{},dictationLanguageOptions:{},autoCompactThreshold:{},autoCompactThresholdOptions:{},hasVisibleFeedbackError:{type:Boolean},selectedProvider:{},providerDropdownOptions:{},freeModeLoading:{type:Boolean},providerError:{},freeModeHasCustomKey:{type:Boolean},freeModeCustomKey:{},freeModeCustomKeyMasked:{},freeModeCustomKeySaving:{type:Boolean},openRouterWireApi:{},opencodeZenKey:{},customEndpointUrl:{},customEndpointKey:{},customEndpointWireApi:{},isTelegramConfigOpen:{type:Boolean},telegramStatusText:{},telegramBotTokenDraft:{},telegramAllowedUserIdsDraft:{},telegramConfigError:{},isTelegramSaving:{type:Boolean},supportsHooks:{type:Boolean},isHooksLoading:{type:Boolean},hooksList:{},supportsRemoteControl:{type:Boolean},remoteControlStatus:{},isRemoteControlActionInFlight:{type:Boolean},remoteControlError:{},remoteControlNotice:{},isRemoteControlLoading:{type:Boolean},remoteControlActionName:{},pairingCode:{},accountRateLimitSnapshots:{},worktreeName:{},appVersion:{},onClose:{type:Function},onActiveSettingsGroupChange:{type:Function},toggleSendWithEnter:{type:Function},cycleInProgressSendMode:{type:Function},cycleDarkMode:{type:Function},onUiLanguageChange:{type:Function},cycleChatWidth:{type:Function},toggleDictationClickToToggle:{type:Function},toggleDictationAutoSend:{type:Function},onDictationLanguageChange:{type:Function},onAutoCompactThresholdChange:{type:Function},onProviderChange:{type:Function},onFreeModeCustomKeyChange:{type:Function},clearFreeModeCustomKey:{type:Function},saveFreeModeCustomKey:{type:Function},setOpenRouterWireApi:{type:Function},onOpencodeZenKeyChange:{type:Function},saveOpencodeZen:{type:Function},onCustomEndpointUrlChange:{type:Function},onCustomEndpointKeyChange:{type:Function},saveCustomEndpoint:{type:Function},onCustomEndpointWireApiChange:{type:Function},onTelegramConfigOpenChange:{type:Function},onTelegramBotTokenDraftChange:{type:Function},onTelegramAllowedUserIdsDraftChange:{type:Function},saveTelegramConfig:{type:Function},refreshHooks:{type:Function},toggleRemoteControl:{type:Function},startRemotePairing:{type:Function},refreshRemoteClients:{type:Function},revokeRemoteClient:{type:Function}},setup(e,{expose:b}){const{t:o}=D(),h=Q(null),u=[{id:"general",label:"General settings"},{id:"models",label:"Models & providers"},{id:"integrations",label:"Integrations"},{id:"usage",label:"Usage & about"}],v={sendWithEnter:o("When enabled, press Enter to send. When disabled, use Command+Enter to send."),inProgressSendMode:o("If a turn is still running, choose whether a new prompt should steer the current turn or be queued."),appearance:o("Switch between system theme, light mode, and dark mode."),chatWidth:o("Choose how wide the conversation column and composer can grow on desktop screens."),dictationClickToToggle:o("Use click-to-start and click-to-stop dictation instead of hold-to-talk."),dictationAutoSend:o("Automatically send transcribed dictation when recording stops."),dictationLanguage:o("Choose transcription language or keep auto-detect.")};function I(p){var a;return((a=h.value)==null?void 0:a.contains(p))??!1}return b({containsTarget:I}),(p,a)=>{var R;return c(),H(q,{to:"body"},[t("div",{class:"settings-dialog-backdrop",role:"presentation",onClick:a[36]||(a[36]=B((...i)=>e.onClose&&e.onClose(...i),["self"]))},[t("div",{ref_key:"settingsPanelRef",ref:h,class:"sidebar-settings-panel",role:"dialog","aria-modal":"true","aria-label":n(o)("Settings"),onClick:a[35]||(a[35]=B(()=>{},["stop"]))},[t("div",$e,[t("h2",Te,s(n(o)("Settings")),1),t("button",{class:"settings-dialog-close",type:"button","aria-label":n(o)("Close"),title:n(o)("Close"),onClick:a[0]||(a[0]=(...i)=>e.onClose&&e.onClose(...i))},[F(Z,{class:"settings-dialog-close-icon"})],8,Ie)]),t("div",xe,[t("nav",{class:"settings-group-nav","aria-label":n(o)("Settings groups")},[(c(),r(C,null,w(u,i=>t("button",{key:i.id,type:"button",class:f(["settings-group-nav-item",{"is-active":e.activeSettingsGroup===i.id}]),"aria-current":e.activeSettingsGroup===i.id?"true":void 0,onClick:k=>e.onActiveSettingsGroupChange(i.id)},s(n(o)(i.label)),11,De)),64))],8,Pe),t("div",Ke,[M(t("div",null,[F(Me,{accounts:e.accounts,"is-accounts-section-collapsed":e.isAccountsSectionCollapsed,"is-refreshing-accounts":e.isRefreshingAccounts,"is-switching-accounts":e.isSwitchingAccounts,"is-starting-codex-login":e.isStartingCodexLogin,"is-completing-codex-login":e.isCompletingCodexLogin,"account-action-error":e.accountActionError,"codex-login-url":e.codexLoginUrl,"feedback-mailto":e.feedbackMailto,"is-account-unavailable":e.isAccountUnavailable,"is-remove-confirmation-active":e.isRemoveConfirmationActive,"is-remove-visible":e.isRemoveVisible,"build-account-title":e.buildAccountTitle,"format-account-meta":e.formatAccountMeta,"format-account-quota":e.formatAccountQuota,"short-account-id":e.shortAccountId,"is-account-action-disabled":e.isAccountActionDisabled,"get-account-switch-label":e.getAccountSwitchLabel,"get-account-remove-label":e.getAccountRemoveLabel,"on-refresh-accounts":e.onRefreshAccounts,"on-start-codex-login":e.onStartCodexLogin,"on-switch-account":e.onSwitchAccount,"on-remove-account":e.onRemoveAccount,"on-account-card-pointer-enter":e.onAccountCardPointerEnter,"on-account-card-pointer-leave":e.onAccountCardPointerLeave,"toggle-accounts-section-collapsed":e.toggleAccountsSectionCollapsed,"prepare-feedback-link":e.prepareFeedbackLink},null,8,["accounts","is-accounts-section-collapsed","is-refreshing-accounts","is-switching-accounts","is-starting-codex-login","is-completing-codex-login","account-action-error","codex-login-url","feedback-mailto","is-account-unavailable","is-remove-confirmation-active","is-remove-visible","build-account-title","format-account-meta","format-account-quota","short-account-id","is-account-action-disabled","get-account-switch-label","get-account-remove-label","on-refresh-accounts","on-start-codex-login","on-switch-account","on-remove-account","on-account-card-pointer-enter","on-account-card-pointer-leave","toggle-accounts-section-collapsed","prepare-feedback-link"]),t("button",{class:"sidebar-settings-row",type:"button",title:v.sendWithEnter,onClick:a[1]||(a[1]=(...i)=>e.toggleSendWithEnter&&e.toggleSendWithEnter(...i))},[t("span",Ue,s(n(o)("Require ⌘ + enter to send")),1),t("span",{class:f(["sidebar-settings-toggle",{"is-on":!e.sendWithEnter}])},null,2)],8,We),t("button",{class:"sidebar-settings-row",type:"button",title:v.inProgressSendMode,onClick:a[2]||(a[2]=(...i)=>e.cycleInProgressSendMode&&e.cycleInProgressSendMode(...i))},[t("span",Oe,s(n(o)("When busy, send as")),1),t("span",Ne,s(e.inProgressSendMode==="steer"?n(o)("Steer"):n(o)("Queue")),1)],8,Be),t("button",{class:"sidebar-settings-row",type:"button",title:v.appearance,onClick:a[3]||(a[3]=(...i)=>e.cycleDarkMode&&e.cycleDarkMode(...i))},[t("span",Ve,s(n(o)("Appearance")),1),t("span",He,s(e.darkMode==="system"?n(o)("System"):e.darkMode==="dark"?n(o)("Dark"):n(o)("Light")),1)],8,Ge),t("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:n(o)("Choose the interface language for the app.")},[t("span",qe,s(n(o)("UI language")),1),F($,{class:"sidebar-settings-provider-dropdown","model-value":e.uiLanguage,options:e.uiLanguageOptions,placeholder:n(o)("UI language"),"menu-align":"end","onUpdate:modelValue":a[4]||(a[4]=i=>e.onUiLanguageChange(i))},null,8,["model-value","options","placeholder"])],8,Ze),t("button",{class:"sidebar-settings-row",type:"button",title:v.chatWidth,onClick:a[5]||(a[5]=(...i)=>e.cycleChatWidth&&e.cycleChatWidth(...i))},[t("span",Xe,s(n(o)("Chat width")),1),t("span",je,s(e.chatWidthLabel),1)],8,Qe),t("button",{class:"sidebar-settings-row",type:"button",title:v.dictationClickToToggle,onClick:a[6]||(a[6]=(...i)=>e.toggleDictationClickToToggle&&e.toggleDictationClickToToggle(...i))},[t("span",Ye,s(n(o)("Click to toggle dictation")),1),t("span",{class:f(["sidebar-settings-toggle",{"is-on":e.dictationClickToToggle}])},null,2)],8,ze),t("button",{class:"sidebar-settings-row",type:"button",title:v.dictationAutoSend,onClick:a[7]||(a[7]=(...i)=>e.toggleDictationAutoSend&&e.toggleDictationAutoSend(...i))},[t("span",_e,s(n(o)("Auto send dictation")),1),t("span",{class:f(["sidebar-settings-toggle",{"is-on":e.dictationAutoSend}])},null,2)],8,Je),t("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:v.dictationLanguage},[t("span",tt,s(n(o)("Dictation language")),1),F($,{class:"sidebar-settings-language-dropdown","model-value":e.dictationLanguage,options:e.dictationLanguageOptions,placeholder:n(o)("Auto-detect"),"open-direction":"up","enable-search":!0,"search-placeholder":n(o)("Search language..."),"onUpdate:modelValue":e.onDictationLanguageChange},null,8,["model-value","options","placeholder","search-placeholder","onUpdate:modelValue"])],8,et),t("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:n(o)("Auto-compact at or below remaining context percentage. 0 disables auto-compaction and falls back to server-side compaction.")},[t("span",ot,s(n(o)("Auto-compact before send")),1),F($,{class:"sidebar-settings-auto-compact-dropdown","model-value":String(e.autoCompactThreshold),options:e.autoCompactThresholdOptions,placeholder:n(o)("Off"),"menu-align":"end","onUpdate:modelValue":e.onAutoCompactThresholdChange},null,8,["model-value","options","placeholder","onUpdate:modelValue"])],8,nt),e.hasVisibleFeedbackError?(c(),r("a",{key:0,class:"sidebar-settings-row sidebar-settings-feedback-row",href:e.feedbackMailto,onClick:a[8]||(a[8]=(...i)=>e.prepareFeedbackLink&&e.prepareFeedbackLink(...i))},[t("span",it,s(n(o)("Send feedback")),1),t("span",at,s(n(o)("Issue detected")),1)],8,st)):m("",!0)],512),[[E,e.activeSettingsGroup==="general"]]),M(t("div",null,[t("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:n(o)("Choose the API provider for the Codex backend")},[t("span",dt,s(n(o)("Provider")),1),F($,{class:"sidebar-settings-provider-dropdown","model-value":e.selectedProvider,options:e.providerDropdownOptions,placeholder:n(o)("Provider"),disabled:e.freeModeLoading,"menu-align":"end","onUpdate:modelValue":e.onProviderChange},null,8,["model-value","options","placeholder","disabled","onUpdate:modelValue"])],8,lt),e.providerError?(c(),r("div",ct,[t("span",null,s(e.providerError),1),t("a",{class:"visible-error-feedback",href:e.feedbackMailto,onClick:a[9]||(a[9]=i=>e.prepareFeedbackLink(i,e.providerError))},s(n(o)("Send feedback")),9,rt)])):m("",!0),e.selectedProvider==="openrouter"?(c(),r("div",ut,[t("div",gt,[t("span",bt,s(n(o)("OpenRouter API key")),1),t("a",mt,s(n(o)("Get API key")),1)]),t("div",ht,[e.freeModeHasCustomKey&&!e.freeModeCustomKey?(c(),r(C,{key:0},[t("span",vt,s(e.freeModeCustomKeyMasked),1),t("button",{class:"sidebar-settings-key-clear",type:"button",disabled:e.freeModeCustomKeySaving,title:n(o)("Remove custom key, use community keys"),onClick:a[10]||(a[10]=(...i)=>e.clearFreeModeCustomKey&&e.clearFreeModeCustomKey(...i))},"✕",8,yt)],64)):(c(),r(C,{key:1},[t("input",{"model-value":e.freeModeCustomKey,onInput:a[11]||(a[11]=i=>e.onFreeModeCustomKeyChange(i.target.value)),class:"sidebar-settings-key-input",type:"password",placeholder:n(o)("sk-or-v1-... (optional, uses free keys if empty)"),onKeydown:a[12]||(a[12]=T((...i)=>e.saveFreeModeCustomKey&&e.saveFreeModeCustomKey(...i),["enter"]))},null,40,Ct),t("button",{class:"sidebar-settings-key-save",type:"button",disabled:e.freeModeCustomKeySaving||!e.freeModeCustomKey.trim(),onClick:a[13]||(a[13]=(...i)=>e.saveFreeModeCustomKey&&e.saveFreeModeCustomKey(...i))},s(e.freeModeCustomKeySaving?"...":n(o)("Set")),9,ft)],64))]),t("div",kt,[t("span",At,s(n(o)("API format")),1),t("div",{class:"sidebar-settings-segmented",role:"group","aria-label":n(o)("OpenRouter API format")},[t("button",{type:"button",class:f(["sidebar-settings-segmented-option",{"is-active":e.openRouterWireApi==="responses"}]),disabled:e.freeModeCustomKeySaving||e.freeModeLoading,onClick:a[14]||(a[14]=i=>e.setOpenRouterWireApi("responses"))},s(n(o)("Responses")),11,Ft),t("button",{type:"button",class:f(["sidebar-settings-segmented-option",{"is-active":e.openRouterWireApi==="chat"}]),disabled:e.freeModeCustomKeySaving||e.freeModeLoading,onClick:a[15]||(a[15]=i=>e.setOpenRouterWireApi("chat"))},s(n(o)("Completions")),11,wt)],8,St)])])):m("",!0),e.selectedProvider==="opencode-zen"?(c(),r("div",Rt,[t("div",Lt,[t("span",pt,s(n(o)("OpenCode Zen API key")),1),t("a",Mt,s(n(o)("Get API key")),1)]),t("div",Et,[t("input",{"model-value":e.opencodeZenKey,onInput:a[16]||(a[16]=i=>e.onOpencodeZenKeyChange(i.target.value)),class:"sidebar-settings-key-input",type:"password",placeholder:n(o)("sk-..."),onKeydown:a[17]||(a[17]=T((...i)=>e.saveOpencodeZen&&e.saveOpencodeZen(...i),["enter"]))},null,40,$t),t("button",{class:"sidebar-settings-key-save",type:"button",disabled:e.freeModeCustomKeySaving||!e.opencodeZenKey.trim(),onClick:a[18]||(a[18]=(...i)=>e.saveOpencodeZen&&e.saveOpencodeZen(...i))},s(e.freeModeCustomKeySaving?"...":n(o)("Save")),9,Tt)])])):m("",!0),e.selectedProvider==="custom"?(c(),r("div",It,[t("span",xt,s(n(o)("Custom endpoint URL")),1),t("div",Pt,[t("input",{"model-value":e.customEndpointUrl,onInput:a[19]||(a[19]=i=>e.onCustomEndpointUrlChange(i.target.value)),class:"sidebar-settings-key-input",type:"url",placeholder:n(o)("https://api.example.com/v1"),onKeydown:a[20]||(a[20]=T((...i)=>e.saveCustomEndpoint&&e.saveCustomEndpoint(...i),["enter"]))},null,40,Dt)]),t("span",Kt,s(n(o)("API key")),1),t("div",Wt,[t("input",{"model-value":e.customEndpointKey,onInput:a[21]||(a[21]=i=>e.onCustomEndpointKeyChange(i.target.value)),class:"sidebar-settings-key-input",type:"password",placeholder:n(o)("Bearer token (optional)"),onKeydown:a[22]||(a[22]=T((...i)=>e.saveCustomEndpoint&&e.saveCustomEndpoint(...i),["enter"]))},null,40,Ut),t("button",{class:"sidebar-settings-key-save",type:"button",disabled:e.freeModeCustomKeySaving||!e.customEndpointUrl.trim(),onClick:a[23]||(a[23]=(...i)=>e.saveCustomEndpoint&&e.saveCustomEndpoint(...i))},s(e.freeModeCustomKeySaving?"...":n(o)("Save")),9,Bt)]),t("div",Ot,[t("span",Nt,s(n(o)("API format")),1),t("div",{class:"sidebar-settings-segmented",role:"group","aria-label":n(o)("Custom endpoint API format")},[t("button",{type:"button",class:f(["sidebar-settings-segmented-option",{"is-active":e.customEndpointWireApi==="responses"}]),onClick:a[24]||(a[24]=i=>e.onCustomEndpointWireApiChange("responses"))},s(n(o)("Responses")),3),t("button",{type:"button",class:f(["sidebar-settings-segmented-option",{"is-active":e.customEndpointWireApi==="chat"}]),onClick:a[25]||(a[25]=i=>e.onCustomEndpointWireApiChange("chat"))},s(n(o)("Completions")),3)],8,Gt)])])):m("",!0)],512),[[E,e.activeSettingsGroup==="models"]]),M(t("div",null,[t("button",{class:"sidebar-settings-row",type:"button","aria-live":"polite",onClick:a[26]||(a[26]=i=>e.onTelegramConfigOpenChange(!e.isTelegramConfigOpen))},[t("span",Vt,s(n(o)("Telegram")),1),t("span",Ht,s(e.telegramStatusText),1)]),e.isTelegramConfigOpen?(c(),r("div",Zt,[t("label",qt,[t("span",Qt,s(n(o)("Bot token")),1),t("input",{value:e.telegramBotTokenDraft,onInput:a[27]||(a[27]=i=>e.onTelegramBotTokenDraftChange(i.target.value)),class:"sidebar-settings-input",type:"password",placeholder:"123456:ABCDEF",autocomplete:"off",spellcheck:"false"},null,40,Xt)]),t("label",jt,[t("span",zt,s(n(o)("Allowed Telegram user IDs")),1),t("textarea",{value:e.telegramAllowedUserIdsDraft,onInput:a[28]||(a[28]=i=>e.onTelegramAllowedUserIdsDraftChange(i.target.value)),class:"sidebar-settings-textarea",rows:"3",placeholder:`123456789
3
+ 987654321`,spellcheck:"false"},null,40,Yt)]),t("div",Jt,s(n(o)("Put one Telegram user ID per line or separate them with commas. Use `*` to allow all Telegram users. Unauthorized users will see their own ID in the rejection message so they can copy it here.")),1),e.telegramConfigError?(c(),r("div",_t,[t("span",null,s(e.telegramConfigError),1),t("a",{class:"visible-error-feedback",href:e.feedbackMailto,onClick:a[29]||(a[29]=i=>e.prepareFeedbackLink(i,e.telegramConfigError))},s(n(o)("Send feedback")),9,en)])):m("",!0),t("div",tn,[t("button",{class:"sidebar-settings-telegram-save",type:"button",disabled:e.isTelegramSaving,onClick:a[30]||(a[30]=(...i)=>e.saveTelegramConfig&&e.saveTelegramConfig(...i))},s(e.isTelegramSaving?n(o)("Saving…"):n(o)("Save Telegram config")),9,nn)])])):m("",!0),t("div",on,[t("div",sn,[t("span",an,s(n(o)("Hooks")),1),t("button",{class:"sidebar-settings-hooks-reload",type:"button",disabled:e.isHooksLoading,title:n(o)("Reload lifecycle hooks"),onClick:a[31]||(a[31]=i=>e.refreshHooks({force:!0}))},s(e.isHooksLoading?n(o)("Reloading…"):n(o)("Reload")),9,ln)]),e.supportsHooks?(c(),r(C,{key:1},[e.isHooksLoading?(c(),r("p",cn,s(n(o)("Loading hooks…")),1)):e.hooksList.length===0?(c(),r("p",rn,s(n(o)("No hooks registered.")),1)):(c(),r("div",un,[(c(!0),r(C,null,w(e.hooksList,i=>(c(),r("div",{key:i.cwd||"__global__",class:"sidebar-settings-hooks-entry"},[t("p",gn,s(i.cwd||n(o)("Global")),1),(c(!0),r(C,null,w(i.hooks,(k,L)=>(c(),r("div",{key:`${i.cwd}:${k.event}:${L}`,class:"sidebar-settings-hooks-item"},[t("span",{class:f(["sidebar-settings-hooks-state",{"is-on":k.enabled!==!1}])},s(k.enabled===!1?n(o)("Disabled"):n(o)("Enabled")),3),t("span",bn,s(k.event),1),t("code",mn,s(k.command),1)]))),128))]))),128))]))],64)):(c(),r("p",dn,s(n(o)("Hooks are not supported by this Codex version.")),1))]),t("div",hn,[t("div",vn,[t("span",yn,s(n(o)("Remote control")),1),t("button",{class:"sidebar-settings-remote-toggle",type:"button",disabled:e.isRemoteControlActionInFlight||e.isRemoteControlLoading,title:n(o)("Enable or disable remote control"),onClick:a[32]||(a[32]=(...i)=>e.toggleRemoteControl&&e.toggleRemoteControl(...i))},[t("span",{class:f(["sidebar-settings-remote-toggle-track",{"is-on":e.remoteControlStatus.enabled}])},[...a[37]||(a[37]=[t("span",{class:"sidebar-settings-remote-toggle-thumb"},null,-1)])],2),t("span",fn,s(e.remoteControlStatus.enabled?n(o)("Enabled"):n(o)("Disabled")),1)],8,Cn)]),e.supportsRemoteControl?(c(),r(C,{key:1},[e.remoteControlError?(c(),r("p",An,s(e.remoteControlError),1)):m("",!0),e.remoteControlNotice?(c(),r("p",Sn,s(e.remoteControlNotice),1)):m("",!0),e.isRemoteControlLoading?(c(),r("p",Fn,s(n(o)("Loading…")),1)):(c(),r(C,{key:3},[t("button",{class:"sidebar-settings-remote-row",type:"button",disabled:!e.remoteControlStatus.enabled||e.isRemoteControlActionInFlight,onClick:a[33]||(a[33]=(...i)=>e.startRemotePairing&&e.startRemotePairing(...i))},[t("span",Rn,s(n(o)("Pair a new device")),1),t("span",Ln,s(e.remoteControlActionName==="pairing"?n(o)("Starting…"):(R=e.pairingCode)!=null&&R.pairingCode?e.pairingCode.pairingCode:n(o)("Generate code")),1)],8,wn),t("div",pn,[t("div",Mn,[t("span",En,s(n(o)("Paired devices")),1),t("button",{class:"sidebar-settings-remote-reload",type:"button",disabled:e.isRemoteControlActionInFlight,onClick:a[34]||(a[34]=(...i)=>e.refreshRemoteClients&&e.refreshRemoteClients(...i))},s(e.remoteControlActionName==="clients"?n(o)("Reloading…"):n(o)("Reload")),9,$n)]),e.remoteControlStatus.clients.length===0?(c(),r("p",Tn,s(n(o)("No paired devices.")),1)):m("",!0),(c(!0),r(C,null,w(e.remoteControlStatus.clients,i=>(c(),r("div",{key:i.clientId,class:"sidebar-settings-remote-client"},[t("span",In,s(i.deviceName||i.clientId),1),t("button",{class:"sidebar-settings-remote-client-revoke",type:"button",disabled:e.isRemoteControlActionInFlight,onClick:k=>e.revokeRemoteClient(i.clientId)},s(e.remoteControlActionName===`revoke:${i.clientId}`?n(o)("Removing…"):n(o)("Revoke")),9,xn)]))),128))])],64))],64)):(c(),r("p",kn,s(n(o)("Remote control is not supported by this Codex version.")),1))])],512),[[E,e.activeSettingsGroup==="integrations"]]),M(t("div",null,[t("div",Pn,[F(ne,{snapshots:e.accountRateLimitSnapshots},null,8,["snapshots"])]),t("div",{class:"sidebar-settings-build-label","aria-label":n(o)("Worktree name and version")}," WT "+s(e.worktreeName)+" · v"+s(e.appVersion),9,Dn)],512),[[E,e.activeSettingsGroup==="usage"]])])])],8,Ee)])])}}}),Un=K(Kn,[["__scopeId","data-v-f5f657a8"]]);export{Un as default};
@@ -0,0 +1,25 @@
1
+ import{r as fo,n as Kn,a as Gn,c as _,b as W,g as Ks,o as Tt,d as _t,e as zn,f as ht,h as le,i as s,j as ue,k as r,w as Ye,l as d,t as w,m as oe,p as I,T as mo,_ as se,u as c,F as N,q as z,s as Fe,v as te,I as ho,x as Gs,y as ot,z as ke,A as we,B as _e,C as go,D as zs,E as Ve,G as Ys,H as vo,J as zt,K as Xs,L as Yn,M as Js,N as Qs,O as Zs,P as po,Q as yo,R as ea,S as Xn,U as Ae,V as ta,W as na,X as oa,Y as sa,Z as Jn,$ as aa,a0 as ia,a1 as ra,a2 as Qn,a3 as la,a4 as ca,a5 as Zn,a6 as ua,a7 as da,a8 as fa,a9 as ma,aa as ha,ab as ga,ac as va,ad as pa}from"./index-CMrfiiel.js";import{s as Ut}from"./sanitizeHtml-Bd3No2dT.js";const ya=30*60*1e3;function wa(e,n){const o=new Date(e),a=new Date(n);return o.getFullYear()===a.getFullYear()&&o.getMonth()===a.getMonth()&&o.getDate()===a.getDate()}function ka(e,n){return typeof n!="number"||!Number.isFinite(n)?!1:e==null||!Number.isFinite(e)||!wa(e,n)?!0:n-e>=ya}function ba(e){const n=new Set;let o=null;for(const a of e){const f=a.timestampMs;typeof f!="number"||!Number.isFinite(f)||ka(o,f)&&(n.add(a.key),o=f)}return n}function Ca(e,n){const o=new Date(e),a=new Date(n),f=new Date(o.getFullYear(),o.getMonth(),o.getDate()).getTime(),i=new Date(a.getFullYear(),a.getMonth(),a.getDate()).getTime();return Math.round((i-f)/864e5)}function xt(e){return String(e).padStart(2,"0")}function $a(e,n={}){if(typeof e!="number"||!Number.isFinite(e))return"";const o=new Date(e);if(Number.isNaN(o.getTime()))return"";const a=n.translate??(p=>p),f=n.now??Date.now(),i=`${xt(o.getHours())}:${xt(o.getMinutes())}`,m=Ca(e,f);if(m===0)return`${a("Today")} ${i}`;if(m===1)return`${a("Yesterday")} ${i}`;const u=`${xt(o.getMonth()+1)}-${xt(o.getDate())}`;return new Date(f).getFullYear()===o.getFullYear()?`${u} ${i}`:`${o.getFullYear()}-${u} ${i}`}const eo=16;function gt(e){return Number.isFinite(e)?e:0}function wo(e){const n=gt(e.scrollHeightPx),o=gt(e.clientHeightPx);return Math.max(0,n-o)}function xa(e){const n=gt(e.scrollHeightPx)-gt(e.scrollTopPx)-gt(e.clientHeightPx);return Math.max(0,n)}function _a(e,n=eo){const o=Number.isFinite(n)?n:eo;return xa(e)<=o}function Ta(e,n){return Number.isFinite(n)?Math.min(wo(e),Math.max(0,n)):0}function Ia(e,n){const o=wo(e),a=Ta(e,n);return Math.min(o,Math.max(0,o-a))}function to(e){return{scrollHeightPx:e.scrollHeight,scrollTopPx:e.scrollTop,clientHeightPx:e.clientHeight}}const ko={js:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",py:"python",rb:"ruby",sh:"bash",shell:"bash",zsh:"bash",yml:"yaml",md:"markdown","c++":"cpp","c#":"csharp",ps1:"powershell"};function pe(e){return`${e.path}\0${e.movedToPath??""}`}function Ma(e,n){return e?!n||e===n?e:`${e}
2
+ ${n}`.trim():n}function Sa(e,n){const o=e.operation==="add"||n.operation==="add"?"add":e.operation==="delete"||n.operation==="delete"?"delete":"update";return{path:n.path||e.path,operation:o,movedToPath:n.movedToPath??e.movedToPath??null,diff:Ma(e.diff,n.diff),addedLineCount:e.addedLineCount+n.addedLineCount,removedLineCount:e.removedLineCount+n.removedLineCount}}function La(e,n){const o=e.operation==="add"?0:e.operation==="update"?1:2,a=n.operation==="add"?0:n.operation==="update"?1:2;if(o!==a)return o-a;const f=`${e.path}\0${e.movedToPath??""}`,i=`${n.path}\0${n.movedToPath??""}`;return f.localeCompare(i)}function Kt(e){const n=new Map;for(const o of e){const a=`${o.path}\0${o.movedToPath??""}`,f=n.get(a);n.set(a,f?Sa(f,o):{...o})}return Array.from(n.values()).sort(La)}function Qt(e,n){return e.operation==="update"&&e.movedToPath?e.addedLineCount>0||e.removedLineCount>0?n("Moved + edited"):n("Moved"):e.operation==="add"?n("Added"):e.operation==="delete"?n("Deleted"):n("Edited")}function Aa(e){return e.operation==="update"&&e.movedToPath?"→":e.operation==="add"?"+":e.operation==="delete"?"−":"M"}function Yt(e){return e.operation==="update"&&e.movedToPath?"move":e.operation}function ze(e){const n=[];return e.addedLineCount>0&&n.push(`+${e.addedLineCount}`),e.removedLineCount>0&&n.push(`-${e.removedLineCount}`),n.join(" ")}function bo(e,n,o=""){const a=[];return e>0&&a.push({tone:"add",label:`+${e}`}),n>0&&a.push({tone:"remove",label:`-${n}`}),a.length>0?a:o?[{tone:"neutral",label:o}]:[]}function Fa(e){return bo(e.addedLineCount,e.removedLineCount)}function Co(e,n){return e===1?`1 ${n("file changed")}`:`${e} ${n("files changed")}`}function Pa(e,n){if(!e||e.changes.length===0)return"";let o=0,a=0,f=0,i=0;for(const u of e.changes){if(u.operation==="add"){o+=1;continue}if(u.operation==="delete"){a+=1;continue}if(u.movedToPath){i+=1;continue}f+=1}const m=[];return f>0&&m.push(`${f} ${n("edited")}`),o>0&&m.push(`${o} ${n("added")}`),a>0&&m.push(`${a} ${n("deleted")}`),i>0&&m.push(`${i} ${n("moved")}`),m.join(", ")}function Ea(e,n){if(!e||e.changes.length===0)return n("Modified files");const o=Co(e.changes.length,n),a=Pa(e,n);return a?`${o} · ${a}`:o}function Ba(e){if(!e||e.changes.length===0)return[];const n=e.changes.reduce((f,i)=>f+i.addedLineCount,0),o=e.changes.reduce((f,i)=>f+i.removedLineCount,0),a=e.changes.some(f=>f.movedToPath)?"Moved":"Ready";return bo(n,o,a)}function st(e,n){const o=fo(e,n),a=Kn(Gn(n.trim())),f=Kn(Gn(o));return a&&f.startsWith(`${a}/`)?f.slice(a.length+1):e}function Da(e,n,o){if(!e||e.changes.length===0)return"";const a=e.changes.map(f=>{const i=st(f.path,n),m=f.movedToPath?` -> ${st(f.movedToPath,n)}`:"",u=ze(f);return`- ${Qt(f,o)}: ${i}${m}${u?` (${u})`:""}`});return`${o("Modified files")}:
3
+ ${a.join(`
4
+ `)}`.trim()}function Ra(e){var a;const o=((a=(e.movedToPath||e.path).split(".").pop())==null?void 0:a.toLowerCase())??"";return ko[o]??o??""}function Ha(e){return e.operation==="update"&&/^diff --git |^@@ |^--- |^\+\+\+ |^[ +-]|^\*\*\* (Move to:|End of File)/mu.test(e.diff)}function Oa(e){const n=e.diff.replace(/\r\n/g,`
5
+ `),o=n.length>0?n.split(`
6
+ `):[];return o.length>0&&o[o.length-1]===""&&o.pop(),o.map((a,f)=>({key:`${pe(e)}:synthetic:${f}`,kind:e.operation==="delete"?"remove":"add",oldLine:e.operation==="delete"?f+1:null,newLine:e.operation==="delete"?null:f+1,text:a}))}function Na(e){const n=e.diff.replace(/\r\n/g,`
7
+ `),o=n.length>0?n.split(`
8
+ `):[];o.length>0&&o[o.length-1]===""&&o.pop();const a=[];let f=0,i=0;for(const[m,u]of o.entries()){const p=u.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/u);if(p){f=Number(p[1]),i=Number(p[2]),a.push({key:`${pe(e)}:hunk:${m}`,kind:"hunk",oldLine:null,newLine:null,text:u});continue}if(u.startsWith("+")&&!u.startsWith("+++")){a.push({key:`${pe(e)}:add:${m}`,kind:"add",oldLine:null,newLine:i,text:u.slice(1)}),i+=1;continue}if(u.startsWith("-")&&!u.startsWith("---")){a.push({key:`${pe(e)}:remove:${m}`,kind:"remove",oldLine:f,newLine:null,text:u.slice(1)}),f+=1;continue}if(u.startsWith(" ")){a.push({key:`${pe(e)}:context:${m}`,kind:"context",oldLine:f,newLine:i,text:u.slice(1)}),f+=1,i+=1;continue}a.push({key:`${pe(e)}:meta:${m}`,kind:"meta",oldLine:null,newLine:null,text:u})}return a}function qa(e){return!e||!e.diff.trim()?[]:Ha(e)?Na(e):Oa(e)}function Va(e){return!!(e!=null&&e.diff.trim())}function Wa(e){return e.kind==="add"?"+":e.kind==="remove"?"-":e.kind==="hunk"?"@@":""}function ja(e,n){if(e.size===0)return e;const o=new Set;for(const a of e)n.has(a)&&o.add(a);return o.size===e.size?e:o}function Ua(e){const{getMessages:n,getLiveTurnId:o,isFileChangeMessage:a,isCopyableAssistantMessage:f,isReasoningMessage:i,isPlanMessage:m,isFoldMember:u,getHiddenGroupedCommandIds:p,isMobile:v}=e,M=W(new Set),y=W(null),F=W(""),S=W(!1),R=_(()=>{var me,Ce;const D=new Map,K=new Map,ye=new Map,be=j=>!a(j)&&!i(j)&&!m(j)&&!p().has(j.id)&&!u(j);for(const j of n()){const $e=typeof j.turnIndex=="number"?`turn:${j.turnIndex}`:`message:${j.id}`;if(be(j)&&D.set($e,j.id),f(j)&&typeof j.turnIndex=="number"&&Array.isArray(j.fileChanges)&&j.fileChanges.length>0&&K.set(j.id,{changes:Kt(j.fileChanges),sourceMessageIds:[],source:"assistant",turnId:j.turnId??""}),!a(j))continue;const Pe=ye.get($e);Pe?Pe.push(j):ye.set($e,[j])}const fe={};for(const[j,$e]of ye.entries()){const Pe=D.get(j);if(!Pe)continue;const vt=((me=K.get(Pe))==null?void 0:me.turnId)??"";fe[Pe]={changes:Kt($e.flatMap(Ee=>Ee.fileChanges??[])),sourceMessageIds:$e.map(Ee=>Ee.id),source:"metadata",turnId:((Ce=$e.find(Ee=>typeof Ee.turnId=="string"&&Ee.turnId.length>0))==null?void 0:Ce.turnId)??vt}}for(const[j,$e]of K.entries())fe[j]||(fe[j]=$e);return fe}),J=_(()=>{var be;const D=new Map,K=new Set;for(const fe of Object.values(R.value))for(const me of fe.sourceMessageIds)K.add(me);for(const fe of n()){if(!a(fe))continue;const me=typeof fe.turnIndex=="number"?`turn:${fe.turnIndex}`:`message:${fe.id}`,Ce=D.get(me);Ce?Ce.push(fe):D.set(me,[fe])}const ye={};for(const[fe,me]of D.entries()){if(me.some(j=>K.has(j.id)))continue;const Ce=me[me.length-1];Ce&&(ye[Ce.id]={changes:Kt(me.flatMap(j=>j.fileChanges??[])),sourceMessageIds:me.map(j=>j.id),source:"metadata",turnId:Ce.turnId??((be=me.find(j=>typeof j.turnId=="string"&&j.turnId.length>0))==null?void 0:be.turnId)??""})}return ye}),U=_(()=>{const D=new Set;for(const K of Object.values(R.value))for(const ye of K.sourceMessageIds)D.add(ye);for(const[K,ye]of Object.entries(J.value))for(const be of ye.sourceMessageIds)be!==K&&D.add(be);return D}),P=_(()=>{var D;return((D=y.value)==null?void 0:D.changes)??[]}),b=_(()=>{const D=P.value;return D.length===0?null:D.find(K=>pe(K)===F.value)??D[0]}),L=_(()=>qa(b.value));function x(D){const K=new Set(M.value);K.has(D.id)?K.delete(D.id):K.add(D.id),M.value=K}function E(D){return M.value.has(D.id)}function B(D,K){D&&(y.value=D,F.value=pe(K),S.value=!1)}function k(){y.value=null,F.value="",S.value=!1}function Y(){S.value=!S.value}function q(){S.value=!1}function ge(D){F.value=pe(D),v()&&(S.value=!1)}function Xe(D){return R.value[D]??null}function at(D){return M.value.has(D)}function T(D){const K=n().find(ye=>ye.id===D);K&&x(K)}function A(D){return Xe(D.id)}function H(D){return J.value[D.id]??null}function Q(D){if(!D)return!1;const K=o();return K?(D.turnId??"")!==K:!0}function de(){const D=new Set([...Object.keys(R.value),...Object.keys(J.value)]);M.value=ja(M.value,D)}return{anchoredFileChangeSummaryByAnchorId:R,standaloneFileChangeSummaryByMessageId:J,hiddenFileChangeMessageIds:U,isDiffViewerFileListOpen:S,diffViewerChanges:P,activeDiffViewerChange:b,activeDiffViewerLines:L,toggleFileChangeSummary:x,isFileChangeSummaryExpanded:E,openDiffViewer:B,closeDiffViewer:k,toggleDiffViewerFileList:Y,closeDiffViewerFileList:q,selectDiffViewerChange:ge,readAnchoredFileChangeSummaryById:Xe,isFileChangeSummaryExpandedById:at,toggleFileChangeSummaryById:T,readAnchoredFileChangeSummary:A,readStandaloneFileChangeSummary:H,isFileChangeSummaryVisible:Q,pruneFileChangeSummaryIds:de}}function Ka(e){const{getMessages:n,isCopyableAssistantMessage:o,isPlanMessage:a,planStepCopyMarker:f,buildFileChangeCopyText:i,getAnchoredFileChangeSummaries:m}=e,u=W("");let p=null;function v(L){var B;const x=ht(L);if(!x)return"";const E=[];return(B=x.explanation)!=null&&B.trim()&&E.push(x.explanation.trim()),x.steps.length>0&&E.push(x.steps.map(k=>`- ${f(k.status)} ${k.step}`.trim()).join(`
9
+ `)),E.join(`
10
+
11
+ `).trim()}function M(L){const x=[],E=L.text.trim()||v(L),B=a(L)&&E?`Plan
12
+ ${E}`:E;B&&x.push(B);const k=(L.fileAttachments??[]).map(q=>q.path.trim()).filter(q=>q.length>0);k.length>0&&x.push(`Files:
13
+ ${k.join(`
14
+ `)}`);const Y=(L.images??[]).map(q=>q.trim()).filter(q=>q.length>0);return Y.length>0&&x.push(`Images:
15
+ ${Y.join(`
16
+ `)}`),x.join(`
17
+
18
+ `).trim()}const y=_(()=>{var E;const L=new Map;for(const B of n()){if(!o(B))continue;const k=M(B);if(!k)continue;const Y=typeof B.turnIndex=="number"?`turn:${B.turnIndex}`:`message:${B.id}`,q=L.get(Y);if(q){q.anchorMessageId=B.id,q.parts.push(k);continue}L.set(Y,{anchorMessageId:B.id,parts:[k]})}const x={};for(const B of L.values()){const k=B.parts.join(`
19
+
20
+ `).trim();k&&(x[B.anchorMessageId]=k)}for(const[B,k]of Object.entries(m())){if(k.source!=="metadata")continue;const Y=i(k);if(!Y)continue;const q=(E=x[B])==null?void 0:E.trim();x[B]=q?`${q}
21
+
22
+ ${Y}`:Y}return x}),F=_(()=>{const L=new Map;for(const E of n()){if(!o(E)||typeof E.turnIndex!="number")continue;const B=`turn:${E.turnIndex}`,k=L.get(B);if(k){k.anchorMessageId=E.id,k.turnIndex=E.turnIndex;continue}L.set(B,{anchorMessageId:E.id,turnIndex:E.turnIndex})}const x={};for(const E of L.values())x[E.anchorMessageId]=E.turnIndex;return x});function S(L){return typeof y.value[L.id]=="string"}function R(L){return L.role==="user"&&M(L).length>0}function J(L){u.value=L,p&&clearTimeout(p),p=setTimeout(()=>{u.value===L&&(u.value=""),p=null},1800)}Ks()&&Tt(()=>{p&&(clearTimeout(p),p=null)});async function U(L){const x=n().find(k=>k.id===L);if(!x)return;const E=M(x);if(!E)return;let B=!1;try{await _t(E),B=!0}catch{B=!1}B||(B=zn(E)),B&&J(L)}function P(L){return typeof F.value[L.id]=="number"}async function b(L){const x=y.value[L]??"";if(!x)return;let E=!1;try{await _t(x),E=!0}catch{E=!1}E||(E=zn(x)),E&&J(L)}return{copiedResponseAnchorId:u,copyableResponseContentByAnchorId:y,forkableTurnIndexByAnchorId:F,showCopyResponseButton:S,isCopyableUserMessage:R,copyUserMessage:U,showForkResponseButton:P,copyResponse:b}}function Ga(e){const{getMessages:n,getLiveOverlay:o,isCommandMessage:a}=e,f=W(new Set),i=_(()=>{var L;const b=n();for(let x=b.length-1;x>=0;x-=1){const E=b[x];if(E.messageType==="commandExecution"&&((L=E.commandExecution)==null?void 0:L.status)==="inProgress")return E.id}return""}),m=_(()=>n().some(b=>b.role==="assistant"&&b.messageType==="agentMessage.live"&&b.text.trim().length>0)),u=_(()=>!!o()||i.value.length>0||m.value),p=_(()=>{const b=n(),L={};for(let x=0;x<b.length;){const E=b[x];if(!a(E)){x+=1;continue}const B=[];for(;x<b.length&&a(b[x]);)B.push(b[x]),x+=1;if(B.length<=1)continue;const k=B[B.length-1];L[k.id]=B.slice(0,-1)}return L}),v=_(()=>{const b=new Set;for(const L of Object.values(p.value))for(const x of L)b.add(x.id);return b});function M(b){return a(b)&&f.value.has(b.id)}function y(b){return a(b)&&u.value}function F(b){var L;return a(b)&&(u.value||((L=b.commandExecution)==null?void 0:L.status)==="inProgress")}function S(b){if(!a(b))return;const L=new Set(f.value);L.has(b.id)?L.delete(b.id):L.add(b.id),f.value=L}function R(b){return p.value[b.id]??[]}function J(b){return a(b)?[...R(b),b]:[]}function U(b,L){if(b.size===0)return b;const x=new Set;for(const E of b)L.has(E)&&x.add(E);return x.size===b.size?b:x}function P(b){f.value=U(f.value,b)}return{expandedCommandIds:f,activeCommandMessageId:i,hasLiveAssistantText:m,isLiveTurnRuntime:u,groupedCommandsByLatestId:p,hiddenGroupedCommandIds:v,isCommandExpanded:M,isCommandCompact:y,isCommandOutputCondensed:F,toggleCommandExpand:S,getGroupedCommandsForLatest:R,getWorkBlockCommands:J,pruneCommandIdSets:P}}function za(e){const{getActiveThreadId:n,getCwd:o,onFileChangesChanged:a,updateThreadFileChanges:f,t:i}=e,m=W({}),u=W({}),p=W({});function v(P){const b=n();return P!=null&&P.turnId&&b?`thread:${b}:turn:${P.turnId}`:""}function M(P){return v(P).length>0}function y(P){const b=v(P);return b?m.value[b]??"idle":"idle"}function F(P){const b=v(P);return b?u.value[b]??"":""}function S(P){const b=y(P);return b==="undone"||b==="redoing"?"redo":"undo"}function R(P){const b=y(P);return b==="undoing"?i("Undoing"):b==="redoing"?i("Redoing"):S(P)==="redo"?i("Redo"):i("Undo")}async function J(P,b,L){const x=v(P),E=n(),B=o();if(!P||!x||!E||!B)return;const k=y(P),Y=b==="undo"?"undoing":"redoing";m.value={...m.value,[x]:Y},u.value={...u.value,[x]:""};let q;try{const ge=p.value[x]??[];q=await f(E,P.turnId,B,b,ge.length>0?ge:void 0,"single_turn",L)}catch(ge){m.value={...m.value,[x]:k},u.value={...u.value,[x]:ge instanceof Error?ge.message:i("Failed to update file changes.")};return}if(q.errors.length>0){b==="undo"?(p.value={...p.value,[x]:q.revertedPatchIds??[]},m.value={...m.value,[x]:"undone"}):((q.appliedPatchIds??[]).length>0&&(p.value={...p.value,[x]:q.appliedPatchIds??[]}),m.value={...m.value,[x]:"undone"}),u.value={...u.value,[x]:q.errors.join("; ")};return}if((q.changed??0)<=0){m.value={...m.value,[x]:k},u.value={...u.value,[x]:q.message||i(b==="undo"?"No file changes to undo.":"No file changes to redo.")};return}b==="undo"?(p.value={...p.value,[x]:q.revertedPatchIds??[]},m.value={...m.value,[x]:"undone"}):(p.value={...p.value,[x]:q.appliedPatchIds??[]},m.value={...m.value,[x]:"redone"}),a()}function U(){m.value={},u.value={},p.value={}}return{fileChangeActionState:m,fileChangeActionError:u,fileChangeRedoPatchIds:p,fileChangeActionKey:v,isFileChangeActionable:M,fileChangeActionStatus:y,fileChangeActionErrorText:F,fileChangeNextAction:S,fileChangeActionLabel:R,runFileChangeAction:J,resetFileChangeActions:U}}function Ya(e){const{toEditUrlFromBrowseHref:n}=e,o=W(!1),a=W(0),f=W(0),i=W(""),m=W("");function u(v){var S,R;const M=v.target,y=(S=M==null?void 0:M.closest)==null?void 0:S.call(M,"a.message-file-link");if(!y)return;const F=(((R=y.getAttribute)==null?void 0:R.call(y,"href"))??"").trim();!F||F==="#"||(v.preventDefault(),v.stopPropagation(),i.value=F,m.value=n(F),a.value=v.clientX,f.value=v.clientY,o.value=!0)}function p(){o.value&&(o.value=!1)}return{isFileLinkContextMenuVisible:o,fileLinkContextMenuX:a,fileLinkContextMenuY:f,fileLinkContextBrowseUrl:i,fileLinkContextEditUrl:m,handleConversationContextMenu:u,closeFileLinkContextMenu:p}}function Xa(e){const{isVideo:n}=e,o=W(""),a=W(!1),f=W(0),i=W(new Set);function m(y,F){return`${y}:${F}`}function u(y,F){return i.value.has(m(y,F))}function p(y,F){const S=new Set(i.value);S.add(m(y,F)),i.value=S,f.value+=1}function v(y){o.value=y,a.value=n(y)}function M(){o.value="",a.value=!1}return{modalImageUrl:o,modalIsVideo:a,markdownImageFailureVersion:f,isMarkdownImageFailed:u,onMarkdownImageError:p,openImageModal:v,closeImageModal:M}}const Ja=["aria-label"],Qa={class:"confirm-dialog-title"},Za={class:"confirm-dialog-message"},ei={class:"confirm-dialog-actions"},ti=le({__name:"ConfirmDialog",props:{visible:{type:Boolean},title:{},message:{},confirmLabel:{default:""},cancelLabel:{default:""},danger:{type:Boolean,default:!1}},emits:["confirm","cancel"],setup(e){return(n,o)=>(s(),ue(mo,{to:"body"},[e.visible?(s(),r("div",{key:0,class:"confirm-dialog-overlay",onClick:o[2]||(o[2]=Ye(a=>n.$emit("cancel"),["self"]))},[d("div",{class:"confirm-dialog-panel",role:"alertdialog","aria-modal":"true","aria-label":e.title},[d("h3",Qa,w(e.title),1),d("p",Za,w(e.message),1),d("div",ei,[d("button",{class:"confirm-dialog-btn confirm-dialog-btn-cancel",type:"button",onClick:o[0]||(o[0]=a=>n.$emit("cancel"))},w(e.cancelLabel||"Cancel"),1),d("button",{class:oe(["confirm-dialog-btn confirm-dialog-btn-confirm",{"is-danger":e.danger}]),type:"button",onClick:o[1]||(o[1]=a=>n.$emit("confirm"))},w(e.confirmLabel||"Confirm"),3)])],8,Ja)])):I("",!0)]))}}),ni=se(ti,[["__scopeId","data-v-860b1449"]]),oi={key:0,class:"diff-viewer-sidebar"},si={class:"diff-viewer-sidebar-header"},ai={class:"diff-viewer-sidebar-title"},ii={class:"diff-viewer-sidebar-count"},ri={class:"diff-viewer-sidebar-list"},li=["data-active","onClick"],ci=["data-operation"],ui={class:"diff-viewer-file-label"},di={key:0,class:"diff-viewer-file-delta"},fi={class:"diff-viewer-main"},mi={class:"diff-viewer-toolbar"},hi={class:"diff-viewer-title-wrap"},gi={class:"diff-viewer-title"},vi={class:"diff-viewer-subtitle"},pi={key:0},yi={class:"diff-viewer-toolbar-actions"},wi=["aria-label"],ki={key:0,class:"diff-viewer-empty"},bi={class:"diff-viewer-empty-title"},Ci={class:"diff-viewer-empty-text"},$i={key:1,class:"diff-viewer-panel"},xi={class:"diff-viewer-meta"},_i={class:"diff-viewer-language"},Ti={class:"diff-viewer-lines"},Ii=["data-kind"],Mi={class:"diff-viewer-line-number"},Si={class:"diff-viewer-line-number"},Li={class:"diff-viewer-line-marker"},Ai=["innerHTML"],Fi={class:"diff-viewer-mobile-sheet-header"},Pi={class:"diff-viewer-sidebar-title"},Ei={class:"diff-viewer-sidebar-count"},Bi={class:"diff-viewer-mobile-sheet-list"},Di=["data-active","onClick"],Ri=["data-operation"],Hi={class:"diff-viewer-file-label"},Oi={key:0,class:"diff-viewer-file-delta"},Ni=le({__name:"DiffViewer",props:{change:{},changes:{},lines:{},isMobile:{type:Boolean},isFileListOpen:{type:Boolean},cwd:{}},emits:["close","select-change","toggle-file-list","close-file-list"],setup(e){const n=e,{t:o}=ke();function a(u){return u.replace(/&/gu,"&amp;").replace(/</gu,"&lt;").replace(/>/gu,"&gt;").replace(/"/gu,"&quot;").replace(/'/gu,"&#39;")}const f=_(()=>u=>Qt(u,o)),i=_(()=>u=>Co(u,o)),m=_(()=>u=>st(u,n.cwd));return(u,p)=>(s(),ue(mo,{to:"body"},[e.change?(s(),r("div",{key:0,class:"diff-viewer-backdrop",onClick:p[5]||(p[5]=v=>u.$emit("close"))},[d("div",{class:"diff-viewer-shell",onClick:p[4]||(p[4]=Ye(()=>{},["stop"]))},[e.isMobile?I("",!0):(s(),r("aside",oi,[d("div",si,[d("p",ai,w(c(o)("Changed files")),1),d("p",ii,w(i.value(e.changes.length)),1)]),d("div",ri,[(s(!0),r(N,null,z(e.changes,v=>(s(),r("button",{key:`diff-viewer:${c(pe)(v)}`,type:"button",class:"diff-viewer-file-button","data-active":c(pe)(v)===c(pe)(e.change),onClick:M=>u.$emit("select-change",v)},[d("span",{class:"file-change-badge","data-operation":c(Yt)(v)},w(f.value(v)),9,ci),d("span",ui,[Fe(w(m.value(v.path))+" ",1),v.movedToPath?(s(),r(N,{key:0},[Fe(" → "+w(m.value(v.movedToPath)),1)],64)):I("",!0)]),c(ze)(v)?(s(),r("span",di,w(c(ze)(v)),1)):I("",!0)],8,li))),128))])])),d("section",fi,[d("div",mi,[d("div",hi,[d("p",gi,[Fe(w(m.value(e.change.path))+" ",1),e.change.movedToPath?(s(),r(N,{key:0},[Fe(" → "+w(m.value(e.change.movedToPath)),1)],64)):I("",!0)]),d("p",vi,[Fe(w(f.value(e.change))+" ",1),c(ze)(e.change)?(s(),r("span",pi," · "+w(c(ze)(e.change)),1)):I("",!0)])]),d("div",yi,[e.isMobile?(s(),r("button",{key:0,type:"button",class:"diff-viewer-mobile-files-button",onClick:p[0]||(p[0]=v=>u.$emit("toggle-file-list"))},w(i.value(e.changes.length)),1)):I("",!0),d("button",{class:"image-modal-close diff-viewer-close",type:"button","aria-label":c(o)("Close diff viewer"),onClick:p[1]||(p[1]=v=>u.$emit("close"))},[te(ho,{class:"icon-svg"})],8,wi)])]),c(Va)(e.change)?(s(),r("div",$i,[d("div",xi,[d("span",_i,w(c(Ra)(e.change)||"diff"),1)]),d("div",Ti,[(s(!0),r(N,null,z(e.lines,v=>(s(),r("div",{key:v.key,class:"diff-viewer-line","data-kind":v.kind},[d("span",Mi,w(v.oldLine??""),1),d("span",Si,w(v.newLine??""),1),d("span",Li,w(c(Wa)(v)),1),d("code",{class:"diff-viewer-line-code",innerHTML:a(v.text)||" "},null,8,Ai)],8,Ii))),128))])])):(s(),r("div",ki,[d("p",bi,w(c(o)("No diff available")),1),d("p",Ci,w(c(o)("This summary was restored from the final answer text, but the thread history does not include patch diff content for this file.")),1)]))]),te(Gs,{name:"diff-viewer-sheet"},{default:ot(()=>[e.isMobile&&e.isFileListOpen?(s(),r("div",{key:0,class:"diff-viewer-mobile-sheet-backdrop",onClick:p[3]||(p[3]=v=>u.$emit("close-file-list"))},[d("div",{class:"diff-viewer-mobile-sheet",onClick:p[2]||(p[2]=Ye(()=>{},["stop"]))},[p[6]||(p[6]=d("div",{class:"diff-viewer-mobile-sheet-handle","aria-hidden":"true"},null,-1)),d("div",Fi,[d("p",Pi,w(c(o)("Changed files")),1),d("p",Ei,w(i.value(e.changes.length)),1)]),d("div",Bi,[(s(!0),r(N,null,z(e.changes,v=>(s(),r("button",{key:`diff-viewer-sheet:${c(pe)(v)}`,type:"button",class:"diff-viewer-file-button","data-active":c(pe)(v)===c(pe)(e.change),onClick:M=>u.$emit("select-change",v)},[d("span",{class:"file-change-badge","data-operation":c(Yt)(v)},w(f.value(v)),9,Ri),d("span",Hi,[Fe(w(m.value(v.path))+" ",1),v.movedToPath?(s(),r(N,{key:0},[Fe(" → "+w(m.value(v.movedToPath)),1)],64)):I("",!0)]),c(ze)(v)?(s(),r("span",Oi,w(c(ze)(v)),1)):I("",!0)],8,Di))),128))])])])):I("",!0)]),_:1})])])):I("",!0)]))}}),qi=se(Ni,[["__scopeId","data-v-a9ed279d"]]),Vi={},Wi={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function ji(e,n){return s(),r("svg",Wi,[...n[0]||(n[0]=[d("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 14L4 9l5-5m-5 5h11a4 4 0 0 1 0 8H4"},null,-1)])])}const Xt=se(Vi,[["render",ji]]),Ui={class:"file-change-summary-label"},Ki={class:"file-change-summary-status"},Gi=["data-tone"],zi={class:"file-change-panel-inner"},Yi={class:"file-change-list"},Xi=["data-operation","title"],Ji={class:"file-change-path-group"},Qi=["title","onClick"],Zi={key:0,class:"file-change-arrow"},er=["title","onClick"],tr={key:0,class:"file-change-delta"},nr=["data-tone"],or=["title","aria-label","onClick"],sr={key:0,class:"file-change-actions"},ar={key:0,class:"file-change-action-error"},ir=["disabled","title","aria-label"],rr=le({__name:"FileChangeSummaryBlock",props:{summary:{},expanded:{type:Boolean},inline:{type:Boolean},cwd:{},actionable:{type:Boolean},actionStatus:{},actionErrorText:{},nextAction:{},actionLabel:{}},emits:["toggle","open-diff","request-action","request-file-action"],setup(e){const n=e,{t:o}=ke(),a=_(()=>u=>Qt(u,o)),f=_(()=>u=>Ea(u,o)),i=_(()=>u=>st(u,n.cwd)),m=_(()=>u=>`${o("Undo")} ${st(u.path,n.cwd)}`);return(u,p)=>e.summary?(s(),r("section",{key:0,class:oe(["file-change-summary-block",{"file-change-summary-block-inline":e.inline}])},[d("button",{type:"button",class:oe(["file-change-summary-row",{"file-change-summary-row-expanded":e.expanded}]),onClick:p[0]||(p[0]=v=>u.$emit("toggle"))},[d("span",{class:oe(["file-change-chevron",{"file-change-chevron-open":e.expanded}])},"▶",2),d("span",Ui,w(f.value(e.summary)),1),d("span",Ki,[(s(!0),r(N,null,z(c(Ba)(e.summary),v=>(s(),r("span",{key:`summary-status:${e.summary.turnId}:${v.tone}:${v.label}`,class:"file-change-signed-count","data-tone":v.tone},w(v.label),9,Gi))),128))])],2),d("div",{class:oe(["file-change-panel",{"file-change-panel-visible":e.expanded}])},[d("div",zi,[d("ul",Yi,[(s(!0),r(N,null,z(e.summary.changes,v=>(s(),r("li",{key:`file-change:${e.summary.turnId}:${v.path}:${v.movedToPath||""}`,class:"file-change-item"},[d("span",{class:"file-change-badge","data-operation":c(Yt)(v),title:a.value(v)},w(c(Aa)(v)),9,Xi),d("span",Ji,[d("button",{type:"button",class:"file-change-path-button",title:v.path,onClick:M=>u.$emit("open-diff",v)},w(i.value(v.path)),9,Qi),v.movedToPath?(s(),r("span",Zi,"→")):I("",!0),v.movedToPath?(s(),r("button",{key:1,type:"button",class:"file-change-path-button",title:v.movedToPath,onClick:M=>u.$emit("open-diff",v)},w(i.value(v.movedToPath)),9,er)):I("",!0)]),v.addedLineCount>0||v.removedLineCount>0?(s(),r("span",tr,[(s(!0),r(N,null,z(c(Fa)(v),M=>(s(),r("span",{key:`change-delta:${e.summary.turnId}:${v.path}:${M.tone}:${M.label}`,class:"file-change-signed-count","data-tone":M.tone},w(M.label),9,nr))),128))])):I("",!0),e.actionable?(s(),r("button",{key:1,type:"button",class:"file-change-file-undo-button",title:m.value(v),"aria-label":m.value(v),onClick:M=>u.$emit("request-file-action",v)},[te(Xt,{class:"icon-svg file-change-action-icon"})],8,or)):I("",!0)]))),128))]),e.actionable?(s(),r("div",sr,[e.actionErrorText?(s(),r("p",ar,w(e.actionErrorText),1)):I("",!0),d("button",{type:"button",class:"file-change-action-button",disabled:e.actionStatus==="undoing"||e.actionStatus==="redoing",title:e.nextAction==="redo"?"Redo file changes from this turn":"Undo file changes from this turn","aria-label":e.nextAction==="redo"?"Redo file changes from this turn":"Undo file changes from this turn",onClick:p[1]||(p[1]=v=>u.$emit("request-action",e.nextAction))},[te(Xt,{class:oe(["icon-svg file-change-action-icon",{"file-change-action-icon-redo":e.nextAction==="redo"}])},null,8,["class"]),Fe(" "+w(e.actionLabel),1)],8,ir)])):I("",!0)])],2)],2)):I("",!0)}}),no=se(rr,[["__scopeId","data-v-32872c73"]]),lr=le({__name:"FileLinkContextMenu",props:{visible:{type:Boolean},x:{},y:{},browseUrl:{},editUrl:{}},emits:["close"],setup(e,{emit:n}){const o=e,a=n,f=W(null),i=_(()=>({left:`${String(o.x)}px`,top:`${String(o.y)}px`}));function m(){a("close")}function u(){const S=o.browseUrl;m(),!(!S||S==="#")&&window.open(S,"_blank","noopener,noreferrer")}function p(){const S=o.editUrl;m(),!(!S||S==="#")&&window.open(S,"_blank","noopener,noreferrer")}async function v(){const S=o.browseUrl;if(m(),!(!S||S==="#"))try{await _t(S)}catch{}}function M(S){if(!o.visible)return;const R=f.value;if(!R){m();return}const J=S.target;J instanceof Node&&R.contains(J)||m()}function y(){m()}function F(S){S.key==="Escape"&&m()}return we(()=>o.visible,S=>{S?(window.addEventListener("pointerdown",M,!0),window.addEventListener("blur",y),window.addEventListener("keydown",F,!0)):(window.removeEventListener("pointerdown",M,!0),window.removeEventListener("blur",y),window.removeEventListener("keydown",F,!0))}),Tt(()=>{window.removeEventListener("pointerdown",M,!0),window.removeEventListener("blur",y),window.removeEventListener("keydown",F,!0)}),(S,R)=>e.visible?(s(),r("div",{key:0,ref_key:"menuRef",ref:f,class:"file-link-context-menu",style:_e(i.value),onClick:R[0]||(R[0]=Ye(()=>{},["stop"]))},[d("button",{type:"button",class:"file-link-context-menu-item",onClick:u}," Open link "),d("button",{type:"button",class:"file-link-context-menu-item",onClick:v}," Copy link "),e.editUrl?(s(),r("button",{key:0,type:"button",class:"file-link-context-menu-item",onClick:p}," Edit file ")):I("",!0)],4)):I("",!0)}}),cr=se(lr,[["__scopeId","data-v-fa2f389c"]]),ur=12e3,dr=240;function fr(e,{streaming:n,truncateStreaming:o=!0,maxChars:a=ur,maxLines:f=dr}){if(!o)return e;let i=e,m=!1;if(a>0&&i.length>a&&(i=i.slice(-a),m=!0),f>0){const u=i.split(/\r?\n/);u.length>f&&(i=u.slice(-f).join(`
23
+ `),m=!0)}return m?`...
24
+ ${i}`:i}const mr={class:"conversation-item conversation-item-overlay"},hr={class:"message-row"},gr={class:"message-stack"},vr={class:"live-overlay-inline","aria-live":"polite"},pr={class:"live-overlay-title-row"},yr={key:0,class:"live-overlay-spinner","aria-hidden":"true"},wr=["aria-expanded"],kr={class:"live-overlay-label"},br={class:"live-overlay-toggle","aria-hidden":"true"},Cr={key:2,class:"live-overlay-label"},$r={key:0,class:"live-overlay-reasoning"},xr={key:1,class:"live-overlay-error"},_r=["href"],Tr=le({__name:"LiveOverlayItem",props:{overlay:{},feedbackMailto:{}},setup(e){const n=e,{buildFeedbackMailto:o,recordVisibleFailure:a}=go(),{t:f}=ke(),i=W(!0);function m(){i.value=!i.value}const u=_(()=>{var v;return fr(((v=n.overlay)==null?void 0:v.reasoningText)??"",{streaming:!0})});function p(v,M){a(M);const y=v.currentTarget;y instanceof HTMLAnchorElement&&(y.href=o())}return(v,M)=>{var y,F,S,R,J,U;return s(),r("li",mr,[d("div",hr,[d("div",gr,[d("article",vr,[d("div",pr,[(y=e.overlay)!=null&&y.errorText?I("",!0):(s(),r("span",yr)),(F=e.overlay)!=null&&F.reasoningText?(s(),r("button",{key:1,type:"button",class:"live-overlay-heading","aria-expanded":i.value,onClick:m},[d("span",kr,w((S=e.overlay)==null?void 0:S.activityLabel),1),d("span",br,w(i.value?"▾":"▸"),1)],8,wr)):(s(),r("p",Cr,w((R=e.overlay)==null?void 0:R.activityLabel),1))]),(J=e.overlay)!=null&&J.reasoningText&&i.value?(s(),r("p",$r,w(u.value),1)):I("",!0),(U=e.overlay)!=null&&U.errorText?(s(),r("div",xr,[d("span",null,w(e.overlay.errorText),1),d("a",{class:"live-overlay-feedback",href:e.feedbackMailto,onClick:M[0]||(M[0]=P=>p(P,e.overlay.errorText))},w(c(f)("Send feedback")),9,_r)])):I("",!0)])])])])}}}),Ir=se(Tr,[["__scopeId","data-v-edcf19dd"]]),Mr=["title"],Sr={class:"model-switch-label"},Lr=le({__name:"ModelSwitchDivider",props:{from:{},to:{}},setup(e){return(n,o)=>(s(),r("div",{class:"model-switch-divider",title:e.to?`切换模型:${e.from??""} → ${e.to}`:void 0},[o[0]||(o[0]=d("span",{class:"model-switch-track","aria-hidden":"true"},null,-1)),d("span",Sr,w(e.from?`${e.from} → `:"")+w(e.to),1),o[1]||(o[1]=d("span",{class:"model-switch-track","aria-hidden":"true"},null,-1))],8,Mr))}}),oo=se(Lr,[["__scopeId","data-v-1fba0d09"]]),Ar={class:"time-divider"},Fr={class:"time-divider-label"},Pr=le({__name:"TimeDivider",props:{label:{}},setup(e){return(n,o)=>(s(),r("div",Ar,[d("span",Fr,w(e.label),1)]))}}),Er=se(Pr,[["__scopeId","data-v-9f8b7bd2"]]),Br={key:0},Dr={key:1,class:"message-bold-text"},Rr={key:2,class:"message-italic-text"},Hr={key:3,class:"message-strikethrough-text"},Or=["href","title"],Nr=["href","title"],qr={key:6,class:"message-inline-code"},Vr=le({__name:"MessageInlineContent",props:{segments:{},toBrowseUrl:{type:Function}},setup(e){return(n,o)=>(s(!0),r(N,null,z(e.segments,(a,f)=>(s(),r(N,{key:f},[a.kind==="text"?(s(),r("span",Br,w(a.value),1)):a.kind==="bold"?(s(),r("strong",Dr,w(a.value),1)):a.kind==="italic"?(s(),r("em",Rr,w(a.value),1)):a.kind==="strikethrough"?(s(),r("s",Hr,w(a.value),1)):a.kind==="file"?(s(),r("a",{key:4,class:"message-file-link",href:e.toBrowseUrl(a.path),target:"_blank",rel:"noopener noreferrer",title:a.path},w(a.displayPath),9,Or)):a.kind==="url"?(s(),r("a",{key:5,class:"message-file-link",href:a.href,target:"_blank",rel:"noopener noreferrer",title:a.href},w(a.value),9,Nr)):(s(),r("code",qr,w(a.value),1))],64))),128))}}),nt=se(Vr,[["__scopeId","data-v-1cf69093"]]),Wr={},jr={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Ur(e,n){return s(),r("svg",jr,[...n[0]||(n[0]=[d("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2zm-4 4a2 2 0 0 1-2-2V8m4 8h10"},null,-1)])])}const Kr=se(Wr,[["render",Ur]]),Gr=["data-role"],zr={key:0,class:"message-timestamp"},Yr=["aria-label","title"],Xr={key:0,class:"message-rollback-label"},Jr=["aria-label","title"],Qr={class:"message-fork-label"},Zr=["data-copied","aria-label","title"],el={key:0,class:"message-copy-label"},tl=le({__name:"MessageToolbar",props:{role:{},showEdit:{type:Boolean,default:!1},showFork:{type:Boolean,default:!1},showCopy:{type:Boolean,default:!1},copied:{type:Boolean,default:!1},timestamp:{default:""}},emits:["edit","fork","copy"],setup(e){const{t:n}=ke();return(o,a)=>e.showEdit||e.showFork||e.showCopy||e.timestamp?(s(),r("div",{key:0,class:"message-toolbar","data-role":e.role},[e.timestamp?(s(),r("span",zr,w(e.timestamp),1)):I("",!0),e.showEdit?(s(),r("button",{key:1,type:"button",class:"message-rollback-button","aria-label":c(n)("Edit this message"),title:c(n)("Edit this message"),onClick:a[0]||(a[0]=f=>o.$emit("edit"))},[te(Xt,{class:"icon-svg message-rollback-icon"}),e.role!=="user"?(s(),r("span",Xr,w(c(n)("Rollback")),1)):I("",!0)],8,Yr)):I("",!0),e.showFork?(s(),r("button",{key:2,type:"button",class:"message-fork-button","aria-label":c(n)("Fork thread from this response"),title:c(n)("Fork thread from this response"),onClick:a[1]||(a[1]=f=>o.$emit("fork"))},[te(zs,{class:"icon-svg message-fork-icon"}),d("span",Qr,w(c(n)("Fork")),1)],8,Jr)):I("",!0),e.showCopy?(s(),r("button",{key:3,type:"button",class:"message-copy-button","data-copied":e.copied,"aria-label":e.copied?c(n)("Response copied"):c(n)("Copy response"),title:e.copied?c(n)("Response copied"):c(n)("Copy response"),onClick:a[2]||(a[2]=f=>o.$emit("copy"))},[te(Kr,{class:"icon-svg message-copy-icon"}),e.role!=="user"?(s(),r("span",el,w(e.copied?"Copied":"Copy"),1)):I("",!0)],8,Zr)):I("",!0)],8,Gr)):I("",!0)}}),nl=se(tl,[["__scopeId","data-v-309de082"]]),ol="codex-web-local.process-fold.v1",so="codex:web-local:process-fold";function Gt(){return typeof localStorage>"u"?"auto":localStorage.getItem(ol)==="expanded"?"expanded":"auto"}function sl(e){const n=o=>e(o.detail);return window.addEventListener(so,n),()=>window.removeEventListener(so,n)}const al=["aria-expanded"],il={class:"process-fold-label"},rl={class:"process-fold-toggle","aria-hidden":"true"},ll={key:0,class:"process-fold-body"},cl=le({__name:"ProcessFold",props:{label:{},running:{type:Boolean},hasOutsideContent:{type:Boolean}},setup(e){const n=e,o=W(Gt()==="expanded"||!n.hasOutsideContent),a=W(!1);let f=!1;const i=sl(()=>{a.value=!1,Gt()==="expanded"?o.value=!0:!n.running&&n.hasOutsideContent&&(o.value=!1)});we(()=>n.running,u=>{const p=f;f=u,u?(p||(a.value=!1),a.value||(o.value=!0)):p&&!a.value&&n.hasOutsideContent&&Gt()!=="expanded"&&(o.value=!1)},{immediate:!0}),Tt(()=>i());function m(){a.value=!0,o.value=!o.value}return(u,p)=>(s(),r("div",{class:oe(["process-fold",{"process-fold--open":o.value,"process-fold--running":e.running}])},[d("button",{type:"button",class:"process-fold-header","aria-expanded":o.value,onClick:m},[d("span",il,w(e.label),1),d("span",rl,w(o.value?"▾":"▸"),1)],8,al),o.value?(s(),r("div",ll,[Ve(u.$slots,"default",{},void 0)])):I("",!0)],2))}}),ul=se(cl,[["__scopeId","data-v-d29a5266"]]),dl=["aria-label"],fl=["data-turn","aria-label","onClick"],ml={class:"question-jump-preview-text"},hl=2,gl=le({__name:"QuestionJumpBar",props:{anchors:{},activeTurn:{}},emits:["jump"],setup(e,{emit:n}){const o=()=>getComputedStyle(document.documentElement).getPropertyValue("--live").trim()||"#b26a12",a=e,f=n,{t:i}=ke(),m=W(null),u=W(-1),p=W("0px"),v=_(()=>{const U=u.value;return U<0?null:a.anchors[U]??null});function M(U){var E;const P=a.activeTurn===((E=a.anchors[U])==null?void 0:E.turn),b=o(),L={};if(u.value<0)return L.width=P?"18px":"12px",L.background=P?b:void 0,L;const x=Math.abs(U-u.value);return L.width=x===0?"32px":x===1?"20px":x===2?"14px":P?"18px":"12px",L.background=x===0?b:x===1?b+"99":x===2?b+"59":P?b:void 0,L.transitionDelay=`${x*20}ms`,L}function y(U){const P=m.value;if(!P)return-1;const b=Array.from(P.querySelectorAll(".question-jump-item"));let L=-1,x=Number.POSITIVE_INFINITY;for(let E=0;E<b.length;E+=1){const B=b[E].getBoundingClientRect(),k=B.top+B.height/2,Y=Math.abs(U-k);Y<x&&(x=Y,L=E)}return L}function F(U){var k;const P=y(U.clientY);if(P<0)return;u.value=P;const b=m.value;if(!b)return;const x=(k=Array.from(b.querySelectorAll(".question-jump-item"))[P])==null?void 0:k.getBoundingClientRect(),E=b.getBoundingClientRect();if(!x)return;const B=x.top+x.height/2;p.value=`${B-E.top}px`}function S(){u.value=-1}function R(U){const P=y(U.clientY),b=P>=0?a.anchors[P]:null;b&&f("jump",b.turn)}function J(U){f("jump",U.turn)}return(U,P)=>e.anchors.length>=hl?(s(),r("nav",{key:0,class:"question-jump-bar","aria-label":c(i)("Question navigation")},[d("div",{ref_key:"trackRef",ref:m,class:"question-jump-track",onMousemove:F,onMouseleave:S,onMousedown:R},[(s(!0),r(N,null,z(e.anchors,(b,L)=>(s(),r("button",{key:b.turn,type:"button",class:"question-jump-item","data-turn":b.turn,"aria-label":c(i)("Jump to question {n}",{n:b.turn+1}),onMousedown:P[0]||(P[0]=Ye(()=>{},["prevent"])),onClick:x=>J(b)},[d("span",{class:"question-jump-dot",style:_e(M(L))},null,4)],40,fl))),128))],544),v.value?(s(),r("div",{key:0,class:"question-jump-preview",role:"tooltip",style:_e({top:p.value})},[d("span",ml,w(v.value.text),1)],4)):I("",!0)],8,dl)):I("",!0)}}),vl=se(gl,[["__scopeId","data-v-f2cd9065"]]),pl=["data-state"],yl=["aria-expanded"],wl={class:"reasoning-block-title"},kl={class:"reasoning-block-toggle","aria-hidden":"true"},bl={key:0,class:"reasoning-block-body"},Cl={key:0,class:"reasoning-block-summary"},$l=["innerHTML"],xl=le({__name:"ReasoningBlock",props:{message:{},expanded:{type:Boolean},contentHtml:{}},emits:["toggle"],setup(e){const n=e,{t:o}=ke(),a=_(()=>{var i;return(((i=n.message.reasoning)==null?void 0:i.summary)??[]).map(m=>m.trim()).filter(Boolean).join(`
25
+ `).trim()});return(f,i)=>(s(),r("div",{class:"reasoning-block","data-state":e.expanded?"expanded":"collapsed"},[d("button",{type:"button",class:"reasoning-block-header","aria-expanded":e.expanded,onClick:i[0]||(i[0]=m=>f.$emit("toggle"))},[d("span",wl,w(c(o)("Thinking process")),1),d("span",kl,w(e.expanded?"▾":"▸"),1)],8,yl),e.expanded?(s(),r("div",bl,[a.value?(s(),r("p",Cl,w(a.value),1)):I("",!0),d("div",{class:"reasoning-block-content message-card",innerHTML:e.contentHtml},null,8,$l)])):I("",!0)],8,pl))}}),ao=se(xl,[["__scopeId","data-v-e64f7962"]]),_l=new Set(["read_file","ls","grep","glob","web_fetch","read_skill","code_index","connect_tool_source"]),Tl=new Set(["write_file","edit_file","multi_edit","move_file","delete_range","delete_symbol","notebook_edit"]),Il=new Set(["task","run_skill","explore","research","review","security_review"]);function Ml(e){var o;const n=((o=e.toolCall)==null?void 0:o.tool)??"";return _l.has(n)?"readonly":Tl.has(n)?"modify":Il.has(n)?"delegate":null}const Sl=2;function Ll(e){var i;const n=[];let o=[],a=null;const f=()=>{if(a!==null&&o.length>=Sl)n.push({type:"batch",kind:a,messages:o});else for(const m of o)n.push({type:"tool",message:m});o=[],a=null};for(const m of e){if(m.messageType!=="toolCall"||((i=m.toolCall)==null?void 0:i.status)==="inProgress"){f(),n.push({type:"tool",message:m});continue}const u=Ml(m);if(u===null){f(),n.push({type:"tool",message:m});continue}a!==null&&a!==u&&f(),a=u,o.push(m)}return f(),n}function Al(e,n,o){const{t:a}=o;if(e==="readonly"){const f=n.filter(p=>{var v,M;return((v=p.toolCall)==null?void 0:v.tool)==="read_file"||((M=p.toolCall)==null?void 0:M.tool)==="ls"}).length,i=n.filter(p=>{var M;const v=((M=p.toolCall)==null?void 0:M.tool)??"";return v==="grep"||v==="glob"||v==="web_fetch"||v==="code_index"}).length,m=n.length-f-i,u=[];return f>0&&u.push(a("Read {n} files",{n:f})),i>0&&u.push(a("Search {n} files",{n:i})),m>0&&u.push(a("{n} read calls",{n:m})),u.join(" · ")}return e==="modify"?a("Modified {n} files",{n:n.length}):e==="delegate"?a("Delegated {n} tasks",{n:n.length}):a("Explored {n} items",{n:n.length})}const Fl={class:"message-row","data-role":"system"},Pl={class:"message-stack","data-role":"system"},El=["title"],Bl={class:"tool-call-name"},Dl={key:0,class:"tool-call-metric"},Rl=le({__name:"ToolCallRow",props:{message:{}},setup(e){const n=e,{t:o}=ke(),a=_(()=>{const y=n.message.toolCall;return y?y.server?`${y.server} · ${y.tool}`:y.tool:n.message.text||"(tool)"}),f=_(()=>{var F;const y=(F=n.message.toolCall)==null?void 0:F.durationMs;return typeof y!="number"||y<0?"":y<1e3?`${y}ms`:`${(y/1e3).toFixed(1)}s`}),i=_(()=>{var y;switch((y=n.message.toolCall)==null?void 0:y.status){case"inProgress":return{text:"RUN",cls:"is-live"};case"failed":return{text:"FAIL",cls:"is-alert"};case"completed":return{text:"OK",cls:"is-ok"};default:return{text:"",cls:""}}}),m=_(()=>i.value.text),u=_(()=>i.value.cls),p=_(()=>{const y=n.message.toolCall;if(!y)return"";switch(y.status){case"inProgress":return o("Running");case"failed":return o("Failed");default:return o("Done")}}),v=_(()=>{var y;switch((y=n.message.toolCall)==null?void 0:y.status){case"inProgress":return"tool-call-running";case"failed":return"tool-call-error";default:return"tool-call-ok"}}),M=_(()=>{const y=n.message.toolCall;if(!y)return"";const F=[a.value,p.value];return y.error&&F.push(y.error),typeof y.durationMs=="number"&&y.durationMs>=0&&F.push(`${y.durationMs}ms`),F.join(" · ")});return(y,F)=>(s(),r("div",Fl,[d("div",Pl,[d("div",{class:oe(["tool-call-block",v.value]),title:M.value},[d("span",{class:oe(["tool-call-pip",u.value]),"aria-hidden":"true"},null,2),d("code",Bl,w(a.value),1),f.value?(s(),r("span",Dl,w(f.value),1)):I("",!0),m.value?(s(),r("span",{key:1,class:oe(["tool-call-status",u.value])},w(m.value),3)):I("",!0)],10,El)])]))}}),Jt=se(Rl,[["__scopeId","data-v-f0b29923"]]),Hl=["aria-expanded","title"],Ol={class:"tool-batch-toggle","aria-hidden":"true"},Nl={class:"tool-batch-label"},ql={class:"tool-batch-count"},Vl={key:0,class:"tool-batch-body"},Wl=le({__name:"ToolBatchBlock",props:{kind:{},messages:{}},setup(e){const n=e,{t:o}=ke(),a=W(!1),f=_(()=>Al(n.kind,n.messages,{t:o})),i=_(()=>n.messages.map(m=>{var u;return((u=m.toolCall)==null?void 0:u.tool)??""}).join(" · "));return(m,u)=>(s(),r("div",{class:oe(["tool-batch-block",{"tool-batch-block--open":a.value}])},[d("button",{type:"button",class:"tool-batch-head","aria-expanded":a.value,title:i.value,onClick:u[0]||(u[0]=p=>a.value=!a.value)},[d("span",Ol,w(a.value?"▾":"▸"),1),u[1]||(u[1]=d("span",{class:"tool-batch-icon","aria-hidden":"true"},"🛠",-1)),d("span",Nl,w(f.value),1),d("span",ql,w(e.messages.length),1)],8,Hl),a.value?(s(),r("div",Vl,[(s(!0),r(N,null,z(e.messages,p=>(s(),ue(Jt,{key:p.id,message:p},null,8,["message"]))),128))])):I("",!0)],2))}}),jl=se(Wl,[["__scopeId","data-v-7b951bea"]]),Ul=["data-turn-key"],Kl={key:0,class:"conversation-turn-request","aria-label":"User request"},Gl={class:"conversation-turn-items"},zl={key:1,class:"conversation-turn-process","aria-label":"Turn process"},Yl=["aria-expanded","aria-label"],Xl={key:2,class:"conversation-turn-time"},Jl={class:"conversation-turn-process-count"},Ql={key:1,class:"conversation-turn-process-heading"},Zl={key:0,class:"conversation-turn-time"},ec={key:2,class:"conversation-turn-items conversation-turn-process-items"},tc={key:2,class:"conversation-turn-final","aria-label":"Assistant final response"},nc={class:"conversation-turn-items"},oc=le({__name:"ThreadTurn",props:{turnKey:{},request:{},processItems:{default:()=>[]},finalItem:{},fileChangeAnchorIds:{default:()=>[]},durationMs:{},warm:{},warmItems:{default:()=>[]}},setup(e){const n=e,{t:o}=ke(),a=W(!0),f=_(()=>n.processItems.length+n.fileChangeAnchorIds.length),i=_(()=>!!n.finalItem);return we(f,(m,u)=>{m>u&&(a.value=!0)}),(m,u)=>e.warm?(s(),r(N,{key:0},[Ve(m.$slots,"warm-card",{warm:e.warm},void 0),(s(!0),r(N,null,z(e.warmItems,p=>Ve(m.$slots,"default",{key:p.message.id,item:p,section:"warm"},void 0)),128))],64)):(s(),r("li",{key:1,class:"conversation-turn","data-turn-key":e.turnKey},[e.request?(s(),r("section",Kl,[d("ol",Gl,[Ve(m.$slots,"default",{item:e.request,section:"request"},void 0)])])):I("",!0),f.value>0?(s(),r("section",zl,[i.value?(s(),r("button",{key:0,class:"conversation-turn-process-heading conversation-turn-process-toggle",type:"button","aria-expanded":a.value,"aria-label":a.value?c(o)("Collapse turn process"):c(o)("Expand turn process"),onClick:u[0]||(u[0]=p=>a.value=!a.value)},[a.value?(s(),ue(Ys,{key:0,class:"conversation-turn-process-toggle-icon"})):(s(),ue(vo,{key:1,class:"conversation-turn-process-toggle-icon"})),d("span",null,w(c(o)("Turn process")),1),e.durationMs!=null&&e.durationMs>0?(s(),r("span",Xl,w(c(zt)(e.durationMs)),1)):I("",!0),d("span",Jl,w(c(o)("{n} process items",{n:f.value})),1)],8,Yl)):(s(),r("div",Ql,[Fe(w(c(o)("Turn process"))+" ",1),e.durationMs!=null&&e.durationMs>0?(s(),r("span",Zl,w(c(zt)(e.durationMs)),1)):I("",!0)])),a.value?(s(),r("ol",ec,[(s(!0),r(N,null,z(e.processItems,p=>Ve(m.$slots,"default",{key:p.message.id,item:p,section:"process"},void 0)),128)),(s(!0),r(N,null,z(e.fileChangeAnchorIds,p=>(s(),r("li",{key:`file-change-${p}`,class:"conversation-turn-row conversation-turn-file-change"},[Ve(m.$slots,"file-change",{anchorMessageId:p},void 0)]))),128))])):I("",!0)])):I("",!0),e.finalItem?(s(),r("section",tc,[d("ol",nc,[Ve(m.$slots,"default",{item:e.finalItem,section:"final"},void 0)])])):I("",!0)],8,Ul))}}),sc=se(oc,[["__scopeId","data-v-7e124617"]]),ac=["aria-expanded"],ic={class:"warm-turn__preview"},rc={key:0,class:"warm-turn__meta"},lc={class:"warm-turn__content"},cc={key:1,class:"warm-turn__assistant"},uc=le({__name:"WarmTurnCard",props:{userText:{},assistantPreview:{},toolCount:{},expanded:{type:Boolean}},emits:["toggle"],setup(e,{emit:n}){const o=n,{t:a}=ke();function f(){o("toggle")}return(i,m)=>(s(),r("div",{class:oe(["warm-turn",{"warm-turn--expanded":e.expanded}])},[d("button",{type:"button",class:"warm-turn__head","aria-expanded":e.expanded,onClick:f},[te(vo,{class:oe(["warm-turn__chevron",{"warm-turn__chevron--open":e.expanded}])},null,8,["class"]),d("span",ic,w(e.userText),1),e.toolCount>0?(s(),r("span",rc,w(c(a)("{n} tools",{n:e.toolCount})),1)):I("",!0)],8,ac),d("div",lc,[e.expanded?Ve(i.$slots,"default",{},void 0,!0,0):e.assistantPreview?(s(),r("div",cc,w(e.assistantPreview),1)):I("",!0)])],2))}}),dc=se(uc,[["__scopeId","data-v-cda74ec1"]]),fc=["aria-expanded","aria-label","title"],mc={class:"work-block-command"},hc={key:0,class:"work-block-metric"},gc={class:"work-block-output-inner"},vc=["textContent"],pc=["textContent"],yc={key:0,class:"work-block-output-spill",role:"note"},wc=["disabled"],kc={key:1},bc={key:0,class:"work-block-permission-hint",role:"note"},Cc=le({__name:"WorkBlockItem",props:{command:{},stepIndex:{},expanded:{type:Boolean},compact:{type:Boolean},outputCondensed:{type:Boolean}},emits:["toggle"],setup(e){const n=e,{t:o}=ke(),a=_(()=>{var k;return(k=n.command.commandExecution)==null?void 0:k.outputSpill}),f=_(()=>{var k;return((k=a.value)==null?void 0:k.ref)??""}),i=W("idle"),m=W(null),u=_(()=>{const k=a.value;return!!(k&&m.value&&m.value.ref===k.ref)}),p=_(()=>{const k=n.command.commandExecution,Y=k==null?void 0:k.outputSpill,q=m.value;return Y&&q&&q.ref===Y.ref?q.text:(k==null?void 0:k.aggregatedOutput)||"(no output)"});function v(k){return k<1024?`${k} B`:k<1024*1024?`${(k/1024).toFixed(1)} KB`:`${(k/(1024*1024)).toFixed(1)} MB`}const M=_(()=>{const k=a.value;return!k||k.omittedBytes<=0?"":o("Output trimmed: {omitted} omitted of {total}.",{omitted:v(k.omittedBytes),total:v(k.totalBytes)})});async function y(){const k=a.value;if(!(!(k!=null&&k.ref)||i.value==="loading")){i.value="loading";try{m.value={ref:k.ref,text:await Xs(k.ref)},i.value="idle"}catch{i.value="error"}}}const F=_(()=>{var Y,q;const k=(Y=n.command.commandExecution)==null?void 0:Y.status;return k==="inProgress"?"cmd-status-running":k==="completed"&&((q=n.command.commandExecution)==null?void 0:q.exitCode)===0?"cmd-status-ok":"cmd-status-error"}),S=_(()=>{const k=n.command.commandExecution;if(!k)return"";switch(k.status){case"inProgress":return o("Running");case"completed":return k.exitCode===0?o("Done"):`${o("Exit")} ${k.exitCode??"?"}`;case"failed":return o("Failed");case"declined":return o("Declined");case"interrupted":return o("Stopped");default:return""}}),R=_(()=>{var k;return((k=n.command.commandExecution)==null?void 0:k.command)||"(command)"}),J=_(()=>{const k=n.command.commandExecution;return k?k.outputSpill&&k.outputSpill.totalBytes>0?k.outputSpill.totalBytes:k.aggregatedOutput?new TextEncoder().encode(k.aggregatedOutput).length:0:0}),U=_(()=>J.value>0?v(J.value):""),P=_(()=>{const k=n.command.commandExecution;if(!k)return{text:"",cls:""};switch(k.status){case"inProgress":return{text:"RUN",cls:"is-live"};case"completed":return k.exitCode===0?{text:"OK",cls:"is-ok"}:{text:`EXIT ${k.exitCode??"?"}`,cls:"is-alert"};case"failed":return{text:"FAIL",cls:"is-alert"};case"declined":return{text:"SKIP",cls:"is-alert"};case"interrupted":return{text:"STOP",cls:"is-alert"};default:return{text:"",cls:""}}}),b=_(()=>P.value.text),L=_(()=>P.value.cls),x=_(()=>[R.value,S.value,U.value].filter(Boolean).join(" · ")),E=[/access to the path .* is denied/iu,/access is denied/iu,/permission denied/iu,/not permitted/iu,/EACCES|EPERM/iu,/denied access|deny access/iu,/拒绝访问/iu,/没有权限/iu,/权限不足/iu,/要求提权|需要提权|require_escalated/iu],B=_(()=>{const k=n.command.commandExecution;if(!k||!(k.status==="failed"||k.status==="declined"||typeof k.exitCode=="number"&&k.exitCode!==0))return"";const q=k.aggregatedOutput??"";return!q||!E.some(ge=>ge.test(q))?"":o("Command blocked by a permission or sandbox restriction; no approval prompt was shown. Check the approval policy or trusted directories if you expected one.")});return(k,Y)=>{var q;return s(),r("div",{class:oe(["work-block",[F.value,{"work-block-expanded":e.expanded,"work-block-compact":e.compact}]])},[d("button",{type:"button",class:"work-block-header","aria-expanded":e.expanded,"aria-label":x.value,title:x.value,onClick:Y[0]||(Y[0]=ge=>k.$emit("toggle"))},[d("span",{class:oe(["work-block-pip",L.value]),"aria-hidden":"true"},null,2),d("code",mc,w(R.value),1),U.value?(s(),r("span",hc,w(U.value),1)):I("",!0),b.value?(s(),r("span",{key:1,class:oe(["work-block-status",L.value])},w(b.value),3)):I("",!0)],8,fc),d("div",{class:oe(["work-block-output-wrap",{"work-block-output-visible":e.expanded}])},[d("div",gc,[d("pre",{class:"work-block-output-command",textContent:w(((q=e.command.commandExecution)==null?void 0:q.command)||"(command)")},null,8,vc),d("pre",{class:oe(["work-block-output",{"cmd-output-condensed":e.outputCondensed}]),textContent:w(p.value)},null,10,pc),M.value?(s(),r("p",yc,[d("span",null,w(M.value),1),f.value&&!u.value?(s(),r("button",{key:0,type:"button",class:"work-block-output-spill-action",disabled:i.value==="loading",onClick:y},w(i.value==="loading"?c(o)("Loading full output…"):c(o)("Show full output")),9,wc)):i.value==="error"?(s(),r("span",kc,w(c(o)("Could not load the full output.")),1)):I("",!0)])):I("",!0)])],2),B.value?(s(),r("p",bc,w(B.value),1)):I("",!0)],2)}}}),io=se(Cc,[["__scopeId","data-v-daded7af"]]),$c=2;function ro(e){const n=e.messageType;return n==="commandExecution"||n==="toolCall"}function xc(e){var o,a;return(((o=e.commandExecution)==null?void 0:o.status)??"")==="inProgress"||(((a=e.toolCall)==null?void 0:a.status)??"")==="inProgress"?!0:(e.messageType??"").endsWith(".live")}function _c(e,n){return e.messages.every(o=>n(o))}function Tc(e){const n=[];let o=[],a="";const f=()=>{o.length>0&&(n.push(o),o=[])};for(const u of e){const p=u.turnId??"",v=ro(u)&&p!=="";(!v||p!==a)&&(o.length>0&&f(),a=v?p:""),v&&o.push(u)}f();const i=new Map;for(const u of e)u.messageType==="worked"&&u.turnId&&typeof u.durationMs=="number"&&i.set(u.turnId,u.durationMs);const m=[];for(const u of n){if(u.length<$c)continue;const p=u[0].turnId??"";let v=0,M=0,y=0,F=!1;for(const R of u)R.messageType==="toolCall"?v+=1:R.messageType==="reasoning"?M+=1:R.messageType==="commandExecution"&&(y+=1),xc(R)&&(F=!0);const S=e.some(R=>R.turnId===p&&!ro(R));m.push({turnId:p,messages:u,running:F,toolCount:v,thoughtCount:M,commandCount:y,durationMs:i.get(p)??0,hasOutsideContent:S})}return m}function Ic(e,n){const{t:o,formatDuration:a}=n,f=[];return e.running?f.push(o("Working…")):e.durationMs>0?f.push(a(e.durationMs)):f.push(o("Processed")),e.toolCount>0&&f.push(o("{n} tools",{n:e.toolCount})),e.thoughtCount>0&&f.push(o("{n} thoughts",{n:e.thoughtCount})),e.commandCount>0&&f.push(o("{n} commands",{n:e.commandCount})),f.join(" · ")}function Mc(e){return e.text.length>0||Array.isArray(e.images)&&e.images.length>0||Array.isArray(e.fileAttachments)&&e.fileAttachments.length>0||Array.isArray(e.skills)&&e.skills.length>0||Array.isArray(e.imageAttachmentIds)&&e.imageAttachmentIds.length>0||Array.isArray(e.audioSources)&&e.audioSources.length>0||Array.isArray(e.mentions)&&e.mentions.length>0}function Sc(e){return!Mc(e)}const Lc=68.5,Ac=42,Fc=34,lo=30,Pc=280;function Ec(e,n){if(!e.collapsed)return Pc;let o=e.hasAssistantPreview?Lc:Ac;return e.hasTimeDivider&&(o+=Fc+n),o+=e.leadingModelSwitchCount*(lo+n),o+=e.trailingModelSwitchCount*(lo+n),o}function Zt(e,n){const o=e.map(i=>Ec(i,n)),a=new Array(e.length);let f=0;for(let i=e.length-1;i>=0;i-=1)a[i]=f+o[i],f+=o[i]+n;return{heightsPx:o,topDistancesFromBottomPx:a,bottomDistancesFromBottomPx:a.map((i,m)=>i-o[m]),totalHeightPx:e.length===0?0:f-n}}function Bc({gapPx:e,overscanPx:n,specs:o,viewportBottomDistancePx:a,viewportHeightPx:f}){var F;const i=o.length;if(i===0)return{first:0,last:-1};const m=Zt(o,e),u=a+f,p=a-n,v=u+n;let M=-1,y=-1;for(let S=0;S<i;S+=1){const R=m.bottomDistancesFromBottomPx[S],J=m.topDistancesFromBottomPx[S];R<=v&&J>=p&&(M<0&&(M=S),y=S)}M<0&&(p>m.totalHeightPx?(M=0,y=0):(M=i-1,y=i-1));for(let S=0;S<i;S+=1)((F=o[S])==null?void 0:F.collapsed)===!1&&(S<M&&(M=S),S>y&&(y=S));return{first:M,last:y}}function Dc({gapPx:e,specs:n,window:o}){const a=Zt(n,e),f=n.length,{first:i,last:m}=o,u=Math.max(0,i),p=Math.max(0,f-1-m);let v=0;if(u>0){let y=0;for(let F=0;F<u;F+=1)y+=a.heightsPx[F];v=y+u*e}let M=0;if(p>0){let y=0;for(let F=m+1;F<f;F+=1)y+=a.heightsPx[F];M=Math.max(0,y+(p-1)*e)}return{topMarginPx:v,bottomSpacerPx:M,skippedAbove:u,skippedBelow:p}}function Rc({gapPx:e,overscanPx:n,specs:o,viewportBottomDistancePx:a,viewportHeightPx:f}){const i=Zt(o,e),m=Bc({gapPx:e,overscanPx:n,specs:o,viewportBottomDistancePx:a,viewportHeightPx:f}),u=Dc({gapPx:e,specs:o,window:m});return{window:m,spacers:u,layout:i}}const Hc=280;function en(e,n){const o=e.map(i=>i.measuredHeightPx??Hc),a=new Array(e.length);let f=0;for(let i=e.length-1;i>=0;i-=1)a[i]=f+o[i],f+=o[i]+n;return{heightsPx:o,topDistancesFromBottomPx:a,bottomDistancesFromBottomPx:a.map((i,m)=>i-o[m]),totalHeightPx:e.length===0?0:f-n}}function Oc({forcedKeys:e,gapPx:n,overscanPx:o,specs:a,viewportBottomDistancePx:f,viewportHeightPx:i}){const m=a.length;if(m===0)return{first:0,last:-1};const u=en(a,n),p=f+i,v=f-o,M=p+o;let y=-1,F=-1;for(let S=0;S<m;S+=1){const R=u.bottomDistancesFromBottomPx[S],J=u.topDistancesFromBottomPx[S];R<=M&&J>=v&&(y<0&&(y=S),F=S)}y<0&&(v>u.totalHeightPx?(y=0,F=0):(y=m-1,F=m-1));for(let S=0;S<m;S+=1){const R=a[S];(R.measuredHeightPx===void 0||e!=null&&e.has(R.key))&&(S<y&&(y=S),S>F&&(F=S))}return{first:y,last:F}}function Nc({gapPx:e,specs:n,window:o}){const a=en(n,e),f=n.length,{first:i,last:m}=o,u=Math.max(0,i),p=Math.max(0,f-1-m);let v=0;if(u>0){let y=0;for(let F=0;F<u;F+=1)y+=a.heightsPx[F];v=Math.max(0,y+(u-1)*e)}let M=0;if(p>0){let y=0;for(let F=m+1;F<f;F+=1)y+=a.heightsPx[F];M=Math.max(0,y+(p-1)*e)}return{topSpacerPx:v,bottomSpacerPx:M,skippedAbove:u,skippedBelow:p}}function qc({forcedKeys:e,gapPx:n,overscanPx:o,specs:a,viewportBottomDistancePx:f,viewportHeightPx:i}){const m=en(a,n),u=Oc({forcedKeys:e,gapPx:n,overscanPx:o,specs:a,viewportBottomDistancePx:f,viewportHeightPx:i}),p=Nc({gapPx:n,specs:a,window:u});return{window:u,spacers:p,layout:m}}function Vc(e){const n={};for(const o of e)o.messageType==="worked"&&o.turnId&&typeof o.durationMs=="number"&&(n[o.turnId]=(n[o.turnId]??0)+o.durationMs);return n}const Wc=300,jc=1200,Uc=300,Kc=250;function Gc(e){const{getCwd:n,isVideoMediaUrl:o}=e,a=W(null),f=W(0);let i=null;const m=new Map,u=new Map,p=new Map,v=new Map;function M(T,A,H,Q){for(T.has(A)&&T.delete(A),T.set(A,H);T.size>Q;){const de=T.keys().next().value;if(de===void 0)break;T.delete(de)}return H}function y(){return a.value?Promise.resolve():(i||(i=Zs(()=>import("./common-DEPjExR-.js"),[]).then(T=>{a.value=T.default,v.clear(),p.clear(),f.value+=1}).finally(()=>{i=null})),i)}function F(){return!!a.value}function S(T){const A=u.get(T);return A?(u.delete(T),u.set(T,A),A):M(u,T,Qs(T),jc)}function R(T){const A=T.trim();if(!A)return"#";const H=K=>K.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(K),Q=Js(A),de=(Q==null?void 0:Q.path)??A,D=fo(de,n());if(H(D)){const K=D.startsWith("/")?D:`/${D}`;return`/codex-local-browse${encodeURI(K)}`}return"#"}function J(T){const A=T.trim();if(!A)return"";try{const H=new URL(A,window.location.href);return H.pathname.startsWith("/codex-local-browse")?`${`/codex-local-edit${H.pathname.slice(19)}`}${H.search}${H.hash}`:""}catch{return""}}function U(T){const A=m.get(T.id);if(A&&A.text===T.text&&A.cwd===n())return m.delete(T.id),m.set(T.id,A),A.blocks;const H=Yn(T.text);return M(m,T.id,{text:T.text,cwd:n(),blocks:H},Wc).blocks}function P(T){return T.replace(/&/gu,"&amp;").replace(/</gu,"&lt;").replace(/>/gu,"&gt;").replace(/"/gu,"&quot;").replace(/'/gu,"&#39;")}function b(T){var H;const A=((H=T.trim().split(/\s+/u)[0])==null?void 0:H.toLowerCase())??"";return A?ko[A]??A:""}function L(T,A){const H=b(T);if(!H)return P(A);const Q=a.value;if(!Q)return P(A);try{if(Q.getLanguage(H))return Q.highlight(A,{language:H,ignoreIllegals:!0}).value}catch{}return P(A)}function x(T,A){return Ut(E(T,A))}function E(T,A){const H=`${f.value}\0${b(T)}\0${T}\0${A}`,Q=v.get(H);return Q!==void 0?(v.delete(H),v.set(H,Q),Q):M(v,H,L(T,A),Kc)}function B(T){return S(T).map(A=>A.kind==="text"?P(A.value):A.kind==="bold"?`<strong class="message-bold-text">${P(A.value)}</strong>`:A.kind==="italic"?`<em class="message-italic-text">${P(A.value)}</em>`:A.kind==="strikethrough"?`<s class="message-strikethrough-text">${P(A.value)}</s>`:A.kind==="file"?`<a class="message-file-link" href="${P(R(A.path))}" target="_blank" rel="noopener noreferrer" title="${P(A.path)}">${P(A.displayPath)}</a>`:A.kind==="url"?`<a class="message-file-link" href="${P(A.href)}" target="_blank" rel="noopener noreferrer" title="${P(A.href)}">${P(A.value)}</a>`:`<code class="message-inline-code">${P(A.value)}</code>`).join("")}function k(T){return T.paragraphs.map(A=>`<div class="message-list-item-text message-list-item-paragraph">${B(A)}</div>`).join("")}function Y(T){var Q;const A=k(T),H=((Q=T.children)==null?void 0:Q.map(de=>ge(de)).join(""))??"";return Ut(A+H)}function q(T){return T?` style="text-align:${T}"`:""}function ge(T){if(T.kind==="paragraph")return`<p class="message-text">${B(T.value)}</p>`;if(T.kind==="heading"){const A=Math.min(6,Math.max(1,Math.trunc(T.level))),H=po(A),Q=`message-heading ${yo(A)}`;return`<${H} class="${Q}">${B(T.value)}</${H}>`}if(T.kind==="blockquote")return`<blockquote class="message-blockquote">${B(T.value)}</blockquote>`;if(T.kind==="unorderedList")return`<ul class="message-list message-list-unordered">${T.items.map(H=>`<li class="message-list-item"><div class="message-list-item-content">${Y(H)}</div></li>`).join("")}</ul>`;if(T.kind==="taskList")return`<ul class="message-list message-task-list">${T.items.map(H=>`<li class="message-task-item"><span class="message-task-checkbox" data-checked="${H.checked?"true":"false"}">${H.checked?"☑":"☐"}</span><div class="message-list-item-text">${B(H.text)}</div></li>`).join("")}</ul>`;if(T.kind==="orderedList"){const A=T.items.map(H=>`<li class="message-list-item"><div class="message-list-item-content">${Y(H)}</div></li>`).join("");return`<ol class="message-list message-list-ordered" start="${T.start}">${A}</ol>`}if(T.kind==="table"){const A=T.headers.map((de,D)=>`<th class="message-table-head-cell"${q(T.alignments[D]??null)}>${B(de)}</th>`).join(""),H=T.rows.map(de=>'<tr class="message-table-body-row">'+de.map((D,K)=>`<td class="message-table-cell"${q(T.alignments[K]??null)}>${B(D)}</td>`).join("")+"</tr>").join(""),Q=H?`<tbody>${H}</tbody>`:"";return`<div class="message-table-wrap"><table class="message-table"><thead><tr>${A}</tr></thead>${Q}</table></div>`}return T.kind==="codeBlock"?`<div class="message-code-block"><div class="message-code-bar">${T.language?`<span class="message-code-language">${P(T.language)}</span>`:""}<span class="message-code-copy" role="button" tabindex="0" data-code-copy>Copy</span></div><pre class="message-code-pre"><code class="hljs">${x(T.language,T.value)}</code></pre></div>`:T.kind==="thematicBreak"?'<hr class="message-divider">':o(T.url)?`<video class="message-image-preview message-video-preview message-markdown-image" src="${P(T.url)}" controls preload="metadata"></video>`:`<img class="message-image-preview message-markdown-image" src="${P(T.url)}" alt="${P(T.alt||"Embedded message image")}" loading="lazy">`}function Xe(T){const A=`${n()}\0${f.value}\0${T}`,H=p.get(A);if(H&&H.text===T&&H.cwd===n()&&H.highlightVersion===f.value)return p.delete(A),p.set(A,H),H.html;const Q=Yn(T).map(D=>ge(D)).join(""),de=Ut(Q);return M(p,A,{text:T,cwd:n(),highlightVersion:f.value,html:de},Uc).html}function at(){m.clear(),u.clear(),p.clear(),v.clear()}return{highlightCacheVersion:f,hasHighlightLoaded:F,ensureHighlightJsLoaded:y,getInlineSegments:S,toBrowseUrl:R,toEditUrlFromBrowseHref:J,getMessageBlocks:U,renderListItemContentAsHtml:Y,renderCachedHighlightedCodeAsHtml:x,renderMarkdownBlocksAsHtml:Xe,clearRenderCaches:at}}const zc=["data-thread-id"],Yc={key:0,class:"conversation-switching-bar",role:"status"},Xc={key:1,class:"conversation-loading"},Jc={key:2,class:"conversation-loading conversation-loading-slow",role:"status"},Qc={key:3,class:"conversation-empty"},Zc={key:0,class:"conversation-load-more"},eu=["disabled"],tu={key:1,class:"conversation-load-more conversation-warm-collapse"},nu=["disabled"],ou={key:0,"aria-hidden":"true",class:"conversation-hot-anchor"},su=["data-hot-block"],au=["data-hot-block"],iu=["id"],ru={class:"message-row","data-role":"system"},lu={class:"message-stack","data-role":"system"},cu={class:"message-row","data-role":"system","data-message-type":"fileChange"},uu={class:"message-stack","data-role":"system"},du={key:0,class:"conversation-item conversation-item-fold","data-role":"system","data-message-type":"processFold"},fu={class:"message-row","data-role":"system"},mu={class:"message-stack","data-role":"system"},hu={key:0,class:"work-block-list"},gu=["id","data-role","data-message-type"],vu={key:0,class:"message-row thread-compaction-row","data-role":"system"},pu={class:"thread-compaction-inline thread-compaction-inline--pending",role:"status"},yu={key:1,class:"message-row thread-compaction-row","data-role":"system"},wu={class:"thread-compaction-inline thread-compaction-inline--done",role:"status"},ku={key:2,class:"message-row","data-role":"system"},bu={class:"message-stack","data-role":"system"},Cu={class:"work-block-list"},$u=["data-role","data-message-type"],xu=["data-role"],_u=["data-role"],Tu={key:5,class:"message-row","data-role":"system","data-message-type":"plan"},Iu={class:"message-stack","data-role":"system"},Mu={class:"thread-plan-record"},Su={class:"thread-plan-record-header"},Lu={key:0,class:"thread-plan-record-explanation"},Au={key:1,class:"thread-plan-record-steps"},Fu=["data-status"],Pu={class:"thread-plan-record-marker","aria-hidden":"true"},Eu={key:6,class:"message-row thread-agent-note-row","data-role":"system","data-message-type":"agentNote"},Bu={class:"message-stack","data-role":"system"},Du={class:"thread-agent-note"},Ru={class:"thread-agent-note-header"},Hu=["innerHTML"],Ou=["data-role","data-message-type"],Nu=["data-role"],qu=["data-role"],Vu=["data-role"],Wu=["onClick"],ju=["src"],Uu=["src","alt"],Ku={key:1,class:"message-file-attachments"},Gu=["href","title"],zu={key:2,class:"message-file-attachments"},Yu=["title"],Xu={class:"message-file-chip-name"},Ju={key:3,class:"message-skill-attachments"},Qu=["href","title"],Zu={class:"message-skill-chip-prefix"},ed={class:"message-skill-chip-name"},td={key:4,class:"message-audio-attachments"},nd=["src"],od={key:5,class:"message-file-attachments"},sd=["title"],ad={class:"message-file-chip-name"},id=["data-role"],rd={key:0,class:"automation-message-label"},ld={key:0},cd={key:1,class:"work-summary-wrap","aria-live":"polite"},ud={class:"work-summary-text"},dd={key:0,class:"message-text"},fd={key:2,class:"message-blockquote"},md={key:3,class:"message-list message-list-unordered"},hd=["innerHTML"],gd={key:4,class:"message-list message-task-list"},vd=["data-checked"],pd={class:"message-list-item-text"},yd=["start"],wd=["innerHTML"],kd={key:6,class:"message-table-wrap"},bd={class:"message-table"},Cd={key:0},$d={key:7,class:"message-code-block"},xd={class:"message-code-bar"},_d={key:0,class:"message-code-language"},Td={class:"message-code-copy",role:"button",tabindex:"0","data-code-copy":""},Id={class:"message-code-pre"},Md=["innerHTML"],Sd={key:8,class:"message-divider"},Ld={key:9,class:"message-text"},Ad=["onClick"],Fd=["src"],Pd=["src","alt","onError"],Ed=["href","onClick"],Bd={key:8,class:"message-inline-editor","data-message-inline-editor":""},Dd=["onKeydown"],Rd={class:"message-inline-editor-actions"},Hd={class:"message-inline-editor-note"},Od=["data-hot-block"],Nd=["title","aria-label"],qd=["aria-label"],Vd=["src"],Wd=["src","alt"],co=30,uo=20,jd=200,Ud=800,Kd=800,Gd=le({__name:"ThreadConversation",props:{messages:{},pendingRequests:{},liveOverlay:{},liveTurnId:{},isLoading:{type:Boolean},isSlowOpen:{type:Boolean},activeThreadId:{},cwd:{},hasMorePersistedAbove:{type:Boolean},isLoadingPersistedAbove:{type:Boolean},loadEarlierMessages:{type:Function}},emits:["forkThread","rollback","editMessage","respondServerRequest","fileChangesChanged"],setup(e,{expose:n,emit:o}){function a(t){return Da(t,i.cwd,G)}function f(t){return st(t,i.cwd)}const i=e,m=Gc({getCwd:()=>i.cwd,isVideoMediaUrl:$t}),{highlightCacheVersion:u,hasHighlightLoaded:p,ensureHighlightJsLoaded:v,getInlineSegments:M,toBrowseUrl:y,toEditUrlFromBrowseHref:F,getMessageBlocks:S,renderListItemContentAsHtml:R,renderCachedHighlightedCodeAsHtml:J,renderMarkdownBlocksAsHtml:U,clearRenderCaches:P}=m,b=Ga({getMessages:()=>i.messages,getLiveOverlay:()=>i.liveOverlay,isCommandMessage:it}),{hiddenGroupedCommandIds:L,isCommandExpanded:x,isCommandCompact:E,isCommandOutputCondensed:B,toggleCommandExpand:k,getWorkBlockCommands:Y,pruneCommandIdSets:q}=b,ge=Ya({toEditUrlFromBrowseHref:F}),{isFileLinkContextMenuVisible:Xe,fileLinkContextMenuX:at,fileLinkContextMenuY:T,fileLinkContextBrowseUrl:A,fileLinkContextEditUrl:H,handleConversationContextMenu:Q,closeFileLinkContextMenu:de}=ge,{isMobile:D}=ea(),K=Ua({getMessages:()=>i.messages,getLiveTurnId:()=>i.liveTurnId??"",isFileChangeMessage:Ft,isCopyableAssistantMessage:un,isReasoningMessage:St,isPlanMessage:Mt,isFoldMember:$n,getHiddenGroupedCommandIds:()=>L.value,isMobile:()=>D.value}),{anchoredFileChangeSummaryByAnchorId:ye,hiddenFileChangeMessageIds:be,isDiffViewerFileListOpen:fe,diffViewerChanges:me,activeDiffViewerChange:Ce,activeDiffViewerLines:j,toggleFileChangeSummary:$e,isFileChangeSummaryExpanded:Pe,openDiffViewer:vt,closeDiffViewer:Ee,toggleDiffViewerFileList:$o,closeDiffViewerFileList:xo,selectDiffViewerChange:_o,readAnchoredFileChangeSummaryById:xe,isFileChangeSummaryExpandedById:To,toggleFileChangeSummaryById:Io,readStandaloneFileChangeSummary:Te,isFileChangeSummaryVisible:tn,pruneFileChangeSummaryIds:Mo}=K,So=Ka({getMessages:()=>i.messages,isCopyableAssistantMessage:un,isPlanMessage:Mt,planStepCopyMarker:Ln,buildFileChangeCopyText:a,getAnchoredFileChangeSummaries:()=>ye.value}),{copiedResponseAnchorId:Lo,forkableTurnIndexByAnchorId:Ao,showCopyResponseButton:Fo,isCopyableUserMessage:Po,copyUserMessage:Eo,showForkResponseButton:Bo,copyResponse:Do}=So,{buildFeedbackMailto:Ro,feedbackMailtoBase:Ho,recordVisibleFailure:Oo}=go(),{t:G}=ke(),nn=Ho();function No(t){if(!t)return"";const l=new Date(t);if(Number.isNaN(l.getTime()))return"";const h=new Date,C=l.getFullYear()===h.getFullYear()&&l.getMonth()===h.getMonth()&&l.getDate()===h.getDate(),O=l.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1});return C?O:`${l.toLocaleDateString([],{month:"2-digit",day:"2-digit"})} ${O}`}const It=new WeakMap;async function on(t){var g;const l=t.target,h=l==null?void 0:l.closest("[data-code-copy]");if(!h)return;const C=(g=h.closest(".message-code-block"))==null?void 0:g.querySelector("code");if(!C)return;try{await _t(C.textContent??"")}catch{return}h.textContent=G("Copied"),h.dataset.copied="true";const O=It.get(h);O!==void 0&&window.clearTimeout(O),It.set(h,window.setTimeout(()=>{h.textContent=G("Copy"),delete h.dataset.copied,It.delete(h)},1600))}function qo(t,l){Oo(l);const h=t.currentTarget;h instanceof HTMLAnchorElement&&(h.href=Ro())}function it(t){return t.messageType==="commandExecution"&&!!t.commandExecution}function sn(t){return t.messageType==="compaction.pending"}function an(t){return t.messageType==="compaction.done"}function Mt(t){return t.messageType==="plan"||t.messageType==="plan.live"}function rn(t){return t.messageType==="modelSwitch"}function St(t){return t.messageType==="reasoning"&&!!t.reasoning}const Lt=W(new Set);function ln(t){return Lt.value.has(t.id)}function cn(t){const l=new Set(Lt.value);l.has(t.id)?l.delete(t.id):l.add(t.id),Lt.value=l}function At(t){return t.messageType==="toolCall"&&!!t.toolCall}function Vo(t){return t.messageType==="turnError"}function Ft(t){return t.messageType==="fileChange"&&t.fileChangeStatus==="completed"&&Array.isArray(t.fileChanges)&&t.fileChanges.length>0}function Wo(t){return it(t)||At(t)||Ft(t)||sn(t)||an(t)||t.messageType==="plan"?!1:Sc(t)}function un(t){return t.role==="assistant"&&!it(t)&&t.messageType!=="worked"&&!(t.messageType??"").endsWith(".live")}const Pt=o,ve=W(null),Et=W(null),jo=Xa({isVideo:$t}),{modalImageUrl:pt,modalIsVideo:Uo,markdownImageFailureVersion:Ko,isMarkdownImageFailed:Go,onMarkdownImageError:zo,openImageModal:dn,closeImageModal:yt}=jo,Yo=za({getActiveThreadId:()=>i.activeThreadId,getCwd:()=>i.cwd,onFileChangesChanged:()=>Pt("fileChangesChanged",i.activeThreadId),updateThreadFileChanges:pa,t:G}),{fileChangeActionKey:fn,isFileChangeActionable:mn,fileChangeActionStatus:hn,fileChangeActionErrorText:gn,fileChangeNextAction:vn,fileChangeActionLabel:pn,runFileChangeAction:Xo,resetFileChangeActions:Jo}=Yo,Be=W(null),Qo=_(()=>{const t=Be.value;return t?t.action==="undo"?G("Undo file changes?"):G("Redo file changes?"):""}),Zo=_(()=>{const t=Be.value;return t?t.filePathLabel?t.action==="undo"?G("Undo the changes to {file}? This modifies the working tree and Codex cannot revert it automatically.",{file:t.filePathLabel}):G("Redo the changes to {file}? This reapplies the edits to the working tree.",{file:t.filePathLabel}):t.action==="undo"?G("Undo the file changes from this turn? This modifies the working tree and Codex cannot revert it automatically."):G("Redo the file changes from this turn? This reapplies the edits to the working tree."):""}),De=W(!0);let We=0,Ie=0,wt=0,rt=null;const yn=new WeakSet,Re=W(Xn(i.activeThreadId)),wn=_(()=>va(Re.value,i.activeThreadId)),He=W(!1),Bt=_(()=>i.messages.filter(t=>!Mt(t)&&!rn(t))),je=_(()=>ma(Bt.value)),Dt=_(()=>ha({turnCount:je.value.length,hotTurns:co,pageSize:uo,coldPage:wn.value.coldPage})),Rt=_(()=>Dt.value.warmStartTurn),Je=_(()=>Dt.value.warmEndTurn),kn=_(()=>Dt.value.coldTurnCount),Ht=_(()=>kn.value>0),Ot=_(()=>wn.value.expandedWarmTurns),Nt=_(()=>{const t=Bt.value,l=je.value,h=[],C=Ot.value;function O(V){const ne=ae=>{var re,Wn,jn,Un;const Me=((re=ae.request)==null?void 0:re.message.turnStartedAtIso)??((Wn=ae.finalItem)==null?void 0:Wn.message.turnStartedAtIso)??(typeof((jn=ae.warm)==null?void 0:jn.turn)=="number"?(Un=l[ae.warm.turn])==null?void 0:Un.userItem.turnStartedAtIso:void 0);if(!Me)return null;const Le=Date.parse(Me);return Number.isFinite(Le)?Le:null},ce=ba(V.map(ae=>({key:ae.key,timestampMs:ne(ae)})));if(ce.size===0)return V;for(const ae of V){if(!ce.has(ae.key))continue;const Me=ne(ae);Me!==null&&(ae.timeDividerLabel=$a(Me,{translate:G}))}return V}const g=new Map,Z=[];for(const V of i.messages){if(!rn(V))continue;const ne={from:V.modelSwitchFrom,to:V.modelSwitchTo};if(V.modelSwitchInsertAfterId){const ce=g.get(V.modelSwitchInsertAfterId)??[];ce.push(ne),g.set(V.modelSwitchInsertAfterId,ce)}else Z.push(ne)}function ie(V){const ne=[];for(const ce of V){const ae=g.get(ce.message.id);ae&&ae.length>0&&(ne.push(...ae),g.delete(ce.message.id))}return ne}for(let V=Rt.value;V<Je.value;V+=1){const ne=l[V];if(!ne)continue;const ce={turn:V,userText:ra(ne.userItem.text),assistantPreview:ne.assistantPreview,toolCount:ne.toolCount,expanded:C.has(V)},ae=C.has(V)?t.slice(ne.startIdx,ne.endIdx).map(Le=>({message:Le})):[],Me=ie(t.slice(ne.startIdx,Math.min(ne.endIdx,t.length)).map(Le=>({message:Le})));h.push({key:`warm-${V}`,warm:ce,warmItems:ae,processItems:[],fileChangeAnchorIds:[],...Me.length>0?{dividers:Me}:{}})}const he=Qn(t,l,Je.value),Ge=he[0];if(!Ge)return O(h);const $=t.findIndex(V=>V.id===Ge.id),X=$>=0?t.slice($):he;for(const V of la(X,{liveOverlayActive:i.liveOverlay!==null,liveTurnId:i.liveTurnId})){const ne=V.items.find(re=>re.kind==="user"),ce=V.items.find(re=>re.kind==="final-assistant"),ae=V.items.filter(re=>re!==ne&&re!==ce&&re.message.messageType!=="worked").map(re=>({message:re.message,presentation:re.kind==="plan"?"plan":re.kind==="agent-note"?"agent-note":"process"})),Me=V.items.map(re=>re.message.id).filter(re=>!!xe(re)),Le=ie(V.items);h.push({key:V.key,warmItems:[],request:ne?{message:ne.message}:void 0,processItems:ae,fileChangeAnchorIds:Me,finalItem:ce?{message:ce.message,presentation:"final-assistant"}:void 0,...Le.length>0?{dividers:Le}:{}})}const ee=[...Z,...g.values()].flat();return ee.length>0&&(h.length>0?h[0]={...h[0],leadingDividers:[...h[0].leadingDividers??[],...ee]}:h.push({key:"leading-divider",warmItems:[],processItems:[],fileChangeAnchorIds:[],leadingDividers:ee})),O(h)}),es=_(()=>Vc(i.messages));function ts(t){var h,C;const l=((h=t.request)==null?void 0:h.message.turnId)??((C=t.finalItem)==null?void 0:C.message.turnId);return l?es.value[l]:void 0}function bn(){Re.value=ca(Re.value,i.activeThreadId)}function ns(t){Re.value=Zn(Re.value,i.activeThreadId,t,!Ot.value.has(t))}const Cn=_(()=>je.value.map((t,l)=>({turn:l,text:ua(t.userItem.text)}))),os=_(()=>Math.max(0,Cn.value.length-1)),ss=_(()=>{const t=new Map;return je.value.forEach((l,h)=>{t.set(l.userItem.id,h)}),t});function qt(t){return`question-anchor-${t}`}function as(t){const l=ss.value.get(t.id);if(l!==void 0&&!(l<Je.value))return qt(l)}function is(t){if(t<Je.value){let l=Re.value;if(t<Rt.value){const h=da({turn:t,turnCount:je.value.length,hotTurns:co,pageSize:uo});l=fa(l,i.activeThreadId,h)}l=Zn(l,i.activeThreadId,t,!0),Re.value=l}else{const l=je.value[t];if(l){const h=new Set(dt.value);h.add(`turn-${l.userItem.id}`),dt.value=h}}De.value=!1,Wt(),Mn(),Ae().then(()=>{const l=ve.value,h=document.getElementById(qt(t));if(!l||!h)return;const C=h.getBoundingClientRect(),O=l.getBoundingClientRect(),g=l.scrollTop+C.top-O.top-12;l.scrollTo({top:Math.max(0,g),behavior:"smooth"})})}const rs=_(()=>{const t=Bt.value,l=je.value,h=[];for(let Z=Rt.value;Z<Je.value;Z+=1){if(!Ot.value.has(Z))continue;const ie=l[Z];ie&&h.push(...t.slice(ie.startIdx,ie.endIdx))}const C=Qn(t,l,Je.value),O=C[0];if(!O)return h;const g=t.findIndex(Z=>Z.id===O.id);return h.push(...g>=0?t.slice(g):C),h}),kt=_(()=>Tc(rs.value)),lt=_(()=>{var l;const t=new Map;for(const h of kt.value){const C=((l=h.messages[0])==null?void 0:l.id)??"";C&&t.set(C,h)}return t}),ls=_(()=>{const t=new Set;for(const l of kt.value)for(const h of l.messages)t.add(h.id);return t}),cs=_(()=>{var h;const t=new Set,l=C=>L.value.has(C.id)||be.value.has(C.id);for(const C of kt.value)_c(C,l)&&t.add(((h=C.messages[0])==null?void 0:h.id)??"");return t}),us=_(()=>{const t=new Set;for(const l of kt.value)t.add(l.turnId);return t});function ds(t){return lt.value.has(t.id)}function $n(t){return ls.value.has(t.id)}function fs(t){var l;return((l=lt.value.get(t.id))==null?void 0:l.messages)??[]}function ms(t){return Ll(fs(t))}function hs(t){var l;return t.type==="batch"?`tool-batch-${t.kind}-${((l=t.messages[0])==null?void 0:l.id)??""}`:t.message.id}function gs(t){const l=lt.value.get(t.id);return l?Ic(l,{t:G,formatDuration:zt}):""}function vs(t){var l;return((l=lt.value.get(t.id))==null?void 0:l.running)??!1}function ps(t){var l;return((l=lt.value.get(t.id))==null?void 0:l.hasOutsideContent)??!0}function ys(t){return t.messageType==="worked"}const xn=_(()=>i.hasMorePersistedAbove===!0),Oe=W(null),ct=_(()=>Nt.value.filter(t=>t.warm!==void 0).map(t=>{var l,h,C;return{turn:t.warm!==void 0?t.warm.turn:-1,collapsed:t.warm!==void 0?!t.warm.expanded:!0,hasTimeDivider:t.timeDividerLabel!==void 0,leadingModelSwitchCount:((l=t.leadingDividers)==null?void 0:l.length)??0,trailingModelSwitchCount:((h=t.dividers)==null?void 0:h.length)??0,hasAssistantPreview:(((C=t.warm)==null?void 0:C.assistantPreview)??"").length>0}})),ws=_(()=>{const t=Oe.value;if(!t)return null;const l=ct.value[t.window.first];return l?`warm-${l.turn}`:null}),ks=_(()=>{const t=Oe.value;if(!t)return null;const l=ct.value[t.window.last];return l?`warm-${l.turn}`:null}),bs=_(()=>{var t;return((t=Oe.value)==null?void 0:t.spacers.topMarginPx)??0}),_n=_(()=>{var t;return((t=Oe.value)==null?void 0:t.spacers.bottomSpacerPx)??0}),Cs=_(()=>{const t=Oe.value;if(!t)return null;const l=ct.value,h=new Set;for(let C=t.window.first;C<=t.window.last;C+=1){const O=l[C];O&&h.add(O.turn)}return h});function $s(t){const l=Cs.value;return l===null||l.has(t)}function Vt(t,l){if(!l||t.key!==ws.value)return;const h=bs.value;if(!(h<=0))return{marginTop:`${h}px`}}let Qe=0;function ut(){Qe||(Qe=requestAnimationFrame(()=>{Qe=0,Wt(),Mn()}))}function Wt(){const t=ve.value,l=ct.value;if(!t||l.length===0){Oe.value=null;return}const h=t.querySelector(".conversation-hot-anchor")??t.querySelector("li.conversation-turn");if(!h){Oe.value=null;return}const C=t.getBoundingClientRect(),g=h.getBoundingClientRect().top-C.top+t.scrollTop-(t.scrollTop+t.clientHeight),Z=Number.parseFloat(window.getComputedStyle(t).rowGap),ie=Number.isFinite(Z)&&Z>0?Z:12;Oe.value=Rc({specs:l,gapPx:ie,viewportBottomDistancePx:g,viewportHeightPx:t.clientHeight,overscanPx:Ud})}we([ct,Ht,xn],()=>{Ae(ut)});const Ne=W(null),Ze=W(new Map),dt=W(new Set),Ue=_(()=>Nt.value.filter(t=>t.warm===void 0).map(t=>({key:t.key,measuredHeightPx:Ze.value.get(t.key)}))),xs=_(()=>{var t;return((t=Ue.value[0])==null?void 0:t.key)??null}),_s=_(()=>{const t=Ne.value;if(!t)return null;const l=Ue.value[t.window.first];return l?l.key:null}),Ts=_(()=>{const t=Ne.value;if(!t)return null;const l=Ue.value[t.window.last];return l?l.key:null}),Tn=_(()=>{var t;return((t=Ne.value)==null?void 0:t.spacers.topSpacerPx)??0}),In=_(()=>{var t;return((t=Ne.value)==null?void 0:t.spacers.bottomSpacerPx)??0}),Is=_(()=>{const t=Ne.value;if(!t)return null;const l=new Set(dt.value);for(let h=t.window.first;h<=t.window.last;h+=1){const C=Ue.value[h];C&&l.add(C.key)}return l});function Ms(t){const l=Is.value;return l===null||l.has(t)}function Mn(){const t=ve.value,l=Et.value,h=Ue.value;if(!t||!l||h.length===0){Ne.value=null;return}const C=t.getBoundingClientRect(),O=l.getBoundingClientRect(),g=Number.parseFloat(window.getComputedStyle(t).rowGap),Z=Number.isFinite(g)&&g>0?g:12,ie=O.top-C.top+t.scrollTop-Z;Ne.value=qc({specs:h,gapPx:Z,viewportBottomDistancePx:ie-(t.scrollTop+t.clientHeight),viewportHeightPx:t.clientHeight,overscanPx:Kd,forcedKeys:dt.value})}function Ss(t){const l=ve.value;if(!l)return null;const h=CSS.escape(t),C=Array.from(l.querySelectorAll(`[data-hot-block="${h}"], [data-turn-key="${h}"]`));if(C.length===0)return null;for(const ie of C){const he=ie.querySelectorAll("img");for(const Ge of he)if(!Ge.complete)return null}let O=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;for(const ie of C){const he=ie.getBoundingClientRect();he.top<O&&(O=he.top),he.bottom>g&&(g=he.bottom)}const Z=g-O;return Number.isFinite(Z)&&Z>0?Z:null}let et=0,tt=null;function Sn(t){tt||(tt=new Set);for(const l of t)tt.add(l);et||(et=requestAnimationFrame(()=>{et=0;const l=tt;if(tt=null,!l||l.size===0)return;const h=ve.value;if(!h)return;const C=new Map(Ze.value);let O=!1;for(const g of l){const Z=CSS.escape(g);if(!h.querySelector(`[data-hot-block="${Z}"], [data-turn-key="${Z}"]`))continue;const he=Ss(g);if(he===null){C.delete(g)&&(O=!0);continue}C.get(g)!==he&&(C.set(g,he),O=!0)}O&&(Ze.value=C,Ae(ut))}))}we(Ue,()=>{Ae(ut)}),we(()=>i.activeThreadId,()=>{Ze.value=new Map,dt.value=new Set,Ne.value=null,Ae(ut)});const Ls=_(()=>!De.value&&(i.messages.length>0||i.pendingRequests.length>0||!!i.liveOverlay));function Ln(t){switch(t){case"completed":return"[x]";case"inProgress":return"[~]";default:return"[ ]"}}function As(t){const l=Ao.value[t];typeof l=="number"&&i.activeThreadId&&Pt("forkThread",{threadId:i.activeThreadId,turnIndex:l})}const An=_(()=>{const t={};for(const l of i.messages){if(!ga(l)||typeof l.turnIndex!="number")continue;const h=typeof l.turnId=="string"&&l.turnId.length>0?l.turnId:"";!h||l.text.trim().length===0||(t[l.id]=h)}return t});function Fs(t){return typeof An.value[t.id]=="string"}const qe=W(null),Fn=W(null);function Ps(t){Fn.value=t instanceof HTMLTextAreaElement?t:null}function Es(t){var l;return((l=qe.value)==null?void 0:l.messageId)===t}we(qe,async t=>{if(!t)return;await Ae();const l=Fn.value;l&&(l.focus(),l.setSelectionRange(l.value.length,l.value.length))});function Bs(t){const l=An.value[t];if(!l)return;const h=i.messages.find(C=>C.id===t);!h||h.text.trim().length===0||(qe.value={messageId:t,turnId:l,text:h.text})}function Pn(){qe.value=null}function Ds(){var h;const t=qe.value;if(qe.value=null,!t)return;const l=t.text.trim();!l||l===((h=i.messages.find(C=>C.id===t.messageId))==null?void 0:h.text.trim())||Pt("editMessage",{turnId:t.turnId,text:l})}function En(t,l){fn(t)&&(Be.value={kind:"file-change",summary:t,action:l})}function Bn(t,l){!t||!fn(t)||!l.path||(Be.value={kind:"file-change",summary:t,action:"undo",filePaths:[l.path],filePathLabel:f(l.path)})}function Rs(){const t=Be.value;Be.value=null,t&&Xo(t.summary,t.action,t.filePaths)}function Hs(t,l){t.scrollTop=Ia(to(t),l)}function Os(){const t=ve.value,l=Et.value;!t||!l||Dn(t)||Hs(t,0)}function Dn(t){return _a(to(t))}function Ns(){if(ve.value&&De.value){bt();return}}function bt(){ve.value&&Os()}function Ct(){return De.value}function Rn(){if(!Ct()){wt=0,Ie=0;return}if(bt(),wt-=1,wt<=0){Ie=0;return}Ie=requestAnimationFrame(Rn)}function ft(t=6){Ct()&&(Ie&&(cancelAnimationFrame(Ie),Ie=0),wt=Math.max(t,1),Ie=requestAnimationFrame(Rn))}function Hn(){ft(3)}function On(){De.value=!0,bt(),ft(4)}async function Nn(){var O;const t=ve.value;if(!t||!i.hasMorePersistedAbove||He.value||i.isLoadingPersistedAbove===!0)return;He.value=!0;const l=i.activeThreadId,h=t.scrollHeight,C=t.scrollTop;try{await((O=i.loadEarlierMessages)==null?void 0:O.call(i,l)),await Ae(),i.activeThreadId===l&&(t.scrollTop=C+(t.scrollHeight-h))}finally{He.value=!1}}n({jumpToLatest:On});function qs(){if(!Ct())return;const t=ve.value;if(!t)return;const l=t.querySelectorAll("img.message-image-preview");for(const h of l)h.complete||yn.has(h)||(yn.add(h),h.addEventListener("load",Hn,{once:!0}),h.addEventListener("error",Hn,{once:!0}))}let Se=null,Ke=null;function qn(){const t=ve.value;if(!(!t||!Se))for(const l of Array.from(t.children))Se.observe(l)}function Vn(){Ct()&&ft(2)}function Vs(t){const l=[];for(const h of t){const C=h.target;if(!C.isConnected)continue;if(C===ve.value){Ze.value.size>0&&(Ze.value=new Map,Sn(Ue.value.map(g=>g.key)));continue}const O=C.dataset.hotBlock??C.dataset.turnKey;O&&l.push(O)}l.length>0&&Sn(l),Vn()}function Ws(){if(Se||Ke||typeof ResizeObserver>"u"||typeof MutationObserver>"u")return;const t=ve.value;t&&(Se=new ResizeObserver(Vs),Se.observe(t),qn(),Ke=new MutationObserver(()=>{qn(),Vn()}),Ke.observe(t,{childList:!0}))}function js(){Se==null||Se.disconnect(),Se=null,Ke==null||Ke.disconnect(),Ke=null}async function mt(){return rt||(rt=Ae().then(()=>new Promise(t=>{We&&cancelAnimationFrame(We),We=requestAnimationFrame(()=>{We=0,rt=null,Ns(),Wt(),qs(),ft(),t()})})),rt)}we(()=>i.messages,async t=>{if(i.isLoading)return;const l=new Set(t.filter(h=>h.messageType==="commandExecution"&&h.commandExecution).map(h=>h.id));q(l),Mo(),await mt()}),we(()=>i.messages.some(t=>t.text.includes("```")),t=>{!t||p()||v()},{immediate:!0}),we(()=>i.pendingRequests,async()=>{i.isLoading||await mt()},{deep:!0}),we(()=>i.liveOverlay,async t=>{t&&De.value&&(await Ae(),bt(),ft(8))},{deep:!0}),we(()=>i.isLoading,async()=>{await mt()}),we(()=>i.activeThreadId,async()=>{De.value=!0,pt.value="",He.value=!1,Jo(),Re.value=Xn(i.activeThreadId),await mt()},{flush:"post"}),ta(()=>{Ws(),mt()});function Us(){const t=ve.value;!t||i.isLoading||(De.value=Dn(t),ut(),t.scrollTop<jd&&!He.value&&(Ht.value?bn():i.hasMorePersistedAbove===!0&&Nn()))}const jt=/\.(mp4|m4v|webm|mov|mkv|ogv|ogg|mpeg|avi)$/iu;function $t(t){const l=t.trim();if(!l)return!1;if(l.startsWith("data:video/"))return!0;try{const h=new URL(l,window.location.href);return jt.test(h.pathname)?!0:h.pathname==="/codex-local-image"?jt.test(h.searchParams.get("path")??""):!1}catch{return jt.test(l)}}return Tt(()=>{P(),et&&(cancelAnimationFrame(et),et=0),tt=null,We&&(cancelAnimationFrame(We),We=0),Qe&&(cancelAnimationFrame(Qe),Qe=0),Ie&&(cancelAnimationFrame(Ie),Ie=0),js()}),(t,l)=>(s(),r(N,null,[d("section",{class:"conversation-root","data-thread-id":i.activeThreadId,onContextmenuCapture:l[5]||(l[5]=(...h)=>c(Q)&&c(Q)(...h)),onClick:on,onKeydown:Jn(on,["enter"])},[e.isLoading&&e.messages.length>0?(s(),r("div",Yc,w(c(G)("Loading messages...")),1)):I("",!0),e.isLoading&&e.messages.length===0?(s(),r("p",Xc,w(c(G)("Loading messages...")),1)):I("",!0),e.isSlowOpen?(s(),r("p",Jc,w(c(G)("Still loading — the first open of a large history can take a while.")),1)):I("",!0),e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay&&!e.isSlowOpen?(s(),r("p",Qc,w(c(G)("No messages in this thread yet. Type a message below to get started.")),1)):I("",!0),d("ul",{ref_key:"conversationListRef",ref:ve,class:"conversation-list",onScroll:Us},[xn.value?(s(),r("li",Zc,[d("button",{type:"button",class:"load-more-button",disabled:He.value||e.isLoadingPersistedAbove,onClick:Nn},w(He.value||e.isLoadingPersistedAbove?c(G)("Loading…"):c(G)("Load earlier messages")),9,eu)])):I("",!0),Ht.value?(s(),r("li",tu,[d("button",{type:"button",class:"load-more-button",disabled:He.value,onClick:bn},w(c(G)("Load earlier ({n} turns)",{n:kn.value})),9,nu)])):I("",!0),(s(!0),r(N,null,z(Nt.value,h=>(s(),r(N,{key:h.key},[h.warm===void 0&&h.key===xs.value?(s(),r("li",ou)):I("",!0),h.warm===void 0&&h.key===_s.value&&Tn.value>0?(s(),r("li",{key:1,"aria-hidden":"true",class:"conversation-hot-spacer-top",style:_e({height:`${Tn.value}px`})},null,4)):I("",!0),(h.warm?$s(h.warm.turn):Ms(h.key))?(s(),r(N,{key:2},[h.timeDividerLabel?(s(),r("li",{key:0,class:"conversation-item conversation-item-time-divider","data-role":"system","data-message-type":"timeDivider","data-hot-block":h.key,style:_e(Vt(h,!0))},[te(Er,{label:h.timeDividerLabel},null,8,["label"])],12,su)):I("",!0),(s(!0),r(N,null,z(h.leadingDividers??[],(C,O)=>(s(),r("li",{key:`${h.key}-leading-${C.to??""}-${C.from??""}`,class:"conversation-item conversation-item-model-switch","data-role":"system","data-message-type":"modelSwitch","data-hot-block":h.key,style:_e(Vt(h,!h.timeDividerLabel&&O===0))},[te(oo,{from:C.from,to:C.to},null,8,["from","to"])],12,au))),128)),te(sc,{"turn-key":h.key,warm:h.warm,"warm-items":h.warmItems,request:h.request,"process-items":h.processItems,"final-item":h.finalItem,"file-change-anchor-ids":h.fileChangeAnchorIds,"duration-ms":ts(h)},{"warm-card":ot(({warm:C})=>{var O;return[d("li",{id:qt(C.turn),class:"conversation-item conversation-item-warm-card","data-role":"system","data-message-type":"warmTurn",style:_e(Vt(h,!h.timeDividerLabel&&!((O=h.leadingDividers)!=null&&O.length)))},[d("div",ru,[d("div",lu,[te(dc,{"user-text":C.userText,"assistant-preview":C.assistantPreview,"tool-count":C.toolCount,expanded:C.expanded,onToggle:g=>ns(C.turn)},null,8,["user-text","assistant-preview","tool-count","expanded","onToggle"])])])],12,iu)]}),"file-change":ot(({anchorMessageId:C})=>[d("div",cu,[d("div",uu,[c(tn)(c(xe)(C))?(s(),ue(no,{key:0,summary:c(xe)(C),expanded:c(To)(C),cwd:i.cwd,actionable:c(mn)(c(xe)(C)),"action-status":c(hn)(c(xe)(C)),"action-error-text":c(gn)(c(xe)(C)),"next-action":c(vn)(c(xe)(C)),"action-label":c(pn)(c(xe)(C)),onToggle:O=>c(Io)(C),onOpenDiff:O=>c(vt)(c(xe)(C),O),onRequestAction:O=>En(c(xe)(C),O),onRequestFileAction:O=>Bn(c(xe)(C),O)},null,8,["summary","expanded","cwd","actionable","action-status","action-error-text","next-action","action-label","onToggle","onOpenDiff","onRequestAction","onRequestFileAction"])):I("",!0)])])]),default:ot(({item:C,section:O})=>[(s(!0),r(N,null,z([C.message],g=>{var Z,ie,he,Ge;return s(),r(N,{key:g.id},[ds(g)&&!cs.value.has(g.id)?(s(),r("li",du,[d("div",fu,[d("div",mu,[te(ul,{label:gs(g),running:vs(g),"has-outside-content":ps(g)},{default:ot(()=>[(s(!0),r(N,null,z(ms(g),$=>(s(),r(N,{key:hs($)},[$.type==="batch"?(s(),ue(jl,{key:0,kind:$.kind,messages:$.messages},null,8,["kind","messages"])):(s(!0),r(N,{key:1},z([$.message],X=>(s(),r(N,{key:X.id},[!c(L).has(X.id)&&!c(be).has(X.id)?(s(),r(N,{key:0},[it(X)?(s(),r("div",hu,[(s(!0),r(N,null,z(c(Y)(X),(ee,V)=>(s(),ue(io,{key:`work-cmd-${ee.id}`,command:ee,"step-index":V,expanded:c(x)(ee),compact:c(E)(ee),"output-condensed":c(B)(ee),onToggle:ne=>c(k)(ee)},null,8,["command","step-index","expanded","compact","output-condensed","onToggle"]))),128))])):At(X)?(s(),ue(Jt,{key:1,message:X},null,8,["message"])):St(X)?(s(),ue(ao,{key:2,message:X,expanded:ln(X),"content-html":c(U)(X.text),onToggle:ee=>cn(X)},null,8,["message","expanded","content-html","onToggle"])):I("",!0)],64)):I("",!0)],64))),128))],64))),128))]),_:2},1032,["label","running","has-outside-content"])])])])):!$n(g)&&!c(L).has(g.id)&&!c(be).has(g.id)&&!(ys(g)&&us.value.has(g.turnId??""))&&!Wo(g)?(s(),r("li",{key:1,id:as(g),class:oe(["conversation-item",{"conversation-item-request":O==="request","conversation-item-process":O==="process"||C.presentation==="process","conversation-item-final":O==="final"||C.presentation==="final-assistant","conversation-item-plan":C.presentation==="plan"}]),"data-role":g.role,"data-message-type":g.messageType||""},[sn(g)?(s(),r("div",vu,[d("div",pu,[l[7]||(l[7]=d("span",{class:"thread-compaction-spinner","aria-hidden":"true"},null,-1)),d("span",null,w(c(G)("Compacting thread context…")),1)])])):an(g)?(s(),r("div",yu,[d("div",wu,w(c(G)("Context compacted")),1)])):it(g)?(s(),r("div",ku,[d("div",bu,[d("div",Cu,[(s(!0),r(N,null,z(c(Y)(g),($,X)=>(s(),ue(io,{key:`work-cmd-${$.id}`,command:$,"step-index":X,expanded:c(x)($),compact:c(E)($),"output-condensed":c(B)($),onToggle:ee=>c(k)($)},null,8,["command","step-index","expanded","compact","output-condensed","onToggle"]))),128))])])])):At(g)?(s(),ue(Jt,{key:3,message:g},null,8,["message"])):Ft(g)?(s(),r("div",{key:4,class:"message-row","data-role":g.role,"data-message-type":g.messageType||""},[d("div",{class:"message-stack","data-role":g.role},[d("article",{class:"message-body","data-role":g.role},[c(tn)(c(Te)(g))?(s(),ue(no,{key:0,summary:c(Te)(g),expanded:c(Pe)(g),cwd:i.cwd,actionable:c(mn)(c(Te)(g)),"action-status":c(hn)(c(Te)(g)),"action-error-text":c(gn)(c(Te)(g)),"next-action":c(vn)(c(Te)(g)),"action-label":c(pn)(c(Te)(g)),onToggle:$=>c($e)(g),onOpenDiff:$=>c(vt)(c(Te)(g),$),onRequestAction:$=>En(c(Te)(g),$),onRequestFileAction:$=>Bn(c(Te)(g),$)},null,8,["summary","expanded","cwd","actionable","action-status","action-error-text","next-action","action-label","onToggle","onOpenDiff","onRequestAction","onRequestFileAction"])):I("",!0)],8,_u)],8,xu)],8,$u)):C.presentation==="plan"?(s(),r("div",Tu,[d("div",Iu,[d("article",Mu,[d("div",Su,w(c(G)("Plan")),1),(Z=c(ht)(g))!=null&&Z.explanation?(s(),r("p",Lu,w((ie=c(ht)(g))==null?void 0:ie.explanation),1)):I("",!0),(he=c(ht)(g))!=null&&he.steps.length?(s(),r("ol",Au,[(s(!0),r(N,null,z((Ge=c(ht)(g))==null?void 0:Ge.steps,($,X)=>(s(),r("li",{key:`${g.id}-plan-${X}`,"data-status":$.status},[d("span",Pu,w(Ln($.status)),1),d("span",null,w($.step),1)],8,Fu))),128))])):I("",!0)])])])):C.presentation==="agent-note"?(s(),r("div",Eu,[d("div",Bu,[d("article",Du,[d("div",Ru,w(c(G)("Agent note")),1),d("div",{class:"thread-agent-note-body",innerHTML:c(U)(g.text)},null,8,Hu)])])])):(s(),r("div",{key:7,class:oe(["message-row",{"message-row-final":C.presentation==="final-assistant"}]),"data-role":g.role,"data-message-type":g.messageType||""},[d("div",{class:"message-stack","data-role":g.role},[d("article",{class:"message-body","data-role":g.role},[g.images&&g.images.length>0?(s(),r("ul",{key:0,class:oe(["message-image-list",{"message-generated-image-list":g.messageType==="imageView"}]),"data-role":g.role},[(s(!0),r(N,null,z(g.images,$=>(s(),r("li",{key:$,class:"message-image-item"},[d("button",{class:"message-image-button",type:"button",onClick:X=>c(dn)($)},[$t($)?(s(),r("video",{key:0,class:oe(["message-image-preview message-video-preview",{"message-generated-image-preview":g.messageType==="imageView"}]),src:$,controls:"",preload:"metadata"},null,10,ju)):(s(),r("img",{key:1,class:oe(["message-image-preview",{"message-generated-image-preview":g.messageType==="imageView"}]),src:$,alt:g.messageType==="imageView"?"Generated image":"Message image preview",loading:"lazy"},null,10,Uu))],8,Wu)]))),128))],10,Vu)):I("",!0),g.fileAttachments&&g.fileAttachments.length>0?(s(),r("div",Ku,[(s(!0),r(N,null,z(g.fileAttachments,$=>(s(),r("span",{key:`${g.id}:${$.path}`,class:"message-file-chip"},[l[8]||(l[8]=d("span",{class:"message-file-chip-icon"},"📄",-1)),d("a",{class:"message-file-link message-file-chip-name",href:c(y)($.path),target:"_blank",rel:"noopener noreferrer",title:$.path},w($.label),9,Gu)]))),128))])):I("",!0),g.imageAttachmentIds&&g.imageAttachmentIds.length>0?(s(),r("div",zu,[(s(!0),r(N,null,z(g.imageAttachmentIds,$=>(s(),r("span",{key:`${g.id}:${$}`,class:"message-file-chip message-image-attachment-chip",title:$},[l[9]||(l[9]=d("span",{class:"message-file-chip-icon"},"🖼",-1)),d("span",Xu,w(c(G)("Image attachment (preview unavailable)")),1)],8,Yu))),128))])):I("",!0),g.skills&&g.skills.length>0?(s(),r("div",Ju,[(s(!0),r(N,null,z(g.skills,$=>(s(),r("a",{key:`${g.id}:${$.path}`,class:"message-skill-chip",href:c(y)($.path),title:$.path},[d("span",Zu,w(c(G)("Skill")),1),d("span",ed,w($.name),1)],8,Qu))),128))])):I("",!0),g.audioSources&&g.audioSources.length>0?(s(),r("div",td,[(s(!0),r(N,null,z(g.audioSources,($,X)=>(s(),r("audio",{key:`${g.id}:audio:${X}`,class:"message-audio-player",controls:"",preload:"metadata",src:$},null,8,nd))),128))])):I("",!0),g.mentions&&g.mentions.length>0?(s(),r("div",od,[(s(!0),r(N,null,z(g.mentions,$=>(s(),r("span",{key:`${g.id}:mention:${$.name}:${$.path}`,class:"message-file-chip message-mention-chip",title:$.path||$.name},[l[10]||(l[10]=d("span",{class:"message-file-chip-icon"},"@",-1)),d("span",ad,w($.name),1)],8,sd))),128))])):I("",!0),g.text.length>0?(s(),r("article",{key:6,class:"message-card","data-role":g.role},[g.isAutomationRun?(s(),r("div",rd,[l[11]||(l[11]=d("span",null,"Sent via automation",-1)),g.automationDisplayName?(s(),r("code",ld,w(g.automationDisplayName),1)):I("",!0)])):I("",!0),g.messageType==="worked"?(s(),r("div",cd,[d("p",ud,w(g.text),1)])):St(g)?(s(),ue(ao,{key:2,message:g,expanded:ln(g),"content-html":c(U)(g.text),onToggle:$=>cn(g)},null,8,["message","expanded","content-html","onToggle"])):na([g.id,g.text,i.cwd,c(u),c(Ko)],()=>(s(),r("div",{key:3,class:"message-text-flow"},[(s(!0),r(N,null,z(c(S)(g),($,X)=>(s(),r(N,{key:`block-${X}`},[$.kind==="paragraph"?(s(),r("p",dd,[te(nt,{segments:c(M)($.value),"to-browse-url":c(y)},null,8,["segments","to-browse-url"])])):$.kind==="heading"?(s(),ue(oa(c(po)($.level)),{key:1,class:oe(["message-heading",c(yo)($.level)])},{default:ot(()=>[te(nt,{segments:c(M)($.value),"to-browse-url":c(y)},null,8,["segments","to-browse-url"])]),_:2},1032,["class"])):$.kind==="blockquote"?(s(),r("blockquote",fd,[te(nt,{segments:c(M)($.value),"to-browse-url":c(y)},null,8,["segments","to-browse-url"])])):$.kind==="unorderedList"?(s(),r("ul",md,[(s(!0),r(N,null,z($.items,(ee,V)=>(s(),r("li",{key:`ul-${X}-${V}`,class:"message-list-item"},[d("div",{class:"message-list-item-content",innerHTML:c(R)(ee)},null,8,hd)]))),128))])):$.kind==="taskList"?(s(),r("ul",gd,[(s(!0),r(N,null,z($.items,(ee,V)=>(s(),r("li",{key:`task-${X}-${V}`,class:"message-task-item"},[d("span",{class:"message-task-checkbox","data-checked":ee.checked},w(ee.checked?"☑":"☐"),9,vd),d("div",pd,[te(nt,{segments:c(M)(ee.text),"to-browse-url":c(y)},null,8,["segments","to-browse-url"])])]))),128))])):$.kind==="orderedList"?(s(),r("ol",{key:5,class:"message-list message-list-ordered",start:$.start},[(s(!0),r(N,null,z($.items,(ee,V)=>(s(),r("li",{key:`ol-${X}-${V}`,class:"message-list-item"},[d("div",{class:"message-list-item-content",innerHTML:c(R)(ee)},null,8,wd)]))),128))],8,yd)):$.kind==="table"?(s(),r("div",kd,[d("table",bd,[d("thead",null,[d("tr",null,[(s(!0),r(N,null,z($.headers,(ee,V)=>(s(),r("th",{key:`th-${X}-${V}`,class:"message-table-head-cell",style:_e({textAlign:$.alignments[V]??"left"})},[te(nt,{segments:c(M)(ee),"to-browse-url":c(y)},null,8,["segments","to-browse-url"])],4))),128))])]),$.rows.length>0?(s(),r("tbody",Cd,[(s(!0),r(N,null,z($.rows,(ee,V)=>(s(),r("tr",{key:`tr-${X}-${V}`,class:"message-table-body-row"},[(s(!0),r(N,null,z(ee,(ne,ce)=>(s(),r("td",{key:`td-${X}-${V}-${ce}`,class:"message-table-cell",style:_e({textAlign:$.alignments[ce]??"left"})},[te(nt,{segments:c(M)(ne),"to-browse-url":c(y)},null,8,["segments","to-browse-url"])],4))),128))]))),128))])):I("",!0)])])):$.kind==="codeBlock"?(s(),r("div",$d,[d("div",xd,[$.language?(s(),r("span",_d,w($.language),1)):I("",!0),d("span",Td,w(c(G)("Copy")),1)]),d("pre",Id,[d("code",{class:"hljs",innerHTML:c(J)($.language,$.value)},null,8,Md)])])):$.kind==="thematicBreak"?(s(),r("hr",Sd)):c(Go)(g.id,X)?(s(),r("p",Ld,w($.markdown),1)):(s(),r("button",{key:10,class:"message-image-button",type:"button",onClick:ee=>c(dn)($.url)},[$t($.url)?(s(),r("video",{key:0,class:"message-image-preview message-video-preview message-markdown-image",src:$.url,controls:"",preload:"metadata"},null,8,Fd)):(s(),r("img",{key:1,class:"message-image-preview message-markdown-image",src:$.url,alt:$.alt||"Embedded message image",loading:"lazy",onError:ee=>c(zo)(g.id,X)},null,40,Pd))],8,Ad))],64))),128))])),l,0),Vo(g)?(s(),r("a",{key:4,class:"turn-error-feedback",href:c(nn),onClick:$=>qo($,g.text)},w(c(G)("Send feedback")),9,Ed)):I("",!0)],8,id)):I("",!0),O!=="process"?(s(),ue(nl,{key:7,role:g.role,"show-edit":Fs(g),"show-fork":c(Bo)(g),"show-copy":c(Fo)(g)||c(Po)(g),copied:c(Lo)===g.id,timestamp:No(g.turnStartedAtIso),onEdit:$=>Bs(g.id),onFork:$=>As(g.id),onCopy:$=>g.role==="user"?c(Eo)(g.id):c(Do)(g.id)},null,8,["role","show-edit","show-fork","show-copy","copied","timestamp","onEdit","onFork","onCopy"])):I("",!0),Es(g.id)?(s(),r("div",Bd,[sa(d("textarea",{ref_for:!0,ref:Ps,"onUpdate:modelValue":l[1]||(l[1]=$=>qe.value.text=$),class:"message-inline-editor-textarea",rows:"3",onKeydown:Jn(Ye(Pn,["prevent"]),["esc"])},null,40,Dd),[[aa,qe.value.text]]),d("div",Rd,[d("button",{type:"button",class:"message-inline-editor-button message-inline-editor-primary",onClick:Ds},w(c(G)("Save")),1),d("button",{type:"button",class:"message-inline-editor-button",onClick:Pn},w(c(G)("Cancel")),1)]),d("p",Hd,w(c(G)("Saving rolls this turn back and resends it with your changes. Later replies will be removed.")),1)])):I("",!0)],8,qu)],8,Nu)],10,Ou))],10,gu)):I("",!0)],64)}),128))]),_:2},1032,["turn-key","warm","warm-items","request","process-items","final-item","file-change-anchor-ids","duration-ms"]),(s(!0),r(N,null,z(h.dividers??[],C=>(s(),r("li",{key:`${h.key}-divider-${C.to??""}-${C.from??""}`,class:"conversation-item conversation-item-model-switch","data-role":"system","data-message-type":"modelSwitch","data-hot-block":h.key},[te(oo,{from:C.from,to:C.to},null,8,["from","to"])],8,Od))),128)),h.key===ks.value&&_n.value>0?(s(),r("li",{key:1,class:"conversation-warm-spacer-bottom",style:_e({height:`${_n.value}px`}),"aria-hidden":"true"},null,4)):I("",!0),h.warm===void 0&&h.key===Ts.value&&In.value>0?(s(),r("li",{key:2,"aria-hidden":"true",class:"conversation-hot-spacer-bottom",style:_e({height:`${In.value}px`})},null,4)):I("",!0)],64)):I("",!0)],64))),128)),e.liveOverlay?(s(),ue(Ir,{key:2,overlay:e.liveOverlay,"feedback-mailto":c(nn)},null,8,["overlay","feedback-mailto"])):I("",!0),d("li",{ref_key:"bottomAnchorRef",ref:Et,class:"conversation-bottom-anchor"},null,512)],544),te(vl,{anchors:Cn.value,"active-turn":os.value,onJump:is},null,8,["anchors","active-turn"]),Ls.value?(s(),r("button",{key:4,type:"button",class:"jump-to-latest-button",title:c(G)("Jump to latest"),"aria-label":c(G)("Jump to latest output"),onClick:On},[te(ia,{class:"icon-svg jump-to-latest-icon"})],8,Nd)):I("",!0),c(pt).length>0?(s(),r("div",{key:5,class:"image-modal-backdrop",onClick:l[4]||(l[4]=(...h)=>c(yt)&&c(yt)(...h))},[d("div",{class:"image-modal-content",onClick:l[3]||(l[3]=Ye(()=>{},["stop"]))},[d("button",{class:"image-modal-close",type:"button","aria-label":c(G)("Close image preview"),onClick:l[2]||(l[2]=(...h)=>c(yt)&&c(yt)(...h))},[te(ho,{class:"icon-svg"})],8,qd),c(Uo)?(s(),r("video",{key:0,class:"image-modal-image",src:c(pt),controls:"",autoplay:""},null,8,Vd)):(s(),r("img",{key:1,class:"image-modal-image",src:c(pt),alt:c(G)("Expanded message image")},null,8,Wd))])])):I("",!0),te(cr,{visible:c(Xe),x:c(at),y:c(T),"browse-url":c(A),"edit-url":c(H),onClose:c(de)},null,8,["visible","x","y","browse-url","edit-url","onClose"]),te(qi,{change:c(Ce),changes:c(me),lines:c(j),"is-mobile":c(D),"is-file-list-open":c(fe),cwd:i.cwd,onClose:c(Ee),onSelectChange:c(_o),onToggleFileList:c($o),onCloseFileList:c(xo)},null,8,["change","changes","lines","is-mobile","is-file-list-open","cwd","onClose","onSelectChange","onToggleFileList","onCloseFileList"])],40,zc),te(ni,{visible:Be.value!==null,title:Qo.value,message:Zo.value,"confirm-label":"Confirm",danger:"",onConfirm:Rs,onCancel:l[6]||(l[6]=h=>Be.value=null)},null,8,["visible","title","message"])],64))}}),Xd=se(Gd,[["__scopeId","data-v-5117b412"]]);export{Xd as default};