@gmb/bitmark-parser 6.10.1 → 6.11.1

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 (50) hide show
  1. package/README.md +288 -22
  2. package/dist/browser/bitmark-parser.min.js +4 -4
  3. package/dist/browser/bitmark-parser.min.js.map +1 -1
  4. package/dist/browser/cjs/index.cjs +1053 -345
  5. package/dist/browser/cjs/index.cjs.map +1 -1
  6. package/dist/browser/cjs/index.d.cts +1175 -34
  7. package/dist/browser/esm/index.d.ts +1175 -34
  8. package/dist/browser/esm/index.js +1048 -345
  9. package/dist/browser/esm/index.js.map +1 -1
  10. package/dist/browser/esm/worker-entry.js +712 -96
  11. package/dist/browser/esm/worker-entry.js.map +1 -1
  12. package/dist/browser/wasm/bitmark_browser_full_wasm_bg.wasm +0 -0
  13. package/dist/browser/wasm/bitmark_json_wasm_bg.wasm +0 -0
  14. package/dist/browser/wasm/bitmark_wasm_bg.wasm +0 -0
  15. package/dist/index.cjs +124 -32
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.cts +1175 -34
  18. package/dist/index.d.ts +1175 -34
  19. package/dist/index.js +119 -32
  20. package/dist/index.js.map +1 -1
  21. package/dist/legacy.cjs +4 -4
  22. package/dist/legacy.cjs.map +1 -1
  23. package/dist/legacy.js +4 -4
  24. package/dist/legacy.js.map +1 -1
  25. package/dist/worker-entry.cjs +7 -1
  26. package/dist/worker-entry.cjs.map +1 -1
  27. package/package.json +14 -8
  28. package/schema/bitmark.schema.json +2746 -573
  29. package/translations/translations.json +2940 -0
  30. package/wasm/bitmark_wasm.d.ts +53 -12
  31. package/wasm/bitmark_wasm.js +171 -47
  32. package/wasm/bitmark_wasm_bg.wasm +0 -0
  33. package/wasm/bitmark_wasm_bg.wasm.d.ts +4 -1
  34. package/wasm/package.json +1 -1
  35. package/wasm-bitmark-json/bitmark_json_wasm.d.ts +39 -12
  36. package/wasm-bitmark-json/bitmark_json_wasm.js +129 -53
  37. package/wasm-bitmark-json/bitmark_json_wasm_bg.wasm +0 -0
  38. package/wasm-bitmark-json/bitmark_json_wasm_bg.wasm.d.ts +3 -1
  39. package/wasm-bitmark-json/package.json +1 -1
  40. package/wasm-browser-full/bitmark_browser_full_wasm.d.ts +149 -0
  41. package/wasm-browser-full/bitmark_browser_full_wasm.js +647 -0
  42. package/wasm-browser-full/bitmark_browser_full_wasm_bg.wasm +0 -0
  43. package/wasm-browser-full/bitmark_browser_full_wasm_bg.wasm.d.ts +23 -0
  44. package/wasm-browser-full/package.json +20 -0
  45. package/dist/browser/bitmark_json_wasm_bg.wasm +0 -0
  46. package/dist/browser/bitmark_wasm_bg.wasm +0 -0
  47. package/dist/browser/cjs/bitmark_json_wasm_bg.wasm +0 -0
  48. package/dist/browser/cjs/bitmark_wasm_bg.wasm +0 -0
  49. package/dist/browser/esm/bitmark_json_wasm_bg.wasm +0 -0
  50. package/dist/browser/esm/bitmark_wasm_bg.wasm +0 -0
@@ -22,22 +22,27 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
22
22
  // src/browser/index.ts
23
23
  var index_exports = {};
