PageSourceSearch

https://magic.af/CoinbaseOnrampStatusScreen-Bu2rkOnQ-YJFQI5JC.js

js magic.af collected 2026-10-07 17:51:12 UTC 6,165 bytes, 126 lines download raw bytes

1import {
2  ArrowsRightLeftIcon_default
3} from "./chunk-QNXGPUOH.js";
4import {
5  CheckCircleIcon_default
6} from "./chunk-DAAMU57Q.js";
7import {
8  t
9} from "./chunk-WJTHUMIQ.js";
10import {
11  a
12} from "./chunk-COQ5KDFA.js";
13import {
14  bt
15} from "./chunk-HGDK5Q2C.js";
16import "./chunk-OVN5HUR5.js";
17import "./chunk-OTHATL7L.js";
18import {
19  g
20} from "./chunk-F2OYRDGK.js";
21import {
22  T,
23  m,
24  u
25} from "./chunk-UL52HBKA.js";
26import {
27  P2 as P,
28  R2 as R,
29  gt,
30  l,
31  require_lib
32} from "./chunk-I4QQ47H5.js";
33import "./chunk-3G3D2VCC.js";
34import "./chunk-256YLKEK.js";
35import "./chunk-JT37I2FE.js";
36import "./chunk-IJXD3LKC.js";
37import "./chunk-2P44GIBZ.js";
38import "./chunk-JY4L4TVN.js";
39import {
40  require_jsx_runtime,
41  require_react
42} from "./chunk-MUQC47WX.js";
43import "./chunk-5JRGJGLK.js";
44import "./chunk-RHWM2WTS.js";
45import "./chunk-M4LWCW24.js";
46import "./chunk-KBR6YQG7.js";
47import "./chunk-OZF4C3W7.js";
48import "./chunk-Z3WEDMX4.js";
49import "./chunk-M6NCLRUY.js";
50import "./chunk-XYPPA4CO.js";
51import "./chunk-BFKH7XNT.js";
52import {
53  __toESM
54} from "./chunk-FOQIPI7F.js";
55
56// node_modules/@privy-io/react-auth/dist/esm/CoinbaseOnrampStatusScreen-Bu2rkOnQ.mjs
57var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
58var import_react = __toESM(require_react(), 1);
59var import_react_device_detect = __toESM(require_lib(), 1);
60var w = { component: () => {
61  let { data: o, setModalData: i, navigate: c2, navigateBack: m2 } = g(), { closePrivyModal: u2, createAnalyticsEvent: p, client: g2 } = l(), [f, j] = (0, import_react.useState)("pending-in-flow"), w2 = (0, import_react.useRef)(0), C2 = { ...o?.funding, showAlternateFundingMethod: true };
62  C2.usingDefaultFundingMethod && (C2.usingDefaultFundingMethod = false);
63  let { partnerUserId: k2, popup: x2 } = o?.coinbaseOnrampStatus ?? {};
64  return (0, import_react.useEffect)(() => {
65    if ("pending-in-flow" === f || "pending-after-flow" === f) {
66      let e2 = setInterval(async () => {
67        if (k2) try {
68          let { status: e3 } = await g2.getCoinbaseOnRampStatus({ partnerUserId: k2 });
69          if ("success" === e3) return void j("success");
70          if ("failure" === e3) throw Error("There was an error completing Coinbase Onramp flow.");
71          if (w2.current >= 3) return i({ funding: C2, solanaFundingData: o?.solanaFundingData }), void c2("FundingMethodSelectionScreen");
72          x2?.closed && (w2.current = w2.current + 1, j("pending-after-flow"));
73        } catch (e3) {
74          console.error(e3), j("error"), p({ eventName: t, payload: { status: "failure", provider: "coinbase-onramp", error: e3.message } }), i({ funding: { ...C2, errorMessage: "Something went wrong adding funds. Please try again or use another method." }, solanaFundingData: o?.solanaFundingData }), c2("FundingMethodSelectionScreen");
75        }
76      }, 1500);
77      return () => clearInterval(e2);
78    }
79  }
79, [k2, x2, f]), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(T, { title: "Fund account", backFn: () => {
80    i({ funding: C2, solanaFundingData: o?.solanaFundingData }), m2();
81  } }, "header"), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(b, { status: f, onClickCta: u2 }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(u, {})] });
82} };
83var b = ({ status: o, onClickCta: i }) => {
84  let { title: n2, body: a3, cta: s2 } = (0, import_react.useMemo)(() => ((e2) => {
85    switch (e2) {
86      case "success":
87        return { title: "You've funded your account!", body: "It may take a few minutes for the assets to appear.", cta: "Continue" };
88      case "pending-after-flow":
89        return { title: "In Progress", body: "Almost done. Retrieving transaction status from Coinbase", cta: "" };
90      case "error":
91      case "pending-in-flow":
92        return { title: "In Progress", body: "Go back to Coinbase Onramp to finish funding your account.", cta: "" };
93    }
94  })(o), [o]);
95  return (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(x, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(C, { isSucccess: "success" === o }
95), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(a, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { children: n2 }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(k, { children: a3 })] })] }), s2 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(m, { onClick: i, children: s2 })] });
96};
97var C = ({ isSucccess: r2 }) => {
98  if (!r2) {
99    let r3 = "var(--privy-color-foreground-4)";
100    return (0, import_jsx_runtime.jsxs)("div", { style: { position: "relative" }, children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(P, { color: r3, style: { position: "absolute" } }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(R, { color: r3 }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(bt, { style: { position: "absolute", width: "2.8rem", height: "2.8rem", top: "1.2rem", left: "1.2rem" } })] });
101  }
102  let n2 = r2 ? CheckCircleIcon_default : () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ArrowsRightLeftIcon_default, { width: "3rem", height: "3rem", style: { backgroundColor: "var(--privy-color-foreground-4)", color: "var(--privy-color-background)", borderRadius: "100%", padding: "0.5rem", margin: "0.5rem" } }), a3 = r2 ? "var(--privy-color-success)" : "var(--privy-color-foreground-4)";
103  return (0, import_jsx_runtime.jsx)("div", { style: { borderColor: a3, display: "flex", justifyContent: "center", alignItems: "center", borderRadius: "100%", borderWidth: 2, padding: "0.5rem", marginBottom: "0.5rem" }, children: n2 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(n2, { width: "4rem", height: "4rem", color: a3 }) });
104};
105var k = gt.p`
106  font-size: 1rem;
107  color: var(--privy-color-foreground-3);
108  margin-bottom: 1rem;
109  display: flex;
110  flex-direction: column;
111  gap: 1rem;
112`;
113var x = gt.div`
114  display: flex;
115  flex-direction: column;
116  align-items: center;
117  justify-content: center;
118  margin-left: 1.75rem;
119  margin-right: 1.75rem;
120  padding: 2rem 0;
121`;
122export {
123  w as CoinbaseOnrampStatusScreen,
124  w as default
125};
126//# sourceMappingURL=CoinbaseOnrampStatusScreen-Bu2rkOnQ-YJFQI5JC.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.