@webex/internal-media-core 0.0.8-beta → 0.0.11-beta

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/esm/index.js CHANGED
@@ -4281,70 +4281,7 @@ function appendToH264fmtpParams(sdp, paramsToAppend) {
4281
4281
  }
4282
4282
 
4283
4283
  function setH264MaxFs(sdp, maxFsValue) {
4284
- var maxFsForProfileLevel = {
4285
- 10: 99,
4286
- 11: 396,
4287
- 12: 396,
4288
- 13: 396,
4289
- 20: 396,
4290
- 21: 792,
4291
- 22: 1620,
4292
- 30: 1620,
4293
- 31: 3600,
4294
- 32: 5120,
4295
- 40: 8192,
4296
- 41: 8192,
4297
- 42: 8704,
4298
- 50: 22080,
4299
- 51: 36864,
4300
- 52: 36864,
4301
- 60: 139264,
4302
- 61: 139264,
4303
- 62: 139264
4304
- };
4305
- sdp.avMedia.forEach(media => {
4306
- if (media.type === 'video') {
4307
- media.codecs.forEach(codec => {
4308
- var _codec$name3;
4309
-
4310
- if (((_codec$name3 = codec.name) === null || _codec$name3 === void 0 ? void 0 : _codec$name3.toUpperCase()) === 'H264') {
4311
- codec.fmtParams = codec.fmtParams.map(fmtp => {
4312
- var parsedRegex = fmtp.match(/(.*)profile-level-id=(\w{4})(\w{2})(.*)/);
4313
-
4314
- if (parsedRegex && parsedRegex.length === 5) {
4315
- var stuffBeforeProfileLevelId = parsedRegex[1];
4316
- var profile = parsedRegex[2].toLowerCase();
4317
- var levelId = parseInt(parsedRegex[3], 16);
4318
- var stuffAfterProfileLevelId = parsedRegex[4];
4319
-
4320
- if (!maxFsForProfileLevel[levelId]) {
4321
- throw new Error("found unsupported h264 profile level id value in the SDP: ".concat(levelId));
4322
- }
4323
-
4324
- if (maxFsForProfileLevel[levelId] === maxFsValue) {
4325
- return fmtp;
4326
- }
4327
-
4328
- if (maxFsForProfileLevel[levelId] < maxFsValue) {
4329
- return "".concat(fmtp, ";max-fs=").concat(maxFsValue);
4330
- }
4331
-
4332
- var newLevelId = Object.keys(maxFsForProfileLevel).reverse().find(key => maxFsForProfileLevel[key] === maxFsValue);
4333
-
4334
- if (newLevelId) {
4335
- var newLevelIdHex = parseInt(newLevelId, 10).toString(16);
4336
- return "".concat(stuffBeforeProfileLevelId, "profile-level-id=").concat(profile).concat(newLevelIdHex).concat(stuffAfterProfileLevelId);
4337
- }
4338
-
4339
- throw new Error("unsupported maxFsValue: ".concat(maxFsValue));
4340
- }
4341
-
4342
- return fmtp;
4343
- });
4344
- }
4345
- });
4346
- }
4347
- });
4284
+ appendToH264fmtpParams(sdp, "max-fs=".concat(maxFsValue));
4348
4285
  }
4349
4286
 
