(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[5151],{15151(__unused_webpack_module,__webpack_exports__,__webpack_require__){(function(){if(!this.ST)return()=>{};with(this.ST)with(this.RH)with(this.G)return function(){"use strict";__webpack_require__.d(__webpack_exports__,{T:()=>w});var t=__webpack_require__(303280);__webpack_require__.n(t);var e=__webpack_require__(860012);var a=__webpack_require__(48084);var n=__webpack_require__(408685);var i=__webpack_require__(848574);var r=__webpack_require__(556734);var c=__webpack_require__(126528);var l=__webpack_require__(68940);var o=__webpack_require__(917214);var s=__webpack_require__(269243);var d=__webpack_require__(199448);var g=__webpack_require__(682988);var u=__webpack_require__(378831);var v=__webpack_require__(184899);var y=__webpack_require__(143195);var p=__webpack_require__(79222);var m=__webpack_require__(499749);var f=__webpack_require__(626481);var E=__webpack_require__(667855);var _=__webpack_require__(559167);let w=()=>{let w=(0,t.c)(46);let{trackEvent:S}=(0,e.useContext)(s.O2);let b=(0,o.P)();let h=(0,a.wA)();let{setIsBackupAndSyncFeatureEnabled:k,error:T}=(0,d.e)();let A=(0,a.d4)(E.$lR);let B=(0,a.d4)(E.IiS);let R=(0,a.d4)(v.Qz);let C=(0,a.d4)(v.Qy);let I=(0,a.d4)(y.JU);let M;w[0]!==R||w[1]!==I||w[2]!==S?(M=t=>{S({category:g.FZ.Settings,event:g.gP.SettingsUpdated,properties:{settings_group:"backup_and_sync",settings_type:"main",old_value:R,new_value:t,was_notifications_on:I}})},w[0]=R,w[1]=I,w[2]=S,w[3]=M):M=w[3];let J=M;let L;let P;w[4]!==R||w[5]!==A||w[6]!==B||w[7]!==k?(L=()=>{(A===!1||B===!1)&&R&&(async()=>{try{await k(n.f.main,!1),await k(n.f.accountSyncing,!1),await k(n.f.contactSyncing,!1)}catch(t){console.error("Failed to disable backup and sync features:",t)}})()},P=[A,B,R,k],w[4]=R,w[5]=A,w[6]=B,w[7]=k,w[8]=L,w[9]=P):(L=w[8],P=w[9]),(0,e.useEffect)(L,P);let x;w[10]!==h||w[11]!==R||w[12]!==A||w[13]!==B||w[14]!==k||w[15]!==J?(x=async()=>{R?(J(!1),await k(n.f.main,!1),await k(n.f.accountSyncing,!1),await k(n.f.contactSyncing,!1)):(J(!0),A===!1||B===!1?h((0,p.toY)({name:_.Md,enableBackupAndSync:async()=>{await k(n.f.main,!0),await k(n.f.accountSyncing,!0),await k(n.f.contactSyncing,!0)}})):(await k(n.f.main,!0),await k(n.f.accountSyncing,!0),await k(n.f.contactSyncing,!0)))},w[10]=h,w[11]=R,w[12]=A,w[13]=B,w[14]=k,w[15]=J,w[16]=x):x=w[16];let D=x;let F;w[17]!==b?(F=b("backupAndSyncEnable"),w[17]=b,w[18]=F):F=w[18];let N;w[19]!==F?(N=e.createElement(l.E,{variant:i.J3.BodyMd,fontWeight:i.IT.Medium},F),w[19]=F,w[20]=N):N=w[20];let $;w[21]!==D||w[22]!==R||w[23]!==C?($=C?e.createElement(c.a,{paddingLeft:5,paddingRight:5},e.createElement(f.A,{size:36})):e.createElement("div",{className:"privacy-settings__setting__toggle","data-testid":"backup-and-sync-toggle-container"},e.createElement(m.A,{value:R,onToggle:D,dataTestId:"backup-and-sync-toggle-button"})),w[21]=D,w[22]=R,w[23]=C,w[24]=$):$=w[24];let z;w[25]!==N||w[26]!==$?(z=e.createElement(c.a,{flexDirection:r.uV.Row,justifyContent:r.TE.Between,alignItems:r.RE.Start,marginBottom:1},N,$),w[25]=N,w[26]=$,w[27]=z):z=w[27];let O;w[28]!==b?(O=b("backupAndSyncPrivacyLink"),w[28]=b,w[29]=O):O=w[29];let Q;w[30]!==O?(Q=e.createElement(l.E,{asChild:!0,variant:i.J3.BodyMd,key:"privacy-link",color:i.r7.InfoDefault},e.createElement("a",{href:u.A.PROFILE_PRIVACY,target:"_blank",rel:"noopener noreferrer"},O)),w[30]=O,w[31]=Q):Q=w[31];let U;w[32]!==b||w[33]!==Q?(U=b("backupAndSyncEnableDescription",[Q]),w[32]=b,w[33]=Q,w[34]=U):U=w[34];let V;w[35]!==U?(V=e.createElement(l.E,{variant:i.J3.BodyMd,color:i.r7.TextAlternative,asChild:!0},e.createElement("div",null,U)),w[35]=U,w[36]=V):V=w[36];let Y;w[37]!==T||w[38]!==b?(Y=T&&e.createElement(c.a,{marginTop:4,paddingBottom:4},e.createElement(l.E,{color:i.r7.ErrorDefault,variant:i.J3.BodySm},b("notificationsSettingsBoxError"))),w[37]=T,w[38]=b,w[39]=Y):Y=w[39];let j;w[40]!==V||w[41]!==Y?(j=e.createElement("div",{className:"privacy-settings__setting__description"},V,Y),w[40]=V,w[41]=Y,w[42]=j):j=w[42];let G;return w[43]!==j||w[44]!==z?(G=e.createElement(c.a,{marginTop:4,marginBottom:4,paddingLeft:4,paddingRight:4,className:"privacy-settings__setting__wrapper",id:"backup-and-sync-toggle","data-testid":"backup-and-sync-container"},z,j),w[43]=j,w[44]=z,w[45]=G):G=w[45],G}}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()}}]);