@solibo/home-api 1.1.9 → 1.1.10

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 (113) hide show
  1. package/Kotlin-DateTime-library-kotlinx-datetime.mjs +3601 -0
  2. package/Kotlin-DateTime-library-kotlinx-datetime.mjs.map +1 -0
  3. package/MultiplatformSettings-multiplatform-settings-no-arg.mjs +4 -0
  4. package/{MultiplatformSettings-multiplatform-settings.js.map → MultiplatformSettings-multiplatform-settings-no-arg.mjs.map} +1 -1
  5. package/MultiplatformSettings-multiplatform-settings.mjs +4 -0
  6. package/{kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js.map → MultiplatformSettings-multiplatform-settings.mjs.map} +1 -1
  7. package/kotlin-kotlin-stdlib.mjs +17369 -0
  8. package/kotlin-kotlin-stdlib.mjs.map +1 -0
  9. package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.mjs +4 -0
  10. package/{kotlinx-serialization-kotlinx-serialization-json-io.js.map → kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.mjs.map} +1 -1
  11. package/kotlinx-atomicfu.mjs +250 -0
  12. package/kotlinx-atomicfu.mjs.map +1 -0
  13. package/kotlinx-browser.mjs +8 -0
  14. package/{kotlinx-browser.js.map → kotlinx-browser.mjs.map} +1 -1
  15. package/kotlinx-coroutines-core.mjs +8888 -0
  16. package/kotlinx-coroutines-core.mjs.map +1 -0
  17. package/kotlinx-io-kotlinx-io-bytestring.mjs +202 -0
  18. package/kotlinx-io-kotlinx-io-bytestring.mjs.map +1 -0
  19. package/kotlinx-io-kotlinx-io-core.mjs +2020 -0
  20. package/kotlinx-io-kotlinx-io-core.mjs.map +1 -0
  21. package/kotlinx-serialization-kotlinx-serialization-core.mjs +6045 -0
  22. package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -0
  23. package/kotlinx-serialization-kotlinx-serialization-json-io.mjs +4 -0
  24. package/{MultiplatformSettings-multiplatform-settings-no-arg.js.map → kotlinx-serialization-kotlinx-serialization-json-io.mjs.map} +1 -1
  25. package/kotlinx-serialization-kotlinx-serialization-json.mjs +5061 -0
  26. package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -0
  27. package/ktor-ktor-client-auth.mjs +4 -0
  28. package/ktor-ktor-client-auth.mjs.map +1 -0
  29. package/ktor-ktor-client-content-negotiation.mjs +750 -0
  30. package/ktor-ktor-client-content-negotiation.mjs.map +1 -0
  31. package/ktor-ktor-client-core.mjs +9810 -0
  32. package/ktor-ktor-client-core.mjs.map +1 -0
  33. package/ktor-ktor-client-logging.mjs +4 -0
  34. package/ktor-ktor-client-logging.mjs.map +1 -0
  35. package/ktor-ktor-events.mjs +81 -0
  36. package/ktor-ktor-events.mjs.map +1 -0
  37. package/ktor-ktor-http-cio.mjs +2254 -0
  38. package/ktor-ktor-http-cio.mjs.map +1 -0
  39. package/ktor-ktor-http.mjs +3238 -0
  40. package/ktor-ktor-http.mjs.map +1 -0
  41. package/ktor-ktor-io.mjs +3536 -0
  42. package/ktor-ktor-io.mjs.map +1 -0
  43. package/ktor-ktor-serialization-kotlinx-json.mjs +46 -0
  44. package/{ktor-ktor-serialization-kotlinx-json.js.map → ktor-ktor-serialization-kotlinx-json.mjs.map} +1 -1
  45. package/ktor-ktor-serialization-kotlinx.mjs +843 -0
  46. package/ktor-ktor-serialization-kotlinx.mjs.map +1 -0
  47. package/ktor-ktor-serialization.mjs +364 -0
  48. package/ktor-ktor-serialization.mjs.map +1 -0
  49. package/ktor-ktor-sse.mjs +4 -0
  50. package/ktor-ktor-sse.mjs.map +1 -0
  51. package/ktor-ktor-utils.mjs +2620 -0
  52. package/ktor-ktor-utils.mjs.map +1 -0
  53. package/ktor-ktor-websocket-serialization.mjs +4 -0
  54. package/ktor-ktor-websocket-serialization.mjs.map +1 -0
  55. package/ktor-ktor-websockets.mjs +2535 -0
  56. package/ktor-ktor-websockets.mjs.map +1 -0
  57. package/package.json +2 -3
  58. package/solibo-sdk-sdk-home-api.d.mts +13419 -0
  59. package/solibo-sdk-sdk-home-api.mjs +199394 -0
  60. package/solibo-sdk-sdk-home-api.mjs.map +1 -0
  61. package/Kotlin-DateTime-library-kotlinx-datetime.js +0 -3614
  62. package/Kotlin-DateTime-library-kotlinx-datetime.js.map +0 -1
  63. package/MultiplatformSettings-multiplatform-settings-no-arg.js +0 -15
  64. package/MultiplatformSettings-multiplatform-settings.js +0 -15
  65. package/kotlin-kotlin-stdlib.js +0 -17392
  66. package/kotlin-kotlin-stdlib.js.map +0 -1
  67. package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js +0 -15
  68. package/kotlinx-atomicfu.js +0 -262
  69. package/kotlinx-atomicfu.js.map +0 -1
  70. package/kotlinx-browser.js +0 -19
  71. package/kotlinx-coroutines-core.js +0 -8901
  72. package/kotlinx-coroutines-core.js.map +0 -1
  73. package/kotlinx-io-kotlinx-io-bytestring.js +0 -214
  74. package/kotlinx-io-kotlinx-io-bytestring.js.map +0 -1
  75. package/kotlinx-io-kotlinx-io-core.js +0 -2035
  76. package/kotlinx-io-kotlinx-io-core.js.map +0 -1
  77. package/kotlinx-serialization-kotlinx-serialization-core.js +0 -6057
  78. package/kotlinx-serialization-kotlinx-serialization-core.js.map +0 -1
  79. package/kotlinx-serialization-kotlinx-serialization-json-io.js +0 -15
  80. package/kotlinx-serialization-kotlinx-serialization-json.js +0 -5074
  81. package/kotlinx-serialization-kotlinx-serialization-json.js.map +0 -1
  82. package/ktor-ktor-client-auth.js +0 -15
  83. package/ktor-ktor-client-auth.js.map +0 -1
  84. package/ktor-ktor-client-content-negotiation.js +0 -767
  85. package/ktor-ktor-client-content-negotiation.js.map +0 -1
  86. package/ktor-ktor-client-core.js +0 -9839
  87. package/ktor-ktor-client-core.js.map +0 -1
  88. package/ktor-ktor-client-logging.js +0 -15
  89. package/ktor-ktor-client-logging.js.map +0 -1
  90. package/ktor-ktor-events.js +0 -94
  91. package/ktor-ktor-events.js.map +0 -1
  92. package/ktor-ktor-http-cio.js +0 -2271
  93. package/ktor-ktor-http-cio.js.map +0 -1
  94. package/ktor-ktor-http.js +0 -3253
  95. package/ktor-ktor-http.js.map +0 -1
  96. package/ktor-ktor-io.js +0 -3556
  97. package/ktor-ktor-io.js.map +0 -1
  98. package/ktor-ktor-serialization-kotlinx-json.js +0 -67
  99. package/ktor-ktor-serialization-kotlinx.js +0 -865
  100. package/ktor-ktor-serialization-kotlinx.js.map +0 -1
  101. package/ktor-ktor-serialization.js +0 -379
  102. package/ktor-ktor-serialization.js.map +0 -1
  103. package/ktor-ktor-sse.js +0 -15
  104. package/ktor-ktor-sse.js.map +0 -1
  105. package/ktor-ktor-utils.js +0 -2639
  106. package/ktor-ktor-utils.js.map +0 -1
  107. package/ktor-ktor-websocket-serialization.js +0 -15
  108. package/ktor-ktor-websocket-serialization.js.map +0 -1
  109. package/ktor-ktor-websockets.js +0 -2552
  110. package/ktor-ktor-websockets.js.map +0 -1
  111. package/solibo-sdk-sdk-home-api.d.ts +0 -12624
  112. package/solibo-sdk-sdk-home-api.js +0 -203510
  113. package/solibo-sdk-sdk-home-api.js.map +0 -1
