@learncard/react 2.3.17 → 2.3.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{VCCard-01443d15.js → VCCard-ef452696.js} +1930 -2466
- package/dist/{esm/VCCard-53ba862f.js.map → cjs/VCCard-ef452696.js.map} +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index15.js +1 -1
- package/dist/cjs/index5.js +1 -1
- package/dist/esm/{VCCard-53ba862f.js → VCCard-9a58a5f4.js} +1930 -2466
- package/dist/{cjs/VCCard-01443d15.js.map → esm/VCCard-9a58a5f4.js.map} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index15.js +1 -1
- package/dist/esm/index5.js +1 -1
- package/package.json +2 -2
|
@@ -143399,232 +143399,6 @@ var require_src3 = __commonJS({
|
|
|
143399
143399
|
};
|
|
143400
143400
|
}
|
|
143401
143401
|
});
|
|
143402
|
-
var require_erc20_abi = __commonJS({
|
|
143403
|
-
"src/wallet/plugins/EthereumPlugin/erc20.abi.json"(exports, module) {
|
|
143404
|
-
module.exports = [
|
|
143405
|
-
{
|
|
143406
|
-
constant: true,
|
|
143407
|
-
inputs: [],
|
|
143408
|
-
name: "name",
|
|
143409
|
-
outputs: [
|
|
143410
|
-
{
|
|
143411
|
-
name: "",
|
|
143412
|
-
type: "string"
|
|
143413
|
-
}
|
|
143414
|
-
],
|
|
143415
|
-
payable: false,
|
|
143416
|
-
stateMutability: "view",
|
|
143417
|
-
type: "function"
|
|
143418
|
-
},
|
|
143419
|
-
{
|
|
143420
|
-
constant: false,
|
|
143421
|
-
inputs: [
|
|
143422
|
-
{
|
|
143423
|
-
name: "_spender",
|
|
143424
|
-
type: "address"
|
|
143425
|
-
},
|
|
143426
|
-
{
|
|
143427
|
-
name: "_value",
|
|
143428
|
-
type: "uint256"
|
|
143429
|
-
}
|
|
143430
|
-
],
|
|
143431
|
-
name: "approve",
|
|
143432
|
-
outputs: [
|
|
143433
|
-
{
|
|
143434
|
-
name: "",
|
|
143435
|
-
type: "bool"
|
|
143436
|
-
}
|
|
143437
|
-
],
|
|
143438
|
-
payable: false,
|
|
143439
|
-
stateMutability: "nonpayable",
|
|
143440
|
-
type: "function"
|
|
143441
|
-
},
|
|
143442
|
-
{
|
|
143443
|
-
constant: true,
|
|
143444
|
-
inputs: [],
|
|
143445
|
-
name: "totalSupply",
|
|
143446
|
-
outputs: [
|
|
143447
|
-
{
|
|
143448
|
-
name: "",
|
|
143449
|
-
type: "uint256"
|
|
143450
|
-
}
|
|
143451
|
-
],
|
|
143452
|
-
payable: false,
|
|
143453
|
-
stateMutability: "view",
|
|
143454
|
-
type: "function"
|
|
143455
|
-
},
|
|
143456
|
-
{
|
|
143457
|
-
constant: false,
|
|
143458
|
-
inputs: [
|
|
143459
|
-
{
|
|
143460
|
-
name: "_from",
|
|
143461
|
-
type: "address"
|
|
143462
|
-
},
|
|
143463
|
-
{
|
|
143464
|
-
name: "_to",
|
|
143465
|
-
type: "address"
|
|
143466
|
-
},
|
|
143467
|
-
{
|
|
143468
|
-
name: "_value",
|
|
143469
|
-
type: "uint256"
|
|
143470
|
-
}
|
|
143471
|
-
],
|
|
143472
|
-
name: "transferFrom",
|
|
143473
|
-
outputs: [
|
|
143474
|
-
{
|
|
143475
|
-
name: "",
|
|
143476
|
-
type: "bool"
|
|
143477
|
-
}
|
|
143478
|
-
],
|
|
143479
|
-
payable: false,
|
|
143480
|
-
stateMutability: "nonpayable",
|
|
143481
|
-
type: "function"
|
|
143482
|
-
},
|
|
143483
|
-
{
|
|
143484
|
-
constant: true,
|
|
143485
|
-
inputs: [],
|
|
143486
|
-
name: "decimals",
|
|
143487
|
-
outputs: [
|
|
143488
|
-
{
|
|
143489
|
-
name: "",
|
|
143490
|
-
type: "uint8"
|
|
143491
|
-
}
|
|
143492
|
-
],
|
|
143493
|
-
payable: false,
|
|
143494
|
-
stateMutability: "view",
|
|
143495
|
-
type: "function"
|
|
143496
|
-
},
|
|
143497
|
-
{
|
|
143498
|
-
constant: true,
|
|
143499
|
-
inputs: [
|
|
143500
|
-
{
|
|
143501
|
-
name: "_owner",
|
|
143502
|
-
type: "address"
|
|
143503
|
-
}
|
|
143504
|
-
],
|
|
143505
|
-
name: "balanceOf",
|
|
143506
|
-
outputs: [
|
|
143507
|
-
{
|
|
143508
|
-
name: "balance",
|
|
143509
|
-
type: "uint256"
|
|
143510
|
-
}
|
|
143511
|
-
],
|
|
143512
|
-
payable: false,
|
|
143513
|
-
stateMutability: "view",
|
|
143514
|
-
type: "function"
|
|
143515
|
-
},
|
|
143516
|
-
{
|
|
143517
|
-
constant: true,
|
|
143518
|
-
inputs: [],
|
|
143519
|
-
name: "symbol",
|
|
143520
|
-
outputs: [
|
|
143521
|
-
{
|
|
143522
|
-
name: "",
|
|
143523
|
-
type: "string"
|
|
143524
|
-
}
|
|
143525
|
-
],
|
|
143526
|
-
payable: false,
|
|
143527
|
-
stateMutability: "view",
|
|
143528
|
-
type: "function"
|
|
143529
|
-
},
|
|
143530
|
-
{
|
|
143531
|
-
constant: false,
|
|
143532
|
-
inputs: [
|
|
143533
|
-
{
|
|
143534
|
-
name: "_to",
|
|
143535
|
-
type: "address"
|
|
143536
|
-
},
|
|
143537
|
-
{
|
|
143538
|
-
name: "_value",
|
|
143539
|
-
type: "uint256"
|
|
143540
|
-
}
|
|
143541
|
-
],
|
|
143542
|
-
name: "transfer",
|
|
143543
|
-
outputs: [
|
|
143544
|
-
{
|
|
143545
|
-
name: "",
|
|
143546
|
-
type: "bool"
|
|
143547
|
-
}
|
|
143548
|
-
],
|
|
143549
|
-
payable: false,
|
|
143550
|
-
stateMutability: "nonpayable",
|
|
143551
|
-
type: "function"
|
|
143552
|
-
},
|
|
143553
|
-
{
|
|
143554
|
-
constant: true,
|
|
143555
|
-
inputs: [
|
|
143556
|
-
{
|
|
143557
|
-
name: "_owner",
|
|
143558
|
-
type: "address"
|
|
143559
|
-
},
|
|
143560
|
-
{
|
|
143561
|
-
name: "_spender",
|
|
143562
|
-
type: "address"
|
|
143563
|
-
}
|
|
143564
|
-
],
|
|
143565
|
-
name: "allowance",
|
|
143566
|
-
outputs: [
|
|
143567
|
-
{
|
|
143568
|
-
name: "",
|
|
143569
|
-
type: "uint256"
|
|
143570
|
-
}
|
|
143571
|
-
],
|
|
143572
|
-
payable: false,
|
|
143573
|
-
stateMutability: "view",
|
|
143574
|
-
type: "function"
|
|
143575
|
-
},
|
|
143576
|
-
{
|
|
143577
|
-
payable: true,
|
|
143578
|
-
stateMutability: "payable",
|
|
143579
|
-
type: "fallback"
|
|
143580
|
-
},
|
|
143581
|
-
{
|
|
143582
|
-
anonymous: false,
|
|
143583
|
-
inputs: [
|
|
143584
|
-
{
|
|
143585
|
-
indexed: true,
|
|
143586
|
-
name: "owner",
|
|
143587
|
-
type: "address"
|
|
143588
|
-
},
|
|
143589
|
-
{
|
|
143590
|
-
indexed: true,
|
|
143591
|
-
name: "spender",
|
|
143592
|
-
type: "address"
|
|
143593
|
-
},
|
|
143594
|
-
{
|
|
143595
|
-
indexed: false,
|
|
143596
|
-
name: "value",
|
|
143597
|
-
type: "uint256"
|
|
143598
|
-
}
|
|
143599
|
-
],
|
|
143600
|
-
name: "Approval",
|
|
143601
|
-
type: "event"
|
|
143602
|
-
},
|
|
143603
|
-
{
|
|
143604
|
-
anonymous: false,
|
|
143605
|
-
inputs: [
|
|
143606
|
-
{
|
|
143607
|
-
indexed: true,
|
|
143608
|
-
name: "from",
|
|
143609
|
-
type: "address"
|
|
143610
|
-
},
|
|
143611
|
-
{
|
|
143612
|
-
indexed: true,
|
|
143613
|
-
name: "to",
|
|
143614
|
-
type: "address"
|
|
143615
|
-
},
|
|
143616
|
-
{
|
|
143617
|
-
indexed: false,
|
|
143618
|
-
name: "value",
|
|
143619
|
-
type: "uint256"
|
|
143620
|
-
}
|
|
143621
|
-
],
|
|
143622
|
-
name: "Transfer",
|
|
143623
|
-
type: "event"
|
|
143624
|
-
}
|
|
143625
|
-
];
|
|
143626
|
-
}
|
|
143627
|
-
});
|
|
143628
143402
|
if (typeof window === "undefined")
|
|
143629
143403
|
globalThis.crypto = crypto2;
|
|
143630
143404
|
var addPluginToWallet = /* @__PURE__ */ __name((wallet, plugin) => __async$1(void 0, null, function* () {
|
|
@@ -150645,7 +150419,7 @@ function toUint8Array(str) {
|
|
|
150645
150419
|
return new Uint8Array(bytes);
|
|
150646
150420
|
}
|
|
150647
150421
|
__name(toUint8Array, "toUint8Array");
|
|
150648
|
-
|
|
150422
|
+
__toESM(require_lib());
|
|
150649
150423
|
var import_ed255192 = __toESM(require_ed25519(), 1);
|
|
150650
150424
|
var import_fast_json_stable_stringify = __toESM(require_fast_json_stable_stringify(), 1);
|
|
150651
150425
|
var B642 = "base64pad";
|
|
@@ -155842,836 +155616,1281 @@ var CeramicClient = class {
|
|
|
155842
155616
|
}
|
|
155843
155617
|
};
|
|
155844
155618
|
__name(CeramicClient, "CeramicClient");
|
|
155845
|
-
var
|
|
155846
|
-
|
|
155847
|
-
|
|
155848
|
-
|
|
155849
|
-
|
|
155850
|
-
|
|
155851
|
-
|
|
155852
|
-
client.did.setProvider(ceramicProvider);
|
|
155853
|
-
yield client.did.authenticate();
|
|
155854
|
-
return client;
|
|
155855
|
-
}), "getCeramicClientFromWalletSuite");
|
|
155856
|
-
var getIDXPlugin = /* @__PURE__ */ __name((_0, _1) => __async$1(void 0, [_0, _1], function* (wallet, { modelData, credentialAlias, ceramicEndpoint, defaultContentFamily }) {
|
|
155857
|
-
const ceramic = yield getCeramicClientFromWalletSuite(wallet, ceramicEndpoint);
|
|
155858
|
-
const loader = new TileLoader({ ceramic });
|
|
155859
|
-
const dataStore = new DIDDataStore({ ceramic, model: modelData });
|
|
155860
|
-
const getCredentialsListFromIdx = /* @__PURE__ */ __name((..._02) => __async$1(void 0, [..._02], function* (alias = credentialAlias) {
|
|
155861
|
-
return (yield dataStore.get(alias)) || { credentials: [] };
|
|
155862
|
-
}), "getCredentialsListFromIdx");
|
|
155863
|
-
const addCredentialStreamIdToIdx = /* @__PURE__ */ __name((record, alias) => __async$1(void 0, null, function* () {
|
|
155864
|
-
if (!record)
|
|
155865
|
-
throw new Error("record is required");
|
|
155866
|
-
if (!record.id)
|
|
155867
|
-
throw Error("No streamId provided");
|
|
155868
|
-
if (record.id.indexOf("ceramic://") === -1)
|
|
155869
|
-
record.id = "ceramic://" + record.id;
|
|
155870
|
-
if (!alias)
|
|
155871
|
-
alias = credentialAlias;
|
|
155872
|
-
const existing = yield getCredentialsListFromIdx(alias);
|
|
155873
|
-
const indexOfExistingCredential = existing.credentials.findIndex((credential) => {
|
|
155874
|
-
return credential.title === record.title;
|
|
155875
|
-
});
|
|
155876
|
-
if (indexOfExistingCredential > -1) {
|
|
155877
|
-
existing.credentials[indexOfExistingCredential] = __spreadValues({
|
|
155878
|
-
storageType: "ceramic"
|
|
155879
|
-
}, record);
|
|
155880
|
-
} else
|
|
155881
|
-
existing.credentials.push(__spreadValues({ storageType: "ceramic" }, record));
|
|
155882
|
-
return dataStore.set(alias, existing);
|
|
155883
|
-
}), "addCredentialStreamIdToIdx");
|
|
155884
|
-
const removeCredentialFromIdx = /* @__PURE__ */ __name((title, alias) => __async$1(void 0, null, function* () {
|
|
155885
|
-
if (!title)
|
|
155886
|
-
throw new Error("record is required");
|
|
155887
|
-
if (!alias)
|
|
155888
|
-
alias = credentialAlias;
|
|
155889
|
-
const existing = yield getCredentialsListFromIdx(alias);
|
|
155890
|
-
existing.credentials = existing.credentials.filter((credential) => credential.title !== title);
|
|
155891
|
-
return dataStore.set(alias, existing);
|
|
155892
|
-
}), "removeCredentialFromIdx");
|
|
155893
|
-
const publishContentToCeramic = /* @__PURE__ */ __name((_02, ..._12) => __async$1(void 0, [_02, ..._12], function* (content, metadata = {}, options = {}) {
|
|
155894
|
-
if (!content)
|
|
155895
|
-
throw new Error("content is required");
|
|
155896
|
-
if (!metadata.controllers)
|
|
155897
|
-
metadata.controllers = [ceramic.did.id];
|
|
155898
|
-
if (!metadata.family)
|
|
155899
|
-
metadata.family = defaultContentFamily;
|
|
155900
|
-
if (!("pin" in options))
|
|
155901
|
-
options.pin = true;
|
|
155902
|
-
const doc = yield TileDocument.create(ceramic, content, metadata, options);
|
|
155903
|
-
return doc.id.toString();
|
|
155904
|
-
}), "publishContentToCeramic");
|
|
155905
|
-
const readContentFromCeramic = /* @__PURE__ */ __name((streamId) => __async$1(void 0, null, function* () {
|
|
155906
|
-
var _a;
|
|
155907
|
-
return (_a = yield loader.load(streamId)) == null ? void 0 : _a.content;
|
|
155908
|
-
}), "readContentFromCeramic");
|
|
155909
|
-
return {
|
|
155910
|
-
pluginMethods: {
|
|
155911
|
-
getCredentialsListFromIdx: (_02, ..._12) => __async$1(void 0, [_02, ..._12], function* (_wallet, alias = credentialAlias) {
|
|
155912
|
-
return getCredentialsListFromIdx(alias);
|
|
155913
|
-
}),
|
|
155914
|
-
publishContentToCeramic: (_wallet, cred) => __async$1(void 0, null, function* () {
|
|
155915
|
-
return publishContentToCeramic(cred);
|
|
155916
|
-
}),
|
|
155917
|
-
readContentFromCeramic: (_wallet, streamId) => __async$1(void 0, null, function* () {
|
|
155918
|
-
return readContentFromCeramic(streamId);
|
|
155919
|
-
}),
|
|
155920
|
-
getVerifiableCredentialFromIdx: (_wallet, title) => __async$1(void 0, null, function* () {
|
|
155921
|
-
var _a;
|
|
155922
|
-
const credentialList = yield getCredentialsListFromIdx();
|
|
155923
|
-
const credential = (_a = credentialList == null ? void 0 : credentialList.credentials) == null ? void 0 : _a.find((cred) => (cred == null ? void 0 : cred.title) === title);
|
|
155924
|
-
return credential && (yield readContentFromCeramic(credential.id));
|
|
155925
|
-
}),
|
|
155926
|
-
getVerifiableCredentialsFromIdx: () => __async$1(void 0, null, function* () {
|
|
155927
|
-
var _a, _b;
|
|
155928
|
-
const credentialList = yield getCredentialsListFromIdx();
|
|
155929
|
-
const streamIds = (_b = (_a = credentialList == null ? void 0 : credentialList.credentials) == null ? void 0 : _a.map((credential) => credential == null ? void 0 : credential.id)) != null ? _b : [];
|
|
155930
|
-
return Promise.all(streamIds.map((streamId) => __async$1(void 0, null, function* () {
|
|
155931
|
-
return readContentFromCeramic(streamId);
|
|
155932
|
-
})));
|
|
155933
|
-
}),
|
|
155934
|
-
addVerifiableCredentialInIdx: (_02, _12) => __async$1(void 0, [_02, _12], function* (_wallet, { title, id }) {
|
|
155935
|
-
return addCredentialStreamIdToIdx({ title, id });
|
|
155936
|
-
}),
|
|
155937
|
-
removeVerifiableCredentialInIdx: (_wallet, title) => __async$1(void 0, null, function* () {
|
|
155938
|
-
return removeCredentialFromIdx(title);
|
|
155939
|
-
})
|
|
155940
|
-
}
|
|
155941
|
-
};
|
|
155942
|
-
}), "getIDXPlugin");
|
|
155943
|
-
var ED25519_METHODS = ["key", "tz", "pkh:tz", "pkh:tezos", "pkh:sol", "pkh:solana"];
|
|
155944
|
-
var SECP256K1_METHODS = [
|
|
155945
|
-
"key",
|
|
155946
|
-
"tz",
|
|
155947
|
-
"ethr",
|
|
155948
|
-
"pkh:tz",
|
|
155949
|
-
"pkh:tezos",
|
|
155950
|
-
"pkh:eth",
|
|
155951
|
-
"pkh:celo",
|
|
155952
|
-
"pkh:poly",
|
|
155953
|
-
"pkh:btc",
|
|
155954
|
-
"pkh:doge",
|
|
155955
|
-
"pkh:eip155",
|
|
155956
|
-
"pkh:bip122"
|
|
155957
|
-
];
|
|
155958
|
-
var isHex = /* @__PURE__ */ __name((str) => /^[0-9a-f]+$/i.test(str), "isHex");
|
|
155959
|
-
var getAlgorithmForDidMethod = /* @__PURE__ */ __name((didMethod) => {
|
|
155960
|
-
if (ED25519_METHODS.includes(didMethod))
|
|
155961
|
-
return "ed25519";
|
|
155962
|
-
if (SECP256K1_METHODS.includes(didMethod) || didMethod.startsWith("pkh:eip155:") || didMethod.startsWith("pkh:bip122:")) {
|
|
155963
|
-
return "secp256k1";
|
|
155964
|
-
}
|
|
155965
|
-
throw new Error("Unspported Did Method");
|
|
155966
|
-
}, "getAlgorithmForDidMethod");
|
|
155967
|
-
var getDidKeyPlugin = /* @__PURE__ */ __name((wallet, key2) => __async$1(void 0, null, function* () {
|
|
155968
|
-
if (key2.length === 0)
|
|
155969
|
-
throw new Error("Please don't use an empty string for a key!");
|
|
155970
|
-
if (!isHex(key2))
|
|
155971
|
-
throw new Error("Key must be a hexadecimal string!");
|
|
155972
|
-
if (key2.length > 64)
|
|
155973
|
-
throw new Error("Key must be less than 64 characters");
|
|
155974
|
-
const seed = key2.padStart(64, "0");
|
|
155975
|
-
const seedBytes = toUint8Array(seed);
|
|
155976
|
-
const memoizedDids = {};
|
|
155977
|
-
const keyPairs = {
|
|
155978
|
-
ed25519: wallet.pluginMethods.generateEd25519KeyFromBytes(seedBytes),
|
|
155979
|
-
secp256k1: wallet.pluginMethods.generateSecp256k1KeyFromBytes(seedBytes)
|
|
155980
|
-
};
|
|
155981
|
-
return {
|
|
155982
|
-
pluginMethods: {
|
|
155983
|
-
getSubjectDid: (_wallet, type) => {
|
|
155984
|
-
if (!memoizedDids[type]) {
|
|
155985
|
-
const algorithm = getAlgorithmForDidMethod(type);
|
|
155986
|
-
memoizedDids[type] = wallet.pluginMethods.keyToDid(type, keyPairs[algorithm]);
|
|
155987
|
-
}
|
|
155988
|
-
return memoizedDids[type];
|
|
155989
|
-
},
|
|
155990
|
-
getSubjectKeypair: (_wallet, type = "ed25519") => {
|
|
155991
|
-
if (!keyPairs[type])
|
|
155992
|
-
throw new Error("Unsupported algorithm");
|
|
155993
|
-
return keyPairs[type];
|
|
155994
|
-
},
|
|
155995
|
-
getKey: () => seed
|
|
155996
|
-
}
|
|
155997
|
-
};
|
|
155998
|
-
}), "getDidKeyPlugin");
|
|
155999
|
-
var ExpirationPlugin = /* @__PURE__ */ __name((wallet) => ({
|
|
156000
|
-
pluginMethods: {
|
|
156001
|
-
verifyCredential: (_wallet, credential) => __async$1(void 0, null, function* () {
|
|
156002
|
-
const verificationCheck = yield wallet.pluginMethods.verifyCredential(credential);
|
|
156003
|
-
if (credential.expirationDate && new Date() > new Date(credential.expirationDate)) {
|
|
156004
|
-
verificationCheck.errors.push("expiration error: Credential is expired");
|
|
156005
|
-
} else {
|
|
156006
|
-
verificationCheck.checks.push("expiration");
|
|
156007
|
-
}
|
|
156008
|
-
return verificationCheck;
|
|
156009
|
-
})
|
|
155619
|
+
var wasm;
|
|
155620
|
+
var cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
155621
|
+
cachedTextDecoder.decode();
|
|
155622
|
+
var cachegetUint8Memory0 = null;
|
|
155623
|
+
function getUint8Memory0() {
|
|
155624
|
+
if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {
|
|
155625
|
+
cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
156010
155626
|
}
|
|
156011
|
-
|
|
156012
|
-
|
|
156013
|
-
|
|
156014
|
-
|
|
156015
|
-
|
|
156016
|
-
|
|
156017
|
-
|
|
156018
|
-
|
|
156019
|
-
|
|
156020
|
-
|
|
156021
|
-
|
|
156022
|
-
|
|
156023
|
-
|
|
156024
|
-
|
|
156025
|
-
|
|
156026
|
-
|
|
156027
|
-
|
|
156028
|
-
|
|
156029
|
-
|
|
156030
|
-
|
|
156031
|
-
return
|
|
156032
|
-
|
|
156033
|
-
|
|
156034
|
-
|
|
156035
|
-
|
|
156036
|
-
|
|
156037
|
-
|
|
156038
|
-
|
|
156039
|
-
|
|
156040
|
-
|
|
156041
|
-
|
|
156042
|
-
|
|
156043
|
-
|
|
156044
|
-
|
|
156045
|
-
|
|
156046
|
-
|
|
156047
|
-
var
|
|
156048
|
-
|
|
156049
|
-
|
|
156050
|
-
|
|
156051
|
-
|
|
156052
|
-
|
|
156053
|
-
|
|
156054
|
-
getTestVc: (_wallet, subject = "did:example:d23dd687a7dc6787646f2eb98d0") => {
|
|
156055
|
-
const did = _wallet.pluginMethods.getSubjectDid("key");
|
|
156056
|
-
return {
|
|
156057
|
-
"@context": ["https://www.w3.org/2018/credentials/v1"],
|
|
156058
|
-
id: "http://example.org/credentials/3731",
|
|
156059
|
-
type: ["VerifiableCredential"],
|
|
156060
|
-
issuer: did,
|
|
156061
|
-
issuanceDate: "2020-08-19T21:41:50Z",
|
|
156062
|
-
credentialSubject: { id: subject }
|
|
156063
|
-
};
|
|
156064
|
-
},
|
|
156065
|
-
getTestVp: (_wallet, _credential) => __async$1(void 0, null, function* () {
|
|
156066
|
-
const credential = _credential || (yield _wallet.pluginMethods.issueCredential(_wallet.pluginMethods.getTestVc()));
|
|
156067
|
-
const did = _wallet.pluginMethods.getSubjectDid("key");
|
|
156068
|
-
return {
|
|
156069
|
-
"@context": ["https://www.w3.org/2018/credentials/v1"],
|
|
156070
|
-
type: ["VerifiablePresentation"],
|
|
156071
|
-
holder: did,
|
|
156072
|
-
verifiableCredential: credential
|
|
156073
|
-
};
|
|
156074
|
-
})
|
|
156075
|
-
})
|
|
156076
|
-
};
|
|
156077
|
-
}), "getVCPlugin");
|
|
156078
|
-
var getEthereumPlugin = /* @__PURE__ */ __name((initWallet, config2) => {
|
|
156079
|
-
const { address, infuraProjectId, network = "mainnet" } = config2;
|
|
156080
|
-
let provider;
|
|
156081
|
-
if (infuraProjectId) {
|
|
156082
|
-
provider = new InfuraProvider(network, infuraProjectId);
|
|
156083
|
-
} else {
|
|
156084
|
-
provider = getDefaultProvider(network);
|
|
156085
|
-
}
|
|
156086
|
-
const checkErc20TokenBalance = /* @__PURE__ */ __name((tokenContractAddress) => __async$1(void 0, null, function* () {
|
|
156087
|
-
if (!address) {
|
|
156088
|
-
throw new Error("Can't check balance: No address provided.");
|
|
156089
|
-
}
|
|
156090
|
-
const erc20Abi = require_erc20_abi();
|
|
156091
|
-
const contract = new Contract(tokenContractAddress, erc20Abi, provider);
|
|
156092
|
-
const balance = yield contract.balanceOf(address);
|
|
156093
|
-
const formattedBalance = formatUnits(balance);
|
|
156094
|
-
return formattedBalance;
|
|
156095
|
-
}), "checkErc20TokenBalance");
|
|
155627
|
+
return cachegetUint8Memory0;
|
|
155628
|
+
}
|
|
155629
|
+
__name(getUint8Memory0, "getUint8Memory0");
|
|
155630
|
+
function getStringFromWasm0(ptr, len) {
|
|
155631
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
155632
|
+
}
|
|
155633
|
+
__name(getStringFromWasm0, "getStringFromWasm0");
|
|
155634
|
+
var heap = new Array(32).fill(void 0);
|
|
155635
|
+
heap.push(void 0, null, true, false);
|
|
155636
|
+
var heap_next = heap.length;
|
|
155637
|
+
function addHeapObject(obj) {
|
|
155638
|
+
if (heap_next === heap.length)
|
|
155639
|
+
heap.push(heap.length + 1);
|
|
155640
|
+
const idx = heap_next;
|
|
155641
|
+
heap_next = heap[idx];
|
|
155642
|
+
heap[idx] = obj;
|
|
155643
|
+
return idx;
|
|
155644
|
+
}
|
|
155645
|
+
__name(addHeapObject, "addHeapObject");
|
|
155646
|
+
function getObject(idx) {
|
|
155647
|
+
return heap[idx];
|
|
155648
|
+
}
|
|
155649
|
+
__name(getObject, "getObject");
|
|
155650
|
+
function dropObject(idx) {
|
|
155651
|
+
if (idx < 36)
|
|
155652
|
+
return;
|
|
155653
|
+
heap[idx] = heap_next;
|
|
155654
|
+
heap_next = idx;
|
|
155655
|
+
}
|
|
155656
|
+
__name(dropObject, "dropObject");
|
|
155657
|
+
function takeObject(idx) {
|
|
155658
|
+
const ret = getObject(idx);
|
|
155659
|
+
dropObject(idx);
|
|
155660
|
+
return ret;
|
|
155661
|
+
}
|
|
155662
|
+
__name(takeObject, "takeObject");
|
|
155663
|
+
var WASM_VECTOR_LEN = 0;
|
|
155664
|
+
var cachedTextEncoder = new TextEncoder("utf-8");
|
|
155665
|
+
var encodeString2 = typeof cachedTextEncoder.encodeInto === "function" ? function(arg, view) {
|
|
155666
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
155667
|
+
} : function(arg, view) {
|
|
155668
|
+
const buf2 = cachedTextEncoder.encode(arg);
|
|
155669
|
+
view.set(buf2);
|
|
156096
155670
|
return {
|
|
156097
|
-
|
|
156098
|
-
|
|
156099
|
-
if (!address) {
|
|
156100
|
-
throw new Error("Can't check ETH: No ethereum address provided.");
|
|
156101
|
-
}
|
|
156102
|
-
const balance = yield provider.getBalance(address);
|
|
156103
|
-
const formattedBalance = formatEther(balance);
|
|
156104
|
-
return formattedBalance;
|
|
156105
|
-
}),
|
|
156106
|
-
checkMyDai: () => __async$1(void 0, null, function* () {
|
|
156107
|
-
const daiAddress = "0x6B175474E89094C44Da98b954EedeAC495271d0F";
|
|
156108
|
-
const daiBalance = yield checkErc20TokenBalance(daiAddress);
|
|
156109
|
-
return daiBalance;
|
|
156110
|
-
}),
|
|
156111
|
-
checkMyUsdc: () => __async$1(void 0, null, function* () {
|
|
156112
|
-
const usdcAddress = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
|
|
156113
|
-
const usdcBalance = yield checkErc20TokenBalance(usdcAddress);
|
|
156114
|
-
return usdcBalance;
|
|
156115
|
-
})
|
|
156116
|
-
}
|
|
155671
|
+
read: arg.length,
|
|
155672
|
+
written: buf2.length
|
|
156117
155673
|
};
|
|
156118
|
-
}
|
|
156119
|
-
|
|
156120
|
-
(
|
|
156121
|
-
|
|
156122
|
-
|
|
155674
|
+
};
|
|
155675
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
155676
|
+
if (realloc === void 0) {
|
|
155677
|
+
const buf2 = cachedTextEncoder.encode(arg);
|
|
155678
|
+
const ptr2 = malloc(buf2.length);
|
|
155679
|
+
getUint8Memory0().subarray(ptr2, ptr2 + buf2.length).set(buf2);
|
|
155680
|
+
WASM_VECTOR_LEN = buf2.length;
|
|
155681
|
+
return ptr2;
|
|
156123
155682
|
}
|
|
156124
|
-
|
|
156125
|
-
|
|
156126
|
-
|
|
156127
|
-
|
|
156128
|
-
|
|
156129
|
-
|
|
156130
|
-
|
|
156131
|
-
|
|
156132
|
-
|
|
156133
|
-
|
|
156134
|
-
|
|
156135
|
-
|
|
156136
|
-
|
|
156137
|
-
filtered[k] = obj[k];
|
|
155683
|
+
let len = arg.length;
|
|
155684
|
+
let ptr = malloc(len);
|
|
155685
|
+
const mem = getUint8Memory0();
|
|
155686
|
+
let offset = 0;
|
|
155687
|
+
for (; offset < len; offset++) {
|
|
155688
|
+
const code5 = arg.charCodeAt(offset);
|
|
155689
|
+
if (code5 > 127)
|
|
155690
|
+
break;
|
|
155691
|
+
mem[ptr + offset] = code5;
|
|
155692
|
+
}
|
|
155693
|
+
if (offset !== len) {
|
|
155694
|
+
if (offset !== 0) {
|
|
155695
|
+
arg = arg.slice(offset);
|
|
156138
155696
|
}
|
|
156139
|
-
|
|
156140
|
-
|
|
156141
|
-
|
|
156142
|
-
|
|
156143
|
-
return obj[e];
|
|
156144
|
-
});
|
|
156145
|
-
};
|
|
156146
|
-
util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => {
|
|
156147
|
-
const keys = [];
|
|
156148
|
-
for (const key2 in object) {
|
|
156149
|
-
if (Object.prototype.hasOwnProperty.call(object, key2)) {
|
|
156150
|
-
keys.push(key2);
|
|
156151
|
-
}
|
|
156152
|
-
}
|
|
156153
|
-
return keys;
|
|
156154
|
-
};
|
|
156155
|
-
util2.find = (arr, checker) => {
|
|
156156
|
-
for (const item of arr) {
|
|
156157
|
-
if (checker(item))
|
|
156158
|
-
return item;
|
|
156159
|
-
}
|
|
156160
|
-
return void 0;
|
|
156161
|
-
};
|
|
156162
|
-
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
|
|
156163
|
-
function joinValues(array, separator = " | ") {
|
|
156164
|
-
return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
|
155697
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3);
|
|
155698
|
+
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
|
155699
|
+
const ret = encodeString2(arg, view);
|
|
155700
|
+
offset += ret.written;
|
|
156165
155701
|
}
|
|
156166
|
-
|
|
156167
|
-
|
|
156168
|
-
}
|
|
156169
|
-
|
|
156170
|
-
|
|
156171
|
-
|
|
156172
|
-
|
|
156173
|
-
|
|
156174
|
-
|
|
156175
|
-
|
|
156176
|
-
|
|
156177
|
-
|
|
156178
|
-
"symbol",
|
|
156179
|
-
"function",
|
|
156180
|
-
"undefined",
|
|
156181
|
-
"null",
|
|
156182
|
-
"array",
|
|
156183
|
-
"object",
|
|
156184
|
-
"unknown",
|
|
156185
|
-
"promise",
|
|
156186
|
-
"void",
|
|
156187
|
-
"never",
|
|
156188
|
-
"map",
|
|
156189
|
-
"set"
|
|
156190
|
-
]);
|
|
156191
|
-
var getParsedType = /* @__PURE__ */ __name((data) => {
|
|
156192
|
-
const t = typeof data;
|
|
156193
|
-
switch (t) {
|
|
156194
|
-
case "undefined":
|
|
156195
|
-
return ZodParsedType.undefined;
|
|
156196
|
-
case "string":
|
|
156197
|
-
return ZodParsedType.string;
|
|
156198
|
-
case "number":
|
|
156199
|
-
return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
156200
|
-
case "boolean":
|
|
156201
|
-
return ZodParsedType.boolean;
|
|
156202
|
-
case "function":
|
|
156203
|
-
return ZodParsedType.function;
|
|
156204
|
-
case "bigint":
|
|
156205
|
-
return ZodParsedType.bigint;
|
|
156206
|
-
case "object":
|
|
156207
|
-
if (Array.isArray(data)) {
|
|
156208
|
-
return ZodParsedType.array;
|
|
156209
|
-
}
|
|
156210
|
-
if (data === null) {
|
|
156211
|
-
return ZodParsedType.null;
|
|
156212
|
-
}
|
|
156213
|
-
if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
|
|
156214
|
-
return ZodParsedType.promise;
|
|
156215
|
-
}
|
|
156216
|
-
if (typeof Map !== "undefined" && data instanceof Map) {
|
|
156217
|
-
return ZodParsedType.map;
|
|
156218
|
-
}
|
|
156219
|
-
if (typeof Set !== "undefined" && data instanceof Set) {
|
|
156220
|
-
return ZodParsedType.set;
|
|
156221
|
-
}
|
|
156222
|
-
if (typeof Date !== "undefined" && data instanceof Date) {
|
|
156223
|
-
return ZodParsedType.date;
|
|
156224
|
-
}
|
|
156225
|
-
return ZodParsedType.object;
|
|
156226
|
-
default:
|
|
156227
|
-
return ZodParsedType.unknown;
|
|
155702
|
+
WASM_VECTOR_LEN = offset;
|
|
155703
|
+
return ptr;
|
|
155704
|
+
}
|
|
155705
|
+
__name(passStringToWasm0, "passStringToWasm0");
|
|
155706
|
+
function isLikeNone(x) {
|
|
155707
|
+
return x === void 0 || x === null;
|
|
155708
|
+
}
|
|
155709
|
+
__name(isLikeNone, "isLikeNone");
|
|
155710
|
+
var cachegetInt32Memory0 = null;
|
|
155711
|
+
function getInt32Memory0() {
|
|
155712
|
+
if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {
|
|
155713
|
+
cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
156228
155714
|
}
|
|
156229
|
-
|
|
156230
|
-
|
|
156231
|
-
|
|
156232
|
-
|
|
156233
|
-
|
|
156234
|
-
"
|
|
156235
|
-
|
|
156236
|
-
|
|
156237
|
-
"
|
|
156238
|
-
|
|
156239
|
-
|
|
156240
|
-
"
|
|
156241
|
-
|
|
156242
|
-
|
|
156243
|
-
|
|
156244
|
-
"invalid_intersection_types",
|
|
156245
|
-
"not_multiple_of"
|
|
156246
|
-
]);
|
|
156247
|
-
var quotelessJson = /* @__PURE__ */ __name((obj) => {
|
|
156248
|
-
const json = JSON.stringify(obj, null, 2);
|
|
156249
|
-
return json.replace(/"([^"]+)":/g, "$1:");
|
|
156250
|
-
}, "quotelessJson");
|
|
156251
|
-
var ZodError = class extends Error {
|
|
156252
|
-
constructor(issues) {
|
|
156253
|
-
super();
|
|
156254
|
-
this.issues = [];
|
|
156255
|
-
this.addIssue = (sub) => {
|
|
156256
|
-
this.issues = [...this.issues, sub];
|
|
156257
|
-
};
|
|
156258
|
-
this.addIssues = (subs = []) => {
|
|
156259
|
-
this.issues = [...this.issues, ...subs];
|
|
156260
|
-
};
|
|
156261
|
-
const actualProto = new.target.prototype;
|
|
156262
|
-
if (Object.setPrototypeOf) {
|
|
156263
|
-
Object.setPrototypeOf(this, actualProto);
|
|
155715
|
+
return cachegetInt32Memory0;
|
|
155716
|
+
}
|
|
155717
|
+
__name(getInt32Memory0, "getInt32Memory0");
|
|
155718
|
+
function debugString(val) {
|
|
155719
|
+
const type = typeof val;
|
|
155720
|
+
if (type == "number" || type == "boolean" || val == null) {
|
|
155721
|
+
return `${val}`;
|
|
155722
|
+
}
|
|
155723
|
+
if (type == "string") {
|
|
155724
|
+
return `"${val}"`;
|
|
155725
|
+
}
|
|
155726
|
+
if (type == "symbol") {
|
|
155727
|
+
const description = val.description;
|
|
155728
|
+
if (description == null) {
|
|
155729
|
+
return "Symbol";
|
|
156264
155730
|
} else {
|
|
156265
|
-
|
|
155731
|
+
return `Symbol(${description})`;
|
|
156266
155732
|
}
|
|
156267
|
-
this.name = "ZodError";
|
|
156268
|
-
this.issues = issues;
|
|
156269
155733
|
}
|
|
156270
|
-
|
|
156271
|
-
|
|
155734
|
+
if (type == "function") {
|
|
155735
|
+
const name5 = val.name;
|
|
155736
|
+
if (typeof name5 == "string" && name5.length > 0) {
|
|
155737
|
+
return `Function(${name5})`;
|
|
155738
|
+
} else {
|
|
155739
|
+
return "Function";
|
|
155740
|
+
}
|
|
156272
155741
|
}
|
|
156273
|
-
|
|
156274
|
-
const
|
|
156275
|
-
|
|
156276
|
-
|
|
156277
|
-
|
|
156278
|
-
|
|
156279
|
-
|
|
156280
|
-
|
|
156281
|
-
|
|
156282
|
-
|
|
156283
|
-
|
|
156284
|
-
} else if (issue.code === "invalid_arguments") {
|
|
156285
|
-
processError(issue.argumentsError);
|
|
156286
|
-
} else if (issue.path.length === 0) {
|
|
156287
|
-
fieldErrors._errors.push(mapper(issue));
|
|
156288
|
-
} else {
|
|
156289
|
-
let curr = fieldErrors;
|
|
156290
|
-
let i = 0;
|
|
156291
|
-
while (i < issue.path.length) {
|
|
156292
|
-
const el = issue.path[i];
|
|
156293
|
-
const terminal = i === issue.path.length - 1;
|
|
156294
|
-
if (!terminal) {
|
|
156295
|
-
curr[el] = curr[el] || { _errors: [] };
|
|
156296
|
-
} else {
|
|
156297
|
-
curr[el] = curr[el] || { _errors: [] };
|
|
156298
|
-
curr[el]._errors.push(mapper(issue));
|
|
156299
|
-
}
|
|
156300
|
-
curr = curr[el];
|
|
156301
|
-
i++;
|
|
156302
|
-
}
|
|
156303
|
-
}
|
|
156304
|
-
}
|
|
156305
|
-
}, "processError");
|
|
156306
|
-
processError(this);
|
|
156307
|
-
return fieldErrors;
|
|
155742
|
+
if (Array.isArray(val)) {
|
|
155743
|
+
const length2 = val.length;
|
|
155744
|
+
let debug = "[";
|
|
155745
|
+
if (length2 > 0) {
|
|
155746
|
+
debug += debugString(val[0]);
|
|
155747
|
+
}
|
|
155748
|
+
for (let i = 1; i < length2; i++) {
|
|
155749
|
+
debug += ", " + debugString(val[i]);
|
|
155750
|
+
}
|
|
155751
|
+
debug += "]";
|
|
155752
|
+
return debug;
|
|
156308
155753
|
}
|
|
156309
|
-
toString()
|
|
156310
|
-
|
|
155754
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
155755
|
+
let className;
|
|
155756
|
+
if (builtInMatches.length > 1) {
|
|
155757
|
+
className = builtInMatches[1];
|
|
155758
|
+
} else {
|
|
155759
|
+
return toString.call(val);
|
|
156311
155760
|
}
|
|
156312
|
-
|
|
156313
|
-
|
|
155761
|
+
if (className == "Object") {
|
|
155762
|
+
try {
|
|
155763
|
+
return "Object(" + JSON.stringify(val) + ")";
|
|
155764
|
+
} catch (_) {
|
|
155765
|
+
return "Object";
|
|
155766
|
+
}
|
|
156314
155767
|
}
|
|
156315
|
-
|
|
156316
|
-
return
|
|
155768
|
+
if (val instanceof Error) {
|
|
155769
|
+
return `${val.name}: ${val.message}
|
|
155770
|
+
${val.stack}`;
|
|
156317
155771
|
}
|
|
156318
|
-
|
|
156319
|
-
|
|
156320
|
-
|
|
156321
|
-
|
|
156322
|
-
|
|
156323
|
-
|
|
156324
|
-
|
|
155772
|
+
return className;
|
|
155773
|
+
}
|
|
155774
|
+
__name(debugString, "debugString");
|
|
155775
|
+
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
155776
|
+
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
155777
|
+
const real = /* @__PURE__ */ __name((...args) => {
|
|
155778
|
+
state.cnt++;
|
|
155779
|
+
const a = state.a;
|
|
155780
|
+
state.a = 0;
|
|
155781
|
+
try {
|
|
155782
|
+
return f(a, state.b, ...args);
|
|
155783
|
+
} finally {
|
|
155784
|
+
if (--state.cnt === 0) {
|
|
155785
|
+
wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
|
|
156325
155786
|
} else {
|
|
156326
|
-
|
|
155787
|
+
state.a = a;
|
|
156327
155788
|
}
|
|
156328
155789
|
}
|
|
156329
|
-
|
|
156330
|
-
|
|
156331
|
-
|
|
156332
|
-
return this.flatten();
|
|
156333
|
-
}
|
|
156334
|
-
};
|
|
156335
|
-
__name(ZodError, "ZodError");
|
|
156336
|
-
ZodError.create = (issues) => {
|
|
156337
|
-
const error = new ZodError(issues);
|
|
156338
|
-
return error;
|
|
156339
|
-
};
|
|
156340
|
-
var defaultErrorMap = /* @__PURE__ */ __name((issue, _ctx) => {
|
|
156341
|
-
let message;
|
|
156342
|
-
switch (issue.code) {
|
|
156343
|
-
case ZodIssueCode.invalid_type:
|
|
156344
|
-
if (issue.received === ZodParsedType.undefined) {
|
|
156345
|
-
message = "Required";
|
|
156346
|
-
} else {
|
|
156347
|
-
message = `Expected ${issue.expected}, received ${issue.received}`;
|
|
156348
|
-
}
|
|
156349
|
-
break;
|
|
156350
|
-
case ZodIssueCode.invalid_literal:
|
|
156351
|
-
message = `Invalid literal value, expected ${JSON.stringify(issue.expected)}`;
|
|
156352
|
-
break;
|
|
156353
|
-
case ZodIssueCode.unrecognized_keys:
|
|
156354
|
-
message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`;
|
|
156355
|
-
break;
|
|
156356
|
-
case ZodIssueCode.invalid_union:
|
|
156357
|
-
message = `Invalid input`;
|
|
156358
|
-
break;
|
|
156359
|
-
case ZodIssueCode.invalid_union_discriminator:
|
|
156360
|
-
message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;
|
|
156361
|
-
break;
|
|
156362
|
-
case ZodIssueCode.invalid_enum_value:
|
|
156363
|
-
message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;
|
|
156364
|
-
break;
|
|
156365
|
-
case ZodIssueCode.invalid_arguments:
|
|
156366
|
-
message = `Invalid function arguments`;
|
|
156367
|
-
break;
|
|
156368
|
-
case ZodIssueCode.invalid_return_type:
|
|
156369
|
-
message = `Invalid function return type`;
|
|
156370
|
-
break;
|
|
156371
|
-
case ZodIssueCode.invalid_date:
|
|
156372
|
-
message = `Invalid date`;
|
|
156373
|
-
break;
|
|
156374
|
-
case ZodIssueCode.invalid_string:
|
|
156375
|
-
if (issue.validation !== "regex")
|
|
156376
|
-
message = `Invalid ${issue.validation}`;
|
|
156377
|
-
else
|
|
156378
|
-
message = "Invalid";
|
|
156379
|
-
break;
|
|
156380
|
-
case ZodIssueCode.too_small:
|
|
156381
|
-
if (issue.type === "array")
|
|
156382
|
-
message = `Array must contain ${issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
|
|
156383
|
-
else if (issue.type === "string")
|
|
156384
|
-
message = `String must contain ${issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
|
|
156385
|
-
else if (issue.type === "number")
|
|
156386
|
-
message = `Number must be greater than ${issue.inclusive ? `or equal to ` : ``}${issue.minimum}`;
|
|
156387
|
-
else
|
|
156388
|
-
message = "Invalid input";
|
|
156389
|
-
break;
|
|
156390
|
-
case ZodIssueCode.too_big:
|
|
156391
|
-
if (issue.type === "array")
|
|
156392
|
-
message = `Array must contain ${issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
|
|
156393
|
-
else if (issue.type === "string")
|
|
156394
|
-
message = `String must contain ${issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
|
|
156395
|
-
else if (issue.type === "number")
|
|
156396
|
-
message = `Number must be less than ${issue.inclusive ? `or equal to ` : ``}${issue.maximum}`;
|
|
156397
|
-
else
|
|
156398
|
-
message = "Invalid input";
|
|
156399
|
-
break;
|
|
156400
|
-
case ZodIssueCode.custom:
|
|
156401
|
-
message = `Invalid input`;
|
|
156402
|
-
break;
|
|
156403
|
-
case ZodIssueCode.invalid_intersection_types:
|
|
156404
|
-
message = `Intersection results could not be merged`;
|
|
156405
|
-
break;
|
|
156406
|
-
case ZodIssueCode.not_multiple_of:
|
|
156407
|
-
message = `Number must be a multiple of ${issue.multipleOf}`;
|
|
156408
|
-
break;
|
|
156409
|
-
default:
|
|
156410
|
-
message = _ctx.defaultError;
|
|
156411
|
-
util.assertNever(issue);
|
|
156412
|
-
}
|
|
156413
|
-
return { message };
|
|
156414
|
-
}, "defaultErrorMap");
|
|
156415
|
-
var overrideErrorMap = defaultErrorMap;
|
|
156416
|
-
var setErrorMap = /* @__PURE__ */ __name((map2) => {
|
|
156417
|
-
overrideErrorMap = map2;
|
|
156418
|
-
}, "setErrorMap");
|
|
156419
|
-
var makeIssue = /* @__PURE__ */ __name((params) => {
|
|
156420
|
-
const { data, path, errorMaps, issueData } = params;
|
|
156421
|
-
const fullPath = [...path, ...issueData.path || []];
|
|
156422
|
-
const fullIssue = __spreadProps(__spreadValues({}, issueData), {
|
|
156423
|
-
path: fullPath
|
|
156424
|
-
});
|
|
156425
|
-
let errorMessage = "";
|
|
156426
|
-
const maps = errorMaps.filter((m) => !!m).slice().reverse();
|
|
156427
|
-
for (const map2 of maps) {
|
|
156428
|
-
errorMessage = map2(fullIssue, { data, defaultError: errorMessage }).message;
|
|
156429
|
-
}
|
|
156430
|
-
return __spreadProps(__spreadValues({}, issueData), {
|
|
156431
|
-
path: fullPath,
|
|
156432
|
-
message: issueData.message || errorMessage
|
|
156433
|
-
});
|
|
156434
|
-
}, "makeIssue");
|
|
156435
|
-
var EMPTY_PATH = [];
|
|
156436
|
-
function addIssueToContext(ctx, issueData) {
|
|
156437
|
-
const issue = makeIssue({
|
|
156438
|
-
issueData,
|
|
156439
|
-
data: ctx.data,
|
|
156440
|
-
path: ctx.path,
|
|
156441
|
-
errorMaps: [
|
|
156442
|
-
ctx.common.contextualErrorMap,
|
|
156443
|
-
ctx.schemaErrorMap,
|
|
156444
|
-
overrideErrorMap,
|
|
156445
|
-
defaultErrorMap
|
|
156446
|
-
].filter((x) => !!x)
|
|
156447
|
-
});
|
|
156448
|
-
ctx.common.issues.push(issue);
|
|
155790
|
+
}, "real");
|
|
155791
|
+
real.original = state;
|
|
155792
|
+
return real;
|
|
156449
155793
|
}
|
|
156450
|
-
__name(
|
|
156451
|
-
|
|
156452
|
-
|
|
156453
|
-
|
|
156454
|
-
|
|
156455
|
-
|
|
156456
|
-
|
|
156457
|
-
|
|
156458
|
-
|
|
156459
|
-
|
|
156460
|
-
|
|
156461
|
-
|
|
156462
|
-
|
|
156463
|
-
|
|
156464
|
-
const
|
|
156465
|
-
|
|
156466
|
-
|
|
156467
|
-
|
|
156468
|
-
|
|
156469
|
-
|
|
156470
|
-
|
|
155794
|
+
__name(makeMutClosure, "makeMutClosure");
|
|
155795
|
+
function __wbg_adapter_24(arg0, arg1, arg2) {
|
|
155796
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h91a8814f66f14b17(arg0, arg1, addHeapObject(arg2));
|
|
155797
|
+
}
|
|
155798
|
+
__name(__wbg_adapter_24, "__wbg_adapter_24");
|
|
155799
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
155800
|
+
const ptr = malloc(arg.length * 1);
|
|
155801
|
+
getUint8Memory0().set(arg, ptr / 1);
|
|
155802
|
+
WASM_VECTOR_LEN = arg.length;
|
|
155803
|
+
return ptr;
|
|
155804
|
+
}
|
|
155805
|
+
__name(passArray8ToWasm0, "passArray8ToWasm0");
|
|
155806
|
+
function generateEd25519KeyFromBytes(bytes) {
|
|
155807
|
+
try {
|
|
155808
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
155809
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
155810
|
+
const len0 = WASM_VECTOR_LEN;
|
|
155811
|
+
wasm.generateEd25519KeyFromBytes(retptr, ptr0, len0);
|
|
155812
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
155813
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
155814
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
155815
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
155816
|
+
var ptr1 = r0;
|
|
155817
|
+
var len1 = r1;
|
|
155818
|
+
if (r3) {
|
|
155819
|
+
ptr1 = 0;
|
|
155820
|
+
len1 = 0;
|
|
155821
|
+
throw takeObject(r2);
|
|
156471
155822
|
}
|
|
156472
|
-
return
|
|
155823
|
+
return getStringFromWasm0(ptr1, len1);
|
|
155824
|
+
} finally {
|
|
155825
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
155826
|
+
wasm.__wbindgen_free(ptr1, len1);
|
|
156473
155827
|
}
|
|
156474
|
-
|
|
156475
|
-
|
|
156476
|
-
|
|
156477
|
-
|
|
156478
|
-
|
|
156479
|
-
|
|
156480
|
-
|
|
156481
|
-
|
|
156482
|
-
|
|
156483
|
-
|
|
156484
|
-
|
|
155828
|
+
}
|
|
155829
|
+
__name(generateEd25519KeyFromBytes, "generateEd25519KeyFromBytes");
|
|
155830
|
+
function generateSecp256k1KeyFromBytes(bytes) {
|
|
155831
|
+
try {
|
|
155832
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
155833
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
155834
|
+
const len0 = WASM_VECTOR_LEN;
|
|
155835
|
+
wasm.generateSecp256k1KeyFromBytes(retptr, ptr0, len0);
|
|
155836
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
155837
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
155838
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
155839
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
155840
|
+
var ptr1 = r0;
|
|
155841
|
+
var len1 = r1;
|
|
155842
|
+
if (r3) {
|
|
155843
|
+
ptr1 = 0;
|
|
155844
|
+
len1 = 0;
|
|
155845
|
+
throw takeObject(r2);
|
|
155846
|
+
}
|
|
155847
|
+
return getStringFromWasm0(ptr1, len1);
|
|
155848
|
+
} finally {
|
|
155849
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
155850
|
+
wasm.__wbindgen_free(ptr1, len1);
|
|
156485
155851
|
}
|
|
156486
|
-
|
|
156487
|
-
|
|
156488
|
-
|
|
156489
|
-
|
|
156490
|
-
|
|
156491
|
-
|
|
156492
|
-
|
|
156493
|
-
|
|
156494
|
-
|
|
156495
|
-
|
|
156496
|
-
|
|
156497
|
-
|
|
156498
|
-
|
|
156499
|
-
|
|
156500
|
-
|
|
155852
|
+
}
|
|
155853
|
+
__name(generateSecp256k1KeyFromBytes, "generateSecp256k1KeyFromBytes");
|
|
155854
|
+
function keyToDID(method_pattern, jwk) {
|
|
155855
|
+
try {
|
|
155856
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
155857
|
+
const ptr0 = passStringToWasm0(method_pattern, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155858
|
+
const len0 = WASM_VECTOR_LEN;
|
|
155859
|
+
const ptr1 = passStringToWasm0(jwk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155860
|
+
const len1 = WASM_VECTOR_LEN;
|
|
155861
|
+
wasm.keyToDID(retptr, ptr0, len0, ptr1, len1);
|
|
155862
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
155863
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
155864
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
155865
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
155866
|
+
var ptr2 = r0;
|
|
155867
|
+
var len2 = r1;
|
|
155868
|
+
if (r3) {
|
|
155869
|
+
ptr2 = 0;
|
|
155870
|
+
len2 = 0;
|
|
155871
|
+
throw takeObject(r2);
|
|
156501
155872
|
}
|
|
156502
|
-
return
|
|
155873
|
+
return getStringFromWasm0(ptr2, len2);
|
|
155874
|
+
} finally {
|
|
155875
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
155876
|
+
wasm.__wbindgen_free(ptr2, len2);
|
|
156503
155877
|
}
|
|
156504
|
-
}
|
|
156505
|
-
__name(
|
|
156506
|
-
|
|
156507
|
-
|
|
156508
|
-
|
|
156509
|
-
|
|
156510
|
-
|
|
156511
|
-
|
|
156512
|
-
|
|
156513
|
-
|
|
156514
|
-
|
|
156515
|
-
|
|
156516
|
-
(
|
|
156517
|
-
|
|
156518
|
-
|
|
156519
|
-
|
|
156520
|
-
|
|
156521
|
-
|
|
156522
|
-
|
|
156523
|
-
|
|
156524
|
-
|
|
156525
|
-
|
|
156526
|
-
|
|
156527
|
-
|
|
156528
|
-
|
|
155878
|
+
}
|
|
155879
|
+
__name(keyToDID, "keyToDID");
|
|
155880
|
+
function keyToVerificationMethod(method_pattern, jwk) {
|
|
155881
|
+
const ptr0 = passStringToWasm0(method_pattern, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155882
|
+
const len0 = WASM_VECTOR_LEN;
|
|
155883
|
+
const ptr1 = passStringToWasm0(jwk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155884
|
+
const len1 = WASM_VECTOR_LEN;
|
|
155885
|
+
const ret = wasm.keyToVerificationMethod(ptr0, len0, ptr1, len1);
|
|
155886
|
+
return takeObject(ret);
|
|
155887
|
+
}
|
|
155888
|
+
__name(keyToVerificationMethod, "keyToVerificationMethod");
|
|
155889
|
+
function issueCredential(credential, proof_options, key2) {
|
|
155890
|
+
const ptr0 = passStringToWasm0(credential, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155891
|
+
const len0 = WASM_VECTOR_LEN;
|
|
155892
|
+
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155893
|
+
const len1 = WASM_VECTOR_LEN;
|
|
155894
|
+
const ptr2 = passStringToWasm0(key2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155895
|
+
const len2 = WASM_VECTOR_LEN;
|
|
155896
|
+
const ret = wasm.issueCredential(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
155897
|
+
return takeObject(ret);
|
|
155898
|
+
}
|
|
155899
|
+
__name(issueCredential, "issueCredential");
|
|
155900
|
+
function verifyCredential(vc, proof_options) {
|
|
155901
|
+
const ptr0 = passStringToWasm0(vc, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155902
|
+
const len0 = WASM_VECTOR_LEN;
|
|
155903
|
+
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155904
|
+
const len1 = WASM_VECTOR_LEN;
|
|
155905
|
+
const ret = wasm.verifyCredential(ptr0, len0, ptr1, len1);
|
|
155906
|
+
return takeObject(ret);
|
|
155907
|
+
}
|
|
155908
|
+
__name(verifyCredential, "verifyCredential");
|
|
155909
|
+
function issuePresentation(presentation, proof_options, key2) {
|
|
155910
|
+
const ptr0 = passStringToWasm0(presentation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155911
|
+
const len0 = WASM_VECTOR_LEN;
|
|
155912
|
+
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155913
|
+
const len1 = WASM_VECTOR_LEN;
|
|
155914
|
+
const ptr2 = passStringToWasm0(key2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155915
|
+
const len2 = WASM_VECTOR_LEN;
|
|
155916
|
+
const ret = wasm.issuePresentation(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
155917
|
+
return takeObject(ret);
|
|
155918
|
+
}
|
|
155919
|
+
__name(issuePresentation, "issuePresentation");
|
|
155920
|
+
function verifyPresentation(vp, proof_options) {
|
|
155921
|
+
const ptr0 = passStringToWasm0(vp, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155922
|
+
const len0 = WASM_VECTOR_LEN;
|
|
155923
|
+
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155924
|
+
const len1 = WASM_VECTOR_LEN;
|
|
155925
|
+
const ret = wasm.verifyPresentation(ptr0, len0, ptr1, len1);
|
|
155926
|
+
return takeObject(ret);
|
|
155927
|
+
}
|
|
155928
|
+
__name(verifyPresentation, "verifyPresentation");
|
|
155929
|
+
function handleError(f, args) {
|
|
155930
|
+
try {
|
|
155931
|
+
return f.apply(this, args);
|
|
155932
|
+
} catch (e) {
|
|
155933
|
+
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
156529
155934
|
}
|
|
156530
|
-
}
|
|
156531
|
-
__name(
|
|
156532
|
-
|
|
156533
|
-
|
|
156534
|
-
|
|
156535
|
-
|
|
156536
|
-
|
|
156537
|
-
|
|
155935
|
+
}
|
|
155936
|
+
__name(handleError, "handleError");
|
|
155937
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
155938
|
+
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
155939
|
+
}
|
|
155940
|
+
__name(getArrayU8FromWasm0, "getArrayU8FromWasm0");
|
|
155941
|
+
function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
|
|
155942
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h3ecfeb7a01c1be81(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
155943
|
+
}
|
|
155944
|
+
__name(__wbg_adapter_110, "__wbg_adapter_110");
|
|
155945
|
+
function load(module, imports) {
|
|
155946
|
+
return __async$1(this, null, function* () {
|
|
155947
|
+
if (typeof Response === "function" && module instanceof Response) {
|
|
155948
|
+
if (typeof WebAssembly.instantiateStreaming === "function") {
|
|
155949
|
+
try {
|
|
155950
|
+
return yield WebAssembly.instantiateStreaming(module, imports);
|
|
155951
|
+
} catch (e) {
|
|
155952
|
+
if (module.headers.get("Content-Type") != "application/wasm") {
|
|
155953
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
155954
|
+
} else {
|
|
155955
|
+
throw e;
|
|
155956
|
+
}
|
|
155957
|
+
}
|
|
155958
|
+
}
|
|
155959
|
+
const bytes = yield module.arrayBuffer();
|
|
155960
|
+
return yield WebAssembly.instantiate(bytes, imports);
|
|
155961
|
+
} else {
|
|
155962
|
+
const instance = yield WebAssembly.instantiate(module, imports);
|
|
155963
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
155964
|
+
return { instance, module };
|
|
155965
|
+
} else {
|
|
155966
|
+
return instance;
|
|
155967
|
+
}
|
|
156538
155968
|
}
|
|
156539
|
-
|
|
156540
|
-
return { success: false, error };
|
|
156541
|
-
}
|
|
156542
|
-
}, "handleResult");
|
|
156543
|
-
function processCreateParams(params) {
|
|
156544
|
-
if (!params)
|
|
156545
|
-
return {};
|
|
156546
|
-
const { errorMap, invalid_type_error, required_error, description } = params;
|
|
156547
|
-
if (errorMap && (invalid_type_error || required_error)) {
|
|
156548
|
-
throw new Error(`Can't use "invalid" or "required" in conjunction with custom error map.`);
|
|
156549
|
-
}
|
|
156550
|
-
if (errorMap)
|
|
156551
|
-
return { errorMap, description };
|
|
156552
|
-
const customMap = /* @__PURE__ */ __name((iss, ctx) => {
|
|
156553
|
-
if (iss.code !== "invalid_type")
|
|
156554
|
-
return { message: ctx.defaultError };
|
|
156555
|
-
if (typeof ctx.data === "undefined" && required_error)
|
|
156556
|
-
return { message: required_error };
|
|
156557
|
-
if (params.invalid_type_error)
|
|
156558
|
-
return { message: params.invalid_type_error };
|
|
156559
|
-
return { message: ctx.defaultError };
|
|
156560
|
-
}, "customMap");
|
|
156561
|
-
return { errorMap: customMap, description };
|
|
155969
|
+
});
|
|
156562
155970
|
}
|
|
156563
|
-
__name(
|
|
156564
|
-
|
|
156565
|
-
|
|
156566
|
-
|
|
156567
|
-
|
|
156568
|
-
|
|
156569
|
-
|
|
156570
|
-
|
|
156571
|
-
this.parseAsync = this.parseAsync.bind(this);
|
|
156572
|
-
this.safeParseAsync = this.safeParseAsync.bind(this);
|
|
156573
|
-
this.spa = this.spa.bind(this);
|
|
156574
|
-
this.refine = this.refine.bind(this);
|
|
156575
|
-
this.refinement = this.refinement.bind(this);
|
|
156576
|
-
this.superRefine = this.superRefine.bind(this);
|
|
156577
|
-
this.optional = this.optional.bind(this);
|
|
156578
|
-
this.nullable = this.nullable.bind(this);
|
|
156579
|
-
this.nullish = this.nullish.bind(this);
|
|
156580
|
-
this.array = this.array.bind(this);
|
|
156581
|
-
this.promise = this.promise.bind(this);
|
|
156582
|
-
this.or = this.or.bind(this);
|
|
156583
|
-
this.and = this.and.bind(this);
|
|
156584
|
-
this.transform = this.transform.bind(this);
|
|
156585
|
-
this.default = this.default.bind(this);
|
|
156586
|
-
this.describe = this.describe.bind(this);
|
|
156587
|
-
this.isNullable = this.isNullable.bind(this);
|
|
156588
|
-
this.isOptional = this.isOptional.bind(this);
|
|
156589
|
-
}
|
|
156590
|
-
get description() {
|
|
156591
|
-
return this._def.description;
|
|
156592
|
-
}
|
|
156593
|
-
_getType(input) {
|
|
156594
|
-
return getParsedType(input.data);
|
|
156595
|
-
}
|
|
156596
|
-
_getOrReturnCtx(input, ctx) {
|
|
156597
|
-
return ctx || {
|
|
156598
|
-
common: input.parent.common,
|
|
156599
|
-
data: input.data,
|
|
156600
|
-
parsedType: getParsedType(input.data),
|
|
156601
|
-
schemaErrorMap: this._def.errorMap,
|
|
156602
|
-
path: input.path,
|
|
156603
|
-
parent: input.parent
|
|
155971
|
+
__name(load, "load");
|
|
155972
|
+
function init2(input) {
|
|
155973
|
+
return __async$1(this, null, function* () {
|
|
155974
|
+
const imports = {};
|
|
155975
|
+
imports.wbg = {};
|
|
155976
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
155977
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
155978
|
+
return addHeapObject(ret);
|
|
156604
155979
|
};
|
|
156605
|
-
|
|
156606
|
-
|
|
156607
|
-
|
|
156608
|
-
|
|
156609
|
-
|
|
156610
|
-
|
|
156611
|
-
|
|
156612
|
-
|
|
156613
|
-
schemaErrorMap: this._def.errorMap,
|
|
156614
|
-
path: input.path,
|
|
156615
|
-
parent: input.parent
|
|
155980
|
+
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
155981
|
+
takeObject(arg0);
|
|
155982
|
+
};
|
|
155983
|
+
imports.wbg.__wbindgen_cb_drop = function(arg0) {
|
|
155984
|
+
const obj = takeObject(arg0).original;
|
|
155985
|
+
if (obj.cnt-- == 1) {
|
|
155986
|
+
obj.a = 0;
|
|
155987
|
+
return true;
|
|
156616
155988
|
}
|
|
155989
|
+
const ret = false;
|
|
155990
|
+
return ret;
|
|
156617
155991
|
};
|
|
156618
|
-
|
|
156619
|
-
|
|
156620
|
-
|
|
156621
|
-
if (isAsync(result)) {
|
|
156622
|
-
throw new Error("Synchronous parse encountered promise.");
|
|
156623
|
-
}
|
|
156624
|
-
return result;
|
|
156625
|
-
}
|
|
156626
|
-
_parseAsync(input) {
|
|
156627
|
-
const result = this._parse(input);
|
|
156628
|
-
return Promise.resolve(result);
|
|
156629
|
-
}
|
|
156630
|
-
parse(data, params) {
|
|
156631
|
-
const result = this.safeParse(data, params);
|
|
156632
|
-
if (result.success)
|
|
156633
|
-
return result.data;
|
|
156634
|
-
throw result.error;
|
|
156635
|
-
}
|
|
156636
|
-
safeParse(data, params) {
|
|
156637
|
-
var _a;
|
|
156638
|
-
const ctx = {
|
|
156639
|
-
common: {
|
|
156640
|
-
issues: [],
|
|
156641
|
-
async: (_a = params === null || params === void 0 ? void 0 : params.async) !== null && _a !== void 0 ? _a : false,
|
|
156642
|
-
contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap
|
|
156643
|
-
},
|
|
156644
|
-
path: (params === null || params === void 0 ? void 0 : params.path) || [],
|
|
156645
|
-
schemaErrorMap: this._def.errorMap,
|
|
156646
|
-
parent: null,
|
|
156647
|
-
data,
|
|
156648
|
-
parsedType: getParsedType(data)
|
|
155992
|
+
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
155993
|
+
const ret = getObject(arg0);
|
|
155994
|
+
return addHeapObject(ret);
|
|
156649
155995
|
};
|
|
156650
|
-
|
|
156651
|
-
|
|
156652
|
-
|
|
156653
|
-
|
|
156654
|
-
|
|
156655
|
-
const
|
|
156656
|
-
|
|
156657
|
-
|
|
156658
|
-
|
|
156659
|
-
|
|
156660
|
-
|
|
156661
|
-
|
|
156662
|
-
|
|
156663
|
-
|
|
156664
|
-
|
|
156665
|
-
|
|
156666
|
-
|
|
156667
|
-
|
|
156668
|
-
|
|
156669
|
-
|
|
156670
|
-
|
|
156671
|
-
|
|
156672
|
-
|
|
156673
|
-
|
|
156674
|
-
|
|
155996
|
+
imports.wbg.__wbg_fetch_811d43d6bdcad5b1 = function(arg0) {
|
|
155997
|
+
const ret = fetch(getObject(arg0));
|
|
155998
|
+
return addHeapObject(ret);
|
|
155999
|
+
};
|
|
156000
|
+
imports.wbg.__wbg_fetch_bf56e2a9f0644e3f = function(arg0, arg1) {
|
|
156001
|
+
const ret = getObject(arg0).fetch(getObject(arg1));
|
|
156002
|
+
return addHeapObject(ret);
|
|
156003
|
+
};
|
|
156004
|
+
imports.wbg.__wbg_new_89d7f088c1c45353 = function() {
|
|
156005
|
+
return handleError(function() {
|
|
156006
|
+
const ret = new Headers();
|
|
156007
|
+
return addHeapObject(ret);
|
|
156008
|
+
}, arguments);
|
|
156009
|
+
};
|
|
156010
|
+
imports.wbg.__wbg_append_f4f93bc73c45ee3e = function() {
|
|
156011
|
+
return handleError(function(arg0, arg1, arg2, arg3, arg4) {
|
|
156012
|
+
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
156013
|
+
}, arguments);
|
|
156014
|
+
};
|
|
156015
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
156016
|
+
const obj = getObject(arg1);
|
|
156017
|
+
const ret = typeof obj === "string" ? obj : void 0;
|
|
156018
|
+
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
156019
|
+
var len0 = WASM_VECTOR_LEN;
|
|
156020
|
+
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
156021
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
156022
|
+
};
|
|
156023
|
+
imports.wbg.__wbg_instanceof_Response_ccfeb62399355bcd = function(arg0) {
|
|
156024
|
+
const ret = getObject(arg0) instanceof Response;
|
|
156025
|
+
return ret;
|
|
156026
|
+
};
|
|
156027
|
+
imports.wbg.__wbg_url_06c0f822d68d195c = function(arg0, arg1) {
|
|
156028
|
+
const ret = getObject(arg1).url;
|
|
156029
|
+
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
156030
|
+
const len0 = WASM_VECTOR_LEN;
|
|
156031
|
+
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
156032
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
156033
|
+
};
|
|
156034
|
+
imports.wbg.__wbg_status_600fd8b881393898 = function(arg0) {
|
|
156035
|
+
const ret = getObject(arg0).status;
|
|
156036
|
+
return ret;
|
|
156037
|
+
};
|
|
156038
|
+
imports.wbg.__wbg_headers_9e7f2c05a9b962ea = function(arg0) {
|
|
156039
|
+
const ret = getObject(arg0).headers;
|
|
156040
|
+
return addHeapObject(ret);
|
|
156041
|
+
};
|
|
156042
|
+
imports.wbg.__wbg_arrayBuffer_5a99283a3954c850 = function() {
|
|
156043
|
+
return handleError(function(arg0) {
|
|
156044
|
+
const ret = getObject(arg0).arrayBuffer();
|
|
156045
|
+
return addHeapObject(ret);
|
|
156046
|
+
}, arguments);
|
|
156047
|
+
};
|
|
156048
|
+
imports.wbg.__wbg_newwithstrandinit_fd99688f189f053e = function() {
|
|
156049
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
156050
|
+
const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
|
|
156051
|
+
return addHeapObject(ret);
|
|
156052
|
+
}, arguments);
|
|
156053
|
+
};
|
|
156054
|
+
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
156055
|
+
const val = getObject(arg0);
|
|
156056
|
+
const ret = typeof val === "object" && val !== null;
|
|
156057
|
+
return ret;
|
|
156058
|
+
};
|
|
156059
|
+
imports.wbg.__wbg_self_86b4b13392c7af56 = function() {
|
|
156060
|
+
return handleError(function() {
|
|
156061
|
+
const ret = self.self;
|
|
156062
|
+
return addHeapObject(ret);
|
|
156063
|
+
}, arguments);
|
|
156064
|
+
};
|
|
156065
|
+
imports.wbg.__wbg_crypto_b8c92eaac23d0d80 = function(arg0) {
|
|
156066
|
+
const ret = getObject(arg0).crypto;
|
|
156067
|
+
return addHeapObject(ret);
|
|
156068
|
+
};
|
|
156069
|
+
imports.wbg.__wbg_msCrypto_9ad6677321a08dd8 = function(arg0) {
|
|
156070
|
+
const ret = getObject(arg0).msCrypto;
|
|
156071
|
+
return addHeapObject(ret);
|
|
156072
|
+
};
|
|
156073
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
156074
|
+
const ret = getObject(arg0) === void 0;
|
|
156075
|
+
return ret;
|
|
156076
|
+
};
|
|
156077
|
+
imports.wbg.__wbg_static_accessor_MODULE_452b4680e8614c81 = function() {
|
|
156078
|
+
const ret = module;
|
|
156079
|
+
return addHeapObject(ret);
|
|
156080
|
+
};
|
|
156081
|
+
imports.wbg.__wbg_require_f5521a5b85ad2542 = function(arg0, arg1, arg2) {
|
|
156082
|
+
const ret = getObject(arg0).require(getStringFromWasm0(arg1, arg2));
|
|
156083
|
+
return addHeapObject(ret);
|
|
156084
|
+
};
|
|
156085
|
+
imports.wbg.__wbg_getRandomValues_dd27e6b0652b3236 = function(arg0) {
|
|
156086
|
+
const ret = getObject(arg0).getRandomValues;
|
|
156087
|
+
return addHeapObject(ret);
|
|
156088
|
+
};
|
|
156089
|
+
imports.wbg.__wbg_getRandomValues_e57c9b75ddead065 = function(arg0, arg1) {
|
|
156090
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
|
156091
|
+
};
|
|
156092
|
+
imports.wbg.__wbg_randomFillSync_d2ba53160aec6aba = function(arg0, arg1, arg2) {
|
|
156093
|
+
getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
|
|
156094
|
+
};
|
|
156095
|
+
imports.wbg.__wbindgen_is_function = function(arg0) {
|
|
156096
|
+
const ret = typeof getObject(arg0) === "function";
|
|
156097
|
+
return ret;
|
|
156098
|
+
};
|
|
156099
|
+
imports.wbg.__wbg_newnoargs_e23b458e372830de = function(arg0, arg1) {
|
|
156100
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
156101
|
+
return addHeapObject(ret);
|
|
156102
|
+
};
|
|
156103
|
+
imports.wbg.__wbg_next_cabb70b365520721 = function(arg0) {
|
|
156104
|
+
const ret = getObject(arg0).next;
|
|
156105
|
+
return addHeapObject(ret);
|
|
156106
|
+
};
|
|
156107
|
+
imports.wbg.__wbg_next_bf3d83fc18df496e = function() {
|
|
156108
|
+
return handleError(function(arg0) {
|
|
156109
|
+
const ret = getObject(arg0).next();
|
|
156110
|
+
return addHeapObject(ret);
|
|
156111
|
+
}, arguments);
|
|
156112
|
+
};
|
|
156113
|
+
imports.wbg.__wbg_done_040f966faa9a72b3 = function(arg0) {
|
|
156114
|
+
const ret = getObject(arg0).done;
|
|
156115
|
+
return ret;
|
|
156116
|
+
};
|
|
156117
|
+
imports.wbg.__wbg_value_419afbd9b9574c4c = function(arg0) {
|
|
156118
|
+
const ret = getObject(arg0).value;
|
|
156119
|
+
return addHeapObject(ret);
|
|
156120
|
+
};
|
|
156121
|
+
imports.wbg.__wbg_iterator_4832ef1f15b0382b = function() {
|
|
156122
|
+
const ret = Symbol.iterator;
|
|
156123
|
+
return addHeapObject(ret);
|
|
156124
|
+
};
|
|
156125
|
+
imports.wbg.__wbg_get_a9cab131e3152c49 = function() {
|
|
156126
|
+
return handleError(function(arg0, arg1) {
|
|
156127
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
156128
|
+
return addHeapObject(ret);
|
|
156129
|
+
}, arguments);
|
|
156130
|
+
};
|
|
156131
|
+
imports.wbg.__wbg_call_ae78342adc33730a = function() {
|
|
156132
|
+
return handleError(function(arg0, arg1) {
|
|
156133
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
156134
|
+
return addHeapObject(ret);
|
|
156135
|
+
}, arguments);
|
|
156136
|
+
};
|
|
156137
|
+
imports.wbg.__wbg_new_36359baae5a47e27 = function() {
|
|
156138
|
+
const ret = new Object();
|
|
156139
|
+
return addHeapObject(ret);
|
|
156140
|
+
};
|
|
156141
|
+
imports.wbg.__wbg_call_3ed288a247f13ea5 = function() {
|
|
156142
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
156143
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
156144
|
+
return addHeapObject(ret);
|
|
156145
|
+
}, arguments);
|
|
156146
|
+
};
|
|
156147
|
+
imports.wbg.__wbg_getTime_bffb1c09df09618b = function(arg0) {
|
|
156148
|
+
const ret = getObject(arg0).getTime();
|
|
156149
|
+
return ret;
|
|
156150
|
+
};
|
|
156151
|
+
imports.wbg.__wbg_new0_0ff7eb5c1486f3ec = function() {
|
|
156152
|
+
const ret = new Date();
|
|
156153
|
+
return addHeapObject(ret);
|
|
156154
|
+
};
|
|
156155
|
+
imports.wbg.__wbg_new_37705eed627d5ed9 = function(arg0, arg1) {
|
|
156156
|
+
try {
|
|
156157
|
+
var state0 = { a: arg0, b: arg1 };
|
|
156158
|
+
var cb0 = /* @__PURE__ */ __name((arg02, arg12) => {
|
|
156159
|
+
const a = state0.a;
|
|
156160
|
+
state0.a = 0;
|
|
156161
|
+
try {
|
|
156162
|
+
return __wbg_adapter_110(a, state0.b, arg02, arg12);
|
|
156163
|
+
} finally {
|
|
156164
|
+
state0.a = a;
|
|
156165
|
+
}
|
|
156166
|
+
}, "cb0");
|
|
156167
|
+
const ret = new Promise(cb0);
|
|
156168
|
+
return addHeapObject(ret);
|
|
156169
|
+
} finally {
|
|
156170
|
+
state0.a = state0.b = 0;
|
|
156171
|
+
}
|
|
156172
|
+
};
|
|
156173
|
+
imports.wbg.__wbg_resolve_a9a87bdd64e9e62c = function(arg0) {
|
|
156174
|
+
const ret = Promise.resolve(getObject(arg0));
|
|
156175
|
+
return addHeapObject(ret);
|
|
156176
|
+
};
|
|
156177
|
+
imports.wbg.__wbg_then_ce526c837d07b68f = function(arg0, arg1) {
|
|
156178
|
+
const ret = getObject(arg0).then(getObject(arg1));
|
|
156179
|
+
return addHeapObject(ret);
|
|
156180
|
+
};
|
|
156181
|
+
imports.wbg.__wbg_then_842e65b843962f56 = function(arg0, arg1, arg2) {
|
|
156182
|
+
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
|
156183
|
+
return addHeapObject(ret);
|
|
156184
|
+
};
|
|
156185
|
+
imports.wbg.__wbg_self_99737b4dcdf6f0d8 = function() {
|
|
156186
|
+
return handleError(function() {
|
|
156187
|
+
const ret = self.self;
|
|
156188
|
+
return addHeapObject(ret);
|
|
156189
|
+
}, arguments);
|
|
156190
|
+
};
|
|
156191
|
+
imports.wbg.__wbg_window_9b61fbbf3564c4fb = function() {
|
|
156192
|
+
return handleError(function() {
|
|
156193
|
+
const ret = window.window;
|
|
156194
|
+
return addHeapObject(ret);
|
|
156195
|
+
}, arguments);
|
|
156196
|
+
};
|
|
156197
|
+
imports.wbg.__wbg_globalThis_8e275ef40caea3a3 = function() {
|
|
156198
|
+
return handleError(function() {
|
|
156199
|
+
const ret = globalThis.globalThis;
|
|
156200
|
+
return addHeapObject(ret);
|
|
156201
|
+
}, arguments);
|
|
156202
|
+
};
|
|
156203
|
+
imports.wbg.__wbg_global_5de1e0f82bddcd27 = function() {
|
|
156204
|
+
return handleError(function() {
|
|
156205
|
+
const ret = global.global;
|
|
156206
|
+
return addHeapObject(ret);
|
|
156207
|
+
}, arguments);
|
|
156208
|
+
};
|
|
156209
|
+
imports.wbg.__wbg_buffer_7af23f65f6c64548 = function(arg0) {
|
|
156210
|
+
const ret = getObject(arg0).buffer;
|
|
156211
|
+
return addHeapObject(ret);
|
|
156212
|
+
};
|
|
156213
|
+
imports.wbg.__wbg_newwithbyteoffsetandlength_ce1e75f0ce5f7974 = function(arg0, arg1, arg2) {
|
|
156214
|
+
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
156215
|
+
return addHeapObject(ret);
|
|
156216
|
+
};
|
|
156217
|
+
imports.wbg.__wbg_new_cc9018bd6f283b6f = function(arg0) {
|
|
156218
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
156219
|
+
return addHeapObject(ret);
|
|
156220
|
+
};
|
|
156221
|
+
imports.wbg.__wbg_set_f25e869e4565d2a2 = function(arg0, arg1, arg2) {
|
|
156222
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
156223
|
+
};
|
|
156224
|
+
imports.wbg.__wbg_length_0acb1cf9bbaf8519 = function(arg0) {
|
|
156225
|
+
const ret = getObject(arg0).length;
|
|
156226
|
+
return ret;
|
|
156227
|
+
};
|
|
156228
|
+
imports.wbg.__wbg_newwithlength_8f0657faca9f1422 = function(arg0) {
|
|
156229
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
156230
|
+
return addHeapObject(ret);
|
|
156231
|
+
};
|
|
156232
|
+
imports.wbg.__wbg_subarray_da527dbd24eafb6b = function(arg0, arg1, arg2) {
|
|
156233
|
+
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
156234
|
+
return addHeapObject(ret);
|
|
156235
|
+
};
|
|
156236
|
+
imports.wbg.__wbg_has_ce995ec88636803d = function() {
|
|
156237
|
+
return handleError(function(arg0, arg1) {
|
|
156238
|
+
const ret = Reflect.has(getObject(arg0), getObject(arg1));
|
|
156239
|
+
return ret;
|
|
156240
|
+
}, arguments);
|
|
156241
|
+
};
|
|
156242
|
+
imports.wbg.__wbg_set_93b1c87ee2af852e = function() {
|
|
156243
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
156244
|
+
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
156245
|
+
return ret;
|
|
156246
|
+
}, arguments);
|
|
156247
|
+
};
|
|
156248
|
+
imports.wbg.__wbg_stringify_c760003feffcc1f2 = function() {
|
|
156249
|
+
return handleError(function(arg0) {
|
|
156250
|
+
const ret = JSON.stringify(getObject(arg0));
|
|
156251
|
+
return addHeapObject(ret);
|
|
156252
|
+
}, arguments);
|
|
156253
|
+
};
|
|
156254
|
+
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
156255
|
+
const ret = debugString(getObject(arg1));
|
|
156256
|
+
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
156257
|
+
const len0 = WASM_VECTOR_LEN;
|
|
156258
|
+
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
156259
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
156260
|
+
};
|
|
156261
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
156262
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
156263
|
+
};
|
|
156264
|
+
imports.wbg.__wbindgen_memory = function() {
|
|
156265
|
+
const ret = wasm.memory;
|
|
156266
|
+
return addHeapObject(ret);
|
|
156267
|
+
};
|
|
156268
|
+
imports.wbg.__wbindgen_closure_wrapper10913 = function(arg0, arg1, arg2) {
|
|
156269
|
+
const ret = makeMutClosure(arg0, arg1, 3725, __wbg_adapter_24);
|
|
156270
|
+
return addHeapObject(ret);
|
|
156271
|
+
};
|
|
156272
|
+
if (typeof input === "string" || typeof Request === "function" && input instanceof Request || typeof URL === "function" && input instanceof URL) {
|
|
156273
|
+
input = fetch(input);
|
|
156274
|
+
}
|
|
156275
|
+
const { instance, module } = yield load(yield input, imports);
|
|
156276
|
+
wasm = instance.exports;
|
|
156277
|
+
init2.__wbindgen_wasm_module = module;
|
|
156278
|
+
return wasm;
|
|
156279
|
+
});
|
|
156280
|
+
}
|
|
156281
|
+
__name(init2, "init");
|
|
156282
|
+
var didkit_wasm_default = init2;
|
|
156283
|
+
var initialized = false;
|
|
156284
|
+
var init3 = /* @__PURE__ */ __name((arg = "https://cdn.filestackcontent.com/dlXanMvQCGDR76JXcBkA") => __async$1(void 0, null, function* () {
|
|
156285
|
+
if (initialized)
|
|
156286
|
+
return;
|
|
156287
|
+
initialized = true;
|
|
156288
|
+
return didkit_wasm_default(arg);
|
|
156289
|
+
}), "init");
|
|
156290
|
+
var didkit_default = init3;
|
|
156291
|
+
var getDidKitPlugin = /* @__PURE__ */ __name((input) => __async$1(void 0, null, function* () {
|
|
156292
|
+
yield didkit_default(input);
|
|
156293
|
+
const memoizedDids = {};
|
|
156294
|
+
return {
|
|
156295
|
+
pluginMethods: {
|
|
156296
|
+
generateEd25519KeyFromBytes: (_wallet, bytes) => JSON.parse(generateEd25519KeyFromBytes(bytes)),
|
|
156297
|
+
generateSecp256k1KeyFromBytes: (_wallet, bytes) => JSON.parse(generateSecp256k1KeyFromBytes(bytes)),
|
|
156298
|
+
keyToDid: (_wallet, type, keypair) => {
|
|
156299
|
+
const memoizedDid = memoizedDids[type];
|
|
156300
|
+
if (!memoizedDid) {
|
|
156301
|
+
const did = keyToDID(type, JSON.stringify(keypair));
|
|
156302
|
+
memoizedDids[type] = did;
|
|
156303
|
+
return did;
|
|
156304
|
+
}
|
|
156305
|
+
return memoizedDid;
|
|
156306
|
+
},
|
|
156307
|
+
keyToVerificationMethod: (_wallet, type, keypair) => __async$1(void 0, null, function* () {
|
|
156308
|
+
return keyToVerificationMethod(type, JSON.stringify(keypair));
|
|
156309
|
+
}),
|
|
156310
|
+
issueCredential: (_wallet, credential, options, keypair) => __async$1(void 0, null, function* () {
|
|
156311
|
+
return JSON.parse(yield issueCredential(JSON.stringify(credential), JSON.stringify(options), JSON.stringify(keypair)));
|
|
156312
|
+
}),
|
|
156313
|
+
verifyCredential: (_wallet, credential) => __async$1(void 0, null, function* () {
|
|
156314
|
+
return JSON.parse(yield verifyCredential(JSON.stringify(credential), "{}"));
|
|
156315
|
+
}),
|
|
156316
|
+
issuePresentation: (_wallet, presentation, options, keypair) => __async$1(void 0, null, function* () {
|
|
156317
|
+
return JSON.parse(yield issuePresentation(JSON.stringify(presentation), JSON.stringify(options), JSON.stringify(keypair)));
|
|
156318
|
+
}),
|
|
156319
|
+
verifyPresentation: (_wallet, presentation) => __async$1(void 0, null, function* () {
|
|
156320
|
+
return JSON.parse(yield verifyPresentation(JSON.stringify(presentation), "{}"));
|
|
156321
|
+
})
|
|
156322
|
+
}
|
|
156323
|
+
};
|
|
156324
|
+
}), "getDidKitPlugin");
|
|
156325
|
+
var ExpirationPlugin = /* @__PURE__ */ __name((wallet) => ({
|
|
156326
|
+
pluginMethods: {
|
|
156327
|
+
verifyCredential: (_wallet, credential) => __async$1(void 0, null, function* () {
|
|
156328
|
+
const verificationCheck = yield wallet.pluginMethods.verifyCredential(credential);
|
|
156329
|
+
if (credential.expirationDate && new Date() > new Date(credential.expirationDate)) {
|
|
156330
|
+
verificationCheck.errors.push("expiration error: Credential is expired");
|
|
156331
|
+
} else {
|
|
156332
|
+
verificationCheck.checks.push("expiration");
|
|
156333
|
+
}
|
|
156334
|
+
return verificationCheck;
|
|
156335
|
+
})
|
|
156336
|
+
}
|
|
156337
|
+
}), "ExpirationPlugin");
|
|
156338
|
+
var util;
|
|
156339
|
+
(function(util2) {
|
|
156340
|
+
function assertNever(_x) {
|
|
156341
|
+
throw new Error();
|
|
156342
|
+
}
|
|
156343
|
+
__name(assertNever, "assertNever");
|
|
156344
|
+
util2.assertNever = assertNever;
|
|
156345
|
+
util2.arrayToEnum = (items) => {
|
|
156346
|
+
const obj = {};
|
|
156347
|
+
for (const item of items) {
|
|
156348
|
+
obj[item] = item;
|
|
156349
|
+
}
|
|
156350
|
+
return obj;
|
|
156351
|
+
};
|
|
156352
|
+
util2.getValidEnumValues = (obj) => {
|
|
156353
|
+
const validKeys = util2.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
|
|
156354
|
+
const filtered = {};
|
|
156355
|
+
for (const k of validKeys) {
|
|
156356
|
+
filtered[k] = obj[k];
|
|
156357
|
+
}
|
|
156358
|
+
return util2.objectValues(filtered);
|
|
156359
|
+
};
|
|
156360
|
+
util2.objectValues = (obj) => {
|
|
156361
|
+
return util2.objectKeys(obj).map(function(e) {
|
|
156362
|
+
return obj[e];
|
|
156363
|
+
});
|
|
156364
|
+
};
|
|
156365
|
+
util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => {
|
|
156366
|
+
const keys = [];
|
|
156367
|
+
for (const key2 in object) {
|
|
156368
|
+
if (Object.prototype.hasOwnProperty.call(object, key2)) {
|
|
156369
|
+
keys.push(key2);
|
|
156370
|
+
}
|
|
156371
|
+
}
|
|
156372
|
+
return keys;
|
|
156373
|
+
};
|
|
156374
|
+
util2.find = (arr, checker) => {
|
|
156375
|
+
for (const item of arr) {
|
|
156376
|
+
if (checker(item))
|
|
156377
|
+
return item;
|
|
156378
|
+
}
|
|
156379
|
+
return void 0;
|
|
156380
|
+
};
|
|
156381
|
+
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
|
|
156382
|
+
function joinValues(array, separator = " | ") {
|
|
156383
|
+
return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
|
156384
|
+
}
|
|
156385
|
+
__name(joinValues, "joinValues");
|
|
156386
|
+
util2.joinValues = joinValues;
|
|
156387
|
+
})(util || (util = {}));
|
|
156388
|
+
var ZodParsedType = util.arrayToEnum([
|
|
156389
|
+
"string",
|
|
156390
|
+
"nan",
|
|
156391
|
+
"number",
|
|
156392
|
+
"integer",
|
|
156393
|
+
"float",
|
|
156394
|
+
"boolean",
|
|
156395
|
+
"date",
|
|
156396
|
+
"bigint",
|
|
156397
|
+
"symbol",
|
|
156398
|
+
"function",
|
|
156399
|
+
"undefined",
|
|
156400
|
+
"null",
|
|
156401
|
+
"array",
|
|
156402
|
+
"object",
|
|
156403
|
+
"unknown",
|
|
156404
|
+
"promise",
|
|
156405
|
+
"void",
|
|
156406
|
+
"never",
|
|
156407
|
+
"map",
|
|
156408
|
+
"set"
|
|
156409
|
+
]);
|
|
156410
|
+
var getParsedType = /* @__PURE__ */ __name((data) => {
|
|
156411
|
+
const t = typeof data;
|
|
156412
|
+
switch (t) {
|
|
156413
|
+
case "undefined":
|
|
156414
|
+
return ZodParsedType.undefined;
|
|
156415
|
+
case "string":
|
|
156416
|
+
return ZodParsedType.string;
|
|
156417
|
+
case "number":
|
|
156418
|
+
return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
156419
|
+
case "boolean":
|
|
156420
|
+
return ZodParsedType.boolean;
|
|
156421
|
+
case "function":
|
|
156422
|
+
return ZodParsedType.function;
|
|
156423
|
+
case "bigint":
|
|
156424
|
+
return ZodParsedType.bigint;
|
|
156425
|
+
case "object":
|
|
156426
|
+
if (Array.isArray(data)) {
|
|
156427
|
+
return ZodParsedType.array;
|
|
156428
|
+
}
|
|
156429
|
+
if (data === null) {
|
|
156430
|
+
return ZodParsedType.null;
|
|
156431
|
+
}
|
|
156432
|
+
if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
|
|
156433
|
+
return ZodParsedType.promise;
|
|
156434
|
+
}
|
|
156435
|
+
if (typeof Map !== "undefined" && data instanceof Map) {
|
|
156436
|
+
return ZodParsedType.map;
|
|
156437
|
+
}
|
|
156438
|
+
if (typeof Set !== "undefined" && data instanceof Set) {
|
|
156439
|
+
return ZodParsedType.set;
|
|
156440
|
+
}
|
|
156441
|
+
if (typeof Date !== "undefined" && data instanceof Date) {
|
|
156442
|
+
return ZodParsedType.date;
|
|
156443
|
+
}
|
|
156444
|
+
return ZodParsedType.object;
|
|
156445
|
+
default:
|
|
156446
|
+
return ZodParsedType.unknown;
|
|
156447
|
+
}
|
|
156448
|
+
}, "getParsedType");
|
|
156449
|
+
var ZodIssueCode = util.arrayToEnum([
|
|
156450
|
+
"invalid_type",
|
|
156451
|
+
"invalid_literal",
|
|
156452
|
+
"custom",
|
|
156453
|
+
"invalid_union",
|
|
156454
|
+
"invalid_union_discriminator",
|
|
156455
|
+
"invalid_enum_value",
|
|
156456
|
+
"unrecognized_keys",
|
|
156457
|
+
"invalid_arguments",
|
|
156458
|
+
"invalid_return_type",
|
|
156459
|
+
"invalid_date",
|
|
156460
|
+
"invalid_string",
|
|
156461
|
+
"too_small",
|
|
156462
|
+
"too_big",
|
|
156463
|
+
"invalid_intersection_types",
|
|
156464
|
+
"not_multiple_of"
|
|
156465
|
+
]);
|
|
156466
|
+
var quotelessJson = /* @__PURE__ */ __name((obj) => {
|
|
156467
|
+
const json = JSON.stringify(obj, null, 2);
|
|
156468
|
+
return json.replace(/"([^"]+)":/g, "$1:");
|
|
156469
|
+
}, "quotelessJson");
|
|
156470
|
+
var ZodError = class extends Error {
|
|
156471
|
+
constructor(issues) {
|
|
156472
|
+
super();
|
|
156473
|
+
this.issues = [];
|
|
156474
|
+
this.addIssue = (sub) => {
|
|
156475
|
+
this.issues = [...this.issues, sub];
|
|
156476
|
+
};
|
|
156477
|
+
this.addIssues = (subs = []) => {
|
|
156478
|
+
this.issues = [...this.issues, ...subs];
|
|
156479
|
+
};
|
|
156480
|
+
const actualProto = new.target.prototype;
|
|
156481
|
+
if (Object.setPrototypeOf) {
|
|
156482
|
+
Object.setPrototypeOf(this, actualProto);
|
|
156483
|
+
} else {
|
|
156484
|
+
this.__proto__ = actualProto;
|
|
156485
|
+
}
|
|
156486
|
+
this.name = "ZodError";
|
|
156487
|
+
this.issues = issues;
|
|
156488
|
+
}
|
|
156489
|
+
get errors() {
|
|
156490
|
+
return this.issues;
|
|
156491
|
+
}
|
|
156492
|
+
format(_mapper) {
|
|
156493
|
+
const mapper = _mapper || function(issue) {
|
|
156494
|
+
return issue.message;
|
|
156495
|
+
};
|
|
156496
|
+
const fieldErrors = { _errors: [] };
|
|
156497
|
+
const processError = /* @__PURE__ */ __name((error) => {
|
|
156498
|
+
for (const issue of error.issues) {
|
|
156499
|
+
if (issue.code === "invalid_union") {
|
|
156500
|
+
issue.unionErrors.map(processError);
|
|
156501
|
+
} else if (issue.code === "invalid_return_type") {
|
|
156502
|
+
processError(issue.returnTypeError);
|
|
156503
|
+
} else if (issue.code === "invalid_arguments") {
|
|
156504
|
+
processError(issue.argumentsError);
|
|
156505
|
+
} else if (issue.path.length === 0) {
|
|
156506
|
+
fieldErrors._errors.push(mapper(issue));
|
|
156507
|
+
} else {
|
|
156508
|
+
let curr = fieldErrors;
|
|
156509
|
+
let i = 0;
|
|
156510
|
+
while (i < issue.path.length) {
|
|
156511
|
+
const el = issue.path[i];
|
|
156512
|
+
const terminal = i === issue.path.length - 1;
|
|
156513
|
+
if (!terminal) {
|
|
156514
|
+
curr[el] = curr[el] || { _errors: [] };
|
|
156515
|
+
} else {
|
|
156516
|
+
curr[el] = curr[el] || { _errors: [] };
|
|
156517
|
+
curr[el]._errors.push(mapper(issue));
|
|
156518
|
+
}
|
|
156519
|
+
curr = curr[el];
|
|
156520
|
+
i++;
|
|
156521
|
+
}
|
|
156522
|
+
}
|
|
156523
|
+
}
|
|
156524
|
+
}, "processError");
|
|
156525
|
+
processError(this);
|
|
156526
|
+
return fieldErrors;
|
|
156527
|
+
}
|
|
156528
|
+
toString() {
|
|
156529
|
+
return this.message;
|
|
156530
|
+
}
|
|
156531
|
+
get message() {
|
|
156532
|
+
return JSON.stringify(this.issues, null, 2);
|
|
156533
|
+
}
|
|
156534
|
+
get isEmpty() {
|
|
156535
|
+
return this.issues.length === 0;
|
|
156536
|
+
}
|
|
156537
|
+
flatten(mapper = (issue) => issue.message) {
|
|
156538
|
+
const fieldErrors = {};
|
|
156539
|
+
const formErrors = [];
|
|
156540
|
+
for (const sub of this.issues) {
|
|
156541
|
+
if (sub.path.length > 0) {
|
|
156542
|
+
fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
|
|
156543
|
+
fieldErrors[sub.path[0]].push(mapper(sub));
|
|
156544
|
+
} else {
|
|
156545
|
+
formErrors.push(mapper(sub));
|
|
156546
|
+
}
|
|
156547
|
+
}
|
|
156548
|
+
return { formErrors, fieldErrors };
|
|
156549
|
+
}
|
|
156550
|
+
get formErrors() {
|
|
156551
|
+
return this.flatten();
|
|
156552
|
+
}
|
|
156553
|
+
};
|
|
156554
|
+
__name(ZodError, "ZodError");
|
|
156555
|
+
ZodError.create = (issues) => {
|
|
156556
|
+
const error = new ZodError(issues);
|
|
156557
|
+
return error;
|
|
156558
|
+
};
|
|
156559
|
+
var defaultErrorMap = /* @__PURE__ */ __name((issue, _ctx) => {
|
|
156560
|
+
let message;
|
|
156561
|
+
switch (issue.code) {
|
|
156562
|
+
case ZodIssueCode.invalid_type:
|
|
156563
|
+
if (issue.received === ZodParsedType.undefined) {
|
|
156564
|
+
message = "Required";
|
|
156565
|
+
} else {
|
|
156566
|
+
message = `Expected ${issue.expected}, received ${issue.received}`;
|
|
156567
|
+
}
|
|
156568
|
+
break;
|
|
156569
|
+
case ZodIssueCode.invalid_literal:
|
|
156570
|
+
message = `Invalid literal value, expected ${JSON.stringify(issue.expected)}`;
|
|
156571
|
+
break;
|
|
156572
|
+
case ZodIssueCode.unrecognized_keys:
|
|
156573
|
+
message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`;
|
|
156574
|
+
break;
|
|
156575
|
+
case ZodIssueCode.invalid_union:
|
|
156576
|
+
message = `Invalid input`;
|
|
156577
|
+
break;
|
|
156578
|
+
case ZodIssueCode.invalid_union_discriminator:
|
|
156579
|
+
message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;
|
|
156580
|
+
break;
|
|
156581
|
+
case ZodIssueCode.invalid_enum_value:
|
|
156582
|
+
message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;
|
|
156583
|
+
break;
|
|
156584
|
+
case ZodIssueCode.invalid_arguments:
|
|
156585
|
+
message = `Invalid function arguments`;
|
|
156586
|
+
break;
|
|
156587
|
+
case ZodIssueCode.invalid_return_type:
|
|
156588
|
+
message = `Invalid function return type`;
|
|
156589
|
+
break;
|
|
156590
|
+
case ZodIssueCode.invalid_date:
|
|
156591
|
+
message = `Invalid date`;
|
|
156592
|
+
break;
|
|
156593
|
+
case ZodIssueCode.invalid_string:
|
|
156594
|
+
if (issue.validation !== "regex")
|
|
156595
|
+
message = `Invalid ${issue.validation}`;
|
|
156596
|
+
else
|
|
156597
|
+
message = "Invalid";
|
|
156598
|
+
break;
|
|
156599
|
+
case ZodIssueCode.too_small:
|
|
156600
|
+
if (issue.type === "array")
|
|
156601
|
+
message = `Array must contain ${issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
|
|
156602
|
+
else if (issue.type === "string")
|
|
156603
|
+
message = `String must contain ${issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
|
|
156604
|
+
else if (issue.type === "number")
|
|
156605
|
+
message = `Number must be greater than ${issue.inclusive ? `or equal to ` : ``}${issue.minimum}`;
|
|
156606
|
+
else
|
|
156607
|
+
message = "Invalid input";
|
|
156608
|
+
break;
|
|
156609
|
+
case ZodIssueCode.too_big:
|
|
156610
|
+
if (issue.type === "array")
|
|
156611
|
+
message = `Array must contain ${issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
|
|
156612
|
+
else if (issue.type === "string")
|
|
156613
|
+
message = `String must contain ${issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
|
|
156614
|
+
else if (issue.type === "number")
|
|
156615
|
+
message = `Number must be less than ${issue.inclusive ? `or equal to ` : ``}${issue.maximum}`;
|
|
156616
|
+
else
|
|
156617
|
+
message = "Invalid input";
|
|
156618
|
+
break;
|
|
156619
|
+
case ZodIssueCode.custom:
|
|
156620
|
+
message = `Invalid input`;
|
|
156621
|
+
break;
|
|
156622
|
+
case ZodIssueCode.invalid_intersection_types:
|
|
156623
|
+
message = `Intersection results could not be merged`;
|
|
156624
|
+
break;
|
|
156625
|
+
case ZodIssueCode.not_multiple_of:
|
|
156626
|
+
message = `Number must be a multiple of ${issue.multipleOf}`;
|
|
156627
|
+
break;
|
|
156628
|
+
default:
|
|
156629
|
+
message = _ctx.defaultError;
|
|
156630
|
+
util.assertNever(issue);
|
|
156631
|
+
}
|
|
156632
|
+
return { message };
|
|
156633
|
+
}, "defaultErrorMap");
|
|
156634
|
+
var overrideErrorMap = defaultErrorMap;
|
|
156635
|
+
var setErrorMap = /* @__PURE__ */ __name((map2) => {
|
|
156636
|
+
overrideErrorMap = map2;
|
|
156637
|
+
}, "setErrorMap");
|
|
156638
|
+
var makeIssue = /* @__PURE__ */ __name((params) => {
|
|
156639
|
+
const { data, path, errorMaps, issueData } = params;
|
|
156640
|
+
const fullPath = [...path, ...issueData.path || []];
|
|
156641
|
+
const fullIssue = __spreadProps(__spreadValues({}, issueData), {
|
|
156642
|
+
path: fullPath
|
|
156643
|
+
});
|
|
156644
|
+
let errorMessage = "";
|
|
156645
|
+
const maps = errorMaps.filter((m) => !!m).slice().reverse();
|
|
156646
|
+
for (const map2 of maps) {
|
|
156647
|
+
errorMessage = map2(fullIssue, { data, defaultError: errorMessage }).message;
|
|
156648
|
+
}
|
|
156649
|
+
return __spreadProps(__spreadValues({}, issueData), {
|
|
156650
|
+
path: fullPath,
|
|
156651
|
+
message: issueData.message || errorMessage
|
|
156652
|
+
});
|
|
156653
|
+
}, "makeIssue");
|
|
156654
|
+
var EMPTY_PATH = [];
|
|
156655
|
+
function addIssueToContext(ctx, issueData) {
|
|
156656
|
+
const issue = makeIssue({
|
|
156657
|
+
issueData,
|
|
156658
|
+
data: ctx.data,
|
|
156659
|
+
path: ctx.path,
|
|
156660
|
+
errorMaps: [
|
|
156661
|
+
ctx.common.contextualErrorMap,
|
|
156662
|
+
ctx.schemaErrorMap,
|
|
156663
|
+
overrideErrorMap,
|
|
156664
|
+
defaultErrorMap
|
|
156665
|
+
].filter((x) => !!x)
|
|
156666
|
+
});
|
|
156667
|
+
ctx.common.issues.push(issue);
|
|
156668
|
+
}
|
|
156669
|
+
__name(addIssueToContext, "addIssueToContext");
|
|
156670
|
+
var ParseStatus = class {
|
|
156671
|
+
constructor() {
|
|
156672
|
+
this.value = "valid";
|
|
156673
|
+
}
|
|
156674
|
+
dirty() {
|
|
156675
|
+
if (this.value === "valid")
|
|
156676
|
+
this.value = "dirty";
|
|
156677
|
+
}
|
|
156678
|
+
abort() {
|
|
156679
|
+
if (this.value !== "aborted")
|
|
156680
|
+
this.value = "aborted";
|
|
156681
|
+
}
|
|
156682
|
+
static mergeArray(status, results) {
|
|
156683
|
+
const arrayValue = [];
|
|
156684
|
+
for (const s of results) {
|
|
156685
|
+
if (s.status === "aborted")
|
|
156686
|
+
return INVALID;
|
|
156687
|
+
if (s.status === "dirty")
|
|
156688
|
+
status.dirty();
|
|
156689
|
+
arrayValue.push(s.value);
|
|
156690
|
+
}
|
|
156691
|
+
return { status: status.value, value: arrayValue };
|
|
156692
|
+
}
|
|
156693
|
+
static mergeObjectAsync(status, pairs) {
|
|
156694
|
+
return __async$1(this, null, function* () {
|
|
156695
|
+
const syncPairs = [];
|
|
156696
|
+
for (const pair of pairs) {
|
|
156697
|
+
syncPairs.push({
|
|
156698
|
+
key: yield pair.key,
|
|
156699
|
+
value: yield pair.value
|
|
156700
|
+
});
|
|
156701
|
+
}
|
|
156702
|
+
return ParseStatus.mergeObjectSync(status, syncPairs);
|
|
156703
|
+
});
|
|
156704
|
+
}
|
|
156705
|
+
static mergeObjectSync(status, pairs) {
|
|
156706
|
+
const finalObject = {};
|
|
156707
|
+
for (const pair of pairs) {
|
|
156708
|
+
const { key: key2, value } = pair;
|
|
156709
|
+
if (key2.status === "aborted")
|
|
156710
|
+
return INVALID;
|
|
156711
|
+
if (value.status === "aborted")
|
|
156712
|
+
return INVALID;
|
|
156713
|
+
if (key2.status === "dirty")
|
|
156714
|
+
status.dirty();
|
|
156715
|
+
if (value.status === "dirty")
|
|
156716
|
+
status.dirty();
|
|
156717
|
+
if (typeof value.value !== "undefined" || pair.alwaysSet) {
|
|
156718
|
+
finalObject[key2.value] = value.value;
|
|
156719
|
+
}
|
|
156720
|
+
}
|
|
156721
|
+
return { status: status.value, value: finalObject };
|
|
156722
|
+
}
|
|
156723
|
+
};
|
|
156724
|
+
__name(ParseStatus, "ParseStatus");
|
|
156725
|
+
var INVALID = Object.freeze({
|
|
156726
|
+
status: "aborted"
|
|
156727
|
+
});
|
|
156728
|
+
var DIRTY = /* @__PURE__ */ __name((value) => ({ status: "dirty", value }), "DIRTY");
|
|
156729
|
+
var OK = /* @__PURE__ */ __name((value) => ({ status: "valid", value }), "OK");
|
|
156730
|
+
var isAborted = /* @__PURE__ */ __name((x) => x.status === "aborted", "isAborted");
|
|
156731
|
+
var isDirty = /* @__PURE__ */ __name((x) => x.status === "dirty", "isDirty");
|
|
156732
|
+
var isValid = /* @__PURE__ */ __name((x) => x.status === "valid", "isValid");
|
|
156733
|
+
var isAsync = /* @__PURE__ */ __name((x) => typeof Promise !== void 0 && x instanceof Promise, "isAsync");
|
|
156734
|
+
var errorUtil;
|
|
156735
|
+
(function(errorUtil2) {
|
|
156736
|
+
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
156737
|
+
errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
|
|
156738
|
+
})(errorUtil || (errorUtil = {}));
|
|
156739
|
+
var ParseInputLazyPath = class {
|
|
156740
|
+
constructor(parent, value, path, key2) {
|
|
156741
|
+
this.parent = parent;
|
|
156742
|
+
this.data = value;
|
|
156743
|
+
this._path = path;
|
|
156744
|
+
this._key = key2;
|
|
156745
|
+
}
|
|
156746
|
+
get path() {
|
|
156747
|
+
return this._path.concat(this._key);
|
|
156748
|
+
}
|
|
156749
|
+
};
|
|
156750
|
+
__name(ParseInputLazyPath, "ParseInputLazyPath");
|
|
156751
|
+
var handleResult = /* @__PURE__ */ __name((ctx, result) => {
|
|
156752
|
+
if (isValid(result)) {
|
|
156753
|
+
return { success: true, data: result.value };
|
|
156754
|
+
} else {
|
|
156755
|
+
if (!ctx.common.issues.length) {
|
|
156756
|
+
throw new Error("Validation failed but no issues detected.");
|
|
156757
|
+
}
|
|
156758
|
+
const error = new ZodError(ctx.common.issues);
|
|
156759
|
+
return { success: false, error };
|
|
156760
|
+
}
|
|
156761
|
+
}, "handleResult");
|
|
156762
|
+
function processCreateParams(params) {
|
|
156763
|
+
if (!params)
|
|
156764
|
+
return {};
|
|
156765
|
+
const { errorMap, invalid_type_error, required_error, description } = params;
|
|
156766
|
+
if (errorMap && (invalid_type_error || required_error)) {
|
|
156767
|
+
throw new Error(`Can't use "invalid" or "required" in conjunction with custom error map.`);
|
|
156768
|
+
}
|
|
156769
|
+
if (errorMap)
|
|
156770
|
+
return { errorMap, description };
|
|
156771
|
+
const customMap = /* @__PURE__ */ __name((iss, ctx) => {
|
|
156772
|
+
if (iss.code !== "invalid_type")
|
|
156773
|
+
return { message: ctx.defaultError };
|
|
156774
|
+
if (typeof ctx.data === "undefined" && required_error)
|
|
156775
|
+
return { message: required_error };
|
|
156776
|
+
if (params.invalid_type_error)
|
|
156777
|
+
return { message: params.invalid_type_error };
|
|
156778
|
+
return { message: ctx.defaultError };
|
|
156779
|
+
}, "customMap");
|
|
156780
|
+
return { errorMap: customMap, description };
|
|
156781
|
+
}
|
|
156782
|
+
__name(processCreateParams, "processCreateParams");
|
|
156783
|
+
var ZodType = class {
|
|
156784
|
+
constructor(def) {
|
|
156785
|
+
this.spa = this.safeParseAsync;
|
|
156786
|
+
this.superRefine = this._refinement;
|
|
156787
|
+
this._def = def;
|
|
156788
|
+
this.parse = this.parse.bind(this);
|
|
156789
|
+
this.safeParse = this.safeParse.bind(this);
|
|
156790
|
+
this.parseAsync = this.parseAsync.bind(this);
|
|
156791
|
+
this.safeParseAsync = this.safeParseAsync.bind(this);
|
|
156792
|
+
this.spa = this.spa.bind(this);
|
|
156793
|
+
this.refine = this.refine.bind(this);
|
|
156794
|
+
this.refinement = this.refinement.bind(this);
|
|
156795
|
+
this.superRefine = this.superRefine.bind(this);
|
|
156796
|
+
this.optional = this.optional.bind(this);
|
|
156797
|
+
this.nullable = this.nullable.bind(this);
|
|
156798
|
+
this.nullish = this.nullish.bind(this);
|
|
156799
|
+
this.array = this.array.bind(this);
|
|
156800
|
+
this.promise = this.promise.bind(this);
|
|
156801
|
+
this.or = this.or.bind(this);
|
|
156802
|
+
this.and = this.and.bind(this);
|
|
156803
|
+
this.transform = this.transform.bind(this);
|
|
156804
|
+
this.default = this.default.bind(this);
|
|
156805
|
+
this.describe = this.describe.bind(this);
|
|
156806
|
+
this.isNullable = this.isNullable.bind(this);
|
|
156807
|
+
this.isOptional = this.isOptional.bind(this);
|
|
156808
|
+
}
|
|
156809
|
+
get description() {
|
|
156810
|
+
return this._def.description;
|
|
156811
|
+
}
|
|
156812
|
+
_getType(input) {
|
|
156813
|
+
return getParsedType(input.data);
|
|
156814
|
+
}
|
|
156815
|
+
_getOrReturnCtx(input, ctx) {
|
|
156816
|
+
return ctx || {
|
|
156817
|
+
common: input.parent.common,
|
|
156818
|
+
data: input.data,
|
|
156819
|
+
parsedType: getParsedType(input.data),
|
|
156820
|
+
schemaErrorMap: this._def.errorMap,
|
|
156821
|
+
path: input.path,
|
|
156822
|
+
parent: input.parent
|
|
156823
|
+
};
|
|
156824
|
+
}
|
|
156825
|
+
_processInputParams(input) {
|
|
156826
|
+
return {
|
|
156827
|
+
status: new ParseStatus(),
|
|
156828
|
+
ctx: {
|
|
156829
|
+
common: input.parent.common,
|
|
156830
|
+
data: input.data,
|
|
156831
|
+
parsedType: getParsedType(input.data),
|
|
156832
|
+
schemaErrorMap: this._def.errorMap,
|
|
156833
|
+
path: input.path,
|
|
156834
|
+
parent: input.parent
|
|
156835
|
+
}
|
|
156836
|
+
};
|
|
156837
|
+
}
|
|
156838
|
+
_parseSync(input) {
|
|
156839
|
+
const result = this._parse(input);
|
|
156840
|
+
if (isAsync(result)) {
|
|
156841
|
+
throw new Error("Synchronous parse encountered promise.");
|
|
156842
|
+
}
|
|
156843
|
+
return result;
|
|
156844
|
+
}
|
|
156845
|
+
_parseAsync(input) {
|
|
156846
|
+
const result = this._parse(input);
|
|
156847
|
+
return Promise.resolve(result);
|
|
156848
|
+
}
|
|
156849
|
+
parse(data, params) {
|
|
156850
|
+
const result = this.safeParse(data, params);
|
|
156851
|
+
if (result.success)
|
|
156852
|
+
return result.data;
|
|
156853
|
+
throw result.error;
|
|
156854
|
+
}
|
|
156855
|
+
safeParse(data, params) {
|
|
156856
|
+
var _a;
|
|
156857
|
+
const ctx = {
|
|
156858
|
+
common: {
|
|
156859
|
+
issues: [],
|
|
156860
|
+
async: (_a = params === null || params === void 0 ? void 0 : params.async) !== null && _a !== void 0 ? _a : false,
|
|
156861
|
+
contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap
|
|
156862
|
+
},
|
|
156863
|
+
path: (params === null || params === void 0 ? void 0 : params.path) || [],
|
|
156864
|
+
schemaErrorMap: this._def.errorMap,
|
|
156865
|
+
parent: null,
|
|
156866
|
+
data,
|
|
156867
|
+
parsedType: getParsedType(data)
|
|
156868
|
+
};
|
|
156869
|
+
const result = this._parseSync({ data, path: ctx.path, parent: ctx });
|
|
156870
|
+
return handleResult(ctx, result);
|
|
156871
|
+
}
|
|
156872
|
+
parseAsync(data, params) {
|
|
156873
|
+
return __async$1(this, null, function* () {
|
|
156874
|
+
const result = yield this.safeParseAsync(data, params);
|
|
156875
|
+
if (result.success)
|
|
156876
|
+
return result.data;
|
|
156877
|
+
throw result.error;
|
|
156878
|
+
});
|
|
156879
|
+
}
|
|
156880
|
+
safeParseAsync(data, params) {
|
|
156881
|
+
return __async$1(this, null, function* () {
|
|
156882
|
+
const ctx = {
|
|
156883
|
+
common: {
|
|
156884
|
+
issues: [],
|
|
156885
|
+
contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,
|
|
156886
|
+
async: true
|
|
156887
|
+
},
|
|
156888
|
+
path: (params === null || params === void 0 ? void 0 : params.path) || [],
|
|
156889
|
+
schemaErrorMap: this._def.errorMap,
|
|
156890
|
+
parent: null,
|
|
156891
|
+
data,
|
|
156892
|
+
parsedType: getParsedType(data)
|
|
156893
|
+
};
|
|
156675
156894
|
const maybeAsyncResult = this._parse({ data, path: [], parent: ctx });
|
|
156676
156895
|
const result = yield isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult);
|
|
156677
156896
|
return handleResult(ctx, result);
|
|
@@ -159931,1543 +160150,788 @@ var formatters2 = {
|
|
|
159931
160150
|
}
|
|
159932
160151
|
return addLeadingZeros(weekYear, token.length);
|
|
159933
160152
|
},
|
|
159934
|
-
R: function(date, token) {
|
|
159935
|
-
var isoWeekYear = getUTCISOWeekYear(date);
|
|
159936
|
-
return addLeadingZeros(isoWeekYear, token.length);
|
|
159937
|
-
},
|
|
159938
|
-
u: function(date, token) {
|
|
159939
|
-
var year = date.getUTCFullYear();
|
|
159940
|
-
return addLeadingZeros(year, token.length);
|
|
159941
|
-
},
|
|
159942
|
-
Q: function(date, token, localize2) {
|
|
159943
|
-
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
|
|
159944
|
-
switch (token) {
|
|
159945
|
-
case "Q":
|
|
159946
|
-
return String(quarter);
|
|
159947
|
-
case "QQ":
|
|
159948
|
-
return addLeadingZeros(quarter, 2);
|
|
159949
|
-
case "Qo":
|
|
159950
|
-
return localize2.ordinalNumber(quarter, {
|
|
159951
|
-
unit: "quarter"
|
|
159952
|
-
});
|
|
159953
|
-
case "QQQ":
|
|
159954
|
-
return localize2.quarter(quarter, {
|
|
159955
|
-
width: "abbreviated",
|
|
159956
|
-
context: "formatting"
|
|
159957
|
-
});
|
|
159958
|
-
case "QQQQQ":
|
|
159959
|
-
return localize2.quarter(quarter, {
|
|
159960
|
-
width: "narrow",
|
|
159961
|
-
context: "formatting"
|
|
159962
|
-
});
|
|
159963
|
-
case "QQQQ":
|
|
159964
|
-
default:
|
|
159965
|
-
return localize2.quarter(quarter, {
|
|
159966
|
-
width: "wide",
|
|
159967
|
-
context: "formatting"
|
|
159968
|
-
});
|
|
159969
|
-
}
|
|
159970
|
-
},
|
|
159971
|
-
q: function(date, token, localize2) {
|
|
159972
|
-
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
|
|
159973
|
-
switch (token) {
|
|
159974
|
-
case "q":
|
|
159975
|
-
return String(quarter);
|
|
159976
|
-
case "qq":
|
|
159977
|
-
return addLeadingZeros(quarter, 2);
|
|
159978
|
-
case "qo":
|
|
159979
|
-
return localize2.ordinalNumber(quarter, {
|
|
159980
|
-
unit: "quarter"
|
|
159981
|
-
});
|
|
159982
|
-
case "qqq":
|
|
159983
|
-
return localize2.quarter(quarter, {
|
|
159984
|
-
width: "abbreviated",
|
|
159985
|
-
context: "standalone"
|
|
159986
|
-
});
|
|
159987
|
-
case "qqqqq":
|
|
159988
|
-
return localize2.quarter(quarter, {
|
|
159989
|
-
width: "narrow",
|
|
159990
|
-
context: "standalone"
|
|
159991
|
-
});
|
|
159992
|
-
case "qqqq":
|
|
159993
|
-
default:
|
|
159994
|
-
return localize2.quarter(quarter, {
|
|
159995
|
-
width: "wide",
|
|
159996
|
-
context: "standalone"
|
|
159997
|
-
});
|
|
159998
|
-
}
|
|
159999
|
-
},
|
|
160000
|
-
M: function(date, token, localize2) {
|
|
160001
|
-
var month = date.getUTCMonth();
|
|
160002
|
-
switch (token) {
|
|
160003
|
-
case "M":
|
|
160004
|
-
case "MM":
|
|
160005
|
-
return lightFormatters_default.M(date, token);
|
|
160006
|
-
case "Mo":
|
|
160007
|
-
return localize2.ordinalNumber(month + 1, {
|
|
160008
|
-
unit: "month"
|
|
160009
|
-
});
|
|
160010
|
-
case "MMM":
|
|
160011
|
-
return localize2.month(month, {
|
|
160012
|
-
width: "abbreviated",
|
|
160013
|
-
context: "formatting"
|
|
160014
|
-
});
|
|
160015
|
-
case "MMMMM":
|
|
160016
|
-
return localize2.month(month, {
|
|
160017
|
-
width: "narrow",
|
|
160018
|
-
context: "formatting"
|
|
160019
|
-
});
|
|
160020
|
-
case "MMMM":
|
|
160021
|
-
default:
|
|
160022
|
-
return localize2.month(month, {
|
|
160023
|
-
width: "wide",
|
|
160024
|
-
context: "formatting"
|
|
160025
|
-
});
|
|
160026
|
-
}
|
|
160027
|
-
},
|
|
160028
|
-
L: function(date, token, localize2) {
|
|
160029
|
-
var month = date.getUTCMonth();
|
|
160030
|
-
switch (token) {
|
|
160031
|
-
case "L":
|
|
160032
|
-
return String(month + 1);
|
|
160033
|
-
case "LL":
|
|
160034
|
-
return addLeadingZeros(month + 1, 2);
|
|
160035
|
-
case "Lo":
|
|
160036
|
-
return localize2.ordinalNumber(month + 1, {
|
|
160037
|
-
unit: "month"
|
|
160038
|
-
});
|
|
160039
|
-
case "LLL":
|
|
160040
|
-
return localize2.month(month, {
|
|
160041
|
-
width: "abbreviated",
|
|
160042
|
-
context: "standalone"
|
|
160043
|
-
});
|
|
160044
|
-
case "LLLLL":
|
|
160045
|
-
return localize2.month(month, {
|
|
160046
|
-
width: "narrow",
|
|
160047
|
-
context: "standalone"
|
|
160048
|
-
});
|
|
160049
|
-
case "LLLL":
|
|
160050
|
-
default:
|
|
160051
|
-
return localize2.month(month, {
|
|
160052
|
-
width: "wide",
|
|
160053
|
-
context: "standalone"
|
|
160054
|
-
});
|
|
160055
|
-
}
|
|
160056
|
-
},
|
|
160057
|
-
w: function(date, token, localize2, options) {
|
|
160058
|
-
var week = getUTCWeek(date, options);
|
|
160059
|
-
if (token === "wo") {
|
|
160060
|
-
return localize2.ordinalNumber(week, {
|
|
160061
|
-
unit: "week"
|
|
160062
|
-
});
|
|
160063
|
-
}
|
|
160064
|
-
return addLeadingZeros(week, token.length);
|
|
160065
|
-
},
|
|
160066
|
-
I: function(date, token, localize2) {
|
|
160067
|
-
var isoWeek = getUTCISOWeek(date);
|
|
160068
|
-
if (token === "Io") {
|
|
160069
|
-
return localize2.ordinalNumber(isoWeek, {
|
|
160070
|
-
unit: "week"
|
|
160071
|
-
});
|
|
160072
|
-
}
|
|
160073
|
-
return addLeadingZeros(isoWeek, token.length);
|
|
160074
|
-
},
|
|
160075
|
-
d: function(date, token, localize2) {
|
|
160076
|
-
if (token === "do") {
|
|
160077
|
-
return localize2.ordinalNumber(date.getUTCDate(), {
|
|
160078
|
-
unit: "date"
|
|
160079
|
-
});
|
|
160080
|
-
}
|
|
160081
|
-
return lightFormatters_default.d(date, token);
|
|
160082
|
-
},
|
|
160083
|
-
D: function(date, token, localize2) {
|
|
160084
|
-
var dayOfYear = getUTCDayOfYear(date);
|
|
160085
|
-
if (token === "Do") {
|
|
160086
|
-
return localize2.ordinalNumber(dayOfYear, {
|
|
160087
|
-
unit: "dayOfYear"
|
|
160088
|
-
});
|
|
160089
|
-
}
|
|
160090
|
-
return addLeadingZeros(dayOfYear, token.length);
|
|
160091
|
-
},
|
|
160092
|
-
E: function(date, token, localize2) {
|
|
160093
|
-
var dayOfWeek = date.getUTCDay();
|
|
160094
|
-
switch (token) {
|
|
160095
|
-
case "E":
|
|
160096
|
-
case "EE":
|
|
160097
|
-
case "EEE":
|
|
160098
|
-
return localize2.day(dayOfWeek, {
|
|
160099
|
-
width: "abbreviated",
|
|
160100
|
-
context: "formatting"
|
|
160101
|
-
});
|
|
160102
|
-
case "EEEEE":
|
|
160103
|
-
return localize2.day(dayOfWeek, {
|
|
160104
|
-
width: "narrow",
|
|
160105
|
-
context: "formatting"
|
|
160106
|
-
});
|
|
160107
|
-
case "EEEEEE":
|
|
160108
|
-
return localize2.day(dayOfWeek, {
|
|
160109
|
-
width: "short",
|
|
160110
|
-
context: "formatting"
|
|
160111
|
-
});
|
|
160112
|
-
case "EEEE":
|
|
160113
|
-
default:
|
|
160114
|
-
return localize2.day(dayOfWeek, {
|
|
160115
|
-
width: "wide",
|
|
160116
|
-
context: "formatting"
|
|
160117
|
-
});
|
|
160118
|
-
}
|
|
160119
|
-
},
|
|
160120
|
-
e: function(date, token, localize2, options) {
|
|
160121
|
-
var dayOfWeek = date.getUTCDay();
|
|
160122
|
-
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
160123
|
-
switch (token) {
|
|
160124
|
-
case "e":
|
|
160125
|
-
return String(localDayOfWeek);
|
|
160126
|
-
case "ee":
|
|
160127
|
-
return addLeadingZeros(localDayOfWeek, 2);
|
|
160128
|
-
case "eo":
|
|
160129
|
-
return localize2.ordinalNumber(localDayOfWeek, {
|
|
160130
|
-
unit: "day"
|
|
160131
|
-
});
|
|
160132
|
-
case "eee":
|
|
160133
|
-
return localize2.day(dayOfWeek, {
|
|
160134
|
-
width: "abbreviated",
|
|
160135
|
-
context: "formatting"
|
|
160136
|
-
});
|
|
160137
|
-
case "eeeee":
|
|
160138
|
-
return localize2.day(dayOfWeek, {
|
|
160139
|
-
width: "narrow",
|
|
160140
|
-
context: "formatting"
|
|
160141
|
-
});
|
|
160142
|
-
case "eeeeee":
|
|
160143
|
-
return localize2.day(dayOfWeek, {
|
|
160144
|
-
width: "short",
|
|
160145
|
-
context: "formatting"
|
|
160146
|
-
});
|
|
160147
|
-
case "eeee":
|
|
160148
|
-
default:
|
|
160149
|
-
return localize2.day(dayOfWeek, {
|
|
160150
|
-
width: "wide",
|
|
160151
|
-
context: "formatting"
|
|
160152
|
-
});
|
|
160153
|
-
}
|
|
160154
|
-
},
|
|
160155
|
-
c: function(date, token, localize2, options) {
|
|
160156
|
-
var dayOfWeek = date.getUTCDay();
|
|
160157
|
-
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
160158
|
-
switch (token) {
|
|
160159
|
-
case "c":
|
|
160160
|
-
return String(localDayOfWeek);
|
|
160161
|
-
case "cc":
|
|
160162
|
-
return addLeadingZeros(localDayOfWeek, token.length);
|
|
160163
|
-
case "co":
|
|
160164
|
-
return localize2.ordinalNumber(localDayOfWeek, {
|
|
160165
|
-
unit: "day"
|
|
160166
|
-
});
|
|
160167
|
-
case "ccc":
|
|
160168
|
-
return localize2.day(dayOfWeek, {
|
|
160169
|
-
width: "abbreviated",
|
|
160170
|
-
context: "standalone"
|
|
160171
|
-
});
|
|
160172
|
-
case "ccccc":
|
|
160173
|
-
return localize2.day(dayOfWeek, {
|
|
160174
|
-
width: "narrow",
|
|
160175
|
-
context: "standalone"
|
|
160176
|
-
});
|
|
160177
|
-
case "cccccc":
|
|
160178
|
-
return localize2.day(dayOfWeek, {
|
|
160179
|
-
width: "short",
|
|
160180
|
-
context: "standalone"
|
|
160181
|
-
});
|
|
160182
|
-
case "cccc":
|
|
160183
|
-
default:
|
|
160184
|
-
return localize2.day(dayOfWeek, {
|
|
160185
|
-
width: "wide",
|
|
160186
|
-
context: "standalone"
|
|
160187
|
-
});
|
|
160188
|
-
}
|
|
160153
|
+
R: function(date, token) {
|
|
160154
|
+
var isoWeekYear = getUTCISOWeekYear(date);
|
|
160155
|
+
return addLeadingZeros(isoWeekYear, token.length);
|
|
160189
160156
|
},
|
|
160190
|
-
|
|
160191
|
-
var
|
|
160192
|
-
|
|
160157
|
+
u: function(date, token) {
|
|
160158
|
+
var year = date.getUTCFullYear();
|
|
160159
|
+
return addLeadingZeros(year, token.length);
|
|
160160
|
+
},
|
|
160161
|
+
Q: function(date, token, localize2) {
|
|
160162
|
+
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
|
|
160193
160163
|
switch (token) {
|
|
160194
|
-
case "
|
|
160195
|
-
return String(
|
|
160196
|
-
case "
|
|
160197
|
-
return addLeadingZeros(
|
|
160198
|
-
case "
|
|
160199
|
-
return localize2.ordinalNumber(
|
|
160200
|
-
unit: "
|
|
160164
|
+
case "Q":
|
|
160165
|
+
return String(quarter);
|
|
160166
|
+
case "QQ":
|
|
160167
|
+
return addLeadingZeros(quarter, 2);
|
|
160168
|
+
case "Qo":
|
|
160169
|
+
return localize2.ordinalNumber(quarter, {
|
|
160170
|
+
unit: "quarter"
|
|
160201
160171
|
});
|
|
160202
|
-
case "
|
|
160203
|
-
return localize2.
|
|
160172
|
+
case "QQQ":
|
|
160173
|
+
return localize2.quarter(quarter, {
|
|
160204
160174
|
width: "abbreviated",
|
|
160205
160175
|
context: "formatting"
|
|
160206
160176
|
});
|
|
160207
|
-
case "
|
|
160208
|
-
return localize2.
|
|
160177
|
+
case "QQQQQ":
|
|
160178
|
+
return localize2.quarter(quarter, {
|
|
160209
160179
|
width: "narrow",
|
|
160210
160180
|
context: "formatting"
|
|
160211
160181
|
});
|
|
160212
|
-
case "
|
|
160213
|
-
return localize2.day(dayOfWeek, {
|
|
160214
|
-
width: "short",
|
|
160215
|
-
context: "formatting"
|
|
160216
|
-
});
|
|
160217
|
-
case "iiii":
|
|
160182
|
+
case "QQQQ":
|
|
160218
160183
|
default:
|
|
160219
|
-
return localize2.
|
|
160184
|
+
return localize2.quarter(quarter, {
|
|
160220
160185
|
width: "wide",
|
|
160221
160186
|
context: "formatting"
|
|
160222
160187
|
});
|
|
160223
160188
|
}
|
|
160224
160189
|
},
|
|
160225
|
-
|
|
160226
|
-
var
|
|
160227
|
-
var dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
|
|
160190
|
+
q: function(date, token, localize2) {
|
|
160191
|
+
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
|
|
160228
160192
|
switch (token) {
|
|
160229
|
-
case "
|
|
160230
|
-
|
|
160231
|
-
|
|
160232
|
-
|
|
160233
|
-
|
|
160193
|
+
case "q":
|
|
160194
|
+
return String(quarter);
|
|
160195
|
+
case "qq":
|
|
160196
|
+
return addLeadingZeros(quarter, 2);
|
|
160197
|
+
case "qo":
|
|
160198
|
+
return localize2.ordinalNumber(quarter, {
|
|
160199
|
+
unit: "quarter"
|
|
160234
160200
|
});
|
|
160235
|
-
case "
|
|
160236
|
-
return localize2.
|
|
160201
|
+
case "qqq":
|
|
160202
|
+
return localize2.quarter(quarter, {
|
|
160237
160203
|
width: "abbreviated",
|
|
160238
|
-
context: "
|
|
160239
|
-
})
|
|
160240
|
-
case "
|
|
160241
|
-
return localize2.
|
|
160204
|
+
context: "standalone"
|
|
160205
|
+
});
|
|
160206
|
+
case "qqqqq":
|
|
160207
|
+
return localize2.quarter(quarter, {
|
|
160242
160208
|
width: "narrow",
|
|
160243
|
-
context: "
|
|
160209
|
+
context: "standalone"
|
|
160244
160210
|
});
|
|
160245
|
-
case "
|
|
160211
|
+
case "qqqq":
|
|
160246
160212
|
default:
|
|
160247
|
-
return localize2.
|
|
160213
|
+
return localize2.quarter(quarter, {
|
|
160248
160214
|
width: "wide",
|
|
160249
|
-
context: "
|
|
160215
|
+
context: "standalone"
|
|
160250
160216
|
});
|
|
160251
160217
|
}
|
|
160252
160218
|
},
|
|
160253
|
-
|
|
160254
|
-
var
|
|
160255
|
-
var dayPeriodEnumValue;
|
|
160256
|
-
if (hours === 12) {
|
|
160257
|
-
dayPeriodEnumValue = dayPeriodEnum.noon;
|
|
160258
|
-
} else if (hours === 0) {
|
|
160259
|
-
dayPeriodEnumValue = dayPeriodEnum.midnight;
|
|
160260
|
-
} else {
|
|
160261
|
-
dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
|
|
160262
|
-
}
|
|
160219
|
+
M: function(date, token, localize2) {
|
|
160220
|
+
var month = date.getUTCMonth();
|
|
160263
160221
|
switch (token) {
|
|
160264
|
-
case "
|
|
160265
|
-
case "
|
|
160266
|
-
return
|
|
160267
|
-
|
|
160268
|
-
|
|
160222
|
+
case "M":
|
|
160223
|
+
case "MM":
|
|
160224
|
+
return lightFormatters_default.M(date, token);
|
|
160225
|
+
case "Mo":
|
|
160226
|
+
return localize2.ordinalNumber(month + 1, {
|
|
160227
|
+
unit: "month"
|
|
160269
160228
|
});
|
|
160270
|
-
case "
|
|
160271
|
-
return localize2.
|
|
160229
|
+
case "MMM":
|
|
160230
|
+
return localize2.month(month, {
|
|
160272
160231
|
width: "abbreviated",
|
|
160273
160232
|
context: "formatting"
|
|
160274
|
-
})
|
|
160275
|
-
case "
|
|
160276
|
-
return localize2.
|
|
160233
|
+
});
|
|
160234
|
+
case "MMMMM":
|
|
160235
|
+
return localize2.month(month, {
|
|
160277
160236
|
width: "narrow",
|
|
160278
160237
|
context: "formatting"
|
|
160279
160238
|
});
|
|
160280
|
-
case "
|
|
160239
|
+
case "MMMM":
|
|
160281
160240
|
default:
|
|
160282
|
-
return localize2.
|
|
160241
|
+
return localize2.month(month, {
|
|
160283
160242
|
width: "wide",
|
|
160284
160243
|
context: "formatting"
|
|
160285
160244
|
});
|
|
160286
160245
|
}
|
|
160287
160246
|
},
|
|
160288
|
-
|
|
160289
|
-
var
|
|
160290
|
-
var dayPeriodEnumValue;
|
|
160291
|
-
if (hours >= 17) {
|
|
160292
|
-
dayPeriodEnumValue = dayPeriodEnum.evening;
|
|
160293
|
-
} else if (hours >= 12) {
|
|
160294
|
-
dayPeriodEnumValue = dayPeriodEnum.afternoon;
|
|
160295
|
-
} else if (hours >= 4) {
|
|
160296
|
-
dayPeriodEnumValue = dayPeriodEnum.morning;
|
|
160297
|
-
} else {
|
|
160298
|
-
dayPeriodEnumValue = dayPeriodEnum.night;
|
|
160299
|
-
}
|
|
160247
|
+
L: function(date, token, localize2) {
|
|
160248
|
+
var month = date.getUTCMonth();
|
|
160300
160249
|
switch (token) {
|
|
160301
|
-
case "
|
|
160302
|
-
|
|
160303
|
-
case "
|
|
160304
|
-
return
|
|
160250
|
+
case "L":
|
|
160251
|
+
return String(month + 1);
|
|
160252
|
+
case "LL":
|
|
160253
|
+
return addLeadingZeros(month + 1, 2);
|
|
160254
|
+
case "Lo":
|
|
160255
|
+
return localize2.ordinalNumber(month + 1, {
|
|
160256
|
+
unit: "month"
|
|
160257
|
+
});
|
|
160258
|
+
case "LLL":
|
|
160259
|
+
return localize2.month(month, {
|
|
160305
160260
|
width: "abbreviated",
|
|
160306
|
-
context: "
|
|
160261
|
+
context: "standalone"
|
|
160307
160262
|
});
|
|
160308
|
-
case "
|
|
160309
|
-
return localize2.
|
|
160263
|
+
case "LLLLL":
|
|
160264
|
+
return localize2.month(month, {
|
|
160310
160265
|
width: "narrow",
|
|
160311
|
-
context: "
|
|
160266
|
+
context: "standalone"
|
|
160312
160267
|
});
|
|
160313
|
-
case "
|
|
160268
|
+
case "LLLL":
|
|
160314
160269
|
default:
|
|
160315
|
-
return localize2.
|
|
160270
|
+
return localize2.month(month, {
|
|
160316
160271
|
width: "wide",
|
|
160317
|
-
context: "
|
|
160272
|
+
context: "standalone"
|
|
160318
160273
|
});
|
|
160319
160274
|
}
|
|
160320
160275
|
},
|
|
160321
|
-
|
|
160322
|
-
|
|
160323
|
-
|
|
160324
|
-
|
|
160325
|
-
|
|
160326
|
-
return localize2.ordinalNumber(hours, {
|
|
160327
|
-
unit: "hour"
|
|
160328
|
-
});
|
|
160329
|
-
}
|
|
160330
|
-
return lightFormatters_default.h(date, token);
|
|
160331
|
-
},
|
|
160332
|
-
H: function(date, token, localize2) {
|
|
160333
|
-
if (token === "Ho") {
|
|
160334
|
-
return localize2.ordinalNumber(date.getUTCHours(), {
|
|
160335
|
-
unit: "hour"
|
|
160336
|
-
});
|
|
160337
|
-
}
|
|
160338
|
-
return lightFormatters_default.H(date, token);
|
|
160339
|
-
},
|
|
160340
|
-
K: function(date, token, localize2) {
|
|
160341
|
-
var hours = date.getUTCHours() % 12;
|
|
160342
|
-
if (token === "Ko") {
|
|
160343
|
-
return localize2.ordinalNumber(hours, {
|
|
160344
|
-
unit: "hour"
|
|
160345
|
-
});
|
|
160346
|
-
}
|
|
160347
|
-
return addLeadingZeros(hours, token.length);
|
|
160348
|
-
},
|
|
160349
|
-
k: function(date, token, localize2) {
|
|
160350
|
-
var hours = date.getUTCHours();
|
|
160351
|
-
if (hours === 0)
|
|
160352
|
-
hours = 24;
|
|
160353
|
-
if (token === "ko") {
|
|
160354
|
-
return localize2.ordinalNumber(hours, {
|
|
160355
|
-
unit: "hour"
|
|
160356
|
-
});
|
|
160357
|
-
}
|
|
160358
|
-
return addLeadingZeros(hours, token.length);
|
|
160359
|
-
},
|
|
160360
|
-
m: function(date, token, localize2) {
|
|
160361
|
-
if (token === "mo") {
|
|
160362
|
-
return localize2.ordinalNumber(date.getUTCMinutes(), {
|
|
160363
|
-
unit: "minute"
|
|
160276
|
+
w: function(date, token, localize2, options) {
|
|
160277
|
+
var week = getUTCWeek(date, options);
|
|
160278
|
+
if (token === "wo") {
|
|
160279
|
+
return localize2.ordinalNumber(week, {
|
|
160280
|
+
unit: "week"
|
|
160364
160281
|
});
|
|
160365
160282
|
}
|
|
160366
|
-
return
|
|
160283
|
+
return addLeadingZeros(week, token.length);
|
|
160367
160284
|
},
|
|
160368
|
-
|
|
160369
|
-
|
|
160370
|
-
|
|
160371
|
-
|
|
160285
|
+
I: function(date, token, localize2) {
|
|
160286
|
+
var isoWeek = getUTCISOWeek(date);
|
|
160287
|
+
if (token === "Io") {
|
|
160288
|
+
return localize2.ordinalNumber(isoWeek, {
|
|
160289
|
+
unit: "week"
|
|
160372
160290
|
});
|
|
160373
160291
|
}
|
|
160374
|
-
return
|
|
160375
|
-
},
|
|
160376
|
-
S: function(date, token) {
|
|
160377
|
-
return lightFormatters_default.S(date, token);
|
|
160378
|
-
},
|
|
160379
|
-
X: function(date, token, _localize, options) {
|
|
160380
|
-
var originalDate = options._originalDate || date;
|
|
160381
|
-
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
160382
|
-
if (timezoneOffset === 0) {
|
|
160383
|
-
return "Z";
|
|
160384
|
-
}
|
|
160385
|
-
switch (token) {
|
|
160386
|
-
case "X":
|
|
160387
|
-
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
160388
|
-
case "XXXX":
|
|
160389
|
-
case "XX":
|
|
160390
|
-
return formatTimezone(timezoneOffset);
|
|
160391
|
-
case "XXXXX":
|
|
160392
|
-
case "XXX":
|
|
160393
|
-
default:
|
|
160394
|
-
return formatTimezone(timezoneOffset, ":");
|
|
160395
|
-
}
|
|
160292
|
+
return addLeadingZeros(isoWeek, token.length);
|
|
160396
160293
|
},
|
|
160397
|
-
|
|
160398
|
-
|
|
160399
|
-
|
|
160400
|
-
|
|
160401
|
-
|
|
160402
|
-
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
160403
|
-
case "xxxx":
|
|
160404
|
-
case "xx":
|
|
160405
|
-
return formatTimezone(timezoneOffset);
|
|
160406
|
-
case "xxxxx":
|
|
160407
|
-
case "xxx":
|
|
160408
|
-
default:
|
|
160409
|
-
return formatTimezone(timezoneOffset, ":");
|
|
160294
|
+
d: function(date, token, localize2) {
|
|
160295
|
+
if (token === "do") {
|
|
160296
|
+
return localize2.ordinalNumber(date.getUTCDate(), {
|
|
160297
|
+
unit: "date"
|
|
160298
|
+
});
|
|
160410
160299
|
}
|
|
160300
|
+
return lightFormatters_default.d(date, token);
|
|
160411
160301
|
},
|
|
160412
|
-
|
|
160413
|
-
var
|
|
160414
|
-
|
|
160415
|
-
|
|
160416
|
-
|
|
160417
|
-
|
|
160418
|
-
case "OOO":
|
|
160419
|
-
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
|
|
160420
|
-
case "OOOO":
|
|
160421
|
-
default:
|
|
160422
|
-
return "GMT" + formatTimezone(timezoneOffset, ":");
|
|
160302
|
+
D: function(date, token, localize2) {
|
|
160303
|
+
var dayOfYear = getUTCDayOfYear(date);
|
|
160304
|
+
if (token === "Do") {
|
|
160305
|
+
return localize2.ordinalNumber(dayOfYear, {
|
|
160306
|
+
unit: "dayOfYear"
|
|
160307
|
+
});
|
|
160423
160308
|
}
|
|
160309
|
+
return addLeadingZeros(dayOfYear, token.length);
|
|
160424
160310
|
},
|
|
160425
|
-
|
|
160426
|
-
var
|
|
160427
|
-
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
160311
|
+
E: function(date, token, localize2) {
|
|
160312
|
+
var dayOfWeek = date.getUTCDay();
|
|
160428
160313
|
switch (token) {
|
|
160429
|
-
case "
|
|
160430
|
-
case "
|
|
160431
|
-
case "
|
|
160432
|
-
return
|
|
160433
|
-
|
|
160314
|
+
case "E":
|
|
160315
|
+
case "EE":
|
|
160316
|
+
case "EEE":
|
|
160317
|
+
return localize2.day(dayOfWeek, {
|
|
160318
|
+
width: "abbreviated",
|
|
160319
|
+
context: "formatting"
|
|
160320
|
+
});
|
|
160321
|
+
case "EEEEE":
|
|
160322
|
+
return localize2.day(dayOfWeek, {
|
|
160323
|
+
width: "narrow",
|
|
160324
|
+
context: "formatting"
|
|
160325
|
+
});
|
|
160326
|
+
case "EEEEEE":
|
|
160327
|
+
return localize2.day(dayOfWeek, {
|
|
160328
|
+
width: "short",
|
|
160329
|
+
context: "formatting"
|
|
160330
|
+
});
|
|
160331
|
+
case "EEEE":
|
|
160434
160332
|
default:
|
|
160435
|
-
return
|
|
160333
|
+
return localize2.day(dayOfWeek, {
|
|
160334
|
+
width: "wide",
|
|
160335
|
+
context: "formatting"
|
|
160336
|
+
});
|
|
160436
160337
|
}
|
|
160437
160338
|
},
|
|
160438
|
-
|
|
160439
|
-
var
|
|
160440
|
-
var
|
|
160441
|
-
|
|
160442
|
-
|
|
160443
|
-
|
|
160444
|
-
|
|
160445
|
-
|
|
160446
|
-
|
|
160447
|
-
|
|
160448
|
-
|
|
160449
|
-
|
|
160450
|
-
|
|
160451
|
-
|
|
160452
|
-
|
|
160453
|
-
|
|
160454
|
-
|
|
160455
|
-
|
|
160456
|
-
|
|
160457
|
-
|
|
160458
|
-
|
|
160459
|
-
}
|
|
160460
|
-
|
|
160461
|
-
|
|
160462
|
-
|
|
160463
|
-
|
|
160464
|
-
|
|
160465
|
-
|
|
160466
|
-
|
|
160467
|
-
|
|
160468
|
-
|
|
160469
|
-
|
|
160470
|
-
|
|
160471
|
-
var sign5 = offset > 0 ? "-" : "+";
|
|
160472
|
-
var absOffset = Math.abs(offset);
|
|
160473
|
-
var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
|
|
160474
|
-
var minutes = addLeadingZeros(absOffset % 60, 2);
|
|
160475
|
-
return sign5 + hours + delimiter + minutes;
|
|
160476
|
-
}
|
|
160477
|
-
__name(formatTimezone, "formatTimezone");
|
|
160478
|
-
var formatters_default = formatters2;
|
|
160479
|
-
function dateLongFormatter(pattern, formatLong2) {
|
|
160480
|
-
switch (pattern) {
|
|
160481
|
-
case "P":
|
|
160482
|
-
return formatLong2.date({
|
|
160483
|
-
width: "short"
|
|
160484
|
-
});
|
|
160485
|
-
case "PP":
|
|
160486
|
-
return formatLong2.date({
|
|
160487
|
-
width: "medium"
|
|
160488
|
-
});
|
|
160489
|
-
case "PPP":
|
|
160490
|
-
return formatLong2.date({
|
|
160491
|
-
width: "long"
|
|
160492
|
-
});
|
|
160493
|
-
case "PPPP":
|
|
160494
|
-
default:
|
|
160495
|
-
return formatLong2.date({
|
|
160496
|
-
width: "full"
|
|
160497
|
-
});
|
|
160498
|
-
}
|
|
160499
|
-
}
|
|
160500
|
-
__name(dateLongFormatter, "dateLongFormatter");
|
|
160501
|
-
function timeLongFormatter(pattern, formatLong2) {
|
|
160502
|
-
switch (pattern) {
|
|
160503
|
-
case "p":
|
|
160504
|
-
return formatLong2.time({
|
|
160505
|
-
width: "short"
|
|
160506
|
-
});
|
|
160507
|
-
case "pp":
|
|
160508
|
-
return formatLong2.time({
|
|
160509
|
-
width: "medium"
|
|
160510
|
-
});
|
|
160511
|
-
case "ppp":
|
|
160512
|
-
return formatLong2.time({
|
|
160513
|
-
width: "long"
|
|
160514
|
-
});
|
|
160515
|
-
case "pppp":
|
|
160516
|
-
default:
|
|
160517
|
-
return formatLong2.time({
|
|
160518
|
-
width: "full"
|
|
160519
|
-
});
|
|
160520
|
-
}
|
|
160521
|
-
}
|
|
160522
|
-
__name(timeLongFormatter, "timeLongFormatter");
|
|
160523
|
-
function dateTimeLongFormatter(pattern, formatLong2) {
|
|
160524
|
-
var matchResult = pattern.match(/(P+)(p+)?/) || [];
|
|
160525
|
-
var datePattern = matchResult[1];
|
|
160526
|
-
var timePattern = matchResult[2];
|
|
160527
|
-
if (!timePattern) {
|
|
160528
|
-
return dateLongFormatter(pattern, formatLong2);
|
|
160529
|
-
}
|
|
160530
|
-
var dateTimeFormat;
|
|
160531
|
-
switch (datePattern) {
|
|
160532
|
-
case "P":
|
|
160533
|
-
dateTimeFormat = formatLong2.dateTime({
|
|
160534
|
-
width: "short"
|
|
160535
|
-
});
|
|
160536
|
-
break;
|
|
160537
|
-
case "PP":
|
|
160538
|
-
dateTimeFormat = formatLong2.dateTime({
|
|
160539
|
-
width: "medium"
|
|
160540
|
-
});
|
|
160541
|
-
break;
|
|
160542
|
-
case "PPP":
|
|
160543
|
-
dateTimeFormat = formatLong2.dateTime({
|
|
160544
|
-
width: "long"
|
|
160545
|
-
});
|
|
160546
|
-
break;
|
|
160547
|
-
case "PPPP":
|
|
160548
|
-
default:
|
|
160549
|
-
dateTimeFormat = formatLong2.dateTime({
|
|
160550
|
-
width: "full"
|
|
160551
|
-
});
|
|
160552
|
-
break;
|
|
160553
|
-
}
|
|
160554
|
-
return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong2)).replace("{{time}}", timeLongFormatter(timePattern, formatLong2));
|
|
160555
|
-
}
|
|
160556
|
-
__name(dateTimeLongFormatter, "dateTimeLongFormatter");
|
|
160557
|
-
var longFormatters = {
|
|
160558
|
-
p: timeLongFormatter,
|
|
160559
|
-
P: dateTimeLongFormatter
|
|
160560
|
-
};
|
|
160561
|
-
var longFormatters_default = longFormatters;
|
|
160562
|
-
var protectedDayOfYearTokens = ["D", "DD"];
|
|
160563
|
-
var protectedWeekYearTokens = ["YY", "YYYY"];
|
|
160564
|
-
function isProtectedDayOfYearToken(token) {
|
|
160565
|
-
return protectedDayOfYearTokens.indexOf(token) !== -1;
|
|
160566
|
-
}
|
|
160567
|
-
__name(isProtectedDayOfYearToken, "isProtectedDayOfYearToken");
|
|
160568
|
-
function isProtectedWeekYearToken(token) {
|
|
160569
|
-
return protectedWeekYearTokens.indexOf(token) !== -1;
|
|
160570
|
-
}
|
|
160571
|
-
__name(isProtectedWeekYearToken, "isProtectedWeekYearToken");
|
|
160572
|
-
function throwProtectedError(token, format2, input) {
|
|
160573
|
-
if (token === "YYYY") {
|
|
160574
|
-
throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format2, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
|
|
160575
|
-
} else if (token === "YY") {
|
|
160576
|
-
throw new RangeError("Use `yy` instead of `YY` (in `".concat(format2, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
|
|
160577
|
-
} else if (token === "D") {
|
|
160578
|
-
throw new RangeError("Use `d` instead of `D` (in `".concat(format2, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
|
|
160579
|
-
} else if (token === "DD") {
|
|
160580
|
-
throw new RangeError("Use `dd` instead of `DD` (in `".concat(format2, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
|
|
160581
|
-
}
|
|
160582
|
-
}
|
|
160583
|
-
__name(throwProtectedError, "throwProtectedError");
|
|
160584
|
-
var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
|
|
160585
|
-
var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
|
|
160586
|
-
var escapedStringRegExp = /^'([^]*?)'?$/;
|
|
160587
|
-
var doubleQuoteRegExp = /''/g;
|
|
160588
|
-
var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
160589
|
-
function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
|
|
160590
|
-
requiredArgs(2, arguments);
|
|
160591
|
-
var formatStr = String(dirtyFormatStr);
|
|
160592
|
-
var options = dirtyOptions || {};
|
|
160593
|
-
var locale2 = options.locale || en_US_default;
|
|
160594
|
-
var localeFirstWeekContainsDate = locale2.options && locale2.options.firstWeekContainsDate;
|
|
160595
|
-
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
|
|
160596
|
-
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);
|
|
160597
|
-
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
|
|
160598
|
-
throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
|
|
160599
|
-
}
|
|
160600
|
-
var localeWeekStartsOn = locale2.options && locale2.options.weekStartsOn;
|
|
160601
|
-
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
|
|
160602
|
-
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn);
|
|
160603
|
-
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
160604
|
-
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
|
|
160605
|
-
}
|
|
160606
|
-
if (!locale2.localize) {
|
|
160607
|
-
throw new RangeError("locale must contain localize property");
|
|
160608
|
-
}
|
|
160609
|
-
if (!locale2.formatLong) {
|
|
160610
|
-
throw new RangeError("locale must contain formatLong property");
|
|
160611
|
-
}
|
|
160612
|
-
var originalDate = toDate(dirtyDate);
|
|
160613
|
-
if (!isValid2(originalDate)) {
|
|
160614
|
-
throw new RangeError("Invalid time value");
|
|
160615
|
-
}
|
|
160616
|
-
var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
|
|
160617
|
-
var utcDate = subMilliseconds(originalDate, timezoneOffset);
|
|
160618
|
-
var formatterOptions = {
|
|
160619
|
-
firstWeekContainsDate,
|
|
160620
|
-
weekStartsOn,
|
|
160621
|
-
locale: locale2,
|
|
160622
|
-
_originalDate: originalDate
|
|
160623
|
-
};
|
|
160624
|
-
var result = formatStr.match(longFormattingTokensRegExp).map(function(substring) {
|
|
160625
|
-
var firstCharacter = substring[0];
|
|
160626
|
-
if (firstCharacter === "p" || firstCharacter === "P") {
|
|
160627
|
-
var longFormatter = longFormatters_default[firstCharacter];
|
|
160628
|
-
return longFormatter(substring, locale2.formatLong, formatterOptions);
|
|
160339
|
+
e: function(date, token, localize2, options) {
|
|
160340
|
+
var dayOfWeek = date.getUTCDay();
|
|
160341
|
+
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
160342
|
+
switch (token) {
|
|
160343
|
+
case "e":
|
|
160344
|
+
return String(localDayOfWeek);
|
|
160345
|
+
case "ee":
|
|
160346
|
+
return addLeadingZeros(localDayOfWeek, 2);
|
|
160347
|
+
case "eo":
|
|
160348
|
+
return localize2.ordinalNumber(localDayOfWeek, {
|
|
160349
|
+
unit: "day"
|
|
160350
|
+
});
|
|
160351
|
+
case "eee":
|
|
160352
|
+
return localize2.day(dayOfWeek, {
|
|
160353
|
+
width: "abbreviated",
|
|
160354
|
+
context: "formatting"
|
|
160355
|
+
});
|
|
160356
|
+
case "eeeee":
|
|
160357
|
+
return localize2.day(dayOfWeek, {
|
|
160358
|
+
width: "narrow",
|
|
160359
|
+
context: "formatting"
|
|
160360
|
+
});
|
|
160361
|
+
case "eeeeee":
|
|
160362
|
+
return localize2.day(dayOfWeek, {
|
|
160363
|
+
width: "short",
|
|
160364
|
+
context: "formatting"
|
|
160365
|
+
});
|
|
160366
|
+
case "eeee":
|
|
160367
|
+
default:
|
|
160368
|
+
return localize2.day(dayOfWeek, {
|
|
160369
|
+
width: "wide",
|
|
160370
|
+
context: "formatting"
|
|
160371
|
+
});
|
|
160629
160372
|
}
|
|
160630
|
-
|
|
160631
|
-
|
|
160632
|
-
|
|
160633
|
-
|
|
160373
|
+
},
|
|
160374
|
+
c: function(date, token, localize2, options) {
|
|
160375
|
+
var dayOfWeek = date.getUTCDay();
|
|
160376
|
+
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
160377
|
+
switch (token) {
|
|
160378
|
+
case "c":
|
|
160379
|
+
return String(localDayOfWeek);
|
|
160380
|
+
case "cc":
|
|
160381
|
+
return addLeadingZeros(localDayOfWeek, token.length);
|
|
160382
|
+
case "co":
|
|
160383
|
+
return localize2.ordinalNumber(localDayOfWeek, {
|
|
160384
|
+
unit: "day"
|
|
160385
|
+
});
|
|
160386
|
+
case "ccc":
|
|
160387
|
+
return localize2.day(dayOfWeek, {
|
|
160388
|
+
width: "abbreviated",
|
|
160389
|
+
context: "standalone"
|
|
160390
|
+
});
|
|
160391
|
+
case "ccccc":
|
|
160392
|
+
return localize2.day(dayOfWeek, {
|
|
160393
|
+
width: "narrow",
|
|
160394
|
+
context: "standalone"
|
|
160395
|
+
});
|
|
160396
|
+
case "cccccc":
|
|
160397
|
+
return localize2.day(dayOfWeek, {
|
|
160398
|
+
width: "short",
|
|
160399
|
+
context: "standalone"
|
|
160400
|
+
});
|
|
160401
|
+
case "cccc":
|
|
160402
|
+
default:
|
|
160403
|
+
return localize2.day(dayOfWeek, {
|
|
160404
|
+
width: "wide",
|
|
160405
|
+
context: "standalone"
|
|
160406
|
+
});
|
|
160634
160407
|
}
|
|
160635
|
-
|
|
160636
|
-
|
|
160637
|
-
|
|
160408
|
+
},
|
|
160409
|
+
i: function(date, token, localize2) {
|
|
160410
|
+
var dayOfWeek = date.getUTCDay();
|
|
160411
|
+
var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
|
|
160412
|
+
switch (token) {
|
|
160413
|
+
case "i":
|
|
160414
|
+
return String(isoDayOfWeek);
|
|
160415
|
+
case "ii":
|
|
160416
|
+
return addLeadingZeros(isoDayOfWeek, token.length);
|
|
160417
|
+
case "io":
|
|
160418
|
+
return localize2.ordinalNumber(isoDayOfWeek, {
|
|
160419
|
+
unit: "day"
|
|
160420
|
+
});
|
|
160421
|
+
case "iii":
|
|
160422
|
+
return localize2.day(dayOfWeek, {
|
|
160423
|
+
width: "abbreviated",
|
|
160424
|
+
context: "formatting"
|
|
160425
|
+
});
|
|
160426
|
+
case "iiiii":
|
|
160427
|
+
return localize2.day(dayOfWeek, {
|
|
160428
|
+
width: "narrow",
|
|
160429
|
+
context: "formatting"
|
|
160430
|
+
});
|
|
160431
|
+
case "iiiiii":
|
|
160432
|
+
return localize2.day(dayOfWeek, {
|
|
160433
|
+
width: "short",
|
|
160434
|
+
context: "formatting"
|
|
160435
|
+
});
|
|
160436
|
+
case "iiii":
|
|
160437
|
+
default:
|
|
160438
|
+
return localize2.day(dayOfWeek, {
|
|
160439
|
+
width: "wide",
|
|
160440
|
+
context: "formatting"
|
|
160441
|
+
});
|
|
160638
160442
|
}
|
|
160639
|
-
|
|
160640
|
-
|
|
160641
|
-
|
|
160642
|
-
|
|
160643
|
-
|
|
160644
|
-
|
|
160645
|
-
|
|
160646
|
-
|
|
160647
|
-
|
|
160443
|
+
},
|
|
160444
|
+
a: function(date, token, localize2) {
|
|
160445
|
+
var hours = date.getUTCHours();
|
|
160446
|
+
var dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
|
|
160447
|
+
switch (token) {
|
|
160448
|
+
case "a":
|
|
160449
|
+
case "aa":
|
|
160450
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
160451
|
+
width: "abbreviated",
|
|
160452
|
+
context: "formatting"
|
|
160453
|
+
});
|
|
160454
|
+
case "aaa":
|
|
160455
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
160456
|
+
width: "abbreviated",
|
|
160457
|
+
context: "formatting"
|
|
160458
|
+
}).toLowerCase();
|
|
160459
|
+
case "aaaaa":
|
|
160460
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
160461
|
+
width: "narrow",
|
|
160462
|
+
context: "formatting"
|
|
160463
|
+
});
|
|
160464
|
+
case "aaaa":
|
|
160465
|
+
default:
|
|
160466
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
160467
|
+
width: "wide",
|
|
160468
|
+
context: "formatting"
|
|
160469
|
+
});
|
|
160648
160470
|
}
|
|
160649
|
-
|
|
160650
|
-
|
|
160471
|
+
},
|
|
160472
|
+
b: function(date, token, localize2) {
|
|
160473
|
+
var hours = date.getUTCHours();
|
|
160474
|
+
var dayPeriodEnumValue;
|
|
160475
|
+
if (hours === 12) {
|
|
160476
|
+
dayPeriodEnumValue = dayPeriodEnum.noon;
|
|
160477
|
+
} else if (hours === 0) {
|
|
160478
|
+
dayPeriodEnumValue = dayPeriodEnum.midnight;
|
|
160479
|
+
} else {
|
|
160480
|
+
dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
|
|
160651
160481
|
}
|
|
160652
|
-
|
|
160653
|
-
|
|
160654
|
-
|
|
160655
|
-
|
|
160656
|
-
|
|
160657
|
-
|
|
160658
|
-
|
|
160659
|
-
|
|
160660
|
-
|
|
160661
|
-
|
|
160662
|
-
|
|
160663
|
-
|
|
160664
|
-
|
|
160665
|
-
|
|
160666
|
-
|
|
160667
|
-
|
|
160668
|
-
|
|
160669
|
-
|
|
160670
|
-
|
|
160671
|
-
|
|
160672
|
-
|
|
160673
|
-
|
|
160674
|
-
|
|
160675
|
-
|
|
160676
|
-
},
|
|
160677
|
-
|
|
160678
|
-
|
|
160679
|
-
|
|
160680
|
-
|
|
160681
|
-
|
|
160682
|
-
|
|
160683
|
-
|
|
160684
|
-
|
|
160685
|
-
|
|
160482
|
+
switch (token) {
|
|
160483
|
+
case "b":
|
|
160484
|
+
case "bb":
|
|
160485
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
160486
|
+
width: "abbreviated",
|
|
160487
|
+
context: "formatting"
|
|
160488
|
+
});
|
|
160489
|
+
case "bbb":
|
|
160490
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
160491
|
+
width: "abbreviated",
|
|
160492
|
+
context: "formatting"
|
|
160493
|
+
}).toLowerCase();
|
|
160494
|
+
case "bbbbb":
|
|
160495
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
160496
|
+
width: "narrow",
|
|
160497
|
+
context: "formatting"
|
|
160498
|
+
});
|
|
160499
|
+
case "bbbb":
|
|
160500
|
+
default:
|
|
160501
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
160502
|
+
width: "wide",
|
|
160503
|
+
context: "formatting"
|
|
160504
|
+
});
|
|
160505
|
+
}
|
|
160506
|
+
},
|
|
160507
|
+
B: function(date, token, localize2) {
|
|
160508
|
+
var hours = date.getUTCHours();
|
|
160509
|
+
var dayPeriodEnumValue;
|
|
160510
|
+
if (hours >= 17) {
|
|
160511
|
+
dayPeriodEnumValue = dayPeriodEnum.evening;
|
|
160512
|
+
} else if (hours >= 12) {
|
|
160513
|
+
dayPeriodEnumValue = dayPeriodEnum.afternoon;
|
|
160514
|
+
} else if (hours >= 4) {
|
|
160515
|
+
dayPeriodEnumValue = dayPeriodEnum.morning;
|
|
160516
|
+
} else {
|
|
160517
|
+
dayPeriodEnumValue = dayPeriodEnum.night;
|
|
160518
|
+
}
|
|
160519
|
+
switch (token) {
|
|
160520
|
+
case "B":
|
|
160521
|
+
case "BB":
|
|
160522
|
+
case "BBB":
|
|
160523
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
160524
|
+
width: "abbreviated",
|
|
160525
|
+
context: "formatting"
|
|
160526
|
+
});
|
|
160527
|
+
case "BBBBB":
|
|
160528
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
160529
|
+
width: "narrow",
|
|
160530
|
+
context: "formatting"
|
|
160531
|
+
});
|
|
160532
|
+
case "BBBB":
|
|
160533
|
+
default:
|
|
160534
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
160535
|
+
width: "wide",
|
|
160536
|
+
context: "formatting"
|
|
160537
|
+
});
|
|
160538
|
+
}
|
|
160539
|
+
},
|
|
160540
|
+
h: function(date, token, localize2) {
|
|
160541
|
+
if (token === "ho") {
|
|
160542
|
+
var hours = date.getUTCHours() % 12;
|
|
160543
|
+
if (hours === 0)
|
|
160544
|
+
hours = 12;
|
|
160545
|
+
return localize2.ordinalNumber(hours, {
|
|
160546
|
+
unit: "hour"
|
|
160686
160547
|
});
|
|
160687
|
-
}
|
|
160688
|
-
|
|
160689
|
-
|
|
160690
|
-
|
|
160691
|
-
|
|
160692
|
-
|
|
160548
|
+
}
|
|
160549
|
+
return lightFormatters_default.h(date, token);
|
|
160550
|
+
},
|
|
160551
|
+
H: function(date, token, localize2) {
|
|
160552
|
+
if (token === "Ho") {
|
|
160553
|
+
return localize2.ordinalNumber(date.getUTCHours(), {
|
|
160554
|
+
unit: "hour"
|
|
160693
160555
|
});
|
|
160694
|
-
}
|
|
160695
|
-
|
|
160696
|
-
|
|
160697
|
-
|
|
160698
|
-
|
|
160699
|
-
|
|
160556
|
+
}
|
|
160557
|
+
return lightFormatters_default.H(date, token);
|
|
160558
|
+
},
|
|
160559
|
+
K: function(date, token, localize2) {
|
|
160560
|
+
var hours = date.getUTCHours() % 12;
|
|
160561
|
+
if (token === "Ko") {
|
|
160562
|
+
return localize2.ordinalNumber(hours, {
|
|
160563
|
+
unit: "hour"
|
|
160700
160564
|
});
|
|
160701
|
-
}
|
|
160702
|
-
return
|
|
160703
|
-
});
|
|
160704
|
-
}, "verifyCredential");
|
|
160705
|
-
var defaultCeramicIDXArgs = {
|
|
160706
|
-
modelData: {
|
|
160707
|
-
definitions: {
|
|
160708
|
-
MyVerifiableCredentials: "kjzl6cwe1jw14am5tu5hh412s19o4zm8aq3g2lpd6s4paxj2nly2lj4drp3pun2"
|
|
160709
|
-
},
|
|
160710
|
-
schemas: {
|
|
160711
|
-
AchievementVerifiableCredential: "ceramic://k3y52l7qbv1frylibw2725v8gem3hxs1onoh6pvux0szdduugczh0hddxo6qsd6o0",
|
|
160712
|
-
VerifiableCredentialsList: "ceramic://k3y52l7qbv1frxkcwfpyauky3fyl4n44izridy3blvjjzgftis40sk9w8g3remghs"
|
|
160713
|
-
},
|
|
160714
|
-
tiles: {}
|
|
160565
|
+
}
|
|
160566
|
+
return addLeadingZeros(hours, token.length);
|
|
160715
160567
|
},
|
|
160716
|
-
|
|
160717
|
-
|
|
160718
|
-
|
|
160719
|
-
|
|
160720
|
-
|
|
160721
|
-
|
|
160722
|
-
|
|
160723
|
-
|
|
160724
|
-
};
|
|
160725
|
-
var wasm;
|
|
160726
|
-
var cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
160727
|
-
cachedTextDecoder.decode();
|
|
160728
|
-
var cachegetUint8Memory0 = null;
|
|
160729
|
-
function getUint8Memory0() {
|
|
160730
|
-
if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {
|
|
160731
|
-
cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
160732
|
-
}
|
|
160733
|
-
return cachegetUint8Memory0;
|
|
160734
|
-
}
|
|
160735
|
-
__name(getUint8Memory0, "getUint8Memory0");
|
|
160736
|
-
function getStringFromWasm0(ptr, len) {
|
|
160737
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
160738
|
-
}
|
|
160739
|
-
__name(getStringFromWasm0, "getStringFromWasm0");
|
|
160740
|
-
var heap = new Array(32).fill(void 0);
|
|
160741
|
-
heap.push(void 0, null, true, false);
|
|
160742
|
-
var heap_next = heap.length;
|
|
160743
|
-
function addHeapObject(obj) {
|
|
160744
|
-
if (heap_next === heap.length)
|
|
160745
|
-
heap.push(heap.length + 1);
|
|
160746
|
-
const idx = heap_next;
|
|
160747
|
-
heap_next = heap[idx];
|
|
160748
|
-
heap[idx] = obj;
|
|
160749
|
-
return idx;
|
|
160750
|
-
}
|
|
160751
|
-
__name(addHeapObject, "addHeapObject");
|
|
160752
|
-
function getObject(idx) {
|
|
160753
|
-
return heap[idx];
|
|
160754
|
-
}
|
|
160755
|
-
__name(getObject, "getObject");
|
|
160756
|
-
function dropObject(idx) {
|
|
160757
|
-
if (idx < 36)
|
|
160758
|
-
return;
|
|
160759
|
-
heap[idx] = heap_next;
|
|
160760
|
-
heap_next = idx;
|
|
160761
|
-
}
|
|
160762
|
-
__name(dropObject, "dropObject");
|
|
160763
|
-
function takeObject(idx) {
|
|
160764
|
-
const ret = getObject(idx);
|
|
160765
|
-
dropObject(idx);
|
|
160766
|
-
return ret;
|
|
160767
|
-
}
|
|
160768
|
-
__name(takeObject, "takeObject");
|
|
160769
|
-
var WASM_VECTOR_LEN = 0;
|
|
160770
|
-
var cachedTextEncoder = new TextEncoder("utf-8");
|
|
160771
|
-
var encodeString2 = typeof cachedTextEncoder.encodeInto === "function" ? function(arg, view) {
|
|
160772
|
-
return cachedTextEncoder.encodeInto(arg, view);
|
|
160773
|
-
} : function(arg, view) {
|
|
160774
|
-
const buf2 = cachedTextEncoder.encode(arg);
|
|
160775
|
-
view.set(buf2);
|
|
160776
|
-
return {
|
|
160777
|
-
read: arg.length,
|
|
160778
|
-
written: buf2.length
|
|
160779
|
-
};
|
|
160780
|
-
};
|
|
160781
|
-
function passStringToWasm0(arg, malloc, realloc) {
|
|
160782
|
-
if (realloc === void 0) {
|
|
160783
|
-
const buf2 = cachedTextEncoder.encode(arg);
|
|
160784
|
-
const ptr2 = malloc(buf2.length);
|
|
160785
|
-
getUint8Memory0().subarray(ptr2, ptr2 + buf2.length).set(buf2);
|
|
160786
|
-
WASM_VECTOR_LEN = buf2.length;
|
|
160787
|
-
return ptr2;
|
|
160788
|
-
}
|
|
160789
|
-
let len = arg.length;
|
|
160790
|
-
let ptr = malloc(len);
|
|
160791
|
-
const mem = getUint8Memory0();
|
|
160792
|
-
let offset = 0;
|
|
160793
|
-
for (; offset < len; offset++) {
|
|
160794
|
-
const code5 = arg.charCodeAt(offset);
|
|
160795
|
-
if (code5 > 127)
|
|
160796
|
-
break;
|
|
160797
|
-
mem[ptr + offset] = code5;
|
|
160798
|
-
}
|
|
160799
|
-
if (offset !== len) {
|
|
160800
|
-
if (offset !== 0) {
|
|
160801
|
-
arg = arg.slice(offset);
|
|
160568
|
+
k: function(date, token, localize2) {
|
|
160569
|
+
var hours = date.getUTCHours();
|
|
160570
|
+
if (hours === 0)
|
|
160571
|
+
hours = 24;
|
|
160572
|
+
if (token === "ko") {
|
|
160573
|
+
return localize2.ordinalNumber(hours, {
|
|
160574
|
+
unit: "hour"
|
|
160575
|
+
});
|
|
160802
160576
|
}
|
|
160803
|
-
|
|
160804
|
-
|
|
160805
|
-
|
|
160806
|
-
|
|
160807
|
-
|
|
160808
|
-
|
|
160809
|
-
|
|
160810
|
-
}
|
|
160811
|
-
__name(passStringToWasm0, "passStringToWasm0");
|
|
160812
|
-
function isLikeNone(x) {
|
|
160813
|
-
return x === void 0 || x === null;
|
|
160814
|
-
}
|
|
160815
|
-
__name(isLikeNone, "isLikeNone");
|
|
160816
|
-
var cachegetInt32Memory0 = null;
|
|
160817
|
-
function getInt32Memory0() {
|
|
160818
|
-
if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {
|
|
160819
|
-
cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
160820
|
-
}
|
|
160821
|
-
return cachegetInt32Memory0;
|
|
160822
|
-
}
|
|
160823
|
-
__name(getInt32Memory0, "getInt32Memory0");
|
|
160824
|
-
function debugString(val) {
|
|
160825
|
-
const type = typeof val;
|
|
160826
|
-
if (type == "number" || type == "boolean" || val == null) {
|
|
160827
|
-
return `${val}`;
|
|
160828
|
-
}
|
|
160829
|
-
if (type == "string") {
|
|
160830
|
-
return `"${val}"`;
|
|
160831
|
-
}
|
|
160832
|
-
if (type == "symbol") {
|
|
160833
|
-
const description = val.description;
|
|
160834
|
-
if (description == null) {
|
|
160835
|
-
return "Symbol";
|
|
160836
|
-
} else {
|
|
160837
|
-
return `Symbol(${description})`;
|
|
160577
|
+
return addLeadingZeros(hours, token.length);
|
|
160578
|
+
},
|
|
160579
|
+
m: function(date, token, localize2) {
|
|
160580
|
+
if (token === "mo") {
|
|
160581
|
+
return localize2.ordinalNumber(date.getUTCMinutes(), {
|
|
160582
|
+
unit: "minute"
|
|
160583
|
+
});
|
|
160838
160584
|
}
|
|
160839
|
-
|
|
160840
|
-
|
|
160841
|
-
|
|
160842
|
-
if (
|
|
160843
|
-
return
|
|
160844
|
-
|
|
160845
|
-
|
|
160585
|
+
return lightFormatters_default.m(date, token);
|
|
160586
|
+
},
|
|
160587
|
+
s: function(date, token, localize2) {
|
|
160588
|
+
if (token === "so") {
|
|
160589
|
+
return localize2.ordinalNumber(date.getUTCSeconds(), {
|
|
160590
|
+
unit: "second"
|
|
160591
|
+
});
|
|
160846
160592
|
}
|
|
160847
|
-
|
|
160848
|
-
|
|
160849
|
-
|
|
160850
|
-
|
|
160851
|
-
|
|
160852
|
-
|
|
160593
|
+
return lightFormatters_default.s(date, token);
|
|
160594
|
+
},
|
|
160595
|
+
S: function(date, token) {
|
|
160596
|
+
return lightFormatters_default.S(date, token);
|
|
160597
|
+
},
|
|
160598
|
+
X: function(date, token, _localize, options) {
|
|
160599
|
+
var originalDate = options._originalDate || date;
|
|
160600
|
+
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
160601
|
+
if (timezoneOffset === 0) {
|
|
160602
|
+
return "Z";
|
|
160853
160603
|
}
|
|
160854
|
-
|
|
160855
|
-
|
|
160604
|
+
switch (token) {
|
|
160605
|
+
case "X":
|
|
160606
|
+
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
160607
|
+
case "XXXX":
|
|
160608
|
+
case "XX":
|
|
160609
|
+
return formatTimezone(timezoneOffset);
|
|
160610
|
+
case "XXXXX":
|
|
160611
|
+
case "XXX":
|
|
160612
|
+
default:
|
|
160613
|
+
return formatTimezone(timezoneOffset, ":");
|
|
160856
160614
|
}
|
|
160857
|
-
|
|
160858
|
-
|
|
160859
|
-
|
|
160860
|
-
|
|
160861
|
-
|
|
160862
|
-
|
|
160863
|
-
|
|
160864
|
-
|
|
160865
|
-
|
|
160866
|
-
|
|
160867
|
-
|
|
160868
|
-
|
|
160869
|
-
|
|
160870
|
-
|
|
160871
|
-
return "Object";
|
|
160615
|
+
},
|
|
160616
|
+
x: function(date, token, _localize, options) {
|
|
160617
|
+
var originalDate = options._originalDate || date;
|
|
160618
|
+
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
160619
|
+
switch (token) {
|
|
160620
|
+
case "x":
|
|
160621
|
+
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
160622
|
+
case "xxxx":
|
|
160623
|
+
case "xx":
|
|
160624
|
+
return formatTimezone(timezoneOffset);
|
|
160625
|
+
case "xxxxx":
|
|
160626
|
+
case "xxx":
|
|
160627
|
+
default:
|
|
160628
|
+
return formatTimezone(timezoneOffset, ":");
|
|
160872
160629
|
}
|
|
160873
|
-
}
|
|
160874
|
-
|
|
160875
|
-
|
|
160876
|
-
|
|
160877
|
-
|
|
160878
|
-
|
|
160879
|
-
|
|
160880
|
-
|
|
160881
|
-
|
|
160882
|
-
|
|
160883
|
-
|
|
160884
|
-
|
|
160885
|
-
const a = state.a;
|
|
160886
|
-
state.a = 0;
|
|
160887
|
-
try {
|
|
160888
|
-
return f(a, state.b, ...args);
|
|
160889
|
-
} finally {
|
|
160890
|
-
if (--state.cnt === 0) {
|
|
160891
|
-
wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
|
|
160892
|
-
} else {
|
|
160893
|
-
state.a = a;
|
|
160894
|
-
}
|
|
160630
|
+
},
|
|
160631
|
+
O: function(date, token, _localize, options) {
|
|
160632
|
+
var originalDate = options._originalDate || date;
|
|
160633
|
+
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
160634
|
+
switch (token) {
|
|
160635
|
+
case "O":
|
|
160636
|
+
case "OO":
|
|
160637
|
+
case "OOO":
|
|
160638
|
+
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
|
|
160639
|
+
case "OOOO":
|
|
160640
|
+
default:
|
|
160641
|
+
return "GMT" + formatTimezone(timezoneOffset, ":");
|
|
160895
160642
|
}
|
|
160896
|
-
},
|
|
160897
|
-
|
|
160898
|
-
|
|
160899
|
-
|
|
160900
|
-
|
|
160901
|
-
|
|
160902
|
-
|
|
160903
|
-
|
|
160904
|
-
|
|
160905
|
-
|
|
160906
|
-
|
|
160907
|
-
|
|
160908
|
-
WASM_VECTOR_LEN = arg.length;
|
|
160909
|
-
return ptr;
|
|
160910
|
-
}
|
|
160911
|
-
__name(passArray8ToWasm0, "passArray8ToWasm0");
|
|
160912
|
-
function generateEd25519KeyFromBytes(bytes) {
|
|
160913
|
-
try {
|
|
160914
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
160915
|
-
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
160916
|
-
const len0 = WASM_VECTOR_LEN;
|
|
160917
|
-
wasm.generateEd25519KeyFromBytes(retptr, ptr0, len0);
|
|
160918
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
160919
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
160920
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
160921
|
-
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
160922
|
-
var ptr1 = r0;
|
|
160923
|
-
var len1 = r1;
|
|
160924
|
-
if (r3) {
|
|
160925
|
-
ptr1 = 0;
|
|
160926
|
-
len1 = 0;
|
|
160927
|
-
throw takeObject(r2);
|
|
160643
|
+
},
|
|
160644
|
+
z: function(date, token, _localize, options) {
|
|
160645
|
+
var originalDate = options._originalDate || date;
|
|
160646
|
+
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
160647
|
+
switch (token) {
|
|
160648
|
+
case "z":
|
|
160649
|
+
case "zz":
|
|
160650
|
+
case "zzz":
|
|
160651
|
+
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
|
|
160652
|
+
case "zzzz":
|
|
160653
|
+
default:
|
|
160654
|
+
return "GMT" + formatTimezone(timezoneOffset, ":");
|
|
160928
160655
|
}
|
|
160929
|
-
|
|
160930
|
-
|
|
160931
|
-
|
|
160932
|
-
|
|
160656
|
+
},
|
|
160657
|
+
t: function(date, token, _localize, options) {
|
|
160658
|
+
var originalDate = options._originalDate || date;
|
|
160659
|
+
var timestamp = Math.floor(originalDate.getTime() / 1e3);
|
|
160660
|
+
return addLeadingZeros(timestamp, token.length);
|
|
160661
|
+
},
|
|
160662
|
+
T: function(date, token, _localize, options) {
|
|
160663
|
+
var originalDate = options._originalDate || date;
|
|
160664
|
+
var timestamp = originalDate.getTime();
|
|
160665
|
+
return addLeadingZeros(timestamp, token.length);
|
|
160933
160666
|
}
|
|
160934
|
-
}
|
|
160935
|
-
|
|
160936
|
-
|
|
160937
|
-
|
|
160938
|
-
|
|
160939
|
-
|
|
160940
|
-
|
|
160941
|
-
|
|
160942
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
160943
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
160944
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
160945
|
-
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
160946
|
-
var ptr1 = r0;
|
|
160947
|
-
var len1 = r1;
|
|
160948
|
-
if (r3) {
|
|
160949
|
-
ptr1 = 0;
|
|
160950
|
-
len1 = 0;
|
|
160951
|
-
throw takeObject(r2);
|
|
160952
|
-
}
|
|
160953
|
-
return getStringFromWasm0(ptr1, len1);
|
|
160954
|
-
} finally {
|
|
160955
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
160956
|
-
wasm.__wbindgen_free(ptr1, len1);
|
|
160667
|
+
};
|
|
160668
|
+
function formatTimezoneShort(offset, dirtyDelimiter) {
|
|
160669
|
+
var sign5 = offset > 0 ? "-" : "+";
|
|
160670
|
+
var absOffset = Math.abs(offset);
|
|
160671
|
+
var hours = Math.floor(absOffset / 60);
|
|
160672
|
+
var minutes = absOffset % 60;
|
|
160673
|
+
if (minutes === 0) {
|
|
160674
|
+
return sign5 + String(hours);
|
|
160957
160675
|
}
|
|
160676
|
+
var delimiter = dirtyDelimiter || "";
|
|
160677
|
+
return sign5 + String(hours) + delimiter + addLeadingZeros(minutes, 2);
|
|
160958
160678
|
}
|
|
160959
|
-
__name(
|
|
160960
|
-
function
|
|
160961
|
-
|
|
160962
|
-
|
|
160963
|
-
|
|
160964
|
-
const len0 = WASM_VECTOR_LEN;
|
|
160965
|
-
const ptr1 = passStringToWasm0(jwk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
160966
|
-
const len1 = WASM_VECTOR_LEN;
|
|
160967
|
-
wasm.keyToDID(retptr, ptr0, len0, ptr1, len1);
|
|
160968
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
160969
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
160970
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
160971
|
-
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
160972
|
-
var ptr2 = r0;
|
|
160973
|
-
var len2 = r1;
|
|
160974
|
-
if (r3) {
|
|
160975
|
-
ptr2 = 0;
|
|
160976
|
-
len2 = 0;
|
|
160977
|
-
throw takeObject(r2);
|
|
160978
|
-
}
|
|
160979
|
-
return getStringFromWasm0(ptr2, len2);
|
|
160980
|
-
} finally {
|
|
160981
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
160982
|
-
wasm.__wbindgen_free(ptr2, len2);
|
|
160679
|
+
__name(formatTimezoneShort, "formatTimezoneShort");
|
|
160680
|
+
function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
|
|
160681
|
+
if (offset % 60 === 0) {
|
|
160682
|
+
var sign5 = offset > 0 ? "-" : "+";
|
|
160683
|
+
return sign5 + addLeadingZeros(Math.abs(offset) / 60, 2);
|
|
160983
160684
|
}
|
|
160685
|
+
return formatTimezone(offset, dirtyDelimiter);
|
|
160984
160686
|
}
|
|
160985
|
-
__name(
|
|
160986
|
-
function
|
|
160987
|
-
|
|
160988
|
-
|
|
160989
|
-
|
|
160990
|
-
|
|
160991
|
-
|
|
160992
|
-
return
|
|
160993
|
-
}
|
|
160994
|
-
__name(keyToVerificationMethod, "keyToVerificationMethod");
|
|
160995
|
-
function issueCredential2(credential, proof_options, key2) {
|
|
160996
|
-
const ptr0 = passStringToWasm0(credential, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
160997
|
-
const len0 = WASM_VECTOR_LEN;
|
|
160998
|
-
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
160999
|
-
const len1 = WASM_VECTOR_LEN;
|
|
161000
|
-
const ptr2 = passStringToWasm0(key2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
161001
|
-
const len2 = WASM_VECTOR_LEN;
|
|
161002
|
-
const ret = wasm.issueCredential(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
161003
|
-
return takeObject(ret);
|
|
161004
|
-
}
|
|
161005
|
-
__name(issueCredential2, "issueCredential");
|
|
161006
|
-
function verifyCredential3(vc, proof_options) {
|
|
161007
|
-
const ptr0 = passStringToWasm0(vc, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
161008
|
-
const len0 = WASM_VECTOR_LEN;
|
|
161009
|
-
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
161010
|
-
const len1 = WASM_VECTOR_LEN;
|
|
161011
|
-
const ret = wasm.verifyCredential(ptr0, len0, ptr1, len1);
|
|
161012
|
-
return takeObject(ret);
|
|
160687
|
+
__name(formatTimezoneWithOptionalMinutes, "formatTimezoneWithOptionalMinutes");
|
|
160688
|
+
function formatTimezone(offset, dirtyDelimiter) {
|
|
160689
|
+
var delimiter = dirtyDelimiter || "";
|
|
160690
|
+
var sign5 = offset > 0 ? "-" : "+";
|
|
160691
|
+
var absOffset = Math.abs(offset);
|
|
160692
|
+
var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
|
|
160693
|
+
var minutes = addLeadingZeros(absOffset % 60, 2);
|
|
160694
|
+
return sign5 + hours + delimiter + minutes;
|
|
161013
160695
|
}
|
|
161014
|
-
__name(
|
|
161015
|
-
|
|
161016
|
-
|
|
161017
|
-
|
|
161018
|
-
|
|
161019
|
-
|
|
161020
|
-
|
|
161021
|
-
|
|
161022
|
-
|
|
161023
|
-
|
|
160696
|
+
__name(formatTimezone, "formatTimezone");
|
|
160697
|
+
var formatters_default = formatters2;
|
|
160698
|
+
function dateLongFormatter(pattern, formatLong2) {
|
|
160699
|
+
switch (pattern) {
|
|
160700
|
+
case "P":
|
|
160701
|
+
return formatLong2.date({
|
|
160702
|
+
width: "short"
|
|
160703
|
+
});
|
|
160704
|
+
case "PP":
|
|
160705
|
+
return formatLong2.date({
|
|
160706
|
+
width: "medium"
|
|
160707
|
+
});
|
|
160708
|
+
case "PPP":
|
|
160709
|
+
return formatLong2.date({
|
|
160710
|
+
width: "long"
|
|
160711
|
+
});
|
|
160712
|
+
case "PPPP":
|
|
160713
|
+
default:
|
|
160714
|
+
return formatLong2.date({
|
|
160715
|
+
width: "full"
|
|
160716
|
+
});
|
|
160717
|
+
}
|
|
161024
160718
|
}
|
|
161025
|
-
__name(
|
|
161026
|
-
function
|
|
161027
|
-
|
|
161028
|
-
|
|
161029
|
-
|
|
161030
|
-
|
|
161031
|
-
|
|
161032
|
-
|
|
160719
|
+
__name(dateLongFormatter, "dateLongFormatter");
|
|
160720
|
+
function timeLongFormatter(pattern, formatLong2) {
|
|
160721
|
+
switch (pattern) {
|
|
160722
|
+
case "p":
|
|
160723
|
+
return formatLong2.time({
|
|
160724
|
+
width: "short"
|
|
160725
|
+
});
|
|
160726
|
+
case "pp":
|
|
160727
|
+
return formatLong2.time({
|
|
160728
|
+
width: "medium"
|
|
160729
|
+
});
|
|
160730
|
+
case "ppp":
|
|
160731
|
+
return formatLong2.time({
|
|
160732
|
+
width: "long"
|
|
160733
|
+
});
|
|
160734
|
+
case "pppp":
|
|
160735
|
+
default:
|
|
160736
|
+
return formatLong2.time({
|
|
160737
|
+
width: "full"
|
|
160738
|
+
});
|
|
160739
|
+
}
|
|
161033
160740
|
}
|
|
161034
|
-
__name(
|
|
161035
|
-
function
|
|
161036
|
-
|
|
161037
|
-
|
|
161038
|
-
|
|
161039
|
-
|
|
160741
|
+
__name(timeLongFormatter, "timeLongFormatter");
|
|
160742
|
+
function dateTimeLongFormatter(pattern, formatLong2) {
|
|
160743
|
+
var matchResult = pattern.match(/(P+)(p+)?/) || [];
|
|
160744
|
+
var datePattern = matchResult[1];
|
|
160745
|
+
var timePattern = matchResult[2];
|
|
160746
|
+
if (!timePattern) {
|
|
160747
|
+
return dateLongFormatter(pattern, formatLong2);
|
|
161040
160748
|
}
|
|
160749
|
+
var dateTimeFormat;
|
|
160750
|
+
switch (datePattern) {
|
|
160751
|
+
case "P":
|
|
160752
|
+
dateTimeFormat = formatLong2.dateTime({
|
|
160753
|
+
width: "short"
|
|
160754
|
+
});
|
|
160755
|
+
break;
|
|
160756
|
+
case "PP":
|
|
160757
|
+
dateTimeFormat = formatLong2.dateTime({
|
|
160758
|
+
width: "medium"
|
|
160759
|
+
});
|
|
160760
|
+
break;
|
|
160761
|
+
case "PPP":
|
|
160762
|
+
dateTimeFormat = formatLong2.dateTime({
|
|
160763
|
+
width: "long"
|
|
160764
|
+
});
|
|
160765
|
+
break;
|
|
160766
|
+
case "PPPP":
|
|
160767
|
+
default:
|
|
160768
|
+
dateTimeFormat = formatLong2.dateTime({
|
|
160769
|
+
width: "full"
|
|
160770
|
+
});
|
|
160771
|
+
break;
|
|
160772
|
+
}
|
|
160773
|
+
return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong2)).replace("{{time}}", timeLongFormatter(timePattern, formatLong2));
|
|
161041
160774
|
}
|
|
161042
|
-
__name(
|
|
161043
|
-
|
|
161044
|
-
|
|
160775
|
+
__name(dateTimeLongFormatter, "dateTimeLongFormatter");
|
|
160776
|
+
var longFormatters = {
|
|
160777
|
+
p: timeLongFormatter,
|
|
160778
|
+
P: dateTimeLongFormatter
|
|
160779
|
+
};
|
|
160780
|
+
var longFormatters_default = longFormatters;
|
|
160781
|
+
var protectedDayOfYearTokens = ["D", "DD"];
|
|
160782
|
+
var protectedWeekYearTokens = ["YY", "YYYY"];
|
|
160783
|
+
function isProtectedDayOfYearToken(token) {
|
|
160784
|
+
return protectedDayOfYearTokens.indexOf(token) !== -1;
|
|
161045
160785
|
}
|
|
161046
|
-
__name(
|
|
161047
|
-
function
|
|
161048
|
-
|
|
160786
|
+
__name(isProtectedDayOfYearToken, "isProtectedDayOfYearToken");
|
|
160787
|
+
function isProtectedWeekYearToken(token) {
|
|
160788
|
+
return protectedWeekYearTokens.indexOf(token) !== -1;
|
|
161049
160789
|
}
|
|
161050
|
-
__name(
|
|
161051
|
-
function
|
|
161052
|
-
|
|
161053
|
-
|
|
161054
|
-
|
|
161055
|
-
|
|
161056
|
-
|
|
161057
|
-
|
|
161058
|
-
|
|
161059
|
-
|
|
161060
|
-
|
|
161061
|
-
throw e;
|
|
161062
|
-
}
|
|
161063
|
-
}
|
|
161064
|
-
}
|
|
161065
|
-
const bytes = yield module.arrayBuffer();
|
|
161066
|
-
return yield WebAssembly.instantiate(bytes, imports);
|
|
161067
|
-
} else {
|
|
161068
|
-
const instance = yield WebAssembly.instantiate(module, imports);
|
|
161069
|
-
if (instance instanceof WebAssembly.Instance) {
|
|
161070
|
-
return { instance, module };
|
|
161071
|
-
} else {
|
|
161072
|
-
return instance;
|
|
161073
|
-
}
|
|
161074
|
-
}
|
|
161075
|
-
});
|
|
160790
|
+
__name(isProtectedWeekYearToken, "isProtectedWeekYearToken");
|
|
160791
|
+
function throwProtectedError(token, format2, input) {
|
|
160792
|
+
if (token === "YYYY") {
|
|
160793
|
+
throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format2, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
|
|
160794
|
+
} else if (token === "YY") {
|
|
160795
|
+
throw new RangeError("Use `yy` instead of `YY` (in `".concat(format2, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
|
|
160796
|
+
} else if (token === "D") {
|
|
160797
|
+
throw new RangeError("Use `d` instead of `D` (in `".concat(format2, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
|
|
160798
|
+
} else if (token === "DD") {
|
|
160799
|
+
throw new RangeError("Use `dd` instead of `DD` (in `".concat(format2, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
|
|
160800
|
+
}
|
|
161076
160801
|
}
|
|
161077
|
-
__name(
|
|
161078
|
-
|
|
161079
|
-
|
|
161080
|
-
|
|
161081
|
-
|
|
161082
|
-
|
|
161083
|
-
|
|
161084
|
-
|
|
161085
|
-
|
|
161086
|
-
|
|
161087
|
-
|
|
161088
|
-
|
|
161089
|
-
|
|
161090
|
-
|
|
161091
|
-
|
|
161092
|
-
|
|
161093
|
-
|
|
161094
|
-
|
|
161095
|
-
|
|
161096
|
-
|
|
161097
|
-
|
|
161098
|
-
|
|
161099
|
-
|
|
161100
|
-
|
|
161101
|
-
|
|
161102
|
-
|
|
161103
|
-
|
|
161104
|
-
|
|
161105
|
-
|
|
161106
|
-
|
|
161107
|
-
|
|
161108
|
-
|
|
161109
|
-
|
|
161110
|
-
|
|
161111
|
-
|
|
161112
|
-
|
|
161113
|
-
|
|
161114
|
-
|
|
161115
|
-
|
|
161116
|
-
|
|
161117
|
-
|
|
161118
|
-
|
|
161119
|
-
|
|
161120
|
-
|
|
161121
|
-
|
|
161122
|
-
|
|
161123
|
-
|
|
161124
|
-
|
|
161125
|
-
|
|
161126
|
-
|
|
161127
|
-
|
|
161128
|
-
}
|
|
161129
|
-
|
|
161130
|
-
|
|
161131
|
-
return
|
|
161132
|
-
}
|
|
161133
|
-
|
|
161134
|
-
|
|
161135
|
-
|
|
161136
|
-
|
|
161137
|
-
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
161138
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
161139
|
-
};
|
|
161140
|
-
imports.wbg.__wbg_status_600fd8b881393898 = function(arg0) {
|
|
161141
|
-
const ret = getObject(arg0).status;
|
|
161142
|
-
return ret;
|
|
161143
|
-
};
|
|
161144
|
-
imports.wbg.__wbg_headers_9e7f2c05a9b962ea = function(arg0) {
|
|
161145
|
-
const ret = getObject(arg0).headers;
|
|
161146
|
-
return addHeapObject(ret);
|
|
161147
|
-
};
|
|
161148
|
-
imports.wbg.__wbg_arrayBuffer_5a99283a3954c850 = function() {
|
|
161149
|
-
return handleError(function(arg0) {
|
|
161150
|
-
const ret = getObject(arg0).arrayBuffer();
|
|
161151
|
-
return addHeapObject(ret);
|
|
161152
|
-
}, arguments);
|
|
161153
|
-
};
|
|
161154
|
-
imports.wbg.__wbg_newwithstrandinit_fd99688f189f053e = function() {
|
|
161155
|
-
return handleError(function(arg0, arg1, arg2) {
|
|
161156
|
-
const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
|
|
161157
|
-
return addHeapObject(ret);
|
|
161158
|
-
}, arguments);
|
|
161159
|
-
};
|
|
161160
|
-
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
161161
|
-
const val = getObject(arg0);
|
|
161162
|
-
const ret = typeof val === "object" && val !== null;
|
|
161163
|
-
return ret;
|
|
161164
|
-
};
|
|
161165
|
-
imports.wbg.__wbg_self_86b4b13392c7af56 = function() {
|
|
161166
|
-
return handleError(function() {
|
|
161167
|
-
const ret = self.self;
|
|
161168
|
-
return addHeapObject(ret);
|
|
161169
|
-
}, arguments);
|
|
161170
|
-
};
|
|
161171
|
-
imports.wbg.__wbg_crypto_b8c92eaac23d0d80 = function(arg0) {
|
|
161172
|
-
const ret = getObject(arg0).crypto;
|
|
161173
|
-
return addHeapObject(ret);
|
|
161174
|
-
};
|
|
161175
|
-
imports.wbg.__wbg_msCrypto_9ad6677321a08dd8 = function(arg0) {
|
|
161176
|
-
const ret = getObject(arg0).msCrypto;
|
|
161177
|
-
return addHeapObject(ret);
|
|
161178
|
-
};
|
|
161179
|
-
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
161180
|
-
const ret = getObject(arg0) === void 0;
|
|
161181
|
-
return ret;
|
|
161182
|
-
};
|
|
161183
|
-
imports.wbg.__wbg_static_accessor_MODULE_452b4680e8614c81 = function() {
|
|
161184
|
-
const ret = module;
|
|
161185
|
-
return addHeapObject(ret);
|
|
161186
|
-
};
|
|
161187
|
-
imports.wbg.__wbg_require_f5521a5b85ad2542 = function(arg0, arg1, arg2) {
|
|
161188
|
-
const ret = getObject(arg0).require(getStringFromWasm0(arg1, arg2));
|
|
161189
|
-
return addHeapObject(ret);
|
|
161190
|
-
};
|
|
161191
|
-
imports.wbg.__wbg_getRandomValues_dd27e6b0652b3236 = function(arg0) {
|
|
161192
|
-
const ret = getObject(arg0).getRandomValues;
|
|
161193
|
-
return addHeapObject(ret);
|
|
161194
|
-
};
|
|
161195
|
-
imports.wbg.__wbg_getRandomValues_e57c9b75ddead065 = function(arg0, arg1) {
|
|
161196
|
-
getObject(arg0).getRandomValues(getObject(arg1));
|
|
161197
|
-
};
|
|
161198
|
-
imports.wbg.__wbg_randomFillSync_d2ba53160aec6aba = function(arg0, arg1, arg2) {
|
|
161199
|
-
getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
|
|
161200
|
-
};
|
|
161201
|
-
imports.wbg.__wbindgen_is_function = function(arg0) {
|
|
161202
|
-
const ret = typeof getObject(arg0) === "function";
|
|
161203
|
-
return ret;
|
|
161204
|
-
};
|
|
161205
|
-
imports.wbg.__wbg_newnoargs_e23b458e372830de = function(arg0, arg1) {
|
|
161206
|
-
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
161207
|
-
return addHeapObject(ret);
|
|
161208
|
-
};
|
|
161209
|
-
imports.wbg.__wbg_next_cabb70b365520721 = function(arg0) {
|
|
161210
|
-
const ret = getObject(arg0).next;
|
|
161211
|
-
return addHeapObject(ret);
|
|
161212
|
-
};
|
|
161213
|
-
imports.wbg.__wbg_next_bf3d83fc18df496e = function() {
|
|
161214
|
-
return handleError(function(arg0) {
|
|
161215
|
-
const ret = getObject(arg0).next();
|
|
161216
|
-
return addHeapObject(ret);
|
|
161217
|
-
}, arguments);
|
|
161218
|
-
};
|
|
161219
|
-
imports.wbg.__wbg_done_040f966faa9a72b3 = function(arg0) {
|
|
161220
|
-
const ret = getObject(arg0).done;
|
|
161221
|
-
return ret;
|
|
161222
|
-
};
|
|
161223
|
-
imports.wbg.__wbg_value_419afbd9b9574c4c = function(arg0) {
|
|
161224
|
-
const ret = getObject(arg0).value;
|
|
161225
|
-
return addHeapObject(ret);
|
|
161226
|
-
};
|
|
161227
|
-
imports.wbg.__wbg_iterator_4832ef1f15b0382b = function() {
|
|
161228
|
-
const ret = Symbol.iterator;
|
|
161229
|
-
return addHeapObject(ret);
|
|
161230
|
-
};
|
|
161231
|
-
imports.wbg.__wbg_get_a9cab131e3152c49 = function() {
|
|
161232
|
-
return handleError(function(arg0, arg1) {
|
|
161233
|
-
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
161234
|
-
return addHeapObject(ret);
|
|
161235
|
-
}, arguments);
|
|
161236
|
-
};
|
|
161237
|
-
imports.wbg.__wbg_call_ae78342adc33730a = function() {
|
|
161238
|
-
return handleError(function(arg0, arg1) {
|
|
161239
|
-
const ret = getObject(arg0).call(getObject(arg1));
|
|
161240
|
-
return addHeapObject(ret);
|
|
161241
|
-
}, arguments);
|
|
161242
|
-
};
|
|
161243
|
-
imports.wbg.__wbg_new_36359baae5a47e27 = function() {
|
|
161244
|
-
const ret = new Object();
|
|
161245
|
-
return addHeapObject(ret);
|
|
161246
|
-
};
|
|
161247
|
-
imports.wbg.__wbg_call_3ed288a247f13ea5 = function() {
|
|
161248
|
-
return handleError(function(arg0, arg1, arg2) {
|
|
161249
|
-
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
161250
|
-
return addHeapObject(ret);
|
|
161251
|
-
}, arguments);
|
|
161252
|
-
};
|
|
161253
|
-
imports.wbg.__wbg_getTime_bffb1c09df09618b = function(arg0) {
|
|
161254
|
-
const ret = getObject(arg0).getTime();
|
|
161255
|
-
return ret;
|
|
161256
|
-
};
|
|
161257
|
-
imports.wbg.__wbg_new0_0ff7eb5c1486f3ec = function() {
|
|
161258
|
-
const ret = new Date();
|
|
161259
|
-
return addHeapObject(ret);
|
|
161260
|
-
};
|
|
161261
|
-
imports.wbg.__wbg_new_37705eed627d5ed9 = function(arg0, arg1) {
|
|
161262
|
-
try {
|
|
161263
|
-
var state0 = { a: arg0, b: arg1 };
|
|
161264
|
-
var cb0 = /* @__PURE__ */ __name((arg02, arg12) => {
|
|
161265
|
-
const a = state0.a;
|
|
161266
|
-
state0.a = 0;
|
|
161267
|
-
try {
|
|
161268
|
-
return __wbg_adapter_110(a, state0.b, arg02, arg12);
|
|
161269
|
-
} finally {
|
|
161270
|
-
state0.a = a;
|
|
161271
|
-
}
|
|
161272
|
-
}, "cb0");
|
|
161273
|
-
const ret = new Promise(cb0);
|
|
161274
|
-
return addHeapObject(ret);
|
|
161275
|
-
} finally {
|
|
161276
|
-
state0.a = state0.b = 0;
|
|
160802
|
+
__name(throwProtectedError, "throwProtectedError");
|
|
160803
|
+
var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
|
|
160804
|
+
var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
|
|
160805
|
+
var escapedStringRegExp = /^'([^]*?)'?$/;
|
|
160806
|
+
var doubleQuoteRegExp = /''/g;
|
|
160807
|
+
var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
160808
|
+
function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
|
|
160809
|
+
requiredArgs(2, arguments);
|
|
160810
|
+
var formatStr = String(dirtyFormatStr);
|
|
160811
|
+
var options = dirtyOptions || {};
|
|
160812
|
+
var locale2 = options.locale || en_US_default;
|
|
160813
|
+
var localeFirstWeekContainsDate = locale2.options && locale2.options.firstWeekContainsDate;
|
|
160814
|
+
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
|
|
160815
|
+
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);
|
|
160816
|
+
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
|
|
160817
|
+
throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
|
|
160818
|
+
}
|
|
160819
|
+
var localeWeekStartsOn = locale2.options && locale2.options.weekStartsOn;
|
|
160820
|
+
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
|
|
160821
|
+
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn);
|
|
160822
|
+
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
160823
|
+
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
|
|
160824
|
+
}
|
|
160825
|
+
if (!locale2.localize) {
|
|
160826
|
+
throw new RangeError("locale must contain localize property");
|
|
160827
|
+
}
|
|
160828
|
+
if (!locale2.formatLong) {
|
|
160829
|
+
throw new RangeError("locale must contain formatLong property");
|
|
160830
|
+
}
|
|
160831
|
+
var originalDate = toDate(dirtyDate);
|
|
160832
|
+
if (!isValid2(originalDate)) {
|
|
160833
|
+
throw new RangeError("Invalid time value");
|
|
160834
|
+
}
|
|
160835
|
+
var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
|
|
160836
|
+
var utcDate = subMilliseconds(originalDate, timezoneOffset);
|
|
160837
|
+
var formatterOptions = {
|
|
160838
|
+
firstWeekContainsDate,
|
|
160839
|
+
weekStartsOn,
|
|
160840
|
+
locale: locale2,
|
|
160841
|
+
_originalDate: originalDate
|
|
160842
|
+
};
|
|
160843
|
+
var result = formatStr.match(longFormattingTokensRegExp).map(function(substring) {
|
|
160844
|
+
var firstCharacter = substring[0];
|
|
160845
|
+
if (firstCharacter === "p" || firstCharacter === "P") {
|
|
160846
|
+
var longFormatter = longFormatters_default[firstCharacter];
|
|
160847
|
+
return longFormatter(substring, locale2.formatLong, formatterOptions);
|
|
160848
|
+
}
|
|
160849
|
+
return substring;
|
|
160850
|
+
}).join("").match(formattingTokensRegExp).map(function(substring) {
|
|
160851
|
+
if (substring === "''") {
|
|
160852
|
+
return "'";
|
|
160853
|
+
}
|
|
160854
|
+
var firstCharacter = substring[0];
|
|
160855
|
+
if (firstCharacter === "'") {
|
|
160856
|
+
return cleanEscapedString(substring);
|
|
160857
|
+
}
|
|
160858
|
+
var formatter = formatters_default[firstCharacter];
|
|
160859
|
+
if (formatter) {
|
|
160860
|
+
if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {
|
|
160861
|
+
throwProtectedError(substring, dirtyFormatStr, dirtyDate);
|
|
161277
160862
|
}
|
|
161278
|
-
|
|
161279
|
-
|
|
161280
|
-
|
|
161281
|
-
return
|
|
161282
|
-
};
|
|
161283
|
-
imports.wbg.__wbg_then_ce526c837d07b68f = function(arg0, arg1) {
|
|
161284
|
-
const ret = getObject(arg0).then(getObject(arg1));
|
|
161285
|
-
return addHeapObject(ret);
|
|
161286
|
-
};
|
|
161287
|
-
imports.wbg.__wbg_then_842e65b843962f56 = function(arg0, arg1, arg2) {
|
|
161288
|
-
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
|
161289
|
-
return addHeapObject(ret);
|
|
161290
|
-
};
|
|
161291
|
-
imports.wbg.__wbg_self_99737b4dcdf6f0d8 = function() {
|
|
161292
|
-
return handleError(function() {
|
|
161293
|
-
const ret = self.self;
|
|
161294
|
-
return addHeapObject(ret);
|
|
161295
|
-
}, arguments);
|
|
161296
|
-
};
|
|
161297
|
-
imports.wbg.__wbg_window_9b61fbbf3564c4fb = function() {
|
|
161298
|
-
return handleError(function() {
|
|
161299
|
-
const ret = window.window;
|
|
161300
|
-
return addHeapObject(ret);
|
|
161301
|
-
}, arguments);
|
|
161302
|
-
};
|
|
161303
|
-
imports.wbg.__wbg_globalThis_8e275ef40caea3a3 = function() {
|
|
161304
|
-
return handleError(function() {
|
|
161305
|
-
const ret = globalThis.globalThis;
|
|
161306
|
-
return addHeapObject(ret);
|
|
161307
|
-
}, arguments);
|
|
161308
|
-
};
|
|
161309
|
-
imports.wbg.__wbg_global_5de1e0f82bddcd27 = function() {
|
|
161310
|
-
return handleError(function() {
|
|
161311
|
-
const ret = global.global;
|
|
161312
|
-
return addHeapObject(ret);
|
|
161313
|
-
}, arguments);
|
|
161314
|
-
};
|
|
161315
|
-
imports.wbg.__wbg_buffer_7af23f65f6c64548 = function(arg0) {
|
|
161316
|
-
const ret = getObject(arg0).buffer;
|
|
161317
|
-
return addHeapObject(ret);
|
|
161318
|
-
};
|
|
161319
|
-
imports.wbg.__wbg_newwithbyteoffsetandlength_ce1e75f0ce5f7974 = function(arg0, arg1, arg2) {
|
|
161320
|
-
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
161321
|
-
return addHeapObject(ret);
|
|
161322
|
-
};
|
|
161323
|
-
imports.wbg.__wbg_new_cc9018bd6f283b6f = function(arg0) {
|
|
161324
|
-
const ret = new Uint8Array(getObject(arg0));
|
|
161325
|
-
return addHeapObject(ret);
|
|
161326
|
-
};
|
|
161327
|
-
imports.wbg.__wbg_set_f25e869e4565d2a2 = function(arg0, arg1, arg2) {
|
|
161328
|
-
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
161329
|
-
};
|
|
161330
|
-
imports.wbg.__wbg_length_0acb1cf9bbaf8519 = function(arg0) {
|
|
161331
|
-
const ret = getObject(arg0).length;
|
|
161332
|
-
return ret;
|
|
161333
|
-
};
|
|
161334
|
-
imports.wbg.__wbg_newwithlength_8f0657faca9f1422 = function(arg0) {
|
|
161335
|
-
const ret = new Uint8Array(arg0 >>> 0);
|
|
161336
|
-
return addHeapObject(ret);
|
|
161337
|
-
};
|
|
161338
|
-
imports.wbg.__wbg_subarray_da527dbd24eafb6b = function(arg0, arg1, arg2) {
|
|
161339
|
-
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
161340
|
-
return addHeapObject(ret);
|
|
161341
|
-
};
|
|
161342
|
-
imports.wbg.__wbg_has_ce995ec88636803d = function() {
|
|
161343
|
-
return handleError(function(arg0, arg1) {
|
|
161344
|
-
const ret = Reflect.has(getObject(arg0), getObject(arg1));
|
|
161345
|
-
return ret;
|
|
161346
|
-
}, arguments);
|
|
161347
|
-
};
|
|
161348
|
-
imports.wbg.__wbg_set_93b1c87ee2af852e = function() {
|
|
161349
|
-
return handleError(function(arg0, arg1, arg2) {
|
|
161350
|
-
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
161351
|
-
return ret;
|
|
161352
|
-
}, arguments);
|
|
161353
|
-
};
|
|
161354
|
-
imports.wbg.__wbg_stringify_c760003feffcc1f2 = function() {
|
|
161355
|
-
return handleError(function(arg0) {
|
|
161356
|
-
const ret = JSON.stringify(getObject(arg0));
|
|
161357
|
-
return addHeapObject(ret);
|
|
161358
|
-
}, arguments);
|
|
161359
|
-
};
|
|
161360
|
-
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
161361
|
-
const ret = debugString(getObject(arg1));
|
|
161362
|
-
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
161363
|
-
const len0 = WASM_VECTOR_LEN;
|
|
161364
|
-
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
161365
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
161366
|
-
};
|
|
161367
|
-
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
161368
|
-
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
161369
|
-
};
|
|
161370
|
-
imports.wbg.__wbindgen_memory = function() {
|
|
161371
|
-
const ret = wasm.memory;
|
|
161372
|
-
return addHeapObject(ret);
|
|
161373
|
-
};
|
|
161374
|
-
imports.wbg.__wbindgen_closure_wrapper10913 = function(arg0, arg1, arg2) {
|
|
161375
|
-
const ret = makeMutClosure(arg0, arg1, 3725, __wbg_adapter_24);
|
|
161376
|
-
return addHeapObject(ret);
|
|
161377
|
-
};
|
|
161378
|
-
if (typeof input === "string" || typeof Request === "function" && input instanceof Request || typeof URL === "function" && input instanceof URL) {
|
|
161379
|
-
input = fetch(input);
|
|
160863
|
+
if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {
|
|
160864
|
+
throwProtectedError(substring, dirtyFormatStr, dirtyDate);
|
|
160865
|
+
}
|
|
160866
|
+
return formatter(utcDate, substring, locale2.localize, formatterOptions);
|
|
161380
160867
|
}
|
|
161381
|
-
|
|
161382
|
-
|
|
161383
|
-
|
|
161384
|
-
return
|
|
161385
|
-
});
|
|
160868
|
+
if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
|
|
160869
|
+
throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`");
|
|
160870
|
+
}
|
|
160871
|
+
return substring;
|
|
160872
|
+
}).join("");
|
|
160873
|
+
return result;
|
|
161386
160874
|
}
|
|
161387
|
-
__name(
|
|
161388
|
-
|
|
161389
|
-
|
|
161390
|
-
|
|
161391
|
-
|
|
161392
|
-
|
|
161393
|
-
|
|
161394
|
-
return
|
|
161395
|
-
}
|
|
161396
|
-
var
|
|
161397
|
-
|
|
161398
|
-
|
|
161399
|
-
|
|
160875
|
+
__name(format, "format");
|
|
160876
|
+
function cleanEscapedString(input) {
|
|
160877
|
+
return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
|
|
160878
|
+
}
|
|
160879
|
+
__name(cleanEscapedString, "cleanEscapedString");
|
|
160880
|
+
var transformErrorCheck = /* @__PURE__ */ __name((error, _credential) => {
|
|
160881
|
+
const prefix = error.split(" error")[0];
|
|
160882
|
+
return prefix || error;
|
|
160883
|
+
}, "transformErrorCheck");
|
|
160884
|
+
var transformErrorMessage = /* @__PURE__ */ __name((error, credential) => {
|
|
160885
|
+
if (error.startsWith("expiration")) {
|
|
160886
|
+
return credential.expirationDate ? `Invalid \u2022 Expired ${format(new Date(credential.expirationDate), "dd MMM yyyy").toUpperCase()}` : "Invalid \u2022 Expired";
|
|
160887
|
+
}
|
|
160888
|
+
return error;
|
|
160889
|
+
}, "transformErrorMessage");
|
|
160890
|
+
var transformCheckMessage = /* @__PURE__ */ __name((check, credential) => {
|
|
161400
160891
|
return {
|
|
161401
|
-
|
|
161402
|
-
|
|
161403
|
-
|
|
161404
|
-
|
|
161405
|
-
|
|
161406
|
-
|
|
161407
|
-
|
|
161408
|
-
|
|
161409
|
-
|
|
161410
|
-
|
|
161411
|
-
|
|
161412
|
-
|
|
161413
|
-
|
|
161414
|
-
|
|
161415
|
-
|
|
161416
|
-
|
|
161417
|
-
|
|
161418
|
-
|
|
161419
|
-
|
|
161420
|
-
|
|
161421
|
-
})
|
|
161422
|
-
|
|
161423
|
-
|
|
161424
|
-
|
|
161425
|
-
|
|
161426
|
-
|
|
161427
|
-
|
|
161428
|
-
|
|
161429
|
-
|
|
161430
|
-
|
|
161431
|
-
|
|
161432
|
-
|
|
161433
|
-
|
|
161434
|
-
|
|
161435
|
-
ethereumConfig = defaultEthereumArgs
|
|
160892
|
+
proof: "Valid",
|
|
160893
|
+
expiration: credential.expirationDate ? `Valid \u2022 Expires ${format(new Date(credential.expirationDate), "dd MMM yyyy").toUpperCase()}` : "Valid \u2022 Does Not Expire"
|
|
160894
|
+
}[check] || check;
|
|
160895
|
+
}, "transformCheckMessage");
|
|
160896
|
+
var verifyCredential3 = /* @__PURE__ */ __name((wallet) => {
|
|
160897
|
+
return (credential) => __async$1(void 0, null, function* () {
|
|
160898
|
+
const rawVerificationCheck = yield wallet.pluginMethods.verifyCredential(credential);
|
|
160899
|
+
const verificationItems = [];
|
|
160900
|
+
rawVerificationCheck.errors.forEach((error) => {
|
|
160901
|
+
verificationItems.push({
|
|
160902
|
+
status: VerificationStatusEnum.Failed,
|
|
160903
|
+
check: transformErrorCheck(error, credential),
|
|
160904
|
+
details: transformErrorMessage(error, credential)
|
|
160905
|
+
});
|
|
160906
|
+
});
|
|
160907
|
+
rawVerificationCheck.warnings.forEach((warning) => {
|
|
160908
|
+
verificationItems.push({
|
|
160909
|
+
status: VerificationStatusEnum.Error,
|
|
160910
|
+
check: "hmm",
|
|
160911
|
+
message: warning
|
|
160912
|
+
});
|
|
160913
|
+
});
|
|
160914
|
+
rawVerificationCheck.checks.forEach((check) => {
|
|
160915
|
+
verificationItems.push({
|
|
160916
|
+
status: VerificationStatusEnum.Success,
|
|
160917
|
+
check,
|
|
160918
|
+
message: transformCheckMessage(check, credential)
|
|
160919
|
+
});
|
|
160920
|
+
});
|
|
160921
|
+
return verificationItems;
|
|
160922
|
+
});
|
|
160923
|
+
}, "verifyCredential");
|
|
160924
|
+
var emptyWallet = /* @__PURE__ */ __name((..._0) => __async$1(void 0, [..._0], function* ({
|
|
160925
|
+
didkit
|
|
161436
160926
|
} = {}) {
|
|
161437
|
-
const didkitWallet = yield (yield generateWallet(
|
|
161438
|
-
const
|
|
161439
|
-
const didkeyAndVCWallet = yield didkeyWallet.addPlugin(yield getVCPlugin(didkeyWallet));
|
|
161440
|
-
const idxWallet = yield didkeyAndVCWallet.addPlugin(yield getIDXPlugin(didkeyAndVCWallet, ceramicIdx));
|
|
161441
|
-
const expirationWallet = yield idxWallet.addPlugin(ExpirationPlugin(idxWallet));
|
|
161442
|
-
const wallet = yield expirationWallet.addPlugin(getEthereumPlugin(expirationWallet, ethereumConfig));
|
|
160927
|
+
const didkitWallet = yield (yield generateWallet()).addPlugin(yield getDidKitPlugin(didkit));
|
|
160928
|
+
const wallet = yield didkitWallet.addPlugin(ExpirationPlugin(didkitWallet));
|
|
161443
160929
|
return {
|
|
161444
160930
|
_wallet: wallet,
|
|
161445
|
-
|
|
161446
|
-
|
|
161447
|
-
issueCredential: wallet.pluginMethods.issueCredential,
|
|
161448
|
-
verifyCredential: verifyCredential2(wallet),
|
|
161449
|
-
issuePresentation: wallet.pluginMethods.issuePresentation,
|
|
161450
|
-
verifyPresentation: wallet.pluginMethods.verifyPresentation,
|
|
161451
|
-
getCredential: wallet.pluginMethods.getVerifiableCredentialFromIdx,
|
|
161452
|
-
getCredentials: wallet.pluginMethods.getVerifiableCredentialsFromIdx,
|
|
161453
|
-
getCredentialsList: () => __async$1(void 0, null, function* () {
|
|
161454
|
-
return (yield wallet.pluginMethods.getCredentialsListFromIdx()).credentials;
|
|
161455
|
-
}),
|
|
161456
|
-
publishCredential: wallet.pluginMethods.publishContentToCeramic,
|
|
161457
|
-
addCredential: (credential) => __async$1(void 0, null, function* () {
|
|
161458
|
-
yield wallet.pluginMethods.addVerifiableCredentialInIdx(credential);
|
|
161459
|
-
}),
|
|
161460
|
-
removeCredential: (title) => __async$1(void 0, null, function* () {
|
|
161461
|
-
yield wallet.pluginMethods.removeVerifiableCredentialInIdx(title);
|
|
161462
|
-
}),
|
|
161463
|
-
readFromCeramic: wallet.pluginMethods.readContentFromCeramic,
|
|
161464
|
-
getTestVc: wallet.pluginMethods.getTestVc,
|
|
161465
|
-
getTestVp: wallet.pluginMethods.getTestVp,
|
|
161466
|
-
checkMyEth: wallet.pluginMethods.checkMyEth,
|
|
161467
|
-
checkMyDai: wallet.pluginMethods.checkMyDai,
|
|
161468
|
-
checkMyUsdc: wallet.pluginMethods.checkMyUsdc
|
|
160931
|
+
verifyCredential: verifyCredential3(wallet),
|
|
160932
|
+
verifyPresentation: wallet.pluginMethods.verifyPresentation
|
|
161469
160933
|
};
|
|
161470
|
-
}), "
|
|
160934
|
+
}), "emptyWallet");
|
|
161471
160935
|
/*!
|
|
161472
160936
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
161473
160937
|
* (c) 2017-2021 Joachim Wester
|
|
@@ -161512,13 +160976,13 @@ const VCCard = ({ credential, issueeOverride, className = "" }) => {
|
|
|
161512
160976
|
const [vcVerification, setVCVerification] = React.useState([]);
|
|
161513
160977
|
React.useEffect(() => {
|
|
161514
160978
|
const verify = () => __async(void 0, null, function* () {
|
|
161515
|
-
const wallet = yield
|
|
160979
|
+
const wallet = yield emptyWallet();
|
|
161516
160980
|
const verification = yield wallet.verifyCredential(credential);
|
|
161517
160981
|
setVCVerification(verification);
|
|
161518
160982
|
setLoading(false);
|
|
161519
160983
|
});
|
|
161520
160984
|
verify();
|
|
161521
|
-
}, []);
|
|
160985
|
+
}, [credential]);
|
|
161522
160986
|
return /* @__PURE__ */ React__default["default"].createElement(VCDisplayCard.VCDisplayCard, {
|
|
161523
160987
|
credential,
|
|
161524
160988
|
issueeOverride,
|
|
@@ -161529,4 +160993,4 @@ const VCCard = ({ credential, issueeOverride, className = "" }) => {
|
|
|
161529
160993
|
};
|
|
161530
160994
|
|
|
161531
160995
|
exports.VCCard = VCCard;
|
|
161532
|
-
//# sourceMappingURL=VCCard-
|
|
160996
|
+
//# sourceMappingURL=VCCard-ef452696.js.map
|