codex-mobile-re 0.1.119 → 0.1.121
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.
- package/README.md +214 -214
- package/dist/assets/{AutomationsPanel-CxjvFbfc.js → AutomationsPanel-Dx0KVoCE.js} +1 -1
- package/dist/assets/{AutomationsPanel-VRBbmMYW.css → AutomationsPanel-ulx5N8pM.css} +1 -1
- package/dist/assets/{DirectoryHub-DmZLEiwB.css → DirectoryHub-BOBZNd77.css} +1 -1
- package/dist/assets/DirectoryHub-BOPhx2Of.js +2 -0
- package/dist/assets/{QueuedMessages-D-8W4gcK.js → QueuedMessages-Dq60IlFJ.js} +1 -1
- package/dist/assets/{ReviewPane-ZrWfZEd_.css → ReviewPane-B8ZRIB5L.css} +1 -1
- package/dist/assets/{ReviewPane-Be2UtBz_.js → ReviewPane-UleDl12M.js} +1 -1
- package/dist/assets/{RightFilePreview-uQztLDUY.js → RightFilePreview-Baikjk70.js} +1 -1
- package/dist/assets/{RightFilesPanel-l-aqQaW6.css → RightFilesPanel-BB__afAJ.css} +1 -1
- package/dist/assets/{RightFilesPanel-CY7PX2sN.js → RightFilesPanel-DNsqEfsl.js} +1 -1
- package/dist/assets/{RightGitPanel-F4KEU11C.js → RightGitPanel-D5vGDcb7.js} +2 -2
- package/dist/assets/{SettingsDialog-CfChVi0L.css → SettingsDialog-CSepwxFJ.css} +1 -1
- package/dist/assets/{SettingsDialog-BXgykQJ7.js → SettingsDialog-eR-iNCMC.js} +3 -3
- package/dist/assets/ThreadConversation-9lNMJVzu.js +39 -0
- package/dist/assets/{ThreadConversation-DkD0ZJIg.css → ThreadConversation-BFwLGxZ1.css} +1 -1
- package/dist/assets/ThreadPendingRequestPanel-BVMOch66.js +1 -0
- package/dist/assets/{ThreadTerminalPanel-CHuA4GMX.js → ThreadTerminalPanel-ClNIUPAl.js} +1 -1
- package/dist/assets/index-BBn90yC5.js +83 -0
- package/dist/assets/{index-Xx6RYcTM.css → index-UrMf1oyy.css} +1 -1
- package/dist/index.html +2 -2
- package/dist-cli/index.js +430 -137
- package/dist-cli/index.js.map +1 -1
- package/package.json +94 -94
- package/dist/assets/DirectoryHub-TQgBZjYj.js +0 -2
- package/dist/assets/ThreadConversation-C4Up0abe.js +0 -39
- package/dist/assets/ThreadPendingRequestPanel-Csyl1ur1.js +0 -1
- package/dist/assets/index-BFbeARme.js +0 -83
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{e as P,f as d,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,
|
|
2
|
-
`)}return(l,c)=>e.snapshots.length>0?(d(),r("aside",X,[(d(!0),r(C,null,w(e.snapshots,g=>(d(),r("div",{key:o(g),class:"rate-limit-card",title:V(g)},[t("div",z,[t("span",J,s(h(g)),1),g.planType?(d(),r("span",Y,s(u(g.planType)),1)):m("",!0)]),t("div",_,[(d(!0),r(C,null,w(R(g),y=>(d(),r("span",{key:y.key,class:"rate-limit-card-metric"},s(y.label),1))),128))]),x(g).length>0?(d(),r("div",ee,s(x(g).join(" | ")),1)):m("",!0)],8,j))),128))])):m("",!0)}}),ne=K(te,[["__scopeId","data-v-1fd5e1ec"]]),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"},ce={class:"sidebar-settings-account-title"},de={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)=>(d(),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",ce,s(n(b)("Accounts")),1),t("span",de,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):(d(),r(C,{key:0},[e.accountActionError?(d(),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?(d(),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?(d(),r("p",ve,s(n(b)("Click Login, or run `codex login`, then click reload.")),1)):(d(),r("div",ye,[(d(!0),r(C,null,w(e.accounts,u=>(d(),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-828a7adf"]]),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"],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"],ct={class:"sidebar-settings-label"},dt={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"},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"],cn={key:0,class:"sidebar-settings-hooks-empty"},dn={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 d(),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")},[(d(),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",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?(d(),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",ct,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?(d(),r("div",dt,[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"?(d(),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?(d(),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)):(d(),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"?(d(),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"?(d(),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?(d(),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?(d(),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?(d(),r(C,{key:1},[e.isHooksLoading?(d(),r("p",dn,s(n(o)("Loading hooks…")),1)):e.hooksList.length===0?(d(),r("p",rn,s(n(o)("No hooks registered.")),1)):(d(),r("div",un,[(d(!0),r(C,null,w(e.hooksList,i=>(d(),r("div",{key:i.cwd||"__global__",class:"sidebar-settings-hooks-entry"},[t("p",gn,s(i.cwd||n(o)("Global")),1),(d(!0),r(C,null,w(i.hooks,(k,L)=>(d(),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)):(d(),r("p",cn,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?(d(),r(C,{key:1},[e.remoteControlError?(d(),r("p",An,s(e.remoteControlError),1)):m("",!0),e.remoteControlNotice?(d(),r("p",Sn,s(e.remoteControlNotice),1)):m("",!0),e.isRemoteControlLoading?(d(),r("p",Fn,s(n(o)("Loading…")),1)):(d(),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?(d(),r("p",Tn,s(n(o)("No paired devices.")),1)):m("",!0),(d(!0),r(C,null,w(e.remoteControlStatus.clients,i=>(d(),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)):(d(),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)])])}}}),
|
|
1
|
+
import{e as P,f as d,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,a3 as M,az as E,X as $,a1 as T,T as X,r as q}from"./index-BBn90yC5.js";const Q={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 c,g;return((c=l.limitId)==null?void 0:c.trim())||((g=l.limitName)==null?void 0:g.trim())||"__default__"}function h(l){var c,g;return((c=l.limitName)==null?void 0:c.trim())||((g=l.limitId)==null?void 0:g.trim())||b("Rate limits")}function u(l){const c=l.trim();return c?c.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 c=Math.max(0,Math.min(100,100-l));return`${Math.round(c)}% ${b("left")}`}function p(l){return`${Math.round(l)}%`}function a(l,c){return{key:c,label:`${v(l.windowDurationMins)} ${I(l.usedPercent)}`}}function R(l){const c=[];return l.primary&&c.push(a(l.primary,"primary")),l.secondary&&c.push(a(l.secondary,"secondary")),c}function i(l){if(!l)return"";const c=new Date(l*1e3),g=c.getMonth()+1,y=String(c.getDate()).padStart(2,"0"),A=String(c.getHours()).padStart(2,"0"),S=String(c.getMinutes()).padStart(2,"0");return`${g}.${y} ${A}:${S}`}function k(l){if(!(l!=null&&l.resetsAt))return"";const c=l.resetsAt*1e3-Date.now();if(c<=0)return b("Resetting now");const g=Math.round(c/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(c=>c!==null)}function O(l){const c=L(l);return c.length===0?null:[...c].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 c=L(l);if(c.length===0)return"";const g=[...c].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 c=l.credits;return c?c.unlimited?b("Unlimited credits"):c.balance?`${b("Credits")} ${c.balance}`:c.hasCredits?b("Credits available"):"":""}function x(l){return[k(O(l)),N(l),G(l)].filter(c=>c.length>0)}function V(l){const c=[h(l)];for(const g of R(l))c.push(g.label);for(const g of L(l))c.push(`${v(g.windowDurationMins)} used ${p(g.usedPercent)}`);for(const g of x(l))c.push(g);return c.join(`
|
|
2
|
+
`)}return(l,c)=>e.snapshots.length>0?(d(),r("aside",Q,[(d(!0),r(C,null,w(e.snapshots,g=>(d(),r("div",{key:o(g),class:"rate-limit-card",title:V(g)},[t("div",z,[t("span",J,s(h(g)),1),g.planType?(d(),r("span",Y,s(u(g.planType)),1)):m("",!0)]),t("div",_,[(d(!0),r(C,null,w(R(g),y=>(d(),r("span",{key:y.key,class:"rate-limit-card-metric"},s(y.label),1))),128))]),x(g).length>0?(d(),r("div",ee,s(x(g).join(" | ")),1)):m("",!0)],8,j))),128))])):m("",!0)}}),ne=K(te,[["__scopeId","data-v-1fd5e1ec"]]),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"},ce={class:"sidebar-settings-account-title"},de={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)=>(d(),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",ce,s(n(b)("Accounts")),1),t("span",de,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):(d(),r(C,{key:0},[e.accountActionError?(d(),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?(d(),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?(d(),r("p",ve,s(n(b)("Click Login, or run `codex login`, then click reload.")),1)):(d(),r("div",ye,[(d(!0),r(C,null,w(e.accounts,u=>(d(),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-acc2fdca"]]),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"],Xe={class:"sidebar-settings-label"},qe=["title"],Qe={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"],ct={class:"sidebar-settings-label"},dt={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"},Xt={class:"sidebar-settings-field"},qt={class:"sidebar-settings-field-label"},Qt=["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"],cn={key:0,class:"sidebar-settings-hooks-empty"},dn={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 d(),H(X,{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")},[(d(),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",Xe,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",Qe,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?(d(),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",ct,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?(d(),r("div",dt,[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"?(d(),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?(d(),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)):(d(),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"?(d(),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"?(d(),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?(d(),r("div",Zt,[t("label",Xt,[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,Qt)]),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?(d(),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?(d(),r(C,{key:1},[e.isHooksLoading?(d(),r("p",dn,s(n(o)("Loading hooks…")),1)):e.hooksList.length===0?(d(),r("p",rn,s(n(o)("No hooks registered.")),1)):(d(),r("div",un,[(d(!0),r(C,null,w(e.hooksList,i=>(d(),r("div",{key:i.cwd||"__global__",class:"sidebar-settings-hooks-entry"},[t("p",gn,s(i.cwd||n(o)("Global")),1),(d(!0),r(C,null,w(i.hooks,(k,L)=>(d(),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)):(d(),r("p",cn,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?(d(),r(C,{key:1},[e.remoteControlError?(d(),r("p",An,s(e.remoteControlError),1)):m("",!0),e.remoteControlNotice?(d(),r("p",Sn,s(e.remoteControlNotice),1)):m("",!0),e.isRemoteControlLoading?(d(),r("p",Fn,s(n(o)("Loading…")),1)):(d(),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?(d(),r("p",Tn,s(n(o)("No paired devices.")),1)):m("",!0),(d(!0),r(C,null,w(e.remoteControlStatus.clients,i=>(d(),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)):(d(),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-f5d8bc1b"]]);export{Wn as default};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import{c as E,r as q,g as $o,o as Ct,a as Ut,b as Fn,d as et,e as oe,f as l,h as se,i as f,w as ze,j as m,t as y,n as te,k as P,T as Jn,_ as ne,u as d,F as j,l as Z,m as ye,p as Q,I as Xn,q as xo,s as qe,v as me,x as Te,y as tt,z as Yn,A as To,B as Ee,C as _o,D as Qn,E as Nt,G as Io,H as Lo,J as Mo,K as gt,L as So,M as Ao,N as Fo,O as Po}from"./index-BBn90yC5.js";import{s as Dt}from"./sanitizeHtml-Bd3No2dT.js";function Eo(e){if(!e||/[\r\n]/u.test(e)||e.endsWith("/")||e.endsWith("\\")||/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(e))return!1;const t=e.startsWith("/"),n=/^[A-Za-z]:[\\/]/u.test(e),o=e.startsWith("./")||e.startsWith("../")||e.startsWith("~/");return t||n||o||/^[A-Za-z0-9._@() -]+\.[A-Za-z0-9]{1,12}$/u.test(e)?!0:/^[A-Za-z0-9._@() -]+(?:[\\/][A-Za-z0-9._@() -]+)+$/u.test(e)}function kt(e){return e.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||e}function Ve(e){return e.replace(/\\/gu,"/")}function es(e){if(!e.startsWith("file://"))return e;let t=e.replace(/^file:\/\//u,"");try{t=decodeURIComponent(t)}catch{}return/^\/[A-Za-z]:\//u.test(t)&&(t=t.slice(1)),t}function Bo(e){const t=Ve(e),n=t.match(/^\/Users\/([^/]+)/u);if(n)return`/Users/${n[1]}`;const o=t.match(/^\/home\/([^/]+)/u);return o?`/home/${o[1]}`:""}function Ue(e){const t=Ve(e);if(!t)return t;let n="",o=t;const s=o.match(/^([A-Za-z]:)(\/.*)?$/u);s?(n=`${s[1]}/`,o=(s[2]??"").replace(/^\/+/u,"")):o.startsWith("/")&&(n="/",o=o.slice(1));const a=o.split("/").filter(Boolean),i=[];for(const c of a)if(c!=="."){if(c===".."){i.length>0&&i.pop();continue}i.push(c)}const r=i.join("/");return n?`${n}${r}`.replace(/\/+$/u,"")||n:r||t}function ts(e,t){const n=Ve(es(e.trim()));if(!n)return"";if(n.startsWith("/")||/^[A-Za-z]:\//u.test(n))return Ue(n);if(n.startsWith("~/")){const a=Bo(t);if(a)return Ue(`${a}/${n.slice(2)}`)}const s=Ve(t.trim());return Ue(s?`${s.replace(/\/+$/u,"")}/${n}`:n)}function yt(e){let t=e,n="",o="";const s={"(":")","[":"]","{":"}","<":">",'"':'"',"'":"'","`":"`","“":"”","‘":"’"};for(;t.length>0;){const a=t[0],i=Object.prototype.hasOwnProperty.call(s,a)?s[a]:"";if(!i||!t.endsWith(i))break;n+=a,o+=i,t=t.slice(1,-1)}return{core:t,leading:n,trailing:o}}function nt(e){if(!e)return null;let t=e.trim();t=yt(t).core.trim();let o=null;const s=t.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(s)t=s[1],o=Number(s[2]);else{const a=t.match(/^(.*):(\d+)(?::\d+)?$/u);a&&(t=a[1],o=Number(a[2]))}return t=es(t),Eo(t)?{path:t,line:o}:null}function Pn(e,t,n){let o=0,s=t-1;for(;s>=n&&e[s]==="*";)o+=1,s-=1;return o}function Ro(e,t){let n=0,o=t;for(;o<e.length&&e[o]==="*";)n+=1,o+=1;return n}function ns(e,t,n,o,s){const a=Pn(e,t,o);return a<2?null:Ro(e,n)>=a?{segmentStart:t-a,segmentEnd:n+a,tokenEndTrim:0}:Pn(s,s.length,0)>=a?{segmentStart:t-a,segmentEnd:n,tokenEndTrim:a}:null}function zt(e){const t=e.trim();if(!t.startsWith("[")||!t.endsWith(")"))return null;const n=t.indexOf("]");if(n<=1||t[n+1]!=="(")return null;const o=t.slice(1,n).trim(),s=t.slice(n+2,-1).trim();if(o.includes(`
|
|
2
|
+
`)||s.includes(`
|
|
3
|
+
`))return null;const a=yt(o).core.trim()||o,i=yt(s).core.trim();return i?{label:a,target:i}:null}function wt(e){const t=e.trim().match(/^codex:\/\/threads\/([A-Za-z0-9-]+)$/u);if(!t)return null;if(typeof window>"u")return`/#/thread/${t[1]}`;const n=window.location.pathname.replace(/\/?$/u,"/");return`${window.location.origin}${n}#/thread/${t[1]}`}function ss(e){const t=Math.min(6,Math.max(1,Math.trunc(e)));return`h${String(t)}`}function os(e){switch(Math.min(6,Math.max(1,Math.trunc(e)))){case 1:return"message-heading-h1";case 2:return"message-heading-h2";case 3:return"message-heading-h3";case 4:return"message-heading-h4";case 5:return"message-heading-h5";default:return"message-heading-h6"}}const as={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 le(e){return`${e.path}\0${e.movedToPath??""}`}function Oo(e,t){return e?!t||e===t?e:`${e}
|
|
4
|
+
${t}`.trim():t}function Do(e,t){const n=e.operation==="add"||t.operation==="add"?"add":e.operation==="delete"||t.operation==="delete"?"delete":"update";return{path:t.path||e.path,operation:n,movedToPath:t.movedToPath??e.movedToPath??null,diff:Oo(e.diff,t.diff),addedLineCount:e.addedLineCount+t.addedLineCount,removedLineCount:e.removedLineCount+t.removedLineCount}}function Ho(e,t){const n=e.operation==="add"?0:e.operation==="update"?1:2,o=t.operation==="add"?0:t.operation==="update"?1:2;if(n!==o)return n-o;const s=`${e.path}\0${e.movedToPath??""}`,a=`${t.path}\0${t.movedToPath??""}`;return s.localeCompare(a)}function Ht(e){const t=new Map;for(const n of e){const o=`${n.path}\0${n.movedToPath??""}`,s=t.get(o);t.set(o,s?Do(s,n):{...n})}return Array.from(t.values()).sort(Ho)}function en(e,t){return e.operation==="update"&&e.movedToPath?e.addedLineCount>0||e.removedLineCount>0?t("Moved + edited"):t("Moved"):e.operation==="add"?t("Added"):e.operation==="delete"?t("Deleted"):t("Edited")}function Wo(e){return e.operation==="update"&&e.movedToPath?"→":e.operation==="add"?"+":e.operation==="delete"?"−":"M"}function Vt(e){return e.operation==="update"&&e.movedToPath?"move":e.operation}function Re(e){const t=[];return e.addedLineCount>0&&t.push(`+${e.addedLineCount}`),e.removedLineCount>0&&t.push(`-${e.removedLineCount}`),t.join(" ")}function is(e,t,n=""){const o=[];return e>0&&o.push({tone:"add",label:`+${e}`}),t>0&&o.push({tone:"remove",label:`-${t}`}),o.length>0?o:n?[{tone:"neutral",label:n}]:[]}function jo(e){return is(e.addedLineCount,e.removedLineCount)}function rs(e,t){return e===1?`1 ${t("file changed")}`:`${e} ${t("files changed")}`}function qo(e,t){if(!e||e.changes.length===0)return"";let n=0,o=0,s=0,a=0;for(const r of e.changes){if(r.operation==="add"){n+=1;continue}if(r.operation==="delete"){o+=1;continue}if(r.movedToPath){a+=1;continue}s+=1}const i=[];return s>0&&i.push(`${s} ${t("edited")}`),n>0&&i.push(`${n} ${t("added")}`),o>0&&i.push(`${o} ${t("deleted")}`),a>0&&i.push(`${a} ${t("moved")}`),i.join(", ")}function Uo(e,t){if(!e||e.changes.length===0)return t("Modified files");const n=rs(e.changes.length,t),o=qo(e,t);return o?`${n} · ${o}`:n}function No(e){if(!e||e.changes.length===0)return[];const t=e.changes.reduce((s,a)=>s+a.addedLineCount,0),n=e.changes.reduce((s,a)=>s+a.removedLineCount,0),o=e.changes.some(s=>s.movedToPath)?"Moved":"Ready";return is(t,n,o)}function Ke(e,t){const n=ts(e,t),o=Ue(Ve(t.trim())),s=Ue(Ve(n));return o&&s.startsWith(`${o}/`)?s.slice(o.length+1):e}function zo(e,t,n){if(!e||e.changes.length===0)return"";const o=e.changes.map(s=>{const a=Ke(s.path,t),i=s.movedToPath?` -> ${Ke(s.movedToPath,t)}`:"",r=Re(s);return`- ${en(s,n)}: ${a}${i}${r?` (${r})`:""}`});return`${n("Modified files")}:
|
|
5
|
+
${o.join(`
|
|
6
|
+
`)}`.trim()}function Vo(e){var o;const n=((o=(e.movedToPath||e.path).split(".").pop())==null?void 0:o.toLowerCase())??"";return as[n]??n??""}function Ko(e){return e.operation==="update"&&/^diff --git |^@@ |^--- |^\+\+\+ |^[ +-]|^\*\*\* (Move to:|End of File)/mu.test(e.diff)}function Go(e){const t=e.diff.replace(/\r\n/g,`
|
|
7
|
+
`),n=t.length>0?t.split(`
|
|
8
|
+
`):[];return n.length>0&&n[n.length-1]===""&&n.pop(),n.map((o,s)=>({key:`${le(e)}:synthetic:${s}`,kind:e.operation==="delete"?"remove":"add",oldLine:e.operation==="delete"?s+1:null,newLine:e.operation==="delete"?null:s+1,text:o}))}function Zo(e){const t=e.diff.replace(/\r\n/g,`
|
|
9
|
+
`),n=t.length>0?t.split(`
|
|
10
|
+
`):[];n.length>0&&n[n.length-1]===""&&n.pop();const o=[];let s=0,a=0;for(const[i,r]of n.entries()){const c=r.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/u);if(c){s=Number(c[1]),a=Number(c[2]),o.push({key:`${le(e)}:hunk:${i}`,kind:"hunk",oldLine:null,newLine:null,text:r});continue}if(r.startsWith("+")&&!r.startsWith("+++")){o.push({key:`${le(e)}:add:${i}`,kind:"add",oldLine:null,newLine:a,text:r.slice(1)}),a+=1;continue}if(r.startsWith("-")&&!r.startsWith("---")){o.push({key:`${le(e)}:remove:${i}`,kind:"remove",oldLine:s,newLine:null,text:r.slice(1)}),s+=1;continue}if(r.startsWith(" ")){o.push({key:`${le(e)}:context:${i}`,kind:"context",oldLine:s,newLine:a,text:r.slice(1)}),s+=1,a+=1;continue}o.push({key:`${le(e)}:meta:${i}`,kind:"meta",oldLine:null,newLine:null,text:r})}return o}function Jo(e){return!e||!e.diff.trim()?[]:Ko(e)?Zo(e):Go(e)}function Xo(e){return!!(e!=null&&e.diff.trim())}function Yo(e){return e.kind==="add"?"+":e.kind==="remove"?"-":e.kind==="hunk"?"@@":""}function Qo(e,t){if(e.size===0)return e;const n=new Set;for(const o of e)t.has(o)&&n.add(o);return n.size===e.size?e:n}function ea(e){const{getMessages:t,getLiveTurnId:n,isFileChangeMessage:o,isCopyableAssistantMessage:s,isReasoningMessage:a,isPlanMessage:i,isFoldMember:r,getHiddenGroupedCommandIds:c,isMobile:h}=e,g=q(new Set),x=q(null),F=q(""),C=q(!1),S=E(()=>{var re,pe;const D=new Map,z=new Map,ce=new Map,ge=N=>!o(N)&&!a(N)&&!i(N)&&!c().has(N.id)&&!r(N);for(const N of t()){const ve=typeof N.turnIndex=="number"?`turn:${N.turnIndex}`:`message:${N.id}`;if(ge(N)&&D.set(ve,N.id),s(N)&&typeof N.turnIndex=="number"&&Array.isArray(N.fileChanges)&&N.fileChanges.length>0&&z.set(N.id,{changes:Ht(N.fileChanges),sourceMessageIds:[],source:"assistant",turnId:N.turnId??""}),!o(N))continue;const Le=ce.get(ve);Le?Le.push(N):ce.set(ve,[N])}const ie={};for(const[N,ve]of ce.entries()){const Le=D.get(N);if(!Le)continue;const at=((re=z.get(Le))==null?void 0:re.turnId)??"";ie[Le]={changes:Ht(ve.flatMap(Me=>Me.fileChanges??[])),sourceMessageIds:ve.map(Me=>Me.id),source:"metadata",turnId:((pe=ve.find(Me=>typeof Me.turnId=="string"&&Me.turnId.length>0))==null?void 0:pe.turnId)??at}}for(const[N,ve]of z.entries())ie[N]||(ie[N]=ve);return ie}),w=E(()=>{var ge;const D=new Map,z=new Set;for(const ie of Object.values(S.value))for(const re of ie.sourceMessageIds)z.add(re);for(const ie of t()){if(!o(ie))continue;const re=typeof ie.turnIndex=="number"?`turn:${ie.turnIndex}`:`message:${ie.id}`,pe=D.get(re);pe?pe.push(ie):D.set(re,[ie])}const ce={};for(const[ie,re]of D.entries()){if(re.some(N=>z.has(N.id)))continue;const pe=re[re.length-1];pe&&(ce[pe.id]={changes:Ht(re.flatMap(N=>N.fileChanges??[])),sourceMessageIds:re.map(N=>N.id),source:"metadata",turnId:pe.turnId??((ge=re.find(N=>typeof N.turnId=="string"&&N.turnId.length>0))==null?void 0:ge.turnId)??""})}return ce}),v=E(()=>{const D=new Set;for(const z of Object.values(S.value))for(const ce of z.sourceMessageIds)D.add(ce);for(const[z,ce]of Object.entries(w.value))for(const ge of ce.sourceMessageIds)ge!==z&&D.add(ge);return D}),$=E(()=>{var D;return((D=x.value)==null?void 0:D.changes)??[]}),b=E(()=>{const D=$.value;return D.length===0?null:D.find(z=>le(z)===F.value)??D[0]}),L=E(()=>Jo(b.value));function I(D){const z=new Set(g.value);z.has(D.id)?z.delete(D.id):z.add(D.id),g.value=z}function B(D){return g.value.has(D.id)}function R(D,z){D&&(x.value=D,F.value=le(z),C.value=!1)}function U(){x.value=null,F.value="",C.value=!1}function ee(){C.value=!C.value}function V(){C.value=!1}function fe(D){F.value=le(D),h()&&(C.value=!1)}function Oe(D){return S.value[D]??null}function Ge(D){return g.value.has(D)}function T(D){const z=t().find(ce=>ce.id===D);z&&I(z)}function A(D){return Oe(D.id)}function H(D){return w.value[D.id]??null}function J(D){if(!D)return!1;const z=n();return z?(D.turnId??"")!==z:!0}function ae(){const D=new Set([...Object.keys(S.value),...Object.keys(w.value)]);g.value=Qo(g.value,D)}return{anchoredFileChangeSummaryByAnchorId:S,standaloneFileChangeSummaryByMessageId:w,hiddenFileChangeMessageIds:v,isDiffViewerFileListOpen:C,diffViewerChanges:$,activeDiffViewerChange:b,activeDiffViewerLines:L,toggleFileChangeSummary:I,isFileChangeSummaryExpanded:B,openDiffViewer:R,closeDiffViewer:U,toggleDiffViewerFileList:ee,closeDiffViewerFileList:V,selectDiffViewerChange:fe,readAnchoredFileChangeSummaryById:Oe,isFileChangeSummaryExpandedById:Ge,toggleFileChangeSummaryById:T,readAnchoredFileChangeSummary:A,readStandaloneFileChangeSummary:H,isFileChangeSummaryVisible:J,pruneFileChangeSummaryIds:ae}}function ta(e){const{getMessages:t,isCopyableAssistantMessage:n,isPlanMessage:o,planStepCopyMarker:s,buildFileChangeCopyText:a,getAnchoredFileChangeSummaries:i}=e,r=q("");let c=null;function h(L){var R;const I=et(L);if(!I)return"";const B=[];return(R=I.explanation)!=null&&R.trim()&&B.push(I.explanation.trim()),I.steps.length>0&&B.push(I.steps.map(U=>`- ${s(U.status)} ${U.step}`.trim()).join(`
|
|
11
|
+
`)),B.join(`
|
|
12
|
+
|
|
13
|
+
`).trim()}function g(L){const I=[],B=L.text.trim()||h(L),R=o(L)&&B?`Plan
|
|
14
|
+
${B}`:B;R&&I.push(R);const U=(L.fileAttachments??[]).map(V=>V.path.trim()).filter(V=>V.length>0);U.length>0&&I.push(`Files:
|
|
15
|
+
${U.join(`
|
|
16
|
+
`)}`);const ee=(L.images??[]).map(V=>V.trim()).filter(V=>V.length>0);return ee.length>0&&I.push(`Images:
|
|
17
|
+
${ee.join(`
|
|
18
|
+
`)}`),I.join(`
|
|
19
|
+
|
|
20
|
+
`).trim()}const x=E(()=>{var B;const L=new Map;for(const R of t()){if(!n(R))continue;const U=g(R);if(!U)continue;const ee=typeof R.turnIndex=="number"?`turn:${R.turnIndex}`:`message:${R.id}`,V=L.get(ee);if(V){V.anchorMessageId=R.id,V.parts.push(U);continue}L.set(ee,{anchorMessageId:R.id,parts:[U]})}const I={};for(const R of L.values()){const U=R.parts.join(`
|
|
21
|
+
|
|
22
|
+
`).trim();U&&(I[R.anchorMessageId]=U)}for(const[R,U]of Object.entries(i())){if(U.source!=="metadata")continue;const ee=a(U);if(!ee)continue;const V=(B=I[R])==null?void 0:B.trim();I[R]=V?`${V}
|
|
23
|
+
|
|
24
|
+
${ee}`:ee}return I}),F=E(()=>{const L=new Map;for(const B of t()){if(!n(B)||typeof B.turnIndex!="number")continue;const R=`turn:${B.turnIndex}`,U=L.get(R);if(U){U.anchorMessageId=B.id,U.turnIndex=B.turnIndex;continue}L.set(R,{anchorMessageId:B.id,turnIndex:B.turnIndex})}const I={};for(const B of L.values())I[B.anchorMessageId]=B.turnIndex;return I});function C(L){return typeof x.value[L.id]=="string"}function S(L){return L.role==="user"&&g(L).length>0}function w(L){r.value=L,c&&clearTimeout(c),c=setTimeout(()=>{r.value===L&&(r.value=""),c=null},1800)}$o()&&Ct(()=>{c&&(clearTimeout(c),c=null)});async function v(L){const I=t().find(U=>U.id===L);if(!I)return;const B=g(I);if(!B)return;let R=!1;try{await Ut(B),R=!0}catch{R=!1}R||(R=Fn(B)),R&&w(L)}function $(L){return typeof F.value[L.id]=="number"}async function b(L){const I=x.value[L]??"";if(!I)return;let B=!1;try{await Ut(I),B=!0}catch{B=!1}B||(B=Fn(I)),B&&w(L)}return{copiedResponseAnchorId:r,copyableResponseContentByAnchorId:x,forkableTurnIndexByAnchorId:F,showCopyResponseButton:C,isCopyableUserMessage:S,copyUserMessage:v,showForkResponseButton:$,copyResponse:b}}function na(e){const{getMessages:t,getLiveOverlay:n,isCommandMessage:o}=e,s=q(new Set),a=E(()=>{var L;const b=t();for(let I=b.length-1;I>=0;I-=1){const B=b[I];if(B.messageType==="commandExecution"&&((L=B.commandExecution)==null?void 0:L.status)==="inProgress")return B.id}return""}),i=E(()=>t().some(b=>b.role==="assistant"&&b.messageType==="agentMessage.live"&&b.text.trim().length>0)),r=E(()=>!!n()||a.value.length>0||i.value),c=E(()=>{const b=t(),L={};for(let I=0;I<b.length;){const B=b[I];if(!o(B)){I+=1;continue}const R=[];for(;I<b.length&&o(b[I]);)R.push(b[I]),I+=1;if(R.length<=1)continue;const U=R[R.length-1];L[U.id]=R.slice(0,-1)}return L}),h=E(()=>{const b=new Set;for(const L of Object.values(c.value))for(const I of L)b.add(I.id);return b});function g(b){return o(b)&&s.value.has(b.id)}function x(b){return o(b)&&r.value}function F(b){var L;return o(b)&&(r.value||((L=b.commandExecution)==null?void 0:L.status)==="inProgress")}function C(b){if(!o(b))return;const L=new Set(s.value);L.has(b.id)?L.delete(b.id):L.add(b.id),s.value=L}function S(b){return c.value[b.id]??[]}function w(b){return o(b)?[...S(b),b]:[]}function v(b,L){if(b.size===0)return b;const I=new Set;for(const B of b)L.has(B)&&I.add(B);return I.size===b.size?b:I}function $(b){s.value=v(s.value,b)}return{expandedCommandIds:s,activeCommandMessageId:a,hasLiveAssistantText:i,isLiveTurnRuntime:r,groupedCommandsByLatestId:c,hiddenGroupedCommandIds:h,isCommandExpanded:g,isCommandCompact:x,isCommandOutputCondensed:F,toggleCommandExpand:C,getGroupedCommandsForLatest:S,getWorkBlockCommands:w,pruneCommandIdSets:$}}function sa(e){const{getActiveThreadId:t,getCwd:n,onFileChangesChanged:o,updateThreadFileChanges:s,t:a}=e,i=q({}),r=q({}),c=q({});function h($){const b=t();return $!=null&&$.turnId&&b?`thread:${b}:turn:${$.turnId}`:""}function g($){return h($).length>0}function x($){const b=h($);return b?i.value[b]??"idle":"idle"}function F($){const b=h($);return b?r.value[b]??"":""}function C($){const b=x($);return b==="undone"||b==="redoing"?"redo":"undo"}function S($){const b=x($);return b==="undoing"?a("Undoing"):b==="redoing"?a("Redoing"):C($)==="redo"?a("Redo"):a("Undo")}async function w($,b,L){const I=h($),B=t(),R=n();if(!$||!I||!B||!R)return;const U=x($),ee=b==="undo"?"undoing":"redoing";i.value={...i.value,[I]:ee},r.value={...r.value,[I]:""};let V;try{const fe=c.value[I]??[];V=await s(B,$.turnId,R,b,fe.length>0?fe:void 0,"single_turn",L)}catch(fe){i.value={...i.value,[I]:U},r.value={...r.value,[I]:fe instanceof Error?fe.message:a("Failed to update file changes.")};return}if(V.errors.length>0){b==="undo"?(c.value={...c.value,[I]:V.revertedPatchIds??[]},i.value={...i.value,[I]:"undone"}):((V.appliedPatchIds??[]).length>0&&(c.value={...c.value,[I]:V.appliedPatchIds??[]}),i.value={...i.value,[I]:"undone"}),r.value={...r.value,[I]:V.errors.join("; ")};return}if((V.changed??0)<=0){i.value={...i.value,[I]:U},r.value={...r.value,[I]:V.message||a(b==="undo"?"No file changes to undo.":"No file changes to redo.")};return}b==="undo"?(c.value={...c.value,[I]:V.revertedPatchIds??[]},i.value={...i.value,[I]:"undone"}):(c.value={...c.value,[I]:V.appliedPatchIds??[]},i.value={...i.value,[I]:"redone"}),o()}function v(){i.value={},r.value={},c.value={}}return{fileChangeActionState:i,fileChangeActionError:r,fileChangeRedoPatchIds:c,fileChangeActionKey:h,isFileChangeActionable:g,fileChangeActionStatus:x,fileChangeActionErrorText:F,fileChangeNextAction:C,fileChangeActionLabel:S,runFileChangeAction:w,resetFileChangeActions:v}}function oa(e){const{toEditUrlFromBrowseHref:t}=e,n=q(!1),o=q(0),s=q(0),a=q(""),i=q("");function r(h){var C,S;const g=h.target,x=(C=g==null?void 0:g.closest)==null?void 0:C.call(g,"a.message-file-link");if(!x)return;const F=(((S=x.getAttribute)==null?void 0:S.call(x,"href"))??"").trim();!F||F==="#"||(h.preventDefault(),h.stopPropagation(),a.value=F,i.value=t(F),o.value=h.clientX,s.value=h.clientY,n.value=!0)}function c(){n.value&&(n.value=!1)}return{isFileLinkContextMenuVisible:n,fileLinkContextMenuX:o,fileLinkContextMenuY:s,fileLinkContextBrowseUrl:a,fileLinkContextEditUrl:i,handleConversationContextMenu:r,closeFileLinkContextMenu:c}}function aa(e){const{isVideo:t}=e,n=q(""),o=q(!1),s=q(0),a=q(new Set);function i(x,F){return`${x}:${F}`}function r(x,F){return a.value.has(i(x,F))}function c(x,F){const C=new Set(a.value);C.add(i(x,F)),a.value=C,s.value+=1}function h(x){n.value=x,o.value=t(x)}function g(){n.value="",o.value=!1}return{modalImageUrl:n,modalIsVideo:o,markdownImageFailureVersion:s,isMarkdownImageFailed:r,onMarkdownImageError:c,openImageModal:h,closeImageModal:g}}const ia=["aria-label"],ra={class:"confirm-dialog-title"},la={class:"confirm-dialog-message"},ca={class:"confirm-dialog-actions"},ua=oe({__name:"ConfirmDialog",props:{visible:{type:Boolean},title:{},message:{},confirmLabel:{default:""},cancelLabel:{default:""},danger:{type:Boolean,default:!1}},emits:["confirm","cancel"],setup(e){return(t,n)=>(l(),se(Jn,{to:"body"},[e.visible?(l(),f("div",{key:0,class:"confirm-dialog-overlay",onClick:n[2]||(n[2]=ze(o=>t.$emit("cancel"),["self"]))},[m("div",{class:"confirm-dialog-panel",role:"alertdialog","aria-modal":"true","aria-label":e.title},[m("h3",ra,y(e.title),1),m("p",la,y(e.message),1),m("div",ca,[m("button",{class:"confirm-dialog-btn confirm-dialog-btn-cancel",type:"button",onClick:n[0]||(n[0]=o=>t.$emit("cancel"))},y(e.cancelLabel||"Cancel"),1),m("button",{class:te(["confirm-dialog-btn confirm-dialog-btn-confirm",{"is-danger":e.danger}]),type:"button",onClick:n[1]||(n[1]=o=>t.$emit("confirm"))},y(e.confirmLabel||"Confirm"),3)])],8,ia)])):P("",!0)]))}}),da=ne(ua,[["__scopeId","data-v-de94025d"]]),fa={key:0,class:"diff-viewer-sidebar"},ha={class:"diff-viewer-sidebar-header"},ma={class:"diff-viewer-sidebar-title"},ga={class:"diff-viewer-sidebar-count"},pa={class:"diff-viewer-sidebar-list"},va=["data-active","onClick"],ka=["data-operation"],ya={class:"diff-viewer-file-label"},wa={key:0,class:"diff-viewer-file-delta"},ba={class:"diff-viewer-main"},Ca={class:"diff-viewer-toolbar"},$a={class:"diff-viewer-title-wrap"},xa={class:"diff-viewer-title"},Ta={class:"diff-viewer-subtitle"},_a={key:0},Ia={class:"diff-viewer-toolbar-actions"},La=["aria-label"],Ma={key:0,class:"diff-viewer-empty"},Sa={class:"diff-viewer-empty-title"},Aa={class:"diff-viewer-empty-text"},Fa={key:1,class:"diff-viewer-panel"},Pa={class:"diff-viewer-meta"},Ea={class:"diff-viewer-language"},Ba={class:"diff-viewer-lines"},Ra=["data-kind"],Oa={class:"diff-viewer-line-number"},Da={class:"diff-viewer-line-number"},Ha={class:"diff-viewer-line-marker"},Wa=["innerHTML"],ja={class:"diff-viewer-mobile-sheet-header"},qa={class:"diff-viewer-sidebar-title"},Ua={class:"diff-viewer-sidebar-count"},Na={class:"diff-viewer-mobile-sheet-list"},za=["data-active","onClick"],Va=["data-operation"],Ka={class:"diff-viewer-file-label"},Ga={key:0,class:"diff-viewer-file-delta"},Za=oe({__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 t=e,{t:n}=me();function o(r){return r.replace(/&/gu,"&").replace(/</gu,"<").replace(/>/gu,">").replace(/"/gu,""").replace(/'/gu,"'")}const s=E(()=>r=>en(r,n)),a=E(()=>r=>rs(r,n)),i=E(()=>r=>Ke(r,t.cwd));return(r,c)=>(l(),se(Jn,{to:"body"},[e.change?(l(),f("div",{key:0,class:"diff-viewer-backdrop",onClick:c[5]||(c[5]=h=>r.$emit("close"))},[m("div",{class:"diff-viewer-shell",onClick:c[4]||(c[4]=ze(()=>{},["stop"]))},[e.isMobile?P("",!0):(l(),f("aside",fa,[m("div",ha,[m("p",ma,y(d(n)("Changed files")),1),m("p",ga,y(a.value(e.changes.length)),1)]),m("div",pa,[(l(!0),f(j,null,Z(e.changes,h=>(l(),f("button",{key:`diff-viewer:${d(le)(h)}`,type:"button",class:"diff-viewer-file-button","data-active":d(le)(h)===d(le)(e.change),onClick:g=>r.$emit("select-change",h)},[m("span",{class:"file-change-badge","data-operation":d(Vt)(h)},y(s.value(h)),9,ka),m("span",ya,[ye(y(i.value(h.path))+" ",1),h.movedToPath?(l(),f(j,{key:0},[ye(" → "+y(i.value(h.movedToPath)),1)],64)):P("",!0)]),d(Re)(h)?(l(),f("span",wa,y(d(Re)(h)),1)):P("",!0)],8,va))),128))])])),m("section",ba,[m("div",Ca,[m("div",$a,[m("p",xa,[ye(y(i.value(e.change.path))+" ",1),e.change.movedToPath?(l(),f(j,{key:0},[ye(" → "+y(i.value(e.change.movedToPath)),1)],64)):P("",!0)]),m("p",Ta,[ye(y(s.value(e.change))+" ",1),d(Re)(e.change)?(l(),f("span",_a," · "+y(d(Re)(e.change)),1)):P("",!0)])]),m("div",Ia,[e.isMobile?(l(),f("button",{key:0,type:"button",class:"diff-viewer-mobile-files-button",onClick:c[0]||(c[0]=h=>r.$emit("toggle-file-list"))},y(a.value(e.changes.length)),1)):P("",!0),m("button",{class:"image-modal-close diff-viewer-close",type:"button","aria-label":d(n)("Close diff viewer"),onClick:c[1]||(c[1]=h=>r.$emit("close"))},[Q(Xn,{class:"icon-svg"})],8,La)])]),d(Xo)(e.change)?(l(),f("div",Fa,[m("div",Pa,[m("span",Ea,y(d(Vo)(e.change)||"diff"),1)]),m("div",Ba,[(l(!0),f(j,null,Z(e.lines,h=>(l(),f("div",{key:h.key,class:"diff-viewer-line","data-kind":h.kind},[m("span",Oa,y(h.oldLine??""),1),m("span",Da,y(h.newLine??""),1),m("span",Ha,y(d(Yo)(h)),1),m("code",{class:"diff-viewer-line-code",innerHTML:o(h.text)||" "},null,8,Wa)],8,Ra))),128))])])):(l(),f("div",Ma,[m("p",Sa,y(d(n)("No diff available")),1),m("p",Aa,y(d(n)("This summary was restored from the final answer text, but the thread history does not include patch diff content for this file.")),1)]))]),Q(xo,{name:"diff-viewer-sheet"},{default:qe(()=>[e.isMobile&&e.isFileListOpen?(l(),f("div",{key:0,class:"diff-viewer-mobile-sheet-backdrop",onClick:c[3]||(c[3]=h=>r.$emit("close-file-list"))},[m("div",{class:"diff-viewer-mobile-sheet",onClick:c[2]||(c[2]=ze(()=>{},["stop"]))},[c[6]||(c[6]=m("div",{class:"diff-viewer-mobile-sheet-handle","aria-hidden":"true"},null,-1)),m("div",ja,[m("p",qa,y(d(n)("Changed files")),1),m("p",Ua,y(a.value(e.changes.length)),1)]),m("div",Na,[(l(!0),f(j,null,Z(e.changes,h=>(l(),f("button",{key:`diff-viewer-sheet:${d(le)(h)}`,type:"button",class:"diff-viewer-file-button","data-active":d(le)(h)===d(le)(e.change),onClick:g=>r.$emit("select-change",h)},[m("span",{class:"file-change-badge","data-operation":d(Vt)(h)},y(s.value(h)),9,Va),m("span",Ka,[ye(y(i.value(h.path))+" ",1),h.movedToPath?(l(),f(j,{key:0},[ye(" → "+y(i.value(h.movedToPath)),1)],64)):P("",!0)]),d(Re)(h)?(l(),f("span",Ga,y(d(Re)(h)),1)):P("",!0)],8,za))),128))])])])):P("",!0)]),_:1})])])):P("",!0)]))}}),Ja=ne(Za,[["__scopeId","data-v-371da3ce"]]),Xa={},Ya={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Qa(e,t){return l(),f("svg",Ya,[...t[0]||(t[0]=[m("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 Kt=ne(Xa,[["render",Qa]]),ei={class:"file-change-summary-label"},ti={class:"file-change-summary-status"},ni=["data-tone"],si={class:"file-change-panel-inner"},oi={class:"file-change-list"},ai=["data-operation","title"],ii={class:"file-change-path-group"},ri=["title","onClick"],li={key:0,class:"file-change-arrow"},ci=["title","onClick"],ui={key:0,class:"file-change-delta"},di=["data-tone"],fi=["title","aria-label","onClick"],hi={key:0,class:"file-change-actions"},mi={key:0,class:"file-change-action-error"},gi=["disabled","title","aria-label"],pi=oe({__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 t=e,{t:n}=me(),o=E(()=>r=>en(r,n)),s=E(()=>r=>Uo(r,n)),a=E(()=>r=>Ke(r,t.cwd)),i=E(()=>r=>`${n("Undo")} ${Ke(r.path,t.cwd)}`);return(r,c)=>e.summary?(l(),f("section",{key:0,class:te(["file-change-summary-block",{"file-change-summary-block-inline":e.inline}])},[m("button",{type:"button",class:te(["file-change-summary-row",{"file-change-summary-row-expanded":e.expanded}]),onClick:c[0]||(c[0]=h=>r.$emit("toggle"))},[m("span",{class:te(["file-change-chevron",{"file-change-chevron-open":e.expanded}])},"▶",2),m("span",ei,y(s.value(e.summary)),1),m("span",ti,[(l(!0),f(j,null,Z(d(No)(e.summary),h=>(l(),f("span",{key:`summary-status:${e.summary.turnId}:${h.tone}:${h.label}`,class:"file-change-signed-count","data-tone":h.tone},y(h.label),9,ni))),128))])],2),m("div",{class:te(["file-change-panel",{"file-change-panel-visible":e.expanded}])},[m("div",si,[m("ul",oi,[(l(!0),f(j,null,Z(e.summary.changes,h=>(l(),f("li",{key:`file-change:${e.summary.turnId}:${h.path}:${h.movedToPath||""}`,class:"file-change-item"},[m("span",{class:"file-change-badge","data-operation":d(Vt)(h),title:o.value(h)},y(d(Wo)(h)),9,ai),m("span",ii,[m("button",{type:"button",class:"file-change-path-button",title:h.path,onClick:g=>r.$emit("open-diff",h)},y(a.value(h.path)),9,ri),h.movedToPath?(l(),f("span",li,"→")):P("",!0),h.movedToPath?(l(),f("button",{key:1,type:"button",class:"file-change-path-button",title:h.movedToPath,onClick:g=>r.$emit("open-diff",h)},y(a.value(h.movedToPath)),9,ci)):P("",!0)]),h.addedLineCount>0||h.removedLineCount>0?(l(),f("span",ui,[(l(!0),f(j,null,Z(d(jo)(h),g=>(l(),f("span",{key:`change-delta:${e.summary.turnId}:${h.path}:${g.tone}:${g.label}`,class:"file-change-signed-count","data-tone":g.tone},y(g.label),9,di))),128))])):P("",!0),e.actionable?(l(),f("button",{key:1,type:"button",class:"file-change-file-undo-button",title:i.value(h),"aria-label":i.value(h),onClick:g=>r.$emit("request-file-action",h)},[Q(Kt,{class:"icon-svg file-change-action-icon"})],8,fi)):P("",!0)]))),128))]),e.actionable?(l(),f("div",hi,[e.actionErrorText?(l(),f("p",mi,y(e.actionErrorText),1)):P("",!0),m("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:c[1]||(c[1]=h=>r.$emit("request-action",e.nextAction))},[Q(Kt,{class:te(["icon-svg file-change-action-icon",{"file-change-action-icon-redo":e.nextAction==="redo"}])},null,8,["class"]),ye(" "+y(e.actionLabel),1)],8,gi)])):P("",!0)])],2)],2)):P("",!0)}}),En=ne(pi,[["__scopeId","data-v-b7e20b6a"]]),vi=oe({__name:"FileLinkContextMenu",props:{visible:{type:Boolean},x:{},y:{},browseUrl:{},editUrl:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,s=q(null),a=E(()=>({left:`${String(n.x)}px`,top:`${String(n.y)}px`}));function i(){o("close")}function r(){const C=n.browseUrl;i(),!(!C||C==="#")&&window.open(C,"_blank","noopener,noreferrer")}function c(){const C=n.editUrl;i(),!(!C||C==="#")&&window.open(C,"_blank","noopener,noreferrer")}async function h(){const C=n.browseUrl;if(i(),!(!C||C==="#"))try{await Ut(C)}catch{}}function g(C){if(!n.visible)return;const S=s.value;if(!S){i();return}const w=C.target;w instanceof Node&&S.contains(w)||i()}function x(){i()}function F(C){C.key==="Escape"&&i()}return Te(()=>n.visible,C=>{C?(window.addEventListener("pointerdown",g,!0),window.addEventListener("blur",x),window.addEventListener("keydown",F,!0)):(window.removeEventListener("pointerdown",g,!0),window.removeEventListener("blur",x),window.removeEventListener("keydown",F,!0))}),Ct(()=>{window.removeEventListener("pointerdown",g,!0),window.removeEventListener("blur",x),window.removeEventListener("keydown",F,!0)}),(C,S)=>e.visible?(l(),f("div",{key:0,ref_key:"menuRef",ref:s,class:"file-link-context-menu",style:tt(a.value),onClick:S[0]||(S[0]=ze(()=>{},["stop"]))},[m("button",{type:"button",class:"file-link-context-menu-item",onClick:r}," Open link "),m("button",{type:"button",class:"file-link-context-menu-item",onClick:h}," Copy link "),e.editUrl?(l(),f("button",{key:0,type:"button",class:"file-link-context-menu-item",onClick:c}," Edit file ")):P("",!0)],4)):P("",!0)}}),ki=ne(vi,[["__scopeId","data-v-19762594"]]),yi=12e3,wi=240;function bi(e,{streaming:t,truncateStreaming:n=!0,maxChars:o=yi,maxLines:s=wi}){if(!n)return e;let a=e,i=!1;if(o>0&&a.length>o&&(a=a.slice(-o),i=!0),s>0){const r=a.split(/\r?\n/);r.length>s&&(a=r.slice(-s).join(`
|
|
25
|
+
`),i=!0)}return i?`...
|
|
26
|
+
${a}`:a}const Ci={class:"conversation-item conversation-item-overlay"},$i={class:"message-row"},xi={class:"message-stack"},Ti={class:"live-overlay-inline","aria-live":"polite"},_i={class:"live-overlay-title-row"},Ii={key:0,class:"live-overlay-spinner","aria-hidden":"true"},Li=["aria-expanded"],Mi={class:"live-overlay-label"},Si={class:"live-overlay-toggle","aria-hidden":"true"},Ai={key:2,class:"live-overlay-label"},Fi={key:0,class:"live-overlay-reasoning"},Pi={key:1,class:"live-overlay-error"},Ei=["href"],Bi=oe({__name:"LiveOverlayItem",props:{overlay:{},feedbackMailto:{}},setup(e){const t=e,{buildFeedbackMailto:n,recordVisibleFailure:o}=Yn(),{t:s}=me(),a=q(!0);function i(){a.value=!a.value}const r=E(()=>{var h;return bi(((h=t.overlay)==null?void 0:h.reasoningText)??"",{streaming:!0})});function c(h,g){o(g);const x=h.currentTarget;x instanceof HTMLAnchorElement&&(x.href=n())}return(h,g)=>{var x,F,C,S,w,v;return l(),f("li",Ci,[m("div",$i,[m("div",xi,[m("article",Ti,[m("div",_i,[(x=e.overlay)!=null&&x.errorText?P("",!0):(l(),f("span",Ii)),(F=e.overlay)!=null&&F.reasoningText?(l(),f("button",{key:1,type:"button",class:"live-overlay-heading","aria-expanded":a.value,onClick:i},[m("span",Mi,y((C=e.overlay)==null?void 0:C.activityLabel),1),m("span",Si,y(a.value?"▾":"▸"),1)],8,Li)):(l(),f("p",Ai,y((S=e.overlay)==null?void 0:S.activityLabel),1))]),(w=e.overlay)!=null&&w.reasoningText&&a.value?(l(),f("p",Fi,y(r.value),1)):P("",!0),(v=e.overlay)!=null&&v.errorText?(l(),f("div",Pi,[m("span",null,y(e.overlay.errorText),1),m("a",{class:"live-overlay-feedback",href:e.feedbackMailto,onClick:g[0]||(g[0]=$=>c($,e.overlay.errorText))},y(d(s)("Send feedback")),9,Ei)])):P("",!0)])])])])}}}),Ri=ne(Bi,[["__scopeId","data-v-b69a0020"]]),Oi=["title"],Di={class:"model-switch-label"},Hi=oe({__name:"ModelSwitchDivider",props:{from:{},to:{}},setup(e){return(t,n)=>(l(),f("div",{class:"model-switch-divider",title:e.to?`切换模型:${e.from??""} → ${e.to}`:void 0},[n[0]||(n[0]=m("span",{class:"model-switch-track","aria-hidden":"true"},null,-1)),m("span",Di,y(e.from?`${e.from} → `:"")+y(e.to),1),n[1]||(n[1]=m("span",{class:"model-switch-track","aria-hidden":"true"},null,-1))],8,Oi))}}),Bn=ne(Hi,[["__scopeId","data-v-1fba0d09"]]),Wi={key:0},ji={key:1,class:"message-bold-text"},qi={key:2,class:"message-italic-text"},Ui={key:3,class:"message-strikethrough-text"},Ni=["href","title"],zi=["href","title"],Vi={key:6,class:"message-inline-code"},Ki=oe({__name:"MessageInlineContent",props:{segments:{},toBrowseUrl:{type:Function}},setup(e){return(t,n)=>(l(!0),f(j,null,Z(e.segments,(o,s)=>(l(),f(j,{key:s},[o.kind==="text"?(l(),f("span",Wi,y(o.value),1)):o.kind==="bold"?(l(),f("strong",ji,y(o.value),1)):o.kind==="italic"?(l(),f("em",qi,y(o.value),1)):o.kind==="strikethrough"?(l(),f("s",Ui,y(o.value),1)):o.kind==="file"?(l(),f("a",{key:4,class:"message-file-link",href:e.toBrowseUrl(o.path),target:"_blank",rel:"noopener noreferrer",title:o.path},y(o.displayPath),9,Ni)):o.kind==="url"?(l(),f("a",{key:5,class:"message-file-link",href:o.href,target:"_blank",rel:"noopener noreferrer",title:o.href},y(o.value),9,zi)):(l(),f("code",Vi,y(o.value),1))],64))),128))}}),je=ne(Ki,[["__scopeId","data-v-b0b3f6a0"]]),Gi={},Zi={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Ji(e,t){return l(),f("svg",Zi,[...t[0]||(t[0]=[m("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 Xi=ne(Gi,[["render",Ji]]),Yi=["data-role"],Qi=["aria-label","title"],er={key:0,class:"message-rollback-label"},tr=["aria-label","title"],nr={class:"message-fork-label"},sr=["data-copied","aria-label","title"],or={key:0,class:"message-copy-label"},ar=oe({__name:"MessageToolbar",props:{role:{},showEdit:{type:Boolean,default:!1},showFork:{type:Boolean,default:!1},showCopy:{type:Boolean,default:!1},copied:{type:Boolean,default:!1}},emits:["edit","fork","copy"],setup(e){const{t}=me();return(n,o)=>e.showEdit||e.showFork||e.showCopy?(l(),f("div",{key:0,class:"message-toolbar","data-role":e.role},[e.showEdit?(l(),f("button",{key:0,type:"button",class:"message-rollback-button","aria-label":d(t)("Rollback this message"),title:d(t)("Rollback this message"),onClick:o[0]||(o[0]=s=>n.$emit("edit"))},[Q(Kt,{class:"icon-svg message-rollback-icon"}),e.role!=="user"?(l(),f("span",er,y(d(t)("Rollback")),1)):P("",!0)],8,Qi)):P("",!0),e.showFork?(l(),f("button",{key:1,type:"button",class:"message-fork-button","aria-label":d(t)("Fork thread from this response"),title:d(t)("Fork thread from this response"),onClick:o[1]||(o[1]=s=>n.$emit("fork"))},[Q(To,{class:"icon-svg message-fork-icon"}),m("span",nr,y(d(t)("Fork")),1)],8,tr)):P("",!0),e.showCopy?(l(),f("button",{key:2,type:"button",class:"message-copy-button","data-copied":e.copied,"aria-label":e.copied?d(t)("Response copied"):d(t)("Copy response"),title:e.copied?d(t)("Response copied"):d(t)("Copy response"),onClick:o[2]||(o[2]=s=>n.$emit("copy"))},[Q(Xi,{class:"icon-svg message-copy-icon"}),e.role!=="user"?(l(),f("span",or,y(e.copied?"Copied":"Copy"),1)):P("",!0)],8,sr)):P("",!0)],8,Yi)):P("",!0)}}),ir=ne(ar,[["__scopeId","data-v-59a7a725"]]),rr="codex-web-local.process-fold.v1",Rn="codex:web-local:process-fold";function Wt(){return typeof localStorage>"u"?"auto":localStorage.getItem(rr)==="expanded"?"expanded":"auto"}function lr(e){const t=n=>e(n.detail);return window.addEventListener(Rn,t),()=>window.removeEventListener(Rn,t)}const cr=["aria-expanded"],ur={class:"process-fold-label"},dr={class:"process-fold-toggle","aria-hidden":"true"},fr={key:0,class:"process-fold-body"},hr=oe({__name:"ProcessFold",props:{label:{},running:{type:Boolean},hasOutsideContent:{type:Boolean}},setup(e){const t=e,n=q(Wt()==="expanded"||!t.hasOutsideContent),o=q(!1);let s=!1;const a=lr(()=>{o.value=!1,Wt()==="expanded"?n.value=!0:!t.running&&t.hasOutsideContent&&(n.value=!1)});Te(()=>t.running,r=>{const c=s;s=r,r?(c||(o.value=!1),o.value||(n.value=!0)):c&&!o.value&&t.hasOutsideContent&&Wt()!=="expanded"&&(n.value=!1)},{immediate:!0}),Ct(()=>a());function i(){o.value=!0,n.value=!n.value}return(r,c)=>(l(),f("div",{class:te(["process-fold",{"process-fold--open":n.value,"process-fold--running":e.running}])},[m("button",{type:"button",class:"process-fold-header","aria-expanded":n.value,onClick:i},[m("span",ur,y(e.label),1),m("span",dr,y(n.value?"▾":"▸"),1)],8,cr),n.value?(l(),f("div",fr,[Ee(r.$slots,"default",{},void 0)])):P("",!0)],2))}}),mr=ne(hr,[["__scopeId","data-v-de9b3329"]]),gr=["aria-label"],pr=["data-turn","aria-label","onClick"],vr={class:"question-jump-preview-text"},kr=2,jt="#3b82f6",yr=oe({__name:"QuestionJumpBar",props:{anchors:{},activeTurn:{}},emits:["jump"],setup(e,{emit:t}){const n=e,o=t,{t:s}=me(),a=q(null),i=q(-1),r=q("0px"),c=E(()=>{const w=i.value;return w<0?null:n.anchors[w]??null});function h(w){var L;const v=n.activeTurn===((L=n.anchors[w])==null?void 0:L.turn),$={};if(i.value<0)return $.width=v?"18px":"12px",$.background=v?jt:void 0,$;const b=Math.abs(w-i.value);return $.width=b===0?"32px":b===1?"20px":b===2?"14px":v?"18px":"12px",$.background=b===0?jt:b===1?"rgba(59,130,246,0.6)":b===2?"rgba(59,130,246,0.35)":v?jt:void 0,$.transitionDelay=`${b*20}ms`,$}function g(w){const v=a.value;if(!v)return-1;const $=Array.from(v.querySelectorAll(".question-jump-item"));let b=-1,L=Number.POSITIVE_INFINITY;for(let I=0;I<$.length;I+=1){const B=$[I].getBoundingClientRect(),R=B.top+B.height/2,U=Math.abs(w-R);U<L&&(L=U,b=I)}return b}function x(w){var R;const v=g(w.clientY);if(v<0)return;i.value=v;const $=a.value;if(!$)return;const L=(R=Array.from($.querySelectorAll(".question-jump-item"))[v])==null?void 0:R.getBoundingClientRect(),I=$.getBoundingClientRect();if(!L)return;const B=L.top+L.height/2;r.value=`${B-I.top}px`}function F(){i.value=-1}function C(w){const v=g(w.clientY),$=v>=0?n.anchors[v]:null;$&&o("jump",$.turn)}function S(w){o("jump",w.turn)}return(w,v)=>e.anchors.length>=kr?(l(),f("nav",{key:0,class:"question-jump-bar","aria-label":d(s)("Question navigation")},[m("div",{ref_key:"trackRef",ref:a,class:"question-jump-track",onMousemove:x,onMouseleave:F,onMousedown:C},[(l(!0),f(j,null,Z(e.anchors,($,b)=>(l(),f("button",{key:$.turn,type:"button",class:"question-jump-item","data-turn":$.turn,"aria-label":d(s)("Jump to question {n}",{n:$.turn+1}),onMousedown:v[0]||(v[0]=ze(()=>{},["prevent"])),onClick:L=>S($)},[m("span",{class:"question-jump-dot",style:tt(h(b))},null,4)],40,pr))),128))],544),c.value?(l(),f("div",{key:0,class:"question-jump-preview",role:"tooltip",style:tt({top:r.value})},[m("span",vr,y(c.value.text),1)],4)):P("",!0)],8,gr)):P("",!0)}}),wr=ne(yr,[["__scopeId","data-v-e451392a"]]),br=["data-state"],Cr=["aria-expanded"],$r={class:"reasoning-block-title"},xr={class:"reasoning-block-toggle","aria-hidden":"true"},Tr={key:0,class:"reasoning-block-body"},_r={key:0,class:"reasoning-block-summary"},Ir=["innerHTML"],Lr=oe({__name:"ReasoningBlock",props:{message:{},expanded:{type:Boolean},contentHtml:{}},emits:["toggle"],setup(e){const t=e,{t:n}=me(),o=E(()=>{var a;return(((a=t.message.reasoning)==null?void 0:a.summary)??[]).map(i=>i.trim()).filter(Boolean).join(`
|
|
27
|
+
`).trim()});return(s,a)=>(l(),f("div",{class:"reasoning-block","data-state":e.expanded?"expanded":"collapsed"},[m("button",{type:"button",class:"reasoning-block-header","aria-expanded":e.expanded,onClick:a[0]||(a[0]=i=>s.$emit("toggle"))},[m("span",$r,y(d(n)("Thinking process")),1),m("span",xr,y(e.expanded?"▾":"▸"),1)],8,Cr),e.expanded?(l(),f("div",Tr,[o.value?(l(),f("p",_r,y(o.value),1)):P("",!0),m("div",{class:"reasoning-block-content message-card",innerHTML:e.contentHtml},null,8,Ir)])):P("",!0)],8,br))}}),On=ne(Lr,[["__scopeId","data-v-5fa90230"]]),Mr=new Set(["read_file","ls","grep","glob","web_fetch","read_skill","code_index","connect_tool_source"]),Sr=new Set(["write_file","edit_file","multi_edit","move_file","delete_range","delete_symbol","notebook_edit"]),Ar=new Set(["task","run_skill","explore","research","review","security_review"]);function Fr(e){var n;const t=((n=e.toolCall)==null?void 0:n.tool)??"";return Mr.has(t)?"readonly":Sr.has(t)?"modify":Ar.has(t)?"delegate":null}const Pr=2;function Er(e){var a;const t=[];let n=[],o=null;const s=()=>{if(o!==null&&n.length>=Pr)t.push({type:"batch",kind:o,messages:n});else for(const i of n)t.push({type:"tool",message:i});n=[],o=null};for(const i of e){if(i.messageType!=="toolCall"||((a=i.toolCall)==null?void 0:a.status)==="inProgress"){s(),t.push({type:"tool",message:i});continue}const r=Fr(i);if(r===null){s(),t.push({type:"tool",message:i});continue}o!==null&&o!==r&&s(),o=r,n.push(i)}return s(),t}function Br(e,t,n){const{t:o}=n;if(e==="readonly"){const s=t.filter(c=>{var h,g;return((h=c.toolCall)==null?void 0:h.tool)==="read_file"||((g=c.toolCall)==null?void 0:g.tool)==="ls"}).length,a=t.filter(c=>{var g;const h=((g=c.toolCall)==null?void 0:g.tool)??"";return h==="grep"||h==="glob"||h==="web_fetch"||h==="code_index"}).length,i=t.length-s-a,r=[];return s>0&&r.push(o("Read {n} files",{n:s})),a>0&&r.push(o("Search {n} files",{n:a})),i>0&&r.push(o("{n} read calls",{n:i})),r.join(" · ")}return e==="modify"?o("Modified {n} files",{n:t.length}):e==="delegate"?o("Delegated {n} tasks",{n:t.length}):o("Explored {n} items",{n:t.length})}const Rr={class:"message-row","data-role":"system"},Or={class:"message-stack","data-role":"system"},Dr=["title"],Hr={key:0,class:"tool-call-server"},Wr={class:"tool-call-name"},jr={class:"tool-call-status"},qr={key:0,class:"work-block-spinner","aria-hidden":"true"},Ur={key:1,class:"tool-call-status-icon","aria-hidden":"true"},Nr={key:2,class:"tool-call-status-icon","aria-hidden":"true"},zr=oe({__name:"ToolCallRow",props:{message:{}},setup(e){const t=e,{t:n}=me(),o=E(()=>{const i=t.message.toolCall;if(!i)return"";switch(i.status){case"inProgress":return n("Running");case"failed":return n("Failed");default:return n("Done")}}),s=E(()=>{var i;switch((i=t.message.toolCall)==null?void 0:i.status){case"inProgress":return"tool-call-running";case"failed":return"tool-call-error";default:return"tool-call-ok"}}),a=E(()=>{const i=t.message.toolCall;if(!i)return"";const r=[];return i.server&&r.push(i.server),r.push(i.tool),i.error&&r.push(i.error),typeof i.durationMs=="number"&&i.durationMs>=0&&r.push(`${i.durationMs}ms`),r.join(" · ")});return(i,r)=>{var c,h,g,x;return l(),f("div",Rr,[m("div",Or,[m("div",{class:te(["tool-call-block",s.value]),title:a.value},[r[0]||(r[0]=m("span",{class:"tool-call-icon","aria-hidden":"true"},"🛠",-1)),(c=e.message.toolCall)!=null&&c.server?(l(),f("span",Hr,y(e.message.toolCall.server),1)):P("",!0),m("code",Wr,y(((h=e.message.toolCall)==null?void 0:h.tool)||e.message.text||"(tool)"),1),m("span",jr,[((g=e.message.toolCall)==null?void 0:g.status)==="inProgress"?(l(),f("span",qr)):((x=e.message.toolCall)==null?void 0:x.status)==="completed"?(l(),f("span",Ur,"✓")):(l(),f("span",Nr,"✗")),ye(" "+y(o.value),1)])],10,Dr)])])}}}),Gt=ne(zr,[["__scopeId","data-v-e25278a7"]]),Vr=["aria-expanded","title"],Kr={class:"tool-batch-toggle","aria-hidden":"true"},Gr={class:"tool-batch-label"},Zr={class:"tool-batch-count"},Jr={key:0,class:"tool-batch-body"},Xr=oe({__name:"ToolBatchBlock",props:{kind:{},messages:{}},setup(e){const t=e,{t:n}=me(),o=q(!1),s=E(()=>Br(t.kind,t.messages,{t:n})),a=E(()=>t.messages.map(i=>{var r;return((r=i.toolCall)==null?void 0:r.tool)??""}).join(" · "));return(i,r)=>(l(),f("div",{class:te(["tool-batch-block",{"tool-batch-block--open":o.value}])},[m("button",{type:"button",class:"tool-batch-head","aria-expanded":o.value,title:a.value,onClick:r[0]||(r[0]=c=>o.value=!o.value)},[m("span",Kr,y(o.value?"▾":"▸"),1),r[1]||(r[1]=m("span",{class:"tool-batch-icon","aria-hidden":"true"},"🛠",-1)),m("span",Gr,y(s.value),1),m("span",Zr,y(e.messages.length),1)],8,Vr),o.value?(l(),f("div",Jr,[(l(!0),f(j,null,Z(e.messages,c=>(l(),se(Gt,{key:c.id,message:c},null,8,["message"]))),128))])):P("",!0)],2))}}),Yr=ne(Xr,[["__scopeId","data-v-908995a9"]]),Qr=["data-turn-key"],el={key:0,class:"conversation-turn-request","aria-label":"User request"},tl={class:"conversation-turn-items"},nl={key:1,class:"conversation-turn-process","aria-label":"Turn process"},sl=["aria-expanded","aria-label"],ol={key:2,class:"conversation-turn-time"},al={class:"conversation-turn-process-count"},il={key:1,class:"conversation-turn-process-heading"},rl={key:0,class:"conversation-turn-time"},ll={key:2,class:"conversation-turn-items conversation-turn-process-items"},cl={key:2,class:"conversation-turn-final","aria-label":"Assistant final response"},ul={class:"conversation-turn-items"},dl=oe({__name:"ThreadTurn",props:{turnKey:{},request:{},processItems:{default:()=>[]},finalItem:{},fileChangeAnchorIds:{default:()=>[]},durationMs:{},warm:{},warmItems:{default:()=>[]}},setup(e){const t=e,{t:n}=me(),o=q(!0),s=E(()=>t.processItems.length+t.fileChangeAnchorIds.length),a=E(()=>!!t.finalItem);return Te(s,(i,r)=>{i>r&&(o.value=!0)}),(i,r)=>e.warm?(l(),f(j,{key:0},[Ee(i.$slots,"warm-card",{warm:e.warm},void 0),(l(!0),f(j,null,Z(e.warmItems,c=>Ee(i.$slots,"default",{key:c.message.id,item:c,section:"warm"},void 0)),128))],64)):(l(),f("li",{key:1,class:"conversation-turn","data-turn-key":e.turnKey},[e.request?(l(),f("section",el,[m("ol",tl,[Ee(i.$slots,"default",{item:e.request,section:"request"},void 0)])])):P("",!0),s.value>0?(l(),f("section",nl,[a.value?(l(),f("button",{key:0,class:"conversation-turn-process-heading conversation-turn-process-toggle",type:"button","aria-expanded":o.value,"aria-label":o.value?d(n)("Collapse turn process"):d(n)("Expand turn process"),onClick:r[0]||(r[0]=c=>o.value=!o.value)},[o.value?(l(),se(_o,{key:0,class:"conversation-turn-process-toggle-icon"})):(l(),se(Qn,{key:1,class:"conversation-turn-process-toggle-icon"})),m("span",null,y(d(n)("Turn process")),1),e.durationMs!=null&&e.durationMs>0?(l(),f("span",ol,y(d(Nt)(e.durationMs)),1)):P("",!0),m("span",al,y(d(n)("{n} process items",{n:s.value})),1)],8,sl)):(l(),f("div",il,[ye(y(d(n)("Turn process"))+" ",1),e.durationMs!=null&&e.durationMs>0?(l(),f("span",rl,y(d(Nt)(e.durationMs)),1)):P("",!0)])),o.value?(l(),f("ol",ll,[(l(!0),f(j,null,Z(e.processItems,c=>Ee(i.$slots,"default",{key:c.message.id,item:c,section:"process"},void 0)),128)),(l(!0),f(j,null,Z(e.fileChangeAnchorIds,c=>(l(),f("li",{key:`file-change-${c}`,class:"conversation-turn-row conversation-turn-file-change"},[Ee(i.$slots,"file-change",{anchorMessageId:c},void 0)]))),128))])):P("",!0)])):P("",!0),e.finalItem?(l(),f("section",cl,[m("ol",ul,[Ee(i.$slots,"default",{item:e.finalItem,section:"final"},void 0)])])):P("",!0)],8,Qr))}}),fl=ne(dl,[["__scopeId","data-v-03c06fab"]]),hl=["aria-expanded"],ml={class:"warm-turn__preview"},gl={key:0,class:"warm-turn__meta"},pl={class:"warm-turn__content"},vl={key:1,class:"warm-turn__assistant"},kl=oe({__name:"WarmTurnCard",props:{userText:{},assistantPreview:{},toolCount:{},expanded:{type:Boolean}},emits:["toggle"],setup(e,{emit:t}){const n=t,{t:o}=me();function s(){n("toggle")}return(a,i)=>(l(),f("div",{class:te(["warm-turn",{"warm-turn--expanded":e.expanded}])},[m("button",{type:"button",class:"warm-turn__head","aria-expanded":e.expanded,onClick:s},[Q(Qn,{class:te(["warm-turn__chevron",{"warm-turn__chevron--open":e.expanded}])},null,8,["class"]),m("span",ml,y(e.userText),1),e.toolCount>0?(l(),f("span",gl,y(d(o)("{n} tools",{n:e.toolCount})),1)):P("",!0)],8,hl),m("div",pl,[e.expanded?Ee(a.$slots,"default",{},void 0,!0,0):e.assistantPreview?(l(),f("div",vl,y(e.assistantPreview),1)):P("",!0)])],2))}}),yl=ne(kl,[["__scopeId","data-v-6b70725e"]]),wl=["aria-expanded"],bl=["title"],Cl={class:"work-block-command"},$l={class:"work-block-status"},xl={key:0,class:"work-block-spinner","aria-hidden":"true"},Tl={key:1,class:"work-block-status-icon","aria-hidden":"true"},_l={key:2,class:"work-block-status-icon","aria-hidden":"true"},Il={class:"work-block-output-inner"},Ll=["textContent"],Ml=["textContent"],Sl={key:0,class:"work-block-output-spill",role:"note"},Al=["disabled"],Fl={key:1},Pl={key:0,class:"work-block-permission-hint",role:"note"},El=oe({__name:"WorkBlockItem",props:{command:{},stepIndex:{},expanded:{type:Boolean},compact:{type:Boolean},outputCondensed:{type:Boolean}},emits:["toggle"],setup(e){const t=e,{t:n}=me(),o=E(()=>{var v;return(v=t.command.commandExecution)==null?void 0:v.outputSpill}),s=E(()=>{var v;return((v=o.value)==null?void 0:v.ref)??""}),a=q("idle"),i=q(null),r=E(()=>{const v=o.value;return!!(v&&i.value&&i.value.ref===v.ref)}),c=E(()=>{const v=t.command.commandExecution,$=v==null?void 0:v.outputSpill,b=i.value;return $&&b&&b.ref===$.ref?b.text:(v==null?void 0:v.aggregatedOutput)||"(no output)"});function h(v){return v<1024?`${v} B`:v<1024*1024?`${(v/1024).toFixed(1)} KB`:`${(v/(1024*1024)).toFixed(1)} MB`}const g=E(()=>{const v=o.value;return!v||v.omittedBytes<=0?"":n("Output trimmed: {omitted} omitted of {total}.",{omitted:h(v.omittedBytes),total:h(v.totalBytes)})});async function x(){const v=o.value;if(!(!(v!=null&&v.ref)||a.value==="loading")){a.value="loading";try{i.value={ref:v.ref,text:await Io(v.ref)},a.value="idle"}catch{a.value="error"}}}const F=E(()=>{var $,b;const v=($=t.command.commandExecution)==null?void 0:$.status;return v==="inProgress"?"cmd-status-running":v==="completed"&&((b=t.command.commandExecution)==null?void 0:b.exitCode)===0?"cmd-status-ok":"cmd-status-error"}),C=E(()=>{const v=t.command.commandExecution;if(!v)return"";switch(v.status){case"inProgress":return n("Running");case"completed":return v.exitCode===0?n("Done"):`${n("Exit")} ${v.exitCode??"?"}`;case"failed":return n("Failed");case"declined":return n("Declined");case"interrupted":return n("Stopped");default:return""}}),S=[/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],w=E(()=>{const v=t.command.commandExecution;if(!v||!(v.status==="failed"||v.status==="declined"||typeof v.exitCode=="number"&&v.exitCode!==0))return"";const b=v.aggregatedOutput??"";return!b||!S.some(L=>L.test(b))?"":n("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(v,$)=>{var b,L,I,B,R;return l(),f("div",{class:te(["work-block",[F.value,{"work-block-expanded":e.expanded,"work-block-compact":e.compact}]])},[m("button",{type:"button",class:"work-block-header","aria-expanded":e.expanded,onClick:$[0]||($[0]=U=>v.$emit("toggle"))},[m("span",{class:"work-step-dot",title:`${d(n)("Step")} ${String(e.stepIndex+1)}`},y(e.stepIndex+1),9,bl),m("code",Cl,y(d(n)("Command")),1),m("span",$l,[((b=e.command.commandExecution)==null?void 0:b.status)==="inProgress"?(l(),f("span",xl)):((L=e.command.commandExecution)==null?void 0:L.status)==="completed"&&((I=e.command.commandExecution)==null?void 0:I.exitCode)===0?(l(),f("span",Tl,"✓")):((B=e.command.commandExecution)==null?void 0:B.status)==="failed"?(l(),f("span",_l,"✗")):P("",!0),ye(" "+y(C.value),1)])],8,wl),m("div",{class:te(["work-block-output-wrap",{"work-block-output-visible":e.expanded}])},[m("div",Il,[m("pre",{class:"work-block-output-command",textContent:y(((R=e.command.commandExecution)==null?void 0:R.command)||"(command)")},null,8,Ll),m("pre",{class:te(["work-block-output",{"cmd-output-condensed":e.outputCondensed}]),textContent:y(c.value)},null,10,Ml),g.value?(l(),f("p",Sl,[m("span",null,y(g.value),1),s.value&&!r.value?(l(),f("button",{key:0,type:"button",class:"work-block-output-spill-action",disabled:a.value==="loading",onClick:x},y(a.value==="loading"?d(n)("Loading full output…"):d(n)("Show full output")),9,Al)):a.value==="error"?(l(),f("span",Fl,y(d(n)("Could not load the full output.")),1)):P("",!0)])):P("",!0)])],2),w.value?(l(),f("p",Pl,y(w.value),1)):P("",!0)],2)}}}),Dn=ne(El,[["__scopeId","data-v-8b258f21"]]),Bl=2;function Hn(e){const t=e.messageType;return t==="commandExecution"||t==="toolCall"}function Rl(e){var n,o;return(((n=e.commandExecution)==null?void 0:n.status)??"")==="inProgress"||(((o=e.toolCall)==null?void 0:o.status)??"")==="inProgress"?!0:(e.messageType??"").endsWith(".live")}function Ol(e,t){return e.messages.every(n=>t(n))}function Dl(e){const t=[];let n=[],o="";const s=()=>{n.length>0&&(t.push(n),n=[])};for(const r of e){const c=r.turnId??"",h=Hn(r)&&c!=="";(!h||c!==o)&&(n.length>0&&s(),o=h?c:""),h&&n.push(r)}s();const a=new Map;for(const r of e)r.messageType==="worked"&&r.turnId&&typeof r.durationMs=="number"&&a.set(r.turnId,r.durationMs);const i=[];for(const r of t){if(r.length<Bl)continue;const c=r[0].turnId??"";let h=0,g=0,x=0,F=!1;for(const S of r)S.messageType==="toolCall"?h+=1:S.messageType==="reasoning"?g+=1:S.messageType==="commandExecution"&&(x+=1),Rl(S)&&(F=!0);const C=e.some(S=>S.turnId===c&&!Hn(S));i.push({turnId:c,messages:r,running:F,toolCount:h,thoughtCount:g,commandCount:x,durationMs:a.get(c)??0,hasOutsideContent:C})}return i}function Hl(e,t){const{t:n,formatDuration:o}=t,s=[];return e.running?s.push(n("Working…")):e.durationMs>0?s.push(o(e.durationMs)):s.push(n("Processed")),e.toolCount>0&&s.push(n("{n} tools",{n:e.toolCount})),e.thoughtCount>0&&s.push(n("{n} thoughts",{n:e.thoughtCount})),e.commandCount>0&&s.push(n("{n} commands",{n:e.commandCount})),s.join(" · ")}function Wl(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}function jl(e){return!Wl(e)}function ql(e){return e.role==="user"?"user":e.messageType==="reasoning"?"reasoning":e.messageType==="plan"||e.messageType==="plan.live"?"plan":e.messageType==="fileChange"?"file-change":e.messageType==="commandExecution"||e.messageType==="toolCall"||e.messageType==="worked"?"process":"assistant"}function Ul(e,t=!1){var n;return e.role==="assistant"&&e.messageType!=="reasoning"&&e.messageType!=="commandExecution"&&e.messageType!=="toolCall"&&e.messageType!=="worked"&&e.messageType!=="plan"&&e.messageType!=="plan.live"&&e.messageType!=="fileChange"&&(t||!((n=e.messageType)!=null&&n.endsWith(".live")))&&e.text.trim().length>0}function Nl(e,t){var a,i;const n=[];let o=null;for(const r of e)(r.role==="user"||!o)&&(o={key:`turn-${r.id}`,items:[]},n.push(o)),o.items.push({message:r,kind:ql(r)});const s=n.length-1;for(let r=0;r<n.length;r+=1){const c=n[r],h=(i=(a=c.items.find(C=>{var S;return(S=C.message.turnId)==null?void 0:S.trim()}))==null?void 0:a.message.turnId)==null?void 0:i.trim(),g=t!==void 0&&"liveTurnId"in t;if((t==null?void 0:t.liveOverlayActive)===!0&&(g?h===(t==null?void 0:t.liveTurnId):r===s))continue;const F=[...c.items].reverse().find(C=>Ul(C.message,(t==null?void 0:t.liveOverlayActive)===!1));F&&((t==null?void 0:t.liveOverlayActive)!==!1&&c.items.some(S=>typeof S.message.messageType=="string"&&S.message.messageType.endsWith(".live"))||(F.kind="final-assistant"))}return n}function ls(e){return e.replace(/\s+/g," ").trim()}function zl(e){const t=ls(e);return t.length<=80?t:t.slice(0,80)}function cs(e){const t=ls(e);return t.length<=80?t:t.slice(0,77)+"..."}function Zt(e){return{sessionKey:e,expandedWarmTurns:new Set,coldPage:0}}function $t(e,t){return e.sessionKey===t?e:Zt(t)}function Vl(e,t){const n=$t(e,t);return{...n,coldPage:n.coldPage+1}}function Kl(e,t,n){const o=$t(e,t),s=Math.max(0,Math.floor(n));return o.coldPage>=s?o:{...o,coldPage:s}}function Wn(e,t,n,o){const s=$t(e,t),a=new Set(s.expandedWarmTurns);return o?a.add(n):a.delete(n),{...s,expandedWarmTurns:a}}function Gl(e){return e.role==="user"}function Zl(e){var t;return((t=e.messageType)==null?void 0:t.endsWith(".live"))===!0}function Jl(e){var a;const t=[];let n=-1,o=0;const s=(i,r)=>{t.push({userItem:i,assistantPreview:"",toolCount:0,startIdx:r,endIdx:e.length})};for(let i=0;i<e.length;i+=1){const r=e[i];if(Gl(r)){if(n>=0)t[t.length-1].endIdx=i;else{t.push({userItem:r,assistantPreview:"",toolCount:0,startIdx:o,endIdx:e.length}),n=i,o=i;continue}n=i,s(r,i)}else if(n>=0&&t.length>0){const c=t[t.length-1],h=((a=r.text)==null?void 0:a.trim())||"";r.role==="assistant"&&!Zl(r)&&h&&(c.assistantPreview=cs(h)),r.messageType==="toolCall"&&(c.toolCount+=1)}}return t}function Xl({turnCount:e,hotTurns:t,pageSize:n,coldPage:o}){const s=Math.max(0,e),a=Math.max(0,t),i=Math.max(0,s-Math.min(s,a));if(i===0)return{warmStartTurn:0,warmEndTurn:0,coldTurnCount:0};const r=Math.max(0,n),c=Math.max(0,Math.floor(o)),h=Math.min(i,r*(c+1));return{warmStartTurn:i-h,warmEndTurn:i,coldTurnCount:i-h}}function Yl({turn:e,turnCount:t,hotTurns:n,pageSize:o}){const s=Math.max(0,t),a=Math.max(0,n),i=Math.max(0,s-Math.min(s,a));if(i===0||e>=i)return 0;const r=Math.max(1,o),c=Math.max(0,Math.floor(e)),h=i-c;return Math.max(0,Math.ceil(h/r)-1)}function jn(e,t,n){if(t.length===0)return e.slice(0);if(n>=t.length)return[];const o=t[n].startIdx;return e.slice(o)}function Ql(e){const t={};for(const n of e)n.messageType==="worked"&&n.turnId&&typeof n.durationMs=="number"&&(t[n.turnId]=(t[n.turnId]??0)+n.durationMs);return t}function ec(e){const t=e.trim();if(!t)return"";if(t.startsWith("data:")||t.startsWith("blob:")||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/codex-local-image?"))return t;if(t.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(t)}`;const n=t.startsWith("/"),o=/^[A-Za-z]:[\\/]/u.test(t);return n||o?`/codex-local-image?path=${encodeURIComponent(t)}`:t}function Ne(e,t={}){const n=[],o=/codex:\/\/threads\/[A-Za-z0-9-]+|https?:\/\/[^\s<>"'`,。;:!?、()[\]{}「」『』《》]+|file:\/\/[^\n<>"'`,。;:!?、[\]{}「」『』《》]+|["'](?:[A-Za-z]:[\\/]|~\/|\.{1,2}\/|\/)[^\n"']+["']|`(?:[A-Za-z]:[\\/]|~\/|\.{1,2}\/|\/)[^`\n]+`/gu;let s=0;for(const a of e.matchAll(o)){if(typeof a.index!="number")continue;const i=a.index,r=i+a[0].length;let c=a[0],h="";for(;/[.,;:!?,。;:!?、]$/u.test(c);)h=c.slice(-1)+h,c=c.slice(0,-1);const g=ns(e,i,r,s,c),x=(g==null?void 0:g.segmentStart)??i,F=(g==null?void 0:g.segmentEnd)??r;x>s&&n.push({kind:"text",value:e.slice(s,x)}),g!=null&&g.tokenEndTrim&&(c=c.slice(0,-g.tokenEndTrim));const C=yt(c);c=C.core;const S=C.leading,w=C.trailing+h;S&&n.push({kind:"text",value:S});const v=wt(c);if(v)n.push({kind:"url",value:v,href:v}),w&&n.push({kind:"text",value:w});else if(c.startsWith("**")&&c.endsWith("**")&&c.length>4)n.push({kind:"bold",value:c.slice(2,-2)}),w&&n.push({kind:"text",value:w});else if(/^https?:\/\//u.test(c))n.push({kind:"url",value:c,href:c}),w&&n.push({kind:"text",value:w});else{const $=nt(c);$?(n.push({kind:"file",value:c,path:$.path,displayPath:c,downloadName:kt($.path)}),w&&n.push({kind:"text",value:w})):n.push({kind:"text",value:a[0]})}s=F}return s<e.length&&n.push({kind:"text",value:e.slice(s)}),t.applyMarkdownMarkers===!1?n:us(n)}function qt(e,t){const n=[];let o=!1,s="";const a=i=>{i&&n.push({kind:"text",value:i})};for(const i of e){if(i.kind!=="text"){o&&(a(`${t.marker}${s}`),o=!1,s=""),n.push(i);continue}let r=i.value;for(;r.length>0;){const c=r.indexOf(t.marker);if(c<0){o?s+=r:a(r);break}const h=r.slice(0,c);if(o?s+=h:a(h),r=r.slice(c+t.marker.length),o){const g=s;g.length>0&&(!t.isValidContent||t.isValidContent(g))?n.push({kind:t.kind,value:g}):a(`${t.marker}${g}${t.marker}`),s="",o=!1}else o=!0}}return o&&a(`${t.marker}${s}`),n}function us(e){const t=o=>o.trim().length>0&&!/^\s/u.test(o)&&!/\s$/u.test(o);let n=qt(e,{marker:"**",kind:"bold",isValidContent:t});return n=qt(n,{marker:"~~",kind:"strikethrough",isValidContent:t}),n=qt(n,{marker:"*",kind:"italic",isValidContent:t}),n}function tc(e,t={}){const n=[];let o=0,s=0;const a=(i,r)=>{let c=i.indexOf("[",r);for(;c>=0;){const h=i.indexOf("]",c+1);if(h<0)return null;if(i[h+1]!=="("){c=i.indexOf("[",c+1);continue}let g=1,x=h+2,F=!1;for(;x<i.length;){const C=i[x];if(C===`
|
|
28
|
+
`){F=!0;break}if(C==="("&&(g+=1),C===")"&&(g-=1,g===0)){const S=i.slice(c,x+1);if(zt(S))return{start:c,end:x+1,token:S};break}x+=1}if(F){c=i.indexOf("[",c+1);continue}c=i.indexOf("[",c+1)}return null};for(;s<e.length;){const i=a(e,s);if(!i)break;const{start:r,end:c,token:h}=i,g=ns(e,r,c,o,h),x=(g==null?void 0:g.segmentStart)??r,F=(g==null?void 0:g.segmentEnd)??c;x>o&&n.push(...Ne(e.slice(o,x),t));const C=zt(h);if(!C){n.push(...Ne(e.slice(x,F),t)),o=F,s=F;continue}const S=C.label,w=C.target,v=wt(w);if(v)n.push({kind:"url",value:S||v,href:v});else if(/^https?:\/\//u.test(w))n.push({kind:"url",value:S||w,href:w});else{const $=nt(w);$?n.push({kind:"file",value:w,path:$.path,displayPath:S||w,downloadName:kt($.path)}):n.push({kind:"text",value:h})}o=F,s=F}return o<e.length&&n.push(...Ne(e.slice(o),t)),n}function nc(e){const t=e.includes("`"),n=tc(e,{applyMarkdownMarkers:!t});if(!t)return n;if(!n.some(s=>s.kind==="text"&&s.value.includes("`")))return us(n);const o=s=>{if(!s.includes("`"))return Ne(s);const a=[];let i=0,r=0;for(;i<s.length;){if(s[i]!=="`"){i+=1;continue}let c=1;for(;i+c<s.length&&s[i+c]==="`";)c+=1;const h="`".repeat(c);let g=i+c,x=-1;for(;g<s.length;){const C=s.indexOf(h,g);if(C<0)break;const S=C>0&&s[C-1]==="`",w=C+c<s.length&&s[C+c]==="`",v=s.slice(i+c,C).includes(`
|
|
29
|
+
`);if(!S&&!w&&!v){x=C;break}g=C+1}if(x<0){i+=c;continue}i>r&&a.push(...Ne(s.slice(r,i)));const F=s.slice(i+c,x);if(F.length>0){const C=zt(F);if(C){const S=wt(C.target);if(S)a.push({kind:"url",value:C.label||S,href:S});else if(/^https?:\/\//u.test(C.target))a.push({kind:"url",value:C.label||C.target,href:C.target});else{const w=nt(C.target);w?a.push({kind:"file",value:C.target,path:w.path,displayPath:C.label||C.target,downloadName:kt(w.path)}):a.push({kind:"code",value:F})}}else{const S=wt(F);if(S)a.push({kind:"url",value:S,href:S});else if(/^https?:\/\/[^\s]+$/u.test(F))a.push({kind:"url",value:F,href:F});else{const w=nt(F);if(w){const v=w.line?`${w.path}:${String(w.line)}`:w.path;a.push({kind:"file",value:F,path:w.path,displayPath:v,downloadName:kt(w.path)})}else a.push({kind:"code",value:F})}}}else a.push({kind:"text",value:`${h}${h}`});i=x+c,r=i}return r<s.length&&a.push(...Ne(s.slice(r))),a};return n.flatMap(s=>s.kind==="text"?o(s.value):[s])}function ds(e){return e.replace(/\r\n/gu,`
|
|
30
|
+
`)}function _e(e){var n;return(((n=e.match(/^\s*/u))==null?void 0:n[0])??"").replace(/\t/gu," ").length}function fs(e,t){if(t<=0)return e.trimStart();let n=0,o=0;for(;n<e.length&&o<t;){const s=e[n];o+=s===" "?4:1,n+=1}return e.slice(n)}function Ie(e){return e.trim().length===0}function Jt(e){const t=e.match(/^\s{0,3}(#{1,6})\s+(.+)$/u);return t?{level:t[1].length,value:t[2].trim()}:null}function pt(e){const t=e.match(/^\s{0,3}>\s?(.*)$/u);return t?t[1]??"":null}function st(e){var n;const t=e.match(/^\s*[-*+]\s+(.+)$/u);return((n=t==null?void 0:t[1])==null?void 0:n.trim())??null}function sc(e){var n;const t=e.match(/^(\s*)[-*+]\s+(.+)$/u);return t?{indent:_e(t[1]??""),text:((n=t[2])==null?void 0:n.trim())??""}:null}function ot(e){var n;const t=e.match(/^\s*[-*+]\s+\[([ xX])\]\s+(.+)$/u);return t?{checked:(t[1]??" ").toLowerCase()==="x",text:((n=t[2])==null?void 0:n.trim())??""}:null}function qn(e){var n;const t=e.match(/^(\s*)[-*+]\s+\[([ xX])\]\s+(.+)$/u);return t?{indent:_e(t[1]??""),item:{checked:(t[2]??" ").toLowerCase()==="x",text:((n=t[3])==null?void 0:n.trim())??""}}:null}function hs(e){var n;const t=e.match(/^(\s*)(\d+)[.)]\s+(.+)$/u);return t?{indent:_e(t[1]??""),start:Number.parseInt(t[2]??"1",10)||1,text:((n=t[3])==null?void 0:n.trim())??""}:null}function Xt(e){var t;return((t=hs(e))==null?void 0:t.text)??null}function Un(e){return hs(e)}function Yt(e){const t=e.trim();if(!t.includes("|"))return null;let n=t;n.startsWith("|")&&(n=n.slice(1)),n.endsWith("|")&&(n=n.slice(0,-1));const o=[];let s="",a=0;for(let i=0;i<n.length;i+=1){const r=n[i];if(r==="\\"&&n[i+1]==="|"){s+="|",i+=1;continue}if(r==="`"){let c=1;for(;n[i+c]==="`";)c+=1;s+=n.slice(i,i+c),a===0?a=c:a===c&&(a=0),i+=c-1;continue}if(r==="|"&&a===0){o.push(s.trim()),s="";continue}s+=r}return o.push(s.trim()),o.some(i=>i.length>0)?o:null}function oc(e){const t=Yt(e);if(!t||t.length===0)return null;const n=t.map(o=>{const s=o.replace(/\s+/gu,"");if(!/^:?-{3,}:?$/u.test(s))return null;const a=s.startsWith(":"),i=s.endsWith(":");return a&&i?"center":i?"right":a?"left":null});return n.every((o,s)=>o!==null||/^-+$/u.test(t[s].replace(/\s+/gu,"")))?n:null}function Nn(e,t){return e.length===t?e:e.length>t?e.slice(0,t):[...e,...Array.from({length:t-e.length},()=>"")]}function zn(e,t){var g;if(t+1>=e.length)return null;const n=e[t],o=e[t+1],s=Yt(n),a=oc(o);if(!s||!a||s.length!==a.length)return null;const i=n.trim();if(!i.startsWith("|")&&(((g=i.match(/\|/gu))==null?void 0:g.length)??0)<2)return null;const r=s.length,c=[];let h=t+2;for(;h<e.length&&!Ie(e[h]);){const x=Yt(e[h]);if(!x)break;c.push(Nn(x,r)),h+=1}return{kind:"table",headers:Nn(s,r),rows:c,alignments:a}}function ac(e){return Ie(e)||bt(e)!==null||Qt(e)||Jt(e)!==null||pt(e)!==null||ot(e)!==null||st(e)!==null||Xt(e)!==null}function ic(e,t,n=-1){const o=[];let s=t;for(;s<e.length&&!(ac(e[s])||n>=0&&_e(e[s])<=n);)o.push(n>=0?fs(e[s],n+1):e[s]),s+=1;const a=o.join(`
|
|
31
|
+
`).trim();return a?{value:a,nextIndex:s}:null}function ms(e,t){for(let n=t;n<e.length;n+=1)if(!Ie(e[n]))return n;return-1}function rc(e,t,n,o=null,s=!1){const a=[];let i=t;for(;i<e.length;){const r=e[i];if(Ie(r)){const x=ms(e,i+1);if(x===-1){a.push(""),i=e.length;break}const F=o==null?void 0:o(e[x]);if(F&&F.indent===n||_e(e[x])<=n)break;a.push(""),i+=1;continue}const c=o==null?void 0:o(r);if(c&&c.indent===n)break;const h=_e(r),g=s&&(ot(r)!==null||st(r)!==null);if(h<=n&&!g)break;a.push(h>n?fs(r,n+1):r.trimStart()),i+=1}for(;a.length>0&&Ie(a[0]);)a.shift();for(;a.length>0&&Ie(a[a.length-1]);)a.pop();return a.length===0?null:{blocks:vt(a.join(`
|
|
32
|
+
`)),nextIndex:i}}function Vn(e,t,n,o=!1){const s=[];let a=t;const i=n(e[t]);if(!i)return null;const r=i.indent;for(;a<e.length;){const c=n(e[a]);if(c===null||c.indent!==r)break;const h=[c.text],g=[];for(a+=1;a<e.length;){if(Ie(e[a])){const w=ms(e,a+1);if(w===-1){a=e.length;break}const v=n(e[w]);if(v&&v.indent===r){a=w;break}if(_e(e[w])<=r){a=w;break}a+=1;continue}const x=n(e[a]);if(x&&x.indent===r)break;const F=_e(e[a])>r,C=o&&(ot(e[a])!==null||st(e[a])!==null);if(F||C){const w=rc(e,a,r,n,o);if(w){g.push(...w.blocks),a=w.nextIndex;continue}}if(_e(e[a])<=r)break;const S=ic(e,a,r);if(!S)break;h.push(S.value),a=S.nextIndex}s.push(g.length>0?{paragraphs:h,children:g}:{paragraphs:h})}return s.length>0?{items:s,nextIndex:a}:null}function Qt(e){return/^\s{0,3}(?:-{3,}|\*{3,}|_{3,})\s*$/u.test(e.trim())}function bt(e){const t=e.match(/^\s{0,3}(```+|~~~+)\s*([^\s`~][^`]*)?\s*$/u);return t?{marker:t[1],language:(t[2]??"").trim()}:null}function vt(e){var a;const n=ds(e).split(`
|
|
33
|
+
`),o=[];let s=0;for(;s<n.length;){if(Ie(n[s])){s+=1;continue}const i=bt(n[s]);if(i){s+=1;const w=[];for(;s<n.length;){if(n[s].trim()===i.marker){s+=1;break}w.push(n[s]),s+=1}o.push({kind:"codeBlock",language:i.language,value:w.join(`
|
|
34
|
+
`)});continue}if(Qt(n[s])){o.push({kind:"thematicBreak"}),s+=1;continue}const r=Jt(n[s]);if(r){o.push({kind:"heading",level:r.level,value:r.value}),s+=1;continue}if(pt(n[s])!==null){const w=[];for(;s<n.length;){const v=pt(n[s]);if(v===null)break;w.push(v),s+=1}o.push({kind:"blockquote",value:w.join(`
|
|
35
|
+
`).trim()});continue}const h=zn(n,s);if(h){o.push(h),s+=2+h.rows.length;continue}if(ot(n[s])!==null){const w=[],v=((a=qn(n[s]))==null?void 0:a.indent)??0;for(;s<n.length;){const $=qn(n[s]);if($===null||$.indent!==v)break;w.push($.item),s+=1}if(w.length>0){o.push({kind:"taskList",items:w});continue}}const x=st(n[s]);if(x!==null){const w=Vn(n,s,sc);if(w){o.push({kind:"unorderedList",items:w.items}),s=w.nextIndex;continue}if(x.length>0){o.push({kind:"unorderedList",items:[{paragraphs:[x]}]}),s+=1;continue}}const F=Xt(n[s]);if(F!==null){const w=Un(n[s]),v=Vn(n,s,Un,!0);if(v){o.push({kind:"orderedList",items:v.items,start:(w==null?void 0:w.start)??1}),s=v.nextIndex;continue}if(F.length>0){o.push({kind:"orderedList",items:[{paragraphs:[F]}],start:(w==null?void 0:w.start)??1}),s+=1;continue}}const C=[];for(;s<n.length&&!(Ie(n[s])||bt(n[s])||Qt(n[s])||Jt(n[s])||zn(n,s)||pt(n[s])!==null||ot(n[s])!==null||st(n[s])!==null||Xt(n[s])!==null);)C.push(n[s]),s+=1;const S=C.join(`
|
|
36
|
+
`).trim();S&&o.push({kind:"paragraph",value:S})}return o}function lc(e){if(!e.includes(")return vt(e);const t=[],n=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let o=0;for(const s of e.matchAll(n)){const[a,i,r]=s;if(typeof s.index!="number")continue;const c=s.index,h=c+a.length,g=ec(r.trim());g&&(c>o&&t.push(...vt(e.slice(o,c))),t.push({kind:"image",url:g,alt:i.trim(),markdown:a}),o=h)}return o<e.length&&t.push(...vt(e.slice(o))),t}function Kn(e){const n=ds(e).split(`
|
|
37
|
+
`),o=[];let s=0,a=0;const i=r=>{if(r<=a)return;const c=n.slice(a,r).join(`
|
|
38
|
+
`);o.push(...lc(c))};for(;s<n.length;){const r=bt(n[s]);if(!r){s+=1;continue}i(s),s+=1;const c=[];for(;s<n.length;){if(n[s].trim()===r.marker){s+=1;break}c.push(n[s]),s+=1}o.push({kind:"codeBlock",language:r.language,value:c.join(`
|
|
39
|
+
`)}),a=s}return i(n.length),o.length>0?o:[{kind:"paragraph",value:e}]}const cc=300,uc=1200,dc=300,fc=250;function hc(e){const{getCwd:t,isVideoMediaUrl:n}=e,o=q(null),s=q(0);let a=null;const i=new Map,r=new Map,c=new Map,h=new Map;function g(T,A,H,J){for(T.has(A)&&T.delete(A),T.set(A,H);T.size>J;){const ae=T.keys().next().value;if(ae===void 0)break;T.delete(ae)}return H}function x(){return o.value?Promise.resolve():(a||(a=Lo(()=>import("./common-BeuopZEI.js"),[]).then(T=>{o.value=T.default,h.clear(),c.clear(),s.value+=1}).finally(()=>{a=null})),a)}function F(){return!!o.value}function C(T){const A=r.get(T);return A?(r.delete(T),r.set(T,A),A):g(r,T,nc(T),uc)}function S(T){const A=T.trim();if(!A)return"#";const H=z=>z.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(z),J=nt(A),ae=(J==null?void 0:J.path)??A,D=ts(ae,t());if(H(D)){const z=D.startsWith("/")?D:`/${D}`;return`/codex-local-browse${encodeURI(z)}`}return"#"}function w(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 v(T){const A=i.get(T.id);if(A&&A.text===T.text&&A.cwd===t())return i.delete(T.id),i.set(T.id,A),A.blocks;const H=Kn(T.text);return g(i,T.id,{text:T.text,cwd:t(),blocks:H},cc).blocks}function $(T){return T.replace(/&/gu,"&").replace(/</gu,"<").replace(/>/gu,">").replace(/"/gu,""").replace(/'/gu,"'")}function b(T){var H;const A=((H=T.trim().split(/\s+/u)[0])==null?void 0:H.toLowerCase())??"";return A?as[A]??A:""}function L(T,A){const H=b(T);if(!H)return $(A);const J=o.value;if(!J)return $(A);try{if(J.getLanguage(H))return J.highlight(A,{language:H,ignoreIllegals:!0}).value}catch{}return $(A)}function I(T,A){return Dt(B(T,A))}function B(T,A){const H=`${s.value}\0${b(T)}\0${T}\0${A}`,J=h.get(H);return J!==void 0?(h.delete(H),h.set(H,J),J):g(h,H,L(T,A),fc)}function R(T){return C(T).map(A=>A.kind==="text"?$(A.value):A.kind==="bold"?`<strong class="message-bold-text">${$(A.value)}</strong>`:A.kind==="italic"?`<em class="message-italic-text">${$(A.value)}</em>`:A.kind==="strikethrough"?`<s class="message-strikethrough-text">${$(A.value)}</s>`:A.kind==="file"?`<a class="message-file-link" href="${$(S(A.path))}" target="_blank" rel="noopener noreferrer" title="${$(A.path)}">${$(A.displayPath)}</a>`:A.kind==="url"?`<a class="message-file-link" href="${$(A.href)}" target="_blank" rel="noopener noreferrer" title="${$(A.href)}">${$(A.value)}</a>`:`<code class="message-inline-code">${$(A.value)}</code>`).join("")}function U(T){return T.paragraphs.map(A=>`<div class="message-list-item-text message-list-item-paragraph">${R(A)}</div>`).join("")}function ee(T){var J;const A=U(T),H=((J=T.children)==null?void 0:J.map(ae=>fe(ae)).join(""))??"";return Dt(A+H)}function V(T){return T?` style="text-align:${T}"`:""}function fe(T){if(T.kind==="paragraph")return`<p class="message-text">${R(T.value)}</p>`;if(T.kind==="heading"){const A=Math.min(6,Math.max(1,Math.trunc(T.level))),H=ss(A),J=`message-heading ${os(A)}`;return`<${H} class="${J}">${R(T.value)}</${H}>`}if(T.kind==="blockquote")return`<blockquote class="message-blockquote">${R(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">${ee(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">${R(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">${ee(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((ae,D)=>`<th class="message-table-head-cell"${V(T.alignments[D]??null)}>${R(ae)}</th>`).join(""),H=T.rows.map(ae=>'<tr class="message-table-body-row">'+ae.map((D,z)=>`<td class="message-table-cell"${V(T.alignments[z]??null)}>${R(D)}</td>`).join("")+"</tr>").join(""),J=H?`<tbody>${H}</tbody>`:"";return`<div class="message-table-wrap"><table class="message-table"><thead><tr>${A}</tr></thead>${J}</table></div>`}return T.kind==="codeBlock"?`<div class="message-code-block">${T.language?`<div class="message-code-language">${$(T.language)}</div>`:""}<pre class="message-code-pre"><code class="hljs">${I(T.language,T.value)}</code></pre></div>`:T.kind==="thematicBreak"?'<hr class="message-divider">':n(T.url)?`<video class="message-image-preview message-video-preview message-markdown-image" src="${$(T.url)}" controls preload="metadata"></video>`:`<img class="message-image-preview message-markdown-image" src="${$(T.url)}" alt="${$(T.alt||"Embedded message image")}" loading="lazy">`}function Oe(T){const A=`${t()}\0${s.value}\0${T}`,H=c.get(A);if(H&&H.text===T&&H.cwd===t()&&H.highlightVersion===s.value)return c.delete(A),c.set(A,H),H.html;const J=Kn(T).map(D=>fe(D)).join(""),ae=Dt(J);return g(c,A,{text:T,cwd:t(),highlightVersion:s.value,html:ae},dc).html}function Ge(){i.clear(),r.clear(),c.clear(),h.clear()}return{highlightCacheVersion:s,hasHighlightLoaded:F,ensureHighlightJsLoaded:x,getInlineSegments:C,toBrowseUrl:S,toEditUrlFromBrowseHref:w,getMessageBlocks:v,renderListItemContentAsHtml:ee,renderCachedHighlightedCodeAsHtml:I,renderMarkdownBlocksAsHtml:Oe,clearRenderCaches:Ge}}const mc={key:0,class:"conversation-switching-bar",role:"status"},gc={key:1,class:"conversation-loading"},pc={key:2,class:"conversation-empty"},vc={key:0,class:"conversation-load-more"},kc=["disabled"],yc={key:1,class:"conversation-load-more conversation-warm-collapse"},wc=["disabled"],bc=["id"],Cc={class:"message-row","data-role":"system"},$c={class:"message-stack","data-role":"system"},xc={class:"message-row","data-role":"system","data-message-type":"fileChange"},Tc={class:"message-stack","data-role":"system"},_c={key:0,class:"conversation-item conversation-item-fold","data-role":"system","data-message-type":"processFold"},Ic={class:"message-row","data-role":"system"},Lc={class:"message-stack","data-role":"system"},Mc={key:0,class:"work-block-list"},Sc=["id","data-role","data-message-type"],Ac={key:0,class:"message-row thread-compaction-row","data-role":"system"},Fc={class:"thread-compaction-inline thread-compaction-inline--pending",role:"status"},Pc={key:1,class:"message-row thread-compaction-row","data-role":"system"},Ec={class:"thread-compaction-inline thread-compaction-inline--done",role:"status"},Bc={key:2,class:"message-row","data-role":"system"},Rc={class:"message-stack","data-role":"system"},Oc={class:"work-block-list"},Dc=["data-role","data-message-type"],Hc=["data-role"],Wc=["data-role"],jc={key:5,class:"message-row","data-role":"system","data-message-type":"plan"},qc={class:"message-stack","data-role":"system"},Uc={class:"thread-plan-record"},Nc={class:"thread-plan-record-header"},zc={key:0,class:"thread-plan-record-explanation"},Vc={key:1,class:"thread-plan-record-steps"},Kc=["data-status"],Gc={class:"thread-plan-record-marker","aria-hidden":"true"},Zc=["data-role","data-message-type"],Jc=["data-role"],Xc=["data-role"],Yc=["data-role"],Qc=["onClick"],eu=["src"],tu=["src","alt"],nu={key:1,class:"message-file-attachments"},su=["href","title"],ou={key:2,class:"message-skill-attachments"},au=["href","title"],iu={class:"message-skill-chip-prefix"},ru={class:"message-skill-chip-name"},lu=["data-role"],cu={key:0,class:"automation-message-label"},uu={key:0},du={key:1,class:"work-summary-wrap","aria-live":"polite"},fu={class:"work-summary-text"},hu={key:0,class:"message-text"},mu={key:2,class:"message-blockquote"},gu={key:3,class:"message-list message-list-unordered"},pu=["innerHTML"],vu={key:4,class:"message-list message-task-list"},ku=["data-checked"],yu={class:"message-list-item-text"},wu=["start"],bu=["innerHTML"],Cu={key:6,class:"message-table-wrap"},$u={class:"message-table"},xu={key:0},Tu={key:7,class:"message-code-block"},_u={key:0,class:"message-code-language"},Iu={class:"message-code-pre"},Lu=["innerHTML"],Mu={key:8,class:"message-divider"},Su={key:9,class:"message-text"},Au=["onClick"],Fu=["src"],Pu=["src","alt","onError"],Eu=["href","onClick"],Bu=["title","aria-label"],Ru=["aria-label"],Ou=["src"],Du=["src","alt"],Hu=16,Gn=30,Zn=20,Wu=200,ju=oe({__name:"ThreadConversation",props:{messages:{},pendingRequests:{},liveOverlay:{},liveTurnId:{},isLoading:{type:Boolean},activeThreadId:{},cwd:{},hasMorePersistedAbove:{type:Boolean},isLoadingPersistedAbove:{type:Boolean},loadEarlierMessages:{type:Function}},emits:["forkThread","rollback","respondServerRequest","fileChangesChanged"],setup(e,{expose:t,emit:n}){function o(u){return zo(u,a.cwd,X)}function s(u){return Ke(u,a.cwd)}const a=e,i=hc({getCwd:()=>a.cwd,isVideoMediaUrl:ht}),{highlightCacheVersion:r,hasHighlightLoaded:c,ensureHighlightJsLoaded:h,getInlineSegments:g,toBrowseUrl:x,toEditUrlFromBrowseHref:F,getMessageBlocks:C,renderListItemContentAsHtml:S,renderCachedHighlightedCodeAsHtml:w,renderMarkdownBlocksAsHtml:v,clearRenderCaches:$}=i,b=na({getMessages:()=>a.messages,getLiveOverlay:()=>a.liveOverlay,isCommandMessage:Ze}),{hiddenGroupedCommandIds:L,isCommandExpanded:I,isCommandCompact:B,isCommandOutputCondensed:R,toggleCommandExpand:U,getWorkBlockCommands:ee,pruneCommandIdSets:V}=b,fe=oa({toEditUrlFromBrowseHref:F}),{isFileLinkContextMenuVisible:Oe,fileLinkContextMenuX:Ge,fileLinkContextMenuY:T,fileLinkContextBrowseUrl:A,fileLinkContextEditUrl:H,handleConversationContextMenu:J,closeFileLinkContextMenu:ae}=fe,{isMobile:D}=Mo(),z=ea({getMessages:()=>a.messages,getLiveTurnId:()=>a.liveTurnId??"",isFileChangeMessage:Lt,isCopyableAssistantMessage:cn,isReasoningMessage:Tt,isPlanMessage:xt,isFoldMember:xn,getHiddenGroupedCommandIds:()=>L.value,isMobile:()=>D.value}),{anchoredFileChangeSummaryByAnchorId:ce,hiddenFileChangeMessageIds:ge,isDiffViewerFileListOpen:ie,diffViewerChanges:re,activeDiffViewerChange:pe,activeDiffViewerLines:N,toggleFileChangeSummary:ve,isFileChangeSummaryExpanded:Le,openDiffViewer:at,closeDiffViewer:Me,toggleDiffViewerFileList:gs,closeDiffViewerFileList:ps,selectDiffViewerChange:vs,readAnchoredFileChangeSummaryById:ke,isFileChangeSummaryExpandedById:ks,toggleFileChangeSummaryById:ys,readStandaloneFileChangeSummary:we,isFileChangeSummaryVisible:tn,pruneFileChangeSummaryIds:ws}=z,bs=ta({getMessages:()=>a.messages,isCopyableAssistantMessage:cn,isPlanMessage:xt,planStepCopyMarker:Tn,buildFileChangeCopyText:o,getAnchoredFileChangeSummaries:()=>ce.value}),{copiedResponseAnchorId:Cs,forkableTurnIndexByAnchorId:$s,showCopyResponseButton:xs,isCopyableUserMessage:Ts,copyUserMessage:_s,showForkResponseButton:Is,copyResponse:Ls}=bs,{buildFeedbackMailto:Ms,feedbackMailtoBase:Ss,recordVisibleFailure:As}=Yn(),{t:X}=me(),nn=Ss();function Fs(u,p){As(p);const M=u.currentTarget;M instanceof HTMLAnchorElement&&(M.href=Ms())}function Ze(u){return u.messageType==="commandExecution"&&!!u.commandExecution}function sn(u){return u.messageType==="compaction.pending"}function on(u){return u.messageType==="compaction.done"}function xt(u){return u.messageType==="plan"||u.messageType==="plan.live"}function an(u){return u.messageType==="modelSwitch"}function Tt(u){return u.messageType==="reasoning"&&!!u.reasoning}const _t=q(new Set);function rn(u){return _t.value.has(u.id)}function ln(u){const p=new Set(_t.value);p.has(u.id)?p.delete(u.id):p.add(u.id),_t.value=p}function It(u){return u.messageType==="toolCall"&&!!u.toolCall}function Ps(u){return u.messageType==="turnError"}function Lt(u){return u.messageType==="fileChange"&&u.fileChangeStatus==="completed"&&Array.isArray(u.fileChanges)&&u.fileChanges.length>0}function Es(u){return Ze(u)||It(u)||Lt(u)||sn(u)||on(u)||u.messageType==="plan"?!1:jl(u)}function cn(u){return u.role==="assistant"&&!Ze(u)&&u.messageType!=="worked"&&!(u.messageType??"").endsWith(".live")}const Mt=n,Se=q(null),un=q(null),Bs=aa({isVideo:ht}),{modalImageUrl:it,modalIsVideo:Rs,markdownImageFailureVersion:Os,isMarkdownImageFailed:Ds,onMarkdownImageError:Hs,openImageModal:dn,closeImageModal:rt}=Bs,Ws=sa({getActiveThreadId:()=>a.activeThreadId,getCwd:()=>a.cwd,onFileChangesChanged:()=>Mt("fileChangesChanged",a.activeThreadId),updateThreadFileChanges:Po,t:X}),{fileChangeActionKey:fn,isFileChangeActionable:hn,fileChangeActionStatus:mn,fileChangeActionErrorText:gn,fileChangeNextAction:pn,fileChangeActionLabel:vn,runFileChangeAction:js,resetFileChangeActions:qs}=Ws,$e=q(null),Us=E(()=>{const u=$e.value;return u?u.kind==="edit-message"?X("Rollback this turn?"):u.action==="undo"?X("Undo file changes?"):X("Redo file changes?"):""}),Ns=E(()=>{const u=$e.value;return u?u.kind==="edit-message"?X("This rolls the thread back to this turn so you can edit the message. Later replies will be removed."):u.filePathLabel?u.action==="undo"?X("Undo the changes to {file}? This modifies the working tree and Codex cannot revert it automatically.",{file:u.filePathLabel}):X("Redo the changes to {file}? This reapplies the edits to the working tree.",{file:u.filePathLabel}):u.action==="undo"?X("Undo the file changes from this turn? This modifies the working tree and Codex cannot revert it automatically."):X("Redo the file changes from this turn? This reapplies the edits to the working tree."):""}),Ae=q(!0);let Be=0,be=0,lt=0,Je=null;const kn=new WeakSet,Fe=q(Zt(a.activeThreadId)),yn=E(()=>$t(Fe.value,a.activeThreadId)),Pe=q(!1),St=E(()=>a.messages.filter(u=>!xt(u)&&!an(u))),De=E(()=>Jl(St.value)),At=E(()=>Xl({turnCount:De.value.length,hotTurns:Gn,pageSize:Zn,coldPage:yn.value.coldPage})),Ft=E(()=>At.value.warmStartTurn),He=E(()=>At.value.warmEndTurn),wn=E(()=>At.value.coldTurnCount),bn=E(()=>wn.value>0),Pt=E(()=>yn.value.expandedWarmTurns),zs=E(()=>{const u=St.value,p=De.value,M=[],O=Pt.value,Y=new Map,k=[];for(const W of a.messages){if(!an(W))continue;const K={from:W.modelSwitchFrom,to:W.modelSwitchTo};if(W.modelSwitchInsertAfterId){const ue=Y.get(W.modelSwitchInsertAfterId)??[];ue.push(K),Y.set(W.modelSwitchInsertAfterId,ue)}else k.push(K)}function he(W){const K=[];for(const ue of W){const Ce=Y.get(ue.message.id);Ce&&Ce.length>0&&(K.push(...Ce),Y.delete(ue.message.id))}return K}for(let W=Ft.value;W<He.value;W+=1){const K=p[W];if(!K)continue;const ue={turn:W,userText:cs(K.userItem.text),assistantPreview:K.assistantPreview,toolCount:K.toolCount,expanded:O.has(W)},Ce=O.has(W)?u.slice(K.startIdx,K.endIdx).map(We=>({message:We})):[],mt=he(u.slice(K.startIdx,Math.min(K.endIdx,u.length)).map(We=>({message:We})));M.push({key:`warm-${W}`,warm:ue,warmItems:Ce,processItems:[],fileChangeAnchorIds:[],...mt.length>0?{dividers:mt}:{}})}const xe=jn(u,p,He.value),Ye=xe[0];if(!Ye)return M;const Qe=u.findIndex(W=>W.id===Ye.id),_=Qe>=0?u.slice(Qe):xe;for(const W of Nl(_,{liveOverlayActive:a.liveOverlay!==null,liveTurnId:a.liveTurnId})){const K=W.items.find(de=>de.kind==="user"),ue=W.items.find(de=>de.kind==="final-assistant"),Ce=W.items.filter(de=>de!==K&&de!==ue&&de.message.messageType!=="worked").map(de=>({message:de.message,presentation:de.kind==="plan"?"plan":"process"})),mt=W.items.map(de=>de.message.id).filter(de=>!!ke(de)),We=he(W.items);M.push({key:W.key,warmItems:[],request:K?{message:K.message}:void 0,processItems:Ce,fileChangeAnchorIds:mt,finalItem:ue?{message:ue.message,presentation:"final-assistant"}:void 0,...We.length>0?{dividers:We}:{}})}const G=[...k,...Y.values()].flat();return G.length>0&&(M.length>0?M[0]={...M[0],leadingDividers:[...M[0].leadingDividers??[],...G]}:M.push({key:"leading-divider",warmItems:[],processItems:[],fileChangeAnchorIds:[],leadingDividers:G})),M}),Vs=E(()=>Ql(a.messages));function Ks(u){var M,O;const p=((M=u.request)==null?void 0:M.message.turnId)??((O=u.finalItem)==null?void 0:O.message.turnId);return p?Vs.value[p]:void 0}function Cn(){Fe.value=Vl(Fe.value,a.activeThreadId)}function Gs(u){Fe.value=Wn(Fe.value,a.activeThreadId,u,!Pt.value.has(u))}const $n=E(()=>De.value.map((u,p)=>({turn:p,text:zl(u.userItem.text)}))),Zs=E(()=>Math.max(0,$n.value.length-1)),Js=E(()=>{const u=new Map;return De.value.forEach((p,M)=>{u.set(p.userItem.id,M)}),u});function Et(u){return`question-anchor-${u}`}function Xs(u){const p=Js.value.get(u.id);if(p!==void 0&&!(p<He.value))return Et(p)}function Ys(u){if(u<He.value){let p=Fe.value;if(u<Ft.value){const M=Yl({turn:u,turnCount:De.value.length,hotTurns:Gn,pageSize:Zn});p=Kl(p,a.activeThreadId,M)}p=Wn(p,a.activeThreadId,u,!0),Fe.value=p}Ae.value=!1,gt().then(()=>{const p=Se.value,M=document.getElementById(Et(u));if(!p||!M)return;const O=M.getBoundingClientRect(),Y=p.getBoundingClientRect(),k=p.scrollTop+O.top-Y.top-12;p.scrollTo({top:Math.max(0,k),behavior:"smooth"})})}const Qs=E(()=>{const u=St.value,p=De.value,M=[];for(let he=Ft.value;he<He.value;he+=1){if(!Pt.value.has(he))continue;const xe=p[he];xe&&M.push(...u.slice(xe.startIdx,xe.endIdx))}const O=jn(u,p,He.value),Y=O[0];if(!Y)return M;const k=u.findIndex(he=>he.id===Y.id);return M.push(...k>=0?u.slice(k):O),M}),ct=E(()=>Dl(Qs.value)),Xe=E(()=>{var p;const u=new Map;for(const M of ct.value){const O=((p=M.messages[0])==null?void 0:p.id)??"";O&&u.set(O,M)}return u}),eo=E(()=>{const u=new Set;for(const p of ct.value)for(const M of p.messages)u.add(M.id);return u}),to=E(()=>{var M;const u=new Set,p=O=>L.value.has(O.id)||ge.value.has(O.id);for(const O of ct.value)Ol(O,p)&&u.add(((M=O.messages[0])==null?void 0:M.id)??"");return u}),no=E(()=>{const u=new Set;for(const p of ct.value)u.add(p.turnId);return u});function so(u){return Xe.value.has(u.id)}function xn(u){return eo.value.has(u.id)}function oo(u){var p;return((p=Xe.value.get(u.id))==null?void 0:p.messages)??[]}function ao(u){return Er(oo(u))}function io(u){var p;return u.type==="batch"?`tool-batch-${u.kind}-${((p=u.messages[0])==null?void 0:p.id)??""}`:u.message.id}function ro(u){const p=Xe.value.get(u.id);return p?Hl(p,{t:X,formatDuration:Nt}):""}function lo(u){var p;return((p=Xe.value.get(u.id))==null?void 0:p.running)??!1}function co(u){var p;return((p=Xe.value.get(u.id))==null?void 0:p.hasOutsideContent)??!0}function uo(u){return u.messageType==="worked"}const fo=E(()=>a.hasMorePersistedAbove===!0),ho=E(()=>!Ae.value&&(a.messages.length>0||a.pendingRequests.length>0||!!a.liveOverlay));function Tn(u){switch(u){case"completed":return"[x]";case"inProgress":return"[~]";default:return"[ ]"}}function mo(u){const p=$s.value[u];typeof p=="number"&&a.activeThreadId&&Mt("forkThread",{threadId:a.activeThreadId,turnIndex:p})}const Bt=E(()=>{const u={};for(const p of a.messages){if(p.role!=="user"||typeof p.turnIndex!="number")continue;const M=typeof p.turnId=="string"&&p.turnId.length>0?p.turnId:"";!M||p.text.trim().length===0||(u[p.id]=M)}return u});function go(u){return typeof Bt.value[u.id]=="string"}function po(u){Bt.value[u]&&($e.value={kind:"edit-message",messageId:u})}function _n(u,p){fn(u)&&($e.value={kind:"file-change",summary:u,action:p})}function In(u,p){!u||!fn(u)||!p.path||($e.value={kind:"file-change",summary:u,action:"undo",filePaths:[p.path],filePathLabel:s(p.path)})}function vo(){const u=$e.value;if($e.value=null,!!u){if(u.kind==="edit-message"){const p=Bt.value[u.messageId];p&&Mt("rollback",{turnId:p});return}js(u.summary,u.action,u.filePaths)}}function ko(){const u=Se.value,p=un.value;!u||!p||(u.scrollTop=u.scrollHeight,p.scrollIntoView({block:"end"}))}function yo(u){return u.scrollHeight-(u.scrollTop+u.clientHeight)<=Hu}function wo(){if(Se.value&&Ae.value){ut();return}}function ut(){Se.value&&ko()}function Rt(){return Ae.value}function Ln(){if(!Rt()){lt=0,be=0;return}if(ut(),lt-=1,lt<=0){be=0;return}be=requestAnimationFrame(Ln)}function dt(u=6){Rt()&&(be&&(cancelAnimationFrame(be),be=0),lt=Math.max(u,1),be=requestAnimationFrame(Ln))}function Mn(){dt(3)}function Sn(){Ae.value=!0,ut(),dt(4)}async function An(){var Y;const u=Se.value;if(!u||!a.hasMorePersistedAbove||Pe.value||a.isLoadingPersistedAbove===!0)return;Pe.value=!0;const p=a.activeThreadId,M=u.scrollHeight,O=u.scrollTop;try{await((Y=a.loadEarlierMessages)==null?void 0:Y.call(a,p)),await gt(),a.activeThreadId===p&&(u.scrollTop=O+(u.scrollHeight-M))}finally{Pe.value=!1}}t({jumpToLatest:Sn});function bo(){if(!Rt())return;const u=Se.value;if(!u)return;const p=u.querySelectorAll("img.message-image-preview");for(const M of p)M.complete||kn.has(M)||(kn.add(M),M.addEventListener("load",Mn,{once:!0}),M.addEventListener("error",Mn,{once:!0}))}async function ft(){return Je||(Je=gt().then(()=>new Promise(u=>{Be&&cancelAnimationFrame(Be),Be=requestAnimationFrame(()=>{Be=0,Je=null,wo(),bo(),dt(),u()})})),Je)}Te(()=>a.messages,async u=>{if(a.isLoading)return;const p=new Set(u.filter(M=>M.messageType==="commandExecution"&&M.commandExecution).map(M=>M.id));V(p),ws(),await ft()}),Te(()=>a.messages.some(u=>u.text.includes("```")),u=>{!u||c()||h()},{immediate:!0}),Te(()=>a.pendingRequests,async()=>{a.isLoading||await ft()},{deep:!0}),Te(()=>a.liveOverlay,async u=>{u&&Ae.value&&(await gt(),ut(),dt(8))},{deep:!0}),Te(()=>a.isLoading,async u=>{u||await ft()}),Te(()=>a.activeThreadId,async()=>{Ae.value=!0,it.value="",Pe.value=!1,qs(),Fe.value=Zt(a.activeThreadId),await ft()},{flush:"post"});function Co(){const u=Se.value;!u||a.isLoading||(Ae.value=yo(u),u.scrollTop<Wu&&!Pe.value&&(bn.value?Cn():a.hasMorePersistedAbove===!0&&An()))}const Ot=/\.(mp4|m4v|webm|mov|mkv|ogv|ogg|mpeg|avi)$/iu;function ht(u){const p=u.trim();if(!p)return!1;if(p.startsWith("data:video/"))return!0;try{const M=new URL(p,window.location.href);return Ot.test(M.pathname)?!0:M.pathname==="/codex-local-image"?Ot.test(M.searchParams.get("path")??""):!1}catch{return Ot.test(p)}}return Ct(()=>{$(),Be&&(cancelAnimationFrame(Be),Be=0),be&&(cancelAnimationFrame(be),be=0)}),(u,p)=>(l(),f(j,null,[m("section",{class:"conversation-root",onContextmenuCapture:p[4]||(p[4]=(...M)=>d(J)&&d(J)(...M))},[e.isLoading&&e.messages.length>0?(l(),f("div",mc,y(d(X)("Loading messages...")),1)):P("",!0),e.isLoading&&e.messages.length===0?(l(),f("p",gc,y(d(X)("Loading messages...")),1)):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(l(),f("p",pc,y(d(X)("No messages in this thread yet.")),1)):(l(),f("ul",{key:3,ref_key:"conversationListRef",ref:Se,class:"conversation-list",onScroll:Co},[fo.value?(l(),f("li",vc,[m("button",{type:"button",class:"load-more-button",disabled:Pe.value||e.isLoadingPersistedAbove,onClick:An},y(Pe.value||e.isLoadingPersistedAbove?d(X)("Loading…"):d(X)("Load earlier messages")),9,kc)])):P("",!0),bn.value?(l(),f("li",yc,[m("button",{type:"button",class:"load-more-button",disabled:Pe.value,onClick:Cn},y(d(X)("Load earlier ({n} turns)",{n:wn.value})),9,wc)])):P("",!0),(l(!0),f(j,null,Z(zs.value,M=>(l(),f(j,{key:M.key},[(l(!0),f(j,null,Z(M.leadingDividers??[],O=>(l(),f("li",{key:`${M.key}-leading-${O.to??""}-${O.from??""}`,class:"conversation-item conversation-item-model-switch","data-role":"system","data-message-type":"modelSwitch"},[Q(Bn,{from:O.from,to:O.to},null,8,["from","to"])]))),128)),Q(fl,{"turn-key":M.key,warm:M.warm,"warm-items":M.warmItems,request:M.request,"process-items":M.processItems,"final-item":M.finalItem,"file-change-anchor-ids":M.fileChangeAnchorIds,"duration-ms":Ks(M)},{"warm-card":qe(({warm:O})=>[m("li",{id:Et(O.turn),class:"conversation-item conversation-item-warm-card","data-role":"system","data-message-type":"warmTurn"},[m("div",Cc,[m("div",$c,[Q(yl,{"user-text":O.userText,"assistant-preview":O.assistantPreview,"tool-count":O.toolCount,expanded:O.expanded,onToggle:Y=>Gs(O.turn)},null,8,["user-text","assistant-preview","tool-count","expanded","onToggle"])])])],8,bc)]),"file-change":qe(({anchorMessageId:O})=>[m("div",xc,[m("div",Tc,[d(tn)(d(ke)(O))?(l(),se(En,{key:0,summary:d(ke)(O),expanded:d(ks)(O),cwd:a.cwd,actionable:d(hn)(d(ke)(O)),"action-status":d(mn)(d(ke)(O)),"action-error-text":d(gn)(d(ke)(O)),"next-action":d(pn)(d(ke)(O)),"action-label":d(vn)(d(ke)(O)),onToggle:Y=>d(ys)(O),onOpenDiff:Y=>d(at)(d(ke)(O),Y),onRequestAction:Y=>_n(d(ke)(O),Y),onRequestFileAction:Y=>In(d(ke)(O),Y)},null,8,["summary","expanded","cwd","actionable","action-status","action-error-text","next-action","action-label","onToggle","onOpenDiff","onRequestAction","onRequestFileAction"])):P("",!0)])])]),default:qe(({item:O,section:Y})=>[(l(!0),f(j,null,Z([O.message],k=>{var he,xe,Ye,Qe;return l(),f(j,{key:k.id},[so(k)&&!to.value.has(k.id)?(l(),f("li",_c,[m("div",Ic,[m("div",Lc,[Q(mr,{label:ro(k),running:lo(k),"has-outside-content":co(k)},{default:qe(()=>[(l(!0),f(j,null,Z(ao(k),_=>(l(),f(j,{key:io(_)},[_.type==="batch"?(l(),se(Yr,{key:0,kind:_.kind,messages:_.messages},null,8,["kind","messages"])):(l(!0),f(j,{key:1},Z([_.message],G=>(l(),f(j,{key:G.id},[!d(L).has(G.id)&&!d(ge).has(G.id)?(l(),f(j,{key:0},[Ze(G)?(l(),f("div",Mc,[(l(!0),f(j,null,Z(d(ee)(G),(W,K)=>(l(),se(Dn,{key:`work-cmd-${W.id}`,command:W,"step-index":K,expanded:d(I)(W),compact:d(B)(W),"output-condensed":d(R)(W),onToggle:ue=>d(U)(W)},null,8,["command","step-index","expanded","compact","output-condensed","onToggle"]))),128))])):It(G)?(l(),se(Gt,{key:1,message:G},null,8,["message"])):Tt(G)?(l(),se(On,{key:2,message:G,expanded:rn(G),"content-html":d(v)(G.text),onToggle:W=>ln(G)},null,8,["message","expanded","content-html","onToggle"])):P("",!0)],64)):P("",!0)],64))),128))],64))),128))]),_:2},1032,["label","running","has-outside-content"])])])])):!xn(k)&&!d(L).has(k.id)&&!d(ge).has(k.id)&&!(uo(k)&&no.value.has(k.turnId??""))&&!Es(k)?(l(),f("li",{key:1,id:Xs(k),class:te(["conversation-item",{"conversation-item-request":Y==="request","conversation-item-process":Y==="process"||O.presentation==="process","conversation-item-final":Y==="final"||O.presentation==="final-assistant","conversation-item-plan":O.presentation==="plan"}]),"data-role":k.role,"data-message-type":k.messageType||""},[sn(k)?(l(),f("div",Ac,[m("div",Fc,[p[6]||(p[6]=m("span",{class:"thread-compaction-spinner","aria-hidden":"true"},null,-1)),m("span",null,y(d(X)("Compacting thread context…")),1)])])):on(k)?(l(),f("div",Pc,[m("div",Ec,y(d(X)("Context compacted")),1)])):Ze(k)?(l(),f("div",Bc,[m("div",Rc,[m("div",Oc,[(l(!0),f(j,null,Z(d(ee)(k),(_,G)=>(l(),se(Dn,{key:`work-cmd-${_.id}`,command:_,"step-index":G,expanded:d(I)(_),compact:d(B)(_),"output-condensed":d(R)(_),onToggle:W=>d(U)(_)},null,8,["command","step-index","expanded","compact","output-condensed","onToggle"]))),128))])])])):It(k)?(l(),se(Gt,{key:3,message:k},null,8,["message"])):Lt(k)?(l(),f("div",{key:4,class:"message-row","data-role":k.role,"data-message-type":k.messageType||""},[m("div",{class:"message-stack","data-role":k.role},[m("article",{class:"message-body","data-role":k.role},[d(tn)(d(we)(k))?(l(),se(En,{key:0,summary:d(we)(k),expanded:d(Le)(k),cwd:a.cwd,actionable:d(hn)(d(we)(k)),"action-status":d(mn)(d(we)(k)),"action-error-text":d(gn)(d(we)(k)),"next-action":d(pn)(d(we)(k)),"action-label":d(vn)(d(we)(k)),onToggle:_=>d(ve)(k),onOpenDiff:_=>d(at)(d(we)(k),_),onRequestAction:_=>_n(d(we)(k),_),onRequestFileAction:_=>In(d(we)(k),_)},null,8,["summary","expanded","cwd","actionable","action-status","action-error-text","next-action","action-label","onToggle","onOpenDiff","onRequestAction","onRequestFileAction"])):P("",!0)],8,Wc)],8,Hc)],8,Dc)):O.presentation==="plan"?(l(),f("div",jc,[m("div",qc,[m("article",Uc,[m("div",Nc,y(d(X)("Plan")),1),(he=d(et)(k))!=null&&he.explanation?(l(),f("p",zc,y((xe=d(et)(k))==null?void 0:xe.explanation),1)):P("",!0),(Ye=d(et)(k))!=null&&Ye.steps.length?(l(),f("ol",Vc,[(l(!0),f(j,null,Z((Qe=d(et)(k))==null?void 0:Qe.steps,(_,G)=>(l(),f("li",{key:`${k.id}-plan-${G}`,"data-status":_.status},[m("span",Gc,y(Tn(_.status)),1),m("span",null,y(_.step),1)],8,Kc))),128))])):P("",!0)])])])):(l(),f("div",{key:6,class:te(["message-row",{"message-row-final":O.presentation==="final-assistant"}]),"data-role":k.role,"data-message-type":k.messageType||""},[m("div",{class:"message-stack","data-role":k.role},[m("article",{class:"message-body","data-role":k.role},[k.images&&k.images.length>0?(l(),f("ul",{key:0,class:te(["message-image-list",{"message-generated-image-list":k.messageType==="imageView"}]),"data-role":k.role},[(l(!0),f(j,null,Z(k.images,_=>(l(),f("li",{key:_,class:"message-image-item"},[m("button",{class:"message-image-button",type:"button",onClick:G=>d(dn)(_)},[ht(_)?(l(),f("video",{key:0,class:te(["message-image-preview message-video-preview",{"message-generated-image-preview":k.messageType==="imageView"}]),src:_,controls:"",preload:"metadata"},null,10,eu)):(l(),f("img",{key:1,class:te(["message-image-preview",{"message-generated-image-preview":k.messageType==="imageView"}]),src:_,alt:k.messageType==="imageView"?"Generated image":"Message image preview",loading:"lazy"},null,10,tu))],8,Qc)]))),128))],10,Yc)):P("",!0),k.fileAttachments&&k.fileAttachments.length>0?(l(),f("div",nu,[(l(!0),f(j,null,Z(k.fileAttachments,_=>(l(),f("span",{key:`${k.id}:${_.path}`,class:"message-file-chip"},[p[7]||(p[7]=m("span",{class:"message-file-chip-icon"},"📄",-1)),m("a",{class:"message-file-link message-file-chip-name",href:d(x)(_.path),target:"_blank",rel:"noopener noreferrer",title:_.path},y(_.label),9,su)]))),128))])):P("",!0),k.skills&&k.skills.length>0?(l(),f("div",ou,[(l(!0),f(j,null,Z(k.skills,_=>(l(),f("a",{key:`${k.id}:${_.path}`,class:"message-skill-chip",href:d(x)(_.path),title:_.path},[m("span",iu,y(d(X)("Skill")),1),m("span",ru,y(_.name),1)],8,au))),128))])):P("",!0),k.text.length>0?(l(),f("article",{key:3,class:"message-card","data-role":k.role},[k.isAutomationRun?(l(),f("div",cu,[p[8]||(p[8]=m("span",null,"Sent via automation",-1)),k.automationDisplayName?(l(),f("code",uu,y(k.automationDisplayName),1)):P("",!0)])):P("",!0),k.messageType==="worked"?(l(),f("div",du,[m("p",fu,y(k.text),1)])):Tt(k)?(l(),se(On,{key:2,message:k,expanded:rn(k),"content-html":d(v)(k.text),onToggle:_=>ln(k)},null,8,["message","expanded","content-html","onToggle"])):So([k.id,k.text,a.cwd,d(r),d(Os)],()=>(l(),f("div",{key:3,class:"message-text-flow"},[(l(!0),f(j,null,Z(d(C)(k),(_,G)=>(l(),f(j,{key:`block-${G}`},[_.kind==="paragraph"?(l(),f("p",hu,[Q(je,{segments:d(g)(_.value),"to-browse-url":d(x)},null,8,["segments","to-browse-url"])])):_.kind==="heading"?(l(),se(Ao(d(ss)(_.level)),{key:1,class:te(["message-heading",d(os)(_.level)])},{default:qe(()=>[Q(je,{segments:d(g)(_.value),"to-browse-url":d(x)},null,8,["segments","to-browse-url"])]),_:2},1032,["class"])):_.kind==="blockquote"?(l(),f("blockquote",mu,[Q(je,{segments:d(g)(_.value),"to-browse-url":d(x)},null,8,["segments","to-browse-url"])])):_.kind==="unorderedList"?(l(),f("ul",gu,[(l(!0),f(j,null,Z(_.items,(W,K)=>(l(),f("li",{key:`ul-${G}-${K}`,class:"message-list-item"},[m("div",{class:"message-list-item-content",innerHTML:d(S)(W)},null,8,pu)]))),128))])):_.kind==="taskList"?(l(),f("ul",vu,[(l(!0),f(j,null,Z(_.items,(W,K)=>(l(),f("li",{key:`task-${G}-${K}`,class:"message-task-item"},[m("span",{class:"message-task-checkbox","data-checked":W.checked},y(W.checked?"☑":"☐"),9,ku),m("div",yu,[Q(je,{segments:d(g)(W.text),"to-browse-url":d(x)},null,8,["segments","to-browse-url"])])]))),128))])):_.kind==="orderedList"?(l(),f("ol",{key:5,class:"message-list message-list-ordered",start:_.start},[(l(!0),f(j,null,Z(_.items,(W,K)=>(l(),f("li",{key:`ol-${G}-${K}`,class:"message-list-item"},[m("div",{class:"message-list-item-content",innerHTML:d(S)(W)},null,8,bu)]))),128))],8,wu)):_.kind==="table"?(l(),f("div",Cu,[m("table",$u,[m("thead",null,[m("tr",null,[(l(!0),f(j,null,Z(_.headers,(W,K)=>(l(),f("th",{key:`th-${G}-${K}`,class:"message-table-head-cell",style:tt({textAlign:_.alignments[K]??"left"})},[Q(je,{segments:d(g)(W),"to-browse-url":d(x)},null,8,["segments","to-browse-url"])],4))),128))])]),_.rows.length>0?(l(),f("tbody",xu,[(l(!0),f(j,null,Z(_.rows,(W,K)=>(l(),f("tr",{key:`tr-${G}-${K}`,class:"message-table-body-row"},[(l(!0),f(j,null,Z(W,(ue,Ce)=>(l(),f("td",{key:`td-${G}-${K}-${Ce}`,class:"message-table-cell",style:tt({textAlign:_.alignments[Ce]??"left"})},[Q(je,{segments:d(g)(ue),"to-browse-url":d(x)},null,8,["segments","to-browse-url"])],4))),128))]))),128))])):P("",!0)])])):_.kind==="codeBlock"?(l(),f("div",Tu,[_.language?(l(),f("div",_u,y(_.language),1)):P("",!0),m("pre",Iu,[m("code",{class:"hljs",innerHTML:d(w)(_.language,_.value)},null,8,Lu)])])):_.kind==="thematicBreak"?(l(),f("hr",Mu)):d(Ds)(k.id,G)?(l(),f("p",Su,y(_.markdown),1)):(l(),f("button",{key:10,class:"message-image-button",type:"button",onClick:W=>d(dn)(_.url)},[ht(_.url)?(l(),f("video",{key:0,class:"message-image-preview message-video-preview message-markdown-image",src:_.url,controls:"",preload:"metadata"},null,8,Fu)):(l(),f("img",{key:1,class:"message-image-preview message-markdown-image",src:_.url,alt:_.alt||"Embedded message image",loading:"lazy",onError:W=>d(Hs)(k.id,G)},null,40,Pu))],8,Au))],64))),128))])),p,0),Ps(k)?(l(),f("a",{key:4,class:"turn-error-feedback",href:d(nn),onClick:_=>Fs(_,k.text)},y(d(X)("Send feedback")),9,Eu)):P("",!0)],8,lu)):P("",!0),Y!=="process"?(l(),se(ir,{key:4,role:k.role,"show-edit":go(k),"show-fork":d(Is)(k),"show-copy":d(xs)(k)||d(Ts)(k),copied:d(Cs)===k.id,onEdit:_=>po(k.id),onFork:_=>mo(k.id),onCopy:_=>k.role==="user"?d(_s)(k.id):d(Ls)(k.id)},null,8,["role","show-edit","show-fork","show-copy","copied","onEdit","onFork","onCopy"])):P("",!0)],8,Xc)],8,Jc)],10,Zc))],10,Sc)):P("",!0)],64)}),128))]),_:2},1032,["turn-key","warm","warm-items","request","process-items","final-item","file-change-anchor-ids","duration-ms"]),(l(!0),f(j,null,Z(M.dividers??[],O=>(l(),f("li",{key:`${M.key}-divider-${O.to??""}-${O.from??""}`,class:"conversation-item conversation-item-model-switch","data-role":"system","data-message-type":"modelSwitch"},[Q(Bn,{from:O.from,to:O.to},null,8,["from","to"])]))),128))],64))),128)),e.liveOverlay?(l(),se(Ri,{key:2,overlay:e.liveOverlay,"feedback-mailto":d(nn)},null,8,["overlay","feedback-mailto"])):P("",!0),m("li",{ref_key:"bottomAnchorRef",ref:un,class:"conversation-bottom-anchor"},null,512)],544)),Q(wr,{anchors:$n.value,"active-turn":Zs.value,onJump:Ys},null,8,["anchors","active-turn"]),ho.value?(l(),f("button",{key:4,type:"button",class:"jump-to-latest-button",title:d(X)("Jump to latest"),"aria-label":d(X)("Jump to latest output"),onClick:Sn},[Q(Fo,{class:"icon-svg jump-to-latest-icon"})],8,Bu)):P("",!0),d(it).length>0?(l(),f("div",{key:5,class:"image-modal-backdrop",onClick:p[3]||(p[3]=(...M)=>d(rt)&&d(rt)(...M))},[m("div",{class:"image-modal-content",onClick:p[2]||(p[2]=ze(()=>{},["stop"]))},[m("button",{class:"image-modal-close",type:"button","aria-label":d(X)("Close image preview"),onClick:p[1]||(p[1]=(...M)=>d(rt)&&d(rt)(...M))},[Q(Xn,{class:"icon-svg"})],8,Ru),d(Rs)?(l(),f("video",{key:0,class:"image-modal-image",src:d(it),controls:"",autoplay:""},null,8,Ou)):(l(),f("img",{key:1,class:"image-modal-image",src:d(it),alt:d(X)("Expanded message image")},null,8,Du))])])):P("",!0),Q(ki,{visible:d(Oe),x:d(Ge),y:d(T),"browse-url":d(A),"edit-url":d(H),onClose:d(ae)},null,8,["visible","x","y","browse-url","edit-url","onClose"]),Q(Ja,{change:d(pe),changes:d(re),lines:d(N),"is-mobile":d(D),"is-file-list-open":d(ie),cwd:a.cwd,onClose:d(Me),onSelectChange:d(vs),onToggleFileList:d(gs),onCloseFileList:d(ps)},null,8,["change","changes","lines","is-mobile","is-file-list-open","cwd","onClose","onSelectChange","onToggleFileList","onCloseFileList"])],32),Q(da,{visible:$e.value!==null,title:Us.value,message:Ns.value,"confirm-label":"Confirm",danger:"",onConfirm:vo,onCancel:p[5]||(p[5]=M=>$e.value=null)},null,8,["visible","title","message"])],64))}}),Nu=ne(ju,[["__scopeId","data-v-92dff0d0"]]);export{Nu as default};
|