(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[9689],{859689(__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__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{"default":()=>E});var e=__webpack_require__(860012);var t=__webpack_require__(48084);var a=__webpack_require__(107495);var r=__webpack_require__(171097);var s=__webpack_require__.n(r);var n=__webpack_require__(556734);var i=__webpack_require__(789292);var o=__webpack_require__(568894);var l=__webpack_require__(126528);var u=__webpack_require__(466770);var c=__webpack_require__(779865);var p=__webpack_require__(423533);var f=__webpack_require__(917214);var d=__webpack_require__(277315);var v=__webpack_require__(959588);var g=__webpack_require__(79222);var y=__webpack_require__(507475);var m=__webpack_require__(880909);var h=__webpack_require__(269243);var w=__webpack_require__(682988);var P=__webpack_require__(667855);let k=5*m.Z2;function E(){let r=(0,a.Zp)();let m=(0,t.wA)();let E=(0,f.P)();let S=E((0,d.vn)());let{trackEvent:T}=(0,e.useContext)(h.O2);let b=(0,t.d4)(P.NY0);let[C,_]=(0,e.useState)("");let[F,x]=(0,e.useState)(!1);let[D,O]=(0,e.useState)(!1);(0,e.useEffect)(()=>()=>{(0,d.B0)()},[]),(0,e.useEffect)(()=>{!b&&r(p.XR,{replace:!0})},[b,r]);let R=()=>{_(""),r(p.XR,{replace:!0})};let Z=async()=>{O(!0),x(!1);try{try{await (0,g.BEp)(C)}catch{x(!0);return}let t=Date.now();let a={verification_method:"password"};T({category:w.FZ.Settings,event:w.gP.PasskeyTurnOff,properties:{...a,status:"started"}});try{await (0,g.Vg1)(C),await (0,g.hmH)(m),T({category:w.FZ.Settings,event:w.gP.PasskeyTurnOff,properties:{...a,status:"completed",duration_ms:Date.now()-t}}),y.oR.success(e.createElement(y.pi,{title:E("passkeyTurnedOff",[S])}),{duration:k}),T({category:w.FZ.Settings,event:w.gP.SettingsUpdated,properties:{settings_group:"security_privacy",settings_type:"passkey",old_value:!0,new_value:!1}}),R()}catch(r){T({category:w.FZ.Settings,event:w.gP.PasskeyTurnOff,properties:{...a,status:"failed",duration_ms:Date.now()-t,reason:(0,v.y2)(r)}}),s().error("Passkey turn off with password verification failed after password was verified",r),y.oR.error(e.createElement(y.pi,{title:E("turnOffPasskeyFailed",[S])}),{duration:k}),R()}}finally{O(!1)}};return!b?null:(0,e.createElement(l.a,{flexDirection:n.uV.Column,justifyContent:n.TE.Start,alignItems:n.RE.Stretch,gap:6,padding:4,className:"h-full min-h-0"},e.createElement(l.a,{flexDirection:n.uV.Column,gap:6,justifyContent:n.TE.Between,asChild:!0,className:"min-h-0 shrink-0"},e.createElement("form",{onSubmit:e=>{e.preventDefault(),Z()}},e.createElement(c.YJ,{id:"turn-off-passkey-current-password",label:E("enterPasswordCurrent"),textFieldProps:{type:c.ux.Password},size:c.dY.Lg,labelProps:{marginBottom:1},inputProps:{autoFocus:!0,"data-testid":"turn-off-passkey-password-input"},value:C,error:F,helpText:F?E("unlockPageIncorrectPassword"):null,onChange:e=>{_(e.target.value),x(!1)}}),e.createElement(u.$,{type:"submit",variant:i.A.Primary,size:o.Mp.Lg,className:"w-full","data-testid":"turn-off-passkey-verify-continue-button",disabled:!C||D||F,isLoading:D},E("continue"))))))}}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()}}]);