fable 3.0.133 → 3.0.135

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.
@@ -3376,9 +3376,20 @@ var tmpValue=tmpManifest.getValueByHash(tmpDataSource,tmpToken.Token);// if (!tm
3376
3376
  // // If no hash resolves, try by address.
3377
3377
  // tmpValue = tmpManifest.getValueAtAddress(tmpToken.Token, tmpDataSource);
3378
3378
  // }
3379
- if(!tmpValue){tmpResults.ExpressionParserLog.push("WARNING: ExpressionParser.substituteValuesInTokenizedObjects found no value for the symbol hash or address ".concat(tmpToken.Token," at index ").concat(i));this.log.warn(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);continue;}else{tmpResults.ExpressionParserLog.push("INFO: ExpressionParser.substituteValuesInTokenizedObjects found a value [".concat(tmpValue,"] for the state address ").concat(tmpToken.Token," at index ").concat(i));this.log.info(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);try{var tmpValueParsed=new this.fable.Utility.bigNumber(tmpValue);tmpToken.Resolved=true;tmpToken.Value=tmpValueParsed.toString();}catch(pError){tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.substituteValuesInTokenizedObjects found a non-numeric value for the state address ".concat(tmpToken.Token," at index ").concat(i));this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);tmpToken.Resolved=false;}}}if(pTokenizedObjects[i].Type==='Token.StateAddress'&&!tmpToken.Resolved){// Symbols are always hashes. This gracefully works for simple shallow objects because hashes default to the address in Manyfest.
3380
- var _tmpValue3=tmpManifest.getValueAtAddress(tmpDataSource,tmpToken.Token);if(!_tmpValue3){tmpResults.ExpressionParserLog.push("WARNING: ExpressionParser.substituteValuesInTokenizedObjects found no value for the state address ".concat(tmpToken.Token," at index ").concat(i));this.log.warn(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);continue;}else{tmpResults.ExpressionParserLog.push("INFO: ExpressionParser.substituteValuesInTokenizedObjects found a value [".concat(_tmpValue3,"] for the state address ").concat(tmpToken.Token," at index ").concat(i));this.log.info(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);try{var _tmpValueParsed=new this.fable.Utility.bigNumber(_tmpValue3);tmpToken.Resolved=true;tmpToken.Value=_tmpValueParsed.toString();}catch(pError){tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.substituteValuesInTokenizedObjects found a non-numeric value for the state address ".concat(tmpToken.Token," at index ").concat(i));this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);tmpToken.Resolved=false;}}}if(pTokenizedObjects[i].Type==='Token.Constant'&&!tmpToken.Resolved){tmpResults.ExpressionParserLog.push("INFO: ExpressionParser.substituteValuesInTokenizedObjects found a value [".concat(tmpToken.Token,"] for the constant ").concat(tmpToken.Token," at index ").concat(i));this.log.info(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);try{var _tmpValueParsed2=new this.fable.Utility.bigNumber(tmpToken.Token);tmpToken.Resolved=true;tmpToken.Value=_tmpValueParsed2.toString();}catch(pError){// This constant has the right symbols but apparently isn't a parsable number.
3381
- tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.substituteValuesInTokenizedObjects found a non-numeric value for the state address ".concat(tmpToken.Token," at index ").concat(i));this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);tmpToken.Resolved=false;}}}return pTokenizedObjects;}},{key:"tokenize",value:function tokenize(pExpression,pResultObject){return this.Tokenizer.tokenize(pExpression,pResultObject);}},{key:"lintTokenizedExpression",value:function lintTokenizedExpression(pTokenizedExpression,pResultObject){return this.Linter.lintTokenizedExpression(pTokenizedExpression,pResultObject);}},{key:"buildPostfixedSolveList",value:function buildPostfixedSolveList(pTokenizedExpression,pResultObject){return this.Postfix.buildPostfixedSolveList(pTokenizedExpression,pResultObject);}},{key:"solvePostfixedExpression",value:function solvePostfixedExpression(pPostfixedExpression,pDataDestinationObject,pResultObject,pManifest){return this.Solver.solvePostfixedExpression(pPostfixedExpression,pDataDestinationObject,pResultObject,pManifest);}},{key:"solve",value:function solve(pExpression,pDataSourceObject,pResultObject,pManifest,pDataDestinationObject){var tmpResultsObject=_typeof(pResultObject)==='object'?pResultObject:{};var tmpDataSourceObject=_typeof(pDataSourceObject)==='object'?pDataSourceObject:{};var tmpDataDestinationObject=_typeof(pDataDestinationObject)==='object'?pDataDestinationObject:{};this.tokenize(pExpression,tmpResultsObject);this.lintTokenizedExpression(tmpResultsObject.RawTokens,tmpResultsObject);this.buildPostfixedSolveList(tmpResultsObject.RawTokens,tmpResultsObject);this.substituteValuesInTokenizedObjects(tmpResultsObject.PostfixTokenObjects,tmpDataSourceObject,tmpResultsObject,pManifest);return this.solvePostfixedExpression(tmpResultsObject.PostfixSolveList,tmpDataDestinationObject,tmpResultsObject,pManifest);}}]);return FableServiceExpressionParser;}(libFableServiceBase);module.exports=FableServiceExpressionParser;},{"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-ExpressionTokenizer.js":137,"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-FunctionMap.json":138,"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-Linter.js":139,"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-Postfix.js":140,"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-SolvePostfixedExpression.js":141,"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-TokenMap.json":142,"big.js":17,"fable-serviceproviderbase":51}],136:[function(require,module,exports){var libFableServiceProviderBase=require('fable-serviceproviderbase');var ExpressionParserOperationBase=/*#__PURE__*/function(_libFableServiceProvi10){_inherits(ExpressionParserOperationBase,_libFableServiceProvi10);function ExpressionParserOperationBase(pFable,pOptions,pServiceHash){var _this25;_classCallCheck2(this,ExpressionParserOperationBase);_this25=_callSuper(this,ExpressionParserOperationBase,[pFable,pOptions,pServiceHash]);_this25.serviceType='ExpressionParserOperationBase';_this25.numberTest=/^-{0,1}\d*\.{0,1}\d+$/;_this25.ExpressionParser=false;return _this25;}_createClass2(ExpressionParserOperationBase,[{key:"connectExpressionParser",value:function connectExpressionParser(pExpressionParser){this.ExpressionParser=pExpressionParser;}},{key:"getTokenType",value:function getTokenType(pToken){if(pToken in this.ExpressionParser.tokenMap){return"Token.".concat(this.ExpressionParser.tokenMap[pToken].Type);}else if(pToken.length>2&&pToken[0]==='{'&&pToken[pToken.length-1]==='}'){return'Token.StateAddress';}else if(this.numberTest.test(pToken)){return'Token.Constant';}else{return'Token.Symbol';}// Just for documentation sake:
3379
+ if(!tmpValue){tmpResults.ExpressionParserLog.push("WARNING: ExpressionParser.substituteValuesInTokenizedObjects found no value for the symbol hash or address ".concat(tmpToken.Token," at index ").concat(i));this.log.warn(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);continue;}else{tmpResults.ExpressionParserLog.push("INFO: ExpressionParser.substituteValuesInTokenizedObjects found a value [".concat(tmpValue,"] for the state address ").concat(tmpToken.Token," at index ").concat(i));this.log.info(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);try{var tmpValueParsed=new this.fable.Utility.bigNumber(tmpValue);tmpToken.Resolved=true;tmpToken.Value=tmpValueParsed.toString();}catch(pError){// TODO: Should we allow this to be a function? Good god the complexity and beauty of that...
3380
+ if(Array.isArray(tmpValue)||_typeof(tmpValue)==='object'){tmpToken.Resolved=true;tmpToken.Value=tmpValue;}else{tmpResults.ExpressionParserLog.push("INFO: ExpressionParser.substituteValuesInTokenizedObjects found a non-numeric, non-set value for the state address ".concat(tmpToken.Token," at index ").concat(i));this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);tmpToken.Resolved=false;}}}}if(pTokenizedObjects[i].Type==='Token.StateAddress'&&!tmpToken.Resolved){// Symbols are always hashes. This gracefully works for simple shallow objects because hashes default to the address in Manyfest.
3381
+ var _tmpValue3=tmpManifest.getValueAtAddress(tmpDataSource,tmpToken.Token);if(!_tmpValue3){tmpResults.ExpressionParserLog.push("WARNING: ExpressionParser.substituteValuesInTokenizedObjects found no value for the state address ".concat(tmpToken.Token," at index ").concat(i));this.log.warn(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);continue;}else{//tmpResults.ExpressionParserLog.push(`INFO: ExpressionParser.substituteValuesInTokenizedObjects found a value [${tmpValue}] for the state address ${tmpToken.Token} at index ${i}`);
3382
+ this.log.info(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);try{var _tmpValueParsed=new this.fable.Utility.bigNumber(_tmpValue3);tmpToken.Resolved=true;tmpToken.Value=_tmpValueParsed.toString();}catch(pError){tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.substituteValuesInTokenizedObjects found a non-numeric value for the state address ".concat(tmpToken.Token," at index ").concat(i));this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);tmpToken.Resolved=false;}}}if(pTokenizedObjects[i].Type==='Token.Constant'&&!tmpToken.Resolved){tmpResults.ExpressionParserLog.push("INFO: ExpressionParser.substituteValuesInTokenizedObjects found a value [".concat(tmpToken.Token,"] for the constant ").concat(tmpToken.Token," at index ").concat(i));this.log.info(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);try{var _tmpValueParsed2=new this.fable.Utility.bigNumber(tmpToken.Token);tmpToken.Resolved=true;tmpToken.Value=_tmpValueParsed2.toString();}catch(pError){// This constant has the right symbols but apparently isn't a parsable number.
3383
+ tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.substituteValuesInTokenizedObjects found a non-numeric value for the state address ".concat(tmpToken.Token," at index ").concat(i));this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);tmpToken.Resolved=false;}}}return pTokenizedObjects;}},{key:"tokenize",value:function tokenize(pExpression,pResultObject){return this.Tokenizer.tokenize(pExpression,pResultObject);}},{key:"lintTokenizedExpression",value:function lintTokenizedExpression(pTokenizedExpression,pResultObject){return this.Linter.lintTokenizedExpression(pTokenizedExpression,pResultObject);}},{key:"buildPostfixedSolveList",value:function buildPostfixedSolveList(pTokenizedExpression,pResultObject){return this.Postfix.buildPostfixedSolveList(pTokenizedExpression,pResultObject);}},{key:"solvePostfixedExpression",value:function solvePostfixedExpression(pPostfixedExpression,pDataDestinationObject,pResultObject,pManifest){return this.Solver.solvePostfixedExpression(pPostfixedExpression,pDataDestinationObject,pResultObject,pManifest);}/**
3384
+ * Solves the given expression using the provided data and manifest.
3385
+ *
3386
+ * @param {string} pExpression - The expression to solve.
3387
+ * @param {object} pDataSourceObject - (optional) The data source object (e.g. AppData).
3388
+ * @param {object} pResultObject - (optional) The result object containing the full postfix expression list, internal variables and solver history.
3389
+ * @param {object} pManifest - (optional) The manifest object for dereferencing variables.
3390
+ * @param {object} pDataDestinationObject - (optional) The data destination object for where to marshal the result into.
3391
+ * @returns {any} - The result of solving the expression.
3392
+ */},{key:"solve",value:function solve(pExpression,pDataSourceObject,pResultObject,pManifest,pDataDestinationObject){var tmpResultsObject=_typeof(pResultObject)==='object'?pResultObject:{};var tmpDataSourceObject=_typeof(pDataSourceObject)==='object'?pDataSourceObject:{};var tmpDataDestinationObject=_typeof(pDataDestinationObject)==='object'?pDataDestinationObject:{};this.tokenize(pExpression,tmpResultsObject);this.lintTokenizedExpression(tmpResultsObject.RawTokens,tmpResultsObject);this.buildPostfixedSolveList(tmpResultsObject.RawTokens,tmpResultsObject);this.substituteValuesInTokenizedObjects(tmpResultsObject.PostfixTokenObjects,tmpDataSourceObject,tmpResultsObject,pManifest);return this.solvePostfixedExpression(tmpResultsObject.PostfixSolveList,tmpDataDestinationObject,tmpResultsObject,pManifest);}}]);return FableServiceExpressionParser;}(libFableServiceBase);module.exports=FableServiceExpressionParser;},{"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-ExpressionTokenizer.js":137,"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-FunctionMap.json":138,"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-Linter.js":139,"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-Postfix.js":140,"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-SolvePostfixedExpression.js":141,"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-TokenMap.json":142,"big.js":17,"fable-serviceproviderbase":51}],136:[function(require,module,exports){var libFableServiceProviderBase=require('fable-serviceproviderbase');var ExpressionParserOperationBase=/*#__PURE__*/function(_libFableServiceProvi10){_inherits(ExpressionParserOperationBase,_libFableServiceProvi10);function ExpressionParserOperationBase(pFable,pOptions,pServiceHash){var _this25;_classCallCheck2(this,ExpressionParserOperationBase);_this25=_callSuper(this,ExpressionParserOperationBase,[pFable,pOptions,pServiceHash]);_this25.serviceType='ExpressionParserOperationBase';_this25.numberTest=/^-{0,1}\d*\.{0,1}\d+$/;_this25.ExpressionParser=false;return _this25;}_createClass2(ExpressionParserOperationBase,[{key:"connectExpressionParser",value:function connectExpressionParser(pExpressionParser){this.ExpressionParser=pExpressionParser;}},{key:"getTokenType",value:function getTokenType(pToken){if(pToken in this.ExpressionParser.tokenMap){return"Token.".concat(this.ExpressionParser.tokenMap[pToken].Type);}else if(pToken.length>2&&pToken[0]==='{'&&pToken[pToken.length-1]==='}'){return'Token.StateAddress';}else if(this.numberTest.test(pToken)){return'Token.Constant';}else{return'Token.Symbol';}// Just for documentation sake:
3382
3393
  // There is a fifth token type, VirtualSymbol
3383
3394
  // This is a value that's added during solve and looked up by address in the VirtualSymbol object.
3384
3395
  }},{key:"getTokenContainerObject",value:function getTokenContainerObject(pToken,pTokenType){return{Token:pToken,Type:typeof pTokenType==='undefined'?this.getTokenType(pToken):pTokenType,Descriptor:pToken in this.ExpressionParser.tokenMap?this.ExpressionParser.tokenMap[pToken]:false};}}]);return ExpressionParserOperationBase;}(libFableServiceProviderBase);module.exports=ExpressionParserOperationBase;},{"fable-serviceproviderbase":51}],137:[function(require,module,exports){var libExpressionParserOperationBase=require('./Fable-Service-ExpressionParser-Base.js');var ExpressionTokenizer=/*#__PURE__*/function(_libExpressionParserO){_inherits(ExpressionTokenizer,_libExpressionParserO);function ExpressionTokenizer(pFable,pOptions,pServiceHash){var _this26;_classCallCheck2(this,ExpressionTokenizer);_this26=_callSuper(this,ExpressionTokenizer,[pFable,pOptions,pServiceHash]);_this26.serviceType='ExpressionParser-Tokenizer';return _this26;}_createClass2(ExpressionTokenizer,[{key:"tokenize",value:function tokenize(pExpression,pResultObject){var tmpResults=_typeof(pResultObject)==='object'?pResultObject:{ExpressionParserLog:[]};tmpResults.RawExpression=pExpression;tmpResults.RawTokens=[];tmpResults.ExpressionParserLog=[];if(typeof pExpression!=='string'){this.log.warn('ExpressionParser.tokenize was passed a non-string expression.');return tmpResults.RawTokens;}/* Tokenize the expression
@@ -3429,7 +3440,7 @@ tmpCurrentTokenType='Value';tmpCurrentToken+=tmpCharacter;// continue;
3429
3440
  // }
3430
3441
  // tmpResults.ExpressionParserLog.push(`ExpressionParser.tokenize found an unknown character code ${tmpCharCode} character ${tmpCharacter} in the expression: ${pExpression} at index ${i}`);
3431
3442
  // this.log.warn(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);
3432
- }if(tmpCurrentTokenType&&tmpCurrentToken.length>0){tmpResults.RawTokens.push(tmpCurrentToken);}return tmpResults.RawTokens;}}]);return ExpressionTokenizer;}(libExpressionParserOperationBase);module.exports=ExpressionTokenizer;},{"./Fable-Service-ExpressionParser-Base.js":136}],138:[function(require,module,exports){module.exports={"sqrt":{"Name":"Square Root","Address":"fable.Math.sqrtPrecise"},"abs":{"Name":"Absolute Value","Address":"fable.Math.absPrecise"},"rad":{"Name":"Degrees to Radians","Address":"fable.Math.radPrecise"},"sin":{"Name":"Sine","Address":"fable.Math.sin"}};},{}],139:[function(require,module,exports){var libExpressionParserOperationBase=require('./Fable-Service-ExpressionParser-Base.js');var ExpressionParserLinter=/*#__PURE__*/function(_libExpressionParserO2){_inherits(ExpressionParserLinter,_libExpressionParserO2);function ExpressionParserLinter(pFable,pOptions,pServiceHash){var _this27;_classCallCheck2(this,ExpressionParserLinter);_this27=_callSuper(this,ExpressionParserLinter,[pFable,pOptions,pServiceHash]);_this27.serviceType='ExpressionParser-Linter';return _this27;}_createClass2(ExpressionParserLinter,[{key:"lintTokenizedExpression",value:function lintTokenizedExpression(pTokenizedExpression,pResultObject){var tmpResults=_typeof(pResultObject)==='object'?pResultObject:{ExpressionParserLog:[]};tmpResults.LinterResults=[];// Guard against bad data being passed in
3443
+ }if(tmpCurrentTokenType&&tmpCurrentToken.length>0){tmpResults.RawTokens.push(tmpCurrentToken);}return tmpResults.RawTokens;}}]);return ExpressionTokenizer;}(libExpressionParserOperationBase);module.exports=ExpressionTokenizer;},{"./Fable-Service-ExpressionParser-Base.js":136}],138:[function(require,module,exports){module.exports={"sqrt":{"Name":"Square Root","Address":"fable.Math.sqrtPrecise"},"abs":{"Name":"Absolute Value","Address":"fable.Math.absPrecise"},"rad":{"Name":"Degrees to Radians","Address":"fable.Math.radPrecise"},"pi":{"Name":"Pi","Address":"fable.Math.piPrecise"},"sin":{"Name":"Sine","Address":"fable.Math.sin"},"cos":{"Name":"Cosine","Address":"fable.Math.cos"},"tan":{"Name":"Tangent","Address":"fable.Math.tan"},"count":{"Name":"Count Set Elements","Address":"fable.Math.countSetElements"},"sortset":{"Name":"Sort Set","Address":"fable.Math.sortSetPrecise"},"bucketset":{"Name":"Bucket Set","Address":"fable.Math.bucketSetPrecise"},"sorthistogram":{"Name":"Sort Histogram","Address":"fable.Math.sortHistogramPrecise"},"max":{"Name":"Maximum","Address":"fable.Math.maxPrecise"},"min":{"Name":"Minimum","Address":"fable.Math.minPrecise"},"sum":{"Name":"Sum","Address":"fable.Math.sumPrecise"},"avg":{"Name":"Average","Address":"fable.Math.averagePrecise"},"mean":{"Name":"Mean","Address":"fable.Math.meanPrecise"},"median":{"Name":"Median","Address":"fable.Math.medianPrecise"},"mode":{"Name":"Mode","Address":"fable.Math.modePrecise"}};},{}],139:[function(require,module,exports){var libExpressionParserOperationBase=require('./Fable-Service-ExpressionParser-Base.js');var ExpressionParserLinter=/*#__PURE__*/function(_libExpressionParserO2){_inherits(ExpressionParserLinter,_libExpressionParserO2);function ExpressionParserLinter(pFable,pOptions,pServiceHash){var _this27;_classCallCheck2(this,ExpressionParserLinter);_this27=_callSuper(this,ExpressionParserLinter,[pFable,pOptions,pServiceHash]);_this27.serviceType='ExpressionParser-Linter';return _this27;}_createClass2(ExpressionParserLinter,[{key:"lintTokenizedExpression",value:function lintTokenizedExpression(pTokenizedExpression,pResultObject){var tmpResults=_typeof(pResultObject)==='object'?pResultObject:{ExpressionParserLog:[]};tmpResults.LinterResults=[];// Guard against bad data being passed in
3433
3444
  if(!Array.isArray(pTokenizedExpression)){tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.lintTokenizedExpression was passed a non-array tokenized expression.");tmpResults.LinterResults.push(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);return pTokenizedExpression;}if(pTokenizedExpression.length<1){tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.lintTokenizedExpression was passed an empty tokenized expression.");tmpResults.LinterResults.push(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);return pTokenizedExpression;}// 1. Check for balanced parenthesis
3434
3445
  var tmpParenthesisDepth=0;// If it is in a state address, we don't care about the parenthesis
3435
3446
  // State addresses are between squiggly brackets
@@ -3533,17 +3544,17 @@ tmpFinalChainToken=_tmpToken2;}else if(_tmpToken2.Descriptor.Precedence<tmpLastP
3533
3544
  if(tmpDecreasingPrecedenceStack.length>0){for(var _j=tmpDecreasingPrecedenceStack.length-1;_j>=0;_j--){if(tmpDecreasingPrecedenceStack[_j].Descriptor.Precedence>=_tmpToken3.Descriptor.Precedence){//console.log(`Hoisting ${tmpDecreasingPrecedenceStack[j].Token} up to ${tmpToken.Token}`);
3534
3545
  tmpDecreasingPrecedenceStack[_j].LeftVirtualSymbolName=_tmpToken3.VirtualSymbolName;tmpDecreasingPrecedenceStack.slice(_j,1);break;}}}tmpLastToken=_tmpToken3;}else if(_tmpToken3.Descriptor.Precedence<tmpLastPrecedence){tmpDecreasingPrecedenceStack.push(tmpLastToken);tmpLastToken=_tmpToken3;}tmpLastPrecedence=_tmpToken3.Descriptor.Precedence;}}}// 5.3: Generate the Postfix Solve List
3535
3546
  for(var _tmpSolveLayerIndex3=0;_tmpSolveLayerIndex3<tmpSolveLayerKeys.length;_tmpSolveLayerIndex3++){var _tmpSolveLayerTokens3=tmpSolveLayerMap[tmpSolveLayerKeys[_tmpSolveLayerIndex3]];// If this is a layer with one value, presume it's an assignment.
3536
- if(_tmpSolveLayerTokens3.length===1){var tmpAbstractMultiplyToken=this.getTokenContainerObject('*');tmpAbstractMultiplyToken.VirtualSymbolName=tmpResults.PostfixLayerstackMap[_tmpSolveLayerTokens3[0].SolveLayerStack];// If this doesn't have a matching solvelayerstack, get the virtual symbol name from the parenthesis group it's in
3537
- if(!tmpAbstractMultiplyToken.VirtualSymbolName){for(var _i26=0;_i26<tmpResults.PostfixTokenObjects.length;_i26++){if(tmpResults.PostfixTokenObjects[_i26].ParenthesisStack===_tmpSolveLayerTokens3[0].SolveLayerStack){tmpAbstractMultiplyToken.VirtualSymbolName=tmpResults.PostfixTokenObjects[_i26].VirtualSymbolName;break;}}}tmpResults.PostfixSolveList.push(this.getPosfixSolveListOperation(tmpAbstractMultiplyToken,this.getTokenContainerObject('1.0'),_tmpSolveLayerTokens3[0]));continue;}// For each precedence level in the layer
3547
+ if(_tmpSolveLayerTokens3.length===1){var tmpAbstractAssignToken=this.getTokenContainerObject('=');tmpAbstractAssignToken.VirtualSymbolName=tmpResults.PostfixLayerstackMap[_tmpSolveLayerTokens3[0].SolveLayerStack];// If this doesn't have a matching solvelayerstack, get the virtual symbol name from the parenthesis group it's in
3548
+ if(!tmpAbstractAssignToken.VirtualSymbolName){for(var _i26=0;_i26<tmpResults.PostfixTokenObjects.length;_i26++){if(tmpResults.PostfixTokenObjects[_i26].ParenthesisStack===_tmpSolveLayerTokens3[0].SolveLayerStack){tmpAbstractAssignToken.VirtualSymbolName=tmpResults.PostfixTokenObjects[_i26].VirtualSymbolName;break;}}}tmpResults.PostfixSolveList.push(this.getPosfixSolveListOperation(tmpAbstractAssignToken,_tmpSolveLayerTokens3[0],this.getTokenContainerObject('0.0')));continue;}// For each precedence level in the layer
3538
3549
  for(var _tmpPrecedence=0;_tmpPrecedence<=this.ExpressionParser.tokenMaxPrecedence;_tmpPrecedence++){// Enumerate all tokens in a layer's expression.
3539
3550
  // There is a recursive way to do this, but given the short length of even the most complex equations we're favoring readability.
3540
3551
  for(var _i27=0;_i27<_tmpSolveLayerTokens3.length;_i27++){// If the token is an operator and at the current precedence, add it to the postfix solve list and mutate the array.
3541
3552
  if(_tmpSolveLayerTokens3[_i27].Type==='Token.Operator'&&_tmpSolveLayerTokens3[_i27].Descriptor.Precedence===_tmpPrecedence){var _tmpToken4=_tmpSolveLayerTokens3[_i27];// The - at the beginning of an expression is a number line orientation modifier
3542
3553
  if(_i27==0&&_tmpToken4.Token=='-'){// The number line negation operator is a special case that generates a virtual constant (-1.0) and multiplies it by the next token
3543
3554
  // This is an abstract operation that isn't in the expression.
3544
- var _tmpAbstractMultiplyToken=this.getTokenContainerObject('*');_tmpAbstractMultiplyToken.VirtualSymbolName=_tmpToken4.VirtualSymbolName;tmpResults.PostfixSolveList.push(this.getPosfixSolveListOperation(_tmpAbstractMultiplyToken,this.getTokenContainerObject('-1.0'),_tmpSolveLayerTokens3[_i27+1]));}// The - after an operator or an open parenthesis is also a number line orientation modifier
3555
+ var tmpAbstractMultiplyToken=this.getTokenContainerObject('*');tmpAbstractMultiplyToken.VirtualSymbolName=_tmpToken4.VirtualSymbolName;tmpResults.PostfixSolveList.push(this.getPosfixSolveListOperation(tmpAbstractMultiplyToken,this.getTokenContainerObject('-1.0'),_tmpSolveLayerTokens3[_i27+1]));}// The - after an operator or an open parenthesis is also a number line orientation modifier
3545
3556
  else if(_i27>0&&_tmpToken4.Token=='-'&&(_tmpSolveLayerTokens3[_i27-1].Type==='Token.Operator'||_tmpSolveLayerTokens3[_i27-1].Token==='(')){// The number line negation operator is a special case that generates a virtual constant (-1.0) and multiplies it by the next token
3546
- var _tmpAbstractMultiplyToken2=this.getTokenContainerObject('*');_tmpAbstractMultiplyToken2.VirtualSymbolName=_tmpToken4.VirtualSymbolName;tmpResults.PostfixSolveList.push(this.getPosfixSolveListOperation(_tmpAbstractMultiplyToken2,this.getTokenContainerObject('-1.0'),_tmpSolveLayerTokens3[_i27+1]));}// The + at the beginning is also a number line orientation modifier ... THAT WE IGNORE
3557
+ var _tmpAbstractMultiplyToken=this.getTokenContainerObject('*');_tmpAbstractMultiplyToken.VirtualSymbolName=_tmpToken4.VirtualSymbolName;tmpResults.PostfixSolveList.push(this.getPosfixSolveListOperation(_tmpAbstractMultiplyToken,this.getTokenContainerObject('-1.0'),_tmpSolveLayerTokens3[_i27+1]));}// The + at the beginning is also a number line orientation modifier ... THAT WE IGNORE
3547
3558
  else if(_i27==0&&_tmpToken4.Token=='+'){continue;}// The + after an operator or a parenthesis is also a number line orientation modifier ... THAT WE IGNORE
3548
3559
  else if(_i27>0&&_tmpToken4.Token=='+'&&(_tmpSolveLayerTokens3[_i27-1].Type==='Token.Operator'||_tmpSolveLayerTokens3[_i27-1].Token==='(')){continue;}// Finally add the dang thing.
3549
3560
  else{tmpResults.PostfixSolveList.push(this.getPosfixSolveListOperation(_tmpToken4,_tmpSolveLayerTokens3[_i27-1],_tmpSolveLayerTokens3[_i27+1],_tmpSolveLayerTokens3,_i27));}}else if(_tmpSolveLayerTokens3[_i27].Type==='Token.Function'&&_tmpPrecedence===0){var _tmpToken5=_tmpSolveLayerTokens3[_i27];tmpResults.PostfixSolveList.push(this.getPosfixSolveListOperation(_tmpToken5,_tmpSolveLayerTokens3[_i27+1],this.getTokenContainerObject('0.0')));}}}}// 7. Lastly set the assignment address.
@@ -3554,10 +3565,12 @@ if(tmpStepResultObject.ExpressionStep.LeftValue.Type==='Token.VirtualSymbol'){tm
3554
3565
  if(tmpStepResultObject.ExpressionStep.LeftValue.Type==='Token.Parenthesis'){tmpStepResultObject.ExpressionStep.LeftValue.Value=tmpManifest.getValueAtAddress(tmpResults.VirtualSymbols,tmpStepResultObject.ExpressionStep.LeftValue.VirtualSymbolName);}if(tmpStepResultObject.ExpressionStep.RightValue.Type==='Token.Parenthesis'){tmpStepResultObject.ExpressionStep.RightValue.Value=tmpManifest.getValueAtAddress(tmpResults.VirtualSymbols,tmpStepResultObject.ExpressionStep.RightValue.VirtualSymbolName);}// Virtual Constants
3555
3566
  if(tmpStepResultObject.ExpressionStep.LeftValue.Type==='Token.Constant'&&!('Value'in tmpStepResultObject.ExpressionStep.LeftValue)){tmpStepResultObject.ExpressionStep.LeftValue.Value=tmpStepResultObject.ExpressionStep.LeftValue.Token;}if(tmpStepResultObject.ExpressionStep.RightValue.Type==='Token.Constant'&&!('Value'in tmpStepResultObject.ExpressionStep.RightValue)){tmpStepResultObject.ExpressionStep.RightValue.Value=tmpStepResultObject.ExpressionStep.RightValue.Token;}if(tmpStepResultObject.ExpressionStep.Operation.Type='Operator'){// TODO: This can be optimized. A lot. If necessary. Seems pretty fast honestly for even thousands of operations. Slowest part is arbitrary precision.
3556
3567
  // An operator always has a left and right value.
3557
- var tmpFunctionAddress=false;if(tmpStepResultObject.ExpressionStep.Operation.Token in this.ExpressionParser.tokenMap){tmpFunctionAddress="ResultsObject.".concat(tmpStepResultObject.ExpressionStep.Operation.Descriptor.Function);}else if(tmpStepResultObject.ExpressionStep.Operation.Token.toLowerCase()in this.ExpressionParser.functionMap){tmpFunctionAddress="ResultsObject.".concat(this.ExpressionParser.functionMap[tmpStepResultObject.ExpressionStep.Operation.Token.toLowerCase()].Address);}try{this.log.trace("Solving Step ".concat(i," [").concat(tmpStepResultObject.ExpressionStep.VirtualSymbolName,"] --> [").concat(tmpStepResultObject.ExpressionStep.Operation.Token,"]: ( ").concat(tmpStepResultObject.ExpressionStep.LeftValue.Value," , ").concat(tmpStepResultObject.ExpressionStep.RightValue.Value," )"));tmpResults.VirtualSymbols[tmpStepResultObject.ExpressionStep.VirtualSymbolName]=tmpManifest.getValueAtAddress(tmpStepResultObject,"".concat(tmpFunctionAddress,"(ExpressionStep.LeftValue.Value,ExpressionStep.RightValue.Value)"));this.log.trace(" ---> Step ".concat(i,": ").concat(tmpResults.VirtualSymbols[tmpStepResultObject.ExpressionStep.VirtualSymbolName]));}catch(pError){tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.solvePostfixedExpression failed to solve step ".concat(i," with function ").concat(tmpStepResultObject.ExpressionStep.Operation.Token,"."));this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);return false;}// Equations don't always solve in virtual symbol order.
3568
+ var tmpFunctionAddress=false;if(tmpStepResultObject.ExpressionStep.Operation.Token in this.ExpressionParser.tokenMap){tmpFunctionAddress="ResultsObject.".concat(tmpStepResultObject.ExpressionStep.Operation.Descriptor.Function);}else if(tmpStepResultObject.ExpressionStep.Operation.Token.toLowerCase()in this.ExpressionParser.functionMap){tmpFunctionAddress="ResultsObject.".concat(this.ExpressionParser.functionMap[tmpStepResultObject.ExpressionStep.Operation.Token.toLowerCase()].Address);}try{//this.log.trace(`Solving Step ${i} [${tmpStepResultObject.ExpressionStep.VirtualSymbolName}] --> [${tmpStepResultObject.ExpressionStep.Operation.Token}]: ( ${tmpStepResultObject.ExpressionStep.LeftValue.Value} , ${tmpStepResultObject.ExpressionStep.RightValue.Value} )`);
3569
+ tmpResults.VirtualSymbols[tmpStepResultObject.ExpressionStep.VirtualSymbolName]=tmpManifest.getValueAtAddress(tmpStepResultObject,"".concat(tmpFunctionAddress,"(ExpressionStep.LeftValue.Value,ExpressionStep.RightValue.Value)"));//this.log.trace(` ---> Step ${i}: ${tmpResults.VirtualSymbols[tmpStepResultObject.ExpressionStep.VirtualSymbolName]}`)
3570
+ }catch(pError){tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.solvePostfixedExpression failed to solve step ".concat(i," with function ").concat(tmpStepResultObject.ExpressionStep.Operation.Token,": ").concat(pError));this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);return false;}// Equations don't always solve in virtual symbol order.
3558
3571
  tmpResults.SolverFinalVirtualSymbol=tmpStepResultObject.ExpressionStep.VirtualSymbolName;}}var tmpSolverResultValue=tmpManifest.getValueAtAddress(tmpResults,"VirtualSymbols.".concat(tmpResults.SolverFinalVirtualSymbol));// Now deal with final assignment
3559
3572
  for(var _i28=0;_i28<pPostfixedExpression.length;_i28++){if(pPostfixedExpression[_i28].Operation.Type==='Token.SolverInstruction'&&pPostfixedExpression[_i28].Operation.Token=='Assign'){tmpManifest.setValueAtAddress(tmpResults.VirtualSymbols,pPostfixedExpression[_i28].VirtualSymbolName,tmpSolverResultValue);tmpManifest.setValueByHash(tmpDataDestinationObject,pPostfixedExpression[_i28].VirtualSymbolName,tmpSolverResultValue);}}// Clean up the reference if we added it to the object.
3560
- if(!tmpPassedInFable){delete tmpResults.fable;}return tmpSolverResultValue.toString();}}]);return ExpressionParserSolver;}(libExpressionParserOperationBase);module.exports=ExpressionParserSolver;},{"./Fable-Service-ExpressionParser-Base.js":136}],142:[function(require,module,exports){module.exports={"=":{"Name":"Equals","Token":"=","Precedence":0,"Type":"Assignment"},"(":{"Name":"Left Parenthesis","Token":"(","Precedence":0,"Type":"Parenthesis"},")":{"Name":"Right Parenthesis","Token":")","Precedence":0,"Type":"Parenthesis"},"*":{"Name":"Multiply","Token":"*","Function":"fable.Math.multiplyPrecise","Precedence":3,"Type":"Operator"},"/":{"Name":"Divide","Token":"/","Function":"fable.Math.dividePrecise","Precedence":3,"Type":"Operator"},"^":{"Name":"Exponent","Token":"^","Function":"fable.Math.powerPrecise","Precedence":1,"Type":"Operator"},"%":{"Name":"Modulus","Token":"%","Function":"fable.Math.modPrecise","Precedence":3,"Type":"Operator"},"+":{"Name":"Add","Token":"+","Function":"fable.Math.addPrecise","Precedence":4,"Type":"Operator"},"-":{"Name":"Subtract","Token":"-","Function":"fable.Math.subtractPrecise","Precedence":4,"Type":"Operator"}};},{}],143:[function(require,module,exports){(function(process){(function(){var libFableServiceBase=require('fable-serviceproviderbase');var libFS=require('fs');var libPath=require('path');var libReadline=require('readline');var FableServiceFilePersistence=/*#__PURE__*/function(_libFableServiceBase5){_inherits(FableServiceFilePersistence,_libFableServiceBase5);function FableServiceFilePersistence(pFable,pOptions,pServiceHash){var _this30;_classCallCheck2(this,FableServiceFilePersistence);_this30=_callSuper(this,FableServiceFilePersistence,[pFable,pOptions,pServiceHash]);_this30.serviceType='FilePersistence';if(!('Mode'in _this30.options)){_this30.options.Mode=parseInt('0777',8)&~process.umask();}_this30.libFS=libFS;_this30.libPath=libPath;_this30.libReadline=libReadline;return _this30;}_createClass2(FableServiceFilePersistence,[{key:"joinPath",value:function joinPath(){return libPath.resolve.apply(libPath,arguments);}},{key:"existsSync",value:function existsSync(pPath){return libFS.existsSync(pPath);}},{key:"exists",value:function exists(pPath,fCallback){var tmpFileExists=this.existsSync(pPath);;return fCallback(null,tmpFileExists);}},{key:"appendFileSync",value:function appendFileSync(pFileName,pAppendContent,pOptions){var tmpOptions=typeof pOptions==='undefined'?'utf8':pOptions;return libFS.appendFileSync(pFileName,pAppendContent,tmpOptions);}},{key:"deleteFileSync",value:function deleteFileSync(pFileName){return libFS.unlinkSync(pFileName);}},{key:"deleteFolderSync",value:function deleteFolderSync(pFileName){return libFS.rmdirSync(pFileName);}},{key:"readFileSync",value:function readFileSync(pFilePath,pOptions){var tmpOptions=typeof pOptions==='undefined'?'utf8':pOptions;return libFS.readFileSync(pFilePath,tmpOptions);}},{key:"readFile",value:function readFile(pFilePath,pOptions,fCallback){var tmpOptions=typeof pOptions==='undefined'?'utf8':pOptions;return libFS.readFile(pFilePath,tmpOptions,fCallback);}},{key:"writeFileSync",value:function writeFileSync(pFileName,pFileContent,pOptions){var tmpOptions=typeof pOptions==='undefined'?'utf8':pOptions;return libFS.writeFileSync(pFileName,pFileContent,tmpOptions);}},{key:"writeFileSyncFromObject",value:function writeFileSyncFromObject(pFileName,pObject){return this.writeFileSync(pFileName,JSON.stringify(pObject,null,4));}},{key:"writeFileSyncFromArray",value:function writeFileSyncFromArray(pFileName,pFileArray){if(!Array.isArray(pFileArray)){this.log.error("File Persistence Service attempted to write ".concat(pFileName," from array but the expected array was not an array (it was a ").concat(_typeof(pFileArray),")."));return Error('Attempted to write ${pFileName} from array but the expected array was not an array (it was a ${typeof(pFileArray)}).');}else{for(var i=0;i<pFileArray.length;i++){return this.appendFileSync(pFileName,"".concat(pFileArray[i],"\n"));}}}},{key:"writeFile",value:function writeFile(pFileName,pFileContent,pOptions,fCallback){var tmpOptions=typeof pOptions==='undefined'?'utf8':pOptions;return libFS.writeFile(pFileName,pFileContent,tmpOptions,fCallback);}},{key:"lineReaderFactory",value:function lineReaderFactory(pFilePath,fOnLine,fOnComplete,fOnError){var tmpLineReader={};if(typeof pFilePath!='string'){return false;}tmpLineReader.filePath=pFilePath;tmpLineReader.fileStream=libFS.createReadStream(tmpLineReader.filePath);tmpLineReader.reader=libReadline.createInterface({input:tmpLineReader.fileStream,crlfDelay:Infinity});if(typeof fOnError==='function'){tmpLineReader.reader.on('error',fOnError);}tmpLineReader.reader.on('line',typeof fOnLine==='function'?fOnLine:function(){});if(typeof fOnComplete==='function'){tmpLineReader.reader.on('close',fOnComplete);}return tmpLineReader;}// Folder management
3573
+ if(!tmpPassedInFable){delete tmpResults.fable;}return tmpSolverResultValue.toString();}}]);return ExpressionParserSolver;}(libExpressionParserOperationBase);module.exports=ExpressionParserSolver;},{"./Fable-Service-ExpressionParser-Base.js":136}],142:[function(require,module,exports){module.exports={"=":{"Name":"Equals","Token":"=","Function":"fable.Math.assignValue","Precedence":0,"Type":"Assignment"},"(":{"Name":"Left Parenthesis","Token":"(","Precedence":0,"Type":"Parenthesis"},")":{"Name":"Right Parenthesis","Token":")","Precedence":0,"Type":"Parenthesis"},"*":{"Name":"Multiply","Token":"*","Function":"fable.Math.multiplyPrecise","Precedence":3,"Type":"Operator"},"/":{"Name":"Divide","Token":"/","Function":"fable.Math.dividePrecise","Precedence":3,"Type":"Operator"},"^":{"Name":"Exponent","Token":"^","Function":"fable.Math.powerPrecise","Precedence":1,"Type":"Operator"},"%":{"Name":"Modulus","Token":"%","Function":"fable.Math.modPrecise","Precedence":3,"Type":"Operator"},"+":{"Name":"Add","Token":"+","Function":"fable.Math.addPrecise","Precedence":4,"Type":"Operator"},"-":{"Name":"Subtract","Token":"-","Function":"fable.Math.subtractPrecise","Precedence":4,"Type":"Operator"}};},{}],143:[function(require,module,exports){(function(process){(function(){var libFableServiceBase=require('fable-serviceproviderbase');var libFS=require('fs');var libPath=require('path');var libReadline=require('readline');var FableServiceFilePersistence=/*#__PURE__*/function(_libFableServiceBase5){_inherits(FableServiceFilePersistence,_libFableServiceBase5);function FableServiceFilePersistence(pFable,pOptions,pServiceHash){var _this30;_classCallCheck2(this,FableServiceFilePersistence);_this30=_callSuper(this,FableServiceFilePersistence,[pFable,pOptions,pServiceHash]);_this30.serviceType='FilePersistence';if(!('Mode'in _this30.options)){_this30.options.Mode=parseInt('0777',8)&~process.umask();}_this30.libFS=libFS;_this30.libPath=libPath;_this30.libReadline=libReadline;return _this30;}_createClass2(FableServiceFilePersistence,[{key:"joinPath",value:function joinPath(){return libPath.resolve.apply(libPath,arguments);}},{key:"existsSync",value:function existsSync(pPath){return libFS.existsSync(pPath);}},{key:"exists",value:function exists(pPath,fCallback){var tmpFileExists=this.existsSync(pPath);;return fCallback(null,tmpFileExists);}},{key:"appendFileSync",value:function appendFileSync(pFileName,pAppendContent,pOptions){var tmpOptions=typeof pOptions==='undefined'?'utf8':pOptions;return libFS.appendFileSync(pFileName,pAppendContent,tmpOptions);}},{key:"deleteFileSync",value:function deleteFileSync(pFileName){return libFS.unlinkSync(pFileName);}},{key:"deleteFolderSync",value:function deleteFolderSync(pFileName){return libFS.rmdirSync(pFileName);}},{key:"readFileSync",value:function readFileSync(pFilePath,pOptions){var tmpOptions=typeof pOptions==='undefined'?'utf8':pOptions;return libFS.readFileSync(pFilePath,tmpOptions);}},{key:"readFile",value:function readFile(pFilePath,pOptions,fCallback){var tmpOptions=typeof pOptions==='undefined'?'utf8':pOptions;return libFS.readFile(pFilePath,tmpOptions,fCallback);}},{key:"writeFileSync",value:function writeFileSync(pFileName,pFileContent,pOptions){var tmpOptions=typeof pOptions==='undefined'?'utf8':pOptions;return libFS.writeFileSync(pFileName,pFileContent,tmpOptions);}},{key:"writeFileSyncFromObject",value:function writeFileSyncFromObject(pFileName,pObject){return this.writeFileSync(pFileName,JSON.stringify(pObject,null,4));}},{key:"writeFileSyncFromArray",value:function writeFileSyncFromArray(pFileName,pFileArray){if(!Array.isArray(pFileArray)){this.log.error("File Persistence Service attempted to write ".concat(pFileName," from array but the expected array was not an array (it was a ").concat(_typeof(pFileArray),")."));return Error('Attempted to write ${pFileName} from array but the expected array was not an array (it was a ${typeof(pFileArray)}).');}else{for(var i=0;i<pFileArray.length;i++){return this.appendFileSync(pFileName,"".concat(pFileArray[i],"\n"));}}}},{key:"writeFile",value:function writeFile(pFileName,pFileContent,pOptions,fCallback){var tmpOptions=typeof pOptions==='undefined'?'utf8':pOptions;return libFS.writeFile(pFileName,pFileContent,tmpOptions,fCallback);}},{key:"lineReaderFactory",value:function lineReaderFactory(pFilePath,fOnLine,fOnComplete,fOnError){var tmpLineReader={};if(typeof pFilePath!='string'){return false;}tmpLineReader.filePath=pFilePath;tmpLineReader.fileStream=libFS.createReadStream(tmpLineReader.filePath);tmpLineReader.reader=libReadline.createInterface({input:tmpLineReader.fileStream,crlfDelay:Infinity});if(typeof fOnError==='function'){tmpLineReader.reader.on('error',fOnError);}tmpLineReader.reader.on('line',typeof fOnLine==='function'?fOnLine:function(){});if(typeof fOnComplete==='function'){tmpLineReader.reader.on('close',fOnComplete);}return tmpLineReader;}// Folder management
3561
3574
  },{key:"makeFolderRecursive",value:function makeFolderRecursive(pParameters,fCallback){var _this31=this;var tmpParameters=pParameters;if(typeof pParameters=='string'){tmpParameters={Path:pParameters};}else if(_typeof(pParameters)!=='object'){fCallback(new Error('Parameters object or string not properly passed to recursive folder create.'));return false;}if(typeof tmpParameters.Path!=='string'){fCallback(new Error('Parameters object needs a path to run the folder create operation.'));return false;}if(!('Mode'in tmpParameters)){tmpParameters.Mode=this.options.Mode;}// Check if we are just starting .. if so, build the initial state for our recursive function
3562
3575
  if(typeof tmpParameters.CurrentPathIndex==='undefined'){// Build the tools to start recursing
3563
3576
  tmpParameters.ActualPath=libPath.normalize(tmpParameters.Path);tmpParameters.ActualPathParts=tmpParameters.ActualPath.split(libPath.sep);tmpParameters.CurrentPathIndex=0;tmpParameters.CurrentPath='';}else{// This is not our first run, so we will continue the recursion.
@@ -3567,28 +3580,237 @@ tmpParameters.CurrentPathIndex++;}// Check if the path is fully complete
3567
3580
  if(tmpParameters.CurrentPathIndex>=tmpParameters.ActualPathParts.length){return fCallback(null);}// Check if the path exists (and is a folder)
3568
3581
  libFS.open(tmpParameters.CurrentPath+libPath.sep+tmpParameters.ActualPathParts[tmpParameters.CurrentPathIndex],'r',function(pError,pFileDescriptor){if(pFileDescriptor){libFS.closeSync(pFileDescriptor);}if(pError&&pError.code=='ENOENT'){/* Path doesn't exist, create it */libFS.mkdir(tmpParameters.CurrentPath+libPath.sep+tmpParameters.ActualPathParts[tmpParameters.CurrentPathIndex],tmpParameters.Mode,function(pCreateError){if(!pCreateError){// We have now created our folder and there was no error -- continue.
3569
3582
  return _this31.makeFolderRecursive(tmpParameters,fCallback);}else if(pCreateError.code=='EEXIST'){// The folder exists -- our dev might be running this in parallel/async/whatnot.
3570
- return _this31.makeFolderRecursive(tmpParameters,fCallback);}else{console.log(pCreateError.code);return fCallback(pCreateError);}});}else{return _this31.makeFolderRecursive(tmpParameters,fCallback);}});}}]);return FableServiceFilePersistence;}(libFableServiceBase);module.exports=FableServiceFilePersistence;}).call(this);}).call(this,require('_process'));},{"_process":87,"fable-serviceproviderbase":51,"fs":19,"path":83,"readline":19}],144:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');/**
3583
+ return _this31.makeFolderRecursive(tmpParameters,fCallback);}else{console.log(pCreateError.code);return fCallback(pCreateError);}});}else{return _this31.makeFolderRecursive(tmpParameters,fCallback);}});}}]);return FableServiceFilePersistence;}(libFableServiceBase);module.exports=FableServiceFilePersistence;}).call(this);}).call(this,require('_process'));},{"_process":87,"fable-serviceproviderbase":51,"fs":19,"path":83,"readline":19}],144:[function(require,module,exports){/**
3584
+ * @file Fable-Service-Math.js
3585
+ * @description This file contains the implementation of the FableServiceMath class, which provides simple functions for performing arbitrary precision math operations.
3586
+ * @module FableServiceMath
3587
+ * @extends libFableServiceBase
3588
+ */var libFableServiceBase=require('fable-serviceproviderbase');/**
3571
3589
  * Arbitrary Precision Math Operations
3572
3590
  * @author Steven Velozo <steven@velozo.com>
3573
3591
  * @description Simple functions that perform arbitrary precision math operations and return string resultant values. Wraps big.js
3574
3592
  * @class FableServiceMath
3575
3593
  * @extends libFableServiceBase
3576
- */var FableServiceMath=/*#__PURE__*/function(_libFableServiceBase6){_inherits(FableServiceMath,_libFableServiceBase6);function FableServiceMath(pFable,pOptions,pServiceHash){var _this32;_classCallCheck2(this,FableServiceMath);_this32=_callSuper(this,FableServiceMath,[pFable,pOptions,pServiceHash]);_this32.serviceType='Math';return _this32;}/*
3577
- Pass-through Rounding Method Constants
3578
-
3579
- Property Value BigDecimal Equiv Description
3580
- ---------- ----- ---------------- -----------
3581
- roundDown 0 ROUND_DOWN Rounds towards zero. (_I.e. truncate, no rounding._)
3582
- roundHalfUp 1 ROUND_HALF_UP Rounds towards nearest neighbour. (_If equidistant, rounds away from zero._)
3583
- roundHalfEven 2 ROUND_HALF_EVEN Rounds towards nearest neighbour. (_If equidistant, rounds towards even neighbour._)
3584
- roundUp 3 ROUND_UP Rounds positively away from zero. (_Always round up._)
3585
- */_createClass2(FableServiceMath,[{key:"roundDown",get:function get(){return this.fable.Utility.bigNumber.roundDown;}},{key:"roundHalfUp",get:function get(){return this.fable.Utility.bigNumber.roundHalfUp;}},{key:"roundHalfEven",get:function get(){return this.fable.Utility.bigNumber.roundHalfEven;}},{key:"roundUp",get:function get(){return this.fable.Utility.bigNumber.roundUp;}},{key:"parsePrecise",value:function parsePrecise(pValue,pNonNumberValue){var tmpNumber;try{tmpNumber=new this.fable.Utility.bigNumber(pValue);}catch(pError){this.log.warn("Error parsing number (type ".concat(_typeof(pValue),"): ").concat(pError));tmpNumber=typeof pNonNumberValue==='undefined'?"0.0":pNonNumberValue;}return tmpNumber.toString();}},{key:"percentagePrecise",value:function percentagePrecise(pIs,pOf){var tmpLeftValue=isNaN(pIs)?0:pIs;var tmpRightValue=isNaN(pOf)?0:pOf;if(tmpRightValue==0){return'0';}var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);var tmpResult=tmpLeftArbitraryValue.div(tmpRightValue);tmpResult=tmpResult.times(100);return tmpResult.toString();}},{key:"roundPrecise",value:function roundPrecise(pValue,pDecimals,pRoundingMethod){var tmpValue=isNaN(pValue)?0:pValue;var tmpDecimals=isNaN(pDecimals)?0:pDecimals;var tmpRoundingMethod=typeof pRoundingMethod==='undefined'?this.roundHalfUp:pRoundingMethod;var tmpArbitraryValue=new this.fable.Utility.bigNumber(tmpValue);var tmpResult=tmpArbitraryValue.round(tmpDecimals,tmpRoundingMethod);return tmpResult.toString();}},{key:"toFixedPrecise",value:function toFixedPrecise(pValue,pDecimals,pRoundingMethod){var tmpValue=isNaN(pValue)?0:pValue;var tmpDecimals=isNaN(pDecimals)?0:pDecimals;var tmpRoundingMethod=typeof pRoundingMethod==='undefined'?this.roundHalfUp:pRoundingMethod;var tmpArbitraryValue=new this.fable.Utility.bigNumber(tmpValue);var tmpResult=tmpArbitraryValue.toFixed(tmpDecimals,tmpRoundingMethod);return tmpResult.toString();}},{key:"addPrecise",value:function addPrecise(pLeftValue,pRightValue){var tmpLeftValue=isNaN(pLeftValue)?0:pLeftValue;var tmpRightValue=isNaN(pRightValue)?0:pRightValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);var tmpResult=tmpLeftArbitraryValue.plus(tmpRightValue);return tmpResult.toString();}},{key:"subtractPrecise",value:function subtractPrecise(pLeftValue,pRightValue){var tmpLeftValue=isNaN(pLeftValue)?0:pLeftValue;var tmpRightValue=isNaN(pRightValue)?0:pRightValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);var tmpResult=tmpLeftArbitraryValue.minus(tmpRightValue);return tmpResult.toString();}// Bignumber does not use precision values for power -- only javascript decimals
3586
- },{key:"powerPrecise",value:function powerPrecise(pLeftValue,pRightValue){var tmpLeftValue=isNaN(pLeftValue)?0:pLeftValue;var tmpRightValue=isNaN(pRightValue)?0:parseInt(pRightValue);var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);var tmpResult=tmpLeftArbitraryValue.pow(tmpRightValue);return tmpResult.toString();}},{key:"multiplyPrecise",value:function multiplyPrecise(pLeftValue,pRightValue){var tmpLeftValue=isNaN(pLeftValue)?0:pLeftValue;var tmpRightValue=isNaN(pRightValue)?0:pRightValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);var tmpResult=tmpLeftArbitraryValue.times(tmpRightValue);return tmpResult.toString();}},{key:"dividePrecise",value:function dividePrecise(pLeftValue,pRightValue){var tmpLeftValue=isNaN(pLeftValue)?0:pLeftValue;var tmpRightValue=isNaN(pRightValue)?0:pRightValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);var tmpResult=tmpLeftArbitraryValue.div(tmpRightValue);return tmpResult.toString();}},{key:"modPrecise",value:function modPrecise(pLeftValue,pRightValue){var tmpLeftValue=isNaN(pLeftValue)?0:pLeftValue;var tmpRightValue=isNaN(pRightValue)?0:pRightValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);var tmpResult=tmpLeftArbitraryValue.mod(tmpRightValue);return tmpResult.toString();}},{key:"sqrtPrecise",value:function sqrtPrecise(pValue){var tmpValue=isNaN(pValue)?0:pValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpValue);var tmpResult=tmpLeftArbitraryValue.sqrt();return tmpResult.toString();}},{key:"absPrecise",value:function absPrecise(pValue){var tmpValue=isNaN(pValue)?0:pValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpValue);var tmpResult=tmpLeftArbitraryValue.abs();return tmpResult.toString();}},{key:"comparePrecise",value:function comparePrecise(pLeftValue,pRightValue){var tmpLeftValue=isNaN(pLeftValue)?0:pLeftValue;var tmpRightValue=isNaN(pRightValue)?0:pRightValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);return tmpLeftArbitraryValue.cmp(tmpRightValue);}},{key:"gtPrecise",value:function gtPrecise(pLeftValue,pRightValue){var tmpLeftValue=isNaN(pLeftValue)?0:pLeftValue;var tmpRightValue=isNaN(pRightValue)?0:pRightValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);return tmpLeftArbitraryValue.gt(tmpRightValue);}},{key:"gtePrecise",value:function gtePrecise(pLeftValue,pRightValue){var tmpLeftValue=isNaN(pLeftValue)?0:pLeftValue;var tmpRightValue=isNaN(pRightValue)?0:pRightValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);return tmpLeftArbitraryValue.gte(tmpRightValue);}},{key:"ltPrecise",value:function ltPrecise(pLeftValue,pRightValue){var tmpLeftValue=isNaN(pLeftValue)?0:pLeftValue;var tmpRightValue=isNaN(pRightValue)?0:pRightValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);return tmpLeftArbitraryValue.lt(tmpRightValue);}},{key:"ltePrecise",value:function ltePrecise(pLeftValue,pRightValue){var tmpLeftValue=isNaN(pLeftValue)?0:pLeftValue;var tmpRightValue=isNaN(pRightValue)?0:pRightValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);return tmpLeftArbitraryValue.lt(tmpRightValue);}},{key:"radPrecise",value:function radPrecise(pDegrees){var tmpDegrees=isNaN(pDegrees)?0:pDegrees;var tmpDegreesArbitraryValue=new this.fable.Utility.bigNumber(tmpDegrees);// TODO: Const for pi in arbitrary precision?
3587
- var tmpResult=tmpDegreesArbitraryValue.times(Math.PI).div(180);return tmpResult.toString();}},{key:"sin",value:function sin(pRadians){var tmpRadians=isNaN(pRadians)?0:pRadians;return Math.sin(tmpRadians);}},{key:"cos",value:function cos(pRadians){var tmpRadians=isNaN(pRadians)?0:pRadians;return Math.cos(tmpRadians);}},{key:"tan",value:function tan(pRadians){var tmpRadians=isNaN(pRadians)?0:pRadians;return Math.tan(tmpRadians);}}]);return FableServiceMath;}(libFableServiceBase);module.exports=FableServiceMath;},{"fable-serviceproviderbase":51}],145:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');/**
3594
+ */var FableServiceMath=/*#__PURE__*/function(_libFableServiceBase6){_inherits(FableServiceMath,_libFableServiceBase6);function FableServiceMath(pFable,pOptions,pServiceHash){var _this32;_classCallCheck2(this,FableServiceMath);_this32=_callSuper(this,FableServiceMath,[pFable,pOptions,pServiceHash]);_this32.serviceType='Math';_this32.pi='3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679';return _this32;}/*
3595
+ Pass-through Rounding Method Constants
3596
+
3597
+ Property Value BigDecimal Equiv Description
3598
+ ---------- ----- ---------------- -----------
3599
+ roundDown 0 ROUND_DOWN Rounds towards zero. (_I.e. truncate, no rounding._)
3600
+ roundHalfUp 1 ROUND_HALF_UP Rounds towards nearest neighbour. (_If equidistant, rounds away from zero._)
3601
+ roundHalfEven 2 ROUND_HALF_EVEN Rounds towards nearest neighbour. (_If equidistant, rounds towards even neighbour._)
3602
+ roundUp 3 ROUND_UP Rounds positively away from zero. (_Always round up._)
3603
+ */_createClass2(FableServiceMath,[{key:"roundDown",get:function get(){return this.fable.Utility.bigNumber.roundDown;}},{key:"roundHalfUp",get:function get(){return this.fable.Utility.bigNumber.roundHalfUp;}},{key:"roundHalfEven",get:function get(){return this.fable.Utility.bigNumber.roundHalfEven;}},{key:"roundUp",get:function get(){return this.fable.Utility.bigNumber.roundUp;}/**
3604
+ * Parses a precise number value.
3605
+ *
3606
+ * @param {number} pValue - The value to parse.
3607
+ * @param {any} pNonNumberValue - The value to use if parsing fails.
3608
+ * @returns {string} - The parsed number as a string.
3609
+ */},{key:"parsePrecise",value:function parsePrecise(pValue,pNonNumberValue){var tmpNumber;try{tmpNumber=new this.fable.Utility.bigNumber(pValue);}catch(pError){this.log.warn("Error parsing number (type ".concat(_typeof(pValue),"): ").concat(pError));tmpNumber=typeof pNonNumberValue==='undefined'?"0.0":pNonNumberValue;}return tmpNumber.toString();}/**
3610
+ * Assigns the given value. For equals operations in the solver.
3611
+ * @param {*} pValue - The value to be assigned.
3612
+ * @returns {*} The assigned value.
3613
+ */},{key:"assignValue",value:function assignValue(pValue){return pValue;}/**
3614
+ * Calculates the precise percentage of a given value compared to another value.
3615
+ *
3616
+ * @param {number} pIs - The value to calculate the percentage of.
3617
+ * @param {number} pOf - The value to calculate the percentage against.
3618
+ * @returns {string} The precise percentage as a string.
3619
+ */},{key:"percentagePrecise",value:function percentagePrecise(pIs,pOf){var tmpLeftValue=isNaN(pIs)?0:pIs;var tmpRightValue=isNaN(pOf)?0:pOf;if(tmpRightValue==0){return'0';}var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);var tmpResult=tmpLeftArbitraryValue.div(tmpRightValue);tmpResult=tmpResult.times(100);return tmpResult.toString();}/**
3620
+ * Rounds a value to a specified number of decimal places using a specified rounding method.
3621
+ *
3622
+ * @param {number} pValue - The value to be rounded.
3623
+ * @param {number} pDecimals - The number of decimal places to round to.
3624
+ * @param {function} [pRoundingMethod] - The rounding method to use. Defaults to `this.roundHalfUp`.
3625
+ * @returns {string} - The rounded value as a string.
3626
+ */},{key:"roundPrecise",value:function roundPrecise(pValue,pDecimals,pRoundingMethod){var tmpValue=isNaN(pValue)?0:pValue;var tmpDecimals=isNaN(pDecimals)?0:pDecimals;var tmpRoundingMethod=typeof pRoundingMethod==='undefined'?this.roundHalfUp:pRoundingMethod;var tmpArbitraryValue=new this.fable.Utility.bigNumber(tmpValue);var tmpResult=tmpArbitraryValue.round(tmpDecimals,tmpRoundingMethod);return tmpResult.toString();}/**
3627
+ * Returns a string representation of a number with a specified number of decimals.
3628
+ *
3629
+ * @param {number} pValue - The number to be formatted.
3630
+ * @param {number} pDecimals - The number of decimals to include in the formatted string.
3631
+ * @param {string} [pRoundingMethod] - The rounding method to use. Defaults to 'roundHalfUp'.
3632
+ * @returns {string} - The formatted number as a string.
3633
+ */},{key:"toFixedPrecise",value:function toFixedPrecise(pValue,pDecimals,pRoundingMethod){var tmpValue=isNaN(pValue)?0:pValue;var tmpDecimals=isNaN(pDecimals)?0:pDecimals;var tmpRoundingMethod=typeof pRoundingMethod==='undefined'?this.roundHalfUp:pRoundingMethod;var tmpArbitraryValue=new this.fable.Utility.bigNumber(tmpValue);var tmpResult=tmpArbitraryValue.toFixed(tmpDecimals,tmpRoundingMethod);return tmpResult.toString();}/**
3634
+ * Adds two values precisely.
3635
+ * @param {number} pLeftValue - The left value to be added.
3636
+ * @param {number} pRightValue - The right value to be added.
3637
+ * @returns {string} - The result of adding the two values as a string.
3638
+ */},{key:"addPrecise",value:function addPrecise(pLeftValue,pRightValue){var tmpLeftValue=isNaN(pLeftValue)?0:pLeftValue;var tmpRightValue=isNaN(pRightValue)?0:pRightValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);var tmpResult=tmpLeftArbitraryValue.plus(tmpRightValue);return tmpResult.toString();}/**
3639
+ * Subtracts two values precisely.
3640
+ *
3641
+ * @param {number} pLeftValue - The left value to subtract.
3642
+ * @param {number} pRightValue - The right value to subtract.
3643
+ * @returns {string} The result of the subtraction as a string.
3644
+ */},{key:"subtractPrecise",value:function subtractPrecise(pLeftValue,pRightValue){var tmpLeftValue=isNaN(pLeftValue)?0:pLeftValue;var tmpRightValue=isNaN(pRightValue)?0:pRightValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);var tmpResult=tmpLeftArbitraryValue.minus(tmpRightValue);return tmpResult.toString();}/**
3645
+ * Calculates the precise power of two numbers.
3646
+ *
3647
+ * @param {number} pLeftValue - The base value.
3648
+ * @param {number} pRightValue - The exponent value.
3649
+ * @returns {string} The result of raising the base value to the exponent value.
3650
+ */},{key:"powerPrecise",value:function powerPrecise(pLeftValue,pRightValue){var tmpLeftValue=isNaN(pLeftValue)?0:pLeftValue;var tmpRightValue=isNaN(pRightValue)?0:parseInt(pRightValue);var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);var tmpResult=tmpLeftArbitraryValue.pow(tmpRightValue);return tmpResult.toString();}/**
3651
+ * Multiplies two values precisely.
3652
+ *
3653
+ * @param {number} pLeftValue - The left value to multiply.
3654
+ * @param {number} pRightValue - The right value to multiply.
3655
+ * @returns {string} The result of the multiplication as a string.
3656
+ */},{key:"multiplyPrecise",value:function multiplyPrecise(pLeftValue,pRightValue){var tmpLeftValue=isNaN(pLeftValue)?0:pLeftValue;var tmpRightValue=isNaN(pRightValue)?0:pRightValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);var tmpResult=tmpLeftArbitraryValue.times(tmpRightValue);return tmpResult.toString();}/**
3657
+ * Divides two values precisely.
3658
+ *
3659
+ * @param {number} pLeftValue - The left value to be divided.
3660
+ * @param {number} pRightValue - The right value to divide by.
3661
+ * @returns {string} The result of the division as a string.
3662
+ */},{key:"dividePrecise",value:function dividePrecise(pLeftValue,pRightValue){var tmpLeftValue=isNaN(pLeftValue)?0:pLeftValue;var tmpRightValue=isNaN(pRightValue)?0:pRightValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);var tmpResult=tmpLeftArbitraryValue.div(tmpRightValue);return tmpResult.toString();}/**
3663
+ * Calculates the modulus of two values with precision.
3664
+ *
3665
+ * @param {number} pLeftValue - The left value.
3666
+ * @param {number} pRightValue - The right value.
3667
+ * @returns {string} The result of the modulus operation as a string.
3668
+ */},{key:"modPrecise",value:function modPrecise(pLeftValue,pRightValue){var tmpLeftValue=isNaN(pLeftValue)?0:pLeftValue;var tmpRightValue=isNaN(pRightValue)?0:pRightValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);var tmpResult=tmpLeftArbitraryValue.mod(tmpRightValue);return tmpResult.toString();}/**
3669
+ * Calculates the square root of a number with precise decimal places.
3670
+ *
3671
+ * @param {number} pValue - The number to calculate the square root of.
3672
+ * @returns {string} The square root of the input number as a string.
3673
+ */},{key:"sqrtPrecise",value:function sqrtPrecise(pValue){var tmpValue=isNaN(pValue)?0:pValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpValue);var tmpResult=tmpLeftArbitraryValue.sqrt();return tmpResult.toString();}/**
3674
+ * Calculates the absolute value of a number precisely.
3675
+ *
3676
+ * @param {number} pValue - The number to calculate the absolute value of.
3677
+ * @returns {string} The absolute value of the input number as a string.
3678
+ */},{key:"absPrecise",value:function absPrecise(pValue){var tmpValue=isNaN(pValue)?0:pValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpValue);var tmpResult=tmpLeftArbitraryValue.abs();return tmpResult.toString();}/**
3679
+ * Compares two values precisely.
3680
+ *
3681
+ * @param {number} pLeftValue - The left value to compare.
3682
+ * @param {number} pRightValue - The right value to compare.
3683
+ * @returns {number} - Returns the result of the comparison.
3684
+ */},{key:"comparePrecise",value:function comparePrecise(pLeftValue,pRightValue){var tmpLeftValue=isNaN(pLeftValue)?0:pLeftValue;var tmpRightValue=isNaN(pRightValue)?0:pRightValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);return tmpLeftArbitraryValue.cmp(tmpRightValue);}/**
3685
+ * Determines if the left value is greater than the right value precisely.
3686
+ *
3687
+ * @param {number} pLeftValue - The left value to compare.
3688
+ * @param {number} pRightValue - The right value to compare.
3689
+ * @returns {boolean} - Returns true if the left value is greater than the right value, otherwise returns false.
3690
+ */},{key:"gtPrecise",value:function gtPrecise(pLeftValue,pRightValue){var tmpLeftValue=isNaN(pLeftValue)?0:pLeftValue;var tmpRightValue=isNaN(pRightValue)?0:pRightValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);return tmpLeftArbitraryValue.gt(tmpRightValue);}/**
3691
+ * Checks if the left value is greater than or equal to the right value.
3692
+ * If either value is not a number, it is treated as 0.
3693
+ *
3694
+ * @param {number} pLeftValue - The left value to compare.
3695
+ * @param {number} pRightValue - The right value to compare.
3696
+ * @returns {boolean} - True if the left value is greater than or equal to the right value, false otherwise.
3697
+ */},{key:"gtePrecise",value:function gtePrecise(pLeftValue,pRightValue){var tmpLeftValue=isNaN(pLeftValue)?0:pLeftValue;var tmpRightValue=isNaN(pRightValue)?0:pRightValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);return tmpLeftArbitraryValue.gte(tmpRightValue);}/**
3698
+ * Determines if the left value is less than the right value precisely.
3699
+ *
3700
+ * @param {number} pLeftValue - The left value to compare.
3701
+ * @param {number} pRightValue - The right value to compare.
3702
+ * @returns {boolean} - Returns true if the left value is less than the right value, otherwise returns false.
3703
+ */},{key:"ltPrecise",value:function ltPrecise(pLeftValue,pRightValue){var tmpLeftValue=isNaN(pLeftValue)?0:pLeftValue;var tmpRightValue=isNaN(pRightValue)?0:pRightValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);return tmpLeftArbitraryValue.lt(tmpRightValue);}/**
3704
+ * Determines if the left value is less than or equal to the right value.
3705
+ *
3706
+ * @param {number} pLeftValue - The left value to compare.
3707
+ * @param {number} pRightValue - The right value to compare.
3708
+ * @returns {boolean} - Returns true if the left value is less than or equal to the right value, otherwise returns false.
3709
+ */},{key:"ltePrecise",value:function ltePrecise(pLeftValue,pRightValue){var tmpLeftValue=isNaN(pLeftValue)?0:pLeftValue;var tmpRightValue=isNaN(pRightValue)?0:pRightValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);return tmpLeftArbitraryValue.lt(tmpRightValue);}/**
3710
+ * Converts degrees to radians with arbitrary precision.
3711
+ *
3712
+ * @param {number} pDegrees - The degrees to convert to radians.
3713
+ * @returns {string} - The converted radians as a string.
3714
+ */},{key:"radPrecise",value:function radPrecise(pDegrees){var tmpDegrees=isNaN(pDegrees)?0:pDegrees;var tmpDegreesArbitraryValue=new this.fable.Utility.bigNumber(tmpDegrees);// TODO: Const for pi in arbitrary precision?
3715
+ var tmpResult=tmpDegreesArbitraryValue.times(Math.PI).div(180);return tmpResult.toString();}/**
3716
+ * Calculates the value of pi with the specified precision.
3717
+ * If no precision is provided, returns 100 digits after the decimal.
3718
+ *
3719
+ * @param {number} [pPrecision] - The precision to use for calculating pi.
3720
+ * @returns {number} - The calculated value of pi.
3721
+ */},{key:"piPrecise",value:function piPrecise(pPrecision){if(typeof pPrecision==='undefined'){return this.pi;}else{return this.roundPrecise(this.pi,pPrecision);}}/**
3722
+ * Calculates the sine of the given angle in radians.
3723
+ *
3724
+ * @param {number} pRadians - The angle in radians.
3725
+ * @returns {number} The sine of the angle.
3726
+ */},{key:"sin",value:function sin(pRadians){var tmpRadians=isNaN(pRadians)?0:pRadians;return Math.sin(tmpRadians);}/**
3727
+ * Calculates the cosine of the given angle in radians.
3728
+ *
3729
+ * @param {number} pRadians - The angle in radians.
3730
+ * @returns {number} The cosine of the angle.
3731
+ */},{key:"cos",value:function cos(pRadians){var tmpRadians=isNaN(pRadians)?0:pRadians;return Math.cos(tmpRadians);}/**
3732
+ * Calculates the tangent of an angle in radians.
3733
+ *
3734
+ * @param {number} pRadians - The angle in radians.
3735
+ * @returns {number} The tangent of the angle.
3736
+ */},{key:"tan",value:function tan(pRadians){var tmpRadians=isNaN(pRadians)?0:pRadians;return Math.tan(tmpRadians);}/* * * * * * * * * * * * * * * *
3737
+ * Set functions
3738
+ * These are meant to work fine with arrays and more complex set descriptions returned by Manyfest.
3739
+ * Manyfest sometimes returns values as arrays and sometimes as a map of addresses with values depending
3740
+ * on what was requested.
3741
+ *
3742
+ * The following functions will likely be broken into their own service.
3743
+ */ /**
3744
+ * Counts the number of elements in a set.
3745
+ *
3746
+ * @param {Array|Object|any} pValueSet - The set to count the elements of.
3747
+ * @returns {number} The number of elements in the set.
3748
+ */},{key:"countSetElements",value:function countSetElements(pValueSet){if(Array.isArray(pValueSet)){return pValueSet.length;}else if(_typeof(pValueSet)==='object'){return Object.keys(pValueSet).length;}else if(pValueSet){// This is controversial. Discuss with colleagues!
3749
+ return 1;}return 0;}/**
3750
+ * Sorts the elements in the given value set in ascending order using the precise parsing and comparison.
3751
+ *
3752
+ * @param {Array|Object} pValueSet - The value set to be sorted.
3753
+ * @returns {Array} - The sorted value set.
3754
+ */},{key:"sortSetPrecise",value:function sortSetPrecise(pValueSet){var _this33=this;var tmpSortedSet=[];if(Array.isArray(pValueSet)){for(var i=0;i<pValueSet.length;i++){tmpSortedSet.push(this.parsePrecise(pValueSet[i],NaN));}}else if(_typeof(pValueSet)==='object'){var tmpKeys=Object.keys(pValueSet);for(var _i29=0;_i29<tmpKeys.length;_i29++){tmpSortedSet.push(this.parsePrecise(pValueSet[tmpKeys[_i29]],NaN));}}tmpSortedSet.sort(function(pLeft,pRight){return _this33.comparePrecise(pLeft,pRight);});return tmpSortedSet;}/**
3755
+ * Bucketizes a set of values based on a specified bucket size.
3756
+ *
3757
+ * @param {Array|Object} pValueSet - The set of values to be bucketized.
3758
+ * @param {number} pBucketSize - The size of each bucket. Optional - If NaN, the values will be bucketized by their value.
3759
+ * @returns {Object} - The bucketized set of values.
3760
+ */},{key:"bucketSetPrecise",value:function bucketSetPrecise(pValueSet,pBucketSize){var tmpBucketedSet={};var tmpBucketSize=this.parsePrecise(pBucketSize,NaN);if(Array.isArray(pValueSet)){for(var i=0;i<pValueSet.length;i++){var tmpValue=this.parsePrecise(pValueSet[i],NaN);var tmpBucket=tmpValue.toString();if(!isNaN(tmpBucketSize)){tmpBucket=this.dividePrecise(pValueSet[i],tmpBucketSize);}if(!(tmpBucket in tmpBucketedSet)){tmpBucketedSet[tmpBucket]=0;}tmpBucketedSet[tmpBucket]=tmpBucketedSet[tmpBucket]+1;}}else if(_typeof(pValueSet)==='object'){var tmpKeys=Object.keys(pValueSet);for(var _i30=0;_i30<tmpKeys.length;_i30++){var _tmpValue4=this.parsePrecise(pValueSet[tmpKeys[_i30]],NaN);var _tmpBucket=_tmpValue4.toString();if(!isNaN(tmpBucketSize)){_tmpBucket=this.dividePrecise(pValueSet[_i30],tmpBucketSize);}if(!(_tmpBucket in tmpBucketedSet)){tmpBucketedSet[_tmpBucket]=0;}tmpBucketedSet[_tmpBucket]=tmpBucketedSet[_tmpBucket]+1;}}return tmpBucketedSet;}/**
3761
+ * Calculates the histogram using precise bucket set for the given pValueSet.
3762
+ *
3763
+ * @param {Array<number>} pValueSet - The array of p-values.
3764
+ * @returns {Array<number>} The histogram of the p-values.
3765
+ */},{key:"histogramPrecise",value:function histogramPrecise(pValueSet){return this.bucketSetPrecise(pValueSet);}/**
3766
+ * Sorts the histogram object in ascending order based on the frequencies of the buckets.
3767
+ *
3768
+ * @param {Object} pHistogram - The histogram object to be sorted.
3769
+ * @returns {Object} - The sorted histogram object.
3770
+ */},{key:"sortHistogramPrecise",value:function sortHistogramPrecise(pHistogram){var tmpSortedHistogram={};var tmpKeys=Object.keys(pHistogram);tmpKeys.sort(function(pLeft,pRight){return pHistogram[pLeft]-pHistogram[pRight];});for(var i=0;i<tmpKeys.length;i++){tmpSortedHistogram[tmpKeys[i]]=pHistogram[tmpKeys[i]];}return tmpSortedHistogram;}/**
3771
+ * Finds the maximum value from a set of precise values.
3772
+ *
3773
+ * @param {Array|Object} pValueSet - The set of values to find the maximum from.
3774
+ * @returns {number} - The maximum value from the set.
3775
+ */},{key:"maxPrecise",value:function maxPrecise(pValueSet){var tmpMaxValue=NaN;if(Array.isArray(pValueSet)){for(var i=0;i<pValueSet.length;i++){if(!tmpMaxValue){tmpMaxValue=this.parsePrecise(pValueSet[i],NaN);}else{var tmpComparisonValue=this.parsePrecise(pValueSet[i],NaN);if(this.gtPrecise(tmpComparisonValue,tmpMaxValue)){tmpMaxValue=tmpComparisonValue;}}}}else if(_typeof(pValueSet)==='object'){var tmpKeys=Object.keys(pValueSet);for(var _i31=0;_i31<tmpKeys.length;_i31++){if(!tmpMaxValue){tmpMaxValue=this.parsePrecise(pValueSet[tmpKeys[_i31]],NaN);}else{var _tmpComparisonValue=this.parsePrecise(pValueSet[tmpKeys[_i31]],NaN);if(this.gtPrecise(_tmpComparisonValue,tmpMaxValue)){tmpMaxValue=_tmpComparisonValue;}}}}return tmpMaxValue;}/**
3776
+ * Finds the minimum value from a set of values.
3777
+ *
3778
+ * @param {Array|Object} pValueSet - The set of values to find the minimum from.
3779
+ * @returns {number} The minimum value from the set.
3780
+ */},{key:"minPrecise",value:function minPrecise(pValueSet){var tmpMinValue=NaN;if(Array.isArray(pValueSet)){for(var i=0;i<pValueSet.length;i++){if(!tmpMinValue){tmpMinValue=this.parsePrecise(pValueSet[i],NaN);}else{var tmpComparisonValue=this.parsePrecise(pValueSet[i],NaN);if(!isNaN(tmpComparisonValue)&&this.ltPrecise(tmpComparisonValue,tmpMinValue)){tmpMinValue=tmpComparisonValue;}}}}else if(_typeof(pValueSet)==='object'){var tmpKeys=Object.keys(pValueSet);for(var _i32=0;_i32<tmpKeys.length;_i32++){if(!tmpMinValue){tmpMinValue=this.parsePrecise(pValueSet[tmpKeys[_i32]],NaN);}else{var _tmpComparisonValue2=this.parsePrecise(pValueSet[tmpKeys[_i32]],NaN);if(!isNaN(_tmpComparisonValue2)&&this.ltPrecise(_tmpComparisonValue2,tmpMinValue)){tmpMinValue=_tmpComparisonValue2;}}}}return tmpMinValue;}/**
3781
+ * Calculates the precise sum of values in the given value set.
3782
+ *
3783
+ * @param {Array|Object} pValueSet - The value set to calculate the sum from.
3784
+ * @returns {string} The precise sum value as a string.
3785
+ */},{key:"sumPrecise",value:function sumPrecise(pValueSet){var tmpSumValue="0.0";if(Array.isArray(pValueSet)){for(var i=0;i<pValueSet.length;i++){var tmpComparisonValue=this.parsePrecise(pValueSet[i],NaN);if(!isNaN(tmpComparisonValue)){tmpSumValue=this.addPrecise(tmpSumValue,tmpComparisonValue);}}}else if(_typeof(pValueSet)==='object'){var tmpKeys=Object.keys(pValueSet);for(var _i33=0;_i33<tmpKeys.length;_i33++){var _tmpComparisonValue3=this.parsePrecise(pValueSet[tmpKeys[_i33]],NaN);if(!isNaN(_tmpComparisonValue3)){tmpSumValue=this.addPrecise(tmpSumValue,_tmpComparisonValue3);}}}return tmpSumValue;}/**
3786
+ * Calculates the precise mean of a given value set.
3787
+ *
3788
+ * @param {Array<number>} pValueSet - The array of values to calculate the mean.
3789
+ * @returns {string} The precise mean value as a string.
3790
+ */},{key:"meanPrecise",value:function meanPrecise(pValueSet){var tmpSumValue=this.sumPrecise(pValueSet);var tmpCount=this.countSetElements(pValueSet);if(tmpCount==0){return'0.0';}return this.dividePrecise(tmpSumValue,tmpCount);}/**
3791
+ * Calculates the average of an array of values precisely.
3792
+ *
3793
+ * @param {Array<number>} pValueSet - The array of values to calculate the average of.
3794
+ * @returns {number} The precise average of the values.
3795
+ */},{key:"averagePrecise",value:function averagePrecise(pValueSet){return this.meanPrecise(pValueSet);}/**
3796
+ * Calculates the precise median value of a given value set.
3797
+ *
3798
+ * @param {Array<number>} pValueSet - The array of values to calculate the median from.
3799
+ * @returns {number|string} - The median value of the given value set. If the value set is empty, returns '0.0'.
3800
+ */},{key:"medianPrecise",value:function medianPrecise(pValueSet){var tmpCount=this.countSetElements(pValueSet);// If there are no elements, return 0 ... should this be NaN?
3801
+ if(tmpCount==0){return'0.0';}var tmpSortedValueSet=this.sortSetPrecise(pValueSet);var tmpMiddleElement=Math.floor(tmpCount/2);// If the count is odd, return the middle element
3802
+ if(tmpCount%2==1){return tmpSortedValueSet[tmpMiddleElement];}// If the count is even, return the average of the two middle elements
3803
+ else{var tmpLeftMiddleValue=tmpSortedValueSet[tmpMiddleElement-1];var tmpRightMiddleValue=tmpSortedValueSet[tmpMiddleElement];return this.dividePrecise(this.addPrecise(tmpLeftMiddleValue,tmpRightMiddleValue),2);}}/**
3804
+ * Calculates the mode (most frequently occurring value) of a given value set using precise mode calculation.
3805
+ *
3806
+ * @param {Array} pValueSet - The array of values to calculate the mode from.
3807
+ * @returns {Array} - An array containing the mode value(s) from the given value set.
3808
+ */},{key:"modePrecise",value:function modePrecise(pValueSet){var tmpHistogram=this.bucketSetPrecise(pValueSet);var tmpMaxCount=0;// Philosophical question about whether the values should be returned sorted.
3809
+ var tmpHistogramValueSet=Object.keys(tmpHistogram);var tmpModeValueSet=[];for(var i=0;i<tmpHistogramValueSet.length;i++){if(tmpHistogram[tmpHistogramValueSet[i]]>tmpMaxCount){tmpMaxCount=tmpHistogram[tmpHistogramValueSet[i]];tmpModeValueSet=[tmpHistogramValueSet[i]];}else if(tmpHistogram[tmpHistogramValueSet[i]]==tmpMaxCount){tmpModeValueSet.push(tmpHistogramValueSet[i]);}}return tmpModeValueSet;}}]);return FableServiceMath;}(libFableServiceBase);module.exports=FableServiceMath;},{"fable-serviceproviderbase":51}],145:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');/**
3588
3810
  * Precedent Meta-Templating
