@onescience/onecode-web 1.14.50-202607240916 → 1.14.50-202607270920
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{alert-01-DX7AlPTQ.js → alert-01-gt6S0z_p.js} +1 -1
- package/assets/{alert-02-UPjgfFjK.js → alert-02-6AlfxkTV.js} +1 -1
- package/assets/{alert-04-BvgaCS1E.js → alert-04-CjwqdNU5.js} +1 -1
- package/assets/{alert-05-Dpfyagbn.js → alert-05-KJYlRG5O.js} +1 -1
- package/assets/alert-06-CefthTEC.js +1 -0
- package/assets/alert-07-fuppCSbf.js +1 -0
- package/assets/alert-08-CCeLh_jz.js +1 -0
- package/assets/alert-10-BfqIrqSs.js +1 -0
- package/assets/{bip-bop-03-Dyqm3mFf.js → bip-bop-03-C-L0V2U7.js} +1 -1
- package/assets/{bip-bop-04-CYqmGP7w.js → bip-bop-04-ZaqYGiVq.js} +1 -1
- package/assets/{bip-bop-06-B88yPLWG.js → bip-bop-06-h4Nvb1D8.js} +1 -1
- package/assets/{bip-bop-08-BwCcBkSt.js → bip-bop-08-CYeRJH1U.js} +1 -1
- package/assets/bip-bop-09-CeXOcPCK.js +1 -0
- package/assets/{dialog-create-project-folder-FfOraAoz.js → dialog-create-project-folder-DwrGtW4z.js} +1 -1
- package/assets/{dialog-edit-project-BP_MEyRY.js → dialog-edit-project-BViLsh8w.js} +1 -1
- package/assets/{dialog-fork-Cmf9Otly.js → dialog-fork-CXPkk66n.js} +1 -1
- package/assets/{dialog-select-directory-CuVPOlYT.js → dialog-select-directory-C-6NKQ4S.js} +1 -1
- package/assets/{dialog-select-file-BsXMZjc6.js → dialog-select-file-DwAtqCpm.js} +1 -1
- package/assets/{dialog-select-mcp-Ba7u3u4N.js → dialog-select-mcp-R_pTVuCD.js} +1 -1
- package/assets/{dialog-select-model-CAgwUIAh.js → dialog-select-model-DZ1zPURp.js} +2 -2
- package/assets/{dialog-select-provider-BHTv3VJJ.js → dialog-select-provider-D82rNFuq.js} +2 -2
- package/assets/{dialog-select-server-vV4dJqbP.js → dialog-select-server-ByR06N2D.js} +1 -1
- package/assets/dialog-settings-B08mlzri.js +1 -0
- package/assets/{ghostty-web-Cs2dsSLi.js → ghostty-web-CNRkU8Eg.js} +1 -1
- package/assets/index-COix1hWu.css +1 -0
- package/assets/index-DcwtRPgA.js +2520 -0
- package/assets/{nope-02-B_YPnFyi.js → nope-02-wPMbWxlL.js} +1 -1
- package/assets/{nope-05-o_QeAHLi.js → nope-05-BHrJ9e1a.js} +1 -1
- package/assets/{nope-08-DeKE3IyG.js → nope-08-1DKFNqle.js} +1 -1
- package/assets/{nope-11-DGupAHY7.js → nope-11-Bcji-F11.js} +1 -1
- package/assets/nope-12-iaIoOH9f.js +1 -0
- package/assets/{server-row-DWYYzXBO.js → server-row-CqtUIexs.js} +1 -1
- package/assets/{staplebops-03-CmL4MWMt.js → staplebops-03-DYnkJ8Rw.js} +1 -1
- package/assets/{staplebops-04-QbEgFH5Z.js → staplebops-04-CTdyVqYs.js} +1 -1
- package/assets/{staplebops-06-BB2t0_mM.js → staplebops-06-BGCcWUEw.js} +1 -1
- package/assets/{staplebops-07-CAjclvxU.js → staplebops-07-Ff3ZuvsU.js} +1 -1
- package/assets/{status-popover-body-BZuM59_l.js → status-popover-body-BIROCXDe.js} +2 -2
- package/assets/{tag-Y1Tk0U7a.js → tag-jNgIM7zW.js} +1 -1
- package/assets/{yup-01-CDeEUTAu.js → yup-01-VfXMm1Xg.js} +1 -1
- package/assets/{yup-03-B8zcJ_Af.js → yup-03-DQKCQpZm.js} +1 -1
- package/assets/{yup-04-CrbxvLti.js → yup-04-CYEBoFeW.js} +1 -1
- package/assets/{yup-05-BUhtMuQw.js → yup-05-eFSfTBF1.js} +1 -1
- package/assets/zh-Dg6VHIXD.js +1 -0
- package/assets/{zh-CCbBR9Ii.js → zh-Z2MHkt0r.js} +1 -1
- package/assets/zht-Dxm0ZV7C.js +1 -0
- package/assets/{zht-yPs7lt8w.js → zht-tFg6RAI0.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/assets/alert-06-D03BbmkP.js +0 -1
- package/assets/alert-07-Di8Rl3ul.js +0 -1
- package/assets/alert-08-Dw08DhdS.js +0 -1
- package/assets/alert-10-DYRFVlOh.js +0 -1
- package/assets/bip-bop-09-8FE30VJK.js +0 -1
- package/assets/dialog-settings-DK77wRQr.js +0 -1
- package/assets/index-B72_58kD.css +0 -1
- package/assets/index-tRQrXlz2.js +0 -2519
- package/assets/nope-12-T6sJIwM6.js +0 -1
- package/assets/zh-ip4M5ZDX.js +0 -1
- package/assets/zht-ERc9dfaq.js +0 -1
|
@@ -0,0 +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 B,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 lt,ai as ot,y as M,aj as ct,d as je,ak as dt,o as Oe,v as Te,F as oe,G as ut,r as Ue,X as gt,al as pt,am as ft,an as ht,ao as mt,b as Pe,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-DcwtRPgA.js";import{L as yt,D as ke,a as $t,b as _t}from"./dialog-select-provider-D82rNFuq.js";import{T as ge}from"./tag-jNgIM7zW.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-202607270920/",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>"),Tt=f("<div data-action=settings-feed-shell-tool-parts-expanded>"),Pt=f("<div data-action=settings-feed-edit-tool-parts-expanded>"),At=f('<div class="flex flex-col gap-1">'),Et=f("<div data-action=settings-show-file-tree>"),Nt=f("<div data-action=settings-show-navigation>"),Kt=f("<div data-action=settings-show-search>"),Ft=f("<div data-action=settings-show-terminal>"),It=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]">'),Lt=f("<div data-action=settings-notifications-agent>"),zt=f("<div data-action=settings-notifications-permissions>"),jt=f("<div data-action=settings-notifications-errors>"),Ot=f("<div data-action=settings-updates-startup>"),Ut=f("<div data-action=settings-release-notes>"),Rt=f("<div data-action=settings-wayland>"),Mt=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">'),Bt=f("<span class=text-text-weak>"),Wt=f('<div class="flex items-center gap-2"><span>'),Gt=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(l=>{if(Y.run!==e){l?.();return}Y.cleanup=l})},100)},qt=()=>{const n=He(),e=ce(),l=Je(),a=Ie(),u=Ye(),s=Le(),[b,y]=Ce({checking:!1}),k=L(()=>a.platform==="desktop"&&a.os==="linux"),x=L(()=>Xe(u.dir)),C=L(()=>{const g=x();return g?u.id?l.isAutoAccepting(u.id,g):l.isAutoAcceptingDirectory(g):!1}),F=g=>{const o=x();if(o){if(!u.id){if(l.isAutoAcceptingDirectory(o)===g)return;l.toggleAutoAcceptDirectory(o);return}if(g){l.enableAutoAccept(u.id,o);return}l.disableAutoAccept(u.id,o)}},O=L(()=>a.platform==="desktop"),j=()=>{a.checkUpdate&&(y("checking",!0),a.checkUpdate().then(g=>{if(!g.updateAvailable){M({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 o=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"}];M({persistent:!0,icon:"download",title:e.t("toast.update.title"),description:e.t("toast.update.description",{version:g.version??""}),actions:o})}).catch(g=>{const o=g instanceof Error?g.message:String(g);M({title:e.t("common.requestFailed"),description:o})}).finally(()=>y("checking",!1)))},W=L(()=>n.ids().map(g=>({id:g,name:n.name(g)}))),v=he(),p=De(),[d]=_e(()=>p.client.pty.shells().then(g=>g.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??""),T=L(()=>{const g=d.latest,o=v.data.config.shell,i=new Map;for(const w of g)i.set(w.name,(i.get(w.name)||0)+1);const $=[S,...g.map(w=>{const se=(i.get(w.name)||0)>1,ue=se?w.path:w.name,Q=w.acceptable?ue:`${ue} (${e.t("settings.general.row.shell.terminalOnly")})`;return{id:w.path,value:se?w.path:w.name,label:Q}})];return o&&!$.some(w=>w.value===o)&&$.push({id:o,value:o,label:o}),$}),R=g=>{const o=a.setDisplayBackend?.(g?"wayland":"auto");o&&o.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(g=>({value:g,label:e.label(g)}))),N={id:"none",label:"sound.option.none"},E=[N,...ot],I=()=>at(s.appearance.font()),c=()=>it(s.appearance.uiFont()),h=()=>lt(s.appearance.terminalFont()),K=(g,o,i,$)=>({options:E,current:g()?E.find(w=>w.id===o())??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 g=At();return r(g,t(H,{get children(){return[t(P,{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(o=>o.value===e.locale())},value:o=>o.value,label:o=>o.label,onSelect:o=>o&&e.setLocale(o.value),variant:"secondary",size:"small",triggerVariant:"settings"})}}),t(P,{get title(){return e.t("command.permissions.autoaccept.enable")},get description(){return e.t("toast.permissions.autoaccept.on.description")},get children(){var o=Ct();return r(o,t(B,{get checked(){return C()},get disabled(){return!x()},onChange:F})),o}}),t(P,{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 T()},get current(){return T().find(o=>o.value===D())??S},value:o=>o.id,label:o=>o.label,onSelect:o=>{o&&o.value!==D()&&v.updateConfig({shell:o.value})},variant:"secondary",size:"small",triggerVariant:"settings",triggerStyle:{"min-width":"180px"}})}}),t(P,{get title(){return e.t("settings.general.row.reasoningSummaries.title")},get description(){return e.t("settings.general.row.reasoningSummaries.description")},get children(){var o=Dt();return r(o,t(B,{get checked(){return s.general.showReasoningSummaries()},onChange:i=>s.general.setShowReasoningSummaries(i)})),o}}),t(P,{get title(){return e.t("settings.general.row.shellToolPartsExpanded.title")},get description(){return e.t("settings.general.row.shellToolPartsExpanded.description")},get children(){var o=Tt();return r(o,t(B,{get checked(){return s.general.shellToolPartsExpanded()},onChange:i=>s.general.setShellToolPartsExpanded(i)})),o}}),t(P,{get title(){return e.t("settings.general.row.editToolPartsExpanded.title")},get description(){return e.t("settings.general.row.editToolPartsExpanded.description")},get children(){var o=Pt();return r(o,t(B,{get checked(){return s.general.editToolPartsExpanded()},onChange:i=>s.general.setEditToolPartsExpanded(i)})),o}})]}})),g})(),X=()=>(()=>{var g=ae(),o=g.firstChild;return r(o,()=>e.t("settings.general.section.advanced")),r(g,t(H,{get children(){return[t(P,{get title(){return e.t("settings.general.row.showFileTree.title")},get description(){return e.t("settings.general.row.showFileTree.description")},get children(){var i=Et();return r(i,t(B,{get checked(){return s.general.showFileTree()},onChange:$=>s.general.setShowFileTree($)})),i}}),t(P,{get title(){return e.t("settings.general.row.showNavigation.title")},get description(){return e.t("settings.general.row.showNavigation.description")},get children(){var i=Nt();return r(i,t(B,{get checked(){return s.general.showNavigation()},onChange:$=>s.general.setShowNavigation($)})),i}}),t(P,{get title(){return e.t("settings.general.row.showSearch.title")},get description(){return e.t("settings.general.row.showSearch.description")},get children(){var i=Kt();return r(i,t(B,{get checked(){return s.general.showSearch()},onChange:$=>s.general.setShowSearch($)})),i}}),t(P,{get title(){return e.t("settings.general.row.showTerminal.title")},get description(){return e.t("settings.general.row.showTerminal.description")},get children(){var i=Ft();return r(i,t(B,{get checked(){return s.general.showTerminal()},onChange:$=>s.general.setShowTerminal($)})),i}}),t(P,{get title(){return e.t("settings.general.row.showStatus.title")},get description(){return e.t("settings.general.row.showStatus.description")},get children(){var i=It();return r(i,t(B,{get checked(){return s.general.showStatus()},onChange:$=>s.general.setShowStatus($)})),i}})]}}),null),g})(),te=()=>(()=>{var g=ae(),o=g.firstChild;return r(o,()=>e.t("settings.general.section.appearance")),r(g,t(H,{get children(){return[t(P,{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(P,{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(P,{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(P,{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(P,{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),g})(),ne=()=>(()=>{var g=ae(),o=g.firstChild;return r(o,()=>e.t("settings.general.section.notifications")),r(g,t(H,{get children(){return[t(P,{get title(){return e.t("settings.general.notifications.agent.title")},get description(){return e.t("settings.general.notifications.agent.description")},get children(){var i=Lt();return r(i,t(B,{get checked(){return s.notifications.agent()},onChange:$=>s.notifications.setAgent($)})),i}}),t(P,{get title(){return e.t("settings.general.notifications.permissions.title")},get description(){return e.t("settings.general.notifications.permissions.description")},get children(){var i=zt();return r(i,t(B,{get checked(){return s.notifications.permissions()},onChange:$=>s.notifications.setPermissions($)})),i}}),t(P,{get title(){return e.t("settings.general.notifications.errors.title")},get description(){return e.t("settings.general.notifications.errors.description")},get children(){var i=jt();return r(i,t(B,{get checked(){return s.notifications.errors()},onChange:$=>s.notifications.setErrors($)})),i}})]}}),null),g})(),me=()=>(()=>{var g=ae(),o=g.firstChild;return r(o,()=>e.t("settings.general.section.sounds")),r(g,t(H,{get children(){return[t(P,{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(P,{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(P,{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),g})(),qe=()=>(()=>{var g=ae(),o=g.firstChild;return r(o,()=>e.t("settings.general.section.updates")),r(g,t(H,{get children(){return[t(P,{get title(){return e.t("settings.updates.row.startup.title")},get description(){return e.t("settings.updates.row.startup.description")},get children(){var i=Ot();return r(i,t(B,{get checked(){return s.updates.startup()},get disabled(){return!a.checkUpdate},onChange:$=>s.updates.setStartup($)})),i}}),t(P,{get title(){return e.t("settings.general.row.releaseNotes.title")},get description(){return e.t("settings.general.row.releaseNotes.description")},get children(){var i=Ut();return r(i,t(B,{get checked(){return s.general.releaseNotes()},onChange:$=>s.general.setReleaseNotes($)})),i}}),t(P,{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),g})();return console.log(St),(()=>{var g=Mt(),o=g.firstChild,i=o.firstChild,$=i.firstChild,w=o.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(),ue=se.firstChild;return r(ue,()=>e.t("settings.general.section.display")),r(se,t(H,{get children(){return t(P,{get title(){return(()=>{var Q=Wt(),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=Bt();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=Rt();return r(Q,t(B,{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),g})()},P=n=>(()=>{var e=Gt(),l=e.firstChild,a=l.firstChild,u=a.nextSibling,s=l.nextSibling;return r(a,()=>n.title),r(u,()=>n.description),r(s,()=>n.children),e})();var Vt=f('<span class="text-14-regular text-text-strong mt-1">"<!>"'),Ht=f('<div class="flex flex-col items-center justify-center py-12 text-center"><span class="text-14-regular text-text-weak">'),Jt=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]">'),Yt=f('<div class="flex flex-col gap-1"><h3 class="text-14-medium text-text-strong pb-2">'),Xt=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),le="command.palette",Qt="mod+shift+p",de=["General","Session","Navigation","Model and agent","Terminal","Prompt"],Zt={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===le?"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 en(n){return n==="Shift"||n==="Control"||n==="Alt"||n==="Meta"}function tn(n){return n===","?"comma":n==="+"?"plus":n===" "?"space":n.toLowerCase()}function nn(n){if(en(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=tn(n.key);if(a)return e.push(a),e.join("+")}function Se(n){if(!n)return[];const e=[];for(const l of ft(n)){const a=[];l.ctrl&&a.push("ctrl"),l.alt&&a.push("alt"),l.shift&&a.push("shift"),l.meta&&a.push("meta"),l.key&&a.push(l.key),a.length!==0&&e.push(a.join("+"))}return e}function rn(n){return!n||typeof n!="object"||Array.isArray(n)?{}:n}function sn(n,e,l){const a=new Map;a.set(le,{title:l,group:"General"});for(const u of n.catalog)u.id.startsWith("suggested.")||u.hidden||a.set(u.id,{title:u.title,group:ye(u.id)});for(const u of n.options)u.id.startsWith("suggested.")||u.hidden||a.set(u.id,{title:u.title,group:ye(u.id)});for(const[u,s]of Object.entries(e))typeof s=="string"&&(a.has(u)||a.set(u,{title:u,group:ye(u)}));return a}function an(n){const e=new Map;for(const l of de)e.set(l,[]);for(const[l,a]of n){const u=e.get(a.group);u&&u.push(l)}for(const l of de){const a=e.get(l);a&&a.sort((u,s)=>(n.get(u)?.title??"").localeCompare(n.get(s)?.title??""))}return e}function ln(n,e,l,a){const u=n.toLowerCase().trim();if(!u)return l;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(u,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 on(n){ze(()=>{ht(document,"keydown",l=>{const a=n.active();if(!a)return;if(l.preventDefault(),l.stopPropagation(),l.stopImmediatePropagation(),l.key==="Escape"){n.stop();return}if((l.key==="Backspace"||l.key==="Delete")&&!l.ctrlKey&&!l.metaKey&&!l.altKey&&!l.shiftKey){n.set(a,"none"),n.stop();return}const s=nn(l);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){M({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 cn=()=>{const n=dt(),e=ce(),l=Le(),[a,u]=Ce({active:null,filter:""}),s=()=>{a.active&&(u("active",null),n.keybinds(!0))},b=d=>{if(a.active===d){s();return}a.active&&s(),u("active",d),n.keybinds(!1)},y=L(()=>rn(l.current.keybinds)),k=L(()=>Object.values(y()).some(d=>typeof d=="string")),x=()=>{s(),l.keybinds.resetAll(),M({title:e.t("settings.shortcuts.reset.toast.title"),description:e.t("settings.shortcuts.reset.toast.description")})},C=L(()=>(e.locale(),sn(n,y(),e.t("command.palette")))),F=d=>C().get(d)?.title??"",O=L(()=>an(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,T)=>{const R=d.get(D);if(!R){d.set(D,[T]);return}R.push(T)},U=l.keybinds.get(le)??Qt;for(const D of Se(U))_(D,{id:le,title:F(le)});const S=D=>{const T=l.keybinds.get(D);if(typeof T=="string")return T;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!==le)for(const T of Se(S(D)))_(T,{id:D,title:F(D)});return d});return on({active:()=>a.active,stop:s,set:(d,_)=>l.keybinds.set(d,_),used:v,language:e}),Oe(()=>{a.active&&n.keybinds(!0)}),(()=>{var d=Jt(),_=d.firstChild,U=_.firstChild,S=U.firstChild,D=S.firstChild,T=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(T,t(Z,{name:"magnifying-glass",class:"text-icon-weak-base flex-shrink-0"}),null),r(T,t(J,{variant:"ghost",type:"text",get value(){return a.filter},onChange:m=>u("filter",m),get placeholder(){return e.t("settings.shortcuts.search.placeholder")},spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"flex-1"}),null),r(T,t(z,{get when(){return a.filter},get children(){return t(Te,{icon:"circle-x",variant:"ghost",onClick:()=>u("filter","")})}}),null),r(R,t(oe,{each:de,children:m=>t(z,{get when(){return(j().get(m)??[]).length>0},get children(){var A=Yt(),N=A.firstChild;return r(N,()=>e.t(Zt[m])),r(A,t(H,{get children(){return t(oe,{get each(){return j().get(m)??[]},children:E=>(()=>{var I=Xt(),c=I.firstChild,h=c.nextSibling;return r(c,()=>F(E)),h.$$click=()=>b(E),ut(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=>gt(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=Ht(),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=Vt(),E=N.firstChild,I=E.nextSibling;return I.nextSibling,r(N,()=>a.filter,I),N}}),null),m}}),null),d})()};je(["click"]);var dn=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">'),gn=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">'),pn=f('<div class="flex flex-col gap-4 max-h-[min(60vh,420px)] overflow-y-auto pr-0.5">'),fn=f('<div class="flex gap-2 justify-end pt-1">'),hn=f('<div class="w-full px-5 pb-5 flex flex-col gap-4">'),mn=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)),l=Math.floor(e/3600),a=Math.floor(e%3600/60),u=e%60;return l>0?`${l}:${String(a).padStart(2,"0")}:${String(u).padStart(2,"0")}`:`${a}:${String(u).padStart(2,"0")}`}function vn(){const n=Pe(),e=ce(),l=De(),a=he(),u=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(()=>{T("/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 T(c,h){const K={"Content-Type":"application/json"},ee=u.current;ee?.http.password&&(K.Authorization=`Basic ${Me({username:ee.http.username,password:ee.http.password})}`);const X=await fetch(`${l.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 l.client.global.dispose().catch(()=>{}),await a.reload()}async function m(c){const h=await T("/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 T("/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()),M({title:e.t("settings.providers.onescience.admin.passwordLocked",{time:Fe(c.lockedUntil-Date.now())})})):M({title:e.t("settings.providers.onescience.admin.passwordInvalid")});return}W(0),k(c.token),O(""),b("menu")}catch(c){M({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){M({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 T("/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(),M({variant:"success",icon:"circle-check",title:e.t("settings.providers.onescience.admin.saved")}),b("menu")}catch(c){M({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 T("/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(),M({variant:"success",icon:"circle-check",title:e.t("settings.providers.onescience.admin.reset")})}catch(c){M({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=mn(),h=c.firstChild;return r(c,t(Te,{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=hn();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=dn();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=gn(),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=pn();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=fn();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 bn=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">'),xn=f('<div class="flex flex-col gap-2 pt-2 border-t border-border-weak-base">'),wn=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">'),yn=f('<div class="py-4 text-14-regular text-text-weak">'),$n=f('<div class="flex items-center gap-1">'),_n=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">'),kn=f('<span class="text-14-regular text-text-base opacity-0 group-hover:opacity-100 transition-opacity duration-200 pr-3 cursor-default">'),Sn=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">'),Cn=f('<span class="text-12-regular text-text-weak pl-8">');const $e="onescience",Dn=[{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=Pe(),e=ce(),l=De(),a=he(),u=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(`${l.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 u.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=u.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=>Dn.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)),M({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 l.client.auth.remove({providerID:v}).catch(()=>{}),await a.updateConfig({disabled_providers:U}),await l.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);M({title:e.t("common.requestFailed"),description:D})}return}await l.client.auth.remove({providerID:v}).then(async()=>{await l.client.global.dispose(),await a.reload(),M({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);M({title:e.t("common.requestFailed"),description:_})})};return(()=>{var v=wn(),p=v.firstChild,d=p.firstChild,_=d.firstChild,U=p.nextSibling,S=U.firstChild,D=S.firstChild,T=S.nextSibling,R=T.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=yn();return r(m,()=>e.t("settings.providers.connected.empty")),m})()},get children(){return t(oe,{get each(){return y()},children:m=>(()=>{var A=_n(),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(ge,{get children(){return C(m)}}),null),r(A,t(z,{get when(){return F(m)},get fallback(){return(()=>{var I=kn();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(T,t(H,{get children(){return[t(oe,{get each(){return k()},children:m=>(()=>{var A=Sn(),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(ge,{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(ge,{get children(){return e.t("dialog.provider.tag.recommended")}})}}),null),r(N,t(z,{get when(){return O(m.id)},children:c=>(()=>{var h=Cn();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=bn(),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(ge,{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(T,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=xn();return r(m,t(G,{size:"large",variant:"secondary",onClick:()=>n.show(()=>t(vn,{})),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">'),Pn=f('<span class="text-14-regular text-text-strong mt-1">"<!>"'),An=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]">'),En=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">'),Nn=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 Kn=n=>(()=>{var e=Ge(),l=e.firstChild;return r(l,()=>n.label),e})(),Fn=n=>(()=>{var e=Ge(),l=e.firstChild;return r(l,()=>n.message),r(e,t(z,{get when(){return n.filter},get children(){var a=Pn(),u=a.firstChild,s=u.nextSibling;return s.nextSibling,r(a,()=>n.filter,s),a}}),null),e})(),In=()=>{const n=ce(),e=xt(),l=Pe(),a=he(),u=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=An(),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(Te,{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(Kn,{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(Fn,{get message(){return n.t("dialog.model.empty")},get filter(){return s.filter()}})},get children(){return t(oe,{get each(){return s.grouped.latest},children:O=>(()=>{var j=En(),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(oe,{get each(){return O.items},children:p=>{const d={providerID:p.provider.id,modelID:p.id},_=u(p.provider.id);return(()=>{var U=Nn(),S=U.firstChild,D=S.firstChild,T=S.nextSibling;return r(D,()=>p.name),r(T,t(z,{when:_,get children(){return t(G,{size:"large",variant:"ghost",onClick:()=>l.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(T,t(B,{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 Ln=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 Un=n=>{const e=ce(),l=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=Ln(),u=a.firstChild,s=u.firstChild,b=s.firstChild,y=b.firstChild,k=b.nextSibling,x=k.firstChild,C=u.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,()=>l.version,null),a}}),t(V.Content,{value:"general",class:"no-scrollbar",get children(){return t(qt,{})}}),t(V.Content,{value:"shortcuts",class:"no-scrollbar",get children(){return t(cn,{})}}),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(In,{})}})]}})}})};export{Un as DialogSettings};
|