@onescience/onecode-web 1.14.50-202607221649 → 1.14.50-202607231111

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 (53) hide show
  1. package/assets/{alert-01-DhjuTI9i.js → alert-01-6gSCJFYY.js} +1 -1
  2. package/assets/{alert-02-B4X1obop.js → alert-02-DsbqruP7.js} +1 -1
  3. package/assets/{alert-04-BBYzzRMV.js → alert-04-DZ1lgBgH.js} +1 -1
  4. package/assets/{alert-05-BrV-Kly2.js → alert-05-BKv4LrOE.js} +1 -1
  5. package/assets/alert-06-hyWGGoRQ.js +1 -0
  6. package/assets/alert-07-DUSZLpaj.js +1 -0
  7. package/assets/alert-08-DotnL2r8.js +1 -0
  8. package/assets/alert-10-BCujfesq.js +1 -0
  9. package/assets/{bip-bop-03-CNYn_Csa.js → bip-bop-03-ENvr_TQj.js} +1 -1
  10. package/assets/{bip-bop-04-BpQqjs_P.js → bip-bop-04-DNuH8BCf.js} +1 -1
  11. package/assets/{bip-bop-06-DuLQzVGO.js → bip-bop-06-D96ipHen.js} +1 -1
  12. package/assets/{bip-bop-08-TyBPrKif.js → bip-bop-08-BQI6UKn5.js} +1 -1
  13. package/assets/bip-bop-09-BqU9HZQq.js +1 -0
  14. package/assets/{dialog-create-project-folder-k5uUqNZ8.js → dialog-create-project-folder-pbq6DSGz.js} +1 -1
  15. package/assets/{dialog-edit-project-CWP2DKic.js → dialog-edit-project-d7INQGq8.js} +1 -1
  16. package/assets/{dialog-fork-Va9uThRo.js → dialog-fork-Cbgzvlil.js} +1 -1
  17. package/assets/{dialog-select-directory-GJIiuwsQ.js → dialog-select-directory-DD5x8PdI.js} +1 -1
  18. package/assets/{dialog-select-file-1qFf1lL_.js → dialog-select-file-BEjj7x-a.js} +1 -1
  19. package/assets/{dialog-select-mcp-DupvbyEw.js → dialog-select-mcp-jeE2F6LH.js} +1 -1
  20. package/assets/{dialog-select-model-bTX-yvkO.js → dialog-select-model-CW2USNWl.js} +2 -2
  21. package/assets/{dialog-select-provider-B_2HuxfT.js → dialog-select-provider-BL4_l6ma.js} +2 -2
  22. package/assets/{dialog-select-server-DOT0mqaK.js → dialog-select-server-BeK-GCRq.js} +1 -1
  23. package/assets/{dialog-settings-BsEhgbdw.js → dialog-settings-C6v5yaFl.js} +1 -1
  24. package/assets/{ghostty-web-D8ahOVQo.js → ghostty-web-GJqs5TVW.js} +1 -1
  25. package/assets/{index-pQ_j64sR.css → index-Bh_cDQcN.css} +1 -1
  26. package/assets/{index-CX_S-Fh-.js → index-ChOscytb.js} +154 -154
  27. package/assets/{nope-02-DzQkfwfb.js → nope-02-jKF9g7-l.js} +1 -1
  28. package/assets/{nope-05-6YWA1WgB.js → nope-05-C9RIR0aK.js} +1 -1
  29. package/assets/{nope-08-DrWRR2nV.js → nope-08-D5hPSdlA.js} +1 -1
  30. package/assets/{nope-11--unJRR3C.js → nope-11-NO_7sLBo.js} +1 -1
  31. package/assets/nope-12-Cq5TMSnw.js +1 -0
  32. package/assets/{prompt-helper-dialog-DNB7fZLV.js → prompt-helper-dialog-gYCY_-xe.js} +1 -1
  33. package/assets/{server-row-9EfIb0Yn.js → server-row-CSvkMpOq.js} +1 -1
  34. package/assets/{staplebops-03-BnUB4iL1.js → staplebops-03-B6aYYhtr.js} +1 -1
  35. package/assets/{staplebops-04-BafZgCD2.js → staplebops-04-QQfrubwP.js} +1 -1
  36. package/assets/{staplebops-06-X5Nm6XYG.js → staplebops-06-9U4-rd-J.js} +1 -1
  37. package/assets/{staplebops-07-BSsxvp1Y.js → staplebops-07-BCwK_sJo.js} +1 -1
  38. package/assets/{status-popover-body-BLUtrU_R.js → status-popover-body-DUhAe3jy.js} +2 -2
  39. package/assets/{tag-DVYWd8tz.js → tag-BpN5JcFY.js} +1 -1
  40. package/assets/{yup-01-CFA1erjV.js → yup-01-DZ73yXfR.js} +1 -1
  41. package/assets/{yup-03-C7y9ga0J.js → yup-03-As8wKHLH.js} +1 -1
  42. package/assets/{yup-04-gaCv7GhQ.js → yup-04-DFbZLb76.js} +1 -1
  43. package/assets/{yup-05-Yc0l_gse.js → yup-05-B4VP9zJ5.js} +1 -1
  44. package/assets/{zh-2z697GM3.js → zh-nWArLqfc.js} +1 -1
  45. package/assets/{zht-BHTvOuxi.js → zht-BL3QoCLx.js} +1 -1
  46. package/index.html +9 -9
  47. package/package.json +2 -2
  48. package/assets/alert-06-C0uuPQxW.js +0 -1
  49. package/assets/alert-07-BBpgwMYE.js +0 -1
  50. package/assets/alert-08-BiG9OJJ2.js +0 -1
  51. package/assets/alert-10-BN2dDXbw.js +0 -1
  52. package/assets/bip-bop-09-CdJlJBAL.js +0 -1
  53. package/assets/nope-12-CjF5j_yk.js +0 -1