3589
3811
  * @author Steven Velozo <steven@velozo.com>
3590
3812
  * @description Process text stream trie and postfix tree, parsing out meta-template expression functions.
3591
- */var libWordTree=require("./Fable-Service-MetaTemplate/MetaTemplate-WordTree.js");var libStringParser=require("./Fable-Service-MetaTemplate/MetaTemplate-StringParser.js");var FableServiceMetaTemplate=/*#__PURE__*/function(_libFableServiceBase7){_inherits(FableServiceMetaTemplate,_libFableServiceBase7);function FableServiceMetaTemplate(pFable,pOptions,pServiceHash){var _this33;_classCallCheck2(this,FableServiceMetaTemplate);_this33=_callSuper(this,FableServiceMetaTemplate,[pFable,pOptions,pServiceHash]);_this33.serviceType='MetaTemplate';_this33.WordTree=new libWordTree();_this33.StringParser=new libStringParser(_this33.fable);_this33.ParseTree=_this33.WordTree.ParseTree;return _this33;}_createClass2(FableServiceMetaTemplate,[{key:"addPattern",value:function addPattern(pPatternStart,pPatternEnd,pParser,pParserContext){return this.WordTree.addPattern(pPatternStart,pPatternEnd,pParser,pParserContext);}},{key:"addPatternBoth",value:function addPatternBoth(pPatternStart,pPatternEnd,pParser,pParserPromise,pParserContext){return this.WordTree.addPatternBoth(pPatternStart,pPatternEnd,pParser,pParserPromise,pParserContext);}/**
3813
+ */var libWordTree=require("./Fable-Service-MetaTemplate/MetaTemplate-WordTree.js");var libStringParser=require("./Fable-Service-MetaTemplate/MetaTemplate-StringParser.js");var FableServiceMetaTemplate=/*#__PURE__*/function(_libFableServiceBase7){_inherits(FableServiceMetaTemplate,_libFableServiceBase7);function FableServiceMetaTemplate(pFable,pOptions,pServiceHash){var _this34;_classCallCheck2(this,FableServiceMetaTemplate);_this34=_callSuper(this,FableServiceMetaTemplate,[pFable,pOptions,pServiceHash]);_this34.serviceType='MetaTemplate';_this34.WordTree=new libWordTree();_this34.StringParser=new libStringParser(_this34.fable);_this34.ParseTree=_this34.WordTree.ParseTree;return _this34;}_createClass2(FableServiceMetaTemplate,[{key:"addPattern",value:function addPattern(pPatternStart,pPatternEnd,pParser,pParserContext){return this.WordTree.addPattern(pPatternStart,pPatternEnd,pParser,pParserContext);}},{key:"addPatternBoth",value:function addPatternBoth(pPatternStart,pPatternEnd,pParser,pParserPromise,pParserContext){return this.WordTree.addPatternBoth(pPatternStart,pPatternEnd,pParser,pParserPromise,pParserContext);}/**
3592
3814
  * Parse a string with the existing parse tree
3593
3815
  * @method parseString
3594
3816
  * @param {string} pString - The string to parse
@@ -3643,10 +3865,10 @@ var _tmpFunctionContext='ParserContext'in pParserState.Pattern?pParserState.Patt
3643
3865
  this.resetOutputBuffer(pParserState);}}// If we aren't in a pattern match or pattern, and this isn't the start of a new pattern (RAW mode)....
3644
3866
  if(!pParserState.PatternMatch){// This may be the start of a new pattern....
3645
3867
  if(pCharacter in pParserState.ParseTree){// ... assign the root node as the matched node.
3646
- this.resetOutputBuffer(pParserState);this.appendOutputBuffer(pCharacter,pParserState);pParserState.Pattern=pParserState.ParseTree[pCharacter];pParserState.PatternMatch=true;return true;}else{this.appendOutputBuffer(pCharacter,pParserState);}}return false;}},{key:"executePatternAsync",value:function executePatternAsync(pParserState,pData,fCallback,pDataContext){var _this34=this;// ... this is the end of a pattern, cut off the end tag and parse it.
3868
+ this.resetOutputBuffer(pParserState);this.appendOutputBuffer(pCharacter,pParserState);pParserState.Pattern=pParserState.ParseTree[pCharacter];pParserState.PatternMatch=true;return true;}else{this.appendOutputBuffer(pCharacter,pParserState);}}return false;}},{key:"executePatternAsync",value:function executePatternAsync(pParserState,pData,fCallback,pDataContext){var _this35=this;// ... this is the end of a pattern, cut off the end tag and parse it.
3647
3869
  // Trim the start and end tags off the output buffer now
3648
3870
  if(pParserState.Pattern.isAsync){// Run the function
3649
- var tmpFunctionContext='ParserContext'in pParserState.Pattern?pParserState.Pattern.ParserContext:false;if(tmpFunctionContext){return pParserState.Pattern.ParseAsync.call(tmpFunctionContext,pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,function(pError,pAsyncOutput){if(pError){_this34.fable.log.info("Precedent ERROR: Async template error happened parsing ".concat(pParserState.Pattern.PatternStart," ... ").concat(pParserState.Pattern.PatternEnd,": ").concat(pError));}pParserState.OutputBuffer=pAsyncOutput;_this34.resetOutputBuffer(pParserState);return fCallback();},pDataContext);}else{return pParserState.Pattern.ParseAsync(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,function(pError,pAsyncOutput){if(pError){_this34.fable.log.info("Precedent ERROR: Async template error happened parsing ".concat(pParserState.Pattern.PatternStart," ... ").concat(pParserState.Pattern.PatternEnd,": ").concat(pError));}pParserState.OutputBuffer=pAsyncOutput;_this34.resetOutputBuffer(pParserState);return fCallback();},pDataContext);}}else{// Run the t*mplate function
3871
+ var tmpFunctionContext='ParserContext'in pParserState.Pattern?pParserState.Pattern.ParserContext:false;if(tmpFunctionContext){return pParserState.Pattern.ParseAsync.call(tmpFunctionContext,pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,function(pError,pAsyncOutput){if(pError){_this35.fable.log.info("Precedent ERROR: Async template error happened parsing ".concat(pParserState.Pattern.PatternStart," ... ").concat(pParserState.Pattern.PatternEnd,": ").concat(pError));}pParserState.OutputBuffer=pAsyncOutput;_this35.resetOutputBuffer(pParserState);return fCallback();},pDataContext);}else{return pParserState.Pattern.ParseAsync(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,function(pError,pAsyncOutput){if(pError){_this35.fable.log.info("Precedent ERROR: Async template error happened parsing ".concat(pParserState.Pattern.PatternStart," ... ").concat(pParserState.Pattern.PatternEnd,": ").concat(pError));}pParserState.OutputBuffer=pAsyncOutput;_this35.resetOutputBuffer(pParserState);return fCallback();},pDataContext);}}else{// Run the t*mplate function
3650
3872
  var _tmpFunctionContext2='ParserContext'in pParserState.Pattern?pParserState.Pattern.ParserContext:false;if(_tmpFunctionContext2){pParserState.OutputBuffer=pParserState.Pattern.Parse.call(_tmpFunctionContext2,pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,pDataContext);}else{pParserState.OutputBuffer=pParserState.Pattern.Parse(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,pDataContext);}this.resetOutputBuffer(pParserState);return fCallback();}}/**
3651
3873
  * Parse a character in the buffer.
3652
3874
  * @method parseCharacterAsync
@@ -3679,11 +3901,11 @@ return fCallback();}/**
3679
3901
  * @param {Object} pData - The data to pass to the function as a second parameter
3680
3902
  * @param {function} fCallback - The callback function to call when the parse is complete
3681
3903
  * @param {array} pDataContext - The history of data objects/context already passed in
3682
- */},{key:"parseString",value:function parseString(pString,pParseTree,pData,fCallback,pDataContext){var _this35=this;// TODO: There is danger here if a template function attempts to functionally recurse and doesn't pass this in.
3904
+ */},{key:"parseString",value:function parseString(pString,pParseTree,pData,fCallback,pDataContext){var _this36=this;// TODO: There is danger here if a template function attempts to functionally recurse and doesn't pass this in.
3683
3905
  var tmpPreviousDataContext=Array.isArray(pDataContext)?pDataContext:[];var tmpDataContext=Array.from(tmpPreviousDataContext);tmpDataContext.push(pData);if(typeof fCallback!=='function'){var tmpParserState=this.newParserState(pParseTree);for(var i=0;i<pString.length;i++){// TODO: This is not fast.
3684
3906
  this.parseCharacter(pString[i],tmpParserState,pData,tmpDataContext);}this.flushOutputBuffer(tmpParserState);return tmpParserState.Output;}else{// This is the async mode
3685
- var _tmpParserState=this.newParserState(pParseTree);_tmpParserState.Asynchronous=true;var tmpAnticipate=this.fable.instantiateServiceProviderWithoutRegistration('Anticipate');var _loop=function _loop(_i29){tmpAnticipate.anticipate(function(fCallback){_this35.parseCharacterAsync(pString[_i29],_tmpParserState,pData,fCallback,tmpDataContext);});};for(var _i29=0;_i29<pString.length;_i29++){_loop(_i29);}tmpAnticipate.wait(function(pError){// Flush the remaining data
3686
- _this35.flushOutputBuffer(_tmpParserState);return fCallback(pError,_tmpParserState.Output);});}}}]);return StringParser;}();module.exports=StringParser;},{}],147:[function(require,module,exports){/**
3907
+ var _tmpParserState=this.newParserState(pParseTree);_tmpParserState.Asynchronous=true;var tmpAnticipate=this.fable.instantiateServiceProviderWithoutRegistration('Anticipate');var _loop=function _loop(_i34){tmpAnticipate.anticipate(function(fCallback){_this36.parseCharacterAsync(pString[_i34],_tmpParserState,pData,fCallback,tmpDataContext);});};for(var _i34=0;_i34<pString.length;_i34++){_loop(_i34);}tmpAnticipate.wait(function(pError){// Flush the remaining data
3908
+ _this36.flushOutputBuffer(_tmpParserState);return fCallback(pError,_tmpParserState.Output);});}}}]);return StringParser;}();module.exports=StringParser;},{}],147:[function(require,module,exports){/**
3687
3909
  * Word Tree
3688
3910
  * @author Steven Velozo <steven@velozo.com>
3689
3911
  * @description Create a tree (directed graph) of Javascript objects, one character per object.
@@ -3712,20 +3934,20 @@ _this35.flushOutputBuffer(_tmpParserState);return fCallback(pError,_tmpParserSta
3712
3934
  * @param {Object} pParserContext - The context to pass to the parser function
3713
3935
  * @return {Object} The leaf parser from the tree
3714
3936
  */},{key:"addPatternBoth",value:function addPatternBoth(pPatternStart,pPatternEnd,fParser,fParserAsync,pParserContext){if(pPatternStart.length<1){return false;}if(typeof pPatternEnd==='string'&&pPatternEnd.length<1){return false;}var tmpLeaf=this.ParseTree;// Add the tree of leaves iteratively
3715
- for(var i=0;i<pPatternStart.length;i++){tmpLeaf=this.addChild(tmpLeaf,pPatternStart[i],i);}if(!('PatternEnd'in tmpLeaf)){tmpLeaf.PatternEnd={};}var tmpPatternEnd=typeof pPatternEnd==='string'?pPatternEnd:pPatternStart;for(var _i30=0;_i30<tmpPatternEnd.length;_i30++){tmpLeaf=this.addEndChild(tmpLeaf,tmpPatternEnd[_i30],_i30);}tmpLeaf.PatternStartString=pPatternStart;tmpLeaf.PatternEndString=tmpPatternEnd;tmpLeaf.Parse=typeof fParser==='function'?fParser:typeof fParser==='string'?function(pHash,pData){return fParser;}:function(pHash,pData){return pHash;};tmpLeaf.ParseAsync=typeof fParserAsync==='function'?fParserAsync:typeof fParserAsync==='string'?function(pHash,pData,fCallback){return fCallback(null,fParserAsync);}:function(pHash,pData,fCallback){return fCallback(null,tmpLeaf.Parse(pHash,pData));};// A "this" for every object
3937
+ for(var i=0;i<pPatternStart.length;i++){tmpLeaf=this.addChild(tmpLeaf,pPatternStart[i],i);}if(!('PatternEnd'in tmpLeaf)){tmpLeaf.PatternEnd={};}var tmpPatternEnd=typeof pPatternEnd==='string'?pPatternEnd:pPatternStart;for(var _i35=0;_i35<tmpPatternEnd.length;_i35++){tmpLeaf=this.addEndChild(tmpLeaf,tmpPatternEnd[_i35],_i35);}tmpLeaf.PatternStartString=pPatternStart;tmpLeaf.PatternEndString=tmpPatternEnd;tmpLeaf.Parse=typeof fParser==='function'?fParser:typeof fParser==='string'?function(pHash,pData){return fParser;}:function(pHash,pData){return pHash;};tmpLeaf.ParseAsync=typeof fParserAsync==='function'?fParserAsync:typeof fParserAsync==='string'?function(pHash,pData,fCallback){return fCallback(null,fParserAsync);}:function(pHash,pData,fCallback){return fCallback(null,tmpLeaf.Parse(pHash,pData));};// A "this" for every object
3716
3938
  if(pParserContext){tmpLeaf.ParserContext=pParserContext;}tmpLeaf.isAsync=true;return tmpLeaf;}/** Add a Pattern to the Parse Tree with both function parameter types
3717
3939
  * @method addPatternAll
3718
3940
  * @param {Object} pPatternStart - The starting string for the pattern (e.g. "${")
3719
3941
  * @param {string} pPatternEnd - The ending string for the pattern (e.g. "}")
3720
3942
  * @param {function} fParser - The function to parse if this is the matched pattern, once the Pattern End is met. If this is a string, a simple replacement occurs.
3721
3943
  * @param {Object} pParserContext - The context to pass to the parser function
3722
- */},{key:"addPattern",value:function addPattern(pPatternStart,pPatternEnd,fParser,pParserContext){return this.addPatternBoth(pPatternStart,pPatternEnd,fParser,null,pParserContext);}}]);return WordTree;}();module.exports=WordTree;},{}],148:[function(require,module,exports){module.exports={"Metadata":{"UUID":false,"Hash":false,"Name":"","Summary":"","Version":0},"Status":{"Completed":false,"StepCount":0},"Steps":[],"Errors":[],"Log":[]};},{}],149:[function(require,module,exports){var _require4=require('big.js'),PE=_require4.PE;var libFableServiceBase=require('fable-serviceproviderbase');var _OperationStatePrototypeString=JSON.stringify(require('./Fable-Service-Operation-DefaultSettings.js'));var FableOperation=/*#__PURE__*/function(_libFableServiceBase8){_inherits(FableOperation,_libFableServiceBase8);function FableOperation(pFable,pOptions,pServiceHash){var _this36;_classCallCheck2(this,FableOperation);_this36=_callSuper(this,FableOperation,[pFable,pOptions,pServiceHash]);// Timestamps will just be the long ints
3723
- _this36.timeStamps={};_this36.serviceType='PhasedOperation';_this36.state=JSON.parse(_OperationStatePrototypeString);_this36.stepMap={};_this36.stepFunctions={};// Match the service instantiation to the operation.
3724
- _this36.state.Metadata.Hash=_this36.Hash;_this36.state.Metadata.UUID=_this36.UUID;_this36.state.Metadata.Name=typeof _this36.options.Name=='string'?_this36.options.Name:"Unnamed Operation ".concat(_this36.state.Metadata.UUID);_this36.name=_this36.state.Metadata.Name;_this36.progressTrackerSet=_this36.fable.instantiateServiceProviderWithoutRegistration('ProgressTrackerSet');_this36.state.OverallProgressTracker=_this36.progressTrackerSet.createProgressTracker("Overall-".concat(_this36.state.Metadata.UUID));// This is here to use the pass-through logging functions in the operation itself.
3725
- _this36.log=_assertThisInitialized(_this36);return _this36;}_createClass2(FableOperation,[{key:"execute",value:function execute(fExecutionCompleteCallback){var _this37=this;// TODO: Should the same operation be allowed to execute more than one time?
3726
- if(this.state.OverallProgressTracker.StartTimeStamp>0){return fExecutionCompleteCallback(new Error("Operation [".concat(this.state.Metadata.UUID,"] ").concat(this.state.Metadata.Name," has already been executed!")));}var tmpAnticipate=this.fable.instantiateServiceProviderWithoutRegistration('Anticipate');this.progressTrackerSet.setProgressTrackerTotalOperations(this.state.OverallProgressTracker.Hash,this.state.Status.StepCount);this.progressTrackerSet.startProgressTracker(this.state.OverallProgressTracker.Hash);this.info("Operation [".concat(this.state.Metadata.UUID,"] ").concat(this.state.Metadata.Name," starting..."));var _loop2=function _loop2(i){tmpAnticipate.anticipate(function(fNext){this.fable.log.info("Step #".concat(i," [").concat(this.state.Steps[i].GUIDStep,"] ").concat(this.state.Steps[i].Name," starting..."));this.progressTrackerSet.startProgressTracker(this.state.Steps[i].ProgressTracker.Hash);return fNext();}.bind(_this37));// Steps are executed in a custom context with
3727
- tmpAnticipate.anticipate(_this37.stepFunctions[_this37.state.Steps[i].GUIDStep].bind({log:_this37,fable:_this37.fable,options:_this37.state.Steps[i].Metadata,metadata:_this37.state.Steps[i].Metadata,ProgressTracker:_this37.progressTrackerSet.getProgressTracker(_this37.state.Steps[i].ProgressTracker.Hash),logProgressTrackerStatus:function(){return this.log.info("Step #".concat(i," [").concat(this.state.Steps[i].GUIDStep,"]: ").concat(this.progressTrackerSet.getProgressTrackerStatusString(this.state.Steps[i].ProgressTracker.Hash)));}.bind(_this37),OperationState:_this37.state,StepState:_this37.state.Steps[i]}));tmpAnticipate.anticipate(function(fNext){this.progressTrackerSet.endProgressTracker(this.state.Steps[i].ProgressTracker.Hash);var tmpStepTimingMessage=this.progressTrackerSet.getProgressTrackerStatusString(this.state.Steps[i].ProgressTracker.Hash);this.fable.log.info("Step #".concat(i," [").concat(this.state.Steps[i].GUIDStep,"] ").concat(this.state.Steps[i].Name," complete."));this.fable.log.info("Step #".concat(i," [").concat(this.state.Steps[i].GUIDStep,"] ").concat(this.state.Steps[i].Name," ").concat(tmpStepTimingMessage,"."));this.progressTrackerSet.incrementProgressTracker(this.state.OverallProgressTracker.Hash,1);var tmpOperationTimingMessage=this.progressTrackerSet.getProgressTrackerStatusString(this.state.OverallProgressTracker.Hash);this.fable.log.info("Operation [".concat(this.state.Metadata.UUID,"] ").concat(tmpOperationTimingMessage,"."));return fNext();}.bind(_this37));};for(var i=0;i<this.state.Steps.length;i++){_loop2(i);}// Wait for the anticipation to complete
3728
- tmpAnticipate.wait(function(pError){if(pError){_this37.fable.log.error("Operation [".concat(_this37.state.Metadata.UUID,"] ").concat(_this37.state.Metadata.Name," had an error: ").concat(pError),pError);return fExecutionCompleteCallback(pError);}_this37.info("Operation [".concat(_this37.state.Metadata.UUID,"] ").concat(_this37.state.Metadata.Name," complete."));var tmpOperationTimingMessage=_this37.progressTrackerSet.getProgressTrackerStatusString(_this37.state.OverallProgressTracker.Hash);_this37.progressTrackerSet.endProgressTracker(_this37.state.OverallProgressTracker.Hash);_this37.fable.log.info("Operation [".concat(_this37.state.Metadata.UUID,"] ").concat(tmpOperationTimingMessage,"."));return fExecutionCompleteCallback();});}// There are three ways to add steps:
3944
+ */},{key:"addPattern",value:function addPattern(pPatternStart,pPatternEnd,fParser,pParserContext){return this.addPatternBoth(pPatternStart,pPatternEnd,fParser,null,pParserContext);}}]);return WordTree;}();module.exports=WordTree;},{}],148:[function(require,module,exports){module.exports={"Metadata":{"UUID":false,"Hash":false,"Name":"","Summary":"","Version":0},"Status":{"Completed":false,"StepCount":0},"Steps":[],"Errors":[],"Log":[]};},{}],149:[function(require,module,exports){var _require4=require('big.js'),PE=_require4.PE;var libFableServiceBase=require('fable-serviceproviderbase');var _OperationStatePrototypeString=JSON.stringify(require('./Fable-Service-Operation-DefaultSettings.js'));var FableOperation=/*#__PURE__*/function(_libFableServiceBase8){_inherits(FableOperation,_libFableServiceBase8);function FableOperation(pFable,pOptions,pServiceHash){var _this37;_classCallCheck2(this,FableOperation);_this37=_callSuper(this,FableOperation,[pFable,pOptions,pServiceHash]);// Timestamps will just be the long ints
3945
+ _this37.timeStamps={};_this37.serviceType='PhasedOperation';_this37.state=JSON.parse(_OperationStatePrototypeString);_this37.stepMap={};_this37.stepFunctions={};// Match the service instantiation to the operation.
3946
+ _this37.state.Metadata.Hash=_this37.Hash;_this37.state.Metadata.UUID=_this37.UUID;_this37.state.Metadata.Name=typeof _this37.options.Name=='string'?_this37.options.Name:"Unnamed Operation ".concat(_this37.state.Metadata.UUID);_this37.name=_this37.state.Metadata.Name;_this37.progressTrackerSet=_this37.fable.instantiateServiceProviderWithoutRegistration('ProgressTrackerSet');_this37.state.OverallProgressTracker=_this37.progressTrackerSet.createProgressTracker("Overall-".concat(_this37.state.Metadata.UUID));// This is here to use the pass-through logging functions in the operation itself.
3947
+ _this37.log=_assertThisInitialized(_this37);return _this37;}_createClass2(FableOperation,[{key:"execute",value:function execute(fExecutionCompleteCallback){var _this38=this;// TODO: Should the same operation be allowed to execute more than one time?
3948
+ if(this.state.OverallProgressTracker.StartTimeStamp>0){return fExecutionCompleteCallback(new Error("Operation [".concat(this.state.Metadata.UUID,"] ").concat(this.state.Metadata.Name," has already been executed!")));}var tmpAnticipate=this.fable.instantiateServiceProviderWithoutRegistration('Anticipate');this.progressTrackerSet.setProgressTrackerTotalOperations(this.state.OverallProgressTracker.Hash,this.state.Status.StepCount);this.progressTrackerSet.startProgressTracker(this.state.OverallProgressTracker.Hash);this.info("Operation [".concat(this.state.Metadata.UUID,"] ").concat(this.state.Metadata.Name," starting..."));var _loop2=function _loop2(i){tmpAnticipate.anticipate(function(fNext){this.fable.log.info("Step #".concat(i," [").concat(this.state.Steps[i].GUIDStep,"] ").concat(this.state.Steps[i].Name," starting..."));this.progressTrackerSet.startProgressTracker(this.state.Steps[i].ProgressTracker.Hash);return fNext();}.bind(_this38));// Steps are executed in a custom context with
3949
+ tmpAnticipate.anticipate(_this38.stepFunctions[_this38.state.Steps[i].GUIDStep].bind({log:_this38,fable:_this38.fable,options:_this38.state.Steps[i].Metadata,metadata:_this38.state.Steps[i].Metadata,ProgressTracker:_this38.progressTrackerSet.getProgressTracker(_this38.state.Steps[i].ProgressTracker.Hash),logProgressTrackerStatus:function(){return this.log.info("Step #".concat(i," [").concat(this.state.Steps[i].GUIDStep,"]: ").concat(this.progressTrackerSet.getProgressTrackerStatusString(this.state.Steps[i].ProgressTracker.Hash)));}.bind(_this38),OperationState:_this38.state,StepState:_this38.state.Steps[i]}));tmpAnticipate.anticipate(function(fNext){this.progressTrackerSet.endProgressTracker(this.state.Steps[i].ProgressTracker.Hash);var tmpStepTimingMessage=this.progressTrackerSet.getProgressTrackerStatusString(this.state.Steps[i].ProgressTracker.Hash);this.fable.log.info("Step #".concat(i," [").concat(this.state.Steps[i].GUIDStep,"] ").concat(this.state.Steps[i].Name," complete."));this.fable.log.info("Step #".concat(i," [").concat(this.state.Steps[i].GUIDStep,"] ").concat(this.state.Steps[i].Name," ").concat(tmpStepTimingMessage,"."));this.progressTrackerSet.incrementProgressTracker(this.state.OverallProgressTracker.Hash,1);var tmpOperationTimingMessage=this.progressTrackerSet.getProgressTrackerStatusString(this.state.OverallProgressTracker.Hash);this.fable.log.info("Operation [".concat(this.state.Metadata.UUID,"] ").concat(tmpOperationTimingMessage,"."));return fNext();}.bind(_this38));};for(var i=0;i<this.state.Steps.length;i++){_loop2(i);}// Wait for the anticipation to complete
3950
+ tmpAnticipate.wait(function(pError){if(pError){_this38.fable.log.error("Operation [".concat(_this38.state.Metadata.UUID,"] ").concat(_this38.state.Metadata.Name," had an error: ").concat(pError),pError);return fExecutionCompleteCallback(pError);}_this38.info("Operation [".concat(_this38.state.Metadata.UUID,"] ").concat(_this38.state.Metadata.Name," complete."));var tmpOperationTimingMessage=_this38.progressTrackerSet.getProgressTrackerStatusString(_this38.state.OverallProgressTracker.Hash);_this38.progressTrackerSet.endProgressTracker(_this38.state.OverallProgressTracker.Hash);_this38.fable.log.info("Operation [".concat(_this38.state.Metadata.UUID,"] ").concat(tmpOperationTimingMessage,"."));return fExecutionCompleteCallback();});}// There are three ways to add steps:
3729
3951
  // 1. As a basic javascript function
3730
3952
  // --
3731
3953
  // This is the most basic, java"script" way to add a step. It will
@@ -3734,11 +3956,11 @@ tmpAnticipate.wait(function(pError){if(pError){_this37.fable.log.error("Operatio
3734
3956
  },{key:"addStep",value:function addStep(fStepFunction,pStepMetadata,pStepName,pStepDescription,pGUIDStep){var tmpStep={};// GUID is optional
3735
3957
  tmpStep.GUIDStep=typeof pGUIDStep!=='undefined'?pGUIDStep:"STEP-".concat(this.state.Steps.length,"-").concat(this.fable.DataGeneration.randomNumericString());// Name is optional
3736
3958
  tmpStep.Name=typeof pStepName!=='undefined'?pStepName:"Step [".concat(tmpStep.GUIDStep,"]");tmpStep.Description=typeof pStepDescription!=='undefined'?pStepDescription:"Step execution of ".concat(tmpStep.Name,".");tmpStep.ProgressTracker=this.progressTrackerSet.createProgressTracker(tmpStep.GUIDStep);tmpStep.Metadata=_typeof(pStepMetadata)==='object'?pStepMetadata:{};// There is an array of steps, in the Operation State itself ... push a step there
3737
- this.state.Steps.push(tmpStep);this.stepMap[tmpStep.GUIDStep]=tmpStep;this.stepFunctions[tmpStep.GUIDStep]=typeof fStepFunction=='function'?fStepFunction:function(fDone){return fDone();};this.state.Status.StepCount++;return tmpStep;}},{key:"setStepTotalOperations",value:function setStepTotalOperations(pGUIDStep,pTotalOperationCount){if(!(pGUIDStep in this.stepMap)){return new Error("Step [".concat(pGUIDStep,"] does not exist in operation [").concat(this.state.Metadata.UUID,"] ").concat(this.state.Metadata.Name," when attempting to set total operations to ").concat(pTotalOperationCount,"."));}this.progressTrackerSet.setProgressTrackerTotalOperations(this.stepMap[pGUIDStep].ProgressTracker.Hash,pTotalOperationCount);}},{key:"writeOperationLog",value:function writeOperationLog(pLogLevel,pLogText,pLogObject){this.state.Log.push("[".concat(new Date().toUTCString(),"]-[").concat(pLogLevel,"]: ").concat(pLogText));if(_typeof(pLogObject)=='object'){this.state.Log.push(JSON.stringify(pLogObject));}}},{key:"writeOperationErrors",value:function writeOperationErrors(pLogText,pLogObject){this.state.Errors.push("".concat(pLogText));if(_typeof(pLogObject)=='object'){this.state.Errors.push(JSON.stringify(pLogObject));}}},{key:"trace",value:function trace(pLogText,pLogObject){this.writeOperationLog('TRACE',pLogText,pLogObject);this.fable.log.trace(pLogText,pLogObject);}},{key:"debug",value:function debug(pLogText,pLogObject){this.writeOperationLog('DEBUG',pLogText,pLogObject);this.fable.log.debug(pLogText,pLogObject);}},{key:"info",value:function info(pLogText,pLogObject){this.writeOperationLog('INFO',pLogText,pLogObject);this.fable.log.info(pLogText,pLogObject);}},{key:"warn",value:function warn(pLogText,pLogObject){this.writeOperationLog('WARN',pLogText,pLogObject);this.fable.log.warn(pLogText,pLogObject);}},{key:"error",value:function error(pLogText,pLogObject){this.writeOperationLog('ERROR',pLogText,pLogObject);this.writeOperationErrors(pLogText,pLogObject);this.fable.log.error(pLogText,pLogObject);}},{key:"fatal",value:function fatal(pLogText,pLogObject){this.writeOperationLog('FATAL',pLogText,pLogObject);this.writeOperationErrors(pLogText,pLogObject);this.fable.log.fatal(pLogText,pLogObject);}}]);return FableOperation;}(libFableServiceBase);module.exports=FableOperation;},{"./Fable-Service-Operation-DefaultSettings.js":148,"big.js":17,"fable-serviceproviderbase":51}],150:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');var FableServiceProgressTime=/*#__PURE__*/function(_libFableServiceBase9){_inherits(FableServiceProgressTime,_libFableServiceBase9);function FableServiceProgressTime(pFable,pOptions,pServiceHash){var _this38;_classCallCheck2(this,FableServiceProgressTime);_this38=_callSuper(this,FableServiceProgressTime,[pFable,pOptions,pServiceHash]);_this38.serviceType='ProgressTime';_this38.timeStamps={};return _this38;}_createClass2(FableServiceProgressTime,[{key:"formatTimeDuration",value:function formatTimeDuration(pTimeDurationInMilliseconds){var tmpTimeDuration=typeof pTimeDurationInMilliseconds=='number'?pTimeDurationInMilliseconds:0;if(pTimeDurationInMilliseconds<0){return'unknown';}var tmpTimeDurationString='';if(tmpTimeDuration>3600000){tmpTimeDurationString+=Math.floor(tmpTimeDuration/3600000)+'h ';tmpTimeDuration=tmpTimeDuration%3600000;}if(tmpTimeDuration>60000){tmpTimeDurationString+=Math.floor(tmpTimeDuration/60000)+'m ';tmpTimeDuration=tmpTimeDuration%60000;}if(tmpTimeDuration>1000){tmpTimeDurationString+=Math.floor(tmpTimeDuration/1000)+'s ';tmpTimeDuration=tmpTimeDuration%1000;}tmpTimeDurationString+=Math.round(tmpTimeDuration)+'ms';return tmpTimeDurationString;}},{key:"createTimeStamp",value:function createTimeStamp(pTimeStampHash){var tmpTimeStampHash=typeof pTimeStampHash=='string'?pTimeStampHash:'Default';this.timeStamps[tmpTimeStampHash]=+new Date();return this.timeStamps[tmpTimeStampHash];}},{key:"getTimeStampValue",value:function getTimeStampValue(pTimeStampHash){var tmpTimeStampHash=typeof pTimeStampHash=='string'?pTimeStampHash:'Default';return tmpTimeStampHash in this.timeStamps?this.timeStamps[tmpTimeStampHash]:-1;}},{key:"updateTimeStampValue",value:function updateTimeStampValue(pTimeStampHash,pReferenceTime){var tmpTimeStampHash=typeof pTimeStampHash=='string'?pTimeStampHash:'Default';var tmpReferenceTime=false;// This function allows the user to pass in either a reference time in ms, or, a hash of a timestamp.
3959
+ this.state.Steps.push(tmpStep);this.stepMap[tmpStep.GUIDStep]=tmpStep;this.stepFunctions[tmpStep.GUIDStep]=typeof fStepFunction=='function'?fStepFunction:function(fDone){return fDone();};this.state.Status.StepCount++;return tmpStep;}},{key:"setStepTotalOperations",value:function setStepTotalOperations(pGUIDStep,pTotalOperationCount){if(!(pGUIDStep in this.stepMap)){return new Error("Step [".concat(pGUIDStep,"] does not exist in operation [").concat(this.state.Metadata.UUID,"] ").concat(this.state.Metadata.Name," when attempting to set total operations to ").concat(pTotalOperationCount,"."));}this.progressTrackerSet.setProgressTrackerTotalOperations(this.stepMap[pGUIDStep].ProgressTracker.Hash,pTotalOperationCount);}},{key:"writeOperationLog",value:function writeOperationLog(pLogLevel,pLogText,pLogObject){this.state.Log.push("[".concat(new Date().toUTCString(),"]-[").concat(pLogLevel,"]: ").concat(pLogText));if(_typeof(pLogObject)=='object'){this.state.Log.push(JSON.stringify(pLogObject));}}},{key:"writeOperationErrors",value:function writeOperationErrors(pLogText,pLogObject){this.state.Errors.push("".concat(pLogText));if(_typeof(pLogObject)=='object'){this.state.Errors.push(JSON.stringify(pLogObject));}}},{key:"trace",value:function trace(pLogText,pLogObject){this.writeOperationLog('TRACE',pLogText,pLogObject);this.fable.log.trace(pLogText,pLogObject);}},{key:"debug",value:function debug(pLogText,pLogObject){this.writeOperationLog('DEBUG',pLogText,pLogObject);this.fable.log.debug(pLogText,pLogObject);}},{key:"info",value:function info(pLogText,pLogObject){this.writeOperationLog('INFO',pLogText,pLogObject);this.fable.log.info(pLogText,pLogObject);}},{key:"warn",value:function warn(pLogText,pLogObject){this.writeOperationLog('WARN',pLogText,pLogObject);this.fable.log.warn(pLogText,pLogObject);}},{key:"error",value:function error(pLogText,pLogObject){this.writeOperationLog('ERROR',pLogText,pLogObject);this.writeOperationErrors(pLogText,pLogObject);this.fable.log.error(pLogText,pLogObject);}},{key:"fatal",value:function fatal(pLogText,pLogObject){this.writeOperationLog('FATAL',pLogText,pLogObject);this.writeOperationErrors(pLogText,pLogObject);this.fable.log.fatal(pLogText,pLogObject);}}]);return FableOperation;}(libFableServiceBase);module.exports=FableOperation;},{"./Fable-Service-Operation-DefaultSettings.js":148,"big.js":17,"fable-serviceproviderbase":51}],150:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');var FableServiceProgressTime=/*#__PURE__*/function(_libFableServiceBase9){_inherits(FableServiceProgressTime,_libFableServiceBase9);function FableServiceProgressTime(pFable,pOptions,pServiceHash){var _this39;_classCallCheck2(this,FableServiceProgressTime);_this39=_callSuper(this,FableServiceProgressTime,[pFable,pOptions,pServiceHash]);_this39.serviceType='ProgressTime';_this39.timeStamps={};return _this39;}_createClass2(FableServiceProgressTime,[{key:"formatTimeDuration",value:function formatTimeDuration(pTimeDurationInMilliseconds){var tmpTimeDuration=typeof pTimeDurationInMilliseconds=='number'?pTimeDurationInMilliseconds:0;if(pTimeDurationInMilliseconds<0){return'unknown';}var tmpTimeDurationString='';if(tmpTimeDuration>3600000){tmpTimeDurationString+=Math.floor(tmpTimeDuration/3600000)+'h ';tmpTimeDuration=tmpTimeDuration%3600000;}if(tmpTimeDuration>60000){tmpTimeDurationString+=Math.floor(tmpTimeDuration/60000)+'m ';tmpTimeDuration=tmpTimeDuration%60000;}if(tmpTimeDuration>1000){tmpTimeDurationString+=Math.floor(tmpTimeDuration/1000)+'s ';tmpTimeDuration=tmpTimeDuration%1000;}tmpTimeDurationString+=Math.round(tmpTimeDuration)+'ms';return tmpTimeDurationString;}},{key:"createTimeStamp",value:function createTimeStamp(pTimeStampHash){var tmpTimeStampHash=typeof pTimeStampHash=='string'?pTimeStampHash:'Default';this.timeStamps[tmpTimeStampHash]=+new Date();return this.timeStamps[tmpTimeStampHash];}},{key:"getTimeStampValue",value:function getTimeStampValue(pTimeStampHash){var tmpTimeStampHash=typeof pTimeStampHash=='string'?pTimeStampHash:'Default';return tmpTimeStampHash in this.timeStamps?this.timeStamps[tmpTimeStampHash]:-1;}},{key:"updateTimeStampValue",value:function updateTimeStampValue(pTimeStampHash,pReferenceTime){var tmpTimeStampHash=typeof pTimeStampHash=='string'?pTimeStampHash:'Default';var tmpReferenceTime=false;// This function allows the user to pass in either a reference time in ms, or, a hash of a timestamp.
3738
3960
  if(typeof pReferenceTime=='string'){tmpReferenceTime=tmpReference in this.timeStamps?this.timeStamps[tmpReference]:false;}else if(typeof pReferenceTime=='number'){tmpReferenceTime=pReferenceTime;}else{tmpReferenceTime=+new Date();}if(tmpTimeStampHash in this.timeStamps&&tmpReferenceTime){this.timeStamps[tmpTimeStampHash]=tmpReferenceTime;return this.timeStamps[tmpTimeStampHash];}else{return-1;}}},{key:"removeTimeStamp",value:function removeTimeStamp(pTimeStampHash){var tmpTimeStampHash=typeof pTimeStampHash=='string'?pTimeStampHash:'Default';if(tmpTimeStampHash in this.timeStamps){delete this.timeStamps[tmpTimeStampHash];return true;}else{return false;}}},{key:"getTimeStampDelta",value:function getTimeStampDelta(pTimeStampHash,pReferenceTime){var tmpTimeStampHash=typeof pTimeStampHash=='string'?pTimeStampHash:'Default';var tmpReferenceTime=false;// This function allows the user to pass in either a reference time in ms, or, a hash of a timestamp.
3739
- if(typeof pReferenceTime=='string'){tmpReferenceTime=tmpReference in this.timeStamps?this.timeStamps[tmpReference]:false;}else if(typeof pReferenceTime=='number'){tmpReferenceTime=pReferenceTime;}else{tmpReferenceTime=+new Date();}if(tmpTimeStampHash in this.timeStamps&&tmpReferenceTime){return tmpReferenceTime-this.timeStamps[tmpTimeStampHash];}else{return-1;}}},{key:"getDurationBetweenTimestamps",value:function getDurationBetweenTimestamps(pTimeStampHashStart,pTimeStampHashEnd){var tmpTimeStampHashStart=typeof pTimeStampHashStart=='string'?pTimeStampHashStart:'Default';var tmpTimeStampHashEnd=typeof pTimeStampHashEnd=='string'?pTimeStampHashEnd:'Default';if(tmpTimeStampHashStart in this.timeStamps&&tmpTimeStampHashEnd in this.timeStamps){return this.timeStamps[tmpTimeStampHashEnd]-this.timeStamps[tmpTimeStampHashStart];}else{return-1;}}},{key:"getTimeStampDeltaMessage",value:function getTimeStampDeltaMessage(pTimeStampHash,pMessage,pReferenceTime){var tmpTimeStampHash=typeof pTimeStampHash=='string'?pTimeStampHash:'Default';var tmpMessage=typeof pMessage!=='undefined'?pMessage:"Elapsed for ".concat(tmpTimeStampHash,": ");var tmpOperationTime=this.getTimeStampDelta(tmpTimeStampHash,pReferenceTime);return"".concat(tmpMessage," ").concat(this.formatTimeDuration(tmpOperationTime));}},{key:"logTimeStampDelta",value:function logTimeStampDelta(pTimeStampHash,pMessage,pReferenceTime){this.fable.log.info(this.getTimeStampDeltaMessage(pTimeStampHash,pMessage,pReferenceTime));}}]);return FableServiceProgressTime;}(libFableServiceBase);module.exports=FableServiceProgressTime;},{"fable-serviceproviderbase":51}],151:[function(require,module,exports){var ProgressTracker=/*#__PURE__*/function(){function ProgressTracker(pProgressTrackerSet,pProgressTrackerHash){_classCallCheck2(this,ProgressTracker);this.progressTrackerSet=pProgressTrackerSet;this.progressTrackerHash=pProgressTrackerHash;this.data=this.progressTrackerSet.getProgressTrackerData(this.progressTrackerHash);}_createClass2(ProgressTracker,[{key:"updateProgressTracker",value:function updateProgressTracker(pProgressAmount){return this.progressTrackerSet.updateProgressTracker(this.progressTrackerHash,pProgressAmount);}},{key:"incrementProgressTracker",value:function incrementProgressTracker(pProgressIncrementAmount){return this.progressTrackerSet.incrementProgressTracker(this.progressTrackerHash,pProgressIncrementAmount);}},{key:"setProgressTrackerTotalOperations",value:function setProgressTrackerTotalOperations(pTotalOperationCount){return this.progressTrackerSet.setProgressTrackerTotalOperations(this.progressTrackerHash,pTotalOperationCount);}},{key:"getProgressTrackerStatusString",value:function getProgressTrackerStatusString(){return this.progressTrackerSet.getProgressTrackerStatusString(this.progressTrackerHash);}}]);return ProgressTracker;}();module.exports=ProgressTracker;},{}],152:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');var libProgressTrackerClass=require('./Fable-Service-ProgressTracker/ProgressTracker.js');var FableServiceProgressTrackerSet=/*#__PURE__*/function(_libFableServiceBase10){_inherits(FableServiceProgressTrackerSet,_libFableServiceBase10);function FableServiceProgressTrackerSet(pFable,pOptions,pServiceHash){var _this39;_classCallCheck2(this,FableServiceProgressTrackerSet);_this39=_callSuper(this,FableServiceProgressTrackerSet,[pFable,pOptions,pServiceHash]);_this39.serviceType='ProgressTrackerSet';_this39.progressTrackers={};// Create an internal PorgressTime service to track timestamps
3740
- _this39.progressTimes=_this39.fable.instantiateServiceProviderWithoutRegistration('ProgressTime');// This timestamp is used and updated by *all* progress trackers.
3741
- _this39.progressTimes.createTimeStamp('CurrentTime');return _this39;}_createClass2(FableServiceProgressTrackerSet,[{key:"getProgressTracker",value:function getProgressTracker(pProgressTrackerHash){var tmpProgressTrackerHash=typeof pProgressTrackerHash=='string'?pProgressTrackerHash:'Default';if(!(tmpProgressTrackerHash in this.progressTrackers)){this.fable.log.warn("ProgressTracker ".concat(tmpProgressTrackerHash," does not exist! Creating a new tracker..."));this.createProgressTracker(tmpProgressTrackerHash,100);}return new libProgressTrackerClass(this,pProgressTrackerHash);}},{key:"getProgressTrackerData",value:function getProgressTrackerData(pProgressTrackerHash){var tmpProgressTrackerHash=typeof pProgressTrackerHash=='string'?pProgressTrackerHash:'Default';if(!(tmpProgressTrackerHash in this.progressTrackers)){this.fable.log.warn("ProgressTracker ".concat(tmpProgressTrackerHash," does not exist! Creating a new tracker..."));this.createProgressTracker(tmpProgressTrackerHash,100);}return this.progressTrackers[tmpProgressTrackerHash];}},{key:"createProgressTracker",value:function createProgressTracker(pProgressTrackerHash,pTotalOperations){var tmpProgressTrackerHash=typeof pProgressTrackerHash=='string'?pProgressTrackerHash:'Default';var tmpTotalOperations=typeof pTotalOperations=='number'?pTotalOperations:100;var tmpProgressTracker={Hash:tmpProgressTrackerHash,StartTimeHash:"".concat(tmpProgressTrackerHash,"-Start"),StartTimeStamp:-1,CurrentTimeStamp:-1,EndTimeHash:"".concat(tmpProgressTrackerHash,"-End"),EndTimeStamp:-1,PercentComplete:-1,// If this is set to true, PercentComplete will be calculated as CurrentCount / TotalCount even if it goes over 100%
3961
+ if(typeof pReferenceTime=='string'){tmpReferenceTime=tmpReference in this.timeStamps?this.timeStamps[tmpReference]:false;}else if(typeof pReferenceTime=='number'){tmpReferenceTime=pReferenceTime;}else{tmpReferenceTime=+new Date();}if(tmpTimeStampHash in this.timeStamps&&tmpReferenceTime){return tmpReferenceTime-this.timeStamps[tmpTimeStampHash];}else{return-1;}}},{key:"getDurationBetweenTimestamps",value:function getDurationBetweenTimestamps(pTimeStampHashStart,pTimeStampHashEnd){var tmpTimeStampHashStart=typeof pTimeStampHashStart=='string'?pTimeStampHashStart:'Default';var tmpTimeStampHashEnd=typeof pTimeStampHashEnd=='string'?pTimeStampHashEnd:'Default';if(tmpTimeStampHashStart in this.timeStamps&&tmpTimeStampHashEnd in this.timeStamps){return this.timeStamps[tmpTimeStampHashEnd]-this.timeStamps[tmpTimeStampHashStart];}else{return-1;}}},{key:"getTimeStampDeltaMessage",value:function getTimeStampDeltaMessage(pTimeStampHash,pMessage,pReferenceTime){var tmpTimeStampHash=typeof pTimeStampHash=='string'?pTimeStampHash:'Default';var tmpMessage=typeof pMessage!=='undefined'?pMessage:"Elapsed for ".concat(tmpTimeStampHash,": ");var tmpOperationTime=this.getTimeStampDelta(tmpTimeStampHash,pReferenceTime);return"".concat(tmpMessage," ").concat(this.formatTimeDuration(tmpOperationTime));}},{key:"logTimeStampDelta",value:function logTimeStampDelta(pTimeStampHash,pMessage,pReferenceTime){this.fable.log.info(this.getTimeStampDeltaMessage(pTimeStampHash,pMessage,pReferenceTime));}}]);return FableServiceProgressTime;}(libFableServiceBase);module.exports=FableServiceProgressTime;},{"fable-serviceproviderbase":51}],151:[function(require,module,exports){var ProgressTracker=/*#__PURE__*/function(){function ProgressTracker(pProgressTrackerSet,pProgressTrackerHash){_classCallCheck2(this,ProgressTracker);this.progressTrackerSet=pProgressTrackerSet;this.progressTrackerHash=pProgressTrackerHash;this.data=this.progressTrackerSet.getProgressTrackerData(this.progressTrackerHash);}_createClass2(ProgressTracker,[{key:"updateProgressTracker",value:function updateProgressTracker(pProgressAmount){return this.progressTrackerSet.updateProgressTracker(this.progressTrackerHash,pProgressAmount);}},{key:"incrementProgressTracker",value:function incrementProgressTracker(pProgressIncrementAmount){return this.progressTrackerSet.incrementProgressTracker(this.progressTrackerHash,pProgressIncrementAmount);}},{key:"setProgressTrackerTotalOperations",value:function setProgressTrackerTotalOperations(pTotalOperationCount){return this.progressTrackerSet.setProgressTrackerTotalOperations(this.progressTrackerHash,pTotalOperationCount);}},{key:"getProgressTrackerStatusString",value:function getProgressTrackerStatusString(){return this.progressTrackerSet.getProgressTrackerStatusString(this.progressTrackerHash);}}]);return ProgressTracker;}();module.exports=ProgressTracker;},{}],152:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');var libProgressTrackerClass=require('./Fable-Service-ProgressTracker/ProgressTracker.js');var FableServiceProgressTrackerSet=/*#__PURE__*/function(_libFableServiceBase10){_inherits(FableServiceProgressTrackerSet,_libFableServiceBase10);function FableServiceProgressTrackerSet(pFable,pOptions,pServiceHash){var _this40;_classCallCheck2(this,FableServiceProgressTrackerSet);_this40=_callSuper(this,FableServiceProgressTrackerSet,[pFable,pOptions,pServiceHash]);_this40.serviceType='ProgressTrackerSet';_this40.progressTrackers={};// Create an internal PorgressTime service to track timestamps
3962
+ _this40.progressTimes=_this40.fable.instantiateServiceProviderWithoutRegistration('ProgressTime');// This timestamp is used and updated by *all* progress trackers.
3963
+ _this40.progressTimes.createTimeStamp('CurrentTime');return _this40;}_createClass2(FableServiceProgressTrackerSet,[{key:"getProgressTracker",value:function getProgressTracker(pProgressTrackerHash){var tmpProgressTrackerHash=typeof pProgressTrackerHash=='string'?pProgressTrackerHash:'Default';if(!(tmpProgressTrackerHash in this.progressTrackers)){this.fable.log.warn("ProgressTracker ".concat(tmpProgressTrackerHash," does not exist! Creating a new tracker..."));this.createProgressTracker(tmpProgressTrackerHash,100);}return new libProgressTrackerClass(this,pProgressTrackerHash);}},{key:"getProgressTrackerData",value:function getProgressTrackerData(pProgressTrackerHash){var tmpProgressTrackerHash=typeof pProgressTrackerHash=='string'?pProgressTrackerHash:'Default';if(!(tmpProgressTrackerHash in this.progressTrackers)){this.fable.log.warn("ProgressTracker ".concat(tmpProgressTrackerHash," does not exist! Creating a new tracker..."));this.createProgressTracker(tmpProgressTrackerHash,100);}return this.progressTrackers[tmpProgressTrackerHash];}},{key:"createProgressTracker",value:function createProgressTracker(pProgressTrackerHash,pTotalOperations){var tmpProgressTrackerHash=typeof pProgressTrackerHash=='string'?pProgressTrackerHash:'Default';var tmpTotalOperations=typeof pTotalOperations=='number'?pTotalOperations:100;var tmpProgressTracker={Hash:tmpProgressTrackerHash,StartTimeHash:"".concat(tmpProgressTrackerHash,"-Start"),StartTimeStamp:-1,CurrentTimeStamp:-1,EndTimeHash:"".concat(tmpProgressTrackerHash,"-End"),EndTimeStamp:-1,PercentComplete:-1,// If this is set to true, PercentComplete will be calculated as CurrentCount / TotalCount even if it goes over 100%
3742
3964
  AllowTruePercentComplete:false,ElapsedTime:-1,AverageOperationTime:-1,EstimatedCompletionTime:-1,TotalCount:tmpTotalOperations,CurrentCount:-1};if(tmpProgressTrackerHash in this.progressTrackers){this.fable.log.warn("ProgressTracker ".concat(tmpProgressTrackerHash," already exists! Overwriting with a new tracker..."));this.progressTimes.removeTimeStamp(tmpProgressTracker.StartTimeHash);this.progressTimes.removeTimeStamp(tmpProgressTracker.EndTimeHash);}this.progressTrackers[tmpProgressTrackerHash]=tmpProgressTracker;return tmpProgressTracker;}},{key:"setProgressTrackerTotalOperations",value:function setProgressTrackerTotalOperations(pProgressTrackerHash,pTotalOperations){var tmpProgressTrackerHash=typeof pProgressTrackerHash=='string'?pProgressTrackerHash:'Default';var tmpTotalOperations=typeof pTotalOperations=='number'?pTotalOperations:100;if(!(tmpProgressTrackerHash in this.progressTrackers)){this.fable.log.warn("Attempted to set the total operations of ProgressTracker ".concat(tmpProgressTrackerHash," but it does not exist! Creating a new tracker..."));this.createProgressTracker(tmpProgressTrackerHash,tmpTotalOperations);}this.progressTrackers[tmpProgressTrackerHash].TotalCount=tmpTotalOperations;return this.progressTrackers[tmpProgressTrackerHash];}},{key:"startProgressTracker",value:function startProgressTracker(pProgressTrackerHash){var tmpProgressTrackerHash=typeof pProgressTrackerHash=='string'?pProgressTrackerHash:'Default';// This is the only method to lazily create ProgressTrackers now
3743
3965
  if(!(tmpProgressTrackerHash in this.progressTrackers)){this.createProgressTracker(tmpProgressTrackerHash,100);}var tmpProgressTracker=this.progressTrackers[tmpProgressTrackerHash];this.progressTimes.createTimeStamp(this.progressTrackers[tmpProgressTrackerHash].StartTimeHash);tmpProgressTracker.StartTimeStamp=this.progressTimes.getTimeStampValue(this.progressTrackers[tmpProgressTrackerHash].StartTimeHash);if(tmpProgressTracker.CurrentCount<0){tmpProgressTracker.CurrentCount=0;}return this.solveProgressTrackerStatus(tmpProgressTrackerHash);}},{key:"endProgressTracker",value:function endProgressTracker(pProgressTrackerHash){var tmpProgressTrackerHash=typeof pProgressTrackerHash=='string'?pProgressTrackerHash:'Default';if(!(tmpProgressTrackerHash in this.progressTrackers)){this.fable.log.error("Attempted to end ProgressTracker ".concat(tmpProgressTrackerHash," that does not exist!"));return false;}var tmpProgressTracker=this.progressTrackers[tmpProgressTrackerHash];this.progressTimes.createTimeStamp(this.progressTrackers[tmpProgressTrackerHash].EndTimeHash);tmpProgressTracker.EndTimeStamp=this.progressTimes.getTimeStampValue(this.progressTrackers[tmpProgressTrackerHash].EndTimeHash);return this.solveProgressTrackerStatus(tmpProgressTrackerHash);}},{key:"solveProgressTrackerStatus",value:function solveProgressTrackerStatus(pProgressTrackerHash){var tmpProgressTrackerHash=typeof pProgressTrackerHash=='string'?pProgressTrackerHash:'Default';if(!(tmpProgressTrackerHash in this.progressTrackers)){this.fable.log.error("Attempted to solve ProgressTracker ".concat(tmpProgressTrackerHash," that does not exist!"));return false;}var tmpProgressTracker=this.progressTrackers[tmpProgressTrackerHash];if(tmpProgressTracker.TotalCount<1||isNaN(tmpProgressTracker.TotalCount)){this.fable.log.error("ProgressTracker ".concat(tmpProgressTracker.Hash," has an invalid total count of operations (").concat(tmpProgressTracker.TotalCount,"! Setting it to the default of 100..."));tmpProgressTracker.TotalCount=100;}// Compute the percentage of progress that is complete.
3744
3966
  if(tmpProgressTracker.CurrentCount<1){tmpProgressTracker.PercentComplete=0;}else{tmpProgressTracker.PercentComplete=tmpProgressTracker.CurrentCount/tmpProgressTracker.TotalCount*100.0;}if(!tmpProgressTracker.AllowTruePercentComplete&&tmpProgressTracker.PercentComplete>100){tmpProgressTracker.PercentComplete=100;}// Compute the average time per operation
@@ -3759,20 +3981,20 @@ this.solveProgressTrackerStatus(tmpProgressTrackerHash);if(!(tmpProgressTrackerH
3759
3981
  if(tmpProgressTracker.StartTimeStamp<1){return"ProgressTracker ".concat(tmpProgressTracker.Hash," has not been started yet.");}// 2. Started, but no operations completed
3760
3982
  if(tmpProgressTracker.CurrentCount<1&&tmpProgressTracker.EndTimeStamp<1){return"ProgressTracker ".concat(tmpProgressTracker.Hash," has no completed operations. ").concat(this.progressTimes.formatTimeDuration(tmpProgressTracker.ElapsedTime)," have elapsed since it was started.");}// 3. Started, some operations completed
3761
3983
  else if(tmpProgressTracker.EndTimeStamp<1){return"ProgressTracker ".concat(tmpProgressTracker.Hash," is ").concat(tmpProgressTracker.PercentComplete.toFixed(3),"% completed - ").concat(tmpProgressTracker.CurrentCount," / ").concat(tmpProgressTracker.TotalCount," operations over ").concat(this.progressTimes.formatTimeDuration(tmpProgressTracker.ElapsedTime)," (median ").concat(this.progressTimes.formatTimeDuration(tmpProgressTracker.AverageOperationTime)," per). Estimated completion: ").concat(this.progressTimes.formatTimeDuration(tmpProgressTracker.EstimatedCompletionTime));}// 4. Done
3762
- else{return"ProgressTracker ".concat(tmpProgressTracker.Hash," is done. ").concat(tmpProgressTracker.CurrentCount," / ").concat(tmpProgressTracker.TotalCount," operations were completed in ").concat(this.progressTimes.formatTimeDuration(tmpProgressTracker.ElapsedTime)," (median ").concat(this.progressTimes.formatTimeDuration(tmpProgressTracker.AverageOperationTime)," per).");}}}},{key:"logProgressTrackerStatus",value:function logProgressTrackerStatus(pProgressTrackerHash){this.fable.log.info(this.getProgressTrackerStatusString(pProgressTrackerHash));}}]);return FableServiceProgressTrackerSet;}(libFableServiceBase);module.exports=FableServiceProgressTrackerSet;},{"./Fable-Service-ProgressTracker/ProgressTracker.js":151,"fable-serviceproviderbase":51}],153:[function(require,module,exports){(function(Buffer){(function(){var libFableServiceBase=require('fable-serviceproviderbase');var libSimpleGet=require('simple-get');var libCookie=require('cookie');var FableServiceRestClient=/*#__PURE__*/function(_libFableServiceBase11){_inherits(FableServiceRestClient,_libFableServiceBase11);function FableServiceRestClient(pFable,pOptions,pServiceHash){var _this40;_classCallCheck2(this,FableServiceRestClient);_this40=_callSuper(this,FableServiceRestClient,[pFable,pOptions,pServiceHash]);_this40.TraceLog=false;if(_this40.options.TraceLog||_this40.fable.TraceLog){_this40.TraceLog=true;}_this40.dataFormat=_this40.fable.services.DataFormat;_this40.serviceType='RestClient';_this40.cookie=false;// This is a function that can be overridden, to allow the management
3984
+ else{return"ProgressTracker ".concat(tmpProgressTracker.Hash," is done. ").concat(tmpProgressTracker.CurrentCount," / ").concat(tmpProgressTracker.TotalCount," operations were completed in ").concat(this.progressTimes.formatTimeDuration(tmpProgressTracker.ElapsedTime)," (median ").concat(this.progressTimes.formatTimeDuration(tmpProgressTracker.AverageOperationTime)," per).");}}}},{key:"logProgressTrackerStatus",value:function logProgressTrackerStatus(pProgressTrackerHash){this.fable.log.info(this.getProgressTrackerStatusString(pProgressTrackerHash));}}]);return FableServiceProgressTrackerSet;}(libFableServiceBase);module.exports=FableServiceProgressTrackerSet;},{"./Fable-Service-ProgressTracker/ProgressTracker.js":151,"fable-serviceproviderbase":51}],153:[function(require,module,exports){(function(Buffer){(function(){var libFableServiceBase=require('fable-serviceproviderbase');var libSimpleGet=require('simple-get');var libCookie=require('cookie');var FableServiceRestClient=/*#__PURE__*/function(_libFableServiceBase11){_inherits(FableServiceRestClient,_libFableServiceBase11);function FableServiceRestClient(pFable,pOptions,pServiceHash){var _this41;_classCallCheck2(this,FableServiceRestClient);_this41=_callSuper(this,FableServiceRestClient,[pFable,pOptions,pServiceHash]);_this41.TraceLog=false;if(_this41.options.TraceLog||_this41.fable.TraceLog){_this41.TraceLog=true;}_this41.dataFormat=_this41.fable.services.DataFormat;_this41.serviceType='RestClient';_this41.cookie=false;// This is a function that can be overridden, to allow the management
3763
3985
  // of the request options before they are passed to the request library.
3764
- _this40.prepareRequestOptions=function(pOptions){return pOptions;};return _this40;}_createClass2(FableServiceRestClient,[{key:"simpleGet",get:function get(){return libSimpleGet;}},{key:"prepareCookies",value:function prepareCookies(pRequestOptions){if(this.cookie){var tmpCookieObject=this.cookie;if(!('headers'in pRequestOptions)){pRequestOptions.headers={};}var tmpCookieKeys=Object.keys(tmpCookieObject);if(tmpCookieKeys.length>0){// Only grab the first for now.
3986
+ _this41.prepareRequestOptions=function(pOptions){return pOptions;};return _this41;}_createClass2(FableServiceRestClient,[{key:"simpleGet",get:function get(){return libSimpleGet;}},{key:"prepareCookies",value:function prepareCookies(pRequestOptions){if(this.cookie){var tmpCookieObject=this.cookie;if(!('headers'in pRequestOptions)){pRequestOptions.headers={};}var tmpCookieKeys=Object.keys(tmpCookieObject);if(tmpCookieKeys.length>0){// Only grab the first for now.
3765
3987
  pRequestOptions.headers.cookie=libCookie.serialize(tmpCookieKeys[0],tmpCookieObject[tmpCookieKeys[0]]);}}return pRequestOptions;}},{key:"preRequest",value:function preRequest(pOptions){// Validate the options object
3766
3988
  var tmpOptions=this.prepareCookies(pOptions);// Prepend a string to the URL if it exists in the Fable Config
3767
- if('RestClientURLPrefix'in this.fable.settings){tmpOptions.url=this.fable.settings.RestClientURLPrefix+tmpOptions.url;}return this.prepareRequestOptions(tmpOptions);}},{key:"executeChunkedRequest",value:function executeChunkedRequest(pOptions,fCallback){var _this41=this;var tmpOptions=this.preRequest(pOptions);tmpOptions.RequestStartTime=this.fable.log.getTimeStamp();if(this.TraceLog){this.fable.log.debug("Beginning ".concat(tmpOptions.method," request to ").concat(tmpOptions.url," at ").concat(tmpOptions.RequestStartTime));}return libSimpleGet(tmpOptions,function(pError,pResponse){if(pError){return fCallback(pError,pResponse);}if(_this41.TraceLog){var tmpConnectTime=_this41.fable.log.getTimeStamp();_this41.fable.log.debug("--> ".concat(tmpOptions.method," connected in ").concat(_this41.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpConnectTime),"ms code ").concat(pResponse.statusCode));}var tmpData='';pResponse.on('data',function(pChunk){// For JSON, the chunk is the serialized object.
3768
- if(_this41.TraceLog){var tmpChunkTime=_this41.fable.log.getTimeStamp();_this41.fable.log.debug("--> ".concat(tmpOptions.method," data chunk size ").concat(pChunk.length,"b received in ").concat(_this41.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpChunkTime),"ms"));}tmpData+=pChunk;});pResponse.on('end',function(){if(_this41.TraceLog){var tmpCompletionTime=_this41.fable.log.getTimeStamp();_this41.fable.log.debug("==> ".concat(tmpOptions.method," completed data size ").concat(tmpData.length,"b received in ").concat(_this41.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpCompletionTime),"ms"));}return fCallback(pError,pResponse,tmpData);});});}},{key:"executeChunkedRequestBinary",value:function executeChunkedRequestBinary(pOptions,fCallback){var _this42=this;var tmpOptions=this.preRequest(pOptions);tmpOptions.RequestStartTime=this.fable.log.getTimeStamp();if(this.TraceLog){this.fable.log.debug("Beginning ".concat(tmpOptions.method," request to ").concat(tmpOptions.url," at ").concat(tmpOptions.RequestStartTime));}tmpOptions.json=false;tmpOptions.encoding=null;return libSimpleGet(tmpOptions,function(pError,pResponse){if(pError){return fCallback(pError,pResponse);}if(_this42.TraceLog){var tmpConnectTime=_this42.fable.log.getTimeStamp();_this42.fable.log.debug("--> ".concat(tmpOptions.method," connected in ").concat(_this42.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpConnectTime),"ms code ").concat(pResponse.statusCode));}var tmpDataBuffer=false;pResponse.on('data',function(pChunk){// For JSON, the chunk is the serialized object.
3769
- if(_this42.TraceLog){var tmpChunkTime=_this42.fable.log.getTimeStamp();_this42.fable.log.debug("--> ".concat(tmpOptions.method," data chunk size ").concat(pChunk.length,"b received in ").concat(_this42.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpChunkTime),"ms"));}// TODO: Potentially create a third option that streams this to a file? So it doesn't have to hold it all in memory.
3770
- if(!tmpDataBuffer){tmpDataBuffer=Buffer.from(pChunk);}else{tmpDataBuffer=Buffer.concat([tmpDataBuffer,pChunk]);}});pResponse.on('end',function(){if(_this42.TraceLog){var tmpCompletionTime=_this42.fable.log.getTimeStamp();_this42.fable.log.debug("==> ".concat(tmpOptions.method," completed data size ").concat(tmpDataBuffer.length,"b received in ").concat(_this42.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpCompletionTime),"ms"));}return fCallback(pError,pResponse,tmpDataBuffer);});});}},{key:"executeJSONRequest",value:function executeJSONRequest(pOptions,fCallback){var _this43=this;pOptions.json=true;var tmpOptions=this.preRequest(pOptions);if(!('headers'in tmpOptions)){tmpOptions.headers={};}/* Automated headers break some APIs
3989
+ if('RestClientURLPrefix'in this.fable.settings){tmpOptions.url=this.fable.settings.RestClientURLPrefix+tmpOptions.url;}return this.prepareRequestOptions(tmpOptions);}},{key:"executeChunkedRequest",value:function executeChunkedRequest(pOptions,fCallback){var _this42=this;var tmpOptions=this.preRequest(pOptions);tmpOptions.RequestStartTime=this.fable.log.getTimeStamp();if(this.TraceLog){this.fable.log.debug("Beginning ".concat(tmpOptions.method," request to ").concat(tmpOptions.url," at ").concat(tmpOptions.RequestStartTime));}return libSimpleGet(tmpOptions,function(pError,pResponse){if(pError){return fCallback(pError,pResponse);}if(_this42.TraceLog){var tmpConnectTime=_this42.fable.log.getTimeStamp();_this42.fable.log.debug("--> ".concat(tmpOptions.method," connected in ").concat(_this42.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpConnectTime),"ms code ").concat(pResponse.statusCode));}var tmpData='';pResponse.on('data',function(pChunk){// For JSON, the chunk is the serialized object.
3990
+ if(_this42.TraceLog){var tmpChunkTime=_this42.fable.log.getTimeStamp();_this42.fable.log.debug("--> ".concat(tmpOptions.method," data chunk size ").concat(pChunk.length,"b received in ").concat(_this42.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpChunkTime),"ms"));}tmpData+=pChunk;});pResponse.on('end',function(){if(_this42.TraceLog){var tmpCompletionTime=_this42.fable.log.getTimeStamp();_this42.fable.log.debug("==> ".concat(tmpOptions.method," completed data size ").concat(tmpData.length,"b received in ").concat(_this42.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpCompletionTime),"ms"));}return fCallback(pError,pResponse,tmpData);});});}},{key:"executeChunkedRequestBinary",value:function executeChunkedRequestBinary(pOptions,fCallback){var _this43=this;var tmpOptions=this.preRequest(pOptions);tmpOptions.RequestStartTime=this.fable.log.getTimeStamp();if(this.TraceLog){this.fable.log.debug("Beginning ".concat(tmpOptions.method," request to ").concat(tmpOptions.url," at ").concat(tmpOptions.RequestStartTime));}tmpOptions.json=false;tmpOptions.encoding=null;return libSimpleGet(tmpOptions,function(pError,pResponse){if(pError){return fCallback(pError,pResponse);}if(_this43.TraceLog){var tmpConnectTime=_this43.fable.log.getTimeStamp();_this43.fable.log.debug("--> ".concat(tmpOptions.method," connected in ").concat(_this43.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpConnectTime),"ms code ").concat(pResponse.statusCode));}var tmpDataBuffer=false;pResponse.on('data',function(pChunk){// For JSON, the chunk is the serialized object.
3991
+ if(_this43.TraceLog){var tmpChunkTime=_this43.fable.log.getTimeStamp();_this43.fable.log.debug("--> ".concat(tmpOptions.method," data chunk size ").concat(pChunk.length,"b received in ").concat(_this43.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpChunkTime),"ms"));}// TODO: Potentially create a third option that streams this to a file? So it doesn't have to hold it all in memory.
3992
+ if(!tmpDataBuffer){tmpDataBuffer=Buffer.from(pChunk);}else{tmpDataBuffer=Buffer.concat([tmpDataBuffer,pChunk]);}});pResponse.on('end',function(){if(_this43.TraceLog){var tmpCompletionTime=_this43.fable.log.getTimeStamp();_this43.fable.log.debug("==> ".concat(tmpOptions.method," completed data size ").concat(tmpDataBuffer.length,"b received in ").concat(_this43.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpCompletionTime),"ms"));}return fCallback(pError,pResponse,tmpDataBuffer);});});}},{key:"executeJSONRequest",value:function executeJSONRequest(pOptions,fCallback){var _this44=this;pOptions.json=true;var tmpOptions=this.preRequest(pOptions);if(!('headers'in tmpOptions)){tmpOptions.headers={};}/* Automated headers break some APIs
3771
3993
  if (!('Content-Type' in tmpOptions.headers))
3772
3994
  {
3773
3995
  tmpOptions.headers['Content-Type'] = 'application/json';
3774
3996
  }
3775
- */tmpOptions.RequestStartTime=this.fable.log.getTimeStamp();if(this.TraceLog){this.fable.log.debug("Beginning ".concat(tmpOptions.method," JSON request to ").concat(tmpOptions.url," at ").concat(tmpOptions.RequestStartTime));}return libSimpleGet(tmpOptions,function(pError,pResponse){if(pError){return fCallback(pError,pResponse);}if(_this43.TraceLog){var tmpConnectTime=_this43.fable.log.getTimeStamp();_this43.fable.log.debug("--> JSON ".concat(tmpOptions.method," connected in ").concat(_this43.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpConnectTime),"ms code ").concat(pResponse.statusCode));}var tmpJSONData='';pResponse.on('data',function(pChunk){if(_this43.TraceLog){var tmpChunkTime=_this43.fable.log.getTimeStamp();_this43.fable.log.debug("--> JSON ".concat(tmpOptions.method," data chunk size ").concat(pChunk.length,"b received in ").concat(_this43.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpChunkTime),"ms"));}tmpJSONData+=pChunk;});pResponse.on('end',function(){if(_this43.TraceLog){var tmpCompletionTime=_this43.fable.log.getTimeStamp();_this43.fable.log.debug("==> JSON ".concat(tmpOptions.method," completed - received in ").concat(_this43.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpCompletionTime),"ms"));}return fCallback(pError,pResponse,JSON.parse(tmpJSONData));});});}},{key:"getJSON",value:function getJSON(pOptionsOrURL,fCallback){var tmpRequestOptions=_typeof(pOptionsOrURL)=='object'?pOptionsOrURL:{};if(typeof pOptionsOrURL=='string'){tmpRequestOptions.url=pOptionsOrURL;}tmpRequestOptions.method='GET';return this.executeJSONRequest(tmpRequestOptions,fCallback);}},{key:"putJSON",value:function putJSON(pOptions,fCallback){if(_typeof(pOptions.body)!='object'){return fCallback(new Error("PUT JSON Error Invalid options object"));}pOptions.method='PUT';return this.executeJSONRequest(pOptions,fCallback);}},{key:"postJSON",value:function postJSON(pOptions,fCallback){if(_typeof(pOptions.body)!='object'){return fCallback(new Error("POST JSON Error Invalid options object"));}pOptions.method='POST';return this.executeJSONRequest(pOptions,fCallback);}},{key:"patchJSON",value:function patchJSON(pOptions,fCallback){if(_typeof(pOptions.body)!='object'){return fCallback(new Error("PATCH JSON Error Invalid options object"));}pOptions.method='PATCH';return this.executeJSONRequest(pOptions,fCallback);}},{key:"headJSON",value:function headJSON(pOptions,fCallback){if(_typeof(pOptions.body)!='object'){return fCallback(new Error("HEAD JSON Error Invalid options object"));}pOptions.method='HEAD';return this.executeJSONRequest(pOptions,fCallback);}},{key:"delJSON",value:function delJSON(pOptions,fCallback){pOptions.method='DELETE';return this.executeJSONRequest(pOptions,fCallback);}},{key:"getRawText",value:function getRawText(pOptionsOrURL,fCallback){var tmpRequestOptions=_typeof(pOptionsOrURL)=='object'?pOptionsOrURL:{};if(typeof pOptionsOrURL=='string'){tmpRequestOptions.url=pOptionsOrURL;}tmpRequestOptions.method='GET';return this.executeChunkedRequest(tmpRequestOptions,fCallback);}}]);return FableServiceRestClient;}(libFableServiceBase);module.exports=FableServiceRestClient;}).call(this);}).call(this,require("buffer").Buffer);},{"buffer":20,"cookie":27,"fable-serviceproviderbase":51,"simple-get":101}],154:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');var FableServiceTemplate=/*#__PURE__*/function(_libFableServiceBase12){_inherits(FableServiceTemplate,_libFableServiceBase12);// Underscore and lodash have a behavior, _.template, which compiles a
3997
+ */tmpOptions.RequestStartTime=this.fable.log.getTimeStamp();if(this.TraceLog){this.fable.log.debug("Beginning ".concat(tmpOptions.method," JSON request to ").concat(tmpOptions.url," at ").concat(tmpOptions.RequestStartTime));}return libSimpleGet(tmpOptions,function(pError,pResponse){if(pError){return fCallback(pError,pResponse);}if(_this44.TraceLog){var tmpConnectTime=_this44.fable.log.getTimeStamp();_this44.fable.log.debug("--> JSON ".concat(tmpOptions.method," connected in ").concat(_this44.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpConnectTime),"ms code ").concat(pResponse.statusCode));}var tmpJSONData='';pResponse.on('data',function(pChunk){if(_this44.TraceLog){var tmpChunkTime=_this44.fable.log.getTimeStamp();_this44.fable.log.debug("--> JSON ".concat(tmpOptions.method," data chunk size ").concat(pChunk.length,"b received in ").concat(_this44.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpChunkTime),"ms"));}tmpJSONData+=pChunk;});pResponse.on('end',function(){if(_this44.TraceLog){var tmpCompletionTime=_this44.fable.log.getTimeStamp();_this44.fable.log.debug("==> JSON ".concat(tmpOptions.method," completed - received in ").concat(_this44.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpCompletionTime),"ms"));}return fCallback(pError,pResponse,JSON.parse(tmpJSONData));});});}},{key:"getJSON",value:function getJSON(pOptionsOrURL,fCallback){var tmpRequestOptions=_typeof(pOptionsOrURL)=='object'?pOptionsOrURL:{};if(typeof pOptionsOrURL=='string'){tmpRequestOptions.url=pOptionsOrURL;}tmpRequestOptions.method='GET';return this.executeJSONRequest(tmpRequestOptions,fCallback);}},{key:"putJSON",value:function putJSON(pOptions,fCallback){if(_typeof(pOptions.body)!='object'){return fCallback(new Error("PUT JSON Error Invalid options object"));}pOptions.method='PUT';return this.executeJSONRequest(pOptions,fCallback);}},{key:"postJSON",value:function postJSON(pOptions,fCallback){if(_typeof(pOptions.body)!='object'){return fCallback(new Error("POST JSON Error Invalid options object"));}pOptions.method='POST';return this.executeJSONRequest(pOptions,fCallback);}},{key:"patchJSON",value:function patchJSON(pOptions,fCallback){if(_typeof(pOptions.body)!='object'){return fCallback(new Error("PATCH JSON Error Invalid options object"));}pOptions.method='PATCH';return this.executeJSONRequest(pOptions,fCallback);}},{key:"headJSON",value:function headJSON(pOptions,fCallback){if(_typeof(pOptions.body)!='object'){return fCallback(new Error("HEAD JSON Error Invalid options object"));}pOptions.method='HEAD';return this.executeJSONRequest(pOptions,fCallback);}},{key:"delJSON",value:function delJSON(pOptions,fCallback){pOptions.method='DELETE';return this.executeJSONRequest(pOptions,fCallback);}},{key:"getRawText",value:function getRawText(pOptionsOrURL,fCallback){var tmpRequestOptions=_typeof(pOptionsOrURL)=='object'?pOptionsOrURL:{};if(typeof pOptionsOrURL=='string'){tmpRequestOptions.url=pOptionsOrURL;}tmpRequestOptions.method='GET';return this.executeChunkedRequest(tmpRequestOptions,fCallback);}}]);return FableServiceRestClient;}(libFableServiceBase);module.exports=FableServiceRestClient;}).call(this);}).call(this,require("buffer").Buffer);},{"buffer":20,"cookie":27,"fable-serviceproviderbase":51,"simple-get":101}],154:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');var FableServiceTemplate=/*#__PURE__*/function(_libFableServiceBase12){_inherits(FableServiceTemplate,_libFableServiceBase12);// Underscore and lodash have a behavior, _.template, which compiles a
3776
3998
  // string-based template with code snippets into simple executable pieces,
