@tonconnect/ui-react 0.0.5 → 0.0.7
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/README.md +46 -0
- package/lib/components/TonConnectUIProvider.d.ts +24 -11
- package/lib/components/index.d.ts +2 -2
- package/lib/index.d.ts +1 -3
- package/lib/index.js +716 -460
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +717 -461
- package/lib/index.umd.js.map +1 -1
- package/lib/library.d.ts +3 -0
- package/package.json +6 -3
package/lib/index.umd.js
CHANGED
|
@@ -4747,11 +4747,16 @@ var __objRest = (source, exclude) => {
|
|
|
4747
4747
|
TonConnect.walletsList = new WalletsListManager();
|
|
4748
4748
|
TonConnect.isWalletInjected = (walletJSKey) => InjectedProvider.isWalletInjected(walletJSKey);
|
|
4749
4749
|
TonConnect.isInsideWalletBrowser = (walletJSKey) => InjectedProvider.isInsideWalletBrowser(walletJSKey);
|
|
4750
|
-
|
|
4750
|
+
const bounceableTag$1 = 17;
|
|
4751
|
+
const testOnlyTag$1 = 128;
|
|
4752
|
+
function toUserFriendlyAddress$1(hexAddress, testOnly = false) {
|
|
4751
4753
|
const { wc, hex } = parseHexAddress$1(hexAddress);
|
|
4752
|
-
|
|
4754
|
+
let tag = bounceableTag$1;
|
|
4755
|
+
if (testOnly) {
|
|
4756
|
+
tag |= testOnlyTag$1;
|
|
4757
|
+
}
|
|
4753
4758
|
const addr = new Int8Array(34);
|
|
4754
|
-
addr[0] =
|
|
4759
|
+
addr[0] = tag;
|
|
4755
4760
|
addr[1] = wc;
|
|
4756
4761
|
addr.set(hex, 2);
|
|
4757
4762
|
const addressWithChecksum = new Uint8Array(36);
|
|
@@ -4855,7 +4860,7 @@ var __objRest = (source, exclude) => {
|
|
|
4855
4860
|
let Effects = null;
|
|
4856
4861
|
let ExecCount = 0;
|
|
4857
4862
|
function createRoot(fn, detachedOwner) {
|
|
4858
|
-
const listener = Listener, owner = Owner, unowned = fn.length === 0, root = unowned
|
|
4863
|
+
const listener = Listener, owner = Owner, unowned = fn.length === 0, root = unowned ? UNOWNED : {
|
|
4859
4864
|
owned: null,
|
|
4860
4865
|
cleanups: null,
|
|
4861
4866
|
context: null,
|
|
@@ -4951,8 +4956,8 @@ var __objRest = (source, exclude) => {
|
|
|
4951
4956
|
runUpdates(() => {
|
|
4952
4957
|
if (!err)
|
|
4953
4958
|
setValue(() => v);
|
|
4954
|
-
setError(err);
|
|
4955
4959
|
setState(err ? "errored" : "ready");
|
|
4960
|
+
setError(err);
|
|
4956
4961
|
for (const c2 of contexts.keys())
|
|
4957
4962
|
c2.decrement();
|
|
4958
4963
|
contexts.clear();
|
|
@@ -4991,7 +4996,7 @@ var __objRest = (source, exclude) => {
|
|
|
4991
4996
|
refetching
|
|
4992
4997
|
}));
|
|
4993
4998
|
if (typeof p2 !== "object" || !(p2 && "then" in p2)) {
|
|
4994
|
-
loadEnd(pr, p2);
|
|
4999
|
+
loadEnd(pr, p2, void 0, lookup2);
|
|
4995
5000
|
return p2;
|
|
4996
5001
|
}
|
|
4997
5002
|
pr = p2;
|
|
@@ -5001,7 +5006,7 @@ var __objRest = (source, exclude) => {
|
|
|
5001
5006
|
setState(resolved ? "refreshing" : "pending");
|
|
5002
5007
|
trigger();
|
|
5003
5008
|
}, false);
|
|
5004
|
-
return p2.then((v) => loadEnd(p2, v, void 0, lookup2), (e2) => loadEnd(p2, void 0, castError(e2)));
|
|
5009
|
+
return p2.then((v) => loadEnd(p2, v, void 0, lookup2), (e2) => loadEnd(p2, void 0, castError(e2), lookup2));
|
|
5005
5010
|
}
|
|
5006
5011
|
Object.defineProperties(read, {
|
|
5007
5012
|
state: {
|
|
@@ -5040,11 +5045,13 @@ var __objRest = (source, exclude) => {
|
|
|
5040
5045
|
return runUpdates(fn, false);
|
|
5041
5046
|
}
|
|
5042
5047
|
function untrack(fn) {
|
|
5043
|
-
|
|
5048
|
+
const listener = Listener;
|
|
5044
5049
|
Listener = null;
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5050
|
+
try {
|
|
5051
|
+
return fn();
|
|
5052
|
+
} finally {
|
|
5053
|
+
Listener = listener;
|
|
5054
|
+
}
|
|
5048
5055
|
}
|
|
5049
5056
|
function on(deps, fn, options) {
|
|
5050
5057
|
const isArray = Array.isArray(deps);
|
|
@@ -5082,7 +5089,7 @@ var __objRest = (source, exclude) => {
|
|
|
5082
5089
|
function getListener() {
|
|
5083
5090
|
return Listener;
|
|
5084
5091
|
}
|
|
5085
|
-
function createContext(defaultValue) {
|
|
5092
|
+
function createContext(defaultValue, options) {
|
|
5086
5093
|
const id = Symbol("context");
|
|
5087
5094
|
return {
|
|
5088
5095
|
id,
|
|
@@ -5096,12 +5103,12 @@ var __objRest = (source, exclude) => {
|
|
|
5096
5103
|
}
|
|
5097
5104
|
function children(fn) {
|
|
5098
5105
|
const children2 = createMemo(fn);
|
|
5099
|
-
const
|
|
5100
|
-
|
|
5101
|
-
const c2 =
|
|
5106
|
+
const memo = createMemo(() => resolveChildren(children2()));
|
|
5107
|
+
memo.toArray = () => {
|
|
5108
|
+
const c2 = memo();
|
|
5102
5109
|
return Array.isArray(c2) ? c2 : c2 != null ? [c2] : [];
|
|
5103
5110
|
};
|
|
5104
|
-
return
|
|
5111
|
+
return memo;
|
|
5105
5112
|
}
|
|
5106
5113
|
let SuspenseContext;
|
|
5107
5114
|
function readSignal() {
|
|
@@ -5380,7 +5387,7 @@ var __objRest = (source, exclude) => {
|
|
|
5380
5387
|
}
|
|
5381
5388
|
return children2;
|
|
5382
5389
|
}
|
|
5383
|
-
function createProvider(id) {
|
|
5390
|
+
function createProvider(id, options) {
|
|
5384
5391
|
return function provider(props) {
|
|
5385
5392
|
let res;
|
|
5386
5393
|
createRenderEffect(() => res = untrack(() => {
|
|
@@ -5388,7 +5395,7 @@ var __objRest = (source, exclude) => {
|
|
|
5388
5395
|
[id]: props.value
|
|
5389
5396
|
};
|
|
5390
5397
|
return children(() => props.children);
|
|
5391
|
-
}));
|
|
5398
|
+
}), void 0);
|
|
5392
5399
|
return res;
|
|
5393
5400
|
};
|
|
5394
5401
|
}
|
|
@@ -5500,6 +5507,8 @@ var __objRest = (source, exclude) => {
|
|
|
5500
5507
|
return _.get(property);
|
|
5501
5508
|
},
|
|
5502
5509
|
has(_, property) {
|
|
5510
|
+
if (property === $PROXY)
|
|
5511
|
+
return true;
|
|
5503
5512
|
return _.has(property);
|
|
5504
5513
|
},
|
|
5505
5514
|
set: trueFn,
|
|
@@ -5520,68 +5529,116 @@ var __objRest = (source, exclude) => {
|
|
|
5520
5529
|
}
|
|
5521
5530
|
};
|
|
5522
5531
|
function resolveSource(s2) {
|
|
5523
|
-
return (s2 = typeof s2 === "function" ? s2() : s2)
|
|
5532
|
+
return !(s2 = typeof s2 === "function" ? s2() : s2) ? {} : s2;
|
|
5524
5533
|
}
|
|
5525
5534
|
function mergeProps(...sources) {
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
|
|
5532
|
-
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
|
|
5535
|
+
let proxy = false;
|
|
5536
|
+
for (let i2 = 0; i2 < sources.length; i2++) {
|
|
5537
|
+
const s2 = sources[i2];
|
|
5538
|
+
proxy = proxy || !!s2 && $PROXY in s2;
|
|
5539
|
+
sources[i2] = typeof s2 === "function" ? (proxy = true, createMemo(s2)) : s2;
|
|
5540
|
+
}
|
|
5541
|
+
if (proxy) {
|
|
5542
|
+
return new Proxy({
|
|
5543
|
+
get(property) {
|
|
5544
|
+
for (let i2 = sources.length - 1; i2 >= 0; i2--) {
|
|
5545
|
+
const v = resolveSource(sources[i2])[property];
|
|
5546
|
+
if (v !== void 0)
|
|
5547
|
+
return v;
|
|
5548
|
+
}
|
|
5549
|
+
},
|
|
5550
|
+
has(property) {
|
|
5551
|
+
for (let i2 = sources.length - 1; i2 >= 0; i2--) {
|
|
5552
|
+
if (property in resolveSource(sources[i2]))
|
|
5553
|
+
return true;
|
|
5554
|
+
}
|
|
5555
|
+
return false;
|
|
5556
|
+
},
|
|
5557
|
+
keys() {
|
|
5558
|
+
const keys = [];
|
|
5559
|
+
for (let i2 = 0; i2 < sources.length; i2++)
|
|
5560
|
+
keys.push(...Object.keys(resolveSource(sources[i2])));
|
|
5561
|
+
return [...new Set(keys)];
|
|
5562
|
+
}
|
|
5563
|
+
}, propTraps);
|
|
5564
|
+
}
|
|
5565
|
+
const target = {};
|
|
5566
|
+
for (let i2 = sources.length - 1; i2 >= 0; i2--) {
|
|
5567
|
+
if (sources[i2]) {
|
|
5568
|
+
const descriptors = Object.getOwnPropertyDescriptors(sources[i2]);
|
|
5569
|
+
for (const key in descriptors) {
|
|
5570
|
+
if (key in target)
|
|
5571
|
+
continue;
|
|
5572
|
+
Object.defineProperty(target, key, {
|
|
5573
|
+
enumerable: true,
|
|
5574
|
+
get() {
|
|
5575
|
+
for (let i3 = sources.length - 1; i3 >= 0; i3--) {
|
|
5576
|
+
const v = (sources[i3] || {})[key];
|
|
5577
|
+
if (v !== void 0)
|
|
5578
|
+
return v;
|
|
5579
|
+
}
|
|
5580
|
+
}
|
|
5581
|
+
});
|
|
5538
5582
|
}
|
|
5539
|
-
return false;
|
|
5540
|
-
},
|
|
5541
|
-
keys() {
|
|
5542
|
-
const keys = [];
|
|
5543
|
-
for (let i2 = 0; i2 < sources.length; i2++)
|
|
5544
|
-
keys.push(...Object.keys(resolveSource(sources[i2])));
|
|
5545
|
-
return [...new Set(keys)];
|
|
5546
5583
|
}
|
|
5547
|
-
}
|
|
5584
|
+
}
|
|
5585
|
+
return target;
|
|
5548
5586
|
}
|
|
5549
5587
|
function splitProps(props, ...keys) {
|
|
5550
5588
|
const blocked = new Set(keys.flat());
|
|
5589
|
+
if ($PROXY in props) {
|
|
5590
|
+
const res = keys.map((k) => {
|
|
5591
|
+
return new Proxy({
|
|
5592
|
+
get(property) {
|
|
5593
|
+
return k.includes(property) ? props[property] : void 0;
|
|
5594
|
+
},
|
|
5595
|
+
has(property) {
|
|
5596
|
+
return k.includes(property) && property in props;
|
|
5597
|
+
},
|
|
5598
|
+
keys() {
|
|
5599
|
+
return k.filter((property) => property in props);
|
|
5600
|
+
}
|
|
5601
|
+
}, propTraps);
|
|
5602
|
+
});
|
|
5603
|
+
res.push(new Proxy({
|
|
5604
|
+
get(property) {
|
|
5605
|
+
return blocked.has(property) ? void 0 : props[property];
|
|
5606
|
+
},
|
|
5607
|
+
has(property) {
|
|
5608
|
+
return blocked.has(property) ? false : property in props;
|
|
5609
|
+
},
|
|
5610
|
+
keys() {
|
|
5611
|
+
return Object.keys(props).filter((k) => !blocked.has(k));
|
|
5612
|
+
}
|
|
5613
|
+
}, propTraps));
|
|
5614
|
+
return res;
|
|
5615
|
+
}
|
|
5551
5616
|
const descriptors = Object.getOwnPropertyDescriptors(props);
|
|
5552
|
-
|
|
5617
|
+
keys.push(Object.keys(descriptors).filter((k) => !blocked.has(k)));
|
|
5618
|
+
return keys.map((k) => {
|
|
5553
5619
|
const clone = {};
|
|
5554
5620
|
for (let i2 = 0; i2 < k.length; i2++) {
|
|
5555
5621
|
const key = k[i2];
|
|
5622
|
+
if (!(key in props))
|
|
5623
|
+
continue;
|
|
5556
5624
|
Object.defineProperty(clone, key, descriptors[key] ? descriptors[key] : {
|
|
5557
5625
|
get() {
|
|
5558
5626
|
return props[key];
|
|
5559
5627
|
},
|
|
5560
5628
|
set() {
|
|
5561
5629
|
return true;
|
|
5562
|
-
}
|
|
5630
|
+
},
|
|
5631
|
+
enumerable: true
|
|
5563
5632
|
});
|
|
5564
5633
|
}
|
|
5565
5634
|
return clone;
|
|
5566
5635
|
});
|
|
5567
|
-
res.push(new Proxy({
|
|
5568
|
-
get(property) {
|
|
5569
|
-
return blocked.has(property) ? void 0 : props[property];
|
|
5570
|
-
},
|
|
5571
|
-
has(property) {
|
|
5572
|
-
return blocked.has(property) ? false : property in props;
|
|
5573
|
-
},
|
|
5574
|
-
keys() {
|
|
5575
|
-
return Object.keys(props).filter((k) => !blocked.has(k));
|
|
5576
|
-
}
|
|
5577
|
-
}, propTraps));
|
|
5578
|
-
return res;
|
|
5579
5636
|
}
|
|
5580
5637
|
function For(props) {
|
|
5581
5638
|
const fallback = "fallback" in props && {
|
|
5582
5639
|
fallback: () => props.fallback
|
|
5583
5640
|
};
|
|
5584
|
-
return createMemo(mapArray(() => props.each, props.children, fallback
|
|
5641
|
+
return createMemo(mapArray(() => props.each, props.children, fallback || void 0));
|
|
5585
5642
|
}
|
|
5586
5643
|
function Show(props) {
|
|
5587
5644
|
let strictEqual = false;
|
|
@@ -5598,11 +5655,12 @@ var __objRest = (source, exclude) => {
|
|
|
5598
5655
|
return fn ? untrack(() => child(c2)) : child;
|
|
5599
5656
|
}
|
|
5600
5657
|
return props.fallback;
|
|
5601
|
-
});
|
|
5658
|
+
}, void 0, void 0);
|
|
5602
5659
|
}
|
|
5603
5660
|
function Switch(props) {
|
|
5604
5661
|
let strictEqual = false;
|
|
5605
5662
|
let keyed = false;
|
|
5663
|
+
const equals = (a2, b) => a2[0] === b[0] && (strictEqual ? a2[1] === b[1] : !a2[1] === !b[1]) && a2[2] === b[2];
|
|
5606
5664
|
const conditions = children(() => props.children), evalConditions = createMemo(() => {
|
|
5607
5665
|
let conds = conditions();
|
|
5608
5666
|
if (!Array.isArray(conds))
|
|
@@ -5616,7 +5674,7 @@ var __objRest = (source, exclude) => {
|
|
|
5616
5674
|
}
|
|
5617
5675
|
return [-1];
|
|
5618
5676
|
}, void 0, {
|
|
5619
|
-
equals
|
|
5677
|
+
equals
|
|
5620
5678
|
});
|
|
5621
5679
|
return createMemo(() => {
|
|
5622
5680
|
const [index, when, cond] = evalConditions();
|
|
@@ -5626,7 +5684,7 @@ var __objRest = (source, exclude) => {
|
|
|
5626
5684
|
const fn = typeof c2 === "function" && c2.length > 0;
|
|
5627
5685
|
strictEqual = keyed || fn;
|
|
5628
5686
|
return fn ? untrack(() => c2(when)) : c2;
|
|
5629
|
-
});
|
|
5687
|
+
}, void 0, void 0);
|
|
5630
5688
|
}
|
|
5631
5689
|
function Match(props) {
|
|
5632
5690
|
return props;
|
|
@@ -5634,18 +5692,18 @@ var __objRest = (source, exclude) => {
|
|
|
5634
5692
|
const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
|
|
5635
5693
|
const Properties = /* @__PURE__ */ new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
|
|
5636
5694
|
const ChildProperties = /* @__PURE__ */ new Set(["innerHTML", "textContent", "innerText", "children"]);
|
|
5637
|
-
const Aliases = {
|
|
5695
|
+
const Aliases = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
5638
5696
|
className: "class",
|
|
5639
5697
|
htmlFor: "for"
|
|
5640
|
-
};
|
|
5641
|
-
const PropAliases = {
|
|
5698
|
+
});
|
|
5699
|
+
const PropAliases = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
5642
5700
|
class: "className",
|
|
5643
5701
|
formnovalidate: "formNoValidate",
|
|
5644
5702
|
ismap: "isMap",
|
|
5645
5703
|
nomodule: "noModule",
|
|
5646
5704
|
playsinline: "playsInline",
|
|
5647
5705
|
readonly: "readOnly"
|
|
5648
|
-
};
|
|
5706
|
+
});
|
|
5649
5707
|
const DelegatedEvents = /* @__PURE__ */ new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
|
|
5650
5708
|
const SVGElements = /* @__PURE__ */ new Set([
|
|
5651
5709
|
"altGlyph",
|
|
@@ -5729,11 +5787,6 @@ var __objRest = (source, exclude) => {
|
|
|
5729
5787
|
xlink: "http://www.w3.org/1999/xlink",
|
|
5730
5788
|
xml: "http://www.w3.org/XML/1998/namespace"
|
|
5731
5789
|
};
|
|
5732
|
-
function memo(fn, equals) {
|
|
5733
|
-
return createMemo(fn, void 0, !equals ? {
|
|
5734
|
-
equals
|
|
5735
|
-
} : void 0);
|
|
5736
|
-
}
|
|
5737
5790
|
function reconcileArrays(parentNode, a2, b) {
|
|
5738
5791
|
let bLength = b.length, aEnd = a2.length, bEnd = bLength, aStart = 0, bStart = 0, after = a2[aEnd - 1].nextSibling, map = null;
|
|
5739
5792
|
while (aStart < aEnd || bStart < bEnd) {
|
|
@@ -5791,12 +5844,12 @@ var __objRest = (source, exclude) => {
|
|
|
5791
5844
|
}
|
|
5792
5845
|
}
|
|
5793
5846
|
const $$EVENTS = "_$DX_DELEGATE";
|
|
5794
|
-
function render(code, element, init) {
|
|
5847
|
+
function render(code, element, init, options = {}) {
|
|
5795
5848
|
let disposer;
|
|
5796
5849
|
createRoot((dispose2) => {
|
|
5797
5850
|
disposer = dispose2;
|
|
5798
5851
|
element === document ? code() : insert(element, code(), element.firstChild ? null : void 0, init);
|
|
5799
|
-
});
|
|
5852
|
+
}, options.owner);
|
|
5800
5853
|
return () => {
|
|
5801
5854
|
disposer();
|
|
5802
5855
|
element.textContent = "";
|
|
@@ -5893,11 +5946,14 @@ var __objRest = (source, exclude) => {
|
|
|
5893
5946
|
}
|
|
5894
5947
|
return prev;
|
|
5895
5948
|
}
|
|
5896
|
-
function spread(node,
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5949
|
+
function spread(node, props = {}, isSVG, skipChildren) {
|
|
5950
|
+
const prevProps = {};
|
|
5951
|
+
if (!skipChildren) {
|
|
5952
|
+
createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));
|
|
5953
|
+
}
|
|
5954
|
+
createRenderEffect(() => props.ref && props.ref(node));
|
|
5955
|
+
createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));
|
|
5956
|
+
return prevProps;
|
|
5901
5957
|
}
|
|
5902
5958
|
function use(fn, element, arg) {
|
|
5903
5959
|
return untrack(() => fn(element, arg));
|
|
@@ -5955,9 +6011,8 @@ var __objRest = (source, exclude) => {
|
|
|
5955
6011
|
if (value === prev)
|
|
5956
6012
|
return prev;
|
|
5957
6013
|
if (prop === "ref") {
|
|
5958
|
-
if (!skipRef)
|
|
6014
|
+
if (!skipRef)
|
|
5959
6015
|
value(node);
|
|
5960
|
-
}
|
|
5961
6016
|
} else if (prop.slice(0, 3) === "on:") {
|
|
5962
6017
|
const e2 = prop.slice(3);
|
|
5963
6018
|
prev && node.removeEventListener(e2, prev);
|
|
@@ -6012,7 +6067,7 @@ var __objRest = (source, exclude) => {
|
|
|
6012
6067
|
sharedConfig.done = true;
|
|
6013
6068
|
document.querySelectorAll("[id^=pl-]").forEach((elem) => elem.remove());
|
|
6014
6069
|
}
|
|
6015
|
-
while (node
|
|
6070
|
+
while (node) {
|
|
6016
6071
|
const handler = node[key];
|
|
6017
6072
|
if (handler && !node.disabled) {
|
|
6018
6073
|
const data = node[`${key}Data`];
|
|
@@ -6020,17 +6075,8 @@ var __objRest = (source, exclude) => {
|
|
|
6020
6075
|
if (e2.cancelBubble)
|
|
6021
6076
|
return;
|
|
6022
6077
|
}
|
|
6023
|
-
node = node.host
|
|
6024
|
-
}
|
|
6025
|
-
}
|
|
6026
|
-
function spreadExpression(node, props, prevProps = {}, isSVG, skipChildren) {
|
|
6027
|
-
props || (props = {});
|
|
6028
|
-
if (!skipChildren) {
|
|
6029
|
-
createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));
|
|
6078
|
+
node = node._$host || node.parentNode || node.host;
|
|
6030
6079
|
}
|
|
6031
|
-
createRenderEffect(() => props.ref && props.ref(node));
|
|
6032
|
-
createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));
|
|
6033
|
-
return prevProps;
|
|
6034
6080
|
}
|
|
6035
6081
|
function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
6036
6082
|
if (sharedConfig.context && !current)
|
|
@@ -6145,7 +6191,7 @@ var __objRest = (source, exclude) => {
|
|
|
6145
6191
|
}
|
|
6146
6192
|
return dynamic;
|
|
6147
6193
|
}
|
|
6148
|
-
function appendNodes(parent, array, marker) {
|
|
6194
|
+
function appendNodes(parent, array, marker = null) {
|
|
6149
6195
|
for (let i2 = 0, len = array.length; i2 < len; i2++)
|
|
6150
6196
|
parent.insertBefore(array[i2], marker);
|
|
6151
6197
|
}
|
|
@@ -6204,10 +6250,11 @@ var __objRest = (source, exclude) => {
|
|
|
6204
6250
|
const container = createElement(props.isSVG ? "g" : "div", props.isSVG), renderRoot = useShadow && container.attachShadow ? container.attachShadow({
|
|
6205
6251
|
mode: "open"
|
|
6206
6252
|
}) : container;
|
|
6207
|
-
Object.defineProperty(container, "host", {
|
|
6253
|
+
Object.defineProperty(container, "_$host", {
|
|
6208
6254
|
get() {
|
|
6209
6255
|
return marker.parentNode;
|
|
6210
|
-
}
|
|
6256
|
+
},
|
|
6257
|
+
configurable: true
|
|
6211
6258
|
});
|
|
6212
6259
|
insert(renderRoot, renderPortal());
|
|
6213
6260
|
mount.appendChild(container);
|
|
@@ -6510,9 +6557,9 @@ var __objRest = (source, exclude) => {
|
|
|
6510
6557
|
for (let i2 = 0, l2 = keys.length; i2 < l2; i2++) {
|
|
6511
6558
|
const prop = keys[i2];
|
|
6512
6559
|
if (desc[prop].get) {
|
|
6513
|
-
const get = desc[prop].get.bind(p2);
|
|
6514
6560
|
Object.defineProperty(value, prop, {
|
|
6515
|
-
|
|
6561
|
+
enumerable: desc[prop].enumerable,
|
|
6562
|
+
get: desc[prop].get.bind(p2)
|
|
6516
6563
|
});
|
|
6517
6564
|
}
|
|
6518
6565
|
}
|
|
@@ -6568,7 +6615,7 @@ var __objRest = (source, exclude) => {
|
|
|
6568
6615
|
function getDataNode(nodes, property, value) {
|
|
6569
6616
|
return nodes[property] || (nodes[property] = createDataNode(value));
|
|
6570
6617
|
}
|
|
6571
|
-
function proxyDescriptor(target, property) {
|
|
6618
|
+
function proxyDescriptor$1(target, property) {
|
|
6572
6619
|
const desc = Reflect.getOwnPropertyDescriptor(target, property);
|
|
6573
6620
|
if (!desc || desc.get || !desc.configurable || property === $PROXY || property === $NODE || property === $NAME)
|
|
6574
6621
|
return desc;
|
|
@@ -6620,8 +6667,7 @@ var __objRest = (source, exclude) => {
|
|
|
6620
6667
|
has(target, property) {
|
|
6621
6668
|
if (property === $RAW || property === $PROXY || property === $TRACK || property === $NODE || property === "__proto__")
|
|
6622
6669
|
return true;
|
|
6623
|
-
|
|
6624
|
-
tracked && tracked();
|
|
6670
|
+
this.get(target, property, target);
|
|
6625
6671
|
return property in target;
|
|
6626
6672
|
},
|
|
6627
6673
|
set() {
|
|
@@ -6631,16 +6677,15 @@ var __objRest = (source, exclude) => {
|
|
|
6631
6677
|
return true;
|
|
6632
6678
|
},
|
|
6633
6679
|
ownKeys,
|
|
6634
|
-
getOwnPropertyDescriptor: proxyDescriptor
|
|
6680
|
+
getOwnPropertyDescriptor: proxyDescriptor$1
|
|
6635
6681
|
};
|
|
6636
6682
|
function setProperty(state, property, value, deleting = false) {
|
|
6637
6683
|
if (!deleting && state[property] === value)
|
|
6638
6684
|
return;
|
|
6639
|
-
const prev = state[property];
|
|
6640
|
-
|
|
6641
|
-
if (value === void 0) {
|
|
6685
|
+
const prev = state[property], len = state.length;
|
|
6686
|
+
if (value === void 0)
|
|
6642
6687
|
delete state[property];
|
|
6643
|
-
|
|
6688
|
+
else
|
|
6644
6689
|
state[property] = value;
|
|
6645
6690
|
let nodes = getDataNodes(state), node;
|
|
6646
6691
|
if (node = getDataNode(nodes, property, prev))
|
|
@@ -6736,59 +6781,235 @@ var __objRest = (source, exclude) => {
|
|
|
6736
6781
|
THEME2["LIGHT"] = "LIGHT";
|
|
6737
6782
|
return THEME2;
|
|
6738
6783
|
})(THEME || {});
|
|
6739
|
-
|
|
6740
|
-
|
|
6741
|
-
|
|
6742
|
-
|
|
6743
|
-
|
|
6744
|
-
|
|
6745
|
-
|
|
6746
|
-
|
|
6747
|
-
|
|
6748
|
-
|
|
6749
|
-
|
|
6750
|
-
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
-
|
|
6784
|
+
const defaultLightColorsSet = {
|
|
6785
|
+
constant: {
|
|
6786
|
+
black: "#000000",
|
|
6787
|
+
white: "#FFFFFF"
|
|
6788
|
+
},
|
|
6789
|
+
connectButton: {
|
|
6790
|
+
background: "#31A6F5",
|
|
6791
|
+
foreground: "#FFFFFF"
|
|
6792
|
+
},
|
|
6793
|
+
accent: "#31A6F5",
|
|
6794
|
+
icon: {
|
|
6795
|
+
primary: "#0F0F0F",
|
|
6796
|
+
secondary: "#7A8999",
|
|
6797
|
+
tertiary: "#C1CAD2",
|
|
6798
|
+
success: "#29CC6A"
|
|
6799
|
+
},
|
|
6800
|
+
background: {
|
|
6801
|
+
primary: "#FFFFFF",
|
|
6802
|
+
secondary: "#F1F3F5"
|
|
6803
|
+
},
|
|
6804
|
+
text: {
|
|
6756
6805
|
primary: "#0F0F0F",
|
|
6757
6806
|
secondary: "#7A8999",
|
|
6758
|
-
|
|
6807
|
+
subhead: "#6A7785"
|
|
6759
6808
|
}
|
|
6760
|
-
}
|
|
6761
|
-
const
|
|
6762
|
-
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6809
|
+
};
|
|
6810
|
+
const defaultDarkColorsSet = {
|
|
6811
|
+
constant: {
|
|
6812
|
+
black: "#000000",
|
|
6813
|
+
white: "#FFFFFF"
|
|
6814
|
+
},
|
|
6815
|
+
connectButton: {
|
|
6816
|
+
background: "#31A6F5",
|
|
6817
|
+
foreground: "#FFFFFF"
|
|
6818
|
+
},
|
|
6819
|
+
accent: "#E5E5EA",
|
|
6820
|
+
icon: {
|
|
6821
|
+
primary: "#E5E5EA",
|
|
6822
|
+
secondary: "#909099",
|
|
6823
|
+
tertiary: "#434347",
|
|
6824
|
+
success: "#29CC6A"
|
|
6825
|
+
},
|
|
6826
|
+
background: {
|
|
6827
|
+
primary: "#121214",
|
|
6828
|
+
secondary: "#18181A"
|
|
6829
|
+
},
|
|
6830
|
+
text: {
|
|
6768
6831
|
primary: "#E5E5EA",
|
|
6769
6832
|
secondary: "#7D7D85",
|
|
6770
|
-
|
|
6833
|
+
subhead: "#8C8C93"
|
|
6771
6834
|
}
|
|
6772
|
-
}
|
|
6773
|
-
|
|
6774
|
-
|
|
6835
|
+
};
|
|
6836
|
+
var isMergeableObject = function isMergeableObject2(value) {
|
|
6837
|
+
return isNonNullObject(value) && !isSpecial(value);
|
|
6838
|
+
};
|
|
6839
|
+
function isNonNullObject(value) {
|
|
6840
|
+
return !!value && typeof value === "object";
|
|
6841
|
+
}
|
|
6842
|
+
function isSpecial(value) {
|
|
6843
|
+
var stringValue = Object.prototype.toString.call(value);
|
|
6844
|
+
return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
|
|
6845
|
+
}
|
|
6846
|
+
var canUseSymbol = typeof Symbol === "function" && Symbol.for;
|
|
6847
|
+
var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
|
|
6848
|
+
function isReactElement(value) {
|
|
6849
|
+
return value.$$typeof === REACT_ELEMENT_TYPE;
|
|
6850
|
+
}
|
|
6851
|
+
function emptyTarget(val) {
|
|
6852
|
+
return Array.isArray(val) ? [] : {};
|
|
6853
|
+
}
|
|
6854
|
+
function cloneUnlessOtherwiseSpecified(value, options) {
|
|
6855
|
+
return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
|
|
6856
|
+
}
|
|
6857
|
+
function defaultArrayMerge(target, source, options) {
|
|
6858
|
+
return target.concat(source).map(function(element) {
|
|
6859
|
+
return cloneUnlessOtherwiseSpecified(element, options);
|
|
6860
|
+
});
|
|
6861
|
+
}
|
|
6862
|
+
function getMergeFunction(key, options) {
|
|
6863
|
+
if (!options.customMerge) {
|
|
6864
|
+
return deepmerge;
|
|
6865
|
+
}
|
|
6866
|
+
var customMerge = options.customMerge(key);
|
|
6867
|
+
return typeof customMerge === "function" ? customMerge : deepmerge;
|
|
6868
|
+
}
|
|
6869
|
+
function getEnumerableOwnPropertySymbols(target) {
|
|
6870
|
+
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
|
|
6871
|
+
return target.propertyIsEnumerable(symbol);
|
|
6872
|
+
}) : [];
|
|
6873
|
+
}
|
|
6874
|
+
function getKeys(target) {
|
|
6875
|
+
return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
|
|
6876
|
+
}
|
|
6877
|
+
function propertyIsOnObject(object, property) {
|
|
6878
|
+
try {
|
|
6879
|
+
return property in object;
|
|
6880
|
+
} catch (_) {
|
|
6881
|
+
return false;
|
|
6882
|
+
}
|
|
6883
|
+
}
|
|
6884
|
+
function propertyIsUnsafe(target, key) {
|
|
6885
|
+
return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
|
|
6886
|
+
}
|
|
6887
|
+
function mergeObject(target, source, options) {
|
|
6888
|
+
var destination = {};
|
|
6889
|
+
if (options.isMergeableObject(target)) {
|
|
6890
|
+
getKeys(target).forEach(function(key) {
|
|
6891
|
+
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
|
|
6892
|
+
});
|
|
6893
|
+
}
|
|
6894
|
+
getKeys(source).forEach(function(key) {
|
|
6895
|
+
if (propertyIsUnsafe(target, key)) {
|
|
6896
|
+
return;
|
|
6897
|
+
}
|
|
6898
|
+
if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
|
|
6899
|
+
destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
|
|
6900
|
+
} else {
|
|
6901
|
+
destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
|
|
6902
|
+
}
|
|
6903
|
+
});
|
|
6904
|
+
return destination;
|
|
6905
|
+
}
|
|
6906
|
+
function deepmerge(target, source, options) {
|
|
6907
|
+
options = options || {};
|
|
6908
|
+
options.arrayMerge = options.arrayMerge || defaultArrayMerge;
|
|
6909
|
+
options.isMergeableObject = options.isMergeableObject || isMergeableObject;
|
|
6910
|
+
options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
|
|
6911
|
+
var sourceIsArray = Array.isArray(source);
|
|
6912
|
+
var targetIsArray = Array.isArray(target);
|
|
6913
|
+
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
|
|
6914
|
+
if (!sourceAndTargetTypesMatch) {
|
|
6915
|
+
return cloneUnlessOtherwiseSpecified(source, options);
|
|
6916
|
+
} else if (sourceIsArray) {
|
|
6917
|
+
return options.arrayMerge(target, source, options);
|
|
6918
|
+
} else {
|
|
6919
|
+
return mergeObject(target, source, options);
|
|
6920
|
+
}
|
|
6921
|
+
}
|
|
6922
|
+
deepmerge.all = function deepmergeAll(array, options) {
|
|
6923
|
+
if (!Array.isArray(array)) {
|
|
6924
|
+
throw new Error("first argument should be an array");
|
|
6925
|
+
}
|
|
6926
|
+
return array.reduce(function(prev, next) {
|
|
6927
|
+
return deepmerge(prev, next, options);
|
|
6928
|
+
}, {});
|
|
6929
|
+
};
|
|
6930
|
+
var deepmerge_1 = deepmerge;
|
|
6931
|
+
var cjs = deepmerge_1;
|
|
6932
|
+
/*!
|
|
6933
|
+
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
6934
|
+
*
|
|
6935
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
6936
|
+
* Released under the MIT License.
|
|
6937
|
+
*/
|
|
6938
|
+
function isObject(o2) {
|
|
6939
|
+
return Object.prototype.toString.call(o2) === "[object Object]";
|
|
6940
|
+
}
|
|
6941
|
+
function isPlainObject(o2) {
|
|
6942
|
+
var ctor, prot;
|
|
6943
|
+
if (isObject(o2) === false)
|
|
6944
|
+
return false;
|
|
6945
|
+
ctor = o2.constructor;
|
|
6946
|
+
if (ctor === void 0)
|
|
6947
|
+
return true;
|
|
6948
|
+
prot = ctor.prototype;
|
|
6949
|
+
if (isObject(prot) === false)
|
|
6950
|
+
return false;
|
|
6951
|
+
if (prot.hasOwnProperty("isPrototypeOf") === false) {
|
|
6952
|
+
return false;
|
|
6953
|
+
}
|
|
6954
|
+
return true;
|
|
6955
|
+
}
|
|
6956
|
+
function mergeOptions(options, defaultOptions) {
|
|
6957
|
+
if (!options) {
|
|
6958
|
+
return defaultOptions;
|
|
6959
|
+
}
|
|
6960
|
+
const overwriteMerge = (_, sourceArray, __) => sourceArray;
|
|
6961
|
+
return cjs(defaultOptions, options, {
|
|
6962
|
+
arrayMerge: overwriteMerge,
|
|
6963
|
+
isMergeableObject: isPlainObject
|
|
6964
|
+
});
|
|
6965
|
+
}
|
|
6775
6966
|
const [themeState, setThemeState] = createStore({
|
|
6776
6967
|
theme: THEME.LIGHT,
|
|
6777
|
-
|
|
6778
|
-
|
|
6968
|
+
colors: defaultLightColorsSet,
|
|
6969
|
+
borderRadius: "m"
|
|
6779
6970
|
});
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6785
|
-
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6971
|
+
const themeColorsMappingDefault = {
|
|
6972
|
+
[THEME.LIGHT]: defaultLightColorsSet,
|
|
6973
|
+
[THEME.DARK]: defaultDarkColorsSet
|
|
6974
|
+
};
|
|
6975
|
+
const themeCustomColors = {
|
|
6976
|
+
[THEME.LIGHT]: void 0,
|
|
6977
|
+
[THEME.DARK]: void 0
|
|
6978
|
+
};
|
|
6979
|
+
function setTheme(theme, colorsSet) {
|
|
6980
|
+
if (colorsSet) {
|
|
6981
|
+
themeCustomColors[THEME.DARK] = mergeOptions(
|
|
6982
|
+
colorsSet[THEME.DARK],
|
|
6983
|
+
themeCustomColors[THEME.DARK]
|
|
6984
|
+
);
|
|
6985
|
+
themeCustomColors[THEME.LIGHT] = mergeOptions(
|
|
6986
|
+
colorsSet[THEME.LIGHT],
|
|
6987
|
+
themeCustomColors[THEME.LIGHT]
|
|
6988
|
+
);
|
|
6791
6989
|
}
|
|
6990
|
+
setThemeState({
|
|
6991
|
+
theme,
|
|
6992
|
+
colors: mergeOptions(themeCustomColors[theme], themeColorsMappingDefault[theme])
|
|
6993
|
+
});
|
|
6994
|
+
}
|
|
6995
|
+
function setBorderRadius(borderRadius) {
|
|
6996
|
+
setThemeState({ borderRadius });
|
|
6997
|
+
}
|
|
6998
|
+
function setColors(colorsSet) {
|
|
6999
|
+
themeCustomColors[THEME.DARK] = mergeOptions(
|
|
7000
|
+
colorsSet[THEME.DARK],
|
|
7001
|
+
themeCustomColors[THEME.DARK]
|
|
7002
|
+
);
|
|
7003
|
+
themeCustomColors[THEME.LIGHT] = mergeOptions(
|
|
7004
|
+
colorsSet[THEME.LIGHT],
|
|
7005
|
+
themeCustomColors[THEME.LIGHT]
|
|
7006
|
+
);
|
|
7007
|
+
setThemeState((state) => ({
|
|
7008
|
+
colors: mergeOptions(
|
|
7009
|
+
themeCustomColors[state.theme],
|
|
7010
|
+
themeColorsMappingDefault[state.theme]
|
|
7011
|
+
)
|
|
7012
|
+
}));
|
|
6792
7013
|
}
|
|
6793
7014
|
const GlobalStyles = () => {
|
|
6794
7015
|
document.body.addEventListener("mousedown", () => document.body.classList.add("using-mouse"));
|
|
@@ -6826,22 +7047,41 @@ var __objRest = (source, exclude) => {
|
|
|
6826
7047
|
`;
|
|
6827
7048
|
return createComponent(Styles, {});
|
|
6828
7049
|
};
|
|
7050
|
+
function hexToRgb(hex) {
|
|
7051
|
+
if (hex[0] === "#") {
|
|
7052
|
+
hex = hex.slice(1);
|
|
7053
|
+
}
|
|
7054
|
+
const bigint = parseInt(hex, 16);
|
|
7055
|
+
const r = bigint >> 16 & 255;
|
|
7056
|
+
const g = bigint >> 8 & 255;
|
|
7057
|
+
const b = bigint & 255;
|
|
7058
|
+
return [r, g, b].join(",");
|
|
7059
|
+
}
|
|
7060
|
+
function rgba(color, opacity) {
|
|
7061
|
+
if (color[0] === "#") {
|
|
7062
|
+
color = hexToRgb(color);
|
|
7063
|
+
}
|
|
7064
|
+
return `rgba(${color}, ${opacity})`;
|
|
7065
|
+
}
|
|
7066
|
+
const borders$3 = {
|
|
7067
|
+
m: "16px",
|
|
7068
|
+
s: "8px",
|
|
7069
|
+
none: "0"
|
|
7070
|
+
};
|
|
6829
7071
|
const ButtonStyled$2 = styled.button`
|
|
6830
|
-
background-color: ${(props) => props.
|
|
6831
|
-
color: ${(props) => props.
|
|
7072
|
+
background-color: ${(props) => rgba(props.theme.colors.accent, 0.12)};
|
|
7073
|
+
color: ${(props) => props.theme.colors.accent};
|
|
6832
7074
|
|
|
6833
|
-
box-shadow: ${(props) => props.appearance === "flat" ? "0 4px 24px rgba(0, 0, 0, 0.16);" : "unset;"}
|
|
6834
|
-
|
|
6835
7075
|
padding: 9px 16px;
|
|
6836
7076
|
border: none;
|
|
6837
|
-
border-radius:
|
|
7077
|
+
border-radius: ${(props) => borders$3[props.theme.borderRadius]};
|
|
6838
7078
|
cursor: pointer;
|
|
6839
7079
|
|
|
6840
7080
|
font-size: 14px;
|
|
6841
7081
|
font-weight: 590;
|
|
6842
7082
|
line-height: 18px;
|
|
6843
7083
|
letter-spacing: -0.154px;
|
|
6844
|
-
|
|
7084
|
+
|
|
6845
7085
|
transition: transform 0.1s ease-in-out;
|
|
6846
7086
|
|
|
6847
7087
|
&:hover {
|
|
@@ -6853,13 +7093,12 @@ var __objRest = (source, exclude) => {
|
|
|
6853
7093
|
}
|
|
6854
7094
|
`;
|
|
6855
7095
|
const Button = (props) => {
|
|
6856
|
-
const appearance = () => props.appearance || "primary";
|
|
6857
7096
|
return createComponent(ButtonStyled$2, {
|
|
6858
7097
|
get ["class"]() {
|
|
6859
7098
|
return props.class;
|
|
6860
7099
|
},
|
|
6861
|
-
get
|
|
6862
|
-
return
|
|
7100
|
+
get id() {
|
|
7101
|
+
return props.id;
|
|
6863
7102
|
},
|
|
6864
7103
|
onClick: () => props.onClick(),
|
|
6865
7104
|
ref(r$) {
|
|
@@ -7267,7 +7506,7 @@ var __objRest = (source, exclude) => {
|
|
|
7267
7506
|
};
|
|
7268
7507
|
const ArrowIcon = (props) => {
|
|
7269
7508
|
const theme = useTheme();
|
|
7270
|
-
const fill = () => props.fill || theme.colors.
|
|
7509
|
+
const fill = () => props.fill || theme.colors.icon.secondary;
|
|
7271
7510
|
const direction = () => props.direction || "left";
|
|
7272
7511
|
const Svg = styled("svg")`
|
|
7273
7512
|
transform: rotate(${(props2) => rotationDegrees[props2.svgDirection]}deg);
|
|
@@ -7292,7 +7531,7 @@ var __objRest = (source, exclude) => {
|
|
|
7292
7531
|
const _tmpl$$e = /* @__PURE__ */ template$1(`<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.900031 0.900397L5.00002 5.00039M5.00002 5.00039L9.10003 9.1004M5.00002 5.00039L9.10003 0.900391M5.00002 5.00039L0.900024 9.1004" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path></svg>`);
|
|
7293
7532
|
const CloseIcon = (props) => {
|
|
7294
7533
|
const theme = useTheme();
|
|
7295
|
-
const fill = () => props.fill || theme.colors.
|
|
7534
|
+
const fill = () => props.fill || theme.colors.icon.secondary;
|
|
7296
7535
|
return (() => {
|
|
7297
7536
|
const _el$ = _tmpl$$e.cloneNode(true), _el$2 = _el$.firstChild;
|
|
7298
7537
|
createRenderEffect(() => setAttribute(_el$2, "stroke", fill()));
|
|
@@ -7307,7 +7546,7 @@ var __objRest = (source, exclude) => {
|
|
|
7307
7546
|
width: 32px;
|
|
7308
7547
|
height: 32px;
|
|
7309
7548
|
border-radius: 50%;
|
|
7310
|
-
background-color: ${(props) => props.theme.colors.
|
|
7549
|
+
background-color: ${(props) => props.theme.colors.background.secondary};
|
|
7311
7550
|
border: none;
|
|
7312
7551
|
cursor: pointer;
|
|
7313
7552
|
|
|
@@ -7392,14 +7631,12 @@ var __objRest = (source, exclude) => {
|
|
|
7392
7631
|
const ModalWrapperClass = u`
|
|
7393
7632
|
position: relative;
|
|
7394
7633
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 16px 64px rgba(0, 0, 0, 0.16);
|
|
7395
|
-
border-radius: 24px;
|
|
7396
7634
|
min-height: 100px;
|
|
7397
7635
|
width: 440px;
|
|
7398
7636
|
padding: 44px 56px 24px;
|
|
7399
7637
|
|
|
7400
7638
|
${media("mobile")} {
|
|
7401
7639
|
width: 100%;
|
|
7402
|
-
border-radius: 24px 24px 0 0;
|
|
7403
7640
|
}
|
|
7404
7641
|
`;
|
|
7405
7642
|
const CloseButtonStyled = styled(IconButton)`
|
|
@@ -7410,6 +7647,11 @@ var __objRest = (source, exclude) => {
|
|
|
7410
7647
|
const _tmpl$$d = /* @__PURE__ */ template$1(`<div></div>`);
|
|
7411
7648
|
const clickOutside = clickOutside$1;
|
|
7412
7649
|
const keyPressed = escPressed;
|
|
7650
|
+
const borders$2 = {
|
|
7651
|
+
m: "24px",
|
|
7652
|
+
s: "16px",
|
|
7653
|
+
none: "0"
|
|
7654
|
+
};
|
|
7413
7655
|
const Modal = (props) => {
|
|
7414
7656
|
const theme = useTheme();
|
|
7415
7657
|
return createComponent(Transition, {
|
|
@@ -7470,9 +7712,23 @@ var __objRest = (source, exclude) => {
|
|
|
7470
7712
|
onClick: () => props.onClose()
|
|
7471
7713
|
}), null);
|
|
7472
7714
|
insert(_el$, () => props.children, null);
|
|
7473
|
-
createRenderEffect(() =>
|
|
7474
|
-
|
|
7475
|
-
|
|
7715
|
+
createRenderEffect((_p$) => {
|
|
7716
|
+
const _v$ = props.id, _v$2 = cn(ModalWrapperClass, props.class, u`
|
|
7717
|
+
background-color: ${theme.colors.background.primary};
|
|
7718
|
+
border-radius: ${borders$2[theme.borderRadius]};
|
|
7719
|
+
|
|
7720
|
+
${media("mobile")} {
|
|
7721
|
+
border-radius: ${borders$2[theme.borderRadius]}
|
|
7722
|
+
${borders$2[theme.borderRadius]} 0 0;
|
|
7723
|
+
}
|
|
7724
|
+
`);
|
|
7725
|
+
_v$ !== _p$._v$ && setAttribute(_el$, "id", _p$._v$ = _v$);
|
|
7726
|
+
_v$2 !== _p$._v$2 && className(_el$, _p$._v$2 = _v$2);
|
|
7727
|
+
return _p$;
|
|
7728
|
+
}, {
|
|
7729
|
+
_v$: void 0,
|
|
7730
|
+
_v$2: void 0
|
|
7731
|
+
});
|
|
7476
7732
|
return _el$;
|
|
7477
7733
|
}
|
|
7478
7734
|
});
|
|
@@ -7517,7 +7773,7 @@ var __objRest = (source, exclude) => {
|
|
|
7517
7773
|
text-align: center;
|
|
7518
7774
|
letter-spacing: 0.072px;
|
|
7519
7775
|
|
|
7520
|
-
color: ${(props) => props.theme.colors.
|
|
7776
|
+
color: ${(props) => props.theme.colors.text.primary};
|
|
7521
7777
|
|
|
7522
7778
|
margin-top: 0;
|
|
7523
7779
|
margin-bottom: 6px;
|
|
@@ -7530,7 +7786,7 @@ var __objRest = (source, exclude) => {
|
|
|
7530
7786
|
},
|
|
7531
7787
|
get children() {
|
|
7532
7788
|
var _a;
|
|
7533
|
-
return
|
|
7789
|
+
return createMemo(() => !!props.translationKey)() ? t2(props.translationKey, props.translationValues, (_a = props.children) == null ? void 0 : _a.toString()) : props.children;
|
|
7534
7790
|
}
|
|
7535
7791
|
});
|
|
7536
7792
|
};
|
|
@@ -7543,7 +7799,7 @@ var __objRest = (source, exclude) => {
|
|
|
7543
7799
|
text-align: center;
|
|
7544
7800
|
letter-spacing: -0.32px;
|
|
7545
7801
|
|
|
7546
|
-
color: ${(props) => props.theme.colors.
|
|
7802
|
+
color: ${(props) => props.theme.colors.text.secondary};
|
|
7547
7803
|
|
|
7548
7804
|
margin-top: 0;
|
|
7549
7805
|
margin-bottom: 32px;
|
|
@@ -7556,7 +7812,7 @@ var __objRest = (source, exclude) => {
|
|
|
7556
7812
|
},
|
|
7557
7813
|
get children() {
|
|
7558
7814
|
var _a;
|
|
7559
|
-
return
|
|
7815
|
+
return createMemo(() => !!props.translationKey)() ? t2(props.translationKey, props.translationValues, (_a = props.children) == null ? void 0 : _a.toString()) : props.children;
|
|
7560
7816
|
}
|
|
7561
7817
|
});
|
|
7562
7818
|
};
|
|
@@ -7568,17 +7824,17 @@ var __objRest = (source, exclude) => {
|
|
|
7568
7824
|
|
|
7569
7825
|
letter-spacing: -0.24px;
|
|
7570
7826
|
|
|
7571
|
-
color: ${(props) => props.theme.colors.
|
|
7827
|
+
color: ${(props) => props.theme.colors.text.primary};
|
|
7572
7828
|
|
|
7573
7829
|
margin-top: 0;
|
|
7574
|
-
margin-bottom:
|
|
7830
|
+
margin-bottom: 0;
|
|
7575
7831
|
`;
|
|
7576
7832
|
const H3 = (props) => {
|
|
7577
7833
|
const [t2] = useI18n();
|
|
7578
7834
|
return createComponent(H3Styled, {
|
|
7579
7835
|
get children() {
|
|
7580
7836
|
var _a;
|
|
7581
|
-
return
|
|
7837
|
+
return createMemo(() => !!props.translationKey)() ? t2(props.translationKey, props.translationValues, (_a = props.children) == null ? void 0 : _a.toString()) : props.children;
|
|
7582
7838
|
}
|
|
7583
7839
|
});
|
|
7584
7840
|
};
|
|
@@ -7594,7 +7850,7 @@ var __objRest = (source, exclude) => {
|
|
|
7594
7850
|
const Text = (inputs) => {
|
|
7595
7851
|
const theme = useTheme();
|
|
7596
7852
|
const [t2] = useI18n();
|
|
7597
|
-
const color = () => inputs.color || theme.colors.
|
|
7853
|
+
const color = () => inputs.color || theme.colors.text.primary;
|
|
7598
7854
|
const props = mergeProps({
|
|
7599
7855
|
fontSize: "14px",
|
|
7600
7856
|
fontWeight: "510",
|
|
@@ -7622,14 +7878,14 @@ var __objRest = (source, exclude) => {
|
|
|
7622
7878
|
},
|
|
7623
7879
|
get children() {
|
|
7624
7880
|
var _a;
|
|
7625
|
-
return
|
|
7881
|
+
return createMemo(() => !!props.translationKey)() ? t2(props.translationKey, props.translationValues, (_a = props.children) == null ? void 0 : _a.toString()) : props.children;
|
|
7626
7882
|
}
|
|
7627
7883
|
});
|
|
7628
7884
|
};
|
|
7629
7885
|
const _tmpl$$c = /* @__PURE__ */ template$1(`<svg width="16" height="15" viewBox="0 0 16 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.1839 12.7069C9.6405 13.6507 9.36881 14.1226 9.05907 14.348C8.42775 14.8074 7.57228 14.8074 6.94096 14.348C6.63122 14.1226 6.35952 13.6507 5.81613 12.7069L1.52066 5.24638C0.768635 3.94024 0.392625 3.28717 0.337617 2.75894C0.225505 1.68236 0.818944 0.655911 1.80788 0.215893C2.29309 0 3.04667 0 4.55383 0H11.4462C12.9534 0 13.7069 0 14.1922 0.215893C15.1811 0.655911 15.7745 1.68236 15.6624 2.75894C15.6074 3.28717 15.2314 3.94024 14.4794 5.24638L10.1839 12.7069ZM7.10002 11.3412L2.56139 3.48002C2.31995 3.06185 2.19924 2.85276 2.18146 2.68365C2.14523 2.33896 2.33507 2.01015 2.65169 1.86919C2.80703 1.80002 3.04847 1.80002 3.53133 1.80002H3.53134L7.10002 1.80002V11.3412ZM8.90001 11.3412L13.4387 3.48002C13.6801 3.06185 13.8008 2.85276 13.8186 2.68365C13.8548 2.33896 13.665 2.01015 13.3484 1.86919C13.193 1.80002 12.9516 1.80002 12.4687 1.80002L8.90001 1.80002V11.3412Z"></path></svg>`);
|
|
7630
7886
|
const TonIcon = (props) => {
|
|
7631
7887
|
const theme = useTheme();
|
|
7632
|
-
const fill = () => props.fill || theme.colors.
|
|
7888
|
+
const fill = () => props.fill || theme.colors.icon.primary;
|
|
7633
7889
|
return (() => {
|
|
7634
7890
|
const _el$ = _tmpl$$c.cloneNode(true), _el$2 = _el$.firstChild;
|
|
7635
7891
|
createRenderEffect(() => setAttribute(_el$2, "fill", fill()));
|
|
@@ -7638,7 +7894,8 @@ var __objRest = (source, exclude) => {
|
|
|
7638
7894
|
};
|
|
7639
7895
|
const _tmpl$$b = /* @__PURE__ */ template$1(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11"></circle><path d="M7.5 13L10 15.5L16.5 9" stroke="white" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path></svg>`);
|
|
7640
7896
|
const SuccessIcon = (props) => {
|
|
7641
|
-
const
|
|
7897
|
+
const theme = useTheme();
|
|
7898
|
+
const fill = () => props.fill || theme.colors.icon.success;
|
|
7642
7899
|
return (() => {
|
|
7643
7900
|
const _el$ = _tmpl$$b.cloneNode(true), _el$2 = _el$.firstChild;
|
|
7644
7901
|
createRenderEffect((_p$) => {
|
|
@@ -7656,7 +7913,7 @@ var __objRest = (source, exclude) => {
|
|
|
7656
7913
|
const _tmpl$$a = /* @__PURE__ */ template$1(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11"></circle><path fill-rule="evenodd" clip-rule="evenodd" d="M7.86358 9.13637C7.51211 8.7849 7.51211 8.21505 7.86358 7.86358C8.21505 7.51211 8.7849 7.51211 9.13637 7.86358L12 10.7272L14.8636 7.86358C15.2151 7.51211 15.7849 7.51211 16.1364 7.86358C16.4878 8.21505 16.4878 8.7849 16.1364 9.13637L13.2728 12L16.1364 14.8636C16.4878 15.2151 16.4878 15.7849 16.1364 16.1364C15.7849 16.4878 15.2151 16.4878 14.8636 16.1364L12 13.2728L9.13637 16.1364C8.7849 16.4878 8.21505 16.4878 7.86358 16.1364C7.51211 15.7849 7.51211 15.2151 7.86358 14.8636L10.7272 12L7.86358 9.13637Z" fill="white"></path></svg>`);
|
|
7657
7914
|
const ErrorIcon = (props) => {
|
|
7658
7915
|
const theme = useTheme();
|
|
7659
|
-
const fill = () => props.fill || theme.colors.
|
|
7916
|
+
const fill = () => props.fill || theme.colors.icon.secondary;
|
|
7660
7917
|
return (() => {
|
|
7661
7918
|
const _el$ = _tmpl$$a.cloneNode(true), _el$2 = _el$.firstChild;
|
|
7662
7919
|
createRenderEffect((_p$) => {
|
|
@@ -7674,7 +7931,7 @@ var __objRest = (source, exclude) => {
|
|
|
7674
7931
|
const _tmpl$$9 = /* @__PURE__ */ template$1(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.00002 18.9282C11.8264 21.1373 16.7191 19.8263 18.9282 16C21.1374 12.1736 19.8264 7.28092 16 5.07178C12.1737 2.86264 7.28096 4.17364 5.07182 7.99998" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path></svg>`);
|
|
7675
7932
|
const LoaderIcon = (props) => {
|
|
7676
7933
|
const theme = useTheme();
|
|
7677
|
-
const fill = () => props.fill || theme.colors.
|
|
7934
|
+
const fill = () => props.fill || theme.colors.icon.tertiary;
|
|
7678
7935
|
const rotateAnimation = h`
|
|
7679
7936
|
0% {
|
|
7680
7937
|
transform: rotate(0deg);
|
|
@@ -7704,7 +7961,7 @@ var __objRest = (source, exclude) => {
|
|
|
7704
7961
|
const _tmpl$$8 = /* @__PURE__ */ template$1(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.76228 2.09998H7.79998H10.2001H10.2378H10.2378H10.2378C11.0459 2.09997 11.7067 2.09996 12.2438 2.14384C12.7997 2.18926 13.3017 2.28614 13.7706 2.52505C14.5045 2.89896 15.1011 3.49558 15.475 4.22941C15.7139 4.6983 15.8108 5.20038 15.8562 5.75629C15.9001 6.29337 15.9001 6.95422 15.9001 7.76227V7.79998V8.1H16.2H16.2377C17.0457 8.09999 17.7066 8.09998 18.2437 8.14386C18.7996 8.18928 19.3017 8.28616 19.7705 8.52507C20.5044 8.89898 21.101 9.4956 21.4749 10.2294C21.7138 10.6983 21.8107 11.2004 21.8561 11.7563C21.9 12.2934 21.9 12.9542 21.9 13.7623V13.8V16.2V16.2377C21.9 17.0458 21.9 17.7066 21.8561 18.2437C21.8107 18.7996 21.7138 19.3017 21.4749 19.7706C21.101 20.5044 20.5044 21.101 19.7705 21.4749C19.3017 21.7138 18.7996 21.8107 18.2437 21.8561C17.7066 21.9 17.0458 21.9 16.2378 21.9H16.2377H16.2H13.8H13.7623H13.7622C12.9542 21.9 12.2934 21.9 11.7563 21.8561C11.2004 21.8107 10.6983 21.7138 10.2294 21.4749C9.49561 21.101 8.89898 20.5044 8.52507 19.7706C8.28616 19.3017 8.18928 18.7996 8.14386 18.2437C8.09998 17.7066 8.09999 17.0458 8.1 16.2377V16.2V15.9H7.79998H7.76227H7.76218C6.95417 15.9 6.29335 15.9 5.75629 15.8561C5.20038 15.8107 4.6983 15.7138 4.22941 15.4749C3.49558 15.101 2.89896 14.5044 2.52505 13.7705C2.28614 13.3017 2.18926 12.7996 2.14384 12.2437C2.09996 11.7066 2.09997 11.0458 2.09998 10.2377V10.2377V10.2377V10.2V7.79998V7.76228V7.76225V7.76224C2.09997 6.9542 2.09996 6.29336 2.14384 5.75629C2.18926 5.20038 2.28614 4.6983 2.52505 4.22941C2.89896 3.49558 3.49558 2.89896 4.22941 2.52505C4.6983 2.28614 5.20038 2.18926 5.75629 2.14384C6.29336 2.09996 6.95419 2.09997 7.76222 2.09998H7.76224H7.76228ZM8.1 14.1V13.8V13.7623C8.09999 12.9542 8.09998 12.2934 8.14386 11.7563C8.18928 11.2004 8.28616 10.6983 8.52507 10.2294C8.89898 9.4956 9.49561 8.89898 10.2294 8.52507C10.6983 8.28616 11.2004 8.18928 11.7563 8.14386C12.2934 8.09998 12.9542 8.09999 13.7623 8.1H13.8H14.1001V7.79998C14.1001 6.94505 14.0994 6.35798 14.0622 5.90287C14.0259 5.45827 13.9593 5.21944 13.8712 5.0466C13.6699 4.65146 13.3486 4.3302 12.9535 4.12886C12.7806 4.04079 12.5418 3.97419 12.0972 3.93786C11.6421 3.90068 11.055 3.89998 10.2001 3.89998H7.79998C6.94505 3.89998 6.35798 3.90068 5.90287 3.93786C5.45827 3.97419 5.21944 4.04079 5.0466 4.12886C4.65146 4.3302 4.3302 4.65146 4.12886 5.0466C4.04079 5.21944 3.97419 5.45827 3.93786 5.90287C3.90068 6.35798 3.89998 6.94505 3.89998 7.79998V10.2C3.89998 11.0549 3.90068 11.642 3.93786 12.0971C3.97419 12.5417 4.04079 12.7805 4.12886 12.9534C4.3302 13.3485 4.65146 13.6698 5.0466 13.8711C5.21944 13.9592 5.45827 14.0258 5.90287 14.0621C6.35798 14.0993 6.94505 14.1 7.79998 14.1H8.1ZM11.0466 10.1289C11.2195 10.0408 11.4583 9.97421 11.9029 9.93788C12.358 9.9007 12.9451 9.9 13.8 9.9H16.2C17.0549 9.9 17.642 9.9007 18.0971 9.93788C18.5417 9.97421 18.7805 10.0408 18.9534 10.1289C19.3485 10.3302 19.6698 10.6515 19.8711 11.0466C19.9592 11.2195 20.0258 11.4583 20.0621 11.9029C20.0993 12.358 20.1 12.9451 20.1 13.8V16.2C20.1 17.0549 20.0993 17.642 20.0621 18.0971C20.0258 18.5417 19.9592 18.7805 19.8711 18.9534C19.6698 19.3485 19.3485 19.6698 18.9534 19.8711C18.7805 19.9592 18.5417 20.0258 18.0971 20.0621C17.642 20.0993 17.0549 20.1 16.2 20.1H13.8C12.9451 20.1 12.358 20.0993 11.9029 20.0621C11.4583 20.0258 11.2195 19.9592 11.0466 19.8711C10.6515 19.6698 10.3302 19.3485 10.1289 18.9534C10.0408 18.7805 9.97421 18.5417 9.93788 18.0971C9.9007 17.642 9.9 17.0549 9.9 16.2V13.8C9.9 12.9451 9.9007 12.358 9.93788 11.9029C9.97421 11.4583 10.0408 11.2195 10.1289 11.0466C10.3302 10.6515 10.6515 10.3302 11.0466 10.1289Z"></path></svg>`);
|
|
7705
7962
|
const CopyIcon = (props) => {
|
|
7706
7963
|
const theme = useTheme();
|
|
7707
|
-
const fill = () => props.fill || theme.colors.
|
|
7964
|
+
const fill = () => props.fill || theme.colors.icon.primary;
|
|
7708
7965
|
return (() => {
|
|
7709
7966
|
const _el$ = _tmpl$$8.cloneNode(true), _el$2 = _el$.firstChild;
|
|
7710
7967
|
createRenderEffect(() => setAttribute(_el$2, "fill", fill()));
|
|
@@ -7714,7 +7971,7 @@ var __objRest = (source, exclude) => {
|
|
|
7714
7971
|
const _tmpl$$7 = /* @__PURE__ */ template$1(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.0001 4.00003H8.80012C7.11996 4.00003 6.27989 4.00003 5.63815 4.32701C5.07366 4.61463 4.61472 5.07357 4.3271 5.63806C4.00012 6.27979 4.00012 7.11987 4.00012 8.80003V15.2C4.00012 16.8802 4.00012 17.7203 4.3271 18.362C4.61472 18.9265 5.07366 19.3854 5.63815 19.6731C6.27989 20 7.11996 20 8.80012 20H12.0001" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path><path d="M9 12H21M21 12L17 8M21 12L17 16" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path></svg>`);
|
|
7715
7972
|
const DisconnectIcon = (props) => {
|
|
7716
7973
|
const theme = useTheme();
|
|
7717
|
-
const fill = () => props.fill || theme.colors.
|
|
7974
|
+
const fill = () => props.fill || theme.colors.icon.primary;
|
|
7718
7975
|
return (() => {
|
|
7719
7976
|
const _el$ = _tmpl$$7.cloneNode(true), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
|
|
7720
7977
|
createRenderEffect((_p$) => {
|
|
@@ -7751,17 +8008,27 @@ var __objRest = (source, exclude) => {
|
|
|
7751
8008
|
document.body.removeChild(textArea);
|
|
7752
8009
|
}
|
|
7753
8010
|
}
|
|
8011
|
+
const hoverBorders = {
|
|
8012
|
+
m: "8px",
|
|
8013
|
+
s: "4px",
|
|
8014
|
+
none: "0"
|
|
8015
|
+
};
|
|
8016
|
+
const dropdownBorders = {
|
|
8017
|
+
m: "16px",
|
|
8018
|
+
s: "8px",
|
|
8019
|
+
none: "0"
|
|
8020
|
+
};
|
|
7754
8021
|
const AccountButtonDropdownStyled = styled.div`
|
|
7755
8022
|
width: 256px;
|
|
7756
8023
|
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16);
|
|
7757
|
-
border-radius:
|
|
8024
|
+
border-radius: ${(props) => dropdownBorders[props.theme.borderRadius]};
|
|
7758
8025
|
|
|
7759
|
-
background-color: ${(props) => props.theme.colors.
|
|
8026
|
+
background-color: ${(props) => props.theme.colors.background.primary}
|
|
7760
8027
|
|
|
7761
|
-
color: ${(props) => props.theme.colors.
|
|
8028
|
+
color: ${(props) => props.theme.colors.text.primary}
|
|
7762
8029
|
`;
|
|
7763
8030
|
const UlStyled$1 = styled.ul`
|
|
7764
|
-
background-color: ${(props) => props.theme.colors.
|
|
8031
|
+
background-color: ${(props) => props.theme.colors.background.primary};
|
|
7765
8032
|
padding: 8px;
|
|
7766
8033
|
`;
|
|
7767
8034
|
const MenuButtonStyled = styled.button`
|
|
@@ -7771,15 +8038,15 @@ var __objRest = (source, exclude) => {
|
|
|
7771
8038
|
padding: 12px;
|
|
7772
8039
|
width: 100%;
|
|
7773
8040
|
|
|
7774
|
-
background-color: ${(props) => props.theme.colors.
|
|
8041
|
+
background-color: ${(props) => props.theme.colors.background.primary};
|
|
7775
8042
|
border: none;
|
|
7776
|
-
border-radius:
|
|
8043
|
+
border-radius: ${(props) => hoverBorders[props.theme.borderRadius]};
|
|
7777
8044
|
cursor: pointer;
|
|
7778
8045
|
|
|
7779
8046
|
transition: background-color, transform 0.1s ease-in-out;
|
|
7780
8047
|
|
|
7781
8048
|
&:hover {
|
|
7782
|
-
background-color: ${(props) => props.theme.colors.
|
|
8049
|
+
background-color: ${(props) => props.theme.colors.background.secondary};
|
|
7783
8050
|
}
|
|
7784
8051
|
|
|
7785
8052
|
&:active {
|
|
@@ -7803,7 +8070,7 @@ var __objRest = (source, exclude) => {
|
|
|
7803
8070
|
const connector = useContext(ConnectorContext);
|
|
7804
8071
|
const [isCopiedShown, setIsCopiedShown] = createSignal(false);
|
|
7805
8072
|
const onCopy = () => __async(void 0, null, function* () {
|
|
7806
|
-
const userFriendlyAddress = toUserFriendlyAddress$1(tonConnectUi.account.address);
|
|
8073
|
+
const userFriendlyAddress = toUserFriendlyAddress$1(tonConnectUi.account.address, tonConnectUi.account.chain === CHAIN$1.TESTNET);
|
|
7807
8074
|
yield copyToClipboard(userFriendlyAddress);
|
|
7808
8075
|
setIsCopiedShown(true);
|
|
7809
8076
|
setTimeout(() => setIsCopiedShown(false), 1e3);
|
|
@@ -7820,6 +8087,9 @@ var __objRest = (source, exclude) => {
|
|
|
7820
8087
|
get ["class"]() {
|
|
7821
8088
|
return props.class;
|
|
7822
8089
|
},
|
|
8090
|
+
get id() {
|
|
8091
|
+
return props.id;
|
|
8092
|
+
},
|
|
7823
8093
|
get children() {
|
|
7824
8094
|
return createComponent(UlStyled$1, {
|
|
7825
8095
|
get children() {
|
|
@@ -7870,19 +8140,24 @@ var __objRest = (source, exclude) => {
|
|
|
7870
8140
|
}
|
|
7871
8141
|
});
|
|
7872
8142
|
};
|
|
8143
|
+
const borders$1 = {
|
|
8144
|
+
m: "16px",
|
|
8145
|
+
s: "8px",
|
|
8146
|
+
none: "0"
|
|
8147
|
+
};
|
|
7873
8148
|
const NotificationStyled = styled.div`
|
|
7874
8149
|
width: 256px;
|
|
7875
8150
|
padding: 12px 16px;
|
|
7876
8151
|
display: flex;
|
|
7877
8152
|
gap: 9px;
|
|
7878
8153
|
|
|
7879
|
-
background-color: ${(props) => props.theme.colors.
|
|
8154
|
+
background-color: ${(props) => props.theme.colors.background.primary};
|
|
7880
8155
|
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16);
|
|
7881
|
-
border-radius:
|
|
8156
|
+
border-radius: ${(props) => borders$1[props.theme.borderRadius]};
|
|
7882
8157
|
`;
|
|
7883
8158
|
const TextStyled$2 = styled(Text)`
|
|
7884
8159
|
margin-top: 4px;
|
|
7885
|
-
color: ${(props) => props.theme.colors.
|
|
8160
|
+
color: ${(props) => props.theme.colors.text.secondary};
|
|
7886
8161
|
`;
|
|
7887
8162
|
const _tmpl$$5 = /* @__PURE__ */ template$1(`<div></div>`);
|
|
7888
8163
|
const Notification = (props) => {
|
|
@@ -7920,7 +8195,7 @@ var __objRest = (source, exclude) => {
|
|
|
7920
8195
|
}
|
|
7921
8196
|
}), null);
|
|
7922
8197
|
return _el$;
|
|
7923
|
-
})(),
|
|
8198
|
+
})(), createMemo(() => props.icon)];
|
|
7924
8199
|
}
|
|
7925
8200
|
});
|
|
7926
8201
|
};
|
|
@@ -7980,7 +8255,7 @@ var __objRest = (source, exclude) => {
|
|
|
7980
8255
|
return createComponent(SuccessIconStyled$1, {});
|
|
7981
8256
|
},
|
|
7982
8257
|
get ["class"]() {
|
|
7983
|
-
return props.class;
|
|
8258
|
+
return cn(props.class, "tc-notification");
|
|
7984
8259
|
},
|
|
7985
8260
|
children: "Transaction sent"
|
|
7986
8261
|
});
|
|
@@ -8071,24 +8346,39 @@ var __objRest = (source, exclude) => {
|
|
|
8071
8346
|
});
|
|
8072
8347
|
}
|
|
8073
8348
|
}));
|
|
8074
|
-
createRenderEffect(() =>
|
|
8349
|
+
createRenderEffect((_p$) => {
|
|
8350
|
+
const _v$ = props.class, _v$2 = props.id;
|
|
8351
|
+
_v$ !== _p$._v$ && className(_el$, _p$._v$ = _v$);
|
|
8352
|
+
_v$2 !== _p$._v$2 && setAttribute(_el$, "id", _p$._v$2 = _v$2);
|
|
8353
|
+
return _p$;
|
|
8354
|
+
}, {
|
|
8355
|
+
_v$: void 0,
|
|
8356
|
+
_v$2: void 0
|
|
8357
|
+
});
|
|
8075
8358
|
return _el$;
|
|
8076
8359
|
})();
|
|
8077
8360
|
};
|
|
8078
8361
|
const AccountButtonStyled = styled(Button)`
|
|
8362
|
+
background-color: ${(props) => props.theme.colors.connectButton.background};
|
|
8363
|
+
color: ${(props) => props.theme.colors.connectButton.foreground};
|
|
8364
|
+
box-shadow: ${(props) => `0 4px 24px ${rgba(props.theme.colors.constant.black, 0.16)}`};
|
|
8365
|
+
|
|
8079
8366
|
display: flex;
|
|
8080
8367
|
align-items: center;
|
|
8081
8368
|
gap: 9px;
|
|
8082
8369
|
|
|
8083
|
-
transition:
|
|
8370
|
+
transition: all 0.1s ease-in-out;
|
|
8084
8371
|
|
|
8085
8372
|
&:hover:not(:active) {
|
|
8086
8373
|
transform: scale(1);
|
|
8087
8374
|
}
|
|
8088
8375
|
|
|
8089
8376
|
&:hover {
|
|
8090
|
-
|
|
8377
|
+
filter: ${(props) => `brightness(${props.theme.theme === THEME.DARK ? 1.07 : 0.95})`};
|
|
8091
8378
|
}
|
|
8379
|
+
`;
|
|
8380
|
+
const DropdownButtonStyled = styled(AccountButtonStyled)`
|
|
8381
|
+
background-color: ${(props) => props.theme.colors.background.primary};
|
|
8092
8382
|
`;
|
|
8093
8383
|
const DropdownContainerStyled = styled.div`
|
|
8094
8384
|
display: flex;
|
|
@@ -8180,7 +8470,7 @@ var __objRest = (source, exclude) => {
|
|
|
8180
8470
|
} = config;
|
|
8181
8471
|
const validMiddleware = middleware.filter(Boolean);
|
|
8182
8472
|
const rtl = yield platform2.isRTL == null ? void 0 : platform2.isRTL(floating);
|
|
8183
|
-
if (
|
|
8473
|
+
if ({}.NODE_ENV !== "production") {
|
|
8184
8474
|
if (platform2 == null) {
|
|
8185
8475
|
console.error(["Floating UI: `platform` property was not passed to config. If you", "want to use Floating UI on the web, install @floating-ui/dom", "instead of the /core package. Otherwise, you can create your own", "`platform`: https://floating-ui.com/docs/platform"].join(" "));
|
|
8186
8476
|
}
|
|
@@ -8237,7 +8527,7 @@ var __objRest = (source, exclude) => {
|
|
|
8237
8527
|
middlewareData = __spreadProps(__spreadValues({}, middlewareData), {
|
|
8238
8528
|
[name]: __spreadValues(__spreadValues({}, middlewareData[name]), data)
|
|
8239
8529
|
});
|
|
8240
|
-
if (
|
|
8530
|
+
if ({}.NODE_ENV !== "production") {
|
|
8241
8531
|
if (resetCount > 50) {
|
|
8242
8532
|
console.warn(["Floating UI: The middleware lifecycle appears to be running in an", "infinite loop. This is usually caused by a `reset` continually", "being returned without a break condition."].join(" "));
|
|
8243
8533
|
}
|
|
@@ -8849,12 +9139,13 @@ var __objRest = (source, exclude) => {
|
|
|
8849
9139
|
return n2().middlewareData;
|
|
8850
9140
|
}, update: i2 };
|
|
8851
9141
|
}
|
|
8852
|
-
const _tmpl$$3 = /* @__PURE__ */ template$1(`<div></div>`);
|
|
9142
|
+
const _tmpl$$3 = /* @__PURE__ */ template$1(`<div id="tc-dropdown-container"></div>`);
|
|
8853
9143
|
const AccountButton = () => {
|
|
9144
|
+
const theme = useTheme();
|
|
8854
9145
|
const connector = useContext(ConnectorContext);
|
|
8855
9146
|
const tonConnectUI2 = useContext(TonConnectUiContext);
|
|
8856
9147
|
const [isOpened, setIsOpened] = createSignal(false);
|
|
8857
|
-
const [
|
|
9148
|
+
const [account, setAccount] = createSignal(null);
|
|
8858
9149
|
let dropDownRef;
|
|
8859
9150
|
const [floating, setFloating] = createSignal();
|
|
8860
9151
|
const [anchor, setAnchor] = createSignal();
|
|
@@ -8863,8 +9154,9 @@ var __objRest = (source, exclude) => {
|
|
|
8863
9154
|
placement: "bottom-end"
|
|
8864
9155
|
});
|
|
8865
9156
|
const normalizedAddress = () => {
|
|
8866
|
-
|
|
8867
|
-
|
|
9157
|
+
const acc = account();
|
|
9158
|
+
if (acc) {
|
|
9159
|
+
const userFriendlyAddress = toUserFriendlyAddress$1(acc.address, acc.chain === CHAIN$1.TESTNET);
|
|
8868
9160
|
return userFriendlyAddress.slice(0, 4) + "..." + userFriendlyAddress.slice(-4);
|
|
8869
9161
|
}
|
|
8870
9162
|
return "";
|
|
@@ -8872,13 +9164,13 @@ var __objRest = (source, exclude) => {
|
|
|
8872
9164
|
const unsubscribe = connector.onStatusChange((wallet) => {
|
|
8873
9165
|
if (!wallet) {
|
|
8874
9166
|
setIsOpened(false);
|
|
8875
|
-
|
|
9167
|
+
setAccount(null);
|
|
8876
9168
|
return;
|
|
8877
9169
|
}
|
|
8878
|
-
|
|
9170
|
+
setAccount(wallet.account);
|
|
8879
9171
|
});
|
|
8880
9172
|
const onClick = (e2) => {
|
|
8881
|
-
if (!
|
|
9173
|
+
if (!account() || !isOpened()) {
|
|
8882
9174
|
return;
|
|
8883
9175
|
}
|
|
8884
9176
|
const clickToButton = anchor().contains(e2.target);
|
|
@@ -8896,18 +9188,25 @@ var __objRest = (source, exclude) => {
|
|
|
8896
9188
|
});
|
|
8897
9189
|
return [createComponent(Show, {
|
|
8898
9190
|
get when() {
|
|
8899
|
-
return !
|
|
9191
|
+
return !account();
|
|
8900
9192
|
},
|
|
8901
9193
|
get children() {
|
|
8902
9194
|
return createComponent(AccountButtonStyled, {
|
|
8903
|
-
appearance: "flat",
|
|
8904
9195
|
onClick: () => tonConnectUI2.connectWallet(),
|
|
9196
|
+
id: "tc-connect-button",
|
|
8905
9197
|
get children() {
|
|
8906
|
-
return [createComponent(TonIcon, {
|
|
9198
|
+
return [createComponent(TonIcon, {
|
|
9199
|
+
get fill() {
|
|
9200
|
+
return theme.colors.connectButton.foreground;
|
|
9201
|
+
}
|
|
9202
|
+
}), createComponent(Text, {
|
|
8907
9203
|
translationKey: "button.connectWallet",
|
|
8908
9204
|
fontSize: "15px",
|
|
8909
9205
|
letterSpacing: "-0.24px",
|
|
8910
9206
|
fontWeight: "590",
|
|
9207
|
+
get color() {
|
|
9208
|
+
return theme.colors.connectButton.foreground;
|
|
9209
|
+
},
|
|
8911
9210
|
children: "Connect wallet"
|
|
8912
9211
|
})];
|
|
8913
9212
|
}
|
|
@@ -8915,15 +9214,15 @@ var __objRest = (source, exclude) => {
|
|
|
8915
9214
|
}
|
|
8916
9215
|
}), createComponent(Show, {
|
|
8917
9216
|
get when() {
|
|
8918
|
-
return
|
|
9217
|
+
return account();
|
|
8919
9218
|
},
|
|
8920
9219
|
get children() {
|
|
8921
9220
|
return createComponent(DropdownContainerStyled, {
|
|
8922
9221
|
get children() {
|
|
8923
|
-
return [createComponent(
|
|
8924
|
-
appearance: "flat",
|
|
9222
|
+
return [createComponent(DropdownButtonStyled, {
|
|
8925
9223
|
onClick: () => setIsOpened((v) => !v),
|
|
8926
9224
|
ref: setAnchor,
|
|
9225
|
+
id: "tc-dropdown-button",
|
|
8927
9226
|
get children() {
|
|
8928
9227
|
return [createComponent(Text, {
|
|
8929
9228
|
fontSize: "15px",
|
|
@@ -8979,13 +9278,16 @@ var __objRest = (source, exclude) => {
|
|
|
8979
9278
|
ref(r$) {
|
|
8980
9279
|
const _ref$ = dropDownRef;
|
|
8981
9280
|
typeof _ref$ === "function" ? _ref$(r$) : dropDownRef = r$;
|
|
8982
|
-
}
|
|
9281
|
+
},
|
|
9282
|
+
id: "tc-dropdown"
|
|
8983
9283
|
});
|
|
8984
9284
|
}
|
|
8985
9285
|
});
|
|
8986
9286
|
}
|
|
8987
9287
|
}), null);
|
|
8988
|
-
insert(_el$, createComponent(NotificationsStyled, {
|
|
9288
|
+
insert(_el$, createComponent(NotificationsStyled, {
|
|
9289
|
+
id: "tc-notifications"
|
|
9290
|
+
}), null);
|
|
8989
9291
|
createRenderEffect((_p$) => {
|
|
8990
9292
|
var _a, _b;
|
|
8991
9293
|
const _v$ = position.strategy, _v$2 = `${(_a = position.y) != null ? _a : 0}px`, _v$3 = `${(_b = position.x) != null ? _b : 0}px`;
|
|
@@ -9016,6 +9318,11 @@ var __objRest = (source, exclude) => {
|
|
|
9016
9318
|
display: flex;
|
|
9017
9319
|
align-items: center;
|
|
9018
9320
|
justify-content: center;
|
|
9321
|
+
|
|
9322
|
+
> svg {
|
|
9323
|
+
height: 276px;
|
|
9324
|
+
width: 276px;
|
|
9325
|
+
}
|
|
9019
9326
|
}
|
|
9020
9327
|
|
|
9021
9328
|
rect {
|
|
@@ -9023,14 +9330,14 @@ var __objRest = (source, exclude) => {
|
|
|
9023
9330
|
}
|
|
9024
9331
|
|
|
9025
9332
|
path {
|
|
9026
|
-
fill: ${(props) => props.theme.colors.
|
|
9333
|
+
fill: ${(props) => props.theme.colors.text.primary};
|
|
9027
9334
|
}
|
|
9028
9335
|
`;
|
|
9029
9336
|
const ImageBackground = styled.div`
|
|
9030
9337
|
position: absolute;
|
|
9031
9338
|
width: 52px;
|
|
9032
9339
|
height: 52px;
|
|
9033
|
-
background: ${(props) => props.theme.colors.
|
|
9340
|
+
background: ${(props) => props.theme.colors.background.secondary};
|
|
9034
9341
|
padding: 7px;
|
|
9035
9342
|
top: 112px;
|
|
9036
9343
|
left: 112px;
|
|
@@ -10723,6 +11030,11 @@ var __objRest = (source, exclude) => {
|
|
|
10723
11030
|
const [t2] = useI18n();
|
|
10724
11031
|
return t2(props.translationKey, props.translationValues, (_a = props.children) == null ? void 0 : _a.toString());
|
|
10725
11032
|
};
|
|
11033
|
+
const borders = {
|
|
11034
|
+
m: "16px",
|
|
11035
|
+
s: "8px",
|
|
11036
|
+
none: "0"
|
|
11037
|
+
};
|
|
10726
11038
|
const QrCodeModalStyled = styled.div`
|
|
10727
11039
|
padding: 0 24px;
|
|
10728
11040
|
`;
|
|
@@ -10733,8 +11045,8 @@ var __objRest = (source, exclude) => {
|
|
|
10733
11045
|
`;
|
|
10734
11046
|
const QRBackgroundStyled = styled.div`
|
|
10735
11047
|
margin-bottom: 16px;
|
|
10736
|
-
background-color: ${(props) => props.theme.colors.
|
|
10737
|
-
border-radius:
|
|
11048
|
+
background-color: ${(props) => props.theme.colors.background.secondary};
|
|
11049
|
+
border-radius: ${(props) => borders[props.theme.borderRadius]};
|
|
10738
11050
|
display: flex;
|
|
10739
11051
|
align-items: center;
|
|
10740
11052
|
justify-content: center;
|
|
@@ -10751,6 +11063,7 @@ var __objRest = (source, exclude) => {
|
|
|
10751
11063
|
line-height: 20px;
|
|
10752
11064
|
letter-spacing: -0.32px;
|
|
10753
11065
|
width: 100%;
|
|
11066
|
+
border-radius: ${(props) => borders[props.theme.borderRadius]};
|
|
10754
11067
|
`;
|
|
10755
11068
|
const GetWalletStyled = styled.div`
|
|
10756
11069
|
display: flex;
|
|
@@ -10758,7 +11071,7 @@ var __objRest = (source, exclude) => {
|
|
|
10758
11071
|
align-items: center;
|
|
10759
11072
|
`;
|
|
10760
11073
|
const TextStyled$1 = styled(Text)`
|
|
10761
|
-
color: ${(props) => props.theme.colors.
|
|
11074
|
+
color: ${(props) => props.theme.colors.text.secondary};
|
|
10762
11075
|
font-size: 16px;
|
|
10763
11076
|
`;
|
|
10764
11077
|
function openLink(href, target = "_self") {
|
|
@@ -10783,8 +11096,11 @@ var __objRest = (source, exclude) => {
|
|
|
10783
11096
|
const universalLink = connector.connect({
|
|
10784
11097
|
universalLink: props.wallet.universalLink,
|
|
10785
11098
|
bridgeUrl: props.wallet.bridgeUrl
|
|
10786
|
-
});
|
|
11099
|
+
}, props.additionalRequest);
|
|
10787
11100
|
return createComponent(QrCodeModalStyled, {
|
|
11101
|
+
get id() {
|
|
11102
|
+
return props.id;
|
|
11103
|
+
},
|
|
10788
11104
|
get children() {
|
|
10789
11105
|
return [createComponent(StyledIconButton, {
|
|
10790
11106
|
icon: "arrow",
|
|
@@ -10797,7 +11113,7 @@ var __objRest = (source, exclude) => {
|
|
|
10797
11113
|
};
|
|
10798
11114
|
},
|
|
10799
11115
|
get children() {
|
|
10800
|
-
return ["Connect with ",
|
|
11116
|
+
return ["Connect with ", createMemo(() => props.wallet.name)];
|
|
10801
11117
|
}
|
|
10802
11118
|
}), createComponent(H2, {
|
|
10803
11119
|
translationKey: "walletModal.qrCodeModal.scan",
|
|
@@ -10807,7 +11123,7 @@ var __objRest = (source, exclude) => {
|
|
|
10807
11123
|
};
|
|
10808
11124
|
},
|
|
10809
11125
|
get children() {
|
|
10810
|
-
return ["Scan QR code with your phone’s or ",
|
|
11126
|
+
return ["Scan QR code with your phone’s or ", createMemo(() => props.wallet.name), "’s camera."];
|
|
10811
11127
|
}
|
|
10812
11128
|
}), createComponent(QRBackgroundStyled, {
|
|
10813
11129
|
get children() {
|
|
@@ -10821,7 +11137,6 @@ var __objRest = (source, exclude) => {
|
|
|
10821
11137
|
}), createComponent(ButtonsContainerStyled, {
|
|
10822
11138
|
get children() {
|
|
10823
11139
|
return [createComponent(ActionButtonStyled, {
|
|
10824
|
-
appearance: "secondary",
|
|
10825
11140
|
onClick: () => openLink(universalLink),
|
|
10826
11141
|
get children() {
|
|
10827
11142
|
return createComponent(Translation, {
|
|
@@ -10832,7 +11147,7 @@ var __objRest = (source, exclude) => {
|
|
|
10832
11147
|
};
|
|
10833
11148
|
},
|
|
10834
11149
|
get children() {
|
|
10835
|
-
return ["Open ",
|
|
11150
|
+
return ["Open ", createMemo(() => props.wallet.name)];
|
|
10836
11151
|
}
|
|
10837
11152
|
});
|
|
10838
11153
|
}
|
|
@@ -10842,10 +11157,9 @@ var __objRest = (source, exclude) => {
|
|
|
10842
11157
|
},
|
|
10843
11158
|
get children() {
|
|
10844
11159
|
return createComponent(ActionButtonStyled, {
|
|
10845
|
-
appearance: "secondary",
|
|
10846
11160
|
onClick: () => connector.connect({
|
|
10847
11161
|
jsBridgeKey: props.wallet.jsBridgeKey
|
|
10848
|
-
}),
|
|
11162
|
+
}, props.additionalRequest),
|
|
10849
11163
|
get children() {
|
|
10850
11164
|
return createComponent(Translation, {
|
|
10851
11165
|
translationKey: "walletModal.qrCodeModal.openExtension",
|
|
@@ -10866,10 +11180,9 @@ var __objRest = (source, exclude) => {
|
|
|
10866
11180
|
};
|
|
10867
11181
|
},
|
|
10868
11182
|
get children() {
|
|
10869
|
-
return ["Don't have ",
|
|
11183
|
+
return ["Don't have ", createMemo(() => props.wallet.name), "?"];
|
|
10870
11184
|
}
|
|
10871
11185
|
}), createComponent(Button, {
|
|
10872
|
-
appearance: "secondary",
|
|
10873
11186
|
onClick: () => openLinkBlank(props.wallet.aboutUrl),
|
|
10874
11187
|
get children() {
|
|
10875
11188
|
return createComponent(Translation, {
|
|
@@ -10987,6 +11300,9 @@ var __objRest = (source, exclude) => {
|
|
|
10987
11300
|
const SelectWalletModal = (props) => {
|
|
10988
11301
|
const learnMoreUrl = "https://ton.org/wallets";
|
|
10989
11302
|
return createComponent(SelectWalletModalStyled, {
|
|
11303
|
+
get id() {
|
|
11304
|
+
return props.id;
|
|
11305
|
+
},
|
|
10990
11306
|
get children() {
|
|
10991
11307
|
return [createComponent(H1, {
|
|
10992
11308
|
translationKey: "walletModal.selectWalletModal.connectWallet",
|
|
@@ -11016,7 +11332,6 @@ var __objRest = (source, exclude) => {
|
|
|
11016
11332
|
});
|
|
11017
11333
|
}
|
|
11018
11334
|
}), createComponent(ButtonStyled$1, {
|
|
11019
|
-
appearance: "secondary",
|
|
11020
11335
|
onClick: () => openLinkBlank(learnMoreUrl),
|
|
11021
11336
|
get children() {
|
|
11022
11337
|
return createComponent(Translation, {
|
|
@@ -11028,12 +11343,6 @@ var __objRest = (source, exclude) => {
|
|
|
11028
11343
|
}
|
|
11029
11344
|
});
|
|
11030
11345
|
};
|
|
11031
|
-
const ModalWrapper = styled.div`
|
|
11032
|
-
color: ${(props) => {
|
|
11033
|
-
var _a;
|
|
11034
|
-
return ((_a = props.theme) == null ? void 0 : _a.accentColor) || "blue";
|
|
11035
|
-
}};
|
|
11036
|
-
`;
|
|
11037
11346
|
const StyledModal = styled(Modal)`
|
|
11038
11347
|
padding-left: 0;
|
|
11039
11348
|
padding-right: 0;
|
|
@@ -11067,21 +11376,8 @@ var __objRest = (source, exclude) => {
|
|
|
11067
11376
|
const [appState, setAppState] = createStore({
|
|
11068
11377
|
buttonRootId: null,
|
|
11069
11378
|
language: "en",
|
|
11070
|
-
|
|
11071
|
-
widgetConfiguration: {}
|
|
11379
|
+
walletsList: {}
|
|
11072
11380
|
});
|
|
11073
|
-
class TonConnectUIError extends TonConnectError$1 {
|
|
11074
|
-
constructor(...args) {
|
|
11075
|
-
super(...args);
|
|
11076
|
-
Object.setPrototypeOf(this, TonConnectUIError.prototype);
|
|
11077
|
-
}
|
|
11078
|
-
}
|
|
11079
|
-
class WalletNotFoundError extends TonConnectUIError {
|
|
11080
|
-
constructor(...args) {
|
|
11081
|
-
super(...args);
|
|
11082
|
-
Object.setPrototypeOf(this, WalletNotFoundError.prototype);
|
|
11083
|
-
}
|
|
11084
|
-
}
|
|
11085
11381
|
function uiWalletToWalletInfo(uiWallet) {
|
|
11086
11382
|
if ("jsBridgeKey" in uiWallet) {
|
|
11087
11383
|
return __spreadProps(__spreadValues({}, uiWallet), {
|
|
@@ -11101,14 +11397,15 @@ var __objRest = (source, exclude) => {
|
|
|
11101
11397
|
if (typeof wallet === "string") {
|
|
11102
11398
|
const walletInfo = walletsList.find((item) => item.name === wallet);
|
|
11103
11399
|
if (!walletInfo) {
|
|
11104
|
-
|
|
11105
|
-
`Wallet with name === '${wallet}' wasn't found in the wallets list. Check ${wallet} correctness
|
|
11400
|
+
console.error(
|
|
11401
|
+
`Wallet with name === '${wallet}' wasn't found in the wallets list. Check '${wallet}' correctness. Available wallets names: ${walletsList.map((i2) => "'" + i2.name + "'").join(", ")}`
|
|
11106
11402
|
);
|
|
11403
|
+
return null;
|
|
11107
11404
|
}
|
|
11108
11405
|
return walletInfo;
|
|
11109
11406
|
}
|
|
11110
11407
|
return uiWalletToWalletInfo(wallet);
|
|
11111
|
-
});
|
|
11408
|
+
}).filter((i2) => !!i2);
|
|
11112
11409
|
}
|
|
11113
11410
|
const filteredWalletsList = ((_a = configuration.excludeWallets) == null ? void 0 : _a.length) ? walletsList.filter(
|
|
11114
11411
|
(wallet) => {
|
|
@@ -11132,12 +11429,35 @@ var __objRest = (source, exclude) => {
|
|
|
11132
11429
|
const connector = useContext(ConnectorContext);
|
|
11133
11430
|
const tonConnectUI2 = useContext(TonConnectUiContext);
|
|
11134
11431
|
const [fetchedWalletsList] = createResource(() => tonConnectUI2.getWallets());
|
|
11432
|
+
const [fetchedAdditionalRequest, {
|
|
11433
|
+
refetch
|
|
11434
|
+
}] = createResource((_, {
|
|
11435
|
+
refetching
|
|
11436
|
+
}) => {
|
|
11437
|
+
var _a;
|
|
11438
|
+
if (refetching) {
|
|
11439
|
+
return (_a = appState.getConnectParameters) == null ? void 0 : _a.call(appState);
|
|
11440
|
+
}
|
|
11441
|
+
return void 0;
|
|
11442
|
+
});
|
|
11443
|
+
createEffect(on(walletsModalOpen, () => {
|
|
11444
|
+
if (walletsModalOpen() && fetchedAdditionalRequest.state !== "refreshing") {
|
|
11445
|
+
refetch();
|
|
11446
|
+
}
|
|
11447
|
+
}));
|
|
11135
11448
|
const [selectedWalletInfo, setSelectedWalletInfo] = createSignal(null);
|
|
11136
11449
|
const walletsList = createMemo(() => {
|
|
11137
11450
|
if (fetchedWalletsList.state !== "ready") {
|
|
11138
11451
|
return null;
|
|
11139
11452
|
}
|
|
11140
|
-
return applyWalletsListConfiguration(fetchedWalletsList(), appState.
|
|
11453
|
+
return applyWalletsListConfiguration(fetchedWalletsList(), appState.walletsList);
|
|
11454
|
+
});
|
|
11455
|
+
const additionalRequestLoading = () => fetchedAdditionalRequest.state !== "ready" && fetchedAdditionalRequest.state !== "errored";
|
|
11456
|
+
const additionalRequest = createMemo(() => {
|
|
11457
|
+
if (fetchedAdditionalRequest.state !== "ready") {
|
|
11458
|
+
return void 0;
|
|
11459
|
+
}
|
|
11460
|
+
return fetchedAdditionalRequest();
|
|
11141
11461
|
});
|
|
11142
11462
|
const onClose = () => {
|
|
11143
11463
|
setWalletsModalOpen(false);
|
|
@@ -11161,13 +11481,13 @@ var __objRest = (source, exclude) => {
|
|
|
11161
11481
|
const universalLink = connector.connect({
|
|
11162
11482
|
universalLink: walletInfo.universalLink,
|
|
11163
11483
|
bridgeUrl: walletInfo.bridgeUrl
|
|
11164
|
-
});
|
|
11484
|
+
}, additionalRequest());
|
|
11165
11485
|
openLink(universalLink);
|
|
11166
11486
|
};
|
|
11167
11487
|
const onSelectIfInjected = (walletInfo) => {
|
|
11168
11488
|
connector.connect({
|
|
11169
11489
|
jsBridgeKey: walletInfo.jsBridgeKey
|
|
11170
|
-
});
|
|
11490
|
+
}, additionalRequest());
|
|
11171
11491
|
};
|
|
11172
11492
|
const unsubscribe = connector.onStatusChange((wallet) => {
|
|
11173
11493
|
if (wallet) {
|
|
@@ -11175,66 +11495,66 @@ var __objRest = (source, exclude) => {
|
|
|
11175
11495
|
}
|
|
11176
11496
|
});
|
|
11177
11497
|
onCleanup(unsubscribe);
|
|
11178
|
-
return createComponent(
|
|
11498
|
+
return createComponent(StyledModal, {
|
|
11499
|
+
get opened() {
|
|
11500
|
+
return walletsModalOpen();
|
|
11501
|
+
},
|
|
11502
|
+
onClose,
|
|
11503
|
+
id: "tc-wallets-modal-container",
|
|
11179
11504
|
get children() {
|
|
11180
|
-
return createComponent(
|
|
11181
|
-
get
|
|
11182
|
-
return
|
|
11505
|
+
return [createComponent(Show, {
|
|
11506
|
+
get when() {
|
|
11507
|
+
return !walletsList() || additionalRequestLoading();
|
|
11508
|
+
},
|
|
11509
|
+
get children() {
|
|
11510
|
+
return [createComponent(H1Styled$1, {
|
|
11511
|
+
translationKey: "walletModal.loading",
|
|
11512
|
+
children: "Wallets list is loading"
|
|
11513
|
+
}), createComponent(LoaderContainerStyled, {
|
|
11514
|
+
get children() {
|
|
11515
|
+
return createComponent(LoaderIconStyled$1, {});
|
|
11516
|
+
}
|
|
11517
|
+
})];
|
|
11518
|
+
}
|
|
11519
|
+
}), createComponent(Show, {
|
|
11520
|
+
get when() {
|
|
11521
|
+
return createMemo(() => !!walletsList())() && !additionalRequestLoading();
|
|
11183
11522
|
},
|
|
11184
|
-
onClose,
|
|
11185
11523
|
get children() {
|
|
11186
11524
|
return [createComponent(Show, {
|
|
11187
11525
|
get when() {
|
|
11188
|
-
return !
|
|
11526
|
+
return !selectedWalletInfo();
|
|
11189
11527
|
},
|
|
11528
|
+
keyed: false,
|
|
11190
11529
|
get children() {
|
|
11191
|
-
return
|
|
11192
|
-
|
|
11193
|
-
|
|
11194
|
-
|
|
11195
|
-
|
|
11196
|
-
|
|
11197
|
-
|
|
11198
|
-
});
|
|
11199
|
-
}
|
|
11200
|
-
})];
|
|
11530
|
+
return createComponent(SelectWalletModal, {
|
|
11531
|
+
get walletsList() {
|
|
11532
|
+
return walletsList();
|
|
11533
|
+
},
|
|
11534
|
+
onSelect,
|
|
11535
|
+
id: "tc-wallets-modal"
|
|
11536
|
+
});
|
|
11201
11537
|
}
|
|
11202
11538
|
}), createComponent(Show, {
|
|
11203
11539
|
get when() {
|
|
11204
|
-
return
|
|
11540
|
+
return selectedWalletInfo();
|
|
11205
11541
|
},
|
|
11542
|
+
keyed: false,
|
|
11206
11543
|
get children() {
|
|
11207
|
-
return
|
|
11208
|
-
get
|
|
11209
|
-
return
|
|
11544
|
+
return createComponent(QrCodeModal, {
|
|
11545
|
+
get additionalRequest() {
|
|
11546
|
+
return additionalRequest();
|
|
11210
11547
|
},
|
|
11211
|
-
|
|
11212
|
-
get children() {
|
|
11213
|
-
return createComponent(SelectWalletModal, {
|
|
11214
|
-
get walletsList() {
|
|
11215
|
-
return walletsList();
|
|
11216
|
-
},
|
|
11217
|
-
onSelect
|
|
11218
|
-
});
|
|
11219
|
-
}
|
|
11220
|
-
}), createComponent(Show, {
|
|
11221
|
-
get when() {
|
|
11548
|
+
get wallet() {
|
|
11222
11549
|
return selectedWalletInfo();
|
|
11223
11550
|
},
|
|
11224
|
-
|
|
11225
|
-
|
|
11226
|
-
|
|
11227
|
-
get wallet() {
|
|
11228
|
-
return selectedWalletInfo();
|
|
11229
|
-
},
|
|
11230
|
-
onBackClick: () => setSelectedWalletInfo(null)
|
|
11231
|
-
});
|
|
11232
|
-
}
|
|
11233
|
-
})];
|
|
11551
|
+
onBackClick: () => setSelectedWalletInfo(null),
|
|
11552
|
+
id: "tc-qr-modal"
|
|
11553
|
+
});
|
|
11234
11554
|
}
|
|
11235
11555
|
})];
|
|
11236
11556
|
}
|
|
11237
|
-
});
|
|
11557
|
+
})];
|
|
11238
11558
|
}
|
|
11239
11559
|
});
|
|
11240
11560
|
};
|
|
@@ -11255,15 +11575,18 @@ var __objRest = (source, exclude) => {
|
|
|
11255
11575
|
text-align: center;
|
|
11256
11576
|
max-width: 250px;
|
|
11257
11577
|
|
|
11258
|
-
color: ${(props) => props.theme.colors.
|
|
11578
|
+
color: ${(props) => props.theme.colors.text.secondary};
|
|
11259
11579
|
`;
|
|
11260
11580
|
const ButtonStyled = styled(Button)`
|
|
11261
11581
|
margin-top: 32px;
|
|
11262
11582
|
`;
|
|
11263
11583
|
const ActionModal = (props) => {
|
|
11264
11584
|
return createComponent(ActionModalStyled, {
|
|
11585
|
+
get id() {
|
|
11586
|
+
return props.id;
|
|
11587
|
+
},
|
|
11265
11588
|
get children() {
|
|
11266
|
-
return [
|
|
11589
|
+
return [createMemo(() => props.icon), createComponent(H1Styled, {
|
|
11267
11590
|
get translationKey() {
|
|
11268
11591
|
return props.headerTranslationKey;
|
|
11269
11592
|
}
|
|
@@ -11277,7 +11600,6 @@ var __objRest = (source, exclude) => {
|
|
|
11277
11600
|
},
|
|
11278
11601
|
get children() {
|
|
11279
11602
|
return createComponent(ButtonStyled, {
|
|
11280
|
-
appearance: "secondary",
|
|
11281
11603
|
onClick: () => props.onClose(),
|
|
11282
11604
|
get children() {
|
|
11283
11605
|
return createComponent(Translation, {
|
|
@@ -11300,12 +11622,13 @@ var __objRest = (source, exclude) => {
|
|
|
11300
11622
|
headerTranslationKey: "actionModal.confirmTransaction.header",
|
|
11301
11623
|
textTranslationKey: "actionModal.confirmTransaction.text",
|
|
11302
11624
|
get icon() {
|
|
11303
|
-
return createComponent(LoaderIconStyled, {
|
|
11304
|
-
fill: "#7A899970"
|
|
11305
|
-
});
|
|
11625
|
+
return createComponent(LoaderIconStyled, {});
|
|
11306
11626
|
},
|
|
11307
11627
|
onClose: () => props.onClose(),
|
|
11308
|
-
showButton: false
|
|
11628
|
+
showButton: false,
|
|
11629
|
+
get id() {
|
|
11630
|
+
return props.id;
|
|
11631
|
+
}
|
|
11309
11632
|
});
|
|
11310
11633
|
};
|
|
11311
11634
|
const ErrorIconStyled = styled(ErrorIcon)`
|
|
@@ -11319,7 +11642,10 @@ var __objRest = (source, exclude) => {
|
|
|
11319
11642
|
get icon() {
|
|
11320
11643
|
return createComponent(ErrorIconStyled, {});
|
|
11321
11644
|
},
|
|
11322
|
-
onClose: () => props.onClose()
|
|
11645
|
+
onClose: () => props.onClose(),
|
|
11646
|
+
get id() {
|
|
11647
|
+
return props.id;
|
|
11648
|
+
}
|
|
11323
11649
|
});
|
|
11324
11650
|
};
|
|
11325
11651
|
const SuccessIconStyled = styled(SuccessIcon)`
|
|
@@ -11333,16 +11659,20 @@ var __objRest = (source, exclude) => {
|
|
|
11333
11659
|
get icon() {
|
|
11334
11660
|
return createComponent(SuccessIconStyled, {});
|
|
11335
11661
|
},
|
|
11336
|
-
onClose: () => props.onClose()
|
|
11662
|
+
onClose: () => props.onClose(),
|
|
11663
|
+
get id() {
|
|
11664
|
+
return props.id;
|
|
11665
|
+
}
|
|
11337
11666
|
});
|
|
11338
11667
|
};
|
|
11339
11668
|
const ActionsModal = () => {
|
|
11340
11669
|
return createComponent(Modal, {
|
|
11341
11670
|
get opened() {
|
|
11342
11671
|
var _a;
|
|
11343
|
-
return
|
|
11672
|
+
return createMemo(() => action() !== null)() && ((_a = action()) == null ? void 0 : _a.openModal) === true;
|
|
11344
11673
|
},
|
|
11345
11674
|
onClose: () => setAction(null),
|
|
11675
|
+
id: "tc-actions-modal-container",
|
|
11346
11676
|
get children() {
|
|
11347
11677
|
return createComponent(Switch, {
|
|
11348
11678
|
get children() {
|
|
@@ -11352,7 +11682,8 @@ var __objRest = (source, exclude) => {
|
|
|
11352
11682
|
},
|
|
11353
11683
|
get children() {
|
|
11354
11684
|
return createComponent(TransactionSentModal, {
|
|
11355
|
-
onClose: () => setAction(null)
|
|
11685
|
+
onClose: () => setAction(null),
|
|
11686
|
+
id: "tc-transaction-sent-modal"
|
|
11356
11687
|
});
|
|
11357
11688
|
}
|
|
11358
11689
|
}), createComponent(Match, {
|
|
@@ -11361,7 +11692,8 @@ var __objRest = (source, exclude) => {
|
|
|
11361
11692
|
},
|
|
11362
11693
|
get children() {
|
|
11363
11694
|
return createComponent(TransactionCanceledModal, {
|
|
11364
|
-
onClose: () => setAction(null)
|
|
11695
|
+
onClose: () => setAction(null),
|
|
11696
|
+
id: "tc-transaction-canceled-modal"
|
|
11365
11697
|
});
|
|
11366
11698
|
}
|
|
11367
11699
|
}), createComponent(Match, {
|
|
@@ -11370,7 +11702,8 @@ var __objRest = (source, exclude) => {
|
|
|
11370
11702
|
},
|
|
11371
11703
|
get children() {
|
|
11372
11704
|
return createComponent(ConfirmTransactionModal, {
|
|
11373
|
-
onClose: () => setAction(null)
|
|
11705
|
+
onClose: () => setAction(null),
|
|
11706
|
+
id: "tc-confirm-modal"
|
|
11374
11707
|
});
|
|
11375
11708
|
}
|
|
11376
11709
|
})];
|
|
@@ -11431,6 +11764,12 @@ var __objRest = (source, exclude) => {
|
|
|
11431
11764
|
tonConnectUI: tonConnectUI2
|
|
11432
11765
|
}), document.getElementById(root))
|
|
11433
11766
|
};
|
|
11767
|
+
class TonConnectUIError extends TonConnectError$1 {
|
|
11768
|
+
constructor(...args) {
|
|
11769
|
+
super(...args);
|
|
11770
|
+
Object.setPrototypeOf(this, TonConnectUIError.prototype);
|
|
11771
|
+
}
|
|
11772
|
+
}
|
|
11434
11773
|
class WalletInfoStorage {
|
|
11435
11774
|
constructor() {
|
|
11436
11775
|
__publicField(this, "localStorage");
|
|
@@ -11456,142 +11795,13 @@ var __objRest = (source, exclude) => {
|
|
|
11456
11795
|
this.localStorage.removeItem(this.storageKey);
|
|
11457
11796
|
}
|
|
11458
11797
|
}
|
|
11459
|
-
var isMergeableObject = function isMergeableObject2(value) {
|
|
11460
|
-
return isNonNullObject(value) && !isSpecial(value);
|
|
11461
|
-
};
|
|
11462
|
-
function isNonNullObject(value) {
|
|
11463
|
-
return !!value && typeof value === "object";
|
|
11464
|
-
}
|
|
11465
|
-
function isSpecial(value) {
|
|
11466
|
-
var stringValue = Object.prototype.toString.call(value);
|
|
11467
|
-
return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
|
|
11468
|
-
}
|
|
11469
|
-
var canUseSymbol = typeof Symbol === "function" && Symbol.for;
|
|
11470
|
-
var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
|
|
11471
|
-
function isReactElement(value) {
|
|
11472
|
-
return value.$$typeof === REACT_ELEMENT_TYPE;
|
|
11473
|
-
}
|
|
11474
|
-
function emptyTarget(val) {
|
|
11475
|
-
return Array.isArray(val) ? [] : {};
|
|
11476
|
-
}
|
|
11477
|
-
function cloneUnlessOtherwiseSpecified(value, options) {
|
|
11478
|
-
return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
|
|
11479
|
-
}
|
|
11480
|
-
function defaultArrayMerge(target, source, options) {
|
|
11481
|
-
return target.concat(source).map(function(element) {
|
|
11482
|
-
return cloneUnlessOtherwiseSpecified(element, options);
|
|
11483
|
-
});
|
|
11484
|
-
}
|
|
11485
|
-
function getMergeFunction(key, options) {
|
|
11486
|
-
if (!options.customMerge) {
|
|
11487
|
-
return deepmerge;
|
|
11488
|
-
}
|
|
11489
|
-
var customMerge = options.customMerge(key);
|
|
11490
|
-
return typeof customMerge === "function" ? customMerge : deepmerge;
|
|
11491
|
-
}
|
|
11492
|
-
function getEnumerableOwnPropertySymbols(target) {
|
|
11493
|
-
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
|
|
11494
|
-
return target.propertyIsEnumerable(symbol);
|
|
11495
|
-
}) : [];
|
|
11496
|
-
}
|
|
11497
|
-
function getKeys(target) {
|
|
11498
|
-
return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
|
|
11499
|
-
}
|
|
11500
|
-
function propertyIsOnObject(object, property) {
|
|
11501
|
-
try {
|
|
11502
|
-
return property in object;
|
|
11503
|
-
} catch (_) {
|
|
11504
|
-
return false;
|
|
11505
|
-
}
|
|
11506
|
-
}
|
|
11507
|
-
function propertyIsUnsafe(target, key) {
|
|
11508
|
-
return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
|
|
11509
|
-
}
|
|
11510
|
-
function mergeObject(target, source, options) {
|
|
11511
|
-
var destination = {};
|
|
11512
|
-
if (options.isMergeableObject(target)) {
|
|
11513
|
-
getKeys(target).forEach(function(key) {
|
|
11514
|
-
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
|
|
11515
|
-
});
|
|
11516
|
-
}
|
|
11517
|
-
getKeys(source).forEach(function(key) {
|
|
11518
|
-
if (propertyIsUnsafe(target, key)) {
|
|
11519
|
-
return;
|
|
11520
|
-
}
|
|
11521
|
-
if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
|
|
11522
|
-
destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
|
|
11523
|
-
} else {
|
|
11524
|
-
destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
|
|
11525
|
-
}
|
|
11526
|
-
});
|
|
11527
|
-
return destination;
|
|
11528
|
-
}
|
|
11529
|
-
function deepmerge(target, source, options) {
|
|
11530
|
-
options = options || {};
|
|
11531
|
-
options.arrayMerge = options.arrayMerge || defaultArrayMerge;
|
|
11532
|
-
options.isMergeableObject = options.isMergeableObject || isMergeableObject;
|
|
11533
|
-
options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
|
|
11534
|
-
var sourceIsArray = Array.isArray(source);
|
|
11535
|
-
var targetIsArray = Array.isArray(target);
|
|
11536
|
-
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
|
|
11537
|
-
if (!sourceAndTargetTypesMatch) {
|
|
11538
|
-
return cloneUnlessOtherwiseSpecified(source, options);
|
|
11539
|
-
} else if (sourceIsArray) {
|
|
11540
|
-
return options.arrayMerge(target, source, options);
|
|
11541
|
-
} else {
|
|
11542
|
-
return mergeObject(target, source, options);
|
|
11543
|
-
}
|
|
11544
|
-
}
|
|
11545
|
-
deepmerge.all = function deepmergeAll(array, options) {
|
|
11546
|
-
if (!Array.isArray(array)) {
|
|
11547
|
-
throw new Error("first argument should be an array");
|
|
11548
|
-
}
|
|
11549
|
-
return array.reduce(function(prev, next) {
|
|
11550
|
-
return deepmerge(prev, next, options);
|
|
11551
|
-
}, {});
|
|
11552
|
-
};
|
|
11553
|
-
var deepmerge_1 = deepmerge;
|
|
11554
|
-
var cjs = deepmerge_1;
|
|
11555
|
-
/*!
|
|
11556
|
-
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
11557
|
-
*
|
|
11558
|
-
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
11559
|
-
* Released under the MIT License.
|
|
11560
|
-
*/
|
|
11561
|
-
function isObject(o2) {
|
|
11562
|
-
return Object.prototype.toString.call(o2) === "[object Object]";
|
|
11563
|
-
}
|
|
11564
|
-
function isPlainObject(o2) {
|
|
11565
|
-
var ctor, prot;
|
|
11566
|
-
if (isObject(o2) === false)
|
|
11567
|
-
return false;
|
|
11568
|
-
ctor = o2.constructor;
|
|
11569
|
-
if (ctor === void 0)
|
|
11570
|
-
return true;
|
|
11571
|
-
prot = ctor.prototype;
|
|
11572
|
-
if (isObject(prot) === false)
|
|
11573
|
-
return false;
|
|
11574
|
-
if (prot.hasOwnProperty("isPrototypeOf") === false) {
|
|
11575
|
-
return false;
|
|
11576
|
-
}
|
|
11577
|
-
return true;
|
|
11578
|
-
}
|
|
11579
|
-
function mergeOptions(options, defaultOptions) {
|
|
11580
|
-
if (!options) {
|
|
11581
|
-
return defaultOptions;
|
|
11582
|
-
}
|
|
11583
|
-
const overwriteMerge = (_, sourceArray, __) => sourceArray;
|
|
11584
|
-
return cjs(defaultOptions, options, {
|
|
11585
|
-
arrayMerge: overwriteMerge,
|
|
11586
|
-
isMergeableObject: isPlainObject
|
|
11587
|
-
});
|
|
11588
|
-
}
|
|
11589
11798
|
class TonConnectUI {
|
|
11590
11799
|
constructor(options) {
|
|
11591
11800
|
__publicField(this, "walletInfoStorage", new WalletInfoStorage());
|
|
11592
11801
|
__publicField(this, "connector");
|
|
11593
11802
|
__publicField(this, "_walletInfo", null);
|
|
11594
11803
|
__publicField(this, "systemThemeChangeUnsubscribe", null);
|
|
11804
|
+
__publicField(this, "actionsConfiguration");
|
|
11595
11805
|
if (options && "connector" in options && options.connector) {
|
|
11596
11806
|
this.connector = options.connector;
|
|
11597
11807
|
} else if (options && "manifestUrl" in options && options.manifestUrl) {
|
|
@@ -11614,8 +11824,11 @@ var __objRest = (source, exclude) => {
|
|
|
11614
11824
|
}
|
|
11615
11825
|
});
|
|
11616
11826
|
}
|
|
11617
|
-
this.uiOptions = options
|
|
11618
|
-
setAppState({
|
|
11827
|
+
this.uiOptions = mergeOptions(options, { uiPreferences: { theme: "SYSTEM" } });
|
|
11828
|
+
setAppState({
|
|
11829
|
+
connector: this.connector,
|
|
11830
|
+
getConnectParameters: options == null ? void 0 : options.getConnectParameters
|
|
11831
|
+
});
|
|
11619
11832
|
widgetController.renderApp(rootId, this);
|
|
11620
11833
|
}
|
|
11621
11834
|
static getWallets() {
|
|
@@ -11634,28 +11847,30 @@ var __objRest = (source, exclude) => {
|
|
|
11634
11847
|
return this._walletInfo;
|
|
11635
11848
|
}
|
|
11636
11849
|
set uiOptions(options) {
|
|
11637
|
-
var _a;
|
|
11850
|
+
var _a, _b, _c, _d, _e;
|
|
11638
11851
|
this.checkButtonRootExist(options.buttonRootId);
|
|
11639
|
-
|
|
11640
|
-
|
|
11641
|
-
if (
|
|
11642
|
-
this.systemThemeChangeUnsubscribe
|
|
11643
|
-
|
|
11644
|
-
|
|
11852
|
+
this.actionsConfiguration = options.actionsConfiguration;
|
|
11853
|
+
if ((_a = options.uiPreferences) == null ? void 0 : _a.theme) {
|
|
11854
|
+
if (((_b = options.uiPreferences) == null ? void 0 : _b.theme) !== "SYSTEM") {
|
|
11855
|
+
(_c = this.systemThemeChangeUnsubscribe) == null ? void 0 : _c.call(this);
|
|
11856
|
+
setTheme(options.uiPreferences.theme, options.uiPreferences.colorsSet);
|
|
11857
|
+
} else {
|
|
11858
|
+
setTheme(getSystemTheme(), options.uiPreferences.colorsSet);
|
|
11859
|
+
if (!this.systemThemeChangeUnsubscribe) {
|
|
11860
|
+
this.systemThemeChangeUnsubscribe = subscribeToThemeChange(setTheme);
|
|
11861
|
+
}
|
|
11645
11862
|
}
|
|
11646
11863
|
} else {
|
|
11647
|
-
if (options.
|
|
11648
|
-
(
|
|
11649
|
-
setTheme(options.theme);
|
|
11864
|
+
if ((_d = options.uiPreferences) == null ? void 0 : _d.colorsSet) {
|
|
11865
|
+
setColors(options.uiPreferences.colorsSet);
|
|
11650
11866
|
}
|
|
11651
11867
|
}
|
|
11868
|
+
if ((_e = options.uiPreferences) == null ? void 0 : _e.borderRadius) {
|
|
11869
|
+
setBorderRadius(options.uiPreferences.borderRadius);
|
|
11870
|
+
}
|
|
11652
11871
|
setAppState((state) => {
|
|
11653
11872
|
const merged = mergeOptions(
|
|
11654
|
-
__spreadValues(__spreadValues(
|
|
11655
|
-
buttonConfiguration: options.buttonConfiguration
|
|
11656
|
-
}), options.widgetConfiguration && {
|
|
11657
|
-
widgetConfiguration: options.widgetConfiguration
|
|
11658
|
-
}),
|
|
11873
|
+
__spreadValues(__spreadValues({}, options.language && { language: options.language }), !!options.walletsList && { walletsList: options.walletsList }),
|
|
11659
11874
|
unwrap(state)
|
|
11660
11875
|
);
|
|
11661
11876
|
if (options.buttonRootId !== void 0) {
|
|
@@ -11716,25 +11931,24 @@ var __objRest = (source, exclude) => {
|
|
|
11716
11931
|
if (!isDevice("desktop") && "universalLink" in this.walletInfo) {
|
|
11717
11932
|
openLink(this.walletInfo.universalLink);
|
|
11718
11933
|
}
|
|
11719
|
-
const
|
|
11720
|
-
const modals = (options == null ? void 0 : options.modals) || ["before"];
|
|
11934
|
+
const { notifications: notifications2, modals } = this.getModalsAndNotificationsConfiguration(options);
|
|
11721
11935
|
widgetController.setAction({
|
|
11722
11936
|
name: "confirm-transaction",
|
|
11723
|
-
showNotification:
|
|
11937
|
+
showNotification: notifications2.includes("before"),
|
|
11724
11938
|
openModal: modals.includes("before")
|
|
11725
11939
|
});
|
|
11726
11940
|
try {
|
|
11727
11941
|
const result = yield this.connector.sendTransaction(tx);
|
|
11728
11942
|
widgetController.setAction({
|
|
11729
11943
|
name: "transaction-sent",
|
|
11730
|
-
showNotification:
|
|
11944
|
+
showNotification: notifications2.includes("success"),
|
|
11731
11945
|
openModal: modals.includes("success")
|
|
11732
11946
|
});
|
|
11733
11947
|
return result;
|
|
11734
11948
|
} catch (e2) {
|
|
11735
11949
|
widgetController.setAction({
|
|
11736
11950
|
name: "transaction-canceled",
|
|
11737
|
-
showNotification:
|
|
11951
|
+
showNotification: notifications2.includes("error"),
|
|
11738
11952
|
openModal: modals.includes("error")
|
|
11739
11953
|
});
|
|
11740
11954
|
if (e2 instanceof TonConnectError$1) {
|
|
@@ -11743,8 +11957,6 @@ var __objRest = (source, exclude) => {
|
|
|
11743
11957
|
console.error(e2);
|
|
11744
11958
|
throw new TonConnectUIError("Unhandled error:" + e2);
|
|
11745
11959
|
}
|
|
11746
|
-
} finally {
|
|
11747
|
-
widgetController.clearAction();
|
|
11748
11960
|
}
|
|
11749
11961
|
});
|
|
11750
11962
|
}
|
|
@@ -11783,6 +11995,44 @@ var __objRest = (source, exclude) => {
|
|
|
11783
11995
|
throw new TonConnectUIError(`${buttonRootId2} element not found in the document.`);
|
|
11784
11996
|
}
|
|
11785
11997
|
}
|
|
11998
|
+
getModalsAndNotificationsConfiguration(options) {
|
|
11999
|
+
var _a, _b, _c;
|
|
12000
|
+
const allActions = [
|
|
12001
|
+
"before",
|
|
12002
|
+
"success",
|
|
12003
|
+
"error"
|
|
12004
|
+
];
|
|
12005
|
+
let notifications2 = allActions;
|
|
12006
|
+
if (((_a = this.actionsConfiguration) == null ? void 0 : _a.notifications) && ((_b = this.actionsConfiguration) == null ? void 0 : _b.notifications) !== "all") {
|
|
12007
|
+
notifications2 = this.actionsConfiguration.notifications;
|
|
12008
|
+
}
|
|
12009
|
+
if (options == null ? void 0 : options.notifications) {
|
|
12010
|
+
if (options.notifications === "all") {
|
|
12011
|
+
notifications2 = allActions;
|
|
12012
|
+
} else {
|
|
12013
|
+
notifications2 = options.notifications;
|
|
12014
|
+
}
|
|
12015
|
+
}
|
|
12016
|
+
let modals = ["before"];
|
|
12017
|
+
if ((_c = this.actionsConfiguration) == null ? void 0 : _c.modals) {
|
|
12018
|
+
if (this.actionsConfiguration.modals === "all") {
|
|
12019
|
+
modals = allActions;
|
|
12020
|
+
} else {
|
|
12021
|
+
modals = this.actionsConfiguration.modals;
|
|
12022
|
+
}
|
|
12023
|
+
}
|
|
12024
|
+
if (options == null ? void 0 : options.modals) {
|
|
12025
|
+
if (options.modals === "all") {
|
|
12026
|
+
modals = allActions;
|
|
12027
|
+
} else {
|
|
12028
|
+
modals = options.modals;
|
|
12029
|
+
}
|
|
12030
|
+
}
|
|
12031
|
+
return {
|
|
12032
|
+
notifications: notifications2,
|
|
12033
|
+
modals
|
|
12034
|
+
};
|
|
12035
|
+
}
|
|
11786
12036
|
}
|
|
11787
12037
|
const TonConnectUIContext = require$$0$2.createContext(null);
|
|
11788
12038
|
let tonConnectUI = null;
|
|
@@ -14615,11 +14865,16 @@ var __objRest = (source, exclude) => {
|
|
|
14615
14865
|
}
|
|
14616
14866
|
return t2;
|
|
14617
14867
|
};
|
|
14618
|
-
|
|
14868
|
+
const bounceableTag = 17;
|
|
14869
|
+
const testOnlyTag = 128;
|
|
14870
|
+
function toUserFriendlyAddress(hexAddress, testOnly = false) {
|
|
14619
14871
|
const { wc, hex } = parseHexAddress(hexAddress);
|
|
14620
|
-
|
|
14872
|
+
let tag = bounceableTag;
|
|
14873
|
+
if (testOnly) {
|
|
14874
|
+
tag |= testOnlyTag;
|
|
14875
|
+
}
|
|
14621
14876
|
const addr = new Int8Array(34);
|
|
14622
|
-
addr[0] =
|
|
14877
|
+
addr[0] = tag;
|
|
14623
14878
|
addr[1] = wc;
|
|
14624
14879
|
addr.set(hex, 2);
|
|
14625
14880
|
const addressWithChecksum = new Uint8Array(36);
|
|
@@ -14699,7 +14954,7 @@ var __objRest = (source, exclude) => {
|
|
|
14699
14954
|
function useTonAddress(userFriendly = true) {
|
|
14700
14955
|
const wallet = useTonWallet();
|
|
14701
14956
|
if (wallet) {
|
|
14702
|
-
return userFriendly ? toUserFriendlyAddress(wallet.account.address) : wallet.account.address;
|
|
14957
|
+
return userFriendly ? toUserFriendlyAddress(wallet.account.address, wallet.account.chain === CHAIN.TESTNET) : wallet.account.address;
|
|
14703
14958
|
} else {
|
|
14704
14959
|
return "";
|
|
14705
14960
|
}
|
|
@@ -14708,6 +14963,7 @@ var __objRest = (source, exclude) => {
|
|
|
14708
14963
|
exports.TonConnectButton = TonConnectButton$1;
|
|
14709
14964
|
exports.TonConnectProviderNotSetError = TonConnectProviderNotSetError;
|
|
14710
14965
|
exports.TonConnectUI = TonConnectUI;
|
|
14966
|
+
exports.TonConnectUIContext = TonConnectUIContext;
|
|
14711
14967
|
exports.TonConnectUIError = TonConnectUIError;
|
|
14712
14968
|
exports.TonConnectUIProvider = TonConnectUIProvider$1;
|
|
14713
14969
|
exports.TonConnectUIReactError = TonConnectUIReactError;
|