import{o as e}from"./rolldown-runtime-iuO8RvI4.js";import{Ll as s,Ou as a}from"./shared-0-C4kdVF7Y.js";import{Mi as o,ki as t}from"./vendor-frame-CwiylG4Y.js";import{Mh as n,cu as r}from"./shared-1-3-6x7RKF.js";import{nn as i,rn as d}from"./vendor-all-2-BJdkbLSj.js";import{u as l}from"./shared-frame-DbQbH4Yr.js";import{Bo as c,Xo as m,qo as u}from"./shared-5-UQAFGbWu.js";import{Bn as h}from"./shared-14-BNdP3DJt.js";import{n as g,t as f}from"./c512c69e9-BXZe6S9Y.js";var x=e(o()),b=t();function p(){const e=c(),o=d(),{addError:t,addSuccess:p}=n(),{account:j}=s(),{mutate:C,isPending:_}=r({noToast:!0}),w=j?.settings?.browser_extension_settings??null,k=w?.enabled??!0,y=(0,x.useCallback)(()=>{p(o.formatMessage({defaultMessage:"Browser extension settings updated.",id:"oS/4HJ8Uak"}))},[p,o]),M=(0,x.useCallback)(e=>{t(o.formatMessage({defaultMessage:"Couldn\u2019t update browser extension settings. Try again.",id:"qZU4B58VnE"}),{error:e,messageForLogging:"Failed to update browser extension settings."})},[t,o]),E=(0,x.useCallback)(e=>{C({browser_extension_settings:{enabled:e,default_domain_policy:w?.default_domain_policy??"allow",allowed_domains:w?.allowed_domains??[],blocked_domains:w?.blocked_domains??[]}},{onSuccess:y,onError:M})},[w,C,y,M]),S=(0,x.useCallback)((e,s)=>C({browser_extension_settings:{...e,enabled:k}},s),[C,k]);return e||a(),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(u,{children:(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)(g,{size:60,className:"text-text-100"}),(0,b.jsxs)("h3",{className:"flex items-center gap-2 text-heading-semibold text-primary",children:[(0,b.jsx)(i,{defaultMessage:"Claude in Chrome settings",id:"yErZtfhr71",description:"\u2018Claude in Chrome\u2019 is a product name; keep it in English and translate only the word \u2018settings\u2019."}),(0,b.jsx)(h,{launchStatus:"public_beta"})]})]})}),(0,b.jsx)(u,{children:(0,b.jsx)(m,{label:(0,b.jsx)(i,{defaultMessage:"Enable Claude in Chrome",id:"EfRYoO/hux"}),description:(0,b.jsx)(i,{defaultMessage:"Use Claude in your browser with the Claude in Chrome extension. This setting only affects the extension.",id:"sTFZ+3/o6R"}),control:e=>(0,b.jsx)(l,{checked:k,onCheckedChange:E,disabled:_,"aria-labelledby":e.labelId,"aria-describedby":e.descriptionId})})}),(0,b.jsx)(f,{settings:w,onSave:S,isPending:_,showSharedSurfacesNote:!0,productName:"Claude"})]})}export{p as default,c as useShowBrowserExtensionPageInPersonalSettings};