@moqtap/codec 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/README.md +4 -2
  2. package/dist/{chunk-CXFAQKL3.js → chunk-23KRITJ6.js} +1 -1
  3. package/dist/{chunk-JL3NEW3O.cjs → chunk-4XLYCT5Q.cjs} +90 -1
  4. package/dist/{chunk-DLSGOZ6P.js → chunk-5XZKO2U5.js} +34 -34
  5. package/dist/{chunk-62LYLROG.js → chunk-APTV6F72.js} +35 -35
  6. package/dist/{chunk-JB5VDJ2V.cjs → chunk-B56AG5HU.cjs} +37 -37
  7. package/dist/{chunk-4HBKHNU2.cjs → chunk-CZNW3R5E.cjs} +37 -37
  8. package/dist/{chunk-Q5D6OW6Q.js → chunk-DORX55MO.js} +1 -1
  9. package/dist/{chunk-OGZTQA24.cjs → chunk-EQAYMCXO.cjs} +64 -64
  10. package/dist/{chunk-HYI6LFMD.js → chunk-HEO2JG6C.js} +1 -1
  11. package/dist/{chunk-UP4XPH4J.js → chunk-I55J3KXD.js} +31 -31
  12. package/dist/{chunk-HZHSO7EW.cjs → chunk-IDV2JYJ6.cjs} +39 -39
  13. package/dist/{chunk-BAG6YWCP.cjs → chunk-IEJULBKB.cjs} +63 -63
  14. package/dist/{chunk-Y6KCSM3V.js → chunk-IJAF6PAY.js} +1 -1
  15. package/dist/{chunk-WMJVSBBE.cjs → chunk-J3ASFPCX.cjs} +57 -57
  16. package/dist/{chunk-COWGGUL4.js → chunk-JKMYAUGY.js} +1 -1
  17. package/dist/{chunk-SIYYMFCC.cjs → chunk-KCH4BQXK.cjs} +37 -37
  18. package/dist/{chunk-VOU7PNHI.js → chunk-KLPWJU6W.js} +89 -0
  19. package/dist/{chunk-NZ7GYEMT.js → chunk-KNLPX3YA.js} +1 -1
  20. package/dist/{chunk-A33U4WVS.cjs → chunk-KTVN4P6J.cjs} +67 -67
  21. package/dist/{chunk-7KBAWOBA.js → chunk-KYVTM5VI.js} +1 -1
  22. package/dist/{chunk-RZ3UML47.js → chunk-MD2OA7SE.js} +1 -1
  23. package/dist/{chunk-MSG2FXJ2.cjs → chunk-MH7537FB.cjs} +68 -68
  24. package/dist/{chunk-SHMA4PBY.js → chunk-N2V7Z37J.js} +1 -1
  25. package/dist/{chunk-HO44OANK.cjs → chunk-QGIHC6BA.cjs} +36 -36
  26. package/dist/{chunk-PKEOQSSZ.cjs → chunk-RIIA4ALQ.cjs} +37 -37
  27. package/dist/{chunk-XZE5R57R.cjs → chunk-VZHL2U2N.cjs} +37 -37
  28. package/dist/{chunk-RW4UG7CN.js → chunk-XHAP2YST.js} +1 -1
  29. package/dist/{chunk-JTRU76JN.cjs → chunk-Y4FRXYX6.cjs} +59 -59
  30. package/dist/draft07.cjs +4 -4
  31. package/dist/draft07.js +2 -2
  32. package/dist/draft08.cjs +3 -3
  33. package/dist/draft08.js +2 -2
  34. package/dist/draft09.cjs +3 -3
  35. package/dist/draft09.js +2 -2
  36. package/dist/draft10.cjs +3 -3
  37. package/dist/draft10.js +2 -2
  38. package/dist/draft11.cjs +3 -3
  39. package/dist/draft11.js +2 -2
  40. package/dist/draft12.cjs +3 -3
  41. package/dist/draft12.js +2 -2
  42. package/dist/draft13.cjs +3 -3
  43. package/dist/draft13.js +2 -2
  44. package/dist/draft14.cjs +3 -3
  45. package/dist/draft14.js +2 -2
  46. package/dist/draft15.cjs +3 -3
  47. package/dist/draft15.js +2 -2
  48. package/dist/draft16.cjs +3 -3
  49. package/dist/draft16.js +2 -2
  50. package/dist/draft17.cjs +3 -3
  51. package/dist/draft17.js +2 -2
  52. package/dist/draft18.cjs +3 -3
  53. package/dist/draft18.js +2 -2
  54. package/dist/draft19.cjs +3 -3
  55. package/dist/draft19.js +2 -2
  56. package/dist/index.cjs +28 -28
  57. package/dist/index.js +14 -14
  58. package/package.json +2 -2
  59. package/src/core/buffer-reader.ts +74 -2
  60. package/src/core/buffer-writer.ts +56 -4
  61. package/src/drafts/draft17/codec.ts +2 -2
  62. package/src/drafts/draft17/data-streams.ts +2 -2
  63. package/src/drafts/draft18/codec.ts +2 -2
  64. package/src/drafts/draft18/data-streams.ts +2 -2
  65. package/src/drafts/draft19/codec.ts +2 -2
  66. package/src/drafts/draft19/data-streams.ts +2 -2
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkJL3NEW3Ocjs = require('./chunk-JL3NEW3O.cjs');
7
+ var _chunk4XLYCT5Qcjs = require('./chunk-4XLYCT5Q.cjs');
8
8
 
