@sonarwatch/portfolio-plugins 0.11.218 → 0.11.219
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +4 -0
- package/package.json +2 -2
- package/src/index.js +4 -0
- package/src/index.js.map +1 -1
- package/src/plugins/bonfida/constants.d.ts +5 -0
- package/src/plugins/bonfida/constants.js +15 -0
- package/src/plugins/bonfida/constants.js.map +1 -0
- package/src/plugins/bonfida/index.d.ts +6 -0
- package/src/plugins/bonfida/index.js +12 -0
- package/src/plugins/bonfida/index.js.map +1 -0
- package/src/plugins/bonfida/offersFetcher.d.ts +3 -0
- package/src/plugins/bonfida/offersFetcher.js +78 -0
- package/src/plugins/bonfida/offersFetcher.js.map +1 -0
- package/src/plugins/bonfida/structs.d.ts +27 -0
- package/src/plugins/bonfida/structs.js +29 -0
- package/src/plugins/bonfida/structs.js.map +1 -0
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
4
4
|
|
5
|
+
## [0.11.219](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.218...plugins-0.11.219) (2024-05-27)
|
6
|
+
|
7
|
+
|
8
|
+
|
5
9
|
## [0.11.218](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.217...plugins-0.11.218) (2024-05-27)
|
6
10
|
|
7
11
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sonarwatch/portfolio-plugins",
|
3
|
-
"version": "0.11.
|
3
|
+
"version": "0.11.219",
|
4
4
|
"type": "commonjs",
|
5
5
|
"generators": "./generators.json",
|
6
6
|
"dependencies": {
|
@@ -42,7 +42,7 @@
|
|
42
42
|
"web3-v1": "npm:web3@^1.5.0"
|
43
43
|
},
|
44
44
|
"peerDependencies": {
|
45
|
-
"@sonarwatch/portfolio-core": "0.11.
|
45
|
+
"@sonarwatch/portfolio-core": "0.11.219"
|
46
46
|
},
|
47
47
|
"main": "./src/index.js",
|
48
48
|
"types": "./src/index.d.ts"
|
package/src/index.js
CHANGED
@@ -112,6 +112,7 @@ const kriya_1 = require("./plugins/kriya");
|
|
112
112
|
const haedal_1 = require("./plugins/haedal");
|
113
113
|
const flowx_1 = require("./plugins/flowx");
|
114
114
|
const mole_1 = require("./plugins/mole");
|
115
|
+
const bonfida_1 = require("./plugins/bonfida");
|
115
116
|
var constants_1 = require("./plugins/tokens/constants");
|
116
117
|
Object.defineProperty(exports, "walletTokensPlatform", { enumerable: true, get: function () { return constants_1.walletTokensPlatform; } });
|
117
118
|
Object.defineProperty(exports, "walletNftsPlatform", { enumerable: true, get: function () { return constants_1.walletNftsPlatform; } });
|
@@ -217,6 +218,7 @@ exports.platforms = [
|
|
217
218
|
...kriya_1.platforms,
|
218
219
|
...haedal_1.platforms,
|
219
220
|
...mole_1.platforms,
|
221
|
+
...bonfida_1.platforms,
|
220
222
|
];
|
221
223
|
// JOBS //
|
222
224
|
exports.jobs = [
|
@@ -305,6 +307,7 @@ exports.jobs = [
|
|
305
307
|
...haedal_1.jobs,
|
306
308
|
...flowx_1.jobs,
|
307
309
|
...mole_1.jobs,
|
310
|
+
...bonfida_1.jobs,
|
308
311
|
];
|
309
312
|
// FETCHERS //
|
310
313
|
exports.fetchers = [
|
@@ -395,6 +398,7 @@ exports.fetchers = [
|
|
395
398
|
...haedal_1.fetchers,
|
396
399
|
...flowx_1.fetchers,
|
397
400
|
...mole_1.fetchers,
|
401
|
+
...bonfida_1.fetchers,
|
398
402
|
];
|
399
403
|
exports.fetchersByAddressSystem = (0, getFetchersByAddressSystem_1.getFetchersByAddressSystem)(exports.fetchers);
|
400
404
|
exports.airdropFetchers = [
|
package/src/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/plugins/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAIA,wFAAqF;AACrF,sEAA8C;AAC9C,6CAI0B;AAC1B,yD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,6CAI0B;AAC1B,yCAIwB;AACxB,mDAI6B;AAC7B,2CAIyB;AACzB,mDAI6B;AAC7B,2CAIyB;AACzB,6CAI0B;AAC1B,2CAIyB;AACzB,yCAIwB;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/plugins/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAIA,wFAAqF;AACrF,sEAA8C;AAC9C,6CAI0B;AAC1B,yDAIgC;AAChC,uDAAgE;AAChE,iDAG4B;AAC5B,iDAI4B;AAC5B,2CAGyB;AACzB,6CAI0B;AAC1B,+CAI2B;AAC3B,yCAIwB;AACxB,+CAI2B;AAC3B,2CAIyB;AACzB,6CAI0B;AAC1B,2CAIyB;AACzB,6CAG0B;AAC1B,6CAI0B;AAC1B,yCAIwB;AACxB,2DAGiC;AACjC,6CAI0B;AAC1B,2CAKyB;AACzB,2CAIyB;AACzB,qDAA6D;AAC7D,qEAIsC;AACtC,uDAI+B;AAC/B,mDAI6B;AAC7B,qDAG8B;AAC9B,uDAG+B;AAC/B,2CAIyB;AACzB,6CAI0B;AAC1B,6CAG0B;AAC1B,yCAIwB;AACxB,+CAI2B;AAC3B,uDAG+B;AAC/B,yCAGwB;AACxB,2CAIyB;AACzB,iDAI4B;AAC5B,iDAI4B;AAC5B,6CAI0B;AAC1B,+CAI2B;AAC3B,qDAG8B;AAC9B,iDAI4B;AAC5B,iDAI4B;AAC5B,mDAG6B;AAC7B,yCAIwB;AACxB,2CAIyB;AACzB,iDAI4B;AAC5B,iDAI4B;AAC5B,+CAI2B;AAC3B,yCAIwB;AACxB,2CAIyB;AACzB,mDAI6B;AAC7B,2CAIyB;AACzB,2CAIyB;AACzB,sCAIsB;AACtB,+CAI2B;AAC3B,yCAIwB;AACxB,iDAI4B;AAC5B,yCAIwB;AACxB,mDAI6B;AAC7B,qDAI8B;AAC9B,2CAIyB;AACzB,2CAKyB;AACzB,yCAIwB;AACxB,+CAI2B;AAC3B,2CAIyB;AAC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B;IACnB,GAAG,kBAAe;IAClB,GAAG,eAAY;IACf,GAAG,gBAAa;IAChB,GAAG,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,gBAAa;IAChB,GAAG,cAAe;IAClB,GAAG,kBAAe;IAClB,GAAG,eAAY;IACf,GAAG,mBAAgB;IACnB,GAAG,eAAY;IACf,GAAG,oBAAiB;IACpB,GAAG,kBAAe;IAClB,GAAG,qBAAkB;IACrB,GAAG,gBAAa;IAChB,GAAG,gBAAa;IAChB,GAAG,eAAY;IACf,GAAG,kBAAe;IAClB,GAAG,gBAAa;IAChB,GAAG,gBAAa;IAChB,GAAG,sBAAmB;IACtB,GAAG,yBAAsB;IACzB,GAAG,gBAAa;IAChB,GAAG,eAAY;IACf,GAAG,oBAAiB;IACpB,GAAG,iBAAc;IACjB,GAAG,2BAAsB;IACzB,GAAG,yBAAkB;IACrB,GAAG,eAAY;IACf,GAAG,cAAW;IACd,GAAG,kBAAe;IAClB,GAAG,mBAAgB;IACnB,GAAG,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,kBAAe;IAClB,GAAG,cAAW;IACd,GAAG,mBAAgB;IACnB,GAAG,eAAY;IACf,GAAG,iBAAc;IACjB,GAAG,eAAY;IACf,GAAG,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,iBAAc;IACjB,GAAG,gBAAa;IAChB,GAAG,eAAY;IACf,GAAG,kBAAe;CACnB,CAAC;AACW,QAAA,uBAAuB,GAAG,IAAA,uDAA0B,EAAC,gBAAQ,CAAC,CAAC;AAE/D,QAAA,eAAe,GAAqB;IAC/C,sBAAmB;IACnB,sBAAmB;CACpB,CAAC;AACW,QAAA,8BAA8B,GACzC,IAAA,uDAA0B,EAAC,uBAAe,CAAC,CAAC"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.offerPid = exports.platform = exports.platformId = void 0;
|
4
|
+
const web3_js_1 = require("@solana/web3.js");
|
5
|
+
exports.platformId = 'bonfida';
|
6
|
+
exports.platform = {
|
7
|
+
id: exports.platformId,
|
8
|
+
name: 'Bonfida (SNS)',
|
9
|
+
image: 'https://sonar.watch/img/platforms/bonfida.webp',
|
10
|
+
website: 'https://www.sns.id/',
|
11
|
+
twitter: 'https://twitter.com/bonfida',
|
12
|
+
defiLlamaId: 'solana-name-service', // from https://defillama.com/docs/api
|
13
|
+
};
|
14
|
+
exports.offerPid = new web3_js_1.PublicKey('85iDfUvr3HJyLM2zcq5BXSiDvUWfw6cSE1FfNBo8Ap29');
|
15
|
+
//# sourceMappingURL=constants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bonfida/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,gDAAgD;IACvD,OAAO,EAAE,qBAAqB;IAC9B,OAAO,EAAE,6BAA6B;IACtC,WAAW,EAAE,qBAAqB,EAAE,sCAAsC;CAC3E,CAAC;AAEW,QAAA,QAAQ,GAAG,IAAI,mBAAS,CACnC,8CAA8C,CAC/C,CAAC"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.fetchers = exports.jobs = exports.platforms = void 0;
|
7
|
+
const constants_1 = require("./constants");
|
8
|
+
const offersFetcher_1 = __importDefault(require("./offersFetcher"));
|
9
|
+
exports.platforms = [constants_1.platform];
|
10
|
+
exports.jobs = [];
|
11
|
+
exports.fetchers = [offersFetcher_1.default];
|
12
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bonfida/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,oEAA4C;AAE/B,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,EAAE,CAAC;AACjB,QAAA,QAAQ,GAAc,CAAC,uBAAa,CAAC,CAAC"}
|
@@ -0,0 +1,78 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
+
};
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
|
+
const constants_1 = require("./constants");
|
17
|
+
const clients_1 = require("../../utils/clients");
|
18
|
+
const solana_1 = require("../../utils/solana");
|
19
|
+
const structs_1 = require("./structs");
|
20
|
+
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
21
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
22
|
+
const connection = (0, clients_1.getClientSolana)();
|
23
|
+
const categoryOfferAccounts = yield (0, solana_1.getParsedProgramAccounts)(connection, structs_1.categoryOfferStruct, constants_1.offerPid, [
|
24
|
+
{ memcmp: { offset: 0, bytes: 'C' } },
|
25
|
+
{
|
26
|
+
memcmp: {
|
27
|
+
bytes: owner,
|
28
|
+
offset: 50,
|
29
|
+
},
|
30
|
+
},
|
31
|
+
]);
|
32
|
+
const offerAccounts = yield (0, solana_1.getParsedProgramAccounts)(connection, structs_1.offerStruct, constants_1.offerPid, [
|
33
|
+
{ memcmp: { offset: 0, bytes: '2' } },
|
34
|
+
{
|
35
|
+
memcmp: {
|
36
|
+
bytes: owner,
|
37
|
+
offset: 34,
|
38
|
+
},
|
39
|
+
},
|
40
|
+
]);
|
41
|
+
if (offerAccounts.length === 0 && categoryOfferAccounts.length === 0)
|
42
|
+
return [];
|
43
|
+
const tokenPrices = yield cache.getTokenPricesAsMap([...offerAccounts.map((a) => a.mint.toString()), portfolio_core_1.solanaNativeAddress], portfolio_core_1.NetworkId.solana);
|
44
|
+
const assets = [];
|
45
|
+
[
|
46
|
+
...offerAccounts,
|
47
|
+
...categoryOfferAccounts.map((a) => (Object.assign(Object.assign({}, a), { mint: portfolio_core_1.solanaNativeAddress }))),
|
48
|
+
].forEach((acc) => {
|
49
|
+
if (acc.amount.isZero())
|
50
|
+
return;
|
51
|
+
const tokenPrice = tokenPrices.get(acc.mint.toString());
|
52
|
+
if (!tokenPrice)
|
53
|
+
return;
|
54
|
+
const amount = acc.amount.div(Math.pow(10, tokenPrice.decimals)).toNumber();
|
55
|
+
const asset = (0, tokenPriceToAssetToken_1.default)(acc.mint.toString(), amount, portfolio_core_1.NetworkId.solana, tokenPrice);
|
56
|
+
assets.push(asset);
|
57
|
+
});
|
58
|
+
if (assets.length === 0)
|
59
|
+
return [];
|
60
|
+
const element = {
|
61
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
62
|
+
label: 'Deposit',
|
63
|
+
platformId: constants_1.platformId,
|
64
|
+
type: portfolio_core_1.PortfolioElementType.multiple,
|
65
|
+
value: (0, portfolio_core_1.getUsdValueSum)(assets.map((a) => a.value)),
|
66
|
+
data: {
|
67
|
+
assets,
|
68
|
+
},
|
69
|
+
};
|
70
|
+
return [element];
|
71
|
+
});
|
72
|
+
const fetcher = {
|
73
|
+
id: `${constants_1.platformId}-offers`,
|
74
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
75
|
+
executor,
|
76
|
+
};
|
77
|
+
exports.default = fetcher;
|
78
|
+
//# sourceMappingURL=offersFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"offersFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bonfida/offersFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAOoC;AAEpC,2CAAmD;AAEnD,iDAAsD;AACtD,+CAA8D;AAC9D,uCAA6D;AAC7D,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,qBAAqB,GAAG,MAAM,IAAA,iCAAwB,EAC1D,UAAU,EACV,6BAAmB,EACnB,oBAAQ,EACR;QACE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;QACrC;YACE,MAAM,EAAE;gBACN,KAAK,EAAE,KAAK;gBACZ,MAAM,EAAE,EAAE;aACX;SACF;KACF,CACF,CAAC;IAEF,MAAM,aAAa,GAAG,MAAM,IAAA,iCAAwB,EAClD,UAAU,EACV,qBAAW,EACX,oBAAQ,EACR;QACE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;QACrC;YACE,MAAM,EAAE;gBACN,KAAK,EAAE,KAAK;gBACZ,MAAM,EAAE,EAAE;aACX;SACF;KACF,CACF,CAAC;IACF,IAAI,aAAa,CAAC,MAAM,KAA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EAAV,sBAAU;QACV,IAAI,EAAE,qCAAoB,CAAC,QAAQ;QACnC,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACjD,IAAI,EAAE;YACJ,MAAM;SACP;KACF,CAAC;IACF,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,SAAS;IAC1B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { BeetStruct } from '@metaplex-foundation/beet';
|
3
|
+
import { PublicKey } from '@solana/web3.js';
|
4
|
+
import BigNumber from 'bignumber.js';
|
5
|
+
export declare enum State {
|
6
|
+
Uninitialized = 0,
|
7
|
+
StakePool = 1,
|
8
|
+
InactiveStakePool = 2,
|
9
|
+
StakeAccount = 3
|
10
|
+
}
|
11
|
+
export type Offer = {
|
12
|
+
buffer: Buffer;
|
13
|
+
domain: PublicKey;
|
14
|
+
owner: PublicKey;
|
15
|
+
mint: PublicKey;
|
16
|
+
amount: BigNumber;
|
17
|
+
tokenAccount: PublicKey;
|
18
|
+
};
|
19
|
+
export declare const offerStruct: BeetStruct<Offer, Partial<Offer>>;
|
20
|
+
export type CategoryOffer = {
|
21
|
+
buffer: Buffer;
|
22
|
+
idk: BigNumber;
|
23
|
+
amount: BigNumber;
|
24
|
+
categoryAccount: PublicKey;
|
25
|
+
owner: PublicKey;
|
26
|
+
};
|
27
|
+
export declare const categoryOfferStruct: BeetStruct<CategoryOffer, Partial<CategoryOffer>>;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.categoryOfferStruct = exports.offerStruct = exports.State = void 0;
|
4
|
+
const beet_1 = require("@metaplex-foundation/beet");
|
5
|
+
const beet_solana_1 = require("@metaplex-foundation/beet-solana");
|
6
|
+
const solana_1 = require("../../utils/solana");
|
7
|
+
var State;
|
8
|
+
(function (State) {
|
9
|
+
State[State["Uninitialized"] = 0] = "Uninitialized";
|
10
|
+
State[State["StakePool"] = 1] = "StakePool";
|
11
|
+
State[State["InactiveStakePool"] = 2] = "InactiveStakePool";
|
12
|
+
State[State["StakeAccount"] = 3] = "StakeAccount";
|
13
|
+
})(State || (exports.State = State = {}));
|
14
|
+
exports.offerStruct = new beet_1.BeetStruct([
|
15
|
+
['buffer', (0, solana_1.blob)(2)],
|
16
|
+
['domain', beet_solana_1.publicKey],
|
17
|
+
['owner', beet_solana_1.publicKey],
|
18
|
+
['mint', beet_solana_1.publicKey],
|
19
|
+
['amount', solana_1.u64],
|
20
|
+
['tokenAccount', beet_solana_1.publicKey],
|
21
|
+
], (args) => args);
|
22
|
+
exports.categoryOfferStruct = new beet_1.BeetStruct([
|
23
|
+
['buffer', (0, solana_1.blob)(2)],
|
24
|
+
['idk', solana_1.u64],
|
25
|
+
['amount', solana_1.u64],
|
26
|
+
['categoryAccount', beet_solana_1.publicKey],
|
27
|
+
['owner', beet_solana_1.publicKey],
|
28
|
+
], (args) => args);
|
29
|
+
//# sourceMappingURL=structs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bonfida/structs.ts"],"names":[],"mappings":";;;AAAA,oDAAuD;AACvD,kEAA6D;AAG7D,+CAA+C;AAE/C,IAAY,KAKX;AALD,WAAY,KAAK;IACf,mDAAa,CAAA;IACb,2CAAS,CAAA;IACT,2DAAiB,CAAA;IACjB,iDAAY,CAAA;AACd,CAAC,EALW,KAAK,qBAAL,KAAK,QAKhB;AAWY,QAAA,WAAW,GAAG,IAAI,iBAAU,CACvC;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,QAAQ,EAAE,uBAAS,CAAC;IACrB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,MAAM,EAAE,uBAAS,CAAC;IACnB,CAAC,QAAQ,EAAE,YAAG,CAAC;IACf,CAAC,cAAc,EAAE,uBAAS,CAAC;CAC5B,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAa,CACxB,CAAC;AAUW,QAAA,mBAAmB,GAAG,IAAI,iBAAU,CAC/C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,KAAK,EAAE,YAAG,CAAC;IACZ,CAAC,QAAQ,EAAE,YAAG,CAAC;IACf,CAAC,iBAAiB,EAAE,uBAAS,CAAC;IAC9B,CAAC,OAAO,EAAE,uBAAS,CAAC;CACrB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAqB,CAChC,CAAC"}
|