4350
4287
  function disableRtx(sdp) {
@@ -4500,8 +4437,8 @@ class MediaConnection$1 extends EventEmitter {
4500
4437
  _defineProperty(this, "lastEmittedMediaConnectionState", void 0);
4501
4438
 
4502
4439
  this.config = mediaConnectionConfig;
4503
- this.receiveOptions = _objectSpread$1({}, options.receive);
4504
- this.localTracks = _objectSpread$1({}, options.send);
4440
+ this.receiveOptions = options.receive;
4441
+ this.localTracks = options.send;
4505
4442
  this.id = debugId || 'MediaConnection';
4506
4443
  this.transceivers = {};
4507
4444
  this.mediaConnectionState = ConnectionState.NEW;
@@ -4518,10 +4455,6 @@ class MediaConnection$1 extends EventEmitter {
4518
4455
  getLogger().info("".concat(this.id, ":").concat(action, " ").concat(description));
4519
4456
  }
4520
4457
 
4521
- warn(action, description) {
4522
- getLogger().warn("".concat(this.id, ":").concat(action, " ").concat(description));
4523
- }
4524
-
4525
4458
  error(action, description, error) {
4526
4459
  getLogger().error("".concat(this.id, ":").concat(action, " ").concat(description, " ").concat(getErrorDescription(error)));
4527
4460
  }
@@ -4579,20 +4512,9 @@ class MediaConnection$1 extends EventEmitter {
4579
4512
  };
4580
4513
  }
4581
4514
 
4582
- updateRemoteQualityLevel(newValue) {
4583
- if (newValue !== this.receiveOptions.remoteQualityLevel) {
4584
- this.receiveOptions.remoteQualityLevel = newValue;
4585
- return true;
4586
- }
4587
-
4588
- return false;
4589
- }
4590
-
4591
4515
  updateTransceivers(options) {
4592
4516
  var newOfferNeeded = false;
4593
- this.receiveOptions.audio = options.receive.audio;
4594
- this.receiveOptions.video = options.receive.video;
4595
- this.receiveOptions.screenShareVideo = options.receive.screenShareVideo;
4517
+ this.receiveOptions = options.receive;
4596
4518
  this.identifyTransceivers();
4597
4519
  localTrackTypes.forEach(_ref2 => {
4598
4520
  var {
@@ -4634,34 +4556,14 @@ class MediaConnection$1 extends EventEmitter {
4634
4556
  }
4635
4557
 
4636
4558
  updateReceiveOptions(options) {
4637
- var sdpNegotiationNeeded = false;
4638
-
4639
- if (this.updateRemoteQualityLevel(options.remoteQualityLevel)) {
4640
- sdpNegotiationNeeded = true;
4641
- }
4642
-
4643
- if (this.updateTransceivers({
4559
+ return this.updateTransceivers({
4644
4560
  send: this.localTracks,
4645
4561
  receive: options
4646
- })) {
4647
- sdpNegotiationNeeded = true;
4648
- }
4649
-
4650
- return sdpNegotiationNeeded;
4562
+ });
4651
4563
  }
4652
4564
 
4653
4565
  updateSendReceiveOptions(options) {
4654
- var sdpNegotiationNeeded = false;
4655
-
4656
- if (this.updateRemoteQualityLevel(options.receive.remoteQualityLevel)) {
4657
- sdpNegotiationNeeded = true;
4658
- }
4659
-
4660
- if (this.updateTransceivers(options)) {
4661
- sdpNegotiationNeeded = true;
4662
- }
4663
-
4664
- return sdpNegotiationNeeded;
4566
+ return this.updateTransceivers(options);
4665
4567
  }
4666
4568
 
4667
4569
  getConnectionState() {
@@ -4877,43 +4779,18 @@ class MediaConnection$1 extends EventEmitter {
4877
4779
  }
4878
4780
  }
4879
4781
 
4880
- createSdpMungingConfig() {
4881
- if (this.receiveOptions.remoteQualityLevel) {
4882
- var maxFsValues = {
4883
- LOW: 1620,
4884
- MEDIUM: 3600,
4885
- HIGH: 8192
4886
- };
4887
-
4888
- if (!maxFsValues[this.receiveOptions.remoteQualityLevel]) {
4889
- throw new Error("invalid value for receiveOptions.remoteQualityLevel: ".concat(this.receiveOptions.remoteQualityLevel));
4890
- }
4891
-
4892
- if (this.config.sdpMunging.h264MaxFs) {
4893
- this.warn('createSdpMungingConfig', 'conflict: both config.sdpMunging.h264MaxFs and receiveOptions.remoteQualityLevel are set, remoteQualityLevel will override the config');
4894
- }
4895
-
4896
- return _objectSpread$1(_objectSpread$1({}, this.config.sdpMunging), {}, {
4897
- h264MaxFs: maxFsValues[this.receiveOptions.remoteQualityLevel]
4898
- });
4899
- }
4900
-
4901
- return this.config.sdpMunging;
4902
- }
4903
-
4904
4782
  createLocalOffer() {
4905
- var sdpMungingConfig = this.createSdpMungingConfig();
4906
4783
  return this.pc.createOffer().then(description => {
4907
4784
  this.log('createLocalOffer', 'local SDP offer created');
4908
4785
  var mungedDescription = {
4909
4786
  type: description.type,
4910
- sdp: mungeLocalSdpForBrowser(sdpMungingConfig, (description === null || description === void 0 ? void 0 : description.sdp) || '')
4787
+ sdp: mungeLocalSdpForBrowser(this.config.sdpMunging, (description === null || description === void 0 ? void 0 : description.sdp) || '')
4911
4788
  };
4912
4789
  return this.pc.setLocalDescription(mungedDescription);
4913
4790
  }).then(() => this.waitForIceCandidates()).then(() => {
4914
4791
  var _this$pc$localDescrip;
4915
4792
 
4916
- var mungedSdp = mungeLocalSdp(sdpMungingConfig, ((_this$pc$localDescrip = this.pc.localDescription) === null || _this$pc$localDescrip === void 0 ? void 0 : _this$pc$localDescrip.sdp) || '');
4793
+ var mungedSdp = mungeLocalSdp(this.config.sdpMunging, ((_this$pc$localDescrip = this.pc.localDescription) === null || _this$pc$localDescrip === void 0 ? void 0 : _this$pc$localDescrip.sdp) || '');
4917
4794
  return {
4918
4795
  sdp: mungedSdp
4919
4796
  };
@@ -4928,20 +4805,19 @@ class MediaConnection$1 extends EventEmitter {
4928
4805
  }
4929
4806
 
4930
4807
  var mungedRemoteSdp = mungeRemoteSdp(this.config.sdpMunging, sdp);
4931
- var sdpMungingConfig = this.createSdpMungingConfig();
4932
4808
  return this.pc.setRemoteDescription(new window.RTCSessionDescription({
4933
4809
  type: 'offer',
4934
4810
  sdp: mungedRemoteSdp
4935
4811
  })).then(() => this.pc.createAnswer()).then(answer => {
4936
4812
  var mungedAnswer = {
4937
4813
  type: answer.type,
4938
- sdp: mungeLocalSdpForBrowser(sdpMungingConfig, (answer === null || answer === void 0 ? void 0 : answer.sdp) || '')
4814
+ sdp: mungeLocalSdpForBrowser(this.config.sdpMunging, (answer === null || answer === void 0 ? void 0 : answer.sdp) || '')
4939
4815
  };
4940
4816
  return this.pc.setLocalDescription(mungedAnswer);
4941
4817
  }).then(() => this.waitForIceCandidates()).then(() => {
4942
4818
  var _this$pc$localDescrip2;
4943
4819
 
4944
- var mungedLocalSdp = mungeLocalSdp(sdpMungingConfig, ((_this$pc$localDescrip2 = this.pc.localDescription) === null || _this$pc$localDescrip2 === void 0 ? void 0 : _this$pc$localDescrip2.sdp) || '');
4820
+ var mungedLocalSdp = mungeLocalSdp(this.config.sdpMunging, ((_this$pc$localDescrip2 = this.pc.localDescription) === null || _this$pc$localDescrip2 === void 0 ? void 0 : _this$pc$localDescrip2.sdp) || '');
4945
4821
  return {
4946
4822
  sdp: mungedLocalSdp
4947
4823
  };
@@ -5209,7 +5085,7 @@ function detectBrowser(window) {
5209
5085
  // Firefox.
5210
5086
  result.browser = 'firefox';
5211
5087
  result.version = extractVersion(navigator.userAgent, /Firefox\/(\d+)\./, 1);
5212
- } else if (navigator.webkitGetUserMedia || window.isSecureContext === false && window.webkitRTCPeerConnection) {
5088
+ } else if (navigator.webkitGetUserMedia || window.isSecureContext === false && window.webkitRTCPeerConnection && !window.RTCIceGatherer) {
5213
5089
  // Chrome, Chromium, Webview, Opera.
5214
5090
  // Version matches Chrome/WebRTC version.
5215
5091
  // Chrome 74 removed webkitGetUserMedia on http as well so we need the
@@ -6569,20 +6445,13 @@ function shimAddTransceiver(window) {
6569
6445
 
6570
6446
  if (origAddTransceiver) {
6571
6447
  window.RTCPeerConnection.prototype.addTransceiver = function addTransceiver() {
6572
- this.setParametersPromises = []; // WebIDL input coercion and validation
6573
-
6574
- var sendEncodings = arguments[1] && arguments[1].sendEncodings;
6575
-
6576
- if (sendEncodings === undefined) {
6577
- sendEncodings = [];
6578
- }
6579
-
6580
- sendEncodings = [...sendEncodings];
6581
- var shouldPerformCheck = sendEncodings.length > 0;
6448
+ this.setParametersPromises = [];
6449
+ var initParameters = arguments[1];
6450
+ var shouldPerformCheck = initParameters && 'sendEncodings' in initParameters;
6582
6451
 
6583
6452
  if (shouldPerformCheck) {
6584
6453
  // If sendEncodings params are provided, validate grammar
6585
- sendEncodings.forEach(encodingParam => {
6454
+ initParameters.sendEncodings.forEach(encodingParam => {
6586
6455
  if ('rid' in encodingParam) {
6587
6456
  var ridRegex = /^[a-z0-9]{0,16}$/i;
6588
6457
 
@@ -6622,8 +6491,8 @@ function shimAddTransceiver(window) {
6622
6491
 
6623
6492
  if (!('encodings' in params) || // Avoid being fooled by patched getParameters() below.
6624
6493
  params.encodings.length === 1 && Object.keys(params.encodings[0]).length === 0) {
6625
- params.encodings = sendEncodings;
6626
- sender.sendEncodings = sendEncodings;
6494
+ params.encodings = initParameters.sendEncodings;
6495
+ sender.sendEncodings = initParameters.sendEncodings;
6627
6496
  this.setParametersPromises.push(sender.setParameters(params).then(() => {
6628
6497
  delete sender.sendEncodings;
6629
6498
  }).catch(() => {
@@ -9575,52 +9444,20 @@ function error(id, data) {
9575
9444
  return eventObject;
9576
9445
  }
9577
9446
 
9578
- var pluckAssigns = function pluckAssigns(actionBlocks) {
9579
- var e_1, _a;
9580
-
9581
- var assignActions = [];
9582
-
9583
- try {
9584
- for (var actionBlocks_1 = __values(actionBlocks), actionBlocks_1_1 = actionBlocks_1.next(); !actionBlocks_1_1.done; actionBlocks_1_1 = actionBlocks_1.next()) {
9585
- var block = actionBlocks_1_1.value;
9586
- var i = 0;
9587
-
9588
- while (i < block.length) {
9589
- if (block[i].type === assign$2) {
9590
- assignActions.push(block[i]);
9591
- block.splice(i, 1);
9592
- continue;
9593
- }
9594
-
9595
- i++;
9596
- }
9597
- }
9598
- } catch (e_1_1) {
9599
- e_1 = {
9600
- error: e_1_1
9601
- };
9602
- } finally {
9603
- try {
9604
- if (actionBlocks_1_1 && !actionBlocks_1_1.done && (_a = actionBlocks_1.return)) _a.call(actionBlocks_1);
9605
- } finally {
9606
- if (e_1) throw e_1.error;
9607
- }
9608
- }
9609
-
9610
- return assignActions;
9611
- };
9612
-
9613
- function resolveActions(machine, currentState, currentContext, _event, actionBlocks, predictableExec, preserveActionOrder) {
9447
+ function resolveActions(machine, currentState, currentContext, _event, actions, predictableExec, preserveActionOrder) {
9614
9448
  if (preserveActionOrder === void 0) {
9615
9449
  preserveActionOrder = false;
9616
9450
  }
9617
9451
 
9618
- var assignActions = preserveActionOrder ? [] : pluckAssigns(actionBlocks);
9452
+ var _a = __read(preserveActionOrder ? [[], actions] : partition(actions, function (action) {
9453
+ return action.type === assign$2;
9454
+ }), 2),
9455
+ assignActions = _a[0],
9456
+ otherActions = _a[1];
9457
+
9619
9458
  var updatedContext = assignActions.length ? updateContext(currentContext, _event, assignActions, currentState) : currentContext;
9620
9459
  var preservedContexts = preserveActionOrder ? [currentContext] : undefined;
9621
- var deferredToBlockEnd = [];
9622
-
9623
- function handleAction(actionObject) {
9460
+ var resolvedActions = flatten(otherActions.map(function (actionObject) {
9624
9461
  var _a;
9625
9462
 
9626
9463
  switch (actionObject.type) {
@@ -9638,8 +9475,8 @@ function resolveActions(machine, currentState, currentContext, _event, actionBlo
9638
9475
  "No delay reference for delay expression '".concat(actionObject.delay, "' was found on machine '").concat(machine.id, "'"));
9639
9476
  }
9640
9477
 
9641
- if (predictableExec && sendAction.to !== SpecialTargets.Internal) {
9642
- deferredToBlockEnd.push(sendAction);
9478
+ if (sendAction.to !== SpecialTargets.Internal) {
9479
+ predictableExec === null || predictableExec === void 0 ? void 0 : predictableExec(sendAction, updatedContext, _event);
9643
9480
  }
9644
9481
 
9645
9482
  return sendAction;
@@ -9663,7 +9500,7 @@ function resolveActions(machine, currentState, currentContext, _event, actionBlo
9663
9500
  return [];
9664
9501
  }
9665
9502
 
9666
- var _b = __read(resolveActions(machine, currentState, updatedContext, _event, [toActionObjects(toArray(matchedActions), machine.options.actions)], predictableExec, preserveActionOrder), 2),
9503
+ var _b = __read(resolveActions(machine, currentState, updatedContext, _event, toActionObjects(toArray(matchedActions), machine.options.actions), predictableExec, preserveActionOrder), 2),
9667
9504
  resolvedActionsFromChoose = _b[0],
9668
9505
  resolvedContextFromChoose = _b[1];
9669
9506
 
@@ -9680,7 +9517,7 @@ function resolveActions(machine, currentState, currentContext, _event, actionBlo
9680
9517
  return [];
9681
9518
  }
9682
9519
 
9683
- var _c = __read(resolveActions(machine, currentState, updatedContext, _event, [toActionObjects(toArray(matchedActions), machine.options.actions)], predictableExec, preserveActionOrder), 2),
9520
+ var _c = __read(resolveActions(machine, currentState, updatedContext, _event, toActionObjects(toArray(matchedActions), machine.options.actions), predictableExec, preserveActionOrder), 2),
9684
9521
  resolvedActionsFromPure = _c[0],
9685
9522
  resolvedContext = _c[1];
9686
9523
 
@@ -9692,7 +9529,7 @@ function resolveActions(machine, currentState, currentContext, _event, actionBlo
9692
9529
  case stop$1:
9693
9530
  {
9694
9531
  var resolved = resolveStop(actionObject, updatedContext, _event);
9695
- predictableExec === null || predictableExec === void 0 ? void 0 : predictableExec(resolved, currentContext, _event);
9532
+ predictableExec === null || predictableExec === void 0 ? void 0 : predictableExec(resolved, updatedContext, _event);
9696
9533
  return resolved;
9697
9534
  }
9698
9535
 
@@ -9726,42 +9563,9 @@ function resolveActions(machine, currentState, currentContext, _event, actionBlo
9726
9563
 
9727
9564
  return resolvedActionObject;
9728
9565
  }
9729
- }
9730
-
9731
- function processBlock(block) {
9732
- var e_2, _a;
9733
-
9734
- var resolvedActions = [];
9735
-
9736
- try {
9737
- for (var block_1 = __values(block), block_1_1 = block_1.next(); !block_1_1.done; block_1_1 = block_1.next()) {
9738
- var action = block_1_1.value;
9739
- var resolved = handleAction(action);
9740
-
9741
- if (resolved) {
9742
- resolvedActions = resolvedActions.concat(resolved);
9743
- }
9744
- }
9745
- } catch (e_2_1) {
9746
- e_2 = {
9747
- error: e_2_1
9748
- };
9749
- } finally {
9750
- try {
9751
- if (block_1_1 && !block_1_1.done && (_a = block_1.return)) _a.call(block_1);
9752
- } finally {
9753
- if (e_2) throw e_2.error;
9754
- }
9755
- }
9756
-
9757
- deferredToBlockEnd.forEach(function (action) {
9758
- predictableExec(action, updatedContext, _event);
9759
- });
9760
- deferredToBlockEnd.length = 0;
9761
- return resolvedActions;
9762
- }
9763
-
9764
- var resolvedActions = flatten(actionBlocks.map(processBlock));
9566
+ }).filter(function (a) {
9567
+ return !!a;
9568
+ }));
9765
9569
  return [resolvedActions, updatedContext];
9766
9570
  }
9767
9571
 
@@ -10627,12 +10431,12 @@ function () {
10627
10431
  * @param options Interpreter options
10628
10432
  */
10629
10433
  function Interpreter(machine, options) {
10434
+ var _this = this;
10435
+
10630
10436
  if (options === void 0) {
10631
10437
  options = Interpreter.defaultOptions;
10632
10438
  }
10633
10439
 
10634
- var _this = this;
10635
-
10636
10440
  this.machine = machine;
10637
10441
  this.delayedEventsMap = {};
10638
10442
  this.listeners = new Set();
@@ -10649,7 +10453,6 @@ function () {
10649
10453
  this.status = InterpreterStatus.NotStarted;
10650
10454
  this.children = new Map();
10651
10455
  this.forwardTo = new Set();
10652
- this._outgoingQueue = [];
10653
10456
  /**
10654
10457
  * Alias for Interpreter.prototype.start
10655
10458
  */
@@ -10692,7 +10495,7 @@ function () {
10692
10495
  // Forward copy of event to child actors
10693
10496
  _this.forward(_event);
10694
10497
 
10695
- var nextState = _this._nextState(_event);
10498
+ var nextState = _this.nextState(_event);
10696
10499
 
10697
10500
  _this.update(nextState, _event);
10698
10501
  });
@@ -10701,7 +10504,7 @@ function () {
10701
10504
  // tslint:disable-next-line:semicolon
10702
10505
  };
10703
10506
 
10704
- this.sendTo = function (event, to, immediate) {
10507
+ this.sendTo = function (event, to) {
10705
10508
  var isParent = _this.parent && (to === SpecialTargets.Parent || _this.parent.id === to);
10706
10509
  var target = isParent ? _this.parent : isString(to) ? _this.children.get(to) || registry.get(to) : isActor$1(to) ? to : undefined;
10707
10510
 
@@ -10724,24 +10527,14 @@ function () {
10724
10527
  if (_this.status !== InterpreterStatus.Stopped || _this.parent !== target || // we need to send events to the parent from exit handlers of a machine that reached its final state
10725
10528
  _this.state.done) {
10726
10529
  // Send SCXML events to machines
10727
- var scxmlEvent = _assign(_assign({}, event), {
10530
+ target.send(_assign(_assign({}, event), {
10728
10531
  name: event.name === error$1 ? "".concat(error(_this.id)) : event.name,
10729
10532
  origin: _this.sessionId
10730
- });
10731
-
10732
- if (!immediate && _this.machine.config.predictableActionArguments) {
10733
- _this._outgoingQueue.push([target, scxmlEvent]);
10734
- } else {
10735
- target.send(scxmlEvent);
10736
- }
10533
+ }));
10737
10534
  }
10738
10535
  } else {
10739
10536
  // Send normal events to other targets
10740
- if (!immediate && _this.machine.config.predictableActionArguments) {
10741
- _this._outgoingQueue.push([target, event.data]);
10742
- } else {
10743
- target.send(event.data);
10744
- }
10537
+ target.send(event.data);
10745
10538
  }
10746
10539
  };
10747
10540
 
@@ -10785,7 +10578,7 @@ function () {
10785
10578
  return;
10786
10579
  } else {
10787
10580
  if (sendAction.to) {
10788
- _this.sendTo(sendAction._event, sendAction.to, _event === initEvent);
10581
+ _this.sendTo(sendAction._event, sendAction.to);
10789
10582
  } else {
10790
10583
  _this.send(sendAction._event);
10791
10584
  }
@@ -10934,9 +10727,6 @@ function () {
10934
10727
  configurable: true
10935
10728
  });
10936
10729
  Object.defineProperty(Interpreter.prototype, "state", {
10937
- /**
10938
- * @deprecated Use `.getSnapshot()` instead.
10939
- */
10940
10730
  get: function get() {
10941
10731
  if (!IS_PRODUCTION) {
10942
10732
  warn(this.status !== InterpreterStatus.NotStarted, "Attempted to read state from uninitialized service '".concat(this.id, "'. Make sure the service is started first."));
@@ -10989,12 +10779,6 @@ function () {
10989
10779
  // we can't just recompute it (and execute actions while doing so) because we try to preserve identity of actors created within initial assigns
10990
10780
  _event === initEvent) && this.options.execute) {
10991
10781
  this.execute(this.state);
10992
- } else {
10993
- var item = void 0;
10994
-
10995
- while (item = this._outgoingQueue.shift()) {
10996
- item[0].send(item[1]);
10997
- }
10998
10782
  } // Update children
10999
10783
 
11000
10784
 
@@ -11085,8 +10869,6 @@ function () {
11085
10869
  }
11086
10870
 
11087
10871
  this._stop();
11088
-
11089
- this._stopChildren();
11090
10872
  }
11091
10873
  };
11092
10874
  /*
@@ -11245,16 +11027,6 @@ function () {
11245
11027
  return this;
11246
11028
  };
11247
11029
 
11248
- Interpreter.prototype._stopChildren = function () {
11249
- // TODO: think about converting those to actions
11250
- this.children.forEach(function (child) {
11251
- if (isFunction(child.stop)) {
11252
- child.stop();
11253
- }
11254
- });
11255
- this.children.clear();
11256
- };
11257
-
11258
11030
  Interpreter.prototype._stop = function () {
11259
11031
  var e_6, _a, e_7, _b, e_8, _c, e_9, _d, e_10, _e;
11260
11032
 
@@ -11392,7 +11164,7 @@ function () {
11392
11164
  return toActionObjects(stateNode.onExit, _this.machine.options.actions);
11393
11165
  }));
11394
11166
 
11395
- var _a = __read(resolveActions(_this.machine, _this.state, _this.state.context, _event, [exitActions], _this.machine.config.predictableActionArguments ? _this._exec : undefined, _this.machine.config.predictableActionArguments || _this.machine.config.preserveActionOrder), 2),
11167
+ var _a = __read(resolveActions(_this.machine, _this.state, _this.state.context, _event, exitActions, _this.machine.config.predictableActionArguments ? _this._exec : undefined, _this.machine.config.predictableActionArguments || _this.machine.config.preserveActionOrder), 2),
11396
11168
  resolvedActions = _a[0],
11397
11169
  updatedContext = _a[1];
11398
11170
 
@@ -11419,9 +11191,17 @@ function () {
11419
11191
  return newState;
11420
11192
  });
11421
11193
 
11422
- _this.update(nextState, _event);
11194
+ _this.update(nextState, _event); // TODO: think about converting those to actions
11195
+ // Stop all children
11423
11196
 
11424
- _this._stopChildren();
11197
+
11198
+ _this.children.forEach(function (child) {
11199
+ if (isFunction(child.stop)) {
11200
+ child.stop();
11201
+ }
11202
+ });
11203
+
11204
+ _this.children.clear();
11425
11205
 
11426
11206
  registry.free(_this.sessionId);
11427
11207
  });
@@ -11441,11 +11221,6 @@ function () {
11441
11221
  "".concat(events.length, " event(s) were sent to uninitialized service \"").concat(this.machine.id, "\". Make sure .start() is called for this service, or set { deferEvents: true } in the service options."));
11442
11222
  }
11443
11223
 
11444
- if (!events.length) {
11445
- return;
11446
- }
11447
-
11448
- var exec = !!this.machine.config.predictableActionArguments && this._exec;
11449
11224
  this.scheduler.schedule(function () {
11450
11225
  var e_11, _a;
11451
11226
 
@@ -11459,9 +11234,9 @@ function () {
11459
11234
  _this.forward(_event);
11460
11235
 
11461
11236
  nextState = provide(_this, function () {
11462
- return _this.machine.transition(nextState, _event, undefined, exec || undefined);
11237
+ return _this.machine.transition(nextState, _event);
11463
11238
  });
11464
- batchedActions.push.apply(batchedActions, __spreadArray([], __read(_this.machine.config.predictableActionArguments ? nextState.actions : nextState.actions.map(function (a) {
11239
+ batchedActions.push.apply(batchedActions, __spreadArray([], __read(nextState.actions.map(function (a) {
11465
11240
  return bindActionToState(a, nextState);
11466
11241
  })), false));
11467
11242
  batchChanged = batchChanged || !!nextState.changed;
@@ -11502,13 +11277,9 @@ function () {
11502
11277
  return this.send.bind(this, event);
11503
11278
  };
11504
11279
 
11505
- Interpreter.prototype._nextState = function (event, exec) {
11280
+ Interpreter.prototype._nextState = function (event) {
11506
11281
  var _this = this;
11507
11282
 
11508
- if (exec === void 0) {
11509
- exec = !!this.machine.config.predictableActionArguments && this._exec;
11510
- }
11511
-
11512
11283
  var _event = toSCXMLEvent(event);
11513
11284
 
11514
11285
  if (_event.name.indexOf(errorPlatform) === 0 && !this.state.nextEvents.some(function (nextEvent) {
@@ -11518,7 +11289,7 @@ function () {
11518
11289
  }
11519
11290
 
11520
11291
  var nextState = provide(this, function () {
11521
- return _this.machine.transition(_this.state, _event, undefined, exec || undefined);
11292
+ return _this.machine.transition(_this.state, _event, undefined, _this.machine.config.predictableActionArguments ? _this._exec : undefined);
11522
11293
  });
11523
11294
  return nextState;
11524
11295
  };
@@ -11532,7 +11303,7 @@ function () {
11532
11303
 
11533
11304
 
11534
11305
  Interpreter.prototype.nextState = function (event) {
11535
- return this._nextState(event, false);
11306
+ return this._nextState(event);
11536
11307
  };
11537
11308
 
11538
11309
  Interpreter.prototype.forward = function (event) {
@@ -11567,7 +11338,7 @@ function () {
11567
11338
 
11568
11339
  this.delayedEventsMap[sendAction.id] = this.clock.setTimeout(function () {
11569
11340
  if (sendAction.to) {
11570
- _this.sendTo(sendAction._event, sendAction.to, true);
11341
+ _this.sendTo(sendAction._event, sendAction.to);
11571
11342
  } else {
11572
11343
  _this.send(sendAction._event);
11573
11344
  }
@@ -12143,12 +11914,12 @@ function () {
12143
11914
  */
12144
11915
  _context, // TODO: this is unsafe, but we're removing it in v5 anyway
12145
11916
  _stateInfo) {
11917
+ var _this = this;
11918
+
12146
11919
  if (_context === void 0) {
12147
11920
  _context = 'context' in config ? config.context : undefined;
12148
11921
  }
12149
11922
 
12150
- var _this = this;
12151
-
12152
11923
  var _a;
12153
11924
 
12154
11925
  this.config = config;
@@ -12758,11 +12529,9 @@ function () {
12758
12529
  return nodes;
12759
12530
  };
12760
12531
 
12761
- StateNode.prototype.getActions = function (resolvedConfig, isDone, transition, currentContext, _event, prevState, predictableExec) {
12532
+ StateNode.prototype.getActions = function (resolvedConfig, isDone, transition, currentContext, _event, prevState) {
12762
12533
  var e_4, _a, e_5, _b;
12763
12534
 
12764
- var _this = this;
12765
-
12766
12535
  var prevConfig = getConfiguration([], prevState ? this.getStateNodes(prevState.value) : [this]);
12767
12536
 
12768
12537
  try {
@@ -12840,19 +12609,20 @@ function () {
12840
12609
  });
12841
12610
  var entryStates = new Set(transition.entrySet);
12842
12611
  var exitStates = new Set(transition.exitSet);
12843
- var entryActions = Array.from(entryStates).map(function (stateNode) {
12844
- var entryActions = stateNode.onEntry;
12845
- var invokeActions = stateNode.activities.map(function (activity) {
12612
+
12613
+ var _c = __read([flatten(Array.from(entryStates).map(function (stateNode) {
12614
+ return __spreadArray(__spreadArray([], __read(stateNode.activities.map(function (activity) {
12846
12615
  return start(activity);
12847
- });
12848
- return toActionObjects(predictableExec ? __spreadArray(__spreadArray([], __read(entryActions), false), __read(invokeActions), false) : __spreadArray(__spreadArray([], __read(invokeActions), false), __read(entryActions), false), _this.machine.options.actions);
12849
- }).concat([doneEvents.map(raise)]);
12850
- var exitActions = Array.from(exitStates).map(function (stateNode) {
12851
- return toActionObjects(__spreadArray(__spreadArray([], __read(stateNode.onExit), false), __read(stateNode.activities.map(function (activity) {
12616
+ })), false), __read(stateNode.onEntry), false);
12617
+ })).concat(doneEvents.map(raise)), flatten(Array.from(exitStates).map(function (stateNode) {
12618
+ return __spreadArray(__spreadArray([], __read(stateNode.onExit), false), __read(stateNode.activities.map(function (activity) {
12852
12619
  return stop(activity);
12853
- })), false), _this.machine.options.actions);
12854
- });
12855
- var actions = exitActions.concat([toActionObjects(transition.actions, this.machine.options.actions)]).concat(entryActions);
12620
+ })), false);
12621
+ }))], 2),
12622
+ entryActions = _c[0],
12623
+ exitActions = _c[1];
12624
+
12625
+ var actions = toActionObjects(exitActions.concat(transition.actions).concat(entryActions), this.machine.options.actions);
12856
12626
 
12857
12627
  if (isDone) {
12858
12628
  var stopActions = toActionObjects(flatten(__spreadArray([], __read(resolvedConfig), false).sort(function (a, b) {
@@ -12862,7 +12632,7 @@ function () {
12862
12632
  })), this.machine.options.actions).filter(function (action) {
12863
12633
  return action.type !== raise$1 && (action.type !== send$1 || !!action.to && action.to !== SpecialTargets.Internal);
12864
12634
  });
12865
- return actions.concat([stopActions]);
12635
+ return actions.concat(stopActions);
12866
12636
  }
12867
12637
 
12868
12638
  return actions;
@@ -12933,7 +12703,7 @@ function () {
12933
12703
  };
12934
12704
 
12935
12705
  StateNode.prototype.resolveTransition = function (stateTransition, currentState, context, predictableExec, _event) {
12936
- var e_6, _a, e_7, _b;
12706
+ var e_6, _a;
12937
12707
 
12938
12708
  var _this = this;
12939
12709
 
@@ -12950,33 +12720,17 @@ function () {
12950
12720
  var isDone = isInFinalState(resolvedConfiguration, this);
12951
12721
  var resolvedStateValue = willTransition ? getValue(this.machine, configuration) : undefined;
12952
12722
  var historyValue = currentState ? currentState.historyValue ? currentState.historyValue : stateTransition.source ? this.machine.historyValue(currentState.value) : undefined : undefined;
12953
- var actionBlocks = this.getActions(new Set(resolvedConfiguration), isDone, stateTransition, context, _event, currentState, predictableExec);
12723
+ var actions = this.getActions(new Set(resolvedConfiguration), isDone, stateTransition, context, _event, currentState);
12954
12724
  var activities = currentState ? _assign({}, currentState.activities) : {};
12955
12725
 
12956
12726
  try {
12957
- for (var actionBlocks_1 = __values(actionBlocks), actionBlocks_1_1 = actionBlocks_1.next(); !actionBlocks_1_1.done; actionBlocks_1_1 = actionBlocks_1.next()) {
12958
- var block = actionBlocks_1_1.value;
12959
-
12960
- try {
12961
- for (var block_1 = (e_7 = void 0, __values(block)), block_1_1 = block_1.next(); !block_1_1.done; block_1_1 = block_1.next()) {
12962
- var action = block_1_1.value;
12727
+ for (var actions_1 = __values(actions), actions_1_1 = actions_1.next(); !actions_1_1.done; actions_1_1 = actions_1.next()) {
12728
+ var action = actions_1_1.value;
12963
12729
 
12964
- if (action.type === start$1) {
12965
- activities[action.activity.id || action.activity.type] = action;
12966
- } else if (action.type === stop$1) {
12967
- activities[action.activity.id || action.activity.type] = false;
12968
- }
12969
- }
12970
- } catch (e_7_1) {
12971
- e_7 = {
12972
- error: e_7_1
12973
- };
12974
- } finally {
12975
- try {
12976
- if (block_1_1 && !block_1_1.done && (_b = block_1.return)) _b.call(block_1);
12977
- } finally {
12978
- if (e_7) throw e_7.error;
12979
- }
12730
+ if (action.type === start$1) {
12731
+ activities[action.activity.id || action.activity.type] = action;
12732
+ } else if (action.type === stop$1) {
12733
+ activities[action.activity.id || action.activity.type] = false;
12980
12734
  }
12981
12735
  }
12982
12736
  } catch (e_6_1) {
@@ -12985,21 +12739,21 @@ function () {
12985
12739
  };
12986
12740
  } finally {
12987
12741
  try {
12988
- if (actionBlocks_1_1 && !actionBlocks_1_1.done && (_a = actionBlocks_1.return)) _a.call(actionBlocks_1);
12742
+ if (actions_1_1 && !actions_1_1.done && (_a = actions_1.return)) _a.call(actions_1);
12989
12743
  } finally {
12990
12744
  if (e_6) throw e_6.error;
12991
12745
  }
12992
12746
  }
12993
12747
 
12994
- var _c = __read(resolveActions(this, currentState, context, _event, actionBlocks, predictableExec, this.machine.config.predictableActionArguments || this.machine.config.preserveActionOrder), 2),
12995
- resolvedActions = _c[0],
12996
- updatedContext = _c[1];
12748
+ var _b = __read(resolveActions(this, currentState, context, _event, actions, predictableExec, this.machine.config.predictableActionArguments || this.machine.config.preserveActionOrder), 2),
12749
+ resolvedActions = _b[0],
12750
+ updatedContext = _b[1];
12997
12751
 
12998
- var _d = __read(partition(resolvedActions, function (action) {
12752
+ var _c = __read(partition(resolvedActions, function (action) {
12999
12753
  return action.type === raise$1 || action.type === send$1 && action.to === SpecialTargets.Internal;
13000
12754
  }), 2),
13001
- raisedEvents = _d[0],
13002
- nonRaisedActions = _d[1];
12755
+ raisedEvents = _c[0],
12756
+ nonRaisedActions = _c[1];
13003
12757
 
13004
12758
  var invokeActions = resolvedActions.filter(function (action) {
13005
12759
  var _a;
@@ -13448,7 +13202,7 @@ function () {
13448
13202
  * All the event types accepted by this state node and its descendants.
13449
13203
  */
13450
13204
  get: function get() {
13451
- var e_8, _a, e_9, _b;
13205
+ var e_7, _a, e_8, _b;
13452
13206
 
13453
13207
  if (this.__cache.events) {
13454
13208
  return this.__cache.events;
@@ -13465,32 +13219,32 @@ function () {
13465
13219
 
13466
13220
  if (state.states) {
13467
13221
  try {
13468
- for (var _e = (e_9 = void 0, __values(state.events)), _f = _e.next(); !_f.done; _f = _e.next()) {
13222
+ for (var _e = (e_8 = void 0, __values(state.events)), _f = _e.next(); !_f.done; _f = _e.next()) {
13469
13223
  var event_1 = _f.value;
13470
13224
  events.add("".concat(event_1));
13471
13225
  }
13472
- } catch (e_9_1) {
13473
- e_9 = {
13474
- error: e_9_1
13226
+ } catch (e_8_1) {
13227
+ e_8 = {
13228
+ error: e_8_1
13475
13229
  };
13476
13230
  } finally {
13477
13231
  try {
13478
13232
  if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
13479
13233
  } finally {
13480
- if (e_9) throw e_9.error;
13234
+ if (e_8) throw e_8.error;
13481
13235
  }
13482
13236
  }
13483
13237
  }
13484
13238
  }
13485
- } catch (e_8_1) {
13486
- e_8 = {
13487
- error: e_8_1
13239
+ } catch (e_7_1) {
13240
+ e_7 = {
13241
+ error: e_7_1
13488
13242
  };
13489
13243
  } finally {
13490
13244
  try {
13491
13245
  if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
13492
13246
  } finally {
13493
- if (e_8) throw e_8.error;
13247
+ if (e_7) throw e_7.error;
13494
13248
  }
13495
13249
  }
13496
13250
  }
@@ -13585,7 +13339,7 @@ function () {
13585
13339
  };
13586
13340
 
13587
13341
  StateNode.prototype.formatTransitions = function () {
13588
- var e_10, _a;
13342
+ var e_9, _a;
13589
13343
 
13590
13344
  var _this = this;
13591
13345
 
@@ -13649,15 +13403,15 @@ function () {
13649
13403
  var delayedTransition = delayedTransitions_1_1.value;
13650
13404
  formattedTransitions.push(delayedTransition);
13651
13405
  }
13652
- } catch (e_10_1) {
13653
- e_10 = {
13654
- error: e_10_1
13406
+ } catch (e_9_1) {
13407
+ e_9 = {
13408
+ error: e_9_1
13655
13409
  };
13656
13410
  } finally {
13657
13411
  try {
13658
13412
  if (delayedTransitions_1_1 && !delayedTransitions_1_1.done && (_a = delayedTransitions_1.return)) _a.call(delayedTransitions_1);
13659
13413
  } finally {
13660
- if (e_10) throw e_10.error;
13414
+ if (e_9) throw e_9.error;
13661
13415
  }
13662
13416
  }
13663
13417
 
@@ -14447,7 +14201,7 @@ var MediaConnections = /*#__PURE__*/Object.freeze({
14447
14201
 
14448
14202
  var bnrProcessor = {
14449
14203
  isModuleAdded: false,
14450
- workletProcessorUrl: 'https://models.intelligence.webex.com/bnr/1.1.0/noise-reduction-effect.worklet.js'
14204
+ workletProcessorUrl: 'https://models.intelligence.webex.com/bnr/2.0.0/noise-reduction-effect.worklet.js'
14451
14205
  };
14452
14206
 
14453
14207
  function isValidTrack(track) {