@player-ui/reference-assets-plugin 0.11.3--canary.660.23372 → 0.11.3--canary.649.23399

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.
@@ -1282,6 +1282,48 @@ var ReferenceAssetsPlugin = function() {
1282
1282
  }
1283
1283
  return typeof expr === "object" && expr !== null && !Array.isArray(expr) && "value" in expr;
1284
1284
  };
1285
+ var isPromiselike = function isPromiselike(value) {
1286
+ var // Check for standard Promise constructor name
1287
+ _value_constructor;
1288
+ return value != null && typeof value === "object" && typeof value.then === "function" && // Additional safeguards against false positives
1289
+ (_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
1290
+ typeof value.catch === "function" && typeof value.finally === "function");
1291
+ };
1292
+ var makePromiseAwareBinaryOp = function makePromiseAwareBinaryOp(operation) {
1293
+ return function(a, b) {
1294
+ if (isPromiselike(a) || isPromiselike(b)) {
1295
+ return Promise.all([
1296
+ Promise.resolve(a),
1297
+ Promise.resolve(b)
1298
+ ]).then(function(param) {
1299
+ var _param = _sliced_to_array(param, 2), resolvedA = _param[0], resolvedB = _param[1];
1300
+ return operation(resolvedA, resolvedB);
1301
+ });
1302
+ }
1303
+ return operation(a, b);
1304
+ };
1305
+ };
1306
+ var makePromiseAwareUnaryOp = function makePromiseAwareUnaryOp(operation) {
1307
+ return function(a) {
1308
+ if (isPromiselike(a)) {
1309
+ return a.then(function(resolved) {
1310
+ return operation(resolved);
1311
+ });
1312
+ }
1313
+ return operation(a);
1314
+ };
1315
+ };
1316
+ var handleConditionalBranching = function handleConditionalBranching(testValue, getTrueBranch, getFalseBranch, resolveNode) {
1317
+ if (isPromiselike(testValue)) {
1318
+ return testValue.then(function(resolved) {
1319
+ var branch2 = resolved ? getTrueBranch() : getFalseBranch();
1320
+ var branchResult = resolveNode(branch2);
1321
+ return isPromiselike(branchResult) ? branchResult : Promise.resolve(branchResult);
1322
+ });
1323
+ }
1324
+ var branch = testValue ? getTrueBranch() : getFalseBranch();
1325
+ return resolveNode(branch);
1326
+ };
1285
1327
  var parse2 = function parse2(schema) {
1286
1328
  var _loop = function() {
1287
1329
  var next = parseQueue.shift();
@@ -3807,6 +3849,9 @@ var ReferenceAssetsPlugin = function() {
3807
3849
  },
3808
3850
  setDataVal: function() {
3809
3851
  return setDataVal;
3852
+ },
3853
+ waitFor: function() {
3854
+ return waitFor;
3810
3855
  }
3811
3856
  });
