@liveblocks/core 3.12.0 → 3.12.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.
package/dist/index.cjs CHANGED
@@ -6,7 +6,7 @@ var __export = (target, all) => {
6
6
 
7
7
  // src/version.ts
8
8
  var PKG_NAME = "@liveblocks/core";
9
- var PKG_VERSION = "3.12.0";
9
+ var PKG_VERSION = "3.12.1";
10
10
  var PKG_FORMAT = "cjs";
11
11
 
12
12
  // src/dupe-detection.ts
@@ -3082,27 +3082,32 @@ var FSM = class {
3082
3082
  };
3083
3083
 
3084
3084
  // src/protocol/ServerMsg.ts
3085
- var ServerMsgCode = /* @__PURE__ */ ((ServerMsgCode2) => {
3086
- ServerMsgCode2[ServerMsgCode2["UPDATE_PRESENCE"] = 100] = "UPDATE_PRESENCE";
3087
- ServerMsgCode2[ServerMsgCode2["USER_JOINED"] = 101] = "USER_JOINED";
3088
- ServerMsgCode2[ServerMsgCode2["USER_LEFT"] = 102] = "USER_LEFT";
3089
- ServerMsgCode2[ServerMsgCode2["BROADCASTED_EVENT"] = 103] = "BROADCASTED_EVENT";
3090
- ServerMsgCode2[ServerMsgCode2["ROOM_STATE"] = 104] = "ROOM_STATE";
3091
- ServerMsgCode2[ServerMsgCode2["INITIAL_STORAGE_STATE"] = 200] = "INITIAL_STORAGE_STATE";
3092
- ServerMsgCode2[ServerMsgCode2["UPDATE_STORAGE"] = 201] = "UPDATE_STORAGE";
3093
- ServerMsgCode2[ServerMsgCode2["UPDATE_YDOC"] = 300] = "UPDATE_YDOC";
3094
- ServerMsgCode2[ServerMsgCode2["THREAD_CREATED"] = 400] = "THREAD_CREATED";
3095
- ServerMsgCode2[ServerMsgCode2["THREAD_DELETED"] = 407] = "THREAD_DELETED";
3096
- ServerMsgCode2[ServerMsgCode2["THREAD_METADATA_UPDATED"] = 401] = "THREAD_METADATA_UPDATED";
3097
- ServerMsgCode2[ServerMsgCode2["THREAD_UPDATED"] = 408] = "THREAD_UPDATED";
3098
- ServerMsgCode2[ServerMsgCode2["COMMENT_CREATED"] = 402] = "COMMENT_CREATED";
3099
- ServerMsgCode2[ServerMsgCode2["COMMENT_EDITED"] = 403] = "COMMENT_EDITED";
3100
- ServerMsgCode2[ServerMsgCode2["COMMENT_DELETED"] = 404] = "COMMENT_DELETED";
3101
- ServerMsgCode2[ServerMsgCode2["COMMENT_REACTION_ADDED"] = 405] = "COMMENT_REACTION_ADDED";
3102
- ServerMsgCode2[ServerMsgCode2["COMMENT_REACTION_REMOVED"] = 406] = "COMMENT_REACTION_REMOVED";
3103
- ServerMsgCode2[ServerMsgCode2["REJECT_STORAGE_OP"] = 299] = "REJECT_STORAGE_OP";
3104
- return ServerMsgCode2;
3105
- })(ServerMsgCode || {});
3085
+ var ServerMsgCode = Object.freeze({
3086
+ // For Presence
3087
+ UPDATE_PRESENCE: 100,
3088
+ USER_JOINED: 101,
3089
+ USER_LEFT: 102,
3090
+ BROADCASTED_EVENT: 103,
3091
+ ROOM_STATE: 104,
3092
+ // For Storage
3093
+ INITIAL_STORAGE_STATE: 200,
3094
+ UPDATE_STORAGE: 201,
3095
+ // For Yjs Docs
3096
+ UPDATE_YDOC: 300,
3097
+ // For Comments
3098
+ THREAD_CREATED: 400,
3099
+ THREAD_DELETED: 407,
3100
+ THREAD_METADATA_UPDATED: 401,
3101
+ THREAD_UPDATED: 408,
3102
+ COMMENT_CREATED: 402,
3103
+ COMMENT_EDITED: 403,
3104
+ COMMENT_DELETED: 404,
3105
+ COMMENT_REACTION_ADDED: 405,
3106
+ COMMENT_REACTION_REMOVED: 406,
3107
+ // Error codes
3108
+ REJECT_STORAGE_OP: 299
3109
+ // Sent if a mutation was not allowed on the server (i.e. due to permissions, limit exceeded, etc)
3110
+ });
3106
3111
 
3107
3112
  // src/types/IWebSocket.ts
3108
3113
  var WebsocketCloseCodes = /* @__PURE__ */ ((WebsocketCloseCodes2) => {
@@ -3403,7 +3408,7 @@ function createConnectionStateMachine(delegates, options) {
3403
3408
  }
3404
3409
  function waitForActorId(event) {
3405
3410
  const serverMsg = tryParseJson(event.data);
3406
- if (_optionalChain([serverMsg, 'optionalAccess', _40 => _40.type]) === 104 /* ROOM_STATE */) {
3411
+ if (_optionalChain([serverMsg, 'optionalAccess', _40 => _40.type]) === ServerMsgCode.ROOM_STATE) {
3407
3412
  didReceiveActor();
3408
3413
  }
3409
3414
  }
@@ -5908,28 +5913,22 @@ function asPos(str) {
5908
5913
  }
5909
5914
 
5910
5915
  // src/protocol/Op.ts
5911
- var OpCode = /* @__PURE__ */ ((OpCode2) => {
5912
- OpCode2[OpCode2["INIT"] = 0] = "INIT";
5913
- OpCode2[OpCode2["SET_PARENT_KEY"] = 1] = "SET_PARENT_KEY";
5914
- OpCode2[OpCode2["CREATE_LIST"] = 2] = "CREATE_LIST";
5915
- OpCode2[OpCode2["UPDATE_OBJECT"] = 3] = "UPDATE_OBJECT";
5916
- OpCode2[OpCode2["CREATE_OBJECT"] = 4] = "CREATE_OBJECT";
5917
- OpCode2[OpCode2["DELETE_CRDT"] = 5] = "DELETE_CRDT";
5918
- OpCode2[OpCode2["DELETE_OBJECT_KEY"] = 6] = "DELETE_OBJECT_KEY";
5919
- OpCode2[OpCode2["CREATE_MAP"] = 7] = "CREATE_MAP";
5920
- OpCode2[OpCode2["CREATE_REGISTER"] = 8] = "CREATE_REGISTER";
5921
- return OpCode2;
5922
- })(OpCode || {});
5923
- function ackOp(opId) {
5924
- return {
5925
- type: 5 /* DELETE_CRDT */,
5926
- id: "ACK",
5927
- // (H)ACK
5928
- opId
5929
- };
5930
- }
5931
- function isAckOp(op) {
5932
- return op.type === 5 /* DELETE_CRDT */ && op.id === "ACK";
5916
+ var OpCode = Object.freeze({
5917
+ INIT: 0,
5918
+ SET_PARENT_KEY: 1,
5919
+ CREATE_LIST: 2,
5920
+ UPDATE_OBJECT: 3,
5921
+ CREATE_OBJECT: 4,
5922
+ DELETE_CRDT: 5,
5923
+ DELETE_OBJECT_KEY: 6,
5924
+ CREATE_MAP: 7,
5925
+ CREATE_REGISTER: 8,
5926
+ ACK: 9
5927
+ // Will only appear in v8+
5928
+ });
5929
+ function isAck(op) {
5930
+ return op.type === OpCode.ACK || // >= v8
5931
+ op.type === OpCode.DELETE_CRDT && op.id === "ACK";
5933
5932
  }
5934
5933
 
5935
5934
  // src/crdts/AbstractCrdt.ts
@@ -6034,7 +6033,7 @@ var AbstractCrdt = class {
6034
6033
  /** @internal */
6035
6034
  _apply(op, _isLocal) {
6036
6035
  switch (op.type) {
6037
- case 5 /* DELETE_CRDT */: {
6036
+ case OpCode.DELETE_CRDT: {
6038
6037
  if (this.parent.type === "HasParent") {
6039
6038
  return this.parent.node._detachChild(crdtAsLiveNode(this));
6040
6039
  }
@@ -6138,13 +6137,12 @@ var AbstractCrdt = class {
6138
6137
  };
6139
6138
 
6140
6139
  // src/protocol/SerializedCrdt.ts
6141
- var CrdtType = /* @__PURE__ */ ((CrdtType2) => {
6142
- CrdtType2[CrdtType2["OBJECT"] = 0] = "OBJECT";
6143
- CrdtType2[CrdtType2["LIST"] = 1] = "LIST";
6144
- CrdtType2[CrdtType2["MAP"] = 2] = "MAP";
6145
- CrdtType2[CrdtType2["REGISTER"] = 3] = "REGISTER";
6146
- return CrdtType2;
6147
- })(CrdtType || {});
6140
+ var CrdtType = Object.freeze({
6141
+ OBJECT: 0,
6142
+ LIST: 1,
6143
+ MAP: 2,
6144
+ REGISTER: 3
6145
+ });
6148
6146
 
6149
6147
  // src/crdts/LiveRegister.ts
6150
6148
  var LiveRegister = class _LiveRegister extends AbstractCrdt {
@@ -6171,7 +6169,7 @@ var LiveRegister = class _LiveRegister extends AbstractCrdt {
6171
6169
  }
6172
6170
  return [
6173
6171
  {
6174
- type: 8 /* CREATE_REGISTER */,
6172
+ type: OpCode.CREATE_REGISTER,
6175
6173
  opId: _optionalChain([pool, 'optionalAccess', _115 => _115.generateOpId, 'call', _116 => _116()]),
6176
6174
  id: this._id,
6177
6175
  parentId,
@@ -6186,7 +6184,7 @@ var LiveRegister = class _LiveRegister extends AbstractCrdt {
6186
6184
  throw new Error("Cannot serialize LiveRegister if parent is missing");
6187
6185
  }
6188
6186
  return {
6189
- type: 3 /* REGISTER */,
6187
+ type: CrdtType.REGISTER,
6190
6188
  parentId: nn(this.parent.node._id, "Parent node expected to have ID"),
6191
6189
  parentKey: this.parent.key,
6192
6190
  data: this.data
@@ -6279,7 +6277,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
6279
6277
  const op = {
6280
6278
  id: this._id,
6281
6279
  opId: _optionalChain([pool, 'optionalAccess', _117 => _117.generateOpId, 'call', _118 => _118()]),
6282
- type: 2 /* CREATE_LIST */,
6280
+ type: OpCode.CREATE_LIST,
6283
6281
  parentId,
6284
6282
  parentKey
6285
6283
  };
@@ -6566,7 +6564,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
6566
6564
  const newIndex = this._indexOfPosition(newKey);
6567
6565
  return {
6568
6566
  modified: makeUpdate(this, [insertDelta(newIndex, child)]),
6569
- reverse: [{ type: 5 /* DELETE_CRDT */, id }]
6567
+ reverse: [{ type: OpCode.DELETE_CRDT, id }]
6570
6568
  };
6571
6569
  }
6572
6570
  #applySetUndoRedo(op) {
@@ -6604,7 +6602,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
6604
6602
  this.#detachItemAssociatedToSetOperation(op.deletedId);
6605
6603
  const newIndex = this._indexOfPosition(newKey);
6606
6604
  return {
6607
- reverse: [{ type: 5 /* DELETE_CRDT */, id }],
6605
+ reverse: [{ type: OpCode.DELETE_CRDT, id }],
6608
6606
  modified: makeUpdate(this, [insertDelta(newIndex, child)])
6609
6607
  };
6610
6608
  }
@@ -6780,7 +6778,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
6780
6778
  modified: makeUpdate(this, [moveDelta(previousIndex, newIndex, child)]),
6781
6779
  reverse: [
6782
6780
  {
6783
- type: 1 /* SET_PARENT_KEY */,
6781
+ type: OpCode.SET_PARENT_KEY,
6784
6782
  id: nn(child._id),
6785
6783
  parentKey: previousKey
6786
6784
  }
@@ -6807,7 +6805,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
6807
6805
  throw new Error("Cannot serialize LiveList if parent is missing");
6808
6806
  }
6809
6807
  return {
6810
- type: 1 /* LIST */,
6808
+ type: CrdtType.LIST,
6811
6809
  parentId: nn(this.parent.node._id, "Parent node expected to have ID"),
6812
6810
  parentKey: this.parent.key
6813
6811
  };
@@ -6849,7 +6847,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
6849
6847
  value._attach(id, this._pool);
6850
6848
  this._pool.dispatch(
6851
6849
  value._toOps(this._id, position, this._pool),
6852
- [{ type: 5 /* DELETE_CRDT */, id }],
6850
+ [{ type: OpCode.DELETE_CRDT, id }],
6853
6851
  /* @__PURE__ */ new Map([
6854
6852
  [this._id, makeUpdate(this, [insertDelta(index, value)])]
6855
6853
  ])
@@ -6898,7 +6896,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
6898
6896
  this._pool.dispatch(
6899
6897
  [
6900
6898
  {
6901
- type: 1 /* SET_PARENT_KEY */,
6899
+ type: OpCode.SET_PARENT_KEY,
6902
6900
  id: nn(item._id),
6903
6901
  opId: this._pool.generateOpId(),
6904
6902
  parentKey: position
@@ -6906,7 +6904,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
6906
6904
  ],
6907
6905
  [
6908
6906
  {
6909
- type: 1 /* SET_PARENT_KEY */,
6907
+ type: OpCode.SET_PARENT_KEY,
6910
6908
  id: nn(item._id),
6911
6909
  parentKey: previousPosition
6912
6910
  }
@@ -6943,7 +6941,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
6943
6941
  {
6944
6942
  id: childRecordId,
6945
6943
  opId: this._pool.generateOpId(),
6946
- type: 5 /* DELETE_CRDT */
6944
+ type: OpCode.DELETE_CRDT
6947
6945
  }
6948
6946
  ],
6949
6947
  item._toOps(nn(this._id), item._getParentKeyOrThrow()),
@@ -6963,7 +6961,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
6963
6961
  const childId = item._id;
6964
6962
  if (childId) {
6965
6963
  ops.push({
6966
- type: 5 /* DELETE_CRDT */,
6964
+ type: OpCode.DELETE_CRDT,
6967
6965
  id: childId,
6968
6966
  opId: this._pool.generateOpId()
6969
6967
  });
@@ -7259,7 +7257,7 @@ var LiveMap = class _LiveMap extends AbstractCrdt {
7259
7257
  const op = {
7260
7258
  id: this._id,
7261
7259
  opId: _optionalChain([pool, 'optionalAccess', _164 => _164.generateOpId, 'call', _165 => _165()]),
7262
- type: 7 /* CREATE_MAP */,
7260
+ type: OpCode.CREATE_MAP,
7263
7261
  parentId,
7264
7262
  parentKey
7265
7263
  };
@@ -7323,7 +7321,7 @@ var LiveMap = class _LiveMap extends AbstractCrdt {
7323
7321
  reverse = previousValue._toOps(thisId, key);
7324
7322
  previousValue._detach();
7325
7323
  } else {
7326
- reverse = [{ type: 5 /* DELETE_CRDT */, id }];
7324
+ reverse = [{ type: OpCode.DELETE_CRDT, id }];
7327
7325
  }
7328
7326
  child._setParentLink(this, key);
7329
7327
  child._attach(id, this._pool);
@@ -7375,7 +7373,7 @@ var LiveMap = class _LiveMap extends AbstractCrdt {
7375
7373
  throw new Error("Cannot serialize LiveMap if parent is missing");
7376
7374
  }
7377
7375
  return {
7378
- type: 2 /* MAP */,
7376
+ type: CrdtType.MAP,
7379
7377
  parentId: nn(this.parent.node._id, "Parent node expected to have ID"),
7380
7378
  parentKey: this.parent.key
7381
7379
  };
@@ -7420,7 +7418,7 @@ var LiveMap = class _LiveMap extends AbstractCrdt {
7420
7418
  this.#unacknowledgedSet.set(key, nn(ops[0].opId));
7421
7419
  this._pool.dispatch(
7422
7420
  item._toOps(this._id, key, this._pool),
7423
- oldValue ? oldValue._toOps(this._id, key) : [{ type: 5 /* DELETE_CRDT */, id }],
7421
+ oldValue ? oldValue._toOps(this._id, key) : [{ type: OpCode.DELETE_CRDT, id }],
7424
7422
  storageUpdates
7425
7423
  );
7426
7424
  }
@@ -7468,7 +7466,7 @@ var LiveMap = class _LiveMap extends AbstractCrdt {
7468
7466
  this._pool.dispatch(
7469
7467
  [
7470
7468
  {
7471
- type: 5 /* DELETE_CRDT */,
7469
+ type: OpCode.DELETE_CRDT,
7472
7470
  id: item._id,
7473
7471
  opId: this._pool.generateOpId()
7474
7472
  }
@@ -7645,7 +7643,7 @@ var LiveObject = (_class2 = class _LiveObject extends AbstractCrdt {
7645
7643
  const opId = _optionalChain([pool, 'optionalAccess', _172 => _172.generateOpId, 'call', _173 => _173()]);
7646
7644
  const ops = [];
7647
7645
  const op = {
7648
- type: 4 /* CREATE_OBJECT */,
7646
+ type: OpCode.CREATE_OBJECT,
7649
7647
  id: this._id,
7650
7648
  opId,
7651
7649
  parentId,
@@ -7722,11 +7720,11 @@ var LiveObject = (_class2 = class _LiveObject extends AbstractCrdt {
7722
7720
  reverse = previousValue._toOps(thisId, key);
7723
7721
  previousValue._detach();
7724
7722
  } else if (previousValue === void 0) {
7725
- reverse = [{ type: 6 /* DELETE_OBJECT_KEY */, id: thisId, key }];
7723
+ reverse = [{ type: OpCode.DELETE_OBJECT_KEY, id: thisId, key }];
7726
7724
  } else {
7727
7725
  reverse = [
7728
7726
  {
7729
- type: 3 /* UPDATE_OBJECT */,
7727
+ type: OpCode.UPDATE_OBJECT,
7730
7728
  id: thisId,
7731
7729
  data: { [key]: previousValue }
7732
7730
  }
@@ -7782,9 +7780,9 @@ var LiveObject = (_class2 = class _LiveObject extends AbstractCrdt {
7782
7780
  }
7783
7781
  /** @internal */
7784
7782
  _apply(op, isLocal) {
7785
- if (op.type === 3 /* UPDATE_OBJECT */) {
7783
+ if (op.type === OpCode.UPDATE_OBJECT) {
7786
7784
  return this.#applyUpdate(op, isLocal);
7787
- } else if (op.type === 6 /* DELETE_OBJECT_KEY */) {
7785
+ } else if (op.type === OpCode.DELETE_OBJECT_KEY) {
7788
7786
  return this.#applyDeleteObjectKey(op, isLocal);
7789
7787
  }
7790
7788
  return super._apply(op, isLocal);
@@ -7799,14 +7797,14 @@ var LiveObject = (_class2 = class _LiveObject extends AbstractCrdt {
7799
7797
  }
7800
7798
  if (this.parent.type === "HasParent" && this.parent.node._id) {
7801
7799
  return {
7802
- type: 0 /* OBJECT */,
7800
+ type: CrdtType.OBJECT,
7803
7801
  parentId: this.parent.node._id,
7804
7802
  parentKey: this.parent.key,
7805
7803
  data
7806
7804
  };
7807
7805
  } else {
7808
7806
  return {
7809
- type: 0 /* OBJECT */,
7807
+ type: CrdtType.OBJECT,
7810
7808
  data
7811
7809
  };
7812
7810
  }
@@ -7816,7 +7814,7 @@ var LiveObject = (_class2 = class _LiveObject extends AbstractCrdt {
7816
7814
  const id = nn(this._id);
7817
7815
  const reverse = [];
7818
7816
  const reverseUpdate = {
7819
- type: 3 /* UPDATE_OBJECT */,
7817
+ type: OpCode.UPDATE_OBJECT,
7820
7818
  id,
7821
7819
  data: {}
7822
7820
  };
@@ -7828,7 +7826,7 @@ var LiveObject = (_class2 = class _LiveObject extends AbstractCrdt {
7828
7826
  } else if (oldValue !== void 0) {
7829
7827
  reverseUpdate.data[key] = oldValue;
7830
7828
  } else if (oldValue === void 0) {
7831
- reverse.push({ type: 6 /* DELETE_OBJECT_KEY */, id, key });
7829
+ reverse.push({ type: OpCode.DELETE_OBJECT_KEY, id, key });
7832
7830
  }
7833
7831
  }
7834
7832
  const updateDelta = {};
@@ -7885,7 +7883,7 @@ var LiveObject = (_class2 = class _LiveObject extends AbstractCrdt {
7885
7883
  } else if (oldValue !== void 0) {
7886
7884
  reverse = [
7887
7885
  {
7888
- type: 3 /* UPDATE_OBJECT */,
7886
+ type: OpCode.UPDATE_OBJECT,
7889
7887
  id,
7890
7888
  data: { [key]: oldValue }
7891
7889
  }
@@ -7952,7 +7950,7 @@ var LiveObject = (_class2 = class _LiveObject extends AbstractCrdt {
7952
7950
  } else {
7953
7951
  reverse = [
7954
7952
  {
7955
- type: 3 /* UPDATE_OBJECT */,
7953
+ type: OpCode.UPDATE_OBJECT,
7956
7954
  data: { [keyAsString]: oldValue },
7957
7955
  id: this._id
7958
7956
  }
@@ -7971,7 +7969,7 @@ var LiveObject = (_class2 = class _LiveObject extends AbstractCrdt {
7971
7969
  this._pool.dispatch(
7972
7970
  [
7973
7971
  {
7974
- type: 6 /* DELETE_OBJECT_KEY */,
7972
+ type: OpCode.DELETE_OBJECT_KEY,
7975
7973
  key: keyAsString,
7976
7974
  id: this._id,
7977
7975
  opId: this._pool.generateOpId()
@@ -8036,7 +8034,7 @@ var LiveObject = (_class2 = class _LiveObject extends AbstractCrdt {
8036
8034
  const updatedProps = {};
8037
8035
  const reverseUpdateOp = {
8038
8036
  id: this._id,
8039
- type: 3 /* UPDATE_OBJECT */,
8037
+ type: OpCode.UPDATE_OBJECT,
8040
8038
  data: {}
8041
8039
  };
8042
8040
  const updateDelta = {};
@@ -8050,7 +8048,7 @@ var LiveObject = (_class2 = class _LiveObject extends AbstractCrdt {
8050
8048
  reverseOps.push(...oldValue._toOps(this._id, key));
8051
8049
  oldValue._detach();
8052
8050
  } else if (oldValue === void 0) {
8053
- reverseOps.push({ type: 6 /* DELETE_OBJECT_KEY */, id: this._id, key });
8051
+ reverseOps.push({ type: OpCode.DELETE_OBJECT_KEY, id: this._id, key });
8054
8052
  } else {
8055
8053
  reverseUpdateOp.data[key] = oldValue;
8056
8054
  }
@@ -8080,7 +8078,7 @@ var LiveObject = (_class2 = class _LiveObject extends AbstractCrdt {
8080
8078
  ops.unshift({
8081
8079
  opId,
8082
8080
  id: this._id,
8083
- type: 3 /* UPDATE_OBJECT */,
8081
+ type: OpCode.UPDATE_OBJECT,
8084
8082
  data: updatedProps
8085
8083
  });
8086
8084
  }
@@ -8137,13 +8135,13 @@ function creationOpToLiveNode(op) {
8137
8135
  }
8138
8136
  function creationOpToLson(op) {
8139
8137
  switch (op.type) {
8140
- case 8 /* CREATE_REGISTER */:
8138
+ case OpCode.CREATE_REGISTER:
8141
8139
  return op.data;
8142
- case 4 /* CREATE_OBJECT */:
8140
+ case OpCode.CREATE_OBJECT:
8143
8141
  return new LiveObject(op.data);
8144
- case 7 /* CREATE_MAP */:
8142
+ case OpCode.CREATE_MAP:
8145
8143
  return new LiveMap();
8146
- case 2 /* CREATE_LIST */:
8144
+ case OpCode.CREATE_LIST:
8147
8145
  return new LiveList([]);
8148
8146
  default:
8149
8147
  return assertNever(op, "Unknown creation Op");
@@ -8160,16 +8158,16 @@ function isSameNodeOrChildOf(node, parent) {
8160
8158
  }
8161
8159
  function deserialize([id, crdt], parentToChildren, pool) {
8162
8160
  switch (crdt.type) {
8163
- case 0 /* OBJECT */: {
8161
+ case CrdtType.OBJECT: {
8164
8162
  return LiveObject._deserialize([id, crdt], parentToChildren, pool);
8165
8163
  }
8166
- case 1 /* LIST */: {
8164
+ case CrdtType.LIST: {
8167
8165
  return LiveList._deserialize([id, crdt], parentToChildren, pool);
8168
8166
  }
8169
- case 2 /* MAP */: {
8167
+ case CrdtType.MAP: {
8170
8168
  return LiveMap._deserialize([id, crdt], parentToChildren, pool);
8171
8169
  }
8172
- case 3 /* REGISTER */: {
8170
+ case CrdtType.REGISTER: {
8173
8171
  return LiveRegister._deserialize([id, crdt], parentToChildren, pool);
8174
8172
  }
8175
8173
  default: {
@@ -8179,16 +8177,16 @@ function deserialize([id, crdt], parentToChildren, pool) {
8179
8177
  }
8180
8178
  function deserializeToLson([id, crdt], parentToChildren, pool) {
8181
8179
  switch (crdt.type) {
8182
- case 0 /* OBJECT */: {
8180
+ case CrdtType.OBJECT: {
8183
8181
  return LiveObject._deserialize([id, crdt], parentToChildren, pool);
8184
8182
  }
8185
- case 1 /* LIST */: {
8183
+ case CrdtType.LIST: {
8186
8184
  return LiveList._deserialize([id, crdt], parentToChildren, pool);
8187
8185
  }
8188
- case 2 /* MAP */: {
8186
+ case CrdtType.MAP: {
8189
8187
  return LiveMap._deserialize([id, crdt], parentToChildren, pool);
8190
8188
  }
8191
- case 3 /* REGISTER */: {
8189
+ case CrdtType.REGISTER: {
8192
8190
  return crdt.data;
8193
8191
  }
8194
8192
  default: {
@@ -8238,7 +8236,7 @@ function getTreesDiffOperations(currentItems, newItems) {
8238
8236
  currentItems.forEach((_, id) => {
8239
8237
  if (!newItems.get(id)) {
8240
8238
  ops.push({
8241
- type: 5 /* DELETE_CRDT */,
8239
+ type: OpCode.DELETE_CRDT,
8242
8240
  id
8243
8241
  });
8244
8242
  }
@@ -8246,10 +8244,10 @@ function getTreesDiffOperations(currentItems, newItems) {
8246
8244
  newItems.forEach((crdt, id) => {
8247
8245
  const currentCrdt = currentItems.get(id);
8248
8246
  if (currentCrdt) {
8249
- if (crdt.type === 0 /* OBJECT */) {
8250
- if (currentCrdt.type !== 0 /* OBJECT */ || stringifyOrLog(crdt.data) !== stringifyOrLog(currentCrdt.data)) {
8247
+ if (crdt.type === CrdtType.OBJECT) {
8248
+ if (currentCrdt.type !== CrdtType.OBJECT || stringifyOrLog(crdt.data) !== stringifyOrLog(currentCrdt.data)) {
8251
8249
  ops.push({
8252
- type: 3 /* UPDATE_OBJECT */,
8250
+ type: OpCode.UPDATE_OBJECT,
8253
8251
  id,
8254
8252
  data: crdt.data
8255
8253
  });
@@ -8257,47 +8255,47 @@ function getTreesDiffOperations(currentItems, newItems) {
8257
8255
  }
8258
8256
  if (crdt.parentKey !== currentCrdt.parentKey) {
8259
8257
  ops.push({
8260
- type: 1 /* SET_PARENT_KEY */,
8258
+ type: OpCode.SET_PARENT_KEY,
8261
8259
  id,
8262
8260
  parentKey: nn(crdt.parentKey, "Parent key must not be missing")
8263
8261
  });
8264
8262
  }
8265
8263
  } else {
8266
8264
  switch (crdt.type) {
8267
- case 3 /* REGISTER */:
8265
+ case CrdtType.REGISTER:
8268
8266
  ops.push({
8269
- type: 8 /* CREATE_REGISTER */,
8267
+ type: OpCode.CREATE_REGISTER,
8270
8268
  id,
8271
8269
  parentId: crdt.parentId,
8272
8270
  parentKey: crdt.parentKey,
8273
8271
  data: crdt.data
8274
8272
  });
8275
8273
  break;
8276
- case 1 /* LIST */:
8274
+ case CrdtType.LIST:
8277
8275
  ops.push({
8278
- type: 2 /* CREATE_LIST */,
8276
+ type: OpCode.CREATE_LIST,
8279
8277
  id,
8280
8278
  parentId: crdt.parentId,
8281
8279
  parentKey: crdt.parentKey
8282
8280
  });
8283
8281
  break;
8284
- case 0 /* OBJECT */:
8282
+ case CrdtType.OBJECT:
8285
8283
  if (crdt.parentId === void 0 || crdt.parentKey === void 0) {
8286
8284
  throw new Error(
8287
8285
  "Internal error. Cannot serialize storage root into an operation"
8288
8286
  );
8289
8287
  }
8290
8288
  ops.push({
8291
- type: 4 /* CREATE_OBJECT */,
8289
+ type: OpCode.CREATE_OBJECT,
8292
8290
  id,
8293
8291
  parentId: crdt.parentId,
8294
8292
  parentKey: crdt.parentKey,
8295
8293
  data: crdt.data
8296
8294
  });
8297
8295
  break;
8298
- case 2 /* MAP */:
8296
+ case CrdtType.MAP:
8299
8297
  ops.push({
8300
- type: 7 /* CREATE_MAP */,
8298
+ type: OpCode.CREATE_MAP,
8301
8299
  id,
8302
8300
  parentId: crdt.parentId,
8303
8301
  parentKey: crdt.parentKey
@@ -8454,15 +8452,17 @@ function isJsonObject(data) {
8454
8452
  }
8455
8453
 
8456
8454
  // src/protocol/ClientMsg.ts
8457
- var ClientMsgCode = /* @__PURE__ */ ((ClientMsgCode2) => {
8458
- ClientMsgCode2[ClientMsgCode2["UPDATE_PRESENCE"] = 100] = "UPDATE_PRESENCE";
8459
- ClientMsgCode2[ClientMsgCode2["BROADCAST_EVENT"] = 103] = "BROADCAST_EVENT";
8460
- ClientMsgCode2[ClientMsgCode2["FETCH_STORAGE"] = 200] = "FETCH_STORAGE";
8461
- ClientMsgCode2[ClientMsgCode2["UPDATE_STORAGE"] = 201] = "UPDATE_STORAGE";
8462
- ClientMsgCode2[ClientMsgCode2["FETCH_YDOC"] = 300] = "FETCH_YDOC";
8463
- ClientMsgCode2[ClientMsgCode2["UPDATE_YDOC"] = 301] = "UPDATE_YDOC";
8464
- return ClientMsgCode2;
8465
- })(ClientMsgCode || {});
8455
+ var ClientMsgCode = Object.freeze({
8456
+ // For Presence
8457
+ UPDATE_PRESENCE: 100,
8458
+ BROADCAST_EVENT: 103,
8459
+ // For Storage
8460
+ FETCH_STORAGE: 200,
8461
+ UPDATE_STORAGE: 201,
8462
+ // For Yjs support
8463
+ FETCH_YDOC: 300,
8464
+ UPDATE_YDOC: 301
8465
+ });
8466
8466
 
8467
8467
  // src/refs/ManagedOthers.ts
8468
8468
  function makeUser(conn, presence) {
@@ -8970,7 +8970,7 @@ function createRoom(options, config) {
8970
8970
  }
8971
8971
  function* chunkMessages(messages) {
8972
8972
  if (messages.length < 2) {
8973
- if (messages[0].type === 201 /* UPDATE_STORAGE */) {
8973
+ if (messages[0].type === ClientMsgCode.UPDATE_STORAGE) {
8974
8974
  yield* chunkOps(messages[0]);
8975
8975
  return;
8976
8976
  } else {
@@ -9210,7 +9210,7 @@ function createRoom(options, config) {
9210
9210
  );
9211
9211
  output.reverse.pushLeft(applyOpResult.reverse);
9212
9212
  }
9213
- if (op.type === 2 /* CREATE_LIST */ || op.type === 7 /* CREATE_MAP */ || op.type === 4 /* CREATE_OBJECT */) {
9213
+ if (op.type === OpCode.CREATE_LIST || op.type === OpCode.CREATE_MAP || op.type === OpCode.CREATE_OBJECT) {
9214
9214
  createdNodeIds.add(nn(op.id));
9215
9215
  }
9216
9216
  }
@@ -9226,20 +9226,20 @@ function createRoom(options, config) {
9226
9226
  };
9227
9227
  }
9228
9228
  function applyOp(op, source) {
9229
- if (isAckOp(op)) {
9229
+ if (isAck(op)) {
9230
9230
  return { modified: false };
9231
9231
  }
9232
9232
  switch (op.type) {
9233
- case 6 /* DELETE_OBJECT_KEY */:
9234
- case 3 /* UPDATE_OBJECT */:
9235
- case 5 /* DELETE_CRDT */: {
9233
+ case OpCode.DELETE_OBJECT_KEY:
9234
+ case OpCode.UPDATE_OBJECT:
9235
+ case OpCode.DELETE_CRDT: {
9236
9236
  const node = context.pool.nodes.get(op.id);
9237
9237
  if (node === void 0) {
9238
9238
  return { modified: false };
9239
9239
  }
9240
9240
  return node._apply(op, source === 0 /* UNDOREDO_RECONNECT */);
9241
9241
  }
9242
- case 1 /* SET_PARENT_KEY */: {
9242
+ case OpCode.SET_PARENT_KEY: {
9243
9243
  const node = context.pool.nodes.get(op.id);
9244
9244
  if (node === void 0) {
9245
9245
  return { modified: false };
@@ -9253,10 +9253,10 @@ function createRoom(options, config) {
9253
9253
  }
9254
9254
  return { modified: false };
9255
9255
  }
9256
- case 4 /* CREATE_OBJECT */:
9257
- case 2 /* CREATE_LIST */:
9258
- case 7 /* CREATE_MAP */:
9259
- case 8 /* CREATE_REGISTER */: {
9256
+ case OpCode.CREATE_OBJECT:
9257
+ case OpCode.CREATE_LIST:
9258
+ case OpCode.CREATE_MAP:
9259
+ case OpCode.CREATE_REGISTER: {
9260
9260
  if (op.parentId === void 0) {
9261
9261
  return { modified: false };
9262
9262
  }
@@ -9340,7 +9340,7 @@ function createRoom(options, config) {
9340
9340
  });
9341
9341
  context.idFactory = makeIdFactory(message.actor);
9342
9342
  notifySelfChanged();
9343
- if (_optionalChain([message, 'access', _201 => _201.meta, 'optionalAccess', _202 => _202.showBrand]) === true) {
9343
+ if (message.meta.showBrand === true) {
9344
9344
  injectBrandBadge(_nullishCoalesce(config.badgeLocation, () => ( "bottom-right")));
9345
9345
  }
9346
9346
  for (const connectionId of context.others.connectionIds()) {
@@ -9378,7 +9378,7 @@ function createRoom(options, config) {
9378
9378
  message.scopes
9379
9379
  );
9380
9380
  context.buffer.messages.push({
9381
- type: 100 /* UPDATE_PRESENCE */,
9381
+ type: ClientMsgCode.UPDATE_PRESENCE,
9382
9382
  data: context.myPresence.get(),
9383
9383
  targetActor: message.actor
9384
9384
  });
@@ -9410,7 +9410,7 @@ function createRoom(options, config) {
9410
9410
  const inOps = Array.from(offlineOps.values());
9411
9411
  const result = applyOps(inOps, true);
9412
9412
  messages.push({
9413
- type: 201 /* UPDATE_STORAGE */,
9413
+ type: ClientMsgCode.UPDATE_STORAGE,
9414
9414
  ops: result.ops
9415
9415
  });
9416
9416
  notify(result.updates);
@@ -9430,21 +9430,21 @@ function createRoom(options, config) {
9430
9430
  };
9431
9431
  for (const message of messages) {
9432
9432
  switch (message.type) {
9433
- case 101 /* USER_JOINED */: {
9433
+ case ServerMsgCode.USER_JOINED: {
9434
9434
  const userJoinedUpdate = onUserJoinedMessage(message);
9435
9435
  if (userJoinedUpdate) {
9436
9436
  updates.others.push(userJoinedUpdate);
9437
9437
  }
9438
9438
  break;
9439
9439
  }
9440
- case 100 /* UPDATE_PRESENCE */: {
9440
+ case ServerMsgCode.UPDATE_PRESENCE: {
9441
9441
  const othersPresenceUpdate = onUpdatePresenceMessage(message);
9442
9442
  if (othersPresenceUpdate) {
9443
9443
  updates.others.push(othersPresenceUpdate);
9444
9444
  }
9445
9445
  break;
9446
9446
  }
9447
- case 103 /* BROADCASTED_EVENT */: {
9447
+ case ServerMsgCode.BROADCASTED_EVENT: {
9448
9448
  const others = context.others.get();
9449
9449
  eventHub.customEvent.notify({
9450
9450
  connectionId: message.actor,
@@ -9453,27 +9453,27 @@ function createRoom(options, config) {
9453
9453
  });
9454
9454
  break;
9455
9455
  }
9456
- case 102 /* USER_LEFT */: {
9456
+ case ServerMsgCode.USER_LEFT: {
9457
9457
  const event2 = onUserLeftMessage(message);
9458
9458
  if (event2) {
9459
9459
  updates.others.push(event2);
9460
9460
  }
9461
9461
  break;
9462
9462
  }
9463
- case 300 /* UPDATE_YDOC */: {
9463
+ case ServerMsgCode.UPDATE_YDOC: {
9464
9464
  eventHub.ydoc.notify(message);
9465
9465
  break;
9466
9466
  }
9467
- case 104 /* ROOM_STATE */: {
9467
+ case ServerMsgCode.ROOM_STATE: {
9468
9468
  updates.others.push(onRoomStateMessage(message));
9469
9469
  break;
9470
9470
  }
9471
- case 200 /* INITIAL_STORAGE_STATE */: {
9471
+ case ServerMsgCode.INITIAL_STORAGE_STATE: {
9472
9472
  processInitialStorage(message);
9473
9473
  break;
9474
9474
  }
9475
9475
  // Write event
9476
- case 201 /* UPDATE_STORAGE */: {
9476
+ case ServerMsgCode.UPDATE_STORAGE: {
9477
9477
  const applyResult = applyOps(message.ops, false);
9478
9478
  for (const [key, value] of applyResult.updates.storageUpdates) {
9479
9479
  updates.storageUpdates.set(
@@ -9487,7 +9487,7 @@ function createRoom(options, config) {
9487
9487
  // longer in sync with the client. Trying to synchronize the client again by
9488
9488
  // rolling back particular Ops may be hard/impossible. It's fine to not try and
9489
9489
  // accept the out-of-sync reality and throw an error.
9490
- case 299 /* REJECT_STORAGE_OP */: {
9490
+ case ServerMsgCode.REJECT_STORAGE_OP: {
9491
9491
  errorWithTitle(
9492
9492
  "Storage mutation rejection error",
9493
9493
  message.reason
@@ -9499,15 +9499,15 @@ function createRoom(options, config) {
9499
9499
  }
9500
9500
  break;
9501
9501
  }
9502
- case 400 /* THREAD_CREATED */:
9503
- case 407 /* THREAD_DELETED */:
9504
- case 401 /* THREAD_METADATA_UPDATED */:
9505
- case 408 /* THREAD_UPDATED */:
9506
- case 405 /* COMMENT_REACTION_ADDED */:
9507
- case 406 /* COMMENT_REACTION_REMOVED */:
9508
- case 402 /* COMMENT_CREATED */:
9509
- case 403 /* COMMENT_EDITED */:
9510
- case 404 /* COMMENT_DELETED */: {
9502
+ case ServerMsgCode.THREAD_CREATED:
9503
+ case ServerMsgCode.THREAD_DELETED:
9504
+ case ServerMsgCode.THREAD_METADATA_UPDATED:
9505
+ case ServerMsgCode.THREAD_UPDATED:
9506
+ case ServerMsgCode.COMMENT_REACTION_ADDED:
9507
+ case ServerMsgCode.COMMENT_REACTION_REMOVED:
9508
+ case ServerMsgCode.COMMENT_CREATED:
9509
+ case ServerMsgCode.COMMENT_EDITED:
9510
+ case ServerMsgCode.COMMENT_DELETED: {
9511
9511
  eventHub.comments.notify(message);
9512
9512
  break;
9513
9513
  }
@@ -9557,14 +9557,14 @@ function createRoom(options, config) {
9557
9557
  if (context.buffer.presenceUpdates) {
9558
9558
  messages.push(
9559
9559
  context.buffer.presenceUpdates.type === "full" ? {
9560
- type: 100 /* UPDATE_PRESENCE */,
9560
+ type: ClientMsgCode.UPDATE_PRESENCE,
9561
9561
  // Populating the `targetActor` field turns this message into
9562
9562
  // a Full Presence™ update message (not a patch), which will get
9563
9563
  // interpreted by other clients as such.
9564
9564
  targetActor: -1,
9565
9565
  data: context.buffer.presenceUpdates.data
9566
9566
  } : {
9567
- type: 100 /* UPDATE_PRESENCE */,
9567
+ type: ClientMsgCode.UPDATE_PRESENCE,
9568
9568
  data: context.buffer.presenceUpdates.data
9569
9569
  }
9570
9570
  );
@@ -9574,7 +9574,7 @@ function createRoom(options, config) {
9574
9574
  }
9575
9575
  if (context.buffer.storageOperations.length > 0) {
9576
9576
  messages.push({
9577
- type: 201 /* UPDATE_STORAGE */,
9577
+ type: ClientMsgCode.UPDATE_STORAGE,
9578
9578
  ops: context.buffer.storageOperations
9579
9579
  });
9580
9580
  }
@@ -9582,7 +9582,7 @@ function createRoom(options, config) {
9582
9582
  }
9583
9583
  function updateYDoc(update, guid, isV2) {
9584
9584
  const clientMsg = {
9585
- type: 301 /* UPDATE_YDOC */,
9585
+ type: ClientMsgCode.UPDATE_YDOC,
9586
9586
  update,
9587
9587
  guid,
9588
9588
  v2: isV2
@@ -9598,7 +9598,7 @@ function createRoom(options, config) {
9598
9598
  return;
9599
9599
  }
9600
9600
  context.buffer.messages.push({
9601
- type: 103 /* BROADCAST_EVENT */,
9601
+ type: ClientMsgCode.BROADCAST_EVENT,
9602
9602
  event
9603
9603
  });
9604
9604
  flushNowOrSoon();
@@ -9616,21 +9616,21 @@ function createRoom(options, config) {
9616
9616
  const unacknowledgedOps = new Map(context.unacknowledgedOps);
9617
9617
  createOrUpdateRootFromMessage(message);
9618
9618
  applyAndSendOps(unacknowledgedOps);
9619
- _optionalChain([_resolveStoragePromise, 'optionalCall', _203 => _203()]);
9619
+ _optionalChain([_resolveStoragePromise, 'optionalCall', _201 => _201()]);
9620
9620
  notifyStorageStatus();
9621
9621
  eventHub.storageDidLoad.notify();
9622
9622
  }
9623
9623
  async function streamStorage() {
9624
9624
  if (!managedSocket.authValue) return;
9625
9625
  const items = await httpClient.streamStorage({ roomId });
9626
- processInitialStorage({ type: 200 /* INITIAL_STORAGE_STATE */, items });
9626
+ processInitialStorage({ type: ServerMsgCode.INITIAL_STORAGE_STATE, items });
9627
9627
  }
9628
9628
  function refreshStorage(options2) {
9629
9629
  const messages = context.buffer.messages;
9630
9630
  if (config.unstable_streamData) {
9631
9631
  void streamStorage();
9632
- } else if (!messages.some((msg) => msg.type === 200 /* FETCH_STORAGE */)) {
9633
- messages.push({ type: 200 /* FETCH_STORAGE */ });
9632
+ } else if (!messages.some((msg) => msg.type === ClientMsgCode.FETCH_STORAGE)) {
9633
+ messages.push({ type: ClientMsgCode.FETCH_STORAGE });
9634
9634
  }
9635
9635
  if (options2.flush) {
9636
9636
  flushNowOrSoon();
@@ -9668,10 +9668,10 @@ function createRoom(options, config) {
9668
9668
  }
9669
9669
  function fetchYDoc(vector, guid, isV2) {
9670
9670
  if (!context.buffer.messages.find((m) => {
9671
- return m.type === 300 /* FETCH_YDOC */ && m.vector === vector && m.guid === guid && m.v2 === isV2;
9671
+ return m.type === ClientMsgCode.FETCH_YDOC && m.vector === vector && m.guid === guid && m.v2 === isV2;
9672
9672
  })) {
9673
9673
  context.buffer.messages.push({
9674
- type: 300 /* FETCH_YDOC */,
9674
+ type: ClientMsgCode.FETCH_YDOC,
9675
9675
  vector,
9676
9676
  guid,
9677
9677
  v2: isV2
@@ -9837,8 +9837,8 @@ function createRoom(options, config) {
9837
9837
  async function getThreads(options2) {
9838
9838
  return httpClient.getThreads({
9839
9839
  roomId,
9840
- query: _optionalChain([options2, 'optionalAccess', _204 => _204.query]),
9841
- cursor: _optionalChain([options2, 'optionalAccess', _205 => _205.cursor])
9840
+ query: _optionalChain([options2, 'optionalAccess', _202 => _202.query]),
9841
+ cursor: _optionalChain([options2, 'optionalAccess', _203 => _203.cursor])
9842
9842
  });
9843
9843
  }
9844
9844
  async function getThread(threadId) {
@@ -9945,7 +9945,7 @@ function createRoom(options, config) {
9945
9945
  function getSubscriptionSettings(options2) {
9946
9946
  return httpClient.getSubscriptionSettings({
9947
9947
  roomId,
9948
- signal: _optionalChain([options2, 'optionalAccess', _206 => _206.signal])
9948
+ signal: _optionalChain([options2, 'optionalAccess', _204 => _204.signal])
9949
9949
  });
9950
9950
  }
9951
9951
  function updateSubscriptionSettings(settings) {
@@ -9967,7 +9967,7 @@ function createRoom(options, config) {
9967
9967
  {
9968
9968
  [kInternal]: {
9969
9969
  get presenceBuffer() {
9970
- return deepClone(_nullishCoalesce(_optionalChain([context, 'access', _207 => _207.buffer, 'access', _208 => _208.presenceUpdates, 'optionalAccess', _209 => _209.data]), () => ( null)));
9970
+ return deepClone(_nullishCoalesce(_optionalChain([context, 'access', _205 => _205.buffer, 'access', _206 => _206.presenceUpdates, 'optionalAccess', _207 => _207.data]), () => ( null)));
9971
9971
  },
9972
9972
  // prettier-ignore
9973
9973
  get undoStack() {
@@ -9982,9 +9982,9 @@ function createRoom(options, config) {
9982
9982
  return context.yjsProvider;
9983
9983
  },
9984
9984
  setYjsProvider(newProvider) {
9985
- _optionalChain([context, 'access', _210 => _210.yjsProvider, 'optionalAccess', _211 => _211.off, 'call', _212 => _212("status", yjsStatusDidChange)]);
9985
+ _optionalChain([context, 'access', _208 => _208.yjsProvider, 'optionalAccess', _209 => _209.off, 'call', _210 => _210("status", yjsStatusDidChange)]);
9986
9986
  context.yjsProvider = newProvider;
9987
- _optionalChain([newProvider, 'optionalAccess', _213 => _213.on, 'call', _214 => _214("status", yjsStatusDidChange)]);
9987
+ _optionalChain([newProvider, 'optionalAccess', _211 => _211.on, 'call', _212 => _212("status", yjsStatusDidChange)]);
9988
9988
  context.yjsProviderDidChange.notify();
9989
9989
  },
9990
9990
  yjsProviderDidChange: context.yjsProviderDidChange.observable,
@@ -10030,7 +10030,7 @@ function createRoom(options, config) {
10030
10030
  source.dispose();
10031
10031
  }
10032
10032
  eventHub.roomWillDestroy.notify();
10033
- _optionalChain([context, 'access', _215 => _215.yjsProvider, 'optionalAccess', _216 => _216.off, 'call', _217 => _217("status", yjsStatusDidChange)]);
10033
+ _optionalChain([context, 'access', _213 => _213.yjsProvider, 'optionalAccess', _214 => _214.off, 'call', _215 => _215("status", yjsStatusDidChange)]);
10034
10034
  syncSourceForStorage.destroy();
10035
10035
  syncSourceForYjs.destroy();
10036
10036
  uninstallBgTabSpy();
@@ -10180,7 +10180,7 @@ function makeClassicSubscribeFn(roomId, events, errorEvents) {
10180
10180
  }
10181
10181
  if (isLiveNode(first)) {
10182
10182
  const node = first;
10183
- if (_optionalChain([options, 'optionalAccess', _218 => _218.isDeep])) {
10183
+ if (_optionalChain([options, 'optionalAccess', _216 => _216.isDeep])) {
10184
10184
  const storageCallback = second;
10185
10185
  return subscribeToLiveStructureDeeply(node, storageCallback);
10186
10186
  } else {
@@ -10260,8 +10260,8 @@ function createClient(options) {
10260
10260
  const userId = token.k === "sec-legacy" /* SECRET_LEGACY */ ? token.id : token.uid;
10261
10261
  currentUserId.set(() => userId);
10262
10262
  });
10263
- const fetchPolyfill = _optionalChain([clientOptions, 'access', _219 => _219.polyfills, 'optionalAccess', _220 => _220.fetch]) || /* istanbul ignore next */
10264
- _optionalChain([globalThis, 'access', _221 => _221.fetch, 'optionalAccess', _222 => _222.bind, 'call', _223 => _223(globalThis)]);
10263
+ const fetchPolyfill = _optionalChain([clientOptions, 'access', _217 => _217.polyfills, 'optionalAccess', _218 => _218.fetch]) || /* istanbul ignore next */
10264
+ _optionalChain([globalThis, 'access', _219 => _219.fetch, 'optionalAccess', _220 => _220.bind, 'call', _221 => _221(globalThis)]);
10265
10265
  const httpClient = createApiClient({
10266
10266
  baseUrl,
10267
10267
  fetchPolyfill,
@@ -10279,7 +10279,7 @@ function createClient(options) {
10279
10279
  delegates: {
10280
10280
  createSocket: makeCreateSocketDelegateForAi(
10281
10281
  baseUrl,
10282
- _optionalChain([clientOptions, 'access', _224 => _224.polyfills, 'optionalAccess', _225 => _225.WebSocket])
10282
+ _optionalChain([clientOptions, 'access', _222 => _222.polyfills, 'optionalAccess', _223 => _223.WebSocket])
10283
10283
  ),
10284
10284
  authenticate: async () => {
10285
10285
  const resp = await authManager.getAuthValue({
@@ -10341,7 +10341,7 @@ function createClient(options) {
10341
10341
  createSocket: makeCreateSocketDelegateForRoom(
10342
10342
  roomId,
10343
10343
  baseUrl,
10344
- _optionalChain([clientOptions, 'access', _226 => _226.polyfills, 'optionalAccess', _227 => _227.WebSocket])
10344
+ _optionalChain([clientOptions, 'access', _224 => _224.polyfills, 'optionalAccess', _225 => _225.WebSocket])
10345
10345
  ),
10346
10346
  authenticate: makeAuthDelegateForRoom(roomId, authManager)
10347
10347
  })),
@@ -10365,7 +10365,7 @@ function createClient(options) {
10365
10365
  const shouldConnect = _nullishCoalesce(options2.autoConnect, () => ( true));
10366
10366
  if (shouldConnect) {
10367
10367
  if (typeof atob === "undefined") {
10368
- if (_optionalChain([clientOptions, 'access', _228 => _228.polyfills, 'optionalAccess', _229 => _229.atob]) === void 0) {
10368
+ if (_optionalChain([clientOptions, 'access', _226 => _226.polyfills, 'optionalAccess', _227 => _227.atob]) === void 0) {
10369
10369
  throw new Error(
10370
10370
  "You need to polyfill atob to use the client in your environment. Please follow the instructions at https://liveblocks.io/docs/errors/liveblocks-client/atob-polyfill"
10371
10371
  );
@@ -10377,7 +10377,7 @@ function createClient(options) {
10377
10377
  return leaseRoom(newRoomDetails);
10378
10378
  }
10379
10379
  function getRoom(roomId) {
10380
- const room = _optionalChain([roomsById, 'access', _230 => _230.get, 'call', _231 => _231(roomId), 'optionalAccess', _232 => _232.room]);
10380
+ const room = _optionalChain([roomsById, 'access', _228 => _228.get, 'call', _229 => _229(roomId), 'optionalAccess', _230 => _230.room]);
10381
10381
  return room ? room : null;
10382
10382
  }
10383
10383
  function logout() {
@@ -10393,7 +10393,7 @@ function createClient(options) {
10393
10393
  const batchedResolveUsers = new Batch(
10394
10394
  async (batchedUserIds) => {
10395
10395
  const userIds = batchedUserIds.flat();
10396
- const users = await _optionalChain([resolveUsers, 'optionalCall', _233 => _233({ userIds })]);
10396
+ const users = await _optionalChain([resolveUsers, 'optionalCall', _231 => _231({ userIds })]);
10397
10397
  warnOnceIf(
10398
10398
  !resolveUsers,
10399
10399
  "Set the resolveUsers option in createClient to specify user info."
@@ -10410,7 +10410,7 @@ function createClient(options) {
10410
10410
  const batchedResolveRoomsInfo = new Batch(
10411
10411
  async (batchedRoomIds) => {
10412
10412
  const roomIds = batchedRoomIds.flat();
10413
- const roomsInfo = await _optionalChain([resolveRoomsInfo, 'optionalCall', _234 => _234({ roomIds })]);
10413
+ const roomsInfo = await _optionalChain([resolveRoomsInfo, 'optionalCall', _232 => _232({ roomIds })]);
10414
10414
  warnOnceIf(
10415
10415
  !resolveRoomsInfo,
10416
10416
  "Set the resolveRoomsInfo option in createClient to specify room info."
@@ -10427,7 +10427,7 @@ function createClient(options) {
10427
10427
  const batchedResolveGroupsInfo = new Batch(
10428
10428
  async (batchedGroupIds) => {
10429
10429
  const groupIds = batchedGroupIds.flat();
10430
- const groupsInfo = await _optionalChain([resolveGroupsInfo, 'optionalCall', _235 => _235({ groupIds })]);
10430
+ const groupsInfo = await _optionalChain([resolveGroupsInfo, 'optionalCall', _233 => _233({ groupIds })]);
10431
10431
  warnOnceIf(
10432
10432
  !resolveGroupsInfo,
10433
10433
  "Set the resolveGroupsInfo option in createClient to specify group info."
@@ -10483,7 +10483,7 @@ function createClient(options) {
10483
10483
  }
10484
10484
  };
10485
10485
  const win = typeof window !== "undefined" ? window : void 0;
10486
- _optionalChain([win, 'optionalAccess', _236 => _236.addEventListener, 'call', _237 => _237("beforeunload", maybePreventClose)]);
10486
+ _optionalChain([win, 'optionalAccess', _234 => _234.addEventListener, 'call', _235 => _235("beforeunload", maybePreventClose)]);
10487
10487
  }
10488
10488
  async function getNotificationSettings(options2) {
10489
10489
  const plainSettings = await httpClient.getNotificationSettings(options2);
@@ -10610,7 +10610,7 @@ var commentBodyElementsTypes = {
10610
10610
  mention: "inline"
10611
10611
  };
10612
10612
  function traverseCommentBody(body, elementOrVisitor, possiblyVisitor) {
10613
- if (!body || !_optionalChain([body, 'optionalAccess', _238 => _238.content])) {
10613
+ if (!body || !_optionalChain([body, 'optionalAccess', _236 => _236.content])) {
10614
10614
  return;
10615
10615
  }
10616
10616
  const element = typeof elementOrVisitor === "string" ? elementOrVisitor : void 0;
@@ -10620,13 +10620,13 @@ function traverseCommentBody(body, elementOrVisitor, possiblyVisitor) {
10620
10620
  for (const block of body.content) {
10621
10621
  if (type === "all" || type === "block") {
10622
10622
  if (guard(block)) {
10623
- _optionalChain([visitor, 'optionalCall', _239 => _239(block)]);
10623
+ _optionalChain([visitor, 'optionalCall', _237 => _237(block)]);
10624
10624
  }
10625
10625
  }
10626
10626
  if (type === "all" || type === "inline") {
10627
10627
  for (const inline of block.children) {
10628
10628
  if (guard(inline)) {
10629
- _optionalChain([visitor, 'optionalCall', _240 => _240(inline)]);
10629
+ _optionalChain([visitor, 'optionalCall', _238 => _238(inline)]);
10630
10630
  }
10631
10631
  }
10632
10632
  }
@@ -10796,7 +10796,7 @@ var stringifyCommentBodyPlainElements = {
10796
10796
  text: ({ element }) => element.text,
10797
10797
  link: ({ element }) => _nullishCoalesce(element.text, () => ( element.url)),
10798
10798
  mention: ({ element, user, group }) => {
10799
- return `@${_nullishCoalesce(_nullishCoalesce(_optionalChain([user, 'optionalAccess', _241 => _241.name]), () => ( _optionalChain([group, 'optionalAccess', _242 => _242.name]))), () => ( element.id))}`;
10799
+ return `@${_nullishCoalesce(_nullishCoalesce(_optionalChain([user, 'optionalAccess', _239 => _239.name]), () => ( _optionalChain([group, 'optionalAccess', _240 => _240.name]))), () => ( element.id))}`;
10800
10800
  }
10801
10801
  };
10802
10802
  var stringifyCommentBodyHtmlElements = {
@@ -10826,7 +10826,7 @@ var stringifyCommentBodyHtmlElements = {
10826
10826
  return html`<a href="${href}" target="_blank" rel="noopener noreferrer">${element.text ? html`${element.text}` : element.url}</a>`;
10827
10827
  },
10828
10828
  mention: ({ element, user, group }) => {
10829
- return html`<span data-mention>@${_optionalChain([user, 'optionalAccess', _243 => _243.name]) ? html`${_optionalChain([user, 'optionalAccess', _244 => _244.name])}` : _optionalChain([group, 'optionalAccess', _245 => _245.name]) ? html`${_optionalChain([group, 'optionalAccess', _246 => _246.name])}` : element.id}</span>`;
10829
+ return html`<span data-mention>@${_optionalChain([user, 'optionalAccess', _241 => _241.name]) ? html`${_optionalChain([user, 'optionalAccess', _242 => _242.name])}` : _optionalChain([group, 'optionalAccess', _243 => _243.name]) ? html`${_optionalChain([group, 'optionalAccess', _244 => _244.name])}` : element.id}</span>`;
10830
10830
  }
10831
10831
  };
10832
10832
  var stringifyCommentBodyMarkdownElements = {
@@ -10856,20 +10856,20 @@ var stringifyCommentBodyMarkdownElements = {
10856
10856
  return markdown`[${_nullishCoalesce(element.text, () => ( element.url))}](${href})`;
10857
10857
  },
10858
10858
  mention: ({ element, user, group }) => {
10859
- return markdown`@${_nullishCoalesce(_nullishCoalesce(_optionalChain([user, 'optionalAccess', _247 => _247.name]), () => ( _optionalChain([group, 'optionalAccess', _248 => _248.name]))), () => ( element.id))}`;
10859
+ return markdown`@${_nullishCoalesce(_nullishCoalesce(_optionalChain([user, 'optionalAccess', _245 => _245.name]), () => ( _optionalChain([group, 'optionalAccess', _246 => _246.name]))), () => ( element.id))}`;
10860
10860
  }
10861
10861
  };
10862
10862
  async function stringifyCommentBody(body, options) {
10863
- const format = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _249 => _249.format]), () => ( "plain"));
10864
- const separator = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _250 => _250.separator]), () => ( (format === "markdown" ? "\n\n" : "\n")));
10863
+ const format = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _247 => _247.format]), () => ( "plain"));
10864
+ const separator = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _248 => _248.separator]), () => ( (format === "markdown" ? "\n\n" : "\n")));
10865
10865
  const elements = {
10866
10866
  ...format === "html" ? stringifyCommentBodyHtmlElements : format === "markdown" ? stringifyCommentBodyMarkdownElements : stringifyCommentBodyPlainElements,
10867
- ..._optionalChain([options, 'optionalAccess', _251 => _251.elements])
10867
+ ..._optionalChain([options, 'optionalAccess', _249 => _249.elements])
10868
10868
  };
10869
10869
  const { users: resolvedUsers, groups: resolvedGroupsInfo } = await resolveMentionsInCommentBody(
10870
10870
  body,
10871
- _optionalChain([options, 'optionalAccess', _252 => _252.resolveUsers]),
10872
- _optionalChain([options, 'optionalAccess', _253 => _253.resolveGroupsInfo])
10871
+ _optionalChain([options, 'optionalAccess', _250 => _250.resolveUsers]),
10872
+ _optionalChain([options, 'optionalAccess', _251 => _251.resolveGroupsInfo])
10873
10873
  );
10874
10874
  const blocks = body.content.flatMap((block, blockIndex) => {
10875
10875
  switch (block.type) {
@@ -11156,12 +11156,12 @@ function legacy_patchImmutableNode(state, path, update) {
11156
11156
  }
11157
11157
  const newState = Object.assign({}, state);
11158
11158
  for (const key in update.updates) {
11159
- if (_optionalChain([update, 'access', _254 => _254.updates, 'access', _255 => _255[key], 'optionalAccess', _256 => _256.type]) === "update") {
11159
+ if (_optionalChain([update, 'access', _252 => _252.updates, 'access', _253 => _253[key], 'optionalAccess', _254 => _254.type]) === "update") {
11160
11160
  const val = update.node.get(key);
11161
11161
  if (val !== void 0) {
11162
11162
  newState[key] = lsonToJson(val);
11163
11163
  }
11164
- } else if (_optionalChain([update, 'access', _257 => _257.updates, 'access', _258 => _258[key], 'optionalAccess', _259 => _259.type]) === "delete") {
11164
+ } else if (_optionalChain([update, 'access', _255 => _255.updates, 'access', _256 => _256[key], 'optionalAccess', _257 => _257.type]) === "delete") {
11165
11165
  delete newState[key];
11166
11166
  }
11167
11167
  }
@@ -11222,12 +11222,12 @@ function legacy_patchImmutableNode(state, path, update) {
11222
11222
  }
11223
11223
  const newState = Object.assign({}, state);
11224
11224
  for (const key in update.updates) {
11225
- if (_optionalChain([update, 'access', _260 => _260.updates, 'access', _261 => _261[key], 'optionalAccess', _262 => _262.type]) === "update") {
11225
+ if (_optionalChain([update, 'access', _258 => _258.updates, 'access', _259 => _259[key], 'optionalAccess', _260 => _260.type]) === "update") {
11226
11226
  const value = update.node.get(key);
11227
11227
  if (value !== void 0) {
11228
11228
  newState[key] = lsonToJson(value);
11229
11229
  }
11230
- } else if (_optionalChain([update, 'access', _263 => _263.updates, 'access', _264 => _264[key], 'optionalAccess', _265 => _265.type]) === "delete") {
11230
+ } else if (_optionalChain([update, 'access', _261 => _261.updates, 'access', _262 => _262[key], 'optionalAccess', _263 => _263.type]) === "delete") {
11231
11231
  delete newState[key];
11232
11232
  }
11233
11233
  }
@@ -11307,9 +11307,9 @@ function makePoller(callback, intervalMs, options) {
11307
11307
  const startTime = performance.now();
11308
11308
  const doc = typeof document !== "undefined" ? document : void 0;
11309
11309
  const win = typeof window !== "undefined" ? window : void 0;
11310
- const maxStaleTimeMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _266 => _266.maxStaleTimeMs]), () => ( Number.POSITIVE_INFINITY));
11310
+ const maxStaleTimeMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _264 => _264.maxStaleTimeMs]), () => ( Number.POSITIVE_INFINITY));
11311
11311
  const context = {
11312
- inForeground: _optionalChain([doc, 'optionalAccess', _267 => _267.visibilityState]) !== "hidden",
11312
+ inForeground: _optionalChain([doc, 'optionalAccess', _265 => _265.visibilityState]) !== "hidden",
11313
11313
  lastSuccessfulPollAt: startTime,
11314
11314
  count: 0,
11315
11315
  backoff: 0
@@ -11390,11 +11390,11 @@ function makePoller(callback, intervalMs, options) {
11390
11390
  pollNowIfStale();
11391
11391
  }
11392
11392
  function onVisibilityChange() {
11393
- setInForeground(_optionalChain([doc, 'optionalAccess', _268 => _268.visibilityState]) !== "hidden");
11393
+ setInForeground(_optionalChain([doc, 'optionalAccess', _266 => _266.visibilityState]) !== "hidden");
11394
11394
  }
11395
- _optionalChain([doc, 'optionalAccess', _269 => _269.addEventListener, 'call', _270 => _270("visibilitychange", onVisibilityChange)]);
11396
- _optionalChain([win, 'optionalAccess', _271 => _271.addEventListener, 'call', _272 => _272("online", onVisibilityChange)]);
11397
- _optionalChain([win, 'optionalAccess', _273 => _273.addEventListener, 'call', _274 => _274("focus", pollNowIfStale)]);
11395
+ _optionalChain([doc, 'optionalAccess', _267 => _267.addEventListener, 'call', _268 => _268("visibilitychange", onVisibilityChange)]);
11396
+ _optionalChain([win, 'optionalAccess', _269 => _269.addEventListener, 'call', _270 => _270("online", onVisibilityChange)]);
11397
+ _optionalChain([win, 'optionalAccess', _271 => _271.addEventListener, 'call', _272 => _272("focus", pollNowIfStale)]);
11398
11398
  fsm.start();
11399
11399
  return {
11400
11400
  inc,
@@ -11526,6 +11526,5 @@ detectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);
11526
11526
 
11527
11527
 
11528
11528
 
11529
-
11530
- exports.ClientMsgCode = ClientMsgCode; exports.CrdtType = CrdtType; exports.DefaultMap = DefaultMap; exports.Deque = Deque; exports.DerivedSignal = DerivedSignal; exports.HttpError = HttpError; exports.LiveList = LiveList; exports.LiveMap = LiveMap; exports.LiveObject = LiveObject; exports.LiveblocksError = LiveblocksError; exports.MENTION_CHARACTER = MENTION_CHARACTER; exports.MutableSignal = MutableSignal; exports.OpCode = OpCode; exports.Permission = Permission; exports.Promise_withResolvers = Promise_withResolvers; exports.ServerMsgCode = ServerMsgCode; exports.Signal = Signal; exports.SortedList = SortedList; exports.TextEditorType = TextEditorType; exports.WebsocketCloseCodes = WebsocketCloseCodes; exports.ackOp = ackOp; exports.asPos = asPos; exports.assert = assert; exports.assertNever = assertNever; exports.autoRetry = autoRetry; exports.b64decode = b64decode; exports.batch = batch; exports.checkBounds = checkBounds; exports.chunk = chunk; exports.cloneLson = cloneLson; exports.compactObject = compactObject; exports.console = fancy_console_exports; exports.convertToCommentData = convertToCommentData; exports.convertToCommentUserReaction = convertToCommentUserReaction; exports.convertToGroupData = convertToGroupData; exports.convertToInboxNotificationData = convertToInboxNotificationData; exports.convertToSubscriptionData = convertToSubscriptionData; exports.convertToThreadData = convertToThreadData; exports.convertToUserSubscriptionData = convertToUserSubscriptionData; exports.createClient = createClient; exports.createCommentAttachmentId = createCommentAttachmentId; exports.createCommentId = createCommentId; exports.createInboxNotificationId = createInboxNotificationId; exports.createManagedPool = createManagedPool; exports.createNotificationSettings = createNotificationSettings; exports.createThreadId = createThreadId; exports.defineAiTool = defineAiTool; exports.deprecate = deprecate; exports.deprecateIf = deprecateIf; exports.detectDupes = detectDupes; exports.entries = entries; exports.errorIf = errorIf; exports.findLastIndex = findLastIndex; exports.freeze = freeze; exports.generateUrl = generateUrl; exports.getMentionsFromCommentBody = getMentionsFromCommentBody; exports.getSubscriptionKey = getSubscriptionKey; exports.html = html; exports.htmlSafe = htmlSafe; exports.isCommentBodyLink = isCommentBodyLink; exports.isCommentBodyMention = isCommentBodyMention; exports.isCommentBodyText = isCommentBodyText; exports.isJsonArray = isJsonArray; exports.isJsonObject = isJsonObject; exports.isJsonScalar = isJsonScalar; exports.isLiveNode = isLiveNode; exports.isNotificationChannelEnabled = isNotificationChannelEnabled; exports.isNumberOperator = isNumberOperator; exports.isPlainObject = isPlainObject; exports.isStartsWithOperator = isStartsWithOperator; exports.isUrl = isUrl; exports.kInternal = kInternal; exports.keys = keys; exports.legacy_patchImmutableObject = legacy_patchImmutableObject; exports.lsonToJson = lsonToJson; exports.makeAbortController = makeAbortController; exports.makeEventSource = makeEventSource; exports.makePoller = makePoller; exports.makePosition = makePosition; exports.mapValues = mapValues; exports.memoizeOnSuccess = memoizeOnSuccess; exports.nanoid = nanoid; exports.nn = nn; exports.objectToQuery = objectToQuery; exports.patchLiveObjectKey = patchLiveObjectKey; exports.patchNotificationSettings = patchNotificationSettings; exports.raise = raise; exports.resolveMentionsInCommentBody = resolveMentionsInCommentBody; exports.sanitizeUrl = sanitizeUrl; exports.shallow = shallow; exports.shallow2 = shallow2; exports.stableStringify = stableStringify; exports.stringifyCommentBody = stringifyCommentBody; exports.throwUsageError = throwUsageError; exports.toPlainLson = toPlainLson; exports.tryParseJson = tryParseJson; exports.url = url; exports.urljoin = urljoin; exports.wait = wait; exports.warnOnce = warnOnce; exports.warnOnceIf = warnOnceIf; exports.withTimeout = withTimeout;
11529
+ exports.ClientMsgCode = ClientMsgCode; exports.CrdtType = CrdtType; exports.DefaultMap = DefaultMap; exports.Deque = Deque; exports.DerivedSignal = DerivedSignal; exports.HttpError = HttpError; exports.LiveList = LiveList; exports.LiveMap = LiveMap; exports.LiveObject = LiveObject; exports.LiveblocksError = LiveblocksError; exports.MENTION_CHARACTER = MENTION_CHARACTER; exports.MutableSignal = MutableSignal; exports.OpCode = OpCode; exports.Permission = Permission; exports.Promise_withResolvers = Promise_withResolvers; exports.ServerMsgCode = ServerMsgCode; exports.Signal = Signal; exports.SortedList = SortedList; exports.TextEditorType = TextEditorType; exports.WebsocketCloseCodes = WebsocketCloseCodes; exports.asPos = asPos; exports.assert = assert; exports.assertNever = assertNever; exports.autoRetry = autoRetry; exports.b64decode = b64decode; exports.batch = batch; exports.checkBounds = checkBounds; exports.chunk = chunk; exports.cloneLson = cloneLson; exports.compactObject = compactObject; exports.console = fancy_console_exports; exports.convertToCommentData = convertToCommentData; exports.convertToCommentUserReaction = convertToCommentUserReaction; exports.convertToGroupData = convertToGroupData; exports.convertToInboxNotificationData = convertToInboxNotificationData; exports.convertToSubscriptionData = convertToSubscriptionData; exports.convertToThreadData = convertToThreadData; exports.convertToUserSubscriptionData = convertToUserSubscriptionData; exports.createClient = createClient; exports.createCommentAttachmentId = createCommentAttachmentId; exports.createCommentId = createCommentId; exports.createInboxNotificationId = createInboxNotificationId; exports.createManagedPool = createManagedPool; exports.createNotificationSettings = createNotificationSettings; exports.createThreadId = createThreadId; exports.defineAiTool = defineAiTool; exports.deprecate = deprecate; exports.deprecateIf = deprecateIf; exports.detectDupes = detectDupes; exports.entries = entries; exports.errorIf = errorIf; exports.findLastIndex = findLastIndex; exports.freeze = freeze; exports.generateUrl = generateUrl; exports.getMentionsFromCommentBody = getMentionsFromCommentBody; exports.getSubscriptionKey = getSubscriptionKey; exports.html = html; exports.htmlSafe = htmlSafe; exports.isCommentBodyLink = isCommentBodyLink; exports.isCommentBodyMention = isCommentBodyMention; exports.isCommentBodyText = isCommentBodyText; exports.isJsonArray = isJsonArray; exports.isJsonObject = isJsonObject; exports.isJsonScalar = isJsonScalar; exports.isLiveNode = isLiveNode; exports.isNotificationChannelEnabled = isNotificationChannelEnabled; exports.isNumberOperator = isNumberOperator; exports.isPlainObject = isPlainObject; exports.isStartsWithOperator = isStartsWithOperator; exports.isUrl = isUrl; exports.kInternal = kInternal; exports.keys = keys; exports.legacy_patchImmutableObject = legacy_patchImmutableObject; exports.lsonToJson = lsonToJson; exports.makeAbortController = makeAbortController; exports.makeEventSource = makeEventSource; exports.makePoller = makePoller; exports.makePosition = makePosition; exports.mapValues = mapValues; exports.memoizeOnSuccess = memoizeOnSuccess; exports.nanoid = nanoid; exports.nn = nn; exports.objectToQuery = objectToQuery; exports.patchLiveObjectKey = patchLiveObjectKey; exports.patchNotificationSettings = patchNotificationSettings; exports.raise = raise; exports.resolveMentionsInCommentBody = resolveMentionsInCommentBody; exports.sanitizeUrl = sanitizeUrl; exports.shallow = shallow; exports.shallow2 = shallow2; exports.stableStringify = stableStringify; exports.stringifyCommentBody = stringifyCommentBody; exports.throwUsageError = throwUsageError; exports.toPlainLson = toPlainLson; exports.tryParseJson = tryParseJson; exports.url = url; exports.urljoin = urljoin; exports.wait = wait; exports.warnOnce = warnOnce; exports.warnOnceIf = warnOnceIf; exports.withTimeout = withTimeout;
11531
11530
  //# sourceMappingURL=index.cjs.map