import{r as s,j as a}from"./globals-BRZwPAPF.js";import{u as h,C as x,S as j,F as n,T as p}from"./preferences-BKv6X7fK.js";/* empty css              */import"./useDesktopBridge-DxVWbYqK.js";function E({bridge:l,snapshot:r,onSnapshotChanged:i,pushToast:t}){const{t:e}=h("preferences"),y=!l.available,v=(r==null?void 0:r.privacy.telemetryEnabled)??!1,m=(r==null?void 0:r.privacy.crashReportingEnabled)??!1,o=s.useCallback(async(c,d,g)=>{try{await l.setSetting(c,d),await i()}catch{t({message:`Couldn't update ${g}.`,variant:"error"})}},[l,i,t]),b=s.useCallback(async()=>{try{await l.openLogsFolder()}catch{t({message:"Couldn't open logs folder.",variant:"error"})}},[l,t]);return a.jsxs(a.Fragment,{children:[a.jsxs("header",{className:"preferences-content__heading",children:[a.jsx("h1",{children:e("privacy.heading")}),a.jsx("p",{children:e("privacy.subheading")})]}),a.jsx(x,{variant:"info",children:e("privacy.disclosure")}),a.jsxs(j,{title:e("privacy.heading"),children:[a.jsx(n,{label:e("privacy.telemetry.label"),help:e("privacy.telemetry.help"),control:a.jsx(p,{ariaLabel:e("privacy.telemetry.label"),checked:v,onChange:c=>o("privacy.telemetryEnabled",c,"telemetry")})}),a.jsx(n,{label:e("privacy.crash.label"),help:e("privacy.crash.help"),control:a.jsx(p,{ariaLabel:e("privacy.crash.label"),checked:m,onChange:c=>o("privacy.crashReportingEnabled",c,"crash reporting")})}),y?null:a.jsx(n,{label:e("privacy.openLogs.label"),help:e("privacy.openLogs.help"),control:a.jsx("button",{type:"button",className:"pref-button",onClick:b,children:e("privacy.openLogs.label")})})]})]})}export{E as PrivacyTab};
