@versori/run 0.1.0-alpha.11 → 0.1.0-alpha.13

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.
Files changed (167) hide show
  1. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/connect.d.ts +3 -0
  2. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/connect.d.ts.map +1 -0
  3. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/connect.js +28 -0
  4. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.d.ts +35 -0
  5. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.d.ts.map +1 -0
  6. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.js +328 -0
  7. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/mod.d.ts +3 -0
  8. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/mod.d.ts.map +1 -0
  9. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/mod.js +2 -0
  10. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/version.d.ts +2 -0
  11. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/version.d.ts.map +1 -0
  12. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/version.js +2 -0
  13. package/esm/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts +9 -0
  14. package/esm/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts.map +1 -0
  15. package/esm/deps/jsr.io/@std/bytes/1.0.5/_types.js +2 -0
  16. package/esm/deps/jsr.io/@std/bytes/1.0.5/concat.d.ts +21 -0
  17. package/esm/deps/jsr.io/@std/bytes/1.0.5/concat.d.ts.map +1 -0
  18. package/esm/deps/jsr.io/@std/bytes/1.0.5/concat.js +32 -0
  19. package/esm/deps/jsr.io/@std/bytes/1.0.5/copy.d.ts +41 -0
  20. package/esm/deps/jsr.io/@std/bytes/1.0.5/copy.d.ts.map +1 -0
  21. package/esm/deps/jsr.io/@std/bytes/1.0.5/copy.js +50 -0
  22. package/{script/deps/jsr.io/@std/fmt/1.0.6 → esm/deps/jsr.io/@std/fmt/1.0.5}/colors.d.ts.map +1 -1
  23. package/esm/deps/jsr.io/@std/fs/{1.0.16 → 1.0.11}/exists.d.ts.map +1 -1
  24. package/esm/deps/jsr.io/@std/io/0.225.2/_common.d.ts +3 -0
  25. package/esm/deps/jsr.io/@std/io/0.225.2/_common.d.ts.map +1 -0
  26. package/esm/deps/jsr.io/@std/io/0.225.2/_common.js +8 -0
  27. package/esm/deps/jsr.io/@std/io/0.225.2/_constants.d.ts +3 -0
  28. package/esm/deps/jsr.io/@std/io/0.225.2/_constants.d.ts.map +1 -0
  29. package/esm/deps/jsr.io/@std/io/0.225.2/_constants.js +4 -0
  30. package/esm/deps/jsr.io/@std/io/0.225.2/buffer.d.ts +321 -0
  31. package/esm/deps/jsr.io/@std/io/0.225.2/buffer.d.ts.map +1 -0
  32. package/esm/deps/jsr.io/@std/io/0.225.2/buffer.js +488 -0
  33. package/esm/deps/jsr.io/@std/io/0.225.2/copy.d.ts +25 -0
  34. package/esm/deps/jsr.io/@std/io/0.225.2/copy.d.ts.map +1 -0
  35. package/esm/deps/jsr.io/@std/io/0.225.2/copy.js +36 -0
  36. package/esm/deps/jsr.io/@std/io/0.225.2/iterate_reader.d.ts +80 -0
  37. package/esm/deps/jsr.io/@std/io/0.225.2/iterate_reader.d.ts.map +1 -0
  38. package/esm/deps/jsr.io/@std/io/0.225.2/iterate_reader.js +96 -0
  39. package/esm/deps/jsr.io/@std/io/0.225.2/mod.d.ts +25 -0
  40. package/esm/deps/jsr.io/@std/io/0.225.2/mod.d.ts.map +1 -0
  41. package/esm/deps/jsr.io/@std/io/0.225.2/mod.js +25 -0
  42. package/esm/deps/jsr.io/@std/io/0.225.2/read_all.d.ts +42 -0
  43. package/esm/deps/jsr.io/@std/io/0.225.2/read_all.d.ts.map +1 -0
  44. package/esm/deps/jsr.io/@std/io/0.225.2/read_all.js +72 -0
  45. package/esm/deps/jsr.io/@std/io/0.225.2/reader_from_stream_reader.d.ts +20 -0
  46. package/esm/deps/jsr.io/@std/io/0.225.2/reader_from_stream_reader.d.ts.map +1 -0
  47. package/esm/deps/jsr.io/@std/io/0.225.2/reader_from_stream_reader.js +36 -0
  48. package/esm/deps/jsr.io/@std/io/0.225.2/to_readable_stream.d.ts +40 -0
  49. package/esm/deps/jsr.io/@std/io/0.225.2/to_readable_stream.d.ts.map +1 -0
  50. package/esm/deps/jsr.io/@std/io/0.225.2/to_readable_stream.js +54 -0
  51. package/esm/deps/jsr.io/@std/io/0.225.2/to_writable_stream.d.ts +27 -0
  52. package/esm/deps/jsr.io/@std/io/0.225.2/to_writable_stream.d.ts.map +1 -0
  53. package/esm/deps/jsr.io/@std/io/0.225.2/to_writable_stream.js +44 -0
  54. package/esm/deps/jsr.io/@std/log/0.224.14/base_handler.d.ts +21 -0
  55. package/esm/deps/jsr.io/@std/log/0.224.14/base_handler.d.ts.map +1 -1
  56. package/esm/deps/jsr.io/@std/log/0.224.14/console_handler.js +1 -1
  57. package/esm/deps/jsr.io/@std/log/0.224.14/rotating_file_handler.js +1 -1
  58. package/esm/src/context/Context.d.ts +14 -4
  59. package/esm/src/context/Context.d.ts.map +1 -1
  60. package/esm/src/context/Context.js +16 -10
  61. package/esm/src/context/ContextProvider.d.ts +3 -4
  62. package/esm/src/context/ContextProvider.d.ts.map +1 -1
  63. package/esm/src/context/ContextProvider.js +5 -5
  64. package/esm/src/dsl/http/versori/platformapi.d.ts +2 -1
  65. package/esm/src/dsl/http/versori/platformapi.d.ts.map +1 -1
  66. package/esm/src/dsl/http/versori/platformapi.js +12 -1
  67. package/esm/src/dsl/http/versori/roundtripper.d.ts.map +1 -1
  68. package/esm/src/dsl/http/versori/roundtripper.js +32 -35
  69. package/esm/src/dsl/triggers/WebhookTrigger.d.ts +45 -3
  70. package/esm/src/dsl/triggers/WebhookTrigger.d.ts.map +1 -1
  71. package/esm/src/dsl/triggers/WebhookTrigger.js +10 -6
  72. package/esm/src/interpreter/memory/MemoryInterpreter.d.ts +6 -1
  73. package/esm/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
  74. package/esm/src/interpreter/memory/MemoryInterpreter.js +67 -5
  75. package/esm/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
  76. package/esm/src/interpreter/memory/compilers/webhook.js +106 -32
  77. package/esm/src/kv/nats/NatsKeyValueProvider.d.ts +2 -1
  78. package/esm/src/kv/nats/NatsKeyValueProvider.d.ts.map +1 -1
  79. package/esm/src/kv/nats/NatsKeyValueProvider.js +1 -1
  80. package/package.json +2 -1
  81. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/connect.d.ts +3 -0
  82. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/connect.d.ts.map +1 -0
  83. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/connect.js +31 -0
  84. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.d.ts +35 -0
  85. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.d.ts.map +1 -0
  86. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.js +333 -0
  87. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/mod.d.ts +3 -0
  88. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/mod.d.ts.map +1 -0
  89. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/mod.js +20 -0
  90. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/version.d.ts +2 -0
  91. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/version.d.ts.map +1 -0
  92. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/version.js +5 -0
  93. package/script/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts +9 -0
  94. package/script/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts.map +1 -0
  95. package/script/deps/jsr.io/@std/bytes/1.0.5/_types.js +3 -0
  96. package/script/deps/jsr.io/@std/bytes/1.0.5/concat.d.ts +21 -0
  97. package/script/deps/jsr.io/@std/bytes/1.0.5/concat.d.ts.map +1 -0
  98. package/script/deps/jsr.io/@std/bytes/1.0.5/concat.js +35 -0
  99. package/script/deps/jsr.io/@std/bytes/1.0.5/copy.d.ts +41 -0
  100. package/script/deps/jsr.io/@std/bytes/1.0.5/copy.d.ts.map +1 -0
  101. package/script/deps/jsr.io/@std/bytes/1.0.5/copy.js +53 -0
  102. package/{esm/deps/jsr.io/@std/fmt/1.0.6 → script/deps/jsr.io/@std/fmt/1.0.5}/colors.d.ts.map +1 -1
  103. package/script/deps/jsr.io/@std/fs/{1.0.16 → 1.0.11}/exists.d.ts.map +1 -1
  104. package/script/deps/jsr.io/@std/io/0.225.2/_common.d.ts +3 -0
  105. package/script/deps/jsr.io/@std/io/0.225.2/_common.d.ts.map +1 -0
  106. package/script/deps/jsr.io/@std/io/0.225.2/_common.js +11 -0
  107. package/script/deps/jsr.io/@std/io/0.225.2/_constants.d.ts +3 -0
  108. package/script/deps/jsr.io/@std/io/0.225.2/_constants.d.ts.map +1 -0
  109. package/script/deps/jsr.io/@std/io/0.225.2/_constants.js +7 -0
  110. package/script/deps/jsr.io/@std/io/0.225.2/buffer.d.ts +321 -0
  111. package/script/deps/jsr.io/@std/io/0.225.2/buffer.d.ts.map +1 -0
  112. package/script/deps/jsr.io/@std/io/0.225.2/buffer.js +492 -0
  113. package/script/deps/jsr.io/@std/io/0.225.2/copy.d.ts +25 -0
  114. package/script/deps/jsr.io/@std/io/0.225.2/copy.d.ts.map +1 -0
  115. package/script/deps/jsr.io/@std/io/0.225.2/copy.js +39 -0
  116. package/script/deps/jsr.io/@std/io/0.225.2/iterate_reader.d.ts +80 -0
  117. package/script/deps/jsr.io/@std/io/0.225.2/iterate_reader.d.ts.map +1 -0
  118. package/script/deps/jsr.io/@std/io/0.225.2/iterate_reader.js +100 -0
  119. package/script/deps/jsr.io/@std/io/0.225.2/mod.d.ts +25 -0
  120. package/script/deps/jsr.io/@std/io/0.225.2/mod.d.ts.map +1 -0
  121. package/script/deps/jsr.io/@std/io/0.225.2/mod.js +41 -0
  122. package/script/deps/jsr.io/@std/io/0.225.2/read_all.d.ts +42 -0
  123. package/script/deps/jsr.io/@std/io/0.225.2/read_all.d.ts.map +1 -0
  124. package/script/deps/jsr.io/@std/io/0.225.2/read_all.js +76 -0
  125. package/script/deps/jsr.io/@std/io/0.225.2/reader_from_stream_reader.d.ts +20 -0
  126. package/script/deps/jsr.io/@std/io/0.225.2/reader_from_stream_reader.d.ts.map +1 -0
  127. package/script/deps/jsr.io/@std/io/0.225.2/reader_from_stream_reader.js +39 -0
  128. package/script/deps/jsr.io/@std/io/0.225.2/to_readable_stream.d.ts +40 -0
  129. package/script/deps/jsr.io/@std/io/0.225.2/to_readable_stream.d.ts.map +1 -0
  130. package/script/deps/jsr.io/@std/io/0.225.2/to_readable_stream.js +57 -0
  131. package/script/deps/jsr.io/@std/io/0.225.2/to_writable_stream.d.ts +27 -0
  132. package/script/deps/jsr.io/@std/io/0.225.2/to_writable_stream.d.ts.map +1 -0
  133. package/script/deps/jsr.io/@std/io/0.225.2/to_writable_stream.js +47 -0
  134. package/script/deps/jsr.io/@std/log/0.224.14/base_handler.d.ts +21 -0
  135. package/script/deps/jsr.io/@std/log/0.224.14/base_handler.d.ts.map +1 -1
  136. package/script/deps/jsr.io/@std/log/0.224.14/console_handler.js +1 -1
  137. package/script/deps/jsr.io/@std/log/0.224.14/rotating_file_handler.js +1 -1
  138. package/script/src/context/Context.d.ts +14 -4
  139. package/script/src/context/Context.d.ts.map +1 -1
  140. package/script/src/context/Context.js +16 -10
  141. package/script/src/context/ContextProvider.d.ts +3 -4
  142. package/script/src/context/ContextProvider.d.ts.map +1 -1
  143. package/script/src/context/ContextProvider.js +5 -5
  144. package/script/src/dsl/http/versori/platformapi.d.ts +2 -1
  145. package/script/src/dsl/http/versori/platformapi.d.ts.map +1 -1
  146. package/script/src/dsl/http/versori/platformapi.js +12 -1
  147. package/script/src/dsl/http/versori/roundtripper.d.ts.map +1 -1
  148. package/script/src/dsl/http/versori/roundtripper.js +32 -35
  149. package/script/src/dsl/triggers/WebhookTrigger.d.ts +45 -3
  150. package/script/src/dsl/triggers/WebhookTrigger.d.ts.map +1 -1
  151. package/script/src/dsl/triggers/WebhookTrigger.js +10 -6
  152. package/script/src/interpreter/memory/MemoryInterpreter.d.ts +6 -1
  153. package/script/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
  154. package/script/src/interpreter/memory/MemoryInterpreter.js +67 -5
  155. package/script/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
  156. package/script/src/interpreter/memory/compilers/webhook.js +109 -32
  157. package/script/src/kv/nats/NatsKeyValueProvider.d.ts +2 -1
  158. package/script/src/kv/nats/NatsKeyValueProvider.d.ts.map +1 -1
  159. package/script/src/kv/nats/NatsKeyValueProvider.js +3 -3
  160. /package/esm/deps/jsr.io/@std/fmt/{1.0.6 → 1.0.5}/colors.d.ts +0 -0
  161. /package/esm/deps/jsr.io/@std/fmt/{1.0.6 → 1.0.5}/colors.js +0 -0
  162. /package/esm/deps/jsr.io/@std/fs/{1.0.16 → 1.0.11}/exists.d.ts +0 -0
  163. /package/esm/deps/jsr.io/@std/fs/{1.0.16 → 1.0.11}/exists.js +0 -0
  164. /package/script/deps/jsr.io/@std/fmt/{1.0.6 → 1.0.5}/colors.d.ts +0 -0
  165. /package/script/deps/jsr.io/@std/fmt/{1.0.6 → 1.0.5}/colors.js +0 -0
  166. /package/script/deps/jsr.io/@std/fs/{1.0.16 → 1.0.11}/exists.d.ts +0 -0
  167. /package/script/deps/jsr.io/@std/fs/{1.0.16 → 1.0.11}/exists.js +0 -0
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.connect = void 0;
18
+ var connect_js_1 = require("./connect.js");
19
+ Object.defineProperty(exports, "connect", { enumerable: true, get: function () { return connect_js_1.connect; } });
20
+ __exportStar(require("../../../nats-core/3.0.2/src/mod.js"), exports);
@@ -0,0 +1,2 @@
1
+ export declare const version = "3.0.2";
2
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,UAAU,CAAC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.version = void 0;
4
+ // This file is generated - do not edit
5
+ exports.version = "3.0.2";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Proxy type of {@code Uint8Array<ArrayBuffer} or {@code Uint8Array} in TypeScript 5.7 or below respectively.
3
+ *
4
+ * This type is internal utility type and should not be used directly.
5
+ *
6
+ * @internal @private
7
+ */
8
+ export type Uint8Array_ = ReturnType<Uint8Array["slice"]>;
9
+ //# sourceMappingURL=_types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_types.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.5/_types.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // Copyright 2018-2025 the Deno authors. MIT license.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,21 @@
1
+ import type { Uint8Array_ } from "./_types.js";
2
+ export type { Uint8Array_ };
3
+ /**
4
+ * Concatenate an array of byte slices into a single slice.
5
+ *
6
+ * @param buffers Array of byte slices to concatenate.
7
+ * @returns A new byte slice containing all the input slices concatenated.
8
+ *
9
+ * @example Basic usage
10
+ * ```ts
11
+ * import { concat } from "@std/bytes/concat";
12
+ * import { assertEquals } from "@std/assert";
13
+ *
14
+ * const a = new Uint8Array([0, 1, 2]);
15
+ * const b = new Uint8Array([3, 4, 5]);
16
+ *
17
+ * assertEquals(concat([a, b]), new Uint8Array([0, 1, 2, 3, 4, 5]));
18
+ * ```
19
+ */
20
+ export declare function concat(buffers: Uint8Array[]): Uint8Array_;
21
+ //# sourceMappingURL=concat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"concat.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.5/concat.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,WAAW,CAazD"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ // Copyright 2018-2025 the Deno authors. MIT license.
3
+ // This module is browser compatible.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.concat = concat;
6
+ /**
7
+ * Concatenate an array of byte slices into a single slice.
8
+ *
9
+ * @param buffers Array of byte slices to concatenate.
10
+ * @returns A new byte slice containing all the input slices concatenated.
11
+ *
12
+ * @example Basic usage
13
+ * ```ts
14
+ * import { concat } from "@std/bytes/concat";
15
+ * import { assertEquals } from "@std/assert";
16
+ *
17
+ * const a = new Uint8Array([0, 1, 2]);
18
+ * const b = new Uint8Array([3, 4, 5]);
19
+ *
20
+ * assertEquals(concat([a, b]), new Uint8Array([0, 1, 2, 3, 4, 5]));
21
+ * ```
22
+ */
23
+ function concat(buffers) {
24
+ let length = 0;
25
+ for (const buffer of buffers) {
26
+ length += buffer.length;
27
+ }
28
+ const output = new Uint8Array(length);
29
+ let index = 0;
30
+ for (const buffer of buffers) {
31
+ output.set(buffer, index);
32
+ index += buffer.length;
33
+ }
34
+ return output;
35
+ }
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Copy bytes from the source array to the destination array and returns the
3
+ * number of bytes copied.
4
+ *
5
+ * If the source array is larger than what the `dst` array can hold, only the
6
+ * amount of bytes that fit in the `dst` array are copied.
7
+ *
8
+ * @param src Source array to copy from.
9
+ * @param dst Destination array to copy to.
10
+ * @param offset Offset in the destination array to start copying to. Defaults
11
+ * to 0.
12
+ * @returns Number of bytes copied.
13
+ *
14
+ * @example Basic usage
15
+ * ```ts
16
+ * import { copy } from "@std/bytes/copy";
17
+ * import { assertEquals } from "@std/assert";
18
+ *
19
+ * const src = new Uint8Array([9, 8, 7]);
20
+ * const dst = new Uint8Array([0, 1, 2, 3, 4, 5]);
21
+ *
22
+ * assertEquals(copy(src, dst), 3);
23
+ * assertEquals(dst, new Uint8Array([9, 8, 7, 3, 4, 5]));
24
+ * ```
25
+ *
26
+ * @example Copy with offset
27
+ * ```ts
28
+ * import { copy } from "@std/bytes/copy";
29
+ * import { assertEquals } from "@std/assert";
30
+ *
31
+ * const src = new Uint8Array([1, 1, 1, 1]);
32
+ * const dst = new Uint8Array([0, 0, 0, 0]);
33
+ *
34
+ * assertEquals(copy(src, dst, 1), 3);
35
+ * assertEquals(dst, new Uint8Array([0, 1, 1, 1]));
36
+ * ```
37
+ * Defining an offset will start copying at the specified index in the
38
+ * destination array.
39
+ */
40
+ export declare function copy(src: Uint8Array, dst: Uint8Array, offset?: number): number;
41
+ //# sourceMappingURL=copy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.5/copy.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,SAAI,GAAG,MAAM,CAQzE"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ // Copyright 2018-2025 the Deno authors. MIT license.
3
+ // This module is browser compatible.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.copy = copy;
6
+ /**
7
+ * Copy bytes from the source array to the destination array and returns the
8
+ * number of bytes copied.
9
+ *
10
+ * If the source array is larger than what the `dst` array can hold, only the
11
+ * amount of bytes that fit in the `dst` array are copied.
12
+ *
13
+ * @param src Source array to copy from.
14
+ * @param dst Destination array to copy to.
15
+ * @param offset Offset in the destination array to start copying to. Defaults
16
+ * to 0.
17
+ * @returns Number of bytes copied.
18
+ *
19
+ * @example Basic usage
20
+ * ```ts
21
+ * import { copy } from "@std/bytes/copy";
22
+ * import { assertEquals } from "@std/assert";
23
+ *
24
+ * const src = new Uint8Array([9, 8, 7]);
25
+ * const dst = new Uint8Array([0, 1, 2, 3, 4, 5]);
26
+ *
27
+ * assertEquals(copy(src, dst), 3);
28
+ * assertEquals(dst, new Uint8Array([9, 8, 7, 3, 4, 5]));
29
+ * ```
30
+ *
31
+ * @example Copy with offset
32
+ * ```ts
33
+ * import { copy } from "@std/bytes/copy";
34
+ * import { assertEquals } from "@std/assert";
35
+ *
36
+ * const src = new Uint8Array([1, 1, 1, 1]);
37
+ * const dst = new Uint8Array([0, 0, 0, 0]);
38
+ *
39
+ * assertEquals(copy(src, dst, 1), 3);
40
+ * assertEquals(dst, new Uint8Array([0, 1, 1, 1]));
41
+ * ```
42
+ * Defining an offset will start copying at the specified index in the
43
+ * destination array.
44
+ */
45
+ function copy(src, dst, offset = 0) {
46
+ offset = Math.max(0, Math.min(offset, dst.byteLength));
47
+ const dstBytesAvailable = dst.byteLength - offset;
48
+ if (src.byteLength > dstBytesAvailable) {
49
+ src = src.subarray(0, dstBytesAvailable);
50
+ }
51
+ dst.set(src, offset);
52
+ return src.byteLength;
53
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/fmt/1.0.6/colors.ts"],"names":[],"mappings":"AAoEA,qEAAqE;AACrE,MAAM,WAAW,GAAG;IAClB,0BAA0B;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,4BAA4B;IAC5B,CAAC,EAAE,MAAM,CAAC;IACV,2BAA2B;IAC3B,CAAC,EAAE,MAAM,CAAC;CACX;AAID;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,QAM7C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAEzC;AA0BD;;;;;;;;;;;;GAYG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAExC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEvC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE1C;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED;;;;;;;;;;;;GAYG;AACH,wBA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;;;;;;;;;GAgGG;AACH,wBAAsB,MAAM,CAC1B,IAAI,EAAE,MAAM,GAAG,GAAG,EAClB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,OAAO,CAAC,CAsClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+FG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,GAAG,GAAG,EAClB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAqCT"}
1
+ {"version":3,"file":"exists.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/fs/1.0.11/exists.ts"],"names":[],"mappings":"AAEA,iEAAiE;AACjE,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgGG;AACH,wBAAsB,MAAM,CAC1B,IAAI,EAAE,MAAM,GAAG,GAAG,EAClB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,OAAO,CAAC,CAsClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+FG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,GAAG,GAAG,EAClB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAqCT"}
@@ -0,0 +1,3 @@
1
+ import type { Closer } from "./types.js";
2
+ export declare function isCloser(value: unknown): value is Closer;
3
+ //# sourceMappingURL=_common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_common.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/io/0.225.2/_common.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAKxD"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ // Copyright 2018-2025 the Deno authors. MIT license.
3
+ // This module is browser compatible.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.isCloser = isCloser;
6
+ function isCloser(value) {
7
+ return typeof value === "object" && value !== null && value !== undefined &&
8
+ "close" in value &&
9
+ // deno-lint-ignore no-explicit-any
10
+ typeof value["close"] === "function";
11
+ }
@@ -0,0 +1,3 @@
1
+ export declare const DEFAULT_CHUNK_SIZE = 16640;
2
+ export declare const DEFAULT_BUFFER_SIZE: number;
3
+ //# sourceMappingURL=_constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_constants.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/io/0.225.2/_constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB,QAAS,CAAC;AACzC,eAAO,MAAM,mBAAmB,QAAY,CAAC"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ // Copyright 2018-2025 the Deno authors. MIT license.
3
+ // This module is browser compatible.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.DEFAULT_BUFFER_SIZE = exports.DEFAULT_CHUNK_SIZE = void 0;
6
+ exports.DEFAULT_CHUNK_SIZE = 16_640;
7
+ exports.DEFAULT_BUFFER_SIZE = 32 * 1024;
@@ -0,0 +1,321 @@
1
+ import type { Reader, ReaderSync, Writer, WriterSync } from "./types.js";
2
+ /**
3
+ * A variable-sized buffer of bytes with `read()` and `write()` methods.
4
+ *
5
+ * Buffer is almost always used with some I/O like files and sockets. It allows
6
+ * one to buffer up a download from a socket. Buffer grows and shrinks as
7
+ * necessary.
8
+ *
9
+ * Buffer is NOT the same thing as Node's Buffer. Node's Buffer was created in
10
+ * 2009 before JavaScript had the concept of ArrayBuffers. It's simply a
11
+ * non-standard ArrayBuffer.
12
+ *
13
+ * ArrayBuffer is a fixed memory allocation. Buffer is implemented on top of
14
+ * ArrayBuffer.
15
+ *
16
+ * Based on {@link https://golang.org/pkg/bytes/#Buffer | Go Buffer}.
17
+ *
18
+ * @example Usage
19
+ * ```ts
20
+ * import { Buffer } from "@std/io/buffer";
21
+ * import { assertEquals } from "@std/assert/equals";
22
+ *
23
+ * const buf = new Buffer();
24
+ * await buf.write(new TextEncoder().encode("Hello, "));
25
+ * await buf.write(new TextEncoder().encode("world!"));
26
+ *
27
+ * const data = new Uint8Array(13);
28
+ * await buf.read(data);
29
+ *
30
+ * assertEquals(new TextDecoder().decode(data), "Hello, world!");
31
+ * ```
32
+ */
33
+ export declare class Buffer implements Writer, WriterSync, Reader, ReaderSync {
34
+ #private;
35
+ /**
36
+ * Constructs a new instance with the specified {@linkcode ArrayBuffer} as its
37
+ * initial contents.
38
+ *
39
+ * @param ab The ArrayBuffer to use as the initial contents of the buffer.
40
+ */
41
+ constructor(ab?: ArrayBufferLike | ArrayLike<number>);
42
+ /**
43
+ * Returns a slice holding the unread portion of the buffer.
44
+ *
45
+ * The slice is valid for use only until the next buffer modification (that
46
+ * is, only until the next call to a method like `read()`, `write()`,
47
+ * `reset()`, or `truncate()`). If `options.copy` is false the slice aliases the buffer content at
48
+ * least until the next buffer modification, so immediate changes to the
49
+ * slice will affect the result of future reads.
50
+ *
51
+ * @example Usage
52
+ * ```ts
53
+ * import { Buffer } from "@std/io/buffer";
54
+ * import { assertEquals } from "@std/assert/equals";
55
+ *
56
+ * const buf = new Buffer();
57
+ * await buf.write(new TextEncoder().encode("Hello, world!"));
58
+ *
59
+ * const slice = buf.bytes();
60
+ * assertEquals(new TextDecoder().decode(slice), "Hello, world!");
61
+ * ```
62
+ *
63
+ * @param options The options for the slice.
64
+ * @returns A slice holding the unread portion of the buffer.
65
+ */
66
+ bytes(options?: {
67
+ copy: boolean;
68
+ }): Uint8Array;
69
+ /**
70
+ * Returns whether the unread portion of the buffer is empty.
71
+ *
72
+ * @example Usage
73
+ * ```ts
74
+ * import { Buffer } from "@std/io/buffer";
75
+ * import { assertEquals } from "@std/assert/equals";
76
+ *
77
+ * const buf = new Buffer();
78
+ * assertEquals(buf.empty(), true);
79
+ * await buf.write(new TextEncoder().encode("Hello, world!"));
80
+ * assertEquals(buf.empty(), false);
81
+ * ```
82
+ *
83
+ * @returns `true` if the unread portion of the buffer is empty, `false`
84
+ * otherwise.
85
+ */
86
+ empty(): boolean;
87
+ /**
88
+ * A read only number of bytes of the unread portion of the buffer.
89
+ *
90
+ * @example Usage
91
+ * ```ts
92
+ * import { Buffer } from "@std/io/buffer";
93
+ * import { assertEquals } from "@std/assert/equals";
94
+ *
95
+ * const buf = new Buffer();
96
+ * await buf.write(new TextEncoder().encode("Hello, world!"));
97
+ *
98
+ * assertEquals(buf.length, 13);
99
+ * ```
100
+ *
101
+ * @returns The number of bytes of the unread portion of the buffer.
102
+ */
103
+ get length(): number;
104
+ /**
105
+ * The read only capacity of the buffer's underlying byte slice, that is,
106
+ * the total space allocated for the buffer's data.
107
+ *
108
+ * @example Usage
109
+ * ```ts
110
+ * import { Buffer } from "@std/io/buffer";
111
+ * import { assertEquals } from "@std/assert/equals";
112
+ *
113
+ * const buf = new Buffer();
114
+ * assertEquals(buf.capacity, 0);
115
+ * await buf.write(new TextEncoder().encode("Hello, world!"));
116
+ * assertEquals(buf.capacity, 13);
117
+ * ```
118
+ *
119
+ * @returns The capacity of the buffer.
120
+ */
121
+ get capacity(): number;
122
+ /**
123
+ * Discards all but the first `n` unread bytes from the buffer but
124
+ * continues to use the same allocated storage. It throws if `n` is
125
+ * negative or greater than the length of the buffer.
126
+ *
127
+ * @example Usage
128
+ * ```ts
129
+ * import { Buffer } from "@std/io/buffer";
130
+ * import { assertEquals } from "@std/assert/equals";
131
+ *
132
+ * const buf = new Buffer();
133
+ * await buf.write(new TextEncoder().encode("Hello, world!"));
134
+ * buf.truncate(6);
135
+ * assertEquals(buf.length, 6);
136
+ * ```
137
+ *
138
+ * @param n The number of bytes to keep.
139
+ */
140
+ truncate(n: number): void;
141
+ /**
142
+ * Resets the contents
143
+ *
144
+ * @example Usage
145
+ * ```ts
146
+ * import { Buffer } from "@std/io/buffer";
147
+ * import { assertEquals } from "@std/assert/equals";
148
+ *
149
+ * const buf = new Buffer();
150
+ * await buf.write(new TextEncoder().encode("Hello, world!"));
151
+ * buf.reset();
152
+ * assertEquals(buf.length, 0);
153
+ * ```
154
+ */
155
+ reset(): void;
156
+ /**
157
+ * Reads the next `p.length` bytes from the buffer or until the buffer is
158
+ * drained. Returns the number of bytes read. If the buffer has no data to
159
+ * return, the return is EOF (`null`).
160
+ *
161
+ * @example Usage
162
+ * ```ts
163
+ * import { Buffer } from "@std/io/buffer";
164
+ * import { assertEquals } from "@std/assert/equals";
165
+ *
166
+ * const buf = new Buffer();
167
+ * await buf.write(new TextEncoder().encode("Hello, world!"));
168
+ *
169
+ * const data = new Uint8Array(5);
170
+ * const res = await buf.read(data);
171
+ *
172
+ * assertEquals(res, 5);
173
+ * assertEquals(new TextDecoder().decode(data), "Hello");
174
+ * ```
175
+ *
176
+ * @param p The buffer to read data into.
177
+ * @returns The number of bytes read.
178
+ */
179
+ readSync(p: Uint8Array): number | null;
180
+ /**
181
+ * Reads the next `p.length` bytes from the buffer or until the buffer is
182
+ * drained. Resolves to the number of bytes read. If the buffer has no
183
+ * data to return, resolves to EOF (`null`).
184
+ *
185
+ * NOTE: This methods reads bytes synchronously; it's provided for
186
+ * compatibility with `Reader` interfaces.
187
+ *
188
+ * @example Usage
189
+ * ```ts
190
+ * import { Buffer } from "@std/io/buffer";
191
+ * import { assertEquals } from "@std/assert/equals";
192
+ *
193
+ * const buf = new Buffer();
194
+ * await buf.write(new TextEncoder().encode("Hello, world!"));
195
+ *
196
+ * const data = new Uint8Array(5);
197
+ * const res = await buf.read(data);
198
+ *
199
+ * assertEquals(res, 5);
200
+ * assertEquals(new TextDecoder().decode(data), "Hello");
201
+ * ```
202
+ *
203
+ * @param p The buffer to read data into.
204
+ * @returns The number of bytes read.
205
+ */
206
+ read(p: Uint8Array): Promise<number | null>;
207
+ /**
208
+ * Writes the given data to the buffer.
209
+ *
210
+ * @example Usage
211
+ * ```ts
212
+ * import { Buffer } from "@std/io/buffer";
213
+ * import { assertEquals } from "@std/assert/equals";
214
+ *
215
+ * const buf = new Buffer();
216
+ * const data = new TextEncoder().encode("Hello, world!");
217
+ * buf.writeSync(data);
218
+ *
219
+ * const slice = buf.bytes();
220
+ * assertEquals(new TextDecoder().decode(slice), "Hello, world!");
221
+ * ```
222
+ *
223
+ * @param p The data to write to the buffer.
224
+ * @returns The number of bytes written.
225
+ */
226
+ writeSync(p: Uint8Array): number;
227
+ /**
228
+ * Writes the given data to the buffer. Resolves to the number of bytes
229
+ * written.
230
+ *
231
+ * > [!NOTE]
232
+ * > This methods writes bytes synchronously; it's provided for compatibility
233
+ * > with the {@linkcode Writer} interface.
234
+ *
235
+ * @example Usage
236
+ * ```ts
237
+ * import { Buffer } from "@std/io/buffer";
238
+ * import { assertEquals } from "@std/assert/equals";
239
+ *
240
+ * const buf = new Buffer();
241
+ * const data = new TextEncoder().encode("Hello, world!");
242
+ * await buf.write(data);
243
+ *
244
+ * const slice = buf.bytes();
245
+ * assertEquals(new TextDecoder().decode(slice), "Hello, world!");
246
+ * ```
247
+ *
248
+ * @param p The data to write to the buffer.
249
+ * @returns The number of bytes written.
250
+ */
251
+ write(p: Uint8Array): Promise<number>;
252
+ /** Grows the buffer's capacity, if necessary, to guarantee space for
253
+ * another `n` bytes. After `.grow(n)`, at least `n` bytes can be written to
254
+ * the buffer without another allocation. If `n` is negative, `.grow()` will
255
+ * throw. If the buffer can't grow it will throw an error.
256
+ *
257
+ * Based on Go Lang's
258
+ * {@link https://golang.org/pkg/bytes/#Buffer.Grow | Buffer.Grow}.
259
+ *
260
+ * @example Usage
261
+ * ```ts
262
+ * import { Buffer } from "@std/io/buffer";
263
+ * import { assertEquals } from "@std/assert/equals";
264
+ *
265
+ * const buf = new Buffer();
266
+ * buf.grow(10);
267
+ * assertEquals(buf.capacity, 10);
268
+ * ```
269
+ *
270
+ * @param n The number of bytes to grow the buffer by.
271
+ */
272
+ grow(n: number): void;
273
+ /**
274
+ * Reads data from `r` until EOF (`null`) and appends it to the buffer,
275
+ * growing the buffer as needed. It resolves to the number of bytes read.
276
+ * If the buffer becomes too large, `.readFrom()` will reject with an error.
277
+ *
278
+ * Based on Go Lang's
279
+ * {@link https://golang.org/pkg/bytes/#Buffer.ReadFrom | Buffer.ReadFrom}.
280
+ *
281
+ * @example Usage
282
+ * ```ts
283
+ * import { Buffer } from "@std/io/buffer";
284
+ * import { assertEquals } from "@std/assert/equals";
285
+ *
286
+ * const buf = new Buffer();
287
+ * const r = new Buffer(new TextEncoder().encode("Hello, world!"));
288
+ * const n = await buf.readFrom(r);
289
+ *
290
+ * assertEquals(n, 13);
291
+ * ```
292
+ *
293
+ * @param r The reader to read from.
294
+ * @returns The number of bytes read.
295
+ */
296
+ readFrom(r: Reader): Promise<number>;
297
+ /** Reads data from `r` until EOF (`null`) and appends it to the buffer,
298
+ * growing the buffer as needed. It returns the number of bytes read. If the
299
+ * buffer becomes too large, `.readFromSync()` will throw an error.
300
+ *
301
+ * Based on Go Lang's
302
+ * {@link https://golang.org/pkg/bytes/#Buffer.ReadFrom | Buffer.ReadFrom}.
303
+ *
304
+ * @example Usage
305
+ * ```ts
306
+ * import { Buffer } from "@std/io/buffer";
307
+ * import { assertEquals } from "@std/assert/equals";
308
+ *
309
+ * const buf = new Buffer();
310
+ * const r = new Buffer(new TextEncoder().encode("Hello, world!"));
311
+ * const n = buf.readFromSync(r);
312
+ *
313
+ * assertEquals(n, 13);
314
+ * ```
315
+ *
316
+ * @param r The reader to read from.
317
+ * @returns The number of bytes read.
318
+ */
319
+ readFromSync(r: ReaderSync): number;
320
+ }
321
+ //# sourceMappingURL=buffer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buffer.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/io/0.225.2/buffer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AASzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBAAa,MAAO,YAAW,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU;;IAInE;;;;;OAKG;gBACS,EAAE,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC,MAAM,CAAC;IAWpD;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,KAAK,CAAC,OAAO;;KAAiB,GAAG,UAAU;IAK3C;;;;;;;;;;;;;;;;OAgBG;IACH,KAAK,IAAI,OAAO;IAIhB;;;;;;;;;;;;;;;OAeG;IACH,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAC,CAAC,EAAE,MAAM;IAWlB;;;;;;;;;;;;;OAaG;IACH,KAAK;IAqBL;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,QAAQ,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI;IAetC;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,IAAI,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAK3C;;;;;;;;;;;;;;;;;;OAkBG;IACH,SAAS,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM;IAKhC;;;;;;;;;;;;;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