@matchain/matchid-sdk-react 0.1.55-alpha.15 → 0.1.55-alpha.16
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/dist/api.js +16431 -73
- package/dist/api.js.map +1 -1
- package/dist/api.mjs +2 -2
- package/dist/{chunk-ULDTUWGQ.mjs → chunk-HVCBDIGY.mjs} +2 -2
- package/dist/{chunk-BWGTZNIT.mjs → chunk-KYTL3LIF.mjs} +17138 -493
- package/dist/chunk-KYTL3LIF.mjs.map +1 -0
- package/dist/components.d.mts +2 -2
- package/dist/components.d.ts +2 -2
- package/dist/components.js +752 -959
- package/dist/components.js.map +1 -1
- package/dist/components.mjs +1 -1
- package/dist/hooks.d.mts +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.js +485 -692
- package/dist/hooks.js.map +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/icon.d.mts +1 -1
- package/dist/icon.d.ts +1 -1
- package/dist/{index-QPdWAVPk.d.mts → index-BKSGbw7b.d.mts} +2 -2
- package/dist/{index-C14uKUDG.d.mts → index-BXbfmVoU.d.mts} +1 -1
- package/dist/{index-B80rDuha.d.ts → index-BtjgRcNJ.d.ts} +2 -2
- package/dist/{index-BBghnVDr.d.ts → index-C82WIWvx.d.ts} +4 -4
- package/dist/{index--EI6w9pi.d.mts → index-CHG4-0Z1.d.mts} +3 -3
- package/dist/{index-DGbpUvkd.d.ts → index-CsUEaGtM.d.ts} +1 -1
- package/dist/{index-Cl0JpAc1.d.ts → index-D1Ep9UMx.d.ts} +3 -3
- package/dist/{index-CHtFnnZk.d.mts → index-D7E317WV.d.mts} +4 -4
- package/dist/{index-hiCo96Vc.d.ts → index-DK7l3lsH.d.ts} +10 -7
- package/dist/{index-Dx4OFZhG.d.mts → index-YPRyEYt6.d.mts} +10 -7
- package/dist/index.d.mts +7 -8
- package/dist/index.d.ts +7 -8
- package/dist/index.js +471 -678
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/ui.d.mts +2 -3
- package/dist/ui.d.ts +2 -3
- package/dist/ui.js +299 -506
- package/dist/ui.js.map +1 -1
- package/dist/ui.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-BWGTZNIT.mjs.map +0 -1
- package/dist/index.es-FMP4VX4N.mjs +0 -16847
- package/dist/index.es-FMP4VX4N.mjs.map +0 -1
- /package/dist/{chunk-ULDTUWGQ.mjs.map → chunk-HVCBDIGY.mjs.map} +0 -0
package/dist/hooks.js
CHANGED
|
@@ -6,9 +6,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __esm = (fn, res) => function __init() {
|
|
10
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
11
|
-
};
|
|
12
9
|
var __commonJS = (cb, mod2) => function __require() {
|
|
13
10
|
return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports;
|
|
14
11
|
};
|
|
@@ -16376,496 +16373,6 @@ var require_lottie = __commonJS({
|
|
|
16376
16373
|
}
|
|
16377
16374
|
});
|
|
16378
16375
|
|
|
16379
|
-
// node_modules/lottie-react/build/index.es.js
|
|
16380
|
-
var index_es_exports = {};
|
|
16381
|
-
__export(index_es_exports, {
|
|
16382
|
-
LottiePlayer: () => import_lottie_web2.default,
|
|
16383
|
-
default: () => Lottie,
|
|
16384
|
-
useLottie: () => useLottie,
|
|
16385
|
-
useLottieInteractivity: () => useLottieInteractivity
|
|
16386
|
-
});
|
|
16387
|
-
function _arrayLikeToArray(r, a) {
|
|
16388
|
-
(null == a || a > r.length) && (a = r.length);
|
|
16389
|
-
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
16390
|
-
return n;
|
|
16391
|
-
}
|
|
16392
|
-
function _arrayWithHoles(r) {
|
|
16393
|
-
if (Array.isArray(r)) return r;
|
|
16394
|
-
}
|
|
16395
|
-
function _defineProperty(e, r, t) {
|
|
16396
|
-
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
16397
|
-
value: t,
|
|
16398
|
-
enumerable: true,
|
|
16399
|
-
configurable: true,
|
|
16400
|
-
writable: true
|
|
16401
|
-
}) : e[r] = t, e;
|
|
16402
|
-
}
|
|
16403
|
-
function _iterableToArrayLimit(r, l) {
|
|
16404
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
16405
|
-
if (null != t) {
|
|
16406
|
-
var e, n, i, u, a = [], f = true, o = false;
|
|
16407
|
-
try {
|
|
16408
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
16409
|
-
if (Object(t) !== t) return;
|
|
16410
|
-
f = false;
|
|
16411
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = true) ;
|
|
16412
|
-
} catch (r2) {
|
|
16413
|
-
o = true, n = r2;
|
|
16414
|
-
} finally {
|
|
16415
|
-
try {
|
|
16416
|
-
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
16417
|
-
} finally {
|
|
16418
|
-
if (o) throw n;
|
|
16419
|
-
}
|
|
16420
|
-
}
|
|
16421
|
-
return a;
|
|
16422
|
-
}
|
|
16423
|
-
}
|
|
16424
|
-
function _nonIterableRest() {
|
|
16425
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
16426
|
-
}
|
|
16427
|
-
function ownKeys(e, r) {
|
|
16428
|
-
var t = Object.keys(e);
|
|
16429
|
-
if (Object.getOwnPropertySymbols) {
|
|
16430
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
16431
|
-
r && (o = o.filter(function(r2) {
|
|
16432
|
-
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
16433
|
-
})), t.push.apply(t, o);
|
|
16434
|
-
}
|
|
16435
|
-
return t;
|
|
16436
|
-
}
|
|
16437
|
-
function _objectSpread2(e) {
|
|
16438
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
16439
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
16440
|
-
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
16441
|
-
_defineProperty(e, r2, t[r2]);
|
|
16442
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
16443
|
-
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
16444
|
-
});
|
|
16445
|
-
}
|
|
16446
|
-
return e;
|
|
16447
|
-
}
|
|
16448
|
-
function _objectWithoutProperties(e, t) {
|
|
16449
|
-
if (null == e) return {};
|
|
16450
|
-
var o, r, i = _objectWithoutPropertiesLoose(e, t);
|
|
16451
|
-
if (Object.getOwnPropertySymbols) {
|
|
16452
|
-
var s = Object.getOwnPropertySymbols(e);
|
|
16453
|
-
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
16454
|
-
}
|
|
16455
|
-
return i;
|
|
16456
|
-
}
|
|
16457
|
-
function _objectWithoutPropertiesLoose(r, e) {
|
|
16458
|
-
if (null == r) return {};
|
|
16459
|
-
var t = {};
|
|
16460
|
-
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
16461
|
-
if (e.includes(n)) continue;
|
|
16462
|
-
t[n] = r[n];
|
|
16463
|
-
}
|
|
16464
|
-
return t;
|
|
16465
|
-
}
|
|
16466
|
-
function _slicedToArray(r, e) {
|
|
16467
|
-
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
16468
|
-
}
|
|
16469
|
-
function _toPrimitive(t, r) {
|
|
16470
|
-
if ("object" != typeof t || !t) return t;
|
|
16471
|
-
var e = t[Symbol.toPrimitive];
|
|
16472
|
-
if (void 0 !== e) {
|
|
16473
|
-
var i = e.call(t, r || "default");
|
|
16474
|
-
if ("object" != typeof i) return i;
|
|
16475
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
16476
|
-
}
|
|
16477
|
-
return ("string" === r ? String : Number)(t);
|
|
16478
|
-
}
|
|
16479
|
-
function _toPropertyKey(t) {
|
|
16480
|
-
var i = _toPrimitive(t, "string");
|
|
16481
|
-
return "symbol" == typeof i ? i : i + "";
|
|
16482
|
-
}
|
|
16483
|
-
function _unsupportedIterableToArray(r, a) {
|
|
16484
|
-
if (r) {
|
|
16485
|
-
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
16486
|
-
var t = {}.toString.call(r).slice(8, -1);
|
|
16487
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
16488
|
-
}
|
|
16489
|
-
}
|
|
16490
|
-
function getContainerVisibility(container) {
|
|
16491
|
-
var _container$getBoundin = container.getBoundingClientRect(), top = _container$getBoundin.top, height2 = _container$getBoundin.height;
|
|
16492
|
-
var current = window.innerHeight - top;
|
|
16493
|
-
var max = window.innerHeight + height2;
|
|
16494
|
-
return current / max;
|
|
16495
|
-
}
|
|
16496
|
-
function getContainerCursorPosition(container, cursorX, cursorY) {
|
|
16497
|
-
var _container$getBoundin2 = container.getBoundingClientRect(), top = _container$getBoundin2.top, left = _container$getBoundin2.left, width2 = _container$getBoundin2.width, height2 = _container$getBoundin2.height;
|
|
16498
|
-
var x = (cursorX - left) / width2;
|
|
16499
|
-
var y = (cursorY - top) / height2;
|
|
16500
|
-
return {
|
|
16501
|
-
x,
|
|
16502
|
-
y
|
|
16503
|
-
};
|
|
16504
|
-
}
|
|
16505
|
-
var import_lottie_web, import_lottie_web2, import_react15, _excluded$1, useLottie, useInitInteractivity, useLottieInteractivity, _excluded, Lottie;
|
|
16506
|
-
var init_index_es = __esm({
|
|
16507
|
-
"node_modules/lottie-react/build/index.es.js"() {
|
|
16508
|
-
"use strict";
|
|
16509
|
-
import_lottie_web = __toESM(require_lottie());
|
|
16510
|
-
import_lottie_web2 = __toESM(require_lottie());
|
|
16511
|
-
import_react15 = __toESM(require("react"));
|
|
16512
|
-
_excluded$1 = ["animationData", "loop", "autoplay", "initialSegment", "onComplete", "onLoopComplete", "onEnterFrame", "onSegmentStart", "onConfigReady", "onDataReady", "onDataFailed", "onLoadedImages", "onDOMLoaded", "onDestroy", "lottieRef", "renderer", "name", "assetsPath", "rendererSettings"];
|
|
16513
|
-
useLottie = function useLottie2(props, style) {
|
|
16514
|
-
var animationData2 = props.animationData, loop = props.loop, autoplay = props.autoplay, initialSegment = props.initialSegment, onComplete = props.onComplete, onLoopComplete = props.onLoopComplete, onEnterFrame = props.onEnterFrame, onSegmentStart = props.onSegmentStart, onConfigReady = props.onConfigReady, onDataReady = props.onDataReady, onDataFailed = props.onDataFailed, onLoadedImages = props.onLoadedImages, onDOMLoaded = props.onDOMLoaded, onDestroy = props.onDestroy;
|
|
16515
|
-
props.lottieRef;
|
|
16516
|
-
props.renderer;
|
|
16517
|
-
props.name;
|
|
16518
|
-
props.assetsPath;
|
|
16519
|
-
props.rendererSettings;
|
|
16520
|
-
var rest = _objectWithoutProperties(props, _excluded$1);
|
|
16521
|
-
var _useState = (0, import_react15.useState)(false), _useState2 = _slicedToArray(_useState, 2), animationLoaded = _useState2[0], setAnimationLoaded = _useState2[1];
|
|
16522
|
-
var animationInstanceRef = (0, import_react15.useRef)();
|
|
16523
|
-
var animationContainer = (0, import_react15.useRef)(null);
|
|
16524
|
-
var play = function play2() {
|
|
16525
|
-
var _a;
|
|
16526
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
|
16527
|
-
};
|
|
16528
|
-
var stop = function stop2() {
|
|
16529
|
-
var _a;
|
|
16530
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.stop();
|
|
16531
|
-
};
|
|
16532
|
-
var pause = function pause2() {
|
|
16533
|
-
var _a;
|
|
16534
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
|
16535
|
-
};
|
|
16536
|
-
var setSpeed = function setSpeed2(speed) {
|
|
16537
|
-
var _a;
|
|
16538
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setSpeed(speed);
|
|
16539
|
-
};
|
|
16540
|
-
var goToAndPlay = function goToAndPlay2(value2, isFrame) {
|
|
16541
|
-
var _a;
|
|
16542
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.goToAndPlay(value2, isFrame);
|
|
16543
|
-
};
|
|
16544
|
-
var goToAndStop = function goToAndStop2(value2, isFrame) {
|
|
16545
|
-
var _a;
|
|
16546
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.goToAndStop(value2, isFrame);
|
|
16547
|
-
};
|
|
16548
|
-
var setDirection = function setDirection2(direction) {
|
|
16549
|
-
var _a;
|
|
16550
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setDirection(direction);
|
|
16551
|
-
};
|
|
16552
|
-
var playSegments = function playSegments2(segments, forceFlag) {
|
|
16553
|
-
var _a;
|
|
16554
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.playSegments(segments, forceFlag);
|
|
16555
|
-
};
|
|
16556
|
-
var setSubframe = function setSubframe2(useSubFrames) {
|
|
16557
|
-
var _a;
|
|
16558
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setSubframe(useSubFrames);
|
|
16559
|
-
};
|
|
16560
|
-
var getDuration = function getDuration2(inFrames) {
|
|
16561
|
-
var _a;
|
|
16562
|
-
return (_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.getDuration(inFrames);
|
|
16563
|
-
};
|
|
16564
|
-
var destroy = function destroy2() {
|
|
16565
|
-
var _a;
|
|
16566
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
16567
|
-
animationInstanceRef.current = void 0;
|
|
16568
|
-
};
|
|
16569
|
-
var loadAnimation2 = function loadAnimation3() {
|
|
16570
|
-
var forcedConfigs = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
16571
|
-
var _a;
|
|
16572
|
-
if (!animationContainer.current) {
|
|
16573
|
-
return;
|
|
16574
|
-
}
|
|
16575
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
16576
|
-
var config = _objectSpread2(_objectSpread2(_objectSpread2({}, props), forcedConfigs), {}, {
|
|
16577
|
-
container: animationContainer.current
|
|
16578
|
-
});
|
|
16579
|
-
animationInstanceRef.current = import_lottie_web.default.loadAnimation(config);
|
|
16580
|
-
setAnimationLoaded(!!animationInstanceRef.current);
|
|
16581
|
-
return function() {
|
|
16582
|
-
var _a2;
|
|
16583
|
-
(_a2 = animationInstanceRef.current) === null || _a2 === void 0 ? void 0 : _a2.destroy();
|
|
16584
|
-
animationInstanceRef.current = void 0;
|
|
16585
|
-
};
|
|
16586
|
-
};
|
|
16587
|
-
(0, import_react15.useEffect)(function() {
|
|
16588
|
-
var onUnmount = loadAnimation2();
|
|
16589
|
-
return function() {
|
|
16590
|
-
return onUnmount === null || onUnmount === void 0 ? void 0 : onUnmount();
|
|
16591
|
-
};
|
|
16592
|
-
}, [animationData2, loop]);
|
|
16593
|
-
(0, import_react15.useEffect)(function() {
|
|
16594
|
-
if (!animationInstanceRef.current) {
|
|
16595
|
-
return;
|
|
16596
|
-
}
|
|
16597
|
-
animationInstanceRef.current.autoplay = !!autoplay;
|
|
16598
|
-
}, [autoplay]);
|
|
16599
|
-
(0, import_react15.useEffect)(function() {
|
|
16600
|
-
if (!animationInstanceRef.current) {
|
|
16601
|
-
return;
|
|
16602
|
-
}
|
|
16603
|
-
if (!initialSegment) {
|
|
16604
|
-
animationInstanceRef.current.resetSegments(true);
|
|
16605
|
-
return;
|
|
16606
|
-
}
|
|
16607
|
-
if (!Array.isArray(initialSegment) || !initialSegment.length) {
|
|
16608
|
-
return;
|
|
16609
|
-
}
|
|
16610
|
-
if (animationInstanceRef.current.currentRawFrame < initialSegment[0] || animationInstanceRef.current.currentRawFrame > initialSegment[1]) {
|
|
16611
|
-
animationInstanceRef.current.currentRawFrame = initialSegment[0];
|
|
16612
|
-
}
|
|
16613
|
-
animationInstanceRef.current.setSegment(initialSegment[0], initialSegment[1]);
|
|
16614
|
-
}, [initialSegment]);
|
|
16615
|
-
(0, import_react15.useEffect)(function() {
|
|
16616
|
-
var partialListeners = [{
|
|
16617
|
-
name: "complete",
|
|
16618
|
-
handler: onComplete
|
|
16619
|
-
}, {
|
|
16620
|
-
name: "loopComplete",
|
|
16621
|
-
handler: onLoopComplete
|
|
16622
|
-
}, {
|
|
16623
|
-
name: "enterFrame",
|
|
16624
|
-
handler: onEnterFrame
|
|
16625
|
-
}, {
|
|
16626
|
-
name: "segmentStart",
|
|
16627
|
-
handler: onSegmentStart
|
|
16628
|
-
}, {
|
|
16629
|
-
name: "config_ready",
|
|
16630
|
-
handler: onConfigReady
|
|
16631
|
-
}, {
|
|
16632
|
-
name: "data_ready",
|
|
16633
|
-
handler: onDataReady
|
|
16634
|
-
}, {
|
|
16635
|
-
name: "data_failed",
|
|
16636
|
-
handler: onDataFailed
|
|
16637
|
-
}, {
|
|
16638
|
-
name: "loaded_images",
|
|
16639
|
-
handler: onLoadedImages
|
|
16640
|
-
}, {
|
|
16641
|
-
name: "DOMLoaded",
|
|
16642
|
-
handler: onDOMLoaded
|
|
16643
|
-
}, {
|
|
16644
|
-
name: "destroy",
|
|
16645
|
-
handler: onDestroy
|
|
16646
|
-
}];
|
|
16647
|
-
var listeners = partialListeners.filter(function(listener) {
|
|
16648
|
-
return listener.handler != null;
|
|
16649
|
-
});
|
|
16650
|
-
if (!listeners.length) {
|
|
16651
|
-
return;
|
|
16652
|
-
}
|
|
16653
|
-
var deregisterList = listeners.map(
|
|
16654
|
-
/**
|
|
16655
|
-
* Handle the process of adding an event listener
|
|
16656
|
-
* @param {Listener} listener
|
|
16657
|
-
* @return {Function} Function that deregister the listener
|
|
16658
|
-
*/
|
|
16659
|
-
function(listener) {
|
|
16660
|
-
var _a;
|
|
16661
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener(listener.name, listener.handler);
|
|
16662
|
-
return function() {
|
|
16663
|
-
var _a2;
|
|
16664
|
-
(_a2 = animationInstanceRef.current) === null || _a2 === void 0 ? void 0 : _a2.removeEventListener(listener.name, listener.handler);
|
|
16665
|
-
};
|
|
16666
|
-
}
|
|
16667
|
-
);
|
|
16668
|
-
return function() {
|
|
16669
|
-
deregisterList.forEach(function(deregister) {
|
|
16670
|
-
return deregister();
|
|
16671
|
-
});
|
|
16672
|
-
};
|
|
16673
|
-
}, [onComplete, onLoopComplete, onEnterFrame, onSegmentStart, onConfigReady, onDataReady, onDataFailed, onLoadedImages, onDOMLoaded, onDestroy]);
|
|
16674
|
-
var View = /* @__PURE__ */ import_react15.default.createElement("div", _objectSpread2({
|
|
16675
|
-
style,
|
|
16676
|
-
ref: animationContainer
|
|
16677
|
-
}, rest));
|
|
16678
|
-
return {
|
|
16679
|
-
View,
|
|
16680
|
-
play,
|
|
16681
|
-
stop,
|
|
16682
|
-
pause,
|
|
16683
|
-
setSpeed,
|
|
16684
|
-
goToAndStop,
|
|
16685
|
-
goToAndPlay,
|
|
16686
|
-
setDirection,
|
|
16687
|
-
playSegments,
|
|
16688
|
-
setSubframe,
|
|
16689
|
-
getDuration,
|
|
16690
|
-
destroy,
|
|
16691
|
-
animationContainerRef: animationContainer,
|
|
16692
|
-
animationLoaded,
|
|
16693
|
-
animationItem: animationInstanceRef.current
|
|
16694
|
-
};
|
|
16695
|
-
};
|
|
16696
|
-
useInitInteractivity = function useInitInteractivity2(_ref) {
|
|
16697
|
-
var wrapperRef = _ref.wrapperRef, animationItem = _ref.animationItem, mode = _ref.mode, actions = _ref.actions;
|
|
16698
|
-
(0, import_react15.useEffect)(function() {
|
|
16699
|
-
var wrapper = wrapperRef.current;
|
|
16700
|
-
if (!wrapper || !animationItem || !actions.length) {
|
|
16701
|
-
return;
|
|
16702
|
-
}
|
|
16703
|
-
animationItem.stop();
|
|
16704
|
-
var scrollModeHandler = function scrollModeHandler2() {
|
|
16705
|
-
var assignedSegment = null;
|
|
16706
|
-
var scrollHandler = function scrollHandler2() {
|
|
16707
|
-
var currentPercent = getContainerVisibility(wrapper);
|
|
16708
|
-
var action = actions.find(function(_ref2) {
|
|
16709
|
-
var visibility = _ref2.visibility;
|
|
16710
|
-
return visibility && currentPercent >= visibility[0] && currentPercent <= visibility[1];
|
|
16711
|
-
});
|
|
16712
|
-
if (!action) {
|
|
16713
|
-
return;
|
|
16714
|
-
}
|
|
16715
|
-
if (action.type === "seek" && action.visibility && action.frames.length === 2) {
|
|
16716
|
-
var frameToGo = action.frames[0] + Math.ceil((currentPercent - action.visibility[0]) / (action.visibility[1] - action.visibility[0]) * action.frames[1]);
|
|
16717
|
-
animationItem.goToAndStop(frameToGo - animationItem.firstFrame - 1, true);
|
|
16718
|
-
}
|
|
16719
|
-
if (action.type === "loop") {
|
|
16720
|
-
if (assignedSegment === null) {
|
|
16721
|
-
animationItem.playSegments(action.frames, true);
|
|
16722
|
-
assignedSegment = action.frames;
|
|
16723
|
-
} else {
|
|
16724
|
-
if (assignedSegment !== action.frames) {
|
|
16725
|
-
animationItem.playSegments(action.frames, true);
|
|
16726
|
-
assignedSegment = action.frames;
|
|
16727
|
-
} else if (animationItem.isPaused) {
|
|
16728
|
-
animationItem.playSegments(action.frames, true);
|
|
16729
|
-
assignedSegment = action.frames;
|
|
16730
|
-
}
|
|
16731
|
-
}
|
|
16732
|
-
}
|
|
16733
|
-
if (action.type === "play" && animationItem.isPaused) {
|
|
16734
|
-
animationItem.resetSegments(true);
|
|
16735
|
-
animationItem.play();
|
|
16736
|
-
}
|
|
16737
|
-
if (action.type === "stop") {
|
|
16738
|
-
animationItem.goToAndStop(action.frames[0] - animationItem.firstFrame - 1, true);
|
|
16739
|
-
}
|
|
16740
|
-
};
|
|
16741
|
-
document.addEventListener("scroll", scrollHandler);
|
|
16742
|
-
return function() {
|
|
16743
|
-
document.removeEventListener("scroll", scrollHandler);
|
|
16744
|
-
};
|
|
16745
|
-
};
|
|
16746
|
-
var cursorModeHandler = function cursorModeHandler2() {
|
|
16747
|
-
var handleCursor = function handleCursor2(_x, _y) {
|
|
16748
|
-
var x = _x;
|
|
16749
|
-
var y = _y;
|
|
16750
|
-
if (x !== -1 && y !== -1) {
|
|
16751
|
-
var pos = getContainerCursorPosition(wrapper, x, y);
|
|
16752
|
-
x = pos.x;
|
|
16753
|
-
y = pos.y;
|
|
16754
|
-
}
|
|
16755
|
-
var action = actions.find(function(_ref3) {
|
|
16756
|
-
var position2 = _ref3.position;
|
|
16757
|
-
if (position2 && Array.isArray(position2.x) && Array.isArray(position2.y)) {
|
|
16758
|
-
return x >= position2.x[0] && x <= position2.x[1] && y >= position2.y[0] && y <= position2.y[1];
|
|
16759
|
-
}
|
|
16760
|
-
if (position2 && !Number.isNaN(position2.x) && !Number.isNaN(position2.y)) {
|
|
16761
|
-
return x === position2.x && y === position2.y;
|
|
16762
|
-
}
|
|
16763
|
-
return false;
|
|
16764
|
-
});
|
|
16765
|
-
if (!action) {
|
|
16766
|
-
return;
|
|
16767
|
-
}
|
|
16768
|
-
if (action.type === "seek" && action.position && Array.isArray(action.position.x) && Array.isArray(action.position.y) && action.frames.length === 2) {
|
|
16769
|
-
var xPercent = (x - action.position.x[0]) / (action.position.x[1] - action.position.x[0]);
|
|
16770
|
-
var yPercent = (y - action.position.y[0]) / (action.position.y[1] - action.position.y[0]);
|
|
16771
|
-
animationItem.playSegments(action.frames, true);
|
|
16772
|
-
animationItem.goToAndStop(Math.ceil((xPercent + yPercent) / 2 * (action.frames[1] - action.frames[0])), true);
|
|
16773
|
-
}
|
|
16774
|
-
if (action.type === "loop") {
|
|
16775
|
-
animationItem.playSegments(action.frames, true);
|
|
16776
|
-
}
|
|
16777
|
-
if (action.type === "play") {
|
|
16778
|
-
if (animationItem.isPaused) {
|
|
16779
|
-
animationItem.resetSegments(false);
|
|
16780
|
-
}
|
|
16781
|
-
animationItem.playSegments(action.frames);
|
|
16782
|
-
}
|
|
16783
|
-
if (action.type === "stop") {
|
|
16784
|
-
animationItem.goToAndStop(action.frames[0], true);
|
|
16785
|
-
}
|
|
16786
|
-
};
|
|
16787
|
-
var mouseMoveHandler = function mouseMoveHandler2(ev) {
|
|
16788
|
-
handleCursor(ev.clientX, ev.clientY);
|
|
16789
|
-
};
|
|
16790
|
-
var mouseOutHandler = function mouseOutHandler2() {
|
|
16791
|
-
handleCursor(-1, -1);
|
|
16792
|
-
};
|
|
16793
|
-
wrapper.addEventListener("mousemove", mouseMoveHandler);
|
|
16794
|
-
wrapper.addEventListener("mouseout", mouseOutHandler);
|
|
16795
|
-
return function() {
|
|
16796
|
-
wrapper.removeEventListener("mousemove", mouseMoveHandler);
|
|
16797
|
-
wrapper.removeEventListener("mouseout", mouseOutHandler);
|
|
16798
|
-
};
|
|
16799
|
-
};
|
|
16800
|
-
switch (mode) {
|
|
16801
|
-
case "scroll":
|
|
16802
|
-
return scrollModeHandler();
|
|
16803
|
-
case "cursor":
|
|
16804
|
-
return cursorModeHandler();
|
|
16805
|
-
}
|
|
16806
|
-
}, [mode, animationItem]);
|
|
16807
|
-
};
|
|
16808
|
-
useLottieInteractivity = function useLottieInteractivity2(_ref4) {
|
|
16809
|
-
var actions = _ref4.actions, mode = _ref4.mode, lottieObj = _ref4.lottieObj;
|
|
16810
|
-
var animationItem = lottieObj.animationItem, View = lottieObj.View, animationContainerRef = lottieObj.animationContainerRef;
|
|
16811
|
-
useInitInteractivity({
|
|
16812
|
-
actions,
|
|
16813
|
-
animationItem,
|
|
16814
|
-
mode,
|
|
16815
|
-
wrapperRef: animationContainerRef
|
|
16816
|
-
});
|
|
16817
|
-
return View;
|
|
16818
|
-
};
|
|
16819
|
-
_excluded = ["style", "interactivity"];
|
|
16820
|
-
Lottie = function Lottie2(props) {
|
|
16821
|
-
var _a, _b, _c;
|
|
16822
|
-
var style = props.style, interactivity = props.interactivity, lottieProps = _objectWithoutProperties(props, _excluded);
|
|
16823
|
-
var _useLottie = useLottie(lottieProps, style), View = _useLottie.View, play = _useLottie.play, stop = _useLottie.stop, pause = _useLottie.pause, setSpeed = _useLottie.setSpeed, goToAndStop = _useLottie.goToAndStop, goToAndPlay = _useLottie.goToAndPlay, setDirection = _useLottie.setDirection, playSegments = _useLottie.playSegments, setSubframe = _useLottie.setSubframe, getDuration = _useLottie.getDuration, destroy = _useLottie.destroy, animationContainerRef = _useLottie.animationContainerRef, animationLoaded = _useLottie.animationLoaded, animationItem = _useLottie.animationItem;
|
|
16824
|
-
(0, import_react15.useEffect)(function() {
|
|
16825
|
-
if (props.lottieRef) {
|
|
16826
|
-
props.lottieRef.current = {
|
|
16827
|
-
play,
|
|
16828
|
-
stop,
|
|
16829
|
-
pause,
|
|
16830
|
-
setSpeed,
|
|
16831
|
-
goToAndPlay,
|
|
16832
|
-
goToAndStop,
|
|
16833
|
-
setDirection,
|
|
16834
|
-
playSegments,
|
|
16835
|
-
setSubframe,
|
|
16836
|
-
getDuration,
|
|
16837
|
-
destroy,
|
|
16838
|
-
animationContainerRef,
|
|
16839
|
-
animationLoaded,
|
|
16840
|
-
animationItem
|
|
16841
|
-
};
|
|
16842
|
-
}
|
|
16843
|
-
}, [(_a = props.lottieRef) === null || _a === void 0 ? void 0 : _a.current]);
|
|
16844
|
-
return useLottieInteractivity({
|
|
16845
|
-
lottieObj: {
|
|
16846
|
-
View,
|
|
16847
|
-
play,
|
|
16848
|
-
stop,
|
|
16849
|
-
pause,
|
|
16850
|
-
setSpeed,
|
|
16851
|
-
goToAndStop,
|
|
16852
|
-
goToAndPlay,
|
|
16853
|
-
setDirection,
|
|
16854
|
-
playSegments,
|
|
16855
|
-
setSubframe,
|
|
16856
|
-
getDuration,
|
|
16857
|
-
destroy,
|
|
16858
|
-
animationContainerRef,
|
|
16859
|
-
animationLoaded,
|
|
16860
|
-
animationItem
|
|
16861
|
-
},
|
|
16862
|
-
actions: (_b = interactivity === null || interactivity === void 0 ? void 0 : interactivity.actions) !== null && _b !== void 0 ? _b : [],
|
|
16863
|
-
mode: (_c = interactivity === null || interactivity === void 0 ? void 0 : interactivity.mode) !== null && _c !== void 0 ? _c : "scroll"
|
|
16864
|
-
});
|
|
16865
|
-
};
|
|
16866
|
-
}
|
|
16867
|
-
});
|
|
16868
|
-
|
|
16869
16376
|
// src/hooks/index.tsx
|
|
16870
16377
|
var hooks_exports = {};
|
|
16871
16378
|
__export(hooks_exports, {
|
|
@@ -17195,10 +16702,10 @@ var localStore = useLocalStore;
|
|
|
17195
16702
|
var useLocalStore_default = useLocalStore;
|
|
17196
16703
|
|
|
17197
16704
|
// src/hooks/useUserInfo.tsx
|
|
17198
|
-
var
|
|
16705
|
+
var import_react35 = require("react");
|
|
17199
16706
|
|
|
17200
16707
|
// src/MatchContext.tsx
|
|
17201
|
-
var
|
|
16708
|
+
var import_react34 = require("react");
|
|
17202
16709
|
|
|
17203
16710
|
// src/store/useModalStore.ts
|
|
17204
16711
|
var import_zustand2 = require("zustand");
|
|
@@ -18103,23 +17610,312 @@ var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
|
18103
17610
|
// src/ui/Tabs/index.tsx
|
|
18104
17611
|
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
18105
17612
|
|
|
17613
|
+
// node_modules/lottie-react/build/index.es.js
|
|
17614
|
+
var import_lottie_web = __toESM(require_lottie());
|
|
17615
|
+
var import_lottie_web2 = __toESM(require_lottie());
|
|
17616
|
+
var import_react15 = __toESM(require("react"));
|
|
17617
|
+
function _arrayLikeToArray(r, a) {
|
|
17618
|
+
(null == a || a > r.length) && (a = r.length);
|
|
17619
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
17620
|
+
return n;
|
|
17621
|
+
}
|
|
17622
|
+
function _arrayWithHoles(r) {
|
|
17623
|
+
if (Array.isArray(r)) return r;
|
|
17624
|
+
}
|
|
17625
|
+
function _defineProperty(e, r, t) {
|
|
17626
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
17627
|
+
value: t,
|
|
17628
|
+
enumerable: true,
|
|
17629
|
+
configurable: true,
|
|
17630
|
+
writable: true
|
|
17631
|
+
}) : e[r] = t, e;
|
|
17632
|
+
}
|
|
17633
|
+
function _iterableToArrayLimit(r, l) {
|
|
17634
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
17635
|
+
if (null != t) {
|
|
17636
|
+
var e, n, i, u, a = [], f = true, o = false;
|
|
17637
|
+
try {
|
|
17638
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
17639
|
+
if (Object(t) !== t) return;
|
|
17640
|
+
f = false;
|
|
17641
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = true) ;
|
|
17642
|
+
} catch (r2) {
|
|
17643
|
+
o = true, n = r2;
|
|
17644
|
+
} finally {
|
|
17645
|
+
try {
|
|
17646
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
17647
|
+
} finally {
|
|
17648
|
+
if (o) throw n;
|
|
17649
|
+
}
|
|
17650
|
+
}
|
|
17651
|
+
return a;
|
|
17652
|
+
}
|
|
17653
|
+
}
|
|
17654
|
+
function _nonIterableRest() {
|
|
17655
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
17656
|
+
}
|
|
17657
|
+
function ownKeys(e, r) {
|
|
17658
|
+
var t = Object.keys(e);
|
|
17659
|
+
if (Object.getOwnPropertySymbols) {
|
|
17660
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
17661
|
+
r && (o = o.filter(function(r2) {
|
|
17662
|
+
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
17663
|
+
})), t.push.apply(t, o);
|
|
17664
|
+
}
|
|
17665
|
+
return t;
|
|
17666
|
+
}
|
|
17667
|
+
function _objectSpread2(e) {
|
|
17668
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
17669
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
17670
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
17671
|
+
_defineProperty(e, r2, t[r2]);
|
|
17672
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
17673
|
+
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
17674
|
+
});
|
|
17675
|
+
}
|
|
17676
|
+
return e;
|
|
17677
|
+
}
|
|
17678
|
+
function _objectWithoutProperties(e, t) {
|
|
17679
|
+
if (null == e) return {};
|
|
17680
|
+
var o, r, i = _objectWithoutPropertiesLoose(e, t);
|
|
17681
|
+
if (Object.getOwnPropertySymbols) {
|
|
17682
|
+
var s = Object.getOwnPropertySymbols(e);
|
|
17683
|
+
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
17684
|
+
}
|
|
17685
|
+
return i;
|
|
17686
|
+
}
|
|
17687
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
17688
|
+
if (null == r) return {};
|
|
17689
|
+
var t = {};
|
|
17690
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
17691
|
+
if (e.includes(n)) continue;
|
|
17692
|
+
t[n] = r[n];
|
|
17693
|
+
}
|
|
17694
|
+
return t;
|
|
17695
|
+
}
|
|
17696
|
+
function _slicedToArray(r, e) {
|
|
17697
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
17698
|
+
}
|
|
17699
|
+
function _toPrimitive(t, r) {
|
|
17700
|
+
if ("object" != typeof t || !t) return t;
|
|
17701
|
+
var e = t[Symbol.toPrimitive];
|
|
17702
|
+
if (void 0 !== e) {
|
|
17703
|
+
var i = e.call(t, r || "default");
|
|
17704
|
+
if ("object" != typeof i) return i;
|
|
17705
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
17706
|
+
}
|
|
17707
|
+
return ("string" === r ? String : Number)(t);
|
|
17708
|
+
}
|
|
17709
|
+
function _toPropertyKey(t) {
|
|
17710
|
+
var i = _toPrimitive(t, "string");
|
|
17711
|
+
return "symbol" == typeof i ? i : i + "";
|
|
17712
|
+
}
|
|
17713
|
+
function _unsupportedIterableToArray(r, a) {
|
|
17714
|
+
if (r) {
|
|
17715
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
17716
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
17717
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
17718
|
+
}
|
|
17719
|
+
}
|
|
17720
|
+
var _excluded$1 = ["animationData", "loop", "autoplay", "initialSegment", "onComplete", "onLoopComplete", "onEnterFrame", "onSegmentStart", "onConfigReady", "onDataReady", "onDataFailed", "onLoadedImages", "onDOMLoaded", "onDestroy", "lottieRef", "renderer", "name", "assetsPath", "rendererSettings"];
|
|
17721
|
+
var useLottie = function useLottie2(props, style) {
|
|
17722
|
+
var animationData2 = props.animationData, loop = props.loop, autoplay = props.autoplay, initialSegment = props.initialSegment, onComplete = props.onComplete, onLoopComplete = props.onLoopComplete, onEnterFrame = props.onEnterFrame, onSegmentStart = props.onSegmentStart, onConfigReady = props.onConfigReady, onDataReady = props.onDataReady, onDataFailed = props.onDataFailed, onLoadedImages = props.onLoadedImages, onDOMLoaded = props.onDOMLoaded, onDestroy = props.onDestroy;
|
|
17723
|
+
props.lottieRef;
|
|
17724
|
+
props.renderer;
|
|
17725
|
+
props.name;
|
|
17726
|
+
props.assetsPath;
|
|
17727
|
+
props.rendererSettings;
|
|
17728
|
+
var rest = _objectWithoutProperties(props, _excluded$1);
|
|
17729
|
+
var _useState = (0, import_react15.useState)(false), _useState2 = _slicedToArray(_useState, 2), animationLoaded = _useState2[0], setAnimationLoaded = _useState2[1];
|
|
17730
|
+
var animationInstanceRef = (0, import_react15.useRef)();
|
|
17731
|
+
var animationContainer = (0, import_react15.useRef)(null);
|
|
17732
|
+
var play = function play2() {
|
|
17733
|
+
var _a;
|
|
17734
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
|
17735
|
+
};
|
|
17736
|
+
var stop = function stop2() {
|
|
17737
|
+
var _a;
|
|
17738
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.stop();
|
|
17739
|
+
};
|
|
17740
|
+
var pause = function pause2() {
|
|
17741
|
+
var _a;
|
|
17742
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
|
17743
|
+
};
|
|
17744
|
+
var setSpeed = function setSpeed2(speed) {
|
|
17745
|
+
var _a;
|
|
17746
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setSpeed(speed);
|
|
17747
|
+
};
|
|
17748
|
+
var goToAndPlay = function goToAndPlay2(value2, isFrame) {
|
|
17749
|
+
var _a;
|
|
17750
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.goToAndPlay(value2, isFrame);
|
|
17751
|
+
};
|
|
17752
|
+
var goToAndStop = function goToAndStop2(value2, isFrame) {
|
|
17753
|
+
var _a;
|
|
17754
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.goToAndStop(value2, isFrame);
|
|
17755
|
+
};
|
|
17756
|
+
var setDirection = function setDirection2(direction) {
|
|
17757
|
+
var _a;
|
|
17758
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setDirection(direction);
|
|
17759
|
+
};
|
|
17760
|
+
var playSegments = function playSegments2(segments, forceFlag) {
|
|
17761
|
+
var _a;
|
|
17762
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.playSegments(segments, forceFlag);
|
|
17763
|
+
};
|
|
17764
|
+
var setSubframe = function setSubframe2(useSubFrames) {
|
|
17765
|
+
var _a;
|
|
17766
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setSubframe(useSubFrames);
|
|
17767
|
+
};
|
|
17768
|
+
var getDuration = function getDuration2(inFrames) {
|
|
17769
|
+
var _a;
|
|
17770
|
+
return (_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.getDuration(inFrames);
|
|
17771
|
+
};
|
|
17772
|
+
var destroy = function destroy2() {
|
|
17773
|
+
var _a;
|
|
17774
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
17775
|
+
animationInstanceRef.current = void 0;
|
|
17776
|
+
};
|
|
17777
|
+
var loadAnimation2 = function loadAnimation3() {
|
|
17778
|
+
var forcedConfigs = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
17779
|
+
var _a;
|
|
17780
|
+
if (!animationContainer.current) {
|
|
17781
|
+
return;
|
|
17782
|
+
}
|
|
17783
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
17784
|
+
var config = _objectSpread2(_objectSpread2(_objectSpread2({}, props), forcedConfigs), {}, {
|
|
17785
|
+
container: animationContainer.current
|
|
17786
|
+
});
|
|
17787
|
+
animationInstanceRef.current = import_lottie_web.default.loadAnimation(config);
|
|
17788
|
+
setAnimationLoaded(!!animationInstanceRef.current);
|
|
17789
|
+
return function() {
|
|
17790
|
+
var _a2;
|
|
17791
|
+
(_a2 = animationInstanceRef.current) === null || _a2 === void 0 ? void 0 : _a2.destroy();
|
|
17792
|
+
animationInstanceRef.current = void 0;
|
|
17793
|
+
};
|
|
17794
|
+
};
|
|
17795
|
+
(0, import_react15.useEffect)(function() {
|
|
17796
|
+
var onUnmount = loadAnimation2();
|
|
17797
|
+
return function() {
|
|
17798
|
+
return onUnmount === null || onUnmount === void 0 ? void 0 : onUnmount();
|
|
17799
|
+
};
|
|
17800
|
+
}, [animationData2, loop]);
|
|
17801
|
+
(0, import_react15.useEffect)(function() {
|
|
17802
|
+
if (!animationInstanceRef.current) {
|
|
17803
|
+
return;
|
|
17804
|
+
}
|
|
17805
|
+
animationInstanceRef.current.autoplay = !!autoplay;
|
|
17806
|
+
}, [autoplay]);
|
|
17807
|
+
(0, import_react15.useEffect)(function() {
|
|
17808
|
+
if (!animationInstanceRef.current) {
|
|
17809
|
+
return;
|
|
17810
|
+
}
|
|
17811
|
+
if (!initialSegment) {
|
|
17812
|
+
animationInstanceRef.current.resetSegments(true);
|
|
17813
|
+
return;
|
|
17814
|
+
}
|
|
17815
|
+
if (!Array.isArray(initialSegment) || !initialSegment.length) {
|
|
17816
|
+
return;
|
|
17817
|
+
}
|
|
17818
|
+
if (animationInstanceRef.current.currentRawFrame < initialSegment[0] || animationInstanceRef.current.currentRawFrame > initialSegment[1]) {
|
|
17819
|
+
animationInstanceRef.current.currentRawFrame = initialSegment[0];
|
|
17820
|
+
}
|
|
17821
|
+
animationInstanceRef.current.setSegment(initialSegment[0], initialSegment[1]);
|
|
17822
|
+
}, [initialSegment]);
|
|
17823
|
+
(0, import_react15.useEffect)(function() {
|
|
17824
|
+
var partialListeners = [{
|
|
17825
|
+
name: "complete",
|
|
17826
|
+
handler: onComplete
|
|
17827
|
+
}, {
|
|
17828
|
+
name: "loopComplete",
|
|
17829
|
+
handler: onLoopComplete
|
|
17830
|
+
}, {
|
|
17831
|
+
name: "enterFrame",
|
|
17832
|
+
handler: onEnterFrame
|
|
17833
|
+
}, {
|
|
17834
|
+
name: "segmentStart",
|
|
17835
|
+
handler: onSegmentStart
|
|
17836
|
+
}, {
|
|
17837
|
+
name: "config_ready",
|
|
17838
|
+
handler: onConfigReady
|
|
17839
|
+
}, {
|
|
17840
|
+
name: "data_ready",
|
|
17841
|
+
handler: onDataReady
|
|
17842
|
+
}, {
|
|
17843
|
+
name: "data_failed",
|
|
17844
|
+
handler: onDataFailed
|
|
17845
|
+
}, {
|
|
17846
|
+
name: "loaded_images",
|
|
17847
|
+
handler: onLoadedImages
|
|
17848
|
+
}, {
|
|
17849
|
+
name: "DOMLoaded",
|
|
17850
|
+
handler: onDOMLoaded
|
|
17851
|
+
}, {
|
|
17852
|
+
name: "destroy",
|
|
17853
|
+
handler: onDestroy
|
|
17854
|
+
}];
|
|
17855
|
+
var listeners = partialListeners.filter(function(listener) {
|
|
17856
|
+
return listener.handler != null;
|
|
17857
|
+
});
|
|
17858
|
+
if (!listeners.length) {
|
|
17859
|
+
return;
|
|
17860
|
+
}
|
|
17861
|
+
var deregisterList = listeners.map(
|
|
17862
|
+
/**
|
|
17863
|
+
* Handle the process of adding an event listener
|
|
17864
|
+
* @param {Listener} listener
|
|
17865
|
+
* @return {Function} Function that deregister the listener
|
|
17866
|
+
*/
|
|
17867
|
+
function(listener) {
|
|
17868
|
+
var _a;
|
|
17869
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener(listener.name, listener.handler);
|
|
17870
|
+
return function() {
|
|
17871
|
+
var _a2;
|
|
17872
|
+
(_a2 = animationInstanceRef.current) === null || _a2 === void 0 ? void 0 : _a2.removeEventListener(listener.name, listener.handler);
|
|
17873
|
+
};
|
|
17874
|
+
}
|
|
17875
|
+
);
|
|
17876
|
+
return function() {
|
|
17877
|
+
deregisterList.forEach(function(deregister) {
|
|
17878
|
+
return deregister();
|
|
17879
|
+
});
|
|
17880
|
+
};
|
|
17881
|
+
}, [onComplete, onLoopComplete, onEnterFrame, onSegmentStart, onConfigReady, onDataReady, onDataFailed, onLoadedImages, onDOMLoaded, onDestroy]);
|
|
17882
|
+
var View = /* @__PURE__ */ import_react15.default.createElement("div", _objectSpread2({
|
|
17883
|
+
style,
|
|
17884
|
+
ref: animationContainer
|
|
17885
|
+
}, rest));
|
|
17886
|
+
return {
|
|
17887
|
+
View,
|
|
17888
|
+
play,
|
|
17889
|
+
stop,
|
|
17890
|
+
pause,
|
|
17891
|
+
setSpeed,
|
|
17892
|
+
goToAndStop,
|
|
17893
|
+
goToAndPlay,
|
|
17894
|
+
setDirection,
|
|
17895
|
+
playSegments,
|
|
17896
|
+
setSubframe,
|
|
17897
|
+
getDuration,
|
|
17898
|
+
destroy,
|
|
17899
|
+
animationContainerRef: animationContainer,
|
|
17900
|
+
animationLoaded,
|
|
17901
|
+
animationItem: animationInstanceRef.current
|
|
17902
|
+
};
|
|
17903
|
+
};
|
|
17904
|
+
|
|
18106
17905
|
// src/ui/Lottie/index.tsx
|
|
18107
|
-
var import_react16 = require("react");
|
|
18108
|
-
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
18109
17906
|
var LazyLottie = (props) => {
|
|
18110
|
-
const
|
|
18111
|
-
|
|
18112
|
-
|
|
18113
|
-
|
|
18114
|
-
|
|
18115
|
-
},
|
|
18116
|
-
|
|
18117
|
-
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(LottieReact, { loop: true, autoplay: true, ...props });
|
|
17907
|
+
const options = {
|
|
17908
|
+
animationData: props.animationData,
|
|
17909
|
+
loop: true,
|
|
17910
|
+
autoplay: true
|
|
17911
|
+
};
|
|
17912
|
+
const { View } = useLottie(options, props.style);
|
|
17913
|
+
return View;
|
|
18118
17914
|
};
|
|
18119
17915
|
var Lottie_default = LazyLottie;
|
|
18120
17916
|
|
|
18121
17917
|
// src/components/EVMModal/index.tsx
|
|
18122
|
-
var
|
|
17918
|
+
var import_react18 = require("react");
|
|
18123
17919
|
|
|
18124
17920
|
// src/hooks/eventManager.ts
|
|
18125
17921
|
var EventManager = class {
|
|
@@ -18153,15 +17949,15 @@ var eventManager_default = eventManager;
|
|
|
18153
17949
|
var import_react_intl10 = require("react-intl");
|
|
18154
17950
|
|
|
18155
17951
|
// src/components/WalletModalContent/index.tsx
|
|
18156
|
-
var
|
|
18157
|
-
var
|
|
17952
|
+
var import_react16 = require("react");
|
|
17953
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
18158
17954
|
|
|
18159
17955
|
// src/components/EVMModal/index.tsx
|
|
18160
17956
|
var import_rainbowkit = require("@rainbow-me/rainbowkit");
|
|
18161
17957
|
var import_wagmi2 = require("wagmi");
|
|
18162
17958
|
|
|
18163
17959
|
// src/hooks/useWalletBox.ts
|
|
18164
|
-
var
|
|
17960
|
+
var import_react17 = require("react");
|
|
18165
17961
|
|
|
18166
17962
|
// src/hooks/useEthersSigner.ts
|
|
18167
17963
|
var React6 = __toESM(require("react"));
|
|
@@ -18171,54 +17967,54 @@ var import_ethers = require("ethers");
|
|
|
18171
17967
|
// src/components/EVMModal/index.tsx
|
|
18172
17968
|
var import_siwe = require("siwe");
|
|
18173
17969
|
var import_styles = require("@rainbow-me/rainbowkit/styles.css");
|
|
18174
|
-
var
|
|
17970
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
18175
17971
|
|
|
18176
17972
|
// src/components/TRONModal/index.tsx
|
|
18177
|
-
var
|
|
17973
|
+
var import_react20 = __toESM(require("react"));
|
|
18178
17974
|
var import_react_intl11 = require("react-intl");
|
|
18179
17975
|
|
|
18180
17976
|
// src/hooks/useTRONWallet.ts
|
|
18181
|
-
var
|
|
17977
|
+
var import_react19 = require("react");
|
|
18182
17978
|
|
|
18183
17979
|
// src/components/TRONModal/index.tsx
|
|
18184
|
-
var
|
|
17980
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
18185
17981
|
|
|
18186
17982
|
// src/components/TONModal/index.tsx
|
|
18187
|
-
var
|
|
17983
|
+
var import_react21 = __toESM(require("react"));
|
|
18188
17984
|
var import_react_intl12 = require("react-intl");
|
|
18189
17985
|
var import_ui_react = require("@tonconnect/ui-react");
|
|
18190
|
-
var
|
|
17986
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
18191
17987
|
|
|
18192
17988
|
// src/components/BTCModal/index.tsx
|
|
18193
|
-
var
|
|
17989
|
+
var import_react23 = __toESM(require("react"));
|
|
18194
17990
|
var import_react_intl13 = require("react-intl");
|
|
18195
17991
|
|
|
18196
17992
|
// src/lib/btc/XverseAdapter.ts
|
|
18197
17993
|
var import_sats_connect = require("sats-connect");
|
|
18198
17994
|
|
|
18199
17995
|
// src/hooks/useBTCWallet.ts
|
|
18200
|
-
var
|
|
17996
|
+
var import_react22 = require("react");
|
|
18201
17997
|
|
|
18202
17998
|
// src/components/BTCModal/index.tsx
|
|
18203
|
-
var
|
|
17999
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
18204
18000
|
|
|
18205
18001
|
// src/components/WalletModal/index.tsx
|
|
18206
|
-
var
|
|
18002
|
+
var import_react24 = require("react");
|
|
18207
18003
|
var import_react_intl14 = require("react-intl");
|
|
18208
|
-
var
|
|
18004
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
18209
18005
|
|
|
18210
18006
|
// src/components/AlphaAvatar/index.tsx
|
|
18211
|
-
var
|
|
18212
|
-
var
|
|
18007
|
+
var import_react25 = require("react");
|
|
18008
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
18213
18009
|
function AlphaAvatar2({ name: name2, size = 40, className = "" }) {
|
|
18214
|
-
const [avatar, setAvatar] = (0,
|
|
18215
|
-
(0,
|
|
18010
|
+
const [avatar, setAvatar] = (0, import_react25.useState)(void 0);
|
|
18011
|
+
(0, import_react25.useEffect)(() => {
|
|
18216
18012
|
if (name2) {
|
|
18217
18013
|
const char = name2[0].toUpperCase();
|
|
18218
18014
|
setAvatar(char);
|
|
18219
18015
|
}
|
|
18220
18016
|
}, [name2]);
|
|
18221
|
-
return /* @__PURE__ */ (0,
|
|
18017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: `matchid-alpha-avatar ${className}`, style: {
|
|
18222
18018
|
width: size,
|
|
18223
18019
|
height: size,
|
|
18224
18020
|
fontSize: Math.ceil(size / 2)
|
|
@@ -18226,13 +18022,13 @@ function AlphaAvatar2({ name: name2, size = 40, className = "" }) {
|
|
|
18226
18022
|
}
|
|
18227
18023
|
|
|
18228
18024
|
// src/components/WalletAsset/index.tsx
|
|
18229
|
-
var
|
|
18025
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
18230
18026
|
|
|
18231
18027
|
// src/components/TokenSend/index.tsx
|
|
18232
|
-
var
|
|
18028
|
+
var import_react26 = require("react");
|
|
18233
18029
|
var import_viem2 = require("viem");
|
|
18234
18030
|
var import_react_intl15 = require("react-intl");
|
|
18235
|
-
var
|
|
18031
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
18236
18032
|
function Input2({
|
|
18237
18033
|
onChange,
|
|
18238
18034
|
placeholder,
|
|
@@ -18242,8 +18038,8 @@ function Input2({
|
|
|
18242
18038
|
error,
|
|
18243
18039
|
size = "df"
|
|
18244
18040
|
}) {
|
|
18245
|
-
return /* @__PURE__ */ (0,
|
|
18246
|
-
/* @__PURE__ */ (0,
|
|
18041
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `matchid-token-input-box ${"matchid-token-input-" + size}`, children: [
|
|
18042
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
18247
18043
|
"input",
|
|
18248
18044
|
{
|
|
18249
18045
|
placeholder,
|
|
@@ -18254,7 +18050,7 @@ function Input2({
|
|
|
18254
18050
|
className: `matchid-token-input ${error ? "matchid-token-input-error" : ""}`
|
|
18255
18051
|
}
|
|
18256
18052
|
),
|
|
18257
|
-
error && /* @__PURE__ */ (0,
|
|
18053
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "matchid-token-input-error-text", children: error })
|
|
18258
18054
|
] });
|
|
18259
18055
|
}
|
|
18260
18056
|
function TokenSend({
|
|
@@ -18267,22 +18063,22 @@ function TokenSend({
|
|
|
18267
18063
|
const intl = (0, import_react_intl15.useIntl)();
|
|
18268
18064
|
const { createWalletClient: createWalletClient2 } = useWallet();
|
|
18269
18065
|
const isNative = token.address.toLowerCase() == NATIVE_TOKEN_ADDRESS;
|
|
18270
|
-
const chain = (0,
|
|
18066
|
+
const chain = (0, import_react26.useMemo)(() => {
|
|
18271
18067
|
return chainList?.find((m) => m.id.toString() === token.chain_id);
|
|
18272
18068
|
}, [chainList, token.chain_id]);
|
|
18273
|
-
const walletClient = (0,
|
|
18069
|
+
const walletClient = (0, import_react26.useMemo)(() => {
|
|
18274
18070
|
return createWalletClient2({
|
|
18275
18071
|
// @ts-ignore
|
|
18276
18072
|
chain: (0, import_viem2.defineChain)(chain),
|
|
18277
18073
|
transport: (0, import_viem2.http)()
|
|
18278
18074
|
});
|
|
18279
18075
|
}, [chain]);
|
|
18280
|
-
const [amount, setAmount] = (0,
|
|
18281
|
-
const [address, setAddress] = (0,
|
|
18282
|
-
const [loading, setLoading] = (0,
|
|
18283
|
-
const [sending, setSending] = (0,
|
|
18284
|
-
const [txError, setTxError] = (0,
|
|
18285
|
-
const transaction = (0,
|
|
18076
|
+
const [amount, setAmount] = (0, import_react26.useState)("");
|
|
18077
|
+
const [address, setAddress] = (0, import_react26.useState)("");
|
|
18078
|
+
const [loading, setLoading] = (0, import_react26.useState)(false);
|
|
18079
|
+
const [sending, setSending] = (0, import_react26.useState)(false);
|
|
18080
|
+
const [txError, setTxError] = (0, import_react26.useState)("");
|
|
18081
|
+
const transaction = (0, import_react26.useMemo)(() => {
|
|
18286
18082
|
const reg = /^0x[a-fA-F0-9]{40}$/;
|
|
18287
18083
|
if (!amount || !address || !reg.test(address)) {
|
|
18288
18084
|
return;
|
|
@@ -18313,7 +18109,7 @@ function TokenSend({
|
|
|
18313
18109
|
setLoading(false);
|
|
18314
18110
|
}
|
|
18315
18111
|
};
|
|
18316
|
-
const error = (0,
|
|
18112
|
+
const error = (0, import_react26.useMemo)(() => {
|
|
18317
18113
|
setTxError("");
|
|
18318
18114
|
let amountError = "";
|
|
18319
18115
|
let addressError = "";
|
|
@@ -18356,7 +18152,7 @@ function TokenSend({
|
|
|
18356
18152
|
setAmount(value2);
|
|
18357
18153
|
}
|
|
18358
18154
|
};
|
|
18359
|
-
const canSend = (0,
|
|
18155
|
+
const canSend = (0, import_react26.useMemo)(() => {
|
|
18360
18156
|
return !error.amount && !error.address && amount && address;
|
|
18361
18157
|
}, [error]);
|
|
18362
18158
|
const onNext = async () => {
|
|
@@ -18366,7 +18162,7 @@ function TokenSend({
|
|
|
18366
18162
|
}
|
|
18367
18163
|
onClose();
|
|
18368
18164
|
};
|
|
18369
|
-
(0,
|
|
18165
|
+
(0, import_react26.useEffect)(() => {
|
|
18370
18166
|
const receiveMessage = (event) => {
|
|
18371
18167
|
if (event.data) {
|
|
18372
18168
|
if (event.data.source == "match-wallet") {
|
|
@@ -18382,24 +18178,24 @@ function TokenSend({
|
|
|
18382
18178
|
window.removeEventListener("message", receiveMessage);
|
|
18383
18179
|
};
|
|
18384
18180
|
}, []);
|
|
18385
|
-
return /* @__PURE__ */ (0,
|
|
18386
|
-
/* @__PURE__ */ (0,
|
|
18387
|
-
/* @__PURE__ */ (0,
|
|
18388
|
-
/* @__PURE__ */ (0,
|
|
18389
|
-
/* @__PURE__ */ (0,
|
|
18390
|
-
/* @__PURE__ */ (0,
|
|
18391
|
-
token.icon ? /* @__PURE__ */ (0,
|
|
18181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(ModalDrawer, { isOpen: true, onClose, zIndex, title: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react_intl15.FormattedMessage, { id: "send" }), onBack, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `matchid-token-send-box`, children: [
|
|
18182
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "matchid-token-send-content", children: [
|
|
18183
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `matchid-token-amount-content`, children: [
|
|
18184
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `matchid-token-amount-header`, children: [
|
|
18185
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: `matchid-token-amount-title`, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react_intl15.FormattedMessage, { id: "amount" }) }),
|
|
18186
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `matchid-token-amount-chain`, children: [
|
|
18187
|
+
token.icon ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
18392
18188
|
"img",
|
|
18393
18189
|
{
|
|
18394
18190
|
src: token?.icon,
|
|
18395
18191
|
alt: token?.symbol,
|
|
18396
18192
|
className: `matchid-token-amount-chain-icon`
|
|
18397
18193
|
}
|
|
18398
|
-
) : /* @__PURE__ */ (0,
|
|
18399
|
-
/* @__PURE__ */ (0,
|
|
18194
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(AlphaAvatar, { name: token.symbol || token.name || "", size: 16 }),
|
|
18195
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { children: token?.symbol })
|
|
18400
18196
|
] })
|
|
18401
18197
|
] }),
|
|
18402
|
-
/* @__PURE__ */ (0,
|
|
18198
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
18403
18199
|
Input2,
|
|
18404
18200
|
{
|
|
18405
18201
|
type: "text",
|
|
@@ -18412,18 +18208,18 @@ function TokenSend({
|
|
|
18412
18208
|
error: error.amount || txError
|
|
18413
18209
|
}
|
|
18414
18210
|
),
|
|
18415
|
-
/* @__PURE__ */ (0,
|
|
18416
|
-
/* @__PURE__ */ (0,
|
|
18417
|
-
/* @__PURE__ */ (0,
|
|
18211
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `matchid-token-amount-footer`, children: [
|
|
18212
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `matchid-token-amount-title`, children: [
|
|
18213
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react_intl15.FormattedMessage, { id: "balance" }),
|
|
18418
18214
|
":"
|
|
18419
18215
|
] }),
|
|
18420
|
-
/* @__PURE__ */ (0,
|
|
18216
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: `matchid-token-amount-value`, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(NumberFormatter, { value: token.balance, tFixNum: 10, suffix: " " + token.symbol }) })
|
|
18421
18217
|
] }),
|
|
18422
|
-
/* @__PURE__ */ (0,
|
|
18218
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(TransferIcon, { className: "matchid-token-amount-transfer" })
|
|
18423
18219
|
] }),
|
|
18424
|
-
/* @__PURE__ */ (0,
|
|
18425
|
-
/* @__PURE__ */ (0,
|
|
18426
|
-
/* @__PURE__ */ (0,
|
|
18220
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `matchid-token-address-content`, children: [
|
|
18221
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: `matchid-token-address-header`, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: `matchid-token-address-title`, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react_intl15.FormattedMessage, { id: "receiveTitle" }) }) }),
|
|
18222
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
18427
18223
|
Input2,
|
|
18428
18224
|
{
|
|
18429
18225
|
type: "text",
|
|
@@ -18439,7 +18235,7 @@ function TokenSend({
|
|
|
18439
18235
|
)
|
|
18440
18236
|
] })
|
|
18441
18237
|
] }),
|
|
18442
|
-
/* @__PURE__ */ (0,
|
|
18238
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
18443
18239
|
Button,
|
|
18444
18240
|
{
|
|
18445
18241
|
size: "lg",
|
|
@@ -18448,7 +18244,7 @@ function TokenSend({
|
|
|
18448
18244
|
disabled: !canSend || !!txError,
|
|
18449
18245
|
onClick: onNext,
|
|
18450
18246
|
loading: loading || sending,
|
|
18451
|
-
children: /* @__PURE__ */ (0,
|
|
18247
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react_intl15.FormattedMessage, { id: "next" })
|
|
18452
18248
|
}
|
|
18453
18249
|
)
|
|
18454
18250
|
] }) });
|
|
@@ -18456,12 +18252,12 @@ function TokenSend({
|
|
|
18456
18252
|
|
|
18457
18253
|
// src/components/TokenDetail/index.tsx
|
|
18458
18254
|
var import_react_intl16 = require("react-intl");
|
|
18459
|
-
var
|
|
18255
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
18460
18256
|
|
|
18461
18257
|
// src/components/TokenSendList/index.tsx
|
|
18462
|
-
var
|
|
18258
|
+
var import_react27 = require("react");
|
|
18463
18259
|
var import_react_intl17 = require("react-intl");
|
|
18464
|
-
var
|
|
18260
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
18465
18261
|
function TokenSendList({ close }) {
|
|
18466
18262
|
const isDownMd = useDownMd();
|
|
18467
18263
|
const walletAssets = useMatchWalletAssets();
|
|
@@ -18469,20 +18265,20 @@ function TokenSendList({ close }) {
|
|
|
18469
18265
|
list: walletAssets.mergedAssets
|
|
18470
18266
|
});
|
|
18471
18267
|
const { list } = useMatchChain();
|
|
18472
|
-
const [checked, setChecked] = (0,
|
|
18268
|
+
const [checked, setChecked] = (0, import_react27.useState)();
|
|
18473
18269
|
const modal = useModal();
|
|
18474
18270
|
const onNext = () => {
|
|
18475
18271
|
checked && modal.show((props) => {
|
|
18476
|
-
return /* @__PURE__ */ (0,
|
|
18272
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(TokenSend, { onClose: () => {
|
|
18477
18273
|
props.close();
|
|
18478
18274
|
close();
|
|
18479
18275
|
}, onBack: props.close, zIndex: props.zIndex, token: checked });
|
|
18480
18276
|
});
|
|
18481
18277
|
};
|
|
18482
|
-
return /* @__PURE__ */ (0,
|
|
18483
|
-
/* @__PURE__ */ (0,
|
|
18278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "matchid-token-send-list-box", children: [
|
|
18279
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "matchid-token-send-list", children: matchWalletAssetList.list.map((n, index2) => {
|
|
18484
18280
|
const chain = list?.find((m) => m.id.toString() === n.chain_id);
|
|
18485
|
-
return /* @__PURE__ */ (0,
|
|
18281
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
18486
18282
|
"div",
|
|
18487
18283
|
{
|
|
18488
18284
|
className: `matchid-token-send-item ${checked?.address == n.address ? "matchid-token-send-chekced" : ""}`,
|
|
@@ -18490,10 +18286,10 @@ function TokenSendList({ close }) {
|
|
|
18490
18286
|
setChecked(n);
|
|
18491
18287
|
},
|
|
18492
18288
|
children: [
|
|
18493
|
-
/* @__PURE__ */ (0,
|
|
18494
|
-
/* @__PURE__ */ (0,
|
|
18495
|
-
/* @__PURE__ */ (0,
|
|
18496
|
-
n.icon ? /* @__PURE__ */ (0,
|
|
18289
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Radio, { checked: checked?.address == n.address, size: isDownMd ? 18 : 24 }),
|
|
18290
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "matchid-token-send-content", children: [
|
|
18291
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "matchid-token-send-logo", children: [
|
|
18292
|
+
n.icon ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("img", { src: n.icon, alt: n.symbol, className: `matchid-token-send-icon` }) : /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
18497
18293
|
AlphaAvatar2,
|
|
18498
18294
|
{
|
|
18499
18295
|
className: `matchid-token-send-icon`,
|
|
@@ -18501,7 +18297,7 @@ function TokenSendList({ close }) {
|
|
|
18501
18297
|
name: n.symbol || n.name || ""
|
|
18502
18298
|
}
|
|
18503
18299
|
),
|
|
18504
|
-
chain?.iconUrl && /* @__PURE__ */ (0,
|
|
18300
|
+
chain?.iconUrl && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
18505
18301
|
"img",
|
|
18506
18302
|
{
|
|
18507
18303
|
src: chain.iconUrl,
|
|
@@ -18510,9 +18306,9 @@ function TokenSendList({ close }) {
|
|
|
18510
18306
|
}
|
|
18511
18307
|
)
|
|
18512
18308
|
] }),
|
|
18513
|
-
/* @__PURE__ */ (0,
|
|
18514
|
-
/* @__PURE__ */ (0,
|
|
18515
|
-
/* @__PURE__ */ (0,
|
|
18309
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: `matchid-token-send-info`, children: [
|
|
18310
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: `matchid-token-send-name`, children: n.symbol }),
|
|
18311
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: `matchid-token-send-balance`, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(NumberFormatter, { value: n.balance, tFixNum: 3 }) })
|
|
18516
18312
|
] })
|
|
18517
18313
|
] })
|
|
18518
18314
|
]
|
|
@@ -18520,13 +18316,13 @@ function TokenSendList({ close }) {
|
|
|
18520
18316
|
index2
|
|
18521
18317
|
);
|
|
18522
18318
|
}) }),
|
|
18523
|
-
/* @__PURE__ */ (0,
|
|
18319
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Button, { size: "lg", highlight: true, block: true, disabled: !checked, onClick: onNext, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react_intl17.FormattedMessage, { id: "next" }) })
|
|
18524
18320
|
] });
|
|
18525
18321
|
}
|
|
18526
18322
|
|
|
18527
18323
|
// src/components/TransactionList/index.tsx
|
|
18528
18324
|
var import_react_infinite_scroll_component = __toESM(require("react-infinite-scroll-component"));
|
|
18529
|
-
var
|
|
18325
|
+
var import_react28 = require("react");
|
|
18530
18326
|
var import_viem3 = require("viem");
|
|
18531
18327
|
var import_viem4 = require("viem");
|
|
18532
18328
|
|
|
@@ -18588,12 +18384,12 @@ var useContractStore_default = useContractStore;
|
|
|
18588
18384
|
|
|
18589
18385
|
// src/components/TransactionList/index.tsx
|
|
18590
18386
|
var import_react_intl18 = require("react-intl");
|
|
18591
|
-
var
|
|
18387
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
18592
18388
|
|
|
18593
18389
|
// src/components/CEXBindModal/index.tsx
|
|
18594
|
-
var
|
|
18390
|
+
var import_react29 = require("react");
|
|
18595
18391
|
var import_react_intl19 = require("react-intl");
|
|
18596
|
-
var
|
|
18392
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
18597
18393
|
|
|
18598
18394
|
// src/context/BusinessProvider.tsx
|
|
18599
18395
|
var import_react_query3 = require("@tanstack/react-query");
|
|
@@ -18611,15 +18407,15 @@ var useStore = (0, import_zustand4.create)((set) => ({
|
|
|
18611
18407
|
var useStore_default = useStore;
|
|
18612
18408
|
|
|
18613
18409
|
// src/context/BusinessProvider.tsx
|
|
18614
|
-
var
|
|
18410
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
18615
18411
|
|
|
18616
18412
|
// src/context/ModalContext.tsx
|
|
18617
|
-
var
|
|
18413
|
+
var import_react30 = __toESM(require("react"));
|
|
18618
18414
|
var import_react_dom = require("react-dom");
|
|
18619
|
-
var
|
|
18620
|
-
var ModalContext = (0,
|
|
18415
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
18416
|
+
var ModalContext = (0, import_react30.createContext)(null);
|
|
18621
18417
|
function useModal() {
|
|
18622
|
-
const context = (0,
|
|
18418
|
+
const context = (0, import_react30.useContext)(ModalContext);
|
|
18623
18419
|
if (!context) {
|
|
18624
18420
|
throw new Error("useModal must be used within a ModalProvider");
|
|
18625
18421
|
}
|
|
@@ -18627,12 +18423,12 @@ function useModal() {
|
|
|
18627
18423
|
}
|
|
18628
18424
|
|
|
18629
18425
|
// src/context/ToastContext.tsx
|
|
18630
|
-
var
|
|
18426
|
+
var import_react31 = require("react");
|
|
18631
18427
|
var import_react_dom2 = require("react-dom");
|
|
18632
|
-
var
|
|
18633
|
-
var ToastContext = (0,
|
|
18428
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
18429
|
+
var ToastContext = (0, import_react31.createContext)(null);
|
|
18634
18430
|
function useToast() {
|
|
18635
|
-
const context = (0,
|
|
18431
|
+
const context = (0, import_react31.useContext)(ToastContext);
|
|
18636
18432
|
if (!context) {
|
|
18637
18433
|
throw new Error("useToast must be used within a ToastProvider");
|
|
18638
18434
|
}
|
|
@@ -18640,14 +18436,14 @@ function useToast() {
|
|
|
18640
18436
|
}
|
|
18641
18437
|
|
|
18642
18438
|
// src/context/index.tsx
|
|
18643
|
-
var
|
|
18439
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
18644
18440
|
|
|
18645
18441
|
// src/hooks/useWalletInit.ts
|
|
18646
|
-
var
|
|
18442
|
+
var import_react32 = require("react");
|
|
18647
18443
|
var AppClientId = getAppClientId();
|
|
18648
18444
|
|
|
18649
18445
|
// src/hooks/useInit.tsx
|
|
18650
|
-
var
|
|
18446
|
+
var import_react33 = require("react");
|
|
18651
18447
|
|
|
18652
18448
|
// src/MatchContext.tsx
|
|
18653
18449
|
var import_react_query4 = require("@tanstack/react-query");
|
|
@@ -18720,7 +18516,7 @@ var matchTest = /* @__PURE__ */ (0, import_viem6.defineChain)({
|
|
|
18720
18516
|
|
|
18721
18517
|
// src/MatchContext.tsx
|
|
18722
18518
|
var import_wagmi3 = require("wagmi");
|
|
18723
|
-
var
|
|
18519
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
18724
18520
|
var queryClient = new import_react_query4.QueryClient();
|
|
18725
18521
|
var wagmiConfig = (0, import_rainbowkit2.getDefaultConfig)({
|
|
18726
18522
|
appName: "MatchID",
|
|
@@ -18739,9 +18535,9 @@ var wagmiConfig = (0, import_rainbowkit2.getDefaultConfig)({
|
|
|
18739
18535
|
],
|
|
18740
18536
|
chains: [import_chains.mainnet, import_chains.polygon, import_chains.optimism, import_chains.arbitrum, import_chains.base, matchMain, matchTest, import_chains.bsc]
|
|
18741
18537
|
});
|
|
18742
|
-
var MatchContext = (0,
|
|
18538
|
+
var MatchContext = (0, import_react34.createContext)(void 0);
|
|
18743
18539
|
var useMatch = () => {
|
|
18744
|
-
const context = (0,
|
|
18540
|
+
const context = (0, import_react34.useContext)(MatchContext);
|
|
18745
18541
|
if (context === void 0) {
|
|
18746
18542
|
throw new Error("useMatch must be used within a MatchProvider");
|
|
18747
18543
|
}
|
|
@@ -18775,7 +18571,7 @@ function useUserInfo() {
|
|
|
18775
18571
|
const getRedirectUri = () => {
|
|
18776
18572
|
return encodeURIComponent(window.location.href);
|
|
18777
18573
|
};
|
|
18778
|
-
const isLogin = (0,
|
|
18574
|
+
const isLogin = (0, import_react35.useMemo)(() => !!token && !!overview, [token, overview]);
|
|
18779
18575
|
const logout = async () => {
|
|
18780
18576
|
try {
|
|
18781
18577
|
await toLogoutApi();
|
|
@@ -19046,9 +18842,9 @@ function useUserInfo() {
|
|
|
19046
18842
|
}
|
|
19047
18843
|
|
|
19048
18844
|
// src/hooks/useMatchEvents.ts
|
|
19049
|
-
var
|
|
18845
|
+
var import_react36 = require("react");
|
|
19050
18846
|
function useMatchEvents(handlers) {
|
|
19051
|
-
(0,
|
|
18847
|
+
(0, import_react36.useEffect)(() => {
|
|
19052
18848
|
Object.entries(handlers).forEach(([event, handler2]) => {
|
|
19053
18849
|
if (handler2) {
|
|
19054
18850
|
eventManager_default.on(event, handler2);
|
|
@@ -19068,7 +18864,7 @@ function useMatchEvents(handlers) {
|
|
|
19068
18864
|
var import_viem7 = require("viem");
|
|
19069
18865
|
var import_accounts = require("viem/accounts");
|
|
19070
18866
|
var import_viem8 = require("viem");
|
|
19071
|
-
var
|
|
18867
|
+
var import_react37 = require("react");
|
|
19072
18868
|
var import_viem9 = require("viem");
|
|
19073
18869
|
|
|
19074
18870
|
// src/store/useTransactionStore.ts
|
|
@@ -19102,7 +18898,7 @@ var useTransactionStore = (0, import_zustand5.create)((0, import_middleware3.dev
|
|
|
19102
18898
|
var useTransactionStore_default = useTransactionStore;
|
|
19103
18899
|
|
|
19104
18900
|
// src/hooks/useWallet.tsx
|
|
19105
|
-
var
|
|
18901
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
19106
18902
|
var AppClientId2 = "react-sdk-" + getVersion();
|
|
19107
18903
|
function useWallet() {
|
|
19108
18904
|
const { address, wallet: walletConfig } = useLocalStore_default();
|
|
@@ -19153,7 +18949,7 @@ function useWallet() {
|
|
|
19153
18949
|
throw error;
|
|
19154
18950
|
}
|
|
19155
18951
|
};
|
|
19156
|
-
const evmAccount = (0,
|
|
18952
|
+
const evmAccount = (0, import_react37.useMemo)(() => {
|
|
19157
18953
|
try {
|
|
19158
18954
|
return address ? (0, import_accounts.toAccount)({
|
|
19159
18955
|
address,
|
|
@@ -19192,7 +18988,7 @@ function useWallet() {
|
|
|
19192
18988
|
return void 0;
|
|
19193
18989
|
}
|
|
19194
18990
|
}, [address]);
|
|
19195
|
-
(0,
|
|
18991
|
+
(0, import_react37.useEffect)(() => {
|
|
19196
18992
|
matchlog_default.log("qwe-evmAccount", evmAccount);
|
|
19197
18993
|
}, [evmAccount]);
|
|
19198
18994
|
const realCreateWalletClient = (parameters) => {
|
|
@@ -19276,12 +19072,12 @@ function useWallet() {
|
|
|
19276
19072
|
address: evmAccount.address
|
|
19277
19073
|
});
|
|
19278
19074
|
modal.show((props) => {
|
|
19279
|
-
return /* @__PURE__ */ (0,
|
|
19075
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(HashPanel_default, { isOpen: true, onClose: props.close, zIndex: props.zIndex, hash: txHash, chain: _chain });
|
|
19280
19076
|
});
|
|
19281
19077
|
return txHash;
|
|
19282
19078
|
} catch (error) {
|
|
19283
19079
|
modal.show((props) => {
|
|
19284
|
-
return /* @__PURE__ */ (0,
|
|
19080
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(HashPanel_default, { isOpen: true, onClose: props.close, zIndex: props.zIndex, error: typeof error == "string" ? error : error.details || error.message, chain: _chain });
|
|
19285
19081
|
});
|
|
19286
19082
|
throw error;
|
|
19287
19083
|
}
|
|
@@ -19335,14 +19131,14 @@ function useWallet() {
|
|
|
19335
19131
|
|
|
19336
19132
|
// src/hooks/useCopyClipboard.ts
|
|
19337
19133
|
var import_copy_to_clipboard = __toESM(require("copy-to-clipboard"));
|
|
19338
|
-
var
|
|
19134
|
+
var import_react38 = require("react");
|
|
19339
19135
|
function useCopyClipboard(timeout = 500) {
|
|
19340
|
-
const [isCopied, setIsCopied] = (0,
|
|
19341
|
-
const staticCopy = (0,
|
|
19136
|
+
const [isCopied, setIsCopied] = (0, import_react38.useState)(false);
|
|
19137
|
+
const staticCopy = (0, import_react38.useCallback)((text2) => {
|
|
19342
19138
|
const didCopy = (0, import_copy_to_clipboard.default)(text2);
|
|
19343
19139
|
setIsCopied(didCopy);
|
|
19344
19140
|
}, []);
|
|
19345
|
-
(0,
|
|
19141
|
+
(0, import_react38.useEffect)(() => {
|
|
19346
19142
|
if (isCopied) {
|
|
19347
19143
|
const hide = setTimeout(() => {
|
|
19348
19144
|
setIsCopied(false);
|
|
@@ -19412,16 +19208,16 @@ function useImportTokenListQuery({
|
|
|
19412
19208
|
}
|
|
19413
19209
|
|
|
19414
19210
|
// src/hooks/useMatchChain.tsx
|
|
19415
|
-
var
|
|
19211
|
+
var import_react39 = require("react");
|
|
19416
19212
|
var import_viem10 = require("viem");
|
|
19417
19213
|
var import_react_intl21 = require("react-intl");
|
|
19418
|
-
var
|
|
19214
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
19419
19215
|
function useMatchChain() {
|
|
19420
19216
|
const chainListQuery = useChainListQuery();
|
|
19421
19217
|
const modal = useModal();
|
|
19422
19218
|
const intl = (0, import_react_intl21.useIntl)();
|
|
19423
19219
|
const { chainId: storeChainId, setChainId } = useLocalStore_default();
|
|
19424
|
-
const chainId = (0,
|
|
19220
|
+
const chainId = (0, import_react39.useMemo)(() => {
|
|
19425
19221
|
if (!chainListQuery.data || !chainListQuery.data.length) {
|
|
19426
19222
|
return null;
|
|
19427
19223
|
}
|
|
@@ -19430,7 +19226,7 @@ function useMatchChain() {
|
|
|
19430
19226
|
}
|
|
19431
19227
|
return chainListQuery.data[0].id;
|
|
19432
19228
|
}, [storeChainId, chainListQuery.data]);
|
|
19433
|
-
const chain = (0,
|
|
19229
|
+
const chain = (0, import_react39.useMemo)(() => {
|
|
19434
19230
|
if (!chainListQuery.data || !chainListQuery.data.length) {
|
|
19435
19231
|
return null;
|
|
19436
19232
|
}
|
|
@@ -19444,30 +19240,30 @@ function useMatchChain() {
|
|
|
19444
19240
|
close
|
|
19445
19241
|
}) {
|
|
19446
19242
|
const { chainId: storeChainId2, setChainId: setChainId2 } = useLocalStore_default();
|
|
19447
|
-
const [selectedChainId, setSelectedChainId] = (0,
|
|
19243
|
+
const [selectedChainId, setSelectedChainId] = (0, import_react39.useState)(storeChainId2);
|
|
19448
19244
|
const isDownMd = useDownMd();
|
|
19449
|
-
return /* @__PURE__ */ (0,
|
|
19450
|
-
/* @__PURE__ */ (0,
|
|
19451
|
-
return /* @__PURE__ */ (0,
|
|
19245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: `matchid-change-network-box`, children: [
|
|
19246
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: `matchid-change-network-list`, children: chainListQuery.data?.map((item, index2) => {
|
|
19247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
|
|
19452
19248
|
"div",
|
|
19453
19249
|
{
|
|
19454
19250
|
onClick: () => setSelectedChainId(item.id),
|
|
19455
19251
|
className: `matchid-change-network-item ${selectedChainId == item.id ? "matchid-change-network-selected" : ""}`,
|
|
19456
19252
|
children: [
|
|
19457
|
-
/* @__PURE__ */ (0,
|
|
19458
|
-
/* @__PURE__ */ (0,
|
|
19459
|
-
/* @__PURE__ */ (0,
|
|
19253
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: `matchid-change-network-item-content`, children: [
|
|
19254
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("img", { src: item.iconUrl, className: `matchid-change-network-item-icon` }),
|
|
19255
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: "matchid-change-network-item-name", children: item.name })
|
|
19460
19256
|
] }),
|
|
19461
|
-
/* @__PURE__ */ (0,
|
|
19257
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Radio, { checked: selectedChainId === item.id, size: isDownMd ? 18 : 24 })
|
|
19462
19258
|
]
|
|
19463
19259
|
},
|
|
19464
19260
|
index2
|
|
19465
19261
|
);
|
|
19466
19262
|
}) }),
|
|
19467
|
-
/* @__PURE__ */ (0,
|
|
19263
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Button, { size: "lg", highlight: true, onClick: () => {
|
|
19468
19264
|
setChainId2(selectedChainId || 0);
|
|
19469
19265
|
close();
|
|
19470
|
-
}, block: true, children: /* @__PURE__ */ (0,
|
|
19266
|
+
}, block: true, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_react_intl21.FormattedMessage, { id: "confirm" }) })
|
|
19471
19267
|
] });
|
|
19472
19268
|
}
|
|
19473
19269
|
const showChangeNetwork = () => {
|
|
@@ -19476,7 +19272,7 @@ function useMatchChain() {
|
|
|
19476
19272
|
content: ChangeNetwork
|
|
19477
19273
|
});
|
|
19478
19274
|
};
|
|
19479
|
-
const publicClient = (0,
|
|
19275
|
+
const publicClient = (0, import_react39.useMemo)(() => {
|
|
19480
19276
|
if (!chain) {
|
|
19481
19277
|
return null;
|
|
19482
19278
|
}
|
|
@@ -19504,13 +19300,13 @@ function useMatchChain() {
|
|
|
19504
19300
|
|
|
19505
19301
|
// src/hooks/useMatchWallet.tsx
|
|
19506
19302
|
var import_react_qrcode = require("react-qrcode");
|
|
19507
|
-
var
|
|
19303
|
+
var import_react41 = require("react");
|
|
19508
19304
|
var import_react_query8 = require("@tanstack/react-query");
|
|
19509
19305
|
var import_viem13 = require("viem");
|
|
19510
19306
|
var import_react_intl23 = require("react-intl");
|
|
19511
19307
|
|
|
19512
19308
|
// src/components/ImportToken/index.tsx
|
|
19513
|
-
var
|
|
19309
|
+
var import_react40 = require("react");
|
|
19514
19310
|
var import_react_intl22 = require("react-intl");
|
|
19515
19311
|
var import_react_query7 = require("@tanstack/react-query");
|
|
19516
19312
|
var import_viem12 = require("viem");
|
|
@@ -19540,14 +19336,14 @@ function useIsContract({
|
|
|
19540
19336
|
}
|
|
19541
19337
|
|
|
19542
19338
|
// src/components/ImportToken/index.tsx
|
|
19543
|
-
var
|
|
19339
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
19544
19340
|
function ImportToken({ close }) {
|
|
19545
|
-
const [status, setStatus] = (0,
|
|
19341
|
+
const [status, setStatus] = (0, import_react40.useState)("");
|
|
19546
19342
|
const { token } = useUserInfo();
|
|
19547
|
-
const [address, setAddress] = (0,
|
|
19548
|
-
const [symbol, setSymbol] = (0,
|
|
19549
|
-
const [decimals, setDecimals] = (0,
|
|
19550
|
-
const [error, setError] = (0,
|
|
19343
|
+
const [address, setAddress] = (0, import_react40.useState)("");
|
|
19344
|
+
const [symbol, setSymbol] = (0, import_react40.useState)("");
|
|
19345
|
+
const [decimals, setDecimals] = (0, import_react40.useState)("");
|
|
19346
|
+
const [error, setError] = (0, import_react40.useState)({});
|
|
19551
19347
|
const { publicClient, chainId, chain } = useMatchChain();
|
|
19552
19348
|
const getContractInfo = async () => {
|
|
19553
19349
|
if (!publicClient) return;
|
|
@@ -19581,7 +19377,7 @@ function ImportToken({ close }) {
|
|
|
19581
19377
|
}
|
|
19582
19378
|
};
|
|
19583
19379
|
const intl = (0, import_react_intl22.useIntl)();
|
|
19584
|
-
(0,
|
|
19380
|
+
(0, import_react40.useEffect)(() => {
|
|
19585
19381
|
if (address.length === 42) {
|
|
19586
19382
|
const reg = /^0x[0-9a-fA-F]{40}$/;
|
|
19587
19383
|
if (!reg.test(address)) {
|
|
@@ -19600,7 +19396,7 @@ function ImportToken({ close }) {
|
|
|
19600
19396
|
}
|
|
19601
19397
|
}
|
|
19602
19398
|
}, [address, publicClient]);
|
|
19603
|
-
const [loading, setLoading] = (0,
|
|
19399
|
+
const [loading, setLoading] = (0, import_react40.useState)(false);
|
|
19604
19400
|
const toast = useToast();
|
|
19605
19401
|
const queryClient2 = (0, import_react_query7.useQueryClient)();
|
|
19606
19402
|
const onImport = async () => {
|
|
@@ -19628,7 +19424,7 @@ function ImportToken({ close }) {
|
|
|
19628
19424
|
setLoading(false);
|
|
19629
19425
|
}
|
|
19630
19426
|
};
|
|
19631
|
-
const canImport = (0,
|
|
19427
|
+
const canImport = (0, import_react40.useMemo)(() => {
|
|
19632
19428
|
if (!address) {
|
|
19633
19429
|
return false;
|
|
19634
19430
|
}
|
|
@@ -19651,22 +19447,22 @@ function ImportToken({ close }) {
|
|
|
19651
19447
|
enabled: canImport
|
|
19652
19448
|
});
|
|
19653
19449
|
if (status == "success" || status == "fail") {
|
|
19654
|
-
return /* @__PURE__ */ (0,
|
|
19655
|
-
/* @__PURE__ */ (0,
|
|
19656
|
-
/* @__PURE__ */ (0,
|
|
19450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: `matchid-import-token-result matchid-flex`, children: [
|
|
19451
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: `matchid-import-token-result-box matchid-flex`, children: [
|
|
19452
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: `matchid-import-token-result-img`, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Lottie_default, { animationData: status == "success" ? success_default : fail_default, style: {
|
|
19657
19453
|
width: "96px",
|
|
19658
19454
|
height: "96px"
|
|
19659
19455
|
} }) }),
|
|
19660
|
-
/* @__PURE__ */ (0,
|
|
19456
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: `matchid-import-token-result-text matchid-import-token-result-text-${status}`, children: status == "success" ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_react_intl22.FormattedMessage, { id: "importSuccess" }) : /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_react_intl22.FormattedMessage, { id: "importFail" }) })
|
|
19661
19457
|
] }),
|
|
19662
|
-
status == "success" ? /* @__PURE__ */ (0,
|
|
19458
|
+
status == "success" ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Button, { size: "lg", onClick: close, block: true, highlight: true, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_react_intl22.FormattedMessage, { id: "close" }) }) : /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Button, { size: "lg", onClick: () => setStatus(""), block: true, highlight: true, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_react_intl22.FormattedMessage, { id: "back" }) })
|
|
19663
19459
|
] });
|
|
19664
19460
|
}
|
|
19665
|
-
return /* @__PURE__ */ (0,
|
|
19666
|
-
/* @__PURE__ */ (0,
|
|
19667
|
-
/* @__PURE__ */ (0,
|
|
19461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: `matchid-import-token`, children: [
|
|
19462
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "matchid-import-token-form", children: [
|
|
19463
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Field, { label: intl.formatMessage({
|
|
19668
19464
|
id: "tokenSmartContract"
|
|
19669
|
-
}), error: error.address ? error.address : isContractQuery.isFetched && !isContractQuery.isLoading && !isContractQuery.data && canImport ? "Address isn't a contract address" : "", children: /* @__PURE__ */ (0,
|
|
19465
|
+
}), error: error.address ? error.address : isContractQuery.isFetched && !isContractQuery.isLoading && !isContractQuery.data && canImport ? "Address isn't a contract address" : "", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
19670
19466
|
Input,
|
|
19671
19467
|
{
|
|
19672
19468
|
placeholder: intl.formatMessage({
|
|
@@ -19677,9 +19473,9 @@ function ImportToken({ close }) {
|
|
|
19677
19473
|
maxLength: 42
|
|
19678
19474
|
}
|
|
19679
19475
|
) }),
|
|
19680
|
-
/* @__PURE__ */ (0,
|
|
19476
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Field, { label: intl.formatMessage({
|
|
19681
19477
|
id: "tokenSymbol"
|
|
19682
|
-
}), error: error.symbol, children: /* @__PURE__ */ (0,
|
|
19478
|
+
}), error: error.symbol, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
19683
19479
|
Input,
|
|
19684
19480
|
{
|
|
19685
19481
|
placeholder: intl.formatMessage({
|
|
@@ -19690,9 +19486,9 @@ function ImportToken({ close }) {
|
|
|
19690
19486
|
maxLength: 16
|
|
19691
19487
|
}
|
|
19692
19488
|
) }),
|
|
19693
|
-
/* @__PURE__ */ (0,
|
|
19489
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Field, { label: intl.formatMessage({
|
|
19694
19490
|
id: "tokenDecimals"
|
|
19695
|
-
}), error: error.decimals, children: /* @__PURE__ */ (0,
|
|
19491
|
+
}), error: error.decimals, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
19696
19492
|
Input,
|
|
19697
19493
|
{
|
|
19698
19494
|
placeholder: intl.formatMessage({
|
|
@@ -19704,7 +19500,7 @@ function ImportToken({ close }) {
|
|
|
19704
19500
|
}
|
|
19705
19501
|
) })
|
|
19706
19502
|
] }),
|
|
19707
|
-
/* @__PURE__ */ (0,
|
|
19503
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
19708
19504
|
Button,
|
|
19709
19505
|
{
|
|
19710
19506
|
size: "lg",
|
|
@@ -19713,14 +19509,14 @@ function ImportToken({ close }) {
|
|
|
19713
19509
|
loading: loading || isContractQuery.isLoading,
|
|
19714
19510
|
disabled: !canImport || !isContractQuery.data,
|
|
19715
19511
|
highlight: true,
|
|
19716
|
-
children: /* @__PURE__ */ (0,
|
|
19512
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_react_intl22.FormattedMessage, { id: "import" })
|
|
19717
19513
|
}
|
|
19718
19514
|
)
|
|
19719
19515
|
] });
|
|
19720
19516
|
}
|
|
19721
19517
|
|
|
19722
19518
|
// src/hooks/useMatchWallet.tsx
|
|
19723
|
-
var
|
|
19519
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
19724
19520
|
var ReceiveModal = () => {
|
|
19725
19521
|
const chain = useMatchChain();
|
|
19726
19522
|
const { address } = useWallet();
|
|
@@ -19734,10 +19530,10 @@ var ReceiveModal = () => {
|
|
|
19734
19530
|
}));
|
|
19735
19531
|
};
|
|
19736
19532
|
const chainLink = chain.explorerLink("address/" + address);
|
|
19737
|
-
return /* @__PURE__ */ (0,
|
|
19738
|
-
/* @__PURE__ */ (0,
|
|
19739
|
-
/* @__PURE__ */ (0,
|
|
19740
|
-
/* @__PURE__ */ (0,
|
|
19533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: `matchid-receive-modal`, children: [
|
|
19534
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: "matchid-receive-container", children: [
|
|
19535
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: `matchid-receive-text`, children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_react_intl23.FormattedMessage, { id: "receiveQrcode" }) }),
|
|
19536
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: `matchid-qr-container`, children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
19741
19537
|
import_react_qrcode.QRCode,
|
|
19742
19538
|
{
|
|
19743
19539
|
margin: "0",
|
|
@@ -19745,7 +19541,7 @@ var ReceiveModal = () => {
|
|
|
19745
19541
|
value: address
|
|
19746
19542
|
}
|
|
19747
19543
|
) }),
|
|
19748
|
-
/* @__PURE__ */ (0,
|
|
19544
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
19749
19545
|
"a",
|
|
19750
19546
|
{
|
|
19751
19547
|
href: chainLink,
|
|
@@ -19755,7 +19551,7 @@ var ReceiveModal = () => {
|
|
|
19755
19551
|
}
|
|
19756
19552
|
)
|
|
19757
19553
|
] }),
|
|
19758
|
-
/* @__PURE__ */ (0,
|
|
19554
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Button, { size: "lg", onClick: onCopy, block: true, highlight: true, disabled: copied, children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
19759
19555
|
import_react_intl23.FormattedMessage,
|
|
19760
19556
|
{
|
|
19761
19557
|
id: "copyAddress"
|
|
@@ -19797,12 +19593,12 @@ function useMatchWallet() {
|
|
|
19797
19593
|
};
|
|
19798
19594
|
}
|
|
19799
19595
|
function useMatchWalletRecords() {
|
|
19800
|
-
const [hasMore, setHasMore] = (0,
|
|
19801
|
-
const [items, setItems] = (0,
|
|
19596
|
+
const [hasMore, setHasMore] = (0, import_react41.useState)(true);
|
|
19597
|
+
const [items, setItems] = (0, import_react41.useState)([]);
|
|
19802
19598
|
const { chainId, publicClient } = useMatchChain();
|
|
19803
19599
|
const { address } = useWallet();
|
|
19804
|
-
const hasMoreRef = (0,
|
|
19805
|
-
const nextPageParamsRef = (0,
|
|
19600
|
+
const hasMoreRef = (0, import_react41.useRef)(hasMore);
|
|
19601
|
+
const nextPageParamsRef = (0, import_react41.useRef)(void 0);
|
|
19806
19602
|
const { contracts, setContracts } = useContractStore_default();
|
|
19807
19603
|
const fetchMoreData = async () => {
|
|
19808
19604
|
const chainIdStr = chainId ? chainId.toString() : "";
|
|
@@ -19829,7 +19625,7 @@ function useMatchWalletRecords() {
|
|
|
19829
19625
|
hasMoreRef.current = true;
|
|
19830
19626
|
fetchMoreData();
|
|
19831
19627
|
};
|
|
19832
|
-
(0,
|
|
19628
|
+
(0, import_react41.useEffect)(() => {
|
|
19833
19629
|
if (chainId && address) {
|
|
19834
19630
|
onInit();
|
|
19835
19631
|
}
|
|
@@ -19885,7 +19681,7 @@ function useMatchWalletRecords() {
|
|
|
19885
19681
|
setContracts(contractMap);
|
|
19886
19682
|
}
|
|
19887
19683
|
};
|
|
19888
|
-
const list = (0,
|
|
19684
|
+
const list = (0, import_react41.useMemo)(() => {
|
|
19889
19685
|
const localTransactions = transactions[`${chainId}-${address}`] || [];
|
|
19890
19686
|
const removeList = localTransactions.filter((n) => items.findIndex((m) => m.hash == n.hash) >= 0);
|
|
19891
19687
|
removeList.forEach((item) => {
|
|
@@ -19927,7 +19723,7 @@ function useMatchWalletAssets({
|
|
|
19927
19723
|
chainId: chainId || 0,
|
|
19928
19724
|
...assetListOptions
|
|
19929
19725
|
});
|
|
19930
|
-
const mergedAssets = (0,
|
|
19726
|
+
const mergedAssets = (0, import_react41.useMemo)(() => {
|
|
19931
19727
|
if (!assetListQuery.data && !importTokenQuery.data) return [];
|
|
19932
19728
|
const assetList = (assetListQuery.data || []).map((asset) => ({
|
|
19933
19729
|
...asset,
|
|
@@ -20014,7 +19810,7 @@ function useMatchWalletAssetList({
|
|
|
20014
19810
|
retry: 3
|
|
20015
19811
|
// Retry up to 3 times if failed
|
|
20016
19812
|
});
|
|
20017
|
-
const erc20Tokens = (0,
|
|
19813
|
+
const erc20Tokens = (0, import_react41.useMemo)(() => list.filter((asset) => asset.address !== NATIVE_TOKEN_ADDRESS), [list]);
|
|
20018
19814
|
const erc20BalanceQuery = (0, import_react_query8.useQuery)({
|
|
20019
19815
|
queryKey: ["erc20Balances", erc20Tokens.map((token) => token.address)],
|
|
20020
19816
|
queryFn: async () => {
|
|
@@ -20042,7 +19838,7 @@ function useMatchWalletAssetList({
|
|
|
20042
19838
|
// Refresh every 15 seconds
|
|
20043
19839
|
retry: 3
|
|
20044
19840
|
});
|
|
20045
|
-
const enrichedAssets = (0,
|
|
19841
|
+
const enrichedAssets = (0, import_react41.useMemo)(() => {
|
|
20046
19842
|
if (!list) return [];
|
|
20047
19843
|
const erc20Balances = erc20BalanceQuery.data || [];
|
|
20048
19844
|
return list.map((asset) => {
|
|
@@ -20064,7 +19860,7 @@ function useMatchWalletAssetList({
|
|
|
20064
19860
|
return { ...asset, balance, value: value2, balanceValue };
|
|
20065
19861
|
});
|
|
20066
19862
|
}, [list, nativeBalanceQuery.data, erc20BalanceQuery.data]);
|
|
20067
|
-
(0,
|
|
19863
|
+
(0, import_react41.useEffect)(() => {
|
|
20068
19864
|
const list2 = enrichedAssets.sort((a, b) => {
|
|
20069
19865
|
if (a.address === NATIVE_TOKEN_ADDRESS) return -1;
|
|
20070
19866
|
if (b.address === NATIVE_TOKEN_ADDRESS) return 1;
|
|
@@ -20089,14 +19885,14 @@ function useMatchWalletAssetList({
|
|
|
20089
19885
|
}
|
|
20090
19886
|
|
|
20091
19887
|
// src/hooks/useReceipt.tsx
|
|
20092
|
-
var
|
|
19888
|
+
var import_react42 = require("react");
|
|
20093
19889
|
var import_react_query9 = require("@tanstack/react-query");
|
|
20094
19890
|
var import_viem14 = require("viem");
|
|
20095
19891
|
var CACHE_TTL = 86400 * 30 * 1e3;
|
|
20096
19892
|
var MAX_CACHE_SIZE = 500;
|
|
20097
19893
|
var STORAGE_KEY = "match_receipt_logs";
|
|
20098
19894
|
function useReceiptCache() {
|
|
20099
|
-
const [cache, setCache] = (0,
|
|
19895
|
+
const [cache, setCache] = (0, import_react42.useState)(/* @__PURE__ */ new Map());
|
|
20100
19896
|
const isLocalStorageAvailable = (() => {
|
|
20101
19897
|
try {
|
|
20102
19898
|
const testKey = "__test__";
|
|
@@ -20107,7 +19903,7 @@ function useReceiptCache() {
|
|
|
20107
19903
|
return false;
|
|
20108
19904
|
}
|
|
20109
19905
|
})();
|
|
20110
|
-
(0,
|
|
19906
|
+
(0, import_react42.useEffect)(() => {
|
|
20111
19907
|
if (isLocalStorageAvailable) {
|
|
20112
19908
|
try {
|
|
20113
19909
|
const storedData = localStorage.getItem(STORAGE_KEY);
|
|
@@ -20126,7 +19922,7 @@ function useReceiptCache() {
|
|
|
20126
19922
|
}
|
|
20127
19923
|
}
|
|
20128
19924
|
}, []);
|
|
20129
|
-
const updateLocalStorage = (0,
|
|
19925
|
+
const updateLocalStorage = (0, import_react42.useCallback)((updatedCache) => {
|
|
20130
19926
|
if (isLocalStorageAvailable) {
|
|
20131
19927
|
try {
|
|
20132
19928
|
const storedData = localStorage.getItem(STORAGE_KEY);
|
|
@@ -20143,7 +19939,7 @@ function useReceiptCache() {
|
|
|
20143
19939
|
}
|
|
20144
19940
|
}
|
|
20145
19941
|
}, []);
|
|
20146
|
-
const set = (0,
|
|
19942
|
+
const set = (0, import_react42.useCallback)((key2, value2) => {
|
|
20147
19943
|
const now = Date.now();
|
|
20148
19944
|
const newCache = new Map(cache);
|
|
20149
19945
|
newCache.forEach((entry, k) => {
|
|
@@ -20161,7 +19957,7 @@ function useReceiptCache() {
|
|
|
20161
19957
|
setCache(newCache);
|
|
20162
19958
|
updateLocalStorage(newCache);
|
|
20163
19959
|
}, [cache, updateLocalStorage]);
|
|
20164
|
-
const get = (0,
|
|
19960
|
+
const get = (0, import_react42.useCallback)((key2) => {
|
|
20165
19961
|
const entry = cache.get(key2);
|
|
20166
19962
|
if (entry) {
|
|
20167
19963
|
if (Date.now() - entry.timestamp > CACHE_TTL) {
|
|
@@ -20175,7 +19971,7 @@ function useReceiptCache() {
|
|
|
20175
19971
|
}
|
|
20176
19972
|
return void 0;
|
|
20177
19973
|
}, [cache, updateLocalStorage]);
|
|
20178
|
-
const del = (0,
|
|
19974
|
+
const del = (0, import_react42.useCallback)((key2) => {
|
|
20179
19975
|
if (cache.has(key2)) {
|
|
20180
19976
|
const newCache = new Map(cache);
|
|
20181
19977
|
newCache.delete(key2);
|
|
@@ -20183,7 +19979,7 @@ function useReceiptCache() {
|
|
|
20183
19979
|
updateLocalStorage(newCache);
|
|
20184
19980
|
}
|
|
20185
19981
|
}, [cache, updateLocalStorage]);
|
|
20186
|
-
const clear = (0,
|
|
19982
|
+
const clear = (0, import_react42.useCallback)(() => {
|
|
20187
19983
|
setCache(/* @__PURE__ */ new Map());
|
|
20188
19984
|
if (isLocalStorageAvailable) {
|
|
20189
19985
|
localStorage.removeItem(STORAGE_KEY);
|
|
@@ -20198,7 +19994,7 @@ function useReceipt2({
|
|
|
20198
19994
|
const { list } = useMatchChain();
|
|
20199
19995
|
const cache = useReceiptCache();
|
|
20200
19996
|
const chain = list?.find((item) => item.id === chainId);
|
|
20201
|
-
const [shouldRefetch, setShouldRefetch] = (0,
|
|
19997
|
+
const [shouldRefetch, setShouldRefetch] = (0, import_react42.useState)(true);
|
|
20202
19998
|
const query = (0, import_react_query9.useQuery)({
|
|
20203
19999
|
queryKey: ["match-tx-receipt", hash, chain],
|
|
20204
20000
|
queryFn: async () => {
|
|
@@ -20224,7 +20020,7 @@ function useReceipt2({
|
|
|
20224
20020
|
},
|
|
20225
20021
|
refetchInterval: shouldRefetch ? 1e4 : false
|
|
20226
20022
|
});
|
|
20227
|
-
(0,
|
|
20023
|
+
(0, import_react42.useEffect)(() => {
|
|
20228
20024
|
if (query.data) {
|
|
20229
20025
|
setShouldRefetch(false);
|
|
20230
20026
|
}
|
|
@@ -20233,14 +20029,14 @@ function useReceipt2({
|
|
|
20233
20029
|
}
|
|
20234
20030
|
|
|
20235
20031
|
// src/hooks/useTransaction.tsx
|
|
20236
|
-
var
|
|
20032
|
+
var import_react43 = require("react");
|
|
20237
20033
|
var import_react_query10 = require("@tanstack/react-query");
|
|
20238
20034
|
var import_viem15 = require("viem");
|
|
20239
20035
|
var CACHE_TTL2 = 86400 * 30 * 1e3;
|
|
20240
20036
|
var MAX_CACHE_SIZE2 = 500;
|
|
20241
20037
|
var STORAGE_KEY2 = "match_transaction_logs";
|
|
20242
20038
|
function useTransactionCache() {
|
|
20243
|
-
const [cache, setCache] = (0,
|
|
20039
|
+
const [cache, setCache] = (0, import_react43.useState)(/* @__PURE__ */ new Map());
|
|
20244
20040
|
const isLocalStorageAvailable = (() => {
|
|
20245
20041
|
try {
|
|
20246
20042
|
const testKey = "__test__";
|
|
@@ -20251,7 +20047,7 @@ function useTransactionCache() {
|
|
|
20251
20047
|
return false;
|
|
20252
20048
|
}
|
|
20253
20049
|
})();
|
|
20254
|
-
(0,
|
|
20050
|
+
(0, import_react43.useEffect)(() => {
|
|
20255
20051
|
if (isLocalStorageAvailable) {
|
|
20256
20052
|
try {
|
|
20257
20053
|
const storedData = localStorage.getItem(STORAGE_KEY2);
|
|
@@ -20270,7 +20066,7 @@ function useTransactionCache() {
|
|
|
20270
20066
|
}
|
|
20271
20067
|
}
|
|
20272
20068
|
}, []);
|
|
20273
|
-
const updateLocalStorage = (0,
|
|
20069
|
+
const updateLocalStorage = (0, import_react43.useCallback)((updatedCache) => {
|
|
20274
20070
|
if (isLocalStorageAvailable) {
|
|
20275
20071
|
try {
|
|
20276
20072
|
const storedData = localStorage.getItem(STORAGE_KEY2);
|
|
@@ -20287,7 +20083,7 @@ function useTransactionCache() {
|
|
|
20287
20083
|
}
|
|
20288
20084
|
}
|
|
20289
20085
|
}, []);
|
|
20290
|
-
const set = (0,
|
|
20086
|
+
const set = (0, import_react43.useCallback)((key2, value2) => {
|
|
20291
20087
|
const now = Date.now();
|
|
20292
20088
|
const newCache = new Map(cache);
|
|
20293
20089
|
newCache.forEach((entry, k) => {
|
|
@@ -20305,7 +20101,7 @@ function useTransactionCache() {
|
|
|
20305
20101
|
setCache(newCache);
|
|
20306
20102
|
updateLocalStorage(newCache);
|
|
20307
20103
|
}, [cache, updateLocalStorage]);
|
|
20308
|
-
const get = (0,
|
|
20104
|
+
const get = (0, import_react43.useCallback)((key2) => {
|
|
20309
20105
|
const entry = cache.get(key2);
|
|
20310
20106
|
if (entry) {
|
|
20311
20107
|
if (Date.now() - entry.timestamp > CACHE_TTL2) {
|
|
@@ -20319,7 +20115,7 @@ function useTransactionCache() {
|
|
|
20319
20115
|
}
|
|
20320
20116
|
return void 0;
|
|
20321
20117
|
}, [cache, updateLocalStorage]);
|
|
20322
|
-
const del = (0,
|
|
20118
|
+
const del = (0, import_react43.useCallback)((key2) => {
|
|
20323
20119
|
if (cache.has(key2)) {
|
|
20324
20120
|
const newCache = new Map(cache);
|
|
20325
20121
|
newCache.delete(key2);
|
|
@@ -20327,7 +20123,7 @@ function useTransactionCache() {
|
|
|
20327
20123
|
updateLocalStorage(newCache);
|
|
20328
20124
|
}
|
|
20329
20125
|
}, [cache, updateLocalStorage]);
|
|
20330
|
-
const clear = (0,
|
|
20126
|
+
const clear = (0, import_react43.useCallback)(() => {
|
|
20331
20127
|
setCache(/* @__PURE__ */ new Map());
|
|
20332
20128
|
if (isLocalStorageAvailable) {
|
|
20333
20129
|
localStorage.removeItem(STORAGE_KEY2);
|
|
@@ -20342,7 +20138,7 @@ function useTransaction({
|
|
|
20342
20138
|
const { list } = useMatchChain();
|
|
20343
20139
|
const cache = useTransactionCache();
|
|
20344
20140
|
const chain = list?.find((item) => item.id === chainId);
|
|
20345
|
-
const [shouldRefetch, setShouldRefetch] = (0,
|
|
20141
|
+
const [shouldRefetch, setShouldRefetch] = (0, import_react43.useState)(true);
|
|
20346
20142
|
const query = (0, import_react_query10.useQuery)({
|
|
20347
20143
|
queryKey: ["match-tx-transaction", hash, chain],
|
|
20348
20144
|
queryFn: async () => {
|
|
@@ -20368,7 +20164,7 @@ function useTransaction({
|
|
|
20368
20164
|
},
|
|
20369
20165
|
refetchInterval: shouldRefetch ? 1e4 : false
|
|
20370
20166
|
});
|
|
20371
|
-
(0,
|
|
20167
|
+
(0, import_react43.useEffect)(() => {
|
|
20372
20168
|
if (query.data) {
|
|
20373
20169
|
setShouldRefetch(false);
|
|
20374
20170
|
}
|
|
@@ -20403,8 +20199,5 @@ lottie-web/build/player/lottie.js:
|
|
|
20403
20199
|
Contributions by leeoniya.
|
|
20404
20200
|
License: MIT, header required.
|
|
20405
20201
|
*)
|
|
20406
|
-
|
|
20407
|
-
lottie-react/build/index.es.js:
|
|
20408
|
-
(*! goToAndStop must be relative to the start of the current segment *)
|
|
20409
20202
|
*/
|
|
20410
20203
|
//# sourceMappingURL=hooks.js.map
|