@directcryptopay/sdk 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/dist/ExchangeController-CPMQq6Q-.js +217 -0
  2. package/dist/HelpersUtil-DfMFC7Bf.js +120 -0
  3. package/dist/NavigationUtil-kj9LEOOd.js +8 -0
  4. package/dist/PhArrowCircleDown-lsK25DCk.js +73 -0
  5. package/dist/PhArrowClockwise-NeKHZ1co.js +73 -0
  6. package/dist/PhArrowDown-C9AkNvLs.js +73 -0
  7. package/dist/PhArrowLeft-RNfIQP1X.js +73 -0
  8. package/dist/PhArrowRight-DM1tna0G.js +73 -0
  9. package/dist/PhArrowSquareOut-S5XYbAZj.js +73 -0
  10. package/dist/PhArrowUp-DmktzOWy.js +73 -0
  11. package/dist/PhArrowUpRight-BkNeW_5i.js +73 -0
  12. package/dist/PhArrowsClockwise-CQ4pG76b.js +73 -0
  13. package/dist/PhArrowsDownUp-H6gxaNM6.js +73 -0
  14. package/dist/PhArrowsLeftRight-DZSsfMR6.js +73 -0
  15. package/dist/PhBank-4_9QzqIB.js +73 -0
  16. package/dist/PhBrowser-B-JSznId.js +73 -0
  17. package/dist/PhCaretDown-vV5oHMNi.js +73 -0
  18. package/dist/PhCaretLeft-BLo6Y_f4.js +73 -0
  19. package/dist/PhCaretRight-CqQN4TT3.js +73 -0
  20. package/dist/PhCaretUp-Df7UCAHy.js +73 -0
  21. package/dist/PhCheck-gtpfK4ed.js +73 -0
  22. package/dist/PhCircleHalf-Uq7dwDYw.js +73 -0
  23. package/dist/PhClock-SDCW-NmF.js +73 -0
  24. package/dist/PhCompass-B7hgtdx-.js +73 -0
  25. package/dist/PhCopy-BcnhyXCy.js +73 -0
  26. package/dist/PhCreditCard-BJjByVgu.js +73 -0
  27. package/dist/PhCurrencyDollar-B7ZXqXBy.js +73 -0
  28. package/dist/PhDesktop-B3VKPuJx.js +73 -0
  29. package/dist/PhDeviceMobile-Bnd0TYEH.js +73 -0
  30. package/dist/PhDotsThree-yyMWyZ-R.js +73 -0
  31. package/dist/PhEnvelope-67uzHbI9.js +73 -0
  32. package/dist/PhFunnelSimple-B-DCsloI.js +73 -0
  33. package/dist/PhGlobe-TMm_6qGk.js +73 -0
  34. package/dist/PhIdentificationCard-CePPD2xc.js +73 -0
  35. package/dist/PhImage-gY96WtHR.js +73 -0
  36. package/dist/PhInfo-DRQM_ZDP.js +73 -0
  37. package/dist/PhLightbulb-B0TxPfZ1.js +73 -0
  38. package/dist/PhMagnifyingGlass-B8si5_6W.js +73 -0
  39. package/dist/PhPaperPlaneRight-DVu5PLYd.js +73 -0
  40. package/dist/PhPlus-BfTsQnUz.js +73 -0
  41. package/dist/PhPower-CxYUGOWn.js +73 -0
  42. package/dist/PhPuzzlePiece-CQ4wh0gV.js +73 -0
  43. package/dist/PhQrCode-BuJ97NYJ.js +73 -0
  44. package/dist/PhQuestion-kJoP8Mja.js +73 -0
  45. package/dist/PhQuestionMark-C46ZkFpu.js +73 -0
  46. package/dist/PhSealCheck-Eh8jVqSN.js +73 -0
  47. package/dist/PhSignOut-jk97OSVt.js +73 -0
  48. package/dist/PhSpinner-CiYOhwMg.js +73 -0
  49. package/dist/PhTrash-pxerMqzd.js +73 -0
  50. package/dist/PhUser-BMg0VV4A.js +73 -0
  51. package/dist/PhVault-DYQvx5A-.js +73 -0
  52. package/dist/PhWarning-NLC5Mj87.js +73 -0
  53. package/dist/PhWarningCircle-Ch2jU9fA.js +73 -0
  54. package/dist/PhX-Bx4wpwm3.js +73 -0
  55. package/dist/SwapController-Cti0Cyxa.js +457 -0
  56. package/dist/{ccip-BIGqktC1.js → ccip-CKZd2XJ7.js} +4 -4
  57. package/dist/data-capture-7D5CL385.js +490 -0
  58. package/dist/dcp-sdk.umd.js +7400 -6589
  59. package/dist/email-AmK0INbZ.js +344 -0
  60. package/dist/embedded-wallet-Pn0I_XLn.js +820 -0
  61. package/dist/features-x8XNprEe.js +274 -0
  62. package/dist/{hashTypedData-ZH9ZnWu3.js → hashTypedData-B50-z0AA.js} +6 -6
  63. package/dist/if-defined-CdZSZ6UL.js +10 -0
  64. package/dist/index-4ewUtPPp.js +7981 -0
  65. package/dist/{index-D6h-qfpt.js → index-51l86yqx.js} +5 -5
  66. package/dist/index-B6K56LF_.js +85 -0
  67. package/dist/index-BAmv9PxJ.js +257 -0
  68. package/dist/index-BEswjY9r.js +117 -0
  69. package/dist/index-BSKRq56S.js +355 -0
  70. package/dist/index-BaygXQxx.js +172 -0
  71. package/dist/index-BcPxaHr5.js +118 -0
  72. package/dist/index-Bjt7nGaJ.js +199 -0
  73. package/dist/{index-D5r0iSq4.js → index-BkTSyAJb.js} +1 -1
  74. package/dist/index-Bmnl7l2U.js +555 -0
  75. package/dist/index-BvPvouSq.js +56 -0
  76. package/dist/index-C-6iznUO.js +174 -0
  77. package/dist/index-C4M5s_AM.js +228 -0
  78. package/dist/index-CEqcN8QP.js +1175 -0
  79. package/dist/{index-CPTcEPbD.js → index-CM3YaYca.js} +296 -298
  80. package/dist/{index-f3LXSfM5.js → index-CclBLA5r.js} +56 -142
  81. package/dist/index-ChTxJOiF.js +46 -0
  82. package/dist/index-CmAv0Tzr.js +86 -0
  83. package/dist/index-CmvoKY4x.js +125 -0
  84. package/dist/{index-BdSIrl-R.js → index-D7PmdQ9B.js} +578 -570
  85. package/dist/{index-DobBVPe4.js → index-D7k2Pc4e.js} +481 -236
  86. package/dist/index-D7lmgqUR.js +153 -0
  87. package/dist/index-DG_-qYze.js +107 -0
  88. package/dist/{index-Dy4NyE6l.js → index-DHot9Fdb.js} +7 -7
  89. package/dist/index-DV2LrPtU.js +123 -0
  90. package/dist/index-DYBaJQ2W.js +65 -0
  91. package/dist/{index-BJ7cbG3N.js → index-D_8VUmn1.js} +36688 -40208
  92. package/dist/index-D_gLn3rT.js +100 -0
  93. package/dist/index-DqcVUSC9.js +62 -0
  94. package/dist/index-I7VDqINw.js +128 -0
  95. package/dist/index-Oz72I9VP.js +209 -0
  96. package/dist/index-UclsHkJ0.js +118 -0
  97. package/dist/index-X8zir_1j.js +110 -0
  98. package/dist/index-XvlWKGCu.js +1281 -0
  99. package/dist/index-dO97xPlt.js +171 -0
  100. package/dist/{index-5mp7WkhV.js → index-uBeF6OAB.js} +2 -2
  101. package/dist/index-zeA_RiCV.js +159 -0
  102. package/dist/index.js +1 -1
  103. package/dist/{localBatchGatewayRequest-CjGcn5nM.js → localBatchGatewayRequest-BUZHGdjw.js} +1 -1
  104. package/dist/onramp-CdnBuF0r.js +855 -0
  105. package/dist/{parseSignature-S8VEpRHC.js → parseSignature-CcyTNGr4.js} +2312 -2313
  106. package/dist/pay-with-exchange-CSM6WCOV.js +525 -0
  107. package/dist/property-Bd8U3_QP.js +618 -0
  108. package/dist/receive-DooMu4Dx.js +232 -0
  109. package/dist/ref-CpgjXAw7.js +107 -0
  110. package/dist/send-3T7CyYic.js +1166 -0
  111. package/dist/socials-Dt-iHL17.js +620 -0
  112. package/dist/swaps-CjA9Es42.js +1760 -0
  113. package/dist/{transactions-DujFkB-M.js → transactions-nRm9DVzn.js} +10 -10
  114. package/dist/w3m-modal-NV25AXhM.js +1706 -0
  115. package/package.json +3 -3
  116. package/dist/ConstantsUtil-B-_-u8aQ.js +0 -6
  117. package/dist/add-sji6scSD.js +0 -19
  118. package/dist/all-wallets-B4H-890E.js +0 -10
  119. package/dist/app-store-Z433s97G.js +0 -21
  120. package/dist/apple-b8Lxj7nb.js +0 -22
  121. package/dist/arrow-bottom-M9oWWo_9.js +0 -12
  122. package/dist/arrow-bottom-circle-N9c4CXY1.js +0 -15
  123. package/dist/arrow-left-Dw8AKfwf.js +0 -12
  124. package/dist/arrow-right-DwLQZSC_.js +0 -12
  125. package/dist/arrow-top-zhUjkBe1.js +0 -12
  126. package/dist/bank-CbQdnILK.js +0 -18
  127. package/dist/browser-xAqNwt7z.js +0 -18
  128. package/dist/card-Dr1QBmWp.js +0 -18
  129. package/dist/checkmark-BhT1dTgG.js +0 -15
  130. package/dist/checkmark-bold-CPB29wqQ.js +0 -12
  131. package/dist/chevron-bottom-BhNyx2II.js +0 -12
  132. package/dist/chevron-left-CGuEjQlY.js +0 -12
  133. package/dist/chevron-right-CvIRRsqZ.js +0 -12
  134. package/dist/chevron-top-RSzCqjBd.js +0 -12
  135. package/dist/chrome-store-Cs8dAgs0.js +0 -65
  136. package/dist/clock-fhZO5otC.js +0 -12
  137. package/dist/close-BPuztrdR.js +0 -12
  138. package/dist/coinPlaceholder-C8X2i7Kh.js +0 -12
  139. package/dist/compass-WMc5huk0.js +0 -12
  140. package/dist/copy-DVAeT17y.js +0 -19
  141. package/dist/cursor-BJ4YLXfy.js +0 -7
  142. package/dist/cursor-transparent-DN2fLQN4.js +0 -16
  143. package/dist/desktop-6avxisBw.js +0 -13
  144. package/dist/disconnect-AReVI8Gk.js +0 -12
  145. package/dist/discord-CxrI30BZ.js +0 -21
  146. package/dist/email-B8dIIaay.js +0 -696
  147. package/dist/embedded-wallet-C_5hF7rM.js +0 -468
  148. package/dist/etherscan-BnAy8cIF.js +0 -10
  149. package/dist/exclamation-triangle-Bu7nHwx9.js +0 -8
  150. package/dist/extension-F0LIhvcf.js +0 -12
  151. package/dist/external-link-CP6phyaM.js +0 -12
  152. package/dist/facebook-BtQ-Io2y.js +0 -30
  153. package/dist/farcaster-BmaN1ugd.js +0 -16
  154. package/dist/filters-DpEwoOmy.js +0 -12
  155. package/dist/github-q7qO9V-b.js +0 -22
  156. package/dist/google-DH_ZE8bW.js +0 -22
  157. package/dist/help-circle-BAQVmKas.js +0 -16
  158. package/dist/id-Cj68Zwgo.js +0 -16
  159. package/dist/if-defined-CNte9B3N.js +0 -744
  160. package/dist/image-BKJDw6N-.js +0 -8
  161. package/dist/index-7toZMdtG.js +0 -573
  162. package/dist/index-B1uKzdvN.js +0 -170
  163. package/dist/index-BHFZVF-b.js +0 -257
  164. package/dist/index-BKwa5JSA.js +0 -559
  165. package/dist/index-BP4B9VUt.js +0 -54
  166. package/dist/index-BVdzXHpO.js +0 -181
  167. package/dist/index-BYND0GJ9.js +0 -146
  168. package/dist/index-BaJ0zEbh.js +0 -97
  169. package/dist/index-Bh0MPFwP.js +0 -58
  170. package/dist/index-Bsh7_qTp.js +0 -511
  171. package/dist/index-BwnXTNNg.js +0 -199
  172. package/dist/index-C0kPDbg_.js +0 -77
  173. package/dist/index-CKikVKe2.js +0 -75
  174. package/dist/index-ChVh0Hkp.js +0 -243
  175. package/dist/index-Cle_NnnS.js +0 -305
  176. package/dist/index-CmWdvIFT.js +0 -51
  177. package/dist/index-D2AMA8Bu.js +0 -65
  178. package/dist/index-DAUM8CO4.js +0 -65
  179. package/dist/index-DGjZW6uR.js +0 -78
  180. package/dist/index-DQe94z7X.js +0 -265
  181. package/dist/index-DTo6w99t.js +0 -7864
  182. package/dist/index-DYdXjap2.js +0 -320
  183. package/dist/index-DceCxNV5.js +0 -181
  184. package/dist/index-Uw9cSw0q.js +0 -294
  185. package/dist/index-qiuyrukh.js +0 -45
  186. package/dist/index-zddvaohA.js +0 -78
  187. package/dist/info-RfPsmroW.js +0 -7
  188. package/dist/info-circle-DFKHB_ZN.js +0 -16
  189. package/dist/lightbulb-B-Bykj9X.js +0 -7
  190. package/dist/mail-mBAgGuw5.js +0 -12
  191. package/dist/mobile-Dhh3ndkf.js +0 -13
  192. package/dist/more-D1h7UTvg.js +0 -15
  193. package/dist/network-placeholder-Dqynvc-t.js +0 -18
  194. package/dist/nftPlaceholder-Df7MW4MM.js +0 -12
  195. package/dist/off-BmG3cHTX.js +0 -12
  196. package/dist/onramp-C401Aenb.js +0 -1279
  197. package/dist/play-store-4q1fzL_P.js +0 -36
  198. package/dist/plus-603Gs3yG.js +0 -17
  199. package/dist/qr-code-Dgwhf6M1.js +0 -10
  200. package/dist/receive-CYXbbEUR.js +0 -186
  201. package/dist/recycle-horizontal-Bu8zZ563.js +0 -13
  202. package/dist/ref-DpmKRWBK.js +0 -41
  203. package/dist/refresh-BMZFu0mu.js +0 -12
  204. package/dist/reown-logo-BXph7ThY.js +0 -16
  205. package/dist/search-Cm_V42Y_.js +0 -12
  206. package/dist/secp256k1-C0iX1TUr.js +0 -1510
  207. package/dist/secp256k1-DOQBqE4Z.js +0 -1302
  208. package/dist/send-BSMYxDuP.js +0 -19
  209. package/dist/send-C8EeIzRB.js +0 -1038
  210. package/dist/socials-DQrHQajs.js +0 -574
  211. package/dist/swapHorizontal-98rnJewS.js +0 -12
  212. package/dist/swapHorizontalBold-C299FjEt.js +0 -12
  213. package/dist/swapHorizontalMedium-Cqm6i4WJ.js +0 -20
  214. package/dist/swapHorizontalRoundedBold-De7hFfqZ.js +0 -12
  215. package/dist/swapVertical-DSL75l8L.js +0 -12
  216. package/dist/swaps-BuTNp65Y.js +0 -1637
  217. package/dist/telegram-cJP7hgUb.js +0 -20
  218. package/dist/three-dots-DHnEh28O.js +0 -9
  219. package/dist/twitch-CR2iGcBo.js +0 -22
  220. package/dist/twitterIcon-E5TAQjOn.js +0 -10
  221. package/dist/verify-DEukUJp0.js +0 -12
  222. package/dist/verify-filled-BXsx1i_p.js +0 -12
  223. package/dist/w3m-modal-Bm7BqVng.js +0 -1037
  224. package/dist/wallet-CzyyvdrT.js +0 -12
  225. package/dist/wallet-placeholder-BrcmyGEe.js +0 -18
  226. package/dist/walletconnect-BSYogWiE.js +0 -36
  227. package/dist/warning-circle-Cgp2BW3m.js +0 -16
  228. package/dist/x-BJinLpTw.js +0 -16
