@eclesia/indexer-engine 2.10.0 → 2.11.0
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/_virtual/rolldown_runtime.cjs +4 -0
- package/dist/_virtual/rolldown_runtime.mjs +38 -0
- package/dist/constants.cjs +6 -2
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.d.cts +6 -3
- package/dist/constants.d.cts.map +1 -1
- package/dist/{constants.d.ts → constants.d.mts} +7 -4
- package/dist/constants.d.mts.map +1 -0
- package/dist/{constants.js → constants.mjs} +7 -4
- package/dist/constants.mjs.map +1 -0
- package/dist/emitter/index.cjs +6 -3
- package/dist/emitter/index.cjs.map +1 -1
- package/dist/emitter/index.d.cts.map +1 -1
- package/dist/emitter/{index.d.ts → index.d.mts} +2 -2
- package/dist/emitter/index.d.mts.map +1 -0
- package/dist/emitter/{index.js → index.mjs} +7 -4
- package/dist/emitter/index.mjs.map +1 -0
- package/dist/errors/index.cjs +18 -0
- package/dist/errors/index.cjs.map +1 -1
- package/dist/errors/index.d.cts.map +1 -1
- package/dist/errors/{index.d.ts → index.d.mts} +1 -1
- package/dist/errors/index.d.mts.map +1 -0
- package/dist/errors/{index.js → index.mjs} +19 -1
- package/dist/errors/index.mjs.map +1 -0
- package/dist/index.cjs +10 -2
- package/dist/index.d.cts +6 -5
- package/dist/index.d.mts +11 -0
- package/dist/index.mjs +12 -0
- package/dist/indexer/index.cjs +113 -67
- package/dist/indexer/index.cjs.map +1 -1
- package/dist/indexer/index.d.cts +7 -1
- package/dist/indexer/index.d.cts.map +1 -1
- package/dist/indexer/{index.d.ts → index.d.mts} +11 -5
- package/dist/indexer/index.d.mts.map +1 -0
- package/dist/indexer/{index.js → index.mjs} +121 -75
- package/dist/indexer/index.mjs.map +1 -0
- package/dist/metrics/index.cjs +28 -0
- package/dist/metrics/index.cjs.map +1 -1
- package/dist/metrics/index.d.cts.map +1 -1
- package/dist/metrics/{index.d.ts → index.d.mts} +1 -1
- package/dist/metrics/index.d.mts.map +1 -0
- package/dist/metrics/{index.js → index.mjs} +29 -1
- package/dist/metrics/index.mjs.map +1 -0
- package/dist/mocks/index.cjs +18 -0
- package/dist/mocks/index.cjs.map +1 -0
- package/dist/mocks/index.d.cts +9 -0
- package/dist/mocks/index.d.cts.map +1 -0
- package/dist/mocks/index.d.mts +9 -0
- package/dist/mocks/index.d.mts.map +1 -0
- package/dist/mocks/index.mjs +13 -0
- package/dist/mocks/index.mjs.map +1 -0
- package/dist/mocks/rpc-client.cjs +209 -0
- package/dist/mocks/rpc-client.cjs.map +1 -0
- package/dist/mocks/rpc-client.d.cts +44 -0
- package/dist/mocks/rpc-client.d.cts.map +1 -0
- package/dist/mocks/rpc-client.d.mts +44 -0
- package/dist/mocks/rpc-client.d.mts.map +1 -0
- package/dist/mocks/rpc-client.mjs +208 -0
- package/dist/mocks/rpc-client.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/ascii.cjs +32 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/ascii.cjs.map +1 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/ascii.mjs +29 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/ascii.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/base64.cjs +67 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/base64.cjs.map +1 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/base64.mjs +64 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/base64.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/bech32.cjs +80 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/bech32.cjs.map +1 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/bech32.mjs +77 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/bech32.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/hex.cjs +33 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/hex.cjs.map +1 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/hex.mjs +30 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/hex.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/index.cjs +106 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/index.mjs +103 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/rfc3339.cjs +52 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/rfc3339.cjs.map +1 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/rfc3339.mjs +49 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/rfc3339.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/utf8.cjs +31 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/utf8.cjs.map +1 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/utf8.mjs +28 -0
- package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/utf8.mjs.map +1 -0
- package/dist/node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.cjs +98 -0
- package/dist/node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.mjs +95 -0
- package/dist/node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.mjs.map +1 -0
- package/dist/promise-queue/index.cjs +34 -5
- package/dist/promise-queue/index.cjs.map +1 -1
- package/dist/promise-queue/index.d.cts.map +1 -1
- package/dist/promise-queue/{index.d.ts → index.d.mts} +1 -1
- package/dist/promise-queue/index.d.mts.map +1 -0
- package/dist/promise-queue/{index.js → index.mjs} +35 -6
- package/dist/promise-queue/index.mjs.map +1 -0
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +2 -1
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/{index.d.ts → index.d.mts} +5 -4
- package/dist/types/index.d.mts.map +1 -0
- package/dist/types/{index.js → index.mjs} +1 -1
- package/dist/types/index.mjs.map +1 -0
- package/dist/utils/{bech32.d.ts → bech32.d.mts} +1 -1
- package/dist/utils/bech32.d.mts.map +1 -0
- package/dist/utils/{bech32.js → bech32.mjs} +1 -1
- package/dist/utils/bech32.mjs.map +1 -0
- package/dist/utils/{bigint.d.ts → bigint.d.mts} +1 -1
- package/dist/utils/bigint.d.mts.map +1 -0
- package/dist/utils/{bigint.js → bigint.mjs} +1 -1
- package/dist/utils/bigint.mjs.map +1 -0
- package/dist/utils/{index.d.ts → index.d.mts} +4 -4
- package/dist/utils/index.d.mts.map +1 -0
- package/dist/utils/{index.js → index.mjs} +5 -5
- package/dist/utils/index.mjs.map +1 -0
- package/dist/utils/{text.d.ts → text.d.mts} +1 -1
- package/dist/utils/text.d.mts.map +1 -0
- package/dist/utils/{text.js → text.mjs} +1 -1
- package/dist/utils/text.mjs.map +1 -0
- package/dist/validation/{index.d.ts → index.d.mts} +1 -1
- package/dist/validation/index.d.mts.map +1 -0
- package/dist/validation/{index.js → index.mjs} +3 -3
- package/dist/validation/index.mjs.map +1 -0
- package/package.json +23 -20
- package/dist/_virtual/rolldown_runtime.js +0 -13
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js.map +0 -1
- package/dist/emitter/index.d.ts.map +0 -1
- package/dist/emitter/index.js.map +0 -1
- package/dist/errors/index.d.ts.map +0 -1
- package/dist/errors/index.js.map +0 -1
- package/dist/index.d.ts +0 -10
- package/dist/index.js +0 -11
- package/dist/indexer/index.d.ts.map +0 -1
- package/dist/indexer/index.js.map +0 -1
- package/dist/metrics/index.d.ts.map +0 -1
- package/dist/metrics/index.js.map +0 -1
- package/dist/promise-queue/index.d.ts.map +0 -1
- package/dist/promise-queue/index.js.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/utils/bech32.d.ts.map +0 -1
- package/dist/utils/bech32.js.map +0 -1
- package/dist/utils/bigint.d.ts.map +0 -1
- package/dist/utils/bigint.js.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/text.d.ts.map +0 -1
- package/dist/utils/text.js.map +0 -1
- package/dist/validation/index.d.ts.map +0 -1
- package/dist/validation/index.js.map +0 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.mjs";
|
|
2
|
+
import { require_ascii } from "./ascii.mjs";
|
|
3
|
+
import { require_base64 } from "./base64.mjs";
|
|
4
|
+
import { require_bech32 } from "./bech32.mjs";
|
|
5
|
+
import { require_hex } from "./hex.mjs";
|
|
6
|
+
import { require_rfc3339 } from "./rfc3339.mjs";
|
|
7
|
+
import { require_utf8 } from "./utf8.mjs";
|
|
8
|
+
|
|
9
|
+
//#region ../../node_modules/.pnpm/@cosmjs+encoding@0.36.0/node_modules/@cosmjs/encoding/build/index.js
|
|
10
|
+
var require_build = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@cosmjs+encoding@0.36.0/node_modules/@cosmjs/encoding/build/index.js": ((exports) => {
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.toUtf8 = exports.fromUtf8 = exports.toRfc3339 = exports.fromRfc3339 = exports.toHex = exports.fromHex = exports.toBech32 = exports.normalizeBech32 = exports.fromBech32 = exports.toBase64 = exports.fromBase64 = exports.toAscii = exports.fromAscii = void 0;
|
|
13
|
+
var ascii_1 = require_ascii();
|
|
14
|
+
Object.defineProperty(exports, "fromAscii", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function() {
|
|
17
|
+
return ascii_1.fromAscii;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "toAscii", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function() {
|
|
23
|
+
return ascii_1.toAscii;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
var base64_1 = require_base64();
|
|
27
|
+
Object.defineProperty(exports, "fromBase64", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function() {
|
|
30
|
+
return base64_1.fromBase64;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
Object.defineProperty(exports, "toBase64", {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function() {
|
|
36
|
+
return base64_1.toBase64;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
var bech32_1 = require_bech32();
|
|
40
|
+
Object.defineProperty(exports, "fromBech32", {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function() {
|
|
43
|
+
return bech32_1.fromBech32;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
Object.defineProperty(exports, "normalizeBech32", {
|
|
47
|
+
enumerable: true,
|
|
48
|
+
get: function() {
|
|
49
|
+
return bech32_1.normalizeBech32;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
Object.defineProperty(exports, "toBech32", {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
get: function() {
|
|
55
|
+
return bech32_1.toBech32;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
var hex_1 = require_hex();
|
|
59
|
+
Object.defineProperty(exports, "fromHex", {
|
|
60
|
+
enumerable: true,
|
|
61
|
+
get: function() {
|
|
62
|
+
return hex_1.fromHex;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
Object.defineProperty(exports, "toHex", {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function() {
|
|
68
|
+
return hex_1.toHex;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
var rfc3339_1 = require_rfc3339();
|
|
72
|
+
Object.defineProperty(exports, "fromRfc3339", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function() {
|
|
75
|
+
return rfc3339_1.fromRfc3339;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "toRfc3339", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function() {
|
|
81
|
+
return rfc3339_1.toRfc3339;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
var utf8_1 = require_utf8();
|
|
85
|
+
Object.defineProperty(exports, "fromUtf8", {
|
|
86
|
+
enumerable: true,
|
|
87
|
+
get: function() {
|
|
88
|
+
return utf8_1.fromUtf8;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
Object.defineProperty(exports, "toUtf8", {
|
|
92
|
+
enumerable: true,
|
|
93
|
+
get: function() {
|
|
94
|
+
return utf8_1.toUtf8;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}) });
|
|
98
|
+
|
|
99
|
+
//#endregion
|
|
100
|
+
export default require_build();
|
|
101
|
+
|
|
102
|
+
export { require_build };
|
|
103
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@cosmjs+encoding@0.36.0/node_modules/@cosmjs/encoding/build/index.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toUtf8 = exports.fromUtf8 = exports.toRfc3339 = exports.fromRfc3339 = exports.toHex = exports.fromHex = exports.toBech32 = exports.normalizeBech32 = exports.fromBech32 = exports.toBase64 = exports.fromBase64 = exports.toAscii = exports.fromAscii = void 0;\nvar ascii_1 = require(\"./ascii\");\nObject.defineProperty(exports, \"fromAscii\", { enumerable: true, get: function () { return ascii_1.fromAscii; } });\nObject.defineProperty(exports, \"toAscii\", { enumerable: true, get: function () { return ascii_1.toAscii; } });\nvar base64_1 = require(\"./base64\");\nObject.defineProperty(exports, \"fromBase64\", { enumerable: true, get: function () { return base64_1.fromBase64; } });\nObject.defineProperty(exports, \"toBase64\", { enumerable: true, get: function () { return base64_1.toBase64; } });\nvar bech32_1 = require(\"./bech32\");\nObject.defineProperty(exports, \"fromBech32\", { enumerable: true, get: function () { return bech32_1.fromBech32; } });\nObject.defineProperty(exports, \"normalizeBech32\", { enumerable: true, get: function () { return bech32_1.normalizeBech32; } });\nObject.defineProperty(exports, \"toBech32\", { enumerable: true, get: function () { return bech32_1.toBech32; } });\nvar hex_1 = require(\"./hex\");\nObject.defineProperty(exports, \"fromHex\", { enumerable: true, get: function () { return hex_1.fromHex; } });\nObject.defineProperty(exports, \"toHex\", { enumerable: true, get: function () { return hex_1.toHex; } });\nvar rfc3339_1 = require(\"./rfc3339\");\nObject.defineProperty(exports, \"fromRfc3339\", { enumerable: true, get: function () { return rfc3339_1.fromRfc3339; } });\nObject.defineProperty(exports, \"toRfc3339\", { enumerable: true, get: function () { return rfc3339_1.toRfc3339; } });\nvar utf8_1 = require(\"./utf8\");\nObject.defineProperty(exports, \"fromUtf8\", { enumerable: true, get: function () { return utf8_1.fromUtf8; } });\nObject.defineProperty(exports, \"toUtf8\", { enumerable: true, get: function () { return utf8_1.toUtf8; } });\n//# sourceMappingURL=index.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;AACA,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,SAAS,QAAQ,WAAW,QAAQ,YAAY,QAAQ,cAAc,QAAQ,QAAQ,QAAQ,UAAU,QAAQ,WAAW,QAAQ,kBAAkB,QAAQ,aAAa,QAAQ,WAAW,QAAQ,aAAa,QAAQ,UAAU,QAAQ,YAAY,KAAK;CACrQ,IAAI;AACJ,QAAO,eAAe,SAAS,aAAa;EAAE,YAAY;EAAM,KAAK,WAAY;AAAE,UAAO,QAAQ;;EAAc,CAAC;AACjH,QAAO,eAAe,SAAS,WAAW;EAAE,YAAY;EAAM,KAAK,WAAY;AAAE,UAAO,QAAQ;;EAAY,CAAC;CAC7G,IAAI;AACJ,QAAO,eAAe,SAAS,cAAc;EAAE,YAAY;EAAM,KAAK,WAAY;AAAE,UAAO,SAAS;;EAAe,CAAC;AACpH,QAAO,eAAe,SAAS,YAAY;EAAE,YAAY;EAAM,KAAK,WAAY;AAAE,UAAO,SAAS;;EAAa,CAAC;CAChH,IAAI;AACJ,QAAO,eAAe,SAAS,cAAc;EAAE,YAAY;EAAM,KAAK,WAAY;AAAE,UAAO,SAAS;;EAAe,CAAC;AACpH,QAAO,eAAe,SAAS,mBAAmB;EAAE,YAAY;EAAM,KAAK,WAAY;AAAE,UAAO,SAAS;;EAAoB,CAAC;AAC9H,QAAO,eAAe,SAAS,YAAY;EAAE,YAAY;EAAM,KAAK,WAAY;AAAE,UAAO,SAAS;;EAAa,CAAC;CAChH,IAAI;AACJ,QAAO,eAAe,SAAS,WAAW;EAAE,YAAY;EAAM,KAAK,WAAY;AAAE,UAAO,MAAM;;EAAY,CAAC;AAC3G,QAAO,eAAe,SAAS,SAAS;EAAE,YAAY;EAAM,KAAK,WAAY;AAAE,UAAO,MAAM;;EAAU,CAAC;CACvG,IAAI;AACJ,QAAO,eAAe,SAAS,eAAe;EAAE,YAAY;EAAM,KAAK,WAAY;AAAE,UAAO,UAAU;;EAAgB,CAAC;AACvH,QAAO,eAAe,SAAS,aAAa;EAAE,YAAY;EAAM,KAAK,WAAY;AAAE,UAAO,UAAU;;EAAc,CAAC;CACnH,IAAI;AACJ,QAAO,eAAe,SAAS,YAAY;EAAE,YAAY;EAAM,KAAK,WAAY;AAAE,UAAO,OAAO;;EAAa,CAAC;AAC9G,QAAO,eAAe,SAAS,UAAU;EAAE,YAAY;EAAM,KAAK,WAAY;AAAE,UAAO,OAAO;;EAAW,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/@cosmjs+encoding@0.36.0/node_modules/@cosmjs/encoding/build/rfc3339.js
|
|
4
|
+
var require_rfc3339 = /* @__PURE__ */ require_rolldown_runtime.__commonJS({ "../../node_modules/.pnpm/@cosmjs+encoding@0.36.0/node_modules/@cosmjs/encoding/build/rfc3339.js": ((exports) => {
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.fromRfc3339 = fromRfc3339;
|
|
7
|
+
exports.toRfc3339 = toRfc3339;
|
|
8
|
+
const rfc3339Matcher = /^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(\.\d{1,9})?((?:[+-]\d{2}:\d{2})|Z)$/;
|
|
9
|
+
function padded(integer, length = 2) {
|
|
10
|
+
return integer.toString().padStart(length, "0");
|
|
11
|
+
}
|
|
12
|
+
function fromRfc3339(str) {
|
|
13
|
+
const matches = rfc3339Matcher.exec(str);
|
|
14
|
+
if (!matches) throw new Error("Date string is not in RFC3339 format");
|
|
15
|
+
const year = +matches[1];
|
|
16
|
+
const month = +matches[2];
|
|
17
|
+
const day = +matches[3];
|
|
18
|
+
const hour = +matches[4];
|
|
19
|
+
const minute = +matches[5];
|
|
20
|
+
const second = +matches[6];
|
|
21
|
+
const milliSeconds = matches[7] ? Math.floor(+matches[7] * 1e3) : 0;
|
|
22
|
+
let tzOffsetSign;
|
|
23
|
+
let tzOffsetHours;
|
|
24
|
+
let tzOffsetMinutes;
|
|
25
|
+
if (matches[8] === "Z") {
|
|
26
|
+
tzOffsetSign = 1;
|
|
27
|
+
tzOffsetHours = 0;
|
|
28
|
+
tzOffsetMinutes = 0;
|
|
29
|
+
} else {
|
|
30
|
+
tzOffsetSign = matches[8].substring(0, 1) === "-" ? -1 : 1;
|
|
31
|
+
tzOffsetHours = +matches[8].substring(1, 3);
|
|
32
|
+
tzOffsetMinutes = +matches[8].substring(4, 6);
|
|
33
|
+
}
|
|
34
|
+
const tzOffset = tzOffsetSign * (tzOffsetHours * 60 + tzOffsetMinutes) * 60;
|
|
35
|
+
const date = /* @__PURE__ */ new Date();
|
|
36
|
+
date.setUTCFullYear(year, month - 1, day);
|
|
37
|
+
date.setUTCHours(hour, minute, second, milliSeconds);
|
|
38
|
+
return /* @__PURE__ */ new Date(date.getTime() - tzOffset * 1e3);
|
|
39
|
+
}
|
|
40
|
+
function toRfc3339(date) {
|
|
41
|
+
return `${date.getUTCFullYear()}-${padded(date.getUTCMonth() + 1)}-${padded(date.getUTCDate())}T${padded(date.getUTCHours())}:${padded(date.getUTCMinutes())}:${padded(date.getUTCSeconds())}.${padded(date.getUTCMilliseconds(), 3)}Z`;
|
|
42
|
+
}
|
|
43
|
+
}) });
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
Object.defineProperty(exports, 'default', {
|
|
47
|
+
enumerable: true,
|
|
48
|
+
get: function () {
|
|
49
|
+
return require_rfc3339();
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=rfc3339.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rfc3339.cjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@cosmjs+encoding@0.36.0/node_modules/@cosmjs/encoding/build/rfc3339.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromRfc3339 = fromRfc3339;\nexports.toRfc3339 = toRfc3339;\nconst rfc3339Matcher = /^(\\d{4})-(\\d{2})-(\\d{2})[T ](\\d{2}):(\\d{2}):(\\d{2})(\\.\\d{1,9})?((?:[+-]\\d{2}:\\d{2})|Z)$/;\nfunction padded(integer, length = 2) {\n return integer.toString().padStart(length, \"0\");\n}\nfunction fromRfc3339(str) {\n const matches = rfc3339Matcher.exec(str);\n if (!matches) {\n throw new Error(\"Date string is not in RFC3339 format\");\n }\n const year = +matches[1];\n const month = +matches[2];\n const day = +matches[3];\n const hour = +matches[4];\n const minute = +matches[5];\n const second = +matches[6];\n // fractional seconds match either undefined or a string like \".1\", \".123456789\"\n const milliSeconds = matches[7] ? Math.floor(+matches[7] * 1000) : 0;\n let tzOffsetSign;\n let tzOffsetHours;\n let tzOffsetMinutes;\n // if timezone is undefined, it must be Z or nothing (otherwise the group would have captured).\n if (matches[8] === \"Z\") {\n tzOffsetSign = 1;\n tzOffsetHours = 0;\n tzOffsetMinutes = 0;\n }\n else {\n tzOffsetSign = matches[8].substring(0, 1) === \"-\" ? -1 : 1;\n tzOffsetHours = +matches[8].substring(1, 3);\n tzOffsetMinutes = +matches[8].substring(4, 6);\n }\n const tzOffset = tzOffsetSign * (tzOffsetHours * 60 + tzOffsetMinutes) * 60; // seconds\n const date = new Date();\n date.setUTCFullYear(year, month - 1, day);\n date.setUTCHours(hour, minute, second, milliSeconds);\n return new Date(date.getTime() - tzOffset * 1000);\n}\nfunction toRfc3339(date) {\n const year = date.getUTCFullYear();\n const month = padded(date.getUTCMonth() + 1);\n const day = padded(date.getUTCDate());\n const hour = padded(date.getUTCHours());\n const minute = padded(date.getUTCMinutes());\n const second = padded(date.getUTCSeconds());\n const ms = padded(date.getUTCMilliseconds(), 3);\n return `${year}-${month}-${day}T${hour}:${minute}:${second}.${ms}Z`;\n}\n//# sourceMappingURL=rfc3339.js.map"],"x_google_ignoreList":[0],"mappings":";;;;AACA,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,cAAc;AACtB,SAAQ,YAAY;CACpB,MAAM,iBAAiB;CACvB,SAAS,OAAO,SAAS,SAAS,GAAG;AACjC,SAAO,QAAQ,UAAU,CAAC,SAAS,QAAQ,IAAI;;CAEnD,SAAS,YAAY,KAAK;EACtB,MAAM,UAAU,eAAe,KAAK,IAAI;AACxC,MAAI,CAAC,QACD,OAAM,IAAI,MAAM,uCAAuC;EAE3D,MAAM,OAAO,CAAC,QAAQ;EACtB,MAAM,QAAQ,CAAC,QAAQ;EACvB,MAAM,MAAM,CAAC,QAAQ;EACrB,MAAM,OAAO,CAAC,QAAQ;EACtB,MAAM,SAAS,CAAC,QAAQ;EACxB,MAAM,SAAS,CAAC,QAAQ;EAExB,MAAM,eAAe,QAAQ,KAAK,KAAK,MAAM,CAAC,QAAQ,KAAK,IAAK,GAAG;EACnE,IAAI;EACJ,IAAI;EACJ,IAAI;AAEJ,MAAI,QAAQ,OAAO,KAAK;AACpB,kBAAe;AACf,mBAAgB;AAChB,qBAAkB;SAEjB;AACD,kBAAe,QAAQ,GAAG,UAAU,GAAG,EAAE,KAAK,MAAM,KAAK;AACzD,mBAAgB,CAAC,QAAQ,GAAG,UAAU,GAAG,EAAE;AAC3C,qBAAkB,CAAC,QAAQ,GAAG,UAAU,GAAG,EAAE;;EAEjD,MAAM,WAAW,gBAAgB,gBAAgB,KAAK,mBAAmB;EACzE,MAAM,uBAAO,IAAI,MAAM;AACvB,OAAK,eAAe,MAAM,QAAQ,GAAG,IAAI;AACzC,OAAK,YAAY,MAAM,QAAQ,QAAQ,aAAa;AACpD,yBAAO,IAAI,KAAK,KAAK,SAAS,GAAG,WAAW,IAAK;;CAErD,SAAS,UAAU,MAAM;AAQrB,SAAO,GAPM,KAAK,gBAAgB,CAOnB,GAND,OAAO,KAAK,aAAa,GAAG,EAAE,CAMpB,GALZ,OAAO,KAAK,YAAY,CAAC,CAKN,GAJlB,OAAO,KAAK,aAAa,CAAC,CAIA,GAHxB,OAAO,KAAK,eAAe,CAAC,CAGM,GAFlC,OAAO,KAAK,eAAe,CAAC,CAEgB,GADhD,OAAO,KAAK,oBAAoB,EAAE,EAAE,CACkB"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/@cosmjs+encoding@0.36.0/node_modules/@cosmjs/encoding/build/rfc3339.js
|
|
4
|
+
var require_rfc3339 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@cosmjs+encoding@0.36.0/node_modules/@cosmjs/encoding/build/rfc3339.js": ((exports) => {
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.fromRfc3339 = fromRfc3339;
|
|
7
|
+
exports.toRfc3339 = toRfc3339;
|
|
8
|
+
const rfc3339Matcher = /^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(\.\d{1,9})?((?:[+-]\d{2}:\d{2})|Z)$/;
|
|
9
|
+
function padded(integer, length = 2) {
|
|
10
|
+
return integer.toString().padStart(length, "0");
|
|
11
|
+
}
|
|
12
|
+
function fromRfc3339(str) {
|
|
13
|
+
const matches = rfc3339Matcher.exec(str);
|
|
14
|
+
if (!matches) throw new Error("Date string is not in RFC3339 format");
|
|
15
|
+
const year = +matches[1];
|
|
16
|
+
const month = +matches[2];
|
|
17
|
+
const day = +matches[3];
|
|
18
|
+
const hour = +matches[4];
|
|
19
|
+
const minute = +matches[5];
|
|
20
|
+
const second = +matches[6];
|
|
21
|
+
const milliSeconds = matches[7] ? Math.floor(+matches[7] * 1e3) : 0;
|
|
22
|
+
let tzOffsetSign;
|
|
23
|
+
let tzOffsetHours;
|
|
24
|
+
let tzOffsetMinutes;
|
|
25
|
+
if (matches[8] === "Z") {
|
|
26
|
+
tzOffsetSign = 1;
|
|
27
|
+
tzOffsetHours = 0;
|
|
28
|
+
tzOffsetMinutes = 0;
|
|
29
|
+
} else {
|
|
30
|
+
tzOffsetSign = matches[8].substring(0, 1) === "-" ? -1 : 1;
|
|
31
|
+
tzOffsetHours = +matches[8].substring(1, 3);
|
|
32
|
+
tzOffsetMinutes = +matches[8].substring(4, 6);
|
|
33
|
+
}
|
|
34
|
+
const tzOffset = tzOffsetSign * (tzOffsetHours * 60 + tzOffsetMinutes) * 60;
|
|
35
|
+
const date = /* @__PURE__ */ new Date();
|
|
36
|
+
date.setUTCFullYear(year, month - 1, day);
|
|
37
|
+
date.setUTCHours(hour, minute, second, milliSeconds);
|
|
38
|
+
return /* @__PURE__ */ new Date(date.getTime() - tzOffset * 1e3);
|
|
39
|
+
}
|
|
40
|
+
function toRfc3339(date) {
|
|
41
|
+
return `${date.getUTCFullYear()}-${padded(date.getUTCMonth() + 1)}-${padded(date.getUTCDate())}T${padded(date.getUTCHours())}:${padded(date.getUTCMinutes())}:${padded(date.getUTCSeconds())}.${padded(date.getUTCMilliseconds(), 3)}Z`;
|
|
42
|
+
}
|
|
43
|
+
}) });
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
export default require_rfc3339();
|
|
47
|
+
|
|
48
|
+
export { require_rfc3339 };
|
|
49
|
+
//# sourceMappingURL=rfc3339.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rfc3339.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@cosmjs+encoding@0.36.0/node_modules/@cosmjs/encoding/build/rfc3339.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromRfc3339 = fromRfc3339;\nexports.toRfc3339 = toRfc3339;\nconst rfc3339Matcher = /^(\\d{4})-(\\d{2})-(\\d{2})[T ](\\d{2}):(\\d{2}):(\\d{2})(\\.\\d{1,9})?((?:[+-]\\d{2}:\\d{2})|Z)$/;\nfunction padded(integer, length = 2) {\n return integer.toString().padStart(length, \"0\");\n}\nfunction fromRfc3339(str) {\n const matches = rfc3339Matcher.exec(str);\n if (!matches) {\n throw new Error(\"Date string is not in RFC3339 format\");\n }\n const year = +matches[1];\n const month = +matches[2];\n const day = +matches[3];\n const hour = +matches[4];\n const minute = +matches[5];\n const second = +matches[6];\n // fractional seconds match either undefined or a string like \".1\", \".123456789\"\n const milliSeconds = matches[7] ? Math.floor(+matches[7] * 1000) : 0;\n let tzOffsetSign;\n let tzOffsetHours;\n let tzOffsetMinutes;\n // if timezone is undefined, it must be Z or nothing (otherwise the group would have captured).\n if (matches[8] === \"Z\") {\n tzOffsetSign = 1;\n tzOffsetHours = 0;\n tzOffsetMinutes = 0;\n }\n else {\n tzOffsetSign = matches[8].substring(0, 1) === \"-\" ? -1 : 1;\n tzOffsetHours = +matches[8].substring(1, 3);\n tzOffsetMinutes = +matches[8].substring(4, 6);\n }\n const tzOffset = tzOffsetSign * (tzOffsetHours * 60 + tzOffsetMinutes) * 60; // seconds\n const date = new Date();\n date.setUTCFullYear(year, month - 1, day);\n date.setUTCHours(hour, minute, second, milliSeconds);\n return new Date(date.getTime() - tzOffset * 1000);\n}\nfunction toRfc3339(date) {\n const year = date.getUTCFullYear();\n const month = padded(date.getUTCMonth() + 1);\n const day = padded(date.getUTCDate());\n const hour = padded(date.getUTCHours());\n const minute = padded(date.getUTCMinutes());\n const second = padded(date.getUTCSeconds());\n const ms = padded(date.getUTCMilliseconds(), 3);\n return `${year}-${month}-${day}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CAOnB,GAND,OAAO,KAAK,aAAa,GAAG,EAAE,CAMpB,GALZ,OAAO,KAAK,YAAY,CAAC,CAKN,GAJlB,OAAO,KAAK,aAAa,CAAC,CAIA,GAHxB,OAAO,KAAK,eAAe,CAAC,CAGM,GAFlC,OAAO,KAAK,eAAe,CAAC,CAEgB,GADhD,OAAO,KAAK,oBAAoB,EAAE,EAAE,CACkB"}
|
package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/utf8.cjs
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/@cosmjs+encoding@0.36.0/node_modules/@cosmjs/encoding/build/utf8.js
|
|
4
|
+
var require_utf8 = /* @__PURE__ */ require_rolldown_runtime.__commonJS({ "../../node_modules/.pnpm/@cosmjs+encoding@0.36.0/node_modules/@cosmjs/encoding/build/utf8.js": ((exports) => {
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.toUtf8 = toUtf8;
|
|
7
|
+
exports.fromUtf8 = fromUtf8;
|
|
8
|
+
function toUtf8(str) {
|
|
9
|
+
return new TextEncoder().encode(str);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Takes UTF-8 data and decodes it to a string.
|
|
13
|
+
*
|
|
14
|
+
* In lossy mode, the [REPLACEMENT CHARACTER](https://en.wikipedia.org/wiki/Specials_(Unicode_block))
|
|
15
|
+
* is used to substitute invalid encodings.
|
|
16
|
+
* By default lossy mode is off and invalid data will lead to exceptions.
|
|
17
|
+
*/
|
|
18
|
+
function fromUtf8(data, lossy = false) {
|
|
19
|
+
const fatal = !lossy;
|
|
20
|
+
return new TextDecoder("utf-8", { fatal }).decode(data);
|
|
21
|
+
}
|
|
22
|
+
}) });
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
Object.defineProperty(exports, 'default', {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return require_utf8();
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=utf8.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utf8.cjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@cosmjs+encoding@0.36.0/node_modules/@cosmjs/encoding/build/utf8.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toUtf8 = toUtf8;\nexports.fromUtf8 = fromUtf8;\nfunction toUtf8(str) {\n return new TextEncoder().encode(str);\n}\n/**\n * Takes UTF-8 data and decodes it to a string.\n *\n * In lossy mode, the [REPLACEMENT CHARACTER](https://en.wikipedia.org/wiki/Specials_(Unicode_block))\n * is used to substitute invalid encodings.\n * By default lossy mode is off and invalid data will lead to exceptions.\n */\nfunction fromUtf8(data, lossy = false) {\n const fatal = !lossy;\n return new TextDecoder(\"utf-8\", { fatal }).decode(data);\n}\n//# sourceMappingURL=utf8.js.map"],"x_google_ignoreList":[0],"mappings":";;;;AACA,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,SAAS;AACjB,SAAQ,WAAW;CACnB,SAAS,OAAO,KAAK;AACjB,SAAO,IAAI,aAAa,CAAC,OAAO,IAAI;;;;;;;;;CASxC,SAAS,SAAS,MAAM,QAAQ,OAAO;EACnC,MAAM,QAAQ,CAAC;AACf,SAAO,IAAI,YAAY,SAAS,EAAE,OAAO,CAAC,CAAC,OAAO,KAAK"}
|
package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/utf8.mjs
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/@cosmjs+encoding@0.36.0/node_modules/@cosmjs/encoding/build/utf8.js
|
|
4
|
+
var require_utf8 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@cosmjs+encoding@0.36.0/node_modules/@cosmjs/encoding/build/utf8.js": ((exports) => {
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.toUtf8 = toUtf8;
|
|
7
|
+
exports.fromUtf8 = fromUtf8;
|
|
8
|
+
function toUtf8(str) {
|
|
9
|
+
return new TextEncoder().encode(str);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Takes UTF-8 data and decodes it to a string.
|
|
13
|
+
*
|
|
14
|
+
* In lossy mode, the [REPLACEMENT CHARACTER](https://en.wikipedia.org/wiki/Specials_(Unicode_block))
|
|
15
|
+
* is used to substitute invalid encodings.
|
|
16
|
+
* By default lossy mode is off and invalid data will lead to exceptions.
|
|
17
|
+
*/
|
|
18
|
+
function fromUtf8(data, lossy = false) {
|
|
19
|
+
const fatal = !lossy;
|
|
20
|
+
return new TextDecoder("utf-8", { fatal }).decode(data);
|
|
21
|
+
}
|
|
22
|
+
}) });
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export default require_utf8();
|
|
26
|
+
|
|
27
|
+
export { require_utf8 };
|
|
28
|
+
//# sourceMappingURL=utf8.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utf8.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@cosmjs+encoding@0.36.0/node_modules/@cosmjs/encoding/build/utf8.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toUtf8 = toUtf8;\nexports.fromUtf8 = fromUtf8;\nfunction toUtf8(str) {\n return new TextEncoder().encode(str);\n}\n/**\n * Takes UTF-8 data and decodes it to a string.\n *\n * In lossy mode, the [REPLACEMENT CHARACTER](https://en.wikipedia.org/wiki/Specials_(Unicode_block))\n * is used to substitute invalid encodings.\n * By default lossy mode is off and invalid data will lead to exceptions.\n */\nfunction fromUtf8(data, lossy = false) {\n const fatal = !lossy;\n return new TextDecoder(\"utf-8\", { fatal }).decode(data);\n}\n//# sourceMappingURL=utf8.js.map"],"x_google_ignoreList":[0],"mappings":";;;;AACA,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,SAAS;AACjB,SAAQ,WAAW;CACnB,SAAS,OAAO,KAAK;AACjB,SAAO,IAAI,aAAa,CAAC,OAAO,IAAI;;;;;;;;;CASxC,SAAS,SAAS,MAAM,QAAQ,OAAO;EACnC,MAAM,QAAQ,CAAC;AACf,SAAO,IAAI,YAAY,SAAS,EAAE,OAAO,CAAC,CAAC,OAAO,KAAK"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js
|
|
4
|
+
var require_base64_js = /* @__PURE__ */ require_rolldown_runtime.__commonJS({ "../../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js": ((exports) => {
|
|
5
|
+
exports.byteLength = byteLength;
|
|
6
|
+
exports.toByteArray = toByteArray;
|
|
7
|
+
exports.fromByteArray = fromByteArray;
|
|
8
|
+
var lookup = [];
|
|
9
|
+
var revLookup = [];
|
|
10
|
+
var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
|
|
11
|
+
var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
12
|
+
for (var i = 0, len = code.length; i < len; ++i) {
|
|
13
|
+
lookup[i] = code[i];
|
|
14
|
+
revLookup[code.charCodeAt(i)] = i;
|
|
15
|
+
}
|
|
16
|
+
revLookup["-".charCodeAt(0)] = 62;
|
|
17
|
+
revLookup["_".charCodeAt(0)] = 63;
|
|
18
|
+
function getLens(b64) {
|
|
19
|
+
var len$1 = b64.length;
|
|
20
|
+
if (len$1 % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4");
|
|
21
|
+
var validLen = b64.indexOf("=");
|
|
22
|
+
if (validLen === -1) validLen = len$1;
|
|
23
|
+
var placeHoldersLen = validLen === len$1 ? 0 : 4 - validLen % 4;
|
|
24
|
+
return [validLen, placeHoldersLen];
|
|
25
|
+
}
|
|
26
|
+
function byteLength(b64) {
|
|
27
|
+
var lens = getLens(b64);
|
|
28
|
+
var validLen = lens[0];
|
|
29
|
+
var placeHoldersLen = lens[1];
|
|
30
|
+
return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
|
|
31
|
+
}
|
|
32
|
+
function _byteLength(b64, validLen, placeHoldersLen) {
|
|
33
|
+
return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
|
|
34
|
+
}
|
|
35
|
+
function toByteArray(b64) {
|
|
36
|
+
var tmp;
|
|
37
|
+
var lens = getLens(b64);
|
|
38
|
+
var validLen = lens[0];
|
|
39
|
+
var placeHoldersLen = lens[1];
|
|
40
|
+
var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));
|
|
41
|
+
var curByte = 0;
|
|
42
|
+
var len$1 = placeHoldersLen > 0 ? validLen - 4 : validLen;
|
|
43
|
+
var i$1;
|
|
44
|
+
for (i$1 = 0; i$1 < len$1; i$1 += 4) {
|
|
45
|
+
tmp = revLookup[b64.charCodeAt(i$1)] << 18 | revLookup[b64.charCodeAt(i$1 + 1)] << 12 | revLookup[b64.charCodeAt(i$1 + 2)] << 6 | revLookup[b64.charCodeAt(i$1 + 3)];
|
|
46
|
+
arr[curByte++] = tmp >> 16 & 255;
|
|
47
|
+
arr[curByte++] = tmp >> 8 & 255;
|
|
48
|
+
arr[curByte++] = tmp & 255;
|
|
49
|
+
}
|
|
50
|
+
if (placeHoldersLen === 2) {
|
|
51
|
+
tmp = revLookup[b64.charCodeAt(i$1)] << 2 | revLookup[b64.charCodeAt(i$1 + 1)] >> 4;
|
|
52
|
+
arr[curByte++] = tmp & 255;
|
|
53
|
+
}
|
|
54
|
+
if (placeHoldersLen === 1) {
|
|
55
|
+
tmp = revLookup[b64.charCodeAt(i$1)] << 10 | revLookup[b64.charCodeAt(i$1 + 1)] << 4 | revLookup[b64.charCodeAt(i$1 + 2)] >> 2;
|
|
56
|
+
arr[curByte++] = tmp >> 8 & 255;
|
|
57
|
+
arr[curByte++] = tmp & 255;
|
|
58
|
+
}
|
|
59
|
+
return arr;
|
|
60
|
+
}
|
|
61
|
+
function tripletToBase64(num) {
|
|
62
|
+
return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63];
|
|
63
|
+
}
|
|
64
|
+
function encodeChunk(uint8, start, end) {
|
|
65
|
+
var tmp;
|
|
66
|
+
var output = [];
|
|
67
|
+
for (var i$1 = start; i$1 < end; i$1 += 3) {
|
|
68
|
+
tmp = (uint8[i$1] << 16 & 16711680) + (uint8[i$1 + 1] << 8 & 65280) + (uint8[i$1 + 2] & 255);
|
|
69
|
+
output.push(tripletToBase64(tmp));
|
|
70
|
+
}
|
|
71
|
+
return output.join("");
|
|
72
|
+
}
|
|
73
|
+
function fromByteArray(uint8) {
|
|
74
|
+
var tmp;
|
|
75
|
+
var len$1 = uint8.length;
|
|
76
|
+
var extraBytes = len$1 % 3;
|
|
77
|
+
var parts = [];
|
|
78
|
+
var maxChunkLength = 16383;
|
|
79
|
+
for (var i$1 = 0, len2 = len$1 - extraBytes; i$1 < len2; i$1 += maxChunkLength) parts.push(encodeChunk(uint8, i$1, i$1 + maxChunkLength > len2 ? len2 : i$1 + maxChunkLength));
|
|
80
|
+
if (extraBytes === 1) {
|
|
81
|
+
tmp = uint8[len$1 - 1];
|
|
82
|
+
parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "==");
|
|
83
|
+
} else if (extraBytes === 2) {
|
|
84
|
+
tmp = (uint8[len$1 - 2] << 8) + uint8[len$1 - 1];
|
|
85
|
+
parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "=");
|
|
86
|
+
}
|
|
87
|
+
return parts.join("");
|
|
88
|
+
}
|
|
89
|
+
}) });
|
|
90
|
+
|
|
91
|
+
//#endregion
|
|
92
|
+
Object.defineProperty(exports, 'default', {
|
|
93
|
+
enumerable: true,
|
|
94
|
+
get: function () {
|
|
95
|
+
return require_base64_js();
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["len","i"],"sources":["../../../../../../../../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js"],"sourcesContent":["'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;AAEA,SAAQ,aAAa;AACrB,SAAQ,cAAc;AACtB,SAAQ,gBAAgB;CAExB,IAAI,SAAS,EAAE;CACf,IAAI,YAAY,EAAE;CAClB,IAAI,MAAM,OAAO,eAAe,cAAc,aAAa;CAE3D,IAAI,OAAO;AACX,MAAK,IAAI,IAAI,GAAG,MAAM,KAAK,QAAQ,IAAI,KAAK,EAAE,GAAG;AAC/C,SAAO,KAAK,KAAK;AACjB,YAAU,KAAK,WAAW,EAAE,IAAI;;AAKlC,WAAU,IAAI,WAAW,EAAE,IAAI;AAC/B,WAAU,IAAI,WAAW,EAAE,IAAI;CAE/B,SAAS,QAAS,KAAK;EACrB,IAAIA,QAAM,IAAI;AAEd,MAAIA,QAAM,IAAI,EACZ,OAAM,IAAI,MAAM,iDAAiD;EAKnE,IAAI,WAAW,IAAI,QAAQ,IAAI;AAC/B,MAAI,aAAa,GAAI,YAAWA;EAEhC,IAAI,kBAAkB,aAAaA,QAC/B,IACA,IAAK,WAAW;AAEpB,SAAO,CAAC,UAAU,gBAAgB;;CAIpC,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,MACnB,OAAO,OAAO,IAAI,MAClB,OAAO,MAAM;;CAGjB,SAAS,YAAa,OAAO,OAAO,KAAK;EACvC,IAAI;EACJ,IAAI,SAAS,EAAE;AACf,OAAK,IAAIA,MAAI,OAAOA,MAAI,KAAK,OAAK,GAAG;AACnC,UACI,MAAMA,QAAM,KAAM,aAClB,MAAMA,MAAI,MAAM,IAAK,UACtB,MAAMA,MAAI,KAAK;AAClB,UAAO,KAAK,gBAAgB,IAAI,CAAC;;AAEnC,SAAO,OAAO,KAAK,GAAG;;CAGxB,SAAS,cAAe,OAAO;EAC7B,IAAI;EACJ,IAAID,QAAM,MAAM;EAChB,IAAI,aAAaA,QAAM;EACvB,IAAI,QAAQ,EAAE;EACd,IAAI,iBAAiB;AAGrB,OAAK,IAAIC,MAAI,GAAG,OAAOD,QAAM,YAAYC,MAAI,MAAM,OAAK,eACtD,OAAM,KAAK,YAAY,OAAOA,KAAIA,MAAI,iBAAkB,OAAO,OAAQA,MAAI,eAAgB,CAAC;AAI9F,MAAI,eAAe,GAAG;AACpB,SAAM,MAAMD,QAAM;AAClB,SAAM,KACJ,OAAO,OAAO,KACd,OAAQ,OAAO,IAAK,MACpB,KACD;aACQ,eAAe,GAAG;AAC3B,UAAO,MAAMA,QAAM,MAAM,KAAK,MAAMA,QAAM;AAC1C,SAAM,KACJ,OAAO,OAAO,MACd,OAAQ,OAAO,IAAK,MACpB,OAAQ,OAAO,IAAK,MACpB,IACD;;AAGH,SAAO,MAAM,KAAK,GAAG"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { __commonJS } from "../../../../../_virtual/rolldown_runtime.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js
|
|
4
|
+
var require_base64_js = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js": ((exports) => {
|
|
5
|
+
exports.byteLength = byteLength;
|
|
6
|
+
exports.toByteArray = toByteArray;
|
|
7
|
+
exports.fromByteArray = fromByteArray;
|
|
8
|
+
var lookup = [];
|
|
9
|
+
var revLookup = [];
|
|
10
|
+
var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
|
|
11
|
+
var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
12
|
+
for (var i = 0, len = code.length; i < len; ++i) {
|
|
13
|
+
lookup[i] = code[i];
|
|
14
|
+
revLookup[code.charCodeAt(i)] = i;
|
|
15
|
+
}
|
|
16
|
+
revLookup["-".charCodeAt(0)] = 62;
|
|
17
|
+
revLookup["_".charCodeAt(0)] = 63;
|
|
18
|
+
function getLens(b64) {
|
|
19
|
+
var len$1 = b64.length;
|
|
20
|
+
if (len$1 % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4");
|
|
21
|
+
var validLen = b64.indexOf("=");
|
|
22
|
+
if (validLen === -1) validLen = len$1;
|
|
23
|
+
var placeHoldersLen = validLen === len$1 ? 0 : 4 - validLen % 4;
|
|
24
|
+
return [validLen, placeHoldersLen];
|
|
25
|
+
}
|
|
26
|
+
function byteLength(b64) {
|
|
27
|
+
var lens = getLens(b64);
|
|
28
|
+
var validLen = lens[0];
|
|
29
|
+
var placeHoldersLen = lens[1];
|
|
30
|
+
return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
|
|
31
|
+
}
|
|
32
|
+
function _byteLength(b64, validLen, placeHoldersLen) {
|
|
33
|
+
return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
|
|
34
|
+
}
|
|
35
|
+
function toByteArray(b64) {
|
|
36
|
+
var tmp;
|
|
37
|
+
var lens = getLens(b64);
|
|
38
|
+
var validLen = lens[0];
|
|
39
|
+
var placeHoldersLen = lens[1];
|
|
40
|
+
var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));
|
|
41
|
+
var curByte = 0;
|
|
42
|
+
var len$1 = placeHoldersLen > 0 ? validLen - 4 : validLen;
|
|
43
|
+
var i$1;
|
|
44
|
+
for (i$1 = 0; i$1 < len$1; i$1 += 4) {
|
|
45
|
+
tmp = revLookup[b64.charCodeAt(i$1)] << 18 | revLookup[b64.charCodeAt(i$1 + 1)] << 12 | revLookup[b64.charCodeAt(i$1 + 2)] << 6 | revLookup[b64.charCodeAt(i$1 + 3)];
|
|
46
|
+
arr[curByte++] = tmp >> 16 & 255;
|
|
47
|
+
arr[curByte++] = tmp >> 8 & 255;
|
|
48
|
+
arr[curByte++] = tmp & 255;
|
|
49
|
+
}
|
|
50
|
+
if (placeHoldersLen === 2) {
|
|
51
|
+
tmp = revLookup[b64.charCodeAt(i$1)] << 2 | revLookup[b64.charCodeAt(i$1 + 1)] >> 4;
|
|
52
|
+
arr[curByte++] = tmp & 255;
|
|
53
|
+
}
|
|
54
|
+
if (placeHoldersLen === 1) {
|
|
55
|
+
tmp = revLookup[b64.charCodeAt(i$1)] << 10 | revLookup[b64.charCodeAt(i$1 + 1)] << 4 | revLookup[b64.charCodeAt(i$1 + 2)] >> 2;
|
|
56
|
+
arr[curByte++] = tmp >> 8 & 255;
|
|
57
|
+
arr[curByte++] = tmp & 255;
|
|
58
|
+
}
|
|
59
|
+
return arr;
|
|
60
|
+
}
|
|
61
|
+
function tripletToBase64(num) {
|
|
62
|
+
return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63];
|
|
63
|
+
}
|
|
64
|
+
function encodeChunk(uint8, start, end) {
|
|
65
|
+
var tmp;
|
|
66
|
+
var output = [];
|
|
67
|
+
for (var i$1 = start; i$1 < end; i$1 += 3) {
|
|
68
|
+
tmp = (uint8[i$1] << 16 & 16711680) + (uint8[i$1 + 1] << 8 & 65280) + (uint8[i$1 + 2] & 255);
|
|
69
|
+
output.push(tripletToBase64(tmp));
|
|
70
|
+
}
|
|
71
|
+
return output.join("");
|
|
72
|
+
}
|
|
73
|
+
function fromByteArray(uint8) {
|
|
74
|
+
var tmp;
|
|
75
|
+
var len$1 = uint8.length;
|
|
76
|
+
var extraBytes = len$1 % 3;
|
|
77
|
+
var parts = [];
|
|
78
|
+
var maxChunkLength = 16383;
|
|
79
|
+
for (var i$1 = 0, len2 = len$1 - extraBytes; i$1 < len2; i$1 += maxChunkLength) parts.push(encodeChunk(uint8, i$1, i$1 + maxChunkLength > len2 ? len2 : i$1 + maxChunkLength));
|
|
80
|
+
if (extraBytes === 1) {
|
|
81
|
+
tmp = uint8[len$1 - 1];
|
|
82
|
+
parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "==");
|
|
83
|
+
} else if (extraBytes === 2) {
|
|
84
|
+
tmp = (uint8[len$1 - 2] << 8) + uint8[len$1 - 1];
|
|
85
|
+
parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "=");
|
|
86
|
+
}
|
|
87
|
+
return parts.join("");
|
|
88
|
+
}
|
|
89
|
+
}) });
|
|
90
|
+
|
|
91
|
+
//#endregion
|
|
92
|
+
export default require_base64_js();
|
|
93
|
+
|
|
94
|
+
export { require_base64_js };
|
|
95
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["len","i"],"sources":["../../../../../../../../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js"],"sourcesContent":["'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;AAEA,SAAQ,aAAa;AACrB,SAAQ,cAAc;AACtB,SAAQ,gBAAgB;CAExB,IAAI,SAAS,EAAE;CACf,IAAI,YAAY,EAAE;CAClB,IAAI,MAAM,OAAO,eAAe,cAAc,aAAa;CAE3D,IAAI,OAAO;AACX,MAAK,IAAI,IAAI,GAAG,MAAM,KAAK,QAAQ,IAAI,KAAK,EAAE,GAAG;AAC/C,SAAO,KAAK,KA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OAAQ,OAAO,IAAK,MACpB,OAAQ,OAAO,IAAK,MACpB,IACD;;AAGH,SAAO,MAAM,KAAK,GAAG"}
|
|
@@ -7,8 +7,21 @@
|
|
|
7
7
|
* - size() is always at minimum 1 item which is the promise for the next enqueued item
|
|
8
8
|
*/
|
|
9
9
|
var PromiseQueue = class {
|
|
10
|
+
/** Optional error handler for enqueue failures */
|
|
11
|
+
errorHandler;
|
|
12
|
+
/** Array of promises representing queued items */
|
|
13
|
+
items;
|
|
14
|
+
/** Function to resolve the next enqueued promise */
|
|
15
|
+
enqueuer;
|
|
16
|
+
/** Function to resolve the continue promise when space is available */
|
|
17
|
+
batcher;
|
|
18
|
+
/** Flag indicating if the queue is synced with the data source */
|
|
19
|
+
synced = false;
|
|
20
|
+
/** Maximum number of items to keep in the queue */
|
|
21
|
+
batchSize;
|
|
22
|
+
/** Promise that resolves when it's safe to enqueue more items */
|
|
23
|
+
continuePromise;
|
|
10
24
|
constructor(batchSize, errorHandler) {
|
|
11
|
-
this.synced = false;
|
|
12
25
|
const nextVal = new Promise((resolve, _reject) => {
|
|
13
26
|
this.enqueuer = resolve;
|
|
14
27
|
});
|
|
@@ -69,11 +82,27 @@ var PromiseQueue = class {
|
|
|
69
82
|
* Used by the indexer for managing block processing queues
|
|
70
83
|
*/
|
|
71
84
|
var CircularBuffer = class {
|
|
85
|
+
/** Optional error handler for enqueue failures */
|
|
86
|
+
errorHandler;
|
|
87
|
+
/** Fixed-size array of promises representing buffered items */
|
|
88
|
+
items;
|
|
89
|
+
/** Function to resolve the next enqueued promise */
|
|
90
|
+
enqueuer;
|
|
91
|
+
/** Current number of items in the buffer */
|
|
92
|
+
count = 0;
|
|
93
|
+
/** Index of the next item to dequeue */
|
|
94
|
+
next = 0;
|
|
95
|
+
/** Function to resolve the continue promise when space is available */
|
|
96
|
+
batcher;
|
|
97
|
+
/** Flag indicating if the buffer is synced with the data source */
|
|
98
|
+
synced = false;
|
|
99
|
+
/** Maximum number of items the buffer can hold */
|
|
100
|
+
batchSize;
|
|
101
|
+
/** Promise that resolves when it's safe to enqueue more items */
|
|
102
|
+
continuePromise;
|
|
103
|
+
/** Index of the next available slot for enqueueing */
|
|
104
|
+
nextAvail = 0;
|
|
72
105
|
constructor(batchSize, errorHandler) {
|
|
73
|
-
this.count = 0;
|
|
74
|
-
this.next = 0;
|
|
75
|
-
this.synced = false;
|
|
76
|
-
this.nextAvail = 0;
|
|
77
106
|
if (batchSize <= 1) throw new Error("Batch size must be greater than 1");
|
|
78
107
|
const nextVal = new Promise((resolve, _reject) => {
|
|
79
108
|
this.enqueuer = resolve;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/promise-queue/index.ts"],"sourcesContent":["/**\n * Implements an \"infinite\" FIFO queue of fixed size using promises\n * - await `continue()` before enqueing items to ensure fixed size (resolves when space available)\n * - await `dequeue()` to pop an item (resolves when next item is available)\n * - size() is always at minimum 1 item which is the promise for the next enqueued item\n */\nexport class PromiseQueue<T> {\n /** Optional error handler for enqueue failures */\n private errorHandler?: (error: unknown) => void;\n /** Array of promises representing queued items */\n private items: Array<Promise<T>>;\n\n /** Function to resolve the next enqueued promise */\n private enqueuer!: (val: T | PromiseLike<T>) => void;\n\n /** Function to resolve the continue promise when space is available */\n private batcher!: (val: boolean) => void;\n\n /** Flag indicating if the queue is synced with the data source */\n public synced = false;\n\n /** Maximum number of items to keep in the queue */\n private batchSize: number;\n\n /** Promise that resolves when it's safe to enqueue more items */\n private continuePromise: Promise<boolean>;\n\n constructor(batchSize: number, errorHandler?: (error: unknown) => void) {\n const nextVal = new Promise<T>((resolve, _reject) => {\n this.enqueuer = resolve;\n });\n this.batchSize = batchSize;\n this.errorHandler = errorHandler;\n this.continuePromise = new Promise<boolean>((resolve, _reject) => {\n this.batcher = resolve;\n });\n this.batcher(true);\n this.items = [nextVal];\n }\n\n enqueue(item: T | PromiseLike<T>) {\n try {\n this.enqueuer(item);\n const nextVal = new Promise<T>((resolve, _reject) => {\n this.enqueuer = resolve;\n });\n this.items.push(nextVal);\n if (this.size() > this.batchSize) {\n this.continuePromise = new Promise<boolean>((resolve, _reject) => {\n this.batcher = resolve;\n });\n }\n }\n catch (e) {\n if (this.errorHandler) {\n this.errorHandler(e);\n }\n // If no error handler provided, silently ignore (existing behavior for backward compatibility)\n }\n }\n\n clear() {\n const nextVal = new Promise<T>((resolve, _reject) => {\n this.enqueuer = resolve;\n });\n this.continuePromise = new Promise<boolean>((resolve, _reject) => {\n this.batcher = resolve;\n });\n this.batcher(true);\n this.items = [nextVal];\n }\n\n dequeue() {\n const item = this.items.shift();\n if (this.size() <= this.batchSize) {\n this.batcher(true);\n }\n\n return item as Promise<T>;\n }\n\n continue() {\n return this.continuePromise;\n }\n\n setSynced() {\n this.synced = true;\n }\n\n isEmpty() {\n if (this.items.length == 0) {\n return true;\n }\n else {\n return false;\n }\n }\n\n size() {\n return this.items.length;\n }\n}\n\n/**\n * Circular buffer implementation using promises for efficient memory usage\n * Reuses array slots in a circular fashion to maintain constant memory footprint\n * Used by the indexer for managing block processing queues\n */\nexport class CircularBuffer<T> {\n /** Optional error handler for enqueue failures */\n private errorHandler?: (error: unknown) => void;\n\n /** Fixed-size array of promises representing buffered items */\n private items: Array<Promise<T>>;\n\n /** Function to resolve the next enqueued promise */\n private enqueuer!: (val: T | PromiseLike<T>) => void;\n\n /** Current number of items in the buffer */\n private count: number = 0;\n\n /** Index of the next item to dequeue */\n private next: number = 0;\n\n /** Function to resolve the continue promise when space is available */\n private batcher!: (val: boolean) => void;\n\n /** Flag indicating if the buffer is synced with the data source */\n public synced = false;\n\n /** Maximum number of items the buffer can hold */\n private batchSize: number;\n\n /** Promise that resolves when it's safe to enqueue more items */\n private continuePromise: Promise<boolean>;\n\n /** Index of the next available slot for enqueueing */\n private nextAvail: number = 0;\n\n constructor(batchSize: number, errorHandler?: (error: unknown) => void) {\n if (batchSize <= 1) {\n throw new Error(\"Batch size must be greater than 1\");\n }\n const nextVal = new Promise<T>((resolve, _reject) => {\n this.enqueuer = resolve;\n });\n this.items = new Array<Promise<T>>(batchSize);\n this.batchSize = batchSize;\n this.errorHandler = errorHandler;\n this.items[this.nextAvail] = nextVal;\n this.count = 1;\n this.nextAvail++;\n if (this.nextAvail >= this.batchSize) {\n this.nextAvail = 0;\n }\n\n this.continuePromise = new Promise<boolean>((resolve, _reject) => {\n this.batcher = resolve;\n });\n this.batcher(true);\n }\n\n enqueue(item: T | PromiseLike<T>) {\n try {\n this.enqueuer(item);\n const nextVal = new Promise<T>((resolve, _reject) => {\n this.enqueuer = resolve;\n });\n this.items[this.nextAvail] = nextVal;\n this.count++;\n this.nextAvail++;\n if (this.nextAvail >= this.batchSize) {\n this.nextAvail = 0;\n }\n\n if (this.nextAvail == this.next) {\n this.continuePromise = new Promise<boolean>((resolve, _reject) => {\n this.batcher = resolve;\n });\n }\n }\n catch (e) {\n if (this.errorHandler) {\n this.errorHandler(e);\n }\n // If no error handler provided, silently ignore (existing behavior for backward compatibility)\n }\n }\n\n dequeue() {\n const item = this.items[this.next];\n this.next++;\n this.count--;\n if (this.next >= this.batchSize) {\n this.next = 0;\n }\n if (this.count <= this.batchSize) {\n this.batcher(true);\n }\n return item;\n }\n\n clear() {\n this.next = 0;\n this.nextAvail = 0;\n const nextVal = new Promise<T>((resolve, _reject) => {\n this.enqueuer = resolve;\n });\n this.items = new Array<Promise<T>>(this.batchSize);\n this.items[this.nextAvail] = nextVal;\n this.synced = false;\n this.count = 1;\n this.nextAvail++;\n if (this.nextAvail >= this.batchSize) {\n this.nextAvail = 0;\n }\n\n this.continuePromise = new Promise<boolean>((resolve, _reject) => {\n this.batcher = resolve;\n });\n this.batcher(true);\n }\n\n continue() {\n return this.continuePromise;\n }\n\n setSynced() {\n this.synced = true;\n }\n\n isEmpty() {\n if (this.count == 0) {\n return true;\n }\n else {\n return false;\n }\n }\n\n size() {\n return this.count;\n }\n}\n"],"mappings":";;;;;;;;AAMA,IAAa,eAAb,MAA6B;
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/promise-queue/index.ts"],"sourcesContent":["/**\n * Implements an \"infinite\" FIFO queue of fixed size using promises\n * - await `continue()` before enqueing items to ensure fixed size (resolves when space available)\n * - await `dequeue()` to pop an item (resolves when next item is available)\n * - size() is always at minimum 1 item which is the promise for the next enqueued item\n */\nexport class PromiseQueue<T> {\n /** Optional error handler for enqueue failures */\n private errorHandler?: (error: unknown) => void;\n /** Array of promises representing queued items */\n private items: Array<Promise<T>>;\n\n /** Function to resolve the next enqueued promise */\n private enqueuer!: (val: T | PromiseLike<T>) => void;\n\n /** Function to resolve the continue promise when space is available */\n private batcher!: (val: boolean) => void;\n\n /** Flag indicating if the queue is synced with the data source */\n public synced = false;\n\n /** Maximum number of items to keep in the queue */\n private batchSize: number;\n\n /** Promise that resolves when it's safe to enqueue more items */\n private continuePromise: Promise<boolean>;\n\n constructor(batchSize: number, errorHandler?: (error: unknown) => void) {\n const nextVal = new Promise<T>((resolve, _reject) => {\n this.enqueuer = resolve;\n });\n this.batchSize = batchSize;\n this.errorHandler = errorHandler;\n this.continuePromise = new Promise<boolean>((resolve, _reject) => {\n this.batcher = resolve;\n });\n this.batcher(true);\n this.items = [nextVal];\n }\n\n enqueue(item: T | PromiseLike<T>) {\n try {\n this.enqueuer(item);\n const nextVal = new Promise<T>((resolve, _reject) => {\n this.enqueuer = resolve;\n });\n this.items.push(nextVal);\n if (this.size() > this.batchSize) {\n this.continuePromise = new Promise<boolean>((resolve, _reject) => {\n this.batcher = resolve;\n });\n }\n }\n catch (e) {\n if (this.errorHandler) {\n this.errorHandler(e);\n }\n // If no error handler provided, silently ignore (existing behavior for backward compatibility)\n }\n }\n\n clear() {\n const nextVal = new Promise<T>((resolve, _reject) => {\n this.enqueuer = resolve;\n });\n this.continuePromise = new Promise<boolean>((resolve, _reject) => {\n this.batcher = resolve;\n });\n this.batcher(true);\n this.items = [nextVal];\n }\n\n dequeue() {\n const item = this.items.shift();\n if (this.size() <= this.batchSize) {\n this.batcher(true);\n }\n\n return item as Promise<T>;\n }\n\n continue() {\n return this.continuePromise;\n }\n\n setSynced() {\n this.synced = true;\n }\n\n isEmpty() {\n if (this.items.length == 0) {\n return true;\n }\n else {\n return false;\n }\n }\n\n size() {\n return this.items.length;\n }\n}\n\n/**\n * Circular buffer implementation using promises for efficient memory usage\n * Reuses array slots in a circular fashion to maintain constant memory footprint\n * Used by the indexer for managing block processing queues\n */\nexport class CircularBuffer<T> {\n /** Optional error handler for enqueue failures */\n private errorHandler?: (error: unknown) => void;\n\n /** Fixed-size array of promises representing buffered items */\n private items: Array<Promise<T>>;\n\n /** Function to resolve the next enqueued promise */\n private enqueuer!: (val: T | PromiseLike<T>) => void;\n\n /** Current number of items in the buffer */\n private count: number = 0;\n\n /** Index of the next item to dequeue */\n private next: number = 0;\n\n /** Function to resolve the continue promise when space is available */\n private batcher!: (val: boolean) => void;\n\n /** Flag indicating if the buffer is synced with the data source */\n public synced = false;\n\n /** Maximum number of items the buffer can hold */\n private batchSize: number;\n\n /** Promise that resolves when it's safe to enqueue more items */\n private continuePromise: Promise<boolean>;\n\n /** Index of the next available slot for enqueueing */\n private nextAvail: number = 0;\n\n constructor(batchSize: number, errorHandler?: (error: unknown) => void) {\n if (batchSize <= 1) {\n throw new Error(\"Batch size must be greater than 1\");\n }\n const nextVal = new Promise<T>((resolve, _reject) => {\n this.enqueuer = resolve;\n });\n this.items = new Array<Promise<T>>(batchSize);\n this.batchSize = batchSize;\n this.errorHandler = errorHandler;\n this.items[this.nextAvail] = nextVal;\n this.count = 1;\n this.nextAvail++;\n if (this.nextAvail >= this.batchSize) {\n this.nextAvail = 0;\n }\n\n this.continuePromise = new Promise<boolean>((resolve, _reject) => {\n this.batcher = resolve;\n });\n this.batcher(true);\n }\n\n enqueue(item: T | PromiseLike<T>) {\n try {\n this.enqueuer(item);\n const nextVal = new Promise<T>((resolve, _reject) => {\n this.enqueuer = resolve;\n });\n this.items[this.nextAvail] = nextVal;\n this.count++;\n this.nextAvail++;\n if (this.nextAvail >= this.batchSize) {\n this.nextAvail = 0;\n }\n\n if (this.nextAvail == this.next) {\n this.continuePromise = new Promise<boolean>((resolve, _reject) => {\n this.batcher = resolve;\n });\n }\n }\n catch (e) {\n if (this.errorHandler) {\n this.errorHandler(e);\n }\n // If no error handler provided, silently ignore (existing behavior for backward compatibility)\n }\n }\n\n dequeue() {\n const item = this.items[this.next];\n this.next++;\n this.count--;\n if (this.next >= this.batchSize) {\n this.next = 0;\n }\n if (this.count <= this.batchSize) {\n this.batcher(true);\n }\n return item;\n }\n\n clear() {\n this.next = 0;\n this.nextAvail = 0;\n const nextVal = new Promise<T>((resolve, _reject) => {\n this.enqueuer = resolve;\n });\n this.items = new Array<Promise<T>>(this.batchSize);\n this.items[this.nextAvail] = nextVal;\n this.synced = false;\n this.count = 1;\n this.nextAvail++;\n if (this.nextAvail >= this.batchSize) {\n this.nextAvail = 0;\n }\n\n this.continuePromise = new Promise<boolean>((resolve, _reject) => {\n this.batcher = resolve;\n });\n this.batcher(true);\n }\n\n continue() {\n return this.continuePromise;\n }\n\n setSynced() {\n this.synced = true;\n }\n\n isEmpty() {\n if (this.count == 0) {\n return true;\n }\n else {\n return false;\n }\n }\n\n size() {\n return this.count;\n }\n}\n"],"mappings":";;;;;;;;AAMA,IAAa,eAAb,MAA6B;;CAE3B,AAAQ;;CAER,AAAQ;;CAGR,AAAQ;;CAGR,AAAQ;;CAGR,AAAO,SAAS;;CAGhB,AAAQ;;CAGR,AAAQ;CAER,YAAY,WAAmB,cAAyC;EACtE,MAAM,UAAU,IAAI,SAAY,SAAS,YAAY;AACnD,QAAK,WAAW;IAChB;AACF,OAAK,YAAY;AACjB,OAAK,eAAe;AACpB,OAAK,kBAAkB,IAAI,SAAkB,SAAS,YAAY;AAChE,QAAK,UAAU;IACf;AACF,OAAK,QAAQ,KAAK;AAClB,OAAK,QAAQ,CAAC,QAAQ;;CAGxB,QAAQ,MAA0B;AAChC,MAAI;AACF,QAAK,SA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