pict 1.0.213 → 1.0.215
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pict.compatible.js +113 -91
- package/dist/pict.compatible.min.js +2 -2
- package/dist/pict.compatible.min.js.map +1 -1
- package/dist/pict.js +34 -12
- package/dist/pict.min.js +2 -2
- package/dist/pict.min.js.map +1 -1
- package/package.json +5 -5
- package/source/Pict.js +2 -2
- package/types/Pict.d.ts +3 -3
- package/types/Pict.d.ts.map +1 -1
package/dist/pict.compatible.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _defineProperty2(e,r,t){return(r=_toPropertyKey2(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _classCallCheck2(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey2(o.key),o);}}function _createClass2(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey2(t){var i=_toPrimitive2(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive2(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}(function(f){if((typeof exports==="undefined"?"undefined":_typeof(exports))==="object"&&typeof module!=="undefined"){module.exports=f();}else if(typeof define==="function"&&define.amd){define([],f);}else{var g;if(typeof window!=="undefined"){g=window;}else if(typeof global!=="undefined"){g=global;}else if(typeof self!=="undefined"){g=self;}else{g=this;}g.Pict=f();}})(function(){var define,module,exports;return function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a;}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r);},p,p.exports,r,e,n,t);}return n[i].exports;}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o;}return r;}()({1:[function(require,module,exports){'use strict';var eachOfLimit=require('async.util.eachoflimit');var withoutIndex=require('async.util.withoutindex');module.exports=function eachLimit(arr,limit,iterator,cb){return eachOfLimit(limit)(arr,withoutIndex(iterator),cb);};},{"async.util.eachoflimit":3,"async.util.withoutindex":14}],2:[function(require,module,exports){'use strict';module.exports=function(tasks){function makeCallback(index){function fn(){if(tasks.length){tasks[index].apply(null,arguments);}return fn.next();}fn.next=function(){return index<tasks.length-1?makeCallback(index+1):null;};return fn;}return makeCallback(0);};},{}],3:[function(require,module,exports){var once=require('async.util.once');var noop=require('async.util.noop');var onlyOnce=require('async.util.onlyonce');var keyIterator=require('async.util.keyiterator');module.exports=function eachOfLimit(limit){return function(obj,iterator,cb){cb=once(cb||noop);obj=obj||[];var nextKey=keyIterator(obj);if(limit<=0){return cb(null);}var done=false;var running=0;var errored=false;(function replenish(){if(done&&running<=0){return cb(null);}while(running<limit&&!errored){var key=nextKey();if(key===null){done=true;if(running<=0){cb(null);}return;}running+=1;iterator(obj[key],key,onlyOnce(function(err){running-=1;if(err){cb(err);errored=true;}else{replenish();}}));}})();};};},{"async.util.keyiterator":7,"async.util.noop":9,"async.util.once":10,"async.util.onlyonce":11}],4:[function(require,module,exports){'use strict';var setImmediate=require('async.util.setimmediate');var restParam=require('async.util.restparam');module.exports=function(fn){return restParam(function(args){var callback=args.pop();args.push(function(){var innerArgs=arguments;if(sync){setImmediate(function(){callback.apply(null,innerArgs);});}else{callback.apply(null,innerArgs);}});var sync=true;fn.apply(this,args);sync=false;});};},{"async.util.restparam":12,"async.util.setimmediate":13}],5:[function(require,module,exports){'use strict';module.exports=Array.isArray||function isArray(obj){return Object.prototype.toString.call(obj)==='[object Array]';};},{}],6:[function(require,module,exports){'use strict';var isArray=require('async.util.isarray');module.exports=function isArrayLike(arr){return isArray(arr)||// has a positive integer length property
|
|
1
|
+
"use strict";function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _defineProperty2(e,r,t){return(r=_toPropertyKey2(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _superPropGet(t,e,r,o){var p=_get(_getPrototypeOf(1&o?t.prototype:t),e,r);return 2&o?function(t){return p.apply(r,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _classCallCheck2(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey2(o.key),o);}}function _createClass2(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey2(t){var i=_toPrimitive2(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive2(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}(function(f){if((typeof exports==="undefined"?"undefined":_typeof(exports))==="object"&&typeof module!=="undefined"){module.exports=f();}else if(typeof define==="function"&&define.amd){define([],f);}else{var g;if(typeof window!=="undefined"){g=window;}else if(typeof global!=="undefined"){g=global;}else if(typeof self!=="undefined"){g=self;}else{g=this;}g.Pict=f();}})(function(){var define,module,exports;return function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a;}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r);},p,p.exports,r,e,n,t);}return n[i].exports;}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o;}return r;}()({1:[function(require,module,exports){'use strict';var eachOfLimit=require('async.util.eachoflimit');var withoutIndex=require('async.util.withoutindex');module.exports=function eachLimit(arr,limit,iterator,cb){return eachOfLimit(limit)(arr,withoutIndex(iterator),cb);};},{"async.util.eachoflimit":3,"async.util.withoutindex":14}],2:[function(require,module,exports){'use strict';module.exports=function(tasks){function makeCallback(index){function fn(){if(tasks.length){tasks[index].apply(null,arguments);}return fn.next();}fn.next=function(){return index<tasks.length-1?makeCallback(index+1):null;};return fn;}return makeCallback(0);};},{}],3:[function(require,module,exports){var once=require('async.util.once');var noop=require('async.util.noop');var onlyOnce=require('async.util.onlyonce');var keyIterator=require('async.util.keyiterator');module.exports=function eachOfLimit(limit){return function(obj,iterator,cb){cb=once(cb||noop);obj=obj||[];var nextKey=keyIterator(obj);if(limit<=0){return cb(null);}var done=false;var running=0;var errored=false;(function replenish(){if(done&&running<=0){return cb(null);}while(running<limit&&!errored){var key=nextKey();if(key===null){done=true;if(running<=0){cb(null);}return;}running+=1;iterator(obj[key],key,onlyOnce(function(err){running-=1;if(err){cb(err);errored=true;}else{replenish();}}));}})();};};},{"async.util.keyiterator":7,"async.util.noop":9,"async.util.once":10,"async.util.onlyonce":11}],4:[function(require,module,exports){'use strict';var setImmediate=require('async.util.setimmediate');var restParam=require('async.util.restparam');module.exports=function(fn){return restParam(function(args){var callback=args.pop();args.push(function(){var innerArgs=arguments;if(sync){setImmediate(function(){callback.apply(null,innerArgs);});}else{callback.apply(null,innerArgs);}});var sync=true;fn.apply(this,args);sync=false;});};},{"async.util.restparam":12,"async.util.setimmediate":13}],5:[function(require,module,exports){'use strict';module.exports=Array.isArray||function isArray(obj){return Object.prototype.toString.call(obj)==='[object Array]';};},{}],6:[function(require,module,exports){'use strict';var isArray=require('async.util.isarray');module.exports=function isArrayLike(arr){return isArray(arr)||// has a positive integer length property
|
|
2
2
|
typeof arr.length==='number'&&arr.length>=0&&arr.length%1===0;};},{"async.util.isarray":5}],7:[function(require,module,exports){'use strict';var _keys=require('async.util.keys');var isArrayLike=require('async.util.isarraylike');module.exports=function keyIterator(coll){var i=-1;var len;var keys;if(isArrayLike(coll)){len=coll.length;return function next(){i++;return i<len?i:null;};}else{keys=_keys(coll);len=keys.length;return function next(){i++;return i<len?keys[i]:null;};}};},{"async.util.isarraylike":6,"async.util.keys":8}],8:[function(require,module,exports){'use strict';module.exports=Object.keys||function keys(obj){var _keys=[];for(var k in obj){if(obj.hasOwnProperty(k)){_keys.push(k);}}return _keys;};},{}],9:[function(require,module,exports){'use strict';module.exports=function noop(){};},{}],10:[function(require,module,exports){'use strict';module.exports=function once(fn){return function(){if(fn===null)return;fn.apply(this,arguments);fn=null;};};},{}],11:[function(require,module,exports){'use strict';module.exports=function only_once(fn){return function(){if(fn===null)throw new Error('Callback was already called.');fn.apply(this,arguments);fn=null;};};},{}],12:[function(require,module,exports){'use strict';module.exports=function restParam(func,startIndex){startIndex=startIndex==null?func.length-1:+startIndex;return function(){var length=Math.max(arguments.length-startIndex,0);var rest=new Array(length);for(var index=0;index<length;index++){rest[index]=arguments[index+startIndex];}switch(startIndex){case 0:return func.call(this,rest);case 1:return func.call(this,arguments[0],rest);}};};},{}],13:[function(require,module,exports){(function(setImmediate){(function(){'use strict';var _setImmediate=typeof setImmediate==='function'&&setImmediate;var fallback=function fallback(fn){setTimeout(fn,0);};module.exports=function setImmediate(fn){// not a direct alias for IE10 compatibility
|
|
3
3
|
return(_setImmediate||fallback)(fn);};}).call(this);}).call(this,require("timers").setImmediate);},{"timers":158}],14:[function(require,module,exports){'use strict';module.exports=function withoutIndex(iterator){return function(value,index,callback){return iterator(value,callback);};};},{}],15:[function(require,module,exports){'use strict';var once=require('async.util.once');var noop=require('async.util.noop');var isArray=require('async.util.isarray');var restParam=require('async.util.restparam');var ensureAsync=require('async.util.ensureasync');var iterator=require('async.iterator');module.exports=function(tasks,cb){cb=once(cb||noop);if(!isArray(tasks))return cb(new Error('First argument to waterfall must be an array of functions'));if(!tasks.length)return cb();function wrapIterator(iterator){return restParam(function(err,args){if(err){cb.apply(null,[err].concat(args));}else{var next=iterator.next();if(next){args.push(wrapIterator(next));}else{args.push(cb);}ensureAsync(iterator).apply(null,args);}});}wrapIterator(iterator(tasks))();};},{"async.iterator":2,"async.util.ensureasync":4,"async.util.isarray":5,"async.util.noop":9,"async.util.once":10,"async.util.restparam":12}],16:[function(require,module,exports){'use strict';exports.byteLength=byteLength;exports.toByteArray=toByteArray;exports.fromByteArray=fromByteArray;var lookup=[];var revLookup=[];var Arr=typeof Uint8Array!=='undefined'?Uint8Array:Array;var code='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';for(var i=0,len=code.length;i<len;++i){lookup[i]=code[i];revLookup[code.charCodeAt(i)]=i;}// Support decoding URL-safe base64 strings, as Node.js does.
|
|
4
4
|
// See: https://en.wikipedia.org/wiki/Base64#URL_applications
|
|
@@ -485,14 +485,14 @@ if(pNode.LeftNode&&pNode.RightNode){pNode.LeftNode.RightNode=pNode.RightNode;pNo
|
|
|
485
485
|
if(pNode.LeftNode){pNode.LeftNode.RightNode=false;this.tail=pNode.LeftNode;pNode.LeftNode=false;return pNode;}// It must be the head
|
|
486
486
|
pNode.RightNode.LeftNode=false;this.head=pNode.RightNode;pNode.RightNode=false;return pNode;}// Remove the head of the list (FIFO)
|
|
487
487
|
},{key:"pop",value:function pop(){return this.remove(this.head);}// Enumerate over each node IN ORDER, running the function fAction(pDatum, pHash, fCallback) then calling the function fComplete callback when done
|
|
488
|
-
},{key:"each",value:function each(fAction,fComplete){var _this5=this;if(this.length<1)return fComplete();var tmpNode=false;var
|
|
488
|
+
},{key:"each",value:function each(fAction,fComplete){var _this5=this;if(this.length<1)return fComplete();var tmpNode=false;var _fIterator=function fIterator(pError){// If the user passed in a callback with an error, call their callback with the error
|
|
489
489
|
if(pError)return fComplete(pError);// If there is no node, this must be the initial run.
|
|
490
490
|
if(!tmpNode)tmpNode=_this5.head;// Check if we are at the tail of the list
|
|
491
491
|
else if(!tmpNode.RightNode)return fComplete();// Proceed to the next node
|
|
492
492
|
else tmpNode=tmpNode.RightNode;// Call the actual action
|
|
493
493
|
// I hate this pattern because long tails eventually cause stack overflows.
|
|
494
|
-
fAction(tmpNode.Datum,tmpNode.Hash,
|
|
495
|
-
return
|
|
494
|
+
fAction(tmpNode.Datum,tmpNode.Hash,_fIterator);};// Now kick off the iterator
|
|
495
|
+
return _fIterator();}// Seek a specific node, 0 is the index of the first node.
|
|
496
496
|
},{key:"seek",value:function seek(pNodeIndex){if(!pNodeIndex)return false;if(this.length<1)return false;if(pNodeIndex>=this.length)return false;var tmpNode=this.head;for(var i=0;i<pNodeIndex;i++){tmpNode=tmpNode.RightNode;}return tmpNode;}}]);}();module.exports=LinkedList;},{"./LinkedList-Node.js":23}],25:[function(require,module,exports){'use strict';var GetIntrinsic=require('get-intrinsic');var callBind=require('./');var $indexOf=callBind(GetIntrinsic('String.prototype.indexOf'));module.exports=function callBoundIntrinsic(name,allowMissing){var intrinsic=GetIntrinsic(name,!!allowMissing);if(typeof intrinsic==='function'&&$indexOf(name,'.prototype.')>-1){return callBind(intrinsic);}return intrinsic;};},{"./":26,"get-intrinsic":91}],26:[function(require,module,exports){'use strict';var bind=require('function-bind');var GetIntrinsic=require('get-intrinsic');var setFunctionLength=require('set-function-length');var $TypeError=require('es-errors/type');var $apply=GetIntrinsic('%Function.prototype.apply%');var $call=GetIntrinsic('%Function.prototype.call%');var $reflectApply=GetIntrinsic('%Reflect.apply%',true)||bind.call($call,$apply);var $defineProperty=require('es-define-property');var $max=GetIntrinsic('%Math.max%');module.exports=function callBind(originalFunction){if(typeof originalFunction!=='function'){throw new $TypeError('a function is required');}var func=$reflectApply(bind,$call,arguments);return setFunctionLength(func,1+$max(0,originalFunction.length-(arguments.length-1)),true);};var applyBind=function applyBind(){return $reflectApply(bind,$apply,arguments);};if($defineProperty){$defineProperty(module.exports,'apply',{value:applyBind});}else{module.exports.apply=applyBind;}},{"es-define-property":37,"es-errors/type":43,"function-bind":90,"get-intrinsic":91,"set-function-length":134}],27:[function(require,module,exports){/*!
|
|
497
497
|
* cookie
|
|
498
498
|
* Copyright(c) 2012-2014 Roman Shtylman
|
|
@@ -645,7 +645,7 @@ var tmpLineStrings=this.logLineStrings;var tmpObjectStrings=this.logObjectString
|
|
|
645
645
|
this.logLineStrings=[];this.logObjectStrings=[];// This is where we will put each line before writing it to the file...
|
|
646
646
|
var tmpConstructedBufferOutputString='';for(var i=0;i<tmpLineStrings.length;i++){// TODO: Windows Newline? ....... yo no se!
|
|
647
647
|
tmpConstructedBufferOutputString+="".concat(tmpLineStrings[i],"\n");if(tmpObjectStrings[i]!==false){tmpConstructedBufferOutputString+="".concat(tmpObjectStrings[i],"\n");}}if(!this.fileWriter.write(tmpConstructedBufferOutputString,'utf8')){// If the streamwriter returns false, we need to wait for it to drain.
|
|
648
|
-
this.fileWriter.once('drain',this.completeBufferFlushToLogFile.bind(this,tmpFlushComplete));}else{return this.completeBufferFlushToLogFile(tmpFlushComplete);}}}},{key:"write",value:function write(pLevel,pLogText,pObject){var tmpLogLine=
|
|
648
|
+
this.fileWriter.once('drain',this.completeBufferFlushToLogFile.bind(this,tmpFlushComplete));}else{return this.completeBufferFlushToLogFile(tmpFlushComplete);}}}},{key:"write",value:function write(pLevel,pLogText,pObject){var tmpLogLine=_superPropGet(SimpleFlatFileLogger,"write",this,3)([pLevel,pLogText,pObject]);// Use a very simple array as the write buffer
|
|
649
649
|
this.logLineStrings.push(tmpLogLine);// Write out the object on a separate line if it is passed in
|
|
650
650
|
if(typeof pObject!=='undefined'){this.logObjectStrings.push(JSON.stringify(pObject,null,4));}else{this.logObjectStrings.push(false);}this.flushBufferToLogFile();}}]);}(libConsoleLog);module.exports=SimpleFlatFileLogger;},{"./Fable-Log-Logger-Console.js":49,"fs":19,"path":115}],51:[function(require,module,exports){/**
|
|
651
651
|
* Fable Logging Service
|
|
@@ -1360,7 +1360,7 @@ else{tmpResults.PostfixSolveList.push(this.getPosfixSolveListOperation(_tmpToken
|
|
|
1360
1360
|
var tmpAbstractAssignToken=this.getTokenContainerObject('=');// The address we are assigning to
|
|
1361
1361
|
tmpAbstractAssignToken.VirtualSymbolName=tmpResults.PostfixedAssignmentAddress;// The address it's coming from
|
|
1362
1362
|
var tmpSolveResultToken=this.getTokenContainerObject('Result','Token.LastResult');var tmpFinalAssignmentInstruction=this.getPosfixSolveListOperation(tmpAbstractAssignToken,tmpSolveResultToken,this.getTokenContainerObject('SolverMarshal','Token.SolverMarshal'));tmpResults.PostfixSolveList.push(tmpFinalAssignmentInstruction);return tmpResults.PostfixSolveList;}}]);}(libExpressionParserOperationBase);module.exports=ExpressionParserPostfix;},{"./Fable-Service-ExpressionParser-Base.js":67}],73:[function(require,module,exports){var libExpressionParserOperationBase=require('./Fable-Service-ExpressionParser-Base.js');var ExpressionParserSolver=/*#__PURE__*/function(_libExpressionParserO5){function ExpressionParserSolver(pFable,pOptions,pServiceHash){var _this26;_classCallCheck2(this,ExpressionParserSolver);_this26=_callSuper(this,ExpressionParserSolver,[pFable,pOptions,pServiceHash]);_this26.serviceType='ExpressionParser-Solver';return _this26;}_inherits(ExpressionParserSolver,_libExpressionParserO5);return _createClass2(ExpressionParserSolver,[{key:"solvePostfixedExpression",value:function solvePostfixedExpression(pPostfixedExpression,pDataDestinationObject,pResultObject,pManifest){var tmpResults=_typeof(pResultObject)==='object'?pResultObject:{ExpressionParserLog:[]};var tmpManifest=_typeof(pManifest)==='object'?pManifest:this.fable.newManyfest();var tmpDataDestinationObject=_typeof(pDataDestinationObject)==='object'?pDataDestinationObject:{};// If there was a fable passed in (e.g. the results object was a service or such), we won't decorate
|
|
1363
|
-
var tmpPassedInFable=
|
|
1363
|
+
var tmpPassedInFable='fable'in tmpResults;if(!tmpPassedInFable){tmpResults.fable=this.fable;}if(!Array.isArray(pPostfixedExpression)){tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.solvePostfixedExpression was passed a non-array postfixed expression.");this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);return false;}if(pPostfixedExpression.length<1){tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.solvePostfixedExpression was passed an empty postfixed expression.");this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);return false;}// This is how the user communication magic happens.
|
|
1364
1364
|
tmpResults.VirtualSymbols={};for(var i=0;i<pPostfixedExpression.length;i++){if(pPostfixedExpression[i].Operation.Type==='Token.SolverInstruction'){continue;}var tmpStepResultObject={ExpressionStep:pPostfixedExpression[i],ExpressionStepIndex:i,ResultsObject:tmpResults,Manifest:tmpManifest};if(tmpStepResultObject.ExpressionStep.LeftValue.Type==='Token.LastResult'){tmpStepResultObject.ExpressionStep.LeftValue.Value=tmpResults.LastResult;}if(tmpStepResultObject.ExpressionStep.RightValue.Type==='Token.LastResult'){tmpStepResultObject.ExpressionStep.RightValue.Value=tmpResults.LastResult;}if(tmpStepResultObject.ExpressionStep.LeftValue.Type==='Token.VirtualSymbol'){tmpStepResultObject.ExpressionStep.LeftValue.Value=tmpManifest.getValueAtAddress(tmpResults.VirtualSymbols,tmpStepResultObject.ExpressionStep.LeftValue.Token);}if(tmpStepResultObject.ExpressionStep.RightValue.Type==='Token.VirtualSymbol'){tmpStepResultObject.ExpressionStep.RightValue.Value=tmpManifest.getValueAtAddress(tmpResults.VirtualSymbols,tmpStepResultObject.ExpressionStep.RightValue.Token);}// Resolve the parenthesis to their actual values
|
|
1365
1365
|
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
|
|
1366
1366
|
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.
|
|
@@ -2721,7 +2721,7 @@ this.elementHashes[pDescriptor.Hash]=pAddress;}else{pDescriptor.Hash=pAddress;}r
|
|
|
2721
2721
|
*/ // Check if an element exists by its hash
|
|
2722
2722
|
},{key:"checkAddressExistsByHash",value:function checkAddressExistsByHash(pObject,pHash){return this.checkAddressExists(pObject,this.resolveHashAddress(pHash));}// Check if an element exists at an address
|
|
2723
2723
|
},{key:"checkAddressExists",value:function checkAddressExists(pObject,pAddress){return this.objectAddressCheckAddressExists.checkAddressExists(pObject,pAddress);}// Turn a hash into an address, factoring in the translation table.
|
|
2724
|
-
},{key:"resolveHashAddress",value:function resolveHashAddress(pHash){var tmpAddress=undefined;var tmpInElementHashTable=
|
|
2724
|
+
},{key:"resolveHashAddress",value:function resolveHashAddress(pHash){var tmpAddress=undefined;var tmpInElementHashTable=pHash in this.elementHashes;var tmpInTranslationTable=pHash in this.hashTranslations.translationTable;// The most straightforward: the hash exists, no translations.
|
|
2725
2725
|
if(tmpInElementHashTable&&!tmpInTranslationTable){tmpAddress=this.elementHashes[pHash];}// There is a translation from one hash to another, and, the elementHashes contains the pointer end
|
|
2726
2726
|
else if(tmpInTranslationTable&&this.hashTranslations.translate(pHash)in this.elementHashes){tmpAddress=this.elementHashes[this.hashTranslations.translate(pHash)];}// Use the level of indirection only in the Translation Table
|
|
2727
2727
|
else if(tmpInTranslationTable){tmpAddress=this.hashTranslations.translate(pHash);}// Just treat the hash as an address.
|
|
@@ -2773,7 +2773,7 @@ if(!has(obj,key)){continue;}// eslint-disable-line no-restricted-syntax, no-cont
|
|
|
2773
2773
|
if(isArr&&String(Number(key))===key&&key<obj.length){continue;}// eslint-disable-line no-restricted-syntax, no-continue
|
|
2774
2774
|
if(hasShammedSymbols&&symMap['$'+key]instanceof Symbol){// this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
|
|
2775
2775
|
continue;// eslint-disable-line no-restricted-syntax, no-continue
|
|
2776
|
-
}else if($test.call(/[^\w$]/,key)){xs.push(inspect(key,obj)+': '+inspect(obj[key],obj));}else{xs.push(key+': '+inspect(obj[key],obj));}}if(typeof gOPS==='function'){for(var j=0;j<syms.length;j++){if(isEnumerable.call(obj,syms[j])){xs.push('['+inspect(syms[j])+']: '+inspect(obj[syms[j]],obj));}}}return xs;}}).call(this);}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{"./util.inspect":18}],114:[function(require,module,exports){var wrappy=require('wrappy');module.exports=wrappy(once);module.exports.strict=wrappy(onceStrict);once.proto=once(function(){Object.defineProperty(Function.prototype,'once',{value:function value(){return once(this);},configurable:true});Object.defineProperty(Function.prototype,'onceStrict',{value:function value(){return onceStrict(this);},configurable:true});});function once(fn){var
|
|
2776
|
+
}else if($test.call(/[^\w$]/,key)){xs.push(inspect(key,obj)+': '+inspect(obj[key],obj));}else{xs.push(key+': '+inspect(obj[key],obj));}}if(typeof gOPS==='function'){for(var j=0;j<syms.length;j++){if(isEnumerable.call(obj,syms[j])){xs.push('['+inspect(syms[j])+']: '+inspect(obj[syms[j]],obj));}}}return xs;}}).call(this);}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{"./util.inspect":18}],114:[function(require,module,exports){var wrappy=require('wrappy');module.exports=wrappy(once);module.exports.strict=wrappy(onceStrict);once.proto=once(function(){Object.defineProperty(Function.prototype,'once',{value:function value(){return once(this);},configurable:true});Object.defineProperty(Function.prototype,'onceStrict',{value:function value(){return onceStrict(this);},configurable:true});});function once(fn){var _f=function f(){if(_f.called)return _f.value;_f.called=true;return _f.value=fn.apply(this,arguments);};_f.called=false;return _f;}function onceStrict(fn){var _f2=function f(){if(_f2.called)throw new Error(_f2.onceError);_f2.called=true;return _f2.value=fn.apply(this,arguments);};var name=fn.name||'Function wrapped with `once`';_f2.onceError=name+" shouldn't be called more than once";_f2.called=false;return _f2;}},{"wrappy":161}],115:[function(require,module,exports){(function(process){(function(){// 'path' module extracted from Node.js v8.11.1 (only the posix part)
|
|
2777
2777
|
// transplited with Babel
|
|
2778
2778
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
2779
2779
|
//
|
|
@@ -2911,13 +2911,13 @@ var tmpOptions=Object.assign({},JSON.parse(JSON.stringify(defaultPictProviderSet
|
|
|
2911
2911
|
_this58.pict=_this58.fable;// Wire in the essential Pict application state
|
|
2912
2912
|
_this58.AppData=_this58.pict.AppData;_this58.initializeTimestamp=false;_this58.lastSolvedTimestamp=false;for(var i=0;i<_this58.options.Templates.length;i++){var tmpDefaultTemplate=_this58.options.Templates[i];if(!tmpDefaultTemplate.hasOwnProperty('Postfix')||!tmpDefaultTemplate.hasOwnProperty('Template')){_this58.log.error("PictProvider [".concat(_this58.UUID,"]::[").concat(_this58.Hash,"] ").concat(_this58.options.ProviderIdentifier," could not load Default Template ").concat(i," in the options array."),tmpDefaultTemplate);}else{if(!tmpDefaultTemplate.Source){tmpDefaultTemplate.Source="PictProvider [".concat(_this58.UUID,"]::[").concat(_this58.Hash,"] ").concat(_this58.options.ProviderIdentifier," options object.");}_this58.pict.TemplateProvider.addDefaultTemplate(tmpDefaultTemplate.Prefix,tmpDefaultTemplate.Postfix,tmpDefaultTemplate.Template,tmpDefaultTemplate.Source);}}return _this58;}/* -------------------------------------------------------------------------- */ /* Code Section: Initialization */ /* -------------------------------------------------------------------------- */_inherits(PictProvider,_libFableServiceBase15);return _createClass2(PictProvider,[{key:"onBeforeInitialize",value:function onBeforeInitialize(){if(this.pict.LogNoisiness>3){this.log.trace("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," onBeforeInitialize:"));}return true;}},{key:"onBeforeInitializeAsync",value:function onBeforeInitializeAsync(fCallback){this.onBeforeInitialize();return fCallback();}},{key:"onInitialize",value:function onInitialize(){if(this.pict.LogNoisiness>3){this.log.trace("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," onInitialize:"));}return true;}},{key:"onInitializeAsync",value:function onInitializeAsync(fCallback){this.onInitialize();return fCallback();}},{key:"initialize",value:function initialize(){if(this.pict.LogControlFlow){this.log.trace("PICT-ControlFlow PROVIDER [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," initialize:"));}if(!this.initializeTimestamp){this.onBeforeInitialize();this.onInitialize();this.onAfterInitialize();this.initializeTimestamp=this.pict.log.getTimeStamp();return true;}else{this.log.warn("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," initialize called but initialization is already completed. Aborting."));return false;}}},{key:"initializeAsync",value:function initializeAsync(fCallback){var _this59=this;if(this.pict.LogControlFlow){this.log.trace("PICT-ControlFlow PROVIDER [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," initializeAsync:"));}if(!this.initializeTimestamp){var tmpAnticipate=this.pict.instantiateServiceProviderWithoutRegistration('Anticipate');if(this.pict.LogNoisiness>0){this.log.info("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," beginning initialization..."));}tmpAnticipate.anticipate(this.onBeforeInitializeAsync.bind(this));tmpAnticipate.anticipate(this.onInitializeAsync.bind(this));tmpAnticipate.anticipate(this.onAfterInitializeAsync.bind(this));tmpAnticipate.wait(function(pError){_this59.initializeTimestamp=_this59.pict.log.getTimeStamp();if(_this59.pict.LogNoisiness>0){_this59.log.info("PictProvider [".concat(_this59.UUID,"]::[").concat(_this59.Hash,"] ").concat(_this59.options.ProviderIdentifier," initialization complete."));}return fCallback();});}else{this.log.warn("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," async initialize called but initialization is already completed. Aborting."));// TODO: Should this be an error?
|
|
2913
2913
|
return fCallback();}}},{key:"onAfterInitialize",value:function onAfterInitialize(){if(this.pict.LogNoisiness>3){this.log.trace("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," onAfterInitialize:"));}return true;}},{key:"onAfterInitializeAsync",value:function onAfterInitializeAsync(fCallback){this.onAfterInitialize();return fCallback();}},{key:"onPreRender",value:function onPreRender(){if(this.pict.LogNoisiness>3){this.log.trace("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," onPreRender:"));}return true;}},{key:"onPreRenderAsync",value:function onPreRenderAsync(fCallback){this.onPreRender();return fCallback();}},{key:"render",value:function render(){return this.onPreRender();}},{key:"renderAsync",value:function renderAsync(fCallback){this.onPreRender();return fCallback();}},{key:"onPreSolve",value:function onPreSolve(){if(this.pict.LogNoisiness>3){this.log.trace("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," onPreSolve:"));}return true;}},{key:"onPreSolveAsync",value:function onPreSolveAsync(fCallback){this.onPreSolve();return fCallback();}},{key:"solve",value:function solve(){return this.onPreSolve();}},{key:"solveAsync",value:function solveAsync(fCallback){this.onPreSolve();return fCallback();}}]);}(libFableServiceBase);module.exports=PictProvider;},{"fable-serviceproviderbase":52}],118:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');/**
|
|
2914
|
-
* @class
|
|
2915
|
-
* @classdesc The
|
|
2916
|
-
*/var
|
|
2914
|
+
* @class PictTemplateExpression
|
|
2915
|
+
* @classdesc The PictTemplateExpression class is a service provider for the pict anti-framework that provides template rendering services.
|
|
2916
|
+
*/var PictTemplateExpression=/*#__PURE__*/function(_libFableServiceBase16){/**
|
|
2917
2917
|
* @param {Object} pFable - The Fable Framework instance
|
|
2918
2918
|
* @param {Object} pOptions - The options for the service
|
|
2919
2919
|
* @param {String} pServiceHash - The hash of the service
|
|
2920
|
-
*/function
|
|
2920
|
+
*/function PictTemplateExpression(pFable,pOptions,pServiceHash){var _this60;_classCallCheck2(this,PictTemplateExpression);_this60=_callSuper(this,PictTemplateExpression,[pFable,pOptions,pServiceHash]);/** @type {import('pict')} */_this60.fable;_this60.pict=_this60.fable;_this60.serviceType='PictTemplate';return _this60;}/**
|
|
2921
2921
|
* Render a template expression, returning a string with the resulting content.
|
|
2922
2922
|
*
|
|
2923
2923
|
* @param {string} pTemplateHash - The hash contents of the template (what's between the template start and stop tags)
|
|
@@ -2925,7 +2925,7 @@ return fCallback();}}},{key:"onAfterInitialize",value:function onAfterInitialize
|
|
|
2925
2925
|
* @param {array} pContextArray - An array of context objects accessible from the template; safe to leave empty
|
|
2926
2926
|
*
|
|
2927
2927
|
* @return {string} The rendered template
|
|
2928
|
-
*/_inherits(
|
|
2928
|
+
*/_inherits(PictTemplateExpression,_libFableServiceBase16);return _createClass2(PictTemplateExpression,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){return'';}/**
|
|
2929
2929
|
* Render a template expression, deliver a string with the resulting content to a callback function.
|
|
2930
2930
|
*
|
|
2931
2931
|
* @param {string} pTemplateHash - The hash contents of the template (what's between the template start and stop tags)
|
|
@@ -2950,7 +2950,7 @@ return fCallback();}}},{key:"onAfterInitialize",value:function onAfterInitialize
|
|
|
2950
2950
|
* @param {object} pRootDataObject - The root data object to resolve (optional)
|
|
2951
2951
|
*
|
|
2952
2952
|
* @return {any} The value at the given address, or undefined
|
|
2953
|
-
*/},{key:"resolveStateFromAddress",value:function resolveStateFromAddress(pAddress,pRecord,pContextArray,pRootDataObject){var tmpContextArray=Array.isArray(pContextArray)?pContextArray:[this.pict];var tmpRootDataObject=_typeof(pRootDataObject)==='object'?pRootDataObject:{};tmpRootDataObject.Pict=this.pict;tmpRootDataObject.AppData=this.pict.AppData;tmpRootDataObject.Bundle=this.pict.Bundle;tmpRootDataObject.Context=tmpContextArray;tmpRootDataObject.Record=pRecord;return this.pict.manifest.getValueByHash(tmpRootDataObject,pAddress);}}]);}(libFableServiceBase);module.exports=
|
|
2953
|
+
*/},{key:"resolveStateFromAddress",value:function resolveStateFromAddress(pAddress,pRecord,pContextArray,pRootDataObject){var tmpContextArray=Array.isArray(pContextArray)?pContextArray:[this.pict];var tmpRootDataObject=_typeof(pRootDataObject)==='object'?pRootDataObject:{};tmpRootDataObject.Pict=this.pict;tmpRootDataObject.AppData=this.pict.AppData;tmpRootDataObject.Bundle=this.pict.Bundle;tmpRootDataObject.Context=tmpContextArray;tmpRootDataObject.Record=pRecord;return this.pict.manifest.getValueByHash(tmpRootDataObject,pAddress);}}]);}(libFableServiceBase);module.exports=PictTemplateExpression;module.exports.template_hash='Default';},{"fable-serviceproviderbase":52}],119:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');var defaultPictViewSettings={DefaultRenderable:false,DefaultDestinationAddress:false,DefaultTemplateRecordAddress:false,ViewIdentifier:false,// If this is set to true, when the App initializes this will.
|
|
2954
2954
|
// After the App initializes, initialize will be called as soon as it's added.
|
|
2955
2955
|
AutoInitialize:true,AutoInitializeOrdinal:0,// If this is set to true, when the App autorenders (on load) this will.
|
|
2956
2956
|
// After the App initializes, render will be called as soon as it's added.
|
|
@@ -3027,6 +3027,27 @@ if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::["
|
|
|
3027
3027
|
*
|
|
3028
3028
|
* @param {ErrorCallback} fCallback - The callback to call when the async operation is complete.
|
|
3029
3029
|
*/},{key:"onBeforeRenderAsync",value:function onBeforeRenderAsync(fCallback){return fCallback();}/**
|
|
3030
|
+
* Builds the render options for a renderable.
|
|
3031
|
+
*
|
|
3032
|
+
* For DRY purposes on the three flavors of render.
|
|
3033
|
+
*
|
|
3034
|
+
* @param {string} [pRenderableHash] - The hash of the renderable to render.
|
|
3035
|
+
* @param {string} [pRenderDestinationAddress] - The address where the renderable will be rendered.
|
|
3036
|
+
* @param {string|object} [pTemplateRecordAddress] - The address of (or actual obejct) where the data for the template is stored.
|
|
3037
|
+
*/},{key:"buildRenderOptions",value:function buildRenderOptions(pRenderableHash,pRenderDestinationAddress,pTemplateRecordAddress){var tmpRenderOptions={Valid:true};tmpRenderOptions.RenderableHash=typeof pRenderableHash==='string'?pRenderableHash:typeof this.options.DefaultRenderable=='string'?this.options.DefaultRenderable:false;if(!tmpRenderOptions.RenderableHash){this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not find a suitable RenderableHash ").concat(tmpRenderOptions.RenderableHash," (param ").concat(pRenderableHash,"because it is not a valid renderable."));tmpRenderOptions.Valid=false;}tmpRenderOptions.Renderable=this.renderables[tmpRenderOptions.RenderableHash];if(!tmpRenderOptions.Renderable){this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(tmpRenderOptions.RenderableHash," (param ").concat(pRenderableHash,") because it does not exist."));tmpRenderOptions.Valid=false;}tmpRenderOptions.DestinationAddress=typeof pRenderDestinationAddress==='string'?pRenderDestinationAddress:typeof tmpRenderOptions.Renderable.ContentDestinationAddress==='string'?tmpRenderOptions.Renderable.ContentDestinationAddress:typeof this.options.DefaultDestinationAddress==='string'?this.options.DefaultDestinationAddress:false;if(!tmpRenderOptions.DestinationAddress){this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(tmpRenderOptions.RenderableHash," (param ").concat(pRenderableHash,") because it does not have a valid destination address (param ").concat(pRenderDestinationAddress,")."));tmpRenderOptions.Valid=false;}if(_typeof(pTemplateRecordAddress)==='object'){tmpRenderOptions.RecordAddress='Passed in as object';tmpRenderOptions.Record=pTemplateRecordAddress;}else{tmpRenderOptions.RecordAddress=typeof pTemplateRecordAddress==='string'?pTemplateRecordAddress:typeof tmpRenderOptions.Renderable.DefaultTemplateRecordAddress==='string'?tmpRenderOptions.Renderable.DefaultTemplateRecordAddress:typeof this.options.DefaultTemplateRecordAddress==='string'?this.options.DefaultTemplateRecordAddress:false;tmpRenderOptions.Record=typeof tmpRecordAddress==='string'?this.pict.DataProvider.getDataByAddress(tmpRecordAddress):undefined;}return tmpRenderOptions;}/**
|
|
3038
|
+
* Assigns the content to the destination address.
|
|
3039
|
+
*
|
|
3040
|
+
* For DRY purposes on the three flavors of render.
|
|
3041
|
+
*
|
|
3042
|
+
* @param {Renderable} pRenderable - The renderable to render.
|
|
3043
|
+
* @param {string} pRenderDestinationAddress - The address where the renderable will be rendered.
|
|
3044
|
+
* @param {string} pContent - The content to render.
|
|
3045
|
+
* @returns {boolean} - Returns true if the content was assigned successfully.
|
|
3046
|
+
* @memberof PictView
|
|
3047
|
+
*/},{key:"assignRenderContent",value:function assignRenderContent(pRenderable,pRenderDestinationAddress,pContent){// Assign the content to the destination address
|
|
3048
|
+
switch(pRenderable.RenderMethod){case'append':return this.pict.ContentAssignment.appendContent(pRenderDestinationAddress,pContent);case'prepend':return this.pict.ContentAssignment.prependContent(pRenderDestinationAddress,pContent);case'append_once':// Try to find the content in the destination address
|
|
3049
|
+
var tmpExistingContent=this.pict.ContentAssignment.getElement("#".concat(pRenderable.DestinationAddress));if(tmpExistingContent.length<1){return this.pict.ContentAssignment.appendContent(pRenderDestinationAddress,pContent);}break;case'replace':// TODO: Should this be the default?
|
|
3050
|
+
default:return this.pict.ContentAssignment.assignContent(pRenderDestinationAddress,pContent);}return false;}/**
|
|
3030
3051
|
* Render a renderable from this view.
|
|
3031
3052
|
*
|
|
3032
3053
|
* @param {string} [pRenderable] - The hash of the renderable to render.
|
|
@@ -3036,7 +3057,7 @@ if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::["
|
|
|
3036
3057
|
this.onBeforeRender(tmpRenderable,tmpRenderDestinationAddress,tmpRecord);if(this.pict.LogControlFlow){this.log.trace("PICT-ControlFlow VIEW [".concat(this.UUID,"]::[").concat(this.Hash,"] Renderable[").concat(tmpRenderableHash,"] Destination[").concat(tmpRenderDestinationAddress,"] TemplateRecordAddress[").concat(tmpRecordAddress,"] render:"));}if(this.pict.LogNoisiness>0){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," Beginning Render of Renderable[").concat(tmpRenderableHash,"] to Destination [").concat(tmpRenderDestinationAddress,"]..."));}// Generate the content output from the template and data
|
|
3037
3058
|
var tmpContent=this.pict.parseTemplateByHash(tmpRenderable.TemplateHash,tmpRecord,null,[this]);if(this.pict.LogNoisiness>0){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," Assigning Renderable[").concat(tmpRenderableHash,"] content length ").concat(tmpContent.length," to Destination [").concat(tmpRenderDestinationAddress,"] using render method [").concat(tmpRenderable.RenderMethod,"]."));}// Assign the content to the destination address
|
|
3038
3059
|
switch(tmpRenderable.RenderMethod){case'append':this.pict.ContentAssignment.appendContent(tmpRenderDestinationAddress,tmpContent);break;case'prepend':this.pict.ContentAssignment.prependContent(tmpRenderDestinationAddress,tmpContent);break;case'append_once':// Try to find the content in the destination address
|
|
3039
|
-
var tmpExistingContent=this.pict.ContentAssignment.getElement("
|
|
3060
|
+
var tmpExistingContent=this.pict.ContentAssignment.getElement("".concat(tmpRenderable.DestinationAddress));if(tmpExistingContent.length<1){this.pict.ContentAssignment.appendContent(tmpRenderDestinationAddress,tmpContent);}break;case'replace':// TODO: Should this be the default?
|
|
3040
3061
|
default:this.pict.ContentAssignment.assignContent(tmpRenderDestinationAddress,tmpContent);break;}// Execute the developer-overridable post-render behavior
|
|
3041
3062
|
this.onAfterRender(tmpRenderable,tmpRenderDestinationAddress,tmpRecord,tmpContent);this.lastRenderedTimestamp=this.pict.log.getTimeStamp();return true;}/**
|
|
3042
3063
|
* Render a renderable from this view.
|
|
@@ -3049,13 +3070,14 @@ this.onAfterRender(tmpRenderable,tmpRenderDestinationAddress,tmpRecord,tmpConten
|
|
|
3049
3070
|
var tmpCallback=typeof fCallback==='function'?fCallback:typeof pTemplateRecordAddress==='function'?pTemplateRecordAddress:typeof pRenderDestinationAddress==='function'?pRenderDestinationAddress:typeof pRenderableHash==='function'?pRenderableHash:false;if(!tmpCallback){this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," renderAsync was called without a valid callback. A callback will be generated but this could lead to race conditions."));tmpCallback=function tmpCallback(pError){if(pError){_this63.log.error("PictView [".concat(_this63.UUID,"]::[").concat(_this63.Hash,"] ").concat(_this63.options.Name," renderAsync Auto Callback Error: ").concat(pError),pError);}};}if(!tmpRenderableHash){this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not asynchronously render ").concat(tmpRenderableHash," (param ").concat(pRenderableHash,"because it is not a valid renderable."));return tmpCallback(Error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not asynchronously render ").concat(tmpRenderableHash," (param ").concat(pRenderableHash,"because it is not a valid renderable.")));}var tmpRenderable=this.renderables[tmpRenderableHash];if(!tmpRenderable){this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(tmpRenderableHash," (param ").concat(pRenderableHash,") because it does not exist."));return tmpCallback(Error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(tmpRenderableHash," (param ").concat(pRenderableHash,") because it does not exist.")));}var tmpRenderDestinationAddress=typeof pRenderDestinationAddress==='string'?pRenderDestinationAddress:typeof tmpRenderable.ContentDestinationAddress==='string'?tmpRenderable.ContentDestinationAddress:typeof this.options.DefaultDestinationAddress==='string'?this.options.DefaultDestinationAddress:false;if(!tmpRenderDestinationAddress){this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(tmpRenderableHash," (param ").concat(pRenderableHash,") because it does not have a valid destination address."));return tmpCallback(Error("Could not render ".concat(tmpRenderableHash)));}var tmpRecordAddress;var tmpRecord;if(_typeof(pTemplateRecordAddress)==='object'){tmpRecord=pTemplateRecordAddress;tmpRecordAddress='Passed in as object';}else{tmpRecordAddress=typeof pTemplateRecordAddress==='string'?pTemplateRecordAddress:typeof tmpRenderable.DefaultTemplateRecordAddress==='string'?tmpRenderable.DefaultTemplateRecordAddress:typeof this.options.DefaultTemplateRecordAddress==='string'?this.options.DefaultTemplateRecordAddress:false;tmpRecord=typeof tmpRecordAddress==='string'?this.pict.DataProvider.getDataByAddress(tmpRecordAddress):undefined;}if(this.pict.LogControlFlow){this.log.trace("PICT-ControlFlow VIEW [".concat(this.UUID,"]::[").concat(this.Hash,"] Renderable[").concat(tmpRenderableHash,"] Destination[").concat(tmpRenderDestinationAddress,"] TemplateRecordAddress[").concat(tmpRecordAddress,"] renderAsync:"));}if(this.pict.LogNoisiness>2){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," Beginning Asynchronous Render (callback-style)..."));}var tmpAnticipate=this.fable.newAnticipate();tmpAnticipate.anticipate(function(fOnBeforeRenderCallback){_this63.onBeforeRender(tmpRenderable,tmpRenderDestinationAddress,tmpRecord);_this63.onBeforeRenderAsync(fOnBeforeRenderCallback);});var tmpContent;tmpAnticipate.anticipate(function(fAsyncTemplateCallback){// Render the template (asynchronously)
|
|
3050
3071
|
_this63.pict.parseTemplateByHash(tmpRenderable.TemplateHash,tmpRecord,function(pError,pContent){if(pError){_this63.log.error("PictView [".concat(_this63.UUID,"]::[").concat(_this63.Hash,"] ").concat(_this63.options.ViewIdentifier," could not render (asynchronously) ").concat(tmpRenderableHash," (param ").concat(pRenderableHash,") because it did not parse the template."),pError);return fAsyncTemplateCallback(pError);}tmpContent=pContent;if(_this63.pict.LogNoisiness>0){_this63.log.trace("PictView [".concat(_this63.UUID,"]::[").concat(_this63.Hash,"] ").concat(_this63.options.ViewIdentifier," Assigning Renderable[").concat(tmpRenderableHash,"] content length ").concat(pContent.length," to Destination [").concat(tmpRenderDestinationAddress,"] using Async render method ").concat(tmpRenderable.RenderMethod,"."));}// Assign the content to the destination address
|
|
3051
3072
|
switch(tmpRenderable.RenderMethod){case'append':_this63.pict.ContentAssignment.appendContent(tmpRenderDestinationAddress,pContent);break;case'prepend':_this63.pict.ContentAssignment.prependContent(tmpRenderDestinationAddress,pContent);break;case'append_once':// Try to find the content in the destination address
|
|
3052
|
-
var tmpExistingContent=_this63.pict.ContentAssignment.getElement("
|
|
3073
|
+
var tmpExistingContent=_this63.pict.ContentAssignment.getElement("".concat(tmpRenderable.DestinationAddress));if(tmpExistingContent.length<1){_this63.pict.ContentAssignment.appendContent(tmpRenderDestinationAddress,pContent);}case'replace':default:_this63.pict.ContentAssignment.assignContent(tmpRenderDestinationAddress,pContent);break;}// Execute the developer-overridable asynchronous post-render behavior
|
|
3053
3074
|
_this63.lastRenderedTimestamp=_this63.pict.log.getTimeStamp();return fAsyncTemplateCallback();},[_this63]);});tmpAnticipate.anticipate(function(fOnAfterRenderCallback){_this63.onAfterRender(tmpRenderable,tmpRenderDestinationAddress,tmpRecord,tmpContent);_this63.onAfterRenderAsync(fOnAfterRenderCallback);});tmpAnticipate.wait(tmpCallback);}/**
|
|
3054
3075
|
* Renders the default renderable.
|
|
3055
3076
|
*
|
|
3056
3077
|
* @param {ErrorCallback} fCallback - The callback to call when the async operation is complete.
|
|
3057
3078
|
*/},{key:"renderDefaultAsync",value:function renderDefaultAsync(fCallback){// Render the default renderable
|
|
3058
|
-
this.renderAsync(fCallback);}
|
|
3079
|
+
this.renderAsync(fCallback);}},{key:"basicRender",value:function basicRender(pRenderable,pRenderDestinationAddress,pTemplateRecordAddress){var tmpRenderOptions=this.buildRenderOptions(pRenderable,pRenderDestinationAddress,pTemplateRecordAddress);if(tmpRenderOptions.Valid){this.assignRenderContent(tmpRenderOptions.Renderable,tmpRenderOptions.DestinationAddress,this.pict.parseTemplateByHash(tmpRenderOptions.Renderable.TemplateHash,tmpRenderOptions.Record,null,[this]));return true;}else{this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not perform a basic render of ").concat(tmpRenderOptions.RenderableHash," because it is not valid."));return false;}}},{key:"basicRenderAsync",value:function basicRenderAsync(pRenderable,pRenderDestinationAddress,pTemplateRecordAddress,fCallback){var _this64=this;// Allow the callback to be passed in as the last parameter no matter what
|
|
3080
|
+
var tmpCallback=typeof fCallback==='function'?fCallback:typeof pTemplateRecordAddress==='function'?pTemplateRecordAddress:typeof pRenderDestinationAddress==='function'?pRenderDestinationAddress:typeof pRenderable==='function'?pRenderable:false;var tmpRenderOptions=this.buildRenderOptions(pRenderable,pRenderDestinationAddress,pTemplateRecordAddress);if(tmpRenderOptions.Valid){this.pict.parseTemplateByHash(tmpRenderOptions.Renderable.TemplateHash,tmpRenderOptions.Record,function(pError,pContent){if(pError){_this64.log.error("PictView [".concat(_this64.UUID,"]::[").concat(_this64.Hash,"] ").concat(_this64.options.ViewIdentifier," could not render (asynchronously) ").concat(tmpRenderOptions.RenderableHash," because it did not parse the template."),pError);return tmpCallback(pError);}_this64.assignRenderContent(tmpRenderOptions.Renderable,tmpRenderOptions.DestinationAddress,pContent);return tmpCallback();},[this]);}else{var tmpErrorMessage="PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not perform a basic render of ").concat(tmpRenderOptions.RenderableHash," because it is not valid.");this.log.error(tmpErrorMessage);return tmpCallback(tmpErrorMessage);}}/**
|
|
3059
3081
|
* Lifecycle hook that triggers after the view is rendered.
|
|
3060
3082
|
*
|
|
3061
3083
|
* @param {any} [pRenderable] - The renderable that was rendered.
|
|
@@ -3086,7 +3108,7 @@ this.renderAsync(fCallback);}/**
|
|
|
3086
3108
|
* Performs view solving and triggers lifecycle hooks (async flow).
|
|
3087
3109
|
*
|
|
3088
3110
|
* @param {ErrorCallback} fCallback - The callback to call when the async operation is complete.
|
|
3089
|
-
*/},{key:"solveAsync",value:function solveAsync(fCallback){var
|
|
3111
|
+
*/},{key:"solveAsync",value:function solveAsync(fCallback){var _this65=this;var tmpAnticipate=this.pict.instantiateServiceProviderWithoutRegistration('Anticipate');var tmpCallback=typeof fCallback==='function'?fCallback:false;if(!tmpCallback){this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," solveAsync was called without a valid callback. A callback will be generated but this could lead to race conditions."));tmpCallback=function tmpCallback(pError){if(pError){_this65.log.error("PictView [".concat(_this65.UUID,"]::[").concat(_this65.Hash,"] ").concat(_this65.options.Name," solveAsync Auto Callback Error: ").concat(pError),pError);}};}tmpAnticipate.anticipate(this.onBeforeSolveAsync.bind(this));tmpAnticipate.anticipate(this.onSolveAsync.bind(this));tmpAnticipate.anticipate(this.onAfterSolveAsync.bind(this));tmpAnticipate.wait(function(pError){if(_this65.pict.LogNoisiness>2){_this65.log.trace("PictView [".concat(_this65.UUID,"]::[").concat(_this65.Hash,"] ").concat(_this65.options.ViewIdentifier," solveAsync() complete."));}_this65.lastSolvedTimestamp=_this65.pict.log.getTimeStamp();return tmpCallback(pError);});}/**
|
|
3090
3112
|
* Lifecycle hook that triggers after the view is solved.
|
|
3091
3113
|
*/},{key:"onAfterSolve",value:function onAfterSolve(){if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterSolve:"));}return true;}/**
|
|
3092
3114
|
* Lifecycle hook that triggers after the view is solved (async flow).
|
|
@@ -3114,7 +3136,7 @@ this.renderAsync(fCallback);}/**
|
|
|
3114
3136
|
* Marshals data from the view (async flow).
|
|
3115
3137
|
*
|
|
3116
3138
|
* @param {ErrorCallback} fCallback - The callback to call when the async operation is complete.
|
|
3117
|
-
*/},{key:"marshalFromViewAsync",value:function marshalFromViewAsync(fCallback){var
|
|
3139
|
+
*/},{key:"marshalFromViewAsync",value:function marshalFromViewAsync(fCallback){var _this66=this;var tmpAnticipate=this.pict.instantiateServiceProviderWithoutRegistration('Anticipate');var tmpCallback=typeof fCallback==='function'?fCallback:false;if(!tmpCallback){this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," marshalFromViewAsync was called without a valid callback. A callback will be generated but this could lead to race conditions."));tmpCallback=function tmpCallback(pError){if(pError){_this66.log.error("PictView [".concat(_this66.UUID,"]::[").concat(_this66.Hash,"] ").concat(_this66.options.Name," marshalFromViewAsync Auto Callback Error: ").concat(pError),pError);}};}tmpAnticipate.anticipate(this.onBeforeMarshalFromViewAsync.bind(this));tmpAnticipate.anticipate(this.onMarshalFromViewAsync.bind(this));tmpAnticipate.anticipate(this.onAfterMarshalFromViewAsync.bind(this));tmpAnticipate.wait(function(pError){if(_this66.pict.LogNoisiness>2){_this66.log.trace("PictView [".concat(_this66.UUID,"]::[").concat(_this66.Hash,"] ").concat(_this66.options.ViewIdentifier," marshalFromViewAsync() complete."));}_this66.lastMarshalFromViewTimestamp=_this66.pict.log.getTimeStamp();return tmpCallback(pError);});}/**
|
|
3118
3140
|
* Lifecycle hook that triggers after data is marshaled from the view.
|
|
3119
3141
|
*/},{key:"onAfterMarshalFromView",value:function onAfterMarshalFromView(){if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterMarshalFromView:"));}return true;}/**
|
|
3120
3142
|
* Lifecycle hook that triggers after data is marshaled from the view (async flow).
|
|
@@ -3140,7 +3162,7 @@ this.renderAsync(fCallback);}/**
|
|
|
3140
3162
|
* Marshals data into the view (async flow).
|
|
3141
3163
|
*
|
|
3142
3164
|
* @param {ErrorCallback} fCallback - The callback to call when the async operation is complete.
|
|
3143
|
-
*/},{key:"marshalToViewAsync",value:function marshalToViewAsync(fCallback){var
|
|
3165
|
+
*/},{key:"marshalToViewAsync",value:function marshalToViewAsync(fCallback){var _this67=this;var tmpAnticipate=this.pict.instantiateServiceProviderWithoutRegistration('Anticipate');var tmpCallback=typeof fCallback==='function'?fCallback:false;if(!tmpCallback){this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," marshalToViewAsync was called without a valid callback. A callback will be generated but this could lead to race conditions."));tmpCallback=function tmpCallback(pError){if(pError){_this67.log.error("PictView [".concat(_this67.UUID,"]::[").concat(_this67.Hash,"] ").concat(_this67.options.Name," marshalToViewAsync Auto Callback Error: ").concat(pError),pError);}};}tmpAnticipate.anticipate(this.onBeforeMarshalToViewAsync.bind(this));tmpAnticipate.anticipate(this.onMarshalToViewAsync.bind(this));tmpAnticipate.anticipate(this.onAfterMarshalToViewAsync.bind(this));tmpAnticipate.wait(function(pError){if(_this67.pict.LogNoisiness>2){_this67.log.trace("PictView [".concat(_this67.UUID,"]::[").concat(_this67.Hash,"] ").concat(_this67.options.ViewIdentifier," marshalToViewAsync() complete."));}_this67.lastMarshalToViewTimestamp=_this67.pict.log.getTimeStamp();return tmpCallback(pError);});}/**
|
|
3144
3166
|
* Lifecycle hook that triggers after data is marshaled into the view.
|
|
3145
3167
|
*/},{key:"onAfterMarshalToView",value:function onAfterMarshalToView(){if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterMarshalToView:"));}return true;}/**
|
|
3146
3168
|
* Lifecycle hook that triggers after data is marshaled into the view (async flow).
|
|
@@ -3571,9 +3593,9 @@ if(self._mode==='moz-chunked-arraybuffer'){xhr.onprogress=function(){self._onXHR
|
|
|
3571
3593
|
*/function statusValid(xhr){try{var status=xhr.status;return status!==null&&status!==0;}catch(e){return false;}}ClientRequest.prototype._onXHRProgress=function(){var self=this;self._resetTimers(false);if(!statusValid(self._xhr)||self._destroyed)return;if(!self._response)self._connect();self._response._onXHRProgress(self._resetTimers.bind(self));};ClientRequest.prototype._connect=function(){var self=this;if(self._destroyed)return;self._response=new IncomingMessage(self._xhr,self._fetchResponse,self._mode,self._resetTimers.bind(self));self._response.on('error',function(err){self.emit('error',err);});self.emit('response',self._response);};ClientRequest.prototype._write=function(chunk,encoding,cb){var self=this;self._body.push(chunk);cb();};ClientRequest.prototype._resetTimers=function(done){var self=this;global.clearTimeout(self._socketTimer);self._socketTimer=null;if(done){global.clearTimeout(self._fetchTimer);self._fetchTimer=null;}else if(self._socketTimeout){self._socketTimer=global.setTimeout(function(){self.emit('timeout');},self._socketTimeout);}};ClientRequest.prototype.abort=ClientRequest.prototype.destroy=function(err){var self=this;self._destroyed=true;self._resetTimers(true);if(self._response)self._response._destroyed=true;if(self._xhr)self._xhr.abort();else if(self._fetchAbortController)self._fetchAbortController.abort();if(err)self.emit('error',err);};ClientRequest.prototype.end=function(data,encoding,cb){var self=this;if(typeof data==='function'){cb=data;data=undefined;}stream.Writable.prototype.end.call(self,data,encoding,cb);};ClientRequest.prototype.setTimeout=function(timeout,cb){var self=this;if(cb)self.once('timeout',cb);self._socketTimeout=timeout;self._resetTimers(false);};ClientRequest.prototype.flushHeaders=function(){};ClientRequest.prototype.setNoDelay=function(){};ClientRequest.prototype.setSocketKeepAlive=function(){};// Taken from http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader%28%29-method
|
|
3572
3594
|
var unsafeHeaders=['accept-charset','accept-encoding','access-control-request-headers','access-control-request-method','connection','content-length','cookie','cookie2','date','dnt','expect','host','keep-alive','origin','referer','te','trailer','transfer-encoding','upgrade','via'];}).call(this);}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer);},{"./capability":139,"./response":141,"_process":123,"buffer":20,"inherits":100,"readable-stream":156}],141:[function(require,module,exports){(function(process,global,Buffer){(function(){var capability=require('./capability');var inherits=require('inherits');var stream=require('readable-stream');var rStates=exports.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4};var IncomingMessage=exports.IncomingMessage=function(xhr,response,mode,resetTimers){var self=this;stream.Readable.call(self);self._mode=mode;self.headers={};self.rawHeaders=[];self.trailers={};self.rawTrailers=[];// Fake the 'close' event, but only once 'end' fires
|
|
3573
3595
|
self.on('end',function(){// The nextTick is necessary to prevent the 'request' module from causing an infinite loop
|
|
3574
|
-
process.nextTick(function(){self.emit('close');});});if(mode==='fetch'){var
|
|
3596
|
+
process.nextTick(function(){self.emit('close');});});if(mode==='fetch'){var _read=function read(){reader.read().then(function(result){if(self._destroyed)return;resetTimers(result.done);if(result.done){self.push(null);return;}self.push(Buffer.from(result.value));_read();})["catch"](function(err){resetTimers(true);if(!self._destroyed)self.emit('error',err);});};self._fetchResponse=response;self.url=response.url;self.statusCode=response.status;self.statusMessage=response.statusText;response.headers.forEach(function(header,key){self.headers[key.toLowerCase()]=header;self.rawHeaders.push(key,header);});if(capability.writableStream){var writable=new WritableStream({write:function write(chunk){resetTimers(false);return new Promise(function(resolve,reject){if(self._destroyed){reject();}else if(self.push(Buffer.from(chunk))){resolve();}else{self._resumeFetch=resolve;}});},close:function close(){resetTimers(true);if(!self._destroyed)self.push(null);},abort:function abort(err){resetTimers(true);if(!self._destroyed)self.emit('error',err);}});try{response.body.pipeTo(writable)["catch"](function(err){resetTimers(true);if(!self._destroyed)self.emit('error',err);});return;}catch(e){}// pipeTo method isn't defined. Can't find a better way to feature test this
|
|
3575
3597
|
}// fallback for when writableStream or pipeTo aren't available
|
|
3576
|
-
var reader=response.body.getReader();
|
|
3598
|
+
var reader=response.body.getReader();_read();}else{self._xhr=xhr;self._pos=0;self.url=xhr.responseURL;self.statusCode=xhr.status;self.statusMessage=xhr.statusText;var headers=xhr.getAllResponseHeaders().split(/\r?\n/);headers.forEach(function(header){var matches=header.match(/^([^:]+):\s*(.*)/);if(matches){var key=matches[1].toLowerCase();if(key==='set-cookie'){if(self.headers[key]===undefined){self.headers[key]=[];}self.headers[key].push(matches[2]);}else if(self.headers[key]!==undefined){self.headers[key]+=', '+matches[2];}else{self.headers[key]=matches[2];}self.rawHeaders.push(matches[1],matches[2]);}});self._charset='x-user-defined';if(!capability.overrideMimeType){var mimeType=self.rawHeaders['mime-type'];if(mimeType){var charsetMatch=mimeType.match(/;\s*charset=([^;])(;|$)/);if(charsetMatch){self._charset=charsetMatch[1].toLowerCase();}}if(!self._charset)self._charset='utf-8';// best guess
|
|
3577
3599
|
}}};inherits(IncomingMessage,stream.Readable);IncomingMessage.prototype._read=function(){var self=this;var resolve=self._resumeFetch;if(resolve){self._resumeFetch=null;resolve();}};IncomingMessage.prototype._onXHRProgress=function(resetTimers){var self=this;var xhr=self._xhr;var response=null;switch(self._mode){case'text':response=xhr.responseText;if(response.length>self._pos){var newData=response.substr(self._pos);if(self._charset==='x-user-defined'){var buffer=Buffer.alloc(newData.length);for(var i=0;i<newData.length;i++)buffer[i]=newData.charCodeAt(i)&0xff;self.push(buffer);}else{self.push(newData,self._charset);}self._pos=response.length;}break;case'arraybuffer':if(xhr.readyState!==rStates.DONE||!xhr.response)break;response=xhr.response;self.push(Buffer.from(new Uint8Array(response)));break;case'moz-chunked-arraybuffer':// take whole
|
|
3578
3600
|
response=xhr.response;if(xhr.readyState!==rStates.LOADING||!response)break;self.push(Buffer.from(new Uint8Array(response)));break;case'ms-stream':response=xhr.response;if(xhr.readyState!==rStates.LOADING)break;var reader=new global.MSStreamReader();reader.onprogress=function(){if(reader.result.byteLength>self._pos){self.push(Buffer.from(new Uint8Array(reader.result.slice(self._pos))));self._pos=reader.result.byteLength;}};reader.onload=function(){resetTimers(true);self.push(null);};// reader.onerror = ??? // TODO: this
|
|
3579
3601
|
reader.readAsArrayBuffer(response);break;}// The ms-stream case handles end separately in reader.onload()
|
|
@@ -4455,57 +4477,57 @@ if(pPictApplication&&'default_configuration'in pPictApplication&&'pict_configura
|
|
|
4455
4477
|
if(document.readyState!='loading')fCallback();// Modern browsers have event listener capabilities
|
|
4456
4478
|
else if(document.addEventListener)document.addEventListener('DOMContentLoaded',fCallback);// IE <= 8 and ... other abominations
|
|
4457
4479
|
else document.attachEvent('onreadystatechange',function(){if(document.readyState=='complete')fCallback();});};},{}],165:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var defaultConfiguration={// This is the address for the <script /> tag that contains the CSS.
|
|
4458
|
-
CSSElementAddress:'#PICT-CSS'};var PictCSS=/*#__PURE__*/function(_libFableServiceBase18){function PictCSS(pFable,pOptions,pServiceHash){var
|
|
4459
|
-
if(typeof
|
|
4480
|
+
CSSElementAddress:'#PICT-CSS'};var PictCSS=/*#__PURE__*/function(_libFableServiceBase18){function PictCSS(pFable,pOptions,pServiceHash){var _this68;_classCallCheck2(this,PictCSS);_this68=_callSuper(this,PictCSS,[pFable,pOptions,pServiceHash]);// No merging of options necessary
|
|
4481
|
+
if(typeof _this68.options.CSSElementAddress==='undefined'){_this68.options.CSSElementAddress=defaultConfiguration.CSSElementAddress;}_this68.inlineCSSMap={};return _this68;}// Add a CSS fragment to the CSS map (each view can have its own CSS fragment)
|
|
4460
4482
|
// Hash is shared across all views, so if 10 views all load the "My-Table-View" fragment, it will only be loaded once.
|
|
4461
|
-
_inherits(PictCSS,_libFableServiceBase18);return _createClass2(PictCSS,[{key:"addCSS",value:function addCSS(pHash,pContent,pPriority,pProvider){var tmpPriority=typeof pPriority!=='undefined'?pPriority:1000;var tmpProvidor=typeof pProvider==='string'?pProvider:'Unknown';this.inlineCSSMap[pHash]={Hash:pHash,Content:pContent,Provider:tmpProvidor,Priority:tmpPriority};}},{key:"removeCSS",value:function removeCSS(pHash){delete this.inlineCSSMap[pHash];}},{key:"generateCSS",value:function generateCSS(){var
|
|
4462
|
-
tmpCSSHashes.sort(function(a,b){return
|
|
4483
|
+
_inherits(PictCSS,_libFableServiceBase18);return _createClass2(PictCSS,[{key:"addCSS",value:function addCSS(pHash,pContent,pPriority,pProvider){var tmpPriority=typeof pPriority!=='undefined'?pPriority:1000;var tmpProvidor=typeof pProvider==='string'?pProvider:'Unknown';this.inlineCSSMap[pHash]={Hash:pHash,Content:pContent,Provider:tmpProvidor,Priority:tmpPriority};}},{key:"removeCSS",value:function removeCSS(pHash){delete this.inlineCSSMap[pHash];}},{key:"generateCSS",value:function generateCSS(){var _this69=this;var tmpCSS='';var tmpCSSHashes=Object.keys(this.inlineCSSMap);// Sort the hashes by Priority
|
|
4484
|
+
tmpCSSHashes.sort(function(a,b){return _this69.inlineCSSMap[a].Priority-_this69.inlineCSSMap[b].Priority;});for(var i=0;i<tmpCSSHashes.length;i++){var tmpCSSFragment=this.inlineCSSMap[tmpCSSHashes[i]];var tmpCSSComment=tmpCSSFragment.Hash;if(tmpCSSFragment.Hash!=tmpCSSFragment.Provider){tmpCSSComment="".concat(tmpCSSComment," from ").concat(tmpCSSFragment.Provider);}tmpCSS+="/* ".concat(tmpCSSComment," */\n").concat(tmpCSSFragment.Content,"\n");}return tmpCSS;}// Inject the CSS into the magic DOM element for it
|
|
4463
4485
|
},{key:"injectCSS",value:function injectCSS(){this.services.ContentAssignment.assignContent(this.options.CSSElementAddress,this.generateCSS());}}]);}(libFableServiceBase);module.exports=PictCSS;},{"fable":58}],166:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;/**
|
|
4464
4486
|
* Class for moving content around in the DOM.
|
|
4465
4487
|
*/var PictContentAssignment=/*#__PURE__*/function(_libFableServiceBase19){/**
|
|
4466
4488
|
* @param {object} pFable - The Fable library instance.
|
|
4467
4489
|
* @param {object} pOptions - The options for the service.
|
|
4468
4490
|
* @param {object} pServiceHash - The hash of services.
|
|
4469
|
-
*/function PictContentAssignment(pFable,pOptions,pServiceHash){var
|
|
4470
|
-
|
|
4471
|
-
if(typeof window.document!='undefined'&&typeof window.document.querySelectorAll=='function'){
|
|
4472
|
-
|
|
4491
|
+
*/function PictContentAssignment(pFable,pOptions,pServiceHash){var _this70;_classCallCheck2(this,PictContentAssignment);_this70=_callSuper(this,PictContentAssignment,[pFable,pOptions,pServiceHash]);_this70.serviceType='PictContentAssignment';// Check to see if we are running in a browser
|
|
4492
|
+
_this70.inBrowser=false;_this70.hasDocument=false;if((typeof window==="undefined"?"undefined":_typeof(window))=='object'){_this70.inBrowser=true;// Now check that the browser has a document object
|
|
4493
|
+
if(typeof window.document!='undefined'&&typeof window.document.querySelectorAll=='function'){_this70.hasDocument=true;}}// If we're in a browser, check to see if jQuery is available.
|
|
4494
|
+
_this70.hasJquery=false;_this70.jQuery=false;if(_this70.inBrowser&&typeof window.jQuery!=='undefined'){_this70.hasJquery=true;}/**
|
|
4473
4495
|
* Set this to override the default mechanism for setting the content of a DOM element.
|
|
4474
4496
|
*
|
|
4475
4497
|
* @type {Function}
|
|
4476
4498
|
* @param {string} pAddress - The address of the element. (a CSS selector)
|
|
4477
4499
|
* @param {string} pContent - The content to set.
|
|
4478
|
-
*/
|
|
4500
|
+
*/_this70.customAssignFunction=false;/**
|
|
4479
4501
|
* Set this to override the default mechanism for prepend content to a DOM element.
|
|
4480
4502
|
*
|
|
4481
4503
|
* @type {Function}
|
|
4482
4504
|
* @param {string} pAddress - The address of the element. (a CSS selector)
|
|
4483
4505
|
* @param {string} pContent - The content to prepend.
|
|
4484
|
-
*/
|
|
4506
|
+
*/_this70.customPrependFunction=false;/**
|
|
4485
4507
|
* Set this to override the default mechanism for appending content to a DOM element.
|
|
4486
4508
|
*
|
|
4487
4509
|
* @type {Function}
|
|
4488
4510
|
* @param {string} pAddress - The address of the element. (a CSS selector)
|
|
4489
4511
|
* @param {string} pContent - The content to append.
|
|
4490
|
-
*/
|
|
4512
|
+
*/_this70.customAppendFunction=false;/**
|
|
4491
4513
|
* Set this to override the default mechanism for reading content from the DOM.
|
|
4492
4514
|
*
|
|
4493
4515
|
* @type {Function}
|
|
4494
4516
|
* @param {string} pAddress - The address of the element. (a CSS selector)
|
|
4495
4517
|
* @return {string} - The content of the element.
|
|
4496
|
-
*/
|
|
4518
|
+
*/_this70.customReadFunction=false;/**
|
|
4497
4519
|
* Set this to override the default mechanism for getting elements.
|
|
4498
4520
|
*
|
|
4499
4521
|
* @type {Function}
|
|
4500
4522
|
* @param {string} pAddress - The address of the element.
|
|
4501
4523
|
* @return {Array<any>} - The matched elements.
|
|
4502
|
-
*/
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4524
|
+
*/_this70.customGetElementFunction=false;// API Consumers can also craft their own attribute read function
|
|
4525
|
+
_this70.customReadAttributeFunction=false;// API Consumers can also craft their own attribute set function
|
|
4526
|
+
_this70.customSetAttributeFunction=false;// API Consumers can also craft their own attribute remove function
|
|
4527
|
+
_this70.customRemoveAttributeFunction=false;// API Consumers can also craft their own class read function
|
|
4528
|
+
_this70.customReadClassFunction=false;// API Consumers can also craft their own class set function
|
|
4529
|
+
_this70.customSetClassFunction=false;// API Consumers can also craft their own class remove function
|
|
4530
|
+
_this70.customRemoveClassFunction=false;return _this70;}/**
|
|
4509
4531
|
* Get an element from the DOM.
|
|
4510
4532
|
*
|
|
4511
4533
|
* @param {string} pAddress - The address of the element.
|
|
@@ -4569,27 +4591,27 @@ var tmpTargetElement=window.jQuery(pAddress);tmpTargetElement.removeClass(pClass
|
|
|
4569
4591
|
* @param {string} pClass - The class to check for.
|
|
4570
4592
|
*
|
|
4571
4593
|
* @return {boolean} - Whether the element has the class. If multiple elements are matched, returns true if any have the class.
|
|
4572
|
-
*/},{key:"hasClass",value:function hasClass(pAddress,pClass){if(this.customReadClassFunction){return this.customReadClassFunction(pAddress,pClass);}if(this.hasJquery){var tmpTargetElement=window.jQuery(pAddress);return tmpTargetElement.hasClass(pClass);}else if(this.inBrowser&&this.hasDocument){var tmpTargetElementSet=window.document.querySelectorAll(pAddress);for(var i=0;i<tmpTargetElementSet.length;i++){if(tmpTargetElementSet[i].classList.contains(pClass)){return true;}}return false;}else{this.log.trace("PICT Content HASCLASS for [".concat(pAddress,"] CLASS [").concat(pClass,"]:"));}}}]);}(libFableServiceBase);module.exports=PictContentAssignment;},{"fable":58}],167:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictDataProvider=/*#__PURE__*/function(_libFableServiceBase20){function PictDataProvider(pFable,pOptions,pServiceHash){var
|
|
4594
|
+
*/},{key:"hasClass",value:function hasClass(pAddress,pClass){if(this.customReadClassFunction){return this.customReadClassFunction(pAddress,pClass);}if(this.hasJquery){var tmpTargetElement=window.jQuery(pAddress);return tmpTargetElement.hasClass(pClass);}else if(this.inBrowser&&this.hasDocument){var tmpTargetElementSet=window.document.querySelectorAll(pAddress);for(var i=0;i<tmpTargetElementSet.length;i++){if(tmpTargetElementSet[i].classList.contains(pClass)){return true;}}return false;}else{this.log.trace("PICT Content HASCLASS for [".concat(pAddress,"] CLASS [").concat(pClass,"]:"));}}}]);}(libFableServiceBase);module.exports=PictContentAssignment;},{"fable":58}],167:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictDataProvider=/*#__PURE__*/function(_libFableServiceBase20){function PictDataProvider(pFable,pOptions,pServiceHash){var _this71;_classCallCheck2(this,PictDataProvider);_this71=_callSuper(this,PictDataProvider,[pFable,pOptions,pServiceHash]);_this71.serviceType='PictDataProvider';return _this71;}_inherits(PictDataProvider,_libFableServiceBase20);return _createClass2(PictDataProvider,[{key:"getDataByAddress",value:function getDataByAddress(pAddress,pData){var tmpData=typeof pData==='undefined'?{}:pData;return this.fable.manifest.getValueByHash({AppData:this.AppData,Bundle:this.Bundle,Record:tmpData},pAddress);}}]);}(libFableServiceBase);module.exports=PictDataProvider;},{"fable":58}],168:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictMeadowEntityProvider=/*#__PURE__*/function(_libFableServiceBase21){function PictMeadowEntityProvider(pFable,pOptions,pServiceHash){var _this72;_classCallCheck2(this,PictMeadowEntityProvider);_this72=_callSuper(this,PictMeadowEntityProvider,[pFable,pOptions,pServiceHash]);_this72.serviceType='PictMeadowProvider';if(_this72.fable.settings.PictDefaultURLPrefix){_this72.options.urlPrefix=_this72.fable.settings.PictDefaultURLPrefix;}else if(!_this72.options.urlPrefix){_this72.options.urlPrefix='/1.0/';}if(_this72.fable.settings.PictDefaultDownloadBatchSize){_this72.options.downloadBatchSize=_this72.fable.settings.PictDefaultDownloadBatchSize;}else if(!_this72.options.downloadBatchSize){_this72.options.downloadBatchSize=100;}_this72.restClient=_this72.fable.instantiateServiceProviderWithoutRegistration('RestClient');_this72.cache={};_this72.prepareRequestOptions=function(pOptions){return pOptions;};return _this72;}_inherits(PictMeadowEntityProvider,_libFableServiceBase21);return _createClass2(PictMeadowEntityProvider,[{key:"initializeCache",value:function initializeCache(pEntity){// This should not be happening as often as it's happening.
|
|
4573
4595
|
if(!(pEntity in this.cache)){this.cache[pEntity]=this.fable.instantiateServiceProviderWithoutRegistration('ObjectCache');// TODO: Make this a configuration?
|
|
4574
4596
|
// For now cache for 30 seconds.
|
|
4575
4597
|
this.cache[pEntity].maxAge=30000;this.cache[pEntity].maxLength=10000;this.fable.Bundle[pEntity]=this.cache[pEntity].RecordMap;}}},{key:"getEntity",value:function getEntity(pEntity,pIDRecord,fCallback){this.initializeCache(pEntity);// Discard anything from the cache that has expired or is over size.
|
|
4576
|
-
this.cache[pEntity].prune(function(){var
|
|
4598
|
+
this.cache[pEntity].prune(function(){var _this73=this;var tmpPossibleRecord=this.cache[pEntity].read(pIDRecord);if(tmpPossibleRecord){return fCallback(null,tmpPossibleRecord);}var tmpOptions={url:"".concat(this.options.urlPrefix).concat(pEntity,"/").concat(pIDRecord)};tmpOptions=this.prepareRequestOptions(tmpOptions);return this.restClient.getJSON(tmpOptions,function(pError,pResponse,pBody){if(pBody){_this73.cache[pEntity].put(pBody,pIDRecord);}return fCallback(pError,pBody);});}.bind(this));}},{key:"getEntitySetPage",value:function getEntitySetPage(pEntity,pMeadowFilterExpression,pRecordStartCursor,pRecordCount,fCallback){var tmpURL="".concat(this.options.urlPrefix).concat(pEntity,"s/FilteredTo/").concat(pMeadowFilterExpression,"/").concat(pRecordStartCursor,"/").concat(pRecordCount);return this.restClient.getJSON(tmpURL,function(pDownloadError,pDownloadResponse,pDownloadBody){return fCallback(pDownloadError,pDownloadBody);}.bind(this));}},{key:"getEntitySetRecordCount",value:function getEntitySetRecordCount(pEntity,pMeadowFilterExpression,fCallback){var tmpURL="".concat(this.options.urlPrefix).concat(pEntity,"s/Count/FilteredTo/").concat(pMeadowFilterExpression);return this.restClient.getJSON(tmpURL,function(pError,pResponse,pBody){if(pError){this.log.error("Error getting entity count of [".concat(pEntity,"] filtered to [").concat(pMeadowFilterExpression,"] from url [").concat(tmpURL,"]: ").concat(pError));return fCallback(pError);}var tmpRecordCount=0;if(pBody.Count){tmpRecordCount=pBody.Count;}return fCallback(pError,tmpRecordCount);}.bind(this));}},{key:"getEntitySet",value:function getEntitySet(pEntity,pMeadowFilterExpression,fCallback){// TODO: Should we test for too many record IDs here by string length in pMeadowFilterExpression?
|
|
4577
4599
|
// FBL~ID${pDestinationEntity}~INN~${tmpIDRecordsCommaSeparated}
|
|
4578
4600
|
// If the list is mega-long we can parse it and break it into chunks.
|
|
4579
4601
|
this.initializeCache(pEntity);// Discard anything from the cache that has expired or is over size.
|
|
4580
|
-
this.cache[pEntity].prune(function(){var
|
|
4581
|
-
tmpDownloadURIFragments.push("".concat(
|
|
4582
|
-
|
|
4602
|
+
this.cache[pEntity].prune(function(){var _this74=this;return this.getEntitySetRecordCount(pEntity,pMeadowFilterExpression,function(pRecordCountError,pRecordCount){if(pRecordCountError){return fCallback(pRecordCountError);}var tmpRecordCount=pRecordCount;if(isNaN(pRecordCount)){_this74.log.error("Entity count did not return a number for [".concat(pEntity,"] filtered to [").concat(pMeadowFilterExpression,"]... something is fatally wrong from the server accessed in getEntitySet call."));return fCallback(new Error('Entity count did not return a number in getEntitySet.'));}var tmpDownloadURIFragments=[];var tmpDownloadBatchSize=_this74.options.downloadBatchSize;for(var i=0;i<tmpRecordCount/tmpDownloadBatchSize;i++){// Generate each of the URI fragments to download
|
|
4603
|
+
tmpDownloadURIFragments.push("".concat(_this74.options.urlPrefix).concat(pEntity,"s/FilteredTo/").concat(pMeadowFilterExpression,"/").concat(i*tmpDownloadBatchSize,"/").concat(tmpDownloadBatchSize));}var tmpEntitySet=[];// Now run these in series (it's possible to parallelize the requests but they would not be in server order)
|
|
4604
|
+
_this74.fable.Utility.eachLimit(tmpDownloadURIFragments,1,function(pURIFragment,fDownloadCallback){_this74.restClient.getJSON(pURIFragment,function(pDownloadError,pDownloadResponse,pDownloadBody){tmpEntitySet=tmpEntitySet.concat(pDownloadBody);// Should we be caching each record?
|
|
4583
4605
|
return fDownloadCallback(pDownloadError);});},function(pFullDownloadError){return fCallback(pFullDownloadError,tmpEntitySet);});});}.bind(this));}}]);}(libFableServiceBase);module.exports=PictMeadowEntityProvider;},{"fable":58}],169:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictTemplateProvider=/*#__PURE__*/function(_libFableServiceBase22){/**
|
|
4584
4606
|
* @param {Object} pFable - The Fable Framework instance
|
|
4585
4607
|
* @param {Object} pOptions - The options for the service
|
|
4586
4608
|
* @param {String} pServiceHash - The hash of the service
|
|
4587
|
-
*/function PictTemplateProvider(pFable,pOptions,pServiceHash){var
|
|
4609
|
+
*/function PictTemplateProvider(pFable,pOptions,pServiceHash){var _this75;_classCallCheck2(this,PictTemplateProvider);_this75=_callSuper(this,PictTemplateProvider,[pFable,pOptions,pServiceHash]);_this75.serviceType='PictTemplateProvider';_this75.templates={};_this75.templateSources={};// Default templates are stored by prefix.
|
|
4588
4610
|
// The longest prefix match is used.
|
|
4589
4611
|
// Case sensitive.
|
|
4590
|
-
|
|
4612
|
+
_this75.defaultTemplates=[];/**
|
|
4591
4613
|
* @property {Function} loadTemplateFunction - The function to load a template
|
|
4592
|
-
*/
|
|
4614
|
+
*/_this75.loadTemplateFunction=function(){return false;};return _this75;}/**
|
|
4593
4615
|
* Add a template to the provider.
|
|
4594
4616
|
*
|
|
4595
4617
|
* @param {String} pTemplateHash - The hash of the template
|
|
@@ -4634,33 +4656,33 @@ if(!(pTemplateHash in this.templates)){this.checkDefaultTemplateHash(pTemplateHa
|
|
|
4634
4656
|
* Pict management object.
|
|
4635
4657
|
*/var Pict=/*#__PURE__*/function(_libFable){/**
|
|
4636
4658
|
* @param {Object<String, any>} pSettings - The settings for the Pict instance.
|
|
4637
|
-
*/function Pict(pSettings){var
|
|
4659
|
+
*/function Pict(pSettings){var _this76;_classCallCheck2(this,Pict);_this76=_callSuper(this,Pict,[pSettings]);_this76.isBrowser=new Function("try {return (this===window);} catch(pError) {return false;}");_this76.browserAddress='window._Pict';if('BrowserAddress'in _this76.settings){_this76.browserAddress=_this76.settings.BrowserAddress;}_this76.children=[];/**
|
|
4638
4660
|
* The templateProvider provides a basic key->template mapping with default fallback capabilities
|
|
4639
4661
|
*
|
|
4640
4662
|
* @type {PictTemplateProvider}
|
|
4641
|
-
*/
|
|
4663
|
+
*/_this76.TemplateProvider=null;_this76.addAndInstantiateServiceType('TemplateProvider',PictTemplateProvider);/**
|
|
4642
4664
|
* The meadow entity provider.
|
|
4643
4665
|
*
|
|
4644
4666
|
* @type {PictMeadowEntityProvider}
|
|
4645
|
-
*/
|
|
4667
|
+
*/_this76.EntityProvider=null;_this76.addAndInstantiateServiceType('EntityProvider',PictMeadowEntityProvider);/**
|
|
4646
4668
|
* The data provider.
|
|
4647
4669
|
*
|
|
4648
4670
|
* @type {PictDataProvider}
|
|
4649
|
-
*/
|
|
4671
|
+
*/_this76.DataProvider=null;_this76.addAndInstantiateServiceType('DataProvider',PictDataProvider);/**
|
|
4650
4672
|
* The content assignment module.
|
|
4651
4673
|
*
|
|
4652
4674
|
* @type {PictContentAssignment}
|
|
4653
|
-
*/
|
|
4675
|
+
*/_this76.ContentAssignment=null;_this76.addAndInstantiateServiceType('ContentAssignment',PictContentAssignment);/**
|
|
4654
4676
|
* The CSS module.
|
|
4655
4677
|
*
|
|
4656
4678
|
* @type {PictCSS}
|
|
4657
4679
|
* @public
|
|
4658
|
-
*/
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
if(
|
|
4663
|
-
|
|
4680
|
+
*/_this76.CSSMap=null;_this76.addAndInstantiateServiceType('CSSMap',PictCSS);_this76.addServiceType('PictTemplate',require('pict-template'));_this76.instantiateServiceProvider('MetaTemplate');_this76.instantiateServiceProvider('DataGeneration');_this76.manifest=_this76.instantiateServiceProvider('Manifest');_this76.AppData={};if('DefaultAppData'in _this76.fable.settings){_this76.AppData=_this76.fable.settings.DefaultAppData;}_this76.Bundle={};// Log noisness goes from 0 - 5, where 5 is show me everything.
|
|
4681
|
+
_this76.LogNoisiness=0;// Although we have log noisiness, sometimes we need control flow without all the other noise for hard to diagnose interpreters.
|
|
4682
|
+
_this76.LogControlFlow=false;// And an easy way to be introspective about data at various locations
|
|
4683
|
+
_this76.LogControlFlowWatchAddressList=[];// Load manifest sets
|
|
4684
|
+
if(_this76.settings.Manifests){_this76.loadManifestSet(_this76.settings.Manifests);}_this76._DefaultPictTemplatesInitialized=false;_this76.initializePictTemplateEngine();_this76.addServiceType('PictView',require('pict-view'));_this76.addServiceType('PictProvider',require('pict-provider'));_this76.addServiceType('PictApplication',require('pict-application'));// Expose the named views directly, through a convenience accessor
|
|
4685
|
+
_this76.providers=_this76.servicesMap.PictProvider;_this76.views=_this76.servicesMap.PictView;return _this76;}/**
|
|
4664
4686
|
* Load manifests in as Hashed services
|
|
4665
4687
|
*
|
|
4666
4688
|
* @param {Object<String, String>} pManifestSet - The manifest set to load.
|
|
@@ -4668,9 +4690,9 @@ _this75.providers=_this75.servicesMap.PictProvider;_this75.views=_this75.service
|
|
|
4668
4690
|
var tmpManifestKey=tmpManifestKeys[i];this.instantiateServiceProvider('Manifest',pManifestSet[tmpManifestKey],tmpManifestKey);}}}/**
|
|
4669
4691
|
* Add a template expression to the template engine from the PictTemplate service.
|
|
4670
4692
|
*
|
|
4671
|
-
* @param {typeof
|
|
4693
|
+
* @param {typeof any} pTemplatePrototype - The prototype class for the template expression
|
|
4672
4694
|
*
|
|
4673
|
-
* @return {
|
|
4695
|
+
* @return {any} the service instance, or null if the prototype was invalid
|
|
4674
4696
|
*/},{key:"addTemplate",value:function addTemplate(pTemplatePrototype){if(typeof pTemplatePrototype!='function'){this.log.warn("PICT [".concat(this.UUID,"] could not add Template; pTemplatePrototype was not a class it was ").concat(_typeof(pTemplatePrototype),"."));return null;}var tmpTemplateHash=pTemplatePrototype.template_hash;if(this.LogNoisiness>1){this.log.info("PICT-ControlFlow addTemplate [".concat(tmpTemplateHash,"]"));}return this.instantiateServiceProviderFromPrototype('PictTemplate',{},tmpTemplateHash,pTemplatePrototype);}/**
|
|
4675
4697
|
* Just passing an options will construct one for us.
|
|
4676
4698
|
* Passing a hash will set the hash.
|
|
@@ -4766,7 +4788,7 @@ this.addTemplate(require("./templates/debugging/Pict-Template-Breakpoint.js"));t
|
|
|
4766
4788
|
* @param {Array<any>} [pContextArray] - The context array to use in the template
|
|
4767
4789
|
*
|
|
4768
4790
|
* @return {String?} The parsed template string, or undefined if a callback was provided
|
|
4769
|
-
*/},{key:"parseTemplate",value:function parseTemplate(pTemplateString,pData,fCallback,pContextArray){var
|
|
4791
|
+
*/},{key:"parseTemplate",value:function parseTemplate(pTemplateString,pData,fCallback,pContextArray){var _this77=this;var tmpData=_typeof(pData)==='object'?pData:{};var tmpContextArray=Array.isArray(pContextArray)?pContextArray:[this];var tmpParseUUID;if(this.LogControlFlow){tmpParseUUID=this.fable.getUUID();this.log.info("PICT-ControlFlow parseTemplate ".concat(tmpParseUUID," [").concat(pTemplateString.substring(0,50).replace('\n','\\n'),"...").concat(pTemplateString.length,"] (fCallback: ").concat(_typeof(fCallback),") with data size [").concat(JSON.stringify(tmpData).length,"]"));if(this.LogNoisiness>1){this.log.info("PICT-ControlFlow parseTemplate ".concat(tmpParseUUID," template:\n").concat(pTemplateString));}if(this.LogControlFlowWatchAddressList.length>0){for(var i=0;i<this.LogControlFlowWatchAddressList.length;i++){this.log.info("PICT-ControlFlow parseTemplate ".concat(tmpParseUUID," Watch Value: [").concat(this.LogControlFlowWatchAddressList[i],"]=>[").concat(this.resolveStateFromAddress(this.LogControlFlowWatchAddressList[i],tmpData),"]"));}}}if(typeof fCallback==='function'){this.MetaTemplate.parseString(pTemplateString,tmpData,function(pError,pParsedTemplate){if(_this77.LogControlFlow&&_this77.LogNoisiness>1){_this77.log.info("PICT-ControlFlow parseTemplate ".concat(tmpParseUUID," Template Async Return Value:\n").concat(pParsedTemplate));}return fCallback(pError,pParsedTemplate);},tmpContextArray);}else{var tmpResult=this.MetaTemplate.parseString(pTemplateString,tmpData,null,tmpContextArray);if(this.LogControlFlow&&this.LogNoisiness>1){this.log.info("PICT-ControlFlow parseTemplate ".concat(tmpParseUUID," Template Return Value:\n").concat(tmpResult));}return tmpResult;}}/**
|
|
4770
4792
|
* Parse a template by hash.
|
|
4771
4793
|
*
|
|
4772
4794
|
* @param {String} pTemplateHash - The hash of the template to parse
|
|
@@ -4785,8 +4807,8 @@ if(!tmpTemplateString){tmpTemplateString='';}return this.parseTemplate(tmpTempla
|
|
|
4785
4807
|
* @param {Array<any>} [pContextArray] - The context array to use in the template
|
|
4786
4808
|
*
|
|
4787
4809
|
* @return {String?} The parsed template string, or undefined if a callback was provided
|
|
4788
|
-
*/},{key:"parseTemplateSet",value:function parseTemplateSet(pTemplateString,pDataSet,fCallback,pContextArray){var
|
|
4789
|
-
var tmpValue='';if(typeof fCallback=='function'){if(Array.isArray(pDataSet)||_typeof(pDataSet)=='object'){this.Utility.eachLimit(pDataSet,1,function(pRecord,fRecordTemplateCallback){return
|
|
4810
|
+
*/},{key:"parseTemplateSet",value:function parseTemplateSet(pTemplateString,pDataSet,fCallback,pContextArray){var _this78=this;// TODO: This will need streaming -- for now janky old string append does the trick
|
|
4811
|
+
var tmpValue='';if(typeof fCallback=='function'){if(Array.isArray(pDataSet)||_typeof(pDataSet)=='object'){this.Utility.eachLimit(pDataSet,1,function(pRecord,fRecordTemplateCallback){return _this78.parseTemplate(pTemplateString,pRecord,function(pError,pTemplateResult){tmpValue+=pTemplateResult;return fRecordTemplateCallback();});},function(pError){return fCallback(pError,tmpValue);});}else{return fCallback(Error('Pict: Template Set: pDataSet is not an array or object.'),'');}}else{if(Array.isArray(pDataSet)||_typeof(pDataSet)=='object'){if(Array.isArray(pDataSet)){for(var i=0;i<pDataSet.length;i++){tmpValue+=this.parseTemplate(pTemplateString,pDataSet[i],null,pContextArray);}}else{var tmpKeys=Object.keys(pDataSet);for(var _i57=0;_i57<tmpKeys.length;_i57++){tmpValue+=this.parseTemplate(pTemplateString,pDataSet[tmpKeys[_i57]],null,pContextArray);}}return tmpValue;}else{return'';}}}/**
|
|
4790
4812
|
* Parse a template set by hash.
|
|
4791
4813
|
*
|
|
4792
4814
|
* @param {String} pTemplateHash - The hash of the template to parse
|
|
@@ -4899,11 +4921,11 @@ return this.contentMap[pAddress];}this.pict.log.warn("Mock read from Address ".c
|
|
|
4899
4921
|
* @param {Object} pFable - The Fable Framework instance
|
|
4900
4922
|
* @param {Object} pOptions - The options for the service
|
|
4901
4923
|
* @param {String} pServiceHash - The hash of the service
|
|
4902
|
-
*/function PictTemplateProviderData(pFable,pOptions,pServiceHash){var
|
|
4924
|
+
*/function PictTemplateProviderData(pFable,pOptions,pServiceHash){var _this79;_classCallCheck2(this,PictTemplateProviderData);_this79=_callSuper(this,PictTemplateProviderData,[pFable,pOptions,pServiceHash]);_this79.addPattern('{~Data:','~}');_this79.addPattern('{~D:','~}');return _this79;}_inherits(PictTemplateProviderData,_libPictTemplate);return _createClass2(PictTemplateProviderData,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpRecord=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fDataRender]::[".concat(tmpHash,"] with tmpData:"),tmpRecord);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fDataRender]::[".concat(tmpHash,"]"));}var tmpValue='';if(tmpHash!=null){tmpValue=this.resolveStateFromAddress(tmpHash,tmpRecord,pContextArray);}if(tmpValue==null||tmpValue=='undefined'||typeof tmpValue=='undefined'){return'';}return tmpValue;}}]);}(libPictTemplate);module.exports=PictTemplateProviderData;},{"pict-template":118}],174:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderEntity=/*#__PURE__*/function(_libPictTemplate2){/**
|
|
4903
4925
|
* @param {Object} pFable - The Fable Framework instance
|
|
4904
4926
|
* @param {Object} pOptions - The options for the service
|
|
4905
4927
|
* @param {String} pServiceHash - The hash of the service
|
|
4906
|
-
*/function PictTemplateProviderEntity(pFable,pOptions,pServiceHash){var
|
|
4928
|
+
*/function PictTemplateProviderEntity(pFable,pOptions,pServiceHash){var _this80;_classCallCheck2(this,PictTemplateProviderEntity);_this80=_callSuper(this,PictTemplateProviderEntity,[pFable,pOptions,pServiceHash]);_this80.addPattern('{~E:','~}');_this80.addPattern('{~Entity:','~}');return _this80;}_inherits(PictTemplateProviderEntity,_libPictTemplate2);return _createClass2(PictTemplateProviderEntity,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){// TODO: Better messaging
|
|
4907
4929
|
this.log.error("Pict: Entity Render [".concat(pTemplateHash,"]: Render called in a non-asynchronous fashion. This should not happen."));return'';}},{key:"renderAsync",value:function renderAsync(pTemplateHash,pRecord,fCallback,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpCallback=typeof fCallback==='function'?fCallback:function(){return'';};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fEntityRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fEntityRender]::[".concat(tmpHash,"]"));}var tmpEntity=false;var tmpEntityID=false;var tmpEntityTemplate=false;// This expression requires 2 parts -- a third is optional, and, if present, is the template to render to.
|
|
4908
4930
|
var tmpAddressParts=tmpHash.split('^');if(tmpAddressParts.length<2){this.log.warn("Pict: Entity Render: Entity or entity ID not resolved for [".concat(tmpHash,"]"));return tmpCallback(Error("Pict: Entity Render: Entity or entity ID not resolved for [".concat(tmpHash,"]")),'');}tmpEntity=tmpAddressParts[0].trim();tmpEntityID=tmpAddressParts[1].trim();tmpEntityTemplate=tmpAddressParts[2].trim();if(!isNaN(tmpEntityID)){try{tmpEntityID=parseInt(tmpEntityID);}catch(_unused){this.log.warn("Pict: Entity Render: Could not parse entity ID.");tmpEntityID=0;}}else{// This is an address, so we need to get the value at the address
|
|
4909
4931
|
tmpEntityID=this.resolveStateFromAddress(tmpEntityID,tmpData,pContextArray);}// No Entity or EntityID
|
|
@@ -4913,11 +4935,11 @@ if(tmpEntityTemplate){return this.pict.parseTemplateByHash(tmpEntityTemplate,pRe
|
|
|
4913
4935
|
* @param {Object} pFable - The Fable Framework instance
|
|
4914
4936
|
* @param {Object} pOptions - The options for the service
|
|
4915
4937
|
* @param {String} pServiceHash - The hash of the service
|
|
4916
|
-
*/function PictTemplateProviderSelf(pFable,pOptions,pServiceHash){var
|
|
4938
|
+
*/function PictTemplateProviderSelf(pFable,pOptions,pServiceHash){var _this81;_classCallCheck2(this,PictTemplateProviderSelf);_this81=_callSuper(this,PictTemplateProviderSelf,[pFable,pOptions,pServiceHash]);_this81.addPattern('{~Pict','~}');_this81.addPattern('{~P','~}');_this81.addPattern('{~p','~}');return _this81;}_inherits(PictTemplateProviderSelf,_libPictTemplate3);return _createClass2(PictTemplateProviderSelf,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){return this.pict.browserAddress;}}]);}(libPictTemplate);module.exports=PictTemplateProviderSelf;},{"pict-template":118}],176:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderTemplate=/*#__PURE__*/function(_libPictTemplate4){/**
|
|
4917
4939
|
* @param {Object} pFable - The Fable Framework instance
|
|
4918
4940
|
* @param {Object} pOptions - The options for the service
|
|
4919
4941
|
* @param {String} pServiceHash - The hash of the service
|
|
4920
|
-
*/function PictTemplateProviderTemplate(pFable,pOptions,pServiceHash){var
|
|
4942
|
+
*/function PictTemplateProviderTemplate(pFable,pOptions,pServiceHash){var _this82;_classCallCheck2(this,PictTemplateProviderTemplate);_this82=_callSuper(this,PictTemplateProviderTemplate,[pFable,pOptions,pServiceHash]);_this82.addPattern('{~Template:','~}');_this82.addPattern('{~T:','~}');return _this82;}_inherits(PictTemplateProviderTemplate,_libPictTemplate4);return _createClass2(PictTemplateProviderTemplate,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateRender]::[".concat(tmpHash,"]"));}var tmpTemplateHash=false;var tmpAddressOfData=false;// This is just a simple 2 part hash (the entity and the ID)
|
|
4921
4943
|
var tmpHashTemplateSeparator=tmpHash.indexOf(':');tmpTemplateHash=tmpHash.substring(0,tmpHashTemplateSeparator);if(tmpHashTemplateSeparator>-1){tmpAddressOfData=tmpHash.substring(tmpHashTemplateSeparator+1);}else{tmpTemplateHash=tmpHash;}// No template hash
|
|
4922
4944
|
if(!tmpTemplateHash){this.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]");}if(!tmpAddressOfData){// No address was provided, just render the template with what this template has.
|
|
4923
4945
|
return this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,null,pContextArray);}else{return this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray),null,pContextArray);}}},{key:"renderAsync",value:function renderAsync(pTemplateHash,pRecord,fCallback,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpCallback=typeof fCallback==='function'?fCallback:function(){return'';};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateRenderAsync]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateRenderAsync]::[".concat(tmpHash,"]"));}var tmpTemplateHash=false;var tmpAddressOfData=false;// This is just a simple 2 part hash (the entity and the ID)
|
|
@@ -4928,7 +4950,7 @@ return this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,function(pError,pVa
|
|
|
4928
4950
|
* @param {Object} pFable - The Fable Framework instance
|
|
4929
4951
|
* @param {Object} pOptions - The options for the service
|
|
4930
4952
|
* @param {String} pServiceHash - The hash of the service
|
|
4931
|
-
*/function PictTemplateProviderTemplateFromMap(pFable,pOptions,pServiceHash){var
|
|
4953
|
+
*/function PictTemplateProviderTemplateFromMap(pFable,pOptions,pServiceHash){var _this83;_classCallCheck2(this,PictTemplateProviderTemplateFromMap);_this83=_callSuper(this,PictTemplateProviderTemplateFromMap,[pFable,pOptions,pServiceHash]);_this83.addPattern('{~TFM:','~}');_this83.addPattern('{~TemplateFromMap:','~}');return _this83;}_inherits(PictTemplateProviderTemplateFromMap,_libPictTemplate5);return _createClass2(PictTemplateProviderTemplateFromMap,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT TemplateFromMap [fTemplateFromMapRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT TemplateFromMap [fTemplateFromMapRender]::[".concat(tmpHash,"]"));}var tmpTemplateFromMapHash=false;var tmpAddressOfMap=false;var tmpAddressOfKey=false;// This is a 3 part hash with the map address and the key address both
|
|
4932
4954
|
var tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<3){this.log.trace("PICT TemplateFromMap [fTemplateFromMapRenderAsync]::[".concat(tmpHash,"] failed because there were not three stanzas in the expression [").concat(pTemplateHash,"]"));return'';}tmpTemplateFromMapHash=tmpTemplateHashPart[0];tmpAddressOfMap=tmpTemplateHashPart[1];tmpAddressOfKey=tmpTemplateHashPart[2];// No TemplateFromMap hash
|
|
4933
4955
|
if(!tmpTemplateFromMapHash){this.log.warn("Pict: TemplateFromMap Render: TemplateFromMapHash not resolved for [".concat(tmpHash,"]"));return'';}// Now resolve the data
|
|
4934
4956
|
var tmpMap=this.resolveStateFromAddress(tmpAddressOfMap,tmpData,pContextArray);var tmpKey=this.resolveStateFromAddress(tmpAddressOfKey,tmpData,pContextArray);if(!tmpMap){this.log.warn("Pict: TemplateFromMap Render: Map not resolved for [".concat(tmpHash,"]"));return'';}tmpData=tmpMap[tmpKey];if(!tmpData){// No address was provided, just render the TemplateFromMap with what this TemplateFromMap has.
|
|
@@ -4941,7 +4963,7 @@ return this.pict.parseTemplateByHash(tmpTemplateFromMapHash,pRecord,function(pEr
|
|
|
4941
4963
|
* @param {Object} pFable - The Fable Framework instance
|
|
4942
4964
|
* @param {Object} pOptions - The options for the service
|
|
4943
4965
|
* @param {String} pServiceHash - The hash of the service
|
|
4944
|
-
*/function PictTemplateProviderTemplateSet(pFable,pOptions,pServiceHash){var
|
|
4966
|
+
*/function PictTemplateProviderTemplateSet(pFable,pOptions,pServiceHash){var _this84;_classCallCheck2(this,PictTemplateProviderTemplateSet);_this84=_callSuper(this,PictTemplateProviderTemplateSet,[pFable,pOptions,pServiceHash]);_this84.addPattern('{~TemplateSet:','~}');_this84.addPattern('{~TS:','~}');return _this84;}_inherits(PictTemplateProviderTemplateSet,_libPictTemplate6);return _createClass2(PictTemplateProviderTemplateSet,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateSetRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateSetRender]::[".concat(tmpHash,"]"));}var tmpTemplateHash=false;var tmpAddressOfData=false;// This is just a simple 2 part hash (the entity and the ID)
|
|
4945
4967
|
var tmpHashTemplateSeparator=tmpHash.indexOf(':');tmpTemplateHash=tmpHash.substring(0,tmpHashTemplateSeparator);if(tmpHashTemplateSeparator>-1){tmpAddressOfData=tmpHash.substring(tmpHashTemplateSeparator+1);}else{tmpTemplateHash=tmpHash;}// No template hash
|
|
4946
4968
|
if(!tmpTemplateHash){this.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]");}if(!tmpAddressOfData){// No address was provided, just render the template with what this template has.
|
|
4947
4969
|
return this.pict.parseTemplateSetByHash(tmpTemplateHash,pRecord,null,pContextArray);}else{return this.pict.parseTemplateSetByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray),null,pContextArray);}}},{key:"renderAsync",value:function renderAsync(pTemplateHash,pRecord,fCallback,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpCallback=typeof fCallback==='function'?fCallback:function(){return'';};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateSetRenderAsync]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateSetRenderAsync]::[".concat(tmpHash,"]"));}var tmpTemplateFromMapHash=false;var tmpAddressOfData=false;// This is a 3 part hash with the map address and the key address both
|
|
@@ -4953,7 +4975,7 @@ return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,function(
|
|
|
4953
4975
|
* @param {Object} pFable - The Fable Framework instance
|
|
4954
4976
|
* @param {Object} pOptions - The options for the service
|
|
4955
4977
|
* @param {String} pServiceHash - The hash of the service
|
|
4956
|
-
*/function PictTemplateProviderTemplateSetFromMap(pFable,pOptions,pServiceHash){var
|
|
4978
|
+
*/function PictTemplateProviderTemplateSetFromMap(pFable,pOptions,pServiceHash){var _this85;_classCallCheck2(this,PictTemplateProviderTemplateSetFromMap);_this85=_callSuper(this,PictTemplateProviderTemplateSetFromMap,[pFable,pOptions,pServiceHash]);_this85.addPattern('{~TSFM:','~}');_this85.addPattern('{~TemplateSetFromMap:','~}');return _this85;}_inherits(PictTemplateProviderTemplateSetFromMap,_libPictTemplate7);return _createClass2(PictTemplateProviderTemplateSetFromMap,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT TemplateFromMap [fTemplateFromMapSetRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT TemplateFromMap [fTemplateFromMapSetRender]::[".concat(tmpHash,"]"));}var tmpTemplateFromMapHash=false;var tmpAddressOfMap=false;var tmpAddressOfKey=false;// This is a 3 part hash with the map address and the key address both
|
|
4957
4979
|
var tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<3){this.log.trace("PICT TemplateFromMap [fTemplateFromMapRenderAsync]::[".concat(tmpHash,"] failed because there were not three stanzas in the expression [").concat(pTemplateHash,"]"));return'';}tmpTemplateFromMapHash=tmpTemplateHashPart[0];tmpAddressOfMap=tmpTemplateHashPart[1];tmpAddressOfKey=tmpTemplateHashPart[2];// No TemplateFromMap hash
|
|
4958
4980
|
if(!tmpTemplateFromMapHash){this.log.warn("Pict: TemplateFromMap Render Async: TemplateFromMapHash not resolved for [".concat(tmpHash,"]"));return'';}// Now resolve the data
|
|
4959
4981
|
var tmpMap=this.resolveStateFromAddress(tmpAddressOfMap,tmpData,pContextArray);var tmpKey=this.resolveStateFromAddress(tmpAddressOfKey,tmpData,pContextArray);if(!tmpMap){this.log.warn("Pict: TemplateFromMap Render: Map not resolved for [".concat(tmpHash,"]"));return'';}tmpData=tmpMap[tmpKey];if(!tmpData){// No address was provided, just render the TemplateFromMap with what this TemplateFromMap has.
|
|
@@ -4966,7 +4988,7 @@ return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,function(
|
|
|
4966
4988
|
* @param {Object} pFable - The Fable Framework instance
|
|
4967
4989
|
* @param {Object} pOptions - The options for the service
|
|
4968
4990
|
* @param {String} pServiceHash - The hash of the service
|
|
4969
|
-
*/function PictTemplateProviderTemplateValueSet(pFable,pOptions,pServiceHash){var
|
|
4991
|
+
*/function PictTemplateProviderTemplateValueSet(pFable,pOptions,pServiceHash){var _this86;_classCallCheck2(this,PictTemplateProviderTemplateValueSet);_this86=_callSuper(this,PictTemplateProviderTemplateValueSet,[pFable,pOptions,pServiceHash]);_this86.addPattern('{~TemplateValueSet:','~}');_this86.addPattern('{~TVS:','~}');return _this86;}_inherits(PictTemplateProviderTemplateValueSet,_libPictTemplate8);return _createClass2(PictTemplateProviderTemplateValueSet,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateValueSetRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateValueSetRender]::[".concat(tmpHash,"]"));}var tmpTemplateHash=false;var tmpAddressOfData=false;// This is just a simple 2 part hash (the entity and the ID)
|
|
4970
4992
|
var tmpHashTemplateSeparator=tmpHash.indexOf(':');tmpTemplateHash=tmpHash.substring(0,tmpHashTemplateSeparator);if(tmpHashTemplateSeparator>-1){tmpAddressOfData=tmpHash.substring(tmpHashTemplateSeparator+1);}else{tmpTemplateHash=tmpHash;}// No template hash
|
|
4971
4993
|
if(!tmpTemplateHash){this.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]");}tmpData=this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray);var tmpDataValueSet=[];if(Array.isArray(tmpData)){for(var i=0;i<tmpData.length;i++){tmpDataValueSet.push({Value:tmpData[i],Key:i});}}else if(_typeof(tmpData)==='object'){var tmpValueKeys=Object.keys(tmpData);for(var _i58=0;_i58<tmpValueKeys.length;_i58++){tmpDataValueSet.push({Value:tmpData[tmpValueKeys[_i58]],Key:tmpValueKeys[_i58]});}}else{tmpDataValueSet.push({Value:tmpData});}tmpData=tmpDataValueSet;if(!tmpData){// No address was provided, just render the template with what this template has.
|
|
4972
4994
|
return this.pict.parseTemplateSetByHash(tmpTemplateHash,pRecord,null,pContextArray);}else{return this.pict.parseTemplateSetByHash(tmpTemplateHash,tmpData,null,pContextArray);}}},{key:"renderAsync",value:function renderAsync(pTemplateHash,pRecord,fCallback,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpCallback=typeof fCallback==='function'?fCallback:function(){return'';};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateValueSetRenderAsync]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateValueSetRenderAsync]::[".concat(tmpHash,"]"));}var tmpTemplateFromMapHash=false;var tmpAddressOfData=false;// This is a 3 part hash with the map address and the key address both
|
|
@@ -4978,19 +5000,19 @@ return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,function(
|
|
|
4978
5000
|
* @param {Object} pFable - The Fable Framework instance
|
|
4979
5001
|
* @param {Object} pOptions - The options for the service
|
|
4980
5002
|
* @param {String} pServiceHash - The hash of the service
|
|
4981
|
-
*/function PictTemplateProviderRandomNumber(pFable,pOptions,pServiceHash){var
|
|
5003
|
+
*/function PictTemplateProviderRandomNumber(pFable,pOptions,pServiceHash){var _this87;_classCallCheck2(this,PictTemplateProviderRandomNumber);_this87=_callSuper(this,PictTemplateProviderRandomNumber,[pFable,pOptions,pServiceHash]);_this87.addPattern('{~RandomNumber:','~}');_this87.addPattern('{~RN:','~}');return _this87;}_inherits(PictTemplateProviderRandomNumber,_libPictTemplate9);return _createClass2(PictTemplateProviderRandomNumber,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fRandomNumber]::[".concat(tmpHash,"]"));}var tmpMinimumNumber=0;var tmpMaxNumber=9999999;if(tmpHash.length>0){var tmpHashParts=tmpHash.split(',');if(tmpHashParts.length>0){try{tmpMinimumNumber=parseInt(tmpHashParts[0]);}catch(_unused2){tmpMinimumNumber=0;}}if(tmpHashParts.length>1){try{tmpMaxNumber=parseInt(tmpHashParts[1]);}catch(_unused3){tmpMaxNumber=9999999;}}}return this.fable.DataGeneration.randomIntegerBetween(tmpMinimumNumber,tmpMaxNumber);}}]);}(libPictTemplate);module.exports=PictTemplateProviderRandomNumber;},{"pict-template":118}],182:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderRandomNumberString=/*#__PURE__*/function(_libPictTemplate10){/**
|
|
4982
5004
|
* @param {Object} pFable - The Fable Framework instance
|
|
4983
5005
|
* @param {Object} pOptions - The options for the service
|
|
4984
5006
|
* @param {String} pServiceHash - The hash of the service
|
|
4985
|
-
*/function PictTemplateProviderRandomNumberString(pFable,pOptions,pServiceHash){var
|
|
5007
|
+
*/function PictTemplateProviderRandomNumberString(pFable,pOptions,pServiceHash){var _this88;_classCallCheck2(this,PictTemplateProviderRandomNumberString);_this88=_callSuper(this,PictTemplateProviderRandomNumberString,[pFable,pOptions,pServiceHash]);_this88.addPattern('{~RandomNumberString:','~}');_this88.addPattern('{~RNS:','~}');return _this88;}_inherits(PictTemplateProviderRandomNumberString,_libPictTemplate10);return _createClass2(PictTemplateProviderRandomNumberString,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fRandomNumberString]::[".concat(tmpHash,"]"));}var tmpStringLength=4;var tmpMaxNumber=9999;if(tmpHash.length>0){var tmpHashParts=tmpHash.split(',');if(tmpHashParts.length>0){try{tmpStringLength=parseInt(tmpHashParts[0]);}catch(_unused4){tmpStringLength=4;}}if(tmpHashParts.length>1){try{tmpMaxNumber=parseInt(tmpHashParts[1]);}catch(_unused5){tmpMaxNumber=9999;}}}return this.fable.DataGeneration.randomNumericString(tmpStringLength,tmpMaxNumber);}}]);}(libPictTemplate);module.exports=PictTemplateProviderRandomNumberString;},{"pict-template":118}],183:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderDollars=/*#__PURE__*/function(_libPictTemplate11){/**
|
|
4986
5008
|
* @param {Object} pFable - The Fable Framework instance
|
|
4987
5009
|
* @param {Object} pOptions - The options for the service
|
|
4988
5010
|
* @param {String} pServiceHash - The hash of the service
|
|
4989
|
-
*/function PictTemplateProviderDollars(pFable,pOptions,pServiceHash){var
|
|
5011
|
+
*/function PictTemplateProviderDollars(pFable,pOptions,pServiceHash){var _this89;_classCallCheck2(this,PictTemplateProviderDollars);_this89=_callSuper(this,PictTemplateProviderDollars,[pFable,pOptions,pServiceHash]);_this89.addPattern('{~DataJson:','~}');_this89.addPattern('{~DJ:','~}');return _this89;}_inherits(PictTemplateProviderDollars,_libPictTemplate11);return _createClass2(PictTemplateProviderDollars,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fDataJson]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fDataJson]::[".concat(tmpHash,"]"));}var tmpDataToStringify=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray);if(!tmpDataToStringify){tmpDataToStringify=pRecord;}return JSON.stringify(tmpDataToStringify);}}]);}(libPictTemplate);module.exports=PictTemplateProviderDollars;},{"pict-template":118}],184:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderDateFormat=/*#__PURE__*/function(_libPictTemplate12){/**
|
|
4990
5012
|
* @param {Object} pFable - The Fable Framework instance
|
|
4991
5013
|
* @param {Object} pOptions - The options for the service
|
|
4992
5014
|
* @param {String} pServiceHash - The hash of the service
|
|
4993
|
-
*/function PictTemplateProviderDateFormat(pFable,pOptions,pServiceHash){var
|
|
5015
|
+
*/function PictTemplateProviderDateFormat(pFable,pOptions,pServiceHash){var _this90;_classCallCheck2(this,PictTemplateProviderDateFormat);_this90=_callSuper(this,PictTemplateProviderDateFormat,[pFable,pOptions,pServiceHash]);_this90.addPattern('{~DateFormat:','~}');return _this90;}_inherits(PictTemplateProviderDateFormat,_libPictTemplate12);return _createClass2(PictTemplateProviderDateFormat,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpDateValueSet=tmpHash.split('^');if(tmpDateValueSet.length<2){this.log.error("PICT Template [fDateFormat]::[".concat(tmpHash,"] did not have a valid format string and date."));return'';}var tmpDateValue=this.resolveStateFromAddress(tmpDateValueSet[0],tmpData,pContextArray);if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fDateFormat]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fDateFormat]::[".concat(tmpHash,"]"));}// TODO: Modularize this
|
|
4994
5016
|
var tmpDayJS=this.fable.Dates.dayJS.utc(tmpDateValue);try{// Try to cast the day to be a specific timezone if one is set for the app
|
|
4995
5017
|
if(this.options.Timezone){tmpDayJS=tmpDayJS.tz(this.options.Timezone);}else{try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.log.error("Error guessing dayJS guess() function; dates may be formatted to GMT by default. (".concat(pError.message||pError,")"));}}}catch(_unused6){//this.log.error(`Error casting date passed timezone using tz .. casting to the browser guess which is [${this.fable.Dates.dayJS.tz.guess()}].`);
|
|
4996
5018
|
// Day.js will try to guess the user's timezone for us
|
|
@@ -5004,7 +5026,7 @@ try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.
|
|
|
5004
5026
|
* @param {Object} pFable - The Fable Framework instance
|
|
5005
5027
|
* @param {Object} pOptions - The options for the service
|
|
5006
5028
|
* @param {String} pServiceHash - The hash of the service
|
|
5007
|
-
*/function PictTemplateProviderDateYMD(pFable,pOptions,pServiceHash){var
|
|
5029
|
+
*/function PictTemplateProviderDateYMD(pFable,pOptions,pServiceHash){var _this91;_classCallCheck2(this,PictTemplateProviderDateYMD);_this91=_callSuper(this,PictTemplateProviderDateYMD,[pFable,pOptions,pServiceHash]);_this91.addPattern('{~DateYMD:','~}');return _this91;}_inherits(PictTemplateProviderDateYMD,_libPictTemplate13);return _createClass2(PictTemplateProviderDateYMD,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpDateValue=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray);if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fDateFormat]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fDateFormat]::[".concat(tmpHash,"]"));}// TODO: Modularize this
|
|
5008
5030
|
var tmpDayJS=this.fable.Dates.dayJS.utc(tmpDateValue);try{// Try to cast the day to be a specific timezone if one is set for the app
|
|
5009
5031
|
if(this.options.Timezone){tmpDayJS=tmpDayJS.tz(this.options.Timezone);}else{try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.log.error("Error guessing dayJS guess() function; dates may be formatted to GMT by default. (".concat(pError.message||pError,")"));}}}catch(_unused7){//this.log.error(`Error casting timezone using tz .. casting to the browser guess which is [${this.fable.Dates.dayJS.tz.guess()}].`);
|
|
5010
5032
|
// Day.js will try to guess the user's timezone for us
|
|
@@ -5012,25 +5034,25 @@ try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.
|
|
|
5012
5034
|
* @param {Object} pFable - The Fable Framework instance
|
|
5013
5035
|
* @param {Object} pOptions - The options for the service
|
|
5014
5036
|
* @param {String} pServiceHash - The hash of the service
|
|
5015
|
-
*/function PictTemplateProviderDigits(pFable,pOptions,pServiceHash){var
|
|
5037
|
+
*/function PictTemplateProviderDigits(pFable,pOptions,pServiceHash){var _this92;_classCallCheck2(this,PictTemplateProviderDigits);_this92=_callSuper(this,PictTemplateProviderDigits,[pFable,pOptions,pServiceHash]);_this92.addPattern('{~Digits:','~}');return _this92;}_inherits(PictTemplateProviderDigits,_libPictTemplate14);return _createClass2(PictTemplateProviderDigits,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fDigits]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fDigits]::[".concat(tmpHash,"]"));}var tmpColumnData=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray);return this.fable.DataFormat.formatterAddCommasToNumber(this.fable.DataFormat.formatterRoundNumber(tmpColumnData,2));}}]);}(libPictTemplate);module.exports=PictTemplateProviderDigits;},{"pict-template":118}],187:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderDollars=/*#__PURE__*/function(_libPictTemplate15){/**
|
|
5016
5038
|
* @param {Object} pFable - The Fable Framework instance
|
|
5017
5039
|
* @param {Object} pOptions - The options for the service
|
|
5018
5040
|
* @param {String} pServiceHash - The hash of the service
|
|
5019
|
-
*/function PictTemplateProviderDollars(pFable,pOptions,pServiceHash){var
|
|
5041
|
+
*/function PictTemplateProviderDollars(pFable,pOptions,pServiceHash){var _this93;_classCallCheck2(this,PictTemplateProviderDollars);_this93=_callSuper(this,PictTemplateProviderDollars,[pFable,pOptions,pServiceHash]);_this93.addPattern('{~Dollars:','~}');return _this93;}_inherits(PictTemplateProviderDollars,_libPictTemplate15);return _createClass2(PictTemplateProviderDollars,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fDollars]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fDollars]::[".concat(tmpHash,"]"));}var tmpColumnData=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray);return this.fable.DataFormat.formatterDollars(tmpColumnData);}}]);}(libPictTemplate);module.exports=PictTemplateProviderDollars;},{"pict-template":118}],188:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderJoin=/*#__PURE__*/function(_libPictTemplate16){/**
|
|
5020
5042
|
* @param {Object} pFable - The Fable Framework instance
|
|
5021
5043
|
* @param {Object} pOptions - The options for the service
|
|
5022
5044
|
* @param {String} pServiceHash - The hash of the service
|
|
5023
|
-
*/function PictTemplateProviderJoin(pFable,pOptions,pServiceHash){var
|
|
5045
|
+
*/function PictTemplateProviderJoin(pFable,pOptions,pServiceHash){var _this94;_classCallCheck2(this,PictTemplateProviderJoin);_this94=_callSuper(this,PictTemplateProviderJoin,[pFable,pOptions,pServiceHash]);_this94.addPattern('{~Join:','~}');_this94.addPattern('{~J:','~}');return _this94;}_inherits(PictTemplateProviderJoin,_libPictTemplate16);return _createClass2(PictTemplateProviderJoin,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash;var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Join [fDataRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Join [fDataRender]::[".concat(tmpHash,"]"));}var tmpDataAddresses=tmpHash.split('^');if(tmpDataAddresses.length<2){return'';}// Get the separator string
|
|
5024
5046
|
var tmpSeparator=tmpDataAddresses.shift();var tmpValueList=[];for(var i=0;i<tmpDataAddresses.length;i++){var tmpValueSet=this.resolveStateFromAddress(tmpDataAddresses[i],tmpData,pContextArray);if(tmpValueSet&&Array.isArray(tmpValueSet)){for(var j=0;j<tmpValueSet.length;j++){tmpValueList.push(tmpValueSet[j]);}}else if(tmpValueSet){tmpValueList.push(tmpValueSet);}}return tmpValueList.join(tmpSeparator);}}]);}(libPictTemplate);module.exports=PictTemplateProviderJoin;},{"pict-template":118}],189:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderJoinUnique=/*#__PURE__*/function(_libPictTemplate17){/**
|
|
5025
5047
|
* @param {Object} pFable - The Fable Framework instance
|
|
5026
5048
|
* @param {Object} pOptions - The options for the service
|
|
5027
5049
|
* @param {String} pServiceHash - The hash of the service
|
|
5028
|
-
*/function PictTemplateProviderJoinUnique(pFable,pOptions,pServiceHash){var
|
|
5050
|
+
*/function PictTemplateProviderJoinUnique(pFable,pOptions,pServiceHash){var _this95;_classCallCheck2(this,PictTemplateProviderJoinUnique);_this95=_callSuper(this,PictTemplateProviderJoinUnique,[pFable,pOptions,pServiceHash]);_this95.addPattern('{~JoinUnique:','~}');_this95.addPattern('{~JU:','~}');return _this95;}_inherits(PictTemplateProviderJoinUnique,_libPictTemplate17);return _createClass2(PictTemplateProviderJoinUnique,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash;var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Join Unique [fDataRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Join Unique [fDataRender]::[".concat(tmpHash,"]"));}var tmpDataAddresses=tmpHash.split('^');if(tmpDataAddresses.length<2){return'';}// Get the separator string
|
|
5029
5051
|
var tmpSeparator=tmpDataAddresses.shift();var tmpValueList=[];var tmpValueMap={};for(var i=0;i<tmpDataAddresses.length;i++){var tmpValueSet=this.resolveStateFromAddress(tmpDataAddresses[i],tmpData,pContextArray);if(tmpValueSet&&Array.isArray(tmpValueSet)){for(var j=0;j<tmpValueSet.length;j++){if(!(tmpValueSet[j]in tmpValueMap)){tmpValueMap[tmpValueSet[j]]=true;tmpValueList.push(tmpValueSet[j]);}}}else if(tmpValueSet){if(!(tmpValueSet in tmpValueMap)){tmpValueMap[tmpValueSet]=true;tmpValueList.push(tmpValueSet);}}}return tmpValueList.join(tmpSeparator);}}]);}(libPictTemplate);module.exports=PictTemplateProviderJoinUnique;},{"pict-template":118}],190:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderPascalCaseIdentifier=/*#__PURE__*/function(_libPictTemplate18){/**
|
|
5030
5052
|
* @param {Object} pFable - The Fable Framework instance
|
|
5031
5053
|
* @param {Object} pOptions - The options for the service
|
|
5032
5054
|
* @param {String} pServiceHash - The hash of the service
|
|
5033
|
-
*/function PictTemplateProviderPascalCaseIdentifier(pFable,pOptions,pServiceHash){var
|
|
5055
|
+
*/function PictTemplateProviderPascalCaseIdentifier(pFable,pOptions,pServiceHash){var _this96;_classCallCheck2(this,PictTemplateProviderPascalCaseIdentifier);_this96=_callSuper(this,PictTemplateProviderPascalCaseIdentifier,[pFable,pOptions,pServiceHash]);_this96.addPattern('{~PascalCaseIdentifier:','~}');return _this96;}_inherits(PictTemplateProviderPascalCaseIdentifier,_libPictTemplate18);return _createClass2(PictTemplateProviderPascalCaseIdentifier,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fPascalCaseIdentifier]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fPascalCaseIdentifier]::[".concat(tmpHash,"]"));}var tmpValue=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray);if(tmpValue==null||tmpValue=='undefined'||typeof tmpValue=='undefined'){return'';}return this.pict.DataFormat.cleanNonAlphaCharacters(this.pict.DataFormat.capitalizeEachWord(tmpValue));}}]);}(libPictTemplate);module.exports=PictTemplateProviderPascalCaseIdentifier;/*
|
|
5034
5056
|
# DEAR DEAD CODE DIARY:
|
|
5035
5057
|
|
|
5036
5058
|
```javascript
|
|
@@ -5040,31 +5062,31 @@ var tmpSeparator=tmpDataAddresses.shift();var tmpValueList=[];var tmpValueMap={}
|
|
|
5040
5062
|
* @param {Object} pFable - The Fable Framework instance
|
|
5041
5063
|
* @param {Object} pOptions - The options for the service
|
|
5042
5064
|
* @param {String} pServiceHash - The hash of the service
|
|
5043
|
-
*/function PictTemplateProviderBreakpoint(pFable,pOptions,pServiceHash){var
|
|
5065
|
+
*/function PictTemplateProviderBreakpoint(pFable,pOptions,pServiceHash){var _this97;_classCallCheck2(this,PictTemplateProviderBreakpoint);_this97=_callSuper(this,PictTemplateProviderBreakpoint,[pFable,pOptions,pServiceHash]);_this97.addPattern('{~Breakpoint','~}');return _this97;}_inherits(PictTemplateProviderBreakpoint,_libPictTemplate19);return _createClass2(PictTemplateProviderBreakpoint,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpError=new Error("PICT Template Breakpoint: ".concat(tmpHash));this.log.trace("PICT Template Breakpoint: ".concat(tmpHash),tmpError.stack);//throw tmpError;
|
|
5044
5066
|
debugger;// eslint-disable-line no-debugger
|
|
5045
5067
|
return'';}}]);}(libPictTemplate);module.exports=PictTemplateProviderBreakpoint;},{"pict-template":118}],192:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderDataValueTree=/*#__PURE__*/function(_libPictTemplate20){/**
|
|
5046
5068
|
* @param {Object} pFable - The Fable Framework instance
|
|
5047
5069
|
* @param {Object} pOptions - The options for the service
|
|
5048
5070
|
* @param {String} pServiceHash - The hash of the service
|
|
5049
|
-
*/function PictTemplateProviderDataValueTree(pFable,pOptions,pServiceHash){var
|
|
5071
|
+
*/function PictTemplateProviderDataValueTree(pFable,pOptions,pServiceHash){var _this98;_classCallCheck2(this,PictTemplateProviderDataValueTree);_this98=_callSuper(this,PictTemplateProviderDataValueTree,[pFable,pOptions,pServiceHash]);_this98.addPattern('{~DataTree:','~}');_this98.addPattern('{~DT:','~}');return _this98;}_inherits(PictTemplateProviderDataValueTree,_libPictTemplate20);return _createClass2(PictTemplateProviderDataValueTree,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpData=_typeof(pRecord)==='object'?pRecord:{};tmpData.TemplateHash=pTemplateHash.trim();tmpData.ValueTreeParameters=tmpData.TemplateHash.split('^');if(tmpData.ValueTreeParameters.length<1){return'';}tmpData.ResolvedValue=this.resolveStateFromAddress(tmpData.ValueTreeParameters[0],tmpData,pContextArray);tmpData.ResolvedValueType=_typeof(tmpData.ResolvedValue);try{tmpData.TreeMaxDepth=tmpData.ValueTreeParameters.length<2?1:parseInt(tmpData.ValueTreeParameters[1]);}catch(_unused8){tmpData.TreeMaxDepth=1;}var tmpPictObjectWrapTemplate=this.pict.TemplateProvider.getTemplate('PICT-Object-Wrap');if(!tmpPictObjectWrapTemplate){// This template is here because it is a default template. Users can override this template by providing their own as PICT-Object-Wrap
|
|
5050
5072
|
tmpPictObjectWrapTemplate="<div class=\"PICT PICTObjectSet\">{~D:Record.ObjectValueTree~}</div>";}if(tmpData.ResolvedValueType=='object'){tmpData.ObjectValueTree=this.dataValueTreeObjectSet(tmpData.ResolvedValue,tmpData.ResolvedValue,0,tmpData.TreeMaxDepth,pContextArray);}else{this.log.trace("PICT Template Log Value Tree: [".concat(tmpData.TemplateHash,"] resolved data is not an object."),tmpData.ResolvedValue);tmpData.ObjectValueTree=tmpData.ResolveValue;}return this.pict.parseTemplate(tmpPictObjectWrapTemplate,tmpData,null,pContextArray);}},{key:"dataValueTreeObjectSet",value:function dataValueTreeObjectSet(pObject,pRootObject,pCurrentDepth,pMaxDepth,pContextArray){var tmpTemplateResult='';if(_typeof(pObject)!=='object'){return tmpTemplateResult;}var tmpObjectValueKeys=Object.keys(pObject);var tmpPictObjectBranchTemplate=this.pict.TemplateProvider.getTemplate('PICT-Object-Branch');if(!tmpPictObjectBranchTemplate){// This template is here because it is a default template. Users can override this template by providing their own as PICT-Object-Branch
|
|
5051
5073
|
tmpPictObjectBranchTemplate="\n<div class=\"PICTObjectBranchDepth_{~D:Record.CurrentDepth~}\"><div class=\"PICTObjectBranch\">{~D:Record.BranchKey~}</div><div class=\"PICTObjectBranchValue\">{~D:Record.BranchValue~}</div></div>\n";}for(var i=0;i<tmpObjectValueKeys.length;i++){var tmpBranchType=_typeof(pObject[tmpObjectValueKeys[i]]);var tmpBranchValue='';switch(tmpBranchType){case'object':if(pCurrentDepth+1>pMaxDepth){tmpBranchValue='...';}else{tmpBranchValue=this.dataValueTreeObjectSet(pObject[tmpObjectValueKeys[i]],pRootObject,pCurrentDepth+1,pMaxDepth,pContextArray);}break;default:tmpBranchValue=pObject[tmpObjectValueKeys[i]];break;}var tmpDataValue={AppData:this.AppData,Bundle:this.Bundle,RootContainer:pRootObject,Container:pObject,BranchEntryCount:tmpObjectValueKeys.length,BranchIndex:i,BranchKey:tmpObjectValueKeys[i],BranchValue:tmpBranchValue,BranchDataType:tmpBranchType,CurrentDepth:pCurrentDepth,MaxDepth:pMaxDepth};tmpTemplateResult+=this.pict.parseTemplate(tmpPictObjectBranchTemplate,tmpDataValue,null,pContextArray);}return tmpTemplateResult;}}]);}(libPictTemplate);module.exports=PictTemplateProviderDataValueTree;},{"pict-template":118}],193:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderLogStatement=/*#__PURE__*/function(_libPictTemplate21){/**
|
|
5052
5074
|
* @param {Object} pFable - The Fable Framework instance
|
|
5053
5075
|
* @param {Object} pOptions - The options for the service
|
|
5054
5076
|
* @param {String} pServiceHash - The hash of the service
|
|
5055
|
-
*/function PictTemplateProviderLogStatement(pFable,pOptions,pServiceHash){var
|
|
5077
|
+
*/function PictTemplateProviderLogStatement(pFable,pOptions,pServiceHash){var _this99;_classCallCheck2(this,PictTemplateProviderLogStatement);_this99=_callSuper(this,PictTemplateProviderLogStatement,[pFable,pOptions,pServiceHash]);_this99.addPattern('{~LogStatement:','~}');_this99.addPattern('{~LS:','~}');return _this99;}_inherits(PictTemplateProviderLogStatement,_libPictTemplate21);return _createClass2(PictTemplateProviderLogStatement,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();this.log.trace("PICT Template Log Message: ".concat(tmpHash));return'';}}]);}(libPictTemplate);module.exports=PictTemplateProviderLogStatement;},{"pict-template":118}],194:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderLogValue=/*#__PURE__*/function(_libPictTemplate22){/**
|
|
5056
5078
|
* @param {Object} pFable - The Fable Framework instance
|
|
5057
5079
|
* @param {Object} pOptions - The options for the service
|
|
5058
5080
|
* @param {String} pServiceHash - The hash of the service
|
|
5059
|
-
*/function PictTemplateProviderLogValue(pFable,pOptions,pServiceHash){var
|
|
5081
|
+
*/function PictTemplateProviderLogValue(pFable,pOptions,pServiceHash){var _this100;_classCallCheck2(this,PictTemplateProviderLogValue);_this100=_callSuper(this,PictTemplateProviderLogValue,[pFable,pOptions,pServiceHash]);_this100.addPattern('{~LogValue:','~}');_this100.addPattern('{~LV:','~}');return _this100;}_inherits(PictTemplateProviderLogValue,_libPictTemplate22);return _createClass2(PictTemplateProviderLogValue,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpValue=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray);var tmpValueType=_typeof(tmpValue);if(tmpValue==null||tmpValueType=='undefined'){this.log.trace("PICT Template Log Value: [".concat(tmpHash,"] is ").concat(tmpValueType,"."));}else if(tmpValueType=='object'){this.log.trace("PICT Template Log Value: [".concat(tmpHash,"] is an object."),tmpValue);}else{this.log.trace("PICT Template Log Value: [".concat(tmpHash,"] is a ").concat(tmpValueType," = [").concat(tmpValue,"]"));}return'';}}]);}(libPictTemplate);module.exports=PictTemplateProviderLogValue;},{"pict-template":118}],195:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderLogValueTree=/*#__PURE__*/function(_libPictTemplate23){/**
|
|
5060
5082
|
* @param {Object} pFable - The Fable Framework instance
|
|
5061
5083
|
* @param {Object} pOptions - The options for the service
|
|
5062
5084
|
* @param {String} pServiceHash - The hash of the service
|
|
5063
|
-
*/function PictTemplateProviderLogValueTree(pFable,pOptions,pServiceHash){var
|
|
5085
|
+
*/function PictTemplateProviderLogValueTree(pFable,pOptions,pServiceHash){var _this101;_classCallCheck2(this,PictTemplateProviderLogValueTree);_this101=_callSuper(this,PictTemplateProviderLogValueTree,[pFable,pOptions,pServiceHash]);_defineProperty2(_this101,"logValueTreeObjectSet",function(pObject,pBaseAddress,pRootObject,pCurrentDepth,pMaxDepth){var tmpTemplateResult='';if(_typeof(pObject)!=='object'){return tmpTemplateResult;}var tmpObjectValueKeys=Object.keys(pObject);for(var i=0;i<tmpObjectValueKeys.length;i++){var tmpBranchType=_typeof(pObject[tmpObjectValueKeys[i]]);var tmpBranchValue='';switch(tmpBranchType){case'object':tmpBranchValue='...';break;default:tmpBranchValue=pObject[tmpObjectValueKeys[i]];break;}_this101.log.trace("[".concat(pBaseAddress,".").concat(tmpObjectValueKeys[i],"] (").concat(tmpBranchType,"): ").concat(tmpBranchValue));if(pCurrentDepth+1>pMaxDepth){return'';}else if(tmpBranchType=='object'){tmpBranchValue=_this101.logValueTreeObjectSet(pObject[tmpObjectValueKeys[i]],"".concat(pBaseAddress,".").concat(tmpObjectValueKeys[i]),pRootObject,pCurrentDepth+1,pMaxDepth);}}return'';});_this101.addPattern('{~LogValueTree:','~}');_this101.addPattern('{~LVT:','~}');return _this101;}_inherits(PictTemplateProviderLogValueTree,_libPictTemplate23);return _createClass2(PictTemplateProviderLogValueTree,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpData=_typeof(pRecord)==='object'?pRecord:{};tmpData.TemplateHash=pTemplateHash.trim();tmpData.ValueTreeParameters=tmpData.TemplateHash.split('^');if(tmpData.ValueTreeParameters.length<1){return'';}tmpData.ResolvedValue=this.resolveStateFromAddress(tmpData.ValueTreeParameters[0],tmpData,pContextArray);tmpData.ResolvedValueType=_typeof(tmpData.ResolvedValue);try{tmpData.TreeMaxDepth=tmpData.ValueTreeParameters.length<2?1:parseInt(tmpData.ValueTreeParameters[1]);}catch(_unused9){tmpData.TreeMaxDepth=1;}if(tmpData.ResolvedValueType=='object'){this.logValueTreeObjectSet(tmpData.ResolvedValue,tmpData.ValueTreeParameters[0],tmpData.ResolvedValue,0,tmpData.TreeMaxDepth);}else{this.log.trace("PICT Template Log Value Tree: [".concat(tmpData.TemplateHash,"] resolved data is not an object."),tmpData.ResolvedValue);}return'';}}]);}(libPictTemplate);module.exports=PictTemplateProviderLogValueTree;},{"pict-template":118}],196:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderNotEmpty=/*#__PURE__*/function(_libPictTemplate24){/**
|
|
5064
5086
|
* @param {Object} pFable - The Fable Framework instance
|
|
5065
5087
|
* @param {Object} pOptions - The options for the service
|
|
5066
5088
|
* @param {String} pServiceHash - The hash of the service
|
|
5067
|
-
*/function PictTemplateProviderNotEmpty(pFable,pOptions,pServiceHash){var
|
|
5089
|
+
*/function PictTemplateProviderNotEmpty(pFable,pOptions,pServiceHash){var _this102;_classCallCheck2(this,PictTemplateProviderNotEmpty);_this102=_callSuper(this,PictTemplateProviderNotEmpty,[pFable,pOptions,pServiceHash]);_this102.addPattern('{~NotEmpty:','~}');_this102.addPattern('{~NE:','~}');return _this102;}_inherits(PictTemplateProviderNotEmpty,_libPictTemplate24);return _createClass2(PictTemplateProviderNotEmpty,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fNotEmptyRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>2){this.log.trace("PICT Template [fNotEmptyRender]::[".concat(tmpHash,"]"));}var tmpHashParts=tmpHash.split('^');// For now just check truthiness. Not sure if this is grand.
|
|
5068
5090
|
if(this.resolveStateFromAddress(tmpHashParts[0],tmpData,pContextArray)){return tmpHashParts[1];}else{return'';}}}]);}(libPictTemplate);module.exports=PictTemplateProviderNotEmpty;},{"pict-template":118}],197:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderTemplateIfBase=/*#__PURE__*/function(_libPictTemplate25){/**
|
|
5069
5091
|
* @param {Object} pFable - The Fable Framework instance
|
|
5070
5092
|
* @param {Object} pOptions - The options for the service
|
|
@@ -5073,7 +5095,7 @@ if(this.resolveStateFromAddress(tmpHashParts[0],tmpData,pContextArray)){return t
|
|
|
5073
5095
|
* @param {Object} pFable - The Fable Framework instance
|
|
5074
5096
|
* @param {Object} pOptions - The options for the service
|
|
5075
5097
|
* @param {String} pServiceHash - The hash of the service
|
|
5076
|
-
*/function PictTemplateProviderTemplateIf(pFable,pOptions,pServiceHash){var
|
|
5098
|
+
*/function PictTemplateProviderTemplateIf(pFable,pOptions,pServiceHash){var _this103;_classCallCheck2(this,PictTemplateProviderTemplateIf);_this103=_callSuper(this,PictTemplateProviderTemplateIf,[pFable,pOptions,pServiceHash]);_this103.addPattern('{~TemplateIf:','~}');_this103.addPattern('{~TIf:','~}');return _this103;}_inherits(PictTemplateProviderTemplateIf,_libPictTemplateIf);return _createClass2(PictTemplateProviderTemplateIf,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateIfAbsoluteValueRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateIfAbsoluteValueRender]::[".concat(tmpHash,"]"));}var tmpTemplateHash=false;var tmpAddressOfData=false;var tmpComparisonOperation=false;var tmpHashParts=tmpHash.split(':');if(tmpHashParts.length<3){this.log.warn("Pict: Template If Absolute Value Render: TemplateHash not complete for [".concat(tmpHash,"]"));return"Pict: Template If Absolute Value Render: TemplateHash not complete for [".concat(tmpHash,"]");}tmpTemplateHash=tmpHashParts[0];tmpAddressOfData=tmpHashParts[1];tmpComparisonOperation=tmpHashParts[2];// No template hash
|
|
5077
5099
|
if(!tmpTemplateHash){this.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]");}// No comparison operation
|
|
5078
5100
|
if(!tmpComparisonOperation){this.log.warn("Pict: Template Render: Comparison Operation not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: Comparison Operation not resolved for [".concat(tmpHash,"]");}// Now try to break the comparison into three parts...
|
|
5079
5101
|
var tmpComparisonParts=tmpComparisonOperation.split('^');if(tmpComparisonParts.length<3){this.log.warn("Pict: Template Render: Comparison Operation not complete (three parts expected) for [".concat(tmpHash,"]"));return"Pict: Template Render: Comparison Operation not complete (three parts expected) for [".concat(tmpHash,"]");}// Now look up the data at the comparison location
|
|
@@ -5087,7 +5109,7 @@ var tmpComparisonResult=this.compareValues(this.resolveStateFromAddress(tmpCompa
|
|
|
5087
5109
|
* @param {Object} pFable - The Fable Framework instance
|
|
5088
5110
|
* @param {Object} pOptions - The options for the service
|
|
5089
5111
|
* @param {String} pServiceHash - The hash of the service
|
|
5090
|
-
*/function PictTemplateProviderTemplateIfAbsolute(pFable,pOptions,pServiceHash){var
|
|
5112
|
+
*/function PictTemplateProviderTemplateIfAbsolute(pFable,pOptions,pServiceHash){var _this104;_classCallCheck2(this,PictTemplateProviderTemplateIfAbsolute);_this104=_callSuper(this,PictTemplateProviderTemplateIfAbsolute,[pFable,pOptions,pServiceHash]);_this104.addPattern('{~TemplateIfAbsolute:','~}');_this104.addPattern('{~TIfAbs:','~}');return _this104;}_inherits(PictTemplateProviderTemplateIfAbsolute,_libPictTemplateIf2);return _createClass2(PictTemplateProviderTemplateIfAbsolute,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateIfAbsoluteValueRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateIfAbsoluteValueRender]::[".concat(tmpHash,"]"));}var tmpTemplateHash=false;var tmpAddressOfData=false;var tmpComparisonOperation=false;var tmpHashParts=tmpHash.split(':');if(tmpHashParts.length<3){this.log.warn("Pict: Template If Absolute Value Render: TemplateHash not complete for [".concat(tmpHash,"]"));return"Pict: Template If Absolute Value Render: TemplateHash not complete for [".concat(tmpHash,"]");}tmpTemplateHash=tmpHashParts[0];tmpAddressOfData=tmpHashParts[1];tmpComparisonOperation=tmpHashParts[2];// No template hash
|
|
5091
5113
|
if(!tmpTemplateHash){this.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]");}// No comparison operation
|
|
5092
5114
|
if(!tmpComparisonOperation){this.log.warn("Pict: Template Render: Comparison Operation not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: Comparison Operation not resolved for [".concat(tmpHash,"]");}// Now try to break the comparison into three parts...
|
|
5093
5115
|
var tmpComparisonParts=tmpComparisonOperation.split('^');if(tmpComparisonParts.length<3){this.log.warn("Pict: Template Render: Comparison Operation not complete (three parts expected) for [".concat(tmpHash,"]"));return"Pict: Template Render: Comparison Operation not complete (three parts expected) for [".concat(tmpHash,"]");}// Now look up the data at the comparison location
|