@campnetwork/origin 0.0.1
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.
- package/LICENSE +21 -0
- package/README.md +1007 -0
- package/dist/core.cjs +448 -0
- package/dist/core.d.ts +503 -0
- package/dist/core.esm.d.ts +503 -0
- package/dist/core.esm.js +446 -0
- package/dist/react/components/Tooltip.d.ts +17 -0
- package/dist/react/index.esm.d.ts +194 -0
- package/dist/react/index.esm.js +2406 -0
- package/package.json +73 -0
|
@@ -0,0 +1,2406 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React, { createContext, useState, useContext, useLayoutEffect, useEffect, useRef, useSyncExternalStore } from 'react';
|
|
3
|
+
import { Auth } from '../core.esm';
|
|
4
|
+
import { WagmiContext, useAccount, useConnectorClient } from 'wagmi';
|
|
5
|
+
import 'axios';
|
|
6
|
+
import 'viem';
|
|
7
|
+
import 'viem/accounts';
|
|
8
|
+
import 'viem/siwe';
|
|
9
|
+
import { EthereumProvider } from '@walletconnect/ethereum-provider';
|
|
10
|
+
import ReactDOM, { createPortal } from 'react-dom';
|
|
11
|
+
import { useQuery } from '@tanstack/react-query';
|
|
12
|
+
|
|
13
|
+
const ModalContext = createContext({
|
|
14
|
+
isButtonDisabled: false,
|
|
15
|
+
setIsButtonDisabled: () => { },
|
|
16
|
+
isVisible: false,
|
|
17
|
+
setIsVisible: () => { },
|
|
18
|
+
isLinkingVisible: false,
|
|
19
|
+
setIsLinkingVisible: () => { },
|
|
20
|
+
currentlyLinking: null,
|
|
21
|
+
setCurrentlyLinking: () => { },
|
|
22
|
+
});
|
|
23
|
+
const ModalProvider = ({ children }) => {
|
|
24
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
25
|
+
const [isLinkingVisible, setIsLinkingVisible] = useState(false);
|
|
26
|
+
const [currentlyLinking, setCurrentlyLinking] = useState(null);
|
|
27
|
+
const [isButtonDisabled, setIsButtonDisabled] = useState(false);
|
|
28
|
+
return (React.createElement(ModalContext.Provider, { value: {
|
|
29
|
+
isButtonDisabled,
|
|
30
|
+
setIsButtonDisabled,
|
|
31
|
+
isVisible,
|
|
32
|
+
setIsVisible,
|
|
33
|
+
isLinkingVisible,
|
|
34
|
+
setIsLinkingVisible,
|
|
35
|
+
currentlyLinking,
|
|
36
|
+
setCurrentlyLinking,
|
|
37
|
+
} }, children));
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/******************************************************************************
|
|
41
|
+
Copyright (c) Microsoft Corporation.
|
|
42
|
+
|
|
43
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
44
|
+
purpose with or without fee is hereby granted.
|
|
45
|
+
|
|
46
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
47
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
48
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
49
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
50
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
51
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
52
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
53
|
+
***************************************************************************** */
|
|
54
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
function __rest(s, e) {
|
|
58
|
+
var t = {};
|
|
59
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
60
|
+
t[p] = s[p];
|
|
61
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
62
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
63
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
64
|
+
t[p[i]] = s[p[i]];
|
|
65
|
+
}
|
|
66
|
+
return t;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
70
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
71
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
72
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
73
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
74
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
75
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
80
|
+
var e = new Error(message);
|
|
81
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Formats an Ethereum address by truncating it to the first and last n characters.
|
|
86
|
+
* @param {string} address - The Ethereum address to format.
|
|
87
|
+
* @param {number} n - The number of characters to keep from the start and end of the address.
|
|
88
|
+
* @return {string} - The formatted address.
|
|
89
|
+
*/
|
|
90
|
+
const formatAddress = (address, n = 8) => {
|
|
91
|
+
return `${address.slice(0, n)}...${address.slice(-n)}`;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Capitalizes the first letter of a string.
|
|
95
|
+
* @param {string} str - The string to capitalize.
|
|
96
|
+
* @return {string} - The capitalized string.
|
|
97
|
+
*/
|
|
98
|
+
const capitalize = (str) => {
|
|
99
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Formats a Camp amount to a human-readable string.
|
|
103
|
+
* @param {number} amount - The Camp amount to format.
|
|
104
|
+
* @returns {string} - The formatted Camp amount.
|
|
105
|
+
*/
|
|
106
|
+
const formatCampAmount = (amount) => {
|
|
107
|
+
if (amount >= 1000) {
|
|
108
|
+
const formatted = (amount / 1000).toFixed(1);
|
|
109
|
+
return formatted.endsWith(".0")
|
|
110
|
+
? formatted.slice(0, -2) + "k"
|
|
111
|
+
: formatted + "k";
|
|
112
|
+
}
|
|
113
|
+
return amount.toString();
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const testnet = {
|
|
117
|
+
id: 123420001114,
|
|
118
|
+
name: "Basecamp",
|
|
119
|
+
nativeCurrency: {
|
|
120
|
+
decimals: 18,
|
|
121
|
+
name: "Camp",
|
|
122
|
+
symbol: "CAMP",
|
|
123
|
+
},
|
|
124
|
+
rpcUrls: {
|
|
125
|
+
default: {
|
|
126
|
+
http: [
|
|
127
|
+
"https://rpc-campnetwork.xyz",
|
|
128
|
+
"https://rpc.basecamp.t.raas.gelato.cloud",
|
|
129
|
+
],
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
blockExplorers: {
|
|
133
|
+
default: {
|
|
134
|
+
name: "Explorer",
|
|
135
|
+
url: "https://basecamp.cloud.blockscout.com/",
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
var constants = {
|
|
141
|
+
SIWE_MESSAGE_STATEMENT: "Connect with Camp Network",
|
|
142
|
+
AUTH_HUB_BASE_API: "https://wv2h4to5qa.execute-api.us-east-2.amazonaws.com/dev",
|
|
143
|
+
ORIGIN_DASHBOARD: "https://origin.campnetwork.xyz",
|
|
144
|
+
SUPPORTED_IMAGE_FORMATS: [
|
|
145
|
+
"image/jpeg",
|
|
146
|
+
"image/png",
|
|
147
|
+
"image/gif",
|
|
148
|
+
"image/webp",
|
|
149
|
+
],
|
|
150
|
+
SUPPORTED_VIDEO_FORMATS: ["video/mp4", "video/webm"],
|
|
151
|
+
SUPPORTED_AUDIO_FORMATS: ["audio/mpeg", "audio/wav", "audio/ogg"],
|
|
152
|
+
SUPPORTED_TEXT_FORMATS: ["text/plain"],
|
|
153
|
+
AVAILABLE_SOCIALS: ["twitter", "discord", "spotify", "tiktok", "telegram"],
|
|
154
|
+
ACKEE_INSTANCE: "https://ackee-production-01bd.up.railway.app",
|
|
155
|
+
ACKEE_EVENTS: {
|
|
156
|
+
USER_CONNECTED: "ed42542d-b676-4112-b6d9-6db98048b2e0",
|
|
157
|
+
USER_DISCONNECTED: "20af31ac-e602-442e-9e0e-b589f4dd4016",
|
|
158
|
+
TWITTER_LINKED: "7fbea086-90ef-4679-ba69-f47f9255b34c",
|
|
159
|
+
DISCORD_LINKED: "d73f5ae3-a8e8-48f2-8532-85e0c7780d6a",
|
|
160
|
+
SPOTIFY_LINKED: "fc1788b4-c984-42c8-96f4-c87f6bb0b8f7",
|
|
161
|
+
TIKTOK_LINKED: "4a2ffdd3-f0e9-4784-8b49-ff76ec1c0a6a",
|
|
162
|
+
TELEGRAM_LINKED: "9006bc5d-bcc9-4d01-a860-4f1a201e8e47",
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
let providers = [];
|
|
167
|
+
const providerStore = {
|
|
168
|
+
value: () => providers,
|
|
169
|
+
subscribe: (callback) => {
|
|
170
|
+
function onAnnouncement(event) {
|
|
171
|
+
if (providers.some((p) => p.info.uuid === event.detail.info.uuid))
|
|
172
|
+
return;
|
|
173
|
+
providers = [...providers, event.detail];
|
|
174
|
+
callback(providers);
|
|
175
|
+
}
|
|
176
|
+
if (typeof window === "undefined")
|
|
177
|
+
return;
|
|
178
|
+
window.addEventListener("eip6963:announceProvider", onAnnouncement);
|
|
179
|
+
window.dispatchEvent(new Event("eip6963:requestProvider"));
|
|
180
|
+
return () => window.removeEventListener("eip6963:announceProvider", onAnnouncement);
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
The MIT License (MIT)
|
|
186
|
+
|
|
187
|
+
Copyright (c) Tobias Reich
|
|
188
|
+
|
|
189
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
190
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
191
|
+
in the Software without restriction, including without limitation the rights
|
|
192
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
193
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
194
|
+
furnished to do so, subject to the following conditions:
|
|
195
|
+
|
|
196
|
+
The above copyright notice and this permission notice shall be included in
|
|
197
|
+
all copies or substantial portions of the Software.
|
|
198
|
+
|
|
199
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
200
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
201
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
202
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
203
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
204
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
205
|
+
THE SOFTWARE.
|
|
206
|
+
*/
|
|
207
|
+
const isBrowser = typeof window !== "undefined";
|
|
208
|
+
const navigator = isBrowser
|
|
209
|
+
? window === null || window === void 0 ? void 0 : window.navigator
|
|
210
|
+
: {
|
|
211
|
+
userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3",
|
|
212
|
+
language: "en",
|
|
213
|
+
languages: [],
|
|
214
|
+
platform: "",
|
|
215
|
+
vendor: "",
|
|
216
|
+
maxTouchPoints: 0,
|
|
217
|
+
hardwareConcurrency: 0,
|
|
218
|
+
deviceMemory: 0,
|
|
219
|
+
};
|
|
220
|
+
const location = isBrowser
|
|
221
|
+
? window === null || window === void 0 ? void 0 : window.location
|
|
222
|
+
: {
|
|
223
|
+
href: "",
|
|
224
|
+
protocol: "",
|
|
225
|
+
host: "",
|
|
226
|
+
hostname: "",
|
|
227
|
+
port: "",
|
|
228
|
+
pathname: "",
|
|
229
|
+
search: "",
|
|
230
|
+
hash: "",
|
|
231
|
+
};
|
|
232
|
+
/**
|
|
233
|
+
* Validates options and sets defaults for undefined properties.
|
|
234
|
+
* @param {?Object} opts
|
|
235
|
+
* @returns {Object} opts - Validated options.
|
|
236
|
+
*/
|
|
237
|
+
const validate = function (opts = {}) {
|
|
238
|
+
// Create new object to avoid changes by reference
|
|
239
|
+
const _opts = {};
|
|
240
|
+
// Defaults to false
|
|
241
|
+
_opts.detailed = opts.detailed === true;
|
|
242
|
+
// Defaults to true
|
|
243
|
+
_opts.ignoreLocalhost = opts.ignoreLocalhost !== false;
|
|
244
|
+
// Defaults to true
|
|
245
|
+
_opts.ignoreOwnVisits = opts.ignoreOwnVisits !== false;
|
|
246
|
+
return _opts;
|
|
247
|
+
};
|
|
248
|
+
/**
|
|
249
|
+
* Determines if a host is a localhost.
|
|
250
|
+
* @param {String} hostname - Hostname that should be tested.
|
|
251
|
+
* @returns {Boolean} isLocalhost
|
|
252
|
+
*/
|
|
253
|
+
const isLocalhost = function (hostname) {
|
|
254
|
+
return (hostname === "" ||
|
|
255
|
+
hostname === "localhost" ||
|
|
256
|
+
hostname === "127.0.0.1" ||
|
|
257
|
+
hostname === "::1");
|
|
258
|
+
};
|
|
259
|
+
/**
|
|
260
|
+
* Determines if user agent is a bot. Approach is to get most bots, assuming other bots don't run JS.
|
|
261
|
+
* Source: https://stackoverflow.com/questions/20084513/detect-search-crawlers-via-javascript/20084661
|
|
262
|
+
* @param {String} userAgent - User agent that should be tested.
|
|
263
|
+
* @returns {Boolean} isBot
|
|
264
|
+
*/
|
|
265
|
+
const isBot = function (userAgent) {
|
|
266
|
+
return /bot|crawler|spider|crawling/i.test(userAgent);
|
|
267
|
+
};
|
|
268
|
+
/**
|
|
269
|
+
* Checks if an id is a fake id. This is the case when Ackee ignores you because of the `ackee_ignore` cookie.
|
|
270
|
+
* @param {String} id - Id that should be tested.
|
|
271
|
+
* @returns {Boolean} isFakeId
|
|
272
|
+
*/
|
|
273
|
+
const isFakeId = function (id) {
|
|
274
|
+
return id === "88888888-8888-8888-8888-888888888888";
|
|
275
|
+
};
|
|
276
|
+
/**
|
|
277
|
+
* Checks if the website is in background (e.g. user has minimzed or switched tabs).
|
|
278
|
+
* @returns {boolean}
|
|
279
|
+
*/
|
|
280
|
+
const isInBackground = function () {
|
|
281
|
+
return document.visibilityState === "hidden";
|
|
282
|
+
};
|
|
283
|
+
/**
|
|
284
|
+
* Get the optional source parameter.
|
|
285
|
+
* @returns {String} source
|
|
286
|
+
*/
|
|
287
|
+
const source = function () {
|
|
288
|
+
const source = (location.search.split(`source=`)[1] || "").split("&")[0];
|
|
289
|
+
return source === "" ? undefined : source;
|
|
290
|
+
};
|
|
291
|
+
/**
|
|
292
|
+
* Gathers all platform-, screen- and user-related information.
|
|
293
|
+
* @param {Boolean} detailed - Include personal data.
|
|
294
|
+
* @returns {Object} attributes - User-related information.
|
|
295
|
+
*/
|
|
296
|
+
const attributes = function (detailed = false) {
|
|
297
|
+
var _a;
|
|
298
|
+
const defaultData = {
|
|
299
|
+
siteLocation: (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.href,
|
|
300
|
+
siteReferrer: document.referrer,
|
|
301
|
+
source: source(),
|
|
302
|
+
};
|
|
303
|
+
const detailedData = {
|
|
304
|
+
siteLanguage: navigator
|
|
305
|
+
? ((navigator === null || navigator === void 0 ? void 0 : navigator.language) || (navigator === null || navigator === void 0 ? void 0 : navigator.language) || "").substr(0, 2)
|
|
306
|
+
: "",
|
|
307
|
+
screenWidth: screen.width,
|
|
308
|
+
screenHeight: screen.height,
|
|
309
|
+
screenColorDepth: screen.colorDepth,
|
|
310
|
+
browserWidth: window === null || window === void 0 ? void 0 : window.outerWidth,
|
|
311
|
+
browserHeight: window === null || window === void 0 ? void 0 : window.outerHeight,
|
|
312
|
+
};
|
|
313
|
+
return Object.assign(Object.assign({}, defaultData), (detailed === true ? detailedData : {}));
|
|
314
|
+
};
|
|
315
|
+
/**
|
|
316
|
+
* Creates an object with a query and variables property to create a record on the server.
|
|
317
|
+
* @param {String} domainId - Id of the domain.
|
|
318
|
+
* @param {Object} input - Data that should be transferred to the server.
|
|
319
|
+
* @returns {Object} Create record body.
|
|
320
|
+
*/
|
|
321
|
+
const createRecordBody = function (domainId, input) {
|
|
322
|
+
return {
|
|
323
|
+
query: `
|
|
324
|
+
mutation createRecord($domainId: ID!, $input: CreateRecordInput!) {
|
|
325
|
+
createRecord(domainId: $domainId, input: $input) {
|
|
326
|
+
payload {
|
|
327
|
+
id
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
`,
|
|
332
|
+
variables: {
|
|
333
|
+
domainId,
|
|
334
|
+
input,
|
|
335
|
+
},
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
/**
|
|
339
|
+
* Creates an object with a query and variables property to update a record on the server.
|
|
340
|
+
* @param {String} recordId - Id of the record.
|
|
341
|
+
* @returns {Object} Update record body.
|
|
342
|
+
*/
|
|
343
|
+
const updateRecordBody = function (recordId) {
|
|
344
|
+
return {
|
|
345
|
+
query: `
|
|
346
|
+
mutation updateRecord($recordId: ID!) {
|
|
347
|
+
updateRecord(id: $recordId) {
|
|
348
|
+
success
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
`,
|
|
352
|
+
variables: {
|
|
353
|
+
recordId,
|
|
354
|
+
},
|
|
355
|
+
};
|
|
356
|
+
};
|
|
357
|
+
/**
|
|
358
|
+
* Creates an object with a query and variables property to create an action on the server.
|
|
359
|
+
* @param {String} eventId - Id of the event.
|
|
360
|
+
* @param {Object} input - Data that should be transferred to the server.
|
|
361
|
+
* @returns {Object} Create action body.
|
|
362
|
+
*/
|
|
363
|
+
const createActionBody = function (eventId, input) {
|
|
364
|
+
return {
|
|
365
|
+
query: `
|
|
366
|
+
mutation createAction($eventId: ID!, $input: CreateActionInput!) {
|
|
367
|
+
createAction(eventId: $eventId, input: $input) {
|
|
368
|
+
payload {
|
|
369
|
+
id
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
`,
|
|
374
|
+
variables: {
|
|
375
|
+
eventId,
|
|
376
|
+
input,
|
|
377
|
+
},
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
/**
|
|
381
|
+
* Creates an object with a query and variables property to update an action on the server.
|
|
382
|
+
* @param {String} actionId - Id of the action.
|
|
383
|
+
* @param {Object} input - Data that should be transferred to the server.
|
|
384
|
+
* @returns {Object} Update action body.
|
|
385
|
+
*/
|
|
386
|
+
const updateActionBody = function (actionId, input) {
|
|
387
|
+
return {
|
|
388
|
+
query: `
|
|
389
|
+
mutation updateAction($actionId: ID!, $input: UpdateActionInput!) {
|
|
390
|
+
updateAction(id: $actionId, input: $input) {
|
|
391
|
+
success
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
`,
|
|
395
|
+
variables: {
|
|
396
|
+
actionId,
|
|
397
|
+
input,
|
|
398
|
+
},
|
|
399
|
+
};
|
|
400
|
+
};
|
|
401
|
+
/**
|
|
402
|
+
* Construct URL to the GraphQL endpoint of Ackee.
|
|
403
|
+
* @param {String} server - URL of the Ackee server.
|
|
404
|
+
* @returns {String} endpoint - URL to the GraphQL endpoint of the Ackee server.
|
|
405
|
+
*/
|
|
406
|
+
const endpoint = function (server) {
|
|
407
|
+
const hasTrailingSlash = server.substr(-1) === "/";
|
|
408
|
+
return server + (hasTrailingSlash === true ? "" : "/") + "api";
|
|
409
|
+
};
|
|
410
|
+
/**
|
|
411
|
+
* Sends a request to a specified URL.
|
|
412
|
+
* Won't catch all errors as some are already logged by the browser.
|
|
413
|
+
* In this case the callback won't fire.
|
|
414
|
+
* @param {String} url - URL to the GraphQL endpoint of the Ackee server.
|
|
415
|
+
* @param {Object} body - JSON which will be send to the server.
|
|
416
|
+
* @param {Object} opts - Options.
|
|
417
|
+
* @param {?Function} next - The callback that handles the response. Receives the following properties: json.
|
|
418
|
+
*/
|
|
419
|
+
const send = function (url, body, opts, next) {
|
|
420
|
+
const xhr = new XMLHttpRequest();
|
|
421
|
+
xhr.open("POST", url);
|
|
422
|
+
xhr.onload = () => {
|
|
423
|
+
if (xhr.status !== 200) {
|
|
424
|
+
throw new Error("Server returned with an unhandled status");
|
|
425
|
+
}
|
|
426
|
+
let json = null;
|
|
427
|
+
try {
|
|
428
|
+
json = JSON.parse(xhr.responseText);
|
|
429
|
+
}
|
|
430
|
+
catch (e) {
|
|
431
|
+
throw new Error("Failed to parse response from server");
|
|
432
|
+
}
|
|
433
|
+
if (json.errors != null) {
|
|
434
|
+
throw new Error(json.errors[0].message);
|
|
435
|
+
}
|
|
436
|
+
if (typeof next === "function") {
|
|
437
|
+
return next(json);
|
|
438
|
+
}
|
|
439
|
+
};
|
|
440
|
+
xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
|
|
441
|
+
// xhr.withCredentials = opts.ignoreOwnVisits ?? false;
|
|
442
|
+
xhr.withCredentials = false;
|
|
443
|
+
xhr.send(JSON.stringify(body));
|
|
444
|
+
};
|
|
445
|
+
/**
|
|
446
|
+
* Looks for an element with Ackee attributes and executes Ackee with the given attributes.
|
|
447
|
+
* Fails silently.
|
|
448
|
+
*/
|
|
449
|
+
const detect = function () {
|
|
450
|
+
const elem = document.querySelector("[data-ackee-domain-id]");
|
|
451
|
+
if (elem == null)
|
|
452
|
+
return;
|
|
453
|
+
const server = elem.getAttribute("data-ackee-server") || "";
|
|
454
|
+
const domainId = elem.getAttribute("data-ackee-domain-id") || "";
|
|
455
|
+
const opts = elem.getAttribute("data-ackee-opts") || "{}";
|
|
456
|
+
create(server, JSON.parse(opts)).record(domainId);
|
|
457
|
+
};
|
|
458
|
+
/**
|
|
459
|
+
* Creates a new instance.
|
|
460
|
+
* @param {String} server - URL of the Ackee server.
|
|
461
|
+
* @param {?Object} opts
|
|
462
|
+
* @returns {Object} instance
|
|
463
|
+
*/
|
|
464
|
+
const create = function (server, opts) {
|
|
465
|
+
opts = validate(opts);
|
|
466
|
+
const url = endpoint(server);
|
|
467
|
+
const noop = () => { };
|
|
468
|
+
// Fake instance when Ackee ignores you
|
|
469
|
+
const fakeInstance = {
|
|
470
|
+
record: () => ({ stop: noop }),
|
|
471
|
+
updateRecord: () => ({ stop: noop }),
|
|
472
|
+
action: noop,
|
|
473
|
+
updateAction: noop,
|
|
474
|
+
};
|
|
475
|
+
if (opts.ignoreLocalhost === true &&
|
|
476
|
+
isLocalhost(location.hostname) === true &&
|
|
477
|
+
isBrowser === true) {
|
|
478
|
+
// console.warn("Ackee ignores you because you are on localhost");
|
|
479
|
+
return fakeInstance;
|
|
480
|
+
}
|
|
481
|
+
if (isBot(navigator ? navigator.userAgent : "") === true) {
|
|
482
|
+
// console.warn("Ackee ignores you because you are a bot");
|
|
483
|
+
return fakeInstance;
|
|
484
|
+
}
|
|
485
|
+
// Creates a new record on the server and updates the record
|
|
486
|
+
// very x seconds to track the duration of the visit. Tries to use
|
|
487
|
+
// the default attributes when there're no custom attributes defined.
|
|
488
|
+
const _record = (domainId, attrs = attributes(opts.detailed), next) => {
|
|
489
|
+
// Function to stop updating the record
|
|
490
|
+
let isStopped = false;
|
|
491
|
+
const stop = () => {
|
|
492
|
+
isStopped = true;
|
|
493
|
+
};
|
|
494
|
+
send(url, createRecordBody(domainId, attrs), opts, (json) => {
|
|
495
|
+
const recordId = json.data.createRecord.payload.id;
|
|
496
|
+
if (isFakeId(recordId) === true) {
|
|
497
|
+
// return console.warn("Ackee ignores you because this is your own site");
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
const interval = setInterval(() => {
|
|
501
|
+
if (isStopped === true) {
|
|
502
|
+
clearInterval(interval);
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
if (isInBackground() === true)
|
|
506
|
+
return;
|
|
507
|
+
send(url, updateRecordBody(recordId), opts);
|
|
508
|
+
}, 15000);
|
|
509
|
+
if (typeof next === "function") {
|
|
510
|
+
return next(recordId);
|
|
511
|
+
}
|
|
512
|
+
});
|
|
513
|
+
return { stop };
|
|
514
|
+
};
|
|
515
|
+
// Updates a record very x seconds to track the duration of the visit
|
|
516
|
+
const _updateRecord = (recordId) => {
|
|
517
|
+
// Function to stop updating the record
|
|
518
|
+
let isStopped = false;
|
|
519
|
+
const stop = () => {
|
|
520
|
+
isStopped = true;
|
|
521
|
+
};
|
|
522
|
+
if (isFakeId(recordId) === true) {
|
|
523
|
+
// console.warn("Ackee ignores you because this is your own site");
|
|
524
|
+
return { stop };
|
|
525
|
+
}
|
|
526
|
+
const interval = setInterval(() => {
|
|
527
|
+
if (isStopped === true) {
|
|
528
|
+
clearInterval(interval);
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
531
|
+
if (isInBackground() === true)
|
|
532
|
+
return;
|
|
533
|
+
send(url, updateRecordBody(recordId));
|
|
534
|
+
}, 15000);
|
|
535
|
+
return { stop };
|
|
536
|
+
};
|
|
537
|
+
// Creates a new action on the server
|
|
538
|
+
const _action = (eventId, attrs, next) => {
|
|
539
|
+
send(url, createActionBody(eventId, attrs), opts, (json) => {
|
|
540
|
+
const actionId = json.data.createAction.payload.id;
|
|
541
|
+
if (isFakeId(actionId) === true) {
|
|
542
|
+
// return console.warn("Ackee ignores you because this is your own site");
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
if (typeof next === "function") {
|
|
546
|
+
return next(actionId);
|
|
547
|
+
}
|
|
548
|
+
});
|
|
549
|
+
};
|
|
550
|
+
// Updates an action
|
|
551
|
+
const _updateAction = (actionId, attrs) => {
|
|
552
|
+
if (isFakeId(actionId) === true) {
|
|
553
|
+
// return console.warn("Ackee ignores you because this is your own site");
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
556
|
+
send(url, updateActionBody(actionId, attrs));
|
|
557
|
+
};
|
|
558
|
+
// Return the real instance
|
|
559
|
+
return {
|
|
560
|
+
record: _record,
|
|
561
|
+
updateRecord: _updateRecord,
|
|
562
|
+
action: _action,
|
|
563
|
+
updateAction: _updateAction,
|
|
564
|
+
};
|
|
565
|
+
};
|
|
566
|
+
// Only run Ackee automatically when executed in a browser environment
|
|
567
|
+
if (isBrowser === true) {
|
|
568
|
+
detect();
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
const SocialsContext = createContext({
|
|
572
|
+
query: null,
|
|
573
|
+
});
|
|
574
|
+
const SocialsProvider = ({ children }) => {
|
|
575
|
+
const { authenticated } = useAuthState();
|
|
576
|
+
const { auth } = useContext(CampContext);
|
|
577
|
+
if (!auth) {
|
|
578
|
+
throw new Error("Auth instance is not available");
|
|
579
|
+
}
|
|
580
|
+
const query = useQuery({
|
|
581
|
+
queryKey: ["socials", authenticated],
|
|
582
|
+
queryFn: () => auth.getLinkedSocials(),
|
|
583
|
+
});
|
|
584
|
+
return (React.createElement(SocialsContext.Provider, { value: {
|
|
585
|
+
query,
|
|
586
|
+
} }, children));
|
|
587
|
+
};
|
|
588
|
+
|
|
589
|
+
function styleInject(css, ref) {
|
|
590
|
+
if ( ref === void 0 ) ref = {};
|
|
591
|
+
var insertAt = ref.insertAt;
|
|
592
|
+
|
|
593
|
+
if (!css || typeof document === 'undefined') { return; }
|
|
594
|
+
|
|
595
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
596
|
+
var style = document.createElement('style');
|
|
597
|
+
style.type = 'text/css';
|
|
598
|
+
|
|
599
|
+
if (insertAt === 'top') {
|
|
600
|
+
if (head.firstChild) {
|
|
601
|
+
head.insertBefore(style, head.firstChild);
|
|
602
|
+
} else {
|
|
603
|
+
head.appendChild(style);
|
|
604
|
+
}
|
|
605
|
+
} else {
|
|
606
|
+
head.appendChild(style);
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
if (style.styleSheet) {
|
|
610
|
+
style.styleSheet.cssText = css;
|
|
611
|
+
} else {
|
|
612
|
+
style.appendChild(document.createTextNode(css));
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
var css_248z$3 = ".toasts-module_toast-container__Bhoiq{bottom:10px;display:flex;flex-direction:column-reverse;gap:10px;position:fixed;right:10px;z-index:1000}.toasts-module_toast__C-fnX{word-wrap:break-word;border-radius:5px;box-shadow:0 2px 10px rgba(0,0,0,.1);color:#fff;cursor:pointer;font-size:14px;max-width:300px;opacity:.9;padding:10px 20px;position:relative}.toasts-module_toast-info__ho5FH{background-color:#007bff}.toasts-module_toast-warning__KTUFG{background-color:#cc4e02}.toasts-module_toast-error__-y03G{background-color:#dc3545}.toasts-module_toast-success__qgwDJ{background-color:#28a745}.toasts-module_toast-enter__Gduwi{animation:toasts-module_toast-in__uFYoe .3s forwards}.toasts-module_toast-exit__obsng{animation:toasts-module_toast-out__-c3s6 .3s forwards}@keyframes toasts-module_toast-in__uFYoe{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes toasts-module_toast-out__-c3s6{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(20px)}}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRvYXN0cy5tb2R1bGUuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLHNDQUVFLFdBQVksQ0FHWixZQUFhLENBQ2IsNkJBQThCLENBQzlCLFFBQVMsQ0FOVCxjQUFlLENBRWYsVUFBVyxDQUNYLFlBSUYsQ0FFQSw0QkFVRSxvQkFBcUIsQ0FSckIsaUJBQWtCLENBR2xCLG9DQUF5QyxDQUZ6QyxVQUFXLENBSVgsY0FBZSxDQUhmLGNBQWUsQ0FLZixlQUFnQixDQUhoQixVQUFZLENBT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1cclxuXHJcbi50b2FzdC13YXJuaW5nIHtcclxuICBiYWNrZ3JvdW5kLWNvbG9yOiAjY2M0ZTAyO1xyXG59XHJcblxyXG4udG9hc3QtZXJyb3Ige1xyXG4gIGJhY2tncm91bmQtY29sb3I6ICNkYzM1NDU7XHJcbn1cclxuXHJcbi50b2FzdC1zdWNjZXNzIHtcclxuICBiYWNrZ3JvdW5kLWNvbG9yOiAjMjhhNzQ1O1xyXG59XHJcblxyXG4udG9hc3QtZW50ZXIge1xyXG4gIGFuaW1hdGlvbjogdG9hc3QtaW4gMC4zcyBmb3J3YXJkcztcclxufVxyXG5cclxuLnRvYXN0LWV4aXQge1xyXG4gIGFuaW1hdGlvbjogdG9hc3Qtb3V0IDAuM3MgZm9yd2FyZHM7XHJcbn1cclxuXHJcbkBrZXlmcmFtZXMgdG9hc3QtaW4ge1xyXG4gIGZyb20ge1xyXG4gICAgb3BhY2l0eTogMDtcclxuICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlWSgyMHB4KTtcclxuICB9XHJcbiAgdG8ge1xyXG4gICAgb3BhY2l0eTogMTtcclxuICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlWSgwKTtcclxuICB9XHJcbn1cclxuXHJcbkBrZXlmcmFtZXMgdG9hc3Qtb3V0IHtcclxuICBmcm9tIHtcclxuICAgIG9wYWNpdHk6IDE7XHJcbiAgICB0cmFuc2Zvcm06IHRyYW5zbGF0ZVkoMCk7XHJcbiAgfVxyXG4gIHRvIHtcclxuICAgIG9wYWNpdHk6IDA7XHJcbiAgICB0cmFuc2Zvcm06IHRyYW5zbGF0ZVkoMjBweCk7XHJcbiAgfVxyXG59XHJcbiJdfQ== */";
|
|
617
|
+
var styles$2 = {"toast-container":"toasts-module_toast-container__Bhoiq","toast":"toasts-module_toast__C-fnX","toast-info":"toasts-module_toast-info__ho5FH","toast-warning":"toasts-module_toast-warning__KTUFG","toast-error":"toasts-module_toast-error__-y03G","toast-success":"toasts-module_toast-success__qgwDJ","toast-enter":"toasts-module_toast-enter__Gduwi","toast-in":"toasts-module_toast-in__uFYoe","toast-exit":"toasts-module_toast-exit__obsng","toast-out":"toasts-module_toast-out__-c3s6"};
|
|
618
|
+
styleInject(css_248z$3);
|
|
619
|
+
|
|
620
|
+
var css_248z$2 = ".tooltip-module_tooltip-container__X8blY{display:inline-block;min-height:-moz-fit-content;min-height:fit-content;position:relative}.tooltip-module_tooltip__IN7yd{border-radius:.25rem;font-size:.875rem;font-weight:500;min-height:-moz-fit-content;min-height:fit-content;opacity:0;padding:.5rem;position:absolute;transition:opacity .2s ease,visibility .2s ease;visibility:hidden;white-space:nowrap;z-index:100}@keyframes tooltip-module_fadeIn__KR3aX{0%{opacity:0;visibility:hidden}to{opacity:1;visibility:visible}}@keyframes tooltip-module_fadeOut__JJntn{0%{opacity:1;visibility:visible}to{opacity:0;visibility:hidden}}.tooltip-module_tooltip__IN7yd.tooltip-module_show__0eq9c{animation:tooltip-module_fadeIn__KR3aX .2s ease-in-out forwards}.tooltip-module_tooltip__IN7yd.tooltip-module_top__5rD4C{bottom:100%;left:50%;margin-bottom:.5rem;transform:translateX(-50%)}.tooltip-module_tooltip__IN7yd.tooltip-module_bottom__Bk3EH{left:50%;margin-top:.5rem;top:100%;transform:translateX(-50%)}.tooltip-module_tooltip__IN7yd.tooltip-module_left__PRFtS{margin-right:.5rem;right:100%;top:50%;transform:translateY(-50%)}.tooltip-module_tooltip__IN7yd.tooltip-module_right__nQugl{left:100%;margin-left:.5rem;top:50%;transform:translateY(-50%)}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRvb2x0aXAubW9kdWxlLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSx5Q0FFRSxvQkFBcUIsQ0FDckIsMkJBQXVCLENBQXZCLHNCQUF1QixDQUZ2QixpQkFHRixDQUVBLCtCQUdFLG9CQUFzQixDQUN0QixpQkFBbUIsQ0FDbkIsZUFBZ0Is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HJcbiAgdG9wOiA1MCU7XHJcbiAgdHJhbnNmb3JtOiB0cmFuc2xhdGVZKC01MCUpO1xyXG4gIG1hcmdpbi1yaWdodDogMC41cmVtO1xyXG59XHJcblxyXG4udG9vbHRpcC5yaWdodCB7XHJcbiAgbGVmdDogMTAwJTtcclxuICB0b3A6IDUwJTtcclxuICB0cmFuc2Zvcm06IHRyYW5zbGF0ZVkoLTUwJSk7XHJcbiAgbWFyZ2luLWxlZnQ6IDAuNXJlbTtcclxufVxyXG4iXX0= */";
|
|
621
|
+
var styles$1 = {"tooltip-container":"tooltip-module_tooltip-container__X8blY","tooltip":"tooltip-module_tooltip__IN7yd","show":"tooltip-module_show__0eq9c","fadeIn":"tooltip-module_fadeIn__KR3aX","top":"tooltip-module_top__5rD4C","bottom":"tooltip-module_bottom__Bk3EH","left":"tooltip-module_left__PRFtS","right":"tooltip-module_right__nQugl","fadeOut":"tooltip-module_fadeOut__JJntn"};
|
|
622
|
+
styleInject(css_248z$2);
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* Tooltip component to wrap other components and display a tooltip on hover.
|
|
626
|
+
* Uses portals to render the tooltip outside of its parent container.
|
|
627
|
+
* @param {TooltipProps} props The props for the Tooltip component.
|
|
628
|
+
* @returns {JSX.Element} The Tooltip component.
|
|
629
|
+
*/
|
|
630
|
+
const Tooltip = ({ content, position = "top", backgroundColor = "#333", textColor = "#fff", containerStyle = {}, children, }) => {
|
|
631
|
+
const [isVisible, setIsVisible] = useState(true);
|
|
632
|
+
const [tooltipPosition, setTooltipPosition] = useState(null);
|
|
633
|
+
const handleMouseEnter = (e) => {
|
|
634
|
+
setIsVisible(true);
|
|
635
|
+
setTooltipPosition(e.currentTarget.getBoundingClientRect());
|
|
636
|
+
};
|
|
637
|
+
const handleMouseLeave = () => {
|
|
638
|
+
setIsVisible(false);
|
|
639
|
+
setTooltipPosition(null);
|
|
640
|
+
};
|
|
641
|
+
const tooltipStyles = Object.assign({ backgroundColor, color: textColor, position: "absolute", zIndex: 1000 }, getTooltipPosition(tooltipPosition, position));
|
|
642
|
+
return (React.createElement("div", { className: styles$1["tooltip-container"], onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: containerStyle },
|
|
643
|
+
children,
|
|
644
|
+
isVisible &&
|
|
645
|
+
tooltipPosition &&
|
|
646
|
+
ReactDOM.createPortal(React.createElement("div", { className: `${styles$1.tooltip} ${styles$1[position]} ${styles$1["show"]}`, style: tooltipStyles }, content), document.body)));
|
|
647
|
+
};
|
|
648
|
+
/**
|
|
649
|
+
* Calculate the position of the tooltip based on the target element's position and the desired tooltip position.
|
|
650
|
+
* Adjusts the position to ensure the tooltip stays within the viewport.
|
|
651
|
+
* @param {DOMRect | null} rect The bounding client rect of the target element.
|
|
652
|
+
* @param {"top" | "bottom" | "left" | "right"} position The desired tooltip position.
|
|
653
|
+
* @returns {CSSProperties} The calculated position styles for the tooltip.
|
|
654
|
+
*/
|
|
655
|
+
const getTooltipPosition = (rect, position) => {
|
|
656
|
+
if (!rect)
|
|
657
|
+
return {};
|
|
658
|
+
const spacing = 8; // Space between the tooltip and the target element
|
|
659
|
+
const viewportWidth = window.innerWidth;
|
|
660
|
+
const viewportHeight = window.innerHeight;
|
|
661
|
+
let top = 0, left = 0, transform = "";
|
|
662
|
+
switch (position) {
|
|
663
|
+
case "top":
|
|
664
|
+
top = rect.top - spacing;
|
|
665
|
+
left = rect.left + rect.width / 2;
|
|
666
|
+
transform = "translate(-50%, -100%)";
|
|
667
|
+
if (top < 0) {
|
|
668
|
+
top = rect.bottom + spacing;
|
|
669
|
+
transform = "translate(-50%, 0)";
|
|
670
|
+
}
|
|
671
|
+
break;
|
|
672
|
+
case "bottom":
|
|
673
|
+
top = rect.bottom + spacing;
|
|
674
|
+
left = rect.left + rect.width / 2;
|
|
675
|
+
transform = "translate(-50%, 0)";
|
|
676
|
+
if (top > viewportHeight) {
|
|
677
|
+
top = rect.top - spacing;
|
|
678
|
+
transform = "translate(-50%, -100%)";
|
|
679
|
+
}
|
|
680
|
+
break;
|
|
681
|
+
case "left":
|
|
682
|
+
top = rect.top + rect.height / 2;
|
|
683
|
+
left = rect.left - spacing;
|
|
684
|
+
transform = "translate(-100%, -50%)";
|
|
685
|
+
if (left < 0) {
|
|
686
|
+
left = rect.right + spacing;
|
|
687
|
+
transform = "translate(0, -50%)";
|
|
688
|
+
}
|
|
689
|
+
break;
|
|
690
|
+
case "right":
|
|
691
|
+
top = rect.top + rect.height / 2;
|
|
692
|
+
left = rect.right + spacing;
|
|
693
|
+
transform = "translate(0, -50%)";
|
|
694
|
+
if (left > viewportWidth) {
|
|
695
|
+
left = rect.left - spacing;
|
|
696
|
+
transform = "translate(-100%, -50%)";
|
|
697
|
+
}
|
|
698
|
+
break;
|
|
699
|
+
}
|
|
700
|
+
return { top, left, transform };
|
|
701
|
+
};
|
|
702
|
+
|
|
703
|
+
var css_248z$1 = "@import url(\"https://api.fontshare.com/v2/css?f[]=satoshi@1&display=swap\");.auth-module_modal__yyg5L{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background-color:#000;background-color:rgba(0,0,0,.4);height:100%;left:0;overflow:auto;position:fixed;top:0;transition:all .3s;width:100%;z-index:85}.auth-module_modal__yyg5L .auth-module_outer-container__RraOQ{align-items:center;box-sizing:border-box;display:flex;flex-direction:row;font-family:Satoshi,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;justify-content:center;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);@media screen and (max-width:440px){border-bottom-left-radius:0;border-bottom-right-radius:0;bottom:0;top:auto;transform:translate(-50%);width:100%}}.auth-module_outer-container__RraOQ .auth-module_container__7utns{align-items:center;background-color:#fefefe;border:1px solid #888;border-radius:1.5rem;box-sizing:border-box;flex-direction:column;justify-content:center;padding:1.5rem 1.5rem 1rem;position:relative;text-align:center;width:400px;@media screen and (max-width:440px){border-radius:0;height:auto;max-height:100vh;overflow-y:auto;padding-bottom:1rem;padding-bottom:.5rem;padding-left:1rem;padding-right:1rem;padding-top:1rem;width:100%}}.auth-module_container__7utns.auth-module_linking-container__mYNwD{max-width:300px}.auth-module_origin-tab__miOUK{align-items:center;display:flex;flex-direction:column;gap:.5rem;height:100%;justify-content:space-between;width:100%}.auth-module_origin-section__UBhBB{align-items:center;display:flex;flex-direction:row;gap:.5rem;justify-content:space-evenly;width:100%}.auth-module_origin-section__UBhBB .auth-module_origin-container__ZIk4c{align-items:center;color:#333;display:flex;flex-direction:column;font-size:.875rem;font-weight:400;justify-content:center;margin-bottom:.5rem;margin-top:.5rem;min-height:3rem;min-width:1rem;text-align:center;width:100%}.auth-module_origin-wrapper__JQfEI{align-items:center;display:flex;flex-direction:column;gap:.5rem;justify-content:center;width:100%}.auth-module_origin-container__ZIk4c .auth-module_origin-label__l-1q9{color:#777;font-size:.75rem;font-weight:400;margin-bottom:.25rem;text-align:center}.auth-module_horizontal-divider__YfWCy{background-color:#ddd;height:1px;margin-bottom:.5rem;margin-top:.5rem;width:100%}.auth-module_origin-section__UBhBB .auth-module_divider__z65Me{background-color:#ddd;height:1rem;width:1px}.auth-module_origin-dashboard-button__-pch4{align-items:center;border:none;color:#ff6f00;display:flex;flex-direction:row;font-size:.875rem;gap:.5rem;justify-content:center;padding:.25rem;width:100%}.auth-module_origin-dashboard-button__-pch4:hover{color:#cc4e02;cursor:pointer}.auth-module_origin-dashboard-button__-pch4:disabled{background-color:#ccc;cursor:not-allowed}.auth-module_container__7utns h2{font-size:1.25rem;margin-bottom:1rem;margin-top:0}.auth-module_container__7utns .auth-module_header__pX9nM{align-items:center;color:#333;display:flex;flex-direction:row;font-weight:700;gap:.5rem;justify-content:flex-start;margin-bottom:1rem;text-align:left;width:100%;@media screen and (max-width:440px){margin-bottom:.5rem;margin-top:0}}.auth-module_linking-container__mYNwD .auth-module_header__pX9nM{justify-content:center}.auth-module_container__7utns .auth-module_auth-header__LsM1f{align-items:center;color:#333;display:flex;flex-direction:column;font-weight:700;justify-content:center;margin-bottom:1rem;text-align:center;width:100%}.auth-module_container__7utns .auth-module_header__pX9nM .auth-module_small-modal-icon__YayD1{height:2rem;margin-bottom:.5rem;margin-top:.5rem;width:2rem}.auth-module_container__7utns .auth-module_header__pX9nM .auth-module_wallet-address__AVVA5{color:#777;font-size:.75rem;font-weight:400;margin-top:.2rem}.auth-module_container__7utns .auth-module_close-button__uZrho{background-color:#fff;border:2px solid #ddd;border-radius:100%;color:#aaa;font-size:1.5rem;height:1.25rem;position:absolute;right:1rem;top:1rem;transition:color .15s;width:1.25rem}.auth-module_close-button__uZrho>.auth-module_close-icon__SSCni{display:block;height:1rem;padding:.15rem;position:relative;width:1rem}.auth-module_container__7utns .auth-module_close-button__uZrho:hover{background-color:#ddd;color:#888;cursor:pointer}.auth-module_container__7utns .auth-module_linking-text__uz3ud{color:#777;font-size:1rem;text-align:center}.auth-module_provider-list__6vISy{box-sizing:border-box;display:flex;flex-direction:column;gap:.5rem;margin-bottom:.75rem;max-height:17.9rem;overflow-y:auto;padding-left:.5rem;padding-right:.5rem;scrollbar-color:#ccc #f1f1f1;scrollbar-width:thin;width:100%}.auth-module_provider-list__6vISy.auth-module_big__jQxvN{max-height:16rem}.auth-module_provider-list__6vISy::-webkit-scrollbar{border-radius:.25rem;width:.5rem}.auth-module_provider-list__6vISy::-webkit-scrollbar-thumb{background-color:#ccc;border-radius:.25rem}.auth-module_provider-list__6vISy::-webkit-scrollbar-track{background-color:#f1f1f1;border-radius:.25rem}.auth-module_spinner__hfzlH:after{animation:auth-module_spin__tm9l6 1s linear infinite;border:.25rem solid #f3f3f3;border-radius:50%;border-top-color:#ff6f00;content:\"\";display:block;height:1rem;width:1rem}.auth-module_spinner__hfzlH{align-self:center;display:flex;justify-content:center;margin-left:auto;margin-right:.25rem}@keyframes auth-module_spin__tm9l6{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.auth-module_modal-icon__CV7ah{align-items:center;display:flex;height:4rem;justify-content:center;margin-bottom:.25rem;margin-top:.5rem;padding:.35rem;width:4rem}.auth-module_modal-icon__CV7ah svg{height:3.6rem;width:3.6rem}.auth-module_container__7utns a.auth-module_footer-text__CQnh6{color:#bbb;font-size:.75rem;text-decoration:none}.auth-module_container__7utns a.auth-module_footer-text__CQnh6:hover{text-decoration:underline}.auth-module_disconnect-button__bsu-3{background-color:#ff6f00;border:none;border-radius:.75rem;box-shadow:inset 0 2px 0 hsla(0,0%,100%,.15),inset 0 -2px 4px rgba(0,0,0,.05),0 1px 1px rgba(46,54,80,.075);color:#fff;font-size:1rem;height:2.5rem;margin-bottom:.75rem;margin-top:1rem;padding:1rem;padding-block:0;width:100%}.auth-module_disconnect-button__bsu-3:hover{background-color:#cc4e02;cursor:pointer}.auth-module_disconnect-button__bsu-3:disabled{background-color:#ccc;cursor:not-allowed}.auth-module_linking-button__g1GlL{background-color:#ff6f00;border:none;border-radius:.75rem;box-shadow:inset 0 2px 0 hsla(0,0%,100%,.15),inset 0 -2px 4px rgba(0,0,0,.05),0 1px 1px rgba(46,54,80,.075);color:#fff;font-size:1rem;height:2.5rem;margin-bottom:.75rem;margin-top:1rem;padding:1rem;padding-block:0;width:100%}.auth-module_linking-button__g1GlL:hover{background-color:#cc4e02;cursor:pointer}.auth-module_linking-button__g1GlL:disabled{background-color:#ccc;cursor:not-allowed}.auth-module_socials-wrapper__PshV3{display:flex;flex-direction:column;gap:1rem;margin-block:.5rem;width:100%}.auth-module_socials-container__iDzfJ{display:flex;flex-direction:column;gap:.5rem;width:100%}.auth-module_socials-container__iDzfJ .auth-module_connector-container__4wn11{align-items:center;display:flex;gap:.25rem;justify-content:flex-start;position:relative}.auth-module_socials-container__iDzfJ .auth-module_connector-button__j79HA{align-items:center;background-color:#fefefe;border:1px solid #ddd;border-radius:.75rem;color:#333;display:flex;font-size:.875rem;gap:.25rem;height:2.5rem;padding:.75rem;position:relative;width:100%}.auth-module_socials-container__iDzfJ .auth-module_connector-button__j79HA:hover{background-color:#ddd;cursor:pointer}.auth-module_socials-container__iDzfJ .auth-module_connector-button__j79HA:disabled{background-color:#fefefe;cursor:default}.auth-module_socials-container__iDzfJ .auth-module_connector-button__j79HA svg{color:#333;height:1.5rem;margin-right:.5rem;width:1.5rem}.auth-module_socials-container__iDzfJ .auth-module_connector-connected__JvDQb{align-items:center;background-color:#eee;border:1px solid #ddd;border-radius:.25rem;color:#333;display:flex;flex:1;font-size:.875rem;gap:.25rem;padding:.5rem .75rem;position:relative;width:100%}.auth-module_socials-container__iDzfJ .auth-module_connector-connected__JvDQb svg{color:#333;height:1.5rem;margin-right:.5rem;width:1.5rem}.auth-module_socials-container__iDzfJ h3{color:#333;margin:0}.auth-module_connector-button__j79HA .auth-module_connector-checkmark__ZS6zU{height:1rem!important;position:absolute;right:-.5rem;top:-.5rem;width:1rem!important}.auth-module_unlink-connector-button__6Fwkp{align-items:center;background-color:#999;border:none;border-radius:.5rem;box-shadow:inset 0 2px 0 hsla(0,0%,100%,.15),inset 0 -2px 4px rgba(0,0,0,.05),0 1px 1px rgba(46,54,80,.075);color:#fff;display:flex;font-size:.75rem;gap:.25rem;padding:.25rem .675rem .25rem .5rem;position:absolute;right:.375rem;text-align:center;transition:background-color .15s}.auth-module_unlink-connector-button__6Fwkp svg{stroke:#fff!important;height:.875rem!important;margin-right:0!important;width:.875rem!important}.auth-module_unlink-connector-button__6Fwkp:hover{background-color:#888;cursor:pointer}.auth-module_unlink-connector-button__6Fwkp:disabled{background-color:#ccc;cursor:not-allowed}@keyframes auth-module_loader__gH3ZC{0%{transform:translateX(0)}50%{transform:translateX(100%)}to{transform:translateX(0)}}.auth-module_loader__gH3ZC{background-color:#ddd;border-radius:.125rem;height:.4rem;margin-bottom:.5rem;margin-top:.5rem;position:relative;width:4rem}.auth-module_loader__gH3ZC:before{animation:auth-module_loader__gH3ZC 1.5s ease-in-out infinite;background-color:#ff6f00;border-radius:.125rem;content:\"\";display:block;height:.4rem;left:0;position:absolute;width:2rem}.auth-module_no-socials__wEx0t{color:#777;font-size:.875rem;margin-top:.5rem;text-align:center}.auth-module_divider__z65Me{align-items:center;display:flex;gap:.5rem;margin-bottom:.5rem;margin-top:.5rem}.auth-module_divider__z65Me:after,.auth-module_divider__z65Me:before{border-bottom:1px solid #ddd;content:\"\";flex:1}input.auth-module_tiktok-input__FeqdG{border:1px solid gray;border-radius:.75rem;color:#000;font-family:Satoshi,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-size:1rem;font-weight:600;height:2.75rem;line-height:1.333rem;margin-top:1rem;padding-inline:1rem;width:100%}input.auth-module_tiktok-input__FeqdG.auth-module_invalid__qqgK6{border-color:#dc3545;outline-color:#dc3545}.auth-module_otp-input-container__B2NH6{display:flex;gap:.5rem;justify-content:center;margin-top:1rem}.auth-module_otp-input__vjImt{border:1px solid #ccc;border-radius:.5rem;font-size:1.5rem;height:2.5rem;outline:none;text-align:center;transition:border-color .2s;width:2rem}.auth-module_otp-input__vjImt:focus{border-color:#ff6f00}.auth-module_tabs__RcUmV{display:flex;justify-content:flex-start;margin-bottom:calc(-.5rem - 1px);max-width:100%;overflow-x:auto}.auth-module_tabs__RcUmV::-webkit-scrollbar{display:none}.auth-module_tabs__RcUmV::-webkit-scrollbar-thumb{background-color:#ccc;border-radius:.25rem}.auth-module_tab-button__HT6wc{background-color:#fefefe;border-right:2px solid #ddd;cursor:pointer;font-size:.875rem;padding:.5rem 1rem;text-align:left;transition:background-color .2s}.auth-module_tab-button__HT6wc:hover{background-color:#eee}.auth-module_active-tab__l6P44{border-right-color:#ff6f00}.auth-module_tab-content__noHF0{height:20rem;margin-top:.25rem;min-height:20rem;width:100%}.auth-module_vertical-tabs-container__6sAOL{box-sizing:border-box;display:flex;flex-direction:row;gap:.5rem;width:100%}.auth-module_vertical-tabs__-ba-W{display:flex;flex-direction:column;gap:.25rem;height:100%;margin-left:-1rem;min-width:-moz-fit-content!important;min-width:fit-content!important;overflow-y:auto}.auth-module_vertical-tab-content__wTqKF{background-color:#f9f9f9;border:1px solid #ddd;border-radius:.25rem;flex:1 1 0%;height:22rem;max-width:100%;min-height:22rem;overflow:hidden;padding:1rem}.auth-module_ip-tab-container__ck0F8{justify-content:space-between}.auth-module_ip-tab-container__ck0F8,.auth-module_ip-tab-content__VI4zC{align-items:center;display:flex;flex-direction:column;gap:1rem;height:100%;width:100%}.auth-module_ip-tab-content__VI4zC{justify-content:center}.auth-module_ip-tab-content-text__y2BRh{color:#777;font-size:.875rem;margin-top:.5rem;text-align:center}.auth-module_contract-button-container__7HH9n{align-items:center;display:flex;flex-direction:column;gap:1rem;margin-top:1rem}.auth-module_contract-input__4BYcs{border:1px solid #ccc;border-radius:.5rem;font-size:1rem;max-width:300px;outline:none;padding:.5rem;transition:border-color .2s;width:100%}.auth-module_contract-input__4BYcs:focus{border-color:#ff6f00}.auth-module_contract-button__Cq6zI{background-color:#ff6f00;border:none;border-radius:.5rem;color:#fff;cursor:pointer;font-size:1rem;padding:.75rem 1.5rem;transition:background-color .2s}.auth-module_contract-button__Cq6zI:hover{background-color:#cc4e02}.auth-module_contract-button__Cq6zI:disabled{background-color:#ccc;cursor:not-allowed}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImF1dGgubW9kdWxlLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSwwRUFBMEUsQ0FFMUUsMEJBVUUsaUNBQTBCLENBQTFCLHlCQUEwQixDQUYxQixxQkFBOEIsQ0FDOUIsK0JBQW9DLENBSHBDLFdBQVksQ0FIWixNQUFPLENBSVAsYUFBYyxDQU5kLGNBQWUsQ0FHZixLQUFNLENBT04sa0JBQW9CLENBTnBCLFVBQVcsQ0FIWCxVQVVGLENBRUEsOERBUUUsa0JBQW1CLENBUG5CLHFCQUFzQixDQUl0QixZQUFhLENBQ2Isa0JBQW1CLENBSm5CLDBJQUVZLENBR1osc0JBQXVCLENBSXZ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b3VuZC1jb2xvcjogI2NjYztcclxuICBjdXJzb3I6IG5vdC1hbGxvd2VkO1xyXG59XHJcbiJdfQ== */";
|
|
704
|
+
var styles = {"modal":"auth-module_modal__yyg5L","outer-container":"auth-module_outer-container__RraOQ","container":"auth-module_container__7utns","linking-container":"auth-module_linking-container__mYNwD","origin-tab":"auth-module_origin-tab__miOUK","origin-section":"auth-module_origin-section__UBhBB","origin-container":"auth-module_origin-container__ZIk4c","origin-wrapper":"auth-module_origin-wrapper__JQfEI","origin-label":"auth-module_origin-label__l-1q9","horizontal-divider":"auth-module_horizontal-divider__YfWCy","divider":"auth-module_divider__z65Me","origin-dashboard-button":"auth-module_origin-dashboard-button__-pch4","header":"auth-module_header__pX9nM","auth-header":"auth-module_auth-header__LsM1f","small-modal-icon":"auth-module_small-modal-icon__YayD1","wallet-address":"auth-module_wallet-address__AVVA5","close-button":"auth-module_close-button__uZrho","close-icon":"auth-module_close-icon__SSCni","linking-text":"auth-module_linking-text__uz3ud","provider-list":"auth-module_provider-list__6vISy","big":"auth-module_big__jQxvN","spinner":"auth-module_spinner__hfzlH","spin":"auth-module_spin__tm9l6","modal-icon":"auth-module_modal-icon__CV7ah","footer-text":"auth-module_footer-text__CQnh6","disconnect-button":"auth-module_disconnect-button__bsu-3","linking-button":"auth-module_linking-button__g1GlL","socials-wrapper":"auth-module_socials-wrapper__PshV3","socials-container":"auth-module_socials-container__iDzfJ","connector-container":"auth-module_connector-container__4wn11","connector-button":"auth-module_connector-button__j79HA","connector-connected":"auth-module_connector-connected__JvDQb","connector-checkmark":"auth-module_connector-checkmark__ZS6zU","unlink-connector-button":"auth-module_unlink-connector-button__6Fwkp","loader":"auth-module_loader__gH3ZC","no-socials":"auth-module_no-socials__wEx0t","tiktok-input":"auth-module_tiktok-input__FeqdG","invalid":"auth-module_invalid__qqgK6","otp-input-container":"auth-module_otp-input-container__B2NH6","otp-input":"auth-module_otp-input__vjImt","tabs":"auth-module_tabs__RcUmV","tab-button":"auth-module_tab-button__HT6wc","active-tab":"auth-module_active-tab__l6P44","tab-content":"auth-module_tab-content__noHF0","vertical-tabs-container":"auth-module_vertical-tabs-container__6sAOL","vertical-tabs":"auth-module_vertical-tabs__-ba-W","vertical-tab-content":"auth-module_vertical-tab-content__wTqKF","ip-tab-container":"auth-module_ip-tab-container__ck0F8","ip-tab-content":"auth-module_ip-tab-content__VI4zC","ip-tab-content-text":"auth-module_ip-tab-content-text__y2BRh","contract-button-container":"auth-module_contract-button-container__7HH9n","contract-input":"auth-module_contract-input__4BYcs","contract-button":"auth-module_contract-button__Cq6zI"};
|
|
705
|
+
styleInject(css_248z$1);
|
|
706
|
+
|
|
707
|
+
const getIconBySocial = (social) => {
|
|
708
|
+
switch (social) {
|
|
709
|
+
case "twitter":
|
|
710
|
+
return TwitterIcon;
|
|
711
|
+
case "spotify":
|
|
712
|
+
return SpotifyIcon;
|
|
713
|
+
case "discord":
|
|
714
|
+
return DiscordIcon;
|
|
715
|
+
case "tiktok":
|
|
716
|
+
return TikTokIcon;
|
|
717
|
+
case "telegram":
|
|
718
|
+
return TelegramIcon;
|
|
719
|
+
default:
|
|
720
|
+
return () => React.createElement(React.Fragment, null);
|
|
721
|
+
}
|
|
722
|
+
};
|
|
723
|
+
const CheckMarkIcon = ({ w, h }) => (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: w || "1rem", height: h || "1rem" },
|
|
724
|
+
React.createElement("path", { d: "M20 6L9 17l-5-5" })));
|
|
725
|
+
const XMarkIcon = ({ w, h }) => (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: w || "1rem", height: h || "1rem" },
|
|
726
|
+
React.createElement("path", { d: "M18 6L6 18" }),
|
|
727
|
+
React.createElement("path", { d: "M6 6l12 12" })));
|
|
728
|
+
const LinkIcon = ({ w, h }) => (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: w || "1rem", height: h || "1rem" },
|
|
729
|
+
React.createElement("path", { d: "M14 4h-13v18h20v-11h1v12h-22v-20h14v1zm10 5h-1v-6.293l-11.646 11.647-.708-.708 11.647-11.646h-6.293v-1h8v8z" })));
|
|
730
|
+
const BinIcon = ({ w, h }) => (React.createElement("svg", { clipRule: "evenodd", fillRule: "evenodd", strokeLinejoin: "round", strokeMiterlimit: "2", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", width: w || "1rem", height: h || "1rem" },
|
|
731
|
+
React.createElement("path", { d: "m4.015 5.494h-.253c-.413 0-.747-.335-.747-.747s.334-.747.747-.747h5.253v-1c0-.535.474-1 1-1h4c.526 0 1 .465 1 1v1h5.254c.412 0 .746.335.746.747s-.334.747-.746.747h-.254v15.435c0 .591-.448 1.071-1 1.071-2.873 0-11.127 0-14 0-.552 0-1-.48-1-1.071zm14.5 0h-13v15.006h13zm-4.25 2.506c-.414 0-.75.336-.75.75v8.5c0 .414.336.75.75.75s.75-.336.75-.75v-8.5c0-.414-.336-.75-.75-.75zm-4.5 0c-.414 0-.75.336-.75.75v8.5c0 .414.336.75.75.75s.75-.336.75-.75v-8.5c0-.414-.336-.75-.75-.75zm3.75-4v-.5h-3v.5z", fillRule: "nonzero" })));
|
|
732
|
+
const CampIcon = ({ customStyles }) => (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 571.95 611.12", height: "1rem", width: "1rem", fill: "currentColor", style: customStyles },
|
|
733
|
+
React.createElement("path", { d: "m563.25 431.49-66.17-51.46c-11.11-8.64-27.28-5.06-33.82 7.4-16.24 30.9-41.69 56.36-70.85 73.73l-69.35-69.35c-3.73-3.73-8.79-5.83-14.07-5.83s-10.34 2.1-14.07 5.83l-73.78 73.78c-57.37-30.39-96.55-90.71-96.55-160.03 0-99.79 81.19-180.98 180.98-180.98 60.35 0 118.17 26.28 156.39 89.44 6.85 11.32 21.92 14.33 32.59 6.51l64.21-47.06c9.53-6.98 12.06-20.15 5.78-30.16C508.83 54.41 411.43 0 305.56 0 137.07 0 0 137.07 0 305.56s137.07 305.56 305.56 305.56c57.6 0 113.72-16.13 162.31-46.63A306.573 306.573 0 0 0 568.8 460.8c5.78-9.78 3.42-22.34-5.55-29.31Zm-301.42 49.69 47.15-47.15 44.69 44.69c-15.92 5.1-32.2 7.83-48.1 7.83-15.08 0-29.72-1.87-43.74-5.36Zm42.36-222.47c-.07 1.49-.08 21.29 49.54 55.11 37.02 25.24 19.68 75.52 12.1 92.05a147.07 147.07 0 0 0-20.12-38.91c-12.73-17.59-26.87-28.9-36.74-35.59-10.38 6.36-27.41 18.74-41.07 40.02-8.27 12.89-12.82 25.16-15.42 34.48l-.03-.05c-15.1-40.6-9.75-60.88-1.95-71.9 6.12-8.65 17.24-20.6 17.24-20.6 9.71-9.66 19.96-19.06 29.82-38.17 6.06-11.75 6.59-15.84 6.63-16.45Z", fill: "#000", strokeWidth: "0" }),
|
|
734
|
+
React.createElement("path", { d: "M267.74 313.33s-11.11 11.95-17.24 20.6c-7.8 11.02-13.14 31.3 1.95 71.9-86.02-75.3 2.56-152.15.79-146.3-6.58 21.75 14.49 53.8 14.49 53.8Zm20.98-23.66c3.01-4.27 5.97-9.06 8.8-14.55 6.62-12.83 6.64-16.54 6.64-16.54s-2.09 20.02 49.53 55.21c37.02 25.24 19.68 75.52 12.1 92.05 0 0 43.69-27.86 37.49-74.92-7.45-56.61-38.08-51.5-60.84-93.43-21.23-39.11 15.03-70.44 15.03-70.44s-48.54-2.61-70.76 48.42c-23.42 53.77 2 74.21 2 74.21Z", fill: "#ff6d01", strokeWidth: "0" })));
|
|
735
|
+
const DiscordIcon = () => (React.createElement("svg", { viewBox: "0 0 42 32", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
736
|
+
React.createElement("path", { d: "M41.1302 23.4469V24.2363C41.0328 24.2948 41.0717 24.3923 41.062 24.4702C41.0328 24.8991 40.9938 25.3279 40.9645 25.7568C40.9548 25.9322 40.8866 26.0589 40.7306 26.1661C37.7092 28.3396 34.4247 30.0062 30.8672 31.1173C30.6528 31.1856 30.5358 31.1563 30.3994 30.9711C29.6879 29.977 29.0446 28.9439 28.4696 27.862C28.3624 27.6573 28.4111 27.5989 28.6061 27.5209C29.532 27.17 30.4286 26.7509 31.2961 26.2733C31.8419 25.981 31.8224 25.9907 31.3546 25.5911C31.1109 25.3767 30.9062 25.3474 30.5943 25.4936C27.7971 26.7509 24.8634 27.4624 21.7933 27.5989C18.0507 27.7645 14.4542 27.092 11.0235 25.6008C10.5069 25.3767 10.1463 25.3669 9.75645 25.7763C9.59076 25.9517 9.54202 25.9907 9.77594 26.1271C10.7213 26.6534 11.6862 27.131 12.6999 27.5014C12.963 27.5989 12.963 27.6963 12.8461 27.9205C12.2905 28.9634 11.6667 29.9575 10.9942 30.9224C10.8383 31.1466 10.6921 31.1953 10.429 31.1173C6.91049 29.9965 3.65518 28.3591 0.663021 26.2051C0.497331 26.0784 0.419365 25.9615 0.409619 25.747C0.409619 25.4156 0.360879 25.094 0.341386 24.7626C0.156204 21.9752 0.292661 19.2072 0.789729 16.4489C1.66691 11.5952 3.61619 7.18007 6.33545 3.08656C6.43291 2.94037 6.54012 2.8429 6.69607 2.76493C9.25938 1.61485 11.9202 0.805904 14.6784 0.308836C14.8538 0.279597 14.961 0.308829 15.0488 0.484265C15.3217 1.04956 15.6141 1.6051 15.887 2.17039C15.9844 2.37507 16.0624 2.4628 16.3158 2.42381C19.2397 2.01446 22.1734 2.02421 25.0973 2.42381C25.2923 2.45305 25.3702 2.39457 25.4385 2.22889C25.7114 1.65385 26.0038 1.08854 26.2767 0.513503C26.3644 0.32832 26.4813 0.26985 26.686 0.308836C29.4248 0.805904 32.066 1.61486 34.6099 2.74545C34.7853 2.82342 34.912 2.94037 35.0192 3.10606C38.4305 8.18395 40.5454 13.7297 40.9938 19.8699C41.0133 20.1623 40.9548 20.4742 41.101 20.7666V21.4976C41.0035 21.634 41.0328 21.7997 41.0425 21.9459C41.0718 22.4527 40.9645 22.9693 41.101 23.4761L41.1302 23.4469ZM23.8108 17.063C23.8108 18.0961 24.035 18.9148 24.5223 19.6458C25.8868 21.7218 28.5963 21.9069 30.1655 20.0259C31.53 18.3885 31.4618 15.8349 29.9998 14.2755C28.7815 12.9792 26.8225 12.8038 25.419 13.8856C24.3371 14.7238 23.8595 15.8739 23.8206 17.063H23.8108ZM17.5731 17.3748C17.5731 16.6244 17.4756 16.0103 17.2027 15.4353C16.5595 14.1 15.5361 13.2424 14.0059 13.1936C12.4952 13.1449 11.4328 13.9246 10.7408 15.2111C9.88315 16.829 10.1366 18.7881 11.3549 20.1623C12.5829 21.5463 14.6102 21.7315 16.0526 20.5619C17.0955 19.714 17.5438 18.5737 17.5828 17.3748H17.5731Z", fill: "#5865F2" })));
|
|
737
|
+
const TwitterIcon = () => (React.createElement("svg", { viewBox: "0 0 33 27", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
738
|
+
React.createElement("path", { d: "M32.3127 3.1985C31.3088 3.64684 30.2075 3.92949 29.1257 4.10493C29.6422 4.01721 30.3927 3.09129 30.6948 2.71118C31.1529 2.13614 31.5428 1.48313 31.7572 0.781387C31.7864 0.722908 31.8059 0.654685 31.7572 0.615699C31.689 0.58646 31.6402 0.605947 31.5915 0.62544C30.3829 1.26871 29.1354 1.73654 27.8099 2.07766C27.7027 2.1069 27.615 2.07766 27.5467 2.00943C27.4395 1.88273 27.3323 1.76578 27.2153 1.66832C26.6598 1.19074 26.0555 0.820367 25.383 0.547467C24.4961 0.186849 23.5312 0.0309141 22.576 0.0991391C21.6501 0.157618 20.734 0.420776 19.9055 0.849619C19.0771 1.27846 18.3461 1.88273 17.7516 2.60397C17.1473 3.35444 16.6989 4.24137 16.465 5.17702C16.2409 6.08344 16.2603 6.98012 16.3968 7.89629C16.4163 8.05223 16.3968 8.07173 16.2701 8.05224C11.0752 7.28227 6.76732 5.42069 3.26834 1.4344C3.1124 1.25896 3.03443 1.25897 2.90773 1.44415C1.37754 3.73457 2.11826 7.41871 4.02857 9.23155C4.28197 9.47521 4.54513 9.71887 4.82777 9.93329C4.72056 9.95278 3.45353 9.81633 2.32294 9.23155C2.167 9.13408 2.09877 9.19257 2.07928 9.35826C2.06953 9.60192 2.07928 9.83583 2.11827 10.099C2.41066 12.4284 4.01882 14.5726 6.23126 15.4108C6.49442 15.518 6.78681 15.6155 7.06946 15.6642C6.56264 15.7714 6.04608 15.8494 4.61335 15.7422C4.43792 15.7032 4.36969 15.8006 4.43792 15.9663C5.51977 18.9195 7.85892 19.7967 9.60353 20.2938C9.83744 20.3327 10.0714 20.3327 10.3053 20.3912C10.2955 20.4107 10.276 20.4107 10.2663 20.4302C9.6815 21.3171 7.67374 21.9701 6.73808 22.3015C5.03245 22.8961 3.18063 23.169 1.37754 22.9838C1.08514 22.9448 1.02666 22.9448 0.948692 22.9838C0.870721 23.0325 0.938946 23.1007 1.02666 23.1787C1.39703 23.4224 1.76739 23.6368 2.1475 23.8415C3.28784 24.4457 4.48665 24.9331 5.73419 25.2742C12.1766 27.0578 19.4279 25.742 24.2622 20.937C28.0633 17.1652 29.3888 11.9605 29.3888 6.7462C29.3888 6.54153 29.6325 6.43433 29.7689 6.31737C30.7533 5.57664 31.5525 4.68971 32.2932 3.69558C32.4589 3.47141 32.4589 3.27648 32.4589 3.18876V3.15952C32.4589 3.0718 32.4589 3.10104 32.3322 3.15952L32.3127 3.1985Z", fill: "#1F9CEA" })));
|
|
739
|
+
const SpotifyIcon = () => (React.createElement("svg", { role: "img", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", fill: "#1DB954" },
|
|
740
|
+
React.createElement("path", { d: "M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.659.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z" })));
|
|
741
|
+
const TikTokIcon = () => (React.createElement("svg", { role: "img", viewBox: "-2 -2 28 28", xmlns: "http://www.w3.org/2000/svg" },
|
|
742
|
+
React.createElement("title", null, "TikTok"),
|
|
743
|
+
React.createElement("path", { d: "M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z" })));
|
|
744
|
+
const TelegramIcon = () => (React.createElement("svg", { role: "img", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", fill: "#0088cc" },
|
|
745
|
+
React.createElement("title", null, "Telegram"),
|
|
746
|
+
React.createElement("path", { d: "M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z" })));
|
|
747
|
+
const CloseIcon = () => (React.createElement("svg", { className: styles["close-icon"], viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
748
|
+
React.createElement("path", { d: "M18 6L6 18", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
749
|
+
React.createElement("path", { d: "M6 6L18 18", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })));
|
|
750
|
+
|
|
751
|
+
/**
|
|
752
|
+
* Creates a wrapper element and appends it to the body.
|
|
753
|
+
* @param { string } wrapperId The wrapper ID.
|
|
754
|
+
* @returns { HTMLElement } The wrapper element.
|
|
755
|
+
*/
|
|
756
|
+
const createWrapperAndAppendToBody = (wrapperId) => {
|
|
757
|
+
const wrapperElement = document.createElement("div");
|
|
758
|
+
wrapperElement.setAttribute("id", wrapperId);
|
|
759
|
+
document.body.appendChild(wrapperElement);
|
|
760
|
+
return wrapperElement;
|
|
761
|
+
};
|
|
762
|
+
/**
|
|
763
|
+
* The ReactPortal component. Renders children in a portal.
|
|
764
|
+
* @param { { children: JSX.Element, wrapperId: string } } props The props.
|
|
765
|
+
* @returns { JSX.Element } The ReactPortal component.
|
|
766
|
+
*/
|
|
767
|
+
const ReactPortal = ({ children, wrapperId = "react-portal-wrapper", }) => {
|
|
768
|
+
const [wrapperElement, setWrapperElement] = useState(null);
|
|
769
|
+
useLayoutEffect(() => {
|
|
770
|
+
let element = document.getElementById(wrapperId);
|
|
771
|
+
let systemCreated = false;
|
|
772
|
+
if (!element) {
|
|
773
|
+
systemCreated = true;
|
|
774
|
+
element = createWrapperAndAppendToBody(wrapperId);
|
|
775
|
+
}
|
|
776
|
+
setWrapperElement(element);
|
|
777
|
+
return () => {
|
|
778
|
+
if (systemCreated && (element === null || element === void 0 ? void 0 : element.parentNode)) {
|
|
779
|
+
element.parentNode.removeChild(element);
|
|
780
|
+
}
|
|
781
|
+
};
|
|
782
|
+
}, [wrapperId]);
|
|
783
|
+
if (wrapperElement === null)
|
|
784
|
+
return null;
|
|
785
|
+
return createPortal(children, wrapperElement);
|
|
786
|
+
};
|
|
787
|
+
/**
|
|
788
|
+
* The ClientOnly component. Renders children only on the client. Needed for Next.js.
|
|
789
|
+
* @param { { children: JSX.Element } } props The props.
|
|
790
|
+
* @returns { JSX.Element } The ClientOnly component.
|
|
791
|
+
*/
|
|
792
|
+
const ClientOnly = (_a) => {
|
|
793
|
+
var { children } = _a, delegated = __rest(_a, ["children"]);
|
|
794
|
+
const [hasMounted, setHasMounted] = useState(false);
|
|
795
|
+
useEffect(() => {
|
|
796
|
+
setHasMounted(true);
|
|
797
|
+
}, []);
|
|
798
|
+
if (!hasMounted) {
|
|
799
|
+
return null;
|
|
800
|
+
}
|
|
801
|
+
return React.createElement("div", Object.assign({}, delegated), children);
|
|
802
|
+
};
|
|
803
|
+
/**
|
|
804
|
+
* Returns the icon URL based on the connector name.
|
|
805
|
+
* @param {string} name - The connector name.
|
|
806
|
+
* @returns {string} The icon URL.
|
|
807
|
+
*/
|
|
808
|
+
const getIconByConnectorName = (name) => {
|
|
809
|
+
switch (name) {
|
|
810
|
+
case "AppKit Auth":
|
|
811
|
+
return "data:image/svg+xml,%3Csvg width='56' height='56' viewBox='0 0 56 56' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='56' height='56' rx='16.3333' fill='%23FF573B'/%3E%3Cpath d='M11.6667 33.8333H44.3334V38.5C44.3334 39.7886 43.2501 40.8333 41.9137 40.8333H14.0865C12.7501 40.8333 11.6667 39.7886 11.6667 38.5V33.8333Z' fill='%23202020'/%3E%3Cpath d='M11.6667 24.5H44.3334V31.5H11.6667V24.5Z' fill='%23202020'/%3E%3Cpath d='M11.6667 17.5C11.6667 16.2113 12.7501 15.1666 14.0865 15.1666H41.9137C43.2501 15.1666 44.3334 16.2113 44.3334 17.5V22.1666H11.6667V17.5Z' fill='%23202020'/%3E%3C/svg%3E";
|
|
812
|
+
case "Privy Wallet":
|
|
813
|
+
return "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='-25 -25 410 514' fill='none' id='svg-669804622_503'%3E%3Cpath d='M180 359.794C279.396 359.794 360 279.236 360 179.897C360 80.5579 279.396 0 180 0C80.604 0 0 80.5579 0 179.897C0 279.236 80.604 359.794 180 359.794Z' fill='%23010110'/%3E%3Cpath d='M180 463.997C247.932 463.997 303.012 452.411 303.012 438.2C303.012 423.988 247.968 412.402 180 412.402C112.032 412.402 56.9883 423.988 56.9883 438.2C56.9883 452.411 112.032 463.997 180 463.997Z' fill='%23010110'/%3E%3C/svg%3E";
|
|
814
|
+
default:
|
|
815
|
+
if (name.toLowerCase().includes("privy")) {
|
|
816
|
+
return "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='-25 -25 410 514' fill='none' id='svg-669804622_503'%3E%3Cpath d='M180 359.794C279.396 359.794 360 279.236 360 179.897C360 80.5579 279.396 0 180 0C80.604 0 0 80.5579 0 179.897C0 279.236 80.604 359.794 180 359.794Z' fill='%23010110'/%3E%3Cpath d='M180 463.997C247.932 463.997 303.012 452.411 303.012 438.2C303.012 423.988 247.968 412.402 180 412.402C112.032 412.402 56.9883 423.988 56.9883 438.2C56.9883 452.411 112.032 463.997 180 463.997Z' fill='%23010110'/%3E%3C/svg%3E";
|
|
817
|
+
}
|
|
818
|
+
else if (name.toLowerCase().includes("appkit")) {
|
|
819
|
+
return "data:image/svg+xml,%3Csvg width='56' height='56' viewBox='0 0 56 56' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='56' height='56' rx='16.3333' fill='%23FF573B'/%3E%3Cpath d='M11.6667 33.8333H44.3334V38.5C44.3334 39.7886 43.2501 40.8333 41.9137 40.8333H14.0865C12.7501 40.8333 11.6667 39.7886 11.6667 38.5V33.8333Z' fill='%23202020'/%3E%3Cpath d='M11.6667 24.5H44.3334V31.5H11.6667V24.5Z' fill='%23202020'/%3E%3Cpath d='M11.6667 17.5C11.6667 16.2113 12.7501 15.1666 14.0865 15.1666H41.9137C43.2501 15.1666 44.3334 16.2113 44.3334 17.5V22.1666H11.6667V17.5Z' fill='%23202020'/%3E%3C/svg%3E";
|
|
820
|
+
}
|
|
821
|
+
else
|
|
822
|
+
return "";
|
|
823
|
+
}
|
|
824
|
+
};
|
|
825
|
+
|
|
826
|
+
const ToastContext = React.createContext(undefined);
|
|
827
|
+
const ToastProvider = ({ children }) => {
|
|
828
|
+
const [toasts, setToasts] = useState([]);
|
|
829
|
+
const timers = useRef({});
|
|
830
|
+
const remainingTimes = useRef({});
|
|
831
|
+
const startTimes = useRef({});
|
|
832
|
+
const isHovering = useRef(false);
|
|
833
|
+
const addToast = (message, type = "info", duration = 3000) => {
|
|
834
|
+
const id = Date.now();
|
|
835
|
+
setToasts((prevToasts) => [
|
|
836
|
+
...prevToasts,
|
|
837
|
+
{ id, message, type, isVisible: true },
|
|
838
|
+
]);
|
|
839
|
+
remainingTimes.current[id] = duration;
|
|
840
|
+
startTimes.current[id] = Date.now();
|
|
841
|
+
timers.current[id] = setTimeout(() => removeToast(id), duration);
|
|
842
|
+
};
|
|
843
|
+
const removeToast = (id) => {
|
|
844
|
+
setToasts((prevToasts) => prevToasts.map((toast) => toast.id === id ? Object.assign(Object.assign({}, toast), { isVisible: false }) : toast));
|
|
845
|
+
setTimeout(() => {
|
|
846
|
+
setToasts((prevToasts) => prevToasts.filter((toast) => toast.id !== id));
|
|
847
|
+
delete timers.current[id];
|
|
848
|
+
delete remainingTimes.current[id];
|
|
849
|
+
delete startTimes.current[id];
|
|
850
|
+
}, 300);
|
|
851
|
+
};
|
|
852
|
+
const handleMouseEnter = () => {
|
|
853
|
+
isHovering.current = true;
|
|
854
|
+
Object.keys(timers.current).forEach((id) => {
|
|
855
|
+
clearTimeout(timers.current[Number(id)]);
|
|
856
|
+
remainingTimes.current[Number(id)] -=
|
|
857
|
+
Date.now() - startTimes.current[Number(id)];
|
|
858
|
+
});
|
|
859
|
+
};
|
|
860
|
+
const handleMouseLeave = () => {
|
|
861
|
+
isHovering.current = false;
|
|
862
|
+
Object.keys(remainingTimes.current).forEach((id) => {
|
|
863
|
+
if (remainingTimes.current[Number(id)] > 0) {
|
|
864
|
+
startTimes.current[Number(id)] = Date.now();
|
|
865
|
+
timers.current[Number(id)] = setTimeout(() => removeToast(Number(id)), remainingTimes.current[Number(id)]);
|
|
866
|
+
}
|
|
867
|
+
});
|
|
868
|
+
};
|
|
869
|
+
return (React.createElement(ToastContext.Provider, { value: { addToast } },
|
|
870
|
+
children,
|
|
871
|
+
React.createElement(ReactPortal, { wrapperId: "toast-wrapper" },
|
|
872
|
+
React.createElement("div", { className: styles$2["toast-container"], onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave }, toasts.map((toast) => (React.createElement("div", { key: toast.id, className: `${styles$2.toast} ${styles$2[`toast-${toast.type}`]} ${toast.isVisible ? styles$2["toast-enter"] : styles$2["toast-exit"]}`, onClick: () => removeToast(toast.id) }, toast.message)))))));
|
|
873
|
+
};
|
|
874
|
+
const useToast = () => {
|
|
875
|
+
const context = React.useContext(ToastContext);
|
|
876
|
+
if (context === undefined) {
|
|
877
|
+
throw new Error("useToast must be used within a ToastProvider");
|
|
878
|
+
}
|
|
879
|
+
return context;
|
|
880
|
+
};
|
|
881
|
+
|
|
882
|
+
const OriginContext = createContext({
|
|
883
|
+
statsQuery: null,
|
|
884
|
+
uploadsQuery: null,
|
|
885
|
+
});
|
|
886
|
+
const OriginProvider = ({ children }) => {
|
|
887
|
+
const { authenticated } = useAuthState();
|
|
888
|
+
const { auth } = useContext(CampContext);
|
|
889
|
+
if (!auth) {
|
|
890
|
+
throw new Error("Auth instance is not available");
|
|
891
|
+
}
|
|
892
|
+
const statsQuery = useQuery({
|
|
893
|
+
queryKey: ["origin-stats", authenticated],
|
|
894
|
+
queryFn: () => { var _a, _b; return (_b = (_a = auth.origin) === null || _a === void 0 ? void 0 : _a.getOriginUsage()) !== null && _b !== void 0 ? _b : Promise.resolve(null); },
|
|
895
|
+
});
|
|
896
|
+
const uploadsQuery = useQuery({
|
|
897
|
+
queryKey: ["origin-uploads", authenticated],
|
|
898
|
+
queryFn: () => { var _a, _b; return (_b = (_a = auth.origin) === null || _a === void 0 ? void 0 : _a.getOriginUploads()) !== null && _b !== void 0 ? _b : Promise.resolve(null); },
|
|
899
|
+
});
|
|
900
|
+
return (React.createElement(OriginContext.Provider, { value: {
|
|
901
|
+
statsQuery: statsQuery,
|
|
902
|
+
uploadsQuery: uploadsQuery,
|
|
903
|
+
} }, children));
|
|
904
|
+
};
|
|
905
|
+
|
|
906
|
+
const CampContext = createContext({
|
|
907
|
+
clientId: null,
|
|
908
|
+
auth: null,
|
|
909
|
+
setAuth: () => { },
|
|
910
|
+
wagmiAvailable: false,
|
|
911
|
+
ackee: null,
|
|
912
|
+
setAckee: () => { },
|
|
913
|
+
});
|
|
914
|
+
/**
|
|
915
|
+
* CampProvider
|
|
916
|
+
* @param {Object} props The props
|
|
917
|
+
* @param {string} props.clientId The Camp client ID
|
|
918
|
+
* @param {string} props.redirectUri The redirect URI to use after social oauths
|
|
919
|
+
* @param {React.ReactNode} props.children The children components
|
|
920
|
+
* @param {boolean} props.allowAnalytics Whether to allow analytics to be sent
|
|
921
|
+
* @returns {JSX.Element} The CampProvider component
|
|
922
|
+
*/
|
|
923
|
+
const CampProvider = ({ clientId, redirectUri, children, allowAnalytics = true, }) => {
|
|
924
|
+
const isServer = typeof window === "undefined";
|
|
925
|
+
const ackeeInstance = allowAnalytics && !isServer
|
|
926
|
+
? create(constants.ACKEE_INSTANCE, {
|
|
927
|
+
detailed: false,
|
|
928
|
+
ignoreLocalhost: true,
|
|
929
|
+
ignoreOwnVisits: false,
|
|
930
|
+
})
|
|
931
|
+
: null;
|
|
932
|
+
const [ackee, setAckee] = useState(ackeeInstance);
|
|
933
|
+
const [auth, setAuth] = useState(new Auth({
|
|
934
|
+
clientId,
|
|
935
|
+
redirectUri: redirectUri
|
|
936
|
+
? redirectUri
|
|
937
|
+
: !isServer
|
|
938
|
+
? window.location.href
|
|
939
|
+
: "",
|
|
940
|
+
ackeeInstance,
|
|
941
|
+
}));
|
|
942
|
+
const wagmiContext = useContext(WagmiContext);
|
|
943
|
+
return (React.createElement(CampContext.Provider, { value: {
|
|
944
|
+
clientId,
|
|
945
|
+
auth,
|
|
946
|
+
setAuth,
|
|
947
|
+
wagmiAvailable: wagmiContext !== undefined,
|
|
948
|
+
ackee,
|
|
949
|
+
setAckee,
|
|
950
|
+
} },
|
|
951
|
+
React.createElement(SocialsProvider, null,
|
|
952
|
+
React.createElement(OriginProvider, null,
|
|
953
|
+
React.createElement(ToastProvider, null,
|
|
954
|
+
React.createElement(ModalProvider, null, children))))));
|
|
955
|
+
};
|
|
956
|
+
|
|
957
|
+
const getWalletConnectProvider = (projectId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
958
|
+
const provider = yield EthereumProvider.init({
|
|
959
|
+
optionalChains: [testnet.id],
|
|
960
|
+
chains: [testnet.id],
|
|
961
|
+
projectId,
|
|
962
|
+
showQrModal: true,
|
|
963
|
+
methods: ["personal_sign"],
|
|
964
|
+
});
|
|
965
|
+
return provider;
|
|
966
|
+
});
|
|
967
|
+
const useWalletConnectProvider = (projectId) => {
|
|
968
|
+
const [walletConnectProvider, setWalletConnectProvider] = useState(null);
|
|
969
|
+
useEffect(() => {
|
|
970
|
+
const fetchWalletConnectProvider = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
971
|
+
try {
|
|
972
|
+
const provider = yield getWalletConnectProvider(projectId);
|
|
973
|
+
setWalletConnectProvider(provider);
|
|
974
|
+
}
|
|
975
|
+
catch (error) {
|
|
976
|
+
console.error("Error getting WalletConnect provider:", error);
|
|
977
|
+
}
|
|
978
|
+
});
|
|
979
|
+
fetchWalletConnectProvider();
|
|
980
|
+
}, [projectId]);
|
|
981
|
+
return walletConnectProvider;
|
|
982
|
+
};
|
|
983
|
+
|
|
984
|
+
var css_248z = ".buttons-module_connect-button__CJhUa{background-color:#ff6f00;border:none;border-radius:.75rem;box-shadow:inset 0 2px 0 hsla(0,0%,100%,.15),inset 0 -2px 4px rgba(0,0,0,.05),0 1px 1px rgba(46,54,80,.075);color:#fff;font-family:Satoshi,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-size:1rem;font-weight:600;height:2.75rem;line-height:1.333rem;padding-inline:2.5rem;padding-left:5rem;position:relative;transition:background-color .15s;width:12rem}.buttons-module_connect-button__CJhUa .buttons-module_button-icon__JM4-2{background:hsla(0,0%,100%,.75);border-radius:.75rem 0 0 .75rem;box-shadow:inset 0 2px 0 hsla(0,0%,100%,.15),inset 0 -2px 4px rgba(0,0,0,.05);display:grid;height:100%;left:0;margin-right:.5rem;place-items:center;position:absolute;top:50%;transform:translateY(-50%);transition:background-color .15s;width:3rem}.buttons-module_connect-button__CJhUa .buttons-module_button-icon__JM4-2 svg{height:1.25rem;width:1.25rem}.buttons-module_connect-button__CJhUa:hover{background-color:#cc4e02;border-color:#cc4e02;cursor:pointer}.buttons-module_connect-button__CJhUa:hover .buttons-module_button-icon__JM4-2{background:hsla(0,0%,100%,.675)}.buttons-module_connect-button__CJhUa:focus{outline:none}.buttons-module_connect-button__CJhUa:disabled{background-color:#ccc;cursor:not-allowed}.buttons-module_provider-button__6JY7s{align-items:center;background-color:#fefefe;border:1px solid #ddd;border-radius:.5rem;display:flex;font-family:inherit;gap:.5rem;justify-content:flex-start;padding:.5rem;transition:background-color .15s;width:100%}.buttons-module_provider-button__6JY7s:focus{outline:1px solid #43b7c4}.buttons-module_provider-button__6JY7s:hover{border-color:#43b7c4}.buttons-module_provider-button__6JY7s:hover:not(:disabled){background-color:#ddd;cursor:pointer}.buttons-module_provider-button__6JY7s img{height:2rem;width:2rem}.buttons-module_provider-button__6JY7s .buttons-module_provider-icon__MOhr8{border-radius:.2rem}.buttons-module_provider-button__6JY7s span{line-height:1rem;margin-left:.5rem}.buttons-module_provider-button__6JY7s span.buttons-module_provider-name__tHWO2{color:#333;font-size:.875rem}.buttons-module_provider-button__6JY7s span.buttons-module_provider-label__CEGRr{color:#777;font-size:.7rem}.buttons-module_link-button-default__EcKUT{background-color:#ff6f00;border:none;border-radius:.75rem;box-shadow:inset 0 2px 0 hsla(0,0%,100%,.15),inset 0 -2px 4px rgba(0,0,0,.05),0 1px 1px rgba(46,54,80,.075);box-sizing:border-box;cursor:pointer;height:2.6rem;position:relative;width:7rem}.buttons-module_link-button-default__EcKUT:disabled{background-color:#b8b8b8;cursor:not-allowed}.buttons-module_link-button-default__EcKUT:after{background-color:transparent;border-radius:.75rem;bottom:0;content:\"\";left:0;position:absolute;right:0;top:0;transition:background-color .15s}.buttons-module_link-button-default__EcKUT:disabled:after{background-color:rgba(0,0,0,.35);border-radius:.35rem;color:#fff;content:\"Not connected\";display:grid;font-size:.75rem;height:2rem;left:0;opacity:0;padding:.25rem;place-items:center;position:absolute;right:0;top:-2.7rem;transform:translateY(-.5rem);transition:all .25s;-webkit-user-select:none;-moz-user-select:none;user-select:none;visibility:hidden}.buttons-module_link-button-default__EcKUT:disabled:hover:after{opacity:1;transform:translateY(0);visibility:visible}.buttons-module_link-button-default__EcKUT:not(:disabled):hover:after{background-color:rgba(0,0,0,.1)}.buttons-module_link-button-default__EcKUT:not(:disabled).buttons-module_twitter__9sRaz{background-color:#1da1f2}.buttons-module_link-button-default__EcKUT:not(:disabled).buttons-module_spotify__-fiKQ{background-color:#1db954}.buttons-module_link-button-default__EcKUT:not(:disabled).buttons-module_discord__I-YjZ{background-color:#7289da}.buttons-module_link-button-default__EcKUT:not(:disabled).buttons-module_tiktok__a80-0{background-color:#000}.buttons-module_link-button-default__EcKUT:not(:disabled).buttons-module_telegram__ExOTS{background-color:#08c}.buttons-module_link-button-default__EcKUT .buttons-module_button-container__-oPqd{align-items:center;display:flex;flex-direction:row;gap:.5rem;justify-content:center;padding:.5rem}.buttons-module_button-container__-oPqd .buttons-module_social-icon__DPdPe{align-items:center;color:#fff;display:flex;height:1.5rem;justify-content:center;width:1.5rem}.buttons-module_button-container__-oPqd .buttons-module_social-icon__DPdPe svg{fill:#fff!important;height:1.5rem;width:1.5rem}.buttons-module_button-container__-oPqd .buttons-module_social-icon__DPdPe svg path{fill:#fff!important}.buttons-module_button-container__-oPqd .buttons-module_link-icon__8V8FP{align-items:center;color:hsla(0,0%,100%,.8);display:flex;height:1.25rem;justify-content:center;width:1.25rem}.buttons-module_button-container__-oPqd .buttons-module_camp-logo__slNl0{align-items:center;background-color:#fff;border-radius:50%;box-sizing:border-box;display:flex;height:1.5rem;justify-content:center;padding:.15rem;width:1.5rem}.buttons-module_link-button-default__EcKUT:disabled .buttons-module_button-container__-oPqd .buttons-module_camp-logo__slNl0 svg path{fill:#b8b8b8!important}.buttons-module_link-button-icon__llX8m{background-color:#ff6f00;border:none;border-radius:.75rem;box-shadow:inset 0 2px 0 hsla(0,0%,100%,.15),inset 0 -2px 4px rgba(0,0,0,.05),0 1px 1px rgba(46,54,80,.075);box-sizing:border-box;cursor:pointer;height:3rem;min-height:3rem;min-width:3rem;padding:0;position:relative;width:3rem}.buttons-module_link-button-icon__llX8m:disabled{background-color:#b8b8b8;cursor:not-allowed}.buttons-module_link-button-icon__llX8m:disabled:after{background-color:rgba(0,0,0,.35);border-radius:.35rem;box-sizing:border-box;color:#fff;content:\"Not connected\";display:grid;font-size:.75rem;height:-moz-fit-content;height:fit-content;left:-1rem;opacity:0;padding:.25rem;place-items:center;position:absolute;right:-1rem;top:-2.7rem;transform:translateY(-.5rem);transition:all .25s}.buttons-module_link-button-icon__llX8m:disabled:hover:after{opacity:1;transform:translateY(0)}.buttons-module_link-button-icon__llX8m:after{background-color:transparent;border-radius:.75rem;bottom:0;content:\"\";left:0;position:absolute;right:0;top:0;transition:background-color .15s}.buttons-module_link-button-icon__llX8m:not(:disabled):hover:after{background-color:rgba(0,0,0,.1)}.buttons-module_link-button-icon__llX8m:not(:disabled).buttons-module_twitter__9sRaz{background-color:#1da1f2}.buttons-module_link-button-icon__llX8m:not(:disabled).buttons-module_spotify__-fiKQ{background-color:#1db954}.buttons-module_link-button-icon__llX8m:not(:disabled).buttons-module_discord__I-YjZ{background-color:#7289da}.buttons-module_link-button-icon__llX8m:not(:disabled).buttons-module_tiktok__a80-0{background-color:#000}.buttons-module_link-button-icon__llX8m:not(:disabled).buttons-module_telegram__ExOTS{background-color:#08c}.buttons-module_link-button-icon__llX8m .buttons-module_icon-container__Q5bI1{align-items:center;display:flex;flex:1;height:100%;justify-content:center;position:relative;width:100%}.buttons-module_link-button-icon__llX8m .buttons-module_icon-container__Q5bI1>svg{fill:#fff!important;height:1.5rem;width:1.5rem}.buttons-module_link-button-icon__llX8m .buttons-module_icon-container__Q5bI1>svg path{fill:#fff!important}.buttons-module_link-button-icon__llX8m .buttons-module_camp-logo__slNl0{align-items:center;background-color:#fff;border-radius:50%;bottom:-.5rem;box-sizing:border-box;display:flex;height:1.5rem;justify-content:center;position:absolute;right:-.5rem;width:1.5rem}.buttons-module_link-button-icon__llX8m .buttons-module_camp-logo__slNl0 svg{height:1.1rem;width:1.1rem}.buttons-module_link-button-icon__llX8m:disabled .buttons-module_camp-logo__slNl0 svg path,.buttons-module_not-linked__ua4va svg path{fill:#b8b8b8!important}.buttons-module_file-upload-container__le7Cg{align-items:center;border:2px dashed #ccc;border-radius:.75rem;box-sizing:border-box;color:#777;cursor:pointer;display:flex;flex-direction:column;justify-content:center;max-width:100%;min-height:12rem;min-width:0;padding:1rem;position:relative;text-align:center;transition:background-color .2s,border-color .2s;width:100%}.buttons-module_file-upload-container__le7Cg:hover{border-color:#e2e2e2}.buttons-module_file-upload-container__le7Cg.buttons-module_dragging__cfggZ{background-color:#f9f9f9;border-color:#ff6f00}.buttons-module_file-upload-container__le7Cg.buttons-module_dragging__cfggZ .buttons-module_file-preview__yuM5i{opacity:.2;transition:opacity .2s}.buttons-module_file-upload-container__le7Cg.buttons-module_file-selected__YY6ms{background-color:#f9f9f9;border:none;height:auto;min-height:auto;padding:0}.buttons-module_file-input__gbD5T{display:none}.buttons-module_selected-file-container__E1AXM{align-items:center;display:flex;flex-direction:column;gap:.25rem;height:100%;justify-content:space-between;max-width:100%;position:relative;width:100%}.buttons-module_remove-file-button__Q1FMa{border:1px solid #ff6f00;border-radius:.5rem;color:#fff;color:#ff6f00;cursor:pointer;font-size:.875rem;padding:.5rem;text-align:center;transition:background-color .2s}.buttons-module_remove-file-button__Q1FMa:hover{background-color:#cc4e02;border-color:#cc4e02;color:#fff;cursor:pointer}.buttons-module_upload-file-button__vTwWd{background-color:#ff6f00;border:none;border-radius:.5rem;color:#fff;cursor:pointer;font-size:.875rem;padding:.5rem;text-align:center;transition:background-color .2s;width:100%}.buttons-module_upload-file-button__vTwWd:hover{background-color:#cc4e02;cursor:pointer}.buttons-module_file-preview__yuM5i{border-radius:.5rem;max-height:8rem;max-width:100%}.buttons-module_file-preview-text__80Ju0{color:#333;font-size:.875rem;margin-bottom:.5rem}.buttons-module_file-name__3iskR{color:#333;font-size:.875rem;max-width:100%;min-height:-moz-fit-content;min-height:fit-content;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.buttons-module_upload-buttons__3SAw6{align-items:center;display:flex;gap:.25rem;justify-content:space-between;width:100%}.buttons-module_upload-buttons__3SAw6 .buttons-module_upload-file-button__vTwWd{flex-grow:1}.buttons-module_upload-buttons__3SAw6 .buttons-module_remove-file-button__Q1FMa{flex-grow:0}.buttons-module_accepted-types__Ys-D2{color:#777;font-size:.875rem;font-style:italic;margin-top:.5rem}.buttons-module_loading-bar-container__nrgPX{background-color:#e0e0e0;border-radius:4px;height:8px;margin-top:8px;overflow:hidden;width:100%}.buttons-module_loading-bar__IUAg1{background-color:#ff6f00;height:100%;transition:width .3s ease}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJ1dHRvbnMubW9kdWxlLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxzQ0FFRSx3QkFBeUIsQ0FFekIsV0FBWSxDQUNaLG9CQUFzQixDQVd0QiwyR0FDeUUsQ0FkekUsVUFBWSxDQVVaLDBJQUVZLENBTFosY0FBZSxDQUNmLGVBQWdCLENBSGhCLGNBQWUsQ0FDZixvQkFBcUIsQ0FIckIscUJBQXNCLENBQ3RCLGlCQUFrQixDQU5sQixpQkFBa0IsQ0FpQmxCLGdDQUFrQyxDQU5sQyxXQU9GLENBRUEseUVBUUUsOEJBQXFDLENBTXJDLCtCQUFrQyxDQUxsQyw2RUFDc0MsQ0FDdEMsWUFBYSxDQUxiLFdBQVksQ0FIWixNQUFPLENBSVAsa0JBQW9CLENBS3BCLGtCQUFtQixDQVhuQixpQkFBa0IsQ0FDbEIsT0FBUSxDQUVSLDBCQUEyQixDQVMzQixnQ0FBa0MsQ0FSbEMsVUFVRixDQUVBLDZFQUVFLGNBQWUsQ0FEZixhQUVGLENBRUEsNENBQ0Usd0JBQXlC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W92ZXJmbG93OiBlbGxpcHNpcztcclxuICBtaW4taGVpZ2h0OiBmaXQtY29udGVudDtcclxuICBtYXgtd2lkdGg6IDEwMCU7XHJcbn1cclxuXHJcbi51cGxvYWQtYnV0dG9ucyB7XHJcbiAgZGlzcGxheTogZmxleDtcclxuICBnYXA6IDAuMjVyZW07XHJcbiAgd2lkdGg6IDEwMCU7XHJcbiAganVzdGlmeS1jb250ZW50OiBzcGFjZS1iZXR3ZWVuO1xyXG4gIGFsaWduLWl0ZW1zOiBjZW50ZXI7XHJcbn1cclxuXHJcbi51cGxvYWQtYnV0dG9ucyAudXBsb2FkLWZpbGUtYnV0dG9uIHtcclxuICBmbGV4LWdyb3c6IDE7XHJcbn1cclxuXHJcbi51cGxvYWQtYnV0dG9ucyAucmVtb3ZlLWZpbGUtYnV0dG9uIHtcclxuICBmbGV4LWdyb3c6IDA7XHJcbn1cclxuXHJcbi5hY2NlcHRlZC10eXBlcyB7XHJcbiAgZm9udC1zaXplOiAwLjg3NXJlbTtcclxuICBjb2xvcjogIzc3NztcclxuICBtYXJnaW4tdG9wOiAwLjVyZW07XHJcbiAgZm9udC1zdHlsZTogaXRhbGljO1xyXG59XHJcblxyXG4ubG9hZGluZy1iYXItY29udGFpbmVyIHtcclxuICB3aWR0aDogMTAwJTtcclxuICBoZWlnaHQ6IDhweDtcclxuICBiYWNrZ3JvdW5kLWNvbG9yOiAjZTBlMGUwO1xyXG4gIGJvcmRlci1yYWRpdXM6IDRweDtcclxuICBvdmVyZmxvdzogaGlkZGVuO1xyXG4gIG1hcmdpbi10b3A6IDhweDtcclxufVxyXG5cclxuLmxvYWRpbmctYmFyIHtcclxuICBoZWlnaHQ6IDEwMCU7XHJcbiAgYmFja2dyb3VuZC1jb2xvcjogI2ZmNmYwMDtcclxuICB0cmFuc2l0aW9uOiB3aWR0aCAwLjNzIGVhc2U7XHJcbn1cclxuIl19 */";
|
|
985
|
+
var buttonStyles = {"connect-button":"buttons-module_connect-button__CJhUa","button-icon":"buttons-module_button-icon__JM4-2","provider-button":"buttons-module_provider-button__6JY7s","provider-icon":"buttons-module_provider-icon__MOhr8","provider-name":"buttons-module_provider-name__tHWO2","provider-label":"buttons-module_provider-label__CEGRr","link-button-default":"buttons-module_link-button-default__EcKUT","twitter":"buttons-module_twitter__9sRaz","spotify":"buttons-module_spotify__-fiKQ","discord":"buttons-module_discord__I-YjZ","tiktok":"buttons-module_tiktok__a80-0","telegram":"buttons-module_telegram__ExOTS","button-container":"buttons-module_button-container__-oPqd","social-icon":"buttons-module_social-icon__DPdPe","link-icon":"buttons-module_link-icon__8V8FP","camp-logo":"buttons-module_camp-logo__slNl0","link-button-icon":"buttons-module_link-button-icon__llX8m","icon-container":"buttons-module_icon-container__Q5bI1","not-linked":"buttons-module_not-linked__ua4va","file-upload-container":"buttons-module_file-upload-container__le7Cg","dragging":"buttons-module_dragging__cfggZ","file-preview":"buttons-module_file-preview__yuM5i","file-selected":"buttons-module_file-selected__YY6ms","file-input":"buttons-module_file-input__gbD5T","selected-file-container":"buttons-module_selected-file-container__E1AXM","remove-file-button":"buttons-module_remove-file-button__Q1FMa","upload-file-button":"buttons-module_upload-file-button__vTwWd","file-preview-text":"buttons-module_file-preview-text__80Ju0","file-name":"buttons-module_file-name__3iskR","upload-buttons":"buttons-module_upload-buttons__3SAw6","accepted-types":"buttons-module_accepted-types__Ys-D2","loading-bar-container":"buttons-module_loading-bar-container__nrgPX","loading-bar":"buttons-module_loading-bar__IUAg1"};
|
|
986
|
+
styleInject(css_248z);
|
|
987
|
+
|
|
988
|
+
/**
|
|
989
|
+
* The injected CampButton component.
|
|
990
|
+
* @param { { onClick: function, authenticated: boolean } } props The props.
|
|
991
|
+
* @returns { JSX.Element } The CampButton component.
|
|
992
|
+
*/
|
|
993
|
+
const CampButton = ({ onClick, authenticated, disabled, }) => {
|
|
994
|
+
return (React.createElement("button", { className: buttonStyles["connect-button"], onClick: onClick, disabled: disabled },
|
|
995
|
+
React.createElement("div", { className: buttonStyles["button-icon"] },
|
|
996
|
+
React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 571.95 611.12", height: "1rem", width: "1rem" },
|
|
997
|
+
React.createElement("path", { d: "m563.25 431.49-66.17-51.46c-11.11-8.64-27.28-5.06-33.82 7.4-16.24 30.9-41.69 56.36-70.85 73.73l-69.35-69.35c-3.73-3.73-8.79-5.83-14.07-5.83s-10.34 2.1-14.07 5.83l-73.78 73.78c-57.37-30.39-96.55-90.71-96.55-160.03 0-99.79 81.19-180.98 180.98-180.98 60.35 0 118.17 26.28 156.39 89.44 6.85 11.32 21.92 14.33 32.59 6.51l64.21-47.06c9.53-6.98 12.06-20.15 5.78-30.16C508.83 54.41 411.43 0 305.56 0 137.07 0 0 137.07 0 305.56s137.07 305.56 305.56 305.56c57.6 0 113.72-16.13 162.31-46.63A306.573 306.573 0 0 0 568.8 460.8c5.78-9.78 3.42-22.34-5.55-29.31Zm-301.42 49.69 47.15-47.15 44.69 44.69c-15.92 5.1-32.2 7.83-48.1 7.83-15.08 0-29.72-1.87-43.74-5.36Zm42.36-222.47c-.07 1.49-.08 21.29 49.54 55.11 37.02 25.24 19.68 75.52 12.1 92.05a147.07 147.07 0 0 0-20.12-38.91c-12.73-17.59-26.87-28.9-36.74-35.59-10.38 6.36-27.41 18.74-41.07 40.02-8.27 12.89-12.82 25.16-15.42 34.48l-.03-.05c-15.1-40.6-9.75-60.88-1.95-71.9 6.12-8.65 17.24-20.6 17.24-20.6 9.71-9.66 19.96-19.06 29.82-38.17 6.06-11.75 6.59-15.84 6.63-16.45Z", fill: "#000", strokeWidth: "0" }),
|
|
998
|
+
React.createElement("path", { d: "M267.74 313.33s-11.11 11.95-17.24 20.6c-7.8 11.02-13.14 31.3 1.95 71.9-86.02-75.3 2.56-152.15.79-146.3-6.58 21.75 14.49 53.8 14.49 53.8Zm20.98-23.66c3.01-4.27 5.97-9.06 8.8-14.55 6.62-12.83 6.64-16.54 6.64-16.54s-2.09 20.02 49.53 55.21c37.02 25.24 19.68 75.52 12.1 92.05 0 0 43.69-27.86 37.49-74.92-7.45-56.61-38.08-51.5-60.84-93.43-21.23-39.11 15.03-70.44 15.03-70.44s-48.54-2.61-70.76 48.42c-23.42 53.77 2 74.21 2 74.21Z", fill: "#ff6d01", strokeWidth: "0" }))),
|
|
999
|
+
authenticated ? "My Origin" : "Connect"));
|
|
1000
|
+
};
|
|
1001
|
+
/**
|
|
1002
|
+
* The GoToOriginDashboard component. Handles the action of going to the Origin Dashboard.
|
|
1003
|
+
* @param { { text?: string } } props The props.
|
|
1004
|
+
* @param { string } [props.text] The text to display on the button.
|
|
1005
|
+
* @param { string } [props.text="Origin Dashboard"] The default text to display on the button.
|
|
1006
|
+
* @returns { JSX.Element } The GoToOriginDashboard component.
|
|
1007
|
+
*/
|
|
1008
|
+
const GoToOriginDashboard = ({ text = "Origin Dashboard", }) => (React.createElement("a", { className: styles["origin-dashboard-button"], href: constants.ORIGIN_DASHBOARD, target: "_blank", rel: "noopener noreferrer" },
|
|
1009
|
+
text,
|
|
1010
|
+
" ",
|
|
1011
|
+
React.createElement(LinkIcon, { w: "0.875rem" })));
|
|
1012
|
+
/**
|
|
1013
|
+
* The TabButton component.
|
|
1014
|
+
* @param { { label: string, isActive: boolean, onClick: function } } props The props.
|
|
1015
|
+
* @returns { JSX.Element } The TabButton component.
|
|
1016
|
+
*/
|
|
1017
|
+
const TabButton = ({ label, isActive, onClick, }) => {
|
|
1018
|
+
return (React.createElement("button", { className: `${styles["tab-button"]} ${isActive ? styles["active-tab"] : ""}`, onClick: onClick }, label));
|
|
1019
|
+
};
|
|
1020
|
+
const StandaloneCampButton = () => {
|
|
1021
|
+
const modalContext = useContext(ModalContext);
|
|
1022
|
+
const { openModal } = useModal();
|
|
1023
|
+
const { authenticated } = useAuthState();
|
|
1024
|
+
if (!modalContext) {
|
|
1025
|
+
console.error("CampButton must be used within a ModalProvider");
|
|
1026
|
+
return null;
|
|
1027
|
+
}
|
|
1028
|
+
const { isButtonDisabled } = modalContext;
|
|
1029
|
+
return (React.createElement(CampButton, { onClick: openModal, authenticated: authenticated, disabled: isButtonDisabled }));
|
|
1030
|
+
};
|
|
1031
|
+
/**
|
|
1032
|
+
* The ProviderButton component.
|
|
1033
|
+
* @param { { provider: { provider: string, info: { name: string, icon: string } }, handleConnect: function, loading: boolean, label: string } } props The props.
|
|
1034
|
+
* @returns { JSX.Element } The ProviderButton component.
|
|
1035
|
+
*/
|
|
1036
|
+
const ProviderButton = ({ provider, handleConnect, loading, label, }) => {
|
|
1037
|
+
const [isButtonLoading, setIsButtonLoading] = useState(false);
|
|
1038
|
+
const handleClick = () => {
|
|
1039
|
+
handleConnect(provider);
|
|
1040
|
+
setIsButtonLoading(true);
|
|
1041
|
+
};
|
|
1042
|
+
useEffect(() => {
|
|
1043
|
+
if (!loading) {
|
|
1044
|
+
setIsButtonLoading(false);
|
|
1045
|
+
}
|
|
1046
|
+
}, [loading]);
|
|
1047
|
+
return (React.createElement("button", { className: buttonStyles["provider-button"], onClick: handleClick, disabled: loading },
|
|
1048
|
+
React.createElement("img", { src: provider.info.icon ||
|
|
1049
|
+
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 24 24'%3E%3Cpath fill='%23777777' d='M21 7.28V5c0-1.1-.9-2-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2v-2.28A2 2 0 0 0 22 15V9a2 2 0 0 0-1-1.72M20 9v6h-7V9zM5 19V5h14v2h-6c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h6v2z'/%3E%3Ccircle cx='16' cy='12' r='1.5' fill='%23777777'/%3E%3C/svg%3E", className: buttonStyles["provider-icon"], alt: provider.info.name }),
|
|
1050
|
+
React.createElement("div", { style: {
|
|
1051
|
+
display: "flex",
|
|
1052
|
+
flexDirection: "column",
|
|
1053
|
+
alignItems: "flex-start",
|
|
1054
|
+
} },
|
|
1055
|
+
React.createElement("span", { className: buttonStyles["provider-name"] }, provider.info.name),
|
|
1056
|
+
label && (React.createElement("span", { className: buttonStyles["provider-label"] },
|
|
1057
|
+
"(",
|
|
1058
|
+
label,
|
|
1059
|
+
")"))),
|
|
1060
|
+
isButtonLoading && React.createElement("div", { className: styles.spinner })));
|
|
1061
|
+
};
|
|
1062
|
+
const ConnectorButton = ({ name, link, unlink, icon, isConnected, refetch, }) => {
|
|
1063
|
+
const [isUnlinking, setIsUnlinking] = useState(false);
|
|
1064
|
+
const handleClick = () => {
|
|
1065
|
+
link();
|
|
1066
|
+
};
|
|
1067
|
+
const handleDisconnect = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
1068
|
+
setIsUnlinking(true);
|
|
1069
|
+
try {
|
|
1070
|
+
yield unlink();
|
|
1071
|
+
yield refetch();
|
|
1072
|
+
setIsUnlinking(false);
|
|
1073
|
+
}
|
|
1074
|
+
catch (error) {
|
|
1075
|
+
setIsUnlinking(false);
|
|
1076
|
+
console.error(error);
|
|
1077
|
+
}
|
|
1078
|
+
});
|
|
1079
|
+
return (React.createElement("div", { className: styles["connector-container"] }, isConnected ? (React.createElement("div", { className: styles["connector-connected"], "data-connected": isConnected },
|
|
1080
|
+
icon,
|
|
1081
|
+
React.createElement("span", null, name),
|
|
1082
|
+
isUnlinking ? (React.createElement("div", { className: styles.loader, style: {
|
|
1083
|
+
alignSelf: "flex-end",
|
|
1084
|
+
position: "absolute",
|
|
1085
|
+
right: "0.375rem",
|
|
1086
|
+
} })) : (React.createElement("button", { className: styles["unlink-connector-button"], onClick: handleDisconnect, disabled: isUnlinking },
|
|
1087
|
+
React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", stroke: "currentColor" },
|
|
1088
|
+
React.createElement("path", { fill: "none", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M17 22v-2m-8-5l6-6m-4-3l.463-.536a5 5 0 0 1 7.071 7.072L18 13m-5 5l-.397.534a5.07 5.07 0 0 1-7.127 0a4.97 4.97 0 0 1 0-7.071L6 11m14 6h2M2 7h2m3-5v2" })),
|
|
1089
|
+
"Unlink")))) : (React.createElement("button", { onClick: handleClick, className: styles["connector-button"], disabled: isConnected },
|
|
1090
|
+
icon,
|
|
1091
|
+
React.createElement("span", null, name)))));
|
|
1092
|
+
};
|
|
1093
|
+
/**
|
|
1094
|
+
* The LinkButton component.
|
|
1095
|
+
* A button that will open the modal to link or unlink a social account.
|
|
1096
|
+
* @param { { variant: ("default"|"icon"), social: ("twitter"|"spotify"|"discord"), theme: ("default"|"camp") } } props The props.
|
|
1097
|
+
* @returns { JSX.Element } The LinkButton component.
|
|
1098
|
+
*/
|
|
1099
|
+
const LinkButton = ({ variant = "default", social, theme = "default", }) => {
|
|
1100
|
+
const { handleOpen } = useLinkModal();
|
|
1101
|
+
if (["default", "icon"].indexOf(variant) === -1) {
|
|
1102
|
+
throw new Error("Invalid variant, must be 'default' or 'icon'");
|
|
1103
|
+
}
|
|
1104
|
+
if (constants.AVAILABLE_SOCIALS.indexOf(social) === -1) {
|
|
1105
|
+
console.error(`Invalid LinkButton social, must be one of ${constants.AVAILABLE_SOCIALS.join(", ")}`);
|
|
1106
|
+
return null;
|
|
1107
|
+
}
|
|
1108
|
+
if (["default", "camp"].indexOf(theme) === -1) {
|
|
1109
|
+
throw new Error("Invalid theme, must be 'default' or 'camp'");
|
|
1110
|
+
}
|
|
1111
|
+
const { socials } = useSocials();
|
|
1112
|
+
const { authenticated } = useAuthState();
|
|
1113
|
+
const isLinked = socials && socials[social];
|
|
1114
|
+
const handleClick = () => {
|
|
1115
|
+
handleOpen(social);
|
|
1116
|
+
};
|
|
1117
|
+
const Icon = getIconBySocial(social);
|
|
1118
|
+
return (React.createElement("button", { disabled: !authenticated, className: `${buttonStyles[`link-button-${variant}`]}
|
|
1119
|
+
${theme === "default" ? buttonStyles[social] : ""}
|
|
1120
|
+
`, onClick: handleClick }, variant === "icon" ? (React.createElement("div", { className: buttonStyles["icon-container"] },
|
|
1121
|
+
React.createElement(Icon, null),
|
|
1122
|
+
React.createElement("div", { className: `${buttonStyles["camp-logo"]} ${!isLinked ? buttonStyles["not-linked"] : ""}` },
|
|
1123
|
+
React.createElement(CampIcon, null)))) : (React.createElement("div", { className: buttonStyles["button-container"] },
|
|
1124
|
+
React.createElement("div", { className: `${buttonStyles["camp-logo"]} ${!isLinked ? buttonStyles["not-linked"] : ""}` },
|
|
1125
|
+
React.createElement(CampIcon, null)),
|
|
1126
|
+
React.createElement("div", { className: buttonStyles["link-icon"] },
|
|
1127
|
+
React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor" },
|
|
1128
|
+
React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244" }))),
|
|
1129
|
+
React.createElement("div", { className: buttonStyles["social-icon"] },
|
|
1130
|
+
React.createElement(Icon, null))))));
|
|
1131
|
+
};
|
|
1132
|
+
/**
|
|
1133
|
+
* LoadingBar component to display upload progress.
|
|
1134
|
+
* @param { { progress: number } } props The props.
|
|
1135
|
+
* @returns { JSX.Element } The LoadingBar component.
|
|
1136
|
+
*/
|
|
1137
|
+
const LoadingBar = ({ progress }) => {
|
|
1138
|
+
return (React.createElement("div", { className: buttonStyles["loading-bar-container"] },
|
|
1139
|
+
React.createElement("div", { className: buttonStyles["loading-bar"], style: { width: `${progress}%` } })));
|
|
1140
|
+
};
|
|
1141
|
+
/**
|
|
1142
|
+
* The FileUpload component.
|
|
1143
|
+
* Provides a file upload field with drag-and-drop support.
|
|
1144
|
+
* @param { { onFileUpload?: function, accept?: string, maxFileSize?: number } } props The props.
|
|
1145
|
+
* @returns { JSX.Element } The FileUpload component.
|
|
1146
|
+
*/
|
|
1147
|
+
const FileUpload = ({ onFileUpload, accept, maxFileSize, }) => {
|
|
1148
|
+
const auth = useAuth();
|
|
1149
|
+
const { uploads } = useOrigin();
|
|
1150
|
+
const { refetch } = uploads;
|
|
1151
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
1152
|
+
const [selectedFile, setSelectedFile] = useState(null);
|
|
1153
|
+
const [isUploading, setIsUploading] = useState(false);
|
|
1154
|
+
const [uploadProgress, setUploadProgress] = useState(0);
|
|
1155
|
+
const fileInputRef = useRef(null);
|
|
1156
|
+
const { addToast } = useToast();
|
|
1157
|
+
const handleUpload = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
1158
|
+
var _a;
|
|
1159
|
+
if (selectedFile) {
|
|
1160
|
+
setIsUploading(true);
|
|
1161
|
+
try {
|
|
1162
|
+
yield ((_a = auth === null || auth === void 0 ? void 0 : auth.origin) === null || _a === void 0 ? void 0 : _a.uploadFile(selectedFile, {
|
|
1163
|
+
progressCallback(percent) {
|
|
1164
|
+
setUploadProgress(percent);
|
|
1165
|
+
},
|
|
1166
|
+
}));
|
|
1167
|
+
if (onFileUpload) {
|
|
1168
|
+
onFileUpload([selectedFile]);
|
|
1169
|
+
}
|
|
1170
|
+
addToast("File uploaded successfully", "success", 5000);
|
|
1171
|
+
refetch();
|
|
1172
|
+
}
|
|
1173
|
+
catch (error) {
|
|
1174
|
+
addToast("Error uploading file", "error", 5000);
|
|
1175
|
+
setIsUploading(false);
|
|
1176
|
+
}
|
|
1177
|
+
finally {
|
|
1178
|
+
setSelectedFile(null);
|
|
1179
|
+
setIsUploading(false);
|
|
1180
|
+
setUploadProgress(0);
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
});
|
|
1184
|
+
const handleDragOver = (e) => {
|
|
1185
|
+
e.preventDefault();
|
|
1186
|
+
setIsDragging(true);
|
|
1187
|
+
};
|
|
1188
|
+
const handleDragLeave = () => {
|
|
1189
|
+
setIsDragging(false);
|
|
1190
|
+
};
|
|
1191
|
+
const handleDrop = (e) => {
|
|
1192
|
+
e.preventDefault();
|
|
1193
|
+
setIsDragging(false);
|
|
1194
|
+
const files = Array.from(e.dataTransfer.files);
|
|
1195
|
+
if (accept) {
|
|
1196
|
+
const acceptedTypes = accept.split(",");
|
|
1197
|
+
const invalidFiles = files.filter((file) => !acceptedTypes.some((type) => file.type.match(type.trim())));
|
|
1198
|
+
if (invalidFiles.length > 0) {
|
|
1199
|
+
addToast(`File not supported. Accepted types: ${accept}`, "error", 5000);
|
|
1200
|
+
return;
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
const file = files[0];
|
|
1204
|
+
if (maxFileSize && file.size > maxFileSize) {
|
|
1205
|
+
addToast(`File size exceeds the limit of ${(maxFileSize /
|
|
1206
|
+
1024 /
|
|
1207
|
+
1024).toPrecision(2)} MB`, "error", 5000);
|
|
1208
|
+
return;
|
|
1209
|
+
}
|
|
1210
|
+
setSelectedFile(file);
|
|
1211
|
+
};
|
|
1212
|
+
const handleFileChange = (e) => {
|
|
1213
|
+
const files = Array.from(e.target.files || []);
|
|
1214
|
+
if (files.length > 0) {
|
|
1215
|
+
const file = files[0];
|
|
1216
|
+
if (maxFileSize && file.size > maxFileSize) {
|
|
1217
|
+
addToast(`File size exceeds the limit of ${(maxFileSize /
|
|
1218
|
+
1024 /
|
|
1219
|
+
1024).toPrecision(2)} MB`, "error", 5000);
|
|
1220
|
+
return;
|
|
1221
|
+
}
|
|
1222
|
+
setSelectedFile(file);
|
|
1223
|
+
}
|
|
1224
|
+
};
|
|
1225
|
+
const handleClick = () => {
|
|
1226
|
+
var _a;
|
|
1227
|
+
(_a = fileInputRef.current) === null || _a === void 0 ? void 0 : _a.click();
|
|
1228
|
+
};
|
|
1229
|
+
const handleRemoveFile = () => {
|
|
1230
|
+
setSelectedFile(null);
|
|
1231
|
+
fileInputRef.current.value = "";
|
|
1232
|
+
};
|
|
1233
|
+
const renderFilePreview = () => {
|
|
1234
|
+
if (!selectedFile)
|
|
1235
|
+
return null;
|
|
1236
|
+
if (selectedFile.type.startsWith("image/")) {
|
|
1237
|
+
return (React.createElement("img", { src: URL.createObjectURL(selectedFile), alt: "Preview", className: buttonStyles["file-preview"] }));
|
|
1238
|
+
}
|
|
1239
|
+
if (selectedFile.type.startsWith("audio/")) {
|
|
1240
|
+
return (React.createElement("audio", { controls: true, src: URL.createObjectURL(selectedFile), className: buttonStyles["file-preview"] }));
|
|
1241
|
+
}
|
|
1242
|
+
if (selectedFile.type.startsWith("video/")) {
|
|
1243
|
+
return (React.createElement("video", { controls: true, src: URL.createObjectURL(selectedFile), className: buttonStyles["file-preview"] }));
|
|
1244
|
+
}
|
|
1245
|
+
if (selectedFile.type.startsWith("text/")) {
|
|
1246
|
+
return (React.createElement("iframe", { src: URL.createObjectURL(selectedFile), className: buttonStyles["file-preview"], title: "File Preview" }));
|
|
1247
|
+
}
|
|
1248
|
+
return (React.createElement("p", { className: buttonStyles["file-preview-text"] },
|
|
1249
|
+
"File selected: ",
|
|
1250
|
+
selectedFile.name));
|
|
1251
|
+
};
|
|
1252
|
+
return (React.createElement("div", { className: `${buttonStyles["file-upload-container"]} ${isDragging
|
|
1253
|
+
? buttonStyles["dragging"]
|
|
1254
|
+
: selectedFile
|
|
1255
|
+
? buttonStyles["file-selected"]
|
|
1256
|
+
: ""}`, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, onClick: !selectedFile ? handleClick : undefined },
|
|
1257
|
+
React.createElement("input", { type: "file", accept: accept, className: buttonStyles["file-input"], onChange: handleFileChange, ref: fileInputRef }),
|
|
1258
|
+
selectedFile ? (React.createElement("div", { className: buttonStyles["selected-file-container"] },
|
|
1259
|
+
renderFilePreview(),
|
|
1260
|
+
React.createElement("span", { className: buttonStyles["file-name"] }, selectedFile.name),
|
|
1261
|
+
isUploading && React.createElement(LoadingBar, { progress: uploadProgress }),
|
|
1262
|
+
React.createElement("div", { className: buttonStyles["upload-buttons"] },
|
|
1263
|
+
React.createElement("button", { className: buttonStyles["remove-file-button"], disabled: isUploading, onClick: handleRemoveFile },
|
|
1264
|
+
React.createElement(BinIcon, { w: "1rem", h: "1rem" })),
|
|
1265
|
+
React.createElement("button", { className: buttonStyles["upload-file-button"], onClick: handleUpload, disabled: !selectedFile || isUploading }, "Upload")))) : (React.createElement("p", null,
|
|
1266
|
+
"Drag and drop your file here, or click to select a file.",
|
|
1267
|
+
React.createElement("br", null),
|
|
1268
|
+
accept && (React.createElement("span", { className: buttonStyles["accepted-types"] }, accept
|
|
1269
|
+
.split(",")
|
|
1270
|
+
.map((type) => type.trim().split("/")[1].replace(/-/g, " "))
|
|
1271
|
+
.join(", ")
|
|
1272
|
+
.replace("plain", "txt")
|
|
1273
|
+
.replace(/, ([^,]*)$/, ", or $1"))),
|
|
1274
|
+
React.createElement("br", null),
|
|
1275
|
+
maxFileSize && (React.createElement("span", { className: buttonStyles["accepted-types"] },
|
|
1276
|
+
"Max size: ",
|
|
1277
|
+
(maxFileSize / 1024 / 1024).toPrecision(2),
|
|
1278
|
+
" MB"))))));
|
|
1279
|
+
};
|
|
1280
|
+
|
|
1281
|
+
var StorageABI = [
|
|
1282
|
+
{
|
|
1283
|
+
inputs: [
|
|
1284
|
+
],
|
|
1285
|
+
name: "retrieve",
|
|
1286
|
+
outputs: [
|
|
1287
|
+
{
|
|
1288
|
+
internalType: "uint256",
|
|
1289
|
+
name: "",
|
|
1290
|
+
type: "uint256"
|
|
1291
|
+
}
|
|
1292
|
+
],
|
|
1293
|
+
stateMutability: "view",
|
|
1294
|
+
type: "function"
|
|
1295
|
+
},
|
|
1296
|
+
{
|
|
1297
|
+
inputs: [
|
|
1298
|
+
{
|
|
1299
|
+
internalType: "uint256",
|
|
1300
|
+
name: "num",
|
|
1301
|
+
type: "uint256"
|
|
1302
|
+
}
|
|
1303
|
+
],
|
|
1304
|
+
name: "store",
|
|
1305
|
+
outputs: [
|
|
1306
|
+
],
|
|
1307
|
+
stateMutability: "nonpayable",
|
|
1308
|
+
type: "function"
|
|
1309
|
+
}
|
|
1310
|
+
];
|
|
1311
|
+
|
|
1312
|
+
/**
|
|
1313
|
+
* The Auth modal component.
|
|
1314
|
+
* @param { { setIsVisible: function, wcProvider: object, loading: boolean, onlyWagmi: boolean, defaultProvider: object } } props The props.
|
|
1315
|
+
* @returns { JSX.Element } The Auth modal component.
|
|
1316
|
+
*/
|
|
1317
|
+
const AuthModal = ({ setIsVisible, wcProvider, loading, onlyWagmi, defaultProvider, }) => {
|
|
1318
|
+
const { connect } = useConnect();
|
|
1319
|
+
const { setProvider } = useProvider();
|
|
1320
|
+
const { auth, wagmiAvailable } = useContext(CampContext);
|
|
1321
|
+
const [customProvider, setCustomProvider] = useState(null);
|
|
1322
|
+
const providers = useProviders();
|
|
1323
|
+
const [customConnector, setCustomConnector] = useState(null);
|
|
1324
|
+
const [customAccount, setCustomAccount] = useState(null);
|
|
1325
|
+
let wagmiConnectorClient;
|
|
1326
|
+
let wagmiAccount;
|
|
1327
|
+
if (wagmiAvailable) {
|
|
1328
|
+
wagmiConnectorClient = useConnectorClient();
|
|
1329
|
+
wagmiAccount = useAccount();
|
|
1330
|
+
}
|
|
1331
|
+
if (!auth) {
|
|
1332
|
+
throw new Error("Auth instance is not available. Make sure to wrap your component with CampProvider.");
|
|
1333
|
+
}
|
|
1334
|
+
const handleWalletConnect = (_a) => __awaiter(void 0, [_a], void 0, function* ({ provider }) {
|
|
1335
|
+
auth.setLoading(true);
|
|
1336
|
+
try {
|
|
1337
|
+
if (provider.connected)
|
|
1338
|
+
yield provider.disconnect();
|
|
1339
|
+
yield provider.connect();
|
|
1340
|
+
}
|
|
1341
|
+
catch (error) {
|
|
1342
|
+
auth.setLoading(false);
|
|
1343
|
+
}
|
|
1344
|
+
});
|
|
1345
|
+
useEffect(() => {
|
|
1346
|
+
if (wagmiAvailable && !defaultProvider) {
|
|
1347
|
+
setCustomConnector(wagmiConnectorClient);
|
|
1348
|
+
setCustomAccount(wagmiAccount);
|
|
1349
|
+
}
|
|
1350
|
+
}, [
|
|
1351
|
+
wagmiAvailable,
|
|
1352
|
+
defaultProvider,
|
|
1353
|
+
wagmiAccount,
|
|
1354
|
+
wagmiConnectorClient === null || wagmiConnectorClient === void 0 ? void 0 : wagmiConnectorClient.data,
|
|
1355
|
+
]);
|
|
1356
|
+
useEffect(() => {
|
|
1357
|
+
if (defaultProvider && defaultProvider.provider && defaultProvider.info) {
|
|
1358
|
+
let addr = defaultProvider.provider.address;
|
|
1359
|
+
const acc = {
|
|
1360
|
+
connector: Object.assign(Object.assign({}, defaultProvider.info), { icon: defaultProvider.info.icon ||
|
|
1361
|
+
getIconByConnectorName(defaultProvider.info.name) }),
|
|
1362
|
+
address: addr,
|
|
1363
|
+
};
|
|
1364
|
+
if (!addr) {
|
|
1365
|
+
defaultProvider.provider
|
|
1366
|
+
.request({
|
|
1367
|
+
method: "eth_requestAccounts",
|
|
1368
|
+
})
|
|
1369
|
+
.then((accounts) => {
|
|
1370
|
+
setCustomAccount(Object.assign(Object.assign({}, acc), { address: accounts[0] }));
|
|
1371
|
+
});
|
|
1372
|
+
}
|
|
1373
|
+
else {
|
|
1374
|
+
setCustomAccount(acc);
|
|
1375
|
+
}
|
|
1376
|
+
setCustomProvider(defaultProvider.provider);
|
|
1377
|
+
}
|
|
1378
|
+
}, [defaultProvider]);
|
|
1379
|
+
useEffect(() => {
|
|
1380
|
+
if (wagmiAvailable && customConnector) {
|
|
1381
|
+
const provider = customConnector.data;
|
|
1382
|
+
if (provider) {
|
|
1383
|
+
setCustomProvider(provider);
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
}, [customConnector, customConnector === null || customConnector === void 0 ? void 0 : customConnector.data, wagmiAvailable, customProvider]);
|
|
1387
|
+
useEffect(() => {
|
|
1388
|
+
const doConnect = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
1389
|
+
handleConnect({
|
|
1390
|
+
provider: wcProvider,
|
|
1391
|
+
info: { name: "WalletConnect" },
|
|
1392
|
+
});
|
|
1393
|
+
});
|
|
1394
|
+
if (wcProvider) {
|
|
1395
|
+
wcProvider.on("connect", doConnect);
|
|
1396
|
+
}
|
|
1397
|
+
return () => {
|
|
1398
|
+
if (wcProvider) {
|
|
1399
|
+
wcProvider.off("connect", doConnect);
|
|
1400
|
+
}
|
|
1401
|
+
};
|
|
1402
|
+
}, [wcProvider]);
|
|
1403
|
+
const handleConnect = (provider) => {
|
|
1404
|
+
var _a, _b;
|
|
1405
|
+
if (provider) {
|
|
1406
|
+
let addr = null;
|
|
1407
|
+
if (((_a = provider === null || provider === void 0 ? void 0 : provider.provider) === null || _a === void 0 ? void 0 : _a.uid) === (customProvider === null || customProvider === void 0 ? void 0 : customProvider.uid)) {
|
|
1408
|
+
addr = customAccount === null || customAccount === void 0 ? void 0 : customAccount.address;
|
|
1409
|
+
}
|
|
1410
|
+
setProvider(Object.assign(Object.assign({}, provider), { address: addr }));
|
|
1411
|
+
if (addr) {
|
|
1412
|
+
auth.setWalletAddress(addr);
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
// necessary for appkit, as it doesn't seem to support the "eth_requestAccounts" method
|
|
1416
|
+
if ((customAccount === null || customAccount === void 0 ? void 0 : customAccount.address) &&
|
|
1417
|
+
(customProvider === null || customProvider === void 0 ? void 0 : customProvider.uid) &&
|
|
1418
|
+
((_b = provider === null || provider === void 0 ? void 0 : provider.provider) === null || _b === void 0 ? void 0 : _b.uid) === (customProvider === null || customProvider === void 0 ? void 0 : customProvider.uid)) {
|
|
1419
|
+
auth.setWalletAddress(customAccount === null || customAccount === void 0 ? void 0 : customAccount.address);
|
|
1420
|
+
}
|
|
1421
|
+
connect();
|
|
1422
|
+
};
|
|
1423
|
+
return (React.createElement("div", { className: styles["outer-container"] },
|
|
1424
|
+
React.createElement("div", { className: `${styles.container} ${styles["linking-container"]}` },
|
|
1425
|
+
React.createElement("div", { className: styles["close-button"], onClick: () => setIsVisible(false) },
|
|
1426
|
+
React.createElement(CloseIcon, null)),
|
|
1427
|
+
React.createElement("div", { className: styles["auth-header"] },
|
|
1428
|
+
React.createElement("div", { className: styles["modal-icon"] },
|
|
1429
|
+
React.createElement(CampIcon, null)),
|
|
1430
|
+
React.createElement("span", null, "Connect to Origin")),
|
|
1431
|
+
React.createElement("div", { className: `${(customAccount === null || customAccount === void 0 ? void 0 : customAccount.connector) ? styles["big"] : ""} ${styles["provider-list"]}` },
|
|
1432
|
+
(customAccount === null || customAccount === void 0 ? void 0 : customAccount.connector) && (React.createElement(React.Fragment, null,
|
|
1433
|
+
React.createElement(ProviderButton, { provider: {
|
|
1434
|
+
provider: customProvider || window.ethereum,
|
|
1435
|
+
info: {
|
|
1436
|
+
name: customAccount.connector.name,
|
|
1437
|
+
icon: customAccount.connector.icon ||
|
|
1438
|
+
getIconByConnectorName(customAccount.connector.name),
|
|
1439
|
+
},
|
|
1440
|
+
}, label: formatAddress(customAccount.address), handleConnect: handleConnect, loading: loading }),
|
|
1441
|
+
(providers.length || wcProvider || window.ethereum) &&
|
|
1442
|
+
!onlyWagmi &&
|
|
1443
|
+
!(defaultProvider === null || defaultProvider === void 0 ? void 0 : defaultProvider.exclusive) && (React.createElement("div", { className: styles["divider"] })))),
|
|
1444
|
+
!onlyWagmi &&
|
|
1445
|
+
!(defaultProvider === null || defaultProvider === void 0 ? void 0 : defaultProvider.exclusive) &&
|
|
1446
|
+
providers.map((provider) => (React.createElement(ProviderButton, { provider: provider, handleConnect: handleConnect, loading: loading, key: provider.info.uuid }))),
|
|
1447
|
+
!onlyWagmi && !(defaultProvider === null || defaultProvider === void 0 ? void 0 : defaultProvider.exclusive) && wcProvider && (React.createElement(ProviderButton, { provider: {
|
|
1448
|
+
provider: wcProvider,
|
|
1449
|
+
info: {
|
|
1450
|
+
name: "WalletConnect",
|
|
1451
|
+
icon: "data:image/svg+xml,%3Csvg fill='%233B99FC' role='img' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.913 7.519c3.915-3.831 10.26-3.831 14.174 0l.471.461a.483.483 0 0 1 0 .694l-1.611 1.577a.252.252 0 0 1-.354 0l-.649-.634c-2.73-2.673-7.157-2.673-9.887 0l-.694.68a.255.255 0 0 1-.355 0L4.397 8.719a.482.482 0 0 1 0-.693l.516-.507Zm17.506 3.263 1.434 1.404a.483.483 0 0 1 0 .694l-6.466 6.331a.508.508 0 0 1-.709 0l-4.588-4.493a.126.126 0 0 0-.178 0l-4.589 4.493a.508.508 0 0 1-.709 0L.147 12.88a.483.483 0 0 1 0-.694l1.434-1.404a.508.508 0 0 1 .709 0l4.589 4.493c.05.048.129.048.178 0l4.589-4.493a.508.508 0 0 1 .709 0l4.589 4.493c.05.048.128.048.178 0l4.589-4.493a.507.507 0 0 1 .708 0Z'/%3E%3C/svg%3E",
|
|
1452
|
+
},
|
|
1453
|
+
}, handleConnect: handleWalletConnect, loading: loading })),
|
|
1454
|
+
!onlyWagmi && !(defaultProvider === null || defaultProvider === void 0 ? void 0 : defaultProvider.exclusive) && window.ethereum && (React.createElement(ProviderButton, { provider: {
|
|
1455
|
+
provider: window.ethereum,
|
|
1456
|
+
info: {
|
|
1457
|
+
name: "Browser Wallet",
|
|
1458
|
+
},
|
|
1459
|
+
}, label: "window.ethereum", handleConnect: handleConnect, loading: loading }))),
|
|
1460
|
+
React.createElement("a", { href: "https://campnetwork.xyz", className: styles["footer-text"], target: "_blank", rel: "noopener noreferrer" }, "Powered by Camp Network"))));
|
|
1461
|
+
};
|
|
1462
|
+
/**
|
|
1463
|
+
* The CampModal component.
|
|
1464
|
+
* @param { { injectButton?: boolean, wcProjectId?: string, onlyWagmi?: boolean, defaultProvider?: object } } props The props.
|
|
1465
|
+
* @returns { JSX.Element } The CampModal component.
|
|
1466
|
+
*/
|
|
1467
|
+
const CampModal = ({ injectButton = true, wcProjectId, onlyWagmi = false, defaultProvider, }) => {
|
|
1468
|
+
// const [isButtonDisabled, setIsButtonDisabled] = useState(false);
|
|
1469
|
+
const { auth } = useContext(CampContext);
|
|
1470
|
+
const { authenticated, loading } = useAuthState();
|
|
1471
|
+
const { isVisible, setIsVisible, isButtonDisabled, setIsButtonDisabled } = useContext(ModalContext);
|
|
1472
|
+
const { isLinkingVisible } = useContext(ModalContext);
|
|
1473
|
+
const { provider } = useProvider();
|
|
1474
|
+
const providers = useProviders();
|
|
1475
|
+
const { wagmiAvailable } = useContext(CampContext);
|
|
1476
|
+
let customAccount;
|
|
1477
|
+
if (wagmiAvailable) {
|
|
1478
|
+
customAccount = useAccount();
|
|
1479
|
+
}
|
|
1480
|
+
const walletConnectProvider = wcProjectId
|
|
1481
|
+
? useWalletConnectProvider(wcProjectId)
|
|
1482
|
+
: null;
|
|
1483
|
+
const handleModalButton = () => {
|
|
1484
|
+
setIsVisible(true);
|
|
1485
|
+
};
|
|
1486
|
+
useEffect(() => {
|
|
1487
|
+
if (authenticated) {
|
|
1488
|
+
if (isVisible) {
|
|
1489
|
+
setIsVisible(false);
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
}, [authenticated]);
|
|
1493
|
+
useEffect(() => {
|
|
1494
|
+
const recoverProvider = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
1495
|
+
var _a, _b;
|
|
1496
|
+
try {
|
|
1497
|
+
if (auth) {
|
|
1498
|
+
if (defaultProvider && defaultProvider.provider) {
|
|
1499
|
+
const provider = defaultProvider.provider;
|
|
1500
|
+
const [address] = yield provider.request({
|
|
1501
|
+
method: "eth_requestAccounts",
|
|
1502
|
+
});
|
|
1503
|
+
if (address.toLowerCase() === ((_a = auth.walletAddress) === null || _a === void 0 ? void 0 : _a.toLowerCase())) {
|
|
1504
|
+
auth.setProvider(Object.assign(Object.assign({}, defaultProvider), { address }));
|
|
1505
|
+
}
|
|
1506
|
+
else {
|
|
1507
|
+
console.error("Address mismatch. Default provider address does not match authenticated address.");
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
else if (walletConnectProvider) {
|
|
1511
|
+
const [address] = yield walletConnectProvider.request({
|
|
1512
|
+
method: "eth_requestAccounts",
|
|
1513
|
+
});
|
|
1514
|
+
if (address.toLowerCase() === ((_b = auth.walletAddress) === null || _b === void 0 ? void 0 : _b.toLowerCase())) {
|
|
1515
|
+
auth.setProvider({
|
|
1516
|
+
provider: walletConnectProvider,
|
|
1517
|
+
info: {
|
|
1518
|
+
name: "WalletConnect",
|
|
1519
|
+
},
|
|
1520
|
+
address,
|
|
1521
|
+
});
|
|
1522
|
+
}
|
|
1523
|
+
else {
|
|
1524
|
+
console.error("Address mismatch. WalletConnect provider address does not match authenticated address.");
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
catch (error) {
|
|
1530
|
+
console.error("Error recovering provider:", error);
|
|
1531
|
+
}
|
|
1532
|
+
});
|
|
1533
|
+
if (authenticated) {
|
|
1534
|
+
recoverProvider();
|
|
1535
|
+
}
|
|
1536
|
+
}, [authenticated, defaultProvider, defaultProvider === null || defaultProvider === void 0 ? void 0 : defaultProvider.provider, auth]);
|
|
1537
|
+
// Cases where the button should be disabled
|
|
1538
|
+
useEffect(() => {
|
|
1539
|
+
const noProvider = !provider.provider;
|
|
1540
|
+
const noWagmiOrAccount = !wagmiAvailable || !(customAccount === null || customAccount === void 0 ? void 0 : customAccount.isConnected);
|
|
1541
|
+
const noWalletConnectProvider = !walletConnectProvider;
|
|
1542
|
+
const noProviders = !providers.length;
|
|
1543
|
+
const onlyWagmiNoAccount = onlyWagmi && !(customAccount === null || customAccount === void 0 ? void 0 : customAccount.isConnected);
|
|
1544
|
+
const noDefaultProvider = !defaultProvider || !defaultProvider.provider;
|
|
1545
|
+
const defaultProviderExclusive = defaultProvider === null || defaultProvider === void 0 ? void 0 : defaultProvider.exclusive;
|
|
1546
|
+
const noAvailableProviders = noProvider &&
|
|
1547
|
+
noWagmiOrAccount &&
|
|
1548
|
+
noWalletConnectProvider &&
|
|
1549
|
+
noProviders &&
|
|
1550
|
+
noDefaultProvider;
|
|
1551
|
+
const shouldDisableButton = (noAvailableProviders ||
|
|
1552
|
+
onlyWagmiNoAccount ||
|
|
1553
|
+
(noDefaultProvider && defaultProviderExclusive)) &&
|
|
1554
|
+
!authenticated;
|
|
1555
|
+
setIsButtonDisabled(shouldDisableButton);
|
|
1556
|
+
}, [
|
|
1557
|
+
provider,
|
|
1558
|
+
wagmiAvailable,
|
|
1559
|
+
customAccount,
|
|
1560
|
+
walletConnectProvider,
|
|
1561
|
+
providers,
|
|
1562
|
+
authenticated,
|
|
1563
|
+
defaultProvider,
|
|
1564
|
+
]);
|
|
1565
|
+
return (React.createElement(ClientOnly, null,
|
|
1566
|
+
React.createElement("div", null,
|
|
1567
|
+
injectButton && (React.createElement(CampButton, { disabled: isButtonDisabled, onClick: handleModalButton, authenticated: authenticated })),
|
|
1568
|
+
React.createElement(ReactPortal, { wrapperId: "camp-modal-wrapper" },
|
|
1569
|
+
isLinkingVisible && React.createElement(LinkingModal, null),
|
|
1570
|
+
isVisible && (React.createElement("div", { className: styles.modal, onClick: (e) => {
|
|
1571
|
+
if (e.target === e.currentTarget) {
|
|
1572
|
+
setIsVisible(false);
|
|
1573
|
+
}
|
|
1574
|
+
} }, authenticated ? (React.createElement(MyCampModal, { wcProvider: walletConnectProvider })) : (React.createElement(AuthModal, { setIsVisible: setIsVisible, wcProvider: walletConnectProvider, loading: loading, onlyWagmi: onlyWagmi, defaultProvider: defaultProvider }))))))));
|
|
1575
|
+
};
|
|
1576
|
+
/**
|
|
1577
|
+
* The TikTokFlow component. Handles linking and unlinking of TikTok accounts.
|
|
1578
|
+
* @returns { JSX.Element } The TikTokFlow component.
|
|
1579
|
+
*/
|
|
1580
|
+
const TikTokFlow = () => {
|
|
1581
|
+
const { setIsLinkingVisible, currentlyLinking } = useContext(ModalContext);
|
|
1582
|
+
const { socials, refetch, isLoading: isSocialsLoading } = useSocials();
|
|
1583
|
+
const { auth } = useContext(CampContext);
|
|
1584
|
+
const [IsLoading, setIsLoading] = useState(false);
|
|
1585
|
+
const [handleInput, setHandleInput] = useState("");
|
|
1586
|
+
if (!auth) {
|
|
1587
|
+
throw new Error("Auth instance is not available. Make sure to wrap your component with CampProvider.");
|
|
1588
|
+
}
|
|
1589
|
+
const resetState = () => {
|
|
1590
|
+
setIsLoading(false);
|
|
1591
|
+
setIsLinkingVisible(false);
|
|
1592
|
+
setHandleInput("");
|
|
1593
|
+
};
|
|
1594
|
+
const handleLink = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
1595
|
+
if (isSocialsLoading)
|
|
1596
|
+
return;
|
|
1597
|
+
setIsLoading(true);
|
|
1598
|
+
if (socials[currentlyLinking]) {
|
|
1599
|
+
try {
|
|
1600
|
+
yield auth.unlinkTikTok();
|
|
1601
|
+
}
|
|
1602
|
+
catch (error) {
|
|
1603
|
+
resetState();
|
|
1604
|
+
console.error(error);
|
|
1605
|
+
return;
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
else {
|
|
1609
|
+
if (!handleInput)
|
|
1610
|
+
return;
|
|
1611
|
+
try {
|
|
1612
|
+
yield auth.linkTikTok(handleInput);
|
|
1613
|
+
}
|
|
1614
|
+
catch (error) {
|
|
1615
|
+
resetState();
|
|
1616
|
+
console.error(error);
|
|
1617
|
+
return;
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1620
|
+
refetch();
|
|
1621
|
+
resetState();
|
|
1622
|
+
});
|
|
1623
|
+
return (React.createElement("div", null,
|
|
1624
|
+
React.createElement("div", { className: styles["linking-text"] }, currentlyLinking && socials[currentlyLinking] ? (React.createElement("div", null,
|
|
1625
|
+
"Your ",
|
|
1626
|
+
capitalize(currentlyLinking),
|
|
1627
|
+
" account is currently linked.")) : (React.createElement("div", null,
|
|
1628
|
+
React.createElement("b", null, window.location.host),
|
|
1629
|
+
" is requesting to link your",
|
|
1630
|
+
" ",
|
|
1631
|
+
capitalize(currentlyLinking),
|
|
1632
|
+
" account.",
|
|
1633
|
+
React.createElement("div", null,
|
|
1634
|
+
React.createElement("input", { value: handleInput, onChange: (e) => setHandleInput(e.target.value), type: "text", placeholder: "Enter your TikTok username", className: styles["tiktok-input"] }))))),
|
|
1635
|
+
React.createElement("button", { className: styles["linking-button"], onClick: handleLink, disabled: IsLoading }, !IsLoading ? (currentlyLinking && socials[currentlyLinking] ? ("Unlink") : ("Link")) : (React.createElement("div", { className: styles.spinner })))));
|
|
1636
|
+
};
|
|
1637
|
+
/**
|
|
1638
|
+
* The OTPInput component. Handles OTP input with customizable number of inputs.
|
|
1639
|
+
* @param { { numInputs: number, onChange: function } } props The props.
|
|
1640
|
+
* @returns { JSX.Element } The OTPInput component.
|
|
1641
|
+
*/
|
|
1642
|
+
const OTPInput = ({ numInputs, onChange }) => {
|
|
1643
|
+
const [otp, setOtp] = useState(Array(numInputs).fill(""));
|
|
1644
|
+
const inputRefs = useRef([]);
|
|
1645
|
+
const handleChange = (value, index) => {
|
|
1646
|
+
if (!/^\d*$/.test(value))
|
|
1647
|
+
return;
|
|
1648
|
+
const newOtp = [...otp];
|
|
1649
|
+
newOtp[index] = value;
|
|
1650
|
+
setOtp(newOtp);
|
|
1651
|
+
onChange(newOtp.join(""));
|
|
1652
|
+
if (value && index < numInputs - 1) {
|
|
1653
|
+
inputRefs.current[index + 1].focus();
|
|
1654
|
+
}
|
|
1655
|
+
};
|
|
1656
|
+
const handleKeyDown = (e, index) => {
|
|
1657
|
+
if (e.key === "Backspace" && !otp[index] && index > 0) {
|
|
1658
|
+
inputRefs.current[index - 1].focus();
|
|
1659
|
+
}
|
|
1660
|
+
};
|
|
1661
|
+
const handleFocus = (e) => e.target.select();
|
|
1662
|
+
return (React.createElement("div", { className: styles["otp-input-container"] }, otp.map((_, index) => (React.createElement("input", { key: index, ref: (el) => {
|
|
1663
|
+
inputRefs.current[index] = el;
|
|
1664
|
+
}, type: "text", maxLength: 1, value: otp[index], onChange: (e) => handleChange(e.target.value, index), onKeyDown: (e) => handleKeyDown(e, index), onFocus: handleFocus, className: styles["otp-input"] })))));
|
|
1665
|
+
};
|
|
1666
|
+
/**
|
|
1667
|
+
* The TelegramFlow component. Handles linking and unlinking of Telegram accounts.
|
|
1668
|
+
* @returns { JSX.Element } The TelegramFlow component.
|
|
1669
|
+
*/
|
|
1670
|
+
const TelegramFlow = () => {
|
|
1671
|
+
const { setIsLinkingVisible, currentlyLinking } = useContext(ModalContext);
|
|
1672
|
+
const { socials, refetch, isLoading: isSocialsLoading } = useSocials();
|
|
1673
|
+
const { auth } = useContext(CampContext);
|
|
1674
|
+
const [IsLoading, setIsLoading] = useState(false);
|
|
1675
|
+
const [phoneInput, setPhoneInput] = useState("");
|
|
1676
|
+
const [otpInput, setOtpInput] = useState("");
|
|
1677
|
+
const [phoneCodeHash, setPhoneCodeHash] = useState("");
|
|
1678
|
+
const [isOTPSent, setIsOTPSent] = useState(false);
|
|
1679
|
+
const [isPhoneValid, setIsPhoneValid] = useState(true);
|
|
1680
|
+
const { addToast: toast } = useToast();
|
|
1681
|
+
if (!auth) {
|
|
1682
|
+
throw new Error("Auth instance is not available. Make sure to wrap your component with CampProvider.");
|
|
1683
|
+
}
|
|
1684
|
+
const resetState = () => {
|
|
1685
|
+
setIsLoading(false);
|
|
1686
|
+
setPhoneInput("");
|
|
1687
|
+
setOtpInput("");
|
|
1688
|
+
};
|
|
1689
|
+
const handlePhoneInput = (e) => {
|
|
1690
|
+
setPhoneInput(e.target.value);
|
|
1691
|
+
setIsPhoneValid(verifyPhoneNumber(e.target.value) || !e.target.value);
|
|
1692
|
+
};
|
|
1693
|
+
const verifyPhoneNumber = (phone) => {
|
|
1694
|
+
const phoneRegex = /^(\+\d{1,2}\s?)?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}$/;
|
|
1695
|
+
return phoneRegex.test(phone.replace(/\s/g, "").replace(/[-()]/g, ""));
|
|
1696
|
+
};
|
|
1697
|
+
const handleAction = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
1698
|
+
if (isSocialsLoading)
|
|
1699
|
+
return;
|
|
1700
|
+
if (isOTPSent) {
|
|
1701
|
+
if (!otpInput)
|
|
1702
|
+
return;
|
|
1703
|
+
setIsLoading(true);
|
|
1704
|
+
try {
|
|
1705
|
+
yield auth.linkTelegram(phoneInput, otpInput, phoneCodeHash);
|
|
1706
|
+
refetch();
|
|
1707
|
+
resetState();
|
|
1708
|
+
setIsLinkingVisible(false);
|
|
1709
|
+
}
|
|
1710
|
+
catch (error) {
|
|
1711
|
+
resetState();
|
|
1712
|
+
console.error(error);
|
|
1713
|
+
return;
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
else {
|
|
1717
|
+
if (!verifyPhoneNumber(phoneInput)) {
|
|
1718
|
+
toast("Invalid phone number, it should be in the format +1234567890", "warning", 5000);
|
|
1719
|
+
return;
|
|
1720
|
+
}
|
|
1721
|
+
setIsLoading(true);
|
|
1722
|
+
try {
|
|
1723
|
+
const res = yield auth.sendTelegramOTP(phoneInput);
|
|
1724
|
+
setIsOTPSent(true);
|
|
1725
|
+
setIsLoading(false);
|
|
1726
|
+
setPhoneCodeHash(res.phone_code_hash);
|
|
1727
|
+
}
|
|
1728
|
+
catch (error) {
|
|
1729
|
+
resetState();
|
|
1730
|
+
console.error(error);
|
|
1731
|
+
return;
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
});
|
|
1735
|
+
return (React.createElement("div", null,
|
|
1736
|
+
React.createElement("div", { className: styles["linking-text"] }, currentlyLinking && socials[currentlyLinking] ? (React.createElement("div", null,
|
|
1737
|
+
"Your ",
|
|
1738
|
+
capitalize(currentlyLinking),
|
|
1739
|
+
" account is currently linked.")) : (React.createElement("div", null, isOTPSent ? (React.createElement("div", null,
|
|
1740
|
+
React.createElement("span", null, "Enter the OTP sent to your phone number."),
|
|
1741
|
+
React.createElement("div", null,
|
|
1742
|
+
React.createElement(OTPInput, { numInputs: 5, onChange: setOtpInput })))) : (React.createElement("div", null,
|
|
1743
|
+
React.createElement("b", null, window.location.host),
|
|
1744
|
+
" is requesting to link your",
|
|
1745
|
+
" ",
|
|
1746
|
+
capitalize(currentlyLinking),
|
|
1747
|
+
" account. ",
|
|
1748
|
+
React.createElement("br", null),
|
|
1749
|
+
React.createElement("span", null, "This will only work if you have 2FA disabled on your Telegram account."),
|
|
1750
|
+
React.createElement("div", null,
|
|
1751
|
+
React.createElement("input", { value: phoneInput, onChange: handlePhoneInput, type: "tel", placeholder: "Enter your phone number", className: `${styles["tiktok-input"]} ${!isPhoneValid ? styles["invalid"] : ""}` }))))))),
|
|
1752
|
+
React.createElement("button", { className: styles["linking-button"], onClick: handleAction, disabled: IsLoading ||
|
|
1753
|
+
(!isPhoneValid && !isOTPSent) ||
|
|
1754
|
+
(!phoneInput && !isOTPSent) ||
|
|
1755
|
+
(isOTPSent && otpInput.length < 5) }, !IsLoading ? (currentlyLinking && socials[currentlyLinking] ? ("Unlink") : isOTPSent ? ("Link") : ("Send OTP")) : (React.createElement("div", { className: styles.spinner })))));
|
|
1756
|
+
};
|
|
1757
|
+
/**
|
|
1758
|
+
* The BasicFlow component. Handles linking and unlinking of socials through redirecting to the appropriate OAuth flow.
|
|
1759
|
+
* @returns { JSX.Element } The BasicFlow component.
|
|
1760
|
+
*/
|
|
1761
|
+
const BasicFlow = () => {
|
|
1762
|
+
const { setIsLinkingVisible, currentlyLinking } = useContext(ModalContext);
|
|
1763
|
+
const { socials, refetch, isLoading: isSocialsLoading } = useSocials();
|
|
1764
|
+
const { auth } = useContext(CampContext);
|
|
1765
|
+
const [isUnlinking, setIsUnlinking] = useState(false);
|
|
1766
|
+
if (!auth) {
|
|
1767
|
+
throw new Error("Auth instance is not available. Make sure to wrap your component with CampProvider.");
|
|
1768
|
+
}
|
|
1769
|
+
const handleLink = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
1770
|
+
if (isSocialsLoading)
|
|
1771
|
+
return;
|
|
1772
|
+
if (socials[currentlyLinking]) {
|
|
1773
|
+
setIsUnlinking(true);
|
|
1774
|
+
try {
|
|
1775
|
+
yield auth[`unlink${capitalize(currentlyLinking)}`]();
|
|
1776
|
+
}
|
|
1777
|
+
catch (error) {
|
|
1778
|
+
setIsUnlinking(false);
|
|
1779
|
+
setIsLinkingVisible(false);
|
|
1780
|
+
console.error(error);
|
|
1781
|
+
return;
|
|
1782
|
+
}
|
|
1783
|
+
refetch();
|
|
1784
|
+
setIsLinkingVisible(false);
|
|
1785
|
+
setIsUnlinking(false);
|
|
1786
|
+
}
|
|
1787
|
+
else {
|
|
1788
|
+
try {
|
|
1789
|
+
yield auth[`link${capitalize(currentlyLinking)}`]();
|
|
1790
|
+
}
|
|
1791
|
+
catch (error) {
|
|
1792
|
+
setIsLinkingVisible(false);
|
|
1793
|
+
console.error(error);
|
|
1794
|
+
return;
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1797
|
+
});
|
|
1798
|
+
return (React.createElement("div", null,
|
|
1799
|
+
React.createElement("div", { className: styles["linking-text"] }, currentlyLinking && socials[currentlyLinking] ? (React.createElement("div", null,
|
|
1800
|
+
"Your ",
|
|
1801
|
+
capitalize(currentlyLinking),
|
|
1802
|
+
" account is currently linked.")) : (React.createElement("div", null,
|
|
1803
|
+
React.createElement("b", null, window.location.host),
|
|
1804
|
+
" is requesting to link your",
|
|
1805
|
+
" ",
|
|
1806
|
+
capitalize(currentlyLinking),
|
|
1807
|
+
" account."))),
|
|
1808
|
+
React.createElement("button", { className: styles["linking-button"], onClick: handleLink, disabled: isUnlinking }, !isUnlinking ? (currentlyLinking && socials[currentlyLinking] ? ("Unlink") : ("Link")) : (React.createElement("div", { className: styles.spinner })))));
|
|
1809
|
+
};
|
|
1810
|
+
/**
|
|
1811
|
+
* The LinkingModal component. Handles the linking and unlinking of socials.
|
|
1812
|
+
* @returns { JSX.Element } The LinkingModal component.
|
|
1813
|
+
*/
|
|
1814
|
+
const LinkingModal = () => {
|
|
1815
|
+
const { isLoading: isSocialsLoading } = useSocials();
|
|
1816
|
+
const { setIsLinkingVisible, currentlyLinking } = useContext(ModalContext);
|
|
1817
|
+
const [flow, setFlow] = useState("basic");
|
|
1818
|
+
useEffect(() => {
|
|
1819
|
+
if (["twitter", "discord", "spotify"].includes(currentlyLinking)) {
|
|
1820
|
+
setFlow("basic");
|
|
1821
|
+
}
|
|
1822
|
+
else if (currentlyLinking === "tiktok") {
|
|
1823
|
+
setFlow("tiktok");
|
|
1824
|
+
}
|
|
1825
|
+
else if (currentlyLinking === "telegram") {
|
|
1826
|
+
setFlow("telegram");
|
|
1827
|
+
}
|
|
1828
|
+
}, [currentlyLinking]);
|
|
1829
|
+
const Icon = getIconBySocial(currentlyLinking);
|
|
1830
|
+
return (React.createElement("div", { className: styles.modal, onClick: (e) => {
|
|
1831
|
+
if (e.target === e.currentTarget) {
|
|
1832
|
+
setIsLinkingVisible(false);
|
|
1833
|
+
}
|
|
1834
|
+
}, style: {
|
|
1835
|
+
zIndex: 86,
|
|
1836
|
+
} },
|
|
1837
|
+
React.createElement("div", { className: styles["outer-container"] },
|
|
1838
|
+
React.createElement("div", { className: `${styles.container} ${styles["linking-container"]}` },
|
|
1839
|
+
React.createElement("div", { className: styles["close-button"], onClick: () => setIsLinkingVisible(false) },
|
|
1840
|
+
React.createElement(CloseIcon, null)),
|
|
1841
|
+
isSocialsLoading ? (React.createElement("div", { style: {
|
|
1842
|
+
display: "flex",
|
|
1843
|
+
justifyContent: "center",
|
|
1844
|
+
alignItems: "center",
|
|
1845
|
+
height: "4rem",
|
|
1846
|
+
marginBottom: "1rem",
|
|
1847
|
+
} },
|
|
1848
|
+
React.createElement("div", { className: styles.spinner, style: {
|
|
1849
|
+
marginRight: "auto",
|
|
1850
|
+
} }))) : (React.createElement("div", null,
|
|
1851
|
+
React.createElement("div", { className: styles.header },
|
|
1852
|
+
React.createElement("div", { className: styles["small-modal-icon"] },
|
|
1853
|
+
React.createElement(Icon, null))),
|
|
1854
|
+
flow === "basic" && React.createElement(BasicFlow, null),
|
|
1855
|
+
flow === "tiktok" && React.createElement(TikTokFlow, null),
|
|
1856
|
+
flow === "telegram" && React.createElement(TelegramFlow, null))),
|
|
1857
|
+
React.createElement("a", { href: "https://campnetwork.xyz", className: styles["footer-text"], target: "_blank", rel: "noopener noreferrer", style: { marginTop: 0 } }, "Powered by Camp Network")))));
|
|
1858
|
+
};
|
|
1859
|
+
/** demo */
|
|
1860
|
+
const ContractInteraction = () => {
|
|
1861
|
+
const { auth } = useContext(CampContext);
|
|
1862
|
+
const [inputValue, setInputValue] = useState("");
|
|
1863
|
+
const [loading, setLoading] = useState(false);
|
|
1864
|
+
const { addToast: toast } = useToast();
|
|
1865
|
+
const CONTRACT_ADDRESS = "0xcCB22CdA4857E1665dE3043FF77ff125c9E0A2A7";
|
|
1866
|
+
const callContract = (methodName_1, params_1, ...args_1) => __awaiter(void 0, [methodName_1, params_1, ...args_1], void 0, function* (methodName, params, isWrite = false) {
|
|
1867
|
+
if (!auth) {
|
|
1868
|
+
toast("Auth instance not available", "error", 5000);
|
|
1869
|
+
return;
|
|
1870
|
+
}
|
|
1871
|
+
try {
|
|
1872
|
+
setLoading(true);
|
|
1873
|
+
const result = yield auth.callContractMethod(CONTRACT_ADDRESS, StorageABI, methodName, params, { waitForReceipt: true });
|
|
1874
|
+
if (isWrite) {
|
|
1875
|
+
toast("Transaction sent successfully", "success", 5000);
|
|
1876
|
+
alert(`Transaction sent successfully: ${result.transactionHash}`);
|
|
1877
|
+
}
|
|
1878
|
+
else {
|
|
1879
|
+
toast("Retrieved value successfully", "success", 5000);
|
|
1880
|
+
alert(`Retrieved value: ${result}`);
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
catch (err) {
|
|
1884
|
+
console.error("Contract call failed:", err);
|
|
1885
|
+
toast(`Error: ${err.message || "Contract call failed"}`, "error", 5000);
|
|
1886
|
+
}
|
|
1887
|
+
finally {
|
|
1888
|
+
setLoading(false);
|
|
1889
|
+
}
|
|
1890
|
+
});
|
|
1891
|
+
return (React.createElement("div", { className: styles["contract-button-container"] },
|
|
1892
|
+
React.createElement("input", { type: "number", value: inputValue, onChange: (e) => setInputValue(e.target.value), placeholder: "Enter a number", className: styles["contract-input"] }),
|
|
1893
|
+
React.createElement("button", { className: styles["contract-button"], onClick: () => callContract("store", [parseInt(inputValue, 10)], true), disabled: loading || !inputValue }, loading ? "Setting..." : "Set"),
|
|
1894
|
+
React.createElement("button", { className: styles["contract-button"], onClick: () => callContract("retrieve", []), disabled: loading }, loading ? "Retrieving..." : "Retrieve")));
|
|
1895
|
+
};
|
|
1896
|
+
/**
|
|
1897
|
+
* The OriginSection component. Displays the Origin status, royalty multiplier, and royalty credits.
|
|
1898
|
+
* @returns { JSX.Element } The OriginSection component.
|
|
1899
|
+
*/
|
|
1900
|
+
const OriginSection = () => {
|
|
1901
|
+
const { stats, uploads } = useOrigin();
|
|
1902
|
+
const [isOriginAuthorized, setIsOriginAuthorized] = useState(true);
|
|
1903
|
+
const [royaltyMultiplier, setRoyaltyMultiplier] = useState(1);
|
|
1904
|
+
const [royaltyCredits, setRoyaltyCredits] = useState(0);
|
|
1905
|
+
const [uploadedImages, setUploadedImages] = useState(0);
|
|
1906
|
+
const [uploadedVideos, setUploadedVideos] = useState(0);
|
|
1907
|
+
const [uploadedAudio, setUploadedAudio] = useState(0);
|
|
1908
|
+
const [uploadedText, setUploadedText] = useState(0);
|
|
1909
|
+
useEffect(() => {
|
|
1910
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
1911
|
+
if (!stats.isLoading && !stats.isError) {
|
|
1912
|
+
setIsOriginAuthorized((_d = (_c = (_b = (_a = stats.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.user) === null || _c === void 0 ? void 0 : _c.active) !== null && _d !== void 0 ? _d : true);
|
|
1913
|
+
setRoyaltyMultiplier((_h = (_g = (_f = (_e = stats.data) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.user) === null || _g === void 0 ? void 0 : _g.multiplier) !== null && _h !== void 0 ? _h : 1);
|
|
1914
|
+
setRoyaltyCredits((_m = (_l = (_k = (_j = stats.data) === null || _j === void 0 ? void 0 : _j.data) === null || _k === void 0 ? void 0 : _k.user) === null || _l === void 0 ? void 0 : _l.points) !== null && _m !== void 0 ? _m : 0);
|
|
1915
|
+
}
|
|
1916
|
+
if (stats.isError) {
|
|
1917
|
+
setIsOriginAuthorized(true);
|
|
1918
|
+
setRoyaltyMultiplier(1);
|
|
1919
|
+
setRoyaltyCredits(0);
|
|
1920
|
+
}
|
|
1921
|
+
}, [stats.data, stats.isError, stats.isLoading]);
|
|
1922
|
+
useEffect(() => {
|
|
1923
|
+
if (uploads.data) {
|
|
1924
|
+
let imagesCount = 0;
|
|
1925
|
+
let videosCount = 0;
|
|
1926
|
+
let audioCount = 0;
|
|
1927
|
+
let textCount = 0;
|
|
1928
|
+
uploads.data.forEach((upload) => {
|
|
1929
|
+
if (upload.type.startsWith("image")) {
|
|
1930
|
+
imagesCount++;
|
|
1931
|
+
}
|
|
1932
|
+
else if (upload.type.startsWith("video")) {
|
|
1933
|
+
videosCount++;
|
|
1934
|
+
}
|
|
1935
|
+
else if (upload.type.startsWith("audio")) {
|
|
1936
|
+
audioCount++;
|
|
1937
|
+
}
|
|
1938
|
+
else if (upload.type.startsWith("text")) {
|
|
1939
|
+
textCount++;
|
|
1940
|
+
}
|
|
1941
|
+
});
|
|
1942
|
+
setUploadedImages(imagesCount);
|
|
1943
|
+
setUploadedVideos(videosCount);
|
|
1944
|
+
setUploadedAudio(audioCount);
|
|
1945
|
+
setUploadedText(textCount);
|
|
1946
|
+
}
|
|
1947
|
+
}, [uploads.data]);
|
|
1948
|
+
return stats.isLoading ? (React.createElement("div", { style: { marginTop: "1rem", marginBottom: "1rem", flex: 1 } },
|
|
1949
|
+
React.createElement("div", { className: styles.spinner }))) : (React.createElement("div", { className: styles["origin-wrapper"] },
|
|
1950
|
+
React.createElement(ContractInteraction, null),
|
|
1951
|
+
React.createElement("div", { className: styles["origin-section"] },
|
|
1952
|
+
React.createElement(Tooltip, { content: isOriginAuthorized ? "Origin Authorized" : "Origin Unauthorized", position: "top", containerStyle: { width: "100%" } },
|
|
1953
|
+
React.createElement("div", { className: styles["origin-container"] },
|
|
1954
|
+
React.createElement("span", null, isOriginAuthorized ? (React.createElement(CheckMarkIcon, { w: "1.2rem", h: "1.2rem" })) : (React.createElement(XMarkIcon, { w: "1.2rem", h: "1.2rem" }))),
|
|
1955
|
+
React.createElement("span", { className: styles["origin-label"] }, isOriginAuthorized ? "Authorized" : "Unauthorized"))),
|
|
1956
|
+
React.createElement("div", { className: styles["divider"] }),
|
|
1957
|
+
React.createElement(Tooltip, { content: `Royalty Multiplier: ${royaltyMultiplier}x`, position: "top", containerStyle: { width: "100%" } },
|
|
1958
|
+
React.createElement("div", { className: styles["origin-container"] },
|
|
1959
|
+
React.createElement("span", null,
|
|
1960
|
+
royaltyMultiplier,
|
|
1961
|
+
"x"),
|
|
1962
|
+
React.createElement("span", { className: styles["origin-label"] }, "Multiplier"))),
|
|
1963
|
+
React.createElement("div", { className: styles["divider"] }),
|
|
1964
|
+
React.createElement(Tooltip, { content: `Royalty Credits: ${royaltyCredits.toLocaleString()}`, position: "top", containerStyle: { width: "100%" } },
|
|
1965
|
+
React.createElement("div", { className: styles["origin-container"] },
|
|
1966
|
+
React.createElement("span", null, formatCampAmount(royaltyCredits)),
|
|
1967
|
+
React.createElement("span", { className: styles["origin-label"] }, "Credits")))),
|
|
1968
|
+
React.createElement("div", { className: styles["origin-section"] },
|
|
1969
|
+
React.createElement(Tooltip, { content: `Images uploaded: ${uploadedImages.toLocaleString()}`, position: "top", containerStyle: { width: "100%" } },
|
|
1970
|
+
React.createElement("div", { className: styles["origin-container"] },
|
|
1971
|
+
React.createElement("span", null, formatCampAmount(uploadedImages)),
|
|
1972
|
+
React.createElement("span", { className: styles["origin-label"] }, "Images"))),
|
|
1973
|
+
React.createElement("div", { className: styles["divider"] }),
|
|
1974
|
+
React.createElement(Tooltip, { content: `Audio uploaded: ${uploadedAudio.toLocaleString()}`, position: "top", containerStyle: { width: "100%" } },
|
|
1975
|
+
React.createElement("div", { className: styles["origin-container"] },
|
|
1976
|
+
React.createElement("span", null, formatCampAmount(uploadedAudio)),
|
|
1977
|
+
React.createElement("span", { className: styles["origin-label"] }, "Audio"))),
|
|
1978
|
+
React.createElement("div", { className: styles["divider"] }),
|
|
1979
|
+
React.createElement(Tooltip, { content: `Videos uploaded: ${uploadedVideos.toLocaleString()}`, position: "top", containerStyle: { width: "100%" } },
|
|
1980
|
+
React.createElement("div", { className: styles["origin-container"] },
|
|
1981
|
+
React.createElement("span", null, formatCampAmount(uploadedVideos)),
|
|
1982
|
+
React.createElement("span", { className: styles["origin-label"] }, "Videos"))),
|
|
1983
|
+
React.createElement("div", { className: styles["divider"] }),
|
|
1984
|
+
React.createElement(Tooltip, { content: `Text uploaded: ${uploadedText.toLocaleString()}`, position: "top", containerStyle: { width: "100%" } },
|
|
1985
|
+
React.createElement("div", { className: styles["origin-container"] },
|
|
1986
|
+
React.createElement("span", null, formatCampAmount(uploadedText)),
|
|
1987
|
+
React.createElement("span", { className: styles["origin-label"] }, "Text"))))));
|
|
1988
|
+
};
|
|
1989
|
+
/**
|
|
1990
|
+
* The MyCampModal component.
|
|
1991
|
+
* @param { { wcProvider: object } } props The props.
|
|
1992
|
+
* @returns { JSX.Element } The MyCampModal component.
|
|
1993
|
+
*/
|
|
1994
|
+
const MyCampModal = ({ wcProvider, }) => {
|
|
1995
|
+
const { auth } = useContext(CampContext);
|
|
1996
|
+
const { setIsVisible: setIsVisible } = useContext(ModalContext);
|
|
1997
|
+
const { disconnect } = useConnect();
|
|
1998
|
+
const { socials, isLoading, refetch } = useSocials();
|
|
1999
|
+
const [isLoadingSocials, setIsLoadingSocials] = useState(true);
|
|
2000
|
+
const { linkTiktok, linkTelegram } = useLinkModal();
|
|
2001
|
+
const [activeTab, setActiveTab] = useState("socials");
|
|
2002
|
+
if (!auth) {
|
|
2003
|
+
throw new Error("Auth instance is not available. Make sure to wrap your component with CampProvider.");
|
|
2004
|
+
}
|
|
2005
|
+
const handleDisconnect = () => {
|
|
2006
|
+
wcProvider === null || wcProvider === void 0 ? void 0 : wcProvider.disconnect();
|
|
2007
|
+
disconnect();
|
|
2008
|
+
setIsVisible(false);
|
|
2009
|
+
};
|
|
2010
|
+
useEffect(() => {
|
|
2011
|
+
if (socials)
|
|
2012
|
+
setIsLoadingSocials(false);
|
|
2013
|
+
}, [socials]);
|
|
2014
|
+
const connectedSocials = [
|
|
2015
|
+
{
|
|
2016
|
+
name: "Discord",
|
|
2017
|
+
link: auth.linkDiscord.bind(auth),
|
|
2018
|
+
unlink: auth.unlinkDiscord.bind(auth),
|
|
2019
|
+
isConnected: socials === null || socials === void 0 ? void 0 : socials.discord,
|
|
2020
|
+
icon: React.createElement(DiscordIcon, null),
|
|
2021
|
+
},
|
|
2022
|
+
{
|
|
2023
|
+
name: "Twitter",
|
|
2024
|
+
link: auth.linkTwitter.bind(auth),
|
|
2025
|
+
unlink: auth.unlinkTwitter.bind(auth),
|
|
2026
|
+
isConnected: socials === null || socials === void 0 ? void 0 : socials.twitter,
|
|
2027
|
+
icon: React.createElement(TwitterIcon, null),
|
|
2028
|
+
},
|
|
2029
|
+
{
|
|
2030
|
+
name: "Spotify",
|
|
2031
|
+
link: auth.linkSpotify.bind(auth),
|
|
2032
|
+
unlink: auth.unlinkSpotify.bind(auth),
|
|
2033
|
+
isConnected: socials === null || socials === void 0 ? void 0 : socials.spotify,
|
|
2034
|
+
icon: React.createElement(SpotifyIcon, null),
|
|
2035
|
+
},
|
|
2036
|
+
{
|
|
2037
|
+
name: "TikTok",
|
|
2038
|
+
link: linkTiktok,
|
|
2039
|
+
unlink: auth.unlinkTikTok.bind(auth),
|
|
2040
|
+
isConnected: socials === null || socials === void 0 ? void 0 : socials.tiktok,
|
|
2041
|
+
icon: React.createElement(TikTokIcon, null),
|
|
2042
|
+
},
|
|
2043
|
+
{
|
|
2044
|
+
name: "Telegram",
|
|
2045
|
+
link: linkTelegram,
|
|
2046
|
+
unlink: auth.unlinkTelegram.bind(auth),
|
|
2047
|
+
isConnected: socials === null || socials === void 0 ? void 0 : socials.telegram,
|
|
2048
|
+
icon: React.createElement(TelegramIcon, null),
|
|
2049
|
+
},
|
|
2050
|
+
].filter((social) => constants.AVAILABLE_SOCIALS.includes(social.name.toLowerCase()));
|
|
2051
|
+
const connected = connectedSocials.filter((social) => social.isConnected);
|
|
2052
|
+
const notConnected = connectedSocials.filter((social) => !social.isConnected);
|
|
2053
|
+
return (React.createElement("div", { className: styles["outer-container"] },
|
|
2054
|
+
React.createElement("div", { className: styles.container },
|
|
2055
|
+
React.createElement("div", { className: styles["close-button"], onClick: () => setIsVisible(false) },
|
|
2056
|
+
React.createElement(CloseIcon, null)),
|
|
2057
|
+
React.createElement("div", { className: styles.header },
|
|
2058
|
+
React.createElement("span", null, "My Origin"),
|
|
2059
|
+
React.createElement("span", { className: styles["wallet-address"] }, formatAddress(auth.walletAddress, 6))),
|
|
2060
|
+
React.createElement("div", { className: styles["vertical-tabs-container"] },
|
|
2061
|
+
React.createElement("div", { className: styles["vertical-tabs"] },
|
|
2062
|
+
React.createElement(TabButton, { label: "Stats", isActive: activeTab === "origin", onClick: () => setActiveTab("origin") }),
|
|
2063
|
+
React.createElement(TabButton, { label: "Socials", isActive: activeTab === "socials", onClick: () => setActiveTab("socials") }),
|
|
2064
|
+
React.createElement(TabButton, { label: "Images", isActive: activeTab === "images", onClick: () => setActiveTab("images") }),
|
|
2065
|
+
React.createElement(TabButton, { label: "Audio", isActive: activeTab === "audio", onClick: () => setActiveTab("audio") }),
|
|
2066
|
+
React.createElement(TabButton, { label: "Videos", isActive: activeTab === "videos", onClick: () => setActiveTab("videos") }),
|
|
2067
|
+
React.createElement(TabButton, { label: "Text", isActive: activeTab === "text", onClick: () => setActiveTab("text") })),
|
|
2068
|
+
React.createElement("div", { className: styles["vertical-tab-content"] },
|
|
2069
|
+
activeTab === "origin" && React.createElement(OriginTab, null),
|
|
2070
|
+
activeTab === "socials" && (React.createElement(SocialsTab, { connectedSocials: connected, notConnectedSocials: notConnected, refetch: refetch, isLoading: isLoading, isLoadingSocials: isLoadingSocials })),
|
|
2071
|
+
activeTab === "images" && React.createElement(ImagesTab, null),
|
|
2072
|
+
activeTab === "audio" && React.createElement(AudioTab, null),
|
|
2073
|
+
activeTab === "videos" && React.createElement(VideosTab, null),
|
|
2074
|
+
activeTab === "text" && React.createElement(TextTab, null))),
|
|
2075
|
+
React.createElement("button", { className: styles["disconnect-button"], onClick: handleDisconnect }, "Disconnect"),
|
|
2076
|
+
React.createElement("a", { href: "https://campnetwork.xyz", className: styles["footer-text"], target: "_blank", rel: "noopener noreferrer", style: { marginTop: 0 } }, "Powered by Camp Network"))));
|
|
2077
|
+
};
|
|
2078
|
+
const OriginTab = () => {
|
|
2079
|
+
return (React.createElement("div", { className: styles["origin-tab"] },
|
|
2080
|
+
React.createElement(OriginSection, null),
|
|
2081
|
+
React.createElement(GoToOriginDashboard, null)));
|
|
2082
|
+
};
|
|
2083
|
+
const SocialsTab = ({ connectedSocials, notConnectedSocials, refetch, isLoading, isLoadingSocials, }) => {
|
|
2084
|
+
return (React.createElement("div", { className: styles["socials-wrapper"] }, isLoading || isLoadingSocials ? (React.createElement("div", { className: styles.spinner, style: {
|
|
2085
|
+
margin: "auto",
|
|
2086
|
+
marginTop: "6rem",
|
|
2087
|
+
marginBottom: "6rem",
|
|
2088
|
+
} })) : (React.createElement(React.Fragment, null,
|
|
2089
|
+
React.createElement("div", { className: styles["socials-container"] },
|
|
2090
|
+
React.createElement("h3", null, "Not Linked"),
|
|
2091
|
+
notConnectedSocials.map((social) => (React.createElement(ConnectorButton, { key: social.name, name: social.name, link: social.link, unlink: social.unlink, isConnected: !!social.isConnected, refetch: refetch, icon: social.icon }))),
|
|
2092
|
+
notConnectedSocials.length === 0 && (React.createElement("span", { className: styles["no-socials"] }, "You've linked all your socials!"))),
|
|
2093
|
+
React.createElement("div", { className: styles["socials-container"] },
|
|
2094
|
+
React.createElement("h3", null, "Linked"),
|
|
2095
|
+
connectedSocials.map((social) => (React.createElement(ConnectorButton, { key: social.name, name: social.name, link: social.link, unlink: social.unlink, isConnected: !!social.isConnected, refetch: refetch, icon: social.icon }))),
|
|
2096
|
+
connectedSocials.length === 0 && (React.createElement("span", { className: styles["no-socials"] }, "You have no socials linked.")))))));
|
|
2097
|
+
};
|
|
2098
|
+
const ImagesTab = () => {
|
|
2099
|
+
const { uploads } = useOrigin();
|
|
2100
|
+
const { isLoading } = uploads;
|
|
2101
|
+
return (React.createElement("div", { className: styles["ip-tab-container"] },
|
|
2102
|
+
React.createElement(FileUpload, { accept: constants.SUPPORTED_IMAGE_FORMATS.join(","), maxFileSize: 1.049e7 }),
|
|
2103
|
+
React.createElement("div", { className: styles["ip-tab-content"] }, isLoading ? (React.createElement("div", { className: styles.spinner, style: { marginRight: "auto" } })) : (React.createElement("div", { className: styles["ip-tab-content-text"] },
|
|
2104
|
+
uploads.data.filter((item) => item.type.startsWith("image"))
|
|
2105
|
+
.length,
|
|
2106
|
+
" ",
|
|
2107
|
+
"images uploaded"))),
|
|
2108
|
+
React.createElement(GoToOriginDashboard, { text: "Manage on Origin Dashboard" })));
|
|
2109
|
+
};
|
|
2110
|
+
const AudioTab = () => {
|
|
2111
|
+
const { uploads } = useOrigin();
|
|
2112
|
+
const { isLoading } = uploads;
|
|
2113
|
+
return (React.createElement("div", { className: styles["ip-tab-container"] },
|
|
2114
|
+
React.createElement(FileUpload, { accept: constants.SUPPORTED_AUDIO_FORMATS.join(","), maxFileSize: 1.573e7 }),
|
|
2115
|
+
React.createElement("div", { className: styles["ip-tab-content"] }, isLoading ? (React.createElement("div", { className: styles.spinner, style: { marginRight: "auto" } })) : (React.createElement("div", { className: styles["ip-tab-content-text"] },
|
|
2116
|
+
uploads.data.filter((item) => item.type.startsWith("audio"))
|
|
2117
|
+
.length,
|
|
2118
|
+
" ",
|
|
2119
|
+
"audio files uploaded"))),
|
|
2120
|
+
React.createElement(GoToOriginDashboard, { text: "Manage on Origin Dashboard" })));
|
|
2121
|
+
};
|
|
2122
|
+
const VideosTab = () => {
|
|
2123
|
+
const { uploads } = useOrigin();
|
|
2124
|
+
const { isLoading } = uploads;
|
|
2125
|
+
return (React.createElement("div", { className: styles["ip-tab-container"] },
|
|
2126
|
+
React.createElement(FileUpload, { accept: constants.SUPPORTED_VIDEO_FORMATS.join(","), maxFileSize: 2.097e7 }),
|
|
2127
|
+
React.createElement("div", { className: styles["ip-tab-content"] }, isLoading ? (React.createElement("div", { className: styles.spinner, style: { marginRight: "auto" } })) : (React.createElement("div", { className: styles["ip-tab-content-text"] },
|
|
2128
|
+
uploads.data.filter((item) => item.type.startsWith("video"))
|
|
2129
|
+
.length,
|
|
2130
|
+
" ",
|
|
2131
|
+
"videos uploaded"))),
|
|
2132
|
+
React.createElement(GoToOriginDashboard, { text: "Manage on Origin Dashboard" })));
|
|
2133
|
+
};
|
|
2134
|
+
const TextTab = () => {
|
|
2135
|
+
const { uploads } = useOrigin();
|
|
2136
|
+
const { isLoading } = uploads;
|
|
2137
|
+
return (React.createElement("div", { className: styles["ip-tab-container"] },
|
|
2138
|
+
React.createElement(FileUpload, { accept: constants.SUPPORTED_TEXT_FORMATS.join(","), maxFileSize: 1.049e7 }),
|
|
2139
|
+
React.createElement("div", { className: styles["ip-tab-content"] }, isLoading ? (React.createElement("div", { className: styles.spinner, style: { marginRight: "auto" } })) : (React.createElement("div", { className: styles["ip-tab-content-text"] },
|
|
2140
|
+
uploads.data.filter((item) => item.type.startsWith("text")).length,
|
|
2141
|
+
" ",
|
|
2142
|
+
"text files uploaded"))),
|
|
2143
|
+
React.createElement(GoToOriginDashboard, { text: "Manage on Origin Dashboard" })));
|
|
2144
|
+
};
|
|
2145
|
+
|
|
2146
|
+
const getAuthProperties = (auth) => {
|
|
2147
|
+
const prototype = Object.getPrototypeOf(auth);
|
|
2148
|
+
const properties = Object.getOwnPropertyNames(prototype);
|
|
2149
|
+
const object = {};
|
|
2150
|
+
for (const property of properties) {
|
|
2151
|
+
if (typeof auth[property] === "function") {
|
|
2152
|
+
object[property] = auth[property].bind(auth);
|
|
2153
|
+
}
|
|
2154
|
+
}
|
|
2155
|
+
return object;
|
|
2156
|
+
};
|
|
2157
|
+
const getAuthVariables = (auth) => {
|
|
2158
|
+
const variables = Object.keys(auth);
|
|
2159
|
+
const object = {};
|
|
2160
|
+
for (const variable of variables) {
|
|
2161
|
+
object[variable] = auth[variable];
|
|
2162
|
+
}
|
|
2163
|
+
return object;
|
|
2164
|
+
};
|
|
2165
|
+
/**
|
|
2166
|
+
* Returns the Auth instance provided by the context.
|
|
2167
|
+
* @returns { Auth } The Auth instance provided by the context.
|
|
2168
|
+
* @example
|
|
2169
|
+
* const auth = useAuth();
|
|
2170
|
+
* auth.connect();
|
|
2171
|
+
*/
|
|
2172
|
+
const useAuth = () => {
|
|
2173
|
+
const { auth } = useContext(CampContext);
|
|
2174
|
+
if (!auth) {
|
|
2175
|
+
throw new Error("Auth instance is not available. Make sure to wrap your component with CampProvider.");
|
|
2176
|
+
}
|
|
2177
|
+
const [authProperties, setAuthProperties] = useState(getAuthProperties(auth));
|
|
2178
|
+
const [authVariables, setAuthVariables] = useState(getAuthVariables(auth));
|
|
2179
|
+
const updateAuth = () => {
|
|
2180
|
+
setAuthVariables(getAuthVariables(auth));
|
|
2181
|
+
setAuthProperties(getAuthProperties(auth));
|
|
2182
|
+
};
|
|
2183
|
+
useEffect(() => {
|
|
2184
|
+
auth.on("state", updateAuth);
|
|
2185
|
+
auth.on("provider", updateAuth);
|
|
2186
|
+
}, [auth]);
|
|
2187
|
+
return Object.assign(Object.assign({}, authVariables), authProperties);
|
|
2188
|
+
};
|
|
2189
|
+
/**
|
|
2190
|
+
* Returns the functions to link and unlink socials.
|
|
2191
|
+
* @returns { { linkTwitter: function, unlinkTwitter: function, linkDiscord: function, unlinkDiscord: function, linkSpotify: function, unlinkSpotify: function } } The functions to link and unlink socials.
|
|
2192
|
+
* @example
|
|
2193
|
+
* const { linkTwitter, unlinkTwitter, linkDiscord, unlinkDiscord, linkSpotify, unlinkSpotify } = useLinkSocials();
|
|
2194
|
+
* linkTwitter();
|
|
2195
|
+
*/
|
|
2196
|
+
const useLinkSocials = () => {
|
|
2197
|
+
const { auth } = useContext(CampContext);
|
|
2198
|
+
if (!auth) {
|
|
2199
|
+
return {};
|
|
2200
|
+
}
|
|
2201
|
+
const prototype = Object.getPrototypeOf(auth);
|
|
2202
|
+
const linkingProps = Object.getOwnPropertyNames(prototype).filter((prop) => (prop.startsWith("link") || prop.startsWith("unlink")) &&
|
|
2203
|
+
(constants.AVAILABLE_SOCIALS.includes(prop.slice(4).toLowerCase()) ||
|
|
2204
|
+
constants.AVAILABLE_SOCIALS.includes(prop.slice(6).toLowerCase())));
|
|
2205
|
+
const linkingFunctions = linkingProps.reduce((acc, prop) => {
|
|
2206
|
+
acc[prop] = auth[prop].bind(auth);
|
|
2207
|
+
return acc;
|
|
2208
|
+
}, {
|
|
2209
|
+
sendTelegramOTP: auth.sendTelegramOTP.bind(auth),
|
|
2210
|
+
});
|
|
2211
|
+
return linkingFunctions;
|
|
2212
|
+
};
|
|
2213
|
+
/**
|
|
2214
|
+
* Fetches the provider from the context and sets the provider in the auth instance.
|
|
2215
|
+
* @returns { { provider: { provider: string, info: { name: string } }, setProvider: function } } The provider and a function to set the provider.
|
|
2216
|
+
*/
|
|
2217
|
+
const useProvider = () => {
|
|
2218
|
+
var _a, _b, _c;
|
|
2219
|
+
const { auth } = useContext(CampContext);
|
|
2220
|
+
if (!auth) {
|
|
2221
|
+
throw new Error("Auth instance is not available. Make sure to wrap your component with CampProvider.");
|
|
2222
|
+
}
|
|
2223
|
+
const [provider, setProvider] = useState({
|
|
2224
|
+
provider: (_a = auth.viem) === null || _a === void 0 ? void 0 : _a.transport,
|
|
2225
|
+
info: { name: (_c = (_b = auth.viem) === null || _b === void 0 ? void 0 : _b.transport) === null || _c === void 0 ? void 0 : _c.name },
|
|
2226
|
+
});
|
|
2227
|
+
useEffect(() => {
|
|
2228
|
+
auth.on("provider", ({ provider, info }) => {
|
|
2229
|
+
setProvider({ provider, info });
|
|
2230
|
+
});
|
|
2231
|
+
}, [auth]);
|
|
2232
|
+
const authSetProvider = auth.setProvider.bind(auth);
|
|
2233
|
+
return { provider, setProvider: authSetProvider };
|
|
2234
|
+
};
|
|
2235
|
+
/**
|
|
2236
|
+
* Returns the authenticated state and loading state.
|
|
2237
|
+
* @returns { { authenticated: boolean, loading: boolean } } The authenticated state and loading state.
|
|
2238
|
+
*/
|
|
2239
|
+
const useAuthState = () => {
|
|
2240
|
+
const { auth } = useContext(CampContext);
|
|
2241
|
+
if (!auth) {
|
|
2242
|
+
throw new Error("Auth instance is not available. Make sure to wrap your component with CampProvider.");
|
|
2243
|
+
}
|
|
2244
|
+
const [authenticated, setAuthenticated] = useState(false);
|
|
2245
|
+
const [loading, setLoading] = useState(false);
|
|
2246
|
+
useEffect(() => {
|
|
2247
|
+
setAuthenticated(auth.isAuthenticated);
|
|
2248
|
+
auth.on("state", (state) => {
|
|
2249
|
+
setAuthenticated(state === "authenticated");
|
|
2250
|
+
setLoading(state === "loading");
|
|
2251
|
+
});
|
|
2252
|
+
}, [auth]);
|
|
2253
|
+
return { authenticated, loading };
|
|
2254
|
+
};
|
|
2255
|
+
const useViem = () => {
|
|
2256
|
+
const { auth } = useContext(CampContext);
|
|
2257
|
+
const [client, setClient] = useState(null);
|
|
2258
|
+
useEffect(() => {
|
|
2259
|
+
setClient(auth === null || auth === void 0 ? void 0 : auth.viem);
|
|
2260
|
+
auth === null || auth === void 0 ? void 0 : auth.on("viem", (client) => {
|
|
2261
|
+
setClient(client);
|
|
2262
|
+
});
|
|
2263
|
+
}, [auth]);
|
|
2264
|
+
if (!auth) {
|
|
2265
|
+
throw new Error("Auth instance is not available. Make sure to wrap your component with CampProvider.");
|
|
2266
|
+
}
|
|
2267
|
+
return {
|
|
2268
|
+
client,
|
|
2269
|
+
};
|
|
2270
|
+
};
|
|
2271
|
+
/**
|
|
2272
|
+
* Connects and disconnects the user.
|
|
2273
|
+
* @returns { { connect: function, disconnect: function } } The connect and disconnect functions.
|
|
2274
|
+
*/
|
|
2275
|
+
const useConnect = () => {
|
|
2276
|
+
const { auth } = useContext(CampContext);
|
|
2277
|
+
if (!auth) {
|
|
2278
|
+
throw new Error("Auth instance is not available. Make sure to wrap your component with CampProvider.");
|
|
2279
|
+
}
|
|
2280
|
+
const connect = auth.connect.bind(auth);
|
|
2281
|
+
const disconnect = auth.disconnect.bind(auth);
|
|
2282
|
+
return { connect, disconnect };
|
|
2283
|
+
};
|
|
2284
|
+
/**
|
|
2285
|
+
* Returns the array of providers.
|
|
2286
|
+
* @returns { Array } The array of providers and the loading state.
|
|
2287
|
+
*/
|
|
2288
|
+
const useProviders = () => useSyncExternalStore(providerStore.subscribe, providerStore.value, providerStore.value);
|
|
2289
|
+
/**
|
|
2290
|
+
* Returns the modal state and functions to open and close the modal.
|
|
2291
|
+
* @returns { { isOpen: boolean, openModal: function, closeModal: function } } The modal state and functions to open and close the modal.
|
|
2292
|
+
*/
|
|
2293
|
+
const useModal = () => {
|
|
2294
|
+
const { isVisible, setIsVisible } = useContext(ModalContext);
|
|
2295
|
+
const handleOpen = () => {
|
|
2296
|
+
setIsVisible(true);
|
|
2297
|
+
};
|
|
2298
|
+
const handleClose = () => {
|
|
2299
|
+
setIsVisible(false);
|
|
2300
|
+
};
|
|
2301
|
+
return {
|
|
2302
|
+
isOpen: isVisible,
|
|
2303
|
+
openModal: handleOpen,
|
|
2304
|
+
closeModal: handleClose,
|
|
2305
|
+
};
|
|
2306
|
+
};
|
|
2307
|
+
/**
|
|
2308
|
+
* Returns the functions to open and close the link modal.
|
|
2309
|
+
* @returns { { isLinkingOpen: boolean, closeModal: function, handleOpen: function } } The link modal state and functions to open and close the modal.
|
|
2310
|
+
*/
|
|
2311
|
+
const useLinkModal = () => {
|
|
2312
|
+
const { socials } = useSocials();
|
|
2313
|
+
const { isLinkingVisible, setIsLinkingVisible, setCurrentlyLinking } = useContext(ModalContext);
|
|
2314
|
+
const handleOpen = (social) => {
|
|
2315
|
+
if (!socials) {
|
|
2316
|
+
console.error("User is not authenticated");
|
|
2317
|
+
return;
|
|
2318
|
+
}
|
|
2319
|
+
setCurrentlyLinking(social);
|
|
2320
|
+
setIsLinkingVisible(true);
|
|
2321
|
+
};
|
|
2322
|
+
const handleLink = (social) => {
|
|
2323
|
+
if (!socials) {
|
|
2324
|
+
console.error("User is not authenticated");
|
|
2325
|
+
return;
|
|
2326
|
+
}
|
|
2327
|
+
if (socials && !socials[social]) {
|
|
2328
|
+
setCurrentlyLinking(social);
|
|
2329
|
+
setIsLinkingVisible(true);
|
|
2330
|
+
}
|
|
2331
|
+
else {
|
|
2332
|
+
setIsLinkingVisible(false);
|
|
2333
|
+
console.warn(`User already linked ${social}`);
|
|
2334
|
+
}
|
|
2335
|
+
};
|
|
2336
|
+
const handleUnlink = (social) => {
|
|
2337
|
+
if (!socials) {
|
|
2338
|
+
console.error("User is not authenticated");
|
|
2339
|
+
return;
|
|
2340
|
+
}
|
|
2341
|
+
if (socials && socials[social]) {
|
|
2342
|
+
setCurrentlyLinking(social);
|
|
2343
|
+
setIsLinkingVisible(true);
|
|
2344
|
+
}
|
|
2345
|
+
else {
|
|
2346
|
+
setIsLinkingVisible(false);
|
|
2347
|
+
console.warn(`User isn't linked to ${social}`);
|
|
2348
|
+
}
|
|
2349
|
+
};
|
|
2350
|
+
const handleClose = () => {
|
|
2351
|
+
setIsLinkingVisible(false);
|
|
2352
|
+
};
|
|
2353
|
+
const obj = {};
|
|
2354
|
+
constants.AVAILABLE_SOCIALS.forEach((social) => {
|
|
2355
|
+
obj[`link${social.charAt(0).toUpperCase() + social.slice(1)}`] = () => handleLink(social);
|
|
2356
|
+
obj[`unlink${social.charAt(0).toUpperCase() + social.slice(1)}`] = () => handleUnlink(social);
|
|
2357
|
+
obj[`open${social.charAt(0).toUpperCase() + social.slice(1)}Modal`] = () => handleOpen(social);
|
|
2358
|
+
});
|
|
2359
|
+
return Object.assign(Object.assign({ isLinkingOpen: isLinkingVisible }, obj), { closeModal: handleClose, handleOpen });
|
|
2360
|
+
};
|
|
2361
|
+
/**
|
|
2362
|
+
* Fetches the socials linked to the user.
|
|
2363
|
+
* @returns { { data: {}, socials: {}, error: Error, isLoading: boolean, refetch: () => {} } } react-query query object.
|
|
2364
|
+
*/
|
|
2365
|
+
const useSocials = () => {
|
|
2366
|
+
const { query } = useContext(SocialsContext);
|
|
2367
|
+
const socials = (query === null || query === void 0 ? void 0 : query.data) || {};
|
|
2368
|
+
return Object.assign(Object.assign({}, query), { socials });
|
|
2369
|
+
};
|
|
2370
|
+
/**
|
|
2371
|
+
* Fetches the Origin usage data and uploads data.
|
|
2372
|
+
* @returns { usage: { data: any, isError: boolean, isLoading: boolean, refetch: () => void }, uploads: { data: any, isError: boolean, isLoading: boolean, refetch: () => void } } The Origin usage data and uploads data.
|
|
2373
|
+
*/
|
|
2374
|
+
const useOrigin = () => {
|
|
2375
|
+
const { statsQuery, uploadsQuery } = useContext(OriginContext);
|
|
2376
|
+
return {
|
|
2377
|
+
stats: {
|
|
2378
|
+
data: statsQuery === null || statsQuery === void 0 ? void 0 : statsQuery.data,
|
|
2379
|
+
isError: statsQuery === null || statsQuery === void 0 ? void 0 : statsQuery.isError,
|
|
2380
|
+
isLoading: statsQuery === null || statsQuery === void 0 ? void 0 : statsQuery.isLoading,
|
|
2381
|
+
refetch: statsQuery === null || statsQuery === void 0 ? void 0 : statsQuery.refetch,
|
|
2382
|
+
},
|
|
2383
|
+
uploads: {
|
|
2384
|
+
data: (uploadsQuery === null || uploadsQuery === void 0 ? void 0 : uploadsQuery.data) || [],
|
|
2385
|
+
isError: uploadsQuery === null || uploadsQuery === void 0 ? void 0 : uploadsQuery.isError,
|
|
2386
|
+
isLoading: uploadsQuery === null || uploadsQuery === void 0 ? void 0 : uploadsQuery.isLoading,
|
|
2387
|
+
refetch: uploadsQuery === null || uploadsQuery === void 0 ? void 0 : uploadsQuery.refetch,
|
|
2388
|
+
},
|
|
2389
|
+
};
|
|
2390
|
+
};
|
|
2391
|
+
// export const useOrigin = (): {
|
|
2392
|
+
// stats: any;
|
|
2393
|
+
// uploads: any[];
|
|
2394
|
+
// } => {
|
|
2395
|
+
// const { statsQuery, uploadsQuery } = useContext(OriginContext) as {
|
|
2396
|
+
// statsQuery: UseQueryResult<any, Error>;
|
|
2397
|
+
// uploadsQuery: UseQueryResult<any, Error>;
|
|
2398
|
+
// };
|
|
2399
|
+
// // return {
|
|
2400
|
+
// // ...statsQuery,
|
|
2401
|
+
// // uploads: uploadsQuery?.data || [],
|
|
2402
|
+
// // // error: statsQuery?.error || uploadsQuery?.error || new Error("Unknown error"),
|
|
2403
|
+
// // };
|
|
2404
|
+
// };
|
|
2405
|
+
|
|
2406
|
+
export { StandaloneCampButton as CampButton, CampContext, CampModal, CampProvider, LinkButton, ModalContext, MyCampModal, useAuth, useAuthState, useConnect, useLinkModal, useLinkSocials, useModal, useOrigin, useProvider, useProviders, useSocials, useViem };
|