@@ -0,0 +1,2020 @@
1
+ import {
2
+ IndexOutOfBoundsException_init_$Create$1rd2xj3xtaoo6 as IndexOutOfBoundsException_init_$Create$,
3
+ IllegalArgumentException_init_$Create$1j1aj36nbo0wg as IllegalArgumentException_init_$Create$,
4
+ subtract2orl8z9upxd9l as subtract,
5
+ _Char___init__impl__6a9atx1csff5kwtduxl as _Char___init__impl__6a9atx,
6
+ charArrayOf27f4r3dozbrk1 as charArrayOf,
7
+ protoOf180f3jzyo7rfj as protoOf,
8
+ toString1pkumu07cwy4m as toString,
9
+ Unit_instance28fytmsmm6r23 as Unit_instance,
10
+ toShort36kaw0zjdq3ex as toShort,
11
+ add2suhfggl4zvkk as add,
12
+ ensureNotNull1e947j3ixpazm as ensureNotNull,
13
+ fromInt2ii0rejb1w62w as fromInt,
14
+ convertToInty04h231mmjoh as convertToInt,
15
+ StringBuilder_init_$Create$39ouzl6b47q8d as StringBuilder_init_$Create$,
16
+ initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
17
+ VOID3gxj6tk5isa35 as VOID,
18
+ IllegalStateException_init_$Create$2429fvs1h56dm as IllegalStateException_init_$Create$,
19
+ AutoCloseable1l5p57f9lp7kv as AutoCloseable,
20
+ objectCreate1ve4bgxiu4x98 as objectCreate,
21
+ initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion,
22
+ arrayCopytctsywo3h7gj as arrayCopy,
23
+ toByte4i43936u611k as toByte,
24
+ IllegalArgumentException_init_$Create$nai51bbwz5t9 as IllegalArgumentException_init_$Create$_0,
25
+ initMetadataForObject1cxne3s9w65el as initMetadataForObject,
26
+ initMetadataForInterface1egvbzx539z91 as initMetadataForInterface,
27
+ multiply2k9eolhnz1bjv as multiply,
28
+ charCodeAt1yspne1d8erbm as charCodeAt,
29
+ Char__toInt_impl_vasixd3jl92hthlhyn7 as Char__toInt_impl_vasixd,
30
+ charArray2ujmm1qusno00 as charArray,
31
+ numberToChar93r9buh19yek as numberToChar,
32
+ concatToString3cxf0c1gqonpo as concatToString,
33
+ Exception_init_$Init$22vtgic9oqkxe as Exception_init_$Init$,
34
+ captureStack1fzi4aczwc4hg as captureStack,
35
+ Exception_init_$Init$2jymvyiuv5u42 as Exception_init_$Init$_0,
36
+ Exception_init_$Init$gwg5c35cbjjd as Exception_init_$Init$_1,
37
+ Exceptiondt2hlxn7j7vw as Exception,
38
+ } from './kotlin-kotlin-stdlib.mjs';
39
+ import { UnsafeByteStringOperations_instance35zx8xrp4hu2p as UnsafeByteStringOperations_instance } from './kotlinx-io-kotlinx-io-bytestring.mjs';
40
+ //region block: imports
41
+ var imul = Math.imul;
42
+ //endregion
43
+ //region block: pre-declaration
44
+ initMetadataForInterface(Source, 'Source', VOID, VOID, [AutoCloseable]);
45
+ function write$default(source, startIndex, endIndex, $super) {
46
+ startIndex = startIndex === VOID ? 0 : startIndex;
47
+ endIndex = endIndex === VOID ? source.length : endIndex;
48
+ var tmp;
49
+ if ($super === VOID) {
50
+ this.aq(source, startIndex, endIndex);
51
+ tmp = Unit_instance;
52
+ } else {
53
+ tmp = $super.aq.call(this, source, startIndex, endIndex);
54
+ }
55
+ return tmp;
56
+ }
57
+ initMetadataForInterface(Sink, 'Sink', VOID, VOID, [AutoCloseable]);
58
+ initMetadataForClass(Buffer, 'Buffer', Buffer, VOID, [Source, Sink]);
59
+ initMetadataForClass(PeekSource, 'PeekSource', VOID, VOID, [AutoCloseable]);
60
+ initMetadataForClass(RealSource, 'RealSource', VOID, VOID, [Source]);
61
+ initMetadataForCompanion(Companion);
62
+ initMetadataForClass(Segment, 'Segment');
63
+ initMetadataForClass(SegmentCopyTracker, 'SegmentCopyTracker');
64
+ initMetadataForObject(AlwaysSharedCopyTracker, 'AlwaysSharedCopyTracker', VOID, SegmentCopyTracker);
65
+ initMetadataForObject(UnsafeBufferOperations, 'UnsafeBufferOperations');
66
+ initMetadataForClass(SegmentReadContextImpl$1);
67
+ initMetadataForClass(SegmentWriteContextImpl$1);
68
+ initMetadataForClass(BufferIterationContextImpl$1);
69
+ initMetadataForClass(IOException, 'IOException', IOException_init_$Create$, Exception);
70
+ initMetadataForClass(EOFException, 'EOFException', EOFException_init_$Create$, IOException);
71
+ initMetadataForObject(SegmentPool, 'SegmentPool');
72
+ //endregion
73
+ function get_HEX_DIGIT_CHARS() {
74
+ _init_properties__Util_kt__g8tcl9();
75
+ return HEX_DIGIT_CHARS;
76
+ }
77
+ var HEX_DIGIT_CHARS;
78
+ function checkBounds(size, startIndex, endIndex) {
79
+ _init_properties__Util_kt__g8tcl9();
80
+ if (startIndex < 0n || endIndex > size) {
81
+ throw IndexOutOfBoundsException_init_$Create$('startIndex (' + startIndex.toString() + ') and endIndex (' + endIndex.toString() + ') are not within the range [0..size(' + size.toString() + '))');
82
+ }
83
+ if (startIndex > endIndex) {
84
+ throw IllegalArgumentException_init_$Create$('startIndex (' + startIndex.toString() + ') > endIndex (' + endIndex.toString() + ')');
85
+ }
86
+ }
87
+ function checkOffsetAndCount(size, offset, byteCount) {
88
+ _init_properties__Util_kt__g8tcl9();
89
+ if (offset < 0n || offset > size || subtract(size, offset) < byteCount || byteCount < 0n) {
90
+ throw IllegalArgumentException_init_$Create$('offset (' + offset.toString() + ') and byteCount (' + byteCount.toString() + ') are not within the range [0..size(' + size.toString() + '))');
91
+ }
92
+ }
93
+ var properties_initialized__Util_kt_67kc5b;
94
+ function _init_properties__Util_kt__g8tcl9() {
95
+ if (!properties_initialized__Util_kt_67kc5b) {
96
+ properties_initialized__Util_kt_67kc5b = true;
97
+ // Inline function 'kotlin.charArrayOf' call
98
+ HEX_DIGIT_CHARS = charArrayOf([_Char___init__impl__6a9atx(48), _Char___init__impl__6a9atx(49), _Char___init__impl__6a9atx(50), _Char___init__impl__6a9atx(51), _Char___init__impl__6a9atx(52), _Char___init__impl__6a9atx(53), _Char___init__impl__6a9atx(54), _Char___init__impl__6a9atx(55), _Char___init__impl__6a9atx(56), _Char___init__impl__6a9atx(57), _Char___init__impl__6a9atx(97), _Char___init__impl__6a9atx(98), _Char___init__impl__6a9atx(99), _Char___init__impl__6a9atx(100), _Char___init__impl__6a9atx(101), _Char___init__impl__6a9atx(102)]);
99
+ }
100
+ }
101
+ function throwEof($this, byteCount) {
102
+ throw EOFException_init_$Create$_0("Buffer doesn't contain required number of bytes (size: " + $this.g1().toString() + ', required: ' + byteCount.toString() + ')');
103
+ }
104
+ function Buffer() {
105
+ this.no_1 = null;
106
+ this.oo_1 = null;
107
+ this.po_1 = 0n;
108
+ }
109
+ protoOf(Buffer).g1 = function () {
110
+ return this.po_1;
111
+ };
112
+ protoOf(Buffer).qo = function () {
113
+ return this;
114
+ };
115
+ protoOf(Buffer).ro = function () {
116
+ return this.g1() === 0n;
117
+ };
118
+ protoOf(Buffer).so = function (byteCount) {
119
+ // Inline function 'kotlin.require' call
120
+ if (!(byteCount >= 0n)) {
121
+ var message = 'byteCount: ' + byteCount.toString();
122
+ throw IllegalArgumentException_init_$Create$(toString(message));
123
+ }
124
+ if (this.g1() < byteCount) {
125
+ throw EOFException_init_$Create$_0("Buffer doesn't contain required number of bytes (size: " + this.g1().toString() + ', required: ' + byteCount.toString() + ')');
126
+ }
127
+ };
128
+ protoOf(Buffer).to = function (byteCount) {
129
+ // Inline function 'kotlin.require' call
130
+ if (!(byteCount >= 0n)) {
131
+ var message = 'byteCount: ' + byteCount.toString() + ' < 0';
132
+ throw IllegalArgumentException_init_$Create$(toString(message));
133
+ }
134
+ return this.g1() >= byteCount;
135
+ };
136
+ protoOf(Buffer).uo = function () {
137
+ var tmp0_elvis_lhs = this.no_1;
138
+ var tmp;
139
+ if (tmp0_elvis_lhs == null) {
140
+ throwEof(this, 1n);
141
+ } else {
142
+ tmp = tmp0_elvis_lhs;
143
+ }
144
+ var segment = tmp;
145
+ var segmentSize = segment.g1();
146
+ if (segmentSize === 0) {
147
+ this.cp();
148
+ return this.uo();
149
+ }
150
+ var v = segment.dp();
151
+ this.po_1 = subtract(this.po_1, 1n);
152
+ if (segmentSize === 1) {
153
+ this.cp();
154
+ }
155
+ return v;
156
+ };
157
+ protoOf(Buffer).ep = function () {
158
+ var tmp0_elvis_lhs = this.no_1;
159
+ var tmp;
160
+ if (tmp0_elvis_lhs == null) {
161
+ throwEof(this, 2n);
162
+ } else {
163
+ tmp = tmp0_elvis_lhs;
164
+ }
165
+ var segment = tmp;
166
+ var segmentSize = segment.g1();
167
+ if (segmentSize < 2) {
168
+ this.so(2n);
169
+ if (segmentSize === 0) {
170
+ this.cp();
171
+ return this.ep();
172
+ }
173
+ // Inline function 'kotlinx.io.and' call
174
+ var tmp_0 = (this.uo() & 255) << 8;
175
+ // Inline function 'kotlinx.io.and' call
176
+ var tmp$ret$1 = this.uo() & 255;
177
+ return toShort(tmp_0 | tmp$ret$1);
178
+ }
179
+ var v = segment.fp();
180
+ this.po_1 = subtract(this.po_1, 2n);
181
+ if (segmentSize === 2) {
182
+ this.cp();
183
+ }
184
+ return v;
185
+ };
186
+ protoOf(Buffer).gp = function () {
187
+ return Unit_instance;
188
+ };
189
+ protoOf(Buffer).hp = function (out, startIndex, endIndex) {
190
+ checkBounds(this.g1(), startIndex, endIndex);
191
+ if (startIndex === endIndex)
192
+ return Unit_instance;
193
+ var currentOffset = startIndex;
194
+ var remainingByteCount = subtract(endIndex, startIndex);
195
+ out.po_1 = add(out.po_1, remainingByteCount);
196
+ var s = this.no_1;
197
+ while (currentOffset >= fromInt(ensureNotNull(s).xo_1 - s.wo_1 | 0)) {
198
+ currentOffset = subtract(currentOffset, fromInt(s.xo_1 - s.wo_1 | 0));
199
+ s = s.ap_1;
200
+ }
201
+ while (remainingByteCount > 0n) {
202
+ var copy = ensureNotNull(s).ip();
203
+ copy.wo_1 = copy.wo_1 + convertToInt(currentOffset) | 0;
204
+ var tmp = copy;
205
+ var tmp0 = copy.wo_1 + convertToInt(remainingByteCount) | 0;
206
+ // Inline function 'kotlin.comparisons.minOf' call
207
+ var b = copy.xo_1;
208
+ tmp.xo_1 = Math.min(tmp0, b);
209
+ // Inline function 'kotlinx.io.Buffer.pushSegment' call
210
+ if (out.no_1 == null) {
211
+ out.no_1 = copy;
212
+ out.oo_1 = copy;
213
+ } else if (false) {
214
+ out.oo_1 = ensureNotNull(out.oo_1).jp(copy).kp();
215
+ if (ensureNotNull(out.oo_1).bp_1 == null) {
216
+ out.no_1 = out.oo_1;
217
+ }
218
+ } else {
219
+ out.oo_1 = ensureNotNull(out.oo_1).jp(copy);
220
+ }
221
+ remainingByteCount = subtract(remainingByteCount, fromInt(copy.xo_1 - copy.wo_1 | 0));
222
+ currentOffset = 0n;
223
+ s = s.ap_1;
224
+ }
225
+ };
226
+ protoOf(Buffer).lp = function () {
227
+ var result = this.g1();
228
+ if (result === 0n)
229
+ return 0n;
230
+ var tail = ensureNotNull(this.oo_1);
231
+ if (tail.xo_1 < 8192 && tail.zo_1) {
232
+ result = subtract(result, fromInt(tail.xo_1 - tail.wo_1 | 0));
233
+ }
234
+ return result;
235
+ };
236
+ protoOf(Buffer).mp = function (position) {
237
+ if (position < 0n || position >= this.g1()) {
238
+ throw IndexOutOfBoundsException_init_$Create$('position (' + position.toString() + ') is not within the range [0..size(' + this.g1().toString() + '))');
239
+ }
240
+ if (position === 0n) {
241
+ return ensureNotNull(this.no_1).np(0);
242
+ }
243
+ // Inline function 'kotlinx.io.seek' call
244
+ if (this.no_1 == null) {
245
+ return ensureNotNull(null).np(convertToInt(subtract(position, -1n)));
246
+ }
247
+ if (subtract(this.g1(), position) < position) {
248
+ var s = this.oo_1;
249
+ var offset = this.g1();
250
+ $l$loop: while (!(s == null) && offset > position) {
251
+ offset = subtract(offset, fromInt(s.xo_1 - s.wo_1 | 0));
252
+ if (offset <= position)
253
+ break $l$loop;
254
+ s = s.bp_1;
255
+ }
256
+ var tmp0 = s;
257
+ var offset_0 = offset;
258
+ return ensureNotNull(tmp0).np(convertToInt(subtract(position, offset_0)));
259
+ } else {
260
+ var s_0 = this.no_1;
261
+ var offset_1 = 0n;
262
+ $l$loop_0: while (!(s_0 == null)) {
263
+ var tmp0_0 = offset_1;
264
+ // Inline function 'kotlin.Long.plus' call
265
+ var other = s_0.xo_1 - s_0.wo_1 | 0;
266
+ var nextOffset = add(tmp0_0, fromInt(other));
267
+ if (nextOffset > position)
268
+ break $l$loop_0;
269
+ s_0 = s_0.ap_1;
270
+ offset_1 = nextOffset;
271
+ }
272
+ var tmp0_1 = s_0;
273
+ var offset_2 = offset_1;
274
+ return ensureNotNull(tmp0_1).np(convertToInt(subtract(position, offset_2)));
275
+ }
276
+ };
277
+ protoOf(Buffer).n2 = function () {
278
+ return this.op(this.g1());
279
+ };
280
+ protoOf(Buffer).op = function (byteCount) {
281
+ // Inline function 'kotlinx.io.checkByteCount' call
282
+ // Inline function 'kotlin.require' call
283
+ if (!(byteCount >= 0n)) {
284
+ var message = 'byteCount (' + byteCount.toString() + ') < 0';
285
+ throw IllegalArgumentException_init_$Create$(toString(message));
286
+ }
287
+ var remainingByteCount = byteCount;
288
+ while (remainingByteCount > 0n) {
289
+ var tmp0_elvis_lhs = this.no_1;
290
+ var tmp;
291
+ if (tmp0_elvis_lhs == null) {
292
+ throw EOFException_init_$Create$_0('Buffer exhausted before skipping ' + byteCount.toString() + ' bytes.');
293
+ } else {
294
+ tmp = tmp0_elvis_lhs;
295
+ }
296
+ var head = tmp;
297
+ var tmp0 = remainingByteCount;
298
+ // Inline function 'kotlinx.io.minOf' call
299
+ var b = head.xo_1 - head.wo_1 | 0;
300
+ // Inline function 'kotlin.comparisons.minOf' call
301
+ var b_0 = fromInt(b);
302
+ var tmp$ret$4 = tmp0 <= b_0 ? tmp0 : b_0;
303
+ var toSkip = convertToInt(tmp$ret$4);
304
+ this.po_1 = subtract(this.po_1, fromInt(toSkip));
305
+ remainingByteCount = subtract(remainingByteCount, fromInt(toSkip));
306
+ head.wo_1 = head.wo_1 + toSkip | 0;
307
+ if (head.wo_1 === head.xo_1) {
308
+ this.cp();
309
+ }
310
+ }
311
+ };
312
+ protoOf(Buffer).pp = function (sink, startIndex, endIndex) {
313
+ // Inline function 'kotlinx.io.checkBounds' call
314
+ var size = sink.length;
315
+ checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
316
+ var tmp0_elvis_lhs = this.no_1;
317
+ var tmp;
318
+ if (tmp0_elvis_lhs == null) {
319
+ return -1;
320
+ } else {
321
+ tmp = tmp0_elvis_lhs;
322
+ }
323
+ var s = tmp;
324
+ var tmp0 = endIndex - startIndex | 0;
325
+ // Inline function 'kotlin.comparisons.minOf' call
326
+ var b = s.g1();
327
+ var toCopy = Math.min(tmp0, b);
328
+ s.qp(sink, startIndex, startIndex + toCopy | 0);
329
+ this.po_1 = subtract(this.po_1, fromInt(toCopy));
330
+ if (isEmpty(s)) {
331
+ this.cp();
332
+ }
333
+ return toCopy;
334
+ };
335
+ protoOf(Buffer).rp = function (sink, byteCount) {
336
+ // Inline function 'kotlinx.io.checkByteCount' call
337
+ // Inline function 'kotlin.require' call
338
+ if (!(byteCount >= 0n)) {
339
+ var message = 'byteCount (' + byteCount.toString() + ') < 0';
340
+ throw IllegalArgumentException_init_$Create$(toString(message));
341
+ }
342
+ if (this.g1() === 0n)
343
+ return -1n;
344
+ var bytesWritten = byteCount > this.g1() ? this.g1() : byteCount;
345
+ sink.sp(this, bytesWritten);
346
+ return bytesWritten;
347
+ };
348
+ protoOf(Buffer).tp = function (sink, byteCount) {
349
+ // Inline function 'kotlinx.io.checkByteCount' call
350
+ // Inline function 'kotlin.require' call
351
+ if (!(byteCount >= 0n)) {
352
+ var message = 'byteCount (' + byteCount.toString() + ') < 0';
353
+ throw IllegalArgumentException_init_$Create$(toString(message));
354
+ }
355
+ if (this.g1() < byteCount) {
356
+ sink.sp(this, this.g1());
357
+ throw EOFException_init_$Create$_0('Buffer exhausted before writing ' + byteCount.toString() + ' bytes. Only ' + this.g1().toString() + ' bytes were written.');
358
+ }
359
+ sink.sp(this, byteCount);
360
+ };
361
+ protoOf(Buffer).up = function (sink) {
362
+ var byteCount = this.g1();
363
+ if (byteCount > 0n) {
364
+ sink.sp(this, byteCount);
365
+ }
366
+ return byteCount;
367
+ };
368
+ protoOf(Buffer).vp = function () {
369
+ return buffered(new PeekSource(this));
370
+ };
371
+ protoOf(Buffer).wp = function (minimumCapacity) {
372
+ // Inline function 'kotlin.require' call
373
+ if (!(minimumCapacity >= 1 && minimumCapacity <= 8192)) {
374
+ var message = 'unexpected capacity (' + minimumCapacity + '), should be in range [1, 8192]';
375
+ throw IllegalArgumentException_init_$Create$(toString(message));
376
+ }
377
+ if (this.oo_1 == null) {
378
+ var result = SegmentPool_instance.zp();
379
+ this.no_1 = result;
380
+ this.oo_1 = result;
381
+ return result;
382
+ }
383
+ var t = ensureNotNull(this.oo_1);
384
+ if ((t.xo_1 + minimumCapacity | 0) > 8192 || !t.zo_1) {
385
+ var newTail = t.jp(SegmentPool_instance.zp());
386
+ this.oo_1 = newTail;
387
+ return newTail;
388
+ }
389
+ return t;
390
+ };
391
+ protoOf(Buffer).aq = function (source, startIndex, endIndex) {
392
+ // Inline function 'kotlinx.io.checkBounds' call
393
+ var size = source.length;
394
+ checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
395
+ var currentOffset = startIndex;
396
+ while (currentOffset < endIndex) {
397
+ var tail = this.wp(1);
398
+ var tmp0 = endIndex - currentOffset | 0;
399
+ // Inline function 'kotlin.comparisons.minOf' call
400
+ var b = tail.bq();
401
+ var toCopy = Math.min(tmp0, b);
402
+ tail.cq(source, currentOffset, currentOffset + toCopy | 0);
403
+ currentOffset = currentOffset + toCopy | 0;
404
+ }
405
+ var tmp = this;
406
+ var tmp0_0 = this.po_1;
407
+ // Inline function 'kotlin.Long.plus' call
408
+ var other = endIndex - startIndex | 0;
409
+ tmp.po_1 = add(tmp0_0, fromInt(other));
410
+ };
411
+ protoOf(Buffer).eq = function (source, byteCount) {
412
+ // Inline function 'kotlinx.io.checkByteCount' call
413
+ // Inline function 'kotlin.require' call
414
+ if (!(byteCount >= 0n)) {
415
+ var message = 'byteCount (' + byteCount.toString() + ') < 0';
416
+ throw IllegalArgumentException_init_$Create$(toString(message));
417
+ }
418
+ var remainingByteCount = byteCount;
419
+ while (remainingByteCount > 0n) {
420
+ var read = source.rp(this, remainingByteCount);
421
+ if (read === -1n) {
422
+ throw EOFException_init_$Create$_0('Source exhausted before reading ' + byteCount.toString() + ' bytes. ' + ('Only ' + subtract(byteCount, remainingByteCount).toString() + ' were read.'));
423
+ }
424
+ remainingByteCount = subtract(remainingByteCount, read);
425
+ }
426
+ };
427
+ protoOf(Buffer).sp = function (source, byteCount) {
428
+ // Inline function 'kotlin.require' call
429
+ if (!!(source === this)) {
430
+ var message = 'source == this';
431
+ throw IllegalArgumentException_init_$Create$(toString(message));
432
+ }
433
+ checkOffsetAndCount(source.po_1, 0n, byteCount);
434
+ var remainingByteCount = byteCount;
435
+ while (remainingByteCount > 0n) {
436
+ if (remainingByteCount < fromInt(ensureNotNull(source.no_1).g1())) {
437
+ var tail = this.oo_1;
438
+ var tmp;
439
+ if (!(tail == null) && tail.zo_1) {
440
+ var tmp0 = remainingByteCount;
441
+ // Inline function 'kotlin.Long.plus' call
442
+ var other = tail.xo_1;
443
+ var tmp0_0 = add(tmp0, fromInt(other));
444
+ // Inline function 'kotlin.Long.minus' call
445
+ var other_0 = tail.fq() ? 0 : tail.wo_1;
446
+ tmp = subtract(tmp0_0, fromInt(other_0)) <= 8192n;
447
+ } else {
448
+ tmp = false;
449
+ }
450
+ if (tmp) {
451
+ ensureNotNull(source.no_1).hq(tail, convertToInt(remainingByteCount));
452
+ source.po_1 = subtract(source.po_1, remainingByteCount);
453
+ this.po_1 = add(this.po_1, remainingByteCount);
454
+ return Unit_instance;
455
+ } else {
456
+ source.no_1 = ensureNotNull(source.no_1).gq(convertToInt(remainingByteCount));
457
+ }
458
+ }
459
+ var segmentToMove = ensureNotNull(source.no_1);
460
+ var movedByteCount = fromInt(segmentToMove.g1());
461
+ source.no_1 = segmentToMove.iq();
462
+ if (source.no_1 == null) {
463
+ source.oo_1 = null;
464
+ }
465
+ // Inline function 'kotlinx.io.Buffer.pushSegment' call
466
+ if (this.no_1 == null) {
467
+ this.no_1 = segmentToMove;
468
+ this.oo_1 = segmentToMove;
469
+ } else if (true) {
470
+ this.oo_1 = ensureNotNull(this.oo_1).jp(segmentToMove).kp();
471
+ if (ensureNotNull(this.oo_1).bp_1 == null) {
472
+ this.no_1 = this.oo_1;
473
+ }
474
+ } else {
475
+ this.oo_1 = ensureNotNull(this.oo_1).jp(segmentToMove);
476
+ }
477
+ source.po_1 = subtract(source.po_1, movedByteCount);
478
+ this.po_1 = add(this.po_1, movedByteCount);
479
+ remainingByteCount = subtract(remainingByteCount, movedByteCount);
480
+ }
481
+ };
482
+ protoOf(Buffer).jq = function (source) {
483
+ var totalBytesRead = 0n;
484
+ $l$loop: while (true) {
485
+ var readCount = source.rp(this, 8192n);
486
+ if (readCount === -1n)
487
+ break $l$loop;
488
+ totalBytesRead = add(totalBytesRead, readCount);
489
+ }
490
+ return totalBytesRead;
491
+ };
492
+ protoOf(Buffer).kq = function (byte) {
493
+ this.wp(1).lq(byte);
494
+ this.po_1 = add(this.po_1, 1n);
495
+ };
496
+ protoOf(Buffer).mq = function (short) {
497
+ this.wp(2).nq(short);
498
+ this.po_1 = add(this.po_1, 2n);
499
+ };
500
+ protoOf(Buffer).j4 = function () {
501
+ return Unit_instance;
502
+ };
503
+ protoOf(Buffer).toString = function () {
504
+ if (this.g1() === 0n)
505
+ return 'Buffer(size=0)';
506
+ var maxPrintableBytes = 64;
507
+ // Inline function 'kotlinx.io.minOf' call
508
+ var b = this.g1();
509
+ // Inline function 'kotlin.comparisons.minOf' call
510
+ var a = fromInt(maxPrintableBytes);
511
+ var tmp$ret$1 = a <= b ? a : b;
512
+ var len = convertToInt(tmp$ret$1);
513
+ var builder = StringBuilder_init_$Create$(imul(len, 2) + (this.g1() > fromInt(maxPrintableBytes) ? 1 : 0) | 0);
514
+ var bytesWritten = 0;
515
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.forEachSegment' call
516
+ var curr = this.no_1;
517
+ while (!(curr == null)) {
518
+ var tmp0 = get_SegmentReadContextImpl();
519
+ var segment = curr;
520
+ var idx = 0;
521
+ while (bytesWritten < len && idx < segment.g1()) {
522
+ var _unary__edvuaz = idx;
523
+ idx = _unary__edvuaz + 1 | 0;
524
+ var b_0 = tmp0.oq(segment, _unary__edvuaz);
525
+ bytesWritten = bytesWritten + 1 | 0;
526
+ var tmp = get_HEX_DIGIT_CHARS();
527
+ // Inline function 'kotlinx.io.shr' call
528
+ var tmp$ret$2 = b_0 >> 4;
529
+ var tmp_0 = builder.s(tmp[tmp$ret$2 & 15]);
530
+ var tmp_1 = get_HEX_DIGIT_CHARS();
531
+ // Inline function 'kotlinx.io.and' call
532
+ var tmp$ret$3 = b_0 & 15;
533
+ tmp_0.s(tmp_1[tmp$ret$3]);
534
+ }
535
+ curr = curr.ap_1;
536
+ }
537
+ if (this.g1() > fromInt(maxPrintableBytes)) {
538
+ builder.s(_Char___init__impl__6a9atx(8230));
539
+ }
540
+ return 'Buffer(size=' + this.g1().toString() + ' hex=' + builder.toString() + ')';
541
+ };
542
+ protoOf(Buffer).cp = function () {
543
+ var oldHead = ensureNotNull(this.no_1);
544
+ var nextHead = oldHead.ap_1;
545
+ this.no_1 = nextHead;
546
+ if (nextHead == null) {
547
+ this.oo_1 = null;
548
+ } else {
549
+ nextHead.bp_1 = null;
550
+ }
551
+ oldHead.ap_1 = null;
552
+ SegmentPool_instance.pq(oldHead);
553
+ };
554
+ protoOf(Buffer).qq = function () {
555
+ var oldTail = ensureNotNull(this.oo_1);
556
+ var newTail = oldTail.bp_1;
557
+ this.oo_1 = newTail;
558
+ if (newTail == null) {
559
+ this.no_1 = null;
560
+ } else {
561
+ newTail.ap_1 = null;
562
+ }
563
+ oldTail.bp_1 = null;
564
+ SegmentPool_instance.pq(oldTail);
565
+ };
566
+ function indexOf(_this__u8e3s4, byte, startIndex, endIndex) {
567
+ startIndex = startIndex === VOID ? 0n : startIndex;
568
+ endIndex = endIndex === VOID ? _this__u8e3s4.g1() : endIndex;
569
+ // Inline function 'kotlin.comparisons.minOf' call
570
+ var b = _this__u8e3s4.g1();
571
+ var endOffset = endIndex <= b ? endIndex : b;
572
+ checkBounds(_this__u8e3s4.g1(), startIndex, endOffset);
573
+ if (startIndex === endOffset)
574
+ return -1n;
575
+ // Inline function 'kotlinx.io.seek' call
576
+ if (_this__u8e3s4.no_1 == null) {
577
+ if (-1n === -1n) {
578
+ return -1n;
579
+ }
580
+ var segment = null;
581
+ var offset = -1n;
582
+ do {
583
+ // Inline function 'kotlin.check' call
584
+ if (!(endOffset > offset)) {
585
+ throw IllegalStateException_init_$Create$('Check failed.');
586
+ }
587
+ ensureNotNull(segment);
588
+ var tmp = segment;
589
+ // Inline function 'kotlin.comparisons.maxOf' call
590
+ var a = convertToInt(subtract(startIndex, offset));
591
+ var tmp_0 = Math.max(a, 0);
592
+ var tmp0 = segment.g1();
593
+ // Inline function 'kotlin.comparisons.minOf' call
594
+ var b_0 = convertToInt(subtract(endOffset, offset));
595
+ var tmp$ret$3 = Math.min(tmp0, b_0);
596
+ var idx = indexOf_0(tmp, byte, tmp_0, tmp$ret$3);
597
+ if (!(idx === -1)) {
598
+ return add(offset, fromInt(idx));
599
+ }
600
+ var tmp0_0 = offset;
601
+ // Inline function 'kotlin.Long.plus' call
602
+ var other = segment.g1();
603
+ offset = add(tmp0_0, fromInt(other));
604
+ segment = segment.ap_1;
605
+ }
606
+ while (!(segment == null) && offset < endOffset);
607
+ return -1n;
608
+ }
609
+ if (subtract(_this__u8e3s4.g1(), startIndex) < startIndex) {
610
+ var s = _this__u8e3s4.oo_1;
611
+ var offset_0 = _this__u8e3s4.g1();
612
+ $l$loop: while (!(s == null) && offset_0 > startIndex) {
613
+ offset_0 = subtract(offset_0, fromInt(s.xo_1 - s.wo_1 | 0));
614
+ if (offset_0 <= startIndex)
615
+ break $l$loop;
616
+ s = s.bp_1;
617
+ }
618
+ var tmp0_1 = s;
619
+ var o = offset_0;
620
+ if (o === -1n) {
621
+ return -1n;
622
+ }
623
+ var segment_0 = tmp0_1;
624
+ var offset_1 = o;
625
+ do {
626
+ // Inline function 'kotlin.check' call
627
+ if (!(endOffset > offset_1)) {
628
+ throw IllegalStateException_init_$Create$('Check failed.');
629
+ }
630
+ ensureNotNull(segment_0);
631
+ var tmp_1 = segment_0;
632
+ // Inline function 'kotlin.comparisons.maxOf' call
633
+ var a_0 = convertToInt(subtract(startIndex, offset_1));
634
+ var tmp_2 = Math.max(a_0, 0);
635
+ var tmp0_2 = segment_0.g1();
636
+ // Inline function 'kotlin.comparisons.minOf' call
637
+ var b_1 = convertToInt(subtract(endOffset, offset_1));
638
+ var tmp$ret$8 = Math.min(tmp0_2, b_1);
639
+ var idx_0 = indexOf_0(tmp_1, byte, tmp_2, tmp$ret$8);
640
+ if (!(idx_0 === -1)) {
641
+ return add(offset_1, fromInt(idx_0));
642
+ }
643
+ var tmp0_3 = offset_1;
644
+ // Inline function 'kotlin.Long.plus' call
645
+ var other_0 = segment_0.g1();
646
+ offset_1 = add(tmp0_3, fromInt(other_0));
647
+ segment_0 = segment_0.ap_1;
648
+ }
649
+ while (!(segment_0 == null) && offset_1 < endOffset);
650
+ return -1n;
651
+ } else {
652
+ var s_0 = _this__u8e3s4.no_1;
653
+ var offset_2 = 0n;
654
+ $l$loop_0: while (!(s_0 == null)) {
655
+ var tmp0_4 = offset_2;
656
+ // Inline function 'kotlin.Long.plus' call
657
+ var other_1 = s_0.xo_1 - s_0.wo_1 | 0;
658
+ var nextOffset = add(tmp0_4, fromInt(other_1));
659
+ if (nextOffset > startIndex)
660
+ break $l$loop_0;
661
+ s_0 = s_0.ap_1;
662
+ offset_2 = nextOffset;
663
+ }
664
+ var tmp0_5 = s_0;
665
+ var o_0 = offset_2;
666
+ if (o_0 === -1n) {
667
+ return -1n;
668
+ }
669
+ var segment_1 = tmp0_5;
670
+ var offset_3 = o_0;
671
+ do {
672
+ // Inline function 'kotlin.check' call
673
+ if (!(endOffset > offset_3)) {
674
+ throw IllegalStateException_init_$Create$('Check failed.');
675
+ }
676
+ ensureNotNull(segment_1);
677
+ var tmp_3 = segment_1;
678
+ // Inline function 'kotlin.comparisons.maxOf' call
679
+ var a_1 = convertToInt(subtract(startIndex, offset_3));
680
+ var tmp_4 = Math.max(a_1, 0);
681
+ var tmp0_6 = segment_1.g1();
682
+ // Inline function 'kotlin.comparisons.minOf' call
683
+ var b_2 = convertToInt(subtract(endOffset, offset_3));
684
+ var tmp$ret$13 = Math.min(tmp0_6, b_2);
685
+ var idx_1 = indexOf_0(tmp_3, byte, tmp_4, tmp$ret$13);
686
+ if (!(idx_1 === -1)) {
687
+ return add(offset_3, fromInt(idx_1));
688
+ }
689
+ var tmp0_7 = offset_3;
690
+ // Inline function 'kotlin.Long.plus' call
691
+ var other_2 = segment_1.g1();
692
+ offset_3 = add(tmp0_7, fromInt(other_2));
693
+ segment_1 = segment_1.ap_1;
694
+ }
695
+ while (!(segment_1 == null) && offset_3 < endOffset);
696
+ return -1n;
697
+ }
698
+ }
699
+ function readByteString(_this__u8e3s4, byteCount) {
700
+ return UnsafeByteStringOperations_instance.mo(readByteArray_0(_this__u8e3s4, byteCount));
701
+ }
702
+ function buffered(_this__u8e3s4) {
703
+ return new RealSource(_this__u8e3s4);
704
+ }
705
+ function PeekSource(upstream) {
706
+ this.rq_1 = upstream;
707
+ this.sq_1 = this.rq_1.qo();
708
+ this.tq_1 = this.sq_1.no_1;
709
+ var tmp = this;
710
+ var tmp0_safe_receiver = this.sq_1.no_1;
711
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.wo_1;
712
+ tmp.uq_1 = tmp1_elvis_lhs == null ? -1 : tmp1_elvis_lhs;
713
+ this.vq_1 = false;
714
+ this.wq_1 = 0n;
715
+ }
716
+ protoOf(PeekSource).rp = function (sink, byteCount) {
717
+ // Inline function 'kotlin.check' call
718
+ if (!!this.vq_1) {
719
+ var message = 'Source is closed.';
720
+ throw IllegalStateException_init_$Create$(toString(message));
721
+ }
722
+ // Inline function 'kotlinx.io.checkByteCount' call
723
+ // Inline function 'kotlin.require' call
724
+ if (!(byteCount >= 0n)) {
725
+ var message_0 = 'byteCount (' + byteCount.toString() + ') < 0';
726
+ throw IllegalArgumentException_init_$Create$(toString(message_0));
727
+ }
728
+ // Inline function 'kotlin.check' call
729
+ if (!(this.tq_1 == null || (this.tq_1 === this.sq_1.no_1 && this.uq_1 === ensureNotNull(this.sq_1.no_1).wo_1))) {
730
+ var message_1 = 'Peek source is invalid because upstream source was used';
731
+ throw IllegalStateException_init_$Create$(toString(message_1));
732
+ }
733
+ if (byteCount === 0n)
734
+ return 0n;
735
+ // Inline function 'kotlin.Long.plus' call
736
+ var this_0 = this.wq_1;
737
+ var tmp$ret$7 = add(this_0, fromInt(1));
738
+ if (!this.rq_1.to(tmp$ret$7))
739
+ return -1n;
740
+ if (this.tq_1 == null && !(this.sq_1.no_1 == null)) {
741
+ this.tq_1 = this.sq_1.no_1;
742
+ this.uq_1 = ensureNotNull(this.sq_1.no_1).wo_1;
743
+ }
744
+ // Inline function 'kotlin.comparisons.minOf' call
745
+ var b = subtract(this.sq_1.g1(), this.wq_1);
746
+ var toCopy = byteCount <= b ? byteCount : b;
747
+ this.sq_1.hp(sink, this.wq_1, add(this.wq_1, toCopy));
748
+ this.wq_1 = add(this.wq_1, toCopy);
749
+ return toCopy;
750
+ };
751
+ protoOf(PeekSource).j4 = function () {
752
+ this.vq_1 = true;
753
+ };
754
+ function RealSource(source) {
755
+ this.xq_1 = source;
756
+ this.yq_1 = false;
757
+ this.zq_1 = new Buffer();
758
+ }
759
+ protoOf(RealSource).qo = function () {
760
+ return this.zq_1;
761
+ };
762
+ protoOf(RealSource).rp = function (sink, byteCount) {
763
+ // Inline function 'kotlinx.io.RealSource.checkNotClosed' call
764
+ // Inline function 'kotlin.check' call
765
+ if (!!this.yq_1) {
766
+ var message = 'Source is closed.';
767
+ throw IllegalStateException_init_$Create$(toString(message));
768
+ }
769
+ // Inline function 'kotlin.require' call
770
+ if (!(byteCount >= 0n)) {
771
+ var message_0 = 'byteCount: ' + byteCount.toString();
772
+ throw IllegalArgumentException_init_$Create$(toString(message_0));
773
+ }
774
+ if (this.zq_1.g1() === 0n) {
775
+ var read = this.xq_1.rp(this.zq_1, 8192n);
776
+ if (read === -1n)
777
+ return -1n;
778
+ }
779
+ // Inline function 'kotlin.comparisons.minOf' call
780
+ var b = this.zq_1.g1();
781
+ var toRead = byteCount <= b ? byteCount : b;
782
+ return this.zq_1.rp(sink, toRead);
783
+ };
784
+ protoOf(RealSource).ro = function () {
785
+ // Inline function 'kotlinx.io.RealSource.checkNotClosed' call
786
+ // Inline function 'kotlin.check' call
787
+ if (!!this.yq_1) {
788
+ var message = 'Source is closed.';
789
+ throw IllegalStateException_init_$Create$(toString(message));
790
+ }
791
+ return this.zq_1.ro() && this.xq_1.rp(this.zq_1, 8192n) === -1n;
792
+ };
793
+ protoOf(RealSource).so = function (byteCount) {
794
+ if (!this.to(byteCount))
795
+ throw EOFException_init_$Create$_0("Source doesn't contain required number of bytes (" + byteCount.toString() + ').');
796
+ };
797
+ protoOf(RealSource).to = function (byteCount) {
798
+ // Inline function 'kotlinx.io.RealSource.checkNotClosed' call
799
+ // Inline function 'kotlin.check' call
800
+ if (!!this.yq_1) {
801
+ var message = 'Source is closed.';
802
+ throw IllegalStateException_init_$Create$(toString(message));
803
+ }
804
+ // Inline function 'kotlin.require' call
805
+ if (!(byteCount >= 0n)) {
806
+ var message_0 = 'byteCount: ' + byteCount.toString();
807
+ throw IllegalArgumentException_init_$Create$(toString(message_0));
808
+ }
809
+ while (this.zq_1.g1() < byteCount) {
810
+ if (this.xq_1.rp(this.zq_1, 8192n) === -1n)
811
+ return false;
812
+ }
813
+ return true;
814
+ };
815
+ protoOf(RealSource).uo = function () {
816
+ this.so(1n);
817
+ return this.zq_1.uo();
818
+ };
819
+ protoOf(RealSource).pp = function (sink, startIndex, endIndex) {
820
+ // Inline function 'kotlinx.io.checkBounds' call
821
+ var size = sink.length;
822
+ checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
823
+ if (this.zq_1.g1() === 0n) {
824
+ var read = this.xq_1.rp(this.zq_1, 8192n);
825
+ if (read === -1n)
826
+ return -1;
827
+ }
828
+ var tmp0 = endIndex - startIndex | 0;
829
+ // Inline function 'kotlinx.io.minOf' call
830
+ var b = this.zq_1.g1();
831
+ // Inline function 'kotlin.comparisons.minOf' call
832
+ var a = fromInt(tmp0);
833
+ var tmp$ret$2 = a <= b ? a : b;
834
+ var toRead = convertToInt(tmp$ret$2);
835
+ return this.zq_1.pp(sink, startIndex, startIndex + toRead | 0);
836
+ };
837
+ protoOf(RealSource).tp = function (sink, byteCount) {
838
+ try {
839
+ this.so(byteCount);
840
+ } catch ($p) {
841
+ if ($p instanceof EOFException) {
842
+ var e = $p;
843
+ sink.sp(this.zq_1, this.zq_1.g1());
844
+ throw e;
845
+ } else {
846
+ throw $p;
847
+ }
848
+ }
849
+ this.zq_1.tp(sink, byteCount);
850
+ };
851
+ protoOf(RealSource).up = function (sink) {
852
+ var totalBytesWritten = 0n;
853
+ while (!(this.xq_1.rp(this.zq_1, 8192n) === -1n)) {
854
+ var emitByteCount = this.zq_1.lp();
855
+ if (emitByteCount > 0n) {
856
+ totalBytesWritten = add(totalBytesWritten, emitByteCount);
857
+ sink.sp(this.zq_1, emitByteCount);
858
+ }
859
+ }
860
+ if (this.zq_1.g1() > 0n) {
861
+ totalBytesWritten = add(totalBytesWritten, this.zq_1.g1());
862
+ sink.sp(this.zq_1, this.zq_1.g1());
863
+ }
864
+ return totalBytesWritten;
865
+ };
866
+ protoOf(RealSource).ep = function () {
867
+ this.so(2n);
868
+ return this.zq_1.ep();
869
+ };
870
+ protoOf(RealSource).vp = function () {
871
+ // Inline function 'kotlinx.io.RealSource.checkNotClosed' call
872
+ // Inline function 'kotlin.check' call
873
+ if (!!this.yq_1) {
874
+ var message = 'Source is closed.';
875
+ throw IllegalStateException_init_$Create$(toString(message));
876
+ }
877
+ return buffered(new PeekSource(this));
878
+ };
879
+ protoOf(RealSource).j4 = function () {
880
+ if (this.yq_1)
881
+ return Unit_instance;
882
+ this.yq_1 = true;
883
+ this.xq_1.j4();
884
+ this.zq_1.n2();
885
+ };
886
+ protoOf(RealSource).toString = function () {
887
+ return 'buffered(' + toString(this.xq_1) + ')';
888
+ };
889
+ function Segment_init_$Init$($this) {
890
+ Segment.call($this);
891
+ $this.vo_1 = new Int8Array(8192);
892
+ $this.zo_1 = true;
893
+ $this.yo_1 = null;
894
+ return $this;
895
+ }
896
+ function Segment_init_$Create$() {
897
+ return Segment_init_$Init$(objectCreate(protoOf(Segment)));
898
+ }
899
+ function Segment_init_$Init$_0(data, pos, limit, shareToken, owner, $this) {
900
+ Segment.call($this);
901
+ $this.vo_1 = data;
902
+ $this.wo_1 = pos;
903
+ $this.xo_1 = limit;
904
+ $this.yo_1 = shareToken;
905
+ $this.zo_1 = owner;
906
+ return $this;
907
+ }
908
+ function Segment_init_$Create$_0(data, pos, limit, shareToken, owner) {
909
+ return Segment_init_$Init$_0(data, pos, limit, shareToken, owner, objectCreate(protoOf(Segment)));
910
+ }
911
+ function Companion() {
912
+ this.ar_1 = 8192;
913
+ this.br_1 = 1024;
914
+ }
915
+ protoOf(Companion).cr = function () {
916
+ return Segment_init_$Create$();
917
+ };
918
+ var Companion_instance;
919
+ function Companion_getInstance() {
920
+ return Companion_instance;
921
+ }
922
+ protoOf(Segment).fq = function () {
923
+ var tmp0_safe_receiver = this.yo_1;
924
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.dr();
925
+ return tmp1_elvis_lhs == null ? false : tmp1_elvis_lhs;
926
+ };
927
+ protoOf(Segment).ip = function () {
928
+ var tmp0_elvis_lhs = this.yo_1;
929
+ var tmp;
930
+ if (tmp0_elvis_lhs == null) {
931
+ // Inline function 'kotlin.also' call
932
+ var this_0 = SegmentPool_instance.er();
933
+ this.yo_1 = this_0;
934
+ tmp = this_0;
935
+ } else {
936
+ tmp = tmp0_elvis_lhs;
937
+ }
938
+ var t = tmp;
939
+ var tmp_0 = this.wo_1;
940
+ var tmp_1 = this.xo_1;
941
+ // Inline function 'kotlin.also' call
942
+ t.fr();
943
+ return Segment_init_$Create$_0(this.vo_1, tmp_0, tmp_1, t, false);
944
+ };
945
+ protoOf(Segment).iq = function () {
946
+ var result = this.ap_1;
947
+ if (!(this.bp_1 == null)) {
948
+ ensureNotNull(this.bp_1).ap_1 = this.ap_1;
949
+ }
950
+ if (!(this.ap_1 == null)) {
951
+ ensureNotNull(this.ap_1).bp_1 = this.bp_1;
952
+ }
953
+ this.ap_1 = null;
954
+ this.bp_1 = null;
955
+ return result;
956
+ };
957
+ protoOf(Segment).jp = function (segment) {
958
+ segment.bp_1 = this;
959
+ segment.ap_1 = this.ap_1;
960
+ if (!(this.ap_1 == null)) {
961
+ ensureNotNull(this.ap_1).bp_1 = segment;
962
+ }
963
+ this.ap_1 = segment;
964
+ return segment;
965
+ };
966
+ protoOf(Segment).gq = function (byteCount) {
967
+ // Inline function 'kotlin.require' call
968
+ if (!(byteCount > 0 && byteCount <= (this.xo_1 - this.wo_1 | 0))) {
969
+ var message = 'byteCount out of range';
970
+ throw IllegalArgumentException_init_$Create$(toString(message));
971
+ }
972
+ var prefix;
973
+ if (byteCount >= 1024) {
974
+ prefix = this.ip();
975
+ } else {
976
+ prefix = SegmentPool_instance.zp();
977
+ var tmp0 = this.vo_1;
978
+ var tmp2 = prefix.vo_1;
979
+ var tmp5 = this.wo_1;
980
+ // Inline function 'kotlin.collections.copyInto' call
981
+ var endIndex = this.wo_1 + byteCount | 0;
982
+ // Inline function 'kotlin.js.unsafeCast' call
983
+ // Inline function 'kotlin.js.asDynamic' call
984
+ var tmp = tmp0;
985
+ // Inline function 'kotlin.js.unsafeCast' call
986
+ // Inline function 'kotlin.js.asDynamic' call
987
+ arrayCopy(tmp, tmp2, 0, tmp5, endIndex);
988
+ }
989
+ prefix.xo_1 = prefix.wo_1 + byteCount | 0;
990
+ this.wo_1 = this.wo_1 + byteCount | 0;
991
+ if (!(this.bp_1 == null)) {
992
+ ensureNotNull(this.bp_1).jp(prefix);
993
+ } else {
994
+ prefix.ap_1 = this;
995
+ this.bp_1 = prefix;
996
+ }
997
+ return prefix;
998
+ };
999
+ protoOf(Segment).kp = function () {
1000
+ // Inline function 'kotlin.check' call
1001
+ if (!!(this.bp_1 == null)) {
1002
+ var message = 'cannot compact';
1003
+ throw IllegalStateException_init_$Create$(toString(message));
1004
+ }
1005
+ if (!ensureNotNull(this.bp_1).zo_1)
1006
+ return this;
1007
+ var byteCount = this.xo_1 - this.wo_1 | 0;
1008
+ var availableByteCount = (8192 - ensureNotNull(this.bp_1).xo_1 | 0) + (ensureNotNull(this.bp_1).fq() ? 0 : ensureNotNull(this.bp_1).wo_1) | 0;
1009
+ if (byteCount > availableByteCount)
1010
+ return this;
1011
+ var predecessor = this.bp_1;
1012
+ this.hq(ensureNotNull(predecessor), byteCount);
1013
+ var successor = this.iq();
1014
+ // Inline function 'kotlin.check' call
1015
+ if (!(successor == null)) {
1016
+ throw IllegalStateException_init_$Create$('Check failed.');
1017
+ }
1018
+ SegmentPool_instance.pq(this);
1019
+ return predecessor;
1020
+ };
1021
+ protoOf(Segment).lq = function (byte) {
1022
+ var _unary__edvuaz = this.xo_1;
1023
+ this.xo_1 = _unary__edvuaz + 1 | 0;
1024
+ this.vo_1[_unary__edvuaz] = byte;
1025
+ };
1026
+ protoOf(Segment).nq = function (short) {
1027
+ var data = this.vo_1;
1028
+ var limit = this.xo_1;
1029
+ var _unary__edvuaz = limit;
1030
+ limit = _unary__edvuaz + 1 | 0;
1031
+ data[_unary__edvuaz] = toByte((short >>> 8 | 0) & 255);
1032
+ var _unary__edvuaz_0 = limit;
1033
+ limit = _unary__edvuaz_0 + 1 | 0;
1034
+ data[_unary__edvuaz_0] = toByte(short & 255);
1035
+ this.xo_1 = limit;
1036
+ };
1037
+ protoOf(Segment).dp = function () {
1038
+ var _unary__edvuaz = this.wo_1;
1039
+ this.wo_1 = _unary__edvuaz + 1 | 0;
1040
+ return this.vo_1[_unary__edvuaz];
1041
+ };
1042
+ protoOf(Segment).fp = function () {
1043
+ var data = this.vo_1;
1044
+ var pos = this.wo_1;
1045
+ var _unary__edvuaz = pos;
1046
+ pos = _unary__edvuaz + 1 | 0;
1047
+ // Inline function 'kotlinx.io.and' call
1048
+ var tmp = (data[_unary__edvuaz] & 255) << 8;
1049
+ var _unary__edvuaz_0 = pos;
1050
+ pos = _unary__edvuaz_0 + 1 | 0;
1051
+ // Inline function 'kotlinx.io.and' call
1052
+ var tmp$ret$1 = data[_unary__edvuaz_0] & 255;
1053
+ var s = toShort(tmp | tmp$ret$1);
1054
+ this.wo_1 = pos;
1055
+ return s;
1056
+ };
1057
+ protoOf(Segment).hq = function (sink, byteCount) {
1058
+ // Inline function 'kotlin.check' call
1059
+ if (!sink.zo_1) {
1060
+ var message = 'only owner can write';
1061
+ throw IllegalStateException_init_$Create$(toString(message));
1062
+ }
1063
+ if ((sink.xo_1 + byteCount | 0) > 8192) {
1064
+ if (sink.fq())
1065
+ throw IllegalArgumentException_init_$Create$_0();
1066
+ if (((sink.xo_1 + byteCount | 0) - sink.wo_1 | 0) > 8192)
1067
+ throw IllegalArgumentException_init_$Create$_0();
1068
+ var tmp0 = sink.vo_1;
1069
+ var tmp2 = sink.vo_1;
1070
+ var tmp5 = sink.wo_1;
1071
+ // Inline function 'kotlin.collections.copyInto' call
1072
+ var endIndex = sink.xo_1;
1073
+ // Inline function 'kotlin.js.unsafeCast' call
1074
+ // Inline function 'kotlin.js.asDynamic' call
1075
+ var tmp = tmp0;
1076
+ // Inline function 'kotlin.js.unsafeCast' call
1077
+ // Inline function 'kotlin.js.asDynamic' call
1078
+ arrayCopy(tmp, tmp2, 0, tmp5, endIndex);
1079
+ sink.xo_1 = sink.xo_1 - sink.wo_1 | 0;
1080
+ sink.wo_1 = 0;
1081
+ }
1082
+ var tmp0_0 = this.vo_1;
1083
+ var tmp2_0 = sink.vo_1;
1084
+ var tmp4 = sink.xo_1;
1085
+ var tmp6 = this.wo_1;
1086
+ // Inline function 'kotlin.collections.copyInto' call
1087
+ var endIndex_0 = this.wo_1 + byteCount | 0;
1088
+ // Inline function 'kotlin.js.unsafeCast' call
1089
+ // Inline function 'kotlin.js.asDynamic' call
1090
+ var tmp_0 = tmp0_0;
1091
+ // Inline function 'kotlin.js.unsafeCast' call
1092
+ // Inline function 'kotlin.js.asDynamic' call
1093
+ arrayCopy(tmp_0, tmp2_0, tmp4, tmp6, endIndex_0);
1094
+ sink.xo_1 = sink.xo_1 + byteCount | 0;
1095
+ this.wo_1 = this.wo_1 + byteCount | 0;
1096
+ };
1097
+ protoOf(Segment).qp = function (dst, dstStartOffset, dstEndOffset) {
1098
+ var len = dstEndOffset - dstStartOffset | 0;
1099
+ var tmp0 = this.vo_1;
1100
+ var tmp6 = this.wo_1;
1101
+ // Inline function 'kotlin.collections.copyInto' call
1102
+ var endIndex = this.wo_1 + len | 0;
1103
+ // Inline function 'kotlin.js.unsafeCast' call
1104
+ // Inline function 'kotlin.js.asDynamic' call
1105
+ var tmp = tmp0;
1106
+ // Inline function 'kotlin.js.unsafeCast' call
1107
+ // Inline function 'kotlin.js.asDynamic' call
1108
+ arrayCopy(tmp, dst, dstStartOffset, tmp6, endIndex);
1109
+ this.wo_1 = this.wo_1 + len | 0;
1110
+ };
1111
+ protoOf(Segment).cq = function (src, srcStartOffset, srcEndOffset) {
1112
+ var tmp2 = this.vo_1;
1113
+ // Inline function 'kotlin.collections.copyInto' call
1114
+ var destinationOffset = this.xo_1;
1115
+ // Inline function 'kotlin.js.unsafeCast' call
1116
+ // Inline function 'kotlin.js.asDynamic' call
1117
+ var tmp = src;
1118
+ // Inline function 'kotlin.js.unsafeCast' call
1119
+ // Inline function 'kotlin.js.asDynamic' call
1120
+ arrayCopy(tmp, tmp2, destinationOffset, srcStartOffset, srcEndOffset);
1121
+ this.xo_1 = this.xo_1 + (srcEndOffset - srcStartOffset | 0) | 0;
1122
+ };
1123
+ protoOf(Segment).g1 = function () {
1124
+ return this.xo_1 - this.wo_1 | 0;
1125
+ };
1126
+ protoOf(Segment).bq = function () {
1127
+ return this.vo_1.length - this.xo_1 | 0;
1128
+ };
1129
+ protoOf(Segment).gr = function (readOnly) {
1130
+ return this.vo_1;
1131
+ };
1132
+ protoOf(Segment).np = function (index) {
1133
+ return this.vo_1[this.wo_1 + index | 0];
1134
+ };
1135
+ protoOf(Segment).hr = function (index, value) {
1136
+ this.vo_1[this.xo_1 + index | 0] = value;
1137
+ };
1138
+ protoOf(Segment).ir = function (index, b0, b1) {
1139
+ var d = this.vo_1;
1140
+ var l = this.xo_1;
1141
+ d[l + index | 0] = b0;
1142
+ d[(l + index | 0) + 1 | 0] = b1;
1143
+ };
1144
+ protoOf(Segment).jr = function (index, b0, b1, b2) {
1145
+ var d = this.vo_1;
1146
+ var l = this.xo_1;
1147
+ d[l + index | 0] = b0;
1148
+ d[(l + index | 0) + 1 | 0] = b1;
1149
+ d[(l + index | 0) + 2 | 0] = b2;
1150
+ };
1151
+ protoOf(Segment).kr = function (index, b0, b1, b2, b3) {
1152
+ var d = this.vo_1;
1153
+ var l = this.xo_1;
1154
+ d[l + index | 0] = b0;
1155
+ d[(l + index | 0) + 1 | 0] = b1;
1156
+ d[(l + index | 0) + 2 | 0] = b2;
1157
+ d[(l + index | 0) + 3 | 0] = b3;
1158
+ };
1159
+ function Segment() {
1160
+ this.wo_1 = 0;
1161
+ this.xo_1 = 0;
1162
+ this.yo_1 = null;
1163
+ this.zo_1 = false;
1164
+ this.ap_1 = null;
1165
+ this.bp_1 = null;
1166
+ }
1167
+ function isEmpty(_this__u8e3s4) {
1168
+ return _this__u8e3s4.g1() === 0;
1169
+ }
1170
+ function SegmentCopyTracker() {
1171
+ }
1172
+ function AlwaysSharedCopyTracker() {
1173
+ AlwaysSharedCopyTracker_instance = this;
1174
+ SegmentCopyTracker.call(this);
1175
+ }
1176
+ protoOf(AlwaysSharedCopyTracker).dr = function () {
1177
+ return true;
1178
+ };
1179
+ protoOf(AlwaysSharedCopyTracker).fr = function () {
1180
+ return Unit_instance;
1181
+ };
1182
+ var AlwaysSharedCopyTracker_instance;
1183
+ function AlwaysSharedCopyTracker_getInstance() {
1184
+ if (AlwaysSharedCopyTracker_instance == null)
1185
+ new AlwaysSharedCopyTracker();
1186
+ return AlwaysSharedCopyTracker_instance;
1187
+ }
1188
+ function indexOf_0(_this__u8e3s4, byte, startOffset, endOffset) {
1189
+ // Inline function 'kotlin.require' call
1190
+ if (!(0 <= startOffset ? startOffset < _this__u8e3s4.g1() : false)) {
1191
+ var message = '' + startOffset;
1192
+ throw IllegalArgumentException_init_$Create$(toString(message));
1193
+ }
1194
+ // Inline function 'kotlin.require' call
1195
+ if (!(startOffset <= endOffset ? endOffset <= _this__u8e3s4.g1() : false)) {
1196
+ var message_0 = '' + endOffset;
1197
+ throw IllegalArgumentException_init_$Create$(toString(message_0));
1198
+ }
1199
+ var p = _this__u8e3s4.wo_1;
1200
+ var data = _this__u8e3s4.gr(true);
1201
+ var inductionVariable = startOffset;
1202
+ if (inductionVariable < endOffset)
1203
+ do {
1204
+ var idx = inductionVariable;
1205
+ inductionVariable = inductionVariable + 1 | 0;
1206
+ if (data[p + idx | 0] === byte) {
1207
+ return idx;
1208
+ }
1209
+ }
1210
+ while (inductionVariable < endOffset);
1211
+ return -1;
1212
+ }
1213
+ function Sink() {
1214
+ }
1215
+ function Source() {
1216
+ }
1217
+ function readByteArray(_this__u8e3s4) {
1218
+ return readByteArrayImpl(_this__u8e3s4, -1);
1219
+ }
1220
+ function readByteArray_0(_this__u8e3s4, byteCount) {
1221
+ // Inline function 'kotlinx.io.checkByteCount' call
1222
+ var byteCount_0 = fromInt(byteCount);
1223
+ // Inline function 'kotlin.require' call
1224
+ if (!(byteCount_0 >= 0n)) {
1225
+ var message = 'byteCount (' + byteCount_0.toString() + ') < 0';
1226
+ throw IllegalArgumentException_init_$Create$(toString(message));
1227
+ }
1228
+ return readByteArrayImpl(_this__u8e3s4, byteCount);
1229
+ }
1230
+ function indexOf_1(_this__u8e3s4, byte, startIndex, endIndex) {
1231
+ startIndex = startIndex === VOID ? 0n : startIndex;
1232
+ endIndex = endIndex === VOID ? 9223372036854775807n : endIndex;
1233
+ // Inline function 'kotlin.require' call
1234
+ if (!(0n <= startIndex ? startIndex <= endIndex : false)) {
1235
+ var tmp;
1236
+ if (endIndex < 0n) {
1237
+ tmp = 'startIndex (' + startIndex.toString() + ') and endIndex (' + endIndex.toString() + ') should be non negative';
1238
+ } else {
1239
+ tmp = 'startIndex (' + startIndex.toString() + ') is not within the range [0..endIndex(' + endIndex.toString() + '))';
1240
+ }
1241
+ var message = tmp;
1242
+ throw IllegalArgumentException_init_$Create$(toString(message));
1243
+ }
1244
+ if (startIndex === endIndex)
1245
+ return -1n;
1246
+ var offset = startIndex;
1247
+ $l$loop: while (true) {
1248
+ var tmp_0;
1249
+ if (offset < endIndex) {
1250
+ // Inline function 'kotlin.Long.plus' call
1251
+ var this_0 = offset;
1252
+ var tmp$ret$2 = add(this_0, fromInt(1));
1253
+ tmp_0 = _this__u8e3s4.to(tmp$ret$2);
1254
+ } else {
1255
+ tmp_0 = false;
1256
+ }
1257
+ if (!tmp_0) {
1258
+ break $l$loop;
1259
+ }
1260
+ var tmp_1 = _this__u8e3s4.qo();
1261
+ var tmp_2 = offset;
1262
+ // Inline function 'kotlin.comparisons.minOf' call
1263
+ var b = _this__u8e3s4.qo().g1();
1264
+ var tmp$ret$3 = endIndex <= b ? endIndex : b;
1265
+ var idx = indexOf(tmp_1, byte, tmp_2, tmp$ret$3);
1266
+ if (!(idx === -1n)) {
1267
+ return idx;
1268
+ }
1269
+ offset = _this__u8e3s4.qo().g1();
1270
+ }
1271
+ return -1n;
1272
+ }
1273
+ function readByteArrayImpl(_this__u8e3s4, size) {
1274
+ var arraySize = size;
1275
+ if (size === -1) {
1276
+ var fetchSize = 2147483647n;
1277
+ while (_this__u8e3s4.qo().g1() < 2147483647n && _this__u8e3s4.to(fetchSize)) {
1278
+ // Inline function 'kotlin.Long.times' call
1279
+ var this_0 = fetchSize;
1280
+ fetchSize = multiply(this_0, fromInt(2));
1281
+ }
1282
+ // Inline function 'kotlin.check' call
1283
+ if (!(_this__u8e3s4.qo().g1() < 2147483647n)) {
1284
+ var message = "Can't create an array of size " + _this__u8e3s4.qo().g1().toString();
1285
+ throw IllegalStateException_init_$Create$(toString(message));
1286
+ }
1287
+ arraySize = convertToInt(_this__u8e3s4.qo().g1());
1288
+ } else {
1289
+ _this__u8e3s4.so(fromInt(size));
1290
+ }
1291
+ var array = new Int8Array(arraySize);
1292
+ readTo(_this__u8e3s4.qo(), array);
1293
+ return array;
1294
+ }
1295
+ function readTo(_this__u8e3s4, sink, startIndex, endIndex) {
1296
+ startIndex = startIndex === VOID ? 0 : startIndex;
1297
+ endIndex = endIndex === VOID ? sink.length : endIndex;
1298
+ // Inline function 'kotlinx.io.checkBounds' call
1299
+ var size = sink.length;
1300
+ checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
1301
+ var offset = startIndex;
1302
+ while (offset < endIndex) {
1303
+ var bytesRead = _this__u8e3s4.pp(sink, offset, endIndex);
1304
+ if (bytesRead === -1) {
1305
+ throw EOFException_init_$Create$_0('Source exhausted before reading ' + (endIndex - startIndex | 0) + ' bytes. ' + ('Only ' + bytesRead + ' bytes were read.'));
1306
+ }
1307
+ offset = offset + bytesRead | 0;
1308
+ }
1309
+ }
1310
+ function readString(_this__u8e3s4, byteCount) {
1311
+ _this__u8e3s4.so(byteCount);
1312
+ return commonReadUtf8(_this__u8e3s4.qo(), byteCount);
1313
+ }
1314
+ function readString_0(_this__u8e3s4) {
1315
+ _this__u8e3s4.to(9223372036854775807n);
1316
+ return commonReadUtf8(_this__u8e3s4.qo(), _this__u8e3s4.qo().g1());
1317
+ }
1318
+ function writeString(_this__u8e3s4, string, startIndex, endIndex) {
1319
+ startIndex = startIndex === VOID ? 0 : startIndex;
1320
+ endIndex = endIndex === VOID ? string.length : endIndex;
1321
+ // Inline function 'kotlinx.io.checkBounds' call
1322
+ var size = string.length;
1323
+ checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
1324
+ // Inline function 'kotlinx.io.writeToInternalBuffer' call
1325
+ // Inline function 'kotlinx.io.commonWriteUtf8' call
1326
+ var this_0 = _this__u8e3s4.qo();
1327
+ var i = startIndex;
1328
+ while (i < endIndex) {
1329
+ var p0 = i;
1330
+ // Inline function 'kotlin.code' call
1331
+ var this_1 = charCodeAt(string, p0);
1332
+ var c = Char__toInt_impl_vasixd(this_1);
1333
+ if (c < 128) {
1334
+ $l$block_0: {
1335
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
1336
+ var tail = this_0.wp(1);
1337
+ var ctx = get_SegmentWriteContextImpl();
1338
+ var segmentOffset = -i | 0;
1339
+ // Inline function 'kotlin.comparisons.minOf' call
1340
+ var b = i + tail.bq() | 0;
1341
+ var runLimit = Math.min(endIndex, b);
1342
+ var _unary__edvuaz = i;
1343
+ i = _unary__edvuaz + 1 | 0;
1344
+ ctx.or(tail, segmentOffset + _unary__edvuaz | 0, toByte(c));
1345
+ $l$loop: while (i < runLimit) {
1346
+ var p0_0 = i;
1347
+ // Inline function 'kotlin.code' call
1348
+ var this_2 = charCodeAt(string, p0_0);
1349
+ c = Char__toInt_impl_vasixd(this_2);
1350
+ if (c >= 128)
1351
+ break $l$loop;
1352
+ var _unary__edvuaz_0 = i;
1353
+ i = _unary__edvuaz_0 + 1 | 0;
1354
+ ctx.or(tail, segmentOffset + _unary__edvuaz_0 | 0, toByte(c));
1355
+ }
1356
+ var bytesWritten = i + segmentOffset | 0;
1357
+ if (bytesWritten === 1) {
1358
+ tail.xo_1 = tail.xo_1 + bytesWritten | 0;
1359
+ var tmp = this_0;
1360
+ // Inline function 'kotlin.Long.plus' call
1361
+ var this_3 = this_0.po_1;
1362
+ tmp.po_1 = add(this_3, fromInt(bytesWritten));
1363
+ break $l$block_0;
1364
+ }
1365
+ // Inline function 'kotlin.check' call
1366
+ if (!(0 <= bytesWritten ? bytesWritten <= tail.bq() : false)) {
1367
+ var message = 'Invalid number of bytes written: ' + bytesWritten + '. Should be in 0..' + tail.bq();
1368
+ throw IllegalStateException_init_$Create$(toString(message));
1369
+ }
1370
+ if (!(bytesWritten === 0)) {
1371
+ tail.xo_1 = tail.xo_1 + bytesWritten | 0;
1372
+ var tmp_0 = this_0;
1373
+ // Inline function 'kotlin.Long.plus' call
1374
+ var this_4 = this_0.po_1;
1375
+ tmp_0.po_1 = add(this_4, fromInt(bytesWritten));
1376
+ break $l$block_0;
1377
+ }
1378
+ if (isEmpty(tail)) {
1379
+ this_0.qq();
1380
+ }
1381
+ }
1382
+ } else if (c < 2048) {
1383
+ $l$block_2: {
1384
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
1385
+ var tail_0 = this_0.wp(2);
1386
+ get_SegmentWriteContextImpl().nr(tail_0, 0, toByte(c >> 6 | 192), toByte(c & 63 | 128));
1387
+ var bytesWritten_0 = 2;
1388
+ if (bytesWritten_0 === 2) {
1389
+ tail_0.xo_1 = tail_0.xo_1 + bytesWritten_0 | 0;
1390
+ var tmp_1 = this_0;
1391
+ // Inline function 'kotlin.Long.plus' call
1392
+ var this_5 = this_0.po_1;
1393
+ tmp_1.po_1 = add(this_5, fromInt(bytesWritten_0));
1394
+ break $l$block_2;
1395
+ }
1396
+ // Inline function 'kotlin.check' call
1397
+ if (!(0 <= bytesWritten_0 ? bytesWritten_0 <= tail_0.bq() : false)) {
1398
+ var message_0 = 'Invalid number of bytes written: ' + bytesWritten_0 + '. Should be in 0..' + tail_0.bq();
1399
+ throw IllegalStateException_init_$Create$(toString(message_0));
1400
+ }
1401
+ if (!(bytesWritten_0 === 0)) {
1402
+ tail_0.xo_1 = tail_0.xo_1 + bytesWritten_0 | 0;
1403
+ var tmp_2 = this_0;
1404
+ // Inline function 'kotlin.Long.plus' call
1405
+ var this_6 = this_0.po_1;
1406
+ tmp_2.po_1 = add(this_6, fromInt(bytesWritten_0));
1407
+ break $l$block_2;
1408
+ }
1409
+ if (isEmpty(tail_0)) {
1410
+ this_0.qq();
1411
+ }
1412
+ }
1413
+ i = i + 1 | 0;
1414
+ } else if (c < 55296 || c > 57343) {
1415
+ $l$block_4: {
1416
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
1417
+ var tail_1 = this_0.wp(3);
1418
+ get_SegmentWriteContextImpl().mr(tail_1, 0, toByte(c >> 12 | 224), toByte(c >> 6 & 63 | 128), toByte(c & 63 | 128));
1419
+ var bytesWritten_1 = 3;
1420
+ if (bytesWritten_1 === 3) {
1421
+ tail_1.xo_1 = tail_1.xo_1 + bytesWritten_1 | 0;
1422
+ var tmp_3 = this_0;
1423
+ // Inline function 'kotlin.Long.plus' call
1424
+ var this_7 = this_0.po_1;
1425
+ tmp_3.po_1 = add(this_7, fromInt(bytesWritten_1));
1426
+ break $l$block_4;
1427
+ }
1428
+ // Inline function 'kotlin.check' call
1429
+ if (!(0 <= bytesWritten_1 ? bytesWritten_1 <= tail_1.bq() : false)) {
1430
+ var message_1 = 'Invalid number of bytes written: ' + bytesWritten_1 + '. Should be in 0..' + tail_1.bq();
1431
+ throw IllegalStateException_init_$Create$(toString(message_1));
1432
+ }
1433
+ if (!(bytesWritten_1 === 0)) {
1434
+ tail_1.xo_1 = tail_1.xo_1 + bytesWritten_1 | 0;
1435
+ var tmp_4 = this_0;
1436
+ // Inline function 'kotlin.Long.plus' call
1437
+ var this_8 = this_0.po_1;
1438
+ tmp_4.po_1 = add(this_8, fromInt(bytesWritten_1));
1439
+ break $l$block_4;
1440
+ }
1441
+ if (isEmpty(tail_1)) {
1442
+ this_0.qq();
1443
+ }
1444
+ }
1445
+ i = i + 1 | 0;
1446
+ } else {
1447
+ var tmp_5;
1448
+ if ((i + 1 | 0) < endIndex) {
1449
+ var p0_1 = i + 1 | 0;
1450
+ // Inline function 'kotlin.code' call
1451
+ var this_9 = charCodeAt(string, p0_1);
1452
+ tmp_5 = Char__toInt_impl_vasixd(this_9);
1453
+ } else {
1454
+ tmp_5 = 0;
1455
+ }
1456
+ var low = tmp_5;
1457
+ if (c > 56319 || !(56320 <= low ? low <= 57343 : false)) {
1458
+ // Inline function 'kotlin.code' call
1459
+ var this_10 = _Char___init__impl__6a9atx(63);
1460
+ var tmp$ret$26 = Char__toInt_impl_vasixd(this_10);
1461
+ this_0.kq(toByte(tmp$ret$26));
1462
+ i = i + 1 | 0;
1463
+ } else {
1464
+ var codePoint = 65536 + ((c & 1023) << 10 | low & 1023) | 0;
1465
+ $l$block_6: {
1466
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
1467
+ var tail_2 = this_0.wp(4);
1468
+ get_SegmentWriteContextImpl().lr(tail_2, 0, toByte(codePoint >> 18 | 240), toByte(codePoint >> 12 & 63 | 128), toByte(codePoint >> 6 & 63 | 128), toByte(codePoint & 63 | 128));
1469
+ var bytesWritten_2 = 4;
1470
+ if (bytesWritten_2 === 4) {
1471
+ tail_2.xo_1 = tail_2.xo_1 + bytesWritten_2 | 0;
1472
+ var tmp_6 = this_0;
1473
+ // Inline function 'kotlin.Long.plus' call
1474
+ var this_11 = this_0.po_1;
1475
+ tmp_6.po_1 = add(this_11, fromInt(bytesWritten_2));
1476
+ break $l$block_6;
1477
+ }
1478
+ // Inline function 'kotlin.check' call
1479
+ if (!(0 <= bytesWritten_2 ? bytesWritten_2 <= tail_2.bq() : false)) {
1480
+ var message_2 = 'Invalid number of bytes written: ' + bytesWritten_2 + '. Should be in 0..' + tail_2.bq();
1481
+ throw IllegalStateException_init_$Create$(toString(message_2));
1482
+ }
1483
+ if (!(bytesWritten_2 === 0)) {
1484
+ tail_2.xo_1 = tail_2.xo_1 + bytesWritten_2 | 0;
1485
+ var tmp_7 = this_0;
1486
+ // Inline function 'kotlin.Long.plus' call
1487
+ var this_12 = this_0.po_1;
1488
+ tmp_7.po_1 = add(this_12, fromInt(bytesWritten_2));
1489
+ break $l$block_6;
1490
+ }
1491
+ if (isEmpty(tail_2)) {
1492
+ this_0.qq();
1493
+ }
1494
+ }
1495
+ i = i + 2 | 0;
1496
+ }
1497
+ }
1498
+ }
1499
+ _this__u8e3s4.gp();
1500
+ }
1501
+ function commonReadUtf8(_this__u8e3s4, byteCount) {
1502
+ if (byteCount === 0n)
1503
+ return '';
1504
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.forEachSegment' call
1505
+ var curr = _this__u8e3s4.no_1;
1506
+ while (!(curr == null)) {
1507
+ get_SegmentReadContextImpl();
1508
+ if (fromInt(curr.g1()) >= byteCount) {
1509
+ var result = '';
1510
+ // Inline function 'kotlinx.io.unsafe.withData' call
1511
+ var tmp0 = curr.gr(true);
1512
+ var tmp2 = curr.wo_1;
1513
+ var tmp0_0 = curr.xo_1;
1514
+ // Inline function 'kotlin.math.min' call
1515
+ var b = tmp2 + convertToInt(byteCount) | 0;
1516
+ var tmp$ret$0 = Math.min(tmp0_0, b);
1517
+ result = commonToUtf8String(tmp0, tmp2, tmp$ret$0);
1518
+ _this__u8e3s4.op(byteCount);
1519
+ return result;
1520
+ }
1521
+ return commonToUtf8String(readByteArray_0(_this__u8e3s4, convertToInt(byteCount)));
1522
+ }
1523
+ // Inline function 'kotlin.error' call
1524
+ var message = 'Unreacheable';
1525
+ throw IllegalStateException_init_$Create$(toString(message));
1526
+ }
1527
+ function commonToUtf8String(_this__u8e3s4, beginIndex, endIndex) {
1528
+ beginIndex = beginIndex === VOID ? 0 : beginIndex;
1529
+ endIndex = endIndex === VOID ? _this__u8e3s4.length : endIndex;
1530
+ if (beginIndex < 0 || endIndex > _this__u8e3s4.length || beginIndex > endIndex) {
1531
+ throw IndexOutOfBoundsException_init_$Create$('size=' + _this__u8e3s4.length + ' beginIndex=' + beginIndex + ' endIndex=' + endIndex);
1532
+ }
1533
+ var chars = charArray(endIndex - beginIndex | 0);
1534
+ var length = 0;
1535
+ // Inline function 'kotlinx.io.internal.processUtf16Chars' call
1536
+ var index = beginIndex;
1537
+ while (index < endIndex) {
1538
+ var b0 = _this__u8e3s4[index];
1539
+ if (b0 >= 0) {
1540
+ var c = numberToChar(b0);
1541
+ var _unary__edvuaz = length;
1542
+ length = _unary__edvuaz + 1 | 0;
1543
+ chars[_unary__edvuaz] = c;
1544
+ index = index + 1 | 0;
1545
+ while (index < endIndex && _this__u8e3s4[index] >= 0) {
1546
+ var _unary__edvuaz_0 = index;
1547
+ index = _unary__edvuaz_0 + 1 | 0;
1548
+ var c_0 = numberToChar(_this__u8e3s4[_unary__edvuaz_0]);
1549
+ var _unary__edvuaz_1 = length;
1550
+ length = _unary__edvuaz_1 + 1 | 0;
1551
+ chars[_unary__edvuaz_1] = c_0;
1552
+ }
1553
+ } else {
1554
+ // Inline function 'kotlinx.io.shr' call
1555
+ if (b0 >> 5 === -2) {
1556
+ var tmp = index;
1557
+ var tmp2 = index;
1558
+ var tmp$ret$5;
1559
+ $l$block_0: {
1560
+ // Inline function 'kotlinx.io.internal.process2Utf8Bytes' call
1561
+ if (endIndex <= (tmp2 + 1 | 0)) {
1562
+ var c_1 = numberToChar(65533);
1563
+ var _unary__edvuaz_2 = length;
1564
+ length = _unary__edvuaz_2 + 1 | 0;
1565
+ chars[_unary__edvuaz_2] = c_1;
1566
+ tmp$ret$5 = 1;
1567
+ break $l$block_0;
1568
+ }
1569
+ var b0_0 = _this__u8e3s4[tmp2];
1570
+ var b1 = _this__u8e3s4[tmp2 + 1 | 0];
1571
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1572
+ // Inline function 'kotlinx.io.and' call
1573
+ if (!((b1 & 192) === 128)) {
1574
+ var c_2 = numberToChar(65533);
1575
+ var _unary__edvuaz_3 = length;
1576
+ length = _unary__edvuaz_3 + 1 | 0;
1577
+ chars[_unary__edvuaz_3] = c_2;
1578
+ tmp$ret$5 = 1;
1579
+ break $l$block_0;
1580
+ }
1581
+ var codePoint = 3968 ^ b1 ^ b0_0 << 6;
1582
+ if (codePoint < 128) {
1583
+ var c_3 = numberToChar(65533);
1584
+ var _unary__edvuaz_4 = length;
1585
+ length = _unary__edvuaz_4 + 1 | 0;
1586
+ chars[_unary__edvuaz_4] = c_3;
1587
+ } else {
1588
+ var c_4 = numberToChar(codePoint);
1589
+ var _unary__edvuaz_5 = length;
1590
+ length = _unary__edvuaz_5 + 1 | 0;
1591
+ chars[_unary__edvuaz_5] = c_4;
1592
+ }
1593
+ tmp$ret$5 = 2;
1594
+ }
1595
+ index = tmp + tmp$ret$5 | 0;
1596
+ } else {
1597
+ // Inline function 'kotlinx.io.shr' call
1598
+ if (b0 >> 4 === -2) {
1599
+ var tmp_0 = index;
1600
+ var tmp2_0 = index;
1601
+ var tmp$ret$19;
1602
+ $l$block_4: {
1603
+ // Inline function 'kotlinx.io.internal.process3Utf8Bytes' call
1604
+ if (endIndex <= (tmp2_0 + 2 | 0)) {
1605
+ var c_5 = numberToChar(65533);
1606
+ var _unary__edvuaz_6 = length;
1607
+ length = _unary__edvuaz_6 + 1 | 0;
1608
+ chars[_unary__edvuaz_6] = c_5;
1609
+ var tmp_1;
1610
+ if (endIndex <= (tmp2_0 + 1 | 0)) {
1611
+ tmp_1 = true;
1612
+ } else {
1613
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1614
+ // Inline function 'kotlinx.io.and' call
1615
+ tmp_1 = !((_this__u8e3s4[tmp2_0 + 1 | 0] & 192) === 128);
1616
+ }
1617
+ if (tmp_1) {
1618
+ tmp$ret$19 = 1;
1619
+ break $l$block_4;
1620
+ } else {
1621
+ tmp$ret$19 = 2;
1622
+ break $l$block_4;
1623
+ }
1624
+ }
1625
+ var b0_1 = _this__u8e3s4[tmp2_0];
1626
+ var b1_0 = _this__u8e3s4[tmp2_0 + 1 | 0];
1627
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1628
+ // Inline function 'kotlinx.io.and' call
1629
+ if (!((b1_0 & 192) === 128)) {
1630
+ var c_6 = numberToChar(65533);
1631
+ var _unary__edvuaz_7 = length;
1632
+ length = _unary__edvuaz_7 + 1 | 0;
1633
+ chars[_unary__edvuaz_7] = c_6;
1634
+ tmp$ret$19 = 1;
1635
+ break $l$block_4;
1636
+ }
1637
+ var b2 = _this__u8e3s4[tmp2_0 + 2 | 0];
1638
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1639
+ // Inline function 'kotlinx.io.and' call
1640
+ if (!((b2 & 192) === 128)) {
1641
+ var c_7 = numberToChar(65533);
1642
+ var _unary__edvuaz_8 = length;
1643
+ length = _unary__edvuaz_8 + 1 | 0;
1644
+ chars[_unary__edvuaz_8] = c_7;
1645
+ tmp$ret$19 = 2;
1646
+ break $l$block_4;
1647
+ }
1648
+ var codePoint_0 = -123008 ^ b2 ^ b1_0 << 6 ^ b0_1 << 12;
1649
+ if (codePoint_0 < 2048) {
1650
+ var c_8 = numberToChar(65533);
1651
+ var _unary__edvuaz_9 = length;
1652
+ length = _unary__edvuaz_9 + 1 | 0;
1653
+ chars[_unary__edvuaz_9] = c_8;
1654
+ } else if (55296 <= codePoint_0 ? codePoint_0 <= 57343 : false) {
1655
+ var c_9 = numberToChar(65533);
1656
+ var _unary__edvuaz_10 = length;
1657
+ length = _unary__edvuaz_10 + 1 | 0;
1658
+ chars[_unary__edvuaz_10] = c_9;
1659
+ } else {
1660
+ var c_10 = numberToChar(codePoint_0);
1661
+ var _unary__edvuaz_11 = length;
1662
+ length = _unary__edvuaz_11 + 1 | 0;
1663
+ chars[_unary__edvuaz_11] = c_10;
1664
+ }
1665
+ tmp$ret$19 = 3;
1666
+ }
1667
+ index = tmp_0 + tmp$ret$19 | 0;
1668
+ } else {
1669
+ // Inline function 'kotlinx.io.shr' call
1670
+ if (b0 >> 3 === -2) {
1671
+ var tmp_2 = index;
1672
+ var tmp2_1 = index;
1673
+ var tmp$ret$41;
1674
+ $l$block_10: {
1675
+ // Inline function 'kotlinx.io.internal.process4Utf8Bytes' call
1676
+ if (endIndex <= (tmp2_1 + 3 | 0)) {
1677
+ if (!(65533 === 65533)) {
1678
+ var c_11 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1679
+ var _unary__edvuaz_12 = length;
1680
+ length = _unary__edvuaz_12 + 1 | 0;
1681
+ chars[_unary__edvuaz_12] = c_11;
1682
+ var c_12 = numberToChar((65533 & 1023) + 56320 | 0);
1683
+ var _unary__edvuaz_13 = length;
1684
+ length = _unary__edvuaz_13 + 1 | 0;
1685
+ chars[_unary__edvuaz_13] = c_12;
1686
+ } else {
1687
+ var c_13 = _Char___init__impl__6a9atx(65533);
1688
+ var _unary__edvuaz_14 = length;
1689
+ length = _unary__edvuaz_14 + 1 | 0;
1690
+ chars[_unary__edvuaz_14] = c_13;
1691
+ }
1692
+ var tmp_3;
1693
+ if (endIndex <= (tmp2_1 + 1 | 0)) {
1694
+ tmp_3 = true;
1695
+ } else {
1696
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1697
+ // Inline function 'kotlinx.io.and' call
1698
+ tmp_3 = !((_this__u8e3s4[tmp2_1 + 1 | 0] & 192) === 128);
1699
+ }
1700
+ if (tmp_3) {
1701
+ tmp$ret$41 = 1;
1702
+ break $l$block_10;
1703
+ } else {
1704
+ var tmp_4;
1705
+ if (endIndex <= (tmp2_1 + 2 | 0)) {
1706
+ tmp_4 = true;
1707
+ } else {
1708
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1709
+ // Inline function 'kotlinx.io.and' call
1710
+ tmp_4 = !((_this__u8e3s4[tmp2_1 + 2 | 0] & 192) === 128);
1711
+ }
1712
+ if (tmp_4) {
1713
+ tmp$ret$41 = 2;
1714
+ break $l$block_10;
1715
+ } else {
1716
+ tmp$ret$41 = 3;
1717
+ break $l$block_10;
1718
+ }
1719
+ }
1720
+ }
1721
+ var b0_2 = _this__u8e3s4[tmp2_1];
1722
+ var b1_1 = _this__u8e3s4[tmp2_1 + 1 | 0];
1723
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1724
+ // Inline function 'kotlinx.io.and' call
1725
+ if (!((b1_1 & 192) === 128)) {
1726
+ if (!(65533 === 65533)) {
1727
+ var c_14 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1728
+ var _unary__edvuaz_15 = length;
1729
+ length = _unary__edvuaz_15 + 1 | 0;
1730
+ chars[_unary__edvuaz_15] = c_14;
1731
+ var c_15 = numberToChar((65533 & 1023) + 56320 | 0);
1732
+ var _unary__edvuaz_16 = length;
1733
+ length = _unary__edvuaz_16 + 1 | 0;
1734
+ chars[_unary__edvuaz_16] = c_15;
1735
+ } else {
1736
+ var c_16 = _Char___init__impl__6a9atx(65533);
1737
+ var _unary__edvuaz_17 = length;
1738
+ length = _unary__edvuaz_17 + 1 | 0;
1739
+ chars[_unary__edvuaz_17] = c_16;
1740
+ }
1741
+ tmp$ret$41 = 1;
1742
+ break $l$block_10;
1743
+ }
1744
+ var b2_0 = _this__u8e3s4[tmp2_1 + 2 | 0];
1745
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1746
+ // Inline function 'kotlinx.io.and' call
1747
+ if (!((b2_0 & 192) === 128)) {
1748
+ if (!(65533 === 65533)) {
1749
+ var c_17 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1750
+ var _unary__edvuaz_18 = length;
1751
+ length = _unary__edvuaz_18 + 1 | 0;
1752
+ chars[_unary__edvuaz_18] = c_17;
1753
+ var c_18 = numberToChar((65533 & 1023) + 56320 | 0);
1754
+ var _unary__edvuaz_19 = length;
1755
+ length = _unary__edvuaz_19 + 1 | 0;
1756
+ chars[_unary__edvuaz_19] = c_18;
1757
+ } else {
1758
+ var c_19 = _Char___init__impl__6a9atx(65533);
1759
+ var _unary__edvuaz_20 = length;
1760
+ length = _unary__edvuaz_20 + 1 | 0;
1761
+ chars[_unary__edvuaz_20] = c_19;
1762
+ }
1763
+ tmp$ret$41 = 2;
1764
+ break $l$block_10;
1765
+ }
1766
+ var b3 = _this__u8e3s4[tmp2_1 + 3 | 0];
1767
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1768
+ // Inline function 'kotlinx.io.and' call
1769
+ if (!((b3 & 192) === 128)) {
1770
+ if (!(65533 === 65533)) {
1771
+ var c_20 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1772
+ var _unary__edvuaz_21 = length;
1773
+ length = _unary__edvuaz_21 + 1 | 0;
1774
+ chars[_unary__edvuaz_21] = c_20;
1775
+ var c_21 = numberToChar((65533 & 1023) + 56320 | 0);
1776
+ var _unary__edvuaz_22 = length;
1777
+ length = _unary__edvuaz_22 + 1 | 0;
1778
+ chars[_unary__edvuaz_22] = c_21;
1779
+ } else {
1780
+ var c_22 = _Char___init__impl__6a9atx(65533);
1781
+ var _unary__edvuaz_23 = length;
1782
+ length = _unary__edvuaz_23 + 1 | 0;
1783
+ chars[_unary__edvuaz_23] = c_22;
1784
+ }
1785
+ tmp$ret$41 = 3;
1786
+ break $l$block_10;
1787
+ }
1788
+ var codePoint_1 = 3678080 ^ b3 ^ b2_0 << 6 ^ b1_1 << 12 ^ b0_2 << 18;
1789
+ if (codePoint_1 > 1114111) {
1790
+ if (!(65533 === 65533)) {
1791
+ var c_23 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1792
+ var _unary__edvuaz_24 = length;
1793
+ length = _unary__edvuaz_24 + 1 | 0;
1794
+ chars[_unary__edvuaz_24] = c_23;
1795
+ var c_24 = numberToChar((65533 & 1023) + 56320 | 0);
1796
+ var _unary__edvuaz_25 = length;
1797
+ length = _unary__edvuaz_25 + 1 | 0;
1798
+ chars[_unary__edvuaz_25] = c_24;
1799
+ } else {
1800
+ var c_25 = _Char___init__impl__6a9atx(65533);
1801
+ var _unary__edvuaz_26 = length;
1802
+ length = _unary__edvuaz_26 + 1 | 0;
1803
+ chars[_unary__edvuaz_26] = c_25;
1804
+ }
1805
+ } else if (55296 <= codePoint_1 ? codePoint_1 <= 57343 : false) {
1806
+ if (!(65533 === 65533)) {
1807
+ var c_26 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1808
+ var _unary__edvuaz_27 = length;
1809
+ length = _unary__edvuaz_27 + 1 | 0;
1810
+ chars[_unary__edvuaz_27] = c_26;
1811
+ var c_27 = numberToChar((65533 & 1023) + 56320 | 0);
1812
+ var _unary__edvuaz_28 = length;
1813
+ length = _unary__edvuaz_28 + 1 | 0;
1814
+ chars[_unary__edvuaz_28] = c_27;
1815
+ } else {
1816
+ var c_28 = _Char___init__impl__6a9atx(65533);
1817
+ var _unary__edvuaz_29 = length;
1818
+ length = _unary__edvuaz_29 + 1 | 0;
1819
+ chars[_unary__edvuaz_29] = c_28;
1820
+ }
1821
+ } else if (codePoint_1 < 65536) {
1822
+ if (!(65533 === 65533)) {
1823
+ var c_29 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1824
+ var _unary__edvuaz_30 = length;
1825
+ length = _unary__edvuaz_30 + 1 | 0;
1826
+ chars[_unary__edvuaz_30] = c_29;
1827
+ var c_30 = numberToChar((65533 & 1023) + 56320 | 0);
1828
+ var _unary__edvuaz_31 = length;
1829
+ length = _unary__edvuaz_31 + 1 | 0;
1830
+ chars[_unary__edvuaz_31] = c_30;
1831
+ } else {
1832
+ var c_31 = _Char___init__impl__6a9atx(65533);
1833
+ var _unary__edvuaz_32 = length;
1834
+ length = _unary__edvuaz_32 + 1 | 0;
1835
+ chars[_unary__edvuaz_32] = c_31;
1836
+ }
1837
+ } else {
1838
+ if (!(codePoint_1 === 65533)) {
1839
+ var c_32 = numberToChar((codePoint_1 >>> 10 | 0) + 55232 | 0);
1840
+ var _unary__edvuaz_33 = length;
1841
+ length = _unary__edvuaz_33 + 1 | 0;
1842
+ chars[_unary__edvuaz_33] = c_32;
1843
+ var c_33 = numberToChar((codePoint_1 & 1023) + 56320 | 0);
1844
+ var _unary__edvuaz_34 = length;
1845
+ length = _unary__edvuaz_34 + 1 | 0;
1846
+ chars[_unary__edvuaz_34] = c_33;
1847
+ } else {
1848
+ var c_34 = _Char___init__impl__6a9atx(65533);
1849
+ var _unary__edvuaz_35 = length;
1850
+ length = _unary__edvuaz_35 + 1 | 0;
1851
+ chars[_unary__edvuaz_35] = c_34;
1852
+ }
1853
+ }
1854
+ tmp$ret$41 = 4;
1855
+ }
1856
+ index = tmp_2 + tmp$ret$41 | 0;
1857
+ } else {
1858
+ var c_35 = _Char___init__impl__6a9atx(65533);
1859
+ var _unary__edvuaz_36 = length;
1860
+ length = _unary__edvuaz_36 + 1 | 0;
1861
+ chars[_unary__edvuaz_36] = c_35;
1862
+ index = index + 1 | 0;
1863
+ }
1864
+ }
1865
+ }
1866
+ }
1867
+ }
1868
+ return concatToString(chars, 0, length);
1869
+ }
1870
+ function get_SegmentReadContextImpl() {
1871
+ _init_properties_UnsafeBufferOperations_kt__xw75gy();
1872
+ return SegmentReadContextImpl;
1873
+ }
1874
+ var SegmentReadContextImpl;
1875
+ function get_SegmentWriteContextImpl() {
1876
+ _init_properties_UnsafeBufferOperations_kt__xw75gy();
1877
+ return SegmentWriteContextImpl;
1878
+ }
1879
+ var SegmentWriteContextImpl;
1880
+ var BufferIterationContextImpl;
1881
+ function UnsafeBufferOperations() {
1882
+ }
1883
+ var UnsafeBufferOperations_instance;
1884
+ function UnsafeBufferOperations_getInstance() {
1885
+ return UnsafeBufferOperations_instance;
1886
+ }
1887
+ function SegmentReadContextImpl$1() {
1888
+ }
1889
+ protoOf(SegmentReadContextImpl$1).oq = function (segment, offset) {
1890
+ return segment.np(offset);
1891
+ };
1892
+ function SegmentWriteContextImpl$1() {
1893
+ }
1894
+ protoOf(SegmentWriteContextImpl$1).or = function (segment, offset, value) {
1895
+ segment.hr(offset, value);
1896
+ };
1897
+ protoOf(SegmentWriteContextImpl$1).nr = function (segment, offset, b0, b1) {
1898
+ segment.ir(offset, b0, b1);
1899
+ };
1900
+ protoOf(SegmentWriteContextImpl$1).mr = function (segment, offset, b0, b1, b2) {
1901
+ segment.jr(offset, b0, b1, b2);
1902
+ };
1903
+ protoOf(SegmentWriteContextImpl$1).lr = function (segment, offset, b0, b1, b2, b3) {
1904
+ segment.kr(offset, b0, b1, b2, b3);
1905
+ };
1906
+ function BufferIterationContextImpl$1() {
1907
+ }
1908
+ protoOf(BufferIterationContextImpl$1).oq = function (segment, offset) {
1909
+ return get_SegmentReadContextImpl().oq(segment, offset);
1910
+ };
1911
+ var properties_initialized_UnsafeBufferOperations_kt_2xfgoc;
1912
+ function _init_properties_UnsafeBufferOperations_kt__xw75gy() {
1913
+ if (!properties_initialized_UnsafeBufferOperations_kt_2xfgoc) {
1914
+ properties_initialized_UnsafeBufferOperations_kt_2xfgoc = true;
1915
+ SegmentReadContextImpl = new SegmentReadContextImpl$1();
1916
+ SegmentWriteContextImpl = new SegmentWriteContextImpl$1();
1917
+ BufferIterationContextImpl = new BufferIterationContextImpl$1();
1918
+ }
1919
+ }
1920
+ function IOException_init_$Init$($this) {
1921
+ Exception_init_$Init$($this);
1922
+ IOException.call($this);
1923
+ return $this;
1924
+ }
1925
+ function IOException_init_$Create$() {
1926
+ var tmp = IOException_init_$Init$(objectCreate(protoOf(IOException)));
1927
+ captureStack(tmp, IOException_init_$Create$);
1928
+ return tmp;
1929
+ }
1930
+ function IOException_init_$Init$_0(message, $this) {
1931
+ Exception_init_$Init$_0(message, $this);
1932
+ IOException.call($this);
1933
+ return $this;
1934
+ }
1935
+ function IOException_init_$Create$_0(message) {
1936
+ var tmp = IOException_init_$Init$_0(message, objectCreate(protoOf(IOException)));
1937
+ captureStack(tmp, IOException_init_$Create$_0);
1938
+ return tmp;
1939
+ }
1940
+ function IOException_init_$Init$_1(message, cause, $this) {
1941
+ Exception_init_$Init$_1(message, cause, $this);
1942
+ IOException.call($this);
1943
+ return $this;
1944
+ }
1945
+ function IOException_init_$Create$_1(message, cause) {
1946
+ var tmp = IOException_init_$Init$_1(message, cause, objectCreate(protoOf(IOException)));
1947
+ captureStack(tmp, IOException_init_$Create$_1);
1948
+ return tmp;
1949
+ }
1950
+ function IOException() {
1951
+ captureStack(this, IOException);
1952
+ }
1953
+ function EOFException_init_$Init$($this) {
1954
+ IOException_init_$Init$($this);
1955
+ EOFException.call($this);
1956
+ return $this;
1957
+ }
1958
+ function EOFException_init_$Create$() {
1959
+ var tmp = EOFException_init_$Init$(objectCreate(protoOf(EOFException)));
1960
+ captureStack(tmp, EOFException_init_$Create$);
1961
+ return tmp;
1962
+ }
1963
+ function EOFException_init_$Init$_0(message, $this) {
1964
+ IOException_init_$Init$_0(message, $this);
1965
+ EOFException.call($this);
1966
+ return $this;
1967
+ }
1968
+ function EOFException_init_$Create$_0(message) {
1969
+ var tmp = EOFException_init_$Init$_0(message, objectCreate(protoOf(EOFException)));
1970
+ captureStack(tmp, EOFException_init_$Create$_0);
1971
+ return tmp;
1972
+ }
1973
+ function EOFException() {
1974
+ captureStack(this, EOFException);
1975
+ }
1976
+ function SegmentPool() {
1977
+ this.xp_1 = 0;
1978
+ this.yp_1 = 0;
1979
+ }
1980
+ protoOf(SegmentPool).zp = function () {
1981
+ return Companion_instance.cr();
1982
+ };
1983
+ protoOf(SegmentPool).pq = function (segment) {
1984
+ };
1985
+ protoOf(SegmentPool).er = function () {
1986
+ return AlwaysSharedCopyTracker_getInstance();
1987
+ };
1988
+ var SegmentPool_instance;
1989
+ function SegmentPool_getInstance() {
1990
+ return SegmentPool_instance;
1991
+ }
1992
+ //region block: post-declaration
1993
+ protoOf(Buffer).dq = write$default;
1994
+ //endregion
1995
+ //region block: init
1996
+ Companion_instance = new Companion();
1997
+ UnsafeBufferOperations_instance = new UnsafeBufferOperations();
1998
+ SegmentPool_instance = new SegmentPool();
1999
+ //endregion
2000
+ //region block: exports
2001
+ export {
2002
+ EOFException_init_$Create$_0 as EOFException_init_$Create$35zn64u2vfdrf,
2003
+ IOException_init_$Init$_0 as IOException_init_$Init$wyx5mfudk66d,
2004
+ IOException_init_$Create$_0 as IOException_init_$Create$3s3kcdlhouh9j,
2005
+ IOException_init_$Init$_1 as IOException_init_$Init$1najp4oty5euc,
2006
+ IOException_init_$Create$_1 as IOException_init_$Create$3dh7c73wuug74,
2007
+ Buffer as Buffergs925ekssbch,
2008
+ IOException as IOException1wyutdmfe71nu,
2009
+ Source as Source1shr0ps16u4p4,
2010
+ indexOf_1 as indexOf29nspdgx2e3ap,
2011
+ readByteArray_0 as readByteArray1fhzfwi2j014k,
2012
+ readByteArray as readByteArray1ri21h2rciakw,
2013
+ readByteString as readByteString2hnsbql6t4ads,
2014
+ readString_0 as readString2nvggcfaijfhd,
2015
+ readString as readString3v6duspiz33tv,
2016
+ writeString as writeString33ca4btrgctw7,
2017
+ };
2018
+ //endregion
2019
+
2020
+ //# sourceMappingURL=kotlinx-io-kotlinx-io-core.mjs.map