@player-ui/common-types-plugin 0.14.0-next.0 → 0.14.0-next.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.
@@ -45,6 +45,10 @@ function _async_to_generator(fn) {
45
45
  });
46
46
  };
47
47
  }
48
+ function _call_super(_this, derived, args) {
49
+ derived = _get_prototype_of(derived);
50
+ return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
51
+ }
48
52
  function _class_call_check(instance, Constructor) {
49
53
  if (!(instance instanceof Constructor)) {
50
54
  throw new TypeError("Cannot call a class as a function");
@@ -283,31 +287,15 @@ function _wrap_native_super(Class) {
283
287
  return _wrap_native_super(Class);
284
288
  }
285
289
  function _is_native_reflect_construct() {
286
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
287
- if (Reflect.construct.sham) return false;
288
- if (typeof Proxy === "function") return true;
289
290
  try {
290
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
291
- return true;
292
- } catch (e) {
293
- return false;
294
- }
295
- }
296
- function _create_super(Derived) {
297
- var hasNativeReflectConstruct = _is_native_reflect_construct();
298
- return function _createSuperInternal() {
299
- var Super = _get_prototype_of(Derived), result;
300
- if (hasNativeReflectConstruct) {
301
- var NewTarget = _get_prototype_of(this).constructor;
302
- result = Reflect.construct(Super, arguments, NewTarget);
303
- } else {
304
- result = Super.apply(this, arguments);
305
- }
306
- return _possible_constructor_return(this, result);
307
- };
291
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
292
+ } catch (_) {}
293
+ return (_is_native_reflect_construct = function() {
294
+ return !!result;
295
+ })();
308
296
  }
309
297
  function _ts_generator(thisArg, body) {
310
- var f, y, t, g, _ = {
298
+ var f, y, t, _ = {
311
299
  label: 0,
312
300
  sent: function() {
313
301
  if (t[0] & 1) throw t[1];
@@ -315,12 +303,8 @@ function _ts_generator(thisArg, body) {
315
303
  },
316
304
  trys: [],
317
305
  ops: []
318
- };
319
- return g = {
320
- next: verb(0),
321
- "throw": verb(1),
322
- "return": verb(2)
323
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
306
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
307
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
324
308
  return this;
325
309
  }), g;
326
310
  function verb(n) {
@@ -333,7 +317,7 @@ function _ts_generator(thisArg, body) {
333
317
  }
334
318
  function step(op) {
335
319
  if (f) throw new TypeError("Generator is already executing.");
336
- while(_)try {
320
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
337
321
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
338
322
  if (y = 0, t) op = [
339
323
  op[0] & 2,
@@ -505,7 +489,7 @@ var CommonTypesPlugin = function() {
505
489
  };
506
490
  var findInArray = function findInArray(array, key, value) {
507
491
  return array.findIndex(function(obj) {
508
- if (obj && typeof obj === "object") {
492
+ if (obj && (typeof obj === "undefined" ? "undefined" : _type_of(obj)) === "object") {
509
493
  return obj[key] == value;
510
494
  }
511
495
  return false;
@@ -599,7 +583,7 @@ var CommonTypesPlugin = function() {
599
583
  };
600
584
  };
601
585
  var isExpressionNode = function isExpressionNode(x) {
602
- return typeof x === "object" && x !== null && !Array.isArray(x) && x.__id === ExpNodeOpaqueIdentifier;
586
+ return (typeof x === "undefined" ? "undefined" : _type_of(x)) === "object" && x !== null && !Array.isArray(x) && x.__id === ExpNodeOpaqueIdentifier;
603
587
  };
604
588
  var throwError = function throwError(message, index) {
605
589
  var err = new Error("".concat(message, " at character ").concat(index));
@@ -1187,7 +1171,7 @@ var CommonTypesPlugin = function() {
1187
1171
  var isPromiseLike = function isPromiseLike(value) {
1188
1172
  var // Check for standard Promise constructor name
1189
1173
  _value_constructor;
1190
- return value != null && typeof value === "object" && typeof value.then === "function" && // Additional safeguards against false positives
1174
+ return value != null && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && typeof value.then === "function" && // Additional safeguards against false positives
1191
1175
  (_instanceof(value, Promise) || ((_value_constructor = value.constructor) === null || _value_constructor === void 0 ? void 0 : _value_constructor.name) === "Promise" || // Verify it has other Promise-like methods to reduce false positives
1192
1176
  typeof value.catch === "function" && typeof value.finally === "function");
1193
1177
  };
@@ -1202,7 +1186,7 @@ var CommonTypesPlugin = function() {
1202
1186
  if (isExpressionNode(expr)) {
1203
1187
  return false;
1204
1188
  }
1205
- return typeof expr === "object" && expr !== null && !Array.isArray(expr) && "value" in expr;
1189
+ return (typeof expr === "undefined" ? "undefined" : _type_of(expr)) === "object" && expr !== null && !Array.isArray(expr) && "value" in expr;
1206
1190
  };
1207
1191
  var makePromiseAwareBinaryOp = function makePromiseAwareBinaryOp(operation) {
1208
1192
  return function(a, b, async) {
@@ -1419,7 +1403,7 @@ var CommonTypesPlugin = function() {
1419
1403
  if (!node) {
1420
1404
  return;
1421
1405
  }
1422
- if ("value" in node && typeof node.value === "object" && typeof ((_node_value = node.value) === null || _node_value === void 0 ? void 0 : _node_value.id) === "string") {
1406
+ if ("value" in node && _type_of(node.value) === "object" && typeof ((_node_value = node.value) === null || _node_value === void 0 ? void 0 : _node_value.id) === "string") {
1423
1407
  return node.value.id;
1424
1408
  }
1425
1409
  };
@@ -1539,7 +1523,7 @@ var CommonTypesPlugin = function() {
1539
1523
  });
1540
1524
  };
1541
1525
  var __copyProps = function(to, from, except, desc) {
1542
- if (from && typeof from === "object" || typeof from === "function") {
1526
+ if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
1543
1527
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1544
1528
  try {
1545
1529
  var _loop = function() {
@@ -1594,15 +1578,16 @@ var CommonTypesPlugin = function() {
1594
1578
  exports.toError = exports.NestedError = void 0;
1595
1579
  var NestedError4 = /*#__PURE__*/ function(Error1) {
1596
1580
  _inherits(_NestedError, Error1);
1597
- var _super = _create_super(_NestedError);
1598
1581
  function _NestedError(message) {
1599
1582
  for(var _len = arguments.length, innerErrors = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
1600
1583
  innerErrors[_key - 1] = arguments[_key];
1601
1584
  }
1602
1585
  _class_call_check(this, _NestedError);
1603
1586
  var _this;
1604
- _this = _super.call(this, message);
1605
- var thisErrorReport = _NestedError.getErrorReport(_assert_this_initialized(_this));
1587
+ _this = _call_super(this, _NestedError, [
1588
+ message
1589
+ ]);
1590
+ var thisErrorReport = _NestedError.getErrorReport(_this);
1606
1591
  if (innerErrors.length === 1) {
1607
1592
  var innerError = toError(innerErrors[0]);
1608
1593
  _this.innerErrors = [
@@ -1738,7 +1723,7 @@ var CommonTypesPlugin = function() {
1738
1723
  return out;
1739
1724
  }
1740
1725
  function isObject(o) {
1741
- return o != null && typeof o === "object";
1726
+ return o != null && (typeof o === "undefined" ? "undefined" : _type_of(o)) === "object";
1742
1727
  }
1743
1728
  function addLast2(array, val) {
1744
1729
  if (Array.isArray(val)) return array.concat(val);
@@ -2081,7 +2066,7 @@ var CommonTypesPlugin = function() {
2081
2066
  else return 0;
2082
2067
  }
2083
2068
  }();
2084
- if (typeof module === "object") module.exports = SortedArray2;
2069
+ if ((typeof module === "undefined" ? "undefined" : _type_of(module)) === "object") module.exports = SortedArray2;
2085
2070
  if (typeof define === "function" && define.amd) define(function() {
2086
2071
  return SortedArray2;
2087
2072
  });
@@ -2384,10 +2369,9 @@ var CommonTypesPlugin = function() {
2384
2369
  }();
2385
2370
  var SyncHook = /*#__PURE__*/ function(Hook) {
2386
2371
  _inherits(SyncHook, Hook);
2387
- var _super = _create_super(SyncHook);
2388
2372
  function SyncHook() {
2389
2373
  _class_call_check(this, SyncHook);
2390
- return _super.apply(this, arguments);
2374
+ return _call_super(this, SyncHook, arguments);
2391
2375
  }
2392
2376
  _create_class(SyncHook, [
2393
2377
  {
@@ -2420,10 +2404,9 @@ var CommonTypesPlugin = function() {
2420
2404
  }(Hook);
2421
2405
  var SyncBailHook = /*#__PURE__*/ function(Hook) {
2422
2406
  _inherits(SyncBailHook, Hook);
2423
- var _super = _create_super(SyncBailHook);
2424
2407
  function SyncBailHook() {
2425
2408
  _class_call_check(this, SyncBailHook);
2426
- return _super.apply(this, arguments);
2409
+ return _call_super(this, SyncBailHook, arguments);
2427
2410
  }
2428
2411
  _create_class(SyncBailHook, [
2429
2412
  {
@@ -2455,10 +2438,9 @@ var CommonTypesPlugin = function() {
2455
2438
  }(Hook);
2456
2439
  var SyncWaterfallHook = /*#__PURE__*/ function(Hook) {
2457
2440
  _inherits(SyncWaterfallHook, Hook);
2458
- var _super = _create_super(SyncWaterfallHook);
2459
2441
  function SyncWaterfallHook() {
2460
2442
  _class_call_check(this, SyncWaterfallHook);
2461
- return _super.apply(this, arguments);
2443
+ return _call_super(this, SyncWaterfallHook, arguments);
2462
2444
  }
2463
2445
  _create_class(SyncWaterfallHook, [
2464
2446
  {
@@ -2520,7 +2502,7 @@ var CommonTypesPlugin = function() {
2520
2502
  for(var _iterator = foo[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
2521
2503
  len = _step.value;
2522
2504
  tmp = len;
2523
- if (tmp && typeof tmp === "object") {
2505
+ if (tmp && (typeof tmp === "undefined" ? "undefined" : _type_of(tmp)) === "object") {
2524
2506
  tmp = find(bar, tmp);
2525
2507
  if (!tmp) return false;
2526
2508
  }
@@ -2551,7 +2533,7 @@ var CommonTypesPlugin = function() {
2551
2533
  for(var _iterator1 = foo[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
2552
2534
  len = _step1.value;
2553
2535
  tmp = len[0];
2554
- if (tmp && typeof tmp === "object") {
2536
+ if (tmp && (typeof tmp === "undefined" ? "undefined" : _type_of(tmp)) === "object") {
2555
2537
  tmp = find(bar, tmp);
2556
2538
  if (!tmp) return false;
2557
2539
  }
@@ -2590,7 +2572,7 @@ var CommonTypesPlugin = function() {
2590
2572
  }
2591
2573
  return len === -1;
2592
2574
  }
2593
- if (!ctor || typeof foo === "object") {
2575
+ if (!ctor || (typeof foo === "undefined" ? "undefined" : _type_of(foo)) === "object") {
2594
2576
  len = 0;
2595
2577
  for(ctor in foo){
2596
2578
  if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
@@ -2623,7 +2605,7 @@ var CommonTypesPlugin = function() {
2623
2605
  var nestedPath = _to_consumable_array(path).concat([
2624
2606
  key
2625
2607
  ]);
2626
- if (typeof val === "object") {
2608
+ if ((typeof val === "undefined" ? "undefined" : _type_of(val)) === "object") {
2627
2609
  traverseObj(val, nestedPath, pairs);
2628
2610
  } else {
2629
2611
  pairs.set(nestedPath, val);
@@ -2664,7 +2646,7 @@ var CommonTypesPlugin = function() {
2664
2646
  {
2665
2647
  /** Add match -> value mapping to the registry */ key: "set",
2666
2648
  value: function set(match, value) {
2667
- var matcher = typeof match === "object" ? createMatcher(match) : createBasicMatcher(match);
2649
+ var matcher = (typeof match === "undefined" ? "undefined" : _type_of(match)) === "object" ? createMatcher(match) : createBasicMatcher(match);
2668
2650
  this.store.insert({
2669
2651
  key: match,
2670
2652
  value: value,
@@ -3204,7 +3186,7 @@ var CommonTypesPlugin = function() {
3204
3186
  var _this_parseCache_path;
3205
3187
  var ast = (_this_parseCache_path = this.parseCache[path]) !== null && _this_parseCache_path !== void 0 ? _this_parseCache_path : parse(path);
3206
3188
  this.parseCache[path] = ast;
3207
- if (typeof ast !== "object" || !(ast === null || ast === void 0 ? void 0 : ast.status)) {
3189
+ if ((typeof ast === "undefined" ? "undefined" : _type_of(ast)) !== "object" || !(ast === null || ast === void 0 ? void 0 : ast.status)) {
3208
3190
  var _ast_error;
3209
3191
  throw new TypeError('Cannot normalize path "'.concat(path, '": ').concat((_ast_error = ast === null || ast === void 0 ? void 0 : ast.error) !== null && _ast_error !== void 0 ? _ast_error : "Unknown Error."));
3210
3192
  }
@@ -3404,14 +3386,13 @@ var CommonTypesPlugin = function() {
3404
3386
  }();
3405
3387
  var DependencyModel = /*#__PURE__*/ function(DependencyTracker) {
3406
3388
  _inherits(DependencyModel, DependencyTracker);
3407
- var _super = _create_super(DependencyModel);
3408
3389
  function DependencyModel(rootModel) {
3409
3390
  _class_call_check(this, DependencyModel);
3410
3391
  var _this;
3411
- _this = _super.call(this);
3392
+ _this = _call_super(this, DependencyModel);
3412
3393
  _this.rootModel = rootModel;
3413
- _this.set = _this.set.bind(_assert_this_initialized(_this));
3414
- _this.get = _this.get.bind(_assert_this_initialized(_this));
3394
+ _this.set = _this.set.bind(_this);
3395
+ _this.get = _this.get.bind(_this);
3415
3396
  return _this;
3416
3397
  }
3417
3398
  _create_class(DependencyModel, [
@@ -3955,23 +3936,20 @@ var CommonTypesPlugin = function() {
3955
3936
  * @experimental These Player APIs are in active development and may change. Use with caution
3956
3937
  */ key: "evaluateAsync",
3957
3938
  value: function evaluateAsync(expr, options) {
3939
+ var _this = this;
3958
3940
  if (Array.isArray(expr)) {
3959
- var _this = this;
3960
- return collateAwaitable(expr.map(function() {
3961
- var _ref = _async_to_generator(function(exp) {
3941
+ return collateAwaitable(expr.map(function(exp) {
3942
+ return _async_to_generator(function() {
3962
3943
  return _ts_generator(this, function(_state) {
3963
3944
  return [
3964
3945
  2,
3965
- _this.evaluate(exp, _object_spread_props(_object_spread({}, options), {
3946
+ this.evaluate(exp, _object_spread_props(_object_spread({}, options), {
3966
3947
  async: true
3967
3948
  }))
3968
3949
  ];
3969
3950
  });
3970
- });
3971
- return function(exp) {
3972
- return _ref.apply(this, arguments);
3973
- };
3974
- }())).awaitableThen(function(values) {
3951
+ }).call(_this);
3952
+ })).awaitableThen(function(values) {
3975
3953
  return values.pop();
3976
3954
  });
3977
3955
  } else {
@@ -4734,7 +4712,7 @@ var CommonTypesPlugin = function() {
4734
4712
  }
4735
4713
  var parseLocalObject = function(currentValue, objToParse) {
4736
4714
  var path = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
4737
- if (typeof objToParse !== "object" || objToParse === null) {
4715
+ if ((typeof objToParse === "undefined" ? "undefined" : _type_of(objToParse)) !== "object" || objToParse === null) {
4738
4716
  return {
4739
4717
  value: objToParse,
4740
4718
  children: []
@@ -4771,7 +4749,7 @@ var CommonTypesPlugin = function() {
4771
4749
  if (newChildren) {
4772
4750
  var _children2;
4773
4751
  (_children2 = children2).push.apply(_children2, _to_consumable_array(newChildren));
4774
- } else if (localValue && typeof localValue === "object") {
4752
+ } else if (localValue && (typeof localValue === "undefined" ? "undefined" : _type_of(localValue)) === "object") {
4775
4753
  var _children21;
4776
4754
  var result = parseLocalObject(accumulation.value, localValue, _to_consumable_array(path).concat([
4777
4755
  localKey
@@ -4929,7 +4907,7 @@ var CommonTypesPlugin = function() {
4929
4907
  Object.keys(clonedNode).forEach(function(key) {
4930
4908
  if (key === "parent") return;
4931
4909
  var value = clonedNode[key];
4932
- if (typeof value === "object" && value !== null) {
4910
+ if ((typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && value !== null) {
4933
4911
  clonedNode[key] = Array.isArray(value) ? _to_consumable_array(value) : _object_spread({}, value);
4934
4912
  }
4935
4913
  });
@@ -5281,7 +5259,7 @@ var CommonTypesPlugin = function() {
5281
5259
  for(var _iterator = templateSubstitutions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
5282
5260
  var _step_value = _step.value, expression2 = _step_value.expression, value = _step_value.value;
5283
5261
  var flags = "g";
5284
- if (typeof expression2 === "object") {
5262
+ if ((typeof expression2 === "undefined" ? "undefined" : _type_of(expression2)) === "object") {
5285
5263
  flags = "".concat(expression2.flags).concat(expression2.global ? "" : "g");
5286
5264
  }
5287
5265
  templateStr = templateStr.replace(new RegExp(expression2, flags), value);
@@ -5430,7 +5408,7 @@ var CommonTypesPlugin = function() {
5430
5408
  var bindingResolveLookup = createPatternMatcher("{{", "}}");
5431
5409
  var expressionResolveLookup = createPatternMatcher("@[", "]@");
5432
5410
  function resolveAllRefs(node, resolveOptions, propertiesToSkip) {
5433
- if (node === null || node === void 0 || typeof node !== "object" && typeof node !== "string") {
5411
+ if (node === null || node === void 0 || (typeof node === "undefined" ? "undefined" : _type_of(node)) !== "object" && typeof node !== "string") {
5434
5412
  return node;
5435
5413
  }
5436
5414
  if (typeof node === "string") {
@@ -5443,7 +5421,7 @@ var CommonTypesPlugin = function() {
5443
5421
  }
5444
5422
  var val = node[key];
5445
5423
  var newVal = val;
5446
- if (typeof val === "object") {
5424
+ if ((typeof val === "undefined" ? "undefined" : _type_of(val)) === "object") {
5447
5425
  newVal = resolveAllRefs(val, resolveOptions, propertiesToSkip);
5448
5426
  } else if (typeof val === "string") {
5449
5427
  newVal = resolveString(val, resolveOptions);
@@ -5784,7 +5762,7 @@ var CommonTypesPlugin = function() {
5784
5762
  key: "applyParser",
5785
5763
  value: function applyParser(parser) {
5786
5764
  parser.hooks.parseNode.tap("asset", function(obj, nodeType, options, childOptions) {
5787
- if ((childOptions === null || childOptions === void 0 ? void 0 : childOptions.key) === "asset" && typeof obj === "object") {
5765
+ if ((childOptions === null || childOptions === void 0 ? void 0 : childOptions.key) === "asset" && (typeof obj === "undefined" ? "undefined" : _type_of(obj)) === "object") {
5788
5766
  var assetAST = parser.parseObject(obj, "asset", options);
5789
5767
  if (!assetAST) {
5790
5768
  return [];
@@ -5984,6 +5962,7 @@ var CommonTypesPlugin = function() {
5984
5962
  }();
5985
5963
  var FlowInstance = /*#__PURE__*/ function() {
5986
5964
  function FlowInstance(id, flow, options) {
5965
+ var _this = this;
5987
5966
  _class_call_check(this, FlowInstance);
5988
5967
  this.isTransitioning = false;
5989
5968
  this.hooks = {
@@ -6000,60 +5979,55 @@ var CommonTypesPlugin = function() {
6000
5979
  this.flow = flow;
6001
5980
  this.log = options === null || options === void 0 ? void 0 : options.logger;
6002
5981
  this.history = [];
6003
- var _this = this;
6004
- this.hooks.transition.tap("startPromise", function() {
6005
- var _ref = _async_to_generator(function(_oldState, nextState) {
5982
+ this.hooks.transition.tap("startPromise", function(_oldState, nextState) {
5983
+ return _async_to_generator(function() {
6006
5984
  var newState;
6007
5985
  return _ts_generator(this, function(_state) {
6008
5986
  newState = nextState.value;
6009
- if (_this.flowPromise && newState.state_type === "END") {
6010
- _this.flowPromise.resolve(newState);
5987
+ if (this.flowPromise && newState.state_type === "END") {
5988
+ this.flowPromise.resolve(newState);
6011
5989
  }
6012
5990
  return [
6013
5991
  2
6014
5992
  ];
6015
5993
  });
6016
- });
6017
- return function(_oldState, nextState) {
6018
- return _ref.apply(this, arguments);
6019
- };
6020
- }());
5994
+ }).call(_this);
5995
+ });
6021
5996
  }
6022
5997
  _create_class(FlowInstance, [
6023
5998
  {
6024
5999
  key: "start",
6025
6000
  value: /** Start the state machine */ function start() {
6026
- var _this = this;
6027
6001
  return _async_to_generator(function() {
6028
6002
  var _this_log, initialState;
6029
6003
  return _ts_generator(this, function(_state) {
6030
- if (_this.flowPromise) {
6004
+ if (this.flowPromise) {
6031
6005
  ;
6032
- (_this_log = _this.log) === null || _this_log === void 0 ? void 0 : _this_log.warn("Already called start for flow");
6006
+ (_this_log = this.log) === null || _this_log === void 0 ? void 0 : _this_log.warn("Already called start for flow");
6033
6007
  return [
6034
6008
  2,
6035
- _this.flowPromise.promise
6009
+ this.flowPromise.promise
6036
6010
  ];
6037
6011
  }
6038
- _this.flow = _this.hooks.beforeStart.call(_this.flow) || _this.flow;
6039
- if (_this.flow.onStart) {
6040
- _this.hooks.onStart.call(_this.flow.onStart);
6012
+ this.flow = this.hooks.beforeStart.call(this.flow) || this.flow;
6013
+ if (this.flow.onStart) {
6014
+ this.hooks.onStart.call(this.flow.onStart);
6041
6015
  }
6042
- initialState = _this.flow.startState;
6016
+ initialState = this.flow.startState;
6043
6017
  if (!initialState) {
6044
6018
  return [
6045
6019
  2,
6046
6020
  Promise.reject(new Error("No 'startState' defined for flow"))
6047
6021
  ];
6048
6022
  }
6049
- _this.flowPromise = (0, import_p_defer2.default)();
6050
- _this.pushHistory(initialState);
6023
+ this.flowPromise = (0, import_p_defer2.default)();
6024
+ this.pushHistory(initialState);
6051
6025
  return [
6052
6026
  2,
6053
- _this.flowPromise.promise
6027
+ this.flowPromise.promise
6054
6028
  ];
6055
6029
  });
6056
- })();
6030
+ }).call(this);
6057
6031
  }
6058
6032
  },
6059
6033
  {
@@ -6105,7 +6079,7 @@ var CommonTypesPlugin = function() {
6105
6079
  throw new Error("No flow definition for: ".concat(stateName, " was found."));
6106
6080
  }
6107
6081
  var nextState = this.flow[stateName];
6108
- if (!this.flow[stateName] || typeof nextState !== "object" || !("state_type" in nextState)) {
6082
+ if (!this.flow[stateName] || (typeof nextState === "undefined" ? "undefined" : _type_of(nextState)) !== "object" || !("state_type" in nextState)) {
6109
6083
  var _this_log;
6110
6084
  (_this_log = this.log) === null || _this_log === void 0 ? void 0 : _this_log.error("Flow doesn't contain any states named: ".concat(stateName));
6111
6085
  return;
@@ -6165,30 +6139,30 @@ var CommonTypesPlugin = function() {
6165
6139
  {
6166
6140
  key: "run",
6167
6141
  value: function run(startState) {
6168
- var _this = this;
6169
6142
  return _async_to_generator(function() {
6170
- var _this_log, startFlow, flow, end, firstItem;
6143
+ var _this, _this_log, startFlow, flow, end, firstItem;
6171
6144
  return _ts_generator(this, function(_state) {
6172
6145
  switch(_state.label){
6173
6146
  case 0:
6174
- if (!Object.prototype.hasOwnProperty.call(_this.navigation, startState)) {
6147
+ _this = this;
6148
+ if (!Object.prototype.hasOwnProperty.call(this.navigation, startState)) {
6175
6149
  return [
6176
6150
  2,
6177
6151
  Promise.reject(new Error("No flow defined for: ".concat(startState)))
6178
6152
  ];
6179
6153
  }
6180
- startFlow = _this.navigation[startState];
6181
- if (startFlow === null || typeof startFlow !== "object") {
6154
+ startFlow = this.navigation[startState];
6155
+ if (startFlow === null || (typeof startFlow === "undefined" ? "undefined" : _type_of(startFlow)) !== "object") {
6182
6156
  return [
6183
6157
  2,
6184
6158
  Promise.reject(new Error("Flow: ".concat(startState, " needs to be an object")))
6185
6159
  ];
6186
6160
  }
6187
- (_this_log = _this.log) === null || _this_log === void 0 ? void 0 : _this_log.debug("Starting flow: ".concat(startState));
6161
+ (_this_log = this.log) === null || _this_log === void 0 ? void 0 : _this_log.debug("Starting flow: ".concat(startState));
6188
6162
  flow = new FlowInstance(startState, startFlow, {
6189
- logger: _this.log
6163
+ logger: this.log
6190
6164
  });
6191
- _this.addNewFlow(flow);
6165
+ this.addNewFlow(flow);
6192
6166
  flow.hooks.afterTransition.tap("flow-controller", function(flowInstance) {
6193
6167
  var _flowInstance_currentState;
6194
6168
  if (((_flowInstance_currentState = flowInstance.currentState) === null || _flowInstance_currentState === void 0 ? void 0 : _flowInstance_currentState.value.state_type) === "FLOW") {
@@ -6208,10 +6182,10 @@ var CommonTypesPlugin = function() {
6208
6182
  ];
6209
6183
  case 1:
6210
6184
  end = _state.sent();
6211
- _this.navStack.pop();
6212
- if (_this.navStack.length > 0) {
6185
+ this.navStack.pop();
6186
+ if (this.navStack.length > 0) {
6213
6187
  firstItem = 0;
6214
- _this.current = _this.navStack[firstItem];
6188
+ this.current = this.navStack[firstItem];
6215
6189
  }
6216
6190
  return [
6217
6191
  2,
@@ -6219,16 +6193,15 @@ var CommonTypesPlugin = function() {
6219
6193
  ];
6220
6194
  }
6221
6195
  });
6222
- })();
6196
+ }).call(this);
6223
6197
  }
6224
6198
  },
6225
6199
  {
6226
6200
  key: "start",
6227
6201
  value: function start() {
6228
- var _this = this;
6229
6202
  return _async_to_generator(function() {
6230
6203
  return _ts_generator(this, function(_state) {
6231
- if (!_this.navigation.BEGIN) {
6204
+ if (!this.navigation.BEGIN) {
6232
6205
  return [
6233
6206
  2,
6234
6207
  Promise.reject(new Error("Must supply a BEGIN state"))
@@ -6236,10 +6209,10 @@ var CommonTypesPlugin = function() {
6236
6209
  }
6237
6210
  return [
6238
6211
  2,
6239
- _this.run(_this.navigation.BEGIN)
6212
+ this.run(this.navigation.BEGIN)
6240
6213
  ];
6241
6214
  });
6242
- })();
6215
+ }).call(this);
6243
6216
  }
6244
6217
  }
6245
6218
  ]);
@@ -7346,7 +7319,7 @@ var CommonTypesPlugin = function() {
7346
7319
  var parentBinding = resolved.parent();
7347
7320
  var property = resolved.key();
7348
7321
  var parentValue = this.get(parentBinding);
7349
- var existedBeforeDelete = typeof parentValue === "object" && parentValue !== null && Object.prototype.hasOwnProperty.call(parentValue, property);
7322
+ var existedBeforeDelete = (typeof parentValue === "undefined" ? "undefined" : _type_of(parentValue)) === "object" && parentValue !== null && Object.prototype.hasOwnProperty.call(parentValue, property);
7350
7323
  this.getModel().delete(resolved, options);
7351
7324
  if (existedBeforeDelete && !this.get(resolved)) {
7352
7325
  this.trash.add(resolved);
@@ -7447,7 +7420,7 @@ var CommonTypesPlugin = function() {
7447
7420
  var expressionEvaluator;
7448
7421
  var handleEval = function(exp) {
7449
7422
  if (exp) {
7450
- if (typeof exp === "object" && "exp" in exp) {
7423
+ if ((typeof exp === "undefined" ? "undefined" : _type_of(exp)) === "object" && "exp" in exp) {
7451
7424
  expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(exp.exp);
7452
7425
  } else {
7453
7426
  expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(exp);
@@ -7708,7 +7681,7 @@ var CommonTypesPlugin = function() {
7708
7681
  flow.hooks.beforeTransition.tap("player", function(state, transitionVal) {
7709
7682
  var computedTransitionVal = state.transitions[transitionVal] ? transitionVal : "*";
7710
7683
  if (state.onEnd && state.transitions[computedTransitionVal]) {
7711
- if (typeof state.onEnd === "object" && "exp" in state.onEnd) {
7684
+ if (_type_of(state.onEnd) === "object" && "exp" in state.onEnd) {
7712
7685
  expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(state.onEnd.exp);
7713
7686
  } else {
7714
7687
  expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(state.onEnd);
@@ -7867,12 +7840,12 @@ var CommonTypesPlugin = function() {
7867
7840
  {
7868
7841
  key: "start",
7869
7842
  value: function start(payload) {
7870
- var _this = this;
7871
7843
  return _async_to_generator(function() {
7872
- var _payload_id, ref, maybeUpdateState, _this_setupFlow, state, start, endProps, _tmp, error, errorState;
7844
+ var _this, _payload_id, ref, maybeUpdateState, _this_setupFlow, state, start, endProps, _tmp, error, errorState;
7873
7845
  return _ts_generator(this, function(_state) {
7874
7846
  switch(_state.label){
7875
7847
  case 0:
7848
+ _this = this;
7876
7849
  ref = Symbol((_payload_id = payload === null || payload === void 0 ? void 0 : payload.id) !== null && _payload_id !== void 0 ? _payload_id : "payload");
7877
7850
  maybeUpdateState = function(newState) {
7878
7851
  if (_this.state.ref !== ref) {
@@ -7882,7 +7855,7 @@ var CommonTypesPlugin = function() {
7882
7855
  _this.setState(newState);
7883
7856
  return newState;
7884
7857
  };
7885
- _this.setState({
7858
+ this.setState({
7886
7859
  status: "not-started",
7887
7860
  ref: ref
7888
7861
  });
@@ -7894,8 +7867,8 @@ var CommonTypesPlugin = function() {
7894
7867
  ,
7895
7868
  4
7896
7869
  ]);
7897
- _this_setupFlow = _this.setupFlow(payload), state = _this_setupFlow.state, start = _this_setupFlow.start;
7898
- _this.setState(_object_spread({
7870
+ _this_setupFlow = this.setupFlow(payload), state = _this_setupFlow.state, start = _this_setupFlow.start;
7871
+ this.setState(_object_spread({
7899
7872
  ref: ref
7900
7873
  }, state));
7901
7874
  start();
@@ -7940,7 +7913,7 @@ var CommonTypesPlugin = function() {
7940
7913
  ];
7941
7914
  }
7942
7915
  });
7943
- })();
7916
+ }).call(this);
7944
7917
  }
7945
7918
  }
7946
7919
  ]);
@@ -8042,7 +8015,7 @@ var CommonTypesPlugin = function() {
8042
8015
  }
8043
8016
  });
8044
8017
  var length = skipNullish(function(context, value, options) {
8045
- if (typeof options !== "object") {
8018
+ if ((typeof options === "undefined" ? "undefined" : _type_of(options)) !== "object") {
8046
8019
  context.logger.warn("Missing comparison in length validation");
8047
8020
  return;
8048
8021
  }
@@ -8051,7 +8024,7 @@ var CommonTypesPlugin = function() {
8051
8024
  if (typeof value === "string") {
8052
8025
  valLength = value.length;
8053
8026
  itemName = "characters";
8054
- } else if (typeof value === "object" && value !== null) {
8027
+ } else if ((typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && value !== null) {
8055
8028
  valLength = Object.keys(value).length;
8056
8029
  }
8057
8030
  if (valLength === void 0) {