9
9
  // src/drafts/draft18/messages.ts
10
10
  var MSG_REQUEST_UPDATE = 0x02n;
@@ -108,7 +108,7 @@ function isValidSubgroupType(streamType) {
108
108
  return (streamType & 6) !== 6;
109
109
  }
110
110
  function encodeSubgroupStream(stream) {
111
- const w = new (0, _chunkJL3NEW3Ocjs.BufferWriter)();
111
+ const w = new (0, _chunk4XLYCT5Qcjs.MoqtBufferWriter)();
112
112
  const streamType = stream.headerType;
113
113
  w.writeUint8(streamType);
114
114
  const propertiesPresent = (streamType & 1) !== 0;
@@ -129,7 +129,7 @@ function encodeSubgroupStream(stream) {
129
129
  w.writeVarInt(delta);
130
130
  if (propertiesPresent) {
131
131
  if (obj.objectProperties && Object.keys(obj.objectProperties).length > 0) {
132
- const tmpW = new (0, _chunkJL3NEW3Ocjs.BufferWriter)(32);
132
+ const tmpW = new (0, _chunk4XLYCT5Qcjs.MoqtBufferWriter)(32);
133
133
  encodeObjectProperties(obj.objectProperties, tmpW);
134
134
  const raw = tmpW.finish();
135
135
  w.writeVarInt(BigInt(raw.byteLength));
@@ -149,7 +149,7 @@ function encodeSubgroupStream(stream) {
149
149
  return w.finish();
150
150
  }
151
151
  function encodeDatagram(dg) {
152
- const w = new (0, _chunkJL3NEW3Ocjs.BufferWriter)();
152
+ const w = new (0, _chunk4XLYCT5Qcjs.MoqtBufferWriter)();
153
153
  const dgType = dg.datagramType;
154
154
  w.writeUint8(dgType);
155
155
  w.writeVarInt(dg.trackAlias);
@@ -166,7 +166,7 @@ function encodeDatagram(dg) {
166
166
  }
167
167
  if (propertiesPresent) {
168
168
  if (dg.objectProperties && Object.keys(dg.objectProperties).length > 0) {
169
- const tmpW = new (0, _chunkJL3NEW3Ocjs.BufferWriter)(32);
169
+ const tmpW = new (0, _chunk4XLYCT5Qcjs.MoqtBufferWriter)(32);
170
170
  encodeObjectProperties(dg.objectProperties, tmpW);
171
171
  const raw = tmpW.finish();
172
172
  w.writeVarInt(BigInt(raw.byteLength));
@@ -183,7 +183,7 @@ function encodeDatagram(dg) {
183
183
  return w.finish();
184
184
  }
185
185
  function encodeFetchStream(stream) {
186
- const w = new (0, _chunkJL3NEW3Ocjs.BufferWriter)();
186
+ const w = new (0, _chunk4XLYCT5Qcjs.MoqtBufferWriter)();
187
187
  w.writeVarInt(FETCH_STREAM_TYPE);
188
188
  w.writeVarInt(stream.requestId);
189
189
  let prevGroupId = 0n;
@@ -205,7 +205,7 @@ function encodeFetchStream(stream) {
205
205
  if (flags & 16) w.writeUint8(obj.publisherPriority);
206
206
  if (flags & 32) {
207
207
  if (obj.objectProperties && Object.keys(obj.objectProperties).length > 0) {
208
- const tmpW = new (0, _chunkJL3NEW3Ocjs.BufferWriter)(32);
208
+ const tmpW = new (0, _chunk4XLYCT5Qcjs.MoqtBufferWriter)(32);
209
209
  encodeObjectProperties(obj.objectProperties, tmpW);
210
210
  const raw = tmpW.finish();
211
211
  w.writeVarInt(BigInt(raw.byteLength));
@@ -229,7 +229,7 @@ function encodeFetchStream(stream) {
229
229
  if (flags & 16) w.writeUint8(obj.publisherPriority);
230
230
  if (flags & 32) {
231
231
  if (obj.objectProperties && Object.keys(obj.objectProperties).length > 0) {
232
- const tmpW = new (0, _chunkJL3NEW3Ocjs.BufferWriter)(32);
232
+ const tmpW = new (0, _chunk4XLYCT5Qcjs.MoqtBufferWriter)(32);
233
233
  encodeObjectProperties(obj.objectProperties, tmpW);
234
234
  const raw = tmpW.finish();
235
235
  w.writeVarInt(BigInt(raw.byteLength));
@@ -252,12 +252,12 @@ function encodeFetchStream(stream) {
252
252
  }
253
253
  function decodeSubgroupStream(bytes) {
254
254
  try {
255
- const r = new (0, _chunkJL3NEW3Ocjs.BufferReader)(bytes);
255
+ const r = new (0, _chunk4XLYCT5Qcjs.MoqtBufferReader)(bytes);
256
256
  const streamType = r.readUint8();
257
257
  if (!isValidSubgroupType(streamType)) {
258
258
  return {
259
259
  ok: false,
260
- error: new (0, _chunkJL3NEW3Ocjs.DecodeError)(
260
+ error: new (0, _chunk4XLYCT5Qcjs.DecodeError)(
261
261
  "CONSTRAINT_VIOLATION",
262
262
  `Invalid subgroup stream type 0x${streamType.toString(16)}`,
263
263
  0
@@ -349,13 +349,13 @@ function decodeSubgroupStream(bytes) {
349
349
  bytesRead: r.offset
350
350
  };
351
351
  } catch (e) {
352
- if (e instanceof _chunkJL3NEW3Ocjs.DecodeError) return { ok: false, error: e };
352
+ if (e instanceof _chunk4XLYCT5Qcjs.DecodeError) return { ok: false, error: e };
353
353
  throw e;
354
354
  }
355
355
  }
356
356
  function decodeDatagram(bytes) {
357
357
  try {
358
- const r = new (0, _chunkJL3NEW3Ocjs.BufferReader)(bytes);
358
+ const r = new (0, _chunk4XLYCT5Qcjs.MoqtBufferReader)(bytes);
359
359
  const dgType = r.readUint8();
360
360
  const objectIdAbsent = (dgType & 4) !== 0;
361
361
  const endOfGroup = (dgType & 2) !== 0;
@@ -405,18 +405,18 @@ function decodeDatagram(bytes) {
405
405
  result.objectProperties = objectProperties;
406
406
  return { ok: true, value: result, bytesRead: r.offset };
407
407
  } catch (e) {
408
- if (e instanceof _chunkJL3NEW3Ocjs.DecodeError) return { ok: false, error: e };
408
+ if (e instanceof _chunk4XLYCT5Qcjs.DecodeError) return { ok: false, error: e };
409
409
  throw e;
410
410
  }
411
411
  }
412
412
  function decodeFetchStream(bytes) {
413
413
  try {
414
- const r = new (0, _chunkJL3NEW3Ocjs.BufferReader)(bytes);
414
+ const r = new (0, _chunk4XLYCT5Qcjs.MoqtBufferReader)(bytes);
415
415
  const streamType = r.readVarInt();
416
416
  if (streamType !== FETCH_STREAM_TYPE) {
417
417
  return {
418
418
  ok: false,
419
- error: new (0, _chunkJL3NEW3Ocjs.DecodeError)(
419
+ error: new (0, _chunk4XLYCT5Qcjs.DecodeError)(
420
420
  "CONSTRAINT_VIOLATION",
421
421
  `Expected fetch stream type 0x05, got 0x${streamType.toString(16)}`,
422
422
  0
@@ -444,7 +444,7 @@ function decodeFetchStream(bytes) {
444
444
  if (flags !== 140 && flags !== 268) {
445
445
  return {
446
446
  ok: false,
447
- error: new (0, _chunkJL3NEW3Ocjs.DecodeError)(
447
+ error: new (0, _chunk4XLYCT5Qcjs.DecodeError)(
448
448
  "CONSTRAINT_VIOLATION",
449
449
  `Unknown serialization flags value: 0x${flags.toString(16)}`,
450
450
  r.offset
@@ -513,7 +513,7 @@ function decodeFetchStream(bytes) {
513
513
  } else if (first) {
514
514
  return {
515
515
  ok: false,
516
- error: new (0, _chunkJL3NEW3Ocjs.DecodeError)(
516
+ error: new (0, _chunk4XLYCT5Qcjs.DecodeError)(
517
517
  "CONSTRAINT_VIOLATION",
518
518
  "First fetch object must include groupId",
519
519
  r.offset
@@ -526,7 +526,7 @@ function decodeFetchStream(bytes) {
526
526
  if (first) {
527
527
  return {
528
528
  ok: false,
529
- error: new (0, _chunkJL3NEW3Ocjs.DecodeError)(
529
+ error: new (0, _chunk4XLYCT5Qcjs.DecodeError)(
530
530
  "CONSTRAINT_VIOLATION",
531
531
  "First fetch object cannot reference prior subgroupId",
532
532
  r.offset
@@ -538,7 +538,7 @@ function decodeFetchStream(bytes) {
538
538
  if (first) {
539
539
  return {
540
540
  ok: false,
541
- error: new (0, _chunkJL3NEW3Ocjs.DecodeError)(
541
+ error: new (0, _chunk4XLYCT5Qcjs.DecodeError)(
542
542
  "CONSTRAINT_VIOLATION",
543
543
  "First fetch object cannot reference prior subgroupId",
544
544
  r.offset
@@ -554,7 +554,7 @@ function decodeFetchStream(bytes) {
554
554
  } else if (first) {
555
555
  return {
556
556
  ok: false,
557
- error: new (0, _chunkJL3NEW3Ocjs.DecodeError)(
557
+ error: new (0, _chunk4XLYCT5Qcjs.DecodeError)(
558
558
  "CONSTRAINT_VIOLATION",
559
559
  "First fetch object must include objectId",
560
560
  r.offset
@@ -622,7 +622,7 @@ function decodeFetchStream(bytes) {
622
622
  bytesRead: r.offset
623
623
  };
624
624
  } catch (e) {
625
- if (e instanceof _chunkJL3NEW3Ocjs.DecodeError) return { ok: false, error: e };
625
+ if (e instanceof _chunk4XLYCT5Qcjs.DecodeError) return { ok: false, error: e };
626
626
  throw e;
627
627
  }
628
628
  }
@@ -659,11 +659,11 @@ function createSubgroupStreamDecoder() {
659
659
  buffer = newBuffer;
660
660
  if (!headerEmitted) {
661
661
  try {
662
- const r = new (0, _chunkJL3NEW3Ocjs.BufferReader)(buffer.subarray(offset));
662
+ const r = new (0, _chunk4XLYCT5Qcjs.MoqtBufferReader)(buffer.subarray(offset));
663
663
  const streamType = r.readUint8();
664
664
  if (!isValidSubgroupType(streamType)) {
665
665
  controller.error(
666
- new (0, _chunkJL3NEW3Ocjs.DecodeError)(
666
+ new (0, _chunk4XLYCT5Qcjs.DecodeError)(
667
667
  "CONSTRAINT_VIOLATION",
668
668
  `Invalid subgroup stream type 0x${streamType.toString(16)}`,
669
669
  0
@@ -695,7 +695,7 @@ function createSubgroupStreamDecoder() {
695
695
  headerEmitted = true;
696
696
  offset += r.offset;
697
697
  } catch (e) {
698
- if (e instanceof _chunkJL3NEW3Ocjs.DecodeError && e.code === "UNEXPECTED_END") {
698
+ if (e instanceof _chunk4XLYCT5Qcjs.DecodeError && e.code === "UNEXPECTED_END") {
699
699
  return;
700
700
  }
701
701
  controller.error(e);
@@ -704,7 +704,7 @@ function createSubgroupStreamDecoder() {
704
704
  }
705
705
  while (offset < buffer.length) {
706
706
  try {
707
- const r = new (0, _chunkJL3NEW3Ocjs.BufferReader)(buffer.subarray(offset));
707
+ const r = new (0, _chunk4XLYCT5Qcjs.MoqtBufferReader)(buffer.subarray(offset));
708
708
  const delta = r.readVarInt();
709
709
  let objectId;
710
710
  if (firstObject) {
@@ -733,7 +733,7 @@ function createSubgroupStreamDecoder() {
733
733
  offset += r.offset;
734
734
  prevObjectId = objectId;
735
735
  } catch (e) {
736
- if (e instanceof _chunkJL3NEW3Ocjs.DecodeError && e.code === "UNEXPECTED_END") {
736
+ if (e instanceof _chunk4XLYCT5Qcjs.DecodeError && e.code === "UNEXPECTED_END") {
737
737
  break;
738
738
  }
739
739
  controller.error(e);
@@ -743,7 +743,7 @@ function createSubgroupStreamDecoder() {
743
743
  },
744
744
  flush(controller) {
745
745
  if (offset < buffer.length) {
746
- controller.error(new (0, _chunkJL3NEW3Ocjs.DecodeError)("UNEXPECTED_END", "Stream ended with incomplete data", 0));
746
+ controller.error(new (0, _chunk4XLYCT5Qcjs.DecodeError)("UNEXPECTED_END", "Stream ended with incomplete data", 0));
747
747
  }
748
748
  }
749
749
  });
@@ -764,11 +764,11 @@ function createFetchStreamDecoder() {
764
764
  buffer = newBuffer;
765
765
  if (!headerEmitted) {
766
766
  try {
767
- const r = new (0, _chunkJL3NEW3Ocjs.BufferReader)(buffer.subarray(offset));
767
+ const r = new (0, _chunk4XLYCT5Qcjs.MoqtBufferReader)(buffer.subarray(offset));
768
768
  const streamType = r.readVarInt();
769
769
  if (streamType !== FETCH_STREAM_TYPE) {
770
770
  controller.error(
771
- new (0, _chunkJL3NEW3Ocjs.DecodeError)(
771
+ new (0, _chunk4XLYCT5Qcjs.DecodeError)(
772
772
  "CONSTRAINT_VIOLATION",
773
773
  `Expected fetch stream type 0x05, got 0x${streamType.toString(16)}`,
774
774
  0
@@ -781,7 +781,7 @@ function createFetchStreamDecoder() {
781
781
  headerEmitted = true;
782
782
  offset += r.offset;
783
783
  } catch (e) {
784
- if (e instanceof _chunkJL3NEW3Ocjs.DecodeError && e.code === "UNEXPECTED_END") {
784
+ if (e instanceof _chunk4XLYCT5Qcjs.DecodeError && e.code === "UNEXPECTED_END") {
785
785
  return;
786
786
  }
787
787
  controller.error(e);
@@ -790,7 +790,7 @@ function createFetchStreamDecoder() {
790
790
  }
791
791
  while (offset < buffer.length) {
792
792
  try {
793
- const r = new (0, _chunkJL3NEW3Ocjs.BufferReader)(buffer.subarray(offset));
793
+ const r = new (0, _chunk4XLYCT5Qcjs.MoqtBufferReader)(buffer.subarray(offset));
794
794
  const flags = Number(r.readVarInt());
795
795
  const objectIdPresent = (flags & 4) !== 0;
796
796
  const groupIdPresent = (flags & 8) !== 0;
@@ -821,7 +821,7 @@ function createFetchStreamDecoder() {
821
821
  });
822
822
  offset += r.offset;
823
823
  } catch (e) {
824
- if (e instanceof _chunkJL3NEW3Ocjs.DecodeError && e.code === "UNEXPECTED_END") {
824
+ if (e instanceof _chunk4XLYCT5Qcjs.DecodeError && e.code === "UNEXPECTED_END") {
825
825
  break;
826
826
  }
827
827
  controller.error(e);
@@ -831,7 +831,7 @@ function createFetchStreamDecoder() {
831
831
  },
832
832
  flush(controller) {
833
833
  if (offset < buffer.length) {
834
- controller.error(new (0, _chunkJL3NEW3Ocjs.DecodeError)("UNEXPECTED_END", "Stream ended with incomplete data", 0));
834
+ controller.error(new (0, _chunk4XLYCT5Qcjs.DecodeError)("UNEXPECTED_END", "Stream ended with incomplete data", 0));
835
835
  }
836
836
  }
837
837
  });
@@ -861,7 +861,7 @@ function createDataStreamDecoder() {
861
861
  inner = decoder;
862
862
  } else {
863
863
  controller.error(
864
- new (0, _chunkJL3NEW3Ocjs.DecodeError)(
864
+ new (0, _chunk4XLYCT5Qcjs.DecodeError)(
865
865
  "CONSTRAINT_VIOLATION",
866
866
  `Unknown data stream type: 0x${firstByte.toString(16)}`,
867
867
  0
@@ -882,7 +882,7 @@ function createDataStreamDecoder() {
882
882
  result = decodeFetchStream(view);
883
883
  } else {
884
884
  controller.error(
885
- new (0, _chunkJL3NEW3Ocjs.DecodeError)(
885
+ new (0, _chunk4XLYCT5Qcjs.DecodeError)(
886
886
  "CONSTRAINT_VIOLATION",
887
887
  `Unknown data stream type: 0x${firstByte.toString(16)}`,
888
888
  0
@@ -939,7 +939,7 @@ function encodeSetupOptions(opts, writer) {
939
939
  entries.push({
940
940
  type: SETUP_OPT_AUTHORIZATION_TOKEN,
941
941
  encode: (w) => {
942
- const tmpW = new (0, _chunkJL3NEW3Ocjs.BufferWriter)(64);
942
+ const tmpW = new (0, _chunk4XLYCT5Qcjs.MoqtBufferWriter)(64);
943
943
  encodeAuthorizationToken(opts.authorization_token, tmpW);
944
944
  const raw = tmpW.finish();
945
945
  w.writeVarInt(BigInt(raw.byteLength));
@@ -980,11 +980,11 @@ function encodeSetupOptions(opts, writer) {
980
980
  type: id,
981
981
  encode: (w) => {
982
982
  if (id % 2n === 0n) {
983
- const raw = _chunkJL3NEW3Ocjs.hexToBytes.call(void 0, u.raw_hex);
984
- const tmpReader = new (0, _chunkJL3NEW3Ocjs.BufferReader)(raw);
983
+ const raw = _chunk4XLYCT5Qcjs.hexToBytes.call(void 0, u.raw_hex);
984
+ const tmpReader = new (0, _chunk4XLYCT5Qcjs.MoqtBufferReader)(raw);
985
985
  w.writeVarInt(tmpReader.readVarInt());
986
986
  } else {
987
- const raw = _chunkJL3NEW3Ocjs.hexToBytes.call(void 0, u.raw_hex);
987
+ const raw = _chunk4XLYCT5Qcjs.hexToBytes.call(void 0, u.raw_hex);
988
988
  w.writeVarInt(BigInt(raw.byteLength));
989
989
  w.writeBytes(raw);
990
990
  }
@@ -1013,13 +1013,13 @@ function decodeSetupOptions(reader, payloadEnd) {
1013
1013
  if (optType === SETUP_OPT_MAX_AUTH_TOKEN_CACHE_SIZE) {
1014
1014
  result.max_auth_token_cache_size = value;
1015
1015
  } else {
1016
- const tmpWriter = new (0, _chunkJL3NEW3Ocjs.BufferWriter)(16);
1016
+ const tmpWriter = new (0, _chunk4XLYCT5Qcjs.MoqtBufferWriter)(16);
1017
1017
  tmpWriter.writeVarInt(value);
1018
1018
  const raw = tmpWriter.finish();
1019
1019
  unknown.push({
1020
1020
  id: `0x${optType.toString(16)}`,
1021
1021
  length: raw.byteLength,
1022
- raw_hex: _chunkJL3NEW3Ocjs.bytesToHex.call(void 0, raw)
1022
+ raw_hex: _chunk4XLYCT5Qcjs.bytesToHex.call(void 0, raw)
1023
1023
  });
1024
1024
  }
1025
1025
  } else {
@@ -1028,7 +1028,7 @@ function decodeSetupOptions(reader, payloadEnd) {
1028
1028
  if (optType === SETUP_OPT_PATH) {
1029
1029
  result.path = textDecoder.decode(bytes);
1030
1030
  } else if (optType === SETUP_OPT_AUTHORIZATION_TOKEN) {
1031
- result.authorization_token = decodeAuthorizationToken(new (0, _chunkJL3NEW3Ocjs.BufferReader)(bytes));
1031
+ result.authorization_token = decodeAuthorizationToken(new (0, _chunk4XLYCT5Qcjs.MoqtBufferReader)(bytes));
1032
1032
  } else if (optType === SETUP_OPT_AUTHORITY) {
1033
1033
  result.authority = textDecoder.decode(bytes);
1034
1034
  } else if (optType === SETUP_OPT_MOQT_IMPLEMENTATION) {
@@ -1037,7 +1037,7 @@ function decodeSetupOptions(reader, payloadEnd) {
1037
1037
  unknown.push({
1038
1038
  id: `0x${optType.toString(16)}`,
1039
1039
  length,
1040
- raw_hex: _chunkJL3NEW3Ocjs.bytesToHex.call(void 0, bytes)
1040
+ raw_hex: _chunk4XLYCT5Qcjs.bytesToHex.call(void 0, bytes)
1041
1041
  });
1042
1042
  }
1043
1043
  }
@@ -1115,7 +1115,7 @@ function encodeParams(params, writer) {
1115
1115
  entries.push({
1116
1116
  type: PARAM_AUTHORIZATION_TOKEN,
1117
1117
  encode: (w) => {
1118
- const tmpW = new (0, _chunkJL3NEW3Ocjs.BufferWriter)(64);
1118
+ const tmpW = new (0, _chunk4XLYCT5Qcjs.MoqtBufferWriter)(64);
1119
1119
  encodeAuthorizationToken(params.authorization_token, tmpW);
1120
1120
  const raw = tmpW.finish();
1121
1121
  w.writeVarInt(BigInt(raw.byteLength));
@@ -1145,7 +1145,7 @@ function encodeParams(params, writer) {
1145
1145
  entries.push({
1146
1146
  type: PARAM_LARGEST_OBJECT,
1147
1147
  encode: (w) => {
1148
- const tmpW = new (0, _chunkJL3NEW3Ocjs.BufferWriter)(16);
1148
+ const tmpW = new (0, _chunk4XLYCT5Qcjs.MoqtBufferWriter)(16);
1149
1149
  tmpW.writeVarInt(params.largest_object.group);
1150
1150
  tmpW.writeVarInt(params.largest_object.object);
1151
1151
  const raw = tmpW.finish();
@@ -1177,7 +1177,7 @@ function encodeParams(params, writer) {
1177
1177
  type: PARAM_SUBSCRIPTION_FILTER,
1178
1178
  encode: (w) => {
1179
1179
  const f = params.subscription_filter;
1180
- const tmpW = new (0, _chunkJL3NEW3Ocjs.BufferWriter)(32);
1180
+ const tmpW = new (0, _chunk4XLYCT5Qcjs.MoqtBufferWriter)(32);
1181
1181
  tmpW.writeVarInt(f.filter_type);
1182
1182
  if (f.filter_type === 3n || f.filter_type === 4n) {
1183
1183
  tmpW.writeVarInt(f.start_group);
@@ -1208,7 +1208,7 @@ function encodeParams(params, writer) {
1208
1208
  entries.push({
1209
1209
  type: PARAM_TRACK_NAMESPACE_PREFIX,
1210
1210
  encode: (w) => {
1211
- const tmpW = new (0, _chunkJL3NEW3Ocjs.BufferWriter)(32);
1211
+ const tmpW = new (0, _chunk4XLYCT5Qcjs.MoqtBufferWriter)(32);
1212
1212
  encodeNamespaceTuple(params.track_namespace_prefix, tmpW);
1213
1213
  const raw = tmpW.finish();
1214
1214
  w.writeVarInt(BigInt(raw.byteLength));
@@ -1222,7 +1222,7 @@ function encodeParams(params, writer) {
1222
1222
  entries.push({
1223
1223
  type: id,
1224
1224
  encode: (w) => {
1225
- const raw = _chunkJL3NEW3Ocjs.hexToBytes.call(void 0, u.raw_hex);
1225
+ const raw = _chunk4XLYCT5Qcjs.hexToBytes.call(void 0, u.raw_hex);
1226
1226
  w.writeBytes(raw);
1227
1227
  }
1228
1228
  });
@@ -1251,7 +1251,7 @@ function decodeParams(reader) {
1251
1251
  } else if (paramType === PARAM_AUTHORIZATION_TOKEN) {
1252
1252
  const length = Number(reader.readVarInt());
1253
1253
  const bytes = reader.readBytes(length);
1254
- result.authorization_token = decodeAuthorizationToken(new (0, _chunkJL3NEW3Ocjs.BufferReader)(bytes));
1254
+ result.authorization_token = decodeAuthorizationToken(new (0, _chunk4XLYCT5Qcjs.MoqtBufferReader)(bytes));
1255
1255
  } else if (paramType === PARAM_RENDEZVOUS_TIMEOUT) {
1256
1256
  result.rendezvous_timeout = reader.readVarInt();
1257
1257
  } else if (paramType === PARAM_SUBGROUP_DELIVERY_TIMEOUT) {
@@ -1294,17 +1294,17 @@ function decodeParams(reader) {
1294
1294
  } else if (paramType === PARAM_TRACK_NAMESPACE_PREFIX) {
1295
1295
  const length = Number(reader.readVarInt());
1296
1296
  const bytes = reader.readBytes(length);
1297
- result.track_namespace_prefix = decodeNamespaceTuple(new (0, _chunkJL3NEW3Ocjs.BufferReader)(bytes));
1297
+ result.track_namespace_prefix = decodeNamespaceTuple(new (0, _chunk4XLYCT5Qcjs.MoqtBufferReader)(bytes));
1298
1298
  } else {
1299
1299
  if (paramType % 2n === 0n) {
1300
1300
  const value = reader.readVarInt();
1301
- const tmpWriter = new (0, _chunkJL3NEW3Ocjs.BufferWriter)(16);
1301
+ const tmpWriter = new (0, _chunk4XLYCT5Qcjs.MoqtBufferWriter)(16);
1302
1302
  tmpWriter.writeVarInt(value);
1303
1303
  const raw = tmpWriter.finish();
1304
1304
  unknown.push({
1305
1305
  id: `0x${paramType.toString(16)}`,
1306
1306
  length: raw.byteLength,
1307
- raw_hex: _chunkJL3NEW3Ocjs.bytesToHex.call(void 0, raw)
1307
+ raw_hex: _chunk4XLYCT5Qcjs.bytesToHex.call(void 0, raw)
1308
1308
  });
1309
1309
  } else {
1310
1310
  const length = Number(reader.readVarInt());
@@ -1312,7 +1312,7 @@ function decodeParams(reader) {
1312
1312
  unknown.push({
1313
1313
  id: `0x${paramType.toString(16)}`,
1314
1314
  length,
1315
- raw_hex: _chunkJL3NEW3Ocjs.bytesToHex.call(void 0, bytes)
1315
+ raw_hex: _chunk4XLYCT5Qcjs.bytesToHex.call(void 0, bytes)
1316
1316
  });
1317
1317
  }
1318
1318
  }
@@ -1382,11 +1382,11 @@ function encodeTrackProperties(props, writer) {
1382
1382
  type: id,
1383
1383
  encode: (w) => {
1384
1384
  if (id % 2n === 0n) {
1385
- const raw = _chunkJL3NEW3Ocjs.hexToBytes.call(void 0, u.raw_hex);
1386
- const tmpReader = new (0, _chunkJL3NEW3Ocjs.BufferReader)(raw);
1385
+ const raw = _chunk4XLYCT5Qcjs.hexToBytes.call(void 0, u.raw_hex);
1386
+ const tmpReader = new (0, _chunk4XLYCT5Qcjs.MoqtBufferReader)(raw);
1387
1387
  w.writeVarInt(tmpReader.readVarInt());
1388
1388
  } else {
1389
- const raw = _chunkJL3NEW3Ocjs.hexToBytes.call(void 0, u.raw_hex);
1389
+ const raw = _chunk4XLYCT5Qcjs.hexToBytes.call(void 0, u.raw_hex);
1390
1390
  w.writeVarInt(BigInt(raw.byteLength));
1391
1391
  w.writeBytes(raw);
1392
1392
  }
@@ -1425,13 +1425,13 @@ function decodeTrackProperties(reader, payloadEnd) {
1425
1425
  } else if (propType === TPROP_DYNAMIC_GROUPS) {
1426
1426
  result.dynamic_groups = value;
1427
1427
  } else {
1428
- const tmpWriter = new (0, _chunkJL3NEW3Ocjs.BufferWriter)(16);
1428
+ const tmpWriter = new (0, _chunk4XLYCT5Qcjs.MoqtBufferWriter)(16);
1429
1429
  tmpWriter.writeVarInt(value);
1430
1430
  const raw = tmpWriter.finish();
1431
1431
  unknown.push({
1432
1432
  id: `0x${propType.toString(16)}`,
1433
1433
  length: raw.byteLength,
1434
- raw_hex: _chunkJL3NEW3Ocjs.bytesToHex.call(void 0, raw)
1434
+ raw_hex: _chunk4XLYCT5Qcjs.bytesToHex.call(void 0, raw)
1435
1435
  });
1436
1436
  }
1437
1437
  } else {
@@ -1443,7 +1443,7 @@ function decodeTrackProperties(reader, payloadEnd) {
1443
1443
  unknown.push({
1444
1444
  id: `0x${propType.toString(16)}`,
1445
1445
  length,
1446
- raw_hex: _chunkJL3NEW3Ocjs.bytesToHex.call(void 0, bytes)
1446
+ raw_hex: _chunk4XLYCT5Qcjs.bytesToHex.call(void 0, bytes)
1447
1447
  });
1448
1448
  }
1449
1449
  }
@@ -1677,7 +1677,7 @@ function decodeFetchPayload(r) {
1677
1677
  const fetch_type = r.readVarInt();
1678
1678
  const ft = Number(fetch_type);
1679
1679
  if (ft < 1 || ft > 3) {
1680
- throw new (0, _chunkJL3NEW3Ocjs.DecodeError)("CONSTRAINT_VIOLATION", `Invalid fetch_type: ${ft}`, r.offset);
1680
+ throw new (0, _chunk4XLYCT5Qcjs.DecodeError)("CONSTRAINT_VIOLATION", `Invalid fetch_type: ${ft}`, r.offset);
1681
1681
  }
1682
1682
  let standalone;
1683
1683
  let joining;
@@ -1774,13 +1774,13 @@ function encodeMessage(message) {
1774
1774
  if (typeId === void 0) {
1775
1775
  throw new Error(`Unknown message type: ${message.type}`);
1776
1776
  }
1777
- const payloadWriter = new (0, _chunkJL3NEW3Ocjs.BufferWriter)();
1777
+ const payloadWriter = new (0, _chunk4XLYCT5Qcjs.MoqtBufferWriter)();
1778
1778
  encodePayload(message, payloadWriter);
1779
1779
  const payload = payloadWriter.finishView();
1780
1780
  if (payload.byteLength > 65535) {
1781
1781
  throw new Error(`Payload too large for 16-bit length: ${payload.byteLength}`);
1782
1782
  }
1783
- const writer = new (0, _chunkJL3NEW3Ocjs.BufferWriter)(payload.byteLength + 16);
1783
+ const writer = new (0, _chunk4XLYCT5Qcjs.MoqtBufferWriter)(payload.byteLength + 16);
1784
1784
  writer.writeVarInt(typeId);
1785
1785
  writer.writeUint8(payload.byteLength >> 8 & 255);
1786
1786
  writer.writeUint8(payload.byteLength & 255);
@@ -1833,13 +1833,13 @@ function encodePayload(msg, w) {
1833
1833
  }
1834
1834
  function decodeMessage(bytes) {
1835
1835
  try {
1836
- const reader = new (0, _chunkJL3NEW3Ocjs.BufferReader)(bytes);
1836
+ const reader = new (0, _chunk4XLYCT5Qcjs.MoqtBufferReader)(bytes);
1837
1837
  const typeId = reader.readVarInt();
1838
1838
  const lenHi = reader.readUint8();
1839
1839
  const lenLo = reader.readUint8();
1840
1840
  const payloadLength = lenHi << 8 | lenLo;
1841
1841
  const payloadBytes = reader.readBytes(payloadLength);
1842
- const payloadReader = new (0, _chunkJL3NEW3Ocjs.BufferReader)(payloadBytes);
1842
+ const payloadReader = new (0, _chunk4XLYCT5Qcjs.MoqtBufferReader)(payloadBytes);
1843
1843
  let message;
1844
1844
  if (typeId === MSG_SETUP) {
1845
1845
  message = decodeSetupPayload(payloadReader, payloadLength);
@@ -1880,7 +1880,7 @@ function decodeMessage(bytes) {
1880
1880
  } else {
1881
1881
  return {
1882
1882
  ok: false,
1883
- error: new (0, _chunkJL3NEW3Ocjs.DecodeError)(
1883
+ error: new (0, _chunk4XLYCT5Qcjs.DecodeError)(
1884
1884
  "UNKNOWN_MESSAGE_TYPE",
1885
1885
  `Unknown message type ID: 0x${typeId.toString(16)}`,
1886
1886
  0
@@ -1889,7 +1889,7 @@ function decodeMessage(bytes) {
1889
1889
  }
1890
1890
  return { ok: true, value: message, bytesRead: reader.offset };
1891
1891
  } catch (e) {
1892
- if (e instanceof _chunkJL3NEW3Ocjs.DecodeError) {
1892
+ if (e instanceof _chunk4XLYCT5Qcjs.DecodeError) {
1893
1893
  return { ok: false, error: e };
1894
1894
  }
1895
1895
  throw e;
@@ -1924,7 +1924,7 @@ function createStreamDecoder() {
1924
1924
  flush(controller) {
1925
1925
  if (offset < buffer.length) {
1926
1926
  controller.error(
1927
- new (0, _chunkJL3NEW3Ocjs.DecodeError)("UNEXPECTED_END", "Stream ended with incomplete message data", 0)
1927
+ new (0, _chunk4XLYCT5Qcjs.DecodeError)("UNEXPECTED_END", "Stream ended with incomplete message data", 0)
1928
1928
  );
1929
1929
  }
1930
1930
  }
@@ -4,7 +4,7 @@ import {
4
4
  DecodeError,
5
5
  bytesToHex,
6
6
  hexToBytes
7
- } from "./chunk-VOU7PNHI.js";
7
+ } from "./chunk-KLPWJU6W.js";
8
8
 
9
9
  // src/drafts/draft07/messages.ts
10
10
  var MSG_SUBSCRIBE_UPDATE = 0x02n;
@@ -4,7 +4,7 @@ import {
4
4
  DecodeError,
5
5
  bytesToHex,
6
6
  hexToBytes
7
- } from "./chunk-VOU7PNHI.js";
7
+ } from "./chunk-KLPWJU6W.js";
8
8
 
9
9
  // src/drafts/draft15/messages.ts
10
10
  var MSG_SUBSCRIBE_UPDATE = 0x02n;