tods-competition-factory 1.9.0 → 1.9.2

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.
@@ -1637,7 +1637,6 @@ function handleCaughtError$1(_a) {
1637
1637
  var globalState = {
1638
1638
  tournamentFactoryVersion: '0.0.0',
1639
1639
  timers: { default: { elapsedTime: 0 } },
1640
- iterators: { makeDeepCopy: 0 },
1641
1640
  deepCopyAttributes: {
1642
1641
  stringify: [],
1643
1642
  ignore: [],
@@ -1720,12 +1719,6 @@ function setGlobalLog(loggingFx) {
1720
1719
  function setDevContext(value) {
1721
1720
  globalState.devContext = value;
1722
1721
  }
1723
- function setDeepCopyIterations(value) {
1724
- globalState.iterators.makeDeepCopy = value;
1725
- }
1726
- function getDeepCopyIterations() {
1727
- return globalState.iterators.makeDeepCopy;
1728
- }
1729
1722
  function disableNotifications() {
1730
1723
  _globalStateProvider.disableNotifications();
1731
1724
  }
@@ -1821,7 +1814,14 @@ function handleCaughtError(_a) {
1821
1814
  }
1822
1815
  function globalLog$1(engine, log) {
1823
1816
  if (globalState.globalLog) {
1824
- return globalState.globalLog(engine, log);
1817
+ try {
1818
+ globalState.globalLog(engine, log);
1819
+ }
1820
+ catch (error) {
1821
+ console.log('globalLog error', error);
1822
+ console.log(engine, log);
1823
+ setGlobalLog(); // delete failing custom globalLog
1824
+ }
1825
1825
  }
1826
1826
  else {
1827
1827
  console.log(engine, log);
@@ -2193,18 +2193,6 @@ iteration // escape hatch - check against iteration threshold
2193
2193
  (typeof (deepCopy === null || deepCopy === void 0 ? void 0 : deepCopy.threshold) === 'number' && iteration >= deepCopy.threshold)) {
2194
2194
  return sourceObject;
2195
2195
  }
2196
- var devContext = getDevContext({ makeDeepCopy: true });
2197
- if (devContext) {
2198
- setDeepCopyIterations(iteration);
2199
- if (typeof devContext === 'object' &&
2200
- (iteration > (devContext.iterationThreshold || 15) ||
2201
- (devContext.firstIteration && iteration === 0)) &&
2202
- devContext.log &&
2203
- (!devContext.notInternalUse ||
2204
- (devContext.notInternalUse && !internalUse))) {
2205
- console.log({ devContext: devContext, iteration: iteration, internalUse: internalUse }, sourceObject);
2206
- }
2207
- }
2208
2196
  var targetObject = Array.isArray(sourceObject) ? [] : {};
2209
2197
  var sourceObjectKeys = Object.keys(sourceObject).filter(function (key) {
2210
2198
  return !internalUse ||
@@ -2421,6 +2409,12 @@ var extractAttributes = function (accessor) { return function (element) {
2421
2409
  })) ||
2422
2410
  ((_a = (typeof accessor === 'string' && getAccessorValue({ element: element, accessor: accessor }))) === null || _a === void 0 ? void 0 : _a.value);
2423
2411
  }; };
2412
+ function getDefinedKeys(obj, ignoreValues, ignoreEmptyArrays) {
2413
+ return Object.keys(obj).filter(function (key) {
2414
+ return !ignoreValues.includes(obj[key]) &&
2415
+ (!ignoreEmptyArrays || (Array.isArray(obj[key]) ? obj[key].length : true));
2416
+ });
2417
+ }
2424
2418
  function definedAttributes(obj, ignoreFalse, ignoreEmptyArrays, shallow) {
2425
2419
  if (typeof obj !== 'object' || obj === null)
2426
2420
  return obj;
@@ -2430,10 +2424,7 @@ function definedAttributes(obj, ignoreFalse, ignoreEmptyArrays, shallow) {
2430
2424
  var ignoreValues = ['', undefined, null];
2431
2425
  if (ignoreFalse)
2432
2426
  ignoreValues.push(false);
2433
- var definedKeys = Object.keys(obj).filter(function (key) {
2434
- return !ignoreValues.includes(obj[key]) &&
2435
- (!ignoreEmptyArrays || (Array.isArray(obj[key]) ? obj[key].length : true));
2436
- });
2427
+ var definedKeys = getDefinedKeys(obj, ignoreValues, ignoreEmptyArrays);
2437
2428
  return Object.assign.apply(Object, __spreadArray([{}], __read(definedKeys.map(function (key) {
2438
2429
  var _a, _b;
2439
2430
  return Array.isArray(obj[key])
@@ -2955,7 +2946,7 @@ var matchUpFormatCode = {
2955
2946
  };
2956
2947
 
2957
2948
  function factoryVersion() {
2958
- return '1.9.0';
2949
+ return '1.9.2';
2959
2950
  }
2960
2951
 
2961
2952
  function getObjectTieFormat(obj) {
@@ -11709,8 +11700,8 @@ var toBePlayed = {
11709
11700
  };
11710
11701
 
11711
11702
  function modifyMatchUpScore(_a) {
11712
- var _b, e_1, _c;
11713
- var _d, _e, _f, _g, _h, _j, _k, _l;
11703
+ var e_1, _b;
11704
+ var _c, _d, _e, _f, _g, _h, _j, _k, _l;
11714
11705
  var matchUpStatusCodes = _a.matchUpStatusCodes, removeWinningSide = _a.removeWinningSide, tournamentRecord = _a.tournamentRecord, drawDefinition = _a.drawDefinition, matchUpFormat = _a.matchUpFormat, matchUpStatus = _a.matchUpStatus, removeScore = _a.removeScore, winningSide = _a.winningSide, matchUpId = _a.matchUpId, matchUp = _a.matchUp, // matchUp without context
11715
11706
  event = _a.event, notes = _a.notes, score = _a.score;
11716
11707
  var stack = 'modifyMatchUpScore';
@@ -11767,16 +11758,16 @@ function modifyMatchUpScore(_a) {
11767
11758
  matchUp.matchUpStatus = MatchUpStatusEnum.InProgress;
11768
11759
  }
11769
11760
  var defaultedProcessCodes;
11770
- if ((wasDefaulted && ((_d = matchUp === null || matchUp === void 0 ? void 0 : matchUp.processCodes) === null || _d === void 0 ? void 0 : _d.length)) ||
11761
+ if ((wasDefaulted && ((_c = matchUp === null || matchUp === void 0 ? void 0 : matchUp.processCodes) === null || _c === void 0 ? void 0 : _c.length)) ||
11771
11762
  matchUpStatus === DEFAULTED) {
11772
- var appliedPolicies = (_e = getAppliedPolicies({
11763
+ var appliedPolicies = (_d = getAppliedPolicies({
11773
11764
  tournamentRecord: tournamentRecord,
11774
11765
  drawDefinition: drawDefinition,
11775
11766
  structure: structure,
11776
11767
  event: event,
11777
- })) === null || _e === void 0 ? void 0 : _e.appliedPolicies;
11768
+ })) === null || _d === void 0 ? void 0 : _d.appliedPolicies;
11778
11769
  defaultedProcessCodes =
11779
- (_g = (_f = appliedPolicies === null || appliedPolicies === void 0 ? void 0 : appliedPolicies[POLICY_TYPE_SCORING]) === null || _f === void 0 ? void 0 : _f.processCodes) === null || _g === void 0 ? void 0 : _g.incompleteAssignmentsOnDefault;
11770
+ (_f = (_e = appliedPolicies === null || appliedPolicies === void 0 ? void 0 : appliedPolicies[POLICY_TYPE_SCORING]) === null || _e === void 0 ? void 0 : _e.processCodes) === null || _f === void 0 ? void 0 : _f.incompleteAssignmentsOnDefault;
11780
11771
  }
11781
11772
  if (!matchUp.collectionId) {
11782
11773
  var isRoundRobin = (structure === null || structure === void 0 ? void 0 : structure.structureType) === CONTAINER;
@@ -11835,7 +11826,7 @@ function modifyMatchUpScore(_a) {
11835
11826
  var matchUpsMap = (sendInContext || defaultedProcessCodes) &&
11836
11827
  getMatchUpsMap({ drawDefinition: drawDefinition });
11837
11828
  var inContextMatchUp = matchUpsMap &&
11838
- ((_h = getAllDrawMatchUps({
11829
+ ((_g = getAllDrawMatchUps({
11839
11830
  // client will not normally be receiving participants for the first time...
11840
11831
  // ... and should therefore already have groupings / ratings / rankings for participants
11841
11832
  // participantsProfile: { withGroupings: true },
@@ -11845,23 +11836,18 @@ function modifyMatchUpScore(_a) {
11845
11836
  inContext: true,
11846
11837
  drawDefinition: drawDefinition,
11847
11838
  matchUpsMap: matchUpsMap,
11848
- }).matchUps) === null || _h === void 0 ? void 0 : _h[0]);
11839
+ }).matchUps) === null || _g === void 0 ? void 0 : _g[0]);
11849
11840
  if (sendInContext && inContextMatchUp) {
11850
11841
  updateInContextMatchUp({ tournamentId: tournamentId, inContextMatchUp: inContextMatchUp });
11851
11842
  }
11852
11843
  if (Array.isArray(defaultedProcessCodes) &&
11853
11844
  inContextMatchUp &&
11854
- !((_j = inContextMatchUp.sides) === null || _j === void 0 ? void 0 : _j.every(function (_a) {
11845
+ !((_h = inContextMatchUp.sides) === null || _h === void 0 ? void 0 : _h.every(function (_a) {
11855
11846
  var participantId = _a.participantId;
11856
11847
  return participantId;
11857
11848
  }))) {
11858
11849
  if (matchUpStatus === DEFAULTED) {
11859
- if (matchUp.processCodes) {
11860
- (_b = matchUp.processCodes).push.apply(_b, __spreadArray([], __read(defaultedProcessCodes), false));
11861
- }
11862
- else {
11863
- matchUp.processCodes = defaultedProcessCodes;
11864
- }
11850
+ matchUp.processCodes = unique(__spreadArray(__spreadArray([], __read(((_j = matchUp.processCodes) !== null && _j !== void 0 ? _j : [])), false), __read(defaultedProcessCodes), false));
11865
11851
  }
11866
11852
  else {
11867
11853
  try {
@@ -11875,7 +11861,7 @@ function modifyMatchUpScore(_a) {
11875
11861
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
11876
11862
  finally {
11877
11863
  try {
11878
- if (_o && !_o.done && (_c = _m.return)) _c.call(_m);
11864
+ if (_o && !_o.done && (_b = _m.return)) _b.call(_m);
11879
11865
  }
11880
11866
  finally { if (e_1) throw e_1.error; }
11881
11867
  }
@@ -28293,6 +28279,12 @@ function getValidSwapAction(_a) {
28293
28279
  return {};
28294
28280
  }
28295
28281
 
28282
+ /**
28283
+ * Calculates the valid actions for a draw position based on the provided parameters.
28284
+ *
28285
+ * @param params - The parameters for calculating the position actions.
28286
+ * @returns An object containing the valid actions for the draw position.
28287
+ */
28296
28288
  function positionActions$1(params) {
28297
28289
  var _a, _b, _c, _d;
28298
28290
  var specifiedPolicyDefinitions = params.policyDefinitions, _e = params.tournamentParticipants, tournamentParticipants = _e === void 0 ? [] : _e, _f = params.returnParticipants, returnParticipants = _f === void 0 ? true : _f, provisionalPositioning = params.provisionalPositioning, tournamentRecord = params.tournamentRecord, drawDefinition = params.drawDefinition, drawPosition = params.drawPosition, event = params.event;
@@ -28401,12 +28393,12 @@ function positionActions$1(params) {
28401
28393
  var isActiveDrawPosition = activeDrawPositions.includes(drawPosition);
28402
28394
  if (actionsDisabled)
28403
28395
  return {
28396
+ hasPositionAssigned: !!positionAssignment,
28404
28397
  info: 'Actions Disabled for structure',
28405
- isByePosition: isByePosition,
28406
28398
  isActiveDrawPosition: isActiveDrawPosition,
28407
28399
  isDrawPosition: true,
28408
- hasPositionAssigned: !!positionAssignment,
28409
28400
  validActions: [],
28401
+ isByePosition: isByePosition,
28410
28402
  };
28411
28403
  if (isAvailableAction({ policyActions: policyActions, action: ASSIGN_PARTICIPANT }) &&
28412
28404
  !isActiveDrawPosition &&
@@ -29159,6 +29151,43 @@ function updateFactoryExtension(_a) {
29159
29151
  addExtension$1({ element: tournamentRecord, extension: updatedExtension });
29160
29152
  }
29161
29153
 
29154
+ function engineLogging(_a) {
29155
+ var _b, _c;
29156
+ var methodName = _a.methodName, elapsed = _a.elapsed, engine = _a.engine, params = _a.params, result = _a.result;
29157
+ var devContext = getDevContext();
29158
+ if (typeof devContext !== 'object')
29159
+ return;
29160
+ var log = { method: methodName };
29161
+ var logError = (result === null || result === void 0 ? void 0 : result.error) &&
29162
+ (devContext.errors === true ||
29163
+ (Array.isArray(devContext.errors) &&
29164
+ devContext.errors.includes(methodName)));
29165
+ var specifiedMethodParams = Array.isArray(devContext.params) && ((_b = devContext.params) === null || _b === void 0 ? void 0 : _b.includes(methodName));
29166
+ var logParams = (devContext.params && !Array.isArray(devContext.params)) ||
29167
+ specifiedMethodParams;
29168
+ var exclude = Array.isArray(devContext.exclude) &&
29169
+ devContext.exclude.includes(methodName);
29170
+ if (!exclude &&
29171
+ ![undefined, false].includes(devContext.perf) &&
29172
+ (isNaN(devContext.perf) || elapsed > devContext.perf)) {
29173
+ log.elapsed = elapsed;
29174
+ }
29175
+ if (!exclude && (logError || logParams)) {
29176
+ log.params = params;
29177
+ }
29178
+ if (!exclude &&
29179
+ (logError ||
29180
+ (devContext.result &&
29181
+ !Array.isArray(devContext.result) &&
29182
+ (!Array.isArray(devContext.params) || specifiedMethodParams)) ||
29183
+ (Array.isArray(devContext.result) &&
29184
+ ((_c = devContext.result) === null || _c === void 0 ? void 0 : _c.includes(methodName))))) {
29185
+ log.result = result;
29186
+ }
29187
+ if (Object.keys(log).length > 1)
29188
+ globalLog$1(engine, log);
29189
+ }
29190
+
29162
29191
  var _a$2;
29163
29192
  function notifySubscribers(params) {
29164
29193
  var e_1, _a;
@@ -32098,22 +32127,18 @@ function conditionallyAdvanceDrawPosition(params) {
32098
32127
  sourceSideNumber = 2;
32099
32128
  }
32100
32129
  }
32101
- else {
32102
- if (targetMatchUp.feedRound) {
32103
- // if different structureIds then structureId that is not equivalent to noContextTargetMatchUp.structureId is fed
32104
- // ... and fed positions are always sideNumber 1
32105
- if (sourceMatchUp.structureId === targetMatchUp.structureId) {
32106
- sourceSideNumber = 2;
32107
- }
32108
- else {
32109
- sourceSideNumber = 1;
32110
- }
32130
+ else if (targetMatchUp.feedRound) {
32131
+ // if different structureIds then structureId that is not equivalent to noContextTargetMatchUp.structureId is fed
32132
+ // ... and fed positions are always sideNumber 1
32133
+ if (sourceMatchUp.structureId === targetMatchUp.structureId) {
32134
+ sourceSideNumber = 2;
32111
32135
  }
32112
32136
  else {
32113
- if (walkoverWinningSide)
32114
- sourceSideNumber = 3 - walkoverWinningSide;
32137
+ sourceSideNumber = 1;
32115
32138
  }
32116
32139
  }
32140
+ else if (walkoverWinningSide)
32141
+ sourceSideNumber = 3 - walkoverWinningSide;
32117
32142
  }
32118
32143
  var sourceMatchUpStatus = params.matchUpStatus;
32119
32144
  var pairedMatchUpStatus = pairedPreviousMatchUp === null || pairedPreviousMatchUp === void 0 ? void 0 : pairedPreviousMatchUp.matchUpStatus;
@@ -44093,42 +44118,6 @@ function setState$4(records, deepCopyOption) {
44093
44118
  return setTournamentRecords(deepCopyOption ? makeDeepCopy(records) : records);
44094
44119
  }
44095
44120
 
44096
- function engineLogging(_a) {
44097
- var _b, _c;
44098
- var result = _a.result, methodName = _a.methodName, elapsed = _a.elapsed, params = _a.params, engine = _a.engine;
44099
- var devContext = getDevContext();
44100
- var log = { method: methodName };
44101
- var logError = (result === null || result === void 0 ? void 0 : result.error) &&
44102
- (devContext.errors === true ||
44103
- (Array.isArray(devContext.errors) &&
44104
- devContext.errors.includes(methodName)));
44105
- var specifiedMethodParams = Array.isArray(devContext.params) && ((_b = devContext.params) === null || _b === void 0 ? void 0 : _b.includes(methodName));
44106
- var logParams = (devContext.params && !Array.isArray(devContext.params)) ||
44107
- specifiedMethodParams;
44108
- var exclude = Array.isArray(devContext.exclude) &&
44109
- devContext.exclude.includes(methodName);
44110
- if (!exclude &&
44111
- ![undefined, false].includes(devContext.perf) &&
44112
- (isNaN(devContext.perf) || elapsed > devContext.perf))
44113
- log.elapsed = elapsed;
44114
- if (!exclude && (logError || logParams)) {
44115
- log.params = params;
44116
- }
44117
- if (!exclude &&
44118
- (logError ||
44119
- (devContext.result &&
44120
- !Array.isArray(devContext.result) &&
44121
- (!Array.isArray(devContext.params) || specifiedMethodParams)) ||
44122
- (Array.isArray(devContext.result) &&
44123
- ((_c = devContext.result) === null || _c === void 0 ? void 0 : _c.includes(methodName))))) {
44124
- log.result = result;
44125
- }
44126
- if (Object.keys(log).length > 1)
44127
- globalLog$1(engine, log);
44128
- if (result && devContext.makeDeepCopy)
44129
- result.deepCopyIterations = getDeepCopyIterations();
44130
- }
44131
-
44132
44121
  var competitionEngine = (function () {
44133
44122
  var engine = {
44134
44123
  getState: function (params) {
@@ -44258,11 +44247,11 @@ var competitionEngine = (function () {
44258
44247
  }
44259
44248
  function executionQueue(directives, rollbackOnError) {
44260
44249
  var e_1, _a;
44261
- var _b;
44262
44250
  if (!Array.isArray(directives))
44263
44251
  return { error: INVALID_VALUES };
44264
44252
  var tournamentRecords = getTournamentRecords();
44265
44253
  var activeTournamentId = getTournamentId();
44254
+ var start = Date.now();
44266
44255
  var snapshot = rollbackOnError && makeDeepCopy(tournamentRecords, false, true);
44267
44256
  var timeStamp;
44268
44257
  var results = [];
@@ -44274,12 +44263,8 @@ var competitionEngine = (function () {
44274
44263
  var methodName = directive.method, params = directive.params;
44275
44264
  if (!engine[methodName]) {
44276
44265
  var result_1 = { error: METHOD_NOT_FOUND, methodName: methodName };
44277
- var devContext = getDevContext();
44278
- if ((devContext.result && !Array.isArray(devContext.result)) ||
44279
- (Array.isArray(devContext.result) &&
44280
- ((_b = devContext.result) === null || _b === void 0 ? void 0 : _b.includes(methodName)))) {
44281
- console.log('ce:', result_1);
44282
- }
44266
+ var elapsed = Date.now() - start;
44267
+ engineLogging({ result: result_1, methodName: methodName, elapsed: elapsed, params: params, engine: 'ce:' });
44283
44268
  return result_1;
44284
44269
  }
44285
44270
  var result_2 = executeFunction(tournamentRecords, engine[methodName], __assign({ activeTournamentId: activeTournamentId }, params), methodName);
@@ -44767,10 +44752,11 @@ function generateQualifyingStructures(_a) {
44767
44752
  var stageSequence = 1, targetRoundQualifiersCount = 0, finalQualifyingRoundNumber = void 0, finalQualifyingStructureId = void 0, linkType = void 0;
44768
44753
  var _loop_1 = function (structureProfile) {
44769
44754
  var _j;
44770
- var drawSize = structureProfile.drawSize ||
44771
- coerceEven(structureProfile.participantsCount);
44772
- var qualifyingRoundNumber = structureProfile.qualifyingRoundNumber, qualifyingPositions = structureProfile.qualifyingPositions, structureOptions = structureProfile.structureOptions, matchUpFormat = structureProfile.matchUpFormat, structureName = structureProfile.structureName, structureId = structureProfile.structureId, drawType = structureProfile.drawType;
44755
+ var drawSize = coerceEven(structureProfile.drawSize || structureProfile.participantsCount);
44756
+ var qualifyingRoundNumber = structureProfile.qualifyingRoundNumber, structureOptions = structureProfile.structureOptions, matchUpFormat = structureProfile.matchUpFormat, structureName = structureProfile.structureName, structureId = structureProfile.structureId, drawType = structureProfile.drawType;
44773
44757
  var matchUpType = structureProfile.matchUpType;
44758
+ var qualifyingPositions = structureProfile.qualifyingPositions ||
44759
+ deriveQualifyingPositions({ drawSize: drawSize, qualifyingRoundNumber: qualifyingRoundNumber });
44774
44760
  var roundLimit, structure = void 0, matchUps = void 0;
44775
44761
  if (!isConvertableInteger(drawSize)) {
44776
44762
  return { value: decorateResult({
@@ -44896,6 +44882,16 @@ function generateQualifyingStructures(_a) {
44896
44882
  }
44897
44883
  return __assign(__assign({ qualifiersCount: totalQualifiersCount, qualifyingDrawPositionsCount: qualifyingDrawPositionsCount, qualifyingDetails: qualifyingDetails, structures: structures }, SUCCESS), { links: links });
44898
44884
  }
44885
+ function deriveQualifyingPositions(_a) {
44886
+ var drawSize = _a.drawSize, qualifyingRoundNumber = _a.qualifyingRoundNumber;
44887
+ var qualifyingPositions = drawSize;
44888
+ var divisionsCount = 0;
44889
+ while (divisionsCount < qualifyingRoundNumber) {
44890
+ qualifyingPositions = Math.floor(qualifyingPositions / 2);
44891
+ divisionsCount += 1;
44892
+ }
44893
+ return qualifyingPositions;
44894
+ }
44899
44895
 
44900
44896
  function getPositionRangeMap(_a) {
44901
44897
  var _b;
@@ -53562,7 +53558,6 @@ function getNextUnfilledDrawPositions(_a) {
53562
53558
  var _b = structureAssignedDrawPositions({
53563
53559
  structure: result.structure,
53564
53560
  }).positionAssignments, positionAssignments = _b === void 0 ? [] : _b;
53565
- // console.log('gnudp', { provisionalPositioning });
53566
53561
  var unfilledPositions = getNextSeedBlock({
53567
53562
  provisionalPositioning: provisionalPositioning,
53568
53563
  randomize: true,
@@ -61395,11 +61390,9 @@ function replaceTieMatchUpParticipantId(params) {
61395
61390
  }
61396
61391
  if (substitution || ((_u = side.substitutions) === null || _u === void 0 ? void 0 : _u.length) === 1) {
61397
61392
  if (substitution) {
61398
- var processCodes = (_v = tieMatchUp === null || tieMatchUp === void 0 ? void 0 : tieMatchUp.processCodes) !== null && _v !== void 0 ? _v : [];
61399
- if (substitutionProcessCodes)
61400
- processCodes.push.apply(processCodes, __spreadArray([], __read(substitutionProcessCodes), false));
61401
- if (tieMatchUp)
61402
- tieMatchUp.processCodes = processCodes;
61393
+ if (substitutionProcessCodes && tieMatchUp) {
61394
+ tieMatchUp.processCodes = unique(__spreadArray(__spreadArray([], __read(((_v = tieMatchUp === null || tieMatchUp === void 0 ? void 0 : tieMatchUp.processCodes) !== null && _v !== void 0 ? _v : [])), false), __read(substitutionProcessCodes), false));
61395
+ }
61403
61396
  }
61404
61397
  else {
61405
61398
  try {
@@ -67091,9 +67084,9 @@ var tournamentEngine = (function () {
67091
67084
  }
67092
67085
  function executionQueue(directives, rollbackOnError) {
67093
67086
  var e_1, _a;
67094
- var _b;
67095
67087
  if (!Array.isArray(directives))
67096
67088
  return { error: INVALID_VALUES };
67089
+ var start = Date.now();
67097
67090
  var tournamentId = getTournamentId();
67098
67091
  var tournamentRecord = getTournamentRecord(tournamentId);
67099
67092
  var snapshot = rollbackOnError && makeDeepCopy(tournamentRecord, false, true);
@@ -67106,12 +67099,8 @@ var tournamentEngine = (function () {
67106
67099
  var methodName = directive.method, params = directive.params;
67107
67100
  if (!engine[methodName]) {
67108
67101
  var result_1 = { error: METHOD_NOT_FOUND, methodName: methodName };
67109
- var devContext = getDevContext();
67110
- if ((devContext.result && !Array.isArray(devContext.result)) ||
67111
- (Array.isArray(devContext.result) &&
67112
- ((_b = devContext.result) === null || _b === void 0 ? void 0 : _b.includes(methodName)))) {
67113
- console.log('te:', result_1);
67114
- }
67102
+ var elapsed = Date.now() - start;
67103
+ engineLogging({ result: result_1, methodName: methodName, elapsed: elapsed, params: params, engine: 'te:' });
67115
67104
  return result_1;
67116
67105
  }
67117
67106
  var result_2 = executeFunction(tournamentRecord, engine[methodName], params, methodName);