3777
3999
  // with the added twist of returning a precompiled function ready to go.
3778
4000
  //
@@ -3781,16 +4003,16 @@ if(!tmpDataBuffer){tmpDataBuffer=Buffer.from(pChunk);}else{tmpDataBuffer=Buffer.
3781
4003
  //
3782
4004
  // This is an implementation of that.
3783
4005
  // TODO: Make this use precedent, add configuration, add debugging.
3784
- function FableServiceTemplate(pFable,pOptions,pServiceHash){var _this44;_classCallCheck2(this,FableServiceTemplate);_this44=_callSuper(this,FableServiceTemplate,[pFable,pOptions,pServiceHash]);_this44.serviceType='Template';// These are the exact regex's used in lodash/underscore
4006
+ function FableServiceTemplate(pFable,pOptions,pServiceHash){var _this45;_classCallCheck2(this,FableServiceTemplate);_this45=_callSuper(this,FableServiceTemplate,[pFable,pOptions,pServiceHash]);_this45.serviceType='Template';// These are the exact regex's used in lodash/underscore
3785
4007
  // TODO: Switch this to precedent
3786
- _this44.Matchers={Evaluate:/<%([\s\S]+?)%>/g,Interpolate:/<%=([\s\S]+?)%>/g,Escaper:/\\|'|\r|\n|\t|\u2028|\u2029/g,Unescaper:/\\(\\|'|r|n|t|u2028|u2029)/g,// This is how underscore does it, so we are keeping it for now.
4008
+ _this45.Matchers={Evaluate:/<%([\s\S]+?)%>/g,Interpolate:/<%=([\s\S]+?)%>/g,Escaper:/\\|'|\r|\n|\t|\u2028|\u2029/g,Unescaper:/\\(\\|'|r|n|t|u2028|u2029)/g,// This is how underscore does it, so we are keeping it for now.
3787
4009
  GuaranteedNonMatch:/.^/};// This is a helper for the escaper and unescaper functions.
3788
4010
  // Right now we are going to keep what underscore is doing, but, not forever.
3789
- _this44.templateEscapes={'\\':'\\',"'":"'",'r':'\r','\r':'r','n':'\n','\n':'n','t':'\t','\t':'t','u2028':"\u2028","\u2028":'u2028','u2029':"\u2029","\u2029":'u2029'};// This is defined as such to underscore that it is a dynamic programming
4011
+ _this45.templateEscapes={'\\':'\\',"'":"'",'r':'\r','\r':'r','n':'\n','\n':'n','t':'\t','\t':'t','u2028':"\u2028","\u2028":'u2028','u2029':"\u2029","\u2029":'u2029'};// This is defined as such to underscore that it is a dynamic programming
3790
4012
  // function on this class.
3791
- _this44.renderFunction=false;_this44.templateString=false;return _this44;}_createClass2(FableServiceTemplate,[{key:"renderTemplate",value:function renderTemplate(pData){return this.renderFunction(pData);}},{key:"templateFunction",value:function templateFunction(){var fRenderTemplateBound=this.renderTemplate.bind(this);return fRenderTemplateBound;}},{key:"buildTemplateFunction",value:function buildTemplateFunction(pTemplateText,pData){var _this45=this;// For now this is being kept in a weird form ... this is to mimic the old
4013
+ _this45.renderFunction=false;_this45.templateString=false;return _this45;}_createClass2(FableServiceTemplate,[{key:"renderTemplate",value:function renderTemplate(pData){return this.renderFunction(pData);}},{key:"templateFunction",value:function templateFunction(){var fRenderTemplateBound=this.renderTemplate.bind(this);return fRenderTemplateBound;}},{key:"buildTemplateFunction",value:function buildTemplateFunction(pTemplateText,pData){var _this46=this;// For now this is being kept in a weird form ... this is to mimic the old
3792
4014
  // underscore code until this is rewritten using precedent.
3793
- this.TemplateSource="__p+='"+pTemplateText.replace(this.Matchers.Escaper,function(pMatch){return"\\".concat(_this45.templateEscapes[pMatch]);}).replace(this.Matchers.Interpolate||this.Matchers.GuaranteedNonMatch,function(pMatch,pCode){return"'+\n(".concat(decodeURIComponent(pCode),")+\n'");}).replace(this.Matchers.Evaluate||this.Matchers.GuaranteedNonMatch,function(pMatch,pCode){return"';\n".concat(decodeURIComponent(pCode),"\n;__p+='");})+"';\n";this.TemplateSource="with(pTemplateDataObject||{}){\n".concat(this.TemplateSource,"}\n");this.TemplateSource="var __p='';var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n".concat(this.TemplateSource,"return __p;\n");this.renderFunction=new Function('pTemplateDataObject',this.TemplateSource);if(typeof pData!='undefined'){return this.renderFunction(pData);}// Provide the compiled function source as a convenience for build time
4015
+ this.TemplateSource="__p+='"+pTemplateText.replace(this.Matchers.Escaper,function(pMatch){return"\\".concat(_this46.templateEscapes[pMatch]);}).replace(this.Matchers.Interpolate||this.Matchers.GuaranteedNonMatch,function(pMatch,pCode){return"'+\n(".concat(decodeURIComponent(pCode),")+\n'");}).replace(this.Matchers.Evaluate||this.Matchers.GuaranteedNonMatch,function(pMatch,pCode){return"';\n".concat(decodeURIComponent(pCode),"\n;__p+='");})+"';\n";this.TemplateSource="with(pTemplateDataObject||{}){\n".concat(this.TemplateSource,"}\n");this.TemplateSource="var __p='';var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n".concat(this.TemplateSource,"return __p;\n");this.renderFunction=new Function('pTemplateDataObject',this.TemplateSource);if(typeof pData!='undefined'){return this.renderFunction(pData);}// Provide the compiled function source as a convenience for build time
3794
4016
  // precompilation.
3795
4017
  this.TemplateSourceCompiled='function(obj){\n'+this.TemplateSource+'}';return this.templateFunction();}}]);return FableServiceTemplate;}(libFableServiceBase);module.exports=FableServiceTemplate;},{"fable-serviceproviderbase":51}],155:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');// TODO: These are still pretty big -- consider the smaller polyfills
3796
4018
  var libAsyncWaterfall=require('async.waterfall');var libAsyncEachLimit=require('async.eachlimit');var libBigNumber=require('big.js');var FableServiceUtility=/*#__PURE__*/function(_libFableServiceBase13){_inherits(FableServiceUtility,_libFableServiceBase13);// Underscore and lodash have a behavior, _.template, which compiles a
@@ -3802,8 +4024,8 @@ var libAsyncWaterfall=require('async.waterfall');var libAsyncEachLimit=require('
3802
4024
  //
3803
4025
  // This is an implementation of that.
3804
4026
  // TODO: Make this use precedent, add configuration, add debugging.
3805
- function FableServiceUtility(pFable,pOptions,pServiceHash){var _this46;_classCallCheck2(this,FableServiceUtility);_this46=_callSuper(this,FableServiceUtility,[pFable,pOptions,pServiceHash]);_this46.templates={};// These two functions are used extensively throughout
3806
- _this46.waterfall=libAsyncWaterfall;_this46.eachLimit=libAsyncEachLimit;_this46.bigNumber=libBigNumber;return _this46;}// Underscore and lodash have a behavior, _.extend, which merges objects.
4027
+ function FableServiceUtility(pFable,pOptions,pServiceHash){var _this47;_classCallCheck2(this,FableServiceUtility);_this47=_callSuper(this,FableServiceUtility,[pFable,pOptions,pServiceHash]);_this47.templates={};// These two functions are used extensively throughout
4028
+ _this47.waterfall=libAsyncWaterfall;_this47.eachLimit=libAsyncEachLimit;_this47.bigNumber=libBigNumber;return _this47;}// Underscore and lodash have a behavior, _.extend, which merges objects.
3807
4029
  // Now that es6 gives us this, use the native thingy.
3808
4030
  // Nevermind, the native thing is not stable enough across environments
3809
4031
  // Basic shallow copy