@@ -0,0 +1,620 @@
1
+ import { cU as O, cX as _, d8 as S, cM as h, dw as W, d0 as f, cL as T, cY as c, cG as C, dx as F, d6 as D, cE as d, d1 as P, dg as N, cF as u, dn as A, cH as v, dy as M, df as R, di as y } from "./index-D_8VUmn1.js";
2
+ import { n as j, r as l, c as I } from "./index-CEqcN8QP.js";
3
+ import { o as $ } from "./if-defined-CdZSZ6UL.js";
4
+ import { O as U } from "./index-BAmv9PxJ.js";
5
+ import { e as q } from "./index-C-6iznUO.js";
6
+ import "./index-UclsHkJ0.js";
7
+ import "./index-DYBaJQ2W.js";
8
+ import "./index-Oz72I9VP.js";
9
+ import "./index-D7PmdQ9B.js";
10
+ import "./index-DqcVUSC9.js";
11
+ const z = O`
12
+ :host {
13
+ margin-top: ${({ spacing: t }) => t[1]};
14
+ }
15
+ wui-separator {
16
+ margin: ${({ spacing: t }) => t[3]} calc(${({ spacing: t }) => t[3]} * -1)
17
+ ${({ spacing: t }) => t[2]} calc(${({ spacing: t }) => t[3]} * -1);
18
+ width: calc(100% + ${({ spacing: t }) => t[3]} * 2);
19
+ }
20
+ `;
21
+ var g = function(t, e, o, r) {
22
+ var n = arguments.length, i = n < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, o) : r, s;
23
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, o, r);
24
+ else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (n < 3 ? s(i) : n > 3 ? s(e, o, i) : s(e, o)) || i);
25
+ return n > 3 && i && Object.defineProperty(e, o, i), i;
26
+ };
27
+ let p = class extends _ {
28
+ constructor() {
29
+ super(), this.unsubscribe = [], this.tabIdx = void 0, this.connectors = S.state.connectors, this.authConnector = this.connectors.find((e) => e.type === "AUTH"), this.remoteFeatures = h.state.remoteFeatures, this.isPwaLoading = !1, this.hasExceededUsageLimit = W.state.plan.hasExceededUsageLimit, this.unsubscribe.push(S.subscribeKey("connectors", (e) => {
30
+ this.connectors = e, this.authConnector = this.connectors.find((o) => o.type === "AUTH");
31
+ }), h.subscribeKey("remoteFeatures", (e) => this.remoteFeatures = e));
32
+ }
33
+ connectedCallback() {
34
+ super.connectedCallback(), this.handlePwaFrameLoad();
35
+ }
36
+ disconnectedCallback() {
37
+ this.unsubscribe.forEach((e) => e());
38
+ }
39
+ render() {
40
+ var i;
41
+ let e = ((i = this.remoteFeatures) == null ? void 0 : i.socials) || [];
42
+ const o = !!this.authConnector, r = e == null ? void 0 : e.length, n = f.state.view === "ConnectSocials";
43
+ return (!o || !r) && !n ? null : (n && !r && (e = T.DEFAULT_SOCIALS), c` <wui-flex flexDirection="column" gap="2">
44
+ ${e.map((s) => c`<wui-list-social
45
+ @click=${() => {
46
+ this.onSocialClick(s);
47
+ }}
48
+ data-testid=${`social-selector-${s}`}
49
+ name=${s}
50
+ logo=${s}
51
+ ?disabled=${this.isPwaLoading}
52
+ ></wui-list-social>`)}
53
+ </wui-flex>`);
54
+ }
55
+ async onSocialClick(e) {
56
+ if (this.hasExceededUsageLimit) {
57
+ f.push("UsageExceeded");
58
+ return;
59
+ }
60
+ e && await q(e);
61
+ }
62
+ async handlePwaFrameLoad() {
63
+ var e;
64
+ if (C.isPWA()) {
65
+ this.isPwaLoading = !0;
66
+ try {
67
+ ((e = this.authConnector) == null ? void 0 : e.provider) instanceof F && await this.authConnector.provider.init();
68
+ } catch (o) {
69
+ D.open({
70
+ displayMessage: "Error loading embedded wallet in PWA",
71
+ debugMessage: o.message
72
+ }, "error");
73
+ } finally {
74
+ this.isPwaLoading = !1;
75
+ }
76
+ }
77
+ }
78
+ };
79
+ p.styles = z;
80
+ g([
81
+ j()
82
+ ], p.prototype, "tabIdx", void 0);
83
+ g([
84
+ l()
85
+ ], p.prototype, "connectors", void 0);
86
+ g([
87
+ l()
88
+ ], p.prototype, "authConnector", void 0);
89
+ g([
90
+ l()
91
+ ], p.prototype, "remoteFeatures", void 0);
92
+ g([
93
+ l()
94
+ ], p.prototype, "isPwaLoading", void 0);
95
+ g([
96
+ l()
97
+ ], p.prototype, "hasExceededUsageLimit", void 0);
98
+ p = g([
99
+ I("w3m-social-login-list")
100
+ ], p);
101
+ const G = O`
102
+ wui-flex {
103
+ max-height: clamp(360px, 540px, 80vh);
104
+ overflow: scroll;
105
+ scrollbar-width: none;
106
+ transition: opacity ${({ durations: t }) => t.md}
107
+ ${({ easings: t }) => t["ease-out-power-1"]};
108
+ will-change: opacity;
109
+ }
110
+
111
+ wui-flex::-webkit-scrollbar {
112
+ display: none;
113
+ }
114
+
115
+ wui-flex.disabled {
116
+ opacity: 0.3;
117
+ pointer-events: none;
118
+ user-select: none;
119
+ }
120
+ `;
121
+ var k = function(t, e, o, r) {
122
+ var n = arguments.length, i = n < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, o) : r, s;
123
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, o, r);
124
+ else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (n < 3 ? s(i) : n > 3 ? s(e, o, i) : s(e, o)) || i);
125
+ return n > 3 && i && Object.defineProperty(e, o, i), i;
126
+ };
127
+ let L = class extends _ {
128
+ constructor() {
129
+ super(), this.unsubscribe = [], this.checked = U.state.isLegalCheckboxChecked, this.unsubscribe.push(U.subscribeKey("isLegalCheckboxChecked", (e) => {
130
+ this.checked = e;
131
+ }));
132
+ }
133
+ disconnectedCallback() {
134
+ this.unsubscribe.forEach((e) => e());
135
+ }
136
+ render() {
137
+ var E;
138
+ const { termsConditionsUrl: e, privacyPolicyUrl: o } = h.state, r = (E = h.state.features) == null ? void 0 : E.legalCheckbox, s = !!(e || o) && !!r && !this.checked, a = s ? -1 : void 0;
139
+ return c`
140
+ <w3m-legal-checkbox></w3m-legal-checkbox>
141
+ <wui-flex
142
+ flexDirection="column"
143
+ .padding=${["0", "3", "3", "3"]}
144
+ gap="01"
145
+ class=${$(s ? "disabled" : void 0)}
146
+ >
147
+ <w3m-social-login-list tabIdx=${$(a)}></w3m-social-login-list>
148
+ </wui-flex>
149
+ `;
150
+ }
151
+ };
152
+ L.styles = G;
153
+ k([
154
+ l()
155
+ ], L.prototype, "checked", void 0);
156
+ L = k([
157
+ I("w3m-connect-socials-view")
158
+ ], L);
159
+ const B = O`
160
+ wui-logo {
161
+ width: 80px;
162
+ height: 80px;
163
+ border-radius: ${({ borderRadius: t }) => t[8]};
164
+ }
165
+ @keyframes shake {
166
+ 0% {
167
+ transform: translateX(0);
168
+ }
169
+ 25% {
170
+ transform: translateX(3px);
171
+ }
172
+ 50% {
173
+ transform: translateX(-3px);
174
+ }
175
+ 75% {
176
+ transform: translateX(3px);
177
+ }
178
+ 100% {
179
+ transform: translateX(0);
180
+ }
181
+ }
182
+ wui-flex:first-child:not(:only-child) {
183
+ position: relative;
184
+ }
185
+ wui-loading-thumbnail {
186
+ position: absolute;
187
+ }
188
+ wui-icon-box {
189
+ position: absolute;
190
+ right: calc(${({ spacing: t }) => t[1]} * -1);
191
+ bottom: calc(${({ spacing: t }) => t[1]} * -1);
192
+ opacity: 0;
193
+ transform: scale(0.5);
194
+ transition: all ${({ easings: t }) => t["ease-out-power-2"]}
195
+ ${({ durations: t }) => t.lg};
196
+ }
197
+ wui-text[align='center'] {
198
+ width: 100%;
199
+ padding: 0px ${({ spacing: t }) => t[4]};
200
+ }
201
+ [data-error='true'] wui-icon-box {
202
+ opacity: 1;
203
+ transform: scale(1);
204
+ }
205
+ [data-error='true'] > wui-flex:first-child {
206
+ animation: shake 250ms ${({ easings: t }) => t["ease-out-power-2"]} both;
207
+ }
208
+ .capitalize {
209
+ text-transform: capitalize;
210
+ }
211
+ `;
212
+ var b = function(t, e, o, r) {
213
+ var n = arguments.length, i = n < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, o) : r, s;
214
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, o, r);
215
+ else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (n < 3 ? s(i) : n > 3 ? s(e, o, i) : s(e, o)) || i);
216
+ return n > 3 && i && Object.defineProperty(e, o, i), i;
217
+ };
218
+ let m = class extends _ {
219
+ constructor() {
220
+ var o, r, n;
221
+ super(), this.unsubscribe = [], this.socialProvider = (o = d.getAccountData()) == null ? void 0 : o.socialProvider, this.socialWindow = (r = d.getAccountData()) == null ? void 0 : r.socialWindow, this.error = !1, this.connecting = !1, this.message = "Connect in the provider window", this.remoteFeatures = h.state.remoteFeatures, this.address = (n = d.getAccountData()) == null ? void 0 : n.address, this.connectionsByNamespace = P.getConnections(d.state.activeChain), this.hasMultipleConnections = this.connectionsByNamespace.length > 0, this.authConnector = S.getAuthConnector(), this.handleSocialConnection = async (i) => {
222
+ var s;
223
+ if ((s = i.data) != null && s.resultUri)
224
+ if (i.origin === N.SECURE_SITE_ORIGIN) {
225
+ window.removeEventListener("message", this.handleSocialConnection, !1);
226
+ try {
227
+ if (this.authConnector && !this.connecting) {
228
+ this.connecting = !0;
229
+ const a = this.parseURLError(i.data.resultUri);
230
+ if (a) {
231
+ this.handleSocialError(a);
232
+ return;
233
+ }
234
+ this.closeSocialWindow(), this.updateMessage();
235
+ const E = i.data.resultUri;
236
+ this.socialProvider && u.sendEvent({
237
+ type: "track",
238
+ event: "SOCIAL_LOGIN_REQUEST_USER_DATA",
239
+ properties: { provider: this.socialProvider }
240
+ }), await P.connectExternal({
241
+ id: this.authConnector.id,
242
+ type: this.authConnector.type,
243
+ socialUri: E
244
+ }, this.authConnector.chain), this.socialProvider && (A.setConnectedSocialProvider(this.socialProvider), u.sendEvent({
245
+ type: "track",
246
+ event: "SOCIAL_LOGIN_SUCCESS",
247
+ properties: { provider: this.socialProvider }
248
+ }));
249
+ }
250
+ } catch (a) {
251
+ this.error = !0, this.updateMessage(), this.socialProvider && u.sendEvent({
252
+ type: "track",
253
+ event: "SOCIAL_LOGIN_ERROR",
254
+ properties: {
255
+ provider: this.socialProvider,
256
+ message: C.parseError(a)
257
+ }
258
+ });
259
+ }
260
+ } else
261
+ f.goBack(), v.showError("Untrusted Origin"), this.socialProvider && u.sendEvent({
262
+ type: "track",
263
+ event: "SOCIAL_LOGIN_ERROR",
264
+ properties: {
265
+ provider: this.socialProvider,
266
+ message: "Untrusted Origin"
267
+ }
268
+ });
269
+ }, M.EmbeddedWalletAbortController.signal.addEventListener("abort", () => {
270
+ this.closeSocialWindow();
271
+ }), this.unsubscribe.push(d.subscribeChainProp("accountState", (i) => {
272
+ var s;
273
+ if (i && (this.socialProvider = i.socialProvider, i.socialWindow && (this.socialWindow = i.socialWindow), i.address)) {
274
+ const a = (s = this.remoteFeatures) == null ? void 0 : s.multiWallet;
275
+ i.address !== this.address && (this.hasMultipleConnections && a ? (f.replace("ProfileWallets"), v.showSuccess("New Wallet Added"), this.address = i.address) : (R.state.open || h.state.enableEmbedded) && R.close());
276
+ }
277
+ }), h.subscribeKey("remoteFeatures", (i) => {
278
+ this.remoteFeatures = i;
279
+ })), this.authConnector && this.connectSocial();
280
+ }
281
+ disconnectedCallback() {
282
+ this.unsubscribe.forEach((o) => o()), window.removeEventListener("message", this.handleSocialConnection, !1), !d.state.activeCaipAddress && this.socialProvider && !this.connecting && u.sendEvent({
283
+ type: "track",
284
+ event: "SOCIAL_LOGIN_CANCELED",
285
+ properties: { provider: this.socialProvider }
286
+ }), this.closeSocialWindow();
287
+ }
288
+ render() {
289
+ return c`
290
+ <wui-flex
291
+ data-error=${$(this.error)}
292
+ flexDirection="column"
293
+ alignItems="center"
294
+ .padding=${["10", "5", "5", "5"]}
295
+ gap="6"
296
+ >
297
+ <wui-flex justifyContent="center" alignItems="center">
298
+ <wui-logo logo=${$(this.socialProvider)}></wui-logo>
299
+ ${this.error ? null : this.loaderTemplate()}
300
+ <wui-icon-box color="error" icon="close" size="sm"></wui-icon-box>
301
+ </wui-flex>
302
+ <wui-flex flexDirection="column" alignItems="center" gap="2">
303
+ <wui-text align="center" variant="lg-medium" color="primary"
304
+ >Log in with
305
+ <span class="capitalize">${this.socialProvider ?? "Social"}</span></wui-text
306
+ >
307
+ <wui-text align="center" variant="lg-regular" color=${this.error ? "error" : "secondary"}
308
+ >${this.message}</wui-text
309
+ ></wui-flex
310
+ >
311
+ </wui-flex>
312
+ `;
313
+ }
314
+ loaderTemplate() {
315
+ const e = y.state.themeVariables["--w3m-border-radius-master"], o = e ? parseInt(e.replace("px", ""), 10) : 4;
316
+ return c`<wui-loading-thumbnail radius=${o * 9}></wui-loading-thumbnail>`;
317
+ }
318
+ parseURLError(e) {
319
+ try {
320
+ const o = "error=", r = e.indexOf(o);
321
+ return r === -1 ? null : e.substring(r + o.length);
322
+ } catch {
323
+ return null;
324
+ }
325
+ }
326
+ connectSocial() {
327
+ const e = setInterval(() => {
328
+ var o;
329
+ (o = this.socialWindow) != null && o.closed && (!this.connecting && f.state.view === "ConnectingSocial" && f.goBack(), clearInterval(e));
330
+ }, 1e3);
331
+ window.addEventListener("message", this.handleSocialConnection, !1);
332
+ }
333
+ updateMessage() {
334
+ this.error ? this.message = "Something went wrong" : this.connecting ? this.message = "Retrieving user data" : this.message = "Connect in the provider window";
335
+ }
336
+ handleSocialError(e) {
337
+ this.error = !0, this.updateMessage(), this.socialProvider && u.sendEvent({
338
+ type: "track",
339
+ event: "SOCIAL_LOGIN_ERROR",
340
+ properties: { provider: this.socialProvider, message: e }
341
+ }), this.closeSocialWindow();
342
+ }
343
+ closeSocialWindow() {
344
+ this.socialWindow && (this.socialWindow.close(), d.setAccountProp("socialWindow", void 0, d.state.activeChain));
345
+ }
346
+ };
347
+ m.styles = B;
348
+ b([
349
+ l()
350
+ ], m.prototype, "socialProvider", void 0);
351
+ b([
352
+ l()
353
+ ], m.prototype, "socialWindow", void 0);
354
+ b([
355
+ l()
356
+ ], m.prototype, "error", void 0);
357
+ b([
358
+ l()
359
+ ], m.prototype, "connecting", void 0);
360
+ b([
361
+ l()
362
+ ], m.prototype, "message", void 0);
363
+ b([
364
+ l()
365
+ ], m.prototype, "remoteFeatures", void 0);
366
+ m = b([
367
+ I("w3m-connecting-social-view")
368
+ ], m);
369
+ const V = O`
370
+ wui-shimmer {
371
+ width: 100%;
372
+ aspect-ratio: 1 / 1;
373
+ border-radius: ${({ borderRadius: t }) => t[4]};
374
+ }
375
+
376
+ wui-qr-code {
377
+ opacity: 0;
378
+ animation-duration: ${({ durations: t }) => t.xl};
379
+ animation-timing-function: ${({ easings: t }) => t["ease-out-power-2"]};
380
+ animation-name: fade-in;
381
+ animation-fill-mode: forwards;
382
+ }
383
+
384
+ wui-logo {
385
+ width: 80px;
386
+ height: 80px;
387
+ border-radius: ${({ borderRadius: t }) => t[8]};
388
+ }
389
+
390
+ wui-flex:first-child:not(:only-child) {
391
+ position: relative;
392
+ }
393
+
394
+ wui-loading-thumbnail {
395
+ position: absolute;
396
+ }
397
+
398
+ wui-icon-box {
399
+ position: absolute;
400
+ right: calc(${({ spacing: t }) => t[1]} * -1);
401
+ bottom: calc(${({ spacing: t }) => t[1]} * -1);
402
+ opacity: 0;
403
+ transform: scale(0.5);
404
+ transition:
405
+ opacity ${({ durations: t }) => t.lg} ${({ easings: t }) => t["ease-out-power-2"]},
406
+ transform ${({ durations: t }) => t.lg}
407
+ ${({ easings: t }) => t["ease-out-power-2"]};
408
+ will-change: opacity, transform;
409
+ }
410
+
411
+ @keyframes fade-in {
412
+ from {
413
+ opacity: 0;
414
+ }
415
+ to {
416
+ opacity: 1;
417
+ }
418
+ }
419
+ `;
420
+ var x = function(t, e, o, r) {
421
+ var n = arguments.length, i = n < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, o) : r, s;
422
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, o, r);
423
+ else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (n < 3 ? s(i) : n > 3 ? s(e, o, i) : s(e, o)) || i);
424
+ return n > 3 && i && Object.defineProperty(e, o, i), i;
425
+ };
426
+ let w = class extends _ {
427
+ constructor() {
428
+ var e, o;
429
+ super(), this.unsubscribe = [], this.timeout = void 0, this.socialProvider = (e = d.getAccountData()) == null ? void 0 : e.socialProvider, this.uri = (o = d.getAccountData()) == null ? void 0 : o.farcasterUrl, this.ready = !1, this.loading = !1, this.remoteFeatures = h.state.remoteFeatures, this.authConnector = S.getAuthConnector(), this.forceUpdate = () => {
430
+ this.requestUpdate();
431
+ }, this.unsubscribe.push(d.subscribeChainProp("accountState", (r) => {
432
+ this.socialProvider = r == null ? void 0 : r.socialProvider, this.uri = r == null ? void 0 : r.farcasterUrl, this.connectFarcaster();
433
+ }), h.subscribeKey("remoteFeatures", (r) => {
434
+ this.remoteFeatures = r;
435
+ })), window.addEventListener("resize", this.forceUpdate);
436
+ }
437
+ disconnectedCallback() {
438
+ super.disconnectedCallback(), clearTimeout(this.timeout), window.removeEventListener("resize", this.forceUpdate), !d.state.activeCaipAddress && this.socialProvider && (this.uri || this.loading) && u.sendEvent({
439
+ type: "track",
440
+ event: "SOCIAL_LOGIN_CANCELED",
441
+ properties: { provider: this.socialProvider }
442
+ });
443
+ }
444
+ render() {
445
+ return this.onRenderProxy(), c`${this.platformTemplate()}`;
446
+ }
447
+ platformTemplate() {
448
+ return C.isMobile() ? c`${this.mobileTemplate()}` : c`${this.desktopTemplate()}`;
449
+ }
450
+ desktopTemplate() {
451
+ return this.loading ? c`${this.loadingTemplate()}` : c`${this.qrTemplate()}`;
452
+ }
453
+ qrTemplate() {
454
+ return c` <wui-flex
455
+ flexDirection="column"
456
+ alignItems="center"
457
+ .padding=${["0", "5", "5", "5"]}
458
+ gap="5"
459
+ >
460
+ <wui-shimmer width="100%"> ${this.qrCodeTemplate()} </wui-shimmer>
461
+
462
+ <wui-text variant="lg-medium" color="primary"> Scan this QR Code with your phone </wui-text>
463
+ ${this.copyTemplate()}
464
+ </wui-flex>`;
465
+ }
466
+ loadingTemplate() {
467
+ return c`
468
+ <wui-flex
469
+ flexDirection="column"
470
+ alignItems="center"
471
+ .padding=${["5", "5", "5", "5"]}
472
+ gap="5"
473
+ >
474
+ <wui-flex justifyContent="center" alignItems="center">
475
+ <wui-logo logo="farcaster"></wui-logo>
476
+ ${this.loaderTemplate()}
477
+ <wui-icon-box color="error" icon="close" size="sm"></wui-icon-box>
478
+ </wui-flex>
479
+ <wui-flex flexDirection="column" alignItems="center" gap="2">
480
+ <wui-text align="center" variant="md-medium" color="primary">
481
+ Loading user data
482
+ </wui-text>
483
+ <wui-text align="center" variant="sm-regular" color="secondary">
484
+ Please wait a moment while we load your data.
485
+ </wui-text>
486
+ </wui-flex>
487
+ </wui-flex>
488
+ `;
489
+ }
490
+ mobileTemplate() {
491
+ return c` <wui-flex
492
+ flexDirection="column"
493
+ alignItems="center"
494
+ .padding=${["10", "5", "5", "5"]}
495
+ gap="5"
496
+ >
497
+ <wui-flex justifyContent="center" alignItems="center">
498
+ <wui-logo logo="farcaster"></wui-logo>
499
+ ${this.loaderTemplate()}
500
+ <wui-icon-box
501
+ color="error"
502
+ icon="close"
503
+ size="sm"
504
+ ></wui-icon-box>
505
+ </wui-flex>
506
+ <wui-flex flexDirection="column" alignItems="center" gap="2">
507
+ <wui-text align="center" variant="md-medium" color="primary"
508
+ >Continue in Farcaster</span></wui-text
509
+ >
510
+ <wui-text align="center" variant="sm-regular" color="secondary"
511
+ >Accept connection request in the app</wui-text
512
+ ></wui-flex
513
+ >
514
+ ${this.mobileLinkTemplate()}
515
+ </wui-flex>`;
516
+ }
517
+ loaderTemplate() {
518
+ const e = y.state.themeVariables["--w3m-border-radius-master"], o = e ? parseInt(e.replace("px", ""), 10) : 4;
519
+ return c`<wui-loading-thumbnail radius=${o * 9}></wui-loading-thumbnail>`;
520
+ }
521
+ async connectFarcaster() {
522
+ var e, o;
523
+ if (this.authConnector)
524
+ try {
525
+ await ((e = this.authConnector) == null ? void 0 : e.provider.connectFarcaster()), this.socialProvider && (A.setConnectedSocialProvider(this.socialProvider), u.sendEvent({
526
+ type: "track",
527
+ event: "SOCIAL_LOGIN_REQUEST_USER_DATA",
528
+ properties: { provider: this.socialProvider }
529
+ })), this.loading = !0;
530
+ const n = P.getConnections(this.authConnector.chain).length > 0;
531
+ await P.connectExternal(this.authConnector, this.authConnector.chain);
532
+ const i = (o = this.remoteFeatures) == null ? void 0 : o.multiWallet;
533
+ this.socialProvider && u.sendEvent({
534
+ type: "track",
535
+ event: "SOCIAL_LOGIN_SUCCESS",
536
+ properties: { provider: this.socialProvider }
537
+ }), this.loading = !1, n && i ? (f.replace("ProfileWallets"), v.showSuccess("New Wallet Added")) : R.close();
538
+ } catch (r) {
539
+ this.socialProvider && u.sendEvent({
540
+ type: "track",
541
+ event: "SOCIAL_LOGIN_ERROR",
542
+ properties: { provider: this.socialProvider, message: C.parseError(r) }
543
+ }), f.goBack(), v.showError(r);
544
+ }
545
+ }
546
+ mobileLinkTemplate() {
547
+ return c`<wui-button
548
+ size="md"
549
+ ?loading=${this.loading}
550
+ ?disabled=${!this.uri || this.loading}
551
+ @click=${() => {
552
+ this.uri && C.openHref(this.uri, "_blank");
553
+ }}
554
+ >
555
+ Open farcaster</wui-button
556
+ >`;
557
+ }
558
+ onRenderProxy() {
559
+ !this.ready && this.uri && (this.timeout = setTimeout(() => {
560
+ this.ready = !0;
561
+ }, 200));
562
+ }
563
+ qrCodeTemplate() {
564
+ if (!this.uri || !this.ready)
565
+ return null;
566
+ const e = this.getBoundingClientRect().width - 40, o = y.state.themeVariables["--apkt-qr-color"] ?? y.state.themeVariables["--w3m-qr-color"];
567
+ return c` <wui-qr-code
568
+ size=${e}
569
+ theme=${y.state.themeMode}
570
+ uri=${this.uri}
571
+ ?farcaster=${!0}
572
+ data-testid="wui-qr-code"
573
+ color=${$(o)}
574
+ ></wui-qr-code>`;
575
+ }
576
+ copyTemplate() {
577
+ const e = !this.uri || !this.ready;
578
+ return c`<wui-button
579
+ .disabled=${e}
580
+ @click=${this.onCopyUri}
581
+ variant="neutral-secondary"
582
+ size="sm"
583
+ data-testid="copy-wc2-uri"
584
+ >
585
+ <wui-icon size="sm" color="default" slot="iconRight" name="copy"></wui-icon>
586
+ Copy link
587
+ </wui-button>`;
588
+ }
589
+ onCopyUri() {
590
+ try {
591
+ this.uri && (C.copyToClopboard(this.uri), v.showSuccess("Link copied"));
592
+ } catch {
593
+ v.showError("Failed to copy");
594
+ }
595
+ }
596
+ };
597
+ w.styles = V;
598
+ x([
599
+ l()
600
+ ], w.prototype, "socialProvider", void 0);
601
+ x([
602
+ l()
603
+ ], w.prototype, "uri", void 0);
604
+ x([
605
+ l()
606
+ ], w.prototype, "ready", void 0);
607
+ x([
608
+ l()
609
+ ], w.prototype, "loading", void 0);
610
+ x([
611
+ l()
612
+ ], w.prototype, "remoteFeatures", void 0);
613
+ w = x([
614
+ I("w3m-connecting-farcaster-view")
615
+ ], w);
616
+ export {
617
+ L as W3mConnectSocialsView,
618
+ w as W3mConnectingFarcasterView,
619
+ m as W3mConnectingSocialView
620
+ };