import{i as e,s as t,t as n}from"./graphql-Dsv3IYEA.js";import{n as r,t as i}from"./LoadingSpinner-B8ofpgbZ.js";import{t as a}from"./jsx-runtime-BKZ-v_4m.js";import{n as o}from"./not-found-i5RsCZif.js";import{t as s}from"./useTranslation-l30fIyqu.js";import{t as c}from"./Button-BIiT28Ux.js";import{t as l}from"./error-solid-bRl8FwTZ.js";import{n as u,t as d}from"./VisualListItem-BzjEwNBe.js";import{F as f,H as p,O as m,T as h,W as g,w as _}from"./main-CxGi0fIe.js";import{t as v}from"./ButtonLink-BcHfDxZ3.js";var y=a(),b=e(`
  mutation AllowCrossSigningReset($userId: ID!) {
    allowUserCrossSigningReset(input: { userId: $userId }) {
      user {
        id
      }
    }
  }
`);function x(){let{deepLink:e}=_.useSearch(),a=_.useNavigate(),{t:x}=s(),{data:{viewer:S}}=t(h);if(S.__typename!==`User`)throw o();let C=S.id,w=r({mutationFn:async e=>n({query:b,variables:{userId:e}}),onSuccess:()=>{setTimeout(()=>{window.onAuthDone?window.onAuthDone():window.opener?.postMessage&&window.opener.postMessage(`authDone`,`*`)}),a({to:`/reset-cross-signing/success`,replace:!0})}});return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(m,{Icon:l,title:x(`frontend.reset_cross_signing.heading`),invalid:!0}),(0,y.jsx)(g,{className:`text-center text-secondary`,size:`md`,children:x(`frontend.reset_cross_signing.description`)}),(0,y.jsxs)(u,{children:[(0,y.jsx)(d,{Icon:f,success:!0,children:x(`frontend.reset_cross_signing.effect_list.positive_1`)}),(0,y.jsx)(d,{Icon:p,children:x(`frontend.reset_cross_signing.effect_list.neutral_1`)}),(0,y.jsx)(d,{Icon:p,children:x(`frontend.reset_cross_signing.effect_list.neutral_2`)})]}),(0,y.jsx)(g,{className:`text-center`,size:`md`,weight:`semibold`,children:x(`frontend.reset_cross_signing.warning`)}),(0,y.jsxs)(c,{kind:`primary`,destructive:!0,disabled:w.isPending,onClick:async()=>{w.mutate(C)},children:[!!w.isPending&&(0,y.jsx)(i,{inline:!0}),x(`frontend.reset_cross_signing.finish_reset`)]}),e?(0,y.jsx)(v,{to:`/reset-cross-signing/cancelled`,kind:`tertiary`,replace:!0,children:x(`action.cancel`)}):(0,y.jsx)(v,{to:`/`,kind:`tertiary`,children:x(`action.back`)})]})}export{x as component};
//# sourceMappingURL=reset-cross-signing.index-COzSiWRu.js.map