PageSourceSearch

https://veefriends.com/dist/SetAutomaticRecoveryScreen-D5x6hDUL-WP42X6LF.q9jj6gaca1.js

js veefriends.com collected 2026-09-25 14:38:05 UTC 4,765 bytes, 91 lines download raw bytes

1import {
2  LockClosedIcon_default
3} from "./chunk-Z2KGBNVP.js";
4import {
5  ExclamationTriangleIcon_default
6} from "./chunk-7XAQQ7SI.js";
7import {
8  t as t2
9} from "./chunk-2AZ2MWPL.js";
10import {
11  o
12} from "./chunk-737HLBXN.js";
13import {
14  t
15} from "./chunk-XKUWNRAU.js";
16import {
17  s,
18  y
19} from "./chunk-BI6FLLBF.js";
20import {
21  I,
22  M2 as M,
23  P2 as P,
24  dt,
25  g,
26  he,
27  require_lib,
28  v2 as v
29} from "./chunk-GW6OWVAS.js";
30import {
31  require_jsx_runtime
32} from "./chunk-V3VQYMUU.js";
33import "./chunk-F7LOI2M5.js";
34import "./chunk-FUATFXFK.js";
35import "./chunk-DRQXJS52.js";
36import "./chunk-EKGTQN7B.js";
37import "./chunk-57LJOLTQ.js";
38import "./chunk-QOAWOBZZ.js";
39import "./chunk-CXC3RFJP.js";
40import "./chunk-LOYGATPO.js";
41import "./chunk-MWZBDUVS.js";
42import "./chunk-IVTAVDWF.js";
43import {
44  require_react
45} from "./chunk-2TKNTQO7.js";
46import {
47  __toESM,
48  init_buffer_shim
49} from "./chunk-DMHST2WB.js";
50
51// ../node_modules/@privy-io/react-auth/dist/esm/SetAutomaticRecoveryScreen-D5x6hDUL.mjs
52init_buffer_shim();
53var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
54var import_react = __toESM(require_react(), 1);
55var import_react_device_detect = __toESM(require_lib(), 1);
56var g2 = /* @__PURE__ */ dt.div.withConfig({ displayName: "WithCircleBorder", componentId: "sc-e4fc5563-0" })(["&&{border-width:4px;}display:flex;justify-content:center;align-items:center;padding:1rem;aspect-ratio:1;border-style:solid;border-color:", ";border-radius:50%;"], ((e2) => e2.$color ?? "var(--privy-color-accent)"));
57var w = { component: () => {
58  let { user: p } = M(), { client: w2, walletProxy: j, refreshSessionAndUser: I2, closePrivyModal: b } = I(), x = P(), { entropyId: C, entropyIdVerifier: T } = x.data?.recoverWallet, [k, M2] = (0, import_react.useState)(false), [S, W] = (0, import_react.useState)(null), [A, P2] = (0, import_react.useState)(null);
59  function U() {
60    if (!k) {
61      if (A) return x.data?.setWalletPassword?.onFailure(A), void b();
62      if (!S) return x.data?.setWalletPassword?.onFailure(Error("User exited set recovery flow")), void b();
63    }
64  }
65  x.onUserCloseViaDialogOrKeybindRef.current = U;
66  let E = !(!k && !S);
67  return (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, A ? { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(y, { onClose: U }, "header"), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(g2, { $color: "var(--privy-color-error)", style: { alignSelf: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ExclamationTriangleIcon_default, { height: 38, width: 38, stroke: "var(--privy-color-error)" }) }
67), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(o, { style: { marginTop: "0.5rem" }, children: "Something went wrong" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(he, { style: { minHeight: "2rem" } }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(t, { onClick: () => P2(null), children: "Try again" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(s, {})] } : { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(y, { onClose: U }, "header"), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LockClosedIcon_default, { style: { width: "3rem", height: "3rem", alignSelf: "center" } }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(o, { style: { marginTop: "0.5rem" }, children: "Automatically secure your account" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(t2, { style: { marginTop: "1rem" }, children: "When you log into a new device, you\u2019ll only need to authenticate to access your account. Never get logged out if you forget your password." }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(he, { style: { minHeight: "2rem" } }
67), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(t, { loading: k, disabled: E, onClick: () => (async function() {
68    M2(true);
69    try {
70      let e2 = await w2.getAccessToken(), r2 = v(p, C);
71      if (!e2 || !j || !r2) return;
72      if (!(await j.setRecovery({ accessToken: e2, entropyId: C, entropyIdVerifier: T, existingRecoveryMethod: r2.recoveryMethod, recoveryMethod: "privy" })).entropyId) throw Error("Unable to set recovery on wallet");
73      let o3 = await I2();
74      if (!o3) throw Error("Unable to set recovery on wallet");
75      let t3 = v(o3, r2.address);
76      if (!t3) throw Error("Unabled to set recovery on wallet");
77      W(!!o3), setTimeout((() => {
78        x.data?.setWalletPassword?.onSuccess(t3), b();
79      }), g);
80    } catch (e2) {
81      P2(e2);
82    } finally {
83      M2(false);
84    }
85  })(), children: S ? "Success" : "Confirm" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(s, {})] });
86} };
87export {
88  w as SetAutomaticRecoveryScreen,
89  w as default
90};
91//# sourceMappingURL=SetAutomaticRecoveryScreen-D5x6hDUL-WP42X6LF.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.