@fuzionx/client 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1344 @@
1
+ /* @ts-self-types="./fuzionx_client_wasm.d.ts" */
2
+
3
+ /**
4
+ * 브라우저 ASP 클라이언트.
5
+ *
6
+ * `master_secret`을 보유하고, 현재 도메인 + UA 기반으로
7
+ * ASP transport 키를 유도하여 암/복호화를 수행한다.
8
+ */
9
+ export class RuxyClient {
10
+ static __wrap(ptr) {
11
+ ptr = ptr >>> 0;
12
+ const obj = Object.create(RuxyClient.prototype);
13
+ obj.__wbg_ptr = ptr;
14
+ RuxyClientFinalization.register(obj, obj.__wbg_ptr, obj);
15
+ return obj;
16
+ }
17
+ __destroy_into_raw() {
18
+ const ptr = this.__wbg_ptr;
19
+ this.__wbg_ptr = 0;
20
+ RuxyClientFinalization.unregister(this);
21
+ return ptr;
22
+ }
23
+ free() {
24
+ const ptr = this.__destroy_into_raw();
25
+ wasm.__wbg_ruxyclient_free(ptr, 0);
26
+ }
27
+ /**
28
+ * 범용 복호화.
29
+ * @param {string} key
30
+ * @param {string} data
31
+ * @returns {string}
32
+ */
33
+ decrypt_custom(key, data) {
34
+ let deferred4_0;
35
+ let deferred4_1;
36
+ try {
37
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
38
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
39
+ const len0 = WASM_VECTOR_LEN;
40
+ const ptr1 = passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
41
+ const len1 = WASM_VECTOR_LEN;
42
+ wasm.ruxyclient_decrypt_custom(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
43
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
44
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
45
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
46
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
47
+ var ptr3 = r0;
48
+ var len3 = r1;
49
+ if (r3) {
50
+ ptr3 = 0; len3 = 0;
51
+ throw takeObject(r2);
52
+ }
53
+ deferred4_0 = ptr3;
54
+ deferred4_1 = len3;
55
+ return getStringFromWasm0(ptr3, len3);
56
+ } finally {
57
+ wasm.__wbindgen_add_to_stack_pointer(16);
58
+ wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
59
+ }
60
+ }
61
+ /**
62
+ * ASP Transport 복호화.
63
+ * @param {string} path
64
+ * @param {string} encrypted
65
+ * @param {number} timestamp
66
+ * @returns {string}
67
+ */
68
+ decrypt_transport(path, encrypted, timestamp) {
69
+ let deferred4_0;
70
+ let deferred4_1;
71
+ try {
72
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
73
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
74
+ const len0 = WASM_VECTOR_LEN;
75
+ const ptr1 = passStringToWasm0(encrypted, wasm.__wbindgen_export, wasm.__wbindgen_export2);
76
+ const len1 = WASM_VECTOR_LEN;
77
+ wasm.ruxyclient_decrypt_transport(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, timestamp);
78
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
79
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
80
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
81
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
82
+ var ptr3 = r0;
83
+ var len3 = r1;
84
+ if (r3) {
85
+ ptr3 = 0; len3 = 0;
86
+ throw takeObject(r2);
87
+ }
88
+ deferred4_0 = ptr3;
89
+ deferred4_1 = len3;
90
+ return getStringFromWasm0(ptr3, len3);
91
+ } finally {
92
+ wasm.__wbindgen_add_to_stack_pointer(16);
93
+ wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
94
+ }
95
+ }
96
+ /**
97
+ * DELETE 요청.
98
+ * @param {string} path
99
+ * @param {boolean | null} [encrypt]
100
+ * @returns {Promise<any>}
101
+ */
102
+ delete(path, encrypt) {
103
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
104
+ const len0 = WASM_VECTOR_LEN;
105
+ const ret = wasm.ruxyclient_delete(this.__wbg_ptr, ptr0, len0, isLikeNone(encrypt) ? 0xFFFFFF : encrypt ? 1 : 0);
106
+ return takeObject(ret);
107
+ }
108
+ /**
109
+ * 키 유도 결과를 hex로 반환 (테스트용).
110
+ * @param {string} path
111
+ * @param {number} timestamp
112
+ * @returns {string}
113
+ */
114
+ derive_key_hex(path, timestamp) {
115
+ let deferred2_0;
116
+ let deferred2_1;
117
+ try {
118
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
119
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
120
+ const len0 = WASM_VECTOR_LEN;
121
+ wasm.ruxyclient_derive_key_hex(retptr, this.__wbg_ptr, ptr0, len0, timestamp);
122
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
123
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
124
+ deferred2_0 = r0;
125
+ deferred2_1 = r1;
126
+ return getStringFromWasm0(r0, r1);
127
+ } finally {
128
+ wasm.__wbindgen_add_to_stack_pointer(16);
129
+ wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
130
+ }
131
+ }
132
+ /**
133
+ * 범용 암호화: SHA256(key) → AES-256-GCM + Nibble Swap.
134
+ * @param {string} key
135
+ * @param {string} data
136
+ * @returns {string}
137
+ */
138
+ encrypt_custom(key, data) {
139
+ let deferred4_0;
140
+ let deferred4_1;
141
+ try {
142
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
143
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
144
+ const len0 = WASM_VECTOR_LEN;
145
+ const ptr1 = passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
146
+ const len1 = WASM_VECTOR_LEN;
147
+ wasm.ruxyclient_encrypt_custom(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
148
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
149
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
150
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
151
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
152
+ var ptr3 = r0;
153
+ var len3 = r1;
154
+ if (r3) {
155
+ ptr3 = 0; len3 = 0;
156
+ throw takeObject(r2);
157
+ }
158
+ deferred4_0 = ptr3;
159
+ deferred4_1 = len3;
160
+ return getStringFromWasm0(ptr3, len3);
161
+ } finally {
162
+ wasm.__wbindgen_add_to_stack_pointer(16);
163
+ wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
164
+ }
165
+ }
166
+ /**
167
+ * ASP Transport 암호화.
168
+ *
169
+ * `master_secret` + 현재 도메인 + UA + path + timestamp 기반 키 유도 후 암호화.
170
+ * @param {string} path
171
+ * @param {string} data
172
+ * @param {number} timestamp
173
+ * @returns {string}
174
+ */
175
+ encrypt_transport(path, data, timestamp) {
176
+ let deferred4_0;
177
+ let deferred4_1;
178
+ try {
179
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
180
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
181
+ const len0 = WASM_VECTOR_LEN;
182
+ const ptr1 = passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
183
+ const len1 = WASM_VECTOR_LEN;
184
+ wasm.ruxyclient_encrypt_transport(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, timestamp);
185
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
186
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
187
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
188
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
189
+ var ptr3 = r0;
190
+ var len3 = r1;
191
+ if (r3) {
192
+ ptr3 = 0; len3 = 0;
193
+ throw takeObject(r2);
194
+ }
195
+ deferred4_0 = ptr3;
196
+ deferred4_1 = len3;
197
+ return getStringFromWasm0(ptr3, len3);
198
+ } finally {
199
+ wasm.__wbindgen_add_to_stack_pointer(16);
200
+ wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
201
+ }
202
+ }
203
+ /**
204
+ * GET 요청. `encrypt` = true면 ASP 암호화 적용.
205
+ * @param {string} path
206
+ * @param {boolean | null} [encrypt]
207
+ * @returns {Promise<any>}
208
+ */
209
+ get(path, encrypt) {
210
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
211
+ const len0 = WASM_VECTOR_LEN;
212
+ const ret = wasm.ruxyclient_get(this.__wbg_ptr, ptr0, len0, isLikeNone(encrypt) ? 0xFFFFFF : encrypt ? 1 : 0);
213
+ return takeObject(ret);
214
+ }
215
+ /**
216
+ * ASP 헤더 시그널 이름을 반환한다.
217
+ * @returns {string}
218
+ */
219
+ get_header_signal() {
220
+ let deferred1_0;
221
+ let deferred1_1;
222
+ try {
223
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
224
+ wasm.ruxyclient_get_header_signal(retptr, this.__wbg_ptr);
225
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
226
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
227
+ deferred1_0 = r0;
228
+ deferred1_1 = r1;
229
+ return getStringFromWasm0(r0, r1);
230
+ } finally {
231
+ wasm.__wbindgen_add_to_stack_pointer(16);
232
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
233
+ }
234
+ }
235
+ /**
236
+ * 클라이언트를 생성한다.
237
+ *
238
+ * `window.navigator.userAgent`와 `window.location.host`를 자동 추출.
239
+ * @param {string} master_secret
240
+ */
241
+ constructor(master_secret) {
242
+ try {
243
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
244
+ const ptr0 = passStringToWasm0(master_secret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
245
+ const len0 = WASM_VECTOR_LEN;
246
+ wasm.ruxyclient_new(retptr, ptr0, len0);
247
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
248
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
249
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
250
+ if (r2) {
251
+ throw takeObject(r1);
252
+ }
253
+ this.__wbg_ptr = r0 >>> 0;
254
+ RuxyClientFinalization.register(this, this.__wbg_ptr, this);
255
+ return this;
256
+ } finally {
257
+ wasm.__wbindgen_add_to_stack_pointer(16);
258
+ }
259
+ }
260
+ /**
261
+ * header_signal을 지정하여 생성 (서버 YAML `asp.header_signal`과 일치시켜야 함).
262
+ * @param {string} master_secret
263
+ * @param {string | null} [header_signal]
264
+ * @returns {RuxyClient}
265
+ */
266
+ static new_with_options(master_secret, header_signal) {
267
+ try {
268
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
269
+ const ptr0 = passStringToWasm0(master_secret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
270
+ const len0 = WASM_VECTOR_LEN;
271
+ var ptr1 = isLikeNone(header_signal) ? 0 : passStringToWasm0(header_signal, wasm.__wbindgen_export, wasm.__wbindgen_export2);
272
+ var len1 = WASM_VECTOR_LEN;
273
+ wasm.ruxyclient_new_with_options(retptr, ptr0, len0, ptr1, len1);
274
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
275
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
276
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
277
+ if (r2) {
278
+ throw takeObject(r1);
279
+ }
280
+ return RuxyClient.__wrap(r0);
281
+ } finally {
282
+ wasm.__wbindgen_add_to_stack_pointer(16);
283
+ }
284
+ }
285
+ /**
286
+ * PATCH 요청.
287
+ * @param {string} path
288
+ * @param {any} body
289
+ * @param {boolean | null} [encrypt]
290
+ * @returns {Promise<any>}
291
+ */
292
+ patch(path, body, encrypt) {
293
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
294
+ const len0 = WASM_VECTOR_LEN;
295
+ const ret = wasm.ruxyclient_patch(this.__wbg_ptr, ptr0, len0, addHeapObject(body), isLikeNone(encrypt) ? 0xFFFFFF : encrypt ? 1 : 0);
296
+ return takeObject(ret);
297
+ }
298
+ /**
299
+ * POST 요청.
300
+ * @param {string} path
301
+ * @param {any} body
302
+ * @param {boolean | null} [encrypt]
303
+ * @returns {Promise<any>}
304
+ */
305
+ post(path, body, encrypt) {
306
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
307
+ const len0 = WASM_VECTOR_LEN;
308
+ const ret = wasm.ruxyclient_post(this.__wbg_ptr, ptr0, len0, addHeapObject(body), isLikeNone(encrypt) ? 0xFFFFFF : encrypt ? 1 : 0);
309
+ return takeObject(ret);
310
+ }
311
+ /**
312
+ * PUT 요청.
313
+ * @param {string} path
314
+ * @param {any} body
315
+ * @param {boolean | null} [encrypt]
316
+ * @returns {Promise<any>}
317
+ */
318
+ put(path, body, encrypt) {
319
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
320
+ const len0 = WASM_VECTOR_LEN;
321
+ const ret = wasm.ruxyclient_put(this.__wbg_ptr, ptr0, len0, addHeapObject(body), isLikeNone(encrypt) ? 0xFFFFFF : encrypt ? 1 : 0);
322
+ return takeObject(ret);
323
+ }
324
+ /**
325
+ * UUID v4 생성.
326
+ * @returns {string}
327
+ */
328
+ uuid() {
329
+ let deferred1_0;
330
+ let deferred1_1;
331
+ try {
332
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
333
+ wasm.ruxyclient_uuid(retptr, this.__wbg_ptr);
334
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
335
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
336
+ deferred1_0 = r0;
337
+ deferred1_1 = r1;
338
+ return getStringFromWasm0(r0, r1);
339
+ } finally {
340
+ wasm.__wbindgen_add_to_stack_pointer(16);
341
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
342
+ }
343
+ }
344
+ }
345
+ if (Symbol.dispose) RuxyClient.prototype[Symbol.dispose] = RuxyClient.prototype.free;
346
+
347
+ /**
348
+ * 📡 RuxySocket — WASM WebSocket 클라이언트.
349
+ */
350
+ export class RuxySocket {
351
+ __destroy_into_raw() {
352
+ const ptr = this.__wbg_ptr;
353
+ this.__wbg_ptr = 0;
354
+ RuxySocketFinalization.unregister(this);
355
+ return ptr;
356
+ }
357
+ free() {
358
+ const ptr = this.__destroy_into_raw();
359
+ wasm.__wbg_ruxysocket_free(ptr, 0);
360
+ }
361
+ /**
362
+ * 서버 연결.
363
+ */
364
+ connect() {
365
+ try {
366
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
367
+ wasm.ruxysocket_connect(retptr, this.__wbg_ptr);
368
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
369
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
370
+ if (r1) {
371
+ throw takeObject(r0);
372
+ }
373
+ } finally {
374
+ wasm.__wbindgen_add_to_stack_pointer(16);
375
+ }
376
+ }
377
+ /**
378
+ * 명시적 연결 종료.
379
+ */
380
+ disconnect() {
381
+ wasm.ruxysocket_disconnect(this.__wbg_ptr);
382
+ }
383
+ /**
384
+ * 연결 상태 확인.
385
+ * @returns {boolean}
386
+ */
387
+ is_connected() {
388
+ const ret = wasm.ruxysocket_is_connected(this.__wbg_ptr);
389
+ return ret !== 0;
390
+ }
391
+ /**
392
+ * 생성자.
393
+ *
394
+ * @param url - WebSocket 주소 (예: "ws://localhost:3000/ws/chat")
395
+ * @param master_secret - Transport 암호화 키
396
+ * @param encrypt_enabled - 암호화 활성화 (기본: false)
397
+ * @param {string} url
398
+ * @param {string} master_secret
399
+ * @param {boolean | null} [encrypt_enabled]
400
+ */
401
+ constructor(url, master_secret, encrypt_enabled) {
402
+ const ptr0 = passStringToWasm0(url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
403
+ const len0 = WASM_VECTOR_LEN;
404
+ const ptr1 = passStringToWasm0(master_secret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
405
+ const len1 = WASM_VECTOR_LEN;
406
+ const ret = wasm.ruxysocket_new(ptr0, len0, ptr1, len1, isLikeNone(encrypt_enabled) ? 0xFFFFFF : encrypt_enabled ? 1 : 0);
407
+ this.__wbg_ptr = ret >>> 0;
408
+ RuxySocketFinalization.register(this, this.__wbg_ptr, this);
409
+ return this;
410
+ }
411
+ /**
412
+ * 이벤트 핸들러 등록.
413
+ * @param {string} event_type
414
+ * @param {Function} callback
415
+ */
416
+ on(event_type, callback) {
417
+ const ptr0 = passStringToWasm0(event_type, wasm.__wbindgen_export, wasm.__wbindgen_export2);
418
+ const len0 = WASM_VECTOR_LEN;
419
+ wasm.ruxysocket_on(this.__wbg_ptr, ptr0, len0, addHeapObject(callback));
420
+ }
421
+ /**
422
+ * 이벤트 기반 메시지 전송 (Transport 암호화).
423
+ * @param {string} event_type
424
+ * @param {any} data
425
+ */
426
+ send(event_type, data) {
427
+ try {
428
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
429
+ const ptr0 = passStringToWasm0(event_type, wasm.__wbindgen_export, wasm.__wbindgen_export2);
430
+ const len0 = WASM_VECTOR_LEN;
431
+ wasm.ruxysocket_send(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(data));
432
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
433
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
434
+ if (r1) {
435
+ throw takeObject(r0);
436
+ }
437
+ } finally {
438
+ wasm.__wbindgen_add_to_stack_pointer(16);
439
+ }
440
+ }
441
+ /**
442
+ * 자동 재연결 설정.
443
+ * @param {boolean} enabled
444
+ */
445
+ set_auto_reconnect(enabled) {
446
+ wasm.ruxysocket_set_auto_reconnect(this.__wbg_ptr, enabled);
447
+ }
448
+ /**
449
+ * 최대 재연결 시도 횟수 설정.
450
+ * @param {number} count
451
+ */
452
+ set_max_reconnect_attempts(count) {
453
+ wasm.ruxysocket_set_max_reconnect_attempts(this.__wbg_ptr, count);
454
+ }
455
+ /**
456
+ * Ping 주기 설정 (밀리초).
457
+ * @param {number} ms
458
+ */
459
+ set_ping_interval(ms) {
460
+ wasm.ruxysocket_set_ping_interval(this.__wbg_ptr, ms);
461
+ }
462
+ }
463
+ if (Symbol.dispose) RuxySocket.prototype[Symbol.dispose] = RuxySocket.prototype.free;
464
+
465
+ /**
466
+ * 브라우저 WASM 유틸리티.
467
+ */
468
+ export class RuxyUtil {
469
+ __destroy_into_raw() {
470
+ const ptr = this.__wbg_ptr;
471
+ this.__wbg_ptr = 0;
472
+ RuxyUtilFinalization.unregister(this);
473
+ return ptr;
474
+ }
475
+ free() {
476
+ const ptr = this.__destroy_into_raw();
477
+ wasm.__wbg_ruxyutil_free(ptr, 0);
478
+ }
479
+ /**
480
+ * 임계값 초과 필터.
481
+ * @param {Int32Array} list
482
+ * @param {number} threshold
483
+ * @returns {Int32Array}
484
+ */
485
+ static filter_gt(list, threshold) {
486
+ try {
487
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
488
+ const ptr0 = passArray32ToWasm0(list, wasm.__wbindgen_export);
489
+ const len0 = WASM_VECTOR_LEN;
490
+ wasm.ruxyutil_filter_gt(retptr, ptr0, len0, threshold);
491
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
492
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
493
+ var v2 = getArrayI32FromWasm0(r0, r1).slice();
494
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
495
+ return v2;
496
+ } finally {
497
+ wasm.__wbindgen_add_to_stack_pointer(16);
498
+ }
499
+ }
500
+ /**
501
+ * MD5 해시 (hex).
502
+ * @param {string} input
503
+ * @returns {string}
504
+ */
505
+ static md5(input) {
506
+ let deferred2_0;
507
+ let deferred2_1;
508
+ try {
509
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
510
+ const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export, wasm.__wbindgen_export2);
511
+ const len0 = WASM_VECTOR_LEN;
512
+ wasm.ruxyutil_md5(retptr, ptr0, len0);
513
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
514
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
515
+ deferred2_0 = r0;
516
+ deferred2_1 = r1;
517
+ return getStringFromWasm0(r0, r1);
518
+ } finally {
519
+ wasm.__wbindgen_add_to_stack_pointer(16);
520
+ wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
521
+ }
522
+ }
523
+ /**
524
+ * SHA-256 해시 (hex).
525
+ * @param {string} input
526
+ * @returns {string}
527
+ */
528
+ static sha256(input) {
529
+ let deferred2_0;
530
+ let deferred2_1;
531
+ try {
532
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
533
+ const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export, wasm.__wbindgen_export2);
534
+ const len0 = WASM_VECTOR_LEN;
535
+ wasm.ruxyutil_sha256(retptr, ptr0, len0);
536
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
537
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
538
+ deferred2_0 = r0;
539
+ deferred2_1 = r1;
540
+ return getStringFromWasm0(r0, r1);
541
+ } finally {
542
+ wasm.__wbindgen_add_to_stack_pointer(16);
543
+ wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
544
+ }
545
+ }
546
+ /**
547
+ * Fisher-Yates 셔플 (JS `sort(() => 0.5 - Math.random())` 대비 균등 분포 + 고속).
548
+ * @param {Int32Array} list
549
+ * @returns {Int32Array}
550
+ */
551
+ static shuffle_i32(list) {
552
+ try {
553
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
554
+ const ptr0 = passArray32ToWasm0(list, wasm.__wbindgen_export);
555
+ const len0 = WASM_VECTOR_LEN;
556
+ wasm.ruxyutil_shuffle_i32(retptr, ptr0, len0);
557
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
558
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
559
+ var v2 = getArrayI32FromWasm0(r0, r1).slice();
560
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
561
+ return v2;
562
+ } finally {
563
+ wasm.__wbindgen_add_to_stack_pointer(16);
564
+ }
565
+ }
566
+ /**
567
+ * 고속 정렬 (unstable sort — 동일 값 순서 미보장, 대신 빠름).
568
+ * @param {Int32Array} list
569
+ * @returns {Int32Array}
570
+ */
571
+ static sort_i32(list) {
572
+ try {
573
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
574
+ const ptr0 = passArray32ToWasm0(list, wasm.__wbindgen_export);
575
+ const len0 = WASM_VECTOR_LEN;
576
+ wasm.ruxyutil_sort_i32(retptr, ptr0, len0);
577
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
578
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
579
+ var v2 = getArrayI32FromWasm0(r0, r1).slice();
580
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
581
+ return v2;
582
+ } finally {
583
+ wasm.__wbindgen_add_to_stack_pointer(16);
584
+ }
585
+ }
586
+ /**
587
+ * UUID v4 생성.
588
+ * @returns {string}
589
+ */
590
+ static uuid() {
591
+ let deferred1_0;
592
+ let deferred1_1;
593
+ try {
594
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
595
+ wasm.ruxyutil_uuid(retptr);
596
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
597
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
598
+ deferred1_0 = r0;
599
+ deferred1_1 = r1;
600
+ return getStringFromWasm0(r0, r1);
601
+ } finally {
602
+ wasm.__wbindgen_add_to_stack_pointer(16);
603
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
604
+ }
605
+ }
606
+ }
607
+ if (Symbol.dispose) RuxyUtil.prototype[Symbol.dispose] = RuxyUtil.prototype.free;
608
+
609
+ function __wbg_get_imports() {
610
+ const import0 = {
611
+ __proto__: null,
612
+ __wbg___wbindgen_debug_string_5398f5bb970e0daa: function(arg0, arg1) {
613
+ const ret = debugString(getObject(arg1));
614
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
615
+ const len1 = WASM_VECTOR_LEN;
616
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
617
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
618
+ },
619
+ __wbg___wbindgen_is_function_3c846841762788c1: function(arg0) {
620
+ const ret = typeof(getObject(arg0)) === 'function';
621
+ return ret;
622
+ },
623
+ __wbg___wbindgen_is_undefined_52709e72fb9f179c: function(arg0) {
624
+ const ret = getObject(arg0) === undefined;
625
+ return ret;
626
+ },
627
+ __wbg___wbindgen_string_get_395e606bd0ee4427: function(arg0, arg1) {
628
+ const obj = getObject(arg1);
629
+ const ret = typeof(obj) === 'string' ? obj : undefined;
630
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
631
+ var len1 = WASM_VECTOR_LEN;
632
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
633
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
634
+ },
635
+ __wbg___wbindgen_throw_6ddd609b62940d55: function(arg0, arg1) {
636
+ throw new Error(getStringFromWasm0(arg0, arg1));
637
+ },
638
+ __wbg__wbg_cb_unref_6b5b6b8576d35cb1: function(arg0) {
639
+ getObject(arg0)._wbg_cb_unref();
640
+ },
641
+ __wbg_apply_ac9afb97ca32f169: function() { return handleError(function (arg0, arg1, arg2) {
642
+ const ret = getObject(arg0).apply(getObject(arg1), getObject(arg2));
643
+ return addHeapObject(ret);
644
+ }, arguments); },
645
+ __wbg_call_2d781c1f4d5c0ef8: function() { return handleError(function (arg0, arg1, arg2) {
646
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
647
+ return addHeapObject(ret);
648
+ }, arguments); },
649
+ __wbg_clearInterval_1cf7b4d7d9952d6e: function(arg0, arg1) {
650
+ getObject(arg0).clearInterval(arg1);
651
+ },
652
+ __wbg_clearTimeout_fdfb5a1468af1a97: function(arg0, arg1) {
653
+ getObject(arg0).clearTimeout(arg1);
654
+ },
655
+ __wbg_close_2bf4dde29c2cd7d5: function() { return handleError(function (arg0, arg1) {
656
+ getObject(arg0).close(arg1);
657
+ }, arguments); },
658
+ __wbg_code_aea376e2d265a64f: function(arg0) {
659
+ const ret = getObject(arg0).code;
660
+ return ret;
661
+ },
662
+ __wbg_data_a3d9ff9cdd801002: function(arg0) {
663
+ const ret = getObject(arg0).data;
664
+ return addHeapObject(ret);
665
+ },
666
+ __wbg_error_8d9a8e04cd1d3588: function(arg0) {
667
+ console.error(getObject(arg0));
668
+ },
669
+ __wbg_fetch_f8a611684c3b5fe5: function(arg0, arg1) {
670
+ const ret = getObject(arg0).fetch(getObject(arg1));
671
+ return addHeapObject(ret);
672
+ },
673
+ __wbg_getRandomValues_76dfc69825c9c552: function() { return handleError(function (arg0, arg1) {
674
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
675
+ }, arguments); },
676
+ __wbg_getRandomValues_a1cf2e70b003a59d: function() { return handleError(function (arg0, arg1) {
677
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
678
+ }, arguments); },
679
+ __wbg_get_3ef1eba1850ade27: function() { return handleError(function (arg0, arg1) {
680
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
681
+ return addHeapObject(ret);
682
+ }, arguments); },
683
+ __wbg_get_a867a94064ecd263: function() { return handleError(function (arg0, arg1, arg2, arg3) {
684
+ const ret = getObject(arg1).get(getStringFromWasm0(arg2, arg3));
685
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
686
+ var len1 = WASM_VECTOR_LEN;
687
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
688
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
689
+ }, arguments); },
690
+ __wbg_headers_eb2234545f9ff993: function(arg0) {
691
+ const ret = getObject(arg0).headers;
692
+ return addHeapObject(ret);
693
+ },
694
+ __wbg_hostname_a30ece22df1c8b63: function() { return handleError(function (arg0, arg1) {
695
+ const ret = getObject(arg1).hostname;
696
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
697
+ const len1 = WASM_VECTOR_LEN;
698
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
699
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
700
+ }, arguments); },
701
+ __wbg_instanceof_Response_9b4d9fd451e051b1: function(arg0) {
702
+ let result;
703
+ try {
704
+ result = getObject(arg0) instanceof Response;
705
+ } catch (_) {
706
+ result = false;
707
+ }
708
+ const ret = result;
709
+ return ret;
710
+ },
711
+ __wbg_instanceof_Window_23e677d2c6843922: function(arg0) {
712
+ let result;
713
+ try {
714
+ result = getObject(arg0) instanceof Window;
715
+ } catch (_) {
716
+ result = false;
717
+ }
718
+ const ret = result;
719
+ return ret;
720
+ },
721
+ __wbg_location_fc8d47802682dd93: function(arg0) {
722
+ const ret = getObject(arg0).location;
723
+ return addHeapObject(ret);
724
+ },
725
+ __wbg_log_524eedafa26daa59: function(arg0) {
726
+ console.log(getObject(arg0));
727
+ },
728
+ __wbg_navigator_9cebf56f28aa719b: function(arg0) {
729
+ const ret = getObject(arg0).navigator;
730
+ return addHeapObject(ret);
731
+ },
732
+ __wbg_new_0837727332ac86ba: function() { return handleError(function () {
733
+ const ret = new Headers();
734
+ return addHeapObject(ret);
735
+ }, arguments); },
736
+ __wbg_new_a70fbab9066b301f: function() {
737
+ const ret = new Array();
738
+ return addHeapObject(ret);
739
+ },
740
+ __wbg_new_ab79df5bd7c26067: function() {
741
+ const ret = new Object();
742
+ return addHeapObject(ret);
743
+ },
744
+ __wbg_new_dd50bcc3f60ba434: function() { return handleError(function (arg0, arg1) {
745
+ const ret = new WebSocket(getStringFromWasm0(arg0, arg1));
746
+ return addHeapObject(ret);
747
+ }, arguments); },
748
+ __wbg_new_typed_aaaeaf29cf802876: function(arg0, arg1) {
749
+ try {
750
+ var state0 = {a: arg0, b: arg1};
751
+ var cb0 = (arg0, arg1) => {
752
+ const a = state0.a;
753
+ state0.a = 0;
754
+ try {
755
+ return __wasm_bindgen_func_elem_605(a, state0.b, arg0, arg1);
756
+ } finally {
757
+ state0.a = a;
758
+ }
759
+ };
760
+ const ret = new Promise(cb0);
761
+ return addHeapObject(ret);
762
+ } finally {
763
+ state0.a = state0.b = 0;
764
+ }
765
+ },
766
+ __wbg_new_with_str_and_init_b4b54d1a819bc724: function() { return handleError(function (arg0, arg1, arg2) {
767
+ const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
768
+ return addHeapObject(ret);
769
+ }, arguments); },
770
+ __wbg_now_16f0c993d5dd6c27: function() {
771
+ const ret = Date.now();
772
+ return ret;
773
+ },
774
+ __wbg_parse_e9eddd2a82c706eb: function() { return handleError(function (arg0, arg1) {
775
+ const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
776
+ return addHeapObject(ret);
777
+ }, arguments); },
778
+ __wbg_push_e87b0e732085a946: function(arg0, arg1) {
779
+ const ret = getObject(arg0).push(getObject(arg1));
780
+ return ret;
781
+ },
782
+ __wbg_queueMicrotask_0c399741342fb10f: function(arg0) {
783
+ const ret = getObject(arg0).queueMicrotask;
784
+ return addHeapObject(ret);
785
+ },
786
+ __wbg_queueMicrotask_a082d78ce798393e: function(arg0) {
787
+ queueMicrotask(getObject(arg0));
788
+ },
789
+ __wbg_readyState_1f1e7f1bdf9f4d42: function(arg0) {
790
+ const ret = getObject(arg0).readyState;
791
+ return ret;
792
+ },
793
+ __wbg_reason_cbcb9911796c4714: function(arg0, arg1) {
794
+ const ret = getObject(arg1).reason;
795
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
796
+ const len1 = WASM_VECTOR_LEN;
797
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
798
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
799
+ },
800
+ __wbg_resolve_ae8d83246e5bcc12: function(arg0) {
801
+ const ret = Promise.resolve(getObject(arg0));
802
+ return addHeapObject(ret);
803
+ },
804
+ __wbg_send_4a1dc66e8653e5ed: function() { return handleError(function (arg0, arg1, arg2) {
805
+ getObject(arg0).send(getStringFromWasm0(arg1, arg2));
806
+ }, arguments); },
807
+ __wbg_setInterval_2cc6fda2bedb96bc: function() { return handleError(function (arg0, arg1, arg2) {
808
+ const ret = getObject(arg0).setInterval(getObject(arg1), arg2);
809
+ return ret;
810
+ }, arguments); },
811
+ __wbg_setTimeout_7f7035ad0b026458: function() { return handleError(function (arg0, arg1, arg2) {
812
+ const ret = getObject(arg0).setTimeout(getObject(arg1), arg2);
813
+ return ret;
814
+ }, arguments); },
815
+ __wbg_set_7eaa4f96924fd6b3: function() { return handleError(function (arg0, arg1, arg2) {
816
+ const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
817
+ return ret;
818
+ }, arguments); },
819
+ __wbg_set_binaryType_3dcf8281ec100a8f: function(arg0, arg1) {
820
+ getObject(arg0).binaryType = __wbindgen_enum_BinaryType[arg1];
821
+ },
822
+ __wbg_set_body_a3d856b097dfda04: function(arg0, arg1) {
823
+ getObject(arg0).body = getObject(arg1);
824
+ },
825
+ __wbg_set_credentials_ed63183445882c65: function(arg0, arg1) {
826
+ getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
827
+ },
828
+ __wbg_set_e09648bea3f1af1e: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
829
+ getObject(arg0).set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
830
+ }, arguments); },
831
+ __wbg_set_headers_3c8fecc693b75327: function(arg0, arg1) {
832
+ getObject(arg0).headers = getObject(arg1);
833
+ },
834
+ __wbg_set_method_8c015e8bcafd7be1: function(arg0, arg1, arg2) {
835
+ getObject(arg0).method = getStringFromWasm0(arg1, arg2);
836
+ },
837
+ __wbg_set_mode_5a87f2c809cf37c2: function(arg0, arg1) {
838
+ getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1];
839
+ },
840
+ __wbg_set_onclose_8da801226bdd7a7b: function(arg0, arg1) {
841
+ getObject(arg0).onclose = getObject(arg1);
842
+ },
843
+ __wbg_set_onerror_901ca711f94a5bbb: function(arg0, arg1) {
844
+ getObject(arg0).onerror = getObject(arg1);
845
+ },
846
+ __wbg_set_onmessage_6f80ab771bf151aa: function(arg0, arg1) {
847
+ getObject(arg0).onmessage = getObject(arg1);
848
+ },
849
+ __wbg_set_onopen_34e3e24cf9337ddd: function(arg0, arg1) {
850
+ getObject(arg0).onopen = getObject(arg1);
851
+ },
852
+ __wbg_static_accessor_GLOBAL_8adb955bd33fac2f: function() {
853
+ const ret = typeof global === 'undefined' ? null : global;
854
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
855
+ },
856
+ __wbg_static_accessor_GLOBAL_THIS_ad356e0db91c7913: function() {
857
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
858
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
859
+ },
860
+ __wbg_static_accessor_SELF_f207c857566db248: function() {
861
+ const ret = typeof self === 'undefined' ? null : self;
862
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
863
+ },
864
+ __wbg_static_accessor_WINDOW_bb9f1ba69d61b386: function() {
865
+ const ret = typeof window === 'undefined' ? null : window;
866
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
867
+ },
868
+ __wbg_stringify_5ae93966a84901ac: function() { return handleError(function (arg0) {
869
+ const ret = JSON.stringify(getObject(arg0));
870
+ return addHeapObject(ret);
871
+ }, arguments); },
872
+ __wbg_text_372f5b91442c50f9: function() { return handleError(function (arg0) {
873
+ const ret = getObject(arg0).text();
874
+ return addHeapObject(ret);
875
+ }, arguments); },
876
+ __wbg_then_098abe61755d12f6: function(arg0, arg1) {
877
+ const ret = getObject(arg0).then(getObject(arg1));
878
+ return addHeapObject(ret);
879
+ },
880
+ __wbg_then_9e335f6dd892bc11: function(arg0, arg1, arg2) {
881
+ const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
882
+ return addHeapObject(ret);
883
+ },
884
+ __wbg_userAgent_161a5f2d2a8dee61: function() { return handleError(function (arg0, arg1) {
885
+ const ret = getObject(arg1).userAgent;
886
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
887
+ const len1 = WASM_VECTOR_LEN;
888
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
889
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
890
+ }, arguments); },
891
+ __wbg_warn_69424c2d92a2fa73: function(arg0) {
892
+ console.warn(getObject(arg0));
893
+ },
894
+ __wbindgen_cast_0000000000000001: function(arg0, arg1) {
895
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 1, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 2, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
896
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_74, __wasm_bindgen_func_elem_75);
897
+ return addHeapObject(ret);
898
+ },
899
+ __wbindgen_cast_0000000000000002: function(arg0, arg1) {
900
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 1, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 2, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
901
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_74, __wasm_bindgen_func_elem_75_1);
902
+ return addHeapObject(ret);
903
+ },
904
+ __wbindgen_cast_0000000000000003: function(arg0, arg1) {
905
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 1, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 2, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
906
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_74, __wasm_bindgen_func_elem_75_2);
907
+ return addHeapObject(ret);
908
+ },
909
+ __wbindgen_cast_0000000000000004: function(arg0, arg1) {
910
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 1, function: Function { arguments: [], shim_idx: 4, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
911
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_74, __wasm_bindgen_func_elem_77);
912
+ return addHeapObject(ret);
913
+ },
914
+ __wbindgen_cast_0000000000000005: function(arg0, arg1) {
915
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 83, function: Function { arguments: [Externref], shim_idx: 84, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
916
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_545, __wasm_bindgen_func_elem_546);
917
+ return addHeapObject(ret);
918
+ },
919
+ __wbindgen_cast_0000000000000006: function(arg0) {
920
+ // Cast intrinsic for `F64 -> Externref`.
921
+ const ret = arg0;
922
+ return addHeapObject(ret);
923
+ },
924
+ __wbindgen_cast_0000000000000007: function(arg0, arg1) {
925
+ // Cast intrinsic for `Ref(String) -> Externref`.
926
+ const ret = getStringFromWasm0(arg0, arg1);
927
+ return addHeapObject(ret);
928
+ },
929
+ __wbindgen_object_clone_ref: function(arg0) {
930
+ const ret = getObject(arg0);
931
+ return addHeapObject(ret);
932
+ },
933
+ __wbindgen_object_drop_ref: function(arg0) {
934
+ takeObject(arg0);
935
+ },
936
+ };
937
+ return {
938
+ __proto__: null,
939
+ "./fuzionx_client_wasm_bg.js": import0,
940
+ };
941
+ }
942
+
943
+ function __wasm_bindgen_func_elem_77(arg0, arg1) {
944
+ wasm.__wasm_bindgen_func_elem_77(arg0, arg1);
945
+ }
946
+
947
+ function __wasm_bindgen_func_elem_75(arg0, arg1, arg2) {
948
+ wasm.__wasm_bindgen_func_elem_75(arg0, arg1, addHeapObject(arg2));
949
+ }
950
+
951
+ function __wasm_bindgen_func_elem_75_1(arg0, arg1, arg2) {
952
+ wasm.__wasm_bindgen_func_elem_75_1(arg0, arg1, addHeapObject(arg2));
953
+ }
954
+
955
+ function __wasm_bindgen_func_elem_75_2(arg0, arg1, arg2) {
956
+ wasm.__wasm_bindgen_func_elem_75_2(arg0, arg1, addHeapObject(arg2));
957
+ }
958
+
959
+ function __wasm_bindgen_func_elem_546(arg0, arg1, arg2) {
960
+ try {
961
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
962
+ wasm.__wasm_bindgen_func_elem_546(retptr, arg0, arg1, addHeapObject(arg2));
963
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
964
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
965
+ if (r1) {
966
+ throw takeObject(r0);
967
+ }
968
+ } finally {
969
+ wasm.__wbindgen_add_to_stack_pointer(16);
970
+ }
971
+ }
972
+
973
+ function __wasm_bindgen_func_elem_605(arg0, arg1, arg2, arg3) {
974
+ wasm.__wasm_bindgen_func_elem_605(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
975
+ }
976
+
977
+
978
+ const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
979
+
980
+
981
+ const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
982
+
983
+
984
+ const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
985
+ const RuxyClientFinalization = (typeof FinalizationRegistry === 'undefined')
986
+ ? { register: () => {}, unregister: () => {} }
987
+ : new FinalizationRegistry(ptr => wasm.__wbg_ruxyclient_free(ptr >>> 0, 1));
988
+ const RuxySocketFinalization = (typeof FinalizationRegistry === 'undefined')
989
+ ? { register: () => {}, unregister: () => {} }
990
+ : new FinalizationRegistry(ptr => wasm.__wbg_ruxysocket_free(ptr >>> 0, 1));
991
+ const RuxyUtilFinalization = (typeof FinalizationRegistry === 'undefined')
992
+ ? { register: () => {}, unregister: () => {} }
993
+ : new FinalizationRegistry(ptr => wasm.__wbg_ruxyutil_free(ptr >>> 0, 1));
994
+
995
+ function addHeapObject(obj) {
996
+ if (heap_next === heap.length) heap.push(heap.length + 1);
997
+ const idx = heap_next;
998
+ heap_next = heap[idx];
999
+
1000
+ heap[idx] = obj;
1001
+ return idx;
1002
+ }
1003
+
1004
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
1005
+ ? { register: () => {}, unregister: () => {} }
1006
+ : new FinalizationRegistry(state => state.dtor(state.a, state.b));
1007
+
1008
+ function debugString(val) {
1009
+ // primitive types
1010
+ const type = typeof val;
1011
+ if (type == 'number' || type == 'boolean' || val == null) {
1012
+ return `${val}`;
1013
+ }
1014
+ if (type == 'string') {
1015
+ return `"${val}"`;
1016
+ }
1017
+ if (type == 'symbol') {
1018
+ const description = val.description;
1019
+ if (description == null) {
1020
+ return 'Symbol';
1021
+ } else {
1022
+ return `Symbol(${description})`;
1023
+ }
1024
+ }
1025
+ if (type == 'function') {
1026
+ const name = val.name;
1027
+ if (typeof name == 'string' && name.length > 0) {
1028
+ return `Function(${name})`;
1029
+ } else {
1030
+ return 'Function';
1031
+ }
1032
+ }
1033
+ // objects
1034
+ if (Array.isArray(val)) {
1035
+ const length = val.length;
1036
+ let debug = '[';
1037
+ if (length > 0) {
1038
+ debug += debugString(val[0]);
1039
+ }
1040
+ for(let i = 1; i < length; i++) {
1041
+ debug += ', ' + debugString(val[i]);
1042
+ }
1043
+ debug += ']';
1044
+ return debug;
1045
+ }
1046
+ // Test for built-in
1047
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
1048
+ let className;
1049
+ if (builtInMatches && builtInMatches.length > 1) {
1050
+ className = builtInMatches[1];
1051
+ } else {
1052
+ // Failed to match the standard '[object ClassName]'
1053
+ return toString.call(val);
1054
+ }
1055
+ if (className == 'Object') {
1056
+ // we're a user defined class or Object
1057
+ // JSON.stringify avoids problems with cycles, and is generally much
1058
+ // easier than looping through ownProperties of `val`.
1059
+ try {
1060
+ return 'Object(' + JSON.stringify(val) + ')';
1061
+ } catch (_) {
1062
+ return 'Object';
1063
+ }
1064
+ }
1065
+ // errors
1066
+ if (val instanceof Error) {
1067
+ return `${val.name}: ${val.message}\n${val.stack}`;
1068
+ }
1069
+ // TODO we could test for more things here, like `Set`s and `Map`s.
1070
+ return className;
1071
+ }
1072
+
1073
+ function dropObject(idx) {
1074
+ if (idx < 1028) return;
1075
+ heap[idx] = heap_next;
1076
+ heap_next = idx;
1077
+ }
1078
+
1079
+ function getArrayI32FromWasm0(ptr, len) {
1080
+ ptr = ptr >>> 0;
1081
+ return getInt32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
1082
+ }
1083
+
1084
+ function getArrayU8FromWasm0(ptr, len) {
1085
+ ptr = ptr >>> 0;
1086
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
1087
+ }
1088
+
1089
+ let cachedDataViewMemory0 = null;
1090
+ function getDataViewMemory0() {
1091
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
1092
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
1093
+ }
1094
+ return cachedDataViewMemory0;
1095
+ }
1096
+
1097
+ let cachedInt32ArrayMemory0 = null;
1098
+ function getInt32ArrayMemory0() {
1099
+ if (cachedInt32ArrayMemory0 === null || cachedInt32ArrayMemory0.byteLength === 0) {
1100
+ cachedInt32ArrayMemory0 = new Int32Array(wasm.memory.buffer);
1101
+ }
1102
+ return cachedInt32ArrayMemory0;
1103
+ }
1104
+
1105
+ function getStringFromWasm0(ptr, len) {
1106
+ ptr = ptr >>> 0;
1107
+ return decodeText(ptr, len);
1108
+ }
1109
+
1110
+ let cachedUint32ArrayMemory0 = null;
1111
+ function getUint32ArrayMemory0() {
1112
+ if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
1113
+ cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
1114
+ }
1115
+ return cachedUint32ArrayMemory0;
1116
+ }
1117
+
1118
+ let cachedUint8ArrayMemory0 = null;
1119
+ function getUint8ArrayMemory0() {
1120
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
1121
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
1122
+ }
1123
+ return cachedUint8ArrayMemory0;
1124
+ }
1125
+
1126
+ function getObject(idx) { return heap[idx]; }
1127
+
1128
+ function handleError(f, args) {
1129
+ try {
1130
+ return f.apply(this, args);
1131
+ } catch (e) {
1132
+ wasm.__wbindgen_export3(addHeapObject(e));
1133
+ }
1134
+ }
1135
+
1136
+ let heap = new Array(1024).fill(undefined);
1137
+ heap.push(undefined, null, true, false);
1138
+
1139
+ let heap_next = heap.length;
1140
+
1141
+ function isLikeNone(x) {
1142
+ return x === undefined || x === null;
1143
+ }
1144
+
1145
+ function makeMutClosure(arg0, arg1, dtor, f) {
1146
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
1147
+ const real = (...args) => {
1148
+
1149
+ // First up with a closure we increment the internal reference
1150
+ // count. This ensures that the Rust closure environment won't
1151
+ // be deallocated while we're invoking it.
1152
+ state.cnt++;
1153
+ const a = state.a;
1154
+ state.a = 0;
1155
+ try {
1156
+ return f(a, state.b, ...args);
1157
+ } finally {
1158
+ state.a = a;
1159
+ real._wbg_cb_unref();
1160
+ }
1161
+ };
1162
+ real._wbg_cb_unref = () => {
1163
+ if (--state.cnt === 0) {
1164
+ state.dtor(state.a, state.b);
1165
+ state.a = 0;
1166
+ CLOSURE_DTORS.unregister(state);
1167
+ }
1168
+ };
1169
+ CLOSURE_DTORS.register(real, state, state);
1170
+ return real;
1171
+ }
1172
+
1173
+ function passArray32ToWasm0(arg, malloc) {
1174
+ const ptr = malloc(arg.length * 4, 4) >>> 0;
1175
+ getUint32ArrayMemory0().set(arg, ptr / 4);
1176
+ WASM_VECTOR_LEN = arg.length;
1177
+ return ptr;
1178
+ }
1179
+
1180
+ function passStringToWasm0(arg, malloc, realloc) {
1181
+ if (realloc === undefined) {
1182
+ const buf = cachedTextEncoder.encode(arg);
1183
+ const ptr = malloc(buf.length, 1) >>> 0;
1184
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
1185
+ WASM_VECTOR_LEN = buf.length;
1186
+ return ptr;
1187
+ }
1188
+
1189
+ let len = arg.length;
1190
+ let ptr = malloc(len, 1) >>> 0;
1191
+
1192
+ const mem = getUint8ArrayMemory0();
1193
+
1194
+ let offset = 0;
1195
+
1196
+ for (; offset < len; offset++) {
1197
+ const code = arg.charCodeAt(offset);
1198
+ if (code > 0x7F) break;
1199
+ mem[ptr + offset] = code;
1200
+ }
1201
+ if (offset !== len) {
1202
+ if (offset !== 0) {
1203
+ arg = arg.slice(offset);
1204
+ }
1205
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
1206
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
1207
+ const ret = cachedTextEncoder.encodeInto(arg, view);
1208
+
1209
+ offset += ret.written;
1210
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
1211
+ }
1212
+
1213
+ WASM_VECTOR_LEN = offset;
1214
+ return ptr;
1215
+ }
1216
+
1217
+ function takeObject(idx) {
1218
+ const ret = getObject(idx);
1219
+ dropObject(idx);
1220
+ return ret;
1221
+ }
1222
+
1223
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1224
+ cachedTextDecoder.decode();
1225
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
1226
+ let numBytesDecoded = 0;
1227
+ function decodeText(ptr, len) {
1228
+ numBytesDecoded += len;
1229
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
1230
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1231
+ cachedTextDecoder.decode();
1232
+ numBytesDecoded = len;
1233
+ }
1234
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
1235
+ }
1236
+
1237
+ const cachedTextEncoder = new TextEncoder();
1238
+
1239
+ if (!('encodeInto' in cachedTextEncoder)) {
1240
+ cachedTextEncoder.encodeInto = function (arg, view) {
1241
+ const buf = cachedTextEncoder.encode(arg);
1242
+ view.set(buf);
1243
+ return {
1244
+ read: arg.length,
1245
+ written: buf.length
1246
+ };
1247
+ };
1248
+ }
1249
+
1250
+ let WASM_VECTOR_LEN = 0;
1251
+
1252
+ let wasmModule, wasm;
1253
+ function __wbg_finalize_init(instance, module) {
1254
+ wasm = instance.exports;
1255
+ wasmModule = module;
1256
+ cachedDataViewMemory0 = null;
1257
+ cachedInt32ArrayMemory0 = null;
1258
+ cachedUint32ArrayMemory0 = null;
1259
+ cachedUint8ArrayMemory0 = null;
1260
+ return wasm;
1261
+ }
1262
+
1263
+ async function __wbg_load(module, imports) {
1264
+ if (typeof Response === 'function' && module instanceof Response) {
1265
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
1266
+ try {
1267
+ return await WebAssembly.instantiateStreaming(module, imports);
1268
+ } catch (e) {
1269
+ const validResponse = module.ok && expectedResponseType(module.type);
1270
+
1271
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
1272
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
1273
+
1274
+ } else { throw e; }
1275
+ }
1276
+ }
1277
+
1278
+ const bytes = await module.arrayBuffer();
1279
+ return await WebAssembly.instantiate(bytes, imports);
1280
+ } else {
1281
+ const instance = await WebAssembly.instantiate(module, imports);
1282
+
1283
+ if (instance instanceof WebAssembly.Instance) {
1284
+ return { instance, module };
1285
+ } else {
1286
+ return instance;
1287
+ }
1288
+ }
1289
+
1290
+ function expectedResponseType(type) {
1291
+ switch (type) {
1292
+ case 'basic': case 'cors': case 'default': return true;
1293
+ }
1294
+ return false;
1295
+ }
1296
+ }
1297
+
1298
+ function initSync(module) {
1299
+ if (wasm !== undefined) return wasm;
1300
+
1301
+
1302
+ if (module !== undefined) {
1303
+ if (Object.getPrototypeOf(module) === Object.prototype) {
1304
+ ({module} = module)
1305
+ } else {
1306
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
1307
+ }
1308
+ }
1309
+
1310
+ const imports = __wbg_get_imports();
1311
+ if (!(module instanceof WebAssembly.Module)) {
1312
+ module = new WebAssembly.Module(module);
1313
+ }
1314
+ const instance = new WebAssembly.Instance(module, imports);
1315
+ return __wbg_finalize_init(instance, module);
1316
+ }
1317
+
1318
+ async function __wbg_init(module_or_path) {
1319
+ if (wasm !== undefined) return wasm;
1320
+
1321
+
1322
+ if (module_or_path !== undefined) {
1323
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1324
+ ({module_or_path} = module_or_path)
1325
+ } else {
1326
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
1327
+ }
1328
+ }
1329
+
1330
+ if (module_or_path === undefined) {
1331
+ module_or_path = new URL('fuzionx_client_wasm_bg.wasm', import.meta.url);
1332
+ }
1333
+ const imports = __wbg_get_imports();
1334
+
1335
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
1336
+ module_or_path = fetch(module_or_path);
1337
+ }
1338
+
1339
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
1340
+
1341
+ return __wbg_finalize_init(instance, module);
1342
+ }
1343
+
1344
+ export { initSync, __wbg_init as default };