@onescience/onecode-web 1.14.50 → 1.14.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/assets/{alert-01-C7YX7Aal.js → alert-01-CW6wwOvC.js} +1 -1
  2. package/assets/{alert-02-BRTtgSFM.js → alert-02-6lH2HJgE.js} +1 -1
  3. package/assets/{alert-04-Bi0fUq3t.js → alert-04-CzC4DkPI.js} +1 -1
  4. package/assets/{alert-05-rvgwPhlO.js → alert-05-6_xUYpKY.js} +1 -1
  5. package/assets/alert-06-DGxdxMcO.js +1 -0
  6. package/assets/alert-07-zYP7tPac.js +1 -0
  7. package/assets/alert-08-CQB2MGsE.js +1 -0
  8. package/assets/alert-10-Cg4L1P2U.js +1 -0
  9. package/assets/bip-bop-03-JYOBGlba.js +1 -0
  10. package/assets/bip-bop-04-CwuPWFEP.js +1 -0
  11. package/assets/bip-bop-06-XgpDh7si.js +1 -0
  12. package/assets/bip-bop-08-Cuo_PLpP.js +1 -0
  13. package/assets/bip-bop-09-DGYhCCuy.js +1 -0
  14. package/assets/{dialog-create-project-folder-Df7AoZN3.js → dialog-create-project-folder-BcfomxJS.js} +1 -1
  15. package/assets/{dialog-edit-project-BxgydLD6.js → dialog-edit-project-D_df2O_R.js} +1 -1
  16. package/assets/{dialog-fork-BlPsgpEl.js → dialog-fork-CsNghmMe.js} +1 -1
  17. package/assets/{dialog-manage-models-B2Pu-2Ed.js → dialog-manage-models-BvLZMn_B.js} +1 -1
  18. package/assets/{dialog-select-directory-BmA55yI0.js → dialog-select-directory-Cjrn7KJ5.js} +1 -1
  19. package/assets/{dialog-select-file-DDMfQKOH.js → dialog-select-file-Cpz_IOae.js} +1 -1
  20. package/assets/{dialog-select-mcp-D4Fk_8Bh.js → dialog-select-mcp-CorJoctC.js} +1 -1
  21. package/assets/{dialog-select-model-TbqtFTp2.js → dialog-select-model-BWM77It1.js} +2 -2
  22. package/assets/{dialog-select-provider-DBAFXW9Y.js → dialog-select-provider-D2zjdaGd.js} +1 -1
  23. package/assets/{dialog-select-server-DEKX4zKb.js → dialog-select-server-BKRhXDIA.js} +2 -2
  24. package/assets/{dialog-select-ssh-vQRD5vyu.js → dialog-select-ssh-D9WfgY1Y.js} +1 -1
  25. package/assets/{dialog-settings-CmwUQtlX.js → dialog-settings-C4hQL70e.js} +1 -1
  26. package/assets/ghostty-web-CxnxzwNu.js +13 -0
  27. package/assets/index-BsKb4267.js +2501 -0
  28. package/assets/{index-B4Jlv0hK.css → index-DaUI7t-Y.css} +1 -1
  29. package/assets/{list-CpNOeYBH.js → list-Bm4iAmpR.js} +1 -1
  30. package/assets/{nope-02-BTzlbxwl.js → nope-02-DTSnEFcm.js} +1 -1
  31. package/assets/{nope-05-TaG3hJE-.js → nope-05-DrR7UT0F.js} +1 -1
  32. package/assets/{nope-08-B5VS1O6l.js → nope-08-hNR6BcH3.js} +1 -1
  33. package/assets/{nope-11-CPCYI8vb.js → nope-11-C_lxjVUg.js} +1 -1
  34. package/assets/nope-12-yTLnCxek.js +1 -0
  35. package/assets/{prompt-helper-dialog-eneteG4A.js → prompt-helper-dialog-CLsUOD_2.js} +1 -1
  36. package/assets/{server-row-CxlejZ4e.js → server-row-BlSuASA8.js} +1 -1
  37. package/assets/staplebops-03-CsKtL-49.js +1 -0
  38. package/assets/staplebops-04-ITUKYVIC.js +1 -0
  39. package/assets/staplebops-06-DhqvrUir.js +1 -0
  40. package/assets/staplebops-07-DHfC0Apk.js +1 -0
  41. package/assets/{status-popover-body-BgKHdQKI.js → status-popover-body-CbmFqoOr.js} +2 -2
  42. package/assets/{switch-C2yZIpi3.js → switch-D1CmhYGB.js} +1 -1
  43. package/assets/{tag-LsVlkTp8.js → tag-B9_ddZHF.js} +1 -1
  44. package/assets/{yup-01-D3mKRwe-.js → yup-01-7QZuklRh.js} +1 -1
  45. package/assets/{yup-03-DSlLP5dz.js → yup-03-DmaMyZra.js} +1 -1
  46. package/assets/{yup-04-BtM8nNQH.js → yup-04-BKvLbMb3.js} +1 -1
  47. package/assets/{yup-05-DKsTbXdS.js → yup-05-DgACT-0v.js} +1 -1
  48. package/index.html +9 -9
  49. package/package.json +2 -2
  50. package/assets/alert-06-BbqR6a-k.js +0 -1
  51. package/assets/alert-07-zb39atti.js +0 -1
  52. package/assets/alert-08-Bt5QOLRj.js +0 -1
  53. package/assets/alert-10-BzCEru8o.js +0 -1
  54. package/assets/bip-bop-03-B_y8WwjM.js +0 -1
  55. package/assets/bip-bop-04-B6gmPb9a.js +0 -1
  56. package/assets/bip-bop-06-Djjj5YU3.js +0 -1
  57. package/assets/bip-bop-08-BtAjCJUh.js +0 -1
  58. package/assets/bip-bop-09-D2FLYhzM.js +0 -1
  59. package/assets/ghostty-web-D1g35o4c.js +0 -13
  60. package/assets/index-C1hWguPq.js +0 -2501
  61. package/assets/nope-12-DlB_ucWn.js +0 -1
  62. package/assets/staplebops-03-AuC1-X5O.js +0 -1
  63. package/assets/staplebops-04-CZno_WaB.js +0 -1
  64. package/assets/staplebops-06-6cEb9lc7.js +0 -1
  65. package/assets/staplebops-07-Dx4UTR1o.js +0 -1