@@ -1 +1 @@
1
- import{i as r,t as f,a2 as He,f as ce,a3 as Je,u as Ie,a4 as Ye,a5 as Le,k as Ce,h as L,a6 as Xe,c as he,e as De,j as _e,w as ze,n as t,a7 as M,a1 as Qe,I as Z,H as z,p as q,a8 as re,T as J,a9 as Ze,aa as et,ab as tt,ac as nt,ad as rt,ae as st,m as ve,B as G,af as it,ag as at,ah as ot,ai as lt,y as B,aj as ct,d as je,ak as dt,o as Oe,v as Pe,F as le,G as gt,r as Ue,X as ut,al as pt,am as ft,an as ht,ao as mt,b as Te,z as Re,A as ie,l as Ee,J as Me,S as vt,M as be,D as Be,g as bt,N as fe,P as pe,ap as xt,aq as wt,ar as V}from"./index-CX_S-Fh-.js";import{L as yt,D as ke,a as $t,b as _t}from"./dialog-select-provider-B_2HuxfT.js";import{T as ue}from"./tag-DVYWd8tz.js";var kt=f('<div class="bg-surface-base px-4 rounded-lg">');const H=n=>(()=>{var e=kt();return r(e,()=>n.children),e})(),St={BASE_URL:"https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202607221649/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};var Ct=f("<div data-action=settings-auto-accept-permissions>"),Dt=f("<div data-action=settings-feed-reasoning-summaries>"),Pt=f("<div data-action=settings-feed-shell-tool-parts-expanded>"),Tt=f("<div data-action=settings-feed-edit-tool-parts-expanded>"),At=f("<div data-action=settings-show-session-progress-bar>"),Et=f('<div class="flex flex-col gap-1">'),Nt=f("<div data-action=settings-show-file-tree>"),Kt=f("<div data-action=settings-show-navigation>"),Ft=f("<div data-action=settings-show-search>"),It=f("<div data-action=settings-show-terminal>"),Lt=f("<div data-action=settings-show-status>"),ae=f('<div class="flex flex-col gap-1"><h3 class="text-14-medium text-text-strong pb-2">'),xe=f('<div class="w-full sm:w-[220px]">'),zt=f("<div data-action=settings-notifications-agent>"),jt=f("<div data-action=settings-notifications-permissions>"),Ot=f("<div data-action=settings-notifications-errors>"),Ut=f("<div data-action=settings-updates-startup>"),Rt=f("<div data-action=settings-release-notes>"),Mt=f("<div data-action=settings-wayland>"),Bt=f('<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">'),Wt=f("<span class=text-text-weak>"),Gt=f('<div class="flex items-center gap-2"><span>'),qt=f('<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 Y={cleanup:void 0,timeout:void 0,run:0};const We=()=>{Y.run+=1,Y.cleanup&&Y.cleanup(),clearTimeout(Y.timeout),Y.cleanup=void 0},Ne=n=>{if(We(),!n)return;const e=++Y.run;Y.timeout=setTimeout(()=>{ct(n).then(o=>{if(Y.run!==e){o?.();return}Y.cleanup=o})},100)},Vt=()=>{const n=He(),e=ce(),o=Je(),a=Ie(),g=Ye(),s=Le(),[b,y]=Ce({checking:!1}),k=L(()=>a.platform==="desktop"&&a.os==="linux"),x=L(()=>Xe(g.dir)),C=L(()=>{const u=x();return u?g.id?o.isAutoAccepting(g.id,u):o.isAutoAcceptingDirectory(u):!1}),F=u=>{const l=x();if(l){if(!g.id){if(o.isAutoAcceptingDirectory(l)===u)return;o.toggleAutoAcceptDirectory(l);return}if(u){o.enableAutoAccept(g.id,l);return}o.disableAutoAccept(g.id,l)}},O=L(()=>a.platform==="desktop"),j=()=>{a.checkUpdate&&(y("checking",!0),a.checkUpdate().then(u=>{if(!u.updateAvailable){B({variant:"success",icon:"circle-check",title:e.t("settings.updates.toast.latest.title"),description:e.t("settings.updates.toast.latest.description",{version:a.version??""})});return}const l=a.updateAndRestart?[{label:e.t("toast.update.action.installRestart"),onClick:async()=>{await a.updateAndRestart()}},{label:e.t("toast.update.action.notYet"),onClick:"dismiss"}]:[{label:e.t("toast.update.action.notYet"),onClick:"dismiss"}];B({persistent:!0,icon:"download",title:e.t("toast.update.title"),description:e.t("toast.update.description",{version:u.version??""}),actions:l})}).catch(u=>{const l=u instanceof Error?u.message:String(u);B({title:e.t("common.requestFailed"),description:l})}).finally(()=>y("checking",!1)))},W=L(()=>n.ids().map(u=>({id:u,name:n.name(u)}))),v=he(),p=De(),[d]=_e(()=>p.client.pty.shells().then(u=>u.data??[]).catch(()=>[]),{initialValue:[]}),[_,{refetch:U}]=_e(()=>!!(k()&&a.getDisplayBackend),()=>Promise.resolve(a.getDisplayBackend?.()??null).catch(()=>null),{initialValue:null});ze(()=>{n.loadThemes()});const S={id:"auto",value:"",label:e.t("settings.general.row.shell.autoDefault")},D=L(()=>v.data.config.shell??""),P=L(()=>{const u=d.latest,l=v.data.config.shell,i=new Map;for(const w of u)i.set(w.name,(i.get(w.name)||0)+1);const $=[S,...u.map(w=>{const se=(i.get(w.name)||0)>1,ge=se?w.path:w.name,Q=w.acceptable?ge:`${ge} (${e.t("settings.general.row.shell.terminalOnly")})`;return{id:w.path,value:se?w.path:w.name,label:Q}})];return l&&!$.some(w=>w.value===l)&&$.push({id:l,value:l,label:l}),$}),R=u=>{const l=a.setDisplayBackend?.(u?"wayland":"auto");l&&l.finally(()=>{U()})},m=L(()=>[{value:"system",label:e.t("theme.scheme.system")},{value:"light",label:e.t("theme.scheme.light")},{value:"dark",label:e.t("theme.scheme.dark")}]),A=L(()=>e.locales.map(u=>({value:u,label:e.label(u)}))),N={id:"none",label:"sound.option.none"},E=[N,...lt],I=()=>at(s.appearance.font()),c=()=>it(s.appearance.uiFont()),h=()=>ot(s.appearance.terminalFont()),K=(u,l,i,$)=>({options:E,current:u()?E.find(w=>w.id===l())??N:N,value:w=>w.id,label:w=>e.t(w.label),onHighlight:w=>{w&&Ne(w.id==="none"?void 0:w.id)},onSelect:w=>{if(w){if(w.id==="none"){i(!1),We();return}i(!0),$(w.id),Ne(w.id)}},variant:"secondary",size:"small",triggerVariant:"settings"}),ee=()=>(()=>{var u=Et();return r(u,t(H,{get children(){return[t(T,{get title(){return e.t("settings.general.row.language.title")},get description(){return e.t("settings.general.row.language.description")},get children(){return t(re,{"data-action":"settings-language",get options(){return A()},get current(){return A().find(l=>l.value===e.locale())},value:l=>l.value,label:l=>l.label,onSelect:l=>l&&e.setLocale(l.value),variant:"secondary",size:"small",triggerVariant:"settings"})}}),t(T,{get title(){return e.t("command.permissions.autoaccept.enable")},get description(){return e.t("toast.permissions.autoaccept.on.description")},get children(){var l=Ct();return r(l,t(M,{get checked(){return C()},get disabled(){return!x()},onChange:F})),l}}),t(T,{get title(){return e.t("settings.general.row.shell.title")},get description(){return e.t("settings.general.row.shell.description")},get children(){return t(re,{"data-action":"settings-shell",get options(){return P()},get current(){return P().find(l=>l.value===D())??S},value:l=>l.id,label:l=>l.label,onSelect:l=>{l&&l.value!==D()&&v.updateConfig({shell:l.value})},variant:"secondary",size:"small",triggerVariant:"settings",triggerStyle:{"min-width":"180px"}})}}),t(T,{get title(){return e.t("settings.general.row.reasoningSummaries.title")},get description(){return e.t("settings.general.row.reasoningSummaries.description")},get children(){var l=Dt();return r(l,t(M,{get checked(){return s.general.showReasoningSummaries()},onChange:i=>s.general.setShowReasoningSummaries(i)})),l}}),t(T,{get title(){return e.t("settings.general.row.shellToolPartsExpanded.title")},get description(){return e.t("settings.general.row.shellToolPartsExpanded.description")},get children(){var l=Pt();return r(l,t(M,{get checked(){return s.general.shellToolPartsExpanded()},onChange:i=>s.general.setShellToolPartsExpanded(i)})),l}}),t(T,{get title(){return e.t("settings.general.row.editToolPartsExpanded.title")},get description(){return e.t("settings.general.row.editToolPartsExpanded.description")},get children(){var l=Tt();return r(l,t(M,{get checked(){return s.general.editToolPartsExpanded()},onChange:i=>s.general.setEditToolPartsExpanded(i)})),l}}),t(T,{get title(){return e.t("settings.general.row.showSessionProgressBar.title")},get description(){return e.t("settings.general.row.showSessionProgressBar.description")},get children(){var l=At();return r(l,t(M,{get checked(){return s.general.showSessionProgressBar()},onChange:i=>s.general.setShowSessionProgressBar(i)})),l}})]}})),u})(),X=()=>(()=>{var u=ae(),l=u.firstChild;return r(l,()=>e.t("settings.general.section.advanced")),r(u,t(H,{get children(){return[t(T,{get title(){return e.t("settings.general.row.showFileTree.title")},get description(){return e.t("settings.general.row.showFileTree.description")},get children(){var i=Nt();return r(i,t(M,{get checked(){return s.general.showFileTree()},onChange:$=>s.general.setShowFileTree($)})),i}}),t(T,{get title(){return e.t("settings.general.row.showNavigation.title")},get description(){return e.t("settings.general.row.showNavigation.description")},get children(){var i=Kt();return r(i,t(M,{get checked(){return s.general.showNavigation()},onChange:$=>s.general.setShowNavigation($)})),i}}),t(T,{get title(){return e.t("settings.general.row.showSearch.title")},get description(){return e.t("settings.general.row.showSearch.description")},get children(){var i=Ft();return r(i,t(M,{get checked(){return s.general.showSearch()},onChange:$=>s.general.setShowSearch($)})),i}}),t(T,{get title(){return e.t("settings.general.row.showTerminal.title")},get description(){return e.t("settings.general.row.showTerminal.description")},get children(){var i=It();return r(i,t(M,{get checked(){return s.general.showTerminal()},onChange:$=>s.general.setShowTerminal($)})),i}}),t(T,{get title(){return e.t("settings.general.row.showStatus.title")},get description(){return e.t("settings.general.row.showStatus.description")},get children(){var i=Lt();return r(i,t(M,{get checked(){return s.general.showStatus()},onChange:$=>s.general.setShowStatus($)})),i}})]}}),null),u})(),te=()=>(()=>{var u=ae(),l=u.firstChild;return r(l,()=>e.t("settings.general.section.appearance")),r(u,t(H,{get children(){return[t(T,{get title(){return e.t("settings.general.row.colorScheme.title")},get description(){return e.t("settings.general.row.colorScheme.description")},get children(){return t(re,{"data-action":"settings-color-scheme",get options(){return m()},get current(){return m().find(i=>i.value===n.colorScheme())},value:i=>i.value,label:i=>i.label,onSelect:i=>i&&n.setColorScheme(i.value),onHighlight:i=>{if(i)return n.previewColorScheme(i.value),()=>n.cancelPreview()},variant:"secondary",size:"small",triggerVariant:"settings",triggerStyle:{"min-width":"220px"}})}}),t(T,{get title(){return e.t("settings.general.row.theme.title")},get description(){return[q(()=>e.t("settings.general.row.theme.description"))," ",t(yt,{href:"https://opencode.ai/docs/themes/",get children(){return e.t("common.learnMore")}})]},get children(){return t(re,{"data-action":"settings-theme",get options(){return W()},get current(){return W().find(i=>i.id===n.themeId())},value:i=>i.id,label:i=>i.name,onSelect:i=>{i&&n.setTheme(i.id)},onHighlight:i=>{if(i)return n.previewTheme(i.id),()=>n.cancelPreview()},variant:"secondary",size:"small",triggerVariant:"settings"})}}),t(T,{get title(){return e.t("settings.general.row.uiFont.title")},get description(){return e.t("settings.general.row.uiFont.description")},get children(){var i=xe();return r(i,t(J,{"data-action":"settings-ui-font",get label(){return e.t("settings.general.row.uiFont.title")},hideLabel:!0,type:"text",get value(){return c()},onChange:$=>s.appearance.setUIFont($),placeholder:Ze,spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"text-12-regular",get style(){return{"font-family":et(s.appearance.uiFont())}}})),i}}),t(T,{get title(){return e.t("settings.general.row.font.title")},get description(){return e.t("settings.general.row.font.description")},get children(){var i=xe();return r(i,t(J,{"data-action":"settings-code-font",get label(){return e.t("settings.general.row.font.title")},hideLabel:!0,type:"text",get value(){return I()},onChange:$=>s.appearance.setFont($),placeholder:tt,spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"text-12-regular",get style(){return{"font-family":nt(s.appearance.font())}}})),i}}),t(T,{get title(){return e.t("settings.general.row.terminalFont.title")},get description(){return e.t("settings.general.row.terminalFont.description")},get children(){var i=xe();return r(i,t(J,{"data-action":"settings-terminal-font",get label(){return e.t("settings.general.row.terminalFont.title")},hideLabel:!0,type:"text",get value(){return h()},onChange:$=>s.appearance.setTerminalFont($),placeholder:rt,spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"text-12-regular",get style(){return{"font-family":st(s.appearance.terminalFont())}}})),i}})]}}),null),u})(),ne=()=>(()=>{var u=ae(),l=u.firstChild;return r(l,()=>e.t("settings.general.section.notifications")),r(u,t(H,{get children(){return[t(T,{get title(){return e.t("settings.general.notifications.agent.title")},get description(){return e.t("settings.general.notifications.agent.description")},get children(){var i=zt();return r(i,t(M,{get checked(){return s.notifications.agent()},onChange:$=>s.notifications.setAgent($)})),i}}),t(T,{get title(){return e.t("settings.general.notifications.permissions.title")},get description(){return e.t("settings.general.notifications.permissions.description")},get children(){var i=jt();return r(i,t(M,{get checked(){return s.notifications.permissions()},onChange:$=>s.notifications.setPermissions($)})),i}}),t(T,{get title(){return e.t("settings.general.notifications.errors.title")},get description(){return e.t("settings.general.notifications.errors.description")},get children(){var i=Ot();return r(i,t(M,{get checked(){return s.notifications.errors()},onChange:$=>s.notifications.setErrors($)})),i}})]}}),null),u})(),me=()=>(()=>{var u=ae(),l=u.firstChild;return r(l,()=>e.t("settings.general.section.sounds")),r(u,t(H,{get children(){return[t(T,{get title(){return e.t("settings.general.sounds.agent.title")},get description(){return e.t("settings.general.sounds.agent.description")},get children(){return t(re,ve({"data-action":"settings-sounds-agent"},()=>K(()=>s.sounds.agentEnabled(),()=>s.sounds.agent(),i=>s.sounds.setAgentEnabled(i),i=>s.sounds.setAgent(i))))}}),t(T,{get title(){return e.t("settings.general.sounds.permissions.title")},get description(){return e.t("settings.general.sounds.permissions.description")},get children(){return t(re,ve({"data-action":"settings-sounds-permissions"},()=>K(()=>s.sounds.permissionsEnabled(),()=>s.sounds.permissions(),i=>s.sounds.setPermissionsEnabled(i),i=>s.sounds.setPermissions(i))))}}),t(T,{get title(){return e.t("settings.general.sounds.errors.title")},get description(){return e.t("settings.general.sounds.errors.description")},get children(){return t(re,ve({"data-action":"settings-sounds-errors"},()=>K(()=>s.sounds.errorsEnabled(),()=>s.sounds.errors(),i=>s.sounds.setErrorsEnabled(i),i=>s.sounds.setErrors(i))))}})]}}),null),u})(),qe=()=>(()=>{var u=ae(),l=u.firstChild;return r(l,()=>e.t("settings.general.section.updates")),r(u,t(H,{get children(){return[t(T,{get title(){return e.t("settings.updates.row.startup.title")},get description(){return e.t("settings.updates.row.startup.description")},get children(){var i=Ut();return r(i,t(M,{get checked(){return s.updates.startup()},get disabled(){return!a.checkUpdate},onChange:$=>s.updates.setStartup($)})),i}}),t(T,{get title(){return e.t("settings.general.row.releaseNotes.title")},get description(){return e.t("settings.general.row.releaseNotes.description")},get children(){var i=Rt();return r(i,t(M,{get checked(){return s.general.releaseNotes()},onChange:$=>s.general.setReleaseNotes($)})),i}}),t(T,{get title(){return e.t("settings.updates.row.check.title")},get description(){return e.t("settings.updates.row.check.description")},get children(){return t(G,{size:"small",variant:"secondary",get disabled(){return b.checking||!a.checkUpdate},onClick:j,get children(){return q(()=>!!b.checking)()?e.t("settings.updates.action.checking"):e.t("settings.updates.action.checkNow")}})}})]}}),null),u})();return console.log(St),(()=>{var u=Bt(),l=u.firstChild,i=l.firstChild,$=i.firstChild,w=l.nextSibling;return r($,()=>e.t("settings.tab.general")),r(w,t(ee,{}),null),r(w,t(te,{}),null),r(w,t(ne,{}),null),r(w,t(me,{}),null),r(w,t(qe,{}),null),r(w,t(z,{get when(){return k()},get children(){var se=ae(),ge=se.firstChild;return r(ge,()=>e.t("settings.general.section.display")),r(se,t(H,{get children(){return t(T,{get title(){return(()=>{var Q=Gt(),Ve=Q.firstChild;return r(Ve,()=>e.t("settings.general.row.wayland.title")),r(Q,t(Qe,{get value(){return e.t("settings.general.row.wayland.tooltip")},placement:"top",get children(){var Ae=Wt();return r(Ae,t(Z,{name:"help",size:"small"})),Ae}}),null),Q})()},get description(){return e.t("settings.general.row.wayland.description")},get children(){var Q=Mt();return r(Q,t(M,{get checked(){return _.latest==="wayland"},onChange:R})),Q}})}}),null),se}}),null),r(w,t(z,{get when(){return q(()=>!!O())()&&!1},get children(){return t(X,{})}}),null),u})()},T=n=>(()=>{var e=qt(),o=e.firstChild,a=o.firstChild,g=a.nextSibling,s=o.nextSibling;return r(a,()=>n.title),r(g,()=>n.description),r(s,()=>n.children),e})();var Ht=f('<span class="text-14-regular text-text-strong mt-1">"<!>"'),Jt=f('<div class="flex flex-col items-center justify-center py-12 text-center"><span class="text-14-regular text-text-weak">'),Yt=f('<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]">'),Xt=f('<div class="flex flex-col gap-1"><h3 class="text-14-medium text-text-strong pb-2">'),Qt=f('<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 we=typeof navigator=="object"&&/(Mac|iPod|iPhone|iPad)/.test(navigator.platform),oe="command.palette",Zt="mod+shift+p",de=["General","Session","Navigation","Model and agent","Terminal","Prompt"],en={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 ye(n){return n===oe?"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 tn(n){return n==="Shift"||n==="Control"||n==="Alt"||n==="Meta"}function nn(n){return n===","?"comma":n==="+"?"plus":n===" "?"space":n.toLowerCase()}function rn(n){if(tn(n.key))return;const e=[];(we?n.metaKey:n.ctrlKey)&&e.push("mod"),we&&n.ctrlKey&&e.push("ctrl"),!we&&n.metaKey&&e.push("meta"),n.altKey&&e.push("alt"),n.shiftKey&&e.push("shift");const a=nn(n.key);if(a)return e.push(a),e.join("+")}function Se(n){if(!n)return[];const e=[];for(const o of ft(n)){const a=[];o.ctrl&&a.push("ctrl"),o.alt&&a.push("alt"),o.shift&&a.push("shift"),o.meta&&a.push("meta"),o.key&&a.push(o.key),a.length!==0&&e.push(a.join("+"))}return e}function sn(n){return!n||typeof n!="object"||Array.isArray(n)?{}:n}function an(n,e,o){const a=new Map;a.set(oe,{title:o,group:"General"});for(const g of n.catalog)g.id.startsWith("suggested.")||g.hidden||a.set(g.id,{title:g.title,group:ye(g.id)});for(const g of n.options)g.id.startsWith("suggested.")||g.hidden||a.set(g.id,{title:g.title,group:ye(g.id)});for(const[g,s]of Object.entries(e))typeof s=="string"&&(a.has(g)||a.set(g,{title:g,group:ye(g)}));return a}function on(n){const e=new Map;for(const o of de)e.set(o,[]);for(const[o,a]of n){const g=e.get(a.group);g&&g.push(o)}for(const o of de){const a=e.get(o);a&&a.sort((g,s)=>(n.get(g)?.title??"").localeCompare(n.get(s)?.title??""))}return e}function ln(n,e,o,a){const g=n.toLowerCase().trim();if(!g)return o;const s=new Map;for(const k of de)s.set(k,[]);const b=Array.from(e.entries()).map(([k,x])=>({id:k,title:x.title,group:x.group,keybind:a(k)})),y=pt.go(g,b,{keys:["title","keybind"],threshold:-1e4});for(const k of y){const x=s.get(k.obj.group);x&&x.push(k.obj.id)}return s}function cn(n){ze(()=>{ht(document,"keydown",o=>{const a=n.active();if(!a)return;if(o.preventDefault(),o.stopPropagation(),o.stopImmediatePropagation(),o.key==="Escape"){n.stop();return}if((o.key==="Backspace"||o.key==="Delete")&&!o.ctrlKey&&!o.metaKey&&!o.altKey&&!o.shiftKey){n.set(a,"none"),n.stop();return}const s=rn(o);if(!s)return;const b=new Map;for(const y of Se(s))for(const k of n.used().get(y)??[])k.id!==a&&b.set(k.id,k.title);if(b.size>0){B({title:n.language.t("settings.shortcuts.conflict.title"),description:n.language.t("settings.shortcuts.conflict.description",{keybind:mt(s,n.language.t),titles:[...b.values()].join(", ")})});return}n.set(a,s),n.stop()},{capture:!0})})}const dn=()=>{const n=dt(),e=ce(),o=Le(),[a,g]=Ce({active:null,filter:""}),s=()=>{a.active&&(g("active",null),n.keybinds(!0))},b=d=>{if(a.active===d){s();return}a.active&&s(),g("active",d),n.keybinds(!1)},y=L(()=>sn(o.current.keybinds)),k=L(()=>Object.values(y()).some(d=>typeof d=="string")),x=()=>{s(),o.keybinds.resetAll(),B({title:e.t("settings.shortcuts.reset.toast.title"),description:e.t("settings.shortcuts.reset.toast.description")})},C=L(()=>(e.locale(),an(n,y(),e.t("command.palette")))),F=d=>C().get(d)?.title??"",O=L(()=>on(C())),j=L(()=>ln(a.filter,C(),O(),d=>n.keybind(d)||"")),W=L(()=>{for(const d of de)if((j().get(d)??[]).length>0)return!0;return!1}),v=L(()=>{const d=new Map,_=(D,P)=>{const R=d.get(D);if(!R){d.set(D,[P]);return}R.push(P)},U=o.keybinds.get(oe)??Zt;for(const D of Se(U))_(D,{id:oe,title:F(oe)});const S=D=>{const P=o.keybinds.get(D);if(typeof P=="string")return P;const R=n.options.find(A=>A.id===D);return R?.keybind?R.keybind:n.catalog.find(A=>A.id===D)?.keybind};for(const D of C().keys())if(D!==oe)for(const P of Se(S(D)))_(P,{id:D,title:F(D)});return d});return cn({active:()=>a.active,stop:s,set:(d,_)=>o.keybinds.set(d,_),used:v,language:e}),Oe(()=>{a.active&&n.keybinds(!0)}),(()=>{var d=Yt(),_=d.firstChild,U=_.firstChild,S=U.firstChild,D=S.firstChild,P=S.nextSibling,R=_.nextSibling;return r(D,()=>e.t("settings.shortcuts.title")),r(S,t(G,{size:"small",variant:"secondary",onClick:x,get disabled(){return!k()},get children(){return e.t("settings.shortcuts.reset.button")}}),null),r(P,t(Z,{name:"magnifying-glass",class:"text-icon-weak-base flex-shrink-0"}),null),r(P,t(J,{variant:"ghost",type:"text",get value(){return a.filter},onChange:m=>g("filter",m),get placeholder(){return e.t("settings.shortcuts.search.placeholder")},spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"flex-1"}),null),r(P,t(z,{get when(){return a.filter},get children(){return t(Pe,{icon:"circle-x",variant:"ghost",onClick:()=>g("filter","")})}}),null),r(R,t(le,{each:de,children:m=>t(z,{get when(){return(j().get(m)??[]).length>0},get children(){var A=Xt(),N=A.firstChild;return r(N,()=>e.t(en[m])),r(A,t(H,{get children(){return t(le,{get each(){return j().get(m)??[]},children:E=>(()=>{var I=Qt(),c=I.firstChild,h=c.nextSibling;return r(c,()=>F(E)),h.$$click=()=>b(E),gt(h,"data-keybind-id",E),r(h,t(z,{get when(){return a.active===E},get fallback(){return n.keybind(E)||e.t("settings.shortcuts.unassigned")},get children(){return e.t("settings.shortcuts.pressKeys")}})),Ue(K=>ut(h,{"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":a.active!==E,"border border-border-weak-base bg-surface-inset-base text-text-weak":a.active===E},K)),I})()})}}),null),A}})}),null),r(R,t(z,{get when(){return q(()=>!!a.filter)()&&!W()},get children(){var m=Jt(),A=m.firstChild;return r(A,()=>e.t("settings.shortcuts.search.empty")),r(m,t(z,{get when(){return a.filter},get children(){var N=Ht(),E=N.firstChild,I=E.nextSibling;return I.nextSibling,r(N,()=>a.filter,I),N}}),null),m}}),null),d})()};je(["click"]);var gn=f('<p class="text-12-regular text-text-weak">'),Ke=f('<div class="flex justify-end pt-1">'),un=f('<p class="text-14-regular text-text-base">'),pn=f('<div class="flex flex-col rounded-lg border border-border-weak-base overflow-hidden"><button type=button class="flex items-center justify-between gap-3 w-full px-3.5 py-3 text-left hover:bg-surface-base-hover transition-colors disabled:opacity-50"><div class="flex flex-col gap-0.5 min-w-0"><span class="text-14-medium text-text-strong"></span><span class="text-12-regular text-text-weak">'),fn=f('<div class="flex flex-col gap-4 max-h-[min(60vh,420px)] overflow-y-auto pr-0.5">'),hn=f('<div class="flex gap-2 justify-end pt-1">'),mn=f('<div class="w-full px-5 pb-5 flex flex-col gap-4">'),vn=f('<div class="flex items-center gap-2 min-w-0"><span class=truncate>');function Fe(n){const e=Math.max(1,Math.ceil(n/1e3)),o=Math.floor(e/3600),a=Math.floor(e%3600/60),g=e%60;return o>0?`${o}:${String(a).padStart(2,"0")}:${String(g).padStart(2,"0")}`:`${a}:${String(g).padStart(2,"0")}`}function bn(){const n=Te(),e=ce(),o=De(),a=he(),g=Re(),[s,b]=ie("password"),[y,k]=ie(""),[x,C]=ie(!1),[F,O]=ie(""),[j,W]=ie(0),[v,p]=ie(Date.now()),[d,_]=Ce({baseURL:"",modelID:"",modelName:"",providerName:"",apiKey:"",hasApiKey:!1}),U=L(()=>Math.max(0,j()-v())),S=L(()=>U()>0);Ee(()=>{if(!S())return;const c=window.setInterval(()=>p(Date.now()),250);Oe(()=>window.clearInterval(c))}),Ee(()=>{P("/global/onescience-preset/status",{method:"GET"}).then(c=>{c.lockedUntil&&c.lockedUntil>Date.now()&&(W(c.lockedUntil),p(Date.now()))}).catch(()=>{})});const D=L(()=>s()==="model"?e.t("settings.providers.onescience.admin.model.title"):e.t("settings.providers.onescience.admin.title"));async function P(c,h){const K={"Content-Type":"application/json"},ee=g.current;ee?.http.password&&(K.Authorization=`Basic ${Me({username:ee.http.username,password:ee.http.password})}`);const X=await fetch(`${o.url}${c}`,{method:h.method,headers:K,body:h.body===void 0?void 0:JSON.stringify(h.body)}),te=await X.text(),ne=te?JSON.parse(te):void 0;if(!X.ok){const me=ne&&typeof ne=="object"&&"message"in ne?String(ne.message):te;throw new Error(me||X.statusText)}return ne}async function R(){await o.client.global.dispose().catch(()=>{}),await a.reload()}async function m(c){const h=await P("/global/onescience-preset/admin/config",{method:"POST",body:{token:c}});_({baseURL:h.baseURL,modelID:h.modelID,modelName:h.modelName,providerName:h.providerName,apiKey:"",hasApiKey:h.hasApiKey})}async function A(){if(!(x()||S())){C(!0);try{const c=await P("/global/onescience-preset/admin/login",{method:"POST",body:{password:F()}});if(!c.ok||!c.token){c.lockedUntil&&c.lockedUntil>Date.now()?(W(c.lockedUntil),p(Date.now()),B({title:e.t("settings.providers.onescience.admin.passwordLocked",{time:Fe(c.lockedUntil-Date.now())})})):B({title:e.t("settings.providers.onescience.admin.passwordInvalid")});return}W(0),k(c.token),O(""),b("menu")}catch(c){B({title:e.t("common.requestFailed"),description:c instanceof Error?c.message:String(c)})}finally{C(!1)}}}async function N(){if(!x()){C(!0);try{await m(y()),b("model")}catch(c){B({title:e.t("common.requestFailed"),description:c instanceof Error?c.message:String(c)})}finally{C(!1)}}}async function E(){if(!x()){C(!0);try{const c=await P("/global/onescience-preset/admin/config",{method:"PATCH",body:{token:y(),baseURL:d.baseURL,modelID:d.modelID,modelName:d.modelName,providerName:d.providerName,apiKey:d.apiKey||void 0}});_({baseURL:c.baseURL,modelID:c.modelID,modelName:c.modelName,providerName:c.providerName,apiKey:"",hasApiKey:c.hasApiKey}),await R(),B({variant:"success",icon:"circle-check",title:e.t("settings.providers.onescience.admin.saved")}),b("menu")}catch(c){B({title:e.t("common.requestFailed"),description:c instanceof Error?c.message:String(c)})}finally{C(!1)}}}async function I(){if(!x()){C(!0);try{const c=await P("/global/onescience-preset/admin/reset",{method:"POST",body:{token:y()}});_({baseURL:c.baseURL,modelID:c.modelID,modelName:c.modelName,providerName:c.providerName,apiKey:"",hasApiKey:c.hasApiKey}),await R(),B({variant:"success",icon:"circle-check",title:e.t("settings.providers.onescience.admin.reset")})}catch(c){B({title:e.t("common.requestFailed"),description:c instanceof Error?c.message:String(c)})}finally{C(!1)}}}return t(Be,{get title(){return q(()=>s()==="model")()?(()=>{var c=vn(),h=c.firstChild;return r(c,t(Pe,{tabIndex:-1,icon:"arrow-left",variant:"ghost",onClick:()=>b("menu"),get"aria-label"(){return e.t("common.goBack")}}),h),r(h,D),c})():D()},get description(){return q(()=>s()==="password")()?e.t("settings.providers.onescience.admin.passwordHint"):void 0},fit:!0,transition:!0,class:"w-full max-w-[420px]",get children(){var c=mn();return r(c,t(vt,{get children(){return[t(be,{get when(){return s()==="password"},get children(){return[t(J,{autofocus:!0,type:"password",get label(){return e.t("settings.providers.onescience.admin.password")},get value(){return F()},onChange:O,get placeholder(){return e.t("settings.providers.onescience.admin.passwordPlaceholder")},get disabled(){return S()},onKeyDown:h=>{h.key==="Enter"&&F().trim()&&!x()&&!S()&&A()}}),t(z,{get when(){return S()},get children(){var h=gn();return r(h,()=>e.t("settings.providers.onescience.admin.passwordLocked",{time:Fe(U())})),h}}),(()=>{var h=Ke();return r(h,t(G,{variant:"primary",get disabled(){return x()||S()||!F().trim()},onClick:()=>void A(),get children(){return e.t("settings.providers.onescience.admin.unlock")}})),h})()]}}),t(be,{get when(){return s()==="menu"},get children(){return[(()=>{var h=un();return r(h,()=>e.t("settings.providers.onescience.admin.menu.hint")),h})(),(()=>{var h=pn(),K=h.firstChild,ee=K.firstChild,X=ee.firstChild,te=X.nextSibling;return K.$$click=()=>void N(),r(X,()=>e.t("settings.providers.onescience.admin.menu.model")),r(te,()=>e.t("settings.providers.onescience.admin.menu.model.description")),r(K,t(Z,{name:"chevron-right",size:"small",class:"shrink-0 text-icon-base"}),null),Ue(()=>K.disabled=x()),h})(),(()=>{var h=Ke();return r(h,t(G,{variant:"ghost",get disabled(){return x()},onClick:()=>n.close(),get children(){return e.t("common.close")}})),h})()]}}),t(be,{get when(){return s()==="model"},get children(){return[(()=>{var h=fn();return r(h,t(J,{get label(){return e.t("settings.providers.onescience.admin.providerName")},get value(){return d.providerName},onChange:K=>_("providerName",K)}),null),r(h,t(J,{get label(){return e.t("settings.providers.onescience.admin.baseURL")},get value(){return d.baseURL},onChange:K=>_("baseURL",K)}),null),r(h,t(J,{get label(){return e.t("settings.providers.onescience.admin.modelID")},get value(){return d.modelID},onChange:K=>_("modelID",K)}),null),r(h,t(J,{get label(){return e.t("settings.providers.onescience.admin.modelName")},get value(){return d.modelName},onChange:K=>_("modelName",K)}),null),r(h,t(J,{type:"password",get label(){return e.t("settings.providers.onescience.admin.apiKey")},get value(){return d.apiKey},onChange:K=>_("apiKey",K),get placeholder(){return q(()=>!!d.hasApiKey)()?e.t("settings.providers.onescience.admin.apiKeyKeep"):e.t("settings.providers.onescience.admin.apiKeyPlaceholder")}}),null),h})(),(()=>{var h=hn();return r(h,t(G,{variant:"ghost",get disabled(){return x()},onClick:()=>void I(),get children(){return e.t("settings.providers.onescience.admin.resetAction")}}),null),r(h,t(G,{variant:"primary",get disabled(){return x()},onClick:()=>void E(),get children(){return e.t("common.save")}}),null),h})()]}})]}})),c}})}je(["click"]);var xn=f('<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">'),wn=f('<div class="flex flex-col gap-2 pt-2 border-t border-border-weak-base">'),yn=f('<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">'),$n=f('<div class="py-4 text-14-regular text-text-weak">'),_n=f('<div class="flex items-center gap-1">'),kn=f('<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">'),Sn=f('<span class="text-14-regular text-text-base opacity-0 group-hover:opacity-100 transition-opacity duration-200 pr-3 cursor-default">'),Cn=f('<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">'),Dn=f('<span class="text-12-regular text-text-weak pl-8">');const $e="onescience",Pn=[{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"}],Tn=()=>{const n=Te(),e=ce(),o=De(),a=he(),g=bt(),s=Re(),[b]=_e(async()=>{const v={},p=s.current;p?.http.password&&(v.Authorization=`Basic ${Me({username:p.http.username,password:p.http.password})}`);const d=await fetch(`${o.url}/global/onescience-preset/status`,{headers:v});return d.ok?await d.json():{adminEnabled:!1,modelEnabled:!1}}),y=L(()=>{const v=new Set(a.data.config.disabled_providers??[]);return g.connected().filter(p=>!v.has(p.id)).filter(p=>p.id!=="opencode"||Object.values(p.models).find(d=>d.cost?.input))}),k=L(()=>{const v=new Set(y().map(d=>d.id)),p=g.popular().filter(d=>!v.has(d.id)).slice();return p.sort((d,_)=>fe.indexOf(d.id)-fe.indexOf(_.id)),p}),x=v=>{if(!("source"in v))return;const p=v.source;if(p==="env"||p==="api"||p==="config"||p==="custom")return p},C=v=>{if(v.id===$e)return e.t("settings.providers.tag.limited");const p=x(v);return p==="env"?e.t("settings.providers.tag.environment"):p==="api"?e.t("provider.connect.method.apiKey"):p==="config"?j(v.id)?e.t("settings.providers.tag.custom"):e.t("settings.providers.tag.config"):p==="custom"?e.t("settings.providers.tag.custom"):e.t("settings.providers.tag.other")},F=v=>v.id!==$e&&x(v)!=="env",O=v=>Pn.find(p=>p.match(v))?.key,j=v=>{const p=a.data.config.provider?.[v];return!(!p||p.npm!=="@ai-sdk/openai-compatible"||!p.models||Object.keys(p.models).length===0)},W=async(v,p)=>{if(j(v)){const d=a.data.config.disabled_providers??[],_=a.data.provider.connected,U=d.includes(v)?d:[...d,v];a.set("config","disabled_providers",U),a.set("provider","connected",_.filter(S=>S!==v)),B({variant:"success",icon:"circle-check",title:e.t("provider.disconnect.toast.disconnected.title",{provider:p}),description:e.t("provider.disconnect.toast.disconnected.description",{provider:p})});try{await o.client.auth.remove({providerID:v}).catch(()=>{}),await a.updateConfig({disabled_providers:U}),await o.client.global.dispose().catch(()=>{}),await a.reload()}catch(S){a.set("config","disabled_providers",d),a.set("provider","connected",_);const D=S instanceof Error?S.message:String(S);B({title:e.t("common.requestFailed"),description:D})}return}await o.client.auth.remove({providerID:v}).then(async()=>{await o.client.global.dispose(),await a.reload(),B({variant:"success",icon:"circle-check",title:e.t("provider.disconnect.toast.disconnected.title",{provider:p}),description:e.t("provider.disconnect.toast.disconnected.description",{provider:p})})}).catch(d=>{const _=d instanceof Error?d.message:String(d);B({title:e.t("common.requestFailed"),description:_})})};return(()=>{var v=yn(),p=v.firstChild,d=p.firstChild,_=d.firstChild,U=p.nextSibling,S=U.firstChild,D=S.firstChild,P=S.nextSibling,R=P.firstChild;return r(_,()=>e.t("settings.providers.title")),r(D,()=>e.t("settings.providers.section.connected")),r(S,t(H,{get children(){return t(z,{get when(){return y().length>0},get fallback(){return(()=>{var m=$n();return r(m,()=>e.t("settings.providers.connected.empty")),m})()},get children(){return t(le,{get each(){return y()},children:m=>(()=>{var A=kn(),N=A.firstChild,E=N.firstChild;return r(N,t(pe,{get id(){return m.id},class:"size-5 shrink-0 icon-strong-base"}),E),r(E,()=>m.name),r(N,t(ue,{get children(){return C(m)}}),null),r(A,t(z,{get when(){return F(m)},get fallback(){return(()=>{var I=Sn();return r(I,(()=>{var c=q(()=>m.id===$e);return()=>c()?e.t("settings.providers.onescience.readonlyHint"):e.t("settings.providers.connected.environmentDescription")})()),I})()},get children(){var I=_n();return r(I,t(z,{get when(){return j(m.id)},get children(){return t(G,{size:"large",variant:"ghost",onClick:()=>n.show(()=>t(ke,{get providerID(){return m.id},back:"providers"})),get children(){return e.t("common.edit")}})}}),null),r(I,t(G,{size:"large",variant:"ghost",onClick:()=>void W(m.id,m.name),get children(){return q(()=>!!j(m.id))()?e.t("common.delete"):e.t("common.disconnect")}}),null),I}}),null),A})()})}})}}),null),r(R,()=>e.t("settings.providers.section.popular")),r(P,t(H,{get children(){return[t(le,{get each(){return k()},children:m=>(()=>{var A=Cn(),N=A.firstChild,E=N.firstChild,I=E.firstChild;return r(E,t(pe,{get id(){return m.id},class:"size-5 shrink-0 icon-strong-base"}),I),r(I,()=>m.name),r(E,t(z,{get when(){return m.id==="opencode"},get children(){return t(ue,{get children(){return e.t("dialog.provider.tag.recommended")}})}}),null),r(E,t(z,{get when(){return m.id==="opencode-go"},get children(){return t(ue,{get children(){return e.t("dialog.provider.tag.recommended")}})}}),null),r(N,t(z,{get when(){return O(m.id)},children:c=>(()=>{var h=Dn();return r(h,()=>e.t(c())),h})()}),null),r(A,t(G,{size:"large",variant:"secondary",icon:"plus-small",onClick:()=>{n.show(()=>t($t,{get provider(){return m.id}}))},get children(){return e.t("common.connect")}}),null),A})()}),(()=>{var m=xn(),A=m.firstChild,N=A.firstChild,E=N.firstChild,I=N.nextSibling;return r(N,t(pe,{id:"synthetic",class:"size-5 shrink-0 icon-strong-base"}),E),r(E,()=>e.t("provider.custom.title")),r(N,t(ue,{get children(){return e.t("settings.providers.tag.custom")}}),null),r(I,()=>e.t("settings.providers.custom.description")),r(m,t(G,{size:"large",variant:"secondary",icon:"plus-small",onClick:()=>{n.show(()=>t(ke,{}))},get children(){return e.t("common.connect")}}),null),m})()]}}),null),r(P,t(G,{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(_t,{}))},get children(){return e.t("dialog.provider.viewAll")}}),null),r(U,t(z,{get when(){return b()?.adminEnabled},get children(){var m=wn();return r(m,t(G,{size:"large",variant:"secondary",onClick:()=>n.show(()=>t(bn,{})),get children(){return e.t("settings.providers.onescience.admin.button")}})),m}}),null),v})()};var Ge=f('<div class="flex flex-col items-center justify-center py-12 text-center"><span class="text-14-regular text-text-weak">'),An=f('<span class="text-14-regular text-text-strong mt-1">&quot;<!>&quot;'),En=f('<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]">'),Nn=f('<div class="flex flex-col gap-1"><div class="flex items-center gap-2 pb-2"><span class="text-14-medium text-text-strong">'),Kn=f('<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 flex-shrink-0 items-center gap-2">');const Fn=n=>(()=>{var e=Ge(),o=e.firstChild;return r(o,()=>n.label),e})(),In=n=>(()=>{var e=Ge(),o=e.firstChild;return r(o,()=>n.message),r(e,t(z,{get when(){return n.filter},get children(){var a=An(),g=a.firstChild,s=g.nextSibling;return s.nextSibling,r(a,()=>n.filter,s),a}}),null),e})(),Ln=()=>{const n=ce(),e=xt(),o=Te(),a=he(),g=b=>{const y=a.data.config.provider?.[b];return!(!y||y.npm!=="@ai-sdk/openai-compatible"||!y.models||Object.keys(y.models).length===0)},s=wt({items:b=>e.list(),key:b=>`${b.provider.id}:${b.id}`,filterKeys:["provider.name","name","id"],sortBy:(b,y)=>b.name.localeCompare(y.name),groupBy:b=>b.provider.id,sortGroupsBy:(b,y)=>{const k=fe.indexOf(b.category),x=fe.indexOf(y.category),C=k>=0,F=x>=0;if(C&&!F)return-1;if(!C&&F)return 1;if(C&&F)return k-x;const O=b.items[0].provider.name,j=y.items[0].provider.name;return O.localeCompare(j)}});return(()=>{var b=En(),y=b.firstChild,k=y.firstChild,x=k.firstChild,C=x.nextSibling,F=y.nextSibling;return r(x,()=>n.t("settings.models.title")),r(C,t(Z,{name:"magnifying-glass",class:"text-icon-weak-base flex-shrink-0"}),null),r(C,t(J,{variant:"ghost",type:"text",get value(){return s.filter()},get onChange(){return s.onInput},get placeholder(){return n.t("dialog.model.search.placeholder")},spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"flex-1"}),null),r(C,t(z,{get when(){return s.filter()},get children(){return t(Pe,{icon:"circle-x",variant:"ghost",get onClick(){return s.clear}})}}),null),r(F,t(z,{get when(){return!s.grouped.loading},get fallback(){return t(Fn,{get label(){return`${n.t("common.loading")}${n.t("common.loading.ellipsis")}`}})},get children(){return t(z,{get when(){return s.flat().length>0},get fallback(){return t(In,{get message(){return n.t("dialog.model.empty")},get filter(){return s.filter()}})},get children(){return t(le,{get each(){return s.grouped.latest},children:O=>(()=>{var j=Nn(),W=j.firstChild,v=W.firstChild;return r(W,t(pe,{get id(){return O.category},class:"size-5 shrink-0 icon-strong-base"}),v),r(v,()=>O.items[0].provider.name),r(j,t(H,{get children(){return t(le,{get each(){return O.items},children:p=>{const d={providerID:p.provider.id,modelID:p.id},_=g(p.provider.id);return(()=>{var U=Kn(),S=U.firstChild,D=S.firstChild,P=S.nextSibling;return r(D,()=>p.name),r(P,t(z,{when:_,get children(){return t(G,{size:"large",variant:"ghost",onClick:()=>o.show(()=>t(ke,{get providerID(){return p.provider.id},get modelID(){return p.id},back:"models"})),get children(){return n.t("common.edit")}})}}),null),r(P,t(M,{get checked(){return e.visible(d)},onChange:R=>{e.setVisibility(d,R)},hideLabel:!0,get children(){return p.name}}),null),U})()}})}}),null),j})()})}})}})),b})()};var zn=f('<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 Rn=n=>{const e=ce(),o=Ie();return t(Be,{size:"x-large",transition:!0,get children(){return t(V,{orientation:"vertical",variant:"settings",get defaultValue(){return n.tab??"general"},class:"h-full settings-dialog",get children(){return[t(V.List,{get children(){var a=zn(),g=a.firstChild,s=g.firstChild,b=s.firstChild,y=b.firstChild,k=b.nextSibling,x=k.firstChild,C=g.nextSibling,F=C.firstChild,O=F.nextSibling;return O.firstChild,r(b,t(V.SectionTitle,{get children(){return e.t("settings.section.desktop")}}),y),r(y,t(V.Trigger,{value:"general",get children(){return[t(Z,{name:"sliders"}),q(()=>e.t("settings.tab.general"))]}}),null),r(y,t(V.Trigger,{value:"shortcuts",get children(){return[t(Z,{name:"keyboard"}),q(()=>e.t("settings.tab.shortcuts"))]}}),null),r(k,t(V.SectionTitle,{get children(){return e.t("settings.section.server")}}),x),r(x,t(V.Trigger,{value:"providers",get children(){return[t(Z,{name:"providers"}),q(()=>e.t("settings.providers.title"))]}}),null),r(x,t(V.Trigger,{value:"models",get children(){return[t(Z,{name:"models"}),q(()=>e.t("settings.models.title"))]}}),null),r(F,()=>e.t("app.name.desktop")),r(O,()=>o.version,null),a}}),t(V.Content,{value:"general",class:"no-scrollbar",get children(){return t(Vt,{})}}),t(V.Content,{value:"shortcuts",class:"no-scrollbar",get children(){return t(dn,{})}}),t(V.Content,{value:"providers",class:"no-scrollbar",get children(){return t(Tn,{})}}),t(V.Content,{value:"models",class:"no-scrollbar",get children(){return t(Ln,{})}})]}})}})};export{Rn as DialogSettings};
1
+ import{i as r,t as f,a2 as He,f as ce,a3 as Je,u as Ie,a4 as Ye,a5 as Le,k as Ce,h as L,a6 as Xe,c as he,e as De,j as _e,w as ze,n as t,a7 as M,a1 as Qe,I as Z,H as z,p as q,a8 as re,T as J,a9 as Ze,aa as et,ab as tt,ac as nt,ad as rt,ae as st,m as ve,B as G,af as it,ag as at,ah as ot,ai as lt,y as B,aj as ct,d as je,ak as dt,o as Oe,v as Pe,F as le,G as gt,r as Ue,X as ut,al as pt,am as ft,an as ht,ao as mt,b as Te,z as Re,A as ie,l as Ee,J as Me,S as vt,M as be,D as Be,g as bt,N as fe,P as pe,ap as xt,aq as wt,ar as V}from"./index-ChOscytb.js";import{L as yt,D as ke,a as $t,b as _t}from"./dialog-select-provider-BL4_l6ma.js";import{T as ue}from"./tag-BpN5JcFY.js";var kt=f('<div class="bg-surface-base px-4 rounded-lg">');const H=n=>(()=>{var e=kt();return r(e,()=>n.children),e})(),St={BASE_URL:"https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202607231111/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};var Ct=f("<div data-action=settings-auto-accept-permissions>"),Dt=f("<div data-action=settings-feed-reasoning-summaries>"),Pt=f("<div data-action=settings-feed-shell-tool-parts-expanded>"),Tt=f("<div data-action=settings-feed-edit-tool-parts-expanded>"),At=f("<div data-action=settings-show-session-progress-bar>"),Et=f('<div class="flex flex-col gap-1">'),Nt=f("<div data-action=settings-show-file-tree>"),Kt=f("<div data-action=settings-show-navigation>"),Ft=f("<div data-action=settings-show-search>"),It=f("<div data-action=settings-show-terminal>"),Lt=f("<div data-action=settings-show-status>"),ae=f('<div class="flex flex-col gap-1"><h3 class="text-14-medium text-text-strong pb-2">'),xe=f('<div class="w-full sm:w-[220px]">'),zt=f("<div data-action=settings-notifications-agent>"),jt=f("<div data-action=settings-notifications-permissions>"),Ot=f("<div data-action=settings-notifications-errors>"),Ut=f("<div data-action=settings-updates-startup>"),Rt=f("<div data-action=settings-release-notes>"),Mt=f("<div data-action=settings-wayland>"),Bt=f('<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">'),Wt=f("<span class=text-text-weak>"),Gt=f('<div class="flex items-center gap-2"><span>'),qt=f('<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 Y={cleanup:void 0,timeout:void 0,run:0};const We=()=>{Y.run+=1,Y.cleanup&&Y.cleanup(),clearTimeout(Y.timeout),Y.cleanup=void 0},Ne=n=>{if(We(),!n)return;const e=++Y.run;Y.timeout=setTimeout(()=>{ct(n).then(o=>{if(Y.run!==e){o?.();return}Y.cleanup=o})},100)},Vt=()=>{const n=He(),e=ce(),o=Je(),a=Ie(),g=Ye(),s=Le(),[b,y]=Ce({checking:!1}),k=L(()=>a.platform==="desktop"&&a.os==="linux"),x=L(()=>Xe(g.dir)),C=L(()=>{const u=x();return u?g.id?o.isAutoAccepting(g.id,u):o.isAutoAcceptingDirectory(u):!1}),F=u=>{const l=x();if(l){if(!g.id){if(o.isAutoAcceptingDirectory(l)===u)return;o.toggleAutoAcceptDirectory(l);return}if(u){o.enableAutoAccept(g.id,l);return}o.disableAutoAccept(g.id,l)}},O=L(()=>a.platform==="desktop"),j=()=>{a.checkUpdate&&(y("checking",!0),a.checkUpdate().then(u=>{if(!u.updateAvailable){B({variant:"success",icon:"circle-check",title:e.t("settings.updates.toast.latest.title"),description:e.t("settings.updates.toast.latest.description",{version:a.version??""})});return}const l=a.updateAndRestart?[{label:e.t("toast.update.action.installRestart"),onClick:async()=>{await a.updateAndRestart()}},{label:e.t("toast.update.action.notYet"),onClick:"dismiss"}]:[{label:e.t("toast.update.action.notYet"),onClick:"dismiss"}];B({persistent:!0,icon:"download",title:e.t("toast.update.title"),description:e.t("toast.update.description",{version:u.version??""}),actions:l})}).catch(u=>{const l=u instanceof Error?u.message:String(u);B({title:e.t("common.requestFailed"),description:l})}).finally(()=>y("checking",!1)))},W=L(()=>n.ids().map(u=>({id:u,name:n.name(u)}))),v=he(),p=De(),[d]=_e(()=>p.client.pty.shells().then(u=>u.data??[]).catch(()=>[]),{initialValue:[]}),[_,{refetch:U}]=_e(()=>!!(k()&&a.getDisplayBackend),()=>Promise.resolve(a.getDisplayBackend?.()??null).catch(()=>null),{initialValue:null});ze(()=>{n.loadThemes()});const S={id:"auto",value:"",label:e.t("settings.general.row.shell.autoDefault")},D=L(()=>v.data.config.shell??""),P=L(()=>{const u=d.latest,l=v.data.config.shell,i=new Map;for(const w of u)i.set(w.name,(i.get(w.name)||0)+1);const $=[S,...u.map(w=>{const se=(i.get(w.name)||0)>1,ge=se?w.path:w.name,Q=w.acceptable?ge:`${ge} (${e.t("settings.general.row.shell.terminalOnly")})`;return{id:w.path,value:se?w.path:w.name,label:Q}})];return l&&!$.some(w=>w.value===l)&&$.push({id:l,value:l,label:l}),$}),R=u=>{const l=a.setDisplayBackend?.(u?"wayland":"auto");l&&l.finally(()=>{U()})},m=L(()=>[{value:"system",label:e.t("theme.scheme.system")},{value:"light",label:e.t("theme.scheme.light")},{value:"dark",label:e.t("theme.scheme.dark")}]),A=L(()=>e.locales.map(u=>({value:u,label:e.label(u)}))),N={id:"none",label:"sound.option.none"},E=[N,...lt],I=()=>at(s.appearance.font()),c=()=>it(s.appearance.uiFont()),h=()=>ot(s.appearance.terminalFont()),K=(u,l,i,$)=>({options:E,current:u()?E.find(w=>w.id===l())??N:N,value:w=>w.id,label:w=>e.t(w.label),onHighlight:w=>{w&&Ne(w.id==="none"?void 0:w.id)},onSelect:w=>{if(w){if(w.id==="none"){i(!1),We();return}i(!0),$(w.id),Ne(w.id)}},variant:"secondary",size:"small",triggerVariant:"settings"}),ee=()=>(()=>{var u=Et();return r(u,t(H,{get children(){return[t(T,{get title(){return e.t("settings.general.row.language.title")},get description(){return e.t("settings.general.row.language.description")},get children(){return t(re,{"data-action":"settings-language",get options(){return A()},get current(){return A().find(l=>l.value===e.locale())},value:l=>l.value,label:l=>l.label,onSelect:l=>l&&e.setLocale(l.value),variant:"secondary",size:"small",triggerVariant:"settings"})}}),t(T,{get title(){return e.t("command.permissions.autoaccept.enable")},get description(){return e.t("toast.permissions.autoaccept.on.description")},get children(){var l=Ct();return r(l,t(M,{get checked(){return C()},get disabled(){return!x()},onChange:F})),l}}),t(T,{get title(){return e.t("settings.general.row.shell.title")},get description(){return e.t("settings.general.row.shell.description")},get children(){return t(re,{"data-action":"settings-shell",get options(){return P()},get current(){return P().find(l=>l.value===D())??S},value:l=>l.id,label:l=>l.label,onSelect:l=>{l&&l.value!==D()&&v.updateConfig({shell:l.value})},variant:"secondary",size:"small",triggerVariant:"settings",triggerStyle:{"min-width":"180px"}})}}),t(T,{get title(){return e.t("settings.general.row.reasoningSummaries.title")},get description(){return e.t("settings.general.row.reasoningSummaries.description")},get children(){var l=Dt();return r(l,t(M,{get checked(){return s.general.showReasoningSummaries()},onChange:i=>s.general.setShowReasoningSummaries(i)})),l}}),t(T,{get title(){return e.t("settings.general.row.shellToolPartsExpanded.title")},get description(){return e.t("settings.general.row.shellToolPartsExpanded.description")},get children(){var l=Pt();return r(l,t(M,{get checked(){return s.general.shellToolPartsExpanded()},onChange:i=>s.general.setShellToolPartsExpanded(i)})),l}}),t(T,{get title(){return e.t("settings.general.row.editToolPartsExpanded.title")},get description(){return e.t("settings.general.row.editToolPartsExpanded.description")},get children(){var l=Tt();return r(l,t(M,{get checked(){return s.general.editToolPartsExpanded()},onChange:i=>s.general.setEditToolPartsExpanded(i)})),l}}),t(T,{get title(){return e.t("settings.general.row.showSessionProgressBar.title")},get description(){return e.t("settings.general.row.showSessionProgressBar.description")},get children(){var l=At();return r(l,t(M,{get checked(){return s.general.showSessionProgressBar()},onChange:i=>s.general.setShowSessionProgressBar(i)})),l}})]}})),u})(),X=()=>(()=>{var u=ae(),l=u.firstChild;return r(l,()=>e.t("settings.general.section.advanced")),r(u,t(H,{get children(){return[t(T,{get title(){return e.t("settings.general.row.showFileTree.title")},get description(){return e.t("settings.general.row.showFileTree.description")},get children(){var i=Nt();return r(i,t(M,{get checked(){return s.general.showFileTree()},onChange:$=>s.general.setShowFileTree($)})),i}}),t(T,{get title(){return e.t("settings.general.row.showNavigation.title")},get description(){return e.t("settings.general.row.showNavigation.description")},get children(){var i=Kt();return r(i,t(M,{get checked(){return s.general.showNavigation()},onChange:$=>s.general.setShowNavigation($)})),i}}),t(T,{get title(){return e.t("settings.general.row.showSearch.title")},get description(){return e.t("settings.general.row.showSearch.description")},get children(){var i=Ft();return r(i,t(M,{get checked(){return s.general.showSearch()},onChange:$=>s.general.setShowSearch($)})),i}}),t(T,{get title(){return e.t("settings.general.row.showTerminal.title")},get description(){return e.t("settings.general.row.showTerminal.description")},get children(){var i=It();return r(i,t(M,{get checked(){return s.general.showTerminal()},onChange:$=>s.general.setShowTerminal($)})),i}}),t(T,{get title(){return e.t("settings.general.row.showStatus.title")},get description(){return e.t("settings.general.row.showStatus.description")},get children(){var i=Lt();return r(i,t(M,{get checked(){return s.general.showStatus()},onChange:$=>s.general.setShowStatus($)})),i}})]}}),null),u})(),te=()=>(()=>{var u=ae(),l=u.firstChild;return r(l,()=>e.t("settings.general.section.appearance")),r(u,t(H,{get children(){return[t(T,{get title(){return e.t("settings.general.row.colorScheme.title")},get description(){return e.t("settings.general.row.colorScheme.description")},get children(){return t(re,{"data-action":"settings-color-scheme",get options(){return m()},get current(){return m().find(i=>i.value===n.colorScheme())},value:i=>i.value,label:i=>i.label,onSelect:i=>i&&n.setColorScheme(i.value),onHighlight:i=>{if(i)return n.previewColorScheme(i.value),()=>n.cancelPreview()},variant:"secondary",size:"small",triggerVariant:"settings",triggerStyle:{"min-width":"220px"}})}}),t(T,{get title(){return e.t("settings.general.row.theme.title")},get description(){return[q(()=>e.t("settings.general.row.theme.description"))," ",t(yt,{href:"https://opencode.ai/docs/themes/",get children(){return e.t("common.learnMore")}})]},get children(){return t(re,{"data-action":"settings-theme",get options(){return W()},get current(){return W().find(i=>i.id===n.themeId())},value:i=>i.id,label:i=>i.name,onSelect:i=>{i&&n.setTheme(i.id)},onHighlight:i=>{if(i)return n.previewTheme(i.id),()=>n.cancelPreview()},variant:"secondary",size:"small",triggerVariant:"settings"})}}),t(T,{get title(){return e.t("settings.general.row.uiFont.title")},get description(){return e.t("settings.general.row.uiFont.description")},get children(){var i=xe();return r(i,t(J,{"data-action":"settings-ui-font",get label(){return e.t("settings.general.row.uiFont.title")},hideLabel:!0,type:"text",get value(){return c()},onChange:$=>s.appearance.setUIFont($),placeholder:Ze,spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"text-12-regular",get style(){return{"font-family":et(s.appearance.uiFont())}}})),i}}),t(T,{get title(){return e.t("settings.general.row.font.title")},get description(){return e.t("settings.general.row.font.description")},get children(){var i=xe();return r(i,t(J,{"data-action":"settings-code-font",get label(){return e.t("settings.general.row.font.title")},hideLabel:!0,type:"text",get value(){return I()},onChange:$=>s.appearance.setFont($),placeholder:tt,spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"text-12-regular",get style(){return{"font-family":nt(s.appearance.font())}}})),i}}),t(T,{get title(){return e.t("settings.general.row.terminalFont.title")},get description(){return e.t("settings.general.row.terminalFont.description")},get children(){var i=xe();return r(i,t(J,{"data-action":"settings-terminal-font",get label(){return e.t("settings.general.row.terminalFont.title")},hideLabel:!0,type:"text",get value(){return h()},onChange:$=>s.appearance.setTerminalFont($),placeholder:rt,spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"text-12-regular",get style(){return{"font-family":st(s.appearance.terminalFont())}}})),i}})]}}),null),u})(),ne=()=>(()=>{var u=ae(),l=u.firstChild;return r(l,()=>e.t("settings.general.section.notifications")),r(u,t(H,{get children(){return[t(T,{get title(){return e.t("settings.general.notifications.agent.title")},get description(){return e.t("settings.general.notifications.agent.description")},get children(){var i=zt();return r(i,t(M,{get checked(){return s.notifications.agent()},onChange:$=>s.notifications.setAgent($)})),i}}),t(T,{get title(){return e.t("settings.general.notifications.permissions.title")},get description(){return e.t("settings.general.notifications.permissions.description")},get children(){var i=jt();return r(i,t(M,{get checked(){return s.notifications.permissions()},onChange:$=>s.notifications.setPermissions($)})),i}}),t(T,{get title(){return e.t("settings.general.notifications.errors.title")},get description(){return e.t("settings.general.notifications.errors.description")},get children(){var i=Ot();return r(i,t(M,{get checked(){return s.notifications.errors()},onChange:$=>s.notifications.setErrors($)})),i}})]}}),null),u})(),me=()=>(()=>{var u=ae(),l=u.firstChild;return r(l,()=>e.t("settings.general.section.sounds")),r(u,t(H,{get children(){return[t(T,{get title(){return e.t("settings.general.sounds.agent.title")},get description(){return e.t("settings.general.sounds.agent.description")},get children(){return t(re,ve({"data-action":"settings-sounds-agent"},()=>K(()=>s.sounds.agentEnabled(),()=>s.sounds.agent(),i=>s.sounds.setAgentEnabled(i),i=>s.sounds.setAgent(i))))}}),t(T,{get title(){return e.t("settings.general.sounds.permissions.title")},get description(){return e.t("settings.general.sounds.permissions.description")},get children(){return t(re,ve({"data-action":"settings-sounds-permissions"},()=>K(()=>s.sounds.permissionsEnabled(),()=>s.sounds.permissions(),i=>s.sounds.setPermissionsEnabled(i),i=>s.sounds.setPermissions(i))))}}),t(T,{get title(){return e.t("settings.general.sounds.errors.title")},get description(){return e.t("settings.general.sounds.errors.description")},get children(){return t(re,ve({"data-action":"settings-sounds-errors"},()=>K(()=>s.sounds.errorsEnabled(),()=>s.sounds.errors(),i=>s.sounds.setErrorsEnabled(i),i=>s.sounds.setErrors(i))))}})]}}),null),u})(),qe=()=>(()=>{var u=ae(),l=u.firstChild;return r(l,()=>e.t("settings.general.section.updates")),r(u,t(H,{get children(){return[t(T,{get title(){return e.t("settings.updates.row.startup.title")},get description(){return e.t("settings.updates.row.startup.description")},get children(){var i=Ut();return r(i,t(M,{get checked(){return s.updates.startup()},get disabled(){return!a.checkUpdate},onChange:$=>s.updates.setStartup($)})),i}}),t(T,{get title(){return e.t("settings.general.row.releaseNotes.title")},get description(){return e.t("settings.general.row.releaseNotes.description")},get children(){var i=Rt();return r(i,t(M,{get checked(){return s.general.releaseNotes()},onChange:$=>s.general.setReleaseNotes($)})),i}}),t(T,{get title(){return e.t("settings.updates.row.check.title")},get description(){return e.t("settings.updates.row.check.description")},get children(){return t(G,{size:"small",variant:"secondary",get disabled(){return b.checking||!a.checkUpdate},onClick:j,get children(){return q(()=>!!b.checking)()?e.t("settings.updates.action.checking"):e.t("settings.updates.action.checkNow")}})}})]}}),null),u})();return console.log(St),(()=>{var u=Bt(),l=u.firstChild,i=l.firstChild,$=i.firstChild,w=l.nextSibling;return r($,()=>e.t("settings.tab.general")),r(w,t(ee,{}),null),r(w,t(te,{}),null),r(w,t(ne,{}),null),r(w,t(me,{}),null),r(w,t(qe,{}),null),r(w,t(z,{get when(){return k()},get children(){var se=ae(),ge=se.firstChild;return r(ge,()=>e.t("settings.general.section.display")),r(se,t(H,{get children(){return t(T,{get title(){return(()=>{var Q=Gt(),Ve=Q.firstChild;return r(Ve,()=>e.t("settings.general.row.wayland.title")),r(Q,t(Qe,{get value(){return e.t("settings.general.row.wayland.tooltip")},placement:"top",get children(){var Ae=Wt();return r(Ae,t(Z,{name:"help",size:"small"})),Ae}}),null),Q})()},get description(){return e.t("settings.general.row.wayland.description")},get children(){var Q=Mt();return r(Q,t(M,{get checked(){return _.latest==="wayland"},onChange:R})),Q}})}}),null),se}}),null),r(w,t(z,{get when(){return q(()=>!!O())()&&!1},get children(){return t(X,{})}}),null),u})()},T=n=>(()=>{var e=qt(),o=e.firstChild,a=o.firstChild,g=a.nextSibling,s=o.nextSibling;return r(a,()=>n.title),r(g,()=>n.description),r(s,()=>n.children),e})();var Ht=f('<span class="text-14-regular text-text-strong mt-1">"<!>"'),Jt=f('<div class="flex flex-col items-center justify-center py-12 text-center"><span class="text-14-regular text-text-weak">'),Yt=f('<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]">'),Xt=f('<div class="flex flex-col gap-1"><h3 class="text-14-medium text-text-strong pb-2">'),Qt=f('<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 we=typeof navigator=="object"&&/(Mac|iPod|iPhone|iPad)/.test(navigator.platform),oe="command.palette",Zt="mod+shift+p",de=["General","Session","Navigation","Model and agent","Terminal","Prompt"],en={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 ye(n){return n===oe?"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 tn(n){return n==="Shift"||n==="Control"||n==="Alt"||n==="Meta"}function nn(n){return n===","?"comma":n==="+"?"plus":n===" "?"space":n.toLowerCase()}function rn(n){if(tn(n.key))return;const e=[];(we?n.metaKey:n.ctrlKey)&&e.push("mod"),we&&n.ctrlKey&&e.push("ctrl"),!we&&n.metaKey&&e.push("meta"),n.altKey&&e.push("alt"),n.shiftKey&&e.push("shift");const a=nn(n.key);if(a)return e.push(a),e.join("+")}function Se(n){if(!n)return[];const e=[];for(const o of ft(n)){const a=[];o.ctrl&&a.push("ctrl"),o.alt&&a.push("alt"),o.shift&&a.push("shift"),o.meta&&a.push("meta"),o.key&&a.push(o.key),a.length!==0&&e.push(a.join("+"))}return e}function sn(n){return!n||typeof n!="object"||Array.isArray(n)?{}:n}function an(n,e,o){const a=new Map;a.set(oe,{title:o,group:"General"});for(const g of n.catalog)g.id.startsWith("suggested.")||g.hidden||a.set(g.id,{title:g.title,group:ye(g.id)});for(const g of n.options)g.id.startsWith("suggested.")||g.hidden||a.set(g.id,{title:g.title,group:ye(g.id)});for(const[g,s]of Object.entries(e))typeof s=="string"&&(a.has(g)||a.set(g,{title:g,group:ye(g)}));return a}function on(n){const e=new Map;for(const o of de)e.set(o,[]);for(const[o,a]of n){const g=e.get(a.group);g&&g.push(o)}for(const o of de){const a=e.get(o);a&&a.sort((g,s)=>(n.get(g)?.title??"").localeCompare(n.get(s)?.title??""))}return e}function ln(n,e,o,a){const g=n.toLowerCase().trim();if(!g)return o;const s=new Map;for(const k of de)s.set(k,[]);const b=Array.from(e.entries()).map(([k,x])=>({id:k,title:x.title,group:x.group,keybind:a(k)})),y=pt.go(g,b,{keys:["title","keybind"],threshold:-1e4});for(const k of y){const x=s.get(k.obj.group);x&&x.push(k.obj.id)}return s}function cn(n){ze(()=>{ht(document,"keydown",o=>{const a=n.active();if(!a)return;if(o.preventDefault(),o.stopPropagation(),o.stopImmediatePropagation(),o.key==="Escape"){n.stop();return}if((o.key==="Backspace"||o.key==="Delete")&&!o.ctrlKey&&!o.metaKey&&!o.altKey&&!o.shiftKey){n.set(a,"none"),n.stop();return}const s=rn(o);if(!s)return;const b=new Map;for(const y of Se(s))for(const k of n.used().get(y)??[])k.id!==a&&b.set(k.id,k.title);if(b.size>0){B({title:n.language.t("settings.shortcuts.conflict.title"),description:n.language.t("settings.shortcuts.conflict.description",{keybind:mt(s,n.language.t),titles:[...b.values()].join(", ")})});return}n.set(a,s),n.stop()},{capture:!0})})}const dn=()=>{const n=dt(),e=ce(),o=Le(),[a,g]=Ce({active:null,filter:""}),s=()=>{a.active&&(g("active",null),n.keybinds(!0))},b=d=>{if(a.active===d){s();return}a.active&&s(),g("active",d),n.keybinds(!1)},y=L(()=>sn(o.current.keybinds)),k=L(()=>Object.values(y()).some(d=>typeof d=="string")),x=()=>{s(),o.keybinds.resetAll(),B({title:e.t("settings.shortcuts.reset.toast.title"),description:e.t("settings.shortcuts.reset.toast.description")})},C=L(()=>(e.locale(),an(n,y(),e.t("command.palette")))),F=d=>C().get(d)?.title??"",O=L(()=>on(C())),j=L(()=>ln(a.filter,C(),O(),d=>n.keybind(d)||"")),W=L(()=>{for(const d of de)if((j().get(d)??[]).length>0)return!0;return!1}),v=L(()=>{const d=new Map,_=(D,P)=>{const R=d.get(D);if(!R){d.set(D,[P]);return}R.push(P)},U=o.keybinds.get(oe)??Zt;for(const D of Se(U))_(D,{id:oe,title:F(oe)});const S=D=>{const P=o.keybinds.get(D);if(typeof P=="string")return P;const R=n.options.find(A=>A.id===D);return R?.keybind?R.keybind:n.catalog.find(A=>A.id===D)?.keybind};for(const D of C().keys())if(D!==oe)for(const P of Se(S(D)))_(P,{id:D,title:F(D)});return d});return cn({active:()=>a.active,stop:s,set:(d,_)=>o.keybinds.set(d,_),used:v,language:e}),Oe(()=>{a.active&&n.keybinds(!0)}),(()=>{var d=Yt(),_=d.firstChild,U=_.firstChild,S=U.firstChild,D=S.firstChild,P=S.nextSibling,R=_.nextSibling;return r(D,()=>e.t("settings.shortcuts.title")),r(S,t(G,{size:"small",variant:"secondary",onClick:x,get disabled(){return!k()},get children(){return e.t("settings.shortcuts.reset.button")}}),null),r(P,t(Z,{name:"magnifying-glass",class:"text-icon-weak-base flex-shrink-0"}),null),r(P,t(J,{variant:"ghost",type:"text",get value(){return a.filter},onChange:m=>g("filter",m),get placeholder(){return e.t("settings.shortcuts.search.placeholder")},spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"flex-1"}),null),r(P,t(z,{get when(){return a.filter},get children(){return t(Pe,{icon:"circle-x",variant:"ghost",onClick:()=>g("filter","")})}}),null),r(R,t(le,{each:de,children:m=>t(z,{get when(){return(j().get(m)??[]).length>0},get children(){var A=Xt(),N=A.firstChild;return r(N,()=>e.t(en[m])),r(A,t(H,{get children(){return t(le,{get each(){return j().get(m)??[]},children:E=>(()=>{var I=Qt(),c=I.firstChild,h=c.nextSibling;return r(c,()=>F(E)),h.$$click=()=>b(E),gt(h,"data-keybind-id",E),r(h,t(z,{get when(){return a.active===E},get fallback(){return n.keybind(E)||e.t("settings.shortcuts.unassigned")},get children(){return e.t("settings.shortcuts.pressKeys")}})),Ue(K=>ut(h,{"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":a.active!==E,"border border-border-weak-base bg-surface-inset-base text-text-weak":a.active===E},K)),I})()})}}),null),A}})}),null),r(R,t(z,{get when(){return q(()=>!!a.filter)()&&!W()},get children(){var m=Jt(),A=m.firstChild;return r(A,()=>e.t("settings.shortcuts.search.empty")),r(m,t(z,{get when(){return a.filter},get children(){var N=Ht(),E=N.firstChild,I=E.nextSibling;return I.nextSibling,r(N,()=>a.filter,I),N}}),null),m}}),null),d})()};je(["click"]);var gn=f('<p class="text-12-regular text-text-weak">'),Ke=f('<div class="flex justify-end pt-1">'),un=f('<p class="text-14-regular text-text-base">'),pn=f('<div class="flex flex-col rounded-lg border border-border-weak-base overflow-hidden"><button type=button class="flex items-center justify-between gap-3 w-full px-3.5 py-3 text-left hover:bg-surface-base-hover transition-colors disabled:opacity-50"><div class="flex flex-col gap-0.5 min-w-0"><span class="text-14-medium text-text-strong"></span><span class="text-12-regular text-text-weak">'),fn=f('<div class="flex flex-col gap-4 max-h-[min(60vh,420px)] overflow-y-auto pr-0.5">'),hn=f('<div class="flex gap-2 justify-end pt-1">'),mn=f('<div class="w-full px-5 pb-5 flex flex-col gap-4">'),vn=f('<div class="flex items-center gap-2 min-w-0"><span class=truncate>');function Fe(n){const e=Math.max(1,Math.ceil(n/1e3)),o=Math.floor(e/3600),a=Math.floor(e%3600/60),g=e%60;return o>0?`${o}:${String(a).padStart(2,"0")}:${String(g).padStart(2,"0")}`:`${a}:${String(g).padStart(2,"0")}`}function bn(){const n=Te(),e=ce(),o=De(),a=he(),g=Re(),[s,b]=ie("password"),[y,k]=ie(""),[x,C]=ie(!1),[F,O]=ie(""),[j,W]=ie(0),[v,p]=ie(Date.now()),[d,_]=Ce({baseURL:"",modelID:"",modelName:"",providerName:"",apiKey:"",hasApiKey:!1}),U=L(()=>Math.max(0,j()-v())),S=L(()=>U()>0);Ee(()=>{if(!S())return;const c=window.setInterval(()=>p(Date.now()),250);Oe(()=>window.clearInterval(c))}),Ee(()=>{P("/global/onescience-preset/status",{method:"GET"}).then(c=>{c.lockedUntil&&c.lockedUntil>Date.now()&&(W(c.lockedUntil),p(Date.now()))}).catch(()=>{})});const D=L(()=>s()==="model"?e.t("settings.providers.onescience.admin.model.title"):e.t("settings.providers.onescience.admin.title"));async function P(c,h){const K={"Content-Type":"application/json"},ee=g.current;ee?.http.password&&(K.Authorization=`Basic ${Me({username:ee.http.username,password:ee.http.password})}`);const X=await fetch(`${o.url}${c}`,{method:h.method,headers:K,body:h.body===void 0?void 0:JSON.stringify(h.body)}),te=await X.text(),ne=te?JSON.parse(te):void 0;if(!X.ok){const me=ne&&typeof ne=="object"&&"message"in ne?String(ne.message):te;throw new Error(me||X.statusText)}return ne}async function R(){await o.client.global.dispose().catch(()=>{}),await a.reload()}async function m(c){const h=await P("/global/onescience-preset/admin/config",{method:"POST",body:{token:c}});_({baseURL:h.baseURL,modelID:h.modelID,modelName:h.modelName,providerName:h.providerName,apiKey:"",hasApiKey:h.hasApiKey})}async function A(){if(!(x()||S())){C(!0);try{const c=await P("/global/onescience-preset/admin/login",{method:"POST",body:{password:F()}});if(!c.ok||!c.token){c.lockedUntil&&c.lockedUntil>Date.now()?(W(c.lockedUntil),p(Date.now()),B({title:e.t("settings.providers.onescience.admin.passwordLocked",{time:Fe(c.lockedUntil-Date.now())})})):B({title:e.t("settings.providers.onescience.admin.passwordInvalid")});return}W(0),k(c.token),O(""),b("menu")}catch(c){B({title:e.t("common.requestFailed"),description:c instanceof Error?c.message:String(c)})}finally{C(!1)}}}async function N(){if(!x()){C(!0);try{await m(y()),b("model")}catch(c){B({title:e.t("common.requestFailed"),description:c instanceof Error?c.message:String(c)})}finally{C(!1)}}}async function E(){if(!x()){C(!0);try{const c=await P("/global/onescience-preset/admin/config",{method:"PATCH",body:{token:y(),baseURL:d.baseURL,modelID:d.modelID,modelName:d.modelName,providerName:d.providerName,apiKey:d.apiKey||void 0}});_({baseURL:c.baseURL,modelID:c.modelID,modelName:c.modelName,providerName:c.providerName,apiKey:"",hasApiKey:c.hasApiKey}),await R(),B({variant:"success",icon:"circle-check",title:e.t("settings.providers.onescience.admin.saved")}),b("menu")}catch(c){B({title:e.t("common.requestFailed"),description:c instanceof Error?c.message:String(c)})}finally{C(!1)}}}async function I(){if(!x()){C(!0);try{const c=await P("/global/onescience-preset/admin/reset",{method:"POST",body:{token:y()}});_({baseURL:c.baseURL,modelID:c.modelID,modelName:c.modelName,providerName:c.providerName,apiKey:"",hasApiKey:c.hasApiKey}),await R(),B({variant:"success",icon:"circle-check",title:e.t("settings.providers.onescience.admin.reset")})}catch(c){B({title:e.t("common.requestFailed"),description:c instanceof Error?c.message:String(c)})}finally{C(!1)}}}return t(Be,{get title(){return q(()=>s()==="model")()?(()=>{var c=vn(),h=c.firstChild;return r(c,t(Pe,{tabIndex:-1,icon:"arrow-left",variant:"ghost",onClick:()=>b("menu"),get"aria-label"(){return e.t("common.goBack")}}),h),r(h,D),c})():D()},get description(){return q(()=>s()==="password")()?e.t("settings.providers.onescience.admin.passwordHint"):void 0},fit:!0,transition:!0,class:"w-full max-w-[420px]",get children(){var c=mn();return r(c,t(vt,{get children(){return[t(be,{get when(){return s()==="password"},get children(){return[t(J,{autofocus:!0,type:"password",get label(){return e.t("settings.providers.onescience.admin.password")},get value(){return F()},onChange:O,get placeholder(){return e.t("settings.providers.onescience.admin.passwordPlaceholder")},get disabled(){return S()},onKeyDown:h=>{h.key==="Enter"&&F().trim()&&!x()&&!S()&&A()}}),t(z,{get when(){return S()},get children(){var h=gn();return r(h,()=>e.t("settings.providers.onescience.admin.passwordLocked",{time:Fe(U())})),h}}),(()=>{var h=Ke();return r(h,t(G,{variant:"primary",get disabled(){return x()||S()||!F().trim()},onClick:()=>void A(),get children(){return e.t("settings.providers.onescience.admin.unlock")}})),h})()]}}),t(be,{get when(){return s()==="menu"},get children(){return[(()=>{var h=un();return r(h,()=>e.t("settings.providers.onescience.admin.menu.hint")),h})(),(()=>{var h=pn(),K=h.firstChild,ee=K.firstChild,X=ee.firstChild,te=X.nextSibling;return K.$$click=()=>void N(),r(X,()=>e.t("settings.providers.onescience.admin.menu.model")),r(te,()=>e.t("settings.providers.onescience.admin.menu.model.description")),r(K,t(Z,{name:"chevron-right",size:"small",class:"shrink-0 text-icon-base"}),null),Ue(()=>K.disabled=x()),h})(),(()=>{var h=Ke();return r(h,t(G,{variant:"ghost",get disabled(){return x()},onClick:()=>n.close(),get children(){return e.t("common.close")}})),h})()]}}),t(be,{get when(){return s()==="model"},get children(){return[(()=>{var h=fn();return r(h,t(J,{get label(){return e.t("settings.providers.onescience.admin.providerName")},get value(){return d.providerName},onChange:K=>_("providerName",K)}),null),r(h,t(J,{get label(){return e.t("settings.providers.onescience.admin.baseURL")},get value(){return d.baseURL},onChange:K=>_("baseURL",K)}),null),r(h,t(J,{get label(){return e.t("settings.providers.onescience.admin.modelID")},get value(){return d.modelID},onChange:K=>_("modelID",K)}),null),r(h,t(J,{get label(){return e.t("settings.providers.onescience.admin.modelName")},get value(){return d.modelName},onChange:K=>_("modelName",K)}),null),r(h,t(J,{type:"password",get label(){return e.t("settings.providers.onescience.admin.apiKey")},get value(){return d.apiKey},onChange:K=>_("apiKey",K),get placeholder(){return q(()=>!!d.hasApiKey)()?e.t("settings.providers.onescience.admin.apiKeyKeep"):e.t("settings.providers.onescience.admin.apiKeyPlaceholder")}}),null),h})(),(()=>{var h=hn();return r(h,t(G,{variant:"ghost",get disabled(){return x()},onClick:()=>void I(),get children(){return e.t("settings.providers.onescience.admin.resetAction")}}),null),r(h,t(G,{variant:"primary",get disabled(){return x()},onClick:()=>void E(),get children(){return e.t("common.save")}}),null),h})()]}})]}})),c}})}je(["click"]);var xn=f('<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">'),wn=f('<div class="flex flex-col gap-2 pt-2 border-t border-border-weak-base">'),yn=f('<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">'),$n=f('<div class="py-4 text-14-regular text-text-weak">'),_n=f('<div class="flex items-center gap-1">'),kn=f('<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">'),Sn=f('<span class="text-14-regular text-text-base opacity-0 group-hover:opacity-100 transition-opacity duration-200 pr-3 cursor-default">'),Cn=f('<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">'),Dn=f('<span class="text-12-regular text-text-weak pl-8">');const $e="onescience",Pn=[{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"}],Tn=()=>{const n=Te(),e=ce(),o=De(),a=he(),g=bt(),s=Re(),[b]=_e(async()=>{const v={},p=s.current;p?.http.password&&(v.Authorization=`Basic ${Me({username:p.http.username,password:p.http.password})}`);const d=await fetch(`${o.url}/global/onescience-preset/status`,{headers:v});return d.ok?await d.json():{adminEnabled:!1,modelEnabled:!1}}),y=L(()=>{const v=new Set(a.data.config.disabled_providers??[]);return g.connected().filter(p=>!v.has(p.id)).filter(p=>p.id!=="opencode"||Object.values(p.models).find(d=>d.cost?.input))}),k=L(()=>{const v=new Set(y().map(d=>d.id)),p=g.popular().filter(d=>!v.has(d.id)).slice();return p.sort((d,_)=>fe.indexOf(d.id)-fe.indexOf(_.id)),p}),x=v=>{if(!("source"in v))return;const p=v.source;if(p==="env"||p==="api"||p==="config"||p==="custom")return p},C=v=>{if(v.id===$e)return e.t("settings.providers.tag.limited");const p=x(v);return p==="env"?e.t("settings.providers.tag.environment"):p==="api"?e.t("provider.connect.method.apiKey"):p==="config"?j(v.id)?e.t("settings.providers.tag.custom"):e.t("settings.providers.tag.config"):p==="custom"?e.t("settings.providers.tag.custom"):e.t("settings.providers.tag.other")},F=v=>v.id!==$e&&x(v)!=="env",O=v=>Pn.find(p=>p.match(v))?.key,j=v=>{const p=a.data.config.provider?.[v];return!(!p||p.npm!=="@ai-sdk/openai-compatible"||!p.models||Object.keys(p.models).length===0)},W=async(v,p)=>{if(j(v)){const d=a.data.config.disabled_providers??[],_=a.data.provider.connected,U=d.includes(v)?d:[...d,v];a.set("config","disabled_providers",U),a.set("provider","connected",_.filter(S=>S!==v)),B({variant:"success",icon:"circle-check",title:e.t("provider.disconnect.toast.disconnected.title",{provider:p}),description:e.t("provider.disconnect.toast.disconnected.description",{provider:p})});try{await o.client.auth.remove({providerID:v}).catch(()=>{}),await a.updateConfig({disabled_providers:U}),await o.client.global.dispose().catch(()=>{}),await a.reload()}catch(S){a.set("config","disabled_providers",d),a.set("provider","connected",_);const D=S instanceof Error?S.message:String(S);B({title:e.t("common.requestFailed"),description:D})}return}await o.client.auth.remove({providerID:v}).then(async()=>{await o.client.global.dispose(),await a.reload(),B({variant:"success",icon:"circle-check",title:e.t("provider.disconnect.toast.disconnected.title",{provider:p}),description:e.t("provider.disconnect.toast.disconnected.description",{provider:p})})}).catch(d=>{const _=d instanceof Error?d.message:String(d);B({title:e.t("common.requestFailed"),description:_})})};return(()=>{var v=yn(),p=v.firstChild,d=p.firstChild,_=d.firstChild,U=p.nextSibling,S=U.firstChild,D=S.firstChild,P=S.nextSibling,R=P.firstChild;return r(_,()=>e.t("settings.providers.title")),r(D,()=>e.t("settings.providers.section.connected")),r(S,t(H,{get children(){return t(z,{get when(){return y().length>0},get fallback(){return(()=>{var m=$n();return r(m,()=>e.t("settings.providers.connected.empty")),m})()},get children(){return t(le,{get each(){return y()},children:m=>(()=>{var A=kn(),N=A.firstChild,E=N.firstChild;return r(N,t(pe,{get id(){return m.id},class:"size-5 shrink-0 icon-strong-base"}),E),r(E,()=>m.name),r(N,t(ue,{get children(){return C(m)}}),null),r(A,t(z,{get when(){return F(m)},get fallback(){return(()=>{var I=Sn();return r(I,(()=>{var c=q(()=>m.id===$e);return()=>c()?e.t("settings.providers.onescience.readonlyHint"):e.t("settings.providers.connected.environmentDescription")})()),I})()},get children(){var I=_n();return r(I,t(z,{get when(){return j(m.id)},get children(){return t(G,{size:"large",variant:"ghost",onClick:()=>n.show(()=>t(ke,{get providerID(){return m.id},back:"providers"})),get children(){return e.t("common.edit")}})}}),null),r(I,t(G,{size:"large",variant:"ghost",onClick:()=>void W(m.id,m.name),get children(){return q(()=>!!j(m.id))()?e.t("common.delete"):e.t("common.disconnect")}}),null),I}}),null),A})()})}})}}),null),r(R,()=>e.t("settings.providers.section.popular")),r(P,t(H,{get children(){return[t(le,{get each(){return k()},children:m=>(()=>{var A=Cn(),N=A.firstChild,E=N.firstChild,I=E.firstChild;return r(E,t(pe,{get id(){return m.id},class:"size-5 shrink-0 icon-strong-base"}),I),r(I,()=>m.name),r(E,t(z,{get when(){return m.id==="opencode"},get children(){return t(ue,{get children(){return e.t("dialog.provider.tag.recommended")}})}}),null),r(E,t(z,{get when(){return m.id==="opencode-go"},get children(){return t(ue,{get children(){return e.t("dialog.provider.tag.recommended")}})}}),null),r(N,t(z,{get when(){return O(m.id)},children:c=>(()=>{var h=Dn();return r(h,()=>e.t(c())),h})()}),null),r(A,t(G,{size:"large",variant:"secondary",icon:"plus-small",onClick:()=>{n.show(()=>t($t,{get provider(){return m.id}}))},get children(){return e.t("common.connect")}}),null),A})()}),(()=>{var m=xn(),A=m.firstChild,N=A.firstChild,E=N.firstChild,I=N.nextSibling;return r(N,t(pe,{id:"synthetic",class:"size-5 shrink-0 icon-strong-base"}),E),r(E,()=>e.t("provider.custom.title")),r(N,t(ue,{get children(){return e.t("settings.providers.tag.custom")}}),null),r(I,()=>e.t("settings.providers.custom.description")),r(m,t(G,{size:"large",variant:"secondary",icon:"plus-small",onClick:()=>{n.show(()=>t(ke,{}))},get children(){return e.t("common.connect")}}),null),m})()]}}),null),r(P,t(G,{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(_t,{}))},get children(){return e.t("dialog.provider.viewAll")}}),null),r(U,t(z,{get when(){return b()?.adminEnabled},get children(){var m=wn();return r(m,t(G,{size:"large",variant:"secondary",onClick:()=>n.show(()=>t(bn,{})),get children(){return e.t("settings.providers.onescience.admin.button")}})),m}}),null),v})()};var Ge=f('<div class="flex flex-col items-center justify-center py-12 text-center"><span class="text-14-regular text-text-weak">'),An=f('<span class="text-14-regular text-text-strong mt-1">&quot;<!>&quot;'),En=f('<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]">'),Nn=f('<div class="flex flex-col gap-1"><div class="flex items-center gap-2 pb-2"><span class="text-14-medium text-text-strong">'),Kn=f('<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 flex-shrink-0 items-center gap-2">');const Fn=n=>(()=>{var e=Ge(),o=e.firstChild;return r(o,()=>n.label),e})(),In=n=>(()=>{var e=Ge(),o=e.firstChild;return r(o,()=>n.message),r(e,t(z,{get when(){return n.filter},get children(){var a=An(),g=a.firstChild,s=g.nextSibling;return s.nextSibling,r(a,()=>n.filter,s),a}}),null),e})(),Ln=()=>{const n=ce(),e=xt(),o=Te(),a=he(),g=b=>{const y=a.data.config.provider?.[b];return!(!y||y.npm!=="@ai-sdk/openai-compatible"||!y.models||Object.keys(y.models).length===0)},s=wt({items:b=>e.list(),key:b=>`${b.provider.id}:${b.id}`,filterKeys:["provider.name","name","id"],sortBy:(b,y)=>b.name.localeCompare(y.name),groupBy:b=>b.provider.id,sortGroupsBy:(b,y)=>{const k=fe.indexOf(b.category),x=fe.indexOf(y.category),C=k>=0,F=x>=0;if(C&&!F)return-1;if(!C&&F)return 1;if(C&&F)return k-x;const O=b.items[0].provider.name,j=y.items[0].provider.name;return O.localeCompare(j)}});return(()=>{var b=En(),y=b.firstChild,k=y.firstChild,x=k.firstChild,C=x.nextSibling,F=y.nextSibling;return r(x,()=>n.t("settings.models.title")),r(C,t(Z,{name:"magnifying-glass",class:"text-icon-weak-base flex-shrink-0"}),null),r(C,t(J,{variant:"ghost",type:"text",get value(){return s.filter()},get onChange(){return s.onInput},get placeholder(){return n.t("dialog.model.search.placeholder")},spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"flex-1"}),null),r(C,t(z,{get when(){return s.filter()},get children(){return t(Pe,{icon:"circle-x",variant:"ghost",get onClick(){return s.clear}})}}),null),r(F,t(z,{get when(){return!s.grouped.loading},get fallback(){return t(Fn,{get label(){return`${n.t("common.loading")}${n.t("common.loading.ellipsis")}`}})},get children(){return t(z,{get when(){return s.flat().length>0},get fallback(){return t(In,{get message(){return n.t("dialog.model.empty")},get filter(){return s.filter()}})},get children(){return t(le,{get each(){return s.grouped.latest},children:O=>(()=>{var j=Nn(),W=j.firstChild,v=W.firstChild;return r(W,t(pe,{get id(){return O.category},class:"size-5 shrink-0 icon-strong-base"}),v),r(v,()=>O.items[0].provider.name),r(j,t(H,{get children(){return t(le,{get each(){return O.items},children:p=>{const d={providerID:p.provider.id,modelID:p.id},_=g(p.provider.id);return(()=>{var U=Kn(),S=U.firstChild,D=S.firstChild,P=S.nextSibling;return r(D,()=>p.name),r(P,t(z,{when:_,get children(){return t(G,{size:"large",variant:"ghost",onClick:()=>o.show(()=>t(ke,{get providerID(){return p.provider.id},get modelID(){return p.id},back:"models"})),get children(){return n.t("common.edit")}})}}),null),r(P,t(M,{get checked(){return e.visible(d)},onChange:R=>{e.setVisibility(d,R)},hideLabel:!0,get children(){return p.name}}),null),U})()}})}}),null),j})()})}})}})),b})()};var zn=f('<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 Rn=n=>{const e=ce(),o=Ie();return t(Be,{size:"x-large",transition:!0,get children(){return t(V,{orientation:"vertical",variant:"settings",get defaultValue(){return n.tab??"general"},class:"h-full settings-dialog",get children(){return[t(V.List,{get children(){var a=zn(),g=a.firstChild,s=g.firstChild,b=s.firstChild,y=b.firstChild,k=b.nextSibling,x=k.firstChild,C=g.nextSibling,F=C.firstChild,O=F.nextSibling;return O.firstChild,r(b,t(V.SectionTitle,{get children(){return e.t("settings.section.desktop")}}),y),r(y,t(V.Trigger,{value:"general",get children(){return[t(Z,{name:"sliders"}),q(()=>e.t("settings.tab.general"))]}}),null),r(y,t(V.Trigger,{value:"shortcuts",get children(){return[t(Z,{name:"keyboard"}),q(()=>e.t("settings.tab.shortcuts"))]}}),null),r(k,t(V.SectionTitle,{get children(){return e.t("settings.section.server")}}),x),r(x,t(V.Trigger,{value:"providers",get children(){return[t(Z,{name:"providers"}),q(()=>e.t("settings.providers.title"))]}}),null),r(x,t(V.Trigger,{value:"models",get children(){return[t(Z,{name:"models"}),q(()=>e.t("settings.models.title"))]}}),null),r(F,()=>e.t("app.name.desktop")),r(O,()=>o.version,null),a}}),t(V.Content,{value:"general",class:"no-scrollbar",get children(){return t(Vt,{})}}),t(V.Content,{value:"shortcuts",class:"no-scrollbar",get children(){return t(dn,{})}}),t(V.Content,{value:"providers",class:"no-scrollbar",get children(){return t(Tn,{})}}),t(V.Content,{value:"models",class:"no-scrollbar",get children(){return t(Ln,{})}})]}})}})};export{Rn as DialogSettings};