3812
3857
  var setDataVal = function(_context, binding, value) {
@@ -3834,12 +3879,33 @@ var ReferenceAssetsPlugin = function() {
3834
3879
  return null;
3835
3880
  };
3836
3881
  conditional.resolveParams = false;
3882
+ var waitFor = function() {
3883
+ var _ref = _async_to_generator(function(ctx, promise) {
3884
+ return _ts_generator(this, function(_state) {
3885
+ switch(_state.label){
3886
+ case 0:
3887
+ return [
3888
+ 4,
3889
+ promise
3890
+ ];
3891
+ case 1:
3892
+ return [
3893
+ 2,
3894
+ _state.sent()
3895
+ ];
3896
+ }
3897
+ });
3898
+ });
3899
+ return function waitFor(ctx, promise) {
3900
+ return _ref.apply(this, arguments);
3901
+ };
3902
+ }();
3837
3903
  var andandOperator = function(ctx, a, b) {
3838
- return ctx.evaluate(a) && ctx.evaluate(b);
3904
+ return LogicalOperators.and(ctx, a, b);
3839
3905
  };
3840
3906
  andandOperator.resolveParams = false;
3841
3907
  var ororOperator = function(ctx, a, b) {
3842
- return ctx.evaluate(a) || ctx.evaluate(b);
3908
+ return LogicalOperators.or(ctx, a, b);
3843
3909
  };
3844
3910
  ororOperator.resolveParams = false;
3845
3911
  var DEFAULT_BINARY_OPERATORS = {
@@ -3859,34 +3925,35 @@ var ReferenceAssetsPlugin = function() {
3859
3925
  "%": function(a, b) {
3860
3926
  return a % b;
3861
3927
  },
3928
+ // Promise-aware comparison operators
3862
3929
  // eslint-disable-next-line
3863
- "==": function(a, b) {
3930
+ "==": makePromiseAwareBinaryOp(function(a, b) {
3864
3931
  return a == b;
3865
- },
3932
+ }),
3866
3933
  // eslint-disable-next-line
3867
- "!=": function(a, b) {
3934
+ "!=": makePromiseAwareBinaryOp(function(a, b) {
3868
3935
  return a != b;
3869
- },
3870
- ">": function(a, b) {
3936
+ }),
3937
+ ">": makePromiseAwareBinaryOp(function(a, b) {
3871
3938
  return a > b;
3872
- },
3873
- ">=": function(a, b) {
3939
+ }),
3940
+ ">=": makePromiseAwareBinaryOp(function(a, b) {
3874
3941
  return a >= b;
3875
- },
3876
- "<": function(a, b) {
3942
+ }),
3943
+ "<": makePromiseAwareBinaryOp(function(a, b) {
3877
3944
  return a < b;
3878
- },
3879
- "<=": function(a, b) {
3945
+ }),
3946
+ "<=": makePromiseAwareBinaryOp(function(a, b) {
3880
3947
  return a <= b;
3881
- },
3882
- "&&": andandOperator,
3883
- "||": ororOperator,
3884
- "!==": function(a, b) {
3948
+ }),
3949
+ "!==": makePromiseAwareBinaryOp(function(a, b) {
3885
3950
  return a !== b;
3886
- },
3887
- "===": function(a, b) {
3951
+ }),
3952
+ "===": makePromiseAwareBinaryOp(function(a, b) {
3888
3953
  return a === b;
3889
- },
3954
+ }),
3955
+ "&&": andandOperator,
3956
+ "||": ororOperator,
3890
3957
  // eslint-disable-next-line
3891
3958
  "|": function(a, b) {
3892
3959
  return a | b;
@@ -3917,8 +3984,70 @@ var ReferenceAssetsPlugin = function() {
3917
3984
  "+": function(a) {
3918
3985
  return Number(a);
3919
3986
  },
3920
- "!": function(a) {
3987
+ "!": makePromiseAwareUnaryOp(function(a) {
3921
3988
  return !a;
3989
+ })
3990
+ };
3991
+ var PromiseCollectionHandler = {
3992
+ /**
3993
+ * Handle array with potential Promise elements
3994
+ */ handleArray: function handleArray(items) {
3995
+ var hasPromises = items.some(function(item) {
3996
+ return isPromiselike(item);
3997
+ });
3998
+ return hasPromises ? Promise.all(items) : items;
3999
+ },
4000
+ /**
4001
+ * Handle object with potential Promise keys/values
4002
+ */ handleObject: function handleObject(attributes, resolveNode) {
4003
+ var resolvedAttributes = {};
4004
+ var promises = [];
4005
+ var hasPromises = false;
4006
+ attributes.forEach(function(attr) {
4007
+ var key = resolveNode(attr.key);
4008
+ var value = resolveNode(attr.value);
4009
+ if (isPromiselike(key) || isPromiselike(value)) {
4010
+ hasPromises = true;
4011
+ var keyPromise = Promise.resolve(key);
4012
+ var valuePromise = Promise.resolve(value);
4013
+ promises.push(Promise.all([
4014
+ keyPromise,
4015
+ valuePromise
4016
+ ]).then(function(param) {
4017
+ var _param = _sliced_to_array(param, 2), resolvedKey = _param[0], resolvedValue = _param[1];
4018
+ resolvedAttributes[resolvedKey] = resolvedValue;
4019
+ }));
4020
+ } else {
4021
+ resolvedAttributes[key] = value;
4022
+ }
4023
+ });
4024
+ return hasPromises ? Promise.all(promises).then(function() {
4025
+ return resolvedAttributes;
4026
+ }) : resolvedAttributes;
4027
+ }
4028
+ };
4029
+ var LogicalOperators = {
4030
+ and: function(ctx, leftNode, rightNode) {
4031
+ var leftResult = ctx.evaluate(leftNode);
4032
+ if (isPromiselike(leftResult)) {
4033
+ return leftResult.then(function(awaitedLeft) {
4034
+ if (!awaitedLeft) return awaitedLeft;
4035
+ var rightResult = ctx.evaluate(rightNode);
4036
+ return isPromiselike(rightResult) ? rightResult : Promise.resolve(rightResult);
4037
+ });
4038
+ }
4039
+ return leftResult && ctx.evaluate(rightNode);
4040
+ },
4041
+ or: function(ctx, leftNode, rightNode) {
4042
+ var leftResult = ctx.evaluate(leftNode);
4043
+ if (isPromiselike(leftResult)) {
4044
+ return leftResult.then(function(awaitedLeft) {
4045
+ if (awaitedLeft) return awaitedLeft;
4046
+ var rightResult = ctx.evaluate(rightNode);
4047
+ return isPromiselike(rightResult) ? rightResult : Promise.resolve(rightResult);
4048
+ });
4049
+ }
4050
+ return leftResult || ctx.evaluate(rightNode);
3922
4051
  }
3923
4052
  };
3924
4053
  var ExpressionEvaluator = /*#__PURE__*/ function() {
@@ -3939,7 +4068,12 @@ var ReferenceAssetsPlugin = function() {
3939
4068
  this.operators = {
3940
4069
  binary: new Map(Object.entries(DEFAULT_BINARY_OPERATORS)),
3941
4070
  unary: new Map(Object.entries(DEFAULT_UNARY_OPERATORS)),
3942
- expressions: new Map(Object.entries(evaluator_functions_exports))
4071
+ expressions: new Map(_to_consumable_array(Object.entries(evaluator_functions_exports)).concat([
4072
+ [
4073
+ "await",
4074
+ waitFor
4075
+ ]
4076
+ ]))
3943
4077
  };
3944
4078
  this.defaultHookOptions = _object_spread_props(_object_spread({}, defaultOptions), {
3945
4079
  evaluate: function(expr) {
@@ -3949,7 +4083,12 @@ var ReferenceAssetsPlugin = function() {
3949
4083
  return _this._execAST(node, _this.defaultHookOptions);
3950
4084
  }
3951
4085
  });
3952
- this.hooks.resolve.tap("ExpressionEvaluator", this._resolveNode.bind(this));
4086
+ this.hooks.resolve.tap("ExpressionEvaluator", function(result, node, options) {
4087
+ if (options.async) {
4088
+ return _this._resolveNodeAsync(result, node, options);
4089
+ }
4090
+ return _this._resolveNode(result, node, options);
4091
+ });
3953
4092
  this.evaluate = this.evaluate.bind(this);
3954
4093
  }
3955
4094
  _create_class(ExpressionEvaluator, [
@@ -3987,6 +4126,14 @@ var ReferenceAssetsPlugin = function() {
3987
4126
  return this._execString(String(expression), resolvedOpts);
3988
4127
  }
3989
4128
  },
4129
+ {
4130
+ key: "evaluateAsync",
4131
+ value: function evaluateAsync(expr, options) {
4132
+ return this.evaluate(expr, _object_spread_props(_object_spread({}, options), {
4133
+ async: true
4134
+ }));
4135
+ }
4136
+ },
3990
4137
  {
3991
4138
  key: "addExpressionFunction",
3992
4139
  value: function addExpressionFunction(name, handler) {
@@ -4032,8 +4179,10 @@ var ReferenceAssetsPlugin = function() {
4032
4179
  var matches = exp.match(/^@\[(.*)\]@$/);
4033
4180
  var matchedExp = exp;
4034
4181
  if (matches) {
4035
- var ref;
4036
- ref = _sliced_to_array(Array.from(matches), 2), matchedExp = ref[1], ref;
4182
+ var _Array_from = _sliced_to_array(Array.from(matches), 2), matched = _Array_from[1];
4183
+ if (matched) {
4184
+ matchedExp = matched;
4185
+ }
4037
4186
  }
4038
4187
  var storedAST;
4039
4188
  try {
@@ -4100,14 +4249,7 @@ var ReferenceAssetsPlugin = function() {
4100
4249
  return;
4101
4250
  }
4102
4251
  if (node.type === "Object") {
4103
- var attributes = node.attributes;
4104
- var resolvedAttributes = {};
4105
- attributes.forEach(function(attr) {
4106
- var key = resolveNode(attr.key);
4107
- var value = resolveNode(attr.value);
4108
- resolvedAttributes[key] = value;
4109
- });
4110
- return resolvedAttributes;
4252
+ return PromiseCollectionHandler.handleObject(node.attributes, resolveNode);
4111
4253
  }
4112
4254
  if (node.type === "CallExpression") {
4113
4255
  var expressionName = node.callTarget.name;
@@ -4158,13 +4300,18 @@ var ReferenceAssetsPlugin = function() {
4158
4300
  return;
4159
4301
  }
4160
4302
  if (node.type === "ConditionalExpression") {
4161
- var result = resolveNode(node.test) ? node.consequent : node.alternate;
4162
- return resolveNode(result);
4303
+ var testResult = resolveNode(node.test);
4304
+ return handleConditionalBranching(testResult, function() {
4305
+ return node.consequent;
4306
+ }, function() {
4307
+ return node.alternate;
4308
+ }, resolveNode);
4163
4309
  }
4164
4310
  if (node.type === "ArrayExpression") {
4165
- return node.elements.map(function(ele) {
4311
+ var results = node.elements.map(function(ele) {
4166
4312
  return resolveNode(ele);
4167
4313
  });
4314
+ return PromiseCollectionHandler.handleArray(results);
4168
4315
  }
4169
4316
  if (node.type === "Modification") {
4170
4317
  var operation = this.operators.binary.get(node.operator);
@@ -4194,6 +4341,459 @@ var ReferenceAssetsPlugin = function() {
4194
4341
  return resolveNode(node.left);
4195
4342
  }
4196
4343
  }
4344
+ },
4345
+ {
4346
+ key: "_resolveNodeAsync",
4347
+ value: function _resolveNodeAsync(_currentValue, node, options) {
4348
+ var _this = this;
4349
+ return _async_to_generator(function() {
4350
+ var resolveNode, model, expressionContext, operator, _tmp, _tmp1, operator1, _tmp2, _tmp3, attributes, resolvedAttributes, expressionName, operator2, args, obj, prop, value, value1, testResult, result, branchResult, operation, newValue, _tmp4, _tmp5;
4351
+ return _ts_generator(this, function(_state) {
4352
+ switch(_state.label){
4353
+ case 0:
4354
+ resolveNode = options.resolveNode, model = options.model;
4355
+ expressionContext = _object_spread_props(_object_spread({}, options), {
4356
+ evaluate: function(expr) {
4357
+ return _this.evaluate(expr, options);
4358
+ }
4359
+ });
4360
+ if (!(node.type === "BinaryExpression" || node.type === "LogicalExpression")) return [
4361
+ 3,
4362
+ 7
4363
+ ];
4364
+ operator = _this.operators.binary.get(node.operator);
4365
+ if (!operator) return [
4366
+ 3,
4367
+ 6
4368
+ ];
4369
+ if (!("resolveParams" in operator)) return [
4370
+ 3,
4371
+ 3
4372
+ ];
4373
+ if (operator.resolveParams === false) {
4374
+ return [
4375
+ 2,
4376
+ operator(expressionContext, node.left, node.right)
4377
+ ];
4378
+ }
4379
+ _tmp = [
4380
+ expressionContext
4381
+ ];
4382
+ return [
4383
+ 4,
4384
+ resolveNode(node.left)
4385
+ ];
4386
+ case 1:
4387
+ _tmp = _tmp.concat([
4388
+ _state.sent()
4389
+ ]);
4390
+ return [
4391
+ 4,
4392
+ resolveNode(node.right)
4393
+ ];
4394
+ case 2:
4395
+ return [
4396
+ 2,
4397
+ operator.apply(void 0, _tmp.concat([
4398
+ _state.sent()
4399
+ ]))
4400
+ ];
4401
+ case 3:
4402
+ return [
4403
+ 4,
4404
+ resolveNode(node.left)
4405
+ ];
4406
+ case 4:
4407
+ _tmp1 = [
4408
+ _state.sent()
4409
+ ];
4410
+ return [
4411
+ 4,
4412
+ resolveNode(node.right)
4413
+ ];
4414
+ case 5:
4415
+ return [
4416
+ 2,
4417
+ operator.apply(void 0, _tmp1.concat([
4418
+ _state.sent()
4419
+ ]))
4420
+ ];
4421
+ case 6:
4422
+ return [
4423
+ 2
4424
+ ];
4425
+ case 7:
4426
+ if (!(node.type === "UnaryExpression")) return [
4427
+ 3,
4428
+ 14
4429
+ ];
4430
+ operator1 = _this.operators.unary.get(node.operator);
4431
+ if (!operator1) return [
4432
+ 3,
4433
+ 13
4434
+ ];
4435
+ if (!("resolveParams" in operator1)) return [
4436
+ 3,
4437
+ 11
4438
+ ];
4439
+ _tmp2 = [
4440
+ expressionContext
4441
+ ];
4442
+ if (!(operator1.resolveParams === false)) return [
4443
+ 3,
4444
+ 8
4445
+ ];
4446
+ _tmp3 = node.argument;
4447
+ return [
4448
+ 3,
4449
+ 10
4450
+ ];
4451
+ case 8:
4452
+ return [
4453
+ 4,
4454
+ resolveNode(node.argument)
4455
+ ];
4456
+ case 9:
4457
+ _tmp3 = _state.sent();
4458
+ _state.label = 10;
4459
+ case 10:
4460
+ return [
4461
+ 2,
4462
+ operator1.apply(void 0, _tmp2.concat([
4463
+ _tmp3
4464
+ ]))
4465
+ ];
4466
+ case 11:
4467
+ return [
4468
+ 4,
4469
+ resolveNode(node.argument)
4470
+ ];
4471
+ case 12:
4472
+ return [
4473
+ 2,
4474
+ operator1.apply(void 0, [
4475
+ _state.sent()
4476
+ ])
4477
+ ];
4478
+ case 13:
4479
+ return [
4480
+ 2
4481
+ ];
4482
+ case 14:
4483
+ if (!(node.type === "Object")) return [
4484
+ 3,
4485
+ 16
4486
+ ];
4487
+ attributes = node.attributes;
4488
+ resolvedAttributes = {};
4489
+ return [
4490
+ 4,
4491
+ Promise.all(attributes.map(function() {
4492
+ var _ref = _async_to_generator(function(attr) {
4493
+ var key, value;
4494
+ return _ts_generator(this, function(_state) {
4495
+ switch(_state.label){
4496
+ case 0:
4497
+ return [
4498
+ 4,
4499
+ resolveNode(attr.key)
4500
+ ];
4501
+ case 1:
4502
+ key = _state.sent();
4503
+ return [
4504
+ 4,
4505
+ resolveNode(attr.value)
4506
+ ];
4507
+ case 2:
4508
+ value = _state.sent();
4509
+ resolvedAttributes[key] = value;
4510
+ return [
4511
+ 2
4512
+ ];
4513
+ }
4514
+ });
4515
+ });
4516
+ return function(attr) {
4517
+ return _ref.apply(this, arguments);
4518
+ };
4519
+ }()))
4520
+ ];
4521
+ case 15:
4522
+ _state.sent();
4523
+ return [
4524
+ 2,
4525
+ resolvedAttributes
4526
+ ];
4527
+ case 16:
4528
+ if (!(node.type === "CallExpression")) return [
4529
+ 3,
4530
+ 18
4531
+ ];
4532
+ expressionName = node.callTarget.name;
4533
+ operator2 = _this.operators.expressions.get(expressionName);
4534
+ if (!operator2) {
4535
+ throw new Error("Unknown expression function: ".concat(expressionName));
4536
+ }
4537
+ if ("resolveParams" in operator2 && operator2.resolveParams === false) {
4538
+ return [
4539
+ 2,
4540
+ operator2.apply(void 0, [
4541
+ expressionContext
4542
+ ].concat(_to_consumable_array(node.args)))
4543
+ ];
4544
+ }
4545
+ return [
4546
+ 4,
4547
+ Promise.all(node.args.map(function() {
4548
+ var _ref = _async_to_generator(function(n) {
4549
+ return _ts_generator(this, function(_state) {
4550
+ switch(_state.label){
4551
+ case 0:
4552
+ return [
4553
+ 4,
4554
+ resolveNode(n)
4555
+ ];
4556
+ case 1:
4557
+ return [
4558
+ 2,
4559
+ _state.sent()
4560
+ ];
4561
+ }
4562
+ });
4563
+ });
4564
+ return function(n) {
4565
+ return _ref.apply(this, arguments);
4566
+ };
4567
+ }()))
4568
+ ];
4569
+ case 17:
4570
+ args = _state.sent();
4571
+ return [
4572
+ 2,
4573
+ operator2.apply(void 0, [
4574
+ expressionContext
4575
+ ].concat(_to_consumable_array(args)))
4576
+ ];
4577
+ case 18:
4578
+ if (node.type === "ModelRef") {
4579
+ return [
4580
+ 2,
4581
+ model.get(node.ref, {
4582
+ context: {
4583
+ model: options.model
4584
+ }
4585
+ })
4586
+ ];
4587
+ }
4588
+ if (!(node.type === "MemberExpression")) return [
4589
+ 3,
4590
+ 21
4591
+ ];
4592
+ return [
4593
+ 4,
4594
+ resolveNode(node.object)
4595
+ ];
4596
+ case 19:
4597
+ obj = _state.sent();
4598
+ return [
4599
+ 4,
4600
+ resolveNode(node.property)
4601
+ ];
4602
+ case 20:
4603
+ prop = _state.sent();
4604
+ return [
4605
+ 2,
4606
+ obj[prop]
4607
+ ];
4608
+ case 21:
4609
+ if (!(node.type === "Assignment")) return [
4610
+ 3,
4611
+ 26
4612
+ ];
4613
+ if (!(node.left.type === "ModelRef")) return [
4614
+ 3,
4615
+ 23
4616
+ ];
4617
+ return [
4618
+ 4,
4619
+ resolveNode(node.right)
4620
+ ];
4621
+ case 22:
4622
+ value = _state.sent();
4623
+ model.set([
4624
+ [
4625
+ node.left.ref,
4626
+ value
4627
+ ]
4628
+ ]);
4629
+ return [
4630
+ 2,
4631
+ value
4632
+ ];
4633
+ case 23:
4634
+ if (!(node.left.type === "Identifier")) return [
4635
+ 3,
4636
+ 25
4637
+ ];
4638
+ return [
4639
+ 4,
4640
+ resolveNode(node.right)
4641
+ ];
4642
+ case 24:
4643
+ value1 = _state.sent();
4644
+ _this.vars[node.left.name] = value1;
4645
+ return [
4646
+ 2,
4647
+ value1
4648
+ ];
4649
+ case 25:
4650
+ return [
4651
+ 2
4652
+ ];
4653
+ case 26:
4654
+ if (!(node.type === "ConditionalExpression")) return [
4655
+ 3,
4656
+ 29
4657
+ ];
4658
+ return [
4659
+ 4,
4660
+ resolveNode(node.test)
4661
+ ];
4662
+ case 27:
4663
+ testResult = _state.sent();
4664
+ result = testResult ? node.consequent : node.alternate;
4665
+ return [
4666
+ 4,
4667
+ resolveNode(result)
4668
+ ];
4669
+ case 28:
4670
+ branchResult = _state.sent();
4671
+ return [
4672
+ 2,
4673
+ branchResult
4674
+ ];
4675
+ case 29:
4676
+ if (node.type === "ArrayExpression") {
4677
+ return [
4678
+ 2,
4679
+ Promise.all(node.elements.map(function() {
4680
+ var _ref = _async_to_generator(function(ele) {
4681
+ return _ts_generator(this, function(_state) {
4682
+ switch(_state.label){
4683
+ case 0:
4684
+ return [
4685
+ 4,
4686
+ resolveNode(ele)
4687
+ ];
4688
+ case 1:
4689
+ return [
4690
+ 2,
4691
+ _state.sent()
4692
+ ];
4693
+ }
4694
+ });
4695
+ });
4696
+ return function(ele) {
4697
+ return _ref.apply(this, arguments);
4698
+ };
4699
+ }()))
4700
+ ];
4701
+ }
4702
+ if (!(node.type === "Modification")) return [
4703
+ 3,
4704
+ 39
4705
+ ];
4706
+ operation = _this.operators.binary.get(node.operator);
4707
+ if (!operation) return [
4708
+ 3,
4709
+ 38
4710
+ ];
4711
+ if (!("resolveParams" in operation)) return [
4712
+ 3,
4713
+ 34
4714
+ ];
4715
+ if (!(operation.resolveParams === false)) return [
4716
+ 3,
4717
+ 30
4718
+ ];
4719
+ newValue = operation(expressionContext, node.left, node.right);
4720
+ return [
4721
+ 3,
4722
+ 33
4723
+ ];
4724
+ case 30:
4725
+ _tmp4 = [
4726
+ expressionContext
4727
+ ];
4728
+ return [
4729
+ 4,
4730
+ resolveNode(node.left)
4731
+ ];
4732
+ case 31:
4733
+ _tmp4 = _tmp4.concat([
4734
+ _state.sent()
4735
+ ]);
4736
+ return [
4737
+ 4,
4738
+ resolveNode(node.right)
4739
+ ];
4740
+ case 32:
4741
+ newValue = operation.apply(void 0, _tmp4.concat([
4742
+ _state.sent()
4743
+ ]));
4744
+ _state.label = 33;
4745
+ case 33:
4746
+ return [
4747
+ 3,
4748
+ 37
4749
+ ];
4750
+ case 34:
4751
+ return [
4752
+ 4,
4753
+ resolveNode(node.left)
4754
+ ];
4755
+ case 35:
4756
+ _tmp5 = [
4757
+ _state.sent()
4758
+ ];
4759
+ return [
4760
+ 4,
4761
+ resolveNode(node.right)
4762
+ ];
4763
+ case 36:
4764
+ newValue = operation.apply(void 0, _tmp5.concat([
4765
+ _state.sent()
4766
+ ]));
4767
+ _state.label = 37;
4768
+ case 37:
4769
+ if (node.left.type === "ModelRef") {
4770
+ model.set([
4771
+ [
4772
+ node.left.ref,
4773
+ newValue
4774
+ ]
4775
+ ]);
4776
+ } else if (node.left.type === "Identifier") {
4777
+ _this.vars[node.left.name] = newValue;
4778
+ }
4779
+ return [
4780
+ 2,
4781
+ newValue
4782
+ ];
4783
+ case 38:
4784
+ return [
4785
+ 2,
4786
+ resolveNode(node.left)
4787
+ ];
4788
+ case 39:
4789
+ return [
4790
+ 2,
4791
+ _this._resolveNode(_currentValue, node, options)
4792
+ ];
4793
+ }
4794
+ });
4795
+ })();
4796
+ }
4197
4797
  }
4198
4798
  ]);
4199
4799
  return ExpressionEvaluator;
@@ -7745,15 +8345,56 @@ var ReferenceAssetsPlugin = function() {
7745
8345
  validationController.reset();
7746
8346
  }
7747
8347
  });
7748
- flow.hooks.afterTransition.tap("player", function(flowInstance) {
7749
- var _flowInstance_currentState;
7750
- var value = (_flowInstance_currentState = flowInstance.currentState) === null || _flowInstance_currentState === void 0 ? void 0 : _flowInstance_currentState.value;
7751
- if (value && value.state_type === "ACTION") {
7752
- var exp = value.exp;
7753
- flowController === null || flowController === void 0 ? void 0 : flowController.transition(String(expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(exp)));
7754
- }
7755
- expressionEvaluator.reset();
7756
- });
8348
+ flow.hooks.afterTransition.tap("player", function() {
8349
+ var _ref = _async_to_generator(function(flowInstance) {
8350
+ var _flowInstance_currentState, value, exp, result, e;
8351
+ return _ts_generator(this, function(_state) {
8352
+ switch(_state.label){
8353
+ case 0:
8354
+ value = (_flowInstance_currentState = flowInstance.currentState) === null || _flowInstance_currentState === void 0 ? void 0 : _flowInstance_currentState.value;
8355
+ if (!(value && value.state_type === "ACTION")) return [
8356
+ 3,
8357
+ 4
8358
+ ];
8359
+ exp = value.exp;
8360
+ _state.label = 1;
8361
+ case 1:
8362
+ _state.trys.push([
8363
+ 1,
8364
+ 3,
8365
+ ,
8366
+ 4
8367
+ ]);
8368
+ return [
8369
+ 4,
8370
+ expressionEvaluator.evaluateAsync(exp)
8371
+ ];
8372
+ case 2:
8373
+ result = _state.sent();
8374
+ flowController === null || flowController === void 0 ? void 0 : flowController.transition(String(result));
8375
+ return [
8376
+ 3,
8377
+ 4
8378
+ ];
8379
+ case 3:
8380
+ e = _state.sent();
8381
+ flowResultDeferred.reject(e);
8382
+ return [
8383
+ 3,
8384
+ 4
8385
+ ];
8386
+ case 4:
8387
+ expressionEvaluator.reset();
8388
+ return [
8389
+ 2
8390
+ ];
8391
+ }
8392
+ });
8393
+ });
8394
+ return function(flowInstance) {
8395
+ return _ref.apply(this, arguments);
8396
+ };
8397
+ }());
7757
8398
  });
7758
8399
  this.hooks.dataController.call(dataController);
7759
8400
  validationController.setOptions({