@@ -1 +1 @@
1
- import{i as r,t as g,a4 as je,f as ie,a5 as Ke,u as xe,a6 as Oe,a7 as be,k as _e,h as E,a8 as Le,c as we,e as $e,j as me,w as ye,n as t,a3 as Be,I as Y,E as j,p as U,a9 as H,T as re,aa as Ne,ab as Me,ac as Ie,ad as Re,ae as We,af as Ge,m as de,B as Z,ag as Ve,ah as Ue,ai as qe,aj as He,y as W,ak as Ye,d as Je,al as Qe,o as Xe,v as ke,F as te,A as Ze,r as et,L as tt,am as nt,an as rt,O as st,ao as it,b as at,g as lt,G as ce,P as oe,ap as ot,J as ct,aq as B,D as dt}from"./index-C1hWguPq.js";import{S as D}from"./switch-C2yZIpi3.js";import{L as gt,D as ut,a as pt,b as ft}from"./dialog-select-provider-DBAFXW9Y.js";import{T as le}from"./tag-LsVlkTp8.js";import"./list-CpNOeYBH.js";var ht=g('<div class="bg-surface-base px-4 rounded-lg">');const N=n=>(()=>{var e=ht();return r(e,()=>n.children),e})(),mt={BASE_URL:"https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};var vt=g("<div data-action=settings-auto-accept-permissions>"),xt=g("<div data-action=settings-feed-reasoning-summaries>"),bt=g("<div data-action=settings-feed-shell-tool-parts-expanded>"),_t=g("<div data-action=settings-feed-edit-tool-parts-expanded>"),wt=g("<div data-action=settings-show-session-progress-bar>"),$t=g('<div class="flex flex-col gap-1">'),yt=g("<div data-action=settings-show-file-tree>"),kt=g("<div data-action=settings-show-navigation>"),St=g("<div data-action=settings-show-search>"),Ct=g("<div data-action=settings-show-terminal>"),Pt=g("<div data-action=settings-show-status>"),X=g('<div class="flex flex-col gap-1"><h3 class="text-14-medium text-text-strong pb-2">'),ge=g('<div class="w-full sm:w-[220px]">'),Tt=g("<div data-action=settings-notifications-agent>"),At=g("<div data-action=settings-notifications-permissions>"),Et=g("<div data-action=settings-notifications-errors>"),Ft=g("<div data-action=settings-updates-startup>"),Dt=g("<div data-action=settings-release-notes>"),zt=g("<div data-action=settings-wayland>"),jt=g('<div class="flex flex-col h-full overflow-y-auto no-scrollbar px-4 pb-10 sm:px-10 sm:pb-10"><div class="sticky top-0 z-10 bg-[linear-gradient(to_bottom,var(--surface-stronger-non-alpha)_calc(100%_-_24px),transparent)]"><div class="flex flex-col gap-1 pt-6 pb-8"><h2 class="text-16-medium text-text-strong"></h2></div></div><div class="flex flex-col gap-8 w-full">'),Kt=g("<span class=text-text-weak>"),Ot=g('<div class="flex items-center gap-2"><span>'),Lt=g('<div class="flex flex-wrap items-center gap-4 py-3 border-b border-border-weak-base last:border-none sm:flex-nowrap"><div class="flex min-w-0 flex-1 flex-col gap-0.5"><span class="text-14-medium text-text-strong"></span><span class="text-12-regular text-text-weak"></span></div><div class="flex w-full justify-end sm:w-auto sm:shrink-0">');let R={cleanup:void 0,timeout:void 0,run:0};const Se=()=>{R.run+=1,R.cleanup&&R.cleanup(),clearTimeout(R.timeout),R.cleanup=void 0},ve=n=>{if(Se(),!n)return;const e=++R.run;R.timeout=setTimeout(()=>{Ye(n).then(l=>{if(R.run!==e){l?.();return}R.cleanup=l})},100)},Bt=()=>{const n=je(),e=ie(),l=Ke(),i=xe(),c=Oe(),a=be(),[y,w]=_e({checking:!1}),x=E(()=>i.platform==="desktop"&&i.os==="linux"),C=E(()=>Le(c.dir)),F=E(()=>{const d=C();return d?c.id?l.isAutoAccepting(c.id,d):l.isAutoAcceptingDirectory(d):!1}),K=d=>{const o=C();if(o){if(!c.id){if(l.isAutoAcceptingDirectory(o)===d)return;l.toggleAutoAcceptDirectory(o);return}if(d){l.enableAutoAccept(c.id,o);return}l.disableAutoAccept(c.id,o)}},G=E(()=>i.platform==="desktop"),L=()=>{i.checkUpdate&&(w("checking",!0),i.checkUpdate().then(d=>{if(!d.updateAvailable){W({variant:"success",icon:"circle-check",title:e.t("settings.updates.toast.latest.title"),description:e.t("settings.updates.toast.latest.description",{version:i.version??""})});return}const o=i.updateAndRestart?[{label:e.t("toast.update.action.installRestart"),onClick:async()=>{await i.updateAndRestart()}},{label:e.t("toast.update.action.notYet"),onClick:"dismiss"}]:[{label:e.t("toast.update.action.notYet"),onClick:"dismiss"}];W({persistent:!0,icon:"download",title:e.t("toast.update.title"),description:e.t("toast.update.description",{version:d.version??""}),actions:o})}).catch(d=>{const o=d instanceof Error?d.message:String(d);W({title:e.t("common.requestFailed"),description:o})}).finally(()=>w("checking",!1)))},p=E(()=>n.ids().map(d=>({id:d,name:n.name(d)}))),u=we(),k=$e(),[m]=me(()=>k.client.pty.shells().then(d=>d.data??[]).catch(()=>[]),{initialValue:[]}),[A,{refetch:O}]=me(()=>!!(x()&&i.getDisplayBackend),()=>Promise.resolve(i.getDisplayBackend?.()??null).catch(()=>null),{initialValue:null});ye(()=>{n.loadThemes()});const M={id:"auto",value:"",label:e.t("settings.general.row.shell.autoDefault")},S=E(()=>u.data.config.shell??""),z=E(()=>{const d=m.latest,o=u.data.config.shell,s=new Map;for(const f of d)s.set(f.name,(s.get(f.name)||0)+1);const h=[M,...d.map(f=>{const Q=(s.get(f.name)||0)>1,ae=Q?f.path:f.name,V=f.acceptable?ae:`${ae} (${e.t("settings.general.row.shell.terminalOnly")})`;return{id:f.path,value:Q?f.path:f.name,label:V}})];return o&&!h.some(f=>f.value===o)&&h.push({id:o,value:o,label:o}),h}),v=d=>{const o=i.setDisplayBackend?.(d?"wayland":"auto");o&&o.finally(()=>{O()})},$=E(()=>[{value:"system",label:e.t("theme.scheme.system")},{value:"light",label:e.t("theme.scheme.light")},{value:"dark",label:e.t("theme.scheme.dark")}]),_=E(()=>e.locales.map(d=>({value:d,label:e.label(d)}))),P={id:"none",label:"sound.option.none"},T=[P,...He],I=()=>Ue(a.appearance.font()),q=()=>Ve(a.appearance.uiFont()),J=()=>qe(a.appearance.terminalFont()),ne=(d,o,s,h)=>({options:T,current:d()?T.find(f=>f.id===o())??P:P,value:f=>f.id,label:f=>e.t(f.label),onHighlight:f=>{f&&ve(f.id==="none"?void 0:f.id)},onSelect:f=>{if(f){if(f.id==="none"){s(!1),Se();return}s(!0),h(f.id),ve(f.id)}},variant:"secondary",size:"small",triggerVariant:"settings"}),Pe=()=>(()=>{var d=$t();return r(d,t(N,{get children(){return[t(b,{get title(){return e.t("settings.general.row.language.title")},get description(){return e.t("settings.general.row.language.description")},get children(){return t(H,{"data-action":"settings-language",get options(){return _()},get current(){return _().find(o=>o.value===e.locale())},value:o=>o.value,label:o=>o.label,onSelect:o=>o&&e.setLocale(o.value),variant:"secondary",size:"small",triggerVariant:"settings"})}}),t(b,{get title(){return e.t("command.permissions.autoaccept.enable")},get description(){return e.t("toast.permissions.autoaccept.on.description")},get children(){var o=vt();return r(o,t(D,{get checked(){return F()},get disabled(){return!C()},onChange:K})),o}}),t(b,{get title(){return e.t("settings.general.row.shell.title")},get description(){return e.t("settings.general.row.shell.description")},get children(){return t(H,{"data-action":"settings-shell",get options(){return z()},get current(){return z().find(o=>o.value===S())??M},value:o=>o.id,label:o=>o.label,onSelect:o=>{o&&o.value!==S()&&u.updateConfig({shell:o.value})},variant:"secondary",size:"small",triggerVariant:"settings",triggerStyle:{"min-width":"180px"}})}}),t(b,{get title(){return e.t("settings.general.row.reasoningSummaries.title")},get description(){return e.t("settings.general.row.reasoningSummaries.description")},get children(){var o=xt();return r(o,t(D,{get checked(){return a.general.showReasoningSummaries()},onChange:s=>a.general.setShowReasoningSummaries(s)})),o}}),t(b,{get title(){return e.t("settings.general.row.shellToolPartsExpanded.title")},get description(){return e.t("settings.general.row.shellToolPartsExpanded.description")},get children(){var o=bt();return r(o,t(D,{get checked(){return a.general.shellToolPartsExpanded()},onChange:s=>a.general.setShellToolPartsExpanded(s)})),o}}),t(b,{get title(){return e.t("settings.general.row.editToolPartsExpanded.title")},get description(){return e.t("settings.general.row.editToolPartsExpanded.description")},get children(){var o=_t();return r(o,t(D,{get checked(){return a.general.editToolPartsExpanded()},onChange:s=>a.general.setEditToolPartsExpanded(s)})),o}}),t(b,{get title(){return e.t("settings.general.row.showSessionProgressBar.title")},get description(){return e.t("settings.general.row.showSessionProgressBar.description")},get children(){var o=wt();return r(o,t(D,{get checked(){return a.general.showSessionProgressBar()},onChange:s=>a.general.setShowSessionProgressBar(s)})),o}})]}})),d})(),Te=()=>(()=>{var d=X(),o=d.firstChild;return r(o,()=>e.t("settings.general.section.advanced")),r(d,t(N,{get children(){return[t(b,{get title(){return e.t("settings.general.row.showFileTree.title")},get description(){return e.t("settings.general.row.showFileTree.description")},get children(){var s=yt();return r(s,t(D,{get checked(){return a.general.showFileTree()},onChange:h=>a.general.setShowFileTree(h)})),s}}),t(b,{get title(){return e.t("settings.general.row.showNavigation.title")},get description(){return e.t("settings.general.row.showNavigation.description")},get children(){var s=kt();return r(s,t(D,{get checked(){return a.general.showNavigation()},onChange:h=>a.general.setShowNavigation(h)})),s}}),t(b,{get title(){return e.t("settings.general.row.showSearch.title")},get description(){return e.t("settings.general.row.showSearch.description")},get children(){var s=St();return r(s,t(D,{get checked(){return a.general.showSearch()},onChange:h=>a.general.setShowSearch(h)})),s}}),t(b,{get title(){return e.t("settings.general.row.showTerminal.title")},get description(){return e.t("settings.general.row.showTerminal.description")},get children(){var s=Ct();return r(s,t(D,{get checked(){return a.general.showTerminal()},onChange:h=>a.general.setShowTerminal(h)})),s}}),t(b,{get title(){return e.t("settings.general.row.showStatus.title")},get description(){return e.t("settings.general.row.showStatus.description")},get children(){var s=Pt();return r(s,t(D,{get checked(){return a.general.showStatus()},onChange:h=>a.general.setShowStatus(h)})),s}})]}}),null),d})(),Ae=()=>(()=>{var d=X(),o=d.firstChild;return r(o,()=>e.t("settings.general.section.appearance")),r(d,t(N,{get children(){return[t(b,{get title(){return e.t("settings.general.row.colorScheme.title")},get description(){return e.t("settings.general.row.colorScheme.description")},get children(){return t(H,{"data-action":"settings-color-scheme",get options(){return $()},get current(){return $().find(s=>s.value===n.colorScheme())},value:s=>s.value,label:s=>s.label,onSelect:s=>s&&n.setColorScheme(s.value),onHighlight:s=>{if(s)return n.previewColorScheme(s.value),()=>n.cancelPreview()},variant:"secondary",size:"small",triggerVariant:"settings",triggerStyle:{"min-width":"220px"}})}}),t(b,{get title(){return e.t("settings.general.row.theme.title")},get description(){return[U(()=>e.t("settings.general.row.theme.description"))," ",t(gt,{href:"https://opencode.ai/docs/themes/",get children(){return e.t("common.learnMore")}})]},get children(){return t(H,{"data-action":"settings-theme",get options(){return p()},get current(){return p().find(s=>s.id===n.themeId())},value:s=>s.id,label:s=>s.name,onSelect:s=>{s&&n.setTheme(s.id)},onHighlight:s=>{if(s)return n.previewTheme(s.id),()=>n.cancelPreview()},variant:"secondary",size:"small",triggerVariant:"settings"})}}),t(b,{get title(){return e.t("settings.general.row.uiFont.title")},get description(){return e.t("settings.general.row.uiFont.description")},get children(){var s=ge();return r(s,t(re,{"data-action":"settings-ui-font",get label(){return e.t("settings.general.row.uiFont.title")},hideLabel:!0,type:"text",get value(){return q()},onChange:h=>a.appearance.setUIFont(h),placeholder:Ne,spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"text-12-regular",get style(){return{"font-family":Me(a.appearance.uiFont())}}})),s}}),t(b,{get title(){return e.t("settings.general.row.font.title")},get description(){return e.t("settings.general.row.font.description")},get children(){var s=ge();return r(s,t(re,{"data-action":"settings-code-font",get label(){return e.t("settings.general.row.font.title")},hideLabel:!0,type:"text",get value(){return I()},onChange:h=>a.appearance.setFont(h),placeholder:Ie,spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"text-12-regular",get style(){return{"font-family":Re(a.appearance.font())}}})),s}}),t(b,{get title(){return e.t("settings.general.row.terminalFont.title")},get description(){return e.t("settings.general.row.terminalFont.description")},get children(){var s=ge();return r(s,t(re,{"data-action":"settings-terminal-font",get label(){return e.t("settings.general.row.terminalFont.title")},hideLabel:!0,type:"text",get value(){return J()},onChange:h=>a.appearance.setTerminalFont(h),placeholder:We,spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"text-12-regular",get style(){return{"font-family":Ge(a.appearance.terminalFont())}}})),s}})]}}),null),d})(),Ee=()=>(()=>{var d=X(),o=d.firstChild;return r(o,()=>e.t("settings.general.section.notifications")),r(d,t(N,{get children(){return[t(b,{get title(){return e.t("settings.general.notifications.agent.title")},get description(){return e.t("settings.general.notifications.agent.description")},get children(){var s=Tt();return r(s,t(D,{get checked(){return a.notifications.agent()},onChange:h=>a.notifications.setAgent(h)})),s}}),t(b,{get title(){return e.t("settings.general.notifications.permissions.title")},get description(){return e.t("settings.general.notifications.permissions.description")},get children(){var s=At();return r(s,t(D,{get checked(){return a.notifications.permissions()},onChange:h=>a.notifications.setPermissions(h)})),s}}),t(b,{get title(){return e.t("settings.general.notifications.errors.title")},get description(){return e.t("settings.general.notifications.errors.description")},get children(){var s=Et();return r(s,t(D,{get checked(){return a.notifications.errors()},onChange:h=>a.notifications.setErrors(h)})),s}})]}}),null),d})(),Fe=()=>(()=>{var d=X(),o=d.firstChild;return r(o,()=>e.t("settings.general.section.sounds")),r(d,t(N,{get children(){return[t(b,{get title(){return e.t("settings.general.sounds.agent.title")},get description(){return e.t("settings.general.sounds.agent.description")},get children(){return t(H,de({"data-action":"settings-sounds-agent"},()=>ne(()=>a.sounds.agentEnabled(),()=>a.sounds.agent(),s=>a.sounds.setAgentEnabled(s),s=>a.sounds.setAgent(s))))}}),t(b,{get title(){return e.t("settings.general.sounds.permissions.title")},get description(){return e.t("settings.general.sounds.permissions.description")},get children(){return t(H,de({"data-action":"settings-sounds-permissions"},()=>ne(()=>a.sounds.permissionsEnabled(),()=>a.sounds.permissions(),s=>a.sounds.setPermissionsEnabled(s),s=>a.sounds.setPermissions(s))))}}),t(b,{get title(){return e.t("settings.general.sounds.errors.title")},get description(){return e.t("settings.general.sounds.errors.description")},get children(){return t(H,de({"data-action":"settings-sounds-errors"},()=>ne(()=>a.sounds.errorsEnabled(),()=>a.sounds.errors(),s=>a.sounds.setErrorsEnabled(s),s=>a.sounds.setErrors(s))))}})]}}),null),d})(),De=()=>(()=>{var d=X(),o=d.firstChild;return r(o,()=>e.t("settings.general.section.updates")),r(d,t(N,{get children(){return[t(b,{get title(){return e.t("settings.updates.row.startup.title")},get description(){return e.t("settings.updates.row.startup.description")},get children(){var s=Ft();return r(s,t(D,{get checked(){return a.updates.startup()},get disabled(){return!i.checkUpdate},onChange:h=>a.updates.setStartup(h)})),s}}),t(b,{get title(){return e.t("settings.general.row.releaseNotes.title")},get description(){return e.t("settings.general.row.releaseNotes.description")},get children(){var s=Dt();return r(s,t(D,{get checked(){return a.general.releaseNotes()},onChange:h=>a.general.setReleaseNotes(h)})),s}}),t(b,{get title(){return e.t("settings.updates.row.check.title")},get description(){return e.t("settings.updates.row.check.description")},get children(){return t(Z,{size:"small",variant:"secondary",get disabled(){return y.checking||!i.checkUpdate},onClick:L,get children(){return U(()=>!!y.checking)()?e.t("settings.updates.action.checking"):e.t("settings.updates.action.checkNow")}})}})]}}),null),d})();return console.log(mt),(()=>{var d=jt(),o=d.firstChild,s=o.firstChild,h=s.firstChild,f=o.nextSibling;return r(h,()=>e.t("settings.tab.general")),r(f,t(Pe,{}),null),r(f,t(Ae,{}),null),r(f,t(Ee,{}),null),r(f,t(Fe,{}),null),r(f,t(De,{}),null),r(f,t(j,{get when(){return x()},get children(){var Q=X(),ae=Q.firstChild;return r(ae,()=>e.t("settings.general.section.display")),r(Q,t(N,{get children(){return t(b,{get title(){return(()=>{var V=Ot(),ze=V.firstChild;return r(ze,()=>e.t("settings.general.row.wayland.title")),r(V,t(Be,{get value(){return e.t("settings.general.row.wayland.tooltip")},placement:"top",get children(){var he=Kt();return r(he,t(Y,{name:"help",size:"small"})),he}}),null),V})()},get description(){return e.t("settings.general.row.wayland.description")},get children(){var V=zt();return r(V,t(D,{get checked(){return A.latest==="wayland"},onChange:v})),V}})}}),null),Q}}),null),r(f,t(j,{get when(){return U(()=>!!G())()&&!1},get children(){return t(Te,{})}}),null),d})()},b=n=>(()=>{var e=Lt(),l=e.firstChild,i=l.firstChild,c=i.nextSibling,a=l.nextSibling;return r(i,()=>n.title),r(c,()=>n.description),r(a,()=>n.children),e})();var Nt=g('<span class="text-14-regular text-text-strong mt-1">"<!>"'),Mt=g('<div class="flex flex-col items-center justify-center py-12 text-center"><span class="text-14-regular text-text-weak">'),It=g('<div class="flex flex-col h-full overflow-y-auto no-scrollbar px-4 pb-10 sm:px-10 sm:pb-10"><div class="sticky top-0 z-10 bg-[linear-gradient(to_bottom,var(--surface-stronger-non-alpha)_calc(100%_-_24px),transparent)]"><div class="flex flex-col gap-4 pt-6 pb-6 max-w-[720px]"><div class="flex items-center justify-between gap-4"><h2 class="text-16-medium text-text-strong"></h2></div><div class="flex items-center gap-2 px-3 h-9 rounded-lg bg-surface-base"></div></div></div><div class="flex flex-col gap-8 max-w-[720px]">'),Rt=g('<div class="flex flex-col gap-1"><h3 class="text-14-medium text-text-strong pb-2">'),Wt=g('<div class="flex items-center justify-between gap-4 py-3 border-b border-border-weak-base last:border-none"><span class="text-14-regular text-text-strong"></span><button type=button>');const ue=typeof navigator=="object"&&/(Mac|iPod|iPhone|iPad)/.test(navigator.platform),ee="command.palette",Gt="mod+shift+p",se=["General","Session","Navigation","Model and agent","Terminal","Prompt"],Vt={General:"settings.shortcuts.group.general",Session:"settings.shortcuts.group.session",Navigation:"settings.shortcuts.group.navigation","Model and agent":"settings.shortcuts.group.modelAndAgent",Terminal:"settings.shortcuts.group.terminal",Prompt:"settings.shortcuts.group.prompt"};function pe(n){return n===ee?"General":n.startsWith("terminal.")?"Terminal":n.startsWith("model.")||n.startsWith("agent.")||n.startsWith("mcp.")?"Model and agent":n.startsWith("file.")||n.startsWith("fileTree.")?"Navigation":n.startsWith("prompt.")?"Prompt":n.startsWith("session.")||n.startsWith("message.")||n.startsWith("permissions.")||n.startsWith("steps.")||n.startsWith("review.")?"Session":"General"}function Ut(n){return n==="Shift"||n==="Control"||n==="Alt"||n==="Meta"}function qt(n){return n===","?"comma":n==="+"?"plus":n===" "?"space":n.toLowerCase()}function Ht(n){if(Ut(n.key))return;const e=[];(ue?n.metaKey:n.ctrlKey)&&e.push("mod"),ue&&n.ctrlKey&&e.push("ctrl"),!ue&&n.metaKey&&e.push("meta"),n.altKey&&e.push("alt"),n.shiftKey&&e.push("shift");const i=qt(n.key);if(i)return e.push(i),e.join("+")}function fe(n){if(!n)return[];const e=[];for(const l of rt(n)){const i=[];l.ctrl&&i.push("ctrl"),l.alt&&i.push("alt"),l.shift&&i.push("shift"),l.meta&&i.push("meta"),l.key&&i.push(l.key),i.length!==0&&e.push(i.join("+"))}return e}function Yt(n){return!n||typeof n!="object"||Array.isArray(n)?{}:n}function Jt(n,e,l){const i=new Map;i.set(ee,{title:l,group:"General"});for(const c of n.catalog)c.id.startsWith("suggested.")||c.hidden||i.set(c.id,{title:c.title,group:pe(c.id)});for(const c of n.options)c.id.startsWith("suggested.")||c.hidden||i.set(c.id,{title:c.title,group:pe(c.id)});for(const[c,a]of Object.entries(e))typeof a=="string"&&(i.has(c)||i.set(c,{title:c,group:pe(c)}));return i}function Qt(n){const e=new Map;for(const l of se)e.set(l,[]);for(const[l,i]of n){const c=e.get(i.group);c&&c.push(l)}for(const l of se){const i=e.get(l);i&&i.sort((c,a)=>(n.get(c)?.title??"").localeCompare(n.get(a)?.title??""))}return e}function Xt(n,e,l,i){const c=n.toLowerCase().trim();if(!c)return l;const a=new Map;for(const x of se)a.set(x,[]);const y=Array.from(e.entries()).map(([x,C])=>({id:x,title:C.title,group:C.group,keybind:i(x)})),w=nt.go(c,y,{keys:["title","keybind"],threshold:-1e4});for(const x of w){const C=a.get(x.obj.group);C&&C.push(x.obj.id)}return a}function Zt(n){ye(()=>{st(document,"keydown",l=>{const i=n.active();if(!i)return;if(l.preventDefault(),l.stopPropagation(),l.stopImmediatePropagation(),l.key==="Escape"){n.stop();return}if((l.key==="Backspace"||l.key==="Delete")&&!l.ctrlKey&&!l.metaKey&&!l.altKey&&!l.shiftKey){n.set(i,"none"),n.stop();return}const a=Ht(l);if(!a)return;const y=new Map;for(const w of fe(a))for(const x of n.used().get(w)??[])x.id!==i&&y.set(x.id,x.title);if(y.size>0){W({title:n.language.t("settings.shortcuts.conflict.title"),description:n.language.t("settings.shortcuts.conflict.description",{keybind:it(a,n.language.t),titles:[...y.values()].join(", ")})});return}n.set(i,a),n.stop()},{capture:!0})})}const en=()=>{const n=Qe(),e=ie(),l=be(),[i,c]=_e({active:null,filter:""}),a=()=>{i.active&&(c("active",null),n.keybinds(!0))},y=m=>{if(i.active===m){a();return}i.active&&a(),c("active",m),n.keybinds(!1)},w=E(()=>Yt(l.current.keybinds)),x=E(()=>Object.values(w()).some(m=>typeof m=="string")),C=()=>{a(),l.keybinds.resetAll(),W({title:e.t("settings.shortcuts.reset.toast.title"),description:e.t("settings.shortcuts.reset.toast.description")})},F=E(()=>(e.locale(),Jt(n,w(),e.t("command.palette")))),K=m=>F().get(m)?.title??"",G=E(()=>Qt(F())),L=E(()=>Xt(i.filter,F(),G(),m=>n.keybind(m)||"")),p=E(()=>{for(const m of se)if((L().get(m)??[]).length>0)return!0;return!1}),u=E(()=>{const m=new Map,A=(S,z)=>{const v=m.get(S);if(!v){m.set(S,[z]);return}v.push(z)},O=l.keybinds.get(ee)??Gt;for(const S of fe(O))A(S,{id:ee,title:K(ee)});const M=S=>{const z=l.keybinds.get(S);if(typeof z=="string")return z;const v=n.options.find(_=>_.id===S);return v?.keybind?v.keybind:n.catalog.find(_=>_.id===S)?.keybind};for(const S of F().keys())if(S!==ee)for(const z of fe(M(S)))A(z,{id:S,title:K(S)});return m});return Zt({active:()=>i.active,stop:a,set:(m,A)=>l.keybinds.set(m,A),used:u,language:e}),Xe(()=>{i.active&&n.keybinds(!0)}),(()=>{var m=It(),A=m.firstChild,O=A.firstChild,M=O.firstChild,S=M.firstChild,z=M.nextSibling,v=A.nextSibling;return r(S,()=>e.t("settings.shortcuts.title")),r(M,t(Z,{size:"small",variant:"secondary",onClick:C,get disabled(){return!x()},get children(){return e.t("settings.shortcuts.reset.button")}}),null),r(z,t(Y,{name:"magnifying-glass",class:"text-icon-weak-base flex-shrink-0"}),null),r(z,t(re,{variant:"ghost",type:"text",get value(){return i.filter},onChange:$=>c("filter",$),get placeholder(){return e.t("settings.shortcuts.search.placeholder")},spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"flex-1"}),null),r(z,t(j,{get when(){return i.filter},get children(){return t(ke,{icon:"circle-x",variant:"ghost",onClick:()=>c("filter","")})}}),null),r(v,t(te,{each:se,children:$=>t(j,{get when(){return(L().get($)??[]).length>0},get children(){var _=Rt(),P=_.firstChild;return r(P,()=>e.t(Vt[$])),r(_,t(N,{get children(){return t(te,{get each(){return L().get($)??[]},children:T=>(()=>{var I=Wt(),q=I.firstChild,J=q.nextSibling;return r(q,()=>K(T)),J.$$click=()=>y(T),Ze(J,"data-keybind-id",T),r(J,t(j,{get when(){return i.active===T},get fallback(){return n.keybind(T)||e.t("settings.shortcuts.unassigned")},get children(){return e.t("settings.shortcuts.pressKeys")}})),et(ne=>tt(J,{"h-8 px-3 rounded-md text-12-regular":!0,"bg-surface-base text-text-subtle hover:bg-surface-raised-base-hover active:bg-surface-raised-base-active":i.active!==T,"border border-border-weak-base bg-surface-inset-base text-text-weak":i.active===T},ne)),I})()})}}),null),_}})}),null),r(v,t(j,{get when(){return U(()=>!!i.filter)()&&!p()},get children(){var $=Mt(),_=$.firstChild;return r(_,()=>e.t("settings.shortcuts.search.empty")),r($,t(j,{get when(){return i.filter},get children(){var P=Nt(),T=P.firstChild,I=T.nextSibling;return I.nextSibling,r(P,()=>i.filter,I),P}}),null),$}}),null),m})()};Je(["click"]);var tn=g('<div class="flex items-center justify-between gap-4 min-h-16 border-b border-border-weak-base last:border-none flex-wrap py-3"data-component=custom-provider-section><div class="flex flex-col min-w-0"><div class="flex flex-wrap items-center gap-x-3 gap-y-1"><span class="text-14-medium text-text-strong"></span></div><span class="text-12-regular text-text-weak pl-8">'),nn=g('<div class="flex flex-col h-full overflow-y-auto no-scrollbar px-4 pb-10 sm:px-10 sm:pb-10"><div class="sticky top-0 z-10 bg-[linear-gradient(to_bottom,var(--surface-stronger-non-alpha)_calc(100%_-_24px),transparent)]"><div class="flex flex-col gap-1 pt-6 pb-8 max-w-[720px]"><h2 class="text-16-medium text-text-strong"></h2></div></div><div class="flex flex-col gap-8 max-w-[720px]"><div class="flex flex-col gap-1"data-component=connected-providers-section><h3 class="text-14-medium text-text-strong pb-2"></h3></div><div class="flex flex-col gap-1"><h3 class="text-14-medium text-text-strong pb-2">'),rn=g('<div class="py-4 text-14-regular text-text-weak">'),sn=g('<div class="group flex flex-wrap items-center justify-between gap-4 min-h-16 py-3 border-b border-border-weak-base last:border-none"><div class="flex items-center gap-3 min-w-0"><span class="text-14-medium text-text-strong truncate">'),an=g('<span class="text-14-regular text-text-base opacity-0 group-hover:opacity-100 transition-opacity duration-200 pr-3 cursor-default">'),ln=g('<div class="flex flex-wrap items-center justify-between gap-4 min-h-16 py-3 border-b border-border-weak-base last:border-none"><div class="flex flex-col min-w-0"><div class="flex items-center gap-x-3"><span class="text-14-medium text-text-strong">'),on=g('<span class="text-12-regular text-text-weak pl-8">');const cn=[{match:n=>n==="opencode",key:"dialog.provider.opencode.note"},{match:n=>n==="opencode-go",key:"dialog.provider.opencodeGo.tagline"},{match:n=>n==="anthropic",key:"dialog.provider.anthropic.note"},{match:n=>n.startsWith("github-copilot"),key:"dialog.provider.copilot.note"},{match:n=>n==="openai",key:"dialog.provider.openai.note"},{match:n=>n==="google",key:"dialog.provider.google.note"},{match:n=>n==="openrouter",key:"dialog.provider.openrouter.note"},{match:n=>n==="vercel",key:"dialog.provider.vercel.note"}],dn=()=>{const n=at(),e=ie(),l=$e(),i=we(),c=lt(),a=E(()=>c.connected().filter(p=>p.id!=="opencode"||Object.values(p.models).find(u=>u.cost?.input))),y=E(()=>{const p=new Set(a().map(k=>k.id)),u=c.popular().filter(k=>!p.has(k.id)).slice();return u.sort((k,m)=>ce.indexOf(k.id)-ce.indexOf(m.id)),u}),w=p=>{if(!("source"in p))return;const u=p.source;if(u==="env"||u==="api"||u==="config"||u==="custom")return u},x=p=>{const u=w(p);return u==="env"?e.t("settings.providers.tag.environment"):u==="api"?e.t("provider.connect.method.apiKey"):u==="config"?K(p.id)?e.t("settings.providers.tag.custom"):e.t("settings.providers.tag.config"):u==="custom"?e.t("settings.providers.tag.custom"):e.t("settings.providers.tag.other")},C=p=>w(p)!=="env",F=p=>cn.find(u=>u.match(p))?.key,K=p=>{const u=i.data.config.provider?.[p];return!(!u||u.npm!=="@ai-sdk/openai-compatible"||!u.models||Object.keys(u.models).length===0)},G=async(p,u)=>{const k=i.data.config.disabled_providers??[],m=k.includes(p)?k:[...k,p];i.set("config","disabled_providers",m),await i.updateConfig({disabled_providers:m}).then(()=>{W({variant:"success",icon:"circle-check",title:e.t("provider.disconnect.toast.disconnected.title",{provider:u}),description:e.t("provider.disconnect.toast.disconnected.description",{provider:u})})}).catch(A=>{i.set("config","disabled_providers",k);const O=A instanceof Error?A.message:String(A);W({title:e.t("common.requestFailed"),description:O})})},L=async(p,u)=>{if(K(p)){await l.client.auth.remove({providerID:p}).catch(()=>{}),await G(p,u);return}await l.client.auth.remove({providerID:p}).then(async()=>{await l.client.global.dispose(),W({variant:"success",icon:"circle-check",title:e.t("provider.disconnect.toast.disconnected.title",{provider:u}),description:e.t("provider.disconnect.toast.disconnected.description",{provider:u})})}).catch(k=>{const m=k instanceof Error?k.message:String(k);W({title:e.t("common.requestFailed"),description:m})})};return(()=>{var p=nn(),u=p.firstChild,k=u.firstChild,m=k.firstChild,A=u.nextSibling,O=A.firstChild,M=O.firstChild,S=O.nextSibling,z=S.firstChild;return r(m,()=>e.t("settings.providers.title")),r(M,()=>e.t("settings.providers.section.connected")),r(O,t(N,{get children(){return t(j,{get when(){return a().length>0},get fallback(){return(()=>{var v=rn();return r(v,()=>e.t("settings.providers.connected.empty")),v})()},get children(){return t(te,{get each(){return a()},children:v=>(()=>{var $=sn(),_=$.firstChild,P=_.firstChild;return r(_,t(oe,{get id(){return v.id},class:"size-5 shrink-0 icon-strong-base"}),P),r(P,()=>v.name),r(_,t(le,{get children(){return x(v)}}),null),r($,t(j,{get when(){return C(v)},get fallback(){return(()=>{var T=an();return r(T,()=>e.t("settings.providers.connected.environmentDescription")),T})()},get children(){return t(Z,{size:"large",variant:"ghost",onClick:()=>void L(v.id,v.name),get children(){return e.t("common.disconnect")}})}}),null),$})()})}})}}),null),r(z,()=>e.t("settings.providers.section.popular")),r(S,t(N,{get children(){return[t(te,{get each(){return y()},children:v=>(()=>{var $=ln(),_=$.firstChild,P=_.firstChild,T=P.firstChild;return r(P,t(oe,{get id(){return v.id},class:"size-5 shrink-0 icon-strong-base"}),T),r(T,()=>v.name),r(P,t(j,{get when(){return v.id==="opencode"},get children(){return t(le,{get children(){return e.t("dialog.provider.tag.recommended")}})}}),null),r(P,t(j,{get when(){return v.id==="opencode-go"},get children(){return t(le,{get children(){return e.t("dialog.provider.tag.recommended")}})}}),null),r(_,t(j,{get when(){return F(v.id)},children:I=>(()=>{var q=on();return r(q,()=>e.t(I())),q})()}),null),r($,t(Z,{size:"large",variant:"secondary",icon:"plus-small",onClick:()=>{n.show(()=>t(ut,{get provider(){return v.id}}))},get children(){return e.t("common.connect")}}),null),$})()}),(()=>{var v=tn(),$=v.firstChild,_=$.firstChild,P=_.firstChild,T=_.nextSibling;return r(_,t(oe,{id:"synthetic",class:"size-5 shrink-0 icon-strong-base"}),P),r(P,()=>e.t("provider.custom.title")),r(_,t(le,{get children(){return e.t("settings.providers.tag.custom")}}),null),r(T,()=>e.t("settings.providers.custom.description")),r(v,t(Z,{size:"large",variant:"secondary",icon:"plus-small",onClick:()=>{n.show(()=>t(pt,{back:"close"}))},get children(){return e.t("common.connect")}}),null),v})()]}}),null),r(S,t(Z,{variant:"ghost",class:"px-0 py-0 mt-5 text-14-medium text-text-interactive-base text-left justify-start hover:bg-transparent active:bg-transparent",onClick:()=>{n.show(()=>t(ft,{}))},get children(){return e.t("dialog.provider.viewAll")}}),null),p})()};var Ce=g('<div class="flex flex-col items-center justify-center py-12 text-center"><span class="text-14-regular text-text-weak">'),gn=g('<span class="text-14-regular text-text-strong mt-1">&quot;<!>&quot;'),un=g('<div class="flex flex-col h-full overflow-y-auto no-scrollbar px-4 pb-10 sm:px-10 sm:pb-10"><div class="sticky top-0 z-10 bg-[linear-gradient(to_bottom,var(--surface-stronger-non-alpha)_calc(100%_-_24px),transparent)]"><div class="flex flex-col gap-4 pt-6 pb-6 max-w-[720px]"><h2 class="text-16-medium text-text-strong"></h2><div class="flex items-center gap-2 px-3 h-9 rounded-lg bg-surface-base"></div></div></div><div class="flex flex-col gap-8 max-w-[720px]">'),pn=g('<div class="flex flex-col gap-1"><div class="flex items-center gap-2 pb-2"><span class="text-14-medium text-text-strong">'),fn=g('<div class="flex flex-wrap items-center justify-between gap-4 py-3 border-b border-border-weak-base last:border-none"><div class=min-w-0><span class="text-14-regular text-text-strong truncate block"></span></div><div class=flex-shrink-0>');const hn=n=>(()=>{var e=Ce(),l=e.firstChild;return r(l,()=>n.label),e})(),mn=n=>(()=>{var e=Ce(),l=e.firstChild;return r(l,()=>n.message),r(e,t(j,{get when(){return n.filter},get children(){var i=gn(),c=i.firstChild,a=c.nextSibling;return a.nextSibling,r(i,()=>n.filter,a),i}}),null),e})(),vn=()=>{const n=ie(),e=ot(),l=ct({items:i=>e.list(),key:i=>`${i.provider.id}:${i.id}`,filterKeys:["provider.name","name","id"],sortBy:(i,c)=>i.name.localeCompare(c.name),groupBy:i=>i.provider.id,sortGroupsBy:(i,c)=>{const a=ce.indexOf(i.category),y=ce.indexOf(c.category),w=a>=0,x=y>=0;if(w&&!x)return-1;if(!w&&x)return 1;if(w&&x)return a-y;const C=i.items[0].provider.name,F=c.items[0].provider.name;return C.localeCompare(F)}});return(()=>{var i=un(),c=i.firstChild,a=c.firstChild,y=a.firstChild,w=y.nextSibling,x=c.nextSibling;return r(y,()=>n.t("settings.models.title")),r(w,t(Y,{name:"magnifying-glass",class:"text-icon-weak-base flex-shrink-0"}),null),r(w,t(re,{variant:"ghost",type:"text",get value(){return l.filter()},get onChange(){return l.onInput},get placeholder(){return n.t("dialog.model.search.placeholder")},spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"flex-1"}),null),r(w,t(j,{get when(){return l.filter()},get children(){return t(ke,{icon:"circle-x",variant:"ghost",get onClick(){return l.clear}})}}),null),r(x,t(j,{get when(){return!l.grouped.loading},get fallback(){return t(hn,{get label(){return`${n.t("common.loading")}${n.t("common.loading.ellipsis")}`}})},get children(){return t(j,{get when(){return l.flat().length>0},get fallback(){return t(mn,{get message(){return n.t("dialog.model.empty")},get filter(){return l.filter()}})},get children(){return t(te,{get each(){return l.grouped.latest},children:C=>(()=>{var F=pn(),K=F.firstChild,G=K.firstChild;return r(K,t(oe,{get id(){return C.category},class:"size-5 shrink-0 icon-strong-base"}),G),r(G,()=>C.items[0].provider.name),r(F,t(N,{get children(){return t(te,{get each(){return C.items},children:L=>{const p={providerID:L.provider.id,modelID:L.id};return(()=>{var u=fn(),k=u.firstChild,m=k.firstChild,A=k.nextSibling;return r(m,()=>L.name),r(A,t(D,{get checked(){return e.visible(p)},onChange:O=>{e.setVisibility(p,O)},hideLabel:!0,get children(){return L.name}})),u})()}})}}),null),F})()})}})}})),i})()};var xn=g('<div class="flex flex-col justify-between h-full w-full"><div class="flex flex-col gap-3 w-full pt-3"><div class="flex flex-col gap-3"><div class="flex flex-col gap-1.5"><div class="flex flex-col gap-1.5 w-full"></div></div><div class="flex flex-col gap-1.5"><div class="flex flex-col gap-1.5 w-full"></div></div></div></div><div class="flex flex-col gap-1 pl-1 py-1 text-12-medium text-text-weak"><span></span><span class=text-11-regular>v');const kn=()=>{const n=ie(),e=xe();return t(dt,{size:"x-large",transition:!0,get children(){return t(B,{orientation:"vertical",variant:"settings",defaultValue:"general",class:"h-full settings-dialog",get children(){return[t(B.List,{get children(){var l=xn(),i=l.firstChild,c=i.firstChild,a=c.firstChild,y=a.firstChild,w=a.nextSibling,x=w.firstChild,C=i.nextSibling,F=C.firstChild,K=F.nextSibling;return K.firstChild,r(a,t(B.SectionTitle,{get children(){return n.t("settings.section.desktop")}}),y),r(y,t(B.Trigger,{value:"general",get children(){return[t(Y,{name:"sliders"}),U(()=>n.t("settings.tab.general"))]}}),null),r(y,t(B.Trigger,{value:"shortcuts",get children(){return[t(Y,{name:"keyboard"}),U(()=>n.t("settings.tab.shortcuts"))]}}),null),r(w,t(B.SectionTitle,{get children(){return n.t("settings.section.server")}}),x),r(x,t(B.Trigger,{value:"providers",get children(){return[t(Y,{name:"providers"}),U(()=>n.t("settings.providers.title"))]}}),null),r(x,t(B.Trigger,{value:"models",get children(){return[t(Y,{name:"models"}),U(()=>n.t("settings.models.title"))]}}),null),r(F,()=>n.t("app.name.desktop")),r(K,()=>e.version,null),l}}),t(B.Content,{value:"general",class:"no-scrollbar",get children(){return t(Bt,{})}}),t(B.Content,{value:"shortcuts",class:"no-scrollbar",get children(){return t(en,{})}}),t(B.Content,{value:"providers",class:"no-scrollbar",get children(){return t(dn,{})}}),t(B.Content,{value:"models",class:"no-scrollbar",get children(){return t(vn,{})}})]}})}})};export{kn as DialogSettings};
1
+ import{i as r,t as g,a4 as je,f as ie,a5 as Ke,u as xe,a6 as Oe,a7 as be,k as _e,h as E,a8 as Le,c as we,e as $e,j as me,w as ye,n as t,a3 as Be,I as Y,E as j,p as U,a9 as H,T as re,aa as Ne,ab as Me,ac as Ie,ad as Re,ae as We,af as Ge,m as de,B as Z,ag as Ve,ah as Ue,ai as qe,aj as He,y as W,ak as Ye,d as Je,al as Qe,o as Xe,v as ke,F as te,A as Ze,r as et,L as tt,am as nt,an as rt,O as st,ao as it,b as at,g as lt,G as ce,P as oe,ap as ot,J as ct,aq as B,D as dt}from"./index-BsKb4267.js";import{S as D}from"./switch-D1CmhYGB.js";import{L as gt,D as ut,a as pt,b as ft}from"./dialog-select-provider-D2zjdaGd.js";import{T as le}from"./tag-B9_ddZHF.js";import"./list-Bm4iAmpR.js";var ht=g('<div class="bg-surface-base px-4 rounded-lg">');const N=n=>(()=>{var e=ht();return r(e,()=>n.children),e})(),mt={BASE_URL:"https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.51/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};var vt=g("<div data-action=settings-auto-accept-permissions>"),xt=g("<div data-action=settings-feed-reasoning-summaries>"),bt=g("<div data-action=settings-feed-shell-tool-parts-expanded>"),_t=g("<div data-action=settings-feed-edit-tool-parts-expanded>"),wt=g("<div data-action=settings-show-session-progress-bar>"),$t=g('<div class="flex flex-col gap-1">'),yt=g("<div data-action=settings-show-file-tree>"),kt=g("<div data-action=settings-show-navigation>"),St=g("<div data-action=settings-show-search>"),Ct=g("<div data-action=settings-show-terminal>"),Pt=g("<div data-action=settings-show-status>"),X=g('<div class="flex flex-col gap-1"><h3 class="text-14-medium text-text-strong pb-2">'),ge=g('<div class="w-full sm:w-[220px]">'),Tt=g("<div data-action=settings-notifications-agent>"),At=g("<div data-action=settings-notifications-permissions>"),Et=g("<div data-action=settings-notifications-errors>"),Ft=g("<div data-action=settings-updates-startup>"),Dt=g("<div data-action=settings-release-notes>"),zt=g("<div data-action=settings-wayland>"),jt=g('<div class="flex flex-col h-full overflow-y-auto no-scrollbar px-4 pb-10 sm:px-10 sm:pb-10"><div class="sticky top-0 z-10 bg-[linear-gradient(to_bottom,var(--surface-stronger-non-alpha)_calc(100%_-_24px),transparent)]"><div class="flex flex-col gap-1 pt-6 pb-8"><h2 class="text-16-medium text-text-strong"></h2></div></div><div class="flex flex-col gap-8 w-full">'),Kt=g("<span class=text-text-weak>"),Ot=g('<div class="flex items-center gap-2"><span>'),Lt=g('<div class="flex flex-wrap items-center gap-4 py-3 border-b border-border-weak-base last:border-none sm:flex-nowrap"><div class="flex min-w-0 flex-1 flex-col gap-0.5"><span class="text-14-medium text-text-strong"></span><span class="text-12-regular text-text-weak"></span></div><div class="flex w-full justify-end sm:w-auto sm:shrink-0">');let R={cleanup:void 0,timeout:void 0,run:0};const Se=()=>{R.run+=1,R.cleanup&&R.cleanup(),clearTimeout(R.timeout),R.cleanup=void 0},ve=n=>{if(Se(),!n)return;const e=++R.run;R.timeout=setTimeout(()=>{Ye(n).then(l=>{if(R.run!==e){l?.();return}R.cleanup=l})},100)},Bt=()=>{const n=je(),e=ie(),l=Ke(),i=xe(),c=Oe(),a=be(),[y,w]=_e({checking:!1}),x=E(()=>i.platform==="desktop"&&i.os==="linux"),C=E(()=>Le(c.dir)),F=E(()=>{const d=C();return d?c.id?l.isAutoAccepting(c.id,d):l.isAutoAcceptingDirectory(d):!1}),K=d=>{const o=C();if(o){if(!c.id){if(l.isAutoAcceptingDirectory(o)===d)return;l.toggleAutoAcceptDirectory(o);return}if(d){l.enableAutoAccept(c.id,o);return}l.disableAutoAccept(c.id,o)}},G=E(()=>i.platform==="desktop"),L=()=>{i.checkUpdate&&(w("checking",!0),i.checkUpdate().then(d=>{if(!d.updateAvailable){W({variant:"success",icon:"circle-check",title:e.t("settings.updates.toast.latest.title"),description:e.t("settings.updates.toast.latest.description",{version:i.version??""})});return}const o=i.updateAndRestart?[{label:e.t("toast.update.action.installRestart"),onClick:async()=>{await i.updateAndRestart()}},{label:e.t("toast.update.action.notYet"),onClick:"dismiss"}]:[{label:e.t("toast.update.action.notYet"),onClick:"dismiss"}];W({persistent:!0,icon:"download",title:e.t("toast.update.title"),description:e.t("toast.update.description",{version:d.version??""}),actions:o})}).catch(d=>{const o=d instanceof Error?d.message:String(d);W({title:e.t("common.requestFailed"),description:o})}).finally(()=>w("checking",!1)))},p=E(()=>n.ids().map(d=>({id:d,name:n.name(d)}))),u=we(),k=$e(),[m]=me(()=>k.client.pty.shells().then(d=>d.data??[]).catch(()=>[]),{initialValue:[]}),[A,{refetch:O}]=me(()=>!!(x()&&i.getDisplayBackend),()=>Promise.resolve(i.getDisplayBackend?.()??null).catch(()=>null),{initialValue:null});ye(()=>{n.loadThemes()});const M={id:"auto",value:"",label:e.t("settings.general.row.shell.autoDefault")},S=E(()=>u.data.config.shell??""),z=E(()=>{const d=m.latest,o=u.data.config.shell,s=new Map;for(const f of d)s.set(f.name,(s.get(f.name)||0)+1);const h=[M,...d.map(f=>{const Q=(s.get(f.name)||0)>1,ae=Q?f.path:f.name,V=f.acceptable?ae:`${ae} (${e.t("settings.general.row.shell.terminalOnly")})`;return{id:f.path,value:Q?f.path:f.name,label:V}})];return o&&!h.some(f=>f.value===o)&&h.push({id:o,value:o,label:o}),h}),v=d=>{const o=i.setDisplayBackend?.(d?"wayland":"auto");o&&o.finally(()=>{O()})},$=E(()=>[{value:"system",label:e.t("theme.scheme.system")},{value:"light",label:e.t("theme.scheme.light")},{value:"dark",label:e.t("theme.scheme.dark")}]),_=E(()=>e.locales.map(d=>({value:d,label:e.label(d)}))),P={id:"none",label:"sound.option.none"},T=[P,...He],I=()=>Ue(a.appearance.font()),q=()=>Ve(a.appearance.uiFont()),J=()=>qe(a.appearance.terminalFont()),ne=(d,o,s,h)=>({options:T,current:d()?T.find(f=>f.id===o())??P:P,value:f=>f.id,label:f=>e.t(f.label),onHighlight:f=>{f&&ve(f.id==="none"?void 0:f.id)},onSelect:f=>{if(f){if(f.id==="none"){s(!1),Se();return}s(!0),h(f.id),ve(f.id)}},variant:"secondary",size:"small",triggerVariant:"settings"}),Pe=()=>(()=>{var d=$t();return r(d,t(N,{get children(){return[t(b,{get title(){return e.t("settings.general.row.language.title")},get description(){return e.t("settings.general.row.language.description")},get children(){return t(H,{"data-action":"settings-language",get options(){return _()},get current(){return _().find(o=>o.value===e.locale())},value:o=>o.value,label:o=>o.label,onSelect:o=>o&&e.setLocale(o.value),variant:"secondary",size:"small",triggerVariant:"settings"})}}),t(b,{get title(){return e.t("command.permissions.autoaccept.enable")},get description(){return e.t("toast.permissions.autoaccept.on.description")},get children(){var o=vt();return r(o,t(D,{get checked(){return F()},get disabled(){return!C()},onChange:K})),o}}),t(b,{get title(){return e.t("settings.general.row.shell.title")},get description(){return e.t("settings.general.row.shell.description")},get children(){return t(H,{"data-action":"settings-shell",get options(){return z()},get current(){return z().find(o=>o.value===S())??M},value:o=>o.id,label:o=>o.label,onSelect:o=>{o&&o.value!==S()&&u.updateConfig({shell:o.value})},variant:"secondary",size:"small",triggerVariant:"settings",triggerStyle:{"min-width":"180px"}})}}),t(b,{get title(){return e.t("settings.general.row.reasoningSummaries.title")},get description(){return e.t("settings.general.row.reasoningSummaries.description")},get children(){var o=xt();return r(o,t(D,{get checked(){return a.general.showReasoningSummaries()},onChange:s=>a.general.setShowReasoningSummaries(s)})),o}}),t(b,{get title(){return e.t("settings.general.row.shellToolPartsExpanded.title")},get description(){return e.t("settings.general.row.shellToolPartsExpanded.description")},get children(){var o=bt();return r(o,t(D,{get checked(){return a.general.shellToolPartsExpanded()},onChange:s=>a.general.setShellToolPartsExpanded(s)})),o}}),t(b,{get title(){return e.t("settings.general.row.editToolPartsExpanded.title")},get description(){return e.t("settings.general.row.editToolPartsExpanded.description")},get children(){var o=_t();return r(o,t(D,{get checked(){return a.general.editToolPartsExpanded()},onChange:s=>a.general.setEditToolPartsExpanded(s)})),o}}),t(b,{get title(){return e.t("settings.general.row.showSessionProgressBar.title")},get description(){return e.t("settings.general.row.showSessionProgressBar.description")},get children(){var o=wt();return r(o,t(D,{get checked(){return a.general.showSessionProgressBar()},onChange:s=>a.general.setShowSessionProgressBar(s)})),o}})]}})),d})(),Te=()=>(()=>{var d=X(),o=d.firstChild;return r(o,()=>e.t("settings.general.section.advanced")),r(d,t(N,{get children(){return[t(b,{get title(){return e.t("settings.general.row.showFileTree.title")},get description(){return e.t("settings.general.row.showFileTree.description")},get children(){var s=yt();return r(s,t(D,{get checked(){return a.general.showFileTree()},onChange:h=>a.general.setShowFileTree(h)})),s}}),t(b,{get title(){return e.t("settings.general.row.showNavigation.title")},get description(){return e.t("settings.general.row.showNavigation.description")},get children(){var s=kt();return r(s,t(D,{get checked(){return a.general.showNavigation()},onChange:h=>a.general.setShowNavigation(h)})),s}}),t(b,{get title(){return e.t("settings.general.row.showSearch.title")},get description(){return e.t("settings.general.row.showSearch.description")},get children(){var s=St();return r(s,t(D,{get checked(){return a.general.showSearch()},onChange:h=>a.general.setShowSearch(h)})),s}}),t(b,{get title(){return e.t("settings.general.row.showTerminal.title")},get description(){return e.t("settings.general.row.showTerminal.description")},get children(){var s=Ct();return r(s,t(D,{get checked(){return a.general.showTerminal()},onChange:h=>a.general.setShowTerminal(h)})),s}}),t(b,{get title(){return e.t("settings.general.row.showStatus.title")},get description(){return e.t("settings.general.row.showStatus.description")},get children(){var s=Pt();return r(s,t(D,{get checked(){return a.general.showStatus()},onChange:h=>a.general.setShowStatus(h)})),s}})]}}),null),d})(),Ae=()=>(()=>{var d=X(),o=d.firstChild;return r(o,()=>e.t("settings.general.section.appearance")),r(d,t(N,{get children(){return[t(b,{get title(){return e.t("settings.general.row.colorScheme.title")},get description(){return e.t("settings.general.row.colorScheme.description")},get children(){return t(H,{"data-action":"settings-color-scheme",get options(){return $()},get current(){return $().find(s=>s.value===n.colorScheme())},value:s=>s.value,label:s=>s.label,onSelect:s=>s&&n.setColorScheme(s.value),onHighlight:s=>{if(s)return n.previewColorScheme(s.value),()=>n.cancelPreview()},variant:"secondary",size:"small",triggerVariant:"settings",triggerStyle:{"min-width":"220px"}})}}),t(b,{get title(){return e.t("settings.general.row.theme.title")},get description(){return[U(()=>e.t("settings.general.row.theme.description"))," ",t(gt,{href:"https://opencode.ai/docs/themes/",get children(){return e.t("common.learnMore")}})]},get children(){return t(H,{"data-action":"settings-theme",get options(){return p()},get current(){return p().find(s=>s.id===n.themeId())},value:s=>s.id,label:s=>s.name,onSelect:s=>{s&&n.setTheme(s.id)},onHighlight:s=>{if(s)return n.previewTheme(s.id),()=>n.cancelPreview()},variant:"secondary",size:"small",triggerVariant:"settings"})}}),t(b,{get title(){return e.t("settings.general.row.uiFont.title")},get description(){return e.t("settings.general.row.uiFont.description")},get children(){var s=ge();return r(s,t(re,{"data-action":"settings-ui-font",get label(){return e.t("settings.general.row.uiFont.title")},hideLabel:!0,type:"text",get value(){return q()},onChange:h=>a.appearance.setUIFont(h),placeholder:Ne,spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"text-12-regular",get style(){return{"font-family":Me(a.appearance.uiFont())}}})),s}}),t(b,{get title(){return e.t("settings.general.row.font.title")},get description(){return e.t("settings.general.row.font.description")},get children(){var s=ge();return r(s,t(re,{"data-action":"settings-code-font",get label(){return e.t("settings.general.row.font.title")},hideLabel:!0,type:"text",get value(){return I()},onChange:h=>a.appearance.setFont(h),placeholder:Ie,spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"text-12-regular",get style(){return{"font-family":Re(a.appearance.font())}}})),s}}),t(b,{get title(){return e.t("settings.general.row.terminalFont.title")},get description(){return e.t("settings.general.row.terminalFont.description")},get children(){var s=ge();return r(s,t(re,{"data-action":"settings-terminal-font",get label(){return e.t("settings.general.row.terminalFont.title")},hideLabel:!0,type:"text",get value(){return J()},onChange:h=>a.appearance.setTerminalFont(h),placeholder:We,spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"text-12-regular",get style(){return{"font-family":Ge(a.appearance.terminalFont())}}})),s}})]}}),null),d})(),Ee=()=>(()=>{var d=X(),o=d.firstChild;return r(o,()=>e.t("settings.general.section.notifications")),r(d,t(N,{get children(){return[t(b,{get title(){return e.t("settings.general.notifications.agent.title")},get description(){return e.t("settings.general.notifications.agent.description")},get children(){var s=Tt();return r(s,t(D,{get checked(){return a.notifications.agent()},onChange:h=>a.notifications.setAgent(h)})),s}}),t(b,{get title(){return e.t("settings.general.notifications.permissions.title")},get description(){return e.t("settings.general.notifications.permissions.description")},get children(){var s=At();return r(s,t(D,{get checked(){return a.notifications.permissions()},onChange:h=>a.notifications.setPermissions(h)})),s}}),t(b,{get title(){return e.t("settings.general.notifications.errors.title")},get description(){return e.t("settings.general.notifications.errors.description")},get children(){var s=Et();return r(s,t(D,{get checked(){return a.notifications.errors()},onChange:h=>a.notifications.setErrors(h)})),s}})]}}),null),d})(),Fe=()=>(()=>{var d=X(),o=d.firstChild;return r(o,()=>e.t("settings.general.section.sounds")),r(d,t(N,{get children(){return[t(b,{get title(){return e.t("settings.general.sounds.agent.title")},get description(){return e.t("settings.general.sounds.agent.description")},get children(){return t(H,de({"data-action":"settings-sounds-agent"},()=>ne(()=>a.sounds.agentEnabled(),()=>a.sounds.agent(),s=>a.sounds.setAgentEnabled(s),s=>a.sounds.setAgent(s))))}}),t(b,{get title(){return e.t("settings.general.sounds.permissions.title")},get description(){return e.t("settings.general.sounds.permissions.description")},get children(){return t(H,de({"data-action":"settings-sounds-permissions"},()=>ne(()=>a.sounds.permissionsEnabled(),()=>a.sounds.permissions(),s=>a.sounds.setPermissionsEnabled(s),s=>a.sounds.setPermissions(s))))}}),t(b,{get title(){return e.t("settings.general.sounds.errors.title")},get description(){return e.t("settings.general.sounds.errors.description")},get children(){return t(H,de({"data-action":"settings-sounds-errors"},()=>ne(()=>a.sounds.errorsEnabled(),()=>a.sounds.errors(),s=>a.sounds.setErrorsEnabled(s),s=>a.sounds.setErrors(s))))}})]}}),null),d})(),De=()=>(()=>{var d=X(),o=d.firstChild;return r(o,()=>e.t("settings.general.section.updates")),r(d,t(N,{get children(){return[t(b,{get title(){return e.t("settings.updates.row.startup.title")},get description(){return e.t("settings.updates.row.startup.description")},get children(){var s=Ft();return r(s,t(D,{get checked(){return a.updates.startup()},get disabled(){return!i.checkUpdate},onChange:h=>a.updates.setStartup(h)})),s}}),t(b,{get title(){return e.t("settings.general.row.releaseNotes.title")},get description(){return e.t("settings.general.row.releaseNotes.description")},get children(){var s=Dt();return r(s,t(D,{get checked(){return a.general.releaseNotes()},onChange:h=>a.general.setReleaseNotes(h)})),s}}),t(b,{get title(){return e.t("settings.updates.row.check.title")},get description(){return e.t("settings.updates.row.check.description")},get children(){return t(Z,{size:"small",variant:"secondary",get disabled(){return y.checking||!i.checkUpdate},onClick:L,get children(){return U(()=>!!y.checking)()?e.t("settings.updates.action.checking"):e.t("settings.updates.action.checkNow")}})}})]}}),null),d})();return console.log(mt),(()=>{var d=jt(),o=d.firstChild,s=o.firstChild,h=s.firstChild,f=o.nextSibling;return r(h,()=>e.t("settings.tab.general")),r(f,t(Pe,{}),null),r(f,t(Ae,{}),null),r(f,t(Ee,{}),null),r(f,t(Fe,{}),null),r(f,t(De,{}),null),r(f,t(j,{get when(){return x()},get children(){var Q=X(),ae=Q.firstChild;return r(ae,()=>e.t("settings.general.section.display")),r(Q,t(N,{get children(){return t(b,{get title(){return(()=>{var V=Ot(),ze=V.firstChild;return r(ze,()=>e.t("settings.general.row.wayland.title")),r(V,t(Be,{get value(){return e.t("settings.general.row.wayland.tooltip")},placement:"top",get children(){var he=Kt();return r(he,t(Y,{name:"help",size:"small"})),he}}),null),V})()},get description(){return e.t("settings.general.row.wayland.description")},get children(){var V=zt();return r(V,t(D,{get checked(){return A.latest==="wayland"},onChange:v})),V}})}}),null),Q}}),null),r(f,t(j,{get when(){return U(()=>!!G())()&&!1},get children(){return t(Te,{})}}),null),d})()},b=n=>(()=>{var e=Lt(),l=e.firstChild,i=l.firstChild,c=i.nextSibling,a=l.nextSibling;return r(i,()=>n.title),r(c,()=>n.description),r(a,()=>n.children),e})();var Nt=g('<span class="text-14-regular text-text-strong mt-1">"<!>"'),Mt=g('<div class="flex flex-col items-center justify-center py-12 text-center"><span class="text-14-regular text-text-weak">'),It=g('<div class="flex flex-col h-full overflow-y-auto no-scrollbar px-4 pb-10 sm:px-10 sm:pb-10"><div class="sticky top-0 z-10 bg-[linear-gradient(to_bottom,var(--surface-stronger-non-alpha)_calc(100%_-_24px),transparent)]"><div class="flex flex-col gap-4 pt-6 pb-6 max-w-[720px]"><div class="flex items-center justify-between gap-4"><h2 class="text-16-medium text-text-strong"></h2></div><div class="flex items-center gap-2 px-3 h-9 rounded-lg bg-surface-base"></div></div></div><div class="flex flex-col gap-8 max-w-[720px]">'),Rt=g('<div class="flex flex-col gap-1"><h3 class="text-14-medium text-text-strong pb-2">'),Wt=g('<div class="flex items-center justify-between gap-4 py-3 border-b border-border-weak-base last:border-none"><span class="text-14-regular text-text-strong"></span><button type=button>');const ue=typeof navigator=="object"&&/(Mac|iPod|iPhone|iPad)/.test(navigator.platform),ee="command.palette",Gt="mod+shift+p",se=["General","Session","Navigation","Model and agent","Terminal","Prompt"],Vt={General:"settings.shortcuts.group.general",Session:"settings.shortcuts.group.session",Navigation:"settings.shortcuts.group.navigation","Model and agent":"settings.shortcuts.group.modelAndAgent",Terminal:"settings.shortcuts.group.terminal",Prompt:"settings.shortcuts.group.prompt"};function pe(n){return n===ee?"General":n.startsWith("terminal.")?"Terminal":n.startsWith("model.")||n.startsWith("agent.")||n.startsWith("mcp.")?"Model and agent":n.startsWith("file.")||n.startsWith("fileTree.")?"Navigation":n.startsWith("prompt.")?"Prompt":n.startsWith("session.")||n.startsWith("message.")||n.startsWith("permissions.")||n.startsWith("steps.")||n.startsWith("review.")?"Session":"General"}function Ut(n){return n==="Shift"||n==="Control"||n==="Alt"||n==="Meta"}function qt(n){return n===","?"comma":n==="+"?"plus":n===" "?"space":n.toLowerCase()}function Ht(n){if(Ut(n.key))return;const e=[];(ue?n.metaKey:n.ctrlKey)&&e.push("mod"),ue&&n.ctrlKey&&e.push("ctrl"),!ue&&n.metaKey&&e.push("meta"),n.altKey&&e.push("alt"),n.shiftKey&&e.push("shift");const i=qt(n.key);if(i)return e.push(i),e.join("+")}function fe(n){if(!n)return[];const e=[];for(const l of rt(n)){const i=[];l.ctrl&&i.push("ctrl"),l.alt&&i.push("alt"),l.shift&&i.push("shift"),l.meta&&i.push("meta"),l.key&&i.push(l.key),i.length!==0&&e.push(i.join("+"))}return e}function Yt(n){return!n||typeof n!="object"||Array.isArray(n)?{}:n}function Jt(n,e,l){const i=new Map;i.set(ee,{title:l,group:"General"});for(const c of n.catalog)c.id.startsWith("suggested.")||c.hidden||i.set(c.id,{title:c.title,group:pe(c.id)});for(const c of n.options)c.id.startsWith("suggested.")||c.hidden||i.set(c.id,{title:c.title,group:pe(c.id)});for(const[c,a]of Object.entries(e))typeof a=="string"&&(i.has(c)||i.set(c,{title:c,group:pe(c)}));return i}function Qt(n){const e=new Map;for(const l of se)e.set(l,[]);for(const[l,i]of n){const c=e.get(i.group);c&&c.push(l)}for(const l of se){const i=e.get(l);i&&i.sort((c,a)=>(n.get(c)?.title??"").localeCompare(n.get(a)?.title??""))}return e}function Xt(n,e,l,i){const c=n.toLowerCase().trim();if(!c)return l;const a=new Map;for(const x of se)a.set(x,[]);const y=Array.from(e.entries()).map(([x,C])=>({id:x,title:C.title,group:C.group,keybind:i(x)})),w=nt.go(c,y,{keys:["title","keybind"],threshold:-1e4});for(const x of w){const C=a.get(x.obj.group);C&&C.push(x.obj.id)}return a}function Zt(n){ye(()=>{st(document,"keydown",l=>{const i=n.active();if(!i)return;if(l.preventDefault(),l.stopPropagation(),l.stopImmediatePropagation(),l.key==="Escape"){n.stop();return}if((l.key==="Backspace"||l.key==="Delete")&&!l.ctrlKey&&!l.metaKey&&!l.altKey&&!l.shiftKey){n.set(i,"none"),n.stop();return}const a=Ht(l);if(!a)return;const y=new Map;for(const w of fe(a))for(const x of n.used().get(w)??[])x.id!==i&&y.set(x.id,x.title);if(y.size>0){W({title:n.language.t("settings.shortcuts.conflict.title"),description:n.language.t("settings.shortcuts.conflict.description",{keybind:it(a,n.language.t),titles:[...y.values()].join(", ")})});return}n.set(i,a),n.stop()},{capture:!0})})}const en=()=>{const n=Qe(),e=ie(),l=be(),[i,c]=_e({active:null,filter:""}),a=()=>{i.active&&(c("active",null),n.keybinds(!0))},y=m=>{if(i.active===m){a();return}i.active&&a(),c("active",m),n.keybinds(!1)},w=E(()=>Yt(l.current.keybinds)),x=E(()=>Object.values(w()).some(m=>typeof m=="string")),C=()=>{a(),l.keybinds.resetAll(),W({title:e.t("settings.shortcuts.reset.toast.title"),description:e.t("settings.shortcuts.reset.toast.description")})},F=E(()=>(e.locale(),Jt(n,w(),e.t("command.palette")))),K=m=>F().get(m)?.title??"",G=E(()=>Qt(F())),L=E(()=>Xt(i.filter,F(),G(),m=>n.keybind(m)||"")),p=E(()=>{for(const m of se)if((L().get(m)??[]).length>0)return!0;return!1}),u=E(()=>{const m=new Map,A=(S,z)=>{const v=m.get(S);if(!v){m.set(S,[z]);return}v.push(z)},O=l.keybinds.get(ee)??Gt;for(const S of fe(O))A(S,{id:ee,title:K(ee)});const M=S=>{const z=l.keybinds.get(S);if(typeof z=="string")return z;const v=n.options.find(_=>_.id===S);return v?.keybind?v.keybind:n.catalog.find(_=>_.id===S)?.keybind};for(const S of F().keys())if(S!==ee)for(const z of fe(M(S)))A(z,{id:S,title:K(S)});return m});return Zt({active:()=>i.active,stop:a,set:(m,A)=>l.keybinds.set(m,A),used:u,language:e}),Xe(()=>{i.active&&n.keybinds(!0)}),(()=>{var m=It(),A=m.firstChild,O=A.firstChild,M=O.firstChild,S=M.firstChild,z=M.nextSibling,v=A.nextSibling;return r(S,()=>e.t("settings.shortcuts.title")),r(M,t(Z,{size:"small",variant:"secondary",onClick:C,get disabled(){return!x()},get children(){return e.t("settings.shortcuts.reset.button")}}),null),r(z,t(Y,{name:"magnifying-glass",class:"text-icon-weak-base flex-shrink-0"}),null),r(z,t(re,{variant:"ghost",type:"text",get value(){return i.filter},onChange:$=>c("filter",$),get placeholder(){return e.t("settings.shortcuts.search.placeholder")},spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"flex-1"}),null),r(z,t(j,{get when(){return i.filter},get children(){return t(ke,{icon:"circle-x",variant:"ghost",onClick:()=>c("filter","")})}}),null),r(v,t(te,{each:se,children:$=>t(j,{get when(){return(L().get($)??[]).length>0},get children(){var _=Rt(),P=_.firstChild;return r(P,()=>e.t(Vt[$])),r(_,t(N,{get children(){return t(te,{get each(){return L().get($)??[]},children:T=>(()=>{var I=Wt(),q=I.firstChild,J=q.nextSibling;return r(q,()=>K(T)),J.$$click=()=>y(T),Ze(J,"data-keybind-id",T),r(J,t(j,{get when(){return i.active===T},get fallback(){return n.keybind(T)||e.t("settings.shortcuts.unassigned")},get children(){return e.t("settings.shortcuts.pressKeys")}})),et(ne=>tt(J,{"h-8 px-3 rounded-md text-12-regular":!0,"bg-surface-base text-text-subtle hover:bg-surface-raised-base-hover active:bg-surface-raised-base-active":i.active!==T,"border border-border-weak-base bg-surface-inset-base text-text-weak":i.active===T},ne)),I})()})}}),null),_}})}),null),r(v,t(j,{get when(){return U(()=>!!i.filter)()&&!p()},get children(){var $=Mt(),_=$.firstChild;return r(_,()=>e.t("settings.shortcuts.search.empty")),r($,t(j,{get when(){return i.filter},get children(){var P=Nt(),T=P.firstChild,I=T.nextSibling;return I.nextSibling,r(P,()=>i.filter,I),P}}),null),$}}),null),m})()};Je(["click"]);var tn=g('<div class="flex items-center justify-between gap-4 min-h-16 border-b border-border-weak-base last:border-none flex-wrap py-3"data-component=custom-provider-section><div class="flex flex-col min-w-0"><div class="flex flex-wrap items-center gap-x-3 gap-y-1"><span class="text-14-medium text-text-strong"></span></div><span class="text-12-regular text-text-weak pl-8">'),nn=g('<div class="flex flex-col h-full overflow-y-auto no-scrollbar px-4 pb-10 sm:px-10 sm:pb-10"><div class="sticky top-0 z-10 bg-[linear-gradient(to_bottom,var(--surface-stronger-non-alpha)_calc(100%_-_24px),transparent)]"><div class="flex flex-col gap-1 pt-6 pb-8 max-w-[720px]"><h2 class="text-16-medium text-text-strong"></h2></div></div><div class="flex flex-col gap-8 max-w-[720px]"><div class="flex flex-col gap-1"data-component=connected-providers-section><h3 class="text-14-medium text-text-strong pb-2"></h3></div><div class="flex flex-col gap-1"><h3 class="text-14-medium text-text-strong pb-2">'),rn=g('<div class="py-4 text-14-regular text-text-weak">'),sn=g('<div class="group flex flex-wrap items-center justify-between gap-4 min-h-16 py-3 border-b border-border-weak-base last:border-none"><div class="flex items-center gap-3 min-w-0"><span class="text-14-medium text-text-strong truncate">'),an=g('<span class="text-14-regular text-text-base opacity-0 group-hover:opacity-100 transition-opacity duration-200 pr-3 cursor-default">'),ln=g('<div class="flex flex-wrap items-center justify-between gap-4 min-h-16 py-3 border-b border-border-weak-base last:border-none"><div class="flex flex-col min-w-0"><div class="flex items-center gap-x-3"><span class="text-14-medium text-text-strong">'),on=g('<span class="text-12-regular text-text-weak pl-8">');const cn=[{match:n=>n==="opencode",key:"dialog.provider.opencode.note"},{match:n=>n==="opencode-go",key:"dialog.provider.opencodeGo.tagline"},{match:n=>n==="anthropic",key:"dialog.provider.anthropic.note"},{match:n=>n.startsWith("github-copilot"),key:"dialog.provider.copilot.note"},{match:n=>n==="openai",key:"dialog.provider.openai.note"},{match:n=>n==="google",key:"dialog.provider.google.note"},{match:n=>n==="openrouter",key:"dialog.provider.openrouter.note"},{match:n=>n==="vercel",key:"dialog.provider.vercel.note"}],dn=()=>{const n=at(),e=ie(),l=$e(),i=we(),c=lt(),a=E(()=>c.connected().filter(p=>p.id!=="opencode"||Object.values(p.models).find(u=>u.cost?.input))),y=E(()=>{const p=new Set(a().map(k=>k.id)),u=c.popular().filter(k=>!p.has(k.id)).slice();return u.sort((k,m)=>ce.indexOf(k.id)-ce.indexOf(m.id)),u}),w=p=>{if(!("source"in p))return;const u=p.source;if(u==="env"||u==="api"||u==="config"||u==="custom")return u},x=p=>{const u=w(p);return u==="env"?e.t("settings.providers.tag.environment"):u==="api"?e.t("provider.connect.method.apiKey"):u==="config"?K(p.id)?e.t("settings.providers.tag.custom"):e.t("settings.providers.tag.config"):u==="custom"?e.t("settings.providers.tag.custom"):e.t("settings.providers.tag.other")},C=p=>w(p)!=="env",F=p=>cn.find(u=>u.match(p))?.key,K=p=>{const u=i.data.config.provider?.[p];return!(!u||u.npm!=="@ai-sdk/openai-compatible"||!u.models||Object.keys(u.models).length===0)},G=async(p,u)=>{const k=i.data.config.disabled_providers??[],m=k.includes(p)?k:[...k,p];i.set("config","disabled_providers",m),await i.updateConfig({disabled_providers:m}).then(()=>{W({variant:"success",icon:"circle-check",title:e.t("provider.disconnect.toast.disconnected.title",{provider:u}),description:e.t("provider.disconnect.toast.disconnected.description",{provider:u})})}).catch(A=>{i.set("config","disabled_providers",k);const O=A instanceof Error?A.message:String(A);W({title:e.t("common.requestFailed"),description:O})})},L=async(p,u)=>{if(K(p)){await l.client.auth.remove({providerID:p}).catch(()=>{}),await G(p,u);return}await l.client.auth.remove({providerID:p}).then(async()=>{await l.client.global.dispose(),W({variant:"success",icon:"circle-check",title:e.t("provider.disconnect.toast.disconnected.title",{provider:u}),description:e.t("provider.disconnect.toast.disconnected.description",{provider:u})})}).catch(k=>{const m=k instanceof Error?k.message:String(k);W({title:e.t("common.requestFailed"),description:m})})};return(()=>{var p=nn(),u=p.firstChild,k=u.firstChild,m=k.firstChild,A=u.nextSibling,O=A.firstChild,M=O.firstChild,S=O.nextSibling,z=S.firstChild;return r(m,()=>e.t("settings.providers.title")),r(M,()=>e.t("settings.providers.section.connected")),r(O,t(N,{get children(){return t(j,{get when(){return a().length>0},get fallback(){return(()=>{var v=rn();return r(v,()=>e.t("settings.providers.connected.empty")),v})()},get children(){return t(te,{get each(){return a()},children:v=>(()=>{var $=sn(),_=$.firstChild,P=_.firstChild;return r(_,t(oe,{get id(){return v.id},class:"size-5 shrink-0 icon-strong-base"}),P),r(P,()=>v.name),r(_,t(le,{get children(){return x(v)}}),null),r($,t(j,{get when(){return C(v)},get fallback(){return(()=>{var T=an();return r(T,()=>e.t("settings.providers.connected.environmentDescription")),T})()},get children(){return t(Z,{size:"large",variant:"ghost",onClick:()=>void L(v.id,v.name),get children(){return e.t("common.disconnect")}})}}),null),$})()})}})}}),null),r(z,()=>e.t("settings.providers.section.popular")),r(S,t(N,{get children(){return[t(te,{get each(){return y()},children:v=>(()=>{var $=ln(),_=$.firstChild,P=_.firstChild,T=P.firstChild;return r(P,t(oe,{get id(){return v.id},class:"size-5 shrink-0 icon-strong-base"}),T),r(T,()=>v.name),r(P,t(j,{get when(){return v.id==="opencode"},get children(){return t(le,{get children(){return e.t("dialog.provider.tag.recommended")}})}}),null),r(P,t(j,{get when(){return v.id==="opencode-go"},get children(){return t(le,{get children(){return e.t("dialog.provider.tag.recommended")}})}}),null),r(_,t(j,{get when(){return F(v.id)},children:I=>(()=>{var q=on();return r(q,()=>e.t(I())),q})()}),null),r($,t(Z,{size:"large",variant:"secondary",icon:"plus-small",onClick:()=>{n.show(()=>t(ut,{get provider(){return v.id}}))},get children(){return e.t("common.connect")}}),null),$})()}),(()=>{var v=tn(),$=v.firstChild,_=$.firstChild,P=_.firstChild,T=_.nextSibling;return r(_,t(oe,{id:"synthetic",class:"size-5 shrink-0 icon-strong-base"}),P),r(P,()=>e.t("provider.custom.title")),r(_,t(le,{get children(){return e.t("settings.providers.tag.custom")}}),null),r(T,()=>e.t("settings.providers.custom.description")),r(v,t(Z,{size:"large",variant:"secondary",icon:"plus-small",onClick:()=>{n.show(()=>t(pt,{back:"close"}))},get children(){return e.t("common.connect")}}),null),v})()]}}),null),r(S,t(Z,{variant:"ghost",class:"px-0 py-0 mt-5 text-14-medium text-text-interactive-base text-left justify-start hover:bg-transparent active:bg-transparent",onClick:()=>{n.show(()=>t(ft,{}))},get children(){return e.t("dialog.provider.viewAll")}}),null),p})()};var Ce=g('<div class="flex flex-col items-center justify-center py-12 text-center"><span class="text-14-regular text-text-weak">'),gn=g('<span class="text-14-regular text-text-strong mt-1">&quot;<!>&quot;'),un=g('<div class="flex flex-col h-full overflow-y-auto no-scrollbar px-4 pb-10 sm:px-10 sm:pb-10"><div class="sticky top-0 z-10 bg-[linear-gradient(to_bottom,var(--surface-stronger-non-alpha)_calc(100%_-_24px),transparent)]"><div class="flex flex-col gap-4 pt-6 pb-6 max-w-[720px]"><h2 class="text-16-medium text-text-strong"></h2><div class="flex items-center gap-2 px-3 h-9 rounded-lg bg-surface-base"></div></div></div><div class="flex flex-col gap-8 max-w-[720px]">'),pn=g('<div class="flex flex-col gap-1"><div class="flex items-center gap-2 pb-2"><span class="text-14-medium text-text-strong">'),fn=g('<div class="flex flex-wrap items-center justify-between gap-4 py-3 border-b border-border-weak-base last:border-none"><div class=min-w-0><span class="text-14-regular text-text-strong truncate block"></span></div><div class=flex-shrink-0>');const hn=n=>(()=>{var e=Ce(),l=e.firstChild;return r(l,()=>n.label),e})(),mn=n=>(()=>{var e=Ce(),l=e.firstChild;return r(l,()=>n.message),r(e,t(j,{get when(){return n.filter},get children(){var i=gn(),c=i.firstChild,a=c.nextSibling;return a.nextSibling,r(i,()=>n.filter,a),i}}),null),e})(),vn=()=>{const n=ie(),e=ot(),l=ct({items:i=>e.list(),key:i=>`${i.provider.id}:${i.id}`,filterKeys:["provider.name","name","id"],sortBy:(i,c)=>i.name.localeCompare(c.name),groupBy:i=>i.provider.id,sortGroupsBy:(i,c)=>{const a=ce.indexOf(i.category),y=ce.indexOf(c.category),w=a>=0,x=y>=0;if(w&&!x)return-1;if(!w&&x)return 1;if(w&&x)return a-y;const C=i.items[0].provider.name,F=c.items[0].provider.name;return C.localeCompare(F)}});return(()=>{var i=un(),c=i.firstChild,a=c.firstChild,y=a.firstChild,w=y.nextSibling,x=c.nextSibling;return r(y,()=>n.t("settings.models.title")),r(w,t(Y,{name:"magnifying-glass",class:"text-icon-weak-base flex-shrink-0"}),null),r(w,t(re,{variant:"ghost",type:"text",get value(){return l.filter()},get onChange(){return l.onInput},get placeholder(){return n.t("dialog.model.search.placeholder")},spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"flex-1"}),null),r(w,t(j,{get when(){return l.filter()},get children(){return t(ke,{icon:"circle-x",variant:"ghost",get onClick(){return l.clear}})}}),null),r(x,t(j,{get when(){return!l.grouped.loading},get fallback(){return t(hn,{get label(){return`${n.t("common.loading")}${n.t("common.loading.ellipsis")}`}})},get children(){return t(j,{get when(){return l.flat().length>0},get fallback(){return t(mn,{get message(){return n.t("dialog.model.empty")},get filter(){return l.filter()}})},get children(){return t(te,{get each(){return l.grouped.latest},children:C=>(()=>{var F=pn(),K=F.firstChild,G=K.firstChild;return r(K,t(oe,{get id(){return C.category},class:"size-5 shrink-0 icon-strong-base"}),G),r(G,()=>C.items[0].provider.name),r(F,t(N,{get children(){return t(te,{get each(){return C.items},children:L=>{const p={providerID:L.provider.id,modelID:L.id};return(()=>{var u=fn(),k=u.firstChild,m=k.firstChild,A=k.nextSibling;return r(m,()=>L.name),r(A,t(D,{get checked(){return e.visible(p)},onChange:O=>{e.setVisibility(p,O)},hideLabel:!0,get children(){return L.name}})),u})()}})}}),null),F})()})}})}})),i})()};var xn=g('<div class="flex flex-col justify-between h-full w-full"><div class="flex flex-col gap-3 w-full pt-3"><div class="flex flex-col gap-3"><div class="flex flex-col gap-1.5"><div class="flex flex-col gap-1.5 w-full"></div></div><div class="flex flex-col gap-1.5"><div class="flex flex-col gap-1.5 w-full"></div></div></div></div><div class="flex flex-col gap-1 pl-1 py-1 text-12-medium text-text-weak"><span></span><span class=text-11-regular>v');const kn=()=>{const n=ie(),e=xe();return t(dt,{size:"x-large",transition:!0,get children(){return t(B,{orientation:"vertical",variant:"settings",defaultValue:"general",class:"h-full settings-dialog",get children(){return[t(B.List,{get children(){var l=xn(),i=l.firstChild,c=i.firstChild,a=c.firstChild,y=a.firstChild,w=a.nextSibling,x=w.firstChild,C=i.nextSibling,F=C.firstChild,K=F.nextSibling;return K.firstChild,r(a,t(B.SectionTitle,{get children(){return n.t("settings.section.desktop")}}),y),r(y,t(B.Trigger,{value:"general",get children(){return[t(Y,{name:"sliders"}),U(()=>n.t("settings.tab.general"))]}}),null),r(y,t(B.Trigger,{value:"shortcuts",get children(){return[t(Y,{name:"keyboard"}),U(()=>n.t("settings.tab.shortcuts"))]}}),null),r(w,t(B.SectionTitle,{get children(){return n.t("settings.section.server")}}),x),r(x,t(B.Trigger,{value:"providers",get children(){return[t(Y,{name:"providers"}),U(()=>n.t("settings.providers.title"))]}}),null),r(x,t(B.Trigger,{value:"models",get children(){return[t(Y,{name:"models"}),U(()=>n.t("settings.models.title"))]}}),null),r(F,()=>n.t("app.name.desktop")),r(K,()=>e.version,null),l}}),t(B.Content,{value:"general",class:"no-scrollbar",get children(){return t(Bt,{})}}),t(B.Content,{value:"shortcuts",class:"no-scrollbar",get children(){return t(en,{})}}),t(B.Content,{value:"providers",class:"no-scrollbar",get children(){return t(dn,{})}}),t(B.Content,{value:"models",class:"no-scrollbar",get children(){return t(vn,{})}})]}})}})};export{kn as DialogSettings};