24
24
  __export(index_exports, {
25
+ ALL_LANGUAGES: () => ALL_LANGUAGES,
25
26
  NotInitializedError: () => NotInitializedError,
27
+ RegisterError: () => RegisterError,
26
28
  UnsupportedFeatureError: () => UnsupportedFeatureError,
27
29
  bitmarkToObjects: () => bitmarkToObjects,
28
30
  breakscapeText: () => breakscapeText,
29
- canonicalize: () => canonicalize3,
30
- convert: () => convert3,
31
+ canonicalize: () => canonicalize4,
32
+ convert: () => convert4,
31
33
  countBits: () => countBits,
32
- info: () => info3,
34
+ diff: () => diff3,
35
+ diffBits: () => diffBits,
36
+ info: () => info4,
33
37
  init: () => init,
34
- initSync: () => initSync3,
38
+ initSync: () => initSync4,
35
39
  legacy: () => legacy_exports,
36
- lex: () => lex2,
40
+ lex: () => lex3,
37
41
  objectsToBitmark: () => objectsToBitmark,
38
42
  patchEntry: () => patchEntry,
43
+ register: () => register4,
39
44
  splitBits: () => splitBits,
40
- transform: () => transform3,
45
+ transform: () => transform4,
41
46
  transformParallel: () => transformParallel,
42
47
  unbreakscapeText: () => unbreakscapeText,
43
48
  variant: () => variant,
@@ -58,11 +63,14 @@ __export(bitmark_wasm_exports, {
58
63
  convert_text: () => convert_text,
59
64
  count_bits: () => count_bits,
60
65
  default: () => bitmark_wasm_default,
66
+ diff: () => diff,
61
67
  info: () => info,
62
68
  initSync: () => initSync,
63
69
  is_bitmark: () => is_bitmark,
64
70
  lex: () => lex,
65
71
  prettify: () => prettify,
72
+ register: () => register,
73
+ resolve_patch_document: () => resolve_patch_document,
66
74
  split_bits: () => split_bits,
67
75
  split_json_bits: () => split_json_bits,
68
76
  transform: () => transform,
@@ -201,9 +209,9 @@ function unbreakscape_text(input, format, location) {
201
209
  wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
202
210
  }
203
211
  }
204
- function info(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full) {
205
- let deferred4_0;
206
- let deferred4_1;
212
+ function info(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full, language) {
213
+ let deferred5_0;
214
+ let deferred5_1;
207
215
  try {
208
216
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
209
217
  const ptr0 = passStringToWasm0(info_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
@@ -212,15 +220,41 @@ function info(info_type, format, bit, pretty, indent, include_deprecated, only_d
212
220
  const len1 = WASM_VECTOR_LEN;
213
221
  const ptr2 = passStringToWasm0(bit, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
214
222
  const len2 = WASM_VECTOR_LEN;
215
- wasm.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, include_deprecated, only_deprecated, full);
223
+ const ptr3 = passStringToWasm0(language, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
224
+ const len3 = WASM_VECTOR_LEN;
225
+ wasm.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, include_deprecated, only_deprecated, full, ptr3, len3);
216
226
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
217
227
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
218
- deferred4_0 = r0;
219
- deferred4_1 = r1;
228
+ deferred5_0 = r0;
229
+ deferred5_1 = r1;
220
230
  return getStringFromWasm0(r0, r1);
221
231
  } finally {
222
232
  wasm.__wbindgen_add_to_stack_pointer(16);
223
- wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
233
+ wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
234
+ }
235
+ }
236
+ function convert_text(input, direction, format, location) {
237
+ let deferred5_0;
238
+ let deferred5_1;
239
+ try {
240
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
241
+ const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
242
+ const len0 = WASM_VECTOR_LEN;
243
+ const ptr1 = passStringToWasm0(direction, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
244
+ const len1 = WASM_VECTOR_LEN;
245
+ const ptr2 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
246
+ const len2 = WASM_VECTOR_LEN;
247
+ const ptr3 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
248
+ const len3 = WASM_VECTOR_LEN;
249
+ wasm.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
250
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
251
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
252
+ deferred5_0 = r0;
253
+ deferred5_1 = r1;
254
+ return getStringFromWasm0(r0, r1);
255
+ } finally {
256
+ wasm.__wbindgen_add_to_stack_pointer(16);
257
+ wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
224
258
  }
225
259
  }
226
260
  function transform(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
@@ -249,6 +283,70 @@ function transform(input, input_format_sel, output_format_sel, mode, patch_json,
249
283
  wasm.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
250
284
  }
251
285
  }
286
+ function resolve_patch_document(input, patch_json) {
287
+ let deferred3_0;
288
+ let deferred3_1;
289
+ try {
290
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
291
+ const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
292
+ const len0 = WASM_VECTOR_LEN;
293
+ const ptr1 = passStringToWasm0(patch_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
294
+ const len1 = WASM_VECTOR_LEN;
295
+ wasm.resolve_patch_document(retptr, ptr0, len0, ptr1, len1);
296
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
297
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
298
+ deferred3_0 = r0;
299
+ deferred3_1 = r1;
300
+ return getStringFromWasm0(r0, r1);
301
+ } finally {
302
+ wasm.__wbindgen_add_to_stack_pointer(16);
303
+ wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
304
+ }
305
+ }
306
+ function diff(a, b, input_format_sel, output_format_sel, context, locate, similarity, bbox_tolerance, spaces_around_values) {
307
+ let deferred5_0;
308
+ let deferred5_1;
309
+ try {
310
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
311
+ const ptr0 = passStringToWasm0(a, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
312
+ const len0 = WASM_VECTOR_LEN;
313
+ const ptr1 = passStringToWasm0(b, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
314
+ const len1 = WASM_VECTOR_LEN;
315
+ const ptr2 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
316
+ const len2 = WASM_VECTOR_LEN;
317
+ const ptr3 = passStringToWasm0(output_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
318
+ const len3 = WASM_VECTOR_LEN;
319
+ wasm.diff(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, context, locate, similarity, bbox_tolerance, spaces_around_values);
320
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
321
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
322
+ deferred5_0 = r0;
323
+ deferred5_1 = r1;
324
+ return getStringFromWasm0(r0, r1);
325
+ } finally {
326
+ wasm.__wbindgen_add_to_stack_pointer(16);
327
+ wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
328
+ }
329
+ }
330
+ function register(data_type, data) {
331
+ let deferred3_0;
332
+ let deferred3_1;
333
+ try {
334
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
335
+ const ptr0 = passStringToWasm0(data_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
336
+ const len0 = WASM_VECTOR_LEN;
337
+ const ptr1 = passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
338
+ const len1 = WASM_VECTOR_LEN;
339
+ wasm.register(retptr, ptr0, len0, ptr1, len1);
340
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
341
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
342
+ deferred3_0 = r0;
343
+ deferred3_1 = r1;
344
+ return getStringFromWasm0(r0, r1);
345
+ } finally {
346
+ wasm.__wbindgen_add_to_stack_pointer(16);
347
+ wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
348
+ }
349
+ }
252
350
  function convert(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report) {
253
351
  let deferred5_0;
254
352
  let deferred5_1;
@@ -373,30 +471,6 @@ function prettify(json, indent) {
373
471
  wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
374
472
  }
375
473
  }
376
- function convert_text(input, direction, format, location) {
377
- let deferred5_0;
378
- let deferred5_1;
379
- try {
380
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
381
- const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
382
- const len0 = WASM_VECTOR_LEN;
383
- const ptr1 = passStringToWasm0(direction, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
384
- const len1 = WASM_VECTOR_LEN;
385
- const ptr2 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
386
- const len2 = WASM_VECTOR_LEN;
387
- const ptr3 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
388
- const len3 = WASM_VECTOR_LEN;
389
- wasm.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
390
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
391
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
392
- deferred5_0 = r0;
393
- deferred5_1 = r1;
394
- return getStringFromWasm0(r0, r1);
395
- } finally {
396
- wasm.__wbindgen_add_to_stack_pointer(16);
397
- wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
398
- }
399
- }
400
474
  async function __wbg_load(module2, imports) {
401
475
  if (typeof Response === "function" && module2 instanceof Response) {
402
476
  if (typeof WebAssembly.instantiateStreaming === "function") {
@@ -474,19 +548,23 @@ async function __wbg_init(module_or_path) {
474
548
  }
475
549
  var bitmark_wasm_default = __wbg_init;
476
550
 
477
- // wasm-web-bitmark-json/bitmark_json_wasm.js
478
- var bitmark_json_wasm_exports = {};
479
- __export(bitmark_json_wasm_exports, {
551
+ // wasm-web-browser-full/bitmark_browser_full_wasm.js
552
+ var bitmark_browser_full_wasm_exports = {};
553
+ __export(bitmark_browser_full_wasm_exports, {
480
554
  breakscape_text: () => breakscape_text2,
481
555
  canonicalize: () => canonicalize2,
482
556
  convert: () => convert2,
483
557
  convert_text: () => convert_text2,
484
558
  count_bits: () => count_bits2,
485
- default: () => bitmark_json_wasm_default,
559
+ default: () => bitmark_browser_full_wasm_default,
560
+ diff: () => diff2,
486
561
  info: () => info2,
487
562
  initSync: () => initSync2,
488
563
  is_bitmark: () => is_bitmark2,
564
+ lex: () => lex2,
489
565
  prettify: () => prettify2,
566
+ register: () => register2,
567
+ resolve_patch_document: () => resolve_patch_document2,
490
568
  split_bits: () => split_bits2,
491
569
  split_json_bits: () => split_json_bits2,
492
570
  transform: () => transform2,
@@ -507,24 +585,516 @@ var cachedTextEncoder2 = typeof TextEncoder !== "undefined" ? new TextEncoder("u
507
585
  var encodeString2 = typeof cachedTextEncoder2.encodeInto === "function" ? function(arg, view) {
508
586
  return cachedTextEncoder2.encodeInto(arg, view);
509
587
  } : function(arg, view) {
510
- const buf = cachedTextEncoder2.encode(arg);
588
+ const buf = cachedTextEncoder2.encode(arg);
589
+ view.set(buf);
590
+ return {
591
+ read: arg.length,
592
+ written: buf.length
593
+ };
594
+ };
595
+ function passStringToWasm02(arg, malloc, realloc) {
596
+ if (realloc === void 0) {
597
+ const buf = cachedTextEncoder2.encode(arg);
598
+ const ptr2 = malloc(buf.length, 1) >>> 0;
599
+ getUint8ArrayMemory02().subarray(ptr2, ptr2 + buf.length).set(buf);
600
+ WASM_VECTOR_LEN2 = buf.length;
601
+ return ptr2;
602
+ }
603
+ let len = arg.length;
604
+ let ptr = malloc(len, 1) >>> 0;
605
+ const mem = getUint8ArrayMemory02();
606
+ let offset = 0;
607
+ for (; offset < len; offset++) {
608
+ const code = arg.charCodeAt(offset);
609
+ if (code > 127) break;
610
+ mem[ptr + offset] = code;
611
+ }
612
+ if (offset !== len) {
613
+ if (offset !== 0) {
614
+ arg = arg.slice(offset);
615
+ }
616
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
617
+ const view = getUint8ArrayMemory02().subarray(ptr + offset, ptr + len);
618
+ const ret = encodeString2(arg, view);
619
+ offset += ret.written;
620
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
621
+ }
622
+ WASM_VECTOR_LEN2 = offset;
623
+ return ptr;
624
+ }
625
+ var cachedDataViewMemory02 = null;
626
+ function getDataViewMemory02() {
627
+ if (cachedDataViewMemory02 === null || cachedDataViewMemory02.buffer.detached === true || cachedDataViewMemory02.buffer.detached === void 0 && cachedDataViewMemory02.buffer !== wasm2.memory.buffer) {
628
+ cachedDataViewMemory02 = new DataView(wasm2.memory.buffer);
629
+ }
630
+ return cachedDataViewMemory02;
631
+ }
632
+ var cachedTextDecoder2 = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
633
+ throw Error("TextDecoder not available");
634
+ } };
635
+ if (typeof TextDecoder !== "undefined") {
636
+ cachedTextDecoder2.decode();
637
+ }
638
+ function getStringFromWasm02(ptr, len) {
639
+ ptr = ptr >>> 0;
640
+ return cachedTextDecoder2.decode(getUint8ArrayMemory02().subarray(ptr, ptr + len));
641
+ }
642
+ function lex2(input, stage) {
643
+ let deferred3_0;
644
+ let deferred3_1;
645
+ try {
646
+ const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
647
+ const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
648
+ const len0 = WASM_VECTOR_LEN2;
649
+ const ptr1 = passStringToWasm02(stage, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
650
+ const len1 = WASM_VECTOR_LEN2;
651
+ wasm2.lex(retptr, ptr0, len0, ptr1, len1);
652
+ var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
653
+ var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
654
+ deferred3_0 = r0;
655
+ deferred3_1 = r1;
656
+ return getStringFromWasm02(r0, r1);
657
+ } finally {
658
+ wasm2.__wbindgen_add_to_stack_pointer(16);
659
+ wasm2.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
660
+ }
661
+ }
662
+ function breakscape_text2(input, format, location) {
663
+ let deferred4_0;
664
+ let deferred4_1;
665
+ try {
666
+ const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
667
+ const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
668
+ const len0 = WASM_VECTOR_LEN2;
669
+ const ptr1 = passStringToWasm02(format, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
670
+ const len1 = WASM_VECTOR_LEN2;
671
+ const ptr2 = passStringToWasm02(location, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
672
+ const len2 = WASM_VECTOR_LEN2;
673
+ wasm2.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
674
+ var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
675
+ var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
676
+ deferred4_0 = r0;
677
+ deferred4_1 = r1;
678
+ return getStringFromWasm02(r0, r1);
679
+ } finally {
680
+ wasm2.__wbindgen_add_to_stack_pointer(16);
681
+ wasm2.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
682
+ }
683
+ }
684
+ function unbreakscape_text2(input, format, location) {
685
+ let deferred4_0;
686
+ let deferred4_1;
687
+ try {
688
+ const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
689
+ const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
690
+ const len0 = WASM_VECTOR_LEN2;
691
+ const ptr1 = passStringToWasm02(format, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
692
+ const len1 = WASM_VECTOR_LEN2;
693
+ const ptr2 = passStringToWasm02(location, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
694
+ const len2 = WASM_VECTOR_LEN2;
695
+ wasm2.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
696
+ var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
697
+ var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
698
+ deferred4_0 = r0;
699
+ deferred4_1 = r1;
700
+ return getStringFromWasm02(r0, r1);
701
+ } finally {
702
+ wasm2.__wbindgen_add_to_stack_pointer(16);
703
+ wasm2.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
704
+ }
705
+ }
706
+ function info2(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full, language) {
707
+ let deferred5_0;
708
+ let deferred5_1;
709
+ try {
710
+ const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
711
+ const ptr0 = passStringToWasm02(info_type, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
712
+ const len0 = WASM_VECTOR_LEN2;
713
+ const ptr1 = passStringToWasm02(format, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
714
+ const len1 = WASM_VECTOR_LEN2;
715
+ const ptr2 = passStringToWasm02(bit, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
716
+ const len2 = WASM_VECTOR_LEN2;
717
+ const ptr3 = passStringToWasm02(language, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
718
+ const len3 = WASM_VECTOR_LEN2;
719
+ wasm2.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, include_deprecated, only_deprecated, full, ptr3, len3);
720
+ var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
721
+ var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
722
+ deferred5_0 = r0;
723
+ deferred5_1 = r1;
724
+ return getStringFromWasm02(r0, r1);
725
+ } finally {
726
+ wasm2.__wbindgen_add_to_stack_pointer(16);
727
+ wasm2.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
728
+ }
729
+ }
730
+ function convert_text2(input, direction, format, location) {
731
+ let deferred5_0;
732
+ let deferred5_1;
733
+ try {
734
+ const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
735
+ const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
736
+ const len0 = WASM_VECTOR_LEN2;
737
+ const ptr1 = passStringToWasm02(direction, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
738
+ const len1 = WASM_VECTOR_LEN2;
739
+ const ptr2 = passStringToWasm02(format, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
740
+ const len2 = WASM_VECTOR_LEN2;
741
+ const ptr3 = passStringToWasm02(location, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
742
+ const len3 = WASM_VECTOR_LEN2;
743
+ wasm2.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
744
+ var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
745
+ var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
746
+ deferred5_0 = r0;
747
+ deferred5_1 = r1;
748
+ return getStringFromWasm02(r0, r1);
749
+ } finally {
750
+ wasm2.__wbindgen_add_to_stack_pointer(16);
751
+ wasm2.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
752
+ }
753
+ }
754
+ function transform2(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
755
+ let deferred6_0;
756
+ let deferred6_1;
757
+ try {
758
+ const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
759
+ const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
760
+ const len0 = WASM_VECTOR_LEN2;
761
+ const ptr1 = passStringToWasm02(input_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
762
+ const len1 = WASM_VECTOR_LEN2;
763
+ const ptr2 = passStringToWasm02(output_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
764
+ const len2 = WASM_VECTOR_LEN2;
765
+ const ptr3 = passStringToWasm02(mode, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
766
+ const len3 = WASM_VECTOR_LEN2;
767
+ const ptr4 = passStringToWasm02(patch_json, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
768
+ const len4 = WASM_VECTOR_LEN2;
769
+ wasm2.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);
770
+ var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
771
+ var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
772
+ deferred6_0 = r0;
773
+ deferred6_1 = r1;
774
+ return getStringFromWasm02(r0, r1);
775
+ } finally {
776
+ wasm2.__wbindgen_add_to_stack_pointer(16);
777
+ wasm2.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
778
+ }
779
+ }
780
+ function resolve_patch_document2(input, patch_json) {
781
+ let deferred3_0;
782
+ let deferred3_1;
783
+ try {
784
+ const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
785
+ const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
786
+ const len0 = WASM_VECTOR_LEN2;
787
+ const ptr1 = passStringToWasm02(patch_json, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
788
+ const len1 = WASM_VECTOR_LEN2;
789
+ wasm2.resolve_patch_document(retptr, ptr0, len0, ptr1, len1);
790
+ var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
791
+ var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
792
+ deferred3_0 = r0;
793
+ deferred3_1 = r1;
794
+ return getStringFromWasm02(r0, r1);
795
+ } finally {
796
+ wasm2.__wbindgen_add_to_stack_pointer(16);
797
+ wasm2.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
798
+ }
799
+ }
800
+ function diff2(a, b, input_format_sel, output_format_sel, context, locate, similarity, bbox_tolerance, spaces_around_values) {
801
+ let deferred5_0;
802
+ let deferred5_1;
803
+ try {
804
+ const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
805
+ const ptr0 = passStringToWasm02(a, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
806
+ const len0 = WASM_VECTOR_LEN2;
807
+ const ptr1 = passStringToWasm02(b, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
808
+ const len1 = WASM_VECTOR_LEN2;
809
+ const ptr2 = passStringToWasm02(input_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
810
+ const len2 = WASM_VECTOR_LEN2;
811
+ const ptr3 = passStringToWasm02(output_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
812
+ const len3 = WASM_VECTOR_LEN2;
813
+ wasm2.diff(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, context, locate, similarity, bbox_tolerance, spaces_around_values);
814
+ var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
815
+ var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
816
+ deferred5_0 = r0;
817
+ deferred5_1 = r1;
818
+ return getStringFromWasm02(r0, r1);
819
+ } finally {
820
+ wasm2.__wbindgen_add_to_stack_pointer(16);
821
+ wasm2.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
822
+ }
823
+ }
824
+ function register2(data_type, data) {
825
+ let deferred3_0;
826
+ let deferred3_1;
827
+ try {
828
+ const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
829
+ const ptr0 = passStringToWasm02(data_type, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
830
+ const len0 = WASM_VECTOR_LEN2;
831
+ const ptr1 = passStringToWasm02(data, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
832
+ const len1 = WASM_VECTOR_LEN2;
833
+ wasm2.register(retptr, ptr0, len0, ptr1, len1);
834
+ var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
835
+ var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
836
+ deferred3_0 = r0;
837
+ deferred3_1 = r1;
838
+ return getStringFromWasm02(r0, r1);
839
+ } finally {
840
+ wasm2.__wbindgen_add_to_stack_pointer(16);
841
+ wasm2.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
842
+ }
843
+ }
844
+ function convert2(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report) {
845
+ let deferred5_0;
846
+ let deferred5_1;
847
+ try {
848
+ const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
849
+ const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
850
+ const len0 = WASM_VECTOR_LEN2;
851
+ const ptr1 = passStringToWasm02(input_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
852
+ const len1 = WASM_VECTOR_LEN2;
853
+ const ptr2 = passStringToWasm02(output_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
854
+ const len2 = WASM_VECTOR_LEN2;
855
+ const ptr3 = passStringToWasm02(mode, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
856
+ const len3 = WASM_VECTOR_LEN2;
857
+ wasm2.convert(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report);
858
+ var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
859
+ var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
860
+ deferred5_0 = r0;
861
+ deferred5_1 = r1;
862
+ return getStringFromWasm02(r0, r1);
863
+ } finally {
864
+ wasm2.__wbindgen_add_to_stack_pointer(16);
865
+ wasm2.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
866
+ }
867
+ }
868
+ function canonicalize2(input, input_format_sel, mode, pretty, indent, spaces_around_values) {
869
+ let deferred4_0;
870
+ let deferred4_1;
871
+ try {
872
+ const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
873
+ const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
874
+ const len0 = WASM_VECTOR_LEN2;
875
+ const ptr1 = passStringToWasm02(input_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
876
+ const len1 = WASM_VECTOR_LEN2;
877
+ const ptr2 = passStringToWasm02(mode, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
878
+ const len2 = WASM_VECTOR_LEN2;
879
+ wasm2.canonicalize(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, spaces_around_values);
880
+ var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
881
+ var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
882
+ deferred4_0 = r0;
883
+ deferred4_1 = r1;
884
+ return getStringFromWasm02(r0, r1);
885
+ } finally {
886
+ wasm2.__wbindgen_add_to_stack_pointer(16);
887
+ wasm2.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
888
+ }
889
+ }
890
+ function count_bits2(input) {
891
+ let deferred2_0;
892
+ let deferred2_1;
893
+ try {
894
+ const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
895
+ const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
896
+ const len0 = WASM_VECTOR_LEN2;
897
+ wasm2.count_bits(retptr, ptr0, len0);
898
+ var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
899
+ var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
900
+ deferred2_0 = r0;
901
+ deferred2_1 = r1;
902
+ return getStringFromWasm02(r0, r1);
903
+ } finally {
904
+ wasm2.__wbindgen_add_to_stack_pointer(16);
905
+ wasm2.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
906
+ }
907
+ }
908
+ function split_bits2(input) {
909
+ let deferred2_0;
910
+ let deferred2_1;
911
+ try {
912
+ const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
913
+ const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
914
+ const len0 = WASM_VECTOR_LEN2;
915
+ wasm2.split_bits(retptr, ptr0, len0);
916
+ var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
917
+ var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
918
+ deferred2_0 = r0;
919
+ deferred2_1 = r1;
920
+ return getStringFromWasm02(r0, r1);
921
+ } finally {
922
+ wasm2.__wbindgen_add_to_stack_pointer(16);
923
+ wasm2.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
924
+ }
925
+ }
926
+ function is_bitmark2(input) {
927
+ const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
928
+ const len0 = WASM_VECTOR_LEN2;
929
+ const ret = wasm2.is_bitmark(ptr0, len0);
930
+ return ret !== 0;
931
+ }
932
+ function split_json_bits2(input) {
933
+ let deferred2_0;
934
+ let deferred2_1;
935
+ try {
936
+ const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
937
+ const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
938
+ const len0 = WASM_VECTOR_LEN2;
939
+ wasm2.split_json_bits(retptr, ptr0, len0);
940
+ var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
941
+ var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
942
+ deferred2_0 = r0;
943
+ deferred2_1 = r1;
944
+ return getStringFromWasm02(r0, r1);
945
+ } finally {
946
+ wasm2.__wbindgen_add_to_stack_pointer(16);
947
+ wasm2.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
948
+ }
949
+ }
950
+ function prettify2(json, indent) {
951
+ let deferred2_0;
952
+ let deferred2_1;
953
+ try {
954
+ const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
955
+ const ptr0 = passStringToWasm02(json, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
956
+ const len0 = WASM_VECTOR_LEN2;
957
+ wasm2.prettify(retptr, ptr0, len0, indent);
958
+ var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
959
+ var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
960
+ deferred2_0 = r0;
961
+ deferred2_1 = r1;
962
+ return getStringFromWasm02(r0, r1);
963
+ } finally {
964
+ wasm2.__wbindgen_add_to_stack_pointer(16);
965
+ wasm2.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
966
+ }
967
+ }
968
+ async function __wbg_load2(module2, imports) {
969
+ if (typeof Response === "function" && module2 instanceof Response) {
970
+ if (typeof WebAssembly.instantiateStreaming === "function") {
971
+ try {
972
+ return await WebAssembly.instantiateStreaming(module2, imports);
973
+ } catch (e) {
974
+ if (module2.headers.get("Content-Type") != "application/wasm") {
975
+ 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);
976
+ } else {
977
+ throw e;
978
+ }
979
+ }
980
+ }
981
+ const bytes = await module2.arrayBuffer();
982
+ return await WebAssembly.instantiate(bytes, imports);
983
+ } else {
984
+ const instance = await WebAssembly.instantiate(module2, imports);
985
+ if (instance instanceof WebAssembly.Instance) {
986
+ return { instance, module: module2 };
987
+ } else {
988
+ return instance;
989
+ }
990
+ }
991
+ }
992
+ function __wbg_get_imports2() {
993
+ const imports = {};
994
+ imports.wbg = {};
995
+ return imports;
996
+ }
997
+ function __wbg_init_memory2(imports, memory) {
998
+ }
999
+ function __wbg_finalize_init2(instance, module2) {
1000
+ wasm2 = instance.exports;
1001
+ __wbg_init2.__wbindgen_wasm_module = module2;
1002
+ cachedDataViewMemory02 = null;
1003
+ cachedUint8ArrayMemory02 = null;
1004
+ return wasm2;
1005
+ }
1006
+ function initSync2(module2) {
1007
+ if (wasm2 !== void 0) return wasm2;
1008
+ if (typeof module2 !== "undefined") {
1009
+ if (Object.getPrototypeOf(module2) === Object.prototype) {
1010
+ ({ module: module2 } = module2);
1011
+ } else {
1012
+ console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
1013
+ }
1014
+ }
1015
+ const imports = __wbg_get_imports2();
1016
+ __wbg_init_memory2(imports);
1017
+ if (!(module2 instanceof WebAssembly.Module)) {
1018
+ module2 = new WebAssembly.Module(module2);
1019
+ }
1020
+ const instance = new WebAssembly.Instance(module2, imports);
1021
+ return __wbg_finalize_init2(instance, module2);
1022
+ }
1023
+ async function __wbg_init2(module_or_path) {
1024
+ if (wasm2 !== void 0) return wasm2;
1025
+ if (typeof module_or_path !== "undefined") {
1026
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1027
+ ({ module_or_path } = module_or_path);
1028
+ } else {
1029
+ console.warn("using deprecated parameters for the initialization function; pass a single object instead");
1030
+ }
1031
+ }
1032
+ if (typeof module_or_path === "undefined") {
1033
+ module_or_path = new URL("bitmark_browser_full_wasm_bg.wasm", importMetaUrl);
1034
+ }
1035
+ const imports = __wbg_get_imports2();
1036
+ if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) {
1037
+ module_or_path = fetch(module_or_path);
1038
+ }
1039
+ __wbg_init_memory2(imports);
1040
+ const { instance, module: module2 } = await __wbg_load2(await module_or_path, imports);
1041
+ return __wbg_finalize_init2(instance, module2);
1042
+ }
1043
+ var bitmark_browser_full_wasm_default = __wbg_init2;
1044
+
1045
+ // wasm-web-bitmark-json/bitmark_json_wasm.js
1046
+ var bitmark_json_wasm_exports = {};
1047
+ __export(bitmark_json_wasm_exports, {
1048
+ breakscape_text: () => breakscape_text3,
1049
+ canonicalize: () => canonicalize3,
1050
+ convert: () => convert3,
1051
+ convert_text: () => convert_text3,
1052
+ count_bits: () => count_bits3,
1053
+ default: () => bitmark_json_wasm_default,
1054
+ info: () => info3,
1055
+ initSync: () => initSync3,
1056
+ is_bitmark: () => is_bitmark3,
1057
+ prettify: () => prettify3,
1058
+ register: () => register3,
1059
+ resolve_patch_document: () => resolve_patch_document3,
1060
+ split_bits: () => split_bits3,
1061
+ split_json_bits: () => split_json_bits3,
1062
+ transform: () => transform3,
1063
+ unbreakscape_text: () => unbreakscape_text3
1064
+ });
1065
+ var wasm3;
1066
+ var WASM_VECTOR_LEN3 = 0;
1067
+ var cachedUint8ArrayMemory03 = null;
1068
+ function getUint8ArrayMemory03() {
1069
+ if (cachedUint8ArrayMemory03 === null || cachedUint8ArrayMemory03.byteLength === 0) {
1070
+ cachedUint8ArrayMemory03 = new Uint8Array(wasm3.memory.buffer);
1071
+ }
1072
+ return cachedUint8ArrayMemory03;
1073
+ }
1074
+ var cachedTextEncoder3 = typeof TextEncoder !== "undefined" ? new TextEncoder("utf-8") : { encode: () => {
1075
+ throw Error("TextEncoder not available");
1076
+ } };
1077
+ var encodeString3 = typeof cachedTextEncoder3.encodeInto === "function" ? function(arg, view) {
1078
+ return cachedTextEncoder3.encodeInto(arg, view);
1079
+ } : function(arg, view) {
1080
+ const buf = cachedTextEncoder3.encode(arg);
511
1081
  view.set(buf);
512
1082
  return {
513
1083
  read: arg.length,
514
1084
  written: buf.length
515
1085
  };
516
1086
  };
517
- function passStringToWasm02(arg, malloc, realloc) {
1087
+ function passStringToWasm03(arg, malloc, realloc) {
518
1088
  if (realloc === void 0) {
519
- const buf = cachedTextEncoder2.encode(arg);
1089
+ const buf = cachedTextEncoder3.encode(arg);
520
1090
  const ptr2 = malloc(buf.length, 1) >>> 0;
521
- getUint8ArrayMemory02().subarray(ptr2, ptr2 + buf.length).set(buf);
522
- WASM_VECTOR_LEN2 = buf.length;
1091
+ getUint8ArrayMemory03().subarray(ptr2, ptr2 + buf.length).set(buf);
1092
+ WASM_VECTOR_LEN3 = buf.length;
523
1093
  return ptr2;
524
1094
  }
525
1095
  let len = arg.length;
526
1096
  let ptr = malloc(len, 1) >>> 0;
527
- const mem = getUint8ArrayMemory02();
1097
+ const mem = getUint8ArrayMemory03();
528
1098
  let offset = 0;
529
1099
  for (; offset < len; offset++) {
530
1100
  const code = arg.charCodeAt(offset);
@@ -536,272 +1106,314 @@ function passStringToWasm02(arg, malloc, realloc) {
536
1106
  arg = arg.slice(offset);
537
1107
  }
538
1108
  ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
539
- const view = getUint8ArrayMemory02().subarray(ptr + offset, ptr + len);
540
- const ret = encodeString2(arg, view);
1109
+ const view = getUint8ArrayMemory03().subarray(ptr + offset, ptr + len);
1110
+ const ret = encodeString3(arg, view);
541
1111
  offset += ret.written;
542
1112
  ptr = realloc(ptr, len, offset, 1) >>> 0;
543
1113
  }
544
- WASM_VECTOR_LEN2 = offset;
1114
+ WASM_VECTOR_LEN3 = offset;
545
1115
  return ptr;
546
1116
  }
547
- var cachedDataViewMemory02 = null;
548
- function getDataViewMemory02() {
549
- if (cachedDataViewMemory02 === null || cachedDataViewMemory02.buffer.detached === true || cachedDataViewMemory02.buffer.detached === void 0 && cachedDataViewMemory02.buffer !== wasm2.memory.buffer) {
550
- cachedDataViewMemory02 = new DataView(wasm2.memory.buffer);
1117
+ var cachedDataViewMemory03 = null;
1118
+ function getDataViewMemory03() {
1119
+ if (cachedDataViewMemory03 === null || cachedDataViewMemory03.buffer.detached === true || cachedDataViewMemory03.buffer.detached === void 0 && cachedDataViewMemory03.buffer !== wasm3.memory.buffer) {
1120
+ cachedDataViewMemory03 = new DataView(wasm3.memory.buffer);
551
1121
  }
552
- return cachedDataViewMemory02;
1122
+ return cachedDataViewMemory03;
553
1123
  }
554
- var cachedTextDecoder2 = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
1124
+ var cachedTextDecoder3 = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
555
1125
  throw Error("TextDecoder not available");
556
1126
  } };
557
1127
  if (typeof TextDecoder !== "undefined") {
558
- cachedTextDecoder2.decode();
1128
+ cachedTextDecoder3.decode();
559
1129
  }
560
- function getStringFromWasm02(ptr, len) {
1130
+ function getStringFromWasm03(ptr, len) {
561
1131
  ptr = ptr >>> 0;
562
- return cachedTextDecoder2.decode(getUint8ArrayMemory02().subarray(ptr, ptr + len));
1132
+ return cachedTextDecoder3.decode(getUint8ArrayMemory03().subarray(ptr, ptr + len));
563
1133
  }
564
- function breakscape_text2(input, format, location) {
1134
+ function breakscape_text3(input, format, location) {
565
1135
  let deferred4_0;
566
1136
  let deferred4_1;
567
1137
  try {
568
- const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
569
- const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
570
- const len0 = WASM_VECTOR_LEN2;
571
- const ptr1 = passStringToWasm02(format, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
572
- const len1 = WASM_VECTOR_LEN2;
573
- const ptr2 = passStringToWasm02(location, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
574
- const len2 = WASM_VECTOR_LEN2;
575
- wasm2.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
576
- var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
577
- var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
1138
+ const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
1139
+ const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1140
+ const len0 = WASM_VECTOR_LEN3;
1141
+ const ptr1 = passStringToWasm03(format, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1142
+ const len1 = WASM_VECTOR_LEN3;
1143
+ const ptr2 = passStringToWasm03(location, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1144
+ const len2 = WASM_VECTOR_LEN3;
1145
+ wasm3.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
1146
+ var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
1147
+ var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
578
1148
  deferred4_0 = r0;
579
1149
  deferred4_1 = r1;
580
- return getStringFromWasm02(r0, r1);
1150
+ return getStringFromWasm03(r0, r1);
581
1151
  } finally {
582
- wasm2.__wbindgen_add_to_stack_pointer(16);
583
- wasm2.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
1152
+ wasm3.__wbindgen_add_to_stack_pointer(16);
1153
+ wasm3.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
584
1154
  }
585
1155
  }
586
- function unbreakscape_text2(input, format, location) {
1156
+ function unbreakscape_text3(input, format, location) {
587
1157
  let deferred4_0;
588
1158
  let deferred4_1;
589
1159
  try {
590
- const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
591
- const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
592
- const len0 = WASM_VECTOR_LEN2;
593
- const ptr1 = passStringToWasm02(format, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
594
- const len1 = WASM_VECTOR_LEN2;
595
- const ptr2 = passStringToWasm02(location, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
596
- const len2 = WASM_VECTOR_LEN2;
597
- wasm2.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
598
- var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
599
- var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
1160
+ const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
1161
+ const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1162
+ const len0 = WASM_VECTOR_LEN3;
1163
+ const ptr1 = passStringToWasm03(format, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1164
+ const len1 = WASM_VECTOR_LEN3;
1165
+ const ptr2 = passStringToWasm03(location, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1166
+ const len2 = WASM_VECTOR_LEN3;
1167
+ wasm3.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
1168
+ var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
1169
+ var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
600
1170
  deferred4_0 = r0;
601
1171
  deferred4_1 = r1;
602
- return getStringFromWasm02(r0, r1);
1172
+ return getStringFromWasm03(r0, r1);
603
1173
  } finally {
604
- wasm2.__wbindgen_add_to_stack_pointer(16);
605
- wasm2.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
1174
+ wasm3.__wbindgen_add_to_stack_pointer(16);
1175
+ wasm3.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
606
1176
  }
607
1177
  }
608
- function info2(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full) {
609
- let deferred4_0;
610
- let deferred4_1;
1178
+ function info3(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full, language) {
1179
+ let deferred5_0;
1180
+ let deferred5_1;
611
1181
  try {
612
- const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
613
- const ptr0 = passStringToWasm02(info_type, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
614
- const len0 = WASM_VECTOR_LEN2;
615
- const ptr1 = passStringToWasm02(format, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
616
- const len1 = WASM_VECTOR_LEN2;
617
- const ptr2 = passStringToWasm02(bit, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
618
- const len2 = WASM_VECTOR_LEN2;
619
- wasm2.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, include_deprecated, only_deprecated, full);
620
- var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
621
- var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
622
- deferred4_0 = r0;
623
- deferred4_1 = r1;
624
- return getStringFromWasm02(r0, r1);
1182
+ const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
1183
+ const ptr0 = passStringToWasm03(info_type, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1184
+ const len0 = WASM_VECTOR_LEN3;
1185
+ const ptr1 = passStringToWasm03(format, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1186
+ const len1 = WASM_VECTOR_LEN3;
1187
+ const ptr2 = passStringToWasm03(bit, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1188
+ const len2 = WASM_VECTOR_LEN3;
1189
+ const ptr3 = passStringToWasm03(language, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1190
+ const len3 = WASM_VECTOR_LEN3;
1191
+ wasm3.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, include_deprecated, only_deprecated, full, ptr3, len3);
1192
+ var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
1193
+ var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
1194
+ deferred5_0 = r0;
1195
+ deferred5_1 = r1;
1196
+ return getStringFromWasm03(r0, r1);
625
1197
  } finally {
626
- wasm2.__wbindgen_add_to_stack_pointer(16);
627
- wasm2.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
1198
+ wasm3.__wbindgen_add_to_stack_pointer(16);
1199
+ wasm3.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
628
1200
  }
629
1201
  }
630
- function convert2(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report) {
1202
+ function register3(data_type, data) {
1203
+ let deferred3_0;
1204
+ let deferred3_1;
1205
+ try {
1206
+ const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
1207
+ const ptr0 = passStringToWasm03(data_type, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1208
+ const len0 = WASM_VECTOR_LEN3;
1209
+ const ptr1 = passStringToWasm03(data, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1210
+ const len1 = WASM_VECTOR_LEN3;
1211
+ wasm3.register(retptr, ptr0, len0, ptr1, len1);
1212
+ var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
1213
+ var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
1214
+ deferred3_0 = r0;
1215
+ deferred3_1 = r1;
1216
+ return getStringFromWasm03(r0, r1);
1217
+ } finally {
1218
+ wasm3.__wbindgen_add_to_stack_pointer(16);
1219
+ wasm3.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
1220
+ }
1221
+ }
1222
+ function transform3(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
1223
+ let deferred6_0;
1224
+ let deferred6_1;
1225
+ try {
1226
+ const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
1227
+ const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1228
+ const len0 = WASM_VECTOR_LEN3;
1229
+ const ptr1 = passStringToWasm03(input_format_sel, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1230
+ const len1 = WASM_VECTOR_LEN3;
1231
+ const ptr2 = passStringToWasm03(output_format_sel, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1232
+ const len2 = WASM_VECTOR_LEN3;
1233
+ const ptr3 = passStringToWasm03(mode, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1234
+ const len3 = WASM_VECTOR_LEN3;
1235
+ const ptr4 = passStringToWasm03(patch_json, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1236
+ const len4 = WASM_VECTOR_LEN3;
1237
+ wasm3.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);
1238
+ var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
1239
+ var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
1240
+ deferred6_0 = r0;
1241
+ deferred6_1 = r1;
1242
+ return getStringFromWasm03(r0, r1);
1243
+ } finally {
1244
+ wasm3.__wbindgen_add_to_stack_pointer(16);
1245
+ wasm3.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
1246
+ }
1247
+ }
1248
+ function resolve_patch_document3(input, patch_json) {
1249
+ let deferred3_0;
1250
+ let deferred3_1;
1251
+ try {
1252
+ const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
1253
+ const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1254
+ const len0 = WASM_VECTOR_LEN3;
1255
+ const ptr1 = passStringToWasm03(patch_json, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1256
+ const len1 = WASM_VECTOR_LEN3;
1257
+ wasm3.resolve_patch_document(retptr, ptr0, len0, ptr1, len1);
1258
+ var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
1259
+ var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
1260
+ deferred3_0 = r0;
1261
+ deferred3_1 = r1;
1262
+ return getStringFromWasm03(r0, r1);
1263
+ } finally {
1264
+ wasm3.__wbindgen_add_to_stack_pointer(16);
1265
+ wasm3.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
1266
+ }
1267
+ }
1268
+ function convert3(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report) {
631
1269
  let deferred5_0;
632
1270
  let deferred5_1;
633
1271
  try {
634
- const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
635
- const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
636
- const len0 = WASM_VECTOR_LEN2;
637
- const ptr1 = passStringToWasm02(input_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
638
- const len1 = WASM_VECTOR_LEN2;
639
- const ptr2 = passStringToWasm02(output_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
640
- const len2 = WASM_VECTOR_LEN2;
641
- const ptr3 = passStringToWasm02(mode, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
642
- const len3 = WASM_VECTOR_LEN2;
643
- wasm2.convert(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report);
644
- var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
645
- var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
1272
+ const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
1273
+ const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1274
+ const len0 = WASM_VECTOR_LEN3;
1275
+ const ptr1 = passStringToWasm03(input_format_sel, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1276
+ const len1 = WASM_VECTOR_LEN3;
1277
+ const ptr2 = passStringToWasm03(output_format_sel, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1278
+ const len2 = WASM_VECTOR_LEN3;
1279
+ const ptr3 = passStringToWasm03(mode, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1280
+ const len3 = WASM_VECTOR_LEN3;
1281
+ wasm3.convert(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report);
1282
+ var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
1283
+ var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
646
1284
  deferred5_0 = r0;
647
1285
  deferred5_1 = r1;
648
- return getStringFromWasm02(r0, r1);
1286
+ return getStringFromWasm03(r0, r1);
649
1287
  } finally {
650
- wasm2.__wbindgen_add_to_stack_pointer(16);
651
- wasm2.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
1288
+ wasm3.__wbindgen_add_to_stack_pointer(16);
1289
+ wasm3.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
652
1290
  }
653
1291
  }
654
- function canonicalize2(input, input_format_sel, mode, pretty, indent, spaces_around_values) {
1292
+ function canonicalize3(input, input_format_sel, mode, pretty, indent, spaces_around_values) {
655
1293
  let deferred4_0;
656
1294
  let deferred4_1;
657
1295
  try {
658
- const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
659
- const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
660
- const len0 = WASM_VECTOR_LEN2;
661
- const ptr1 = passStringToWasm02(input_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
662
- const len1 = WASM_VECTOR_LEN2;
663
- const ptr2 = passStringToWasm02(mode, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
664
- const len2 = WASM_VECTOR_LEN2;
665
- wasm2.canonicalize(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, spaces_around_values);
666
- var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
667
- var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
1296
+ const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
1297
+ const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1298
+ const len0 = WASM_VECTOR_LEN3;
1299
+ const ptr1 = passStringToWasm03(input_format_sel, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1300
+ const len1 = WASM_VECTOR_LEN3;
1301
+ const ptr2 = passStringToWasm03(mode, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1302
+ const len2 = WASM_VECTOR_LEN3;
1303
+ wasm3.canonicalize(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, spaces_around_values);
1304
+ var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
1305
+ var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
668
1306
  deferred4_0 = r0;
669
1307
  deferred4_1 = r1;
670
- return getStringFromWasm02(r0, r1);
1308
+ return getStringFromWasm03(r0, r1);
671
1309
  } finally {
672
- wasm2.__wbindgen_add_to_stack_pointer(16);
673
- wasm2.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
1310
+ wasm3.__wbindgen_add_to_stack_pointer(16);
1311
+ wasm3.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
674
1312
  }
675
1313
  }
676
- function count_bits2(input) {
1314
+ function count_bits3(input) {
677
1315
  let deferred2_0;
678
1316
  let deferred2_1;
679
1317
  try {
680
- const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
681
- const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
682
- const len0 = WASM_VECTOR_LEN2;
683
- wasm2.count_bits(retptr, ptr0, len0);
684
- var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
685
- var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
1318
+ const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
1319
+ const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1320
+ const len0 = WASM_VECTOR_LEN3;
1321
+ wasm3.count_bits(retptr, ptr0, len0);
1322
+ var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
1323
+ var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
686
1324
  deferred2_0 = r0;
687
1325
  deferred2_1 = r1;
688
- return getStringFromWasm02(r0, r1);
1326
+ return getStringFromWasm03(r0, r1);
689
1327
  } finally {
690
- wasm2.__wbindgen_add_to_stack_pointer(16);
691
- wasm2.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
1328
+ wasm3.__wbindgen_add_to_stack_pointer(16);
1329
+ wasm3.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
692
1330
  }
693
1331
  }
694
- function split_bits2(input) {
1332
+ function split_bits3(input) {
695
1333
  let deferred2_0;
696
1334
  let deferred2_1;
697
1335
  try {
698
- const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
699
- const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
700
- const len0 = WASM_VECTOR_LEN2;
701
- wasm2.split_bits(retptr, ptr0, len0);
702
- var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
703
- var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
1336
+ const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
1337
+ const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1338
+ const len0 = WASM_VECTOR_LEN3;
1339
+ wasm3.split_bits(retptr, ptr0, len0);
1340
+ var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
1341
+ var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
704
1342
  deferred2_0 = r0;
705
1343
  deferred2_1 = r1;
706
- return getStringFromWasm02(r0, r1);
1344
+ return getStringFromWasm03(r0, r1);
707
1345
  } finally {
708
- wasm2.__wbindgen_add_to_stack_pointer(16);
709
- wasm2.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
1346
+ wasm3.__wbindgen_add_to_stack_pointer(16);
1347
+ wasm3.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
710
1348
  }
711
1349
  }
712
- function is_bitmark2(input) {
713
- const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
714
- const len0 = WASM_VECTOR_LEN2;
715
- const ret = wasm2.is_bitmark(ptr0, len0);
1350
+ function is_bitmark3(input) {
1351
+ const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1352
+ const len0 = WASM_VECTOR_LEN3;
1353
+ const ret = wasm3.is_bitmark(ptr0, len0);
716
1354
  return ret !== 0;
717
1355
  }
718
- function split_json_bits2(input) {
1356
+ function split_json_bits3(input) {
719
1357
  let deferred2_0;
720
1358
  let deferred2_1;
721
1359
  try {
722
- const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
723
- const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
724
- const len0 = WASM_VECTOR_LEN2;
725
- wasm2.split_json_bits(retptr, ptr0, len0);
726
- var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
727
- var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
1360
+ const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
1361
+ const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1362
+ const len0 = WASM_VECTOR_LEN3;
1363
+ wasm3.split_json_bits(retptr, ptr0, len0);
1364
+ var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
1365
+ var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
728
1366
  deferred2_0 = r0;
729
1367
  deferred2_1 = r1;
730
- return getStringFromWasm02(r0, r1);
1368
+ return getStringFromWasm03(r0, r1);
731
1369
  } finally {
732
- wasm2.__wbindgen_add_to_stack_pointer(16);
733
- wasm2.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
1370
+ wasm3.__wbindgen_add_to_stack_pointer(16);
1371
+ wasm3.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
734
1372
  }
735
1373
  }
736
- function prettify2(json, indent) {
1374
+ function prettify3(json, indent) {
737
1375
  let deferred2_0;
738
1376
  let deferred2_1;
739
1377
  try {
740
- const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
741
- const ptr0 = passStringToWasm02(json, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
742
- const len0 = WASM_VECTOR_LEN2;
743
- wasm2.prettify(retptr, ptr0, len0, indent);
744
- var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
745
- var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
1378
+ const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
1379
+ const ptr0 = passStringToWasm03(json, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1380
+ const len0 = WASM_VECTOR_LEN3;
1381
+ wasm3.prettify(retptr, ptr0, len0, indent);
1382
+ var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
1383
+ var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
746
1384
  deferred2_0 = r0;
747
1385
  deferred2_1 = r1;
748
- return getStringFromWasm02(r0, r1);
1386
+ return getStringFromWasm03(r0, r1);
749
1387
  } finally {
750
- wasm2.__wbindgen_add_to_stack_pointer(16);
751
- wasm2.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
1388
+ wasm3.__wbindgen_add_to_stack_pointer(16);
1389
+ wasm3.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
752
1390
  }
753
1391
  }
754
- function convert_text2(input, direction, format, location) {
1392
+ function convert_text3(input, direction, format, location) {
755
1393
  let deferred5_0;
756
1394
  let deferred5_1;
757
1395
  try {
758
- const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
759
- const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
760
- const len0 = WASM_VECTOR_LEN2;
761
- const ptr1 = passStringToWasm02(direction, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
762
- const len1 = WASM_VECTOR_LEN2;
763
- const ptr2 = passStringToWasm02(format, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
764
- const len2 = WASM_VECTOR_LEN2;
765
- const ptr3 = passStringToWasm02(location, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
766
- const len3 = WASM_VECTOR_LEN2;
767
- wasm2.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
768
- var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
769
- var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
1396
+ const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
1397
+ const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1398
+ const len0 = WASM_VECTOR_LEN3;
1399
+ const ptr1 = passStringToWasm03(direction, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1400
+ const len1 = WASM_VECTOR_LEN3;
1401
+ const ptr2 = passStringToWasm03(format, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1402
+ const len2 = WASM_VECTOR_LEN3;
1403
+ const ptr3 = passStringToWasm03(location, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
1404
+ const len3 = WASM_VECTOR_LEN3;
1405
+ wasm3.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
1406
+ var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
1407
+ var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
770
1408
  deferred5_0 = r0;
771
1409
  deferred5_1 = r1;
772
- return getStringFromWasm02(r0, r1);
773
- } finally {
774
- wasm2.__wbindgen_add_to_stack_pointer(16);
775
- wasm2.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
776
- }
777
- }
778
- function transform2(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
779
- let deferred6_0;
780
- let deferred6_1;
781
- try {
782
- const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
783
- const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
784
- const len0 = WASM_VECTOR_LEN2;
785
- const ptr1 = passStringToWasm02(input_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
786
- const len1 = WASM_VECTOR_LEN2;
787
- const ptr2 = passStringToWasm02(output_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
788
- const len2 = WASM_VECTOR_LEN2;
789
- const ptr3 = passStringToWasm02(mode, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
790
- const len3 = WASM_VECTOR_LEN2;
791
- const ptr4 = passStringToWasm02(patch_json, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
792
- const len4 = WASM_VECTOR_LEN2;
793
- wasm2.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);
794
- var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
795
- var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
796
- deferred6_0 = r0;
797
- deferred6_1 = r1;
798
- return getStringFromWasm02(r0, r1);
1410
+ return getStringFromWasm03(r0, r1);
799
1411
  } finally {
800
- wasm2.__wbindgen_add_to_stack_pointer(16);
801
- wasm2.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
1412
+ wasm3.__wbindgen_add_to_stack_pointer(16);
1413
+ wasm3.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
802
1414
  }
803
1415
  }
804
- async function __wbg_load2(module2, imports) {
1416
+ async function __wbg_load3(module2, imports) {
805
1417
  if (typeof Response === "function" && module2 instanceof Response) {
806
1418
  if (typeof WebAssembly.instantiateStreaming === "function") {
807
1419
  try {
@@ -825,22 +1437,22 @@ async function __wbg_load2(module2, imports) {
825
1437
  }
826
1438
  }
827
1439
  }
828
- function __wbg_get_imports2() {
1440
+ function __wbg_get_imports3() {
829
1441
  const imports = {};
830
1442
  imports.wbg = {};
831
1443
  return imports;
832
1444
  }
833
- function __wbg_init_memory2(imports, memory) {
1445
+ function __wbg_init_memory3(imports, memory) {
834
1446
  }
835
- function __wbg_finalize_init2(instance, module2) {
836
- wasm2 = instance.exports;
837
- __wbg_init2.__wbindgen_wasm_module = module2;
838
- cachedDataViewMemory02 = null;
839
- cachedUint8ArrayMemory02 = null;
840
- return wasm2;
1447
+ function __wbg_finalize_init3(instance, module2) {
1448
+ wasm3 = instance.exports;
1449
+ __wbg_init3.__wbindgen_wasm_module = module2;
1450
+ cachedDataViewMemory03 = null;
1451
+ cachedUint8ArrayMemory03 = null;
1452
+ return wasm3;
841
1453
  }
842
- function initSync2(module2) {
843
- if (wasm2 !== void 0) return wasm2;
1454
+ function initSync3(module2) {
1455
+ if (wasm3 !== void 0) return wasm3;
844
1456
  if (typeof module2 !== "undefined") {
845
1457
  if (Object.getPrototypeOf(module2) === Object.prototype) {
846
1458
  ({ module: module2 } = module2);
@@ -848,16 +1460,16 @@ function initSync2(module2) {
848
1460
  console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
849
1461
  }
850
1462
  }
851
- const imports = __wbg_get_imports2();
852
- __wbg_init_memory2(imports);
1463
+ const imports = __wbg_get_imports3();
1464
+ __wbg_init_memory3(imports);
853
1465
  if (!(module2 instanceof WebAssembly.Module)) {
854
1466
  module2 = new WebAssembly.Module(module2);
855
1467
  }
856
1468
  const instance = new WebAssembly.Instance(module2, imports);
857
- return __wbg_finalize_init2(instance, module2);
1469
+ return __wbg_finalize_init3(instance, module2);
858
1470
  }
859
- async function __wbg_init2(module_or_path) {
860
- if (wasm2 !== void 0) return wasm2;
1471
+ async function __wbg_init3(module_or_path) {
1472
+ if (wasm3 !== void 0) return wasm3;
861
1473
  if (typeof module_or_path !== "undefined") {
862
1474
  if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
863
1475
  ({ module_or_path } = module_or_path);
@@ -868,32 +1480,39 @@ async function __wbg_init2(module_or_path) {
868
1480
  if (typeof module_or_path === "undefined") {
869
1481
  module_or_path = new URL("bitmark_json_wasm_bg.wasm", importMetaUrl);
870
1482
  }
871
- const imports = __wbg_get_imports2();
1483
+ const imports = __wbg_get_imports3();
872
1484
  if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) {
873
1485
  module_or_path = fetch(module_or_path);
874
1486
  }
875
- __wbg_init_memory2(imports);
876
- const { instance, module: module2 } = await __wbg_load2(await module_or_path, imports);
877
- return __wbg_finalize_init2(instance, module2);
1487
+ __wbg_init_memory3(imports);
1488
+ const { instance, module: module2 } = await __wbg_load3(await module_or_path, imports);
1489
+ return __wbg_finalize_init3(instance, module2);
878
1490
  }
879
- var bitmark_json_wasm_default = __wbg_init2;
1491
+ var bitmark_json_wasm_default = __wbg_init3;
880
1492
 
881
1493
  // src/generated/package_info.ts
882
1494
  var PACKAGE_INFO = {
883
1495
  "name": "@gmb/bitmark-parser",
884
- "version": "6.10.1",
1496
+ "version": "6.11.1",
885
1497
  "author": "Get More Brain Ltd <info@getmorebrain.com>",
886
1498
  "license": "ISC",
887
1499
  "description": "A parser for bitmark text, powered by WebAssembly."
888
1500
  };
889
1501
 
890
1502
  // src/core/facade.ts
1503
+ var BROWSER_DEFAULT_FEATURE = "browser-full";
891
1504
  var NotInitializedError = class extends Error {
892
1505
  constructor() {
893
1506
  super("wasm not initialised: call init() (or init({ feature: \u2026 })) first");
894
1507
  this.name = "NotInitializedError";
895
1508
  }
896
1509
  };
1510
+ var RegisterError = class extends Error {
1511
+ constructor(message) {
1512
+ super(message);
1513
+ this.name = "RegisterError";
1514
+ }
1515
+ };
897
1516
  var UnsupportedFeatureError = class extends Error {
898
1517
  constructor(what, active2) {
899
1518
  super(
@@ -905,15 +1524,23 @@ var UnsupportedFeatureError = class extends Error {
905
1524
  var active;
906
1525
  var activeFeature;
907
1526
  var lazyLoader;
1527
+ var registrations = /* @__PURE__ */ new Map();
908
1528
  function getActive() {
909
1529
  if (!active && lazyLoader) lazyLoader();
910
1530
  if (!active) throw new NotInitializedError();
911
1531
  return active;
912
1532
  }
913
1533
  function setActive(feature, module2) {
1534
+ for (const [type, data] of registrations) {
1535
+ const error = module2.register(type, data);
1536
+ if (error) throw new RegisterError(error.replace(/^error:\s*/, ""));
1537
+ }
914
1538
  active = module2;
915
1539
  activeFeature = feature;
916
1540
  }
1541
+ function rememberRegistration(type, data) {
1542
+ registrations.set(type, data);
1543
+ }
917
1544
  function variant() {
918
1545
  return activeFeature;
919
1546
  }
@@ -930,17 +1557,14 @@ function stripArray(doc) {
930
1557
  const t = doc.trim();
931
1558
  return t.startsWith("[") && t.endsWith("]") ? t.slice(1, -1) : doc;
932
1559
  }
933
- function normalisePatch(patch) {
934
- if (patch === void 0) return [];
935
- if (typeof patch === "string") {
936
- const trimmed = patch.trim();
937
- return trimmed === "" ? [] : JSON.parse(trimmed);
938
- }
939
- return patch;
1560
+ function patchJsonOf(patch) {
1561
+ if (patch === void 0) return "";
1562
+ if (typeof patch === "string") return patch.trim();
1563
+ return JSON.stringify(patch);
940
1564
  }
941
- function buildUnits(wasm3, input, inputIsBitmark) {
1565
+ function buildUnits(wasm4, input, inputIsBitmark) {
942
1566
  if (inputIsBitmark) {
943
- const out2 = wasm3.split_bits(input);
1567
+ const out2 = wasm4.split_bits(input);
944
1568
  if (isError(out2)) throw new Error(out2);
945
1569
  const slices = JSON.parse(out2);
946
1570
  return slices.map((s) => ({
@@ -948,7 +1572,7 @@ function buildUnits(wasm3, input, inputIsBitmark) {
948
1572
  source: s.source
949
1573
  }));
950
1574
  }
951
- const out = wasm3.split_json_bits(input);
1575
+ const out = wasm4.split_json_bits(input);
952
1576
  if (isError(out)) throw new Error(out);
953
1577
  const envelopes = JSON.parse(out);
954
1578
  return envelopes.map((env, index) => ({
@@ -957,42 +1581,70 @@ function buildUnits(wasm3, input, inputIsBitmark) {
957
1581
  source: JSON.stringify([env])
958
1582
  }));
959
1583
  }
960
- function planTransform(wasm3, input, options) {
1584
+ function planTransform(wasm4, input, options) {
961
1585
  const mode = options.mode ?? "optimized";
962
1586
  const output = options.outputFormat ?? "json";
963
1587
  const spacesAroundValues = options.spacesAroundValues ?? 1;
964
1588
  const indent = options.indent ?? 2;
965
1589
  const pretty = options.pretty ?? false;
966
1590
  const sel = options.inputFormat ?? "auto";
967
- const inputIsBitmark = sel === "bitmark" || sel !== "json" && wasm3.is_bitmark(input);
1591
+ const inputIsBitmark = sel === "bitmark" || sel !== "json" && wasm4.is_bitmark(input);
968
1592
  const inputFormat = inputIsBitmark ? "bitmark" : "json";
969
- const staticPatch = normalisePatch(options.patch);
970
- const units = buildUnits(wasm3, input, inputIsBitmark);
1593
+ const units = buildUnits(wasm4, input, inputIsBitmark);
971
1594
  const total = units.length;
972
- const jobs = [];
973
- const views = [];
1595
+ const hooked = [];
974
1596
  for (let index = 0; index < total; index++) {
975
- const { view, source } = units[index];
1597
+ const { view } = units[index];
976
1598
  view.index = index;
977
1599
  view.total = total;
978
1600
  const result = options.preHook ? options.preHook(view) || {} : {};
979
- if (result.drop) continue;
980
- const patches = result.patches ? [...staticPatch, ...result.patches] : staticPatch;
981
- jobs.push({
982
- index,
983
- source,
984
- inputFormat,
985
- outputFormat: result.outputFormat ?? output,
986
- mode,
987
- patchJson: JSON.stringify(patches),
988
- spacesAroundValues
989
- });
990
- views.push(view);
1601
+ hooked.push(result.drop ? null : { patches: result.patches ?? [], outputFormat: result.outputFormat ?? output });
1602
+ }
1603
+ const patchJson = patchJsonOf(options.patch);
1604
+ let resolved;
1605
+ if (patchJson === "") {
1606
+ resolved = units.map((_, index) => ({ source: index, bit: null, patch: [] }));
1607
+ } else {
1608
+ const out = wasm4.resolve_patch_document(input, patchJson);
1609
+ if (isError(out)) throw new Error(out);
1610
+ resolved = JSON.parse(out);
1611
+ }
1612
+ const jobs = [];
1613
+ const views = [];
1614
+ for (const item of resolved) {
1615
+ if (item.source !== null) {
1616
+ const hook = hooked[item.source];
1617
+ if (!hook) continue;
1618
+ jobs.push({
1619
+ index: item.source,
1620
+ source: units[item.source].source,
1621
+ inputFormat,
1622
+ outputFormat: hook.outputFormat,
1623
+ mode,
1624
+ // The document's patches first, the hook's after (the hook contract).
1625
+ patchJson: JSON.stringify([...item.patch, ...hook.patches]),
1626
+ spacesAroundValues
1627
+ });
1628
+ views.push(units[item.source].view);
1629
+ } else {
1630
+ const bit = item.bit ?? {};
1631
+ const index = jobs.length;
1632
+ jobs.push({
1633
+ index,
1634
+ source: JSON.stringify([{ bit }]),
1635
+ inputFormat: "json",
1636
+ outputFormat: output,
1637
+ mode,
1638
+ patchJson: JSON.stringify(item.patch),
1639
+ spacesAroundValues
1640
+ });
1641
+ views.push({ format: "json", index, total, bit });
1642
+ }
991
1643
  }
992
1644
  return { jobs, views, output, pretty, indent };
993
1645
  }
994
- function computeBit(wasm3, job) {
995
- const out = wasm3.transform(
1646
+ function computeBit(wasm4, job) {
1647
+ const out = wasm4.transform(
996
1648
  job.source,
997
1649
  job.inputFormat,
998
1650
  job.outputFormat,
@@ -1005,33 +1657,33 @@ function computeBit(wasm3, job) {
1005
1657
  if (isError(out)) return out;
1006
1658
  return job.outputFormat === "json" ? stripArray(out) : out;
1007
1659
  }
1008
- function recombine(wasm3, elements, output, pretty, indent) {
1660
+ function recombine(wasm4, elements, output, pretty, indent) {
1009
1661
  if (output === "bitmark" || output === "text") return elements.join("\n");
1010
1662
  const arr = `[${elements.join(",")}]`;
1011
- return pretty ? wasm3.prettify(arr, indent) : arr;
1663
+ return pretty ? wasm4.prettify(arr, indent) : arr;
1012
1664
  }
1013
- function runHookedTransform(wasm3, input, options) {
1665
+ function runHookedTransform(wasm4, input, options) {
1014
1666
  let plan;
1015
1667
  try {
1016
- plan = planTransform(wasm3, input, options);
1668
+ plan = planTransform(wasm4, input, options);
1017
1669
  } catch (e) {
1018
1670
  return errorString(e);
1019
1671
  }
1020
1672
  const rendered = [];
1021
1673
  for (let i = 0; i < plan.jobs.length; i++) {
1022
- const element = computeBit(wasm3, plan.jobs[i]);
1674
+ const element = computeBit(wasm4, plan.jobs[i]);
1023
1675
  if (isError(element)) return element;
1024
1676
  options.postHook?.(plan.views[i], element);
1025
1677
  rendered.push(element);
1026
1678
  }
1027
- return recombine(wasm3, rendered, plan.output, plan.pretty, plan.indent);
1679
+ return recombine(wasm4, rendered, plan.output, plan.pretty, plan.indent);
1028
1680
  }
1029
1681
 
1030
1682
  // src/core/parallel.ts
1031
- async function orchestrateParallel(wasm3, input, options, runJobs) {
1683
+ async function orchestrateParallel(wasm4, input, options, runJobs) {
1032
1684
  let plan;
1033
1685
  try {
1034
- plan = planTransform(wasm3, input, options);
1686
+ plan = planTransform(wasm4, input, options);
1035
1687
  } catch (e) {
1036
1688
  return errorString(e);
1037
1689
  }
@@ -1045,7 +1697,7 @@ async function orchestrateParallel(wasm3, input, options, runJobs) {
1045
1697
  if (isError(elements[i])) return elements[i];
1046
1698
  options.postHook?.(plan.views[i], elements[i]);
1047
1699
  }
1048
- return recombine(wasm3, elements, plan.output, plan.pretty, plan.indent);
1700
+ return recombine(wasm4, elements, plan.output, plan.pretty, plan.indent);
1049
1701
  }
1050
1702
 
1051
1703
  // src/legacy/runtime.ts
@@ -1192,9 +1844,9 @@ function validateJsonOptions(o) {
1192
1844
  if (o.textAsPlainText) unsupportedOption("jsonOptions.textAsPlainText", V3_ONLY);
1193
1845
  if (o.debugGenerationInline) unsupportedOption("jsonOptions.debugGenerationInline");
1194
1846
  }
1195
- function prettyIndent(prettify3) {
1196
- if (prettify3 === true) return { pretty: true, indent: 2 };
1197
- if (typeof prettify3 === "number" && prettify3 > 0) return { pretty: true, indent: prettify3 };
1847
+ function prettyIndent(prettify4) {
1848
+ if (prettify4 === true) return { pretty: true, indent: 2 };
1849
+ if (typeof prettify4 === "number" && prettify4 > 0) return { pretty: true, indent: prettify4 };
1198
1850
  return { pretty: false, indent: 2 };
1199
1851
  }
1200
1852
  function spacesAround(v) {
@@ -1294,7 +1946,7 @@ var Builder = class {
1294
1946
  * more than one resource, use the first one").
1295
1947
  */
1296
1948
  buildBit(data, _options) {
1297
- const wasm3 = getLegacyWasm();
1949
+ const wasm4 = getLegacyWasm();
1298
1950
  const src = { ...data };
1299
1951
  const bitType = src.bitType;
1300
1952
  const bitConfig = this.getBitConfig(bitType);
@@ -1355,7 +2007,7 @@ var Builder = class {
1355
2007
  }
1356
2008
  }
1357
2009
  this.parseStringTexts(bit);
1358
- const out = wasm3.convert(JSON.stringify([{ bit }]), "json", "json", "optimized", false, 2, 1, false, false);
2010
+ const out = wasm4.convert(JSON.stringify([{ bit }]), "json", "json", "optimized", false, 2, 1, false, false);
1359
2011
  if (out.startsWith("error:")) {
1360
2012
  throw new Error(out.slice("error:".length).trim());
1361
2013
  }
@@ -1411,10 +2063,10 @@ var Builder = class {
1411
2063
  * (bpg TextParser.toAst ignores format; only location matters).
1412
2064
  */
1413
2065
  parseStringTexts(bit) {
1414
- const wasm3 = getLegacyWasm();
2066
+ const wasm4 = getLegacyWasm();
1415
2067
  const toAst = (s, location) => {
1416
2068
  if (s === "") return s;
1417
- const out = wasm3.convert_text(s, "textToAst", "bitmark++", location);
2069
+ const out = wasm4.convert_text(s, "textToAst", "bitmark++", location);
1418
2070
  try {
1419
2071
  return JSON.parse(out);
1420
2072
  } catch {
@@ -1444,11 +2096,11 @@ var Builder = class {
1444
2096
  * unknown-bit-type error (`Config.getBitConfig` parity).
1445
2097
  */
1446
2098
  getBitConfig(bitType) {
1447
- const wasm3 = getLegacyWasm();
2099
+ const wasm4 = getLegacyWasm();
1448
2100
  if (bitType !== void 0) {
1449
2101
  try {
1450
- const info4 = JSON.parse(wasm3.info("bit", "json", bitType, false, 2, false, false, true));
1451
- if (info4.error === void 0) return { bodyFormat: info4.body?.format };
2102
+ const info5 = JSON.parse(wasm4.info("bit", "json", bitType, false, 2, false, false, true, ""));
2103
+ if (info5.error === void 0) return { bodyFormat: info5.body?.format };
1452
2104
  } catch {
1453
2105
  }
1454
2106
  }
@@ -1487,7 +2139,7 @@ var BitmarkParserGenerator = class {
1487
2139
  validateBitmarkOptions(bitmarkOptions);
1488
2140
  validateJsonOptions(jsonOptions);
1489
2141
  this.checkBrowserFileWrite(opts.outputFile);
1490
- const wasm3 = getLegacyWasm();
2142
+ const wasm4 = getLegacyWasm();
1491
2143
  const { source, isBitmark } = this.resolveInput(input, opts.inputFormat);
1492
2144
  const outputFormat = opts.outputFormat ?? (isBitmark ? "json" : "bitmark");
1493
2145
  const coreFormat = outputFormat === "ast" ? "json" : outputFormat;
@@ -1495,7 +2147,7 @@ var BitmarkParserGenerator = class {
1495
2147
  const emit = coreFormat === "bitmark" ? prettyIndent(bitmarkOptions.prettifyJson) : { pretty, indent };
1496
2148
  const spaces = spacesAround(bitmarkOptions.spacesAroundValues);
1497
2149
  const includeUnknown = !jsonOptions.excludeUnknownProperties;
1498
- const out = wasm3.convert(source, isBitmark ? "bitmark" : "json", coreFormat, "optimized", emit.pretty, emit.indent, spaces, includeUnknown, false);
2150
+ const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", coreFormat, "optimized", emit.pretty, emit.indent, spaces, includeUnknown, false);
1499
2151
  this.throwOnError(out);
1500
2152
  if (outputFormat === "bitmark" || outputFormat === "text") {
1501
2153
  return this.deliver(out, opts.outputFile, opts.fileOptions);
@@ -1523,13 +2175,13 @@ var BitmarkParserGenerator = class {
1523
2175
  validateBitmarkOptions(bitmarkOptions);
1524
2176
  validateJsonOptions(jsonOptions);
1525
2177
  this.checkBrowserFileWrite(opts.outputFile);
1526
- const wasm3 = getLegacyWasm();
2178
+ const wasm4 = getLegacyWasm();
1527
2179
  const { source, isBitmark } = this.resolveInput(input, opts.inputFormat);
1528
2180
  const { pretty, indent } = prettyIndent(
1529
2181
  isBitmark ? bitmarkOptions.prettifyJson : jsonOptions.prettify
1530
2182
  );
1531
2183
  const spaces = spacesAround(bitmarkOptions.spacesAroundValues);
1532
- const out = wasm3.canonicalize(source, isBitmark ? "bitmark" : "json", "optimized", pretty, indent, spaces);
2184
+ const out = wasm4.canonicalize(source, isBitmark ? "bitmark" : "json", "optimized", pretty, indent, spaces);
1533
2185
  this.throwOnError(out);
1534
2186
  if (isBitmark) return this.deliver(out, opts.outputFile, opts.fileOptions);
1535
2187
  if (opts.outputFile) return this.deliver(out, opts.outputFile, opts.fileOptions);
@@ -1541,12 +2193,12 @@ var BitmarkParserGenerator = class {
1541
2193
  */
1542
2194
  info(options) {
1543
2195
  const opts = Object.assign({}, options);
1544
- const wasm3 = getLegacyWasm();
2196
+ const wasm4 = getLegacyWasm();
1545
2197
  const type = opts.type ?? "list";
1546
2198
  const format = opts.outputFormat ?? "text";
1547
2199
  const { pretty, indent } = prettyIndent(opts.prettify);
1548
2200
  const coreFormat = format === "pojo" ? "json" : format;
1549
- const out = wasm3.info(type, coreFormat, opts.bit ?? "", pretty, indent, false, false, true);
2201
+ const out = wasm4.info(type, coreFormat, opts.bit ?? "", pretty, indent, false, false, true, "");
1550
2202
  this.throwOnError(out);
1551
2203
  if (format === "pojo") return JSON.parse(out);
1552
2204
  return out;
@@ -1574,12 +2226,12 @@ var BitmarkParserGenerator = class {
1574
2226
  if (opts.keepUnknownTags) unsupportedOption("keepUnknownTags");
1575
2227
  if (opts.noBreakscaping) unsupportedOption("noBreakscaping");
1576
2228
  this.checkBrowserFileWrite(opts.outputFile);
1577
- const wasm3 = getLegacyWasm();
2229
+ const wasm4 = getLegacyWasm();
1578
2230
  const inStr = typeof input === "string" ? this.maybeReadFile(input, void 0) : "";
1579
2231
  const isHtmlInput = opts.inputFormat === "html" || opts.inputFormat === void 0 && typeof input === "string" && /<table[\s>]/iu.test(inStr);
1580
2232
  if (!isHtmlInput) {
1581
2233
  const { source, isBitmark } = this.resolveInput(input, void 0);
1582
- const out2 = wasm3.convert(source, isBitmark ? "bitmark" : "json", "html", "optimized", false, 2, 1, false, false);
2234
+ const out2 = wasm4.convert(source, isBitmark ? "bitmark" : "json", "html", "optimized", false, 2, 1, false, false);
1583
2235
  this.throwOnError(out2);
1584
2236
  return this.deliver(extractHtmlTables(out2).join("\n"), opts.outputFile, opts.fileOptions);
1585
2237
  }
@@ -1589,12 +2241,12 @@ var BitmarkParserGenerator = class {
1589
2241
  const { pretty, indent } = prettyIndent(jsonOptions.prettify);
1590
2242
  const spaces = spacesAround(bitmarkOptions.spacesAroundValues);
1591
2243
  if (outputFormat === "html") {
1592
- const out2 = wasm3.convert(wrapped, "html", "html", "optimized", false, 2, 1, false, false);
2244
+ const out2 = wasm4.convert(wrapped, "html", "html", "optimized", false, 2, 1, false, false);
1593
2245
  this.throwOnError(out2);
1594
2246
  return this.deliver(extractHtmlTables(out2).join("\n"), opts.outputFile, opts.fileOptions);
1595
2247
  }
1596
2248
  const coreFormat = outputFormat === "ast" ? "json" : outputFormat;
1597
- const out = wasm3.convert(wrapped, "html", coreFormat, "optimized", pretty, indent, spaces, false, false);
2249
+ const out = wasm4.convert(wrapped, "html", coreFormat, "optimized", pretty, indent, spaces, false, false);
1598
2250
  this.throwOnError(out);
1599
2251
  if (outputFormat === "bitmark" || outputFormat === "text") {
1600
2252
  return this.deliver(out, opts.outputFile, opts.fileOptions);
@@ -1617,9 +2269,9 @@ var BitmarkParserGenerator = class {
1617
2269
  */
1618
2270
  createAst(input, options) {
1619
2271
  const opts = Object.assign({}, options);
1620
- const wasm3 = getLegacyWasm();
2272
+ const wasm4 = getLegacyWasm();
1621
2273
  const { source, isBitmark } = this.resolveInput(input, opts.inputFormat);
1622
- const out = wasm3.convert(source, isBitmark ? "bitmark" : "json", "json", "optimized", false, 2, 1, true, false);
2274
+ const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", "json", "optimized", false, 2, 1, true, false);
1623
2275
  this.throwOnError(out);
1624
2276
  return makePseudoAst(JSON.parse(out));
1625
2277
  }
@@ -1630,9 +2282,9 @@ var BitmarkParserGenerator = class {
1630
2282
  if (!input) return input;
1631
2283
  const opts = Object.assign({}, options);
1632
2284
  this.checkBrowserFileWrite(opts.outputFile);
1633
- const wasm3 = getLegacyWasm();
2285
+ const wasm4 = getLegacyWasm();
1634
2286
  const inStr = this.maybeReadFile(input, opts.inputFormat);
1635
- const res = wasm3.breakscape_text(inStr, mapTextFormat(opts.textFormat), opts.textLocation ?? "body");
2287
+ const res = wasm4.breakscape_text(inStr, mapTextFormat(opts.textFormat), opts.textLocation ?? "body");
1636
2288
  return this.deliver(res, opts.outputFile, opts.fileOptions);
1637
2289
  }
1638
2290
  /**
@@ -1642,9 +2294,9 @@ var BitmarkParserGenerator = class {
1642
2294
  if (!input) return input;
1643
2295
  const opts = Object.assign({}, options);
1644
2296
  this.checkBrowserFileWrite(opts.outputFile);
1645
- const wasm3 = getLegacyWasm();
2297
+ const wasm4 = getLegacyWasm();
1646
2298
  const inStr = this.maybeReadFile(input, opts.inputFormat);
1647
- const res = wasm3.unbreakscape_text(inStr, mapTextFormat(opts.textFormat), opts.textLocation ?? "body");
2299
+ const res = wasm4.unbreakscape_text(inStr, mapTextFormat(opts.textFormat), opts.textLocation ?? "body");
1648
2300
  return this.deliver(res, opts.outputFile, opts.fileOptions);
1649
2301
  }
1650
2302
  /**
@@ -1658,7 +2310,7 @@ var BitmarkParserGenerator = class {
1658
2310
  const opts = Object.assign({}, options);
1659
2311
  const jsonOptions = Object.assign({}, opts.jsonOptions);
1660
2312
  this.checkBrowserFileWrite(opts.outputFile);
1661
- const wasm3 = getLegacyWasm();
2313
+ const wasm4 = getLegacyWasm();
1662
2314
  const isBitmarkText = opts.textFormat === void 0 || mapTextFormat(opts.textFormat) === "bitmark++";
1663
2315
  const textLocation = opts.textLocation ?? "body";
1664
2316
  let inStr;
@@ -1671,14 +2323,14 @@ var BitmarkParserGenerator = class {
1671
2323
  ast = Array.isArray(input) ? input : void 0;
1672
2324
  }
1673
2325
  if (ast !== void 0) {
1674
- const out2 = isBitmarkText ? wasm3.convert_text(JSON.stringify(ast), "astToText", "bitmark++", textLocation) : wasm3.convert_text(JSON.stringify(ast), "astToPlainText", "plainText", textLocation);
2326
+ const out2 = isBitmarkText ? wasm4.convert_text(JSON.stringify(ast), "astToText", "bitmark++", textLocation) : wasm4.convert_text(JSON.stringify(ast), "astToPlainText", "plainText", textLocation);
1675
2327
  this.throwOnError(out2);
1676
2328
  return this.deliver(out2, opts.outputFile, opts.fileOptions);
1677
2329
  }
1678
- const out = wasm3.convert_text(inStr, "textToAst", isBitmarkText ? "bitmark++" : "plainText", "body");
2330
+ const out = wasm4.convert_text(inStr, "textToAst", isBitmarkText ? "bitmark++" : "plainText", "body");
1679
2331
  this.throwOnError(out);
1680
2332
  const { pretty, indent } = prettyIndent(jsonOptions.prettify);
1681
- const outStr = pretty ? wasm3.prettify(out, indent) : out;
2333
+ const outStr = pretty ? wasm4.prettify(out, indent) : out;
1682
2334
  if (opts.outputFile) return this.deliver(outStr, opts.outputFile, opts.fileOptions);
1683
2335
  if (pretty) return outStr;
1684
2336
  return JSON.parse(out);
@@ -1687,8 +2339,8 @@ var BitmarkParserGenerator = class {
1687
2339
  * Convert a text AST to plain text (bpg-compatible `textAstToPlainText`).
1688
2340
  */
1689
2341
  textAstToPlainText(textAst, _options) {
1690
- const wasm3 = getLegacyWasm();
1691
- const out = wasm3.convert_text(
2342
+ const wasm4 = getLegacyWasm();
2343
+ const out = wasm4.convert_text(
1692
2344
  typeof textAst === "string" ? textAst : JSON.stringify(textAst),
1693
2345
  "astToPlainText",
1694
2346
  "bitmark++",
@@ -1702,17 +2354,17 @@ var BitmarkParserGenerator = class {
1702
2354
  */
1703
2355
  extractPlainText(input, options) {
1704
2356
  const inputFormat = options?.inputFormat;
1705
- const wasm3 = getLegacyWasm();
2357
+ const wasm4 = getLegacyWasm();
1706
2358
  if (inputFormat === "plainText") {
1707
2359
  return typeof input === "string" ? String(input) : "";
1708
2360
  }
1709
2361
  if (inputFormat === "bitmarkText") {
1710
- const ast = wasm3.convert_text(String(input), "textToAst", "bitmark++", "body");
1711
- const out2 = wasm3.convert_text(ast, "astToPlainText", "bitmark++", "body");
2362
+ const ast = wasm4.convert_text(String(input), "textToAst", "bitmark++", "body");
2363
+ const out2 = wasm4.convert_text(ast, "astToPlainText", "bitmark++", "body");
1712
2364
  this.throwOnError(out2);
1713
2365
  return out2;
1714
2366
  }
1715
- if (typeof input === "string" && this.parseTextAstString(input) === void 0 && !wasm3.is_bitmark(input)) {
2367
+ if (typeof input === "string" && this.parseTextAstString(input) === void 0 && !wasm4.is_bitmark(input)) {
1716
2368
  const looksJson = (() => {
1717
2369
  try {
1718
2370
  JSON.parse(input);
@@ -1726,7 +2378,7 @@ var BitmarkParserGenerator = class {
1726
2378
  }
1727
2379
  }
1728
2380
  const { source, isBitmark } = this.resolveInput(input, void 0);
1729
- const out = wasm3.convert(source, isBitmark ? "bitmark" : "json", "text", "optimized", false, 2, 1, false, false);
2381
+ const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", "text", "optimized", false, 2, 1, false, false);
1730
2382
  this.throwOnError(out);
1731
2383
  return out;
1732
2384
  }
@@ -1760,8 +2412,8 @@ var BitmarkParserGenerator = class {
1760
2412
  };
1761
2413
  }
1762
2414
  const inStr = this.maybeReadFile(input, inputFormat);
1763
- const wasm3 = getLegacyWasm();
1764
- if (wasm3.is_bitmark(inStr)) return { source: inStr, isBitmark: true };
2415
+ const wasm4 = getLegacyWasm();
2416
+ if (wasm4.is_bitmark(inStr)) return { source: inStr, isBitmark: true };
1765
2417
  try {
1766
2418
  const parsed = JSON.parse(inStr);
1767
2419
  const entries = this.jsonEntries(parsed);
@@ -2130,8 +2782,8 @@ function bitNameToKey(name) {
2130
2782
  var bitTypeCache;
2131
2783
  function loadBitTypes() {
2132
2784
  if (!bitTypeCache) {
2133
- const wasm3 = getLegacyWasm();
2134
- const all = JSON.parse(wasm3.info("all", "json", "", false, 2, true, false, false));
2785
+ const wasm4 = getLegacyWasm();
2786
+ const all = JSON.parse(wasm4.info("all", "json", "", false, 2, true, false, false, ""));
2135
2787
  const map = { _standard: "_standard" };
2136
2788
  for (const { name } of all) {
2137
2789
  map[bitNameToKey(name)] = name;
@@ -2202,12 +2854,13 @@ var StreamWriter = stubClass("StreamWriter", INTERNAL_REASON);
2202
2854
  function patchEntry(path, op, value) {
2203
2855
  return value === void 0 ? { path, op } : { path, op, value };
2204
2856
  }
2857
+ var ALL_LANGUAGES = "all";
2205
2858
 
2206
2859
  // src/core/api.ts
2207
- function lex2(input, options = {}) {
2208
- const wasm3 = getActive();
2209
- if (typeof wasm3.lex !== "function") throw new UnsupportedFeatureError("lex", variant());
2210
- return wasm3.lex(input, options.stage ?? "lex");
2860
+ function lex3(input, options = {}) {
2861
+ const wasm4 = getActive();
2862
+ if (typeof wasm4.lex !== "function") throw new UnsupportedFeatureError("lex", variant());
2863
+ return wasm4.lex(input, options.stage ?? "lex");
2211
2864
  }
2212
2865
  function bitmarkToObjects(input, options = {}) {
2213
2866
  const out = getActive().convert(
@@ -2242,7 +2895,7 @@ function objectsToBitmark(bits, options = {}) {
2242
2895
  if (out.startsWith("error:")) throw new Error(out.slice("error:".length).trim());
2243
2896
  return out;
2244
2897
  }
2245
- function convert3(input, options = {}) {
2898
+ function convert4(input, options = {}) {
2246
2899
  return getActive().convert(
2247
2900
  input,
2248
2901
  options.inputFormat ?? "auto",
@@ -2255,7 +2908,7 @@ function convert3(input, options = {}) {
2255
2908
  options.mappingReport ?? false
2256
2909
  );
2257
2910
  }
2258
- function canonicalize3(input, options = {}) {
2911
+ function canonicalize4(input, options = {}) {
2259
2912
  return getActive().canonicalize(
2260
2913
  input,
2261
2914
  options.inputFormat ?? "auto",
@@ -2273,13 +2926,13 @@ function countBits(input) {
2273
2926
  function splitBits(input) {
2274
2927
  return JSON.parse(getActive().split_bits(input));
2275
2928
  }
2276
- function transform3(input, options = {}) {
2277
- const wasm3 = getActive();
2929
+ function transform4(input, options = {}) {
2930
+ const wasm4 = getActive();
2278
2931
  if (options.preHook || options.postHook) {
2279
- return runHookedTransform(wasm3, input, options);
2932
+ return runHookedTransform(wasm4, input, options);
2280
2933
  }
2281
2934
  const patchJson = options.patch === void 0 ? "" : typeof options.patch === "string" ? options.patch : JSON.stringify(options.patch);
2282
- return wasm3.transform(
2935
+ return wasm4.transform(
2283
2936
  input,
2284
2937
  options.inputFormat ?? "auto",
2285
2938
  options.outputFormat ?? "json",
@@ -2290,6 +2943,26 @@ function transform3(input, options = {}) {
2290
2943
  options.spacesAroundValues ?? 1
2291
2944
  );
2292
2945
  }
2946
+ function diff3(a, b, options = {}) {
2947
+ const wasm4 = getActive();
2948
+ if (typeof wasm4.diff !== "function") throw new UnsupportedFeatureError("diff", variant());
2949
+ const out = wasm4.diff(
2950
+ a,
2951
+ b,
2952
+ options.inputFormat ?? "auto",
2953
+ options.outputFormat ?? "bitmark",
2954
+ options.context ?? 3,
2955
+ options.locate ?? false,
2956
+ options.similarity ?? 0.6,
2957
+ options.bboxTolerance ?? 8,
2958
+ options.spacesAroundValues ?? 0
2959
+ );
2960
+ if (out.startsWith("error:")) throw new Error(out.slice("error:".length).trim());
2961
+ return out;
2962
+ }
2963
+ function diffBits(a, b, options = {}) {
2964
+ return JSON.parse(diff3(a, b, { ...options, outputFormat: "json" }));
2965
+ }
2293
2966
  function breakscapeText(input, options = {}) {
2294
2967
  const format = options.format ?? "bitmark++";
2295
2968
  const location = options.location ?? "body";
@@ -2300,7 +2973,7 @@ function unbreakscapeText(input, options = {}) {
2300
2973
  const location = options.location ?? "body";
2301
2974
  return getActive().unbreakscape_text(input, format, location);
2302
2975
  }
2303
- function info3(options = {}) {
2976
+ function info4(options = {}) {
2304
2977
  const infoType = options.infoType ?? "list";
2305
2978
  const format = options.format ?? "text";
2306
2979
  const bit = options.bit ?? "";
@@ -2309,10 +2982,27 @@ function info3(options = {}) {
2309
2982
  const includeDeprecated = options.includeDeprecated ?? false;
2310
2983
  const onlyDeprecated = options.onlyDeprecated ?? false;
2311
2984
  const full = options.full ?? false;
2312
- return getActive().info(infoType, format, bit, pretty, indent, includeDeprecated, onlyDeprecated, full);
2985
+ const language = typeof options.language === "string" ? options.language : options.language?.join(",") ?? "";
2986
+ return getActive().info(
2987
+ infoType,
2988
+ format,
2989
+ bit,
2990
+ pretty,
2991
+ indent,
2992
+ includeDeprecated,
2993
+ onlyDeprecated,
2994
+ full,
2995
+ language
2996
+ );
2997
+ }
2998
+ function register4(options) {
2999
+ const result = getActive().register(options.type, options.data);
3000
+ if (result) throw new RegisterError(result.replace(/^error:\s*/, ""));
3001
+ rememberRegistration(options.type, options.data);
2313
3002
  }
2314
3003
 
2315
3004
  // src/browser/index.ts
3005
+ var WASM_BASE = true ? "../wasm/" : "./";
2316
3006
  var VARIANTS = {
2317
3007
  full: {
2318
3008
  init: bitmark_wasm_default,
@@ -2320,20 +3010,33 @@ var VARIANTS = {
2320
3010
  ns: bitmark_wasm_exports,
2321
3011
  wasmFile: "bitmark_wasm_bg.wasm"
2322
3012
  },
3013
+ "browser-full": {
3014
+ init: bitmark_browser_full_wasm_default,
3015
+ initSync: initSync2,
3016
+ ns: bitmark_browser_full_wasm_exports,
3017
+ wasmFile: "bitmark_browser_full_wasm_bg.wasm"
3018
+ },
2323
3019
  "bitmark-json": {
2324
3020
  init: bitmark_json_wasm_default,
2325
- initSync: initSync2,
3021
+ initSync: initSync3,
2326
3022
  ns: bitmark_json_wasm_exports,
2327
3023
  wasmFile: "bitmark_json_wasm_bg.wasm"
2328
3024
  }
2329
3025
  };
2330
3026
  setLegacyWasmProvider(() => getActive());
3027
+ function defaultFeatureFor(module_or_path) {
3028
+ return module_or_path === void 0 ? BROWSER_DEFAULT_FEATURE : "full";
3029
+ }
2331
3030
  function normalizeInit(arg) {
2332
3031
  if (arg !== null && typeof arg === "object" && !(arg instanceof URL) && ("feature" in arg || "module_or_path" in arg)) {
2333
3032
  const o = arg;
2334
- return { feature: o.feature ?? "full", module_or_path: o.module_or_path };
3033
+ return {
3034
+ feature: o.feature ?? defaultFeatureFor(o.module_or_path),
3035
+ module_or_path: o.module_or_path
3036
+ };
2335
3037
  }
2336
- return { feature: "full", module_or_path: arg ?? void 0 };
3038
+ const module_or_path = arg ?? void 0;
3039
+ return { feature: defaultFeatureFor(module_or_path), module_or_path };
2337
3040
  }
2338
3041
  var initSeq = 0;
2339
3042
  var activeOut;
@@ -2346,7 +3049,7 @@ async function init(options) {
2346
3049
  }
2347
3050
  const mySeq = ++initSeq;
2348
3051
  const v = VARIANTS[feature];
2349
- const source = module_or_path ?? new URL(`${v.wasmFile}?v=${PACKAGE_INFO.version}`, importMetaUrl);
3052
+ const source = module_or_path ?? new URL(`${WASM_BASE}${v.wasmFile}?v=${PACKAGE_INFO.version}`, importMetaUrl);
2350
3053
  const promise = (async () => {
2351
3054
  try {
2352
3055
  const out = await v.init(source);
@@ -2364,8 +3067,8 @@ async function init(options) {
2364
3067
  inflight = { feature, seq: mySeq, promise };
2365
3068
  return promise;
2366
3069
  }
2367
- function initSync3(module2, options = {}) {
2368
- const feature = options.feature ?? "full";
3070
+ function initSync4(module2, options = {}) {
3071
+ const feature = options.feature ?? defaultFeatureFor(module2);
2369
3072
  const v = VARIANTS[feature];
2370
3073
  const out = v.initSync(module2);
2371
3074
  setActive(feature, v.ns);
@@ -2376,10 +3079,10 @@ function version() {
2376
3079
  return PACKAGE_INFO.version;
2377
3080
  }
2378
3081
  function transformParallel(input, options = {}) {
2379
- const wasm3 = getActive();
2380
- const feature = variant() ?? "full";
3082
+ const wasm4 = getActive();
3083
+ const feature = variant() ?? BROWSER_DEFAULT_FEATURE;
2381
3084
  return orchestrateParallel(
2382
- wasm3,
3085
+ wasm4,
2383
3086
  input,
2384
3087
  options,
2385
3088
  (jobs, workers) => runJobsParallel(jobs, workers, feature)
@@ -2387,13 +3090,17 @@ function transformParallel(input, options = {}) {
2387
3090
  }
2388
3091
  // Annotate the CommonJS export names for ESM import in node:
2389
3092
  0 && (module.exports = {
3093
+ ALL_LANGUAGES,
2390
3094
  NotInitializedError,
3095
+ RegisterError,
2391
3096
  UnsupportedFeatureError,
2392
3097
  bitmarkToObjects,
2393
3098
  breakscapeText,
2394
3099
  canonicalize,
2395
3100
  convert,
2396
3101
  countBits,
3102
+ diff,
3103
+ diffBits,
2397
3104
  info,
2398
3105
  init,
2399
3106
  initSync,
@@ -2401,6 +3108,7 @@ function transformParallel(input, options = {}) {
2401
3108
  lex,
2402
3109
  objectsToBitmark,
2403
3110
  patchEntry,
3111
+ register,
2404
3112
  splitBits,
2405
3113
  transform,
2406
3114
  transformParallel,