import{n as e}from"./rolldown-runtime-BG2f4sTM.js";import{$ct as t,$r as n,Dvt as r,H9 as i,Jtt as a,MM as o,Mft as s,Mvt as c,N_t as l,O_t as u,Qr as d,Rft as f,Vft as p,W9 as m,Wft as h,Xw as g,Yet as _,Yw as v,Zct as y,Ztt as b,idt as x,iz as S,jM as C,jft as w,rdt as T,rz as E,ztt as D}from"./app-initial-BHB6SClA.js";import{a as O,i as k,n as A,o as j,r as M,s as N,t as P}from"./use-visible-settings-sections-Bv4VQBqG.js";function F(e){let n=(0,z.c)(8),{close:r,isSelectedHostLocal:i,selectedHostId:a}=e,o=t(O),{visibleSettingsSections:s}=A(null,i,a),c;n[0]===s?c=n[1]:(c=s.filter(I),n[0]=s,n[1]=c);let l=c;if(l.length===0)return null;let u;n[2]===o?u=n[3]:(u=[j.account,...o?[j.securitySettings]:[]],n[2]=o,n[3]=u);let d;return n[4]!==r||n[5]!==l||n[6]!==u?(d=(0,B.jsx)(L,{close:r,externalItems:u,settingsSections:l}),n[4]=r,n[5]=l,n[6]=u,n[7]=d):d=n[7],d}function I(e){return!e.disabled}function L(e){let t=(0,z.c)(17),{close:n,externalItems:r,settingsSections:i}=e,a=h(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,B.jsx)(`span`,{className:`block px-2 pt-2 text-sm text-token-description-foreground`,children:(0,B.jsx)(p,{id:`codex.commandMenu.settingsGroup`,defaultMessage:`Settings`,description:`Command group label for settings sections in the command menu`})}),t[0]=o):o=t[0];let s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s={gap:`var(--spacing)`},t[1]=s):s=t[1];let c;if(t[2]!==n||t[3]!==i){let e;t[5]===n?e=t[6]:(e=e=>(0,B.jsx)(R,{close:n,section:e},e.slug),t[5]=n,t[6]=e),c=i.map(e),t[2]=n,t[3]=i,t[4]=c}else c=t[4];let l;if(t[7]!==n||t[8]!==r||t[9]!==a){let e;t[11]!==n||t[12]!==a?(e=e=>{let t=a.formatMessage(e.message);return(0,B.jsx)(v,{value:`settings ${t}`,title:t,LeftIcon:e.icon,RightIcon:E,onSelect:()=>{b({href:e.href,initiator:`open_in_browser_bridge`,openTarget:`external-browser`}),n()}},e.href)},t[11]=n,t[12]=a,t[13]=e):e=t[13],l=r.map(e),t[7]=n,t[8]=r,t[9]=a,t[10]=l}else l=t[10];let u;return t[14]!==c||t[15]!==l?(u=(0,B.jsxs)(C.Group,{heading:o,className:`flex flex-col`,style:s,children:[c,l]}),t[14]=c,t[15]=l,t[16]=u):u=t[16],u}function R(e){let t=(0,z.c)(14),{close:n,section:r}=e,i=l(w),a=h(),o;t[0]!==a||t[1]!==r.slug?(o=a.formatMessage(d(r.slug)),t[0]=a,t[1]=r.slug,t[2]=o):o=t[2];let s=o,c=`settings ${s}${r.slug===`mcp-settings`?` mcp settings`:r.slug===`personalization`?` personality tone`:``}`,u=M[r.slug],f=r.externalUrl==null?void 0:E,p;t[3]!==n||t[4]!==i||t[5]!==r.externalUrl||t[6]!==r.slug?(p=()=>{r.externalUrl==null?(r.slug===`profile`&&m(i,_,{source:`command_menu`}),x.dispatchHostMessage({type:`navigate-to-route`,path:`/settings/${r.slug}`})):b({href:r.externalUrl,initiator:`open_in_browser_bridge`}),n()},t[3]=n,t[4]=i,t[5]=r.externalUrl,t[6]=r.slug,t[7]=p):p=t[7];let g;return t[8]!==c||t[9]!==u||t[10]!==f||t[11]!==p||t[12]!==s?(g=(0,B.jsx)(v,{value:c,title:s,LeftIcon:u,RightIcon:f,onSelect:p}),t[8]=c,t[9]=u,t[10]=f,t[11]=p,t[12]=s,t[13]=g):g=t[13],g}var z,B;e((()=>{z=c(),D(),o(),u(),f(),a(),g(),S(),T(),i(),s(),N(),k(),n(),P(),y(),B=r()}))();export{F as VisibleSettingsCommandMenuSectionItems};
//# sourceMappingURL=settings-command-menu-section-items-DuQSrP5l.js.map