import{s as o,u as f,o as h,q as I,p as x,d as w,l as d,k as l,j as e,P as y,I as j,T as a,t as c,B as R,h as S}from"./main-CiAhdYQG.js";import{I as q}from"./check-Cx46Fv0J.js";import{V as k,a as r}from"./VisualListItem-Dd-weqBc.js";import{B as u}from"./ButtonLink-kWcKQZoZ.js";import"./_commonjsHelpers-DaWZu8wl.js";/* empty css               */const v=l(`
  query CurrentViewer {
    viewer {
      __typename
      ... on Node {
        id
      }
    }
  }
`),C=I({queryKey:["currentViewer"],queryFn:({signal:n})=>d({query:v,signal:n})}),E=l(`
  mutation AllowCrossSigningReset($userId: ID!) {
    allowUserCrossSigningReset(input: { userId: $userId }) {
      user {
        id
      }
    }
  }
`);function b(){const{deepLink:n}=o.useSearch(),g=o.useNavigate(),{t:s}=f(),{data:{viewer:i}}=h(C);if(i.__typename!=="User")throw x();const _=i.id,t=w({mutationFn:async m=>d({query:E,variables:{userId:m}}),onSuccess:()=>{setTimeout(()=>{window.onAuthDone?window.onAuthDone():window.opener?.postMessage&&window.opener.postMessage("authDone","*")}),g({to:"/reset-cross-signing/success",replace:!0})}}),p=async()=>{t.mutate(_)};return e.jsxs(e.Fragment,{children:[e.jsx(y,{Icon:j,title:s("frontend.reset_cross_signing.heading"),invalid:!0}),e.jsx(a,{className:"text-center text-secondary",size:"md",children:s("frontend.reset_cross_signing.description")}),e.jsxs(k,{children:[e.jsx(r,{Icon:q,success:!0,children:s("frontend.reset_cross_signing.effect_list.positive_1")}),e.jsx(r,{Icon:c,children:s("frontend.reset_cross_signing.effect_list.neutral_1")}),e.jsx(r,{Icon:c,children:s("frontend.reset_cross_signing.effect_list.neutral_2")})]}),e.jsx(a,{className:"text-center",size:"md",weight:"semibold",children:s("frontend.reset_cross_signing.warning")}),e.jsxs(R,{kind:"primary",destructive:!0,disabled:t.isPending,onClick:p,children:[!!t.isPending&&e.jsx(S,{inline:!0}),s("frontend.reset_cross_signing.finish_reset")]}),n?e.jsx(u,{to:"/reset-cross-signing/cancelled",kind:"tertiary",replace:!0,children:s("action.cancel")}):e.jsx(u,{to:"/",kind:"tertiary",children:s("action.back")})]})}export{b as component};
//# sourceMappingURL=reset-cross-signing.index-d3QQKAON.js.map
