import"./src-BOCweS1p.js";import{t as e}from"./jsx-runtime-CiQ1k8xo.js";import{I as t,a as n,h as r,lt as i,u as a}from"./vscode-api-DjORcpSo.js";import{o}from"./lib-MoKmYgcO.js";import{f as s,m as c}from"./chunk-LFPYN7LY-PMGLV5Go.js";import{t as l}from"./button-Bi7lGVi1.js";import"./setting-storage-CwKZnsvR.js";import"./reduced-motion-preference-Bd5_3c7y.js";import"./spinner-BAEL5-Nn.js";import{t as u}from"./arrow-left-Cy8P3y0C.js";import{t as d}from"./settings-content-layout-Dm8iYKt_.js";import{n as f,t as p}from"./settings-group-sezdm9FP.js";var m=i(),h=e(),g=n(r,`third-party-notices`,{enabled:!0,staleTime:a.ONE_MINUTE});function _(){let e=(0,m.c)(18),n=c(),r=s(),i;e[0]===r.state?i=e[1]:(i=v(r.state),e[0]=r.state,e[1]=i);let a=i,_=r.state!=null&&typeof r.state==`object`&&!Array.isArray(r.state)?r.state:null,{data:y,isLoading:b}=t(g),x;e[2]!==a||e[3]!==_||e[4]!==n?(x=()=>{n(a,{replace:!0,state:_})},e[2]=a,e[3]=_,e[4]=n,e[5]=x):x=e[5];let S,C;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,h.jsx)(u,{className:`icon-xs`}),C=(0,h.jsx)(o,{id:`settings.openSourceLicenses.back`,defaultMessage:`Back`,description:`Button label to go back to the main settings page`}),e[6]=S,e[7]=C):(S=e[6],C=e[7]);let w;e[8]===x?w=e[9]:(w=(0,h.jsxs)(l,{color:`ghost`,size:`toolbar`,onClick:x,children:[S,C]}),e[8]=x,e[9]=w);let T,E;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,h.jsx)(o,{id:`settings.openSourceLicenses.title`,defaultMessage:`Open source licenses`,description:`Title for the open source licenses settings page`}),E=(0,h.jsx)(o,{id:`settings.openSourceLicenses.subtitle`,defaultMessage:`Third-party notices for dependencies included in this app`,description:`Subtitle for the open source licenses settings page`}),e[10]=T,e[11]=E):(T=e[10],E=e[11]);let D;e[12]!==y||e[13]!==b?(D=(0,h.jsx)(p,{children:(0,h.jsx)(p.Content,{children:(0,h.jsx)(f,{children:b?(0,h.jsx)(`div`,{className:`text-sm text-token-text-secondary`,children:(0,h.jsx)(o,{id:`settings.openSourceLicenses.loading`,defaultMessage:`Loading…`,description:`Loading label while fetching third-party notices`})}):y?.text?(0,h.jsx)(`pre`,{className:`bg-token-surface-secondary rounded p-3 text-xs leading-relaxed break-words whitespace-pre-wrap text-token-text-primary`,children:y.text}):(0,h.jsx)(`div`,{className:`text-sm text-token-text-secondary`,children:(0,h.jsx)(o,{id:`settings.openSourceLicenses.missing`,defaultMessage:`No third-party notices were found.`,description:`Message shown when the third-party notices file is missing`})})})})}),e[12]=y,e[13]=b,e[14]=D):D=e[14];let O;return e[15]!==w||e[16]!==D?(O=(0,h.jsx)(d,{backSlot:w,title:T,subtitle:E,children:D}),e[15]=w,e[16]=D,e[17]=O):O=e[17],O}function v(e){if(typeof e==`object`&&e&&!Array.isArray(e)&&`licensesBackPath`in e){let t=e.licensesBackPath;if(typeof t==`string`&&t.startsWith(`/settings/`))return t}return`/settings/general`}export{_ as OpenSourceLicensesPage};
//# sourceMappingURL=open-source-licenses-page-CAQSTDqO.js.map