pict 1.0.113 → 1.0.115
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 +232 -174
- package/dist/pict.compatible.min.js +2 -2
- package/dist/pict.compatible.min.js.map +1 -1
- package/dist/pict.js +156 -98
- package/dist/pict.min.js +2 -2
- package/dist/pict.min.js.map +1 -1
- package/package.json +3 -3
package/dist/pict.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";function _defineProperty2(e,t,r){return(t=_toPropertyKey2(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey2(e){var t=_toPrimitive2(e,"string");return"symbol"==typeof t?t:String(t)}function _toPrimitive2(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Pict=e()}}((function(){return function e(t,r,n){function i(o,a){if(!r[o]){if(!t[o]){var c="function"==typeof require&&require;if(!a&&c)return c(o,!0);if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var h=r[o]={exports:{}};t[o][0].call(h.exports,(function(e){return i(t[o][1][e]||e)}),h,h.exports,e,t,r,n)}return r[o].exports}for(var s="function"==typeof require&&require,o=0;o<n.length;o++)i(n[o]);return i}({1:[function(e,t,r){var n=e("async.util.eachoflimit"),i=e("async.util.withoutindex");t.exports=function(e,t,r,s){return n(t)(e,i(r),s)}},{"async.util.eachoflimit":3,"async.util.withoutindex":14}],2:[function(e,t,r){t.exports=function(e){return function t(r){function n(){return e.length&&e[r].apply(null,arguments),n.next()}return n.next=function(){return r<e.length-1?t(r+1):null},n}(0)}},{}],3:[function(e,t,r){var n=e("async.util.once"),i=e("async.util.noop"),s=e("async.util.onlyonce"),o=e("async.util.keyiterator");t.exports=function(e){return function(t,r,a){a=n(a||i);var c=o(t=t||[]);if(e<=0)return a(null);var l=!1,h=0,u=!1;!function n(){if(l&&h<=0)return a(null);for(;h<e&&!u;){var i=c();if(null===i)return l=!0,void(h<=0&&a(null));h+=1,r(t[i],i,s((function(e){h-=1,e?(a(e),u=!0):n()})))}}()}}},{"async.util.keyiterator":7,"async.util.noop":9,"async.util.once":10,"async.util.onlyonce":11}],4:[function(e,t,r){var n=e("async.util.setimmediate"),i=e("async.util.restparam");t.exports=function(e){return i((function(t){var r=t.pop();t.push((function(){var e=arguments;i?n((function(){r.apply(null,e)})):r.apply(null,e)}));var i=!0;e.apply(this,t),i=!1}))}},{"async.util.restparam":12,"async.util.setimmediate":13}],5:[function(e,t,r){t.exports=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],6:[function(e,t,r){var n=e("async.util.isarray");t.exports=function(e){return n(e)||"number"==typeof e.length&&e.length>=0&&e.length%1==0}},{"async.util.isarray":5}],7:[function(e,t,r){var n=e("async.util.keys"),i=e("async.util.isarraylike");t.exports=function(e){var t,r,s=-1;return i(e)?(t=e.length,function(){return++s<t?s:null}):(r=n(e),t=r.length,function(){return++s<t?r[s]:null})}},{"async.util.isarraylike":6,"async.util.keys":8}],8:[function(e,t,r){t.exports=Object.keys||function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r);return t}},{}],9:[function(e,t,r){t.exports=function(){}},{}],10:[function(e,t,r){t.exports=function(e){return function(){null!==e&&(e.apply(this,arguments),e=null)}}},{}],11:[function(e,t,r){t.exports=function(e){return function(){if(null===e)throw new Error("Callback was already called.");e.apply(this,arguments),e=null}}},{}],12:[function(e,t,r){t.exports=function(e,t){return t=null==t?e.length-1:+t,function(){for(var r=Math.max(arguments.length-t,0),n=new Array(r),i=0;i<r;i++)n[i]=arguments[i+t];switch(t){case 0:return e.call(this,n);case 1:return e.call(this,arguments[0],n)}}}},{}],13:[function(e,t,r){(function(e){(function(){var r="function"==typeof e&&e,n=function(e){setTimeout(e,0)};t.exports=function(e){return(r||n)(e)}}).call(this)}).call(this,e("timers").setImmediate)},{timers:105}],14:[function(e,t,r){t.exports=function(e){return function(t,r,n){return e(t,n)}}},{}],15:[function(e,t,r){var n=e("async.util.once"),i=e("async.util.noop"),s=e("async.util.isarray"),o=e("async.util.restparam"),a=e("async.util.ensureasync"),c=e("async.iterator");t.exports=function(e,t){if(t=n(t||i),!s(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();!function e(r){return o((function(n,i){if(n)t.apply(null,[n].concat(i));else{var s=r.next();s?i.push(e(s)):i.push(t),a(r).apply(null,i)}}))}(c(e))()}},{"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(e,t,r){r.byteLength=function(e){var t=c(e),r=t[0],n=t[1];return 3*(r+n)/4-n},r.toByteArray=function(e){var t,r,n=c(e),o=n[0],a=n[1],l=new s(function(e,t,r){return 3*(t+r)/4-r}(0,o,a)),h=0,u=a>0?o-4:o;for(r=0;r<u;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],l[h++]=t>>16&255,l[h++]=t>>8&255,l[h++]=255&t;2===a&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,l[h++]=255&t);1===a&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,l[h++]=t>>8&255,l[h++]=255&t);return l},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,s=[],o=16383,a=0,c=r-i;a<c;a+=o)s.push(l(e,a,a+o>c?c:a+o));1===i?(t=e[r-1],s.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],s.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return s.join("")};for(var n=[],i=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)n[a]=o[a],i[o.charCodeAt(a)]=a;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,r){for(var i,s,o=[],a=t;a<r;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(n[(s=i)>>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],17:[function(e,t,r){},{}],18:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{dup:17}],19:[function(e,t,r){(function(t){(function(){var t=e("base64-js"),n=e("ieee754");r.Buffer=o,r.SlowBuffer=function(e){+e!=e&&(e=0);return o.alloc(+e)},r.INSPECT_MAX_BYTES=50;var i=2147483647;function s(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=o.prototype,t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return a(e,t,r)}function a(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|f(e,t),n=s(r),i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return h(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(F(e,ArrayBuffer)||e&&F(e.buffer,ArrayBuffer))return function(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r);return n.__proto__=o.prototype,n}(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return o.from(n,t,r);var i=function(e){if(o.isBuffer(e)){var t=0|u(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||H(e.length)?s(0):h(e);if("Buffer"===e.type&&Array.isArray(e.data))return h(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return c(e),s(e<0?0:0|u(e))}function h(e){for(var t=e.length<0?0:0|u(e.length),r=s(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function u(e){if(e>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function f(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||F(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return U(e).length;default:if(i)return n?-1:B(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return A(this,t,r);case"ascii":return E(this,t,r);case"latin1":case"binary":return C(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function d(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),H(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:m(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,n,i){var s,o=1,a=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,a/=2,c/=2,r/=2}function l(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var h=-1;for(s=r;s<a;s++)if(l(e,s)===l(t,-1===h?0:s-h)){if(-1===h&&(h=s),s-h+1===c)return h*o}else-1!==h&&(s-=s-h),h=-1}else for(r+c>a&&(r=a-c),s=r;s>=0;s--){for(var u=!0,f=0;f<c;f++)if(l(e,s+f)!==l(t,f)){u=!1;break}if(u)return s}return-1}function y(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var s=t.length;n>s/2&&(n=s/2);for(var o=0;o<n;++o){var a=parseInt(t.substr(2*o,2),16);if(H(a))return o;e[r+o]=a}return o}function b(e,t,r,n){return k(B(t,e.length-r),e,r,n)}function v(e,t,r,n){return k(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function w(e,t,r,n){return v(e,t,r,n)}function S(e,t,r,n){return k(U(t),e,r,n)}function P(e,t,r,n){return k(function(e,t){for(var r,n,i,s=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,i=r%256,s.push(i),s.push(n);return s}(t,e.length-r),e,r,n)}function T(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function A(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var s,o,a,c,l=e[i],h=null,u=l>239?4:l>223?3:l>191?2:1;if(i+u<=r)switch(u){case 1:l<128&&(h=l);break;case 2:128==(192&(s=e[i+1]))&&(c=(31&l)<<6|63&s)>127&&(h=c);break;case 3:s=e[i+1],o=e[i+2],128==(192&s)&&128==(192&o)&&(c=(15&l)<<12|(63&s)<<6|63&o)>2047&&(c<55296||c>57343)&&(h=c);break;case 4:s=e[i+1],o=e[i+2],a=e[i+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(c=(15&l)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&c<1114112&&(h=c)}null===h?(h=65533,u=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=u}return function(e){var t=e.length;if(t<=_)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=_));return r}(n)}r.kMaxLength=i,o.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}(),o.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),o.poolSize=8192,o.from=function(e,t,r){return a(e,t,r)},o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,o.alloc=function(e,t,r){return function(e,t,r){return c(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)}(e,t,r)},o.allocUnsafe=function(e){return l(e)},o.allocUnsafeSlow=function(e){return l(e)},o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(F(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),F(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=o.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var s=e[r];if(F(s,Uint8Array)&&(s=o.from(s)),!o.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},o.byteLength=f,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)d(this,t,t+1);return this},o.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)d(this,t,t+3),d(this,t+1,t+2);return this},o.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)d(this,t,t+7),d(this,t+1,t+6),d(this,t+2,t+5),d(this,t+3,t+4);return this},o.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?A(this,0,e):p.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",t=r.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},o.prototype.compare=function(e,t,r,n,i){if(F(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var s=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),c=Math.min(s,a),l=this.slice(n,i),h=e.slice(t,r),u=0;u<c;++u)if(l[u]!==h[u]){s=l[u],a=h[u];break}return s<a?-1:a<s?1:0},o.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)},o.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return y(this,e,t,r);case"utf8":case"utf-8":return b(this,e,t,r);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return w(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var _=4096;function E(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function C(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function O(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",s=t;s<r;++s)i+=N(e[s]);return i}function M(e,t,r){for(var n=e.slice(t,r),i="",s=0;s<n.length;s+=2)i+=String.fromCharCode(n[s]+256*n[s+1]);return i}function D(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function x(e,t,r,n,i,s){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function R(e,t,r,n,i,s){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(e,t,r,i,s){return t=+t,r>>>=0,s||R(e,0,r,4),n.write(e,t,r,i,23,4),r+4}function I(e,t,r,i,s){return t=+t,r>>>=0,s||R(e,0,r,8),n.write(e,t,r,i,52,8),r+8}o.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return n.__proto__=o.prototype,n},o.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=this[e],i=1,s=0;++s<t&&(i*=256);)n+=this[e+s]*i;return n},o.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},o.prototype.readUInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=this[e],i=1,s=0;++s<t&&(i*=256);)n+=this[e+s]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=t,i=1,s=this[e+--n];n>0&&(i*=256);)s+=this[e+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*t)),s},o.prototype.readInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||D(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(e,t){e>>>=0,t||D(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||D(e,4,this.length),n.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||D(e,4,this.length),n.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||D(e,8,this.length),n.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||D(e,8,this.length),n.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||x(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,s=0;for(this[t]=255&e;++s<r&&(i*=256);)this[t+s]=e/i&255;return t+r},o.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||x(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+r},o.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);x(this,e,t,r,i-1,-i)}var s=0,o=1,a=0;for(this[t]=255&e;++s<r&&(o*=256);)e<0&&0===a&&0!==this[t+s-1]&&(a=1),this[t+s]=(e/o>>0)-a&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);x(this,e,t,r,i-1,-i)}var s=r-1,o=1,a=0;for(this[t+s]=255&e;--s>=0&&(o*=256);)e<0&&0===a&&0!==this[t+s+1]&&(a=1),this[t+s]=(e/o>>0)-a&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,r){return j(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return j(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return I(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return I(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var s=i-1;s>=0;--s)e[s+t]=this[s+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return i},o.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var i=e.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(e=i)}}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var s;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(s=t;s<r;++s)this[s]=e;else{var a=o.isBuffer(e)?e:o.from(e,n),c=a.length;if(0===c)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<r-t;++s)this[s+t]=a[s%c]}return this};var L=/[^+/0-9A-Za-z-_]/g;function N(e){return e<16?"0"+e.toString(16):e.toString(16)}function B(e,t){var r;t=t||1/0;for(var n=e.length,i=null,s=[],o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function U(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function k(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function F(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function H(e){return e!=e}}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":16,buffer:19,ieee754:57}],20:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],21:[function(e,t,r){const n=e("fable-serviceproviderbase"),i=e("./LinkedList.js");t.exports=class extends n{constructor(e,t,r){void 0===e?super({}):super(e,t,r),this.serviceType="ObjectCache",this._HashMap={},this._RecordMap={},this._List=new i,this.maxLength=0,this.maxAge=0}get RecordMap(){return this._RecordMap}put(e,t){if(this._HashMap.hasOwnProperty(t))return this._HashMap[t].Datum=e,this._RecordMap[t]=e,this._HashMap[t].Datum;let r=this._List.push(e,t);return this._HashMap[r.Hash]=r,this._RecordMap[t]=e,this.maxLength>0&&this._List.length>this.maxLength&&(r=this._List.pop(),delete this._RecordMap[r.Hash],delete this._HashMap[r.Hash]),r.Metadata.Created=+new Date,r.Datum}read(e){return!!this._HashMap.hasOwnProperty(e)&&this._HashMap[e].Datum}touch(e){if(!this._HashMap.hasOwnProperty(e))return!1;let t=this._List.remove(this._HashMap[e]);return delete this._RecordMap[e],delete this._HashMap[e],this.put(t.Datum,t.Hash)}expire(e){if(!this._HashMap.hasOwnProperty(e))return!1;let t=this._HashMap[e];return t=this._List.remove(t),delete this._RecordMap[t.Hash],delete this._HashMap[t.Hash],t}pruneBasedOnExpiration(e,t){let r=void 0===t?[]:t;if(this.maxAge<1)return e(r);let n=+new Date,i=Object.keys(this._HashMap);for(let e=0;e<i.length;e++)n-this._HashMap[i[e]].Metadata.Created>=this.maxAge&&r.push(this.expire(i[e]));e(r)}pruneBasedOnLength(e,t){let r=void 0===t?[]:t;if(this.maxLength>0)for(;this._List.length>this.maxLength;)r.push(this._List.pop());return e(r)}pruneCustom(e,t,r){let n=void 0===r?[]:r,i=Object.keys(this._HashMap);for(let e=0;e<i.length;e++){let r=this._HashMap[i[e]];t(r.Datum,r.Hash,r)&&n.push(this.expire(i[e]))}e(n)}prune(e){let t=[];if(this._List.length<1)return e(t);this.pruneBasedOnExpiration((r=>{this.pruneBasedOnLength(e,t)}),t)}getNode(e){return!!this._HashMap.hasOwnProperty(e)&&this._HashMap[e]}}},{"./LinkedList.js":23,"fable-serviceproviderbase":33}],22:[function(e,t,r){t.exports=class{constructor(){this.Hash=!1,this.Datum=!1,this.Metadata={},this.LeftNode=!1,this.RightNode=!1,this.__ISNODE=!0}}},{}],23:[function(e,t,r){const n=e("./LinkedList-Node.js");t.exports=class{constructor(){this.totalNodes=0,this.length=0,this.head=!1,this.tail=!1}initializeNode(e,t){if(void 0===e)return!1;this.totalNodes++;let r=void 0!==t?t:"NODE[".concat(this.totalNodes,"]"),i=new n;return i.Hash=r,i.Datum=e,i}append(e,t){let r=this.initializeNode(e,t);return!!r&&(this.length++,1==this.length?(this.head=r,this.tail=r,r):(this.tail.RightNode=r,r.LeftNode=this.tail,this.tail=r,r))}push(e,t){return this.append(e,t)}prepend(e,t){let r=this.initializeNode(e,t);return!!r&&(this.length++,1==this.length?(this.head=r,this.tail=r,r):(this.head.LeftNode=r,r.RightNode=this.head,this.head=r,r))}remove(e){return void 0!==e&&(!!e.__ISNODE&&(this.length--,this.length<1?(this.head=!1,this.tail=!1,e):e.LeftNode&&e.RightNode?(e.LeftNode.RightNode=e.RightNode,e.RightNode.LeftNode=e.LeftNode,e.RightNode=!1,e.LeftNode=!1,e):e.LeftNode?(e.LeftNode.RightNode=!1,this.tail=e.LeftNode,e.LeftNode=!1,e):(e.RightNode.LeftNode=!1,this.head=e.RightNode,e.RightNode=!1,e)))}pop(){return this.remove(this.head)}each(e,t){if(this.length<1)return t();let r=!1,n=i=>{if(i)return t(i);if(r){if(!r.RightNode)return t();r=r.RightNode}else r=this.head;e(r.Datum,r.Hash,n)};return n()}seek(e){if(!e)return!1;if(this.length<1)return!1;if(e>=this.length)return!1;let t=this.head;for(let r=0;r<e;r++)t=t.RightNode;return t}}},{"./LinkedList-Node.js":22}],24:[function(e,t,r){r.parse=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");var r={},n=(t||{}).decode||s,i=0;for(;i<e.length;){var o=e.indexOf("=",i);if(-1===o)break;var c=e.indexOf(";",i);if(-1===c)c=e.length;else if(c<o){i=e.lastIndexOf(";",o-1)+1;continue}var l=e.slice(i,o).trim();if(void 0===r[l]){var h=e.slice(o+1,c).trim();34===h.charCodeAt(0)&&(h=h.slice(1,-1)),r[l]=a(h,n)}i=c+1}return r},r.serialize=function(e,t,r){var s=r||{},a=s.encode||o;if("function"!=typeof a)throw new TypeError("option encode is invalid");if(!i.test(e))throw new TypeError("argument name is invalid");var c=a(t);if(c&&!i.test(c))throw new TypeError("argument val is invalid");var l=e+"="+c;if(null!=s.maxAge){var h=s.maxAge-0;if(isNaN(h)||!isFinite(h))throw new TypeError("option maxAge is invalid");l+="; Max-Age="+Math.floor(h)}if(s.domain){if(!i.test(s.domain))throw new TypeError("option domain is invalid");l+="; Domain="+s.domain}if(s.path){if(!i.test(s.path))throw new TypeError("option path is invalid");l+="; Path="+s.path}if(s.expires){var u=s.expires;if(!function(e){return"[object Date]"===n.call(e)||e instanceof Date}(u)||isNaN(u.valueOf()))throw new TypeError("option expires is invalid");l+="; Expires="+u.toUTCString()}s.httpOnly&&(l+="; HttpOnly");s.secure&&(l+="; Secure");if(s.priority){switch("string"==typeof s.priority?s.priority.toLowerCase():s.priority){case"low":l+="; Priority=Low";break;case"medium":l+="; Priority=Medium";break;case"high":l+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(s.sameSite){switch("string"==typeof s.sameSite?s.sameSite.toLowerCase():s.sameSite){case!0:l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"strict":l+="; SameSite=Strict";break;case"none":l+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return l};var n=Object.prototype.toString,i=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function s(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function o(e){return encodeURIComponent(e)}function a(e,t){try{return t(e)}catch(t){return e}}},{}],25:[function(e,t,r){var n,i="object"==typeof Reflect?Reflect:null,s=i&&"function"==typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}t.exports=a,t.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,s),n(r)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}y(e,t,s,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&y(e,"error",t,r)}(e,i,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var c=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function h(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function u(e,t,r,n){var i,s,o,a;if(l(r),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),o=s[t]),void 0===o)o=s[t]=r,++e._eventsCount;else if("function"==typeof o?o=s[t]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(i=h(e))>0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=o.length,a=c,console&&console.warn&&console.warn(a)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=f.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):m(i,i.length)}function g(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function y(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(s){n.once&&e.removeEventListener(t,i),r(s)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");c=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return h(this)},a.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=i[e];if(void 0===c)return!1;if("function"==typeof c)s(c,this,t);else{var l=c.length,h=m(c,l);for(r=0;r<l;++r)s(h[r],this,t)}return!0},a.prototype.addListener=function(e,t){return u(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return u(this,e,t,!0)},a.prototype.once=function(e,t){return l(t),this.on(e,p(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,p(this,e,t)),this},a.prototype.removeListener=function(e,t){var r,n,i,s,o;if(l(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,s=r.length-1;s>=0;s--)if(r[s]===t||r[s].listener===t){o=r[s].listener,i=s;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,o||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,s=Object.keys(r);for(n=0;n<s.length;++n)"removeListener"!==(i=s[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},a.prototype.listeners=function(e){return d(this,e,!0)},a.prototype.rawListeners=function(e){return d(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},a.prototype.listenerCount=g,a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],26:[function(e,t,r){t.exports=class{constructor(e,t){this._Settings="object"==typeof e?e:{},this.loggerUUID=this.generateInsecureUUID(),this.levels=["trace","debug","info","warn","error","fatal"]}generateInsecureUUID(){let e=(new Date).getTime();return"LOGSTREAM-xxxxxx-yxxxxx".replace(/[xy]/g,(t=>{let r=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?r:3&r|8).toString(16)}))}initialize(){}trace(e,t){this.write("trace",e,t)}debug(e,t){this.write("debug",e,t)}info(e,t){this.write("info",e,t)}warn(e,t){this.write("warn",e,t)}error(e,t){this.write("error",e,t)}fatal(e,t){this.write("fatal",e,t)}write(e,t,r){return!0}}},{}],27:[function(e,t,r){t.exports=(()=>{let t={};return t.console=e("./Fable-Log-Logger-Console.js"),t.default=t.console,t})()},{"./Fable-Log-Logger-Console.js":29}],28:[function(e,t,r){t.exports=[{loggertype:"console",streamtype:"console",level:"trace"}]},{}],29:[function(e,t,r){let n=e("./Fable-Log-BaseLogger.js");t.exports=class extends n{constructor(e,t){super(e),this._ShowTimeStamps=!this._Settings.hasOwnProperty("showtimestamps")||1==this._Settings.showtimestamps,this._FormattedTimeStamps=!this._Settings.hasOwnProperty("formattedtimestamps")||1==this._Settings.formattedtimestamps,this._ContextMessage=this._Settings.hasOwnProperty("Context")?"(".concat(this._Settings.Context,")"):t._Settings.hasOwnProperty("Product")?"(".concat(t._Settings.Product,")"):"Unnamed_Log_Context",this._OutputLogLinesToConsole=!this._Settings.hasOwnProperty("outputloglinestoconsole")||this._Settings.outputloglinestoconsole,this._OutputObjectsToConsole=!this._Settings.hasOwnProperty("outputobjectstoconsole")||this._Settings.outputobjectstoconsole,this.prefixCache={};for(let e=0;e<=this.levels.length;e++)this.prefixCache[this.levels[e]]="[".concat(this.levels[e],"] ").concat(this._ContextMessage,": "),this._ShowTimeStamps&&(this.prefixCache[this.levels[e]]=" "+this.prefixCache[this.levels[e]])}write(e,t,r){let n="";this._ShowTimeStamps&&this._FormattedTimeStamps?n=(new Date).toISOString():this._ShowTimeStamps&&(n=+new Date);let i="".concat(n).concat(this.prefixCache[e]).concat(t);return this._OutputLogLinesToConsole&&console.log(i),this._OutputObjectsToConsole&&void 0!==r&&console.log(JSON.stringify(r,null,2)),i}}},{"./Fable-Log-BaseLogger.js":26}],30:[function(e,t,r){const n=e("./Fable-Log-Logger-Console.js"),i=e("fs"),s=e("path");t.exports=class extends n{constructor(e,t){super(e,t),this.logFileRawPath=this._Settings.hasOwnProperty("path")?this._Settings.path:"./".concat(this._ContextMessage,".log"),this.logFilePath=s.normalize(this.logFileRawPath),this.logFileStreamOptions=this._Settings.hasOwnProperty("fileStreamoptions")?this._Settings.fileStreamOptions:{flags:"a",encoding:"utf8"},this.fileWriter=i.createWriteStream(this.logFilePath,this.logFileStreamOptions),this.activelyWriting=!1,this.logLineStrings=[],this.logObjectStrings=[],this.defaultWriteCompleteCallback=()=>{},this.defaultBufferFlushCallback=()=>{}}closeWriter(e){let t="function"==typeof e?e:()=>{};if(this.fileWriter)return this.fileWriter.end("\n"),this.fileWriter.once("finish",t.bind(this))}completeBufferFlushToLogFile(e){this.activelyWriting=!1;let t="function"==typeof e?e:this.defaultBufferFlushCallback;if(!(this.logLineStrings.length>0))return t();this.flushBufferToLogFile(t)}flushBufferToLogFile(e){if(!this.activelyWriting){this.activelyWriting=!0;let t="function"==typeof e?e:this.defaultBufferFlushCallback,r=this.logLineStrings,n=this.logObjectStrings;this.logLineStrings=[],this.logObjectStrings=[];let i="";for(let e=0;e<r.length;e++)i+="".concat(r[e],"\n"),!1!==n[e]&&(i+="".concat(n[e],"\n"));if(this.fileWriter.write(i,"utf8"))return this.completeBufferFlushToLogFile(t);this.fileWriter.once("drain",this.completeBufferFlushToLogFile.bind(this,t))}}write(e,t,r){let n=super.write(e,t,r);this.logLineStrings.push(n),void 0!==r?this.logObjectStrings.push(JSON.stringify(r,null,4)):this.logObjectStrings.push(!1),this.flushBufferToLogFile()}}},{"./Fable-Log-Logger-Console.js":29,fs:18,path:71}],31:[function(e,t,r){const n=e("fable-serviceproviderbase").CoreServiceProviderBase;class i extends n{constructor(t,r){super(t,r),this.serviceType="Logging";let n="object"==typeof t?t:{};this._Settings=n,this._Providers=e("./Fable-Log-DefaultProviders-Node.js"),this._StreamDefinitions=n.hasOwnProperty("LogStreams")?n.LogStreams:e("./Fable-Log-DefaultStreams.json"),this.logStreams=[],this.logProviders={},this.activeLogStreams={},this.logStreamsTrace=[],this.logStreamsDebug=[],this.logStreamsInfo=[],this.logStreamsWarn=[],this.logStreamsError=[],this.logStreamsFatal=[],this.datumDecorator=e=>e,this.uuid="string"==typeof n.Product?n.Product:"Default"}addLogger(e,t){if(this.activeLogStreams.hasOwnProperty(e.loggerUUID))return!1;switch(this.logStreams.push(e),this.activeLogStreams[e.loggerUUID]=!0,t){case"trace":this.logStreamsTrace.push(e);case"debug":this.logStreamsDebug.push(e);case"info":this.logStreamsInfo.push(e);case"warn":this.logStreamsWarn.push(e);case"error":this.logStreamsError.push(e);case"fatal":this.logStreamsFatal.push(e)}return!0}setDatumDecorator(e){this.datumDecorator="function"==typeof e?e:e=>e}trace(e,t){const r=this.datumDecorator(t);for(let t=0;t<this.logStreamsTrace.length;t++)this.logStreamsTrace[t].trace(e,r)}debug(e,t){const r=this.datumDecorator(t);for(let t=0;t<this.logStreamsDebug.length;t++)this.logStreamsDebug[t].debug(e,r)}info(e,t){const r=this.datumDecorator(t);for(let t=0;t<this.logStreamsInfo.length;t++)this.logStreamsInfo[t].info(e,r)}warn(e,t){const r=this.datumDecorator(t);for(let t=0;t<this.logStreamsWarn.length;t++)this.logStreamsWarn[t].warn(e,r)}error(e,t){const r=this.datumDecorator(t);for(let t=0;t<this.logStreamsError.length;t++)this.logStreamsError[t].error(e,r)}fatal(e,t){const r=this.datumDecorator(t);for(let t=0;t<this.logStreamsFatal.length;t++)this.logStreamsFatal[t].fatal(e,r)}initialize(){for(let e=0;e<this._StreamDefinitions.length;e++){let t=Object.assign({loggertype:"default",streamtype:"console",level:"info"},this._StreamDefinitions[e]);this._Providers.hasOwnProperty(t.loggertype)?this.addLogger(new this._Providers[t.loggertype](t,this),t.level):console.log("Error initializing log stream: bad loggertype in stream definition ".concat(JSON.stringify(t)))}for(let e=0;e<this.logStreams.length;e++)this.logStreams[e].initialize()}logTime(e,t){let r=void 0!==e?e:"Time",n=new Date;this.info("".concat(r," ").concat(n," (epoch ").concat(+n,")"),t)}getTimeStamp(){return+new Date}getTimeDelta(e){return+new Date-e}logTimeDelta(e,t,r){let n=void 0!==t?t:"Time Measurement",i=+new Date;this.info("".concat(n," logged at (epoch ").concat(+i,") took (").concat(e,"ms)"),r)}logTimeDeltaHuman(e,t,r){let n=void 0!==t?t:"Time Measurement",i=+new Date,s=parseInt(e%1e3),o=parseInt(e/1e3%60),a=parseInt(e/6e4%60),c=parseInt(e/36e5);s=s<10?"00"+s:s<100?"0"+s:s,o=o<10?"0"+o:o,a=a<10?"0"+a:a,c=c<10?"0"+c:c,this.info("".concat(n," logged at (epoch ").concat(+i,") took (").concat(e,"ms) or (").concat(c,":").concat(a,":").concat(o,".").concat(s,")"),r)}logTimeDeltaRelative(e,t,r){this.logTimeDelta(this.getTimeDelta(e),t,r)}logTimeDeltaRelativeHuman(e,t,r){this.logTimeDeltaHuman(this.getTimeDelta(e),t,r)}}t.exports=i,t.exports.new=function(e){return new i(e)},t.exports.LogProviderBase=e("./Fable-Log-BaseLogger.js"),t.exports.LogProviderConsole=e("./Fable-Log-Logger-Console.js"),t.exports.LogProviderConsole=e("./Fable-Log-Logger-SimpleFlatFile.js")},{"./Fable-Log-BaseLogger.js":26,"./Fable-Log-DefaultProviders-Node.js":27,"./Fable-Log-DefaultStreams.json":28,"./Fable-Log-Logger-Console.js":29,"./Fable-Log-Logger-SimpleFlatFile.js":30,"fable-serviceproviderbase":33}],32:[function(e,t,r){class n{constructor(e,t){this.fable=!1,this.options="object"==typeof e?e:{},this.serviceType="Unknown",this.UUID="CORESVC-".concat(Math.floor(89999*Math.random()+1e4)),this.Hash="string"==typeof t?t:"".concat(this.UUID)}connectFable(e){return this.fable=e,!0}}_defineProperty2(n,"isFableService",!0),t.exports=n},{}],33:[function(e,t,r){class n{constructor(e,t,r){this.fable=e,this.options="object"==typeof t?t:"object"!=typeof e||e.isFable?{}:e,this.serviceType="Unknown","function"==typeof e.getUUID?this.UUID=e.getUUID():this.UUID="NoFABLESVC-".concat(Math.floor(89999*Math.random()+1e4)),this.Hash="string"==typeof r?r:"".concat(this.UUID),this.log=this.fable.log,this.servicesMap=this.fable.servicesMap,this.services=this.fable.services}}_defineProperty2(n,"isFableService",!0),t.exports=n,t.exports.CoreServiceProviderBase=e("./Fable-ServiceProviderBase-Preinit.js")},{"./Fable-ServiceProviderBase-Preinit.js":32}],34:[function(e,t,r){t.exports={Product:"ApplicationNameHere",ProductVersion:"0.0.0",ConfigFile:!1,LogStreams:[{level:"trace"}]}},{}],35:[function(e,t,r){(function(r){(function(){const n=e("precedent");t.exports=class{constructor(e){this.templateProcessor=new n,this.templateProcessor.addPattern("${","}",(e=>{let t=e.trim(),n=t.indexOf("|"),i=t.substring(n+1),s=n>-1?t.substring(0,n):t;return r.env.hasOwnProperty(s)?r.env[s]:i}))}parseSetting(e){return this.templateProcessor.parseString(e)}}}).call(this)}).call(this,e("_process"))},{_process:77,precedent:74}],36:[function(e,t,r){const n=e("fable-serviceproviderbase").CoreServiceProviderBase,i=e("./Fable-Settings-TemplateProcessor.js");class s extends n{constructor(t,r){super(t,r),this.serviceType="SettingsManager",this.settingsTemplateProcessor=new i,this._configureEnvTemplating(t),this.default=this.buildDefaultSettings();let n=this.merge(t,this.buildDefaultSettings());if(this.base=JSON.parse(JSON.stringify(n)),n.DefaultConfigFile)try{n=this.merge(e(n.DefaultConfigFile),n)}catch(e){console.log("Fable-Settings Warning: Default configuration file specified but there was a problem loading it. Falling back to base."),console.log(" Loading Exception: "+e)}if(n.ConfigFile)try{n=this.merge(e(n.ConfigFile),n)}catch(e){console.log("Fable-Settings Warning: Configuration file specified but there was a problem loading it. Falling back to base."),console.log(" Loading Exception: "+e)}this.settings=n}buildDefaultSettings(){return JSON.parse(JSON.stringify(e("./Fable-Settings-Default")))}_configureEnvTemplating(e){this._PerformEnvTemplating=!e||!0!==e.NoEnvReplacement}_resolveEnv(e){for(const t in e)"object"==typeof e[t]?this._resolveEnv(e[t]):"string"==typeof e[t]&&(e[t]=this.settingsTemplateProcessor.parseSetting(e[t]))}_isObject(e){return"object"==typeof e&&!Array.isArray(e)}_deepMergeObjects(e,t){if(t&&this._isObject(t))return Object.keys(t).forEach((r=>{const n=t[r];if(this._isObject(n)){const t=e[r];if(t&&this._isObject(t))return void this._deepMergeObjects(t,n)}e[r]=n})),e}merge(e,t){let r="object"==typeof e?e:{},n="object"==typeof t?t:this.settings,i=JSON.parse(JSON.stringify(r));return n=this._deepMergeObjects(n,i),this._PerformEnvTemplating&&this._resolveEnv(n),this._configureEnvTemplating(n),n}fill(e){let t="object"==typeof e?e:{},r=JSON.parse(JSON.stringify(t));return this.settings=this._deepMergeObjects(r,this.settings),this.settings}}t.exports=s,t.exports.new=function(e){return new s(e)}},{"./Fable-Settings-Default":34,"./Fable-Settings-TemplateProcessor.js":35,"fable-serviceproviderbase":33}],37:[function(e,t,r){t.exports=class{constructor(){this.getRandomValues="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)}generateWhatWGBytes(){let e=new Uint8Array(16);return this.getRandomValues(e),e}generateRandomBytes(){let e=new Uint8Array(16);for(let t,r=0;r<16;r++)0==(3&r)&&(t=4294967296*Math.random()),e[r]=t>>>((3&r)<<3)&255;return e}generate(){return this.getRandomValues?this.generateWhatWGBytes():this.generateRandomBytes()}}},{}],38:[function(e,t,r){const n=e("fable-serviceproviderbase").CoreServiceProviderBase,i=e("./Fable-UUID-Random.js");class s extends n{constructor(e,t){super(e,t),this.serviceType="UUID",this._UUIDModeRandom=!("object"!=typeof e||!e.hasOwnProperty("UUIDModeRandom"))&&1==e.UUIDModeRandom,this._UUIDLength="object"==typeof e&&e.hasOwnProperty("UUIDLength")?e.UUIDLength+0:8,this._UUIDRandomDictionary="object"==typeof e&&e.hasOwnProperty("UUIDDictionary")?e.UUIDDictionary+0:"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",this.randomByteGenerator=new i,this._HexLookup=[];for(let e=0;e<256;++e)this._HexLookup[e]=(e+256).toString(16).substr(1)}bytesToUUID(e){let t=0;return[this._HexLookup[e[t++]],this._HexLookup[e[t++]],this._HexLookup[e[t++]],this._HexLookup[e[t++]],"-",this._HexLookup[e[t++]],this._HexLookup[e[t++]],"-",this._HexLookup[e[t++]],this._HexLookup[e[t++]],"-",this._HexLookup[e[t++]],this._HexLookup[e[t++]],"-",this._HexLookup[e[t++]],this._HexLookup[e[t++]],this._HexLookup[e[t++]],this._HexLookup[e[t++]],this._HexLookup[e[t++]],this._HexLookup[e[t++]]].join("")}generateUUIDv4(){new Array(16);var e=this.randomByteGenerator.generate();return e[6]=15&e[6]|64,e[8]=63&e[8]|128,this.bytesToUUID(e)}generateRandom(){let e="";for(let t=0;t<this._UUIDLength;t++)e+=this._UUIDRandomDictionary.charAt(Math.floor(Math.random()*(this._UUIDRandomDictionary.length-1)));return e}getUUID(){return this._UUIDModeRandom?this.generateRandom():this.generateUUIDv4()}}t.exports=s,t.exports.new=function(e){return new s(e)}},{"./Fable-UUID-Random.js":37,"fable-serviceproviderbase":33}],39:[function(e,t,r){const n=e("fable-serviceproviderbase");class i extends n.CoreServiceProviderBase{constructor(e,t){super(e,t),this.serviceType="ServiceManager",this.serviceTypes=[],this.servicesMap={},this.services={},this.serviceClasses={},this.extraServiceInitialization=!1}addServiceType(e,t){this.servicesMap.hasOwnProperty(e)?this.fable.log.warn("Adding a service type [".concat(e,"] that already exists.")):(this.servicesMap[e]={},this.serviceTypes.push(e)),"function"==typeof t&&t.isFableService?this.serviceClasses[e]=t:(this.fable.log.error("Attempted to add service type [".concat(e,"] with an invalid class. Using base service class, which will not crash but won't provide meaningful services.")),this.serviceClasses[e]=n)}addAndInstantiateServiceType(e,t){return this.addServiceType(e,t),this.instantiateServiceProvider(e,{},"".concat(e,"-Default"))}instantiateServiceProviderFromPrototype(e,t,r,n){let i=new n(this.fable,t,r);return this.extraServiceInitialization&&(i=this.extraServiceInitialization(i)),this.servicesMap[e][i.Hash]=i,this.services.hasOwnProperty(e)||this.setDefaultServiceInstantiation(e,i.Hash),i}instantiateServiceProvider(e,t,r){let n=this.instantiateServiceProviderWithoutRegistration(e,t,r);return this.servicesMap[e][n.Hash]=n,this.services.hasOwnProperty(e)||this.setDefaultServiceInstantiation(e,n.Hash),n}instantiateServiceProviderWithoutRegistration(e,t,r){let n=new this.serviceClasses[e](this.fable,t,r);return this.extraServiceInitialization&&(n=this.extraServiceInitialization(n)),n}connectPreinitServiceProviderInstance(e){let t=e.serviceType,r=e.Hash;return e.connectFable(this.fable),this.servicesMap.hasOwnProperty(t)||(this.servicesMap[t]={}),this.servicesMap[t][r]=e,this.services.hasOwnProperty(t)||this.setDefaultServiceInstantiation(t,r),e}setDefaultServiceInstantiation(e,t){return!!this.servicesMap[e].hasOwnProperty(t)&&(this.fable[e]=this.servicesMap[e][t],this.services[e]=this.servicesMap[e][t],!0)}}t.exports=i,t.exports.ServiceProviderBase=n,t.exports.CoreServiceProviderBase=n.CoreServiceProviderBase},{"fable-serviceproviderbase":33}],40:[function(e,t,r){const n=e("fable-settings"),i=e("fable-uuid"),s=e("fable-log"),o=e("./Fable-ServiceManager.js");class a{constructor(t){this._coreServices={},this._coreServices.SettingsManager=new n(t),this._coreServices.UUID=new i(this._coreServices.SettingsManager.settings),this._coreServices.Logging=new s(this._coreServices.SettingsManager.settings),this._coreServices.Logging.initialize(),this._coreServices.ServiceManager=new o(this),this.serviceManager=this._coreServices.ServiceManager,this.serviceManager.connectFable(this),this.serviceManager.connectPreinitServiceProviderInstance(this._coreServices.ServiceManager),this.serviceManager.connectPreinitServiceProviderInstance(this._coreServices.UUID),this.serviceManager.connectPreinitServiceProviderInstance(this._coreServices.Logging),this.serviceManager.connectPreinitServiceProviderInstance(this._coreServices.SettingsManager),this.serviceManager.addAndInstantiateServiceType("EnvironmentData",e("./services/Fable-Service-EnvironmentData.js")),this.serviceManager.addServiceType("Template",e("./services/Fable-Service-Template.js")),this.serviceManager.addServiceType("MetaTemplate",e("./services/Fable-Service-MetaTemplate.js")),this.serviceManager.addServiceType("Anticipate",e("./services/Fable-Service-Anticipate.js")),this.serviceManager.addAndInstantiateServiceType("DataFormat",e("./services/Fable-Service-DataFormat.js")),this.serviceManager.addAndInstantiateServiceType("DataGeneration",e("./services/Fable-Service-DataGeneration.js")),this.serviceManager.addAndInstantiateServiceType("Utility",e("./services/Fable-Service-Utility.js")),this.serviceManager.addServiceType("Operation",e("./services/Fable-Service-Operation.js")),this.serviceManager.addServiceType("RestClient",e("./services/Fable-Service-RestClient.js")),this.serviceManager.addServiceType("CSVParser",e("./services/Fable-Service-CSVParser.js")),this.serviceManager.addServiceType("Manifest",e("manyfest")),this.serviceManager.addServiceType("ObjectCache",e("cachetrax")),this.serviceManager.addServiceType("FilePersistence",e("./services/Fable-Service-FilePersistence.js"))}get isFable(){return!0}get settings(){return this._coreServices.SettingsManager.settings}get settingsManager(){return this._coreServices.SettingsManager}get log(){return this._coreServices.Logging}get services(){return this._coreServices.ServiceManager.services}get servicesMap(){return this._coreServices.ServiceManager.servicesMap}getUUID(){return this._coreServices.UUID.getUUID()}get fable(){return this}}t.exports=a,t.exports.new=function(e){return new a(e)},t.exports.LogProviderBase=s.LogProviderBase,t.exports.ServiceProviderBase=o.ServiceProviderBase,t.exports.CoreServiceProviderBase=o.CoreServiceProviderBase,t.exports.precedent=n.precedent},{"./Fable-ServiceManager.js":39,"./services/Fable-Service-Anticipate.js":41,"./services/Fable-Service-CSVParser.js":42,"./services/Fable-Service-DataFormat.js":43,"./services/Fable-Service-DataGeneration.js":45,"./services/Fable-Service-EnvironmentData.js":46,"./services/Fable-Service-FilePersistence.js":47,"./services/Fable-Service-MetaTemplate.js":48,"./services/Fable-Service-Operation.js":52,"./services/Fable-Service-RestClient.js":53,"./services/Fable-Service-Template.js":54,"./services/Fable-Service-Utility.js":55,cachetrax:21,"fable-log":31,"fable-settings":36,"fable-uuid":38,manyfest:69}],41:[function(e,t,r){const n=e("../Fable-ServiceManager.js").ServiceProviderBase;t.exports=class extends n{constructor(e,t,r){super(e,t,r),this.serviceType="AsyncAnticipate",this.operationQueue=[],this.erroredOperations=[],this.executingOperationCount=0,this.completedOperationCount=0,this.maxOperations=1,this.lastError=void 0,this.waitingFunctions=[]}checkQueue(){if(this.operationQueue.length>0&&this.executingOperationCount<this.maxOperations){let e=this.operationQueue.shift();this.executingOperationCount+=1,e(this.buildAnticipatorCallback())}else if(this.waitingFunctions.length>0&&this.executingOperationCount<1){for(let e=0;e<this.waitingFunctions.length;e++)this.waitingFunctions[e](this.lastError);this.lastError=void 0,this.waitingFunctions=[]}}anticipate(e){this.operationQueue.push(e),this.checkQueue()}buildAnticipatorCallback(){let e={Called:!1,Error:void 0,OperationSet:this};return function(t){if(e.Called)throw new Error("Anticipation async callback called twice...");e.Called=!0,e.error=t,e.OperationSet.executingOperationCount-=1,e.OperationSet.completedOperationCount+=1,e.OperationSet.checkQueue()}}wait(e){this.waitingFunctions.push(e),this.checkQueue()}}},{"../Fable-ServiceManager.js":39}],42:[function(e,t,r){const n=e("fable-serviceproviderbase");t.exports=class extends n{constructor(e,t,r){super(e,t,r),this.serviceType="CSVParser",this.Header=[],this.HeaderFieldNames=[],this.Delimiter=",",this.QuoteCharacter='"',this.CleanCharacters=["\r"],this.HeaderLineIndex=0,this.HasHeader=!0,this.HasSetHeader=!1,this.EmitHeader=!1,this.EmitJSON=!0,this.EscapedQuoteString=""",this.CurrentLine="",this.CurrentRecord=[],this.InQuote=!1,this.InEscapedQuote=!1,this.LinesParsed=0,this.RowsEmitted=0}marshalRowToJSON(e){if(!Array.isArray(e))return!1;for(let t=this.HeaderFieldNames.length;t<e.length;t++)this.HeaderFieldNames[t]="".concat(t);let t={};for(let r=0;r<e.length;r++)t[this.HeaderFieldNames[r]]=e[r];return t}setHeader(e){this.Header=e;for(let e=0;e<this.Header.length;e++)void 0===this.Header[e]?this.HeaderFieldNames[e]="".concat(e):this.HeaderFieldNames[e]=this.Header[e].toString()}resetRowState(){this.CurrentRecord=[]}pushLine(){for(let e=0;e<this.CleanCharacters.length;e++)this.CurrentLine=this.CurrentLine.replace(this.CleanCharacters[e],"");this.CurrentRecord.push(this.CurrentLine),this.CurrentLine=""}emitRow(e){let t=void 0===e?this.EmitJSON:e;this.RowsEmitted++;let r=this.CurrentRecord;return this.CurrentRecord=[],t?this.marshalRowToJSON(r):r}parseCSVLine(e){this.LinesParsed++;for(let t=0;t<e.length;t++)this.InQuote||e[t]!=this.Delimiter?e[t]==this.QuoteCharacter?this.InEscapedQuote?this.InEscapedQuote=!1:this.InQuote?t<e.length&&e[t+1]==this.QuoteCharacter?(this.CurrentLine+=this.EscapedQuoteString,this.InEscapedQuote=!0):this.InQuote=!1:this.InQuote=!0:this.CurrentLine+=e[t]:this.pushLine();return!this.InQuote&&(this.pushLine(),this.HasHeader&&!this.HasSetHeader&&this.RowsEmitted==this.HeaderLineIndex?(this.HasSetHeader=!0,this.setHeader(this.emitRow(!1)),!!this.EmitHeader&&this.Header):this.emitRow())}}},{"fable-serviceproviderbase":33}],43:[function(e,t,r){const n=e("fable-serviceproviderbase");t.exports=class extends n{constructor(e,t,r){super(e,t,r),_defineProperty2(this,"stringPadStart",(function(e,t,r){let n=e.toString();return this.stringGeneratePaddingString(n,t,r)+n})),_defineProperty2(this,"stringPadEnd",(function(e,t,r){let n=e.toString();return n+this.stringGeneratePaddingString(n,t,r)})),this.serviceType="DataArithmatic",this._Regex_formatterInsertCommas=/.{1,3}/g,this._Regex_formatterAddCommasToNumber=/^([-+]?)(0?)(\d+)(.?)(\d+)$/g,this._Regex_formatterDollarsRemoveCommas=/,/gi,this._Regex_formatterCleanNonAlphaChar=/[^a-zA-Z]/gi,this._Regex_formatterCapitalizeEachWord=/([a-zA-Z]+)/g,this._Value_MoneySign_Currency="$",this._Value_NaN_Currency="--",this._Value_GroupSeparator_Number=",",this._Value_Prefix_StringHash="HSH",this._Value_Clean_formatterCleanNonAlpha="",this._UseEngineStringStartsWith="function"==typeof String.prototype.startsWith,this._UseEngineStringEndsWith="function"==typeof String.prototype.endsWith}stringReverse(e){return e.split("").reverse().join("")}stringStartsWith(e,t,r){return this._UseEngineStringStartsWith?e.startsWith(t,r):this.stringStartsWith_Polyfill.call(e,t,r)}stringStartsWith_Polyfill(e,t){return this.slice(t||0,e.length)===e}stringEndsWith(e,t,r){return this._UseEngineStringEndsWith?e.endsWith(t,r):this.stringEndsWith_Polyfill.call(e,t,r)}stringEndsWith_Polyfill(e,t){return t<this.length?t|=0:t=this.length,this.substr(t-e.length,e.length)===e}insecureStringHash(e){let t=0,r=e.length,n=0;for(;n<r;)t=(t<<5)-t+e.charCodeAt(n++)|0;return"".concat(this._Value_Prefix_StringHash).concat(t)}capitalizeEachWord(e){return e.replace(this._Regex_formatterCapitalizeEachWord,(e=>e.charAt(0).toUpperCase()+e.substr(1)))}cleanEnclosureWrapCharacters(e,t){return t.startsWith(e)&&t.endsWith(e)?t.substring(1,t.length-1):t}cleanNonAlphaCharacters(e){return"string"==typeof e&&""!=e?e.replace(this._Regex_formatterCleanNonAlphaChar,this._Value_Clean_formatterCleanNonAlpha):""}formatterInsertCommas(e){let t=this.stringReverse(e).match(this._Regex_formatterInsertCommas).join(",");return this.stringReverse(t)}processAddCommasToNumberRegex(e,t,r,n,i,s){return t+(i?this.formatterInsertCommas(n)+i+s:this.formatterInsertCommas(n+s))}formatterAddCommasToNumber(e){return e.toString().replace(this._Regex_formatterAddCommasToNumber,this.processAddCommasToNumberRegex.bind(this))}formatterDollars(e){let t=parseFloat(e).toFixed(2);return isNaN(t)&&("string"==typeof e&&(t=parseFloat(e.replace(this._Value_MoneySign_Currency,"").replace(this._Regex_formatterDollarsRemoveCommas,"")).toFixed(2)),isNaN(t))?this._Value_NaN_Currency:"$".concat(this.formatterAddCommasToNumber(t))}formatterRoundNumber(e,t){let r=void 0===t?2:t,n=parseFloat(e).toFixed(r);if(isNaN(n)){return(0).toFixed(r)}return n}stringGeneratePaddingString(e,t,r){let n=t>>0;String(void 0!==r?r:" ");if(e.length>t)return"";{let i=t-e.length;return i>r.length&&(r+=r.repeat(n/r.length)),r.slice(0,i)}}formatTimeSpan(e){if("number"!=typeof e)return"";let t=parseInt(e%1e3),r=parseInt(e/1e3%60),n=parseInt(e/6e4%60),i=parseInt(e/36e5);return"".concat(this.stringPadStart(i,2,"0"),":").concat(this.stringPadStart(n,2,"0"),":").concat(this.stringPadStart(r,2,"0"),".").concat(this.stringPadStart(t,3,"0"))}formatTimeDelta(e,t){return"number"!=typeof e||"number"!=typeof t?"":this.formatTimeSpan(t-e)}getMonthFromDate(e){return["January","February","March","April","May","June","July","August","September","October","November","December"][e.getMonth()]}getMonthAbbreviatedFromDate(e){return["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()]}formatSortableStringFromDate(e){return e.getFullYear()+this.stringPadStart(e.getMonth(),2,"0")+this.stringPadStart(e.getDate(),2,"0")}stringBeforeMatch(e,t){return e.split(t)[0]}stringAfterMatch(e,t){let r=e.indexOf(t);return r<0||r+t.length>=e.length?"":e.substring(r+t.length)}stringCountEnclosures(e,t,r){let n="string"==typeof e?e:"",i="string"==typeof t?t:"(",s="string"==typeof r?r:")",o=0,a=0;for(let e=0;e<n.length;e++)n[e]==i?(0==a&&o++,a++):n[e]==s&&a--;return o}stringGetEnclosureValueByIndex(e,t,r,n){let i="string"==typeof e?e:"",s="number"==typeof t?t:0,o="string"==typeof r?r:"(",a="string"==typeof n?n:")",c=0,l=0,h=!1,u=0,f=0;for(let e=0;e<i.length;e++)i[e]==o?(l++,1==l&&(c++,s==c-1&&(h=!0,u=e))):i[e]==a&&(l--,0==l&&h&&f<=u&&(f=e,h=!1));return c<=s?"":f>0&&f>u?i.substring(u+1,f):i.substring(u+1)}stringRemoveEnclosureByIndex(e,t,r,n){let i="string"==typeof e?e:"",s="number"==typeof t?t:0,o="string"==typeof r?r:"(",a="string"==typeof n?n:")",c=0,l=0,h=!1,u=0,f=0;for(let e=0;e<i.length;e++)i[e]==o?(l++,1==l&&(c++,s==c-1&&(h=!0,u=e))):i[e]==a&&(l--,0==l&&h&&f<=u&&(f=e,h=!1));if(c<=s)return i;let p="";return u>1&&(p=i.substring(0,u)),i.length>f+1&&f>u&&(p+=i.substring(f+1)),p}}},{"fable-serviceproviderbase":33}],44:[function(e,t,r){t.exports={DefaultIntegerMinimum:0,DefaultIntegerMaximum:9999999,DefaultNumericStringLength:10,MonthSet:["January","February","March","April","May","June","July","August","September","October","November","December"],WeekDaySet:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ColorSet:["Red","Orange","Yellow","Green","Blue","Indigo","Violet","Pink","Purple","Turquoise","Gold","Lime","Maroon","Navy","Coral","Teal","Brown","White","Black","Sky","Berry","Grey","Straw","Silver","Sapphire"],SurNameSet:["Smith","Johnson","Williams","Brown","Jones","Miller","Davis","Garcia","Rodriguez","Wilson","Martinez","Anderson","Taylor","Thomas","Hernandez","Moore","Martin","Jackson","Thompson","White","Lopez","Lee","Gonzalez","Harris","Clark","Lewis","Robinson","Walker","Perez","Hall","Young","Allen","Sanchez","Wright","King","Scott","Green","Baker","Adams","Nelson","Hill","Ramirez","Campbell","Mitchell","Roberts","Carter","Phillips","Evans","Turner","Torres","Parker","Collins","Edwards","Stewart","Flores","Morris","Nguyen","Murphy","Rivera","Cook","Rogers","Morgan","Peterson","Cooper","Reed","Bailey","Bell","Gomez","Kelly","Howard","Ward","Cox","Diaz","Richardson","Wood","Watson","Brooks","Bennett","Gray","James","Reyes","Cruz","Hughes","Price","Myers","Long","Foster","Sanders","Ross","Morales","Powell","Sullivan","Russell","Ortiz","Jenkins","Gutierrez","Perry","Butler","Barnes","Fisher"],NameSet:["Mary","Patricia","Jennifer","Linda","Elizabeth","Barbara","Susan","Jessica","Sarah","Karen","Lisa","Nancy","Betty","Sandra","Margaret","Ashley","Kimberly","Emily","Donna","Michelle","Carol","Amanda","Melissa","Deborah","Stephanie","Dorothy","Rebecca","Sharon","Laura","Cynthia","Amy","Kathleen","Angela","Shirley","Brenda","Emma","Anna","Pamela","Nicole","Samantha","Katherine","Christine","Helen","Debra","Rachel","Carolyn","Janet","Maria","Catherine","Heather","Diane","Olivia","Julie","Joyce","Victoria","Ruth","Virginia","Lauren","Kelly","Christina","Joan","Evelyn","Judith","Andrea","Hannah","Megan","Cheryl","Jacqueline","Martha","Madison","Teresa","Gloria","Sara","Janice","Ann","Kathryn","Abigail","Sophia","Frances","Jean","Alice","Judy","Isabella","Julia","Grace","Amber","Denise","Danielle","Marilyn","Beverly","Charlotte","Natalie","Theresa","Diana","Brittany","Doris","Kayla","Alexis","Lori","Marie","James","Robert","John","Michael","David","William","Richard","Joseph","Thomas","Christopher","Charles","Daniel","Matthew","Anthony","Mark","Donald","Steven","Andrew","Paul","Joshua","Kenneth","Kevin","Brian","George","Timothy","Ronald","Jason","Edward","Jeffrey","Ryan","Jacob","Gary","Nicholas","Eric","Jonathan","Stephen","Larry","Justin","Scott","Brandon","Benjamin","Samuel","Gregory","Alexander","Patrick","Frank","Raymond","Jack","Dennis","Jerry","Tyler","Aaron","Jose","Adam","Nathan","Henry","Zachary","Douglas","Peter","Kyle","Noah","Ethan","Jeremy","Walter","Christian","Keith","Roger","Terry","Austin","Sean","Gerald","Carl","Harold","Dylan","Arthur","Lawrence","Jordan","Jesse","Bryan","Billy","Bruce","Gabriel","Joe","Logan","Alan","Juan","Albert","Willie","Elijah","Wayne","Randy","Vincent","Mason","Roy","Ralph","Bobby","Russell","Bradley","Philip","Eugene"]}},{}],45:[function(e,t,r){const n=e("../Fable-ServiceManager.js").ServiceProviderBase;t.exports=class extends n{constructor(t,r,n){super(t,r,n),this.serviceType="DataGeneration",this.defaultData=e("./Fable-Service-DataGeneration-DefaultValues.json")}randomIntegerBetween(e,t){return Math.floor(Math.random()*(t-e))+e}randomIntegerUpTo(e){return this.randomIntegerBetween(0,e)}randomInteger(){return Math.floor(Math.random()*this.defaultData.DefaultIntegerMaximum)}randomNumericString(e,t){let r=void 0===t?10**(void 0===e?10:e)-1:t;return this.services.DataFormat.stringPadStart(this.randomIntegerUpTo(r),e,"0")}randomMonth(){return this.defaultData.MonthSet[this.randomIntegerUpTo(this.defaultData.MonthSet.length-1)]}randomDayOfWeek(){return this.defaultData.WeekDaySet[this.randomIntegerUpTo(this.defaultData.WeekDaySet.length-1)]}randomColor(){return this.defaultData.ColorSet[this.randomIntegerUpTo(this.defaultData.ColorSet.length-1)]}randomName(){return this.defaultData.NameSet[this.randomIntegerUpTo(this.defaultData.NameSet.length-1)]}randomSurname(){return this.defaultData.SurNameSet[this.randomIntegerUpTo(this.defaultData.SurNameSet.length-1)]}}},{"../Fable-ServiceManager.js":39,"./Fable-Service-DataGeneration-DefaultValues.json":44}],46:[function(e,t,r){const n=e("../Fable-ServiceManager.js").ServiceProviderBase;t.exports=class extends n{constructor(e,t,r){super(e,t,r),this.serviceType="EnvironmentData",this.Environment="node.js"}}},{"../Fable-ServiceManager.js":39}],47:[function(e,t,r){(function(r){(function(){const n=e("../Fable-ServiceManager.js").ServiceProviderBase,i=e("fs"),s=e("path");t.exports=class extends n{constructor(e,t,n){super(e,t,n),this.serviceType="FilePersistence",this.options.hasOwnProperty("Mode")||(this.options.Mode=parseInt("0777",8)&~r.umask()),this.currentInputFolder="/tmp",this.currentOutputFolder="/tmp"}joinPath(){return s.resolve(...arguments)}existsSync(e){return i.existsSync(e)}exists(e,t){return t(null,this.existsSync(e))}writeFileSync(e,t,r){let n=void 0===r?"utf8":r;return i.writeFileSync(e,t,n)}appendFileSync(e,t,r){let n=void 0===r?"utf8":r;return i.appendFileSync(e,t,n)}deleteFileSync(e){return i.unlinkSync(e)}deleteFolderSync(e){return i.rmdirSync(e)}writeFileSyncFromObject(e,t){return this.writeFileSync(e,JSON.stringify(t,null,4))}writeFileSyncFromArray(e,t){if(!Array.isArray(t))return this.log.error("File Persistence Service attempted to write ".concat(e," from array but the expected array was not an array (it was a ").concat(typeof t,").")),Error("Attempted to write ${pFileName} from array but the expected array was not an array (it was a ${typeof(pFileArray)}).");for(let r=0;r<t.length;r++)return this.appendFileSync(e,"".concat(t[r],"\n"))}getDefaultOutputPath(e){return s.join(this.currentOutputFolder,e)}dataFolderWriteSync(e,t){return this.writeFileSync(this.getDefaultOutputPath(e),t)}dataFolderWriteSyncFromObject(e,t){return this.writeFileSyncFromObject(this.getDefaultOutputPath(e),t)}dataFolderWriteSyncFromArray(e,t){return this.writeFileSyncFromArray(this.getDefaultOutputPath(e),t)}makeFolderRecursive(e,t){let r=e;if("string"==typeof e)r={Path:e};else if("object"!=typeof e)return t(new Error("Parameters object or string not properly passed to recursive folder create.")),!1;return"string"!=typeof r.Path?(t(new Error("Parameters object needs a path to run the folder create operation.")),!1):(r.hasOwnProperty("Mode")||(r.Mode=this.options.Mode),void 0===r.CurrentPathIndex?(r.ActualPath=s.normalize(r.Path),r.ActualPathParts=r.ActualPath.split(s.sep),r.CurrentPathIndex=0,r.CurrentPath=""):(r.CurrentPath==s.sep?r.CurrentPath=r.CurrentPath+r.ActualPathParts[r.CurrentPathIndex]:r.CurrentPath=r.CurrentPath+s.sep+r.ActualPathParts[r.CurrentPathIndex],r.CurrentPathIndex++),r.CurrentPathIndex>=r.ActualPathParts.length?(t(null),!0):void i.open(r.CurrentPath+s.sep+r.ActualPathParts[r.CurrentPathIndex],"r",((e,n)=>{if(n&&i.closeSync(n),!e||"ENOENT"!=e.code)return this.makeFolderRecursive(r,t);i.mkdir(r.CurrentPath+s.sep+r.ActualPathParts[r.CurrentPathIndex],r.Mode,(e=>e?"EEXIST"==e.code?this.makeFolderRecursive(r,t):(console.log(e.code),t(e),!1):this.makeFolderRecursive(r,t)))})))}}}).call(this)}).call(this,e("_process"))},{"../Fable-ServiceManager.js":39,_process:77,fs:18,path:71}],48:[function(e,t,r){const n=e("../Fable-ServiceManager.js").ServiceProviderBase,i=e("./Fable-Service-MetaTemplate/MetaTemplate-WordTree.js"),s=e("./Fable-Service-MetaTemplate/MetaTemplate-StringParser.js");t.exports=class extends n{constructor(e,t,r){super(e,t,r),this.serviceType="MetaTemplate",this.WordTree=new i,this.StringParser=new s(this.fable.services.Utility.eachLimit),this.ParseTree=this.WordTree.ParseTree}addPattern(e,t,r){return this.WordTree.addPattern(e,t,r)}addPatternAsync(e,t,r){return this.WordTree.addPatternAsync(e,t,r)}parseString(e,t,r){return this.StringParser.parseString(e,this.ParseTree,t,r)}}},{"../Fable-ServiceManager.js":39,"./Fable-Service-MetaTemplate/MetaTemplate-StringParser.js":49,"./Fable-Service-MetaTemplate/MetaTemplate-WordTree.js":50}],49:[function(e,t,r){t.exports=class{constructor(e){this.eachLimit=e}newParserState(e){return{ParseTree:e,Asynchronous:!1,Output:"",OutputBuffer:"",Pattern:{},PatternMatch:!1,PatternMatchEnd:!1}}appendOutputBuffer(e,t){t.OutputBuffer+=e}flushOutputBuffer(e){e.Output+=e.OutputBuffer,e.OutputBuffer=""}resetOutputBuffer(e){return this.flushOutputBuffer(e),e.Pattern=!1,e.PatternStartNode=!1,e.StartPatternMatchComplete=!1,e.EndPatternMatchBegan=!1,e.PatternMatch=!1,!0}parseCharacter(e,t,r){if(t.PatternMatch)if(!t.StartPatternMatchComplete&&t.Pattern.hasOwnProperty(e))t.Pattern=t.Pattern[e],this.appendOutputBuffer(e,t);else if(t.EndPatternMatchBegan)if(t.Pattern.PatternEnd.hasOwnProperty(e)){if(t.Pattern=t.Pattern.PatternEnd[e],this.appendOutputBuffer(e,t),t.Pattern.hasOwnProperty("Parse"))return t.OutputBuffer=t.Pattern.Parse(t.OutputBuffer.substr(t.Pattern.PatternStartString.length,t.OutputBuffer.length-(t.Pattern.PatternStartString.length+t.Pattern.PatternEndString.length)),r),this.resetOutputBuffer(t)}else t.PatternStartNode.PatternEnd.hasOwnProperty(e)?(t.Pattern=t.PatternStartNode.PatternEnd[e],this.appendOutputBuffer(e,t)):(t.EndPatternMatchBegan=!1,this.appendOutputBuffer(e,t));else if(t.Pattern.hasOwnProperty("PatternEnd")){if(t.StartPatternMatchComplete||(t.StartPatternMatchComplete=!0,t.PatternStartNode=t.Pattern),this.appendOutputBuffer(e,t),t.Pattern.PatternEnd.hasOwnProperty(e)&&(t.EndPatternMatchBegan=!0,t.Pattern=t.Pattern.PatternEnd[e],t.Pattern.hasOwnProperty("Parse"))){if(!t.Pattern.isAsync)return t.OutputBuffer=t.Pattern.Parse(t.OutputBuffer.substr(t.Pattern.PatternStartString.length,t.OutputBuffer.length-(t.Pattern.PatternStartString.length+t.Pattern.PatternEndString.length)),r),this.resetOutputBuffer(t);this.log.error("MetaTemplate: The pattern ".concat(t.Pattern.PatternStartString," is asynchronous and cannot be used in a synchronous parser.")),this.resetOutputBuffer(t)}}else this.resetOutputBuffer(t);if(!t.PatternMatch){if(t.ParseTree.hasOwnProperty(e))return this.resetOutputBuffer(t),this.appendOutputBuffer(e,t),t.Pattern=t.ParseTree[e],t.PatternMatch=!0,!0;this.appendOutputBuffer(e,t)}return!1}parseCharacterAsync(e,t,r,n){if(t.PatternMatch)if(!t.StartPatternMatchComplete&&t.Pattern.hasOwnProperty(e))t.Pattern=t.Pattern[e],this.appendOutputBuffer(e,t);else if(t.EndPatternMatchBegan)if(t.Pattern.PatternEnd.hasOwnProperty(e)){if(t.Pattern=t.Pattern.PatternEnd[e],this.appendOutputBuffer(e,t),t.Pattern.hasOwnProperty("Parse"))return t.Pattern.isAsync?t.Pattern.Parse(t.OutputBuffer.substr(t.Pattern.PatternStartString.length,t.OutputBuffer.length-(t.Pattern.PatternStartString.length+t.Pattern.PatternEndString.length)),r,((e,r)=>(e&&console.log("Precedent ERROR: Async template error happened parsing ".concat(t.Pattern.PatternStart," ... ").concat(t.Pattern.PatternEnd,": ").concat(e)),t.OutputBuffer=r,this.resetOutputBuffer(t),n()))):(t.OutputBuffer=t.Pattern.Parse(t.OutputBuffer.substr(t.Pattern.PatternStartString.length,t.OutputBuffer.length-(t.Pattern.PatternStartString.length+t.Pattern.PatternEndString.length)),r),this.resetOutputBuffer(t),n())}else t.PatternStartNode.PatternEnd.hasOwnProperty(e)?(t.Pattern=t.PatternStartNode.PatternEnd[e],this.appendOutputBuffer(e,t)):(t.EndPatternMatchBegan=!1,this.appendOutputBuffer(e,t));else{if(!t.Pattern.hasOwnProperty("PatternEnd"))return this.resetOutputBuffer(t),n();if(t.StartPatternMatchComplete||(t.StartPatternMatchComplete=!0,t.PatternStartNode=t.Pattern),this.appendOutputBuffer(e,t),t.Pattern.PatternEnd.hasOwnProperty(e)&&(t.EndPatternMatchBegan=!0,t.Pattern=t.Pattern.PatternEnd[e],t.Pattern.hasOwnProperty("Parse")))return t.Pattern.isAsync?t.Pattern.Parse(t.OutputBuffer.substr(t.Pattern.PatternStartString.length,t.OutputBuffer.length-(t.Pattern.PatternStartString.length+t.Pattern.PatternEndString.length)),r,((e,r)=>(e&&console.log("Precedent ERROR: Async template error happened parsing ".concat(t.Pattern.PatternStart," ... ").concat(t.Pattern.PatternEnd,": ").concat(e)),t.OutputBuffer=r,this.resetOutputBuffer(t),n()))):(t.OutputBuffer=t.Pattern.Parse(t.OutputBuffer.substr(t.Pattern.PatternStartString.length,t.OutputBuffer.length-(t.Pattern.PatternStartString.length+t.Pattern.PatternEndString.length)),r),this.resetOutputBuffer(t),n())}return t.PatternMatch||(t.ParseTree.hasOwnProperty(e)?(this.resetOutputBuffer(t),this.appendOutputBuffer(e,t),t.Pattern=t.ParseTree[e],t.PatternMatch=!0):this.appendOutputBuffer(e,t)),n()}parseString(e,t,r,n){if("function"!=typeof n){let s=this.newParserState(t);for(var i=0;i<e.length;i++)this.parseCharacter(e[i],s,r,n);return this.flushOutputBuffer(s),s.Output}{let i=this.newParserState(t);i.Asynchronous=!0,this.eachLimit(e,1,((e,t)=>{this.parseCharacterAsync(e,i,r,t)}),(e=>{this.flushOutputBuffer(i),n(e,i.Output)}))}}}},{}],50:[function(e,t,r){t.exports=class{constructor(){this.ParseTree={}}addChild(e,t){return e.hasOwnProperty(t)||(e[t]={}),e[t]}addEndChild(e,t){return e.hasOwnProperty("PatternEnd")||(e.PatternEnd={}),e.PatternEnd[t]={},e.PatternEnd[t]}addPattern(e,t,r){if(e.length<1)return!1;if("string"==typeof t&&t.length<1)return!1;let n=this.ParseTree;for(var i=0;i<e.length;i++)n=this.addChild(n,e[i],i);n.hasOwnProperty("PatternEnd")||(n.PatternEnd={});let s="string"==typeof t?t:e;for(let e=0;e<s.length;e++)n=this.addEndChild(n,s[e],e);return n.PatternStartString=e,n.PatternEndString=s,n.Parse="function"==typeof r?r:"string"==typeof r?()=>r:e=>e,n}addPatternAsync(e,t,r){let n=this.addPattern(e,t,r);n&&(n.isAsync=!0)}}},{}],51:[function(e,t,r){t.exports={Metadata:{UUID:!1,Hash:!1,Title:"",Summary:"",Version:0},Status:{Completed:!1,CompletionProgress:0,CompletionTimeElapsed:0,Steps:1,StepsCompleted:0,StartTime:0,EndTime:0},Errors:[],Log:[]}},{}],52:[function(e,t,r){const n=e("../Fable-ServiceManager.js").ServiceProviderBase,i=JSON.stringify(e("./Fable-Service-Operation-DefaultSettings.js"));t.exports=class extends n{constructor(e,t,r){super(e,t,r),this.serviceType="PhasedOperation",this.state=JSON.parse(i),this.state.Metadata.Hash=this.Hash,this.state.Metadata.UUID=this.UUID,this.name="string"==typeof this.options.Name?this.options.Name:"Unnamed Operation ".concat(this.state.Metadata.UUID),this.log=this}writeOperationLog(e,t,r){this.state.Log.push("".concat((new Date).toUTCString()," [").concat(e,"]: ").concat(t)),"object"==typeof r&&this.state.Log.push(JSON.stringify(r))}writeOperationErrors(e,t){this.state.Errors.push("".concat(e)),"object"==typeof t&&this.state.Errors.push(JSON.stringify(t))}trace(e,t){this.writeOperationLog("TRACE",e,t),this.fable.log.trace(e,t)}debug(e,t){this.writeOperationLog("DEBUG",e,t),this.fable.log.debug(e,t)}info(e,t){this.writeOperationLog("INFO",e,t),this.fable.log.info(e,t)}warn(e,t){this.writeOperationLog("WARN",e,t),this.fable.log.warn(e,t)}error(e,t){this.writeOperationLog("ERROR",e,t),this.writeOperationErrors(e,t),this.fable.log.error(e,t)}fatal(e,t){this.writeOperationLog("FATAL",e,t),this.writeOperationErrors(e,t),this.fable.log.fatal(e,t)}}},{"../Fable-ServiceManager.js":39,"./Fable-Service-Operation-DefaultSettings.js":51}],53:[function(e,t,r){const n=e("../Fable-ServiceManager.js").ServiceProviderBase,i=e("simple-get"),s=e("cookie");t.exports=class extends n{constructor(e,t,r){super(e,t,r),this.TraceLog=!1,(this.options.TraceLog||this.fable.TraceLog)&&(this.TraceLog=!0),this.dataFormat=this.fable.services.DataFormat,this.serviceType="RestClient",this.cookie=!1,this.prepareRequestOptions=e=>e}prepareCookies(e){if(this.cookie){let t=this.cookie;e.hasOwnProperty("headers")||(e.headers={});let r=Object.keys(t);r.length>0&&(e.headers.cookie=s.serialize(r[0],t[r[0]]))}return e}preRequest(e){let t=this.prepareCookies(e);return this.prepareRequestOptions(t)}executeChunkedRequest(e,t){let r=this.preRequest(e);return r.RequestStartTime=this.fable.log.getTimeStamp(),this.TraceLog&&this.fable.log.debug("Beginning ".concat(r.method," request to ").concat(r.url," at ").concat(r.RequestStartTime)),i(r,((e,n)=>{if(e)return t(e,n);if(this.TraceLog){let e=this.fable.log.getTimeStamp();this.fable.log.debug("--\x3e ".concat(r.method," connected in ").concat(this.dataFormat.formatTimeDelta(r.RequestStartTime,e),"ms code ").concat(n.statusCode))}let i="";n.on("data",(e=>{if(this.TraceLog){let t=this.fable.log.getTimeStamp();this.fable.log.debug("--\x3e ".concat(r.method," data chunk size ").concat(e.length,"b received in ").concat(this.dataFormat.formatTimeDelta(r.RequestStartTime,t),"ms"))}i+=e})),n.on("end",(()=>{if(this.TraceLog){let e=this.fable.log.getTimeStamp();this.fable.log.debug("==> ".concat(r.method," completed data size ").concat(i.length,"b received in ").concat(this.dataFormat.formatTimeDelta(r.RequestStartTime,e),"ms"))}return t(e,n,i)}))}))}executeJSONRequest(e,t){e.json=!0;let r=this.preRequest(e);return r.hasOwnProperty("headers")||(r.headers={}),r.RequestStartTime=this.fable.log.getTimeStamp(),this.TraceLog&&this.fable.log.debug("Beginning ".concat(r.method," JSON request to ").concat(r.url," at ").concat(r.RequestStartTime)),i(r,((e,n)=>{if(e)return t(e,n);if(this.TraceLog){let e=this.fable.log.getTimeStamp();this.fable.log.debug("--\x3e JSON ".concat(r.method," connected in ").concat(this.dataFormat.formatTimeDelta(r.RequestStartTime,e),"ms code ").concat(n.statusCode))}let i="";n.on("data",(e=>{if(this.TraceLog){let t=this.fable.log.getTimeStamp();this.fable.log.debug("--\x3e JSON ".concat(r.method," data chunk size ").concat(e.length,"b received in ").concat(this.dataFormat.formatTimeDelta(r.RequestStartTime,t),"ms"))}i+=e})),n.on("end",(()=>{if(this.TraceLog){let e=this.fable.log.getTimeStamp();this.fable.log.debug("==> JSON ".concat(r.method," completed - received in ").concat(this.dataFormat.formatTimeDelta(r.RequestStartTime,e),"ms"))}return t(e,n,JSON.parse(i))}))}))}getJSON(e,t){let r="object"==typeof e?e:{};return"string"==typeof e&&(r.url=e),r.method="GET",this.executeJSONRequest(r,t)}putJSON(e,t){return"object"!=typeof e.body?t(new Error("PUT JSON Error Invalid options object")):(e.method="PUT",this.executeJSONRequest(e,t))}postJSON(e,t){return"object"!=typeof e.body?t(new Error("POST JSON Error Invalid options object")):(e.method="POST",this.executeJSONRequest(e,t))}patchJSON(e,t){return"object"!=typeof e.body?t(new Error("PATCH JSON Error Invalid options object")):(e.method="PATCH",this.executeJSONRequest(e,t))}headJSON(e,t){return"object"!=typeof e.body?t(new Error("HEAD JSON Error Invalid options object")):(e.method="HEAD",this.executeJSONRequest(e,t))}delJSON(e,t){return e.method="DELETE",this.executeJSONRequest(e,t)}getRawText(e,t){let r="object"==typeof e?e:{};return"string"==typeof e&&(r.url=e),r.method="GET",this.executeChunkedRequest(r,t)}}},{"../Fable-ServiceManager.js":39,cookie:24,"simple-get":84}],54:[function(e,t,r){const n=e("../Fable-ServiceManager.js").ServiceProviderBase;t.exports=class extends n{constructor(e,t,r){super(e,t,r),this.serviceType="Template",this.Matchers={Evaluate:/<%([\s\S]+?)%>/g,Interpolate:/<%=([\s\S]+?)%>/g,Escaper:/\\|'|\r|\n|\t|\u2028|\u2029/g,Unescaper:/\\(\\|'|r|n|t|u2028|u2029)/g,GuaranteedNonMatch:/.^/},this.templateEscapes={"\\":"\\","'":"'",r:"\r","\r":"r",n:"\n","\n":"n",t:"\t","\t":"t",u2028:"\u2028","\u2028":"u2028",u2029:"\u2029","\u2029":"u2029"},this.renderFunction=!1,this.templateString=!1}renderTemplate(e){return this.renderFunction(e)}templateFunction(e){return this.renderTemplate.bind(this)}buildTemplateFunction(e,t){return this.TemplateSource="__p+='"+e.replace(this.Matchers.Escaper,(e=>"\\".concat(this.templateEscapes[e]))).replace(this.Matchers.Interpolate||this.Matchers.GuaranteedNonMatch,((e,t)=>"'+\n(".concat(decodeURIComponent(t),")+\n'"))).replace(this.Matchers.Evaluate||this.Matchers.GuaranteedNonMatch,((e,t)=>"';\n".concat(decodeURIComponent(t),"\n;__p+='")))+"';\n",this.TemplateSource="with(pTemplateDataObject||{}){\n".concat(this.TemplateSource,"}\n"),this.TemplateSource="var __p='';var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n".concat(this.TemplateSource,"return __p;\n"),this.renderFunction=new Function("pTemplateDataObject",this.TemplateSource),void 0!==t?this.renderFunction(t):(this.TemplateSourceCompiled="function(obj){\n"+this.TemplateSource+"}",this.templateFunction())}}},{"../Fable-ServiceManager.js":39}],55:[function(e,t,r){const n=e("../Fable-ServiceManager.js").ServiceProviderBase,i=e("async.waterfall"),s=e("async.eachlimit");t.exports=class extends n{constructor(e,t,r){super(e,t,r),this.templates={},this.waterfall=i,this.eachLimit=s}extend(e){for(let t=0;t<(arguments.length<=1?0:arguments.length-1);t++){let r=t+1<1||arguments.length<=t+1?void 0:arguments[t+1];if("object"==typeof r){let t=Object.keys(r);for(let n=0;n<t.length;n++)e[t[n]]=r[t[n]]}}return e}template(e,t){return this.fable.serviceManager.instantiateServiceProviderWithoutRegistration("Template").buildTemplateFunction(e,t)}buildHashedTemplate(e,t,r){let n=this.fable.serviceManager.instantiateServiceProvider("Template",{},e);return this.templates[e]=n.buildTemplateFunction(t,r),this.templates[e]}chunk(e,t,r){let n=[...e],i="number"==typeof t?t:0,s=void 0!==r?r:[];if(i<=0)return s;for(;n.length;)s.push(n.splice(0,i));return s}isoStringToDate(e){let t=e.split(/\D+/),r=new Date,n=0,i=0;return r.setUTCFullYear(parseInt(t[0])),r.setUTCMonth(parseInt(t[1]-1)),r.setUTCDate(parseInt(t[2])),r.setUTCHours(parseInt(t[3])),r.setUTCMinutes(parseInt(t[4])),r.setUTCSeconds(parseInt(t[5])),r.setUTCMilliseconds(parseInt(t[6])),(t[7]||t[8])&&(t[8]&&(i=parseInt(t[8])/60),n=parseInt(t[7])+i,"+"==e.substr(-6,1)&&(n*=-1)),r.setHours(r.getHours()+n),r}}},{"../Fable-ServiceManager.js":39,"async.eachlimit":1,"async.waterfall":15}],56:[function(e,t,r){var n=e("http"),i=e("url"),s=t.exports;for(var o in n)n.hasOwnProperty(o)&&(s[o]=n[o]);function a(e){if("string"==typeof e&&(e=i.parse(e)),e.protocol||(e.protocol="https:"),"https:"!==e.protocol)throw new Error('Protocol "'+e.protocol+'" not supported. Expected "https:"');return e}s.request=function(e,t){return e=a(e),n.request.call(this,e,t)},s.get=function(e,t){return e=a(e),n.get.call(this,e,t)}},{http:85,url:106}],57:[function(e,t,r){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */r.read=function(e,t,r,n,i){var s,o,a=8*i-n-1,c=(1<<a)-1,l=c>>1,h=-7,u=r?i-1:0,f=r?-1:1,p=e[t+u];for(u+=f,s=p&(1<<-h)-1,p>>=-h,h+=a;h>0;s=256*s+e[t+u],u+=f,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=n;h>0;o=256*o+e[t+u],u+=f,h-=8);if(0===s)s=1-l;else{if(s===c)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),s-=l}return(p?-1:1)*o*Math.pow(2,s-n)},r.write=function(e,t,r,n,i,s){var o,a,c,l=8*s-i-1,h=(1<<l)-1,u=h>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:s-1,d=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+u>=1?f/c:f*Math.pow(2,1-u))*c>=2&&(o++,c/=2),o+u>=h?(a=0,o=h):o+u>=1?(a=(t*c-1)*Math.pow(2,i),o+=u):(a=t*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;e[r+p]=255&a,p+=d,a/=256,i-=8);for(o=o<<i|a,l+=i;l>0;e[r+p]=255&o,p+=d,o/=256,l-=8);e[r+p-d]|=128*g}},{}],58:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},{}],59:[function(e,t,r){t.exports=(e,t)=>t.startsWith(e)&&t.endsWith(e)?t.substring(1,t.length-1):t},{}],60:[function(e,t,r){let n=e("./Manyfest-LogToConsole.js");t.exports=class{constructor(e,t){this.logInfo="function"==typeof e?e:n,this.logError="function"==typeof t?t:n,this.translationTable={}}translationCount(){return Object.keys(this.translationTable).length}addTranslation(e){if("object"!=typeof e)return this.logError("Hash translation addTranslation expected a translation be type object but was passed in ".concat(typeof e)),!1;Object.keys(e).forEach((t=>{"string"!=typeof e[t]?this.logError("Hash translation addTranslation expected a translation destination hash for [".concat(t,"] to be a string but the referrant was a ").concat(typeof e[t])):this.translationTable[t]=e[t]}))}removeTranslationHash(e){this.translationTable.hasOwnProperty(e)&&delete this.translationTable[e]}removeTranslation(e){if("string"==typeof e)return this.removeTranslationHash(e),!0;if("object"==typeof e){return Object.keys(e).forEach((e=>{this.removeTranslation(e)})),!0}return this.logError("Hash translation removeTranslation expected either a string or an object but the passed-in translation was type ".concat(typeof e)),!1}clearTranslations(){this.translationTable={}}translate(e){return this.translationTable.hasOwnProperty(e)?this.translationTable[e]:e}}},{"./Manyfest-LogToConsole.js":61}],61:[function(e,t,r){t.exports=(e,t)=>{let r="string"==typeof e?e:"";console.log("[Manyfest] ".concat(r)),t&&console.log(JSON.stringify(t))}},{}],62:[function(e,t,r){let n=e("./Manyfest-LogToConsole.js");t.exports=class{constructor(e,t){this.logInfo="function"==typeof e?e:n,this.logError="function"==typeof t?t:n}checkAddressExists(e,t){if("object"!=typeof e)return!1;if("string"!=typeof t)return!1;let r=t.indexOf(".");if(-1==r){let r=t.indexOf("["),n=t.indexOf("]");if(r>0&&n>r&&n-r>1){let i=t.substring(0,r).trim();if("object"!=typeof e[i])return!1;let s=t.substring(r+1,n).trim(),o=parseInt(s,10);return Array.isArray(e[i])!=isNaN(o)&&(isNaN(o)?(s=this.cleanWrapCharacters('"',s),s=this.cleanWrapCharacters("`",s),s=this.cleanWrapCharacters("'",s),e[i].hasOwnProperty(s)):o in e[i])}return e.hasOwnProperty(t)}{let n=t.substring(0,r),i=t.substring(r+1),s=n.indexOf("["),o=n.indexOf("]");if(s>0&&o>s&&o-s>1){let t=n.substring(0,s).trim(),r=n.substring(s+1,o).trim(),a=parseInt(r,10);return Array.isArray(e[t])!=isNaN(a)&&(isNaN(a)?(r=this.cleanWrapCharacters('"',r),r=this.cleanWrapCharacters("`",r),r=this.cleanWrapCharacters("'",r),this.checkAddressExists(e[t][r],i)):this.checkAddressExists(e[t][a],i))}return(!e.hasOwnProperty(n)||"object"==typeof e[n])&&(e.hasOwnProperty(n)||(e[n]={}),this.checkAddressExists(e[n],i))}}}},{"./Manyfest-LogToConsole.js":61}],63:[function(e,t,r){let n=e("./Manyfest-LogToConsole.js"),i=e("./Manyfest-CleanWrapCharacters.js"),s=e("../source/Manyfest-ParseConditionals.js");t.exports=class{constructor(e,t){this.logInfo="function"==typeof e?e:n,this.logError="function"==typeof t?t:n,this.cleanWrapCharacters=i}checkFilters(e,t){return s(this,e,t)}deleteValueAtAddress(e,t,r){if("object"!=typeof e)return;if("string"!=typeof t)return;let n="";"string"==typeof r&&(n=r);let i=t.indexOf(".");if(-1==i){let r=t.indexOf("["),n=t.indexOf("]"),i=t.indexOf("{}");if(r>0&&n>r&&n-r>1){let i=t.substring(0,r).trim();if("object"!=typeof e[i])return!1;let s=t.substring(r+1,n).trim(),o=parseInt(s,10);return Array.isArray(e[i])!=isNaN(o)&&(isNaN(o)?(s=this.cleanWrapCharacters('"',s),s=this.cleanWrapCharacters("`",s),s=this.cleanWrapCharacters("'",s),delete e[i][s],!0):(delete e[i][o],!0))}if(r>0&&n>r&&n-r==1){let n=t.substring(0,r).trim();if(!Array.isArray(e[n]))return!1;let i=e[n];for(let e=i.length-1;e>=0;e--){this.checkFilters(t,i[e])&&i.splice(e,1)}return!0}if(i>0){let r=t.substring(0,i).trim();return"object"==typeof e[r]&&(delete e[r],!0)}return delete e[t],!0}{let r=t.substring(0,i),s=t.substring(i+1),o=r.indexOf("["),a=r.indexOf("]");if(o>0&&a>o&&a-o>1){let t=r.substring(0,o).trim(),i=r.substring(o+1,a).trim(),c=parseInt(i,10);return Array.isArray(e[t])!=isNaN(c)&&("object"==typeof e[t]&&(isNaN(c)?(i=this.cleanWrapCharacters('"',i),i=this.cleanWrapCharacters("`",i),i=this.cleanWrapCharacters("'",i),n="".concat(n).concat(n.length>0?".":"").concat(r),this.deleteValueAtAddress(e[t][i],s,n)):(n="".concat(n).concat(n.length>0?".":"").concat(r),this.deleteValueAtAddress(e[t][c],s,n))))}if(o>0&&a>o&&a-o==1){let r=t.substring(0,o).trim();if(!Array.isArray(e[r]))return!1;let i=e[r];n="".concat(n).concat(n.length>0?".":"").concat(r);let a={};for(let t=0;t<i.length;t++){let i="".concat(n,"[").concat(t,"]"),o=this.deleteValueAtAddress(e[r][t],s,i);a["".concat(i,".").concat(s)]=o}return a}let c=t.indexOf("{}");if(c>0){let r=t.substring(0,c).trim();if("object"!=typeof e[r])return!1;let i=e[r],o=Object.keys(i);n="".concat(n).concat(n.length>0?".":"").concat(r);let a={};for(let i=0;i<o.length;i++){let c="".concat(n,".").concat(o[i]),l=this.deleteValueAtAddress(e[r][o[i]],s,c);this.checkFilters(t,l)&&(a["".concat(c,".").concat(s)]=l)}return a}return e.hasOwnProperty(r)&&"object"!=typeof e[r]?void 0:e.hasOwnProperty(r)?(n="".concat(n).concat(n.length>0?".":"").concat(r),this.deleteValueAtAddress(e[r],s,n)):(n="".concat(n).concat(n.length>0?".":"").concat(r),e[r]={},this.deleteValueAtAddress(e[r],s,n))}}}},{"../source/Manyfest-ParseConditionals.js":67,"./Manyfest-CleanWrapCharacters.js":59,"./Manyfest-LogToConsole.js":61}],64:[function(e,t,r){let n=e("./Manyfest-LogToConsole.js"),i=e("./Manyfest-CleanWrapCharacters.js"),s=e("../source/Manyfest-ParseConditionals.js");t.exports=class{constructor(e,t){this.logInfo="function"==typeof e?e:n,this.logError="function"==typeof t?t:n,this.cleanWrapCharacters=i}checkFilters(e,t){return s(this,e,t)}getValueAtAddress(e,t,r,n){if("object"!=typeof e)return;if("string"!=typeof t)return;let i="";"string"==typeof r&&(i=r);let s=void 0===n?e:n,o=t.indexOf(".");if(0==o){let e=i.split("."),r=0;for(let e=0;e<t.length&&"."==t.charAt(e);e++)r++;let n=e.length-r;if(n<0)return;{let i=t.slice(r);return n>0&&(i="".concat(e.slice(0,n).join("."),".").concat(i)),this.logInfo("Back-navigation detected. Recursing back to address [".concat(i,"]")),this.getValueAtAddress(s,i)}}if(-1==o){let r=t.indexOf("["),n=t.indexOf("]"),i=t.indexOf("{}");if(r>0&&n>r&&n-r>1){let i=t.substring(0,r).trim();if("object"!=typeof e[i])return;let s=t.substring(r+1,n).trim(),o=parseInt(s,10);if(Array.isArray(e[i])==isNaN(o))return;return isNaN(o)?(s=this.cleanWrapCharacters('"',s),s=this.cleanWrapCharacters("`",s),s=this.cleanWrapCharacters("'",s),e[i][s]):e[i][o]}if(r>0&&n>r&&n-r==1){let n=t.substring(0,r).trim();if(!Array.isArray(e[n]))return!1;let i=e[n],s=[];for(let e=0;e<i.length;e++){this.checkFilters(t,i[e])&&s.push(i[e])}return s}if(i>0){let r=t.substring(0,i).trim();return"object"==typeof e[r]&&e[r]}return e[t]}{let r=t.substring(0,o),n=t.substring(o+1),a=r.indexOf("["),c=r.indexOf("]");if(a>0&&c>a&&c-a>1){let t=r.substring(0,a).trim(),o=r.substring(a+1,c).trim(),l=parseInt(o,10);if(Array.isArray(e[t])==isNaN(l))return;if("object"!=typeof e[t])return;return isNaN(l)?(o=this.cleanWrapCharacters('"',o),o=this.cleanWrapCharacters("`",o),o=this.cleanWrapCharacters("'",o),i="".concat(i).concat(i.length>0?".":"").concat(r),this.getValueAtAddress(e[t][o],n,i,s)):(i="".concat(i).concat(i.length>0?".":"").concat(r),this.getValueAtAddress(e[t][l],n,i,s))}if(a>0&&c>a&&c-a==1){let r=t.substring(0,a).trim();if(!Array.isArray(e[r]))return!1;let o=e[r];i="".concat(i).concat(i.length>0?".":"").concat(r);let c={};for(let t=0;t<o.length;t++){let o="".concat(i,"[").concat(t,"]"),a=this.getValueAtAddress(e[r][t],n,o,s);c["".concat(o,".").concat(n)]=a}return c}let l=t.indexOf("{}");if(l>0){let r=t.substring(0,l).trim();if("object"!=typeof e[r])return!1;let o=e[r],a=Object.keys(o);i="".concat(i).concat(i.length>0?".":"").concat(r);let c={};for(let o=0;o<a.length;o++){let l="".concat(i,".").concat(a[o]),h=this.getValueAtAddress(e[r][a[o]],n,l,s);this.checkFilters(t,h)&&(c["".concat(l,".").concat(n)]=h)}return c}return e.hasOwnProperty(r)&&"object"!=typeof e[r]?void 0:e.hasOwnProperty(r)?(i="".concat(i).concat(i.length>0?".":"").concat(r),this.getValueAtAddress(e[r],n,i,s)):(i="".concat(i).concat(i.length>0?".":"").concat(r),e[r]={},this.getValueAtAddress(e[r],n,i,s))}}}},{"../source/Manyfest-ParseConditionals.js":67,"./Manyfest-CleanWrapCharacters.js":59,"./Manyfest-LogToConsole.js":61}],65:[function(e,t,r){let n=e("./Manyfest-LogToConsole.js"),i=e("./Manyfest-CleanWrapCharacters.js");t.exports=class{constructor(e,t){this.logInfo="function"==typeof e?e:n,this.logError="function"==typeof t?t:n,this.cleanWrapCharacters=i}setValueAtAddress(e,t,r){if("object"!=typeof e)return!1;if("string"!=typeof t)return!1;let n=t.indexOf(".");if(-1==n){let n=t.indexOf("["),i=t.indexOf("]");if(n>0&&i>n&&i-n>1){let s=t.substring(0,n).trim();if("object"!=typeof e[s])return!1;let o=t.substring(n+1,i).trim(),a=parseInt(o,10);return Array.isArray(e[s])!=isNaN(a)&&(isNaN(a)?(o=this.cleanWrapCharacters('"',o),o=this.cleanWrapCharacters("`",o),o=this.cleanWrapCharacters("'",o),e[s][o]=r,!0):(e[s][a]=r,!0))}return e[t]=r,!0}{let i=t.substring(0,n),s=t.substring(n+1),o=i.indexOf("["),a=i.indexOf("]");if(o>0&&a>o&&a-o>1){let t=i.substring(0,o).trim(),n=i.substring(o+1,a).trim(),c=parseInt(n,10);return Array.isArray(e[t])!=isNaN(c)&&(isNaN(c)?(n=this.cleanWrapCharacters('"',n),n=this.cleanWrapCharacters("`",n),n=this.cleanWrapCharacters("'",n),this.setValueAtAddress(e[t][n],s,r)):this.setValueAtAddress(e[t][c],s,r))}return e.hasOwnProperty(i)&&"object"!=typeof e[i]?(e.hasOwnProperty("__ERROR")||(e.__ERROR={}),e.__ERROR[t]=r,!1):(e.hasOwnProperty(i)||(e[i]={}),this.setValueAtAddress(e[i],s,r))}}}},{"./Manyfest-CleanWrapCharacters.js":59,"./Manyfest-LogToConsole.js":61}],66:[function(e,t,r){let n=e("./Manyfest-LogToConsole.js");t.exports=class{constructor(e,t){this.logInfo="function"==typeof e?e:n,this.logError="function"==typeof t?t:n}generateAddressses(e,t,r){let n="string"==typeof t?t:"",i="object"==typeof r?r:{},s=typeof e,o={Address:n,Hash:n,Name:n,InSchema:!1};switch("object"==s&&null==e&&(s="null"),s){case"string":o.DataType="String",o.Default=e,i[n]=o;break;case"number":case"bigint":o.DataType="Number",o.Default=e,i[n]=o;break;case"undefined":case"null":o.DataType="Any",o.Default=e,i[n]=o;break;case"object":if(Array.isArray(e)){o.DataType="Array",""!=n&&(i[n]=o);for(let t=0;t<e.length;t++)this.generateAddressses(e[t],"".concat(n,"[").concat(t,"]"),i)}else{o.DataType="Object",""!=n&&(i[n]=o,n+=".");let t=Object.keys(e);for(let r=0;r<t.length;r++)this.generateAddressses(e[t[r]],"".concat(n).concat(t[r]),i)}}return i}}},{"./Manyfest-LogToConsole.js":61}],67:[function(e,t,r){const n="<<~?",i="?~>>",s=(e,t,r,n,i)=>{switch(n){case"!=":return e.getValueAtAddress(t,r)!=i;case"<":return e.getValueAtAddress(t,r)<i;case">":return e.getValueAtAddress(t,r)>i;case"<=":return e.getValueAtAddress(t,r)<=i;case">=":return e.getValueAtAddress(t,r)>=i;case"===":return e.getValueAtAddress(t,r)===i;default:return e.getValueAtAddress(t,r)==i}};t.exports=(e,t,r)=>{let o=!0,a=t.indexOf(n);for(;-1!=a;){let c=t.indexOf(i,a+4);if(-1!=c){let i=t.substring(a+4,c).split(","),l=i[0],h=i[1],u=i[2];o=o&&s(e,r,l,h,u),a=t.indexOf(n,c+4)}else a=-1}return o}},{}],68:[function(e,t,r){let n=e("./Manyfest-LogToConsole.js");t.exports=class{constructor(e,t){this.logInfo="function"==typeof e?e:n,this.logError="function"==typeof t?t:n}resolveAddressMappings(e,t){if("object"!=typeof e)return this.logError("Attempted to resolve address mapping but the descriptor was not an object."),!1;if("object"!=typeof t)return!0;let r=Object.keys(e),n={};return r.forEach((t=>{e[t].hasOwnProperty("Hash")&&(n[e[t].Hash]=t)})),Object.keys(t).forEach((r=>{let i=t[r],s=!1,o=!1;e.hasOwnProperty(r)?s=r:n.hasOwnProperty(r)&&(s=n[r]),s?(o=e[s],delete e[s]):o={Hash:r},e[i]=o})),!0}safeResolveAddressMappings(e,t){let r=JSON.parse(JSON.stringify(e));return this.resolveAddressMappings(r,t),r}mergeAddressMappings(e,t){if("object"!=typeof t||"object"!=typeof e)return this.logError("Attempted to merge two schema descriptors but both were not objects."),!1;let r=JSON.parse(JSON.stringify(t)),n=JSON.parse(JSON.stringify(e));return Object.keys(r).forEach((e=>{n.hasOwnProperty(e)||(n[e]=r[e])})),n}}},{"./Manyfest-LogToConsole.js":61}],69:[function(e,t,r){const n=e("fable-serviceproviderbase");let i=e("./Manyfest-LogToConsole.js"),s=e("./Manyfest-HashTranslation.js"),o=e("./Manyfest-ObjectAddress-CheckAddressExists.js"),a=e("./Manyfest-ObjectAddress-GetValue.js"),c=e("./Manyfest-ObjectAddress-SetValue.js"),l=e("./Manyfest-ObjectAddress-DeleteValue.js"),h=e("./Manyfest-ObjectAddressGeneration.js"),u=e("./Manyfest-SchemaManipulation.js");const f={Scope:"DEFAULT",Descriptors:{}};class p extends n{constructor(e,t,r){void 0===e?super({}):super(e,t,r),this.serviceType="Manifest",this.logInfo=i,this.logError=i,this.objectAddressCheckAddressExists=new o(this.logInfo,this.logError),this.objectAddressGetValue=new a(this.logInfo,this.logError),this.objectAddressSetValue=new c(this.logInfo,this.logError),this.objectAddressDeleteValue=new l(this.logInfo,this.logError),this.options.hasOwnProperty("defaultValues")||(this.options.defaultValues={String:"",Number:0,Float:0,Integer:0,Boolean:!1,Binary:0,DateTime:0,Array:[],Object:{},Null:null}),this.options.hasOwnProperty("strict")||(this.options.strict=!1),this.scope=void 0,this.elementAddresses=void 0,this.elementHashes=void 0,this.elementDescriptors=void 0,this.reset(),"object"==typeof this.options&&this.loadManifest(this.options),this.schemaManipulations=new u(this.logInfo,this.logError),this.objectAddressGeneration=new h(this.logInfo,this.logError),this.hashTranslations=new s(this.logInfo,this.logError)}reset(){this.scope="DEFAULT",this.elementAddresses=[],this.elementHashes={},this.elementDescriptors={}}clone(){let e=JSON.parse(JSON.stringify(this.options)),t=new p(this.getManifest(),this.logInfo,this.logError,e);return t.hashTranslations.addTranslation(this.hashTranslations.translationTable),t}deserialize(e){return this.loadManifest(JSON.parse(e))}loadManifest(e){"object"!=typeof e&&this.logError("(".concat(this.scope,") Error loading manifest; expecting an object but parameter was type ").concat(typeof e,"."));let t="object"==typeof e?e:{},r=Object.keys(f);for(let e=0;e<r.length;e++)t.hasOwnProperty(r[e])||(t[r[e]]=JSON.parse(JSON.stringify(f[r[e]])));if(t.hasOwnProperty("Scope")?"string"==typeof t.Scope?this.scope=t.Scope:this.logError("(".concat(this.scope,") Error loading scope from manifest; expecting a string but property was type ").concat(typeof t.Scope,"."),t):this.logError("(".concat(this.scope,') Error loading scope from manifest object. Property "Scope" does not exist in the root of the object.'),t),t.hasOwnProperty("Descriptors"))if("object"==typeof t.Descriptors){let e=Object.keys(t.Descriptors);for(let r=0;r<e.length;r++)this.addDescriptor(e[r],t.Descriptors[e[r]])}else this.logError("(".concat(this.scope,") Error loading description object from manifest object. Expecting an object in 'Manifest.Descriptors' but the property was type ").concat(typeof t.Descriptors,"."),t);else this.logError("(".concat(this.scope,') Error loading object description from manifest object. Property "Descriptors" does not exist in the root of the Manifest object.'),t);if(t.hasOwnProperty("HashTranslations")&&"object"==typeof t.HashTranslations)for(let e=0;e<t.HashTranslations.length;e++);}serialize(){return JSON.stringify(this.getManifest())}getManifest(){return{Scope:this.scope,Descriptors:JSON.parse(JSON.stringify(this.elementDescriptors)),HashTranslations:JSON.parse(JSON.stringify(this.hashTranslations.translationTable))}}addDescriptor(e,t){return"object"==typeof t?(t.hasOwnProperty("Address")||(t.Address=e),this.elementDescriptors.hasOwnProperty(e)||this.elementAddresses.push(e),this.elementDescriptors[e]=t,this.elementHashes[e]=e,t.hasOwnProperty("Hash")?this.elementHashes[t.Hash]=e:t.Hash=e,!0):(this.logError("(".concat(this.scope,") Error loading object descriptor for address '").concat(e,"' from manifest object. Expecting an object but property was type ").concat(typeof t,".")),!1)}getDescriptorByHash(e){return this.getDescriptor(this.resolveHashAddress(e))}getDescriptor(e){return this.elementDescriptors[e]}eachDescriptor(e){let t=Object.keys(this.elementDescriptors);for(let r=0;r<t.length;r++)e(this.elementDescriptors[t[r]])}checkAddressExistsByHash(e,t){return this.checkAddressExists(e,this.resolveHashAddress(t))}checkAddressExists(e,t){return this.objectAddressCheckAddressExists.checkAddressExists(e,t)}resolveHashAddress(e){let t,r=this.elementHashes.hasOwnProperty(e),n=this.hashTranslations.translationTable.hasOwnProperty(e);return t=r&&!n?this.elementHashes[e]:n&&this.elementHashes.hasOwnProperty(this.hashTranslations.translate(e))?this.elementHashes[this.hashTranslations.translate(e)]:n?this.hashTranslations.translate(e):e,t}getValueByHash(e,t){let r=this.getValueAtAddress(e,this.resolveHashAddress(t));return void 0===r&&(r=this.getDefaultValue(this.getDescriptorByHash(t))),r}getValueAtAddress(e,t){let r=this.objectAddressGetValue.getValueAtAddress(e,t);return void 0===r&&(r=this.getDefaultValue(this.getDescriptor(t))),r}setValueByHash(e,t,r){return this.setValueAtAddress(e,this.resolveHashAddress(t),r)}setValueAtAddress(e,t,r){return this.objectAddressSetValue.setValueAtAddress(e,t,r)}deleteValueByHash(e,t,r){return this.deleteValueAtAddress(e,this.resolveHashAddress(t),r)}deleteValueAtAddress(e,t,r){return this.objectAddressDeleteValue.deleteValueAtAddress(e,t,r)}validate(e){let t={Error:null,Errors:[],MissingElements:[]};"object"!=typeof e&&(t.Error=!0,t.Errors.push("Expected passed in object to be type object but was passed in ".concat(typeof e)));let r=(e,r)=>{t.Error=!0,t.Errors.push('Element at address "'.concat(e,'" ').concat(r,"."))};for(let n=0;n<this.elementAddresses.length;n++){let i=this.getDescriptor(this.elementAddresses[n]),s=this.checkAddressExists(e,i.Address),o=this.getValueAtAddress(e,i.Address);if(void 0!==o&&s||(t.MissingElements.push(i.Address),(i.Required||this.options.strict)&&r(i.Address,"is flagged REQUIRED but is not set in the object")),i.DataType){let e=typeof o;switch(i.DataType.toString().trim().toLowerCase()){case"string":"string"!=e&&r(i.Address,"has a DataType ".concat(i.DataType," but is of the type ").concat(e));break;case"number":"number"!=e&&r(i.Address,"has a DataType ".concat(i.DataType," but is of the type ").concat(e));break;case"integer":if("number"!=e)r(i.Address,"has a DataType ".concat(i.DataType," but is of the type ").concat(e));else{o.toString().indexOf(".")>-1&&r(i.Address,"has a DataType ".concat(i.DataType," but has a decimal point in the number."))}break;case"float":"number"!=e&&r(i.Address,"has a DataType ".concat(i.DataType," but is of the type ").concat(e));break;case"DateTime":"Invalid Date"==new Date(o).toString()&&r(i.Address,"has a DataType ".concat(i.DataType," but is not parsable as a Date by Javascript"));default:"string"!=e&&r(i.Address,"has a DataType ".concat(i.DataType," (which auto-converted to String because it was unrecognized) but is of the type ").concat(e))}}}return t}getDefaultValue(e){if("object"==typeof e){if(e.hasOwnProperty("Default"))return e.Default;{let t=e.hasOwnProperty("DataType")?e.DataType:"String";return this.options.defaultValues.hasOwnProperty(t)?this.options.defaultValues[t]:null}}}populateDefaults(e,t){return this.populateObject(e,t,(e=>e.hasOwnProperty("Default")))}populateObject(e,t,r){let n="object"==typeof e?e:{},i=void 0!==t&&t,s="function"==typeof r?r:e=>!0;return this.elementAddresses.forEach((e=>{let t=this.getDescriptor(e);s(t)&&(!i&&this.checkAddressExists(n,e)||this.setValueAtAddress(n,e,this.getDefaultValue(t)))})),n}}t.exports=p},{"./Manyfest-HashTranslation.js":60,"./Manyfest-LogToConsole.js":61,"./Manyfest-ObjectAddress-CheckAddressExists.js":62,"./Manyfest-ObjectAddress-DeleteValue.js":63,"./Manyfest-ObjectAddress-GetValue.js":64,"./Manyfest-ObjectAddress-SetValue.js":65,"./Manyfest-ObjectAddressGeneration.js":66,"./Manyfest-SchemaManipulation.js":68,"fable-serviceproviderbase":33}],70:[function(e,t,r){var n=e("wrappy");function i(e){var t=function t(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function s(e){var t=function t(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}t.exports=n(i),t.exports.strict=n(s),i.proto=i((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return i(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return s(this)},configurable:!0})}))},{wrappy:109}],71:[function(e,t,r){(function(e){(function(){function r(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var r,n="",i=0,s=-1,o=0,a=0;a<=e.length;++a){if(a<e.length)r=e.charCodeAt(a);else{if(47===r)break;r=47}if(47===r){if(s===a-1||1===o);else if(s!==a-1&&2===o){if(n.length<2||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var c=n.lastIndexOf("/");if(c!==n.length-1){-1===c?(n="",i=0):i=(n=n.slice(0,c)).length-1-n.lastIndexOf("/"),s=a,o=0;continue}}else if(2===n.length||1===n.length){n="",i=0,s=a,o=0;continue}t&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+e.slice(s+1,a):n=e.slice(s+1,a),i=a-s-1;s=a,o=0}else 46===r&&-1!==o?++o:o=-1}return n}var i={resolve:function(){for(var t,i="",s=!1,o=arguments.length-1;o>=-1&&!s;o--){var a;o>=0?a=arguments[o]:(void 0===t&&(t=e.cwd()),a=t),r(a),0!==a.length&&(i=a+"/"+i,s=47===a.charCodeAt(0))}return i=n(i,!s),s?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(e){if(r(e),0===e.length)return".";var t=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!t)).length||t||(e="."),e.length>0&&i&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return r(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t<arguments.length;++t){var n=arguments[t];r(n),n.length>0&&(void 0===e?e=n:e+="/"+n)}return void 0===e?".":i.normalize(e)},relative:function(e,t){if(r(e),r(t),e===t)return"";if((e=i.resolve(e))===(t=i.resolve(t)))return"";for(var n=1;n<e.length&&47===e.charCodeAt(n);++n);for(var s=e.length,o=s-n,a=1;a<t.length&&47===t.charCodeAt(a);++a);for(var c=t.length-a,l=o<c?o:c,h=-1,u=0;u<=l;++u){if(u===l){if(c>l){if(47===t.charCodeAt(a+u))return t.slice(a+u+1);if(0===u)return t.slice(a+u)}else o>l&&(47===e.charCodeAt(n+u)?h=u:0===u&&(h=0));break}var f=e.charCodeAt(n+u);if(f!==t.charCodeAt(a+u))break;47===f&&(h=u)}var p="";for(u=n+h+1;u<=s;++u)u!==s&&47!==e.charCodeAt(u)||(0===p.length?p+="..":p+="/..");return p.length>0?p+t.slice(a+h):(a+=h,47===t.charCodeAt(a)&&++a,t.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(r(e),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,i=-1,s=!0,o=e.length-1;o>=1;--o)if(47===(t=e.charCodeAt(o))){if(!s){i=o;break}}else s=!1;return-1===i?n?"/":".":n&&1===i?"//":e.slice(0,i)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');r(e);var n,i=0,s=-1,o=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var a=t.length-1,c=-1;for(n=e.length-1;n>=0;--n){var l=e.charCodeAt(n);if(47===l){if(!o){i=n+1;break}}else-1===c&&(o=!1,c=n+1),a>=0&&(l===t.charCodeAt(a)?-1==--a&&(s=n):(a=-1,s=c))}return i===s?s=c:-1===s&&(s=e.length),e.slice(i,s)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!o){i=n+1;break}}else-1===s&&(o=!1,s=n+1);return-1===s?"":e.slice(i,s)},extname:function(e){r(e);for(var t=-1,n=0,i=-1,s=!0,o=0,a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(47!==c)-1===i&&(s=!1,i=a+1),46===c?-1===t?t=a:1!==o&&(o=1):-1!==t&&(o=-1);else if(!s){n=a+1;break}}return-1===t||-1===i||0===o||1===o&&t===i-1&&t===n+1?"":e.slice(t,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+e+n:n}("/",e)},parse:function(e){r(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var n,i=e.charCodeAt(0),s=47===i;s?(t.root="/",n=1):n=0;for(var o=-1,a=0,c=-1,l=!0,h=e.length-1,u=0;h>=n;--h)if(47!==(i=e.charCodeAt(h)))-1===c&&(l=!1,c=h+1),46===i?-1===o?o=h:1!==u&&(u=1):-1!==o&&(u=-1);else if(!l){a=h+1;break}return-1===o||-1===c||0===u||1===u&&o===c-1&&o===a+1?-1!==c&&(t.base=t.name=0===a&&s?e.slice(1,c):e.slice(a,c)):(0===a&&s?(t.name=e.slice(1,o),t.base=e.slice(1,c)):(t.name=e.slice(a,o),t.base=e.slice(a,c)),t.ext=e.slice(o,c)),a>0?t.dir=e.slice(0,a-1):s&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};i.posix=i,t.exports=i}).call(this)}).call(this,e("_process"))},{_process:77}],72:[function(e,t,r){const n=e("fable-serviceproviderbase"),i={Name:"DefaultPictApplication",MainViewportViewIdentifier:"Default-View",MainViewportRenderableHash:!1,MainViewportDestinationAddress:!1,MainViewportDefaultDataAddress:!1,AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!0,Manifests:{},IdentifierAddressPrefix:"PICT-"};t.exports=class extends n{constructor(e,t,r){super(e,Object.assign({},JSON.parse(JSON.stringify(i)),t),r),this.serviceType="PictApplication",this.pict=this.fable,this.AppData=this.fable.AppData,this.initializeTimestamp=!1,this.lastSolvedTimestamp=!1;let n=Object.keys(this.options.Manifests);if(n.length>0)for(let e=0;e<n.length;e++){let t=n[e];this.fable.serviceManager.instantiateServiceProvider("Manifest",this.options.Manifests[t],t)}}onBeforeSolve(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onBeforeSolve:")),!0}onBeforeSolveAsync(e){return this.onBeforeSolve(),e()}onSolve(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onSolve:")),!0}onSolveAsync(e){return this.onSolve(),e()}solve(){this.pict.LogNoisiness>2&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," executing solve() function...")),this.onBeforeSolve();let e=Object.keys(this.pict.views),t=[];for(let r=0;r<e.length;r++){let n=this.pict.views[e[r]];n.options.AutoInitialize&&t.push(n)}t.sort(((e,t)=>e.options.AutoInitializeOrdinal-t.options.AutoInitializeOrdinal));for(let e=0;e<t.length;e++)t[e].solve();return this.onSolve(),this.onAfterSolve(),this.lastSolvedTimestamp=this.fable.log.getTimeStamp(),!0}solveAsync(e){let t=this.fable.serviceManager.instantiateServiceProviderWithoutRegistration("Anticipate");t.anticipate(this.onBeforeSolveAsync.bind(this));let r=Object.keys(this.pict.views),n=[];for(let e=0;e<r.length;e++){let t=this.pict.views[r[e]];t.options.AutoSolveWithApp&&n.push(t)}n.sort(((e,t)=>e.options.AutoSolveOrdinal-t.options.AutoSolveOrdinal));for(let e=0;e<n.length;e++)t.anticipate(n[e].solveAsync.bind(n[e]));t.anticipate(this.onSolveAsync.bind(this)),t.anticipate(this.onAfterSolveAsync.bind(this)),t.wait((t=>(this.pict.LogNoisiness>2&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," solveAsync() complete.")),this.lastSolvedTimestamp=this.fable.log.getTimeStamp(),e(t))))}onAfterSolve(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onAfterSolve:")),!0}onAfterSolveAsync(e){return this.onAfterSolve(),e()}onBeforeInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onBeforeInitialize:")),!0}onBeforeInitializeAsync(e){return this.onBeforeInitialize(),e()}onInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onInitialize:")),!0}onInitializeAsync(e){return this.onInitialize(),e()}initialize(){if(this.initializeTimestamp)return this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," initialize called but initialization is already completed. Aborting.")),!1;{this.onBeforeInitialize(),this.onInitialize();let e=Object.keys(this.pict.views),t=[];for(let r=0;r<e.length;r++){let n=this.pict.views[e[r]];n.options.AutoInitialize&&t.push(n)}t.sort(((e,t)=>e.options.AutoInitializeOrdinal-t.options.AutoInitializeOrdinal));for(let e=0;e<t.length;e++)t[e].initialize();return this.onAfterInitialize(),this.options.AutoSolveAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," auto solving after initialization...")),this.solve()),this.options.AutoRenderMainViewportViewAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," auto rendering after initialization...")),this.render()),this.initializeTimestamp=this.fable.log.getTimeStamp(),!0}}initializeAsync(e){if(this.initializeTimestamp)return this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," async initialize called but initialization is already completed. Aborting.")),fCallback();{let t=this.fable.serviceManager.instantiateServiceProviderWithoutRegistration("Anticipate");this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," beginning initialization...")),t.anticipate(this.onBeforeInitializeAsync.bind(this)),t.anticipate(this.onInitializeAsync.bind(this));let r=Object.keys(this.pict.views),n=[];for(let e=0;e<r.length;e++){let t=this.pict.views[r[e]];t.options.AutoInitialize&&n.push(t)}n.sort(((e,t)=>e.options.AutoInitializeOrdinal-t.options.AutoInitializeOrdinal));for(let e=0;e<n.length;e++){let r=n[e];t.anticipate(r.initializeAsync.bind(r))}t.anticipate(this.onAfterInitializeAsync.bind(this)),this.options.AutoSolveAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," auto solving (asynchronously) after initialization...")),t.anticipate(this.solveAsync.bind(this))),this.options.AutoRenderMainViewportViewAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," auto rendering (asynchronously) after initialization...")),t.anticipate(this.renderMainViewportAsync.bind(this))),t.wait((t=>(this.initializeTimestamp=this.fable.log.getTimeStamp(),this.pict.LogNoisiness>2&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," initialization complete.")),e())))}}onAfterInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onAfterInitialize:")),!0}onAfterInitializeAsync(e){return this.onAfterInitialize(),e()}render(e,t,r,n){let i=void 0===e?this.options.MainViewportViewIdentifier:e,s=void 0===t?this.options.MainViewportRenderableHash:t,o=void 0===r?this.options.MainViewportDestinationAddress:r,a=void 0===n?this.options.MainViewportDefaultDataAddress:n,c="string"==typeof i&&this.servicesMap.PictView[i];return c?c.render(s,o,a):(this.log.error("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," could not render from View ").concat(i," because it is not a valid view.")),!1)}renderMainViewport(){return this.render(this.options.MainViewportViewIdentifier,this.options.MainViewportRenderableHash,this.options.MainViewportDestinationAddress,this.options.MainViewportDefaultDataAddress)}renderAsync(e,t,r,n,i){let s=void 0===e?this.options.MainViewportViewIdentifier:e,o=void 0===t?this.options.MainViewportRenderableHash:t,a=void 0===r?this.options.MainViewportDestinationAddress:r,c=void 0===n?this.options.MainViewportDefaultDataAddress:n,l="string"==typeof s&&this.servicesMap.PictView[s];if(!l){let e="PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," could not asynchronously render from View ").concat(s," because it is not a valid view.");return this.pict.LogNoisiness>3&&this.log.error(e),i(new Error(e))}return l.renderAsync(o,a,c,i)}renderMainViewportAsync(e){return this.renderAsync(this.options.MainViewportViewIdentifier,this.options.MainViewportRenderableHash,this.options.MainViewportDestinationAddress,this.options.MainViewportDefaultDataAddress,e)}}},{"fable-serviceproviderbase":33}],73:[function(e,t,r){const n=e("fable-serviceproviderbase"),i={DefaultRenderable:!1,DefaultDestinationAddress:!1,DefaultTemplateRecordAddress:!1,ViewIdentifier:!1,AutoInitialize:!0,AutoInitializeOrdinal:0,AutoRender:!0,AutoRenderOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0,CSSHash:!1,CSS:!1,CSSProvider:!1,CSSPriority:500,Templates:[],DefaultTemplates:[],Renderables:[],Manifests:{}};t.exports=class extends n{constructor(e,t,r){super(e,Object.assign({},JSON.parse(JSON.stringify(i)),t),r),this.options.ViewIdentifier||(this.options.ViewIdentifier="AutoViewID-".concat(this.fable.getUUID())),this.serviceType="PictView",this.pict=this.fable,this.AppData=this.pict.AppData,this.initializeTimestamp=!1,this.lastSolvedTimestamp=!1,this.lastRenderedTimestamp=!1;for(let e=0;e<this.options.Templates.length;e++){let t=this.options.Templates[e];t.hasOwnProperty("Hash")&&t.hasOwnProperty("Template")?(t.Source||(t.Source="PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," options object.")),this.pict.TemplateProvider.addTemplate(t.Hash,t.Template,t.Source)):this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not load Template ").concat(e," in the options array."),t)}for(let e=0;e<this.options.DefaultTemplates.length;e++){let t=this.options.DefaultTemplates[e];t.hasOwnProperty("Postfix")&&t.hasOwnProperty("Template")?(t.Source||(t.Source="PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," options object.")),this.pict.TemplateProvider.addDefaultTemplate(t.Prefix,t.Postfix,t.Template,t.Source)):this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not load Default Template ").concat(e," in the options array."),t)}if(this.options.CSS){let e=this.options.CSSHash?this.options.CSSHash:"View-".concat(this.options.ViewIdentifier),t=this.options.CSSProvider?this.options.CSSProvider:e;this.pict.CSSMap.addCSS(e,this.options.CSS,t,this.options.CSSPriority)}this.renderables={};for(let e=0;e<this.options.Renderables.length;e++){this.options.Renderables[e];this.addRenderable(this.options.Renderables[e])}}addRenderable(e,t,r,n,i){let s=!1;if("object"==typeof e)s=e;else{s={RenderableHash:e,TemplateHash:t,DefaultTemplateDataAddress:r,DefaultDestinationAddress:n,RenderMethod:"string"!=typeof i?i:"replace"}}"string"!=typeof s.RenderableHash||"string"!=typeof s.TemplateHash?this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not load Renderable; RenderableHash or TemplateHash are invalid."),s):(this.pict.LogNoisiness>0&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," adding renderable [").concat(s.RenderableHash,"] pointed to template ").concat(s.TemplateHash,".")),this.renderables[s.RenderableHash]=s)}onBeforeSolve(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onBeforeSolve:")),!0}onBeforeSolveAsync(e){return this.onBeforeSolve(),e()}onSolve(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onSolve:")),!0}onSolveAsync(e){return this.onSolve(),e()}solve(){return this.pict.LogNoisiness>2&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," executing solve() function...")),this.onBeforeSolve(),this.onSolve(),this.onAfterSolve(),this.lastSolvedTimestamp=this.pict.log.getTimeStamp(),!0}solveAsync(e){let t=this.pict.serviceManager.instantiateServiceProviderWithoutRegistration("Anticipate");t.anticipate(this.onBeforeSolveAsync.bind(this)),t.anticipate(this.onSolveAsync.bind(this)),t.anticipate(this.onAfterSolveAsync.bind(this)),t.wait((t=>(this.pict.LogNoisiness>2&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," solveAsync() complete.")),this.lastSolvedTimestamp=this.pict.log.getTimeStamp(),e(t))))}onAfterSolve(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterSolve:")),!0}onAfterSolveAsync(e){return this.onAfterSolve(),e()}onBeforeInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onBeforeInitialize:")),!0}onBeforeInitializeAsync(e){return this.onBeforeInitialize(),e()}onInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onInitialize:")),!0}onInitializeAsync(e){return this.onInitialize(),e()}initialize(){return this.initializeTimestamp?(this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," initialize called but initialization is already completed. Aborting.")),!1):(this.onBeforeInitialize(),this.onInitialize(),this.onAfterInitialize(),this.initializeTimestamp=this.pict.log.getTimeStamp(),!0)}initializeAsync(e){if(this.initializeTimestamp)return this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," async initialize called but initialization is already completed. Aborting.")),e();{let t=this.pict.serviceManager.instantiateServiceProviderWithoutRegistration("Anticipate");this.pict.LogNoisiness>0&&this.log.info("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," beginning initialization...")),t.anticipate(this.onBeforeInitializeAsync.bind(this)),t.anticipate(this.onInitializeAsync.bind(this)),t.anticipate(this.onAfterInitializeAsync.bind(this)),t.wait((t=>(this.initializeTimestamp=this.pict.log.getTimeStamp(),this.pict.LogNoisiness>0&&this.log.info("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," initialization complete.")),e())))}}onAfterInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterInitialize:")),!0}onAfterInitializeAsync(e){return this.onAfterInitialize(),e()}onBeforeRender(e,t,r){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onBeforeRender:")),!0}onBeforeRenderAsync(e,t,r,n){return this.onBeforeRender(e,t,r),n()}render(e,t,r){let n="string"==typeof e?e:"string"==typeof this.options.DefaultRenderable&&this.options.DefaultRenderable;if(!n)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(n," (param ").concat(e,") because it is not a valid renderable.")),!1;let i=this.renderables[n];if(!i)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(n," (param ").concat(e,") because it does not exist.")),!1;let s="string"==typeof t?t:"string"==typeof i.ContentDestinationAddress?i.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress&&this.options.DefaultDestinationAddress;if(!s)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(n," (param ").concat(e,") because it does not have a valid destination address.")),!1;let o="string"==typeof r?r:"string"==typeof i.DefaultTemplateRecordAddress?i.DefaultTemplateRecordAddress:"string"==typeof this.options.DefaultTemplateRecordAddress&&this.options.DefaultTemplateRecordAddress,a="string"==typeof o?this.pict.DataProvider.getDataByAddress(o):void 0;this.onBeforeRender(i,s,a);let c=this.pict.parseTemplateByHash(i.TemplateHash,a);switch(i.RenderMethod){case"append":this.pict.ContentAssignment.appendContent(s,c);break;case"prepend":this.pict.ContentAssignment.prependContent(s,c);break;case"append_once":this.pict.ContentAssignment.getElement("#".concat(n)).length<1&&this.pict.ContentAssignment.appendContent(s,c);default:this.pict.ContentAssignment.assignContent(s,c)}this.onAfterRender(i,s,a,c),this.lastRenderedTimestamp=this.pict.log.getTimeStamp()}renderAsync(e,t,r,n){let i="string"==typeof e?e:"string"==typeof this.options.DefaultRenderable&&this.options.DefaultRenderable;if(!i)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not asynchronously render ").concat(i," (param ").concat(e,"because it is not a valid renderable.")),n(Error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not asynchronously render ").concat(i," (param ").concat(e,"because it is not a valid renderable.")));let s=this.renderables[i];if(!s)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(i," (param ").concat(e,") because it does not exist.")),n(Error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(i," (param ").concat(e,") because it does not exist.")));let o="string"==typeof t?t:"string"==typeof s.ContentDestinationAddress?s.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress&&this.options.DefaultDestinationAddress;if(!o)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(i," (param ").concat(e,") because it does not have a valid destination address.")),n(Error("Could not render ".concat(i)));let a="string"==typeof r?r:"string"==typeof s.DefaultTemplateRecordAddress?s.DefaultTemplateRecordAddress:"string"==typeof this.options.DefaultTemplateRecordAddress&&this.options.DefaultTemplateRecordAddress,c="string"==typeof a?this.pict.DataProvider.getDataByAddress(a):void 0;this.onBeforeRender(s,o,c),this.pict.parseTemplateByHash(s.TemplateHash,c,((t,r)=>{if(t)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render (asynchronously) ").concat(i," (param ").concat(e,") because it did not parse the template."),t),n(t);switch(s.RenderMethod){case"append":this.pict.ContentAssignment.appendContent(o,r);break;case"prepend":this.pict.ContentAssignment.prependContent(o,r);break;case"append_once":this.pict.ContentAssignment.getElement("#".concat(i)).length<1&&this.pict.ContentAssignment.appendContent(o,r);default:this.pict.ContentAssignment.assignContent(o,r)}return this.onAfterRender(s,o,c,r),this.lastRenderedTimestamp=this.pict.log.getTimeStamp(),n(null,r)}))}onAfterRender(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterRender:")),!0}onAfterRenderAsync(e){return this.onAfterRender(),e()}}},{"fable-serviceproviderbase":33}],74:[function(e,t,r){
|
|
1
|
+
"use strict";function _defineProperty2(t,e,r){return(e=_toPropertyKey2(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _toPropertyKey2(t){var e=_toPrimitive2(t,"string");return"symbol"==typeof e?e:String(e)}function _toPrimitive2(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Pict=t()}}((function(){return function t(e,r,n){function i(o,a){if(!r[o]){if(!e[o]){var l="function"==typeof require&&require;if(!a&&l)return l(o,!0);if(s)return s(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var h=r[o]={exports:{}};e[o][0].call(h.exports,(function(t){return i(e[o][1][t]||t)}),h,h.exports,t,e,r,n)}return r[o].exports}for(var s="function"==typeof require&&require,o=0;o<n.length;o++)i(n[o]);return i}({1:[function(t,e,r){var n=t("async.util.eachoflimit"),i=t("async.util.withoutindex");e.exports=function(t,e,r,s){return n(e)(t,i(r),s)}},{"async.util.eachoflimit":3,"async.util.withoutindex":14}],2:[function(t,e,r){e.exports=function(t){return function e(r){function n(){return t.length&&t[r].apply(null,arguments),n.next()}return n.next=function(){return r<t.length-1?e(r+1):null},n}(0)}},{}],3:[function(t,e,r){var n=t("async.util.once"),i=t("async.util.noop"),s=t("async.util.onlyonce"),o=t("async.util.keyiterator");e.exports=function(t){return function(e,r,a){a=n(a||i);var l=o(e=e||[]);if(t<=0)return a(null);var c=!1,h=0,u=!1;!function n(){if(c&&h<=0)return a(null);for(;h<t&&!u;){var i=l();if(null===i)return c=!0,void(h<=0&&a(null));h+=1,r(e[i],i,s((function(t){h-=1,t?(a(t),u=!0):n()})))}}()}}},{"async.util.keyiterator":7,"async.util.noop":9,"async.util.once":10,"async.util.onlyonce":11}],4:[function(t,e,r){var n=t("async.util.setimmediate"),i=t("async.util.restparam");e.exports=function(t){return i((function(e){var r=e.pop();e.push((function(){var t=arguments;i?n((function(){r.apply(null,t)})):r.apply(null,t)}));var i=!0;t.apply(this,e),i=!1}))}},{"async.util.restparam":12,"async.util.setimmediate":13}],5:[function(t,e,r){e.exports=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],6:[function(t,e,r){var n=t("async.util.isarray");e.exports=function(t){return n(t)||"number"==typeof t.length&&t.length>=0&&t.length%1==0}},{"async.util.isarray":5}],7:[function(t,e,r){var n=t("async.util.keys"),i=t("async.util.isarraylike");e.exports=function(t){var e,r,s=-1;return i(t)?(e=t.length,function(){return++s<e?s:null}):(r=n(t),e=r.length,function(){return++s<e?r[s]:null})}},{"async.util.isarraylike":6,"async.util.keys":8}],8:[function(t,e,r){e.exports=Object.keys||function(t){var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(r);return e}},{}],9:[function(t,e,r){e.exports=function(){}},{}],10:[function(t,e,r){e.exports=function(t){return function(){null!==t&&(t.apply(this,arguments),t=null)}}},{}],11:[function(t,e,r){e.exports=function(t){return function(){if(null===t)throw new Error("Callback was already called.");t.apply(this,arguments),t=null}}},{}],12:[function(t,e,r){e.exports=function(t,e){return e=null==e?t.length-1:+e,function(){for(var r=Math.max(arguments.length-e,0),n=new Array(r),i=0;i<r;i++)n[i]=arguments[i+e];switch(e){case 0:return t.call(this,n);case 1:return t.call(this,arguments[0],n)}}}},{}],13:[function(t,e,r){(function(t){(function(){var r="function"==typeof t&&t,n=function(t){setTimeout(t,0)};e.exports=function(t){return(r||n)(t)}}).call(this)}).call(this,t("timers").setImmediate)},{timers:106}],14:[function(t,e,r){e.exports=function(t){return function(e,r,n){return t(e,n)}}},{}],15:[function(t,e,r){var n=t("async.util.once"),i=t("async.util.noop"),s=t("async.util.isarray"),o=t("async.util.restparam"),a=t("async.util.ensureasync"),l=t("async.iterator");e.exports=function(t,e){if(e=n(e||i),!s(t))return e(new Error("First argument to waterfall must be an array of functions"));if(!t.length)return e();!function t(r){return o((function(n,i){if(n)e.apply(null,[n].concat(i));else{var s=r.next();s?i.push(t(s)):i.push(e),a(r).apply(null,i)}}))}(l(t))()}},{"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(t,e,r){r.byteLength=function(t){var e=l(t),r=e[0],n=e[1];return 3*(r+n)/4-n},r.toByteArray=function(t){var e,r,n=l(t),o=n[0],a=n[1],c=new s(function(t,e,r){return 3*(e+r)/4-r}(0,o,a)),h=0,u=a>0?o-4:o;for(r=0;r<u;r+=4)e=i[t.charCodeAt(r)]<<18|i[t.charCodeAt(r+1)]<<12|i[t.charCodeAt(r+2)]<<6|i[t.charCodeAt(r+3)],c[h++]=e>>16&255,c[h++]=e>>8&255,c[h++]=255&e;2===a&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,c[h++]=255&e);1===a&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,c[h++]=e>>8&255,c[h++]=255&e);return c},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,s=[],o=16383,a=0,l=r-i;a<l;a+=o)s.push(c(t,a,a+o>l?l:a+o));1===i?(e=t[r-1],s.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],s.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return s.join("")};for(var n=[],i=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)n[a]=o[a],i[o.charCodeAt(a)]=a;function l(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,r){for(var i,s,o=[],a=e;a<r;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),o.push(n[(s=i)>>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],17:[function(t,e,r){},{}],18:[function(t,e,r){arguments[4][17][0].apply(r,arguments)},{dup:17}],19:[function(t,e,r){(function(e){(function(){var e=t("base64-js"),n=t("ieee754");r.Buffer=o,r.SlowBuffer=function(t){+t!=t&&(t=0);return o.alloc(+t)},r.INSPECT_MAX_BYTES=50;var i=2147483647;function s(t){if(t>i)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=o.prototype,e}function o(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return c(t)}return a(t,e,r)}function a(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!o.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|f(t,e),n=s(r),i=n.write(t,e);i!==r&&(n=n.slice(0,i));return n}(t,e);if(ArrayBuffer.isView(t))return h(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(F(t,ArrayBuffer)||t&&F(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r);return n.__proto__=o.prototype,n}(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return o.from(n,e,r);var i=function(t){if(o.isBuffer(t)){var e=0|u(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!=typeof t.length||H(t.length)?s(0):h(t);if("Buffer"===t.type&&Array.isArray(t.data))return h(t.data)}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return o.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function c(t){return l(t),s(t<0?0:0|u(t))}function h(t){for(var e=t.length<0?0:0|u(t.length),r=s(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function u(t){if(t>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|t}function f(t,e){if(o.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||F(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return U(t).length;default:if(i)return n?-1:B(t).length;e=(""+e).toLowerCase(),i=!0}}function p(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return E(this,e,r);case"latin1":case"binary":return O(this,e,r);case"base64":return T(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function d(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),H(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=o.from(e,n)),o.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,i){var s,o=1,a=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var h=-1;for(s=r;s<a;s++)if(c(t,s)===c(e,-1===h?0:s-h)){if(-1===h&&(h=s),s-h+1===l)return h*o}else-1!==h&&(s-=s-h),h=-1}else for(r+l>a&&(r=a-l),s=r;s>=0;s--){for(var u=!0,f=0;f<l;f++)if(c(t,s+f)!==c(e,f)){u=!1;break}if(u)return s}return-1}function y(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var s=e.length;n>s/2&&(n=s/2);for(var o=0;o<n;++o){var a=parseInt(e.substr(2*o,2),16);if(H(a))return o;t[r+o]=a}return o}function b(t,e,r,n){return k(B(e,t.length-r),t,r,n)}function v(t,e,r,n){return k(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function w(t,e,r,n){return v(t,e,r,n)}function S(t,e,r,n){return k(U(e),t,r,n)}function P(t,e,r,n){return k(function(t,e){for(var r,n,i,s=[],o=0;o<t.length&&!((e-=2)<0);++o)n=(r=t.charCodeAt(o))>>8,i=r%256,s.push(i),s.push(n);return s}(e,t.length-r),t,r,n)}function T(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function A(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var s,o,a,l,c=t[i],h=null,u=c>239?4:c>223?3:c>191?2:1;if(i+u<=r)switch(u){case 1:c<128&&(h=c);break;case 2:128==(192&(s=t[i+1]))&&(l=(31&c)<<6|63&s)>127&&(h=l);break;case 3:s=t[i+1],o=t[i+2],128==(192&s)&&128==(192&o)&&(l=(15&c)<<12|(63&s)<<6|63&o)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:s=t[i+1],o=t[i+2],a=t[i+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(l=(15&c)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(h=l)}null===h?(h=65533,u=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=u}return function(t){var e=t.length;if(e<=_)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=_));return r}(n)}r.kMaxLength=i,o.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}(),o.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),o.poolSize=8192,o.from=function(t,e,r){return a(t,e,r)},o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,o.alloc=function(t,e,r){return function(t,e,r){return l(t),t<=0?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)}(t,e,r)},o.allocUnsafe=function(t){return c(t)},o.allocUnsafeSlow=function(t){return c(t)},o.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==o.prototype},o.compare=function(t,e){if(F(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),F(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(t)||!o.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,s=Math.min(r,n);i<s;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},o.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return o.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=o.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var s=t[r];if(F(s,Uint8Array)&&(s=o.from(s)),!o.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},o.byteLength=f,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)d(this,e,e+1);return this},o.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)d(this,e,e+3),d(this,e+1,e+2);return this},o.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)d(this,e,e+7),d(this,e+1,e+6),d(this,e+2,e+5),d(this,e+3,e+4);return this},o.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?A(this,0,t):p.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(t){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===o.compare(this,t)},o.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},o.prototype.compare=function(t,e,r,n,i){if(F(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var s=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),l=Math.min(s,a),c=this.slice(n,i),h=t.slice(e,r),u=0;u<l;++u)if(c[u]!==h[u]){s=c[u],a=h[u];break}return s<a?-1:a<s?1:0},o.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},o.prototype.indexOf=function(t,e,r){return g(this,t,e,r,!0)},o.prototype.lastIndexOf=function(t,e,r){return g(this,t,e,r,!1)},o.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return y(this,t,e,r);case"utf8":case"utf-8":return b(this,t,e,r);case"ascii":return v(this,t,e,r);case"latin1":case"binary":return w(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var _=4096;function E(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function O(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function C(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",s=e;s<r;++s)i+=N(t[s]);return i}function M(t,e,r){for(var n=t.slice(e,r),i="",s=0;s<n.length;s+=2)i+=String.fromCharCode(n[s]+256*n[s+1]);return i}function R(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function x(t,e,r,n,i,s){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function D(t,e,r,n,i,s){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(t,e,r,i,s){return e=+e,r>>>=0,s||D(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function I(t,e,r,i,s){return e=+e,r>>>=0,s||D(t,0,r,8),n.write(t,e,r,i,52,8),r+8}o.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return n.__proto__=o.prototype,n},o.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||R(t,e,this.length);for(var n=this[t],i=1,s=0;++s<e&&(i*=256);)n+=this[t+s]*i;return n},o.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||R(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},o.prototype.readUInt8=function(t,e){return t>>>=0,e||R(t,1,this.length),this[t]},o.prototype.readUInt16LE=function(t,e){return t>>>=0,e||R(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUInt16BE=function(t,e){return t>>>=0,e||R(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUInt32LE=function(t,e){return t>>>=0,e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUInt32BE=function(t,e){return t>>>=0,e||R(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||R(t,e,this.length);for(var n=this[t],i=1,s=0;++s<e&&(i*=256);)n+=this[t+s]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},o.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||R(t,e,this.length);for(var n=e,i=1,s=this[t+--n];n>0&&(i*=256);)s+=this[t+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*e)),s},o.prototype.readInt8=function(t,e){return t>>>=0,e||R(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){t>>>=0,e||R(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(t,e){t>>>=0,e||R(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(t,e){return t>>>=0,e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return t>>>=0,e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readFloatLE=function(t,e){return t>>>=0,e||R(t,4,this.length),n.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return t>>>=0,e||R(t,4,this.length),n.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return t>>>=0,e||R(t,8,this.length),n.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return t>>>=0,e||R(t,8,this.length),n.read(this,t,!1,52,8)},o.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||x(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,s=0;for(this[e]=255&t;++s<r&&(i*=256);)this[e+s]=t/i&255;return e+r},o.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||x(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,s=1;for(this[e+i]=255&t;--i>=0&&(s*=256);)this[e+i]=t/s&255;return e+r},o.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,1,255,0),this[e]=255&t,e+1},o.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},o.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);x(this,t,e,r,i-1,-i)}var s=0,o=1,a=0;for(this[e]=255&t;++s<r&&(o*=256);)t<0&&0===a&&0!==this[e+s-1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+r},o.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);x(this,t,e,r,i-1,-i)}var s=r-1,o=1,a=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+r},o.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},o.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeFloatLE=function(t,e,r){return j(this,t,e,!0,r)},o.prototype.writeFloatBE=function(t,e,r){return j(this,t,e,!1,r)},o.prototype.writeDoubleLE=function(t,e,r){return I(this,t,e,!0,r)},o.prototype.writeDoubleBE=function(t,e,r){return I(this,t,e,!1,r)},o.prototype.copy=function(t,e,r,n){if(!o.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(var s=i-1;s>=0;--s)t[s+e]=this[s+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},o.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var s;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(s=e;s<r;++s)this[s]=t;else{var a=o.isBuffer(t)?t:o.from(t,n),l=a.length;if(0===l)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(s=0;s<r-e;++s)this[s+e]=a[s%l]}return this};var L=/[^+/0-9A-Za-z-_]/g;function N(t){return t<16?"0"+t.toString(16):t.toString(16)}function B(t,e){var r;e=e||1/0;for(var n=t.length,i=null,s=[],o=0;o<n;++o){if((r=t.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function U(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function k(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function F(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function H(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":16,buffer:19,ieee754:57}],20:[function(t,e,r){e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],21:[function(t,e,r){const n=t("fable-serviceproviderbase"),i=t("./LinkedList.js");e.exports=class extends n{constructor(t,e,r){void 0===t?super({}):super(t,e,r),this.serviceType="ObjectCache",this._HashMap={},this._RecordMap={},this._List=new i,this.maxLength=0,this.maxAge=0}get RecordMap(){return this._RecordMap}put(t,e){if(this._HashMap.hasOwnProperty(e))return this._HashMap[e].Datum=t,this._RecordMap[e]=t,this._HashMap[e].Datum;let r=this._List.push(t,e);return this._HashMap[r.Hash]=r,this._RecordMap[e]=t,this.maxLength>0&&this._List.length>this.maxLength&&(r=this._List.pop(),delete this._RecordMap[r.Hash],delete this._HashMap[r.Hash]),r.Metadata.Created=+new Date,r.Datum}read(t){return!!this._HashMap.hasOwnProperty(t)&&this._HashMap[t].Datum}touch(t){if(!this._HashMap.hasOwnProperty(t))return!1;let e=this._List.remove(this._HashMap[t]);return delete this._RecordMap[t],delete this._HashMap[t],this.put(e.Datum,e.Hash)}expire(t){if(!this._HashMap.hasOwnProperty(t))return!1;let e=this._HashMap[t];return e=this._List.remove(e),delete this._RecordMap[e.Hash],delete this._HashMap[e.Hash],e}pruneBasedOnExpiration(t,e){let r=void 0===e?[]:e;if(this.maxAge<1)return t(r);let n=+new Date,i=Object.keys(this._HashMap);for(let t=0;t<i.length;t++)n-this._HashMap[i[t]].Metadata.Created>=this.maxAge&&r.push(this.expire(i[t]));t(r)}pruneBasedOnLength(t,e){let r=void 0===e?[]:e;if(this.maxLength>0)for(;this._List.length>this.maxLength;)r.push(this._List.pop());return t(r)}pruneCustom(t,e,r){let n=void 0===r?[]:r,i=Object.keys(this._HashMap);for(let t=0;t<i.length;t++){let r=this._HashMap[i[t]];e(r.Datum,r.Hash,r)&&n.push(this.expire(i[t]))}t(n)}prune(t){let e=[];if(this._List.length<1)return t(e);this.pruneBasedOnExpiration((r=>{this.pruneBasedOnLength(t,e)}),e)}getNode(t){return!!this._HashMap.hasOwnProperty(t)&&this._HashMap[t]}}},{"./LinkedList.js":23,"fable-serviceproviderbase":33}],22:[function(t,e,r){e.exports=class{constructor(){this.Hash=!1,this.Datum=!1,this.Metadata={},this.LeftNode=!1,this.RightNode=!1,this.__ISNODE=!0}}},{}],23:[function(t,e,r){const n=t("./LinkedList-Node.js");e.exports=class{constructor(){this.totalNodes=0,this.length=0,this.head=!1,this.tail=!1}initializeNode(t,e){if(void 0===t)return!1;this.totalNodes++;let r=void 0!==e?e:"NODE[".concat(this.totalNodes,"]"),i=new n;return i.Hash=r,i.Datum=t,i}append(t,e){let r=this.initializeNode(t,e);return!!r&&(this.length++,1==this.length?(this.head=r,this.tail=r,r):(this.tail.RightNode=r,r.LeftNode=this.tail,this.tail=r,r))}push(t,e){return this.append(t,e)}prepend(t,e){let r=this.initializeNode(t,e);return!!r&&(this.length++,1==this.length?(this.head=r,this.tail=r,r):(this.head.LeftNode=r,r.RightNode=this.head,this.head=r,r))}remove(t){return void 0!==t&&(!!t.__ISNODE&&(this.length--,this.length<1?(this.head=!1,this.tail=!1,t):t.LeftNode&&t.RightNode?(t.LeftNode.RightNode=t.RightNode,t.RightNode.LeftNode=t.LeftNode,t.RightNode=!1,t.LeftNode=!1,t):t.LeftNode?(t.LeftNode.RightNode=!1,this.tail=t.LeftNode,t.LeftNode=!1,t):(t.RightNode.LeftNode=!1,this.head=t.RightNode,t.RightNode=!1,t)))}pop(){return this.remove(this.head)}each(t,e){if(this.length<1)return e();let r=!1,n=i=>{if(i)return e(i);if(r){if(!r.RightNode)return e();r=r.RightNode}else r=this.head;t(r.Datum,r.Hash,n)};return n()}seek(t){if(!t)return!1;if(this.length<1)return!1;if(t>=this.length)return!1;let e=this.head;for(let r=0;r<t;r++)e=e.RightNode;return e}}},{"./LinkedList-Node.js":22}],24:[function(t,e,r){r.parse=function(t,e){if("string"!=typeof t)throw new TypeError("argument str must be a string");var r={},n=(e||{}).decode||s,i=0;for(;i<t.length;){var o=t.indexOf("=",i);if(-1===o)break;var l=t.indexOf(";",i);if(-1===l)l=t.length;else if(l<o){i=t.lastIndexOf(";",o-1)+1;continue}var c=t.slice(i,o).trim();if(void 0===r[c]){var h=t.slice(o+1,l).trim();34===h.charCodeAt(0)&&(h=h.slice(1,-1)),r[c]=a(h,n)}i=l+1}return r},r.serialize=function(t,e,r){var s=r||{},a=s.encode||o;if("function"!=typeof a)throw new TypeError("option encode is invalid");if(!i.test(t))throw new TypeError("argument name is invalid");var l=a(e);if(l&&!i.test(l))throw new TypeError("argument val is invalid");var c=t+"="+l;if(null!=s.maxAge){var h=s.maxAge-0;if(isNaN(h)||!isFinite(h))throw new TypeError("option maxAge is invalid");c+="; Max-Age="+Math.floor(h)}if(s.domain){if(!i.test(s.domain))throw new TypeError("option domain is invalid");c+="; Domain="+s.domain}if(s.path){if(!i.test(s.path))throw new TypeError("option path is invalid");c+="; Path="+s.path}if(s.expires){var u=s.expires;if(!function(t){return"[object Date]"===n.call(t)||t instanceof Date}(u)||isNaN(u.valueOf()))throw new TypeError("option expires is invalid");c+="; Expires="+u.toUTCString()}s.httpOnly&&(c+="; HttpOnly");s.secure&&(c+="; Secure");if(s.priority){switch("string"==typeof s.priority?s.priority.toLowerCase():s.priority){case"low":c+="; Priority=Low";break;case"medium":c+="; Priority=Medium";break;case"high":c+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(s.sameSite){switch("string"==typeof s.sameSite?s.sameSite.toLowerCase():s.sameSite){case!0:c+="; SameSite=Strict";break;case"lax":c+="; SameSite=Lax";break;case"strict":c+="; SameSite=Strict";break;case"none":c+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return c};var n=Object.prototype.toString,i=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function s(t){return-1!==t.indexOf("%")?decodeURIComponent(t):t}function o(t){return encodeURIComponent(t)}function a(t,e){try{return e(t)}catch(e){return t}}},{}],25:[function(t,e,r){var n,i="object"==typeof Reflect?Reflect:null,s=i&&"function"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,s),n(r)}function s(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}y(t,e,s,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&y(t,"error",e,r)}(t,i,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var l=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function h(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function u(t,e,r,n){var i,s,o,a;if(c(r),void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),o=s[e]),void 0===o)o=s[e]=r,++t._eventsCount;else if("function"==typeof o?o=s[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(i=h(t))>0&&o.length>i&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=o.length,a=l,console&&console.warn&&console.warn(a)}return t}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=f.bind(n);return i.listener=r,n.wrapFn=i,i}function d(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):m(i,i.length)}function g(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function y(t,e,r,n){if("function"==typeof t.on)n.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(s){n.once&&t.removeEventListener(e,i),r(s)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");l=t}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},a.prototype.getMaxListeners=function(){return h(this)},a.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=i[t];if(void 0===l)return!1;if("function"==typeof l)s(l,this,e);else{var c=l.length,h=m(l,c);for(r=0;r<c;++r)s(h[r],this,e)}return!0},a.prototype.addListener=function(t,e){return u(this,t,e,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(t,e){return u(this,t,e,!0)},a.prototype.once=function(t,e){return c(e),this.on(t,p(this,t,e)),this},a.prototype.prependOnceListener=function(t,e){return c(e),this.prependListener(t,p(this,t,e)),this},a.prototype.removeListener=function(t,e){var r,n,i,s,o;if(c(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,s=r.length-1;s>=0;s--)if(r[s]===e||r[s].listener===e){o=r[s].listener,i=s;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,i),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,o||e)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var i,s=Object.keys(r);for(n=0;n<s.length;++n)"removeListener"!==(i=s[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},a.prototype.listeners=function(t){return d(this,t,!0)},a.prototype.rawListeners=function(t){return d(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},a.prototype.listenerCount=g,a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],26:[function(t,e,r){e.exports=class{constructor(t,e){this._Settings="object"==typeof t?t:{},this.loggerUUID=this.generateInsecureUUID(),this.levels=["trace","debug","info","warn","error","fatal"]}generateInsecureUUID(){let t=(new Date).getTime();return"LOGSTREAM-xxxxxx-yxxxxx".replace(/[xy]/g,(e=>{let r=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?r:3&r|8).toString(16)}))}initialize(){}trace(t,e){this.write("trace",t,e)}debug(t,e){this.write("debug",t,e)}info(t,e){this.write("info",t,e)}warn(t,e){this.write("warn",t,e)}error(t,e){this.write("error",t,e)}fatal(t,e){this.write("fatal",t,e)}write(t,e,r){return!0}}},{}],27:[function(t,e,r){e.exports=(()=>{let e={};return e.console=t("./Fable-Log-Logger-Console.js"),e.default=e.console,e})()},{"./Fable-Log-Logger-Console.js":29}],28:[function(t,e,r){e.exports=[{loggertype:"console",streamtype:"console",level:"trace"}]},{}],29:[function(t,e,r){let n=t("./Fable-Log-BaseLogger.js");e.exports=class extends n{constructor(t,e){super(t),this._ShowTimeStamps=!this._Settings.hasOwnProperty("showtimestamps")||1==this._Settings.showtimestamps,this._FormattedTimeStamps=!this._Settings.hasOwnProperty("formattedtimestamps")||1==this._Settings.formattedtimestamps,this._ContextMessage=this._Settings.hasOwnProperty("Context")?"(".concat(this._Settings.Context,")"):e._Settings.hasOwnProperty("Product")?"(".concat(e._Settings.Product,")"):"Unnamed_Log_Context",this._OutputLogLinesToConsole=!this._Settings.hasOwnProperty("outputloglinestoconsole")||this._Settings.outputloglinestoconsole,this._OutputObjectsToConsole=!this._Settings.hasOwnProperty("outputobjectstoconsole")||this._Settings.outputobjectstoconsole,this.prefixCache={};for(let t=0;t<=this.levels.length;t++)this.prefixCache[this.levels[t]]="[".concat(this.levels[t],"] ").concat(this._ContextMessage,": "),this._ShowTimeStamps&&(this.prefixCache[this.levels[t]]=" "+this.prefixCache[this.levels[t]])}write(t,e,r){let n="";this._ShowTimeStamps&&this._FormattedTimeStamps?n=(new Date).toISOString():this._ShowTimeStamps&&(n=+new Date);let i="".concat(n).concat(this.prefixCache[t]).concat(e);return this._OutputLogLinesToConsole&&console.log(i),this._OutputObjectsToConsole&&void 0!==r&&console.log(JSON.stringify(r,null,2)),i}}},{"./Fable-Log-BaseLogger.js":26}],30:[function(t,e,r){const n=t("./Fable-Log-Logger-Console.js"),i=t("fs"),s=t("path");e.exports=class extends n{constructor(t,e){super(t,e),this.logFileRawPath=this._Settings.hasOwnProperty("path")?this._Settings.path:"./".concat(this._ContextMessage,".log"),this.logFilePath=s.normalize(this.logFileRawPath),this.logFileStreamOptions=this._Settings.hasOwnProperty("fileStreamoptions")?this._Settings.fileStreamOptions:{flags:"a",encoding:"utf8"},this.fileWriter=i.createWriteStream(this.logFilePath,this.logFileStreamOptions),this.activelyWriting=!1,this.logLineStrings=[],this.logObjectStrings=[],this.defaultWriteCompleteCallback=()=>{},this.defaultBufferFlushCallback=()=>{}}closeWriter(t){let e="function"==typeof t?t:()=>{};if(this.fileWriter)return this.fileWriter.end("\n"),this.fileWriter.once("finish",e.bind(this))}completeBufferFlushToLogFile(t){this.activelyWriting=!1;let e="function"==typeof t?t:this.defaultBufferFlushCallback;if(!(this.logLineStrings.length>0))return e();this.flushBufferToLogFile(e)}flushBufferToLogFile(t){if(!this.activelyWriting){this.activelyWriting=!0;let e="function"==typeof t?t:this.defaultBufferFlushCallback,r=this.logLineStrings,n=this.logObjectStrings;this.logLineStrings=[],this.logObjectStrings=[];let i="";for(let t=0;t<r.length;t++)i+="".concat(r[t],"\n"),!1!==n[t]&&(i+="".concat(n[t],"\n"));if(this.fileWriter.write(i,"utf8"))return this.completeBufferFlushToLogFile(e);this.fileWriter.once("drain",this.completeBufferFlushToLogFile.bind(this,e))}}write(t,e,r){let n=super.write(t,e,r);this.logLineStrings.push(n),void 0!==r?this.logObjectStrings.push(JSON.stringify(r,null,4)):this.logObjectStrings.push(!1),this.flushBufferToLogFile()}}},{"./Fable-Log-Logger-Console.js":29,fs:18,path:72}],31:[function(t,e,r){const n=t("fable-serviceproviderbase").CoreServiceProviderBase;class i extends n{constructor(e,r){super(e,r),this.serviceType="Logging";let n="object"==typeof e?e:{};this._Settings=n,this._Providers=t("./Fable-Log-DefaultProviders-Node.js"),this._StreamDefinitions=n.hasOwnProperty("LogStreams")?n.LogStreams:t("./Fable-Log-DefaultStreams.json"),this.logStreams=[],this.logProviders={},this.activeLogStreams={},this.logStreamsTrace=[],this.logStreamsDebug=[],this.logStreamsInfo=[],this.logStreamsWarn=[],this.logStreamsError=[],this.logStreamsFatal=[],this.datumDecorator=t=>t,this.uuid="string"==typeof n.Product?n.Product:"Default"}addLogger(t,e){if(this.activeLogStreams.hasOwnProperty(t.loggerUUID))return!1;switch(this.logStreams.push(t),this.activeLogStreams[t.loggerUUID]=!0,e){case"trace":this.logStreamsTrace.push(t);case"debug":this.logStreamsDebug.push(t);case"info":this.logStreamsInfo.push(t);case"warn":this.logStreamsWarn.push(t);case"error":this.logStreamsError.push(t);case"fatal":this.logStreamsFatal.push(t)}return!0}setDatumDecorator(t){this.datumDecorator="function"==typeof t?t:t=>t}trace(t,e){const r=this.datumDecorator(e);for(let e=0;e<this.logStreamsTrace.length;e++)this.logStreamsTrace[e].trace(t,r)}debug(t,e){const r=this.datumDecorator(e);for(let e=0;e<this.logStreamsDebug.length;e++)this.logStreamsDebug[e].debug(t,r)}info(t,e){const r=this.datumDecorator(e);for(let e=0;e<this.logStreamsInfo.length;e++)this.logStreamsInfo[e].info(t,r)}warn(t,e){const r=this.datumDecorator(e);for(let e=0;e<this.logStreamsWarn.length;e++)this.logStreamsWarn[e].warn(t,r)}error(t,e){const r=this.datumDecorator(e);for(let e=0;e<this.logStreamsError.length;e++)this.logStreamsError[e].error(t,r)}fatal(t,e){const r=this.datumDecorator(e);for(let e=0;e<this.logStreamsFatal.length;e++)this.logStreamsFatal[e].fatal(t,r)}initialize(){for(let t=0;t<this._StreamDefinitions.length;t++){let e=Object.assign({loggertype:"default",streamtype:"console",level:"info"},this._StreamDefinitions[t]);this._Providers.hasOwnProperty(e.loggertype)?this.addLogger(new this._Providers[e.loggertype](e,this),e.level):console.log("Error initializing log stream: bad loggertype in stream definition ".concat(JSON.stringify(e)))}for(let t=0;t<this.logStreams.length;t++)this.logStreams[t].initialize()}logTime(t,e){let r=void 0!==t?t:"Time",n=new Date;this.info("".concat(r," ").concat(n," (epoch ").concat(+n,")"),e)}getTimeStamp(){return+new Date}getTimeDelta(t){return+new Date-t}logTimeDelta(t,e,r){let n=void 0!==e?e:"Time Measurement",i=+new Date;this.info("".concat(n," logged at (epoch ").concat(+i,") took (").concat(t,"ms)"),r)}logTimeDeltaHuman(t,e,r){let n=void 0!==e?e:"Time Measurement",i=+new Date,s=parseInt(t%1e3),o=parseInt(t/1e3%60),a=parseInt(t/6e4%60),l=parseInt(t/36e5);s=s<10?"00"+s:s<100?"0"+s:s,o=o<10?"0"+o:o,a=a<10?"0"+a:a,l=l<10?"0"+l:l,this.info("".concat(n," logged at (epoch ").concat(+i,") took (").concat(t,"ms) or (").concat(l,":").concat(a,":").concat(o,".").concat(s,")"),r)}logTimeDeltaRelative(t,e,r){this.logTimeDelta(this.getTimeDelta(t),e,r)}logTimeDeltaRelativeHuman(t,e,r){this.logTimeDeltaHuman(this.getTimeDelta(t),e,r)}}e.exports=i,e.exports.new=function(t){return new i(t)},e.exports.LogProviderBase=t("./Fable-Log-BaseLogger.js"),e.exports.LogProviderConsole=t("./Fable-Log-Logger-Console.js"),e.exports.LogProviderConsole=t("./Fable-Log-Logger-SimpleFlatFile.js")},{"./Fable-Log-BaseLogger.js":26,"./Fable-Log-DefaultProviders-Node.js":27,"./Fable-Log-DefaultStreams.json":28,"./Fable-Log-Logger-Console.js":29,"./Fable-Log-Logger-SimpleFlatFile.js":30,"fable-serviceproviderbase":33}],32:[function(t,e,r){class n{constructor(t,e){this.fable=!1,this.options="object"==typeof t?t:{},this.serviceType="Unknown",this.UUID="CORESVC-".concat(Math.floor(89999*Math.random()+1e4)),this.Hash="string"==typeof e?e:"".concat(this.UUID)}connectFable(t){return this.fable=t,!0}}_defineProperty2(n,"isFableService",!0),e.exports=n},{}],33:[function(t,e,r){class n{constructor(t,e,r){this.fable=t,this.options="object"==typeof e?e:"object"!=typeof t||t.isFable?{}:t,this.serviceType="Unknown","function"==typeof t.getUUID?this.UUID=t.getUUID():this.UUID="NoFABLESVC-".concat(Math.floor(89999*Math.random()+1e4)),this.Hash="string"==typeof r?r:"".concat(this.UUID),this.log=this.fable.log,this.servicesMap=this.fable.servicesMap,this.services=this.fable.services}}_defineProperty2(n,"isFableService",!0),e.exports=n,e.exports.CoreServiceProviderBase=t("./Fable-ServiceProviderBase-Preinit.js")},{"./Fable-ServiceProviderBase-Preinit.js":32}],34:[function(t,e,r){e.exports={Product:"ApplicationNameHere",ProductVersion:"0.0.0",ConfigFile:!1,LogStreams:[{level:"trace"}]}},{}],35:[function(t,e,r){(function(r){(function(){const n=t("precedent");e.exports=class{constructor(t){this.templateProcessor=new n,this.templateProcessor.addPattern("${","}",(t=>{let e=t.trim(),n=e.indexOf("|");const i=n>=0?e.substring(n+1):"";let s=n>-1?e.substring(0,n):e;return r.env.hasOwnProperty(s)?r.env[s]:i}))}parseSetting(t){return this.templateProcessor.parseString(t)}}}).call(this)}).call(this,t("_process"))},{_process:78,precedent:75}],36:[function(t,e,r){const n=t("fable-serviceproviderbase").CoreServiceProviderBase,i=t("./Fable-Settings-TemplateProcessor.js");class s extends n{constructor(e,r){super(e,r),this.serviceType="SettingsManager",this.settingsTemplateProcessor=new i,this._configureEnvTemplating(e),this.default=this.buildDefaultSettings();let n=this.merge(e,this.buildDefaultSettings());if(this.base=JSON.parse(JSON.stringify(n)),n.DefaultConfigFile)try{n=this.merge(t(n.DefaultConfigFile),n)}catch(t){console.log("Fable-Settings Warning: Default configuration file specified but there was a problem loading it. Falling back to base."),console.log(" Loading Exception: "+t)}if(n.ConfigFile)try{n=this.merge(t(n.ConfigFile),n)}catch(t){console.log("Fable-Settings Warning: Configuration file specified but there was a problem loading it. Falling back to base."),console.log(" Loading Exception: "+t)}this.settings=n}buildDefaultSettings(){return JSON.parse(JSON.stringify(t("./Fable-Settings-Default")))}_configureEnvTemplating(t){this._PerformEnvTemplating=!t||!0!==t.NoEnvReplacement}_resolveEnv(t){for(const e in t)"object"==typeof t[e]?this._resolveEnv(t[e]):"string"==typeof t[e]&&(t[e]=this.settingsTemplateProcessor.parseSetting(t[e]))}_isObject(t){return"object"==typeof t&&!Array.isArray(t)}_deepMergeObjects(t,e){if(e&&this._isObject(e))return Object.keys(e).forEach((r=>{const n=e[r];if(this._isObject(n)){const e=t[r];if(e&&this._isObject(e))return void this._deepMergeObjects(e,n)}t[r]=n})),t}merge(t,e){let r="object"==typeof t?t:{},n="object"==typeof e?e:this.settings,i=JSON.parse(JSON.stringify(r));return n=this._deepMergeObjects(n,i),this._PerformEnvTemplating&&this._resolveEnv(n),this._configureEnvTemplating(n),n}fill(t){let e="object"==typeof t?t:{},r=JSON.parse(JSON.stringify(e));return this.settings=this._deepMergeObjects(r,this.settings),this.settings}}e.exports=s,e.exports.new=function(t){return new s(t)}},{"./Fable-Settings-Default":34,"./Fable-Settings-TemplateProcessor.js":35,"fable-serviceproviderbase":33}],37:[function(t,e,r){e.exports=class{constructor(){this.getRandomValues="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)}generateWhatWGBytes(){let t=new Uint8Array(16);return this.getRandomValues(t),t}generateRandomBytes(){let t=new Uint8Array(16);for(let e,r=0;r<16;r++)0==(3&r)&&(e=4294967296*Math.random()),t[r]=e>>>((3&r)<<3)&255;return t}generate(){return this.getRandomValues?this.generateWhatWGBytes():this.generateRandomBytes()}}},{}],38:[function(t,e,r){const n=t("fable-serviceproviderbase").CoreServiceProviderBase,i=t("./Fable-UUID-Random.js");class s extends n{constructor(t,e){super(t,e),this.serviceType="UUID",this._UUIDModeRandom=!("object"!=typeof t||!t.hasOwnProperty("UUIDModeRandom"))&&1==t.UUIDModeRandom,this._UUIDLength="object"==typeof t&&t.hasOwnProperty("UUIDLength")?t.UUIDLength+0:8,this._UUIDRandomDictionary="object"==typeof t&&t.hasOwnProperty("UUIDDictionary")?t.UUIDDictionary+0:"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",this.randomByteGenerator=new i,this._HexLookup=[];for(let t=0;t<256;++t)this._HexLookup[t]=(t+256).toString(16).substr(1)}bytesToUUID(t){let e=0;return[this._HexLookup[t[e++]],this._HexLookup[t[e++]],this._HexLookup[t[e++]],this._HexLookup[t[e++]],"-",this._HexLookup[t[e++]],this._HexLookup[t[e++]],"-",this._HexLookup[t[e++]],this._HexLookup[t[e++]],"-",this._HexLookup[t[e++]],this._HexLookup[t[e++]],"-",this._HexLookup[t[e++]],this._HexLookup[t[e++]],this._HexLookup[t[e++]],this._HexLookup[t[e++]],this._HexLookup[t[e++]],this._HexLookup[t[e++]]].join("")}generateUUIDv4(){new Array(16);var t=this.randomByteGenerator.generate();return t[6]=15&t[6]|64,t[8]=63&t[8]|128,this.bytesToUUID(t)}generateRandom(){let t="";for(let e=0;e<this._UUIDLength;e++)t+=this._UUIDRandomDictionary.charAt(Math.floor(Math.random()*(this._UUIDRandomDictionary.length-1)));return t}getUUID(){return this._UUIDModeRandom?this.generateRandom():this.generateUUIDv4()}}e.exports=s,e.exports.new=function(t){return new s(t)}},{"./Fable-UUID-Random.js":37,"fable-serviceproviderbase":33}],39:[function(t,e,r){const n=t("fable-serviceproviderbase");class i extends n.CoreServiceProviderBase{constructor(t,e){super(t,e),this.serviceType="ServiceManager",this.serviceTypes=[],this.servicesMap={},this.services={},this.serviceClasses={},this.extraServiceInitialization=!1}addServiceType(t,e){this.servicesMap.hasOwnProperty(t)?this.fable.log.warn("Adding a service type [".concat(t,"] that already exists.")):(this.servicesMap[t]={},this.serviceTypes.push(t)),"function"==typeof e&&e.isFableService?this.serviceClasses[t]=e:(this.fable.log.error("Attempted to add service type [".concat(t,"] with an invalid class. Using base service class, which will not crash but won't provide meaningful services.")),this.serviceClasses[t]=n)}addAndInstantiateServiceType(t,e){return this.addServiceType(t,e),this.instantiateServiceProvider(t,{},"".concat(t,"-Default"))}instantiateServiceProviderFromPrototype(t,e,r,n){let i=new n(this.fable,e,r);return this.extraServiceInitialization&&(i=this.extraServiceInitialization(i)),this.servicesMap[t][i.Hash]=i,this.services.hasOwnProperty(t)||this.setDefaultServiceInstantiation(t,i.Hash),i}instantiateServiceProvider(t,e,r){let n=this.instantiateServiceProviderWithoutRegistration(t,e,r);return this.servicesMap[t][n.Hash]=n,this.services.hasOwnProperty(t)||this.setDefaultServiceInstantiation(t,n.Hash),n}instantiateServiceProviderWithoutRegistration(t,e,r){let n=new this.serviceClasses[t](this.fable,e,r);return this.extraServiceInitialization&&(n=this.extraServiceInitialization(n)),n}connectPreinitServiceProviderInstance(t){let e=t.serviceType,r=t.Hash;return t.connectFable(this.fable),this.servicesMap.hasOwnProperty(e)||(this.servicesMap[e]={}),this.servicesMap[e][r]=t,this.services.hasOwnProperty(e)||this.setDefaultServiceInstantiation(e,r),t}setDefaultServiceInstantiation(t,e){return!!this.servicesMap[t].hasOwnProperty(e)&&(this.fable[t]=this.servicesMap[t][e],this.services[t]=this.servicesMap[t][e],!0)}}e.exports=i,e.exports.ServiceProviderBase=n,e.exports.CoreServiceProviderBase=n.CoreServiceProviderBase},{"fable-serviceproviderbase":33}],40:[function(t,e,r){const n=t("fable-settings"),i=t("fable-uuid"),s=t("fable-log"),o=t("./Fable-ServiceManager.js");class a{constructor(e){this._coreServices={},this._coreServices.SettingsManager=new n(e),this._coreServices.UUID=new i(this._coreServices.SettingsManager.settings),this._coreServices.Logging=new s(this._coreServices.SettingsManager.settings),this._coreServices.Logging.initialize(),this._coreServices.ServiceManager=new o(this),this.serviceManager=this._coreServices.ServiceManager,this.serviceManager.connectFable(this),this.serviceManager.connectPreinitServiceProviderInstance(this._coreServices.ServiceManager),this.serviceManager.connectPreinitServiceProviderInstance(this._coreServices.UUID),this.serviceManager.connectPreinitServiceProviderInstance(this._coreServices.Logging),this.serviceManager.connectPreinitServiceProviderInstance(this._coreServices.SettingsManager),this.serviceManager.addAndInstantiateServiceType("EnvironmentData",t("./services/Fable-Service-EnvironmentData.js")),this.serviceManager.addServiceType("Template",t("./services/Fable-Service-Template.js")),this.serviceManager.addServiceType("MetaTemplate",t("./services/Fable-Service-MetaTemplate.js")),this.serviceManager.addServiceType("Anticipate",t("./services/Fable-Service-Anticipate.js")),this.serviceManager.addAndInstantiateServiceType("DataFormat",t("./services/Fable-Service-DataFormat.js")),this.serviceManager.addAndInstantiateServiceType("DataGeneration",t("./services/Fable-Service-DataGeneration.js")),this.serviceManager.addAndInstantiateServiceType("Utility",t("./services/Fable-Service-Utility.js")),this.serviceManager.addServiceType("Operation",t("./services/Fable-Service-Operation.js")),this.serviceManager.addServiceType("RestClient",t("./services/Fable-Service-RestClient.js")),this.serviceManager.addServiceType("CSVParser",t("./services/Fable-Service-CSVParser.js")),this.serviceManager.addServiceType("Manifest",t("manyfest")),this.serviceManager.addServiceType("ObjectCache",t("cachetrax")),this.serviceManager.addServiceType("FilePersistence",t("./services/Fable-Service-FilePersistence.js"))}get isFable(){return!0}get settings(){return this._coreServices.SettingsManager.settings}get settingsManager(){return this._coreServices.SettingsManager}get log(){return this._coreServices.Logging}get services(){return this._coreServices.ServiceManager.services}get servicesMap(){return this._coreServices.ServiceManager.servicesMap}getUUID(){return this._coreServices.UUID.getUUID()}get fable(){return this}}e.exports=a,e.exports.new=function(t){return new a(t)},e.exports.LogProviderBase=s.LogProviderBase,e.exports.ServiceProviderBase=o.ServiceProviderBase,e.exports.CoreServiceProviderBase=o.CoreServiceProviderBase,e.exports.precedent=n.precedent},{"./Fable-ServiceManager.js":39,"./services/Fable-Service-Anticipate.js":41,"./services/Fable-Service-CSVParser.js":42,"./services/Fable-Service-DataFormat.js":43,"./services/Fable-Service-DataGeneration.js":45,"./services/Fable-Service-EnvironmentData.js":46,"./services/Fable-Service-FilePersistence.js":47,"./services/Fable-Service-MetaTemplate.js":48,"./services/Fable-Service-Operation.js":52,"./services/Fable-Service-RestClient.js":53,"./services/Fable-Service-Template.js":54,"./services/Fable-Service-Utility.js":55,cachetrax:21,"fable-log":31,"fable-settings":36,"fable-uuid":38,manyfest:70}],41:[function(t,e,r){const n=t("../Fable-ServiceManager.js").ServiceProviderBase;e.exports=class extends n{constructor(t,e,r){super(t,e,r),this.serviceType="AsyncAnticipate",this.operationQueue=[],this.erroredOperations=[],this.executingOperationCount=0,this.completedOperationCount=0,this.maxOperations=1,this.lastError=void 0,this.waitingFunctions=[]}checkQueue(){if(this.operationQueue.length>0&&this.executingOperationCount<this.maxOperations){let t=this.operationQueue.shift();this.executingOperationCount+=1,t(this.buildAnticipatorCallback())}else if(this.waitingFunctions.length>0&&this.executingOperationCount<1){for(let t=0;t<this.waitingFunctions.length;t++)this.waitingFunctions[t](this.lastError);this.lastError=void 0,this.waitingFunctions=[]}}anticipate(t){this.operationQueue.push(t),this.checkQueue()}buildAnticipatorCallback(){let t={Called:!1,Error:void 0,OperationSet:this};return function(e){if(t.Called)throw new Error("Anticipation async callback called twice...");t.Called=!0,t.error=e,t.OperationSet.executingOperationCount-=1,t.OperationSet.completedOperationCount+=1,t.OperationSet.checkQueue()}}wait(t){this.waitingFunctions.push(t),this.checkQueue()}}},{"../Fable-ServiceManager.js":39}],42:[function(t,e,r){const n=t("fable-serviceproviderbase");e.exports=class extends n{constructor(t,e,r){super(t,e,r),this.serviceType="CSVParser",this.Header=[],this.HeaderFieldNames=[],this.Delimiter=",",this.QuoteCharacter='"',this.CleanCharacters=["\r"],this.HeaderLineIndex=0,this.HasHeader=!0,this.HasSetHeader=!1,this.EmitHeader=!1,this.EmitJSON=!0,this.EscapedQuoteString=""",this.CurrentLine="",this.CurrentRecord=[],this.InQuote=!1,this.InEscapedQuote=!1,this.LinesParsed=0,this.RowsEmitted=0}marshalRowToJSON(t){if(!Array.isArray(t))return!1;for(let e=this.HeaderFieldNames.length;e<t.length;e++)this.HeaderFieldNames[e]="".concat(e);let e={};for(let r=0;r<t.length;r++)e[this.HeaderFieldNames[r]]=t[r];return e}setHeader(t){this.Header=t;for(let t=0;t<this.Header.length;t++)void 0===this.Header[t]?this.HeaderFieldNames[t]="".concat(t):this.HeaderFieldNames[t]=this.Header[t].toString()}resetRowState(){this.CurrentRecord=[]}pushLine(){for(let t=0;t<this.CleanCharacters.length;t++)this.CurrentLine=this.CurrentLine.replace(this.CleanCharacters[t],"");this.CurrentRecord.push(this.CurrentLine),this.CurrentLine=""}emitRow(t){let e=void 0===t?this.EmitJSON:t;this.RowsEmitted++;let r=this.CurrentRecord;return this.CurrentRecord=[],e?this.marshalRowToJSON(r):r}parseCSVLine(t){this.LinesParsed++;for(let e=0;e<t.length;e++)this.InQuote||t[e]!=this.Delimiter?t[e]==this.QuoteCharacter?this.InEscapedQuote?this.InEscapedQuote=!1:this.InQuote?e<t.length&&t[e+1]==this.QuoteCharacter?(this.CurrentLine+=this.EscapedQuoteString,this.InEscapedQuote=!0):this.InQuote=!1:this.InQuote=!0:this.CurrentLine+=t[e]:this.pushLine();return!this.InQuote&&(this.pushLine(),this.HasHeader&&!this.HasSetHeader&&this.RowsEmitted==this.HeaderLineIndex?(this.HasSetHeader=!0,this.setHeader(this.emitRow(!1)),!!this.EmitHeader&&this.Header):this.emitRow())}}},{"fable-serviceproviderbase":33}],43:[function(t,e,r){const n=t("fable-serviceproviderbase");e.exports=class extends n{constructor(t,e,r){super(t,e,r),_defineProperty2(this,"stringPadStart",(function(t,e,r){let n=t.toString();return this.stringGeneratePaddingString(n,e,r)+n})),_defineProperty2(this,"stringPadEnd",(function(t,e,r){let n=t.toString();return n+this.stringGeneratePaddingString(n,e,r)})),this.serviceType="DataArithmatic",this._Regex_formatterInsertCommas=/.{1,3}/g,this._Regex_formatterAddCommasToNumber=/^([-+]?)(0?)(\d+)(.?)(\d+)$/g,this._Regex_formatterDollarsRemoveCommas=/,/gi,this._Regex_formatterCleanNonAlphaChar=/[^a-zA-Z]/gi,this._Regex_formatterCapitalizeEachWord=/([a-zA-Z]+)/g,this._Value_MoneySign_Currency="$",this._Value_NaN_Currency="--",this._Value_GroupSeparator_Number=",",this._Value_Prefix_StringHash="HSH",this._Value_Clean_formatterCleanNonAlpha="",this._UseEngineStringStartsWith="function"==typeof String.prototype.startsWith,this._UseEngineStringEndsWith="function"==typeof String.prototype.endsWith}stringReverse(t){return t.split("").reverse().join("")}stringStartsWith(t,e,r){return this._UseEngineStringStartsWith?t.startsWith(e,r):this.stringStartsWith_Polyfill.call(t,e,r)}stringStartsWith_Polyfill(t,e){return this.slice(e||0,t.length)===t}stringEndsWith(t,e,r){return this._UseEngineStringEndsWith?t.endsWith(e,r):this.stringEndsWith_Polyfill.call(t,e,r)}stringEndsWith_Polyfill(t,e){return e<this.length?e|=0:e=this.length,this.substr(e-t.length,t.length)===t}insecureStringHash(t){let e=0,r=t.length,n=0;for(;n<r;)e=(e<<5)-e+t.charCodeAt(n++)|0;return"".concat(this._Value_Prefix_StringHash).concat(e)}capitalizeEachWord(t){return t.replace(this._Regex_formatterCapitalizeEachWord,(t=>t.charAt(0).toUpperCase()+t.substr(1)))}cleanEnclosureWrapCharacters(t,e){return e.startsWith(t)&&e.endsWith(t)?e.substring(1,e.length-1):e}cleanNonAlphaCharacters(t){return"string"==typeof t&&""!=t?t.replace(this._Regex_formatterCleanNonAlphaChar,this._Value_Clean_formatterCleanNonAlpha):""}formatterInsertCommas(t){let e=this.stringReverse(t).match(this._Regex_formatterInsertCommas).join(",");return this.stringReverse(e)}processAddCommasToNumberRegex(t,e,r,n,i,s){return e+(i?this.formatterInsertCommas(n)+i+s:this.formatterInsertCommas(n+s))}formatterAddCommasToNumber(t){return t.toString().replace(this._Regex_formatterAddCommasToNumber,this.processAddCommasToNumberRegex.bind(this))}formatterDollars(t){if(isNaN(t))return this._Value_NaN_Currency;let e=this.fable.Utility.bigDecimal.round(t,2);return isNaN(e)&&("string"==typeof t&&(e=parseFloat(t.replace(this._Value_MoneySign_Currency,"").replace(this._Regex_formatterDollarsRemoveCommas,"")).toFixed(2)),isNaN(e))?this._Value_NaN_Currency:"$".concat(this.formatterAddCommasToNumber(e))}formatterRoundNumber(t,e){let r=void 0===e?2:e;if(isNaN(t)){return(0).toFixed(r)}let n=this.fable.Utility.bigDecimal.round(t,r);if(isNaN(n)){return(0).toFixed(r)}return n}stringGeneratePaddingString(t,e,r){let n=e>>0;String(void 0!==r?r:" ");if(t.length>e)return"";{let i=e-t.length;return i>r.length&&(r+=r.repeat(n/r.length)),r.slice(0,i)}}formatTimeSpan(t){if("number"!=typeof t)return"";let e=parseInt(t%1e3),r=parseInt(t/1e3%60),n=parseInt(t/6e4%60),i=parseInt(t/36e5);return"".concat(this.stringPadStart(i,2,"0"),":").concat(this.stringPadStart(n,2,"0"),":").concat(this.stringPadStart(r,2,"0"),".").concat(this.stringPadStart(e,3,"0"))}formatTimeDelta(t,e){return"number"!=typeof t||"number"!=typeof e?"":this.formatTimeSpan(e-t)}getMonthFromDate(t){return["January","February","March","April","May","June","July","August","September","October","November","December"][t.getMonth()]}getMonthAbbreviatedFromDate(t){return["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.getMonth()]}formatSortableStringFromDate(t){return t.getFullYear()+this.stringPadStart(t.getMonth(),2,"0")+this.stringPadStart(t.getDate(),2,"0")}stringBeforeMatch(t,e){return t.split(e)[0]}stringAfterMatch(t,e){let r=t.indexOf(e);return r<0||r+e.length>=t.length?"":t.substring(r+e.length)}stringCountEnclosures(t,e,r){let n="string"==typeof t?t:"",i="string"==typeof e?e:"(",s="string"==typeof r?r:")",o=0,a=0;for(let t=0;t<n.length;t++)n[t]==i?(0==a&&o++,a++):n[t]==s&&a--;return o}stringGetEnclosureValueByIndex(t,e,r,n){let i="string"==typeof t?t:"",s="number"==typeof e?e:0,o="string"==typeof r?r:"(",a="string"==typeof n?n:")",l=0,c=0,h=!1,u=0,f=0;for(let t=0;t<i.length;t++)i[t]==o?(c++,1==c&&(l++,s==l-1&&(h=!0,u=t))):i[t]==a&&(c--,0==c&&h&&f<=u&&(f=t,h=!1));return l<=s?"":f>0&&f>u?i.substring(u+1,f):i.substring(u+1)}stringRemoveEnclosureByIndex(t,e,r,n){let i="string"==typeof t?t:"",s="number"==typeof e?e:0,o="string"==typeof r?r:"(",a="string"==typeof n?n:")",l=0,c=0,h=!1,u=0,f=0;for(let t=0;t<i.length;t++)i[t]==o?(c++,1==c&&(l++,s==l-1&&(h=!0,u=t))):i[t]==a&&(c--,0==c&&h&&f<=u&&(f=t,h=!1));if(l<=s)return i;let p="";return u>1&&(p=i.substring(0,u)),i.length>f+1&&f>u&&(p+=i.substring(f+1)),p}}},{"fable-serviceproviderbase":33}],44:[function(t,e,r){e.exports={DefaultIntegerMinimum:0,DefaultIntegerMaximum:9999999,DefaultNumericStringLength:10,MonthSet:["January","February","March","April","May","June","July","August","September","October","November","December"],WeekDaySet:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ColorSet:["Red","Orange","Yellow","Green","Blue","Indigo","Violet","Pink","Purple","Turquoise","Gold","Lime","Maroon","Navy","Coral","Teal","Brown","White","Black","Sky","Berry","Grey","Straw","Silver","Sapphire"],SurNameSet:["Smith","Johnson","Williams","Brown","Jones","Miller","Davis","Garcia","Rodriguez","Wilson","Martinez","Anderson","Taylor","Thomas","Hernandez","Moore","Martin","Jackson","Thompson","White","Lopez","Lee","Gonzalez","Harris","Clark","Lewis","Robinson","Walker","Perez","Hall","Young","Allen","Sanchez","Wright","King","Scott","Green","Baker","Adams","Nelson","Hill","Ramirez","Campbell","Mitchell","Roberts","Carter","Phillips","Evans","Turner","Torres","Parker","Collins","Edwards","Stewart","Flores","Morris","Nguyen","Murphy","Rivera","Cook","Rogers","Morgan","Peterson","Cooper","Reed","Bailey","Bell","Gomez","Kelly","Howard","Ward","Cox","Diaz","Richardson","Wood","Watson","Brooks","Bennett","Gray","James","Reyes","Cruz","Hughes","Price","Myers","Long","Foster","Sanders","Ross","Morales","Powell","Sullivan","Russell","Ortiz","Jenkins","Gutierrez","Perry","Butler","Barnes","Fisher"],NameSet:["Mary","Patricia","Jennifer","Linda","Elizabeth","Barbara","Susan","Jessica","Sarah","Karen","Lisa","Nancy","Betty","Sandra","Margaret","Ashley","Kimberly","Emily","Donna","Michelle","Carol","Amanda","Melissa","Deborah","Stephanie","Dorothy","Rebecca","Sharon","Laura","Cynthia","Amy","Kathleen","Angela","Shirley","Brenda","Emma","Anna","Pamela","Nicole","Samantha","Katherine","Christine","Helen","Debra","Rachel","Carolyn","Janet","Maria","Catherine","Heather","Diane","Olivia","Julie","Joyce","Victoria","Ruth","Virginia","Lauren","Kelly","Christina","Joan","Evelyn","Judith","Andrea","Hannah","Megan","Cheryl","Jacqueline","Martha","Madison","Teresa","Gloria","Sara","Janice","Ann","Kathryn","Abigail","Sophia","Frances","Jean","Alice","Judy","Isabella","Julia","Grace","Amber","Denise","Danielle","Marilyn","Beverly","Charlotte","Natalie","Theresa","Diana","Brittany","Doris","Kayla","Alexis","Lori","Marie","James","Robert","John","Michael","David","William","Richard","Joseph","Thomas","Christopher","Charles","Daniel","Matthew","Anthony","Mark","Donald","Steven","Andrew","Paul","Joshua","Kenneth","Kevin","Brian","George","Timothy","Ronald","Jason","Edward","Jeffrey","Ryan","Jacob","Gary","Nicholas","Eric","Jonathan","Stephen","Larry","Justin","Scott","Brandon","Benjamin","Samuel","Gregory","Alexander","Patrick","Frank","Raymond","Jack","Dennis","Jerry","Tyler","Aaron","Jose","Adam","Nathan","Henry","Zachary","Douglas","Peter","Kyle","Noah","Ethan","Jeremy","Walter","Christian","Keith","Roger","Terry","Austin","Sean","Gerald","Carl","Harold","Dylan","Arthur","Lawrence","Jordan","Jesse","Bryan","Billy","Bruce","Gabriel","Joe","Logan","Alan","Juan","Albert","Willie","Elijah","Wayne","Randy","Vincent","Mason","Roy","Ralph","Bobby","Russell","Bradley","Philip","Eugene"]}},{}],45:[function(t,e,r){const n=t("../Fable-ServiceManager.js").ServiceProviderBase;e.exports=class extends n{constructor(e,r,n){super(e,r,n),this.serviceType="DataGeneration",this.defaultData=t("./Fable-Service-DataGeneration-DefaultValues.json")}randomIntegerBetween(t,e){return Math.floor(Math.random()*(e-t))+t}randomIntegerUpTo(t){return this.randomIntegerBetween(0,t)}randomInteger(){return Math.floor(Math.random()*this.defaultData.DefaultIntegerMaximum)}randomNumericString(t,e){let r=void 0===e?10**(void 0===t?10:t)-1:e;return this.services.DataFormat.stringPadStart(this.randomIntegerUpTo(r),t,"0")}randomMonth(){return this.defaultData.MonthSet[this.randomIntegerUpTo(this.defaultData.MonthSet.length-1)]}randomDayOfWeek(){return this.defaultData.WeekDaySet[this.randomIntegerUpTo(this.defaultData.WeekDaySet.length-1)]}randomColor(){return this.defaultData.ColorSet[this.randomIntegerUpTo(this.defaultData.ColorSet.length-1)]}randomName(){return this.defaultData.NameSet[this.randomIntegerUpTo(this.defaultData.NameSet.length-1)]}randomSurname(){return this.defaultData.SurNameSet[this.randomIntegerUpTo(this.defaultData.SurNameSet.length-1)]}}},{"../Fable-ServiceManager.js":39,"./Fable-Service-DataGeneration-DefaultValues.json":44}],46:[function(t,e,r){const n=t("../Fable-ServiceManager.js").ServiceProviderBase;e.exports=class extends n{constructor(t,e,r){super(t,e,r),this.serviceType="EnvironmentData",this.Environment="node.js"}}},{"../Fable-ServiceManager.js":39}],47:[function(t,e,r){(function(r){(function(){const n=t("../Fable-ServiceManager.js").ServiceProviderBase,i=t("fs"),s=t("path");e.exports=class extends n{constructor(t,e,n){super(t,e,n),this.serviceType="FilePersistence",this.options.hasOwnProperty("Mode")||(this.options.Mode=parseInt("0777",8)&~r.umask()),this.currentInputFolder="/tmp",this.currentOutputFolder="/tmp"}joinPath(){return s.resolve(...arguments)}existsSync(t){return i.existsSync(t)}exists(t,e){return e(null,this.existsSync(t))}writeFileSync(t,e,r){let n=void 0===r?"utf8":r;return i.writeFileSync(t,e,n)}appendFileSync(t,e,r){let n=void 0===r?"utf8":r;return i.appendFileSync(t,e,n)}deleteFileSync(t){return i.unlinkSync(t)}deleteFolderSync(t){return i.rmdirSync(t)}writeFileSyncFromObject(t,e){return this.writeFileSync(t,JSON.stringify(e,null,4))}writeFileSyncFromArray(t,e){if(!Array.isArray(e))return this.log.error("File Persistence Service attempted to write ".concat(t," from array but the expected array was not an array (it was a ").concat(typeof e,").")),Error("Attempted to write ${pFileName} from array but the expected array was not an array (it was a ${typeof(pFileArray)}).");for(let r=0;r<e.length;r++)return this.appendFileSync(t,"".concat(e[r],"\n"))}getDefaultOutputPath(t){return s.join(this.currentOutputFolder,t)}dataFolderWriteSync(t,e){return this.writeFileSync(this.getDefaultOutputPath(t),e)}dataFolderWriteSyncFromObject(t,e){return this.writeFileSyncFromObject(this.getDefaultOutputPath(t),e)}dataFolderWriteSyncFromArray(t,e){return this.writeFileSyncFromArray(this.getDefaultOutputPath(t),e)}makeFolderRecursive(t,e){let r=t;if("string"==typeof t)r={Path:t};else if("object"!=typeof t)return e(new Error("Parameters object or string not properly passed to recursive folder create.")),!1;return"string"!=typeof r.Path?(e(new Error("Parameters object needs a path to run the folder create operation.")),!1):(r.hasOwnProperty("Mode")||(r.Mode=this.options.Mode),void 0===r.CurrentPathIndex?(r.ActualPath=s.normalize(r.Path),r.ActualPathParts=r.ActualPath.split(s.sep),r.CurrentPathIndex=0,r.CurrentPath=""):(r.CurrentPath==s.sep?r.CurrentPath=r.CurrentPath+r.ActualPathParts[r.CurrentPathIndex]:r.CurrentPath=r.CurrentPath+s.sep+r.ActualPathParts[r.CurrentPathIndex],r.CurrentPathIndex++),r.CurrentPathIndex>=r.ActualPathParts.length?e(null):void i.open(r.CurrentPath+s.sep+r.ActualPathParts[r.CurrentPathIndex],"r",((t,n)=>{if(n&&i.closeSync(n),!t||"ENOENT"!=t.code)return this.makeFolderRecursive(r,e);i.mkdir(r.CurrentPath+s.sep+r.ActualPathParts[r.CurrentPathIndex],r.Mode,(t=>t?"EEXIST"==t.code?this.makeFolderRecursive(r,e):(console.log(t.code),e(t)):this.makeFolderRecursive(r,e)))})))}}}).call(this)}).call(this,t("_process"))},{"../Fable-ServiceManager.js":39,_process:78,fs:18,path:72}],48:[function(t,e,r){const n=t("../Fable-ServiceManager.js").ServiceProviderBase,i=t("./Fable-Service-MetaTemplate/MetaTemplate-WordTree.js"),s=t("./Fable-Service-MetaTemplate/MetaTemplate-StringParser.js");e.exports=class extends n{constructor(t,e,r){super(t,e,r),this.serviceType="MetaTemplate",this.WordTree=new i,this.StringParser=new s(this.fable.services.Utility.eachLimit),this.ParseTree=this.WordTree.ParseTree}addPattern(t,e,r){return this.WordTree.addPattern(t,e,r)}addPatternAsync(t,e,r){return this.WordTree.addPatternAsync(t,e,r)}parseString(t,e,r){return this.StringParser.parseString(t,this.ParseTree,e,r)}}},{"../Fable-ServiceManager.js":39,"./Fable-Service-MetaTemplate/MetaTemplate-StringParser.js":49,"./Fable-Service-MetaTemplate/MetaTemplate-WordTree.js":50}],49:[function(t,e,r){e.exports=class{constructor(t){this.eachLimit=t}newParserState(t){return{ParseTree:t,Asynchronous:!1,Output:"",OutputBuffer:"",Pattern:{},PatternMatch:!1,PatternMatchEnd:!1}}appendOutputBuffer(t,e){e.OutputBuffer+=t}flushOutputBuffer(t){t.Output+=t.OutputBuffer,t.OutputBuffer=""}resetOutputBuffer(t){return this.flushOutputBuffer(t),t.Pattern=!1,t.PatternStartNode=!1,t.StartPatternMatchComplete=!1,t.EndPatternMatchBegan=!1,t.PatternMatch=!1,!0}parseCharacter(t,e,r){if(e.PatternMatch)if(!e.StartPatternMatchComplete&&e.Pattern.hasOwnProperty(t))e.Pattern=e.Pattern[t],this.appendOutputBuffer(t,e);else if(e.EndPatternMatchBegan)if(e.Pattern.PatternEnd.hasOwnProperty(t)){if(e.Pattern=e.Pattern.PatternEnd[t],this.appendOutputBuffer(t,e),e.Pattern.hasOwnProperty("Parse"))return e.OutputBuffer=e.Pattern.Parse(e.OutputBuffer.substr(e.Pattern.PatternStartString.length,e.OutputBuffer.length-(e.Pattern.PatternStartString.length+e.Pattern.PatternEndString.length)),r),this.resetOutputBuffer(e)}else e.PatternStartNode.PatternEnd.hasOwnProperty(t)?(e.Pattern=e.PatternStartNode.PatternEnd[t],this.appendOutputBuffer(t,e)):(e.EndPatternMatchBegan=!1,this.appendOutputBuffer(t,e));else if(e.Pattern.hasOwnProperty("PatternEnd")){if(e.StartPatternMatchComplete||(e.StartPatternMatchComplete=!0,e.PatternStartNode=e.Pattern),this.appendOutputBuffer(t,e),e.Pattern.PatternEnd.hasOwnProperty(t)&&(e.EndPatternMatchBegan=!0,e.Pattern=e.Pattern.PatternEnd[t],e.Pattern.hasOwnProperty("Parse"))){if(!e.Pattern.isAsync)return e.OutputBuffer=e.Pattern.Parse(e.OutputBuffer.substr(e.Pattern.PatternStartString.length,e.OutputBuffer.length-(e.Pattern.PatternStartString.length+e.Pattern.PatternEndString.length)),r),this.resetOutputBuffer(e);this.log.error("MetaTemplate: The pattern ".concat(e.Pattern.PatternStartString," is asynchronous and cannot be used in a synchronous parser.")),this.resetOutputBuffer(e)}}else this.resetOutputBuffer(e);if(!e.PatternMatch){if(e.ParseTree.hasOwnProperty(t))return this.resetOutputBuffer(e),this.appendOutputBuffer(t,e),e.Pattern=e.ParseTree[t],e.PatternMatch=!0,!0;this.appendOutputBuffer(t,e)}return!1}parseCharacterAsync(t,e,r,n){if(e.PatternMatch)if(!e.StartPatternMatchComplete&&e.Pattern.hasOwnProperty(t))e.Pattern=e.Pattern[t],this.appendOutputBuffer(t,e);else if(e.EndPatternMatchBegan)if(e.Pattern.PatternEnd.hasOwnProperty(t)){if(e.Pattern=e.Pattern.PatternEnd[t],this.appendOutputBuffer(t,e),e.Pattern.hasOwnProperty("Parse"))return e.Pattern.isAsync?e.Pattern.Parse(e.OutputBuffer.substr(e.Pattern.PatternStartString.length,e.OutputBuffer.length-(e.Pattern.PatternStartString.length+e.Pattern.PatternEndString.length)),r,((t,r)=>(t&&console.log("Precedent ERROR: Async template error happened parsing ".concat(e.Pattern.PatternStart," ... ").concat(e.Pattern.PatternEnd,": ").concat(t)),e.OutputBuffer=r,this.resetOutputBuffer(e),n()))):(e.OutputBuffer=e.Pattern.Parse(e.OutputBuffer.substr(e.Pattern.PatternStartString.length,e.OutputBuffer.length-(e.Pattern.PatternStartString.length+e.Pattern.PatternEndString.length)),r),this.resetOutputBuffer(e),n())}else e.PatternStartNode.PatternEnd.hasOwnProperty(t)?(e.Pattern=e.PatternStartNode.PatternEnd[t],this.appendOutputBuffer(t,e)):(e.EndPatternMatchBegan=!1,this.appendOutputBuffer(t,e));else{if(!e.Pattern.hasOwnProperty("PatternEnd"))return this.resetOutputBuffer(e),n();if(e.StartPatternMatchComplete||(e.StartPatternMatchComplete=!0,e.PatternStartNode=e.Pattern),this.appendOutputBuffer(t,e),e.Pattern.PatternEnd.hasOwnProperty(t)&&(e.EndPatternMatchBegan=!0,e.Pattern=e.Pattern.PatternEnd[t],e.Pattern.hasOwnProperty("Parse")))return e.Pattern.isAsync?e.Pattern.Parse(e.OutputBuffer.substr(e.Pattern.PatternStartString.length,e.OutputBuffer.length-(e.Pattern.PatternStartString.length+e.Pattern.PatternEndString.length)),r,((t,r)=>(t&&console.log("Precedent ERROR: Async template error happened parsing ".concat(e.Pattern.PatternStart," ... ").concat(e.Pattern.PatternEnd,": ").concat(t)),e.OutputBuffer=r,this.resetOutputBuffer(e),n()))):(e.OutputBuffer=e.Pattern.Parse(e.OutputBuffer.substr(e.Pattern.PatternStartString.length,e.OutputBuffer.length-(e.Pattern.PatternStartString.length+e.Pattern.PatternEndString.length)),r),this.resetOutputBuffer(e),n())}return e.PatternMatch||(e.ParseTree.hasOwnProperty(t)?(this.resetOutputBuffer(e),this.appendOutputBuffer(t,e),e.Pattern=e.ParseTree[t],e.PatternMatch=!0):this.appendOutputBuffer(t,e)),n()}parseString(t,e,r,n){if("function"!=typeof n){let s=this.newParserState(e);for(var i=0;i<t.length;i++)this.parseCharacter(t[i],s,r,n);return this.flushOutputBuffer(s),s.Output}{let i=this.newParserState(e);i.Asynchronous=!0,this.eachLimit(t,1,((t,e)=>{this.parseCharacterAsync(t,i,r,e)}),(t=>{this.flushOutputBuffer(i),n(t,i.Output)}))}}}},{}],50:[function(t,e,r){e.exports=class{constructor(){this.ParseTree={}}addChild(t,e){return t.hasOwnProperty(e)||(t[e]={}),t[e]}addEndChild(t,e){return t.hasOwnProperty("PatternEnd")||(t.PatternEnd={}),t.PatternEnd[e]={},t.PatternEnd[e]}addPattern(t,e,r){if(t.length<1)return!1;if("string"==typeof e&&e.length<1)return!1;let n=this.ParseTree;for(var i=0;i<t.length;i++)n=this.addChild(n,t[i],i);n.hasOwnProperty("PatternEnd")||(n.PatternEnd={});let s="string"==typeof e?e:t;for(let t=0;t<s.length;t++)n=this.addEndChild(n,s[t],t);return n.PatternStartString=t,n.PatternEndString=s,n.Parse="function"==typeof r?r:"string"==typeof r?()=>r:t=>t,n}addPatternAsync(t,e,r){let n=this.addPattern(t,e,r);n&&(n.isAsync=!0)}}},{}],51:[function(t,e,r){e.exports={Metadata:{UUID:!1,Hash:!1,Title:"",Summary:"",Version:0},Status:{Completed:!1,CompletionProgress:0,CompletionTimeElapsed:0,Steps:1,StepsCompleted:0,StartTime:0,EndTime:0},Errors:[],Log:[]}},{}],52:[function(t,e,r){const n=t("../Fable-ServiceManager.js").ServiceProviderBase,i=JSON.stringify(t("./Fable-Service-Operation-DefaultSettings.js"));e.exports=class extends n{constructor(t,e,r){super(t,e,r),this.serviceType="PhasedOperation",this.state=JSON.parse(i),this.state.Metadata.Hash=this.Hash,this.state.Metadata.UUID=this.UUID,this.name="string"==typeof this.options.Name?this.options.Name:"Unnamed Operation ".concat(this.state.Metadata.UUID),this.log=this}writeOperationLog(t,e,r){this.state.Log.push("".concat((new Date).toUTCString()," [").concat(t,"]: ").concat(e)),"object"==typeof r&&this.state.Log.push(JSON.stringify(r))}writeOperationErrors(t,e){this.state.Errors.push("".concat(t)),"object"==typeof e&&this.state.Errors.push(JSON.stringify(e))}trace(t,e){this.writeOperationLog("TRACE",t,e),this.fable.log.trace(t,e)}debug(t,e){this.writeOperationLog("DEBUG",t,e),this.fable.log.debug(t,e)}info(t,e){this.writeOperationLog("INFO",t,e),this.fable.log.info(t,e)}warn(t,e){this.writeOperationLog("WARN",t,e),this.fable.log.warn(t,e)}error(t,e){this.writeOperationLog("ERROR",t,e),this.writeOperationErrors(t,e),this.fable.log.error(t,e)}fatal(t,e){this.writeOperationLog("FATAL",t,e),this.writeOperationErrors(t,e),this.fable.log.fatal(t,e)}}},{"../Fable-ServiceManager.js":39,"./Fable-Service-Operation-DefaultSettings.js":51}],53:[function(t,e,r){(function(r){(function(){const n=t("../Fable-ServiceManager.js").ServiceProviderBase,i=t("simple-get"),s=t("cookie");e.exports=class extends n{constructor(t,e,r){super(t,e,r),this.TraceLog=!1,(this.options.TraceLog||this.fable.TraceLog)&&(this.TraceLog=!0),this.dataFormat=this.fable.services.DataFormat,this.serviceType="RestClient",this.cookie=!1,this.prepareRequestOptions=t=>t}get simpleGet(){return i}prepareCookies(t){if(this.cookie){let e=this.cookie;t.hasOwnProperty("headers")||(t.headers={});let r=Object.keys(e);r.length>0&&(t.headers.cookie=s.serialize(r[0],e[r[0]]))}return t}preRequest(t){let e=this.prepareCookies(t);return this.prepareRequestOptions(e)}executeChunkedRequest(t,e){let r=this.preRequest(t);return r.RequestStartTime=this.fable.log.getTimeStamp(),this.TraceLog&&this.fable.log.debug("Beginning ".concat(r.method," request to ").concat(r.url," at ").concat(r.RequestStartTime)),i(r,((t,n)=>{if(t)return e(t,n);if(this.TraceLog){let t=this.fable.log.getTimeStamp();this.fable.log.debug("--\x3e ".concat(r.method," connected in ").concat(this.dataFormat.formatTimeDelta(r.RequestStartTime,t),"ms code ").concat(n.statusCode))}let i="";n.on("data",(t=>{if(this.TraceLog){let e=this.fable.log.getTimeStamp();this.fable.log.debug("--\x3e ".concat(r.method," data chunk size ").concat(t.length,"b received in ").concat(this.dataFormat.formatTimeDelta(r.RequestStartTime,e),"ms"))}i+=t})),n.on("end",(()=>{if(this.TraceLog){let t=this.fable.log.getTimeStamp();this.fable.log.debug("==> ".concat(r.method," completed data size ").concat(i.length,"b received in ").concat(this.dataFormat.formatTimeDelta(r.RequestStartTime,t),"ms"))}return e(t,n,i)}))}))}executeChunkedRequestBinary(t,e){let n=this.preRequest(t);return n.RequestStartTime=this.fable.log.getTimeStamp(),this.TraceLog&&this.fable.log.debug("Beginning ".concat(n.method," request to ").concat(n.url," at ").concat(n.RequestStartTime)),n.json=!1,n.encoding=null,i(n,((t,i)=>{if(t)return e(t,i);if(this.TraceLog){let t=this.fable.log.getTimeStamp();this.fable.log.debug("--\x3e ".concat(n.method," connected in ").concat(this.dataFormat.formatTimeDelta(n.RequestStartTime,t),"ms code ").concat(i.statusCode))}let s=!1;i.on("data",(t=>{if(this.TraceLog){let e=this.fable.log.getTimeStamp();this.fable.log.debug("--\x3e ".concat(n.method," data chunk size ").concat(t.length,"b received in ").concat(this.dataFormat.formatTimeDelta(n.RequestStartTime,e),"ms"))}s=s?r.concat([s,t]):r.from(t)})),i.on("end",(()=>{if(this.TraceLog){let t=this.fable.log.getTimeStamp();this.fable.log.debug("==> ".concat(n.method," completed data size ").concat(s.length,"b received in ").concat(this.dataFormat.formatTimeDelta(n.RequestStartTime,t),"ms"))}return e(t,i,s)}))}))}executeJSONRequest(t,e){t.json=!0;let r=this.preRequest(t);return r.hasOwnProperty("headers")||(r.headers={}),r.RequestStartTime=this.fable.log.getTimeStamp(),this.TraceLog&&this.fable.log.debug("Beginning ".concat(r.method," JSON request to ").concat(r.url," at ").concat(r.RequestStartTime)),i(r,((t,n)=>{if(t)return e(t,n);if(this.TraceLog){let t=this.fable.log.getTimeStamp();this.fable.log.debug("--\x3e JSON ".concat(r.method," connected in ").concat(this.dataFormat.formatTimeDelta(r.RequestStartTime,t),"ms code ").concat(n.statusCode))}let i="";n.on("data",(t=>{if(this.TraceLog){let e=this.fable.log.getTimeStamp();this.fable.log.debug("--\x3e JSON ".concat(r.method," data chunk size ").concat(t.length,"b received in ").concat(this.dataFormat.formatTimeDelta(r.RequestStartTime,e),"ms"))}i+=t})),n.on("end",(()=>{if(this.TraceLog){let t=this.fable.log.getTimeStamp();this.fable.log.debug("==> JSON ".concat(r.method," completed - received in ").concat(this.dataFormat.formatTimeDelta(r.RequestStartTime,t),"ms"))}return e(t,n,JSON.parse(i))}))}))}getJSON(t,e){let r="object"==typeof t?t:{};return"string"==typeof t&&(r.url=t),r.method="GET",this.executeJSONRequest(r,e)}putJSON(t,e){return"object"!=typeof t.body?e(new Error("PUT JSON Error Invalid options object")):(t.method="PUT",this.executeJSONRequest(t,e))}postJSON(t,e){return"object"!=typeof t.body?e(new Error("POST JSON Error Invalid options object")):(t.method="POST",this.executeJSONRequest(t,e))}patchJSON(t,e){return"object"!=typeof t.body?e(new Error("PATCH JSON Error Invalid options object")):(t.method="PATCH",this.executeJSONRequest(t,e))}headJSON(t,e){return"object"!=typeof t.body?e(new Error("HEAD JSON Error Invalid options object")):(t.method="HEAD",this.executeJSONRequest(t,e))}delJSON(t,e){return t.method="DELETE",this.executeJSONRequest(t,e)}getRawText(t,e){let r="object"==typeof t?t:{};return"string"==typeof t&&(r.url=t),r.method="GET",this.executeChunkedRequest(r,e)}}}).call(this)}).call(this,t("buffer").Buffer)},{"../Fable-ServiceManager.js":39,buffer:19,cookie:24,"simple-get":85}],54:[function(t,e,r){const n=t("../Fable-ServiceManager.js").ServiceProviderBase;e.exports=class extends n{constructor(t,e,r){super(t,e,r),this.serviceType="Template",this.Matchers={Evaluate:/<%([\s\S]+?)%>/g,Interpolate:/<%=([\s\S]+?)%>/g,Escaper:/\\|'|\r|\n|\t|\u2028|\u2029/g,Unescaper:/\\(\\|'|r|n|t|u2028|u2029)/g,GuaranteedNonMatch:/.^/},this.templateEscapes={"\\":"\\","'":"'",r:"\r","\r":"r",n:"\n","\n":"n",t:"\t","\t":"t",u2028:"\u2028","\u2028":"u2028",u2029:"\u2029","\u2029":"u2029"},this.renderFunction=!1,this.templateString=!1}renderTemplate(t){return this.renderFunction(t)}templateFunction(t){return this.renderTemplate.bind(this)}buildTemplateFunction(t,e){return this.TemplateSource="__p+='"+t.replace(this.Matchers.Escaper,(t=>"\\".concat(this.templateEscapes[t]))).replace(this.Matchers.Interpolate||this.Matchers.GuaranteedNonMatch,((t,e)=>"'+\n(".concat(decodeURIComponent(e),")+\n'"))).replace(this.Matchers.Evaluate||this.Matchers.GuaranteedNonMatch,((t,e)=>"';\n".concat(decodeURIComponent(e),"\n;__p+='")))+"';\n",this.TemplateSource="with(pTemplateDataObject||{}){\n".concat(this.TemplateSource,"}\n"),this.TemplateSource="var __p='';var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n".concat(this.TemplateSource,"return __p;\n"),this.renderFunction=new Function("pTemplateDataObject",this.TemplateSource),void 0!==e?this.renderFunction(e):(this.TemplateSourceCompiled="function(obj){\n"+this.TemplateSource+"}",this.templateFunction())}}},{"../Fable-ServiceManager.js":39}],55:[function(t,e,r){const n=t("../Fable-ServiceManager.js").ServiceProviderBase,i=t("async.waterfall"),s=t("async.eachlimit"),o=t("js-big-decimal");e.exports=class extends n{constructor(t,e,r){super(t,e,r),this.templates={},this.waterfall=i,this.eachLimit=s,this.bigDecimal=o}extend(t){for(let e=0;e<(arguments.length<=1?0:arguments.length-1);e++){let r=e+1<1||arguments.length<=e+1?void 0:arguments[e+1];if("object"==typeof r){let e=Object.keys(r);for(let n=0;n<e.length;n++)t[e[n]]=r[e[n]]}}return t}template(t,e){return this.fable.serviceManager.instantiateServiceProviderWithoutRegistration("Template").buildTemplateFunction(t,e)}buildHashedTemplate(t,e,r){let n=this.fable.serviceManager.instantiateServiceProvider("Template",{},t);return this.templates[t]=n.buildTemplateFunction(e,r),this.templates[t]}chunk(t,e,r){let n=[...t],i="number"==typeof e?e:0,s=void 0!==r?r:[];if(i<=0)return s;for(;n.length;)s.push(n.splice(0,i));return s}isoStringToDate(t){let e=t.split(/\D+/),r=new Date,n=0,i=0;return r.setUTCFullYear(parseInt(e[0])),r.setUTCMonth(parseInt(e[1]-1)),r.setUTCDate(parseInt(e[2])),r.setUTCHours(parseInt(e[3])),r.setUTCMinutes(parseInt(e[4])),r.setUTCSeconds(parseInt(e[5])),r.setUTCMilliseconds(parseInt(e[6])),(e[7]||e[8])&&(e[8]&&(i=parseInt(e[8])/60),n=parseInt(e[7])+i,"+"==t.substr(-6,1)&&(n*=-1)),r.setHours(r.getHours()+n),r}}},{"../Fable-ServiceManager.js":39,"async.eachlimit":1,"async.waterfall":15,"js-big-decimal":59}],56:[function(t,e,r){var n=t("http"),i=t("url"),s=e.exports;for(var o in n)n.hasOwnProperty(o)&&(s[o]=n[o]);function a(t){if("string"==typeof t&&(t=i.parse(t)),t.protocol||(t.protocol="https:"),"https:"!==t.protocol)throw new Error('Protocol "'+t.protocol+'" not supported. Expected "https:"');return t}s.request=function(t,e){return t=a(t),n.request.call(this,t,e)},s.get=function(t,e){return t=a(t),n.get.call(this,t,e)}},{http:86,url:107}],57:[function(t,e,r){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */r.read=function(t,e,r,n,i){var s,o,a=8*i-n-1,l=(1<<a)-1,c=l>>1,h=-7,u=r?i-1:0,f=r?-1:1,p=t[e+u];for(u+=f,s=p&(1<<-h)-1,p>>=-h,h+=a;h>0;s=256*s+t[e+u],u+=f,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=n;h>0;o=256*o+t[e+u],u+=f,h-=8);if(0===s)s=1-c;else{if(s===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),s-=c}return(p?-1:1)*o*Math.pow(2,s-n)},r.write=function(t,e,r,n,i,s){var o,a,l,c=8*s-i-1,h=(1<<c)-1,u=h>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:s-1,d=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=h):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+u>=1?f/l:f*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=h?(a=0,o=h):o+u>=1?(a=(e*l-1)*Math.pow(2,i),o+=u):(a=e*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(o=o<<i|a,c+=i;c>0;t[r+p]=255&o,p+=d,o/=256,c-=8);t[r+p-d]|=128*g}},{}],58:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},{}],59:[function(t,e,r){(function(t){(function(){var n,i;n=t,i=function(){return t={165:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.abs=void 0,e.abs=function(t){return"number"!=typeof t&&"bigint"!=typeof t||(t=t.toString()),"-"==t[0]?t.substring(1):t}},217:function(t,e){function r(t){if(o(t))return t;for(var e="",r=t.length,n=t.split(".")[1],i=n?n.length:0,a=0;a<r;a++)t[a]>="0"&&t[a]<="9"?e+=9-parseInt(t[a]):e+=t[a];return s(e,i>0?"0."+new Array(i).join("0")+"1":"1")}function n(t){var e=t.split(".");for(e[0]||(e[0]="0");"0"==e[0][0]&&e[0].length>1;)e[0]=e[0].substring(1);return e[0]+(e[1]?"."+e[1]:"")}function i(t,e){var r=t.split("."),n=e.split("."),i=r[0].length,s=n[0].length;return i>s?n[0]=new Array(Math.abs(i-s)+1).join("0")+(n[0]?n[0]:""):r[0]=new Array(Math.abs(i-s)+1).join("0")+(r[0]?r[0]:""),i=r[1]?r[1].length:0,s=n[1]?n[1].length:0,(i||s)&&(i>s?n[1]=(n[1]?n[1]:"")+new Array(Math.abs(i-s)+1).join("0"):r[1]=(r[1]?r[1]:"")+new Array(Math.abs(i-s)+1).join("0")),[t=r[0]+(r[1]?"."+r[1]:""),e=n[0]+(n[1]?"."+n[1]:"")]}function s(t,e){var r;t=(r=i(t,e))[0],e=r[1];for(var n="",s=0,o=t.length-1;o>=0;o--)if("."!==t[o]){var a=parseInt(t[o])+parseInt(e[o])+s;n=a%10+n,s=Math.floor(a/10)}else n="."+n;return s?s.toString()+n:n}function o(t){return/^0[0]*[.]{0,1}[0]*$/.test(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.pad=e.trim=e.add=void 0,e.add=function(t,e){var a;void 0===e&&(e="0");var l=0,c=-1;"-"==t[0]&&(o(t=t.substring(1))||(l++,c=1,t.length)),"-"==e[0]&&(o(e=e.substring(1))||(l++,c=2,e.length)),t=n(t),e=n(e),t=(a=i(n(t),n(e)))[0],e=a[1],1==l&&(1===c?t=r(t):2===c&&(e=r(e)));var h=s(t,e);return l?2==l?"-"+n(h):t.length<h.length?n(h.substring(1)):"-"+n(r(h)):n(h)},e.trim=n,e.pad=i},423:function(t,e,r){var n=r(217),i=r(165),s=r(350),o=r(182),a=r(415),l=r(213),c=r(664),h=r(26),u=r(916),f=function(){function t(e){void 0===e&&(e="0"),this.value=t.validate(e)}return t.validate=function(t){if(t){if(t=t.toString(),isNaN(t))throw Error("Parameter is not a number: "+t);"+"==t[0]&&(t=t.substring(1))}else t="0";if(t.startsWith(".")?t="0"+t:t.startsWith("-.")&&(t="-0"+t.substr(1)),/e/i.test(t)){var e=t.split(/[eE]/),r=e[0],i=e[1],s="";"-"==(r=(0,n.trim)(r))[0]&&(s="-",r=r.substring(1)),r.indexOf(".")>=0?(i=parseInt(i)+r.indexOf("."),r=r.replace(".","")):i=parseInt(i)+r.length,t=r.length<i?s+r+new Array(i-r.length+1).join("0"):r.length>=i&&i>0?s+(0,n.trim)(r.substring(0,i))+(r.length>i?"."+r.substring(i):""):s+"0."+new Array(1-i).join("0")+r}return t},t.prototype.getValue=function(){return this.value},t.prototype.setValue=function(e){this.value=t.validate(e)},t.getPrettyValue=function(e,r,n){if(r||n){if(!r||!n)throw Error("Illegal Arguments. Should pass both digits and separator or pass none")}else r=3,n=",";var i="-"==(e=t.validate(e)).charAt(0);i&&(e=e.substring(1));for(var s=e.indexOf("."),o="",a=s=s>0?s:e.length;a>0;)a<r?(r=a,a=0):a-=r,o=e.substring(a,a+r)+(a<s-r&&a>=0?n:"")+o;return(i?"-":"")+o+e.substring(s)},t.prototype.getPrettyValue=function(e,r){return t.getPrettyValue(this.value,e,r)},t.round=function(e,r,n){if(void 0===r&&(r=0),void 0===n&&(n=u.RoundingModes.HALF_EVEN),e=t.validate(e),isNaN(r))throw Error("Precision is not a number: "+r);return(0,s.roundOff)(e,r,n)},t.prototype.round=function(e,r){if(void 0===e&&(e=0),void 0===r&&(r=u.RoundingModes.HALF_EVEN),isNaN(e))throw Error("Precision is not a number: "+e);return new t((0,s.roundOff)(this.value,e,r))},t.abs=function(e){return e=t.validate(e),(0,i.abs)(e)},t.prototype.abs=function(){return new t((0,i.abs)(this.value))},t.floor=function(e){return-1===(e=t.validate(e)).indexOf(".")?e:t.round(e,0,u.RoundingModes.FLOOR)},t.prototype.floor=function(){return-1===this.value.indexOf(".")?new t(this.value):new t(this.value).round(0,u.RoundingModes.FLOOR)},t.ceil=function(e){return-1===(e=t.validate(e)).indexOf(".")?e:t.round(e,0,u.RoundingModes.CEILING)},t.prototype.ceil=function(){return-1===this.value.indexOf(".")?new t(this.value):new t(this.value).round(0,u.RoundingModes.CEILING)},t.add=function(e,r){return e=t.validate(e),r=t.validate(r),(0,n.add)(e,r)},t.prototype.add=function(e){return new t((0,n.add)(this.value,e.getValue()))},t.subtract=function(e,r){return e=t.validate(e),r=t.validate(r),(0,h.subtract)(e,r)},t.prototype.subtract=function(e){return new t((0,h.subtract)(this.value,e.getValue()))},t.multiply=function(e,r){return e=t.validate(e),r=t.validate(r),(0,o.multiply)(e,r)},t.prototype.multiply=function(e){return new t((0,o.multiply)(this.value,e.getValue()))},t.divide=function(e,r,n){return e=t.validate(e),r=t.validate(r),(0,a.divide)(e,r,n)},t.prototype.divide=function(e,r){return new t((0,a.divide)(this.value,e.getValue(),r))},t.modulus=function(e,r){return e=t.validate(e),r=t.validate(r),(0,l.modulus)(e,r)},t.prototype.modulus=function(e){return new t((0,l.modulus)(this.value,e.getValue()))},t.compareTo=function(e,r){return e=t.validate(e),r=t.validate(r),(0,c.compareTo)(e,r)},t.prototype.compareTo=function(t){return(0,c.compareTo)(this.value,t.getValue())},t.negate=function(e){return e=t.validate(e),(0,h.negate)(e)},t.prototype.negate=function(){return new t((0,h.negate)(this.value))},t.RoundingModes=u.RoundingModes,t}();t.exports=f},664:function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.compareTo=void 0;var n=r(217);e.compareTo=function(t,e){var r,i=!1;if("-"==t[0]&&"-"!=e[0])return-1;if("-"!=t[0]&&"-"==e[0])return 1;if("-"==t[0]&&"-"==e[0]&&(t=t.substr(1),e=e.substr(1),i=!0),t=(r=(0,n.pad)(t,e))[0],e=r[1],0==t.localeCompare(e))return 0;for(var s=0;s<t.length;s++)if(t[s]!=e[s])return t[s]>e[s]?i?-1:1:i?1:-1;return 0}},415:function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.divide=void 0;var n=r(217),i=r(350);e.divide=function(t,e,r){if(void 0===r&&(r=8),0==e)throw new Error("Cannot divide by 0");if(t=t.toString(),e=e.toString(),t=t.replace(/(\.\d*?[1-9])0+$/g,"$1").replace(/\.0+$/,""),e=e.replace(/(\.\d*?[1-9])0+$/g,"$1").replace(/\.0+$/,""),0==t)return"0";var s=0;"-"==e[0]&&(e=e.substring(1),s++),"-"==t[0]&&(t=t.substring(1),s++);var o=e.indexOf(".")>0?e.length-e.indexOf(".")-1:-1;if(e=(0,n.trim)(e.replace(".","")),o>=0){var a=t.indexOf(".")>0?t.length-t.indexOf(".")-1:-1;if(-1==a)t=(0,n.trim)(t+new Array(o+1).join("0"));else if(o>a)t=t.replace(".",""),t=(0,n.trim)(t+new Array(o-a+1).join("0"));else if(o<a){var l=(t=t.replace(".","")).length-a+o;t=(0,n.trim)(t.substring(0,l)+"."+t.substring(l))}else o==a&&(t=(0,n.trim)(t.replace(".","")))}var c=0,h=e.length,u="",f=t.indexOf(".")>-1&&t.indexOf(".")<h?t.substring(0,h+1):t.substring(0,h);if(t=t.indexOf(".")>-1&&t.indexOf(".")<h?t.substring(h+1):t.substring(h),f.indexOf(".")>-1){var p=f.length-f.indexOf(".")-1;h>(f=f.replace(".","")).length&&(p+=h-f.length,f+=new Array(h-f.length+1).join("0")),c=p,u="0."+new Array(p).join("0")}for(r+=2;c<=r;){for(var d=0;parseInt(f)>=parseInt(e);)f=(0,n.add)(f,"-"+e),d++;u+=d,t?("."==t[0]&&(u+=".",c++,t=t.substring(1)),f+=t.substring(0,1),t=t.substring(1)):(c||(u+="."),c++,f+="0")}return(1==s?"-":"")+(0,n.trim)((0,i.roundOff)(u,r-2))}},213:function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.modulus=void 0;var n=r(415),i=r(350),s=r(182),o=r(26),a=r(916);function l(t){if(-1!=t.indexOf("."))throw new Error("Modulus of non-integers not supported")}e.modulus=function(t,e){if(0==e)throw new Error("Cannot divide by 0");t=t.toString(),e=e.toString(),l(t),l(e);var r="";return"-"==t[0]&&(r="-",t=t.substr(1)),"-"==e[0]&&(e=e.substr(1)),r+(0,o.subtract)(t,(0,s.multiply)(e,(0,i.roundOff)((0,n.divide)(t,e),0,a.RoundingModes.FLOOR)))}},182:function(t,e){function r(t){for(;"0"==t[0];)t=t.substr(1);if(-1!=t.indexOf("."))for(;"0"==t[t.length-1];)t=t.substr(0,t.length-1);return""==t||"."==t?t="0":"."==t[t.length-1]&&(t=t.substr(0,t.length-1)),"."==t[0]&&(t="0"+t),t}Object.defineProperty(e,"__esModule",{value:!0}),e.multiply=void 0,e.multiply=function(t,e){t=t.toString(),e=e.toString();var n=0;"-"==t[0]&&(n++,t=t.substr(1)),"-"==e[0]&&(n++,e=e.substr(1)),t=r(t),e=r(e);var i=0,s=0;-1!=t.indexOf(".")&&(i=t.length-t.indexOf(".")-1),-1!=e.indexOf(".")&&(s=e.length-e.indexOf(".")-1);var o=i+s;if(t=r(t.replace(".","")),e=r(e.replace(".","")),t.length<e.length){var a=t;t=e,e=a}if("0"==e)return"0";for(var l,c,h=e.length,u=0,f=[],p=h-1,d="",g=0;g<h;g++)f[g]=t.length-1;for(g=0;g<2*t.length;g++){for(var m=0,y=e.length-1;y>=p&&y>=0;y--)f[y]>-1&&f[y]<t.length&&(m+=parseInt(t[f[y]--])*parseInt(e[y]));m+=u,u=Math.floor(m/10),d=m%10+d,p--}return d=r((l=d,0==(c=o)?l:(l=c>=l.length?new Array(c-l.length+1).join("0")+l:l).substr(0,l.length-c)+"."+l.substr(l.length-c,c))),1==n&&(d="-"+d),d}},350:function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.roundOff=void 0;var n=r(916);function i(t,e,r,i){if(!t||t===new Array(t.length+1).join("0"))return!1;if(i===n.RoundingModes.DOWN||!r&&i===n.RoundingModes.FLOOR||r&&i===n.RoundingModes.CEILING)return!1;if(i===n.RoundingModes.UP||r&&i===n.RoundingModes.FLOOR||!r&&i===n.RoundingModes.CEILING)return!0;var s="5"+new Array(t.length).join("0");if(t>s)return!0;if(t<s)return!1;switch(i){case n.RoundingModes.HALF_DOWN:return!1;case n.RoundingModes.HALF_UP:return!0;case n.RoundingModes.HALF_EVEN:default:return parseInt(e[e.length-1])%2==1}}function s(t,e){void 0===e&&(e=0),e||(e=1),"number"==typeof t&&t.toString();for(var r="",n=t.length-1;n>=0;n--){var i=parseInt(t[n])+e;10==i?(e=1,i=0):e=0,r+=i}return e&&(r+=e),r.split("").reverse().join("")}e.roundOff=function t(e,r,o){if(void 0===r&&(r=0),void 0===o&&(o=n.RoundingModes.HALF_EVEN),o===n.RoundingModes.UNNECESSARY)throw new Error("UNNECESSARY Rounding Mode has not yet been implemented");"number"!=typeof e&&"bigint"!=typeof e||(e=e.toString());var a=!1;"-"===e[0]&&(a=!0,e=e.substring(1));var l=e.split("."),c=l[0],h=l[1];if(r<0){if(r=-r,c.length<=r)return"0";var u=c.substr(0,c.length-r);return(a?"-":"")+(u=t(e=u+"."+c.substr(c.length-r)+h,0,o))+new Array(r+1).join("0")}if(0==r)return c.length,i(l[1],c,a,o)&&(c=s(c)),(a&&parseInt(c)?"-":"")+c;if(!l[1])return(a?"-":"")+c+"."+new Array(r+1).join("0");if(l[1].length<r)return(a?"-":"")+c+"."+l[1]+new Array(r-l[1].length+1).join("0");h=l[1].substring(0,r);var f=l[1].substring(r);return f&&i(f,h,a,o)&&(h=s(h)).length>r?(a?"-":"")+s(c,parseInt(h[0]))+"."+h.substring(1):(a&&(parseInt(c)||parseInt(h))?"-":"")+c+"."+h}},916:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.RoundingModes=void 0,function(t){t[t.CEILING=0]="CEILING",t[t.DOWN=1]="DOWN",t[t.FLOOR=2]="FLOOR",t[t.HALF_DOWN=3]="HALF_DOWN",t[t.HALF_EVEN=4]="HALF_EVEN",t[t.HALF_UP=5]="HALF_UP",t[t.UNNECESSARY=6]="UNNECESSARY",t[t.UP=7]="UP"}(e.RoundingModes||(e.RoundingModes={}))},26:function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.negate=e.subtract=void 0;var n=r(217);function i(t){return t="-"==t[0]?t.substr(1):"-"+t}e.subtract=function(t,e){return t=t.toString(),e=i(e=e.toString()),(0,n.add)(t,e)},e.negate=i}},e={},r=function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n](s,s.exports,r),s.exports}(423),r;var t,e,r},"object"==typeof r&&"object"==typeof e?e.exports=i():"object"==typeof r?r.bigDecimal=i():n.bigDecimal=i()}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],60:[function(t,e,r){e.exports=(t,e)=>e.startsWith(t)&&e.endsWith(t)?e.substring(1,e.length-1):e},{}],61:[function(t,e,r){let n=t("./Manyfest-LogToConsole.js");e.exports=class{constructor(t,e){this.logInfo="function"==typeof t?t:n,this.logError="function"==typeof e?e:n,this.translationTable={}}translationCount(){return Object.keys(this.translationTable).length}addTranslation(t){if("object"!=typeof t)return this.logError("Hash translation addTranslation expected a translation be type object but was passed in ".concat(typeof t)),!1;Object.keys(t).forEach((e=>{"string"!=typeof t[e]?this.logError("Hash translation addTranslation expected a translation destination hash for [".concat(e,"] to be a string but the referrant was a ").concat(typeof t[e])):this.translationTable[e]=t[e]}))}removeTranslationHash(t){this.translationTable.hasOwnProperty(t)&&delete this.translationTable[t]}removeTranslation(t){if("string"==typeof t)return this.removeTranslationHash(t),!0;if("object"==typeof t){return Object.keys(t).forEach((t=>{this.removeTranslation(t)})),!0}return this.logError("Hash translation removeTranslation expected either a string or an object but the passed-in translation was type ".concat(typeof t)),!1}clearTranslations(){this.translationTable={}}translate(t){return this.translationTable.hasOwnProperty(t)?this.translationTable[t]:t}}},{"./Manyfest-LogToConsole.js":62}],62:[function(t,e,r){e.exports=(t,e)=>{let r="string"==typeof t?t:"";console.log("[Manyfest] ".concat(r)),e&&console.log(JSON.stringify(e))}},{}],63:[function(t,e,r){let n=t("./Manyfest-LogToConsole.js");e.exports=class{constructor(t,e){this.logInfo="function"==typeof t?t:n,this.logError="function"==typeof e?e:n}checkAddressExists(t,e){if("object"!=typeof t)return!1;if("string"!=typeof e)return!1;let r=e.indexOf(".");if(-1==r){let r=e.indexOf("["),n=e.indexOf("]");if(r>0&&n>r&&n-r>1){let i=e.substring(0,r).trim();if("object"!=typeof t[i])return!1;let s=e.substring(r+1,n).trim(),o=parseInt(s,10);return Array.isArray(t[i])!=isNaN(o)&&(isNaN(o)?(s=this.cleanWrapCharacters('"',s),s=this.cleanWrapCharacters("`",s),s=this.cleanWrapCharacters("'",s),t[i].hasOwnProperty(s)):o in t[i])}return t.hasOwnProperty(e)}{let n=e.substring(0,r),i=e.substring(r+1),s=n.indexOf("["),o=n.indexOf("]");if(s>0&&o>s&&o-s>1){let e=n.substring(0,s).trim(),r=n.substring(s+1,o).trim(),a=parseInt(r,10);return Array.isArray(t[e])!=isNaN(a)&&(isNaN(a)?(r=this.cleanWrapCharacters('"',r),r=this.cleanWrapCharacters("`",r),r=this.cleanWrapCharacters("'",r),this.checkAddressExists(t[e][r],i)):this.checkAddressExists(t[e][a],i))}return(!t.hasOwnProperty(n)||"object"==typeof t[n])&&(t.hasOwnProperty(n)||(t[n]={}),this.checkAddressExists(t[n],i))}}}},{"./Manyfest-LogToConsole.js":62}],64:[function(t,e,r){let n=t("./Manyfest-LogToConsole.js"),i=t("./Manyfest-CleanWrapCharacters.js"),s=t("../source/Manyfest-ParseConditionals.js");e.exports=class{constructor(t,e){this.logInfo="function"==typeof t?t:n,this.logError="function"==typeof e?e:n,this.cleanWrapCharacters=i}checkFilters(t,e){return s(this,t,e)}deleteValueAtAddress(t,e,r){if("object"!=typeof t)return;if("string"!=typeof e)return;let n="";"string"==typeof r&&(n=r);let i=e.indexOf(".");if(-1==i){let r=e.indexOf("["),n=e.indexOf("]"),i=e.indexOf("{}");if(r>0&&n>r&&n-r>1){let i=e.substring(0,r).trim();if("object"!=typeof t[i])return!1;let s=e.substring(r+1,n).trim(),o=parseInt(s,10);return Array.isArray(t[i])!=isNaN(o)&&(isNaN(o)?(s=this.cleanWrapCharacters('"',s),s=this.cleanWrapCharacters("`",s),s=this.cleanWrapCharacters("'",s),delete t[i][s],!0):(delete t[i][o],!0))}if(r>0&&n>r&&n-r==1){let n=e.substring(0,r).trim();if(!Array.isArray(t[n]))return!1;let i=t[n];for(let t=i.length-1;t>=0;t--){this.checkFilters(e,i[t])&&i.splice(t,1)}return!0}if(i>0){let r=e.substring(0,i).trim();return"object"==typeof t[r]&&(delete t[r],!0)}return delete t[e],!0}{let r=e.substring(0,i),s=e.substring(i+1),o=r.indexOf("["),a=r.indexOf("]");if(o>0&&a>o&&a-o>1){let e=r.substring(0,o).trim(),i=r.substring(o+1,a).trim(),l=parseInt(i,10);return Array.isArray(t[e])!=isNaN(l)&&("object"==typeof t[e]&&(isNaN(l)?(i=this.cleanWrapCharacters('"',i),i=this.cleanWrapCharacters("`",i),i=this.cleanWrapCharacters("'",i),n="".concat(n).concat(n.length>0?".":"").concat(r),this.deleteValueAtAddress(t[e][i],s,n)):(n="".concat(n).concat(n.length>0?".":"").concat(r),this.deleteValueAtAddress(t[e][l],s,n))))}if(o>0&&a>o&&a-o==1){let r=e.substring(0,o).trim();if(!Array.isArray(t[r]))return!1;let i=t[r];n="".concat(n).concat(n.length>0?".":"").concat(r);let a={};for(let e=0;e<i.length;e++){let i="".concat(n,"[").concat(e,"]"),o=this.deleteValueAtAddress(t[r][e],s,i);a["".concat(i,".").concat(s)]=o}return a}let l=e.indexOf("{}");if(l>0){let r=e.substring(0,l).trim();if("object"!=typeof t[r])return!1;let i=t[r],o=Object.keys(i);n="".concat(n).concat(n.length>0?".":"").concat(r);let a={};for(let i=0;i<o.length;i++){let l="".concat(n,".").concat(o[i]),c=this.deleteValueAtAddress(t[r][o[i]],s,l);this.checkFilters(e,c)&&(a["".concat(l,".").concat(s)]=c)}return a}return t.hasOwnProperty(r)&&"object"!=typeof t[r]?void 0:t.hasOwnProperty(r)?(n="".concat(n).concat(n.length>0?".":"").concat(r),this.deleteValueAtAddress(t[r],s,n)):(n="".concat(n).concat(n.length>0?".":"").concat(r),t[r]={},this.deleteValueAtAddress(t[r],s,n))}}}},{"../source/Manyfest-ParseConditionals.js":68,"./Manyfest-CleanWrapCharacters.js":60,"./Manyfest-LogToConsole.js":62}],65:[function(t,e,r){let n=t("./Manyfest-LogToConsole.js"),i=t("./Manyfest-CleanWrapCharacters.js"),s=t("../source/Manyfest-ParseConditionals.js");e.exports=class{constructor(t,e){this.logInfo="function"==typeof t?t:n,this.logError="function"==typeof e?e:n,this.cleanWrapCharacters=i}checkFilters(t,e){return s(this,t,e)}getValueAtAddress(t,e,r,n){if("object"!=typeof t)return;if("string"!=typeof e)return;let i="";"string"==typeof r&&(i=r);let s=void 0===n?t:n,o=e.indexOf(".");if(0==o){let t=i.split("."),r=0;for(let t=0;t<e.length&&"."==e.charAt(t);t++)r++;let n=t.length-r;if(n<0)return;{let i=e.slice(r);return n>0&&(i="".concat(t.slice(0,n).join("."),".").concat(i)),this.logInfo("Back-navigation detected. Recursing back to address [".concat(i,"]")),this.getValueAtAddress(s,i)}}if(-1==o){let r=e.indexOf("["),n=e.indexOf("]"),i=e.indexOf("{}");if(r>0&&n>r&&n-r>1){let i=e.substring(0,r).trim();if("object"!=typeof t[i])return;let s=e.substring(r+1,n).trim(),o=parseInt(s,10);if(Array.isArray(t[i])==isNaN(o))return;return isNaN(o)?(s=this.cleanWrapCharacters('"',s),s=this.cleanWrapCharacters("`",s),s=this.cleanWrapCharacters("'",s),t[i][s]):t[i][o]}if(r>0&&n>r&&n-r==1){let n=e.substring(0,r).trim();if(!Array.isArray(t[n]))return!1;let i=t[n],s=[];for(let t=0;t<i.length;t++){this.checkFilters(e,i[t])&&s.push(i[t])}return s}if(i>0){let r=e.substring(0,i).trim();return"object"==typeof t[r]&&t[r]}return t[e]}{let r=e.substring(0,o),n=e.substring(o+1),a=r.indexOf("["),l=r.indexOf("]");if(a>0&&l>a&&l-a>1){let e=r.substring(0,a).trim(),o=r.substring(a+1,l).trim(),c=parseInt(o,10);if(Array.isArray(t[e])==isNaN(c))return;if("object"!=typeof t[e])return;return isNaN(c)?(o=this.cleanWrapCharacters('"',o),o=this.cleanWrapCharacters("`",o),o=this.cleanWrapCharacters("'",o),i="".concat(i).concat(i.length>0?".":"").concat(r),this.getValueAtAddress(t[e][o],n,i,s)):(i="".concat(i).concat(i.length>0?".":"").concat(r),this.getValueAtAddress(t[e][c],n,i,s))}if(a>0&&l>a&&l-a==1){let r=e.substring(0,a).trim();if(!Array.isArray(t[r]))return!1;let o=t[r];i="".concat(i).concat(i.length>0?".":"").concat(r);let l={};for(let e=0;e<o.length;e++){let o="".concat(i,"[").concat(e,"]"),a=this.getValueAtAddress(t[r][e],n,o,s);l["".concat(o,".").concat(n)]=a}return l}let c=e.indexOf("{}");if(c>0){let r=e.substring(0,c).trim();if("object"!=typeof t[r])return!1;let o=t[r],a=Object.keys(o);i="".concat(i).concat(i.length>0?".":"").concat(r);let l={};for(let o=0;o<a.length;o++){let c="".concat(i,".").concat(a[o]),h=this.getValueAtAddress(t[r][a[o]],n,c,s);this.checkFilters(e,h)&&(l["".concat(c,".").concat(n)]=h)}return l}return t.hasOwnProperty(r)&&"object"!=typeof t[r]?void 0:t.hasOwnProperty(r)?(i="".concat(i).concat(i.length>0?".":"").concat(r),this.getValueAtAddress(t[r],n,i,s)):(i="".concat(i).concat(i.length>0?".":"").concat(r),t[r]={},this.getValueAtAddress(t[r],n,i,s))}}}},{"../source/Manyfest-ParseConditionals.js":68,"./Manyfest-CleanWrapCharacters.js":60,"./Manyfest-LogToConsole.js":62}],66:[function(t,e,r){let n=t("./Manyfest-LogToConsole.js"),i=t("./Manyfest-CleanWrapCharacters.js");e.exports=class{constructor(t,e){this.logInfo="function"==typeof t?t:n,this.logError="function"==typeof e?e:n,this.cleanWrapCharacters=i}setValueAtAddress(t,e,r){if("object"!=typeof t)return!1;if("string"!=typeof e)return!1;let n=e.indexOf(".");if(-1==n){let n=e.indexOf("["),i=e.indexOf("]");if(n>0&&i>n&&i-n>1){let s=e.substring(0,n).trim();if("object"!=typeof t[s])return!1;let o=e.substring(n+1,i).trim(),a=parseInt(o,10);return Array.isArray(t[s])!=isNaN(a)&&(isNaN(a)?(o=this.cleanWrapCharacters('"',o),o=this.cleanWrapCharacters("`",o),o=this.cleanWrapCharacters("'",o),t[s][o]=r,!0):(t[s][a]=r,!0))}return t[e]=r,!0}{let i=e.substring(0,n),s=e.substring(n+1),o=i.indexOf("["),a=i.indexOf("]");if(o>0&&a>o&&a-o>1){let e=i.substring(0,o).trim(),n=i.substring(o+1,a).trim(),l=parseInt(n,10);return Array.isArray(t[e])!=isNaN(l)&&(isNaN(l)?(n=this.cleanWrapCharacters('"',n),n=this.cleanWrapCharacters("`",n),n=this.cleanWrapCharacters("'",n),this.setValueAtAddress(t[e][n],s,r)):this.setValueAtAddress(t[e][l],s,r))}return t.hasOwnProperty(i)&&"object"!=typeof t[i]?(t.hasOwnProperty("__ERROR")||(t.__ERROR={}),t.__ERROR[e]=r,!1):(t.hasOwnProperty(i)||(t[i]={}),this.setValueAtAddress(t[i],s,r))}}}},{"./Manyfest-CleanWrapCharacters.js":60,"./Manyfest-LogToConsole.js":62}],67:[function(t,e,r){let n=t("./Manyfest-LogToConsole.js");e.exports=class{constructor(t,e){this.logInfo="function"==typeof t?t:n,this.logError="function"==typeof e?e:n}generateAddressses(t,e,r){let n="string"==typeof e?e:"",i="object"==typeof r?r:{},s=typeof t,o={Address:n,Hash:n,Name:n,InSchema:!1};switch("object"==s&&null==t&&(s="null"),s){case"string":o.DataType="String",o.Default=t,i[n]=o;break;case"number":case"bigint":o.DataType="Number",o.Default=t,i[n]=o;break;case"undefined":case"null":o.DataType="Any",o.Default=t,i[n]=o;break;case"object":if(Array.isArray(t)){o.DataType="Array",""!=n&&(i[n]=o);for(let e=0;e<t.length;e++)this.generateAddressses(t[e],"".concat(n,"[").concat(e,"]"),i)}else{o.DataType="Object",""!=n&&(i[n]=o,n+=".");let e=Object.keys(t);for(let r=0;r<e.length;r++)this.generateAddressses(t[e[r]],"".concat(n).concat(e[r]),i)}}return i}}},{"./Manyfest-LogToConsole.js":62}],68:[function(t,e,r){const n="<<~?",i="?~>>",s=(t,e,r,n,i)=>{switch(n){case"!=":return t.getValueAtAddress(e,r)!=i;case"<":return t.getValueAtAddress(e,r)<i;case">":return t.getValueAtAddress(e,r)>i;case"<=":return t.getValueAtAddress(e,r)<=i;case">=":return t.getValueAtAddress(e,r)>=i;case"===":return t.getValueAtAddress(e,r)===i;default:return t.getValueAtAddress(e,r)==i}};e.exports=(t,e,r)=>{let o=!0,a=e.indexOf(n);for(;-1!=a;){let l=e.indexOf(i,a+4);if(-1!=l){let i=e.substring(a+4,l).split(","),c=i[0],h=i[1],u=i[2];o=o&&s(t,r,c,h,u),a=e.indexOf(n,l+4)}else a=-1}return o}},{}],69:[function(t,e,r){let n=t("./Manyfest-LogToConsole.js");e.exports=class{constructor(t,e){this.logInfo="function"==typeof t?t:n,this.logError="function"==typeof e?e:n}resolveAddressMappings(t,e){if("object"!=typeof t)return this.logError("Attempted to resolve address mapping but the descriptor was not an object."),!1;if("object"!=typeof e)return!0;let r=Object.keys(t),n={};return r.forEach((e=>{t[e].hasOwnProperty("Hash")&&(n[t[e].Hash]=e)})),Object.keys(e).forEach((r=>{let i=e[r],s=!1,o=!1;t.hasOwnProperty(r)?s=r:n.hasOwnProperty(r)&&(s=n[r]),s?(o=t[s],delete t[s]):o={Hash:r},t[i]=o})),!0}safeResolveAddressMappings(t,e){let r=JSON.parse(JSON.stringify(t));return this.resolveAddressMappings(r,e),r}mergeAddressMappings(t,e){if("object"!=typeof e||"object"!=typeof t)return this.logError("Attempted to merge two schema descriptors but both were not objects."),!1;let r=JSON.parse(JSON.stringify(e)),n=JSON.parse(JSON.stringify(t));return Object.keys(r).forEach((t=>{n.hasOwnProperty(t)||(n[t]=r[t])})),n}}},{"./Manyfest-LogToConsole.js":62}],70:[function(t,e,r){const n=t("fable-serviceproviderbase");let i=t("./Manyfest-LogToConsole.js"),s=t("./Manyfest-HashTranslation.js"),o=t("./Manyfest-ObjectAddress-CheckAddressExists.js"),a=t("./Manyfest-ObjectAddress-GetValue.js"),l=t("./Manyfest-ObjectAddress-SetValue.js"),c=t("./Manyfest-ObjectAddress-DeleteValue.js"),h=t("./Manyfest-ObjectAddressGeneration.js"),u=t("./Manyfest-SchemaManipulation.js");const f={Scope:"DEFAULT",Descriptors:{}};class p extends n{constructor(t,e,r){void 0===t?super({}):super(t,e,r),this.serviceType="Manifest",this.logInfo=i,this.logError=i,this.objectAddressCheckAddressExists=new o(this.logInfo,this.logError),this.objectAddressGetValue=new a(this.logInfo,this.logError),this.objectAddressSetValue=new l(this.logInfo,this.logError),this.objectAddressDeleteValue=new c(this.logInfo,this.logError),this.options.hasOwnProperty("defaultValues")||(this.options.defaultValues={String:"",Number:0,Float:0,Integer:0,Boolean:!1,Binary:0,DateTime:0,Array:[],Object:{},Null:null}),this.options.hasOwnProperty("strict")||(this.options.strict=!1),this.scope=void 0,this.elementAddresses=void 0,this.elementHashes=void 0,this.elementDescriptors=void 0,this.reset(),"object"==typeof this.options&&this.loadManifest(this.options),this.schemaManipulations=new u(this.logInfo,this.logError),this.objectAddressGeneration=new h(this.logInfo,this.logError),this.hashTranslations=new s(this.logInfo,this.logError)}reset(){this.scope="DEFAULT",this.elementAddresses=[],this.elementHashes={},this.elementDescriptors={}}clone(){let t=JSON.parse(JSON.stringify(this.options)),e=new p(this.getManifest(),this.logInfo,this.logError,t);return e.hashTranslations.addTranslation(this.hashTranslations.translationTable),e}deserialize(t){return this.loadManifest(JSON.parse(t))}loadManifest(t){"object"!=typeof t&&this.logError("(".concat(this.scope,") Error loading manifest; expecting an object but parameter was type ").concat(typeof t,"."));let e="object"==typeof t?t:{},r=Object.keys(f);for(let t=0;t<r.length;t++)e.hasOwnProperty(r[t])||(e[r[t]]=JSON.parse(JSON.stringify(f[r[t]])));if(e.hasOwnProperty("Scope")?"string"==typeof e.Scope?this.scope=e.Scope:this.logError("(".concat(this.scope,") Error loading scope from manifest; expecting a string but property was type ").concat(typeof e.Scope,"."),e):this.logError("(".concat(this.scope,') Error loading scope from manifest object. Property "Scope" does not exist in the root of the object.'),e),e.hasOwnProperty("Descriptors"))if("object"==typeof e.Descriptors){let t=Object.keys(e.Descriptors);for(let r=0;r<t.length;r++)this.addDescriptor(t[r],e.Descriptors[t[r]])}else this.logError("(".concat(this.scope,") Error loading description object from manifest object. Expecting an object in 'Manifest.Descriptors' but the property was type ").concat(typeof e.Descriptors,"."),e);else this.logError("(".concat(this.scope,') Error loading object description from manifest object. Property "Descriptors" does not exist in the root of the Manifest object.'),e);if(e.hasOwnProperty("HashTranslations")&&"object"==typeof e.HashTranslations)for(let t=0;t<e.HashTranslations.length;t++);}serialize(){return JSON.stringify(this.getManifest())}getManifest(){return{Scope:this.scope,Descriptors:JSON.parse(JSON.stringify(this.elementDescriptors)),HashTranslations:JSON.parse(JSON.stringify(this.hashTranslations.translationTable))}}addDescriptor(t,e){return"object"==typeof e?(e.hasOwnProperty("Address")||(e.Address=t),this.elementDescriptors.hasOwnProperty(t)||this.elementAddresses.push(t),this.elementDescriptors[t]=e,this.elementHashes[t]=t,e.hasOwnProperty("Hash")?this.elementHashes[e.Hash]=t:e.Hash=t,!0):(this.logError("(".concat(this.scope,") Error loading object descriptor for address '").concat(t,"' from manifest object. Expecting an object but property was type ").concat(typeof e,".")),!1)}getDescriptorByHash(t){return this.getDescriptor(this.resolveHashAddress(t))}getDescriptor(t){return this.elementDescriptors[t]}eachDescriptor(t){let e=Object.keys(this.elementDescriptors);for(let r=0;r<e.length;r++)t(this.elementDescriptors[e[r]])}checkAddressExistsByHash(t,e){return this.checkAddressExists(t,this.resolveHashAddress(e))}checkAddressExists(t,e){return this.objectAddressCheckAddressExists.checkAddressExists(t,e)}resolveHashAddress(t){let e,r=this.elementHashes.hasOwnProperty(t),n=this.hashTranslations.translationTable.hasOwnProperty(t);return e=r&&!n?this.elementHashes[t]:n&&this.elementHashes.hasOwnProperty(this.hashTranslations.translate(t))?this.elementHashes[this.hashTranslations.translate(t)]:n?this.hashTranslations.translate(t):t,e}getValueByHash(t,e){let r=this.getValueAtAddress(t,this.resolveHashAddress(e));return void 0===r&&(r=this.getDefaultValue(this.getDescriptorByHash(e))),r}getValueAtAddress(t,e){let r=this.objectAddressGetValue.getValueAtAddress(t,e);return void 0===r&&(r=this.getDefaultValue(this.getDescriptor(e))),r}setValueByHash(t,e,r){return this.setValueAtAddress(t,this.resolveHashAddress(e),r)}setValueAtAddress(t,e,r){return this.objectAddressSetValue.setValueAtAddress(t,e,r)}deleteValueByHash(t,e,r){return this.deleteValueAtAddress(t,this.resolveHashAddress(e),r)}deleteValueAtAddress(t,e,r){return this.objectAddressDeleteValue.deleteValueAtAddress(t,e,r)}validate(t){let e={Error:null,Errors:[],MissingElements:[]};"object"!=typeof t&&(e.Error=!0,e.Errors.push("Expected passed in object to be type object but was passed in ".concat(typeof t)));let r=(t,r)=>{e.Error=!0,e.Errors.push('Element at address "'.concat(t,'" ').concat(r,"."))};for(let n=0;n<this.elementAddresses.length;n++){let i=this.getDescriptor(this.elementAddresses[n]),s=this.checkAddressExists(t,i.Address),o=this.getValueAtAddress(t,i.Address);if(void 0!==o&&s||(e.MissingElements.push(i.Address),(i.Required||this.options.strict)&&r(i.Address,"is flagged REQUIRED but is not set in the object")),i.DataType){let t=typeof o;switch(i.DataType.toString().trim().toLowerCase()){case"string":"string"!=t&&r(i.Address,"has a DataType ".concat(i.DataType," but is of the type ").concat(t));break;case"number":"number"!=t&&r(i.Address,"has a DataType ".concat(i.DataType," but is of the type ").concat(t));break;case"integer":if("number"!=t)r(i.Address,"has a DataType ".concat(i.DataType," but is of the type ").concat(t));else{o.toString().indexOf(".")>-1&&r(i.Address,"has a DataType ".concat(i.DataType," but has a decimal point in the number."))}break;case"float":"number"!=t&&r(i.Address,"has a DataType ".concat(i.DataType," but is of the type ").concat(t));break;case"DateTime":"Invalid Date"==new Date(o).toString()&&r(i.Address,"has a DataType ".concat(i.DataType," but is not parsable as a Date by Javascript"));default:"string"!=t&&r(i.Address,"has a DataType ".concat(i.DataType," (which auto-converted to String because it was unrecognized) but is of the type ").concat(t))}}}return e}getDefaultValue(t){if("object"==typeof t){if(t.hasOwnProperty("Default"))return t.Default;{let e=t.hasOwnProperty("DataType")?t.DataType:"String";return this.options.defaultValues.hasOwnProperty(e)?this.options.defaultValues[e]:null}}}populateDefaults(t,e){return this.populateObject(t,e,(t=>t.hasOwnProperty("Default")))}populateObject(t,e,r){let n="object"==typeof t?t:{},i=void 0!==e&&e,s="function"==typeof r?r:t=>!0;return this.elementAddresses.forEach((t=>{let e=this.getDescriptor(t);s(e)&&(!i&&this.checkAddressExists(n,t)||this.setValueAtAddress(n,t,this.getDefaultValue(e)))})),n}}e.exports=p},{"./Manyfest-HashTranslation.js":61,"./Manyfest-LogToConsole.js":62,"./Manyfest-ObjectAddress-CheckAddressExists.js":63,"./Manyfest-ObjectAddress-DeleteValue.js":64,"./Manyfest-ObjectAddress-GetValue.js":65,"./Manyfest-ObjectAddress-SetValue.js":66,"./Manyfest-ObjectAddressGeneration.js":67,"./Manyfest-SchemaManipulation.js":69,"fable-serviceproviderbase":33}],71:[function(t,e,r){var n=t("wrappy");function i(t){var e=function e(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function s(t){var e=function e(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},r=t.name||"Function wrapped with `once`";return e.onceError=r+" shouldn't be called more than once",e.called=!1,e}e.exports=n(i),e.exports.strict=n(s),i.proto=i((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return i(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return s(this)},configurable:!0})}))},{wrappy:110}],72:[function(t,e,r){(function(t){(function(){function r(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function n(t,e){for(var r,n="",i=0,s=-1,o=0,a=0;a<=t.length;++a){if(a<t.length)r=t.charCodeAt(a);else{if(47===r)break;r=47}if(47===r){if(s===a-1||1===o);else if(s!==a-1&&2===o){if(n.length<2||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var l=n.lastIndexOf("/");if(l!==n.length-1){-1===l?(n="",i=0):i=(n=n.slice(0,l)).length-1-n.lastIndexOf("/"),s=a,o=0;continue}}else if(2===n.length||1===n.length){n="",i=0,s=a,o=0;continue}e&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+t.slice(s+1,a):n=t.slice(s+1,a),i=a-s-1;s=a,o=0}else 46===r&&-1!==o?++o:o=-1}return n}var i={resolve:function(){for(var e,i="",s=!1,o=arguments.length-1;o>=-1&&!s;o--){var a;o>=0?a=arguments[o]:(void 0===e&&(e=t.cwd()),a=e),r(a),0!==a.length&&(i=a+"/"+i,s=47===a.charCodeAt(0))}return i=n(i,!s),s?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(t){if(r(t),0===t.length)return".";var e=47===t.charCodeAt(0),i=47===t.charCodeAt(t.length-1);return 0!==(t=n(t,!e)).length||e||(t="."),t.length>0&&i&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return r(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var n=arguments[e];r(n),n.length>0&&(void 0===t?t=n:t+="/"+n)}return void 0===t?".":i.normalize(t)},relative:function(t,e){if(r(t),r(e),t===e)return"";if((t=i.resolve(t))===(e=i.resolve(e)))return"";for(var n=1;n<t.length&&47===t.charCodeAt(n);++n);for(var s=t.length,o=s-n,a=1;a<e.length&&47===e.charCodeAt(a);++a);for(var l=e.length-a,c=o<l?o:l,h=-1,u=0;u<=c;++u){if(u===c){if(l>c){if(47===e.charCodeAt(a+u))return e.slice(a+u+1);if(0===u)return e.slice(a+u)}else o>c&&(47===t.charCodeAt(n+u)?h=u:0===u&&(h=0));break}var f=t.charCodeAt(n+u);if(f!==e.charCodeAt(a+u))break;47===f&&(h=u)}var p="";for(u=n+h+1;u<=s;++u)u!==s&&47!==t.charCodeAt(u)||(0===p.length?p+="..":p+="/..");return p.length>0?p+e.slice(a+h):(a+=h,47===e.charCodeAt(a)&&++a,e.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(r(t),0===t.length)return".";for(var e=t.charCodeAt(0),n=47===e,i=-1,s=!0,o=t.length-1;o>=1;--o)if(47===(e=t.charCodeAt(o))){if(!s){i=o;break}}else s=!1;return-1===i?n?"/":".":n&&1===i?"//":t.slice(0,i)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');r(t);var n,i=0,s=-1,o=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var a=e.length-1,l=-1;for(n=t.length-1;n>=0;--n){var c=t.charCodeAt(n);if(47===c){if(!o){i=n+1;break}}else-1===l&&(o=!1,l=n+1),a>=0&&(c===e.charCodeAt(a)?-1==--a&&(s=n):(a=-1,s=l))}return i===s?s=l:-1===s&&(s=t.length),t.slice(i,s)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!o){i=n+1;break}}else-1===s&&(o=!1,s=n+1);return-1===s?"":t.slice(i,s)},extname:function(t){r(t);for(var e=-1,n=0,i=-1,s=!0,o=0,a=t.length-1;a>=0;--a){var l=t.charCodeAt(a);if(47!==l)-1===i&&(s=!1,i=a+1),46===l?-1===e?e=a:1!==o&&(o=1):-1!==e&&(o=-1);else if(!s){n=a+1;break}}return-1===e||-1===i||0===o||1===o&&e===i-1&&e===n+1?"":t.slice(e,i)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var r=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+n:r+t+n:n}("/",t)},parse:function(t){r(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var n,i=t.charCodeAt(0),s=47===i;s?(e.root="/",n=1):n=0;for(var o=-1,a=0,l=-1,c=!0,h=t.length-1,u=0;h>=n;--h)if(47!==(i=t.charCodeAt(h)))-1===l&&(c=!1,l=h+1),46===i?-1===o?o=h:1!==u&&(u=1):-1!==o&&(u=-1);else if(!c){a=h+1;break}return-1===o||-1===l||0===u||1===u&&o===l-1&&o===a+1?-1!==l&&(e.base=e.name=0===a&&s?t.slice(1,l):t.slice(a,l)):(0===a&&s?(e.name=t.slice(1,o),e.base=t.slice(1,l)):(e.name=t.slice(a,o),e.base=t.slice(a,l)),e.ext=t.slice(o,l)),a>0?e.dir=t.slice(0,a-1):s&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};i.posix=i,e.exports=i}).call(this)}).call(this,t("_process"))},{_process:78}],73:[function(t,e,r){const n=t("fable-serviceproviderbase"),i={Name:"DefaultPictApplication",MainViewportViewIdentifier:"Default-View",MainViewportRenderableHash:!1,MainViewportDestinationAddress:!1,MainViewportDefaultDataAddress:!1,AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!0,Manifests:{},IdentifierAddressPrefix:"PICT-"};e.exports=class extends n{constructor(t,e,r){super(t,Object.assign({},JSON.parse(JSON.stringify(i)),e),r),this.serviceType="PictApplication",this.pict=this.fable,this.AppData=this.fable.AppData,this.initializeTimestamp=!1,this.lastSolvedTimestamp=!1;let n=Object.keys(this.options.Manifests);if(n.length>0)for(let t=0;t<n.length;t++){let e=n[t];this.fable.serviceManager.instantiateServiceProvider("Manifest",this.options.Manifests[e],e)}}onBeforeSolve(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onBeforeSolve:")),!0}onBeforeSolveAsync(t){return this.onBeforeSolve(),t()}onSolve(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onSolve:")),!0}onSolveAsync(t){return this.onSolve(),t()}solve(){this.pict.LogNoisiness>2&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," executing solve() function...")),this.onBeforeSolve();let t=Object.keys(this.pict.views),e=[];for(let r=0;r<t.length;r++){let n=this.pict.views[t[r]];n.options.AutoInitialize&&e.push(n)}e.sort(((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal));for(let t=0;t<e.length;t++)e[t].solve();return this.onSolve(),this.onAfterSolve(),this.lastSolvedTimestamp=this.fable.log.getTimeStamp(),!0}solveAsync(t){let e=this.fable.serviceManager.instantiateServiceProviderWithoutRegistration("Anticipate");e.anticipate(this.onBeforeSolveAsync.bind(this));let r=Object.keys(this.pict.views),n=[];for(let t=0;t<r.length;t++){let e=this.pict.views[r[t]];e.options.AutoSolveWithApp&&n.push(e)}n.sort(((t,e)=>t.options.AutoSolveOrdinal-e.options.AutoSolveOrdinal));for(let t=0;t<n.length;t++)e.anticipate(n[t].solveAsync.bind(n[t]));e.anticipate(this.onSolveAsync.bind(this)),e.anticipate(this.onAfterSolveAsync.bind(this)),e.wait((e=>(this.pict.LogNoisiness>2&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," solveAsync() complete.")),this.lastSolvedTimestamp=this.fable.log.getTimeStamp(),t(e))))}onAfterSolve(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onAfterSolve:")),!0}onAfterSolveAsync(t){return this.onAfterSolve(),t()}onBeforeInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onBeforeInitialize:")),!0}onBeforeInitializeAsync(t){return this.onBeforeInitialize(),t()}onInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onInitialize:")),!0}onInitializeAsync(t){return this.onInitialize(),t()}initialize(){if(this.initializeTimestamp)return this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," initialize called but initialization is already completed. Aborting.")),!1;{this.onBeforeInitialize(),this.onInitialize();let t=Object.keys(this.pict.views),e=[];for(let r=0;r<t.length;r++){let n=this.pict.views[t[r]];n.options.AutoInitialize&&e.push(n)}e.sort(((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal));for(let t=0;t<e.length;t++)e[t].initialize();return this.onAfterInitialize(),this.options.AutoSolveAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," auto solving after initialization...")),this.solve()),this.options.AutoRenderMainViewportViewAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," auto rendering after initialization...")),this.render()),this.initializeTimestamp=this.fable.log.getTimeStamp(),!0}}initializeAsync(t){if(this.initializeTimestamp)return this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," async initialize called but initialization is already completed. Aborting.")),fCallback();{let e=this.fable.serviceManager.instantiateServiceProviderWithoutRegistration("Anticipate");this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," beginning initialization...")),e.anticipate(this.onBeforeInitializeAsync.bind(this)),e.anticipate(this.onInitializeAsync.bind(this));let r=Object.keys(this.pict.views),n=[];for(let t=0;t<r.length;t++){let e=this.pict.views[r[t]];e.options.AutoInitialize&&n.push(e)}n.sort(((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal));for(let t=0;t<n.length;t++){let r=n[t];e.anticipate(r.initializeAsync.bind(r))}e.anticipate(this.onAfterInitializeAsync.bind(this)),this.options.AutoSolveAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," auto solving (asynchronously) after initialization...")),e.anticipate(this.solveAsync.bind(this))),this.options.AutoRenderMainViewportViewAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," auto rendering (asynchronously) after initialization...")),e.anticipate(this.renderMainViewportAsync.bind(this))),e.wait((e=>(this.initializeTimestamp=this.fable.log.getTimeStamp(),this.pict.LogNoisiness>2&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," initialization complete.")),t())))}}onAfterInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onAfterInitialize:")),!0}onAfterInitializeAsync(t){return this.onAfterInitialize(),t()}render(t,e,r,n){let i=void 0===t?this.options.MainViewportViewIdentifier:t,s=void 0===e?this.options.MainViewportRenderableHash:e,o=void 0===r?this.options.MainViewportDestinationAddress:r,a=void 0===n?this.options.MainViewportDefaultDataAddress:n,l="string"==typeof i&&this.servicesMap.PictView[i];return l?l.render(s,o,a):(this.log.error("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," could not render from View ").concat(i," because it is not a valid view.")),!1)}renderMainViewport(){return this.render(this.options.MainViewportViewIdentifier,this.options.MainViewportRenderableHash,this.options.MainViewportDestinationAddress,this.options.MainViewportDefaultDataAddress)}renderAsync(t,e,r,n,i){let s=void 0===t?this.options.MainViewportViewIdentifier:t,o=void 0===e?this.options.MainViewportRenderableHash:e,a=void 0===r?this.options.MainViewportDestinationAddress:r,l=void 0===n?this.options.MainViewportDefaultDataAddress:n,c="string"==typeof s&&this.servicesMap.PictView[s];if(!c){let t="PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," could not asynchronously render from View ").concat(s," because it is not a valid view.");return this.pict.LogNoisiness>3&&this.log.error(t),i(new Error(t))}return c.renderAsync(o,a,l,i)}renderMainViewportAsync(t){return this.renderAsync(this.options.MainViewportViewIdentifier,this.options.MainViewportRenderableHash,this.options.MainViewportDestinationAddress,this.options.MainViewportDefaultDataAddress,t)}}},{"fable-serviceproviderbase":33}],74:[function(t,e,r){const n=t("fable-serviceproviderbase"),i={DefaultRenderable:!1,DefaultDestinationAddress:!1,DefaultTemplateRecordAddress:!1,ViewIdentifier:!1,AutoInitialize:!0,AutoInitializeOrdinal:0,AutoRender:!0,AutoRenderOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0,CSSHash:!1,CSS:!1,CSSProvider:!1,CSSPriority:500,Templates:[],DefaultTemplates:[],Renderables:[],Manifests:{}};e.exports=class extends n{constructor(t,e,r){super(t,Object.assign({},JSON.parse(JSON.stringify(i)),e),r),this.options.ViewIdentifier||(this.options.ViewIdentifier="AutoViewID-".concat(this.fable.getUUID())),this.serviceType="PictView",this.pict=this.fable,this.AppData=this.pict.AppData,this.initializeTimestamp=!1,this.lastSolvedTimestamp=!1,this.lastRenderedTimestamp=!1;for(let t=0;t<this.options.Templates.length;t++){let e=this.options.Templates[t];e.hasOwnProperty("Hash")&&e.hasOwnProperty("Template")?(e.Source||(e.Source="PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," options object.")),this.pict.TemplateProvider.addTemplate(e.Hash,e.Template,e.Source)):this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not load Template ").concat(t," in the options array."),e)}for(let t=0;t<this.options.DefaultTemplates.length;t++){let e=this.options.DefaultTemplates[t];e.hasOwnProperty("Postfix")&&e.hasOwnProperty("Template")?(e.Source||(e.Source="PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," options object.")),this.pict.TemplateProvider.addDefaultTemplate(e.Prefix,e.Postfix,e.Template,e.Source)):this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not load Default Template ").concat(t," in the options array."),e)}if(this.options.CSS){let t=this.options.CSSHash?this.options.CSSHash:"View-".concat(this.options.ViewIdentifier),e=this.options.CSSProvider?this.options.CSSProvider:t;this.pict.CSSMap.addCSS(t,this.options.CSS,e,this.options.CSSPriority)}this.renderables={};for(let t=0;t<this.options.Renderables.length;t++){this.options.Renderables[t];this.addRenderable(this.options.Renderables[t])}}addRenderable(t,e,r,n,i){let s=!1;if("object"==typeof t)s=t;else{s={RenderableHash:t,TemplateHash:e,DefaultTemplateDataAddress:r,DefaultDestinationAddress:n,RenderMethod:"string"!=typeof i?i:"replace"}}"string"!=typeof s.RenderableHash||"string"!=typeof s.TemplateHash?this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not load Renderable; RenderableHash or TemplateHash are invalid."),s):(this.pict.LogNoisiness>0&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," adding renderable [").concat(s.RenderableHash,"] pointed to template ").concat(s.TemplateHash,".")),this.renderables[s.RenderableHash]=s)}onBeforeSolve(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onBeforeSolve:")),!0}onBeforeSolveAsync(t){return this.onBeforeSolve(),t()}onSolve(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onSolve:")),!0}onSolveAsync(t){return this.onSolve(),t()}solve(){return this.pict.LogNoisiness>2&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," executing solve() function...")),this.onBeforeSolve(),this.onSolve(),this.onAfterSolve(),this.lastSolvedTimestamp=this.pict.log.getTimeStamp(),!0}solveAsync(t){let e=this.pict.serviceManager.instantiateServiceProviderWithoutRegistration("Anticipate");e.anticipate(this.onBeforeSolveAsync.bind(this)),e.anticipate(this.onSolveAsync.bind(this)),e.anticipate(this.onAfterSolveAsync.bind(this)),e.wait((e=>(this.pict.LogNoisiness>2&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," solveAsync() complete.")),this.lastSolvedTimestamp=this.pict.log.getTimeStamp(),t(e))))}onAfterSolve(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterSolve:")),!0}onAfterSolveAsync(t){return this.onAfterSolve(),t()}onBeforeInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onBeforeInitialize:")),!0}onBeforeInitializeAsync(t){return this.onBeforeInitialize(),t()}onInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onInitialize:")),!0}onInitializeAsync(t){return this.onInitialize(),t()}initialize(){return this.initializeTimestamp?(this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," initialize called but initialization is already completed. Aborting.")),!1):(this.onBeforeInitialize(),this.onInitialize(),this.onAfterInitialize(),this.initializeTimestamp=this.pict.log.getTimeStamp(),!0)}initializeAsync(t){if(this.initializeTimestamp)return this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," async initialize called but initialization is already completed. Aborting.")),t();{let e=this.pict.serviceManager.instantiateServiceProviderWithoutRegistration("Anticipate");this.pict.LogNoisiness>0&&this.log.info("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," beginning initialization...")),e.anticipate(this.onBeforeInitializeAsync.bind(this)),e.anticipate(this.onInitializeAsync.bind(this)),e.anticipate(this.onAfterInitializeAsync.bind(this)),e.wait((e=>(this.initializeTimestamp=this.pict.log.getTimeStamp(),this.pict.LogNoisiness>0&&this.log.info("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," initialization complete.")),t())))}}onAfterInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterInitialize:")),!0}onAfterInitializeAsync(t){return this.onAfterInitialize(),t()}onBeforeRender(t,e,r){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onBeforeRender:")),!0}onBeforeRenderAsync(t,e,r,n){return this.onBeforeRender(t,e,r),n()}render(t,e,r){let n="string"==typeof t?t:"string"==typeof this.options.DefaultRenderable&&this.options.DefaultRenderable;if(!n)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(n," (param ").concat(t,") because it is not a valid renderable.")),!1;let i=this.renderables[n];if(!i)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(n," (param ").concat(t,") because it does not exist.")),!1;let s="string"==typeof e?e:"string"==typeof i.ContentDestinationAddress?i.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress&&this.options.DefaultDestinationAddress;if(!s)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(n," (param ").concat(t,") because it does not have a valid destination address.")),!1;let o="string"==typeof r?r:"string"==typeof i.DefaultTemplateRecordAddress?i.DefaultTemplateRecordAddress:"string"==typeof this.options.DefaultTemplateRecordAddress&&this.options.DefaultTemplateRecordAddress,a="string"==typeof o?this.pict.DataProvider.getDataByAddress(o):void 0;this.onBeforeRender(i,s,a);let l=this.pict.parseTemplateByHash(i.TemplateHash,a);switch(i.RenderMethod){case"append":this.pict.ContentAssignment.appendContent(s,l);break;case"prepend":this.pict.ContentAssignment.prependContent(s,l);break;case"append_once":this.pict.ContentAssignment.getElement("#".concat(n)).length<1&&this.pict.ContentAssignment.appendContent(s,l);default:this.pict.ContentAssignment.assignContent(s,l)}this.onAfterRender(i,s,a,l),this.lastRenderedTimestamp=this.pict.log.getTimeStamp()}renderAsync(t,e,r,n){let i="string"==typeof t?t:"string"==typeof this.options.DefaultRenderable&&this.options.DefaultRenderable;if(!i)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not asynchronously render ").concat(i," (param ").concat(t,"because it is not a valid renderable.")),n(Error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not asynchronously render ").concat(i," (param ").concat(t,"because it is not a valid renderable.")));let s=this.renderables[i];if(!s)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(i," (param ").concat(t,") because it does not exist.")),n(Error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(i," (param ").concat(t,") because it does not exist.")));let o="string"==typeof e?e:"string"==typeof s.ContentDestinationAddress?s.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress&&this.options.DefaultDestinationAddress;if(!o)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(i," (param ").concat(t,") because it does not have a valid destination address.")),n(Error("Could not render ".concat(i)));let a="string"==typeof r?r:"string"==typeof s.DefaultTemplateRecordAddress?s.DefaultTemplateRecordAddress:"string"==typeof this.options.DefaultTemplateRecordAddress&&this.options.DefaultTemplateRecordAddress,l="string"==typeof a?this.pict.DataProvider.getDataByAddress(a):void 0;this.onBeforeRender(s,o,l),this.pict.parseTemplateByHash(s.TemplateHash,l,((e,r)=>{if(e)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render (asynchronously) ").concat(i," (param ").concat(t,") because it did not parse the template."),e),n(e);switch(s.RenderMethod){case"append":this.pict.ContentAssignment.appendContent(o,r);break;case"prepend":this.pict.ContentAssignment.prependContent(o,r);break;case"append_once":this.pict.ContentAssignment.getElement("#".concat(i)).length<1&&this.pict.ContentAssignment.appendContent(o,r);default:this.pict.ContentAssignment.assignContent(o,r)}return this.onAfterRender(s,o,l,r),this.lastRenderedTimestamp=this.pict.log.getTimeStamp(),n(null,r)}))}onAfterRender(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterRender:")),!0}onAfterRenderAsync(t){return this.onAfterRender(),t()}}},{"fable-serviceproviderbase":33}],75:[function(t,e,r){
|
|
2
2
|
/**
|
|
3
3
|
* Precedent Meta-Templating
|
|
4
4
|
*
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @description Process text streams, parsing out meta-template expressions.
|
|
10
10
|
*/
|
|
11
|
-
var n=e("./WordTree.js"),i=e("./StringParser.js");t.exports=class{constructor(){this.WordTree=new n,this.StringParser=new i,this.ParseTree=this.WordTree.ParseTree}addPattern(e,t,r){return this.WordTree.addPattern(e,t,r)}parseString(e,t){return this.StringParser.parseString(e,this.ParseTree,t)}}},{"./StringParser.js":75,"./WordTree.js":76}],75:[function(e,t,r){t.exports=class{constructor(){}newParserState(e){return{ParseTree:e,Asynchronous:!1,Output:"",OutputBuffer:"",Pattern:!1,PatternMatch:!1,PatternMatchOutputBuffer:""}}assignNode(e,t){t.PatternMatch=e,t.PatternMatch.hasOwnProperty("PatternEnd")&&(t.Pattern=t.PatternMatch)}appendOutputBuffer(e,t){t.OutputBuffer+=e}flushOutputBuffer(e){e.Output+=e.OutputBuffer,e.OutputBuffer=""}checkPatternEnd(e,t){e.OutputBuffer.length>=e.Pattern.PatternEnd.length+e.Pattern.PatternStart.length&&e.OutputBuffer.substr(-e.Pattern.PatternEnd.length)===e.Pattern.PatternEnd&&(e.OutputBuffer=e.Pattern.Parse(e.OutputBuffer.substr(e.Pattern.PatternStart.length,e.OutputBuffer.length-(e.Pattern.PatternStart.length+e.Pattern.PatternEnd.length)),t),this.flushOutputBuffer(e),e.Pattern=!1,e.PatternMatch=!1)}parseCharacter(e,t,r){!t.PatternMatch&&t.ParseTree.hasOwnProperty(e)?(this.assignNode(t.ParseTree[e],t),this.appendOutputBuffer(e,t)):t.PatternMatch?(t.PatternMatch.hasOwnProperty(e)&&this.assignNode(t.PatternMatch[e],t),this.appendOutputBuffer(e,t),t.Pattern&&this.checkPatternEnd(t,r)):t.Output+=e}parseString(e,t,r){let n=this.newParserState(t);for(var i=0;i<e.length;i++)this.parseCharacter(e[i],n,r);return this.flushOutputBuffer(n),n.Output}}},{}],76:[function(e,t,r){t.exports=class{constructor(){this.ParseTree={}}addChild(e,t,r){return e.hasOwnProperty(t[r])||(e[t[r]]={}),e[t[r]]}addPattern(e,t,r){if(e.length<1)return!1;if("string"==typeof t&&t.length<1)return!1;let n=this.ParseTree;for(var i=0;i<e.length;i++)n=this.addChild(n,e,i);return n.PatternStart=e,n.PatternEnd="string"==typeof t&&t.length>0?t:e,n.Parse="function"==typeof r?r:"string"==typeof r?()=>r:e=>e,!0}}},{}],77:[function(e,t,r){var n,i,s=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(e){i=a}}();var l,h=[],u=!1,f=-1;function p(){u&&l&&(u=!1,l.length?h=l.concat(h):f=-1,h.length&&d())}function d(){if(!u){var e=c(p);u=!0;for(var t=h.length;t;){for(l=h,h=[];++f<t;)l&&l[f].run();f=-1,t=h.length}l=null,u=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{return i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function g(e,t){this.fun=e,this.array=t}function m(){}s.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];h.push(new g(e,t)),1!==h.length||u||c(d)},g.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=m,s.addListener=m,s.once=m,s.off=m,s.removeListener=m,s.removeAllListeners=m,s.emit=m,s.prependListener=m,s.prependOnceListener=m,s.listeners=function(e){return[]},s.binding=function(e){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(e){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},{}],78:[function(e,t,r){(function(e){(function(){!function(n){var i="object"==typeof r&&r&&!r.nodeType&&r,s="object"==typeof t&&t&&!t.nodeType&&t,o="object"==typeof e&&e;o.global!==o&&o.window!==o&&o.self!==o||(n=o);var a,c,l=2147483647,h=36,u=1,f=26,p=38,d=700,g=72,m=128,y="-",b=/^xn--/,v=/[^\x20-\x7E]/,w=/[\x2E\u3002\uFF0E\uFF61]/g,S={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},P=h-u,T=Math.floor,A=String.fromCharCode;function _(e){throw new RangeError(S[e])}function E(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function C(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+E((e=e.replace(w,".")).split("."),t).join(".")}function O(e){for(var t,r,n=[],i=0,s=e.length;i<s;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<s?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function M(e){return E(e,(function(e){var t="";return e>65535&&(t+=A((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=A(e)})).join("")}function D(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function x(e,t,r){var n=0;for(e=r?T(e/d):e>>1,e+=T(e/t);e>P*f>>1;n+=h)e=T(e/P);return T(n+(P+1)*e/(e+p))}function R(e){var t,r,n,i,s,o,a,c,p,d,b,v=[],w=e.length,S=0,P=m,A=g;for((r=e.lastIndexOf(y))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&_("not-basic"),v.push(e.charCodeAt(n));for(i=r>0?r+1:0;i<w;){for(s=S,o=1,a=h;i>=w&&_("invalid-input"),((c=(b=e.charCodeAt(i++))-48<10?b-22:b-65<26?b-65:b-97<26?b-97:h)>=h||c>T((l-S)/o))&&_("overflow"),S+=c*o,!(c<(p=a<=A?u:a>=A+f?f:a-A));a+=h)o>T(l/(d=h-p))&&_("overflow"),o*=d;A=x(S-s,t=v.length+1,0==s),T(S/t)>l-P&&_("overflow"),P+=T(S/t),S%=t,v.splice(S++,0,P)}return M(v)}function j(e){var t,r,n,i,s,o,a,c,p,d,b,v,w,S,P,E=[];for(v=(e=O(e)).length,t=m,r=0,s=g,o=0;o<v;++o)(b=e[o])<128&&E.push(A(b));for(n=i=E.length,i&&E.push(y);n<v;){for(a=l,o=0;o<v;++o)(b=e[o])>=t&&b<a&&(a=b);for(a-t>T((l-r)/(w=n+1))&&_("overflow"),r+=(a-t)*w,t=a,o=0;o<v;++o)if((b=e[o])<t&&++r>l&&_("overflow"),b==t){for(c=r,p=h;!(c<(d=p<=s?u:p>=s+f?f:p-s));p+=h)P=c-d,S=h-d,E.push(A(D(d+P%S,0))),c=T(P/S);E.push(A(D(c,0))),s=x(r,w,n==i),r=0,++n}++r,++t}return E.join("")}if(a={version:"1.4.1",ucs2:{decode:O,encode:M},decode:R,encode:j,toASCII:function(e){return C(e,(function(e){return v.test(e)?"xn--"+j(e):e}))},toUnicode:function(e){return C(e,(function(e){return b.test(e)?R(e.slice(4).toLowerCase()):e}))}},i&&s)if(t.exports==i)s.exports=a;else for(c in a)a.hasOwnProperty(c)&&(i[c]=a[c]);else n.punycode=a}(this)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],79:[function(e,t,r){function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,r,s){t=t||"&",r=r||"=";var o={};if("string"!=typeof e||0===e.length)return o;var a=/\+/g;e=e.split(t);var c=1e3;s&&"number"==typeof s.maxKeys&&(c=s.maxKeys);var l=e.length;c>0&&l>c&&(l=c);for(var h=0;h<l;++h){var u,f,p,d,g=e[h].replace(a,"%20"),m=g.indexOf(r);m>=0?(u=g.substr(0,m),f=g.substr(m+1)):(u=g,f=""),p=decodeURIComponent(u),d=decodeURIComponent(f),n(o,p)?i(o[p])?o[p].push(d):o[p]=[o[p],d]:o[p]=d}return o};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],80:[function(e,t,r){var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,a){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?s(o(e),(function(o){var a=encodeURIComponent(n(o))+r;return i(e[o])?s(e[o],(function(e){return a+encodeURIComponent(n(e))})).join(t):a+encodeURIComponent(n(e[o]))})).join(t):a?encodeURIComponent(n(a))+r+encodeURIComponent(n(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function s(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var o=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t}},{}],81:[function(e,t,r){r.decode=r.parse=e("./decode"),r.encode=r.stringify=e("./encode")},{"./decode":79,"./encode":80}],82:[function(e,t,r){/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var n=e("buffer"),i=n.Buffer;function s(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(s(n,r),r.Buffer=o),o.prototype=Object.create(i.prototype),s(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},{buffer:19}],83:[function(e,t,r){(function(e){(function(){/*! simple-concat. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */t.exports=function(t,r){var n=[];t.on("data",(function(e){n.push(e)})),t.once("end",(function(){r&&r(null,e.concat(n)),r=null})),t.once("error",(function(e){r&&r(e),r=null}))}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:19}],84:[function(e,t,r){(function(r){(function(){/*! simple-get. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */t.exports=u;const n=e("simple-concat"),i=e("decompress-response"),s=e("http"),o=e("https"),a=e("once"),c=e("querystring"),l=e("url"),h=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;function u(e,t){if(e=Object.assign({maxRedirects:10},"string"==typeof e?{url:e}:e),t=a(t),e.url){const{hostname:t,port:r,protocol:n,auth:i,path:s}=l.parse(e.url);delete e.url,t||r||n||i?Object.assign(e,{hostname:t,port:r,protocol:n,auth:i,path:s}):e.path=s}const n={"accept-encoding":"gzip, deflate"};let f;e.headers&&Object.keys(e.headers).forEach((t=>n[t.toLowerCase()]=e.headers[t])),e.headers=n,e.body?f=e.json&&!h(e.body)?JSON.stringify(e.body):e.body:e.form&&(f="string"==typeof e.form?e.form:c.stringify(e.form),e.headers["content-type"]="application/x-www-form-urlencoded"),f&&(e.method||(e.method="POST"),h(f)||(e.headers["content-length"]=r.byteLength(f)),e.json&&!e.form&&(e.headers["content-type"]="application/json")),delete e.body,delete e.form,e.json&&(e.headers.accept="application/json"),e.method&&(e.method=e.method.toUpperCase());const p=e.hostname,d=("https:"===e.protocol?o:s).request(e,(r=>{if(!1!==e.followRedirects&&r.statusCode>=300&&r.statusCode<400&&r.headers.location){e.url=r.headers.location,delete e.headers.host,r.resume();const n=l.parse(e.url).hostname;return null!==n&&n!==p&&(delete e.headers.cookie,delete e.headers.authorization),"POST"===e.method&&[301,302].includes(r.statusCode)&&(e.method="GET",delete e.headers["content-length"],delete e.headers["content-type"]),0==e.maxRedirects--?t(new Error("too many redirects")):u(e,t)}const n="function"==typeof i&&"HEAD"!==e.method;t(null,n?i(r):r)}));return d.on("timeout",(()=>{d.abort(),t(new Error("Request timed out"))})),d.on("error",t),h(f)?f.on("error",t).pipe(d):d.end(f),d}u.concat=(e,t)=>u(e,((r,i)=>{if(r)return t(r);n(i,((r,n)=>{if(r)return t(r);if(e.json)try{n=JSON.parse(n.toString())}catch(r){return t(r,i,n)}t(null,i,n)}))})),["get","post","put","patch","head","delete"].forEach((e=>{u[e]=(t,r)=>("string"==typeof t&&(t={url:t}),u(Object.assign({method:e.toUpperCase()},t),r))}))}).call(this)}).call(this,e("buffer").Buffer)},{buffer:19,"decompress-response":17,http:85,https:56,once:70,querystring:81,"simple-concat":83,url:106}],85:[function(e,t,r){(function(t){(function(){var n=e("./lib/request"),i=e("./lib/response"),s=e("xtend"),o=e("builtin-status-codes"),a=e("url"),c=r;c.request=function(e,r){e="string"==typeof e?a.parse(e):s(e);var i=-1===t.location.protocol.search(/^https?:$/)?"http:":"",o=e.protocol||i,c=e.hostname||e.host,l=e.port,h=e.path||"/";c&&-1!==c.indexOf(":")&&(c="["+c+"]"),e.url=(c?o+"//"+c:"")+(l?":"+l:"")+h,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var u=new n(e);return r&&u.on("response",r),u},c.get=function(e,t){var r=c.request(e,t);return r.end(),r},c.ClientRequest=n,c.IncomingMessage=i.IncomingMessage,c.Agent=function(){},c.Agent.defaultMaxSockets=4,c.globalAgent=new c.Agent,c.STATUS_CODES=o,c.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/request":87,"./lib/response":88,"builtin-status-codes":20,url:106,xtend:110}],86:[function(e,t,r){(function(e){(function(){var t;function n(){if(void 0!==t)return t;if(e.XMLHttpRequest){t=new e.XMLHttpRequest;try{t.open("GET",e.XDomainRequest?"/":"https://example.com")}catch(e){t=null}}else t=null;return t}function i(e){var t=n();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}function s(e){return"function"==typeof e}r.fetch=s(e.fetch)&&s(e.ReadableStream),r.writableStream=s(e.WritableStream),r.abortController=s(e.AbortController),r.arraybuffer=r.fetch||i("arraybuffer"),r.msstream=!r.fetch&&i("ms-stream"),r.mozchunkedarraybuffer=!r.fetch&&i("moz-chunked-arraybuffer"),r.overrideMimeType=r.fetch||!!n()&&s(n().overrideMimeType),t=null}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],87:[function(e,t,r){(function(r,n,i){(function(){var s=e("./capability"),o=e("inherits"),a=e("./response"),c=e("readable-stream"),l=a.IncomingMessage,h=a.readyStates;var u=t.exports=function(e){var t,r=this;c.Writable.call(r),r._opts=e,r._body=[],r._headers={},e.auth&&r.setHeader("Authorization","Basic "+i.from(e.auth).toString("base64")),Object.keys(e.headers).forEach((function(t){r.setHeader(t,e.headers[t])}));var n=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!s.abortController)n=!1,t=!0;else if("prefer-streaming"===e.mode)t=!1;else if("allow-wrong-content-type"===e.mode)t=!s.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");t=!0}r._mode=function(e,t){return s.fetch&&t?"fetch":s.mozchunkedarraybuffer?"moz-chunked-arraybuffer":s.msstream?"ms-stream":s.arraybuffer&&e?"arraybuffer":"text"}(t,n),r._fetchTimer=null,r._socketTimeout=null,r._socketTimer=null,r.on("finish",(function(){r._onFinish()}))};o(u,c.Writable),u.prototype.setHeader=function(e,t){var r=e.toLowerCase();-1===f.indexOf(r)&&(this._headers[r]={name:e,value:t})},u.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},u.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},u.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t=e._opts;"timeout"in t&&0!==t.timeout&&e.setTimeout(t.timeout);var i=e._headers,o=null;"GET"!==t.method&&"HEAD"!==t.method&&(o=new Blob(e._body,{type:(i["content-type"]||{}).value||""}));var a=[];if(Object.keys(i).forEach((function(e){var t=i[e].name,r=i[e].value;Array.isArray(r)?r.forEach((function(e){a.push([t,e])})):a.push([t,r])})),"fetch"===e._mode){var c=null;if(s.abortController){var l=new AbortController;c=l.signal,e._fetchAbortController=l,"requestTimeout"in t&&0!==t.requestTimeout&&(e._fetchTimer=n.setTimeout((function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()}),t.requestTimeout))}n.fetch(e._opts.url,{method:e._opts.method,headers:a,body:o||void 0,mode:"cors",credentials:t.withCredentials?"include":"same-origin",signal:c}).then((function(t){e._fetchResponse=t,e._resetTimers(!1),e._connect()}),(function(t){e._resetTimers(!0),e._destroyed||e.emit("error",t)}))}else{var u=e._xhr=new n.XMLHttpRequest;try{u.open(e._opts.method,e._opts.url,!0)}catch(t){return void r.nextTick((function(){e.emit("error",t)}))}"responseType"in u&&(u.responseType=e._mode),"withCredentials"in u&&(u.withCredentials=!!t.withCredentials),"text"===e._mode&&"overrideMimeType"in u&&u.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in t&&(u.timeout=t.requestTimeout,u.ontimeout=function(){e.emit("requestTimeout")}),a.forEach((function(e){u.setRequestHeader(e[0],e[1])})),e._response=null,u.onreadystatechange=function(){switch(u.readyState){case h.LOADING:case h.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(u.onprogress=function(){e._onXHRProgress()}),u.onerror=function(){e._destroyed||(e._resetTimers(!0),e.emit("error",new Error("XHR error")))};try{u.send(o)}catch(t){return void r.nextTick((function(){e.emit("error",t)}))}}}},u.prototype._onXHRProgress=function(){var e=this;e._resetTimers(!1),function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}}(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress(e._resetTimers.bind(e)))},u.prototype._connect=function(){var e=this;e._destroyed||(e._response=new l(e._xhr,e._fetchResponse,e._mode,e._resetTimers.bind(e)),e._response.on("error",(function(t){e.emit("error",t)})),e.emit("response",e._response))},u.prototype._write=function(e,t,r){this._body.push(e),r()},u.prototype._resetTimers=function(e){var t=this;n.clearTimeout(t._socketTimer),t._socketTimer=null,e?(n.clearTimeout(t._fetchTimer),t._fetchTimer=null):t._socketTimeout&&(t._socketTimer=n.setTimeout((function(){t.emit("timeout")}),t._socketTimeout))},u.prototype.abort=u.prototype.destroy=function(e){var t=this;t._destroyed=!0,t._resetTimers(!0),t._response&&(t._response._destroyed=!0),t._xhr?t._xhr.abort():t._fetchAbortController&&t._fetchAbortController.abort(),e&&t.emit("error",e)},u.prototype.end=function(e,t,r){"function"==typeof e&&(r=e,e=void 0),c.Writable.prototype.end.call(this,e,t,r)},u.prototype.setTimeout=function(e,t){var r=this;t&&r.once("timeout",t),r._socketTimeout=e,r._resetTimers(!1)},u.prototype.flushHeaders=function(){},u.prototype.setNoDelay=function(){},u.prototype.setSocketKeepAlive=function(){};var f=["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,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./capability":86,"./response":88,_process:77,buffer:19,inherits:58,"readable-stream":103}],88:[function(e,t,r){(function(t,n,i){(function(){var s=e("./capability"),o=e("inherits"),a=e("readable-stream"),c=r.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},l=r.IncomingMessage=function(e,r,n,o){var c=this;if(a.Readable.call(c),c._mode=n,c.headers={},c.rawHeaders=[],c.trailers={},c.rawTrailers=[],c.on("end",(function(){t.nextTick((function(){c.emit("close")}))})),"fetch"===n){if(c._fetchResponse=r,c.url=r.url,c.statusCode=r.status,c.statusMessage=r.statusText,r.headers.forEach((function(e,t){c.headers[t.toLowerCase()]=e,c.rawHeaders.push(t,e)})),s.writableStream){var l=new WritableStream({write:function(e){return o(!1),new Promise((function(t,r){c._destroyed?r():c.push(i.from(e))?t():c._resumeFetch=t}))},close:function(){o(!0),c._destroyed||c.push(null)},abort:function(e){o(!0),c._destroyed||c.emit("error",e)}});try{return void r.body.pipeTo(l).catch((function(e){o(!0),c._destroyed||c.emit("error",e)}))}catch(d){}}var h=r.body.getReader();function p(){h.read().then((function(e){c._destroyed||(o(e.done),e.done?c.push(null):(c.push(i.from(e.value)),p()))})).catch((function(e){o(!0),c._destroyed||c.emit("error",e)}))}p()}else{if(c._xhr=e,c._pos=0,c.url=e.responseURL,c.statusCode=e.status,c.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach((function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var r=t[1].toLowerCase();"set-cookie"===r?(void 0===c.headers[r]&&(c.headers[r]=[]),c.headers[r].push(t[2])):void 0!==c.headers[r]?c.headers[r]+=", "+t[2]:c.headers[r]=t[2],c.rawHeaders.push(t[1],t[2])}})),c._charset="x-user-defined",!s.overrideMimeType){var u=c.rawHeaders["mime-type"];if(u){var f=u.match(/;\s*charset=([^;])(;|$)/);f&&(c._charset=f[1].toLowerCase())}c._charset||(c._charset="utf-8")}}};o(l,a.Readable),l.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},l.prototype._onXHRProgress=function(e){var t=this,r=t._xhr,s=null;switch(t._mode){case"text":if((s=r.responseText).length>t._pos){var o=s.substr(t._pos);if("x-user-defined"===t._charset){for(var a=i.alloc(o.length),l=0;l<o.length;l++)a[l]=255&o.charCodeAt(l);t.push(a)}else t.push(o,t._charset);t._pos=s.length}break;case"arraybuffer":if(r.readyState!==c.DONE||!r.response)break;s=r.response,t.push(i.from(new Uint8Array(s)));break;case"moz-chunked-arraybuffer":if(s=r.response,r.readyState!==c.LOADING||!s)break;t.push(i.from(new Uint8Array(s)));break;case"ms-stream":if(s=r.response,r.readyState!==c.LOADING)break;var h=new n.MSStreamReader;h.onprogress=function(){h.result.byteLength>t._pos&&(t.push(i.from(new Uint8Array(h.result.slice(t._pos)))),t._pos=h.result.byteLength)},h.onload=function(){e(!0),t.push(null)},h.readAsArrayBuffer(s)}t._xhr.readyState===c.DONE&&"ms-stream"!==t._mode&&(e(!0),t.push(null))}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./capability":86,_process:77,buffer:19,inherits:58,"readable-stream":103}],89:[function(e,t,r){var n={};function i(e,t,r){r||(r=Error);var i=function(e){var r,n;function i(r,n,i){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,i))||this}return n=e,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);i.prototype.name=r.name,i.prototype.code=e,n[e]=i}function s(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,i,o,a;if("string"==typeof t&&(i="not ",t.substr(!o||o<0?0:+o,i.length)===i)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))a="The ".concat(e," ").concat(n," ").concat(s(t,"type"));else{var c=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";a='The "'.concat(e,'" ').concat(c," ").concat(n," ").concat(s(t,"type"))}return a+=". Received type ".concat(typeof r)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=n},{}],90:[function(e,t,r){(function(r){(function(){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=l;var i=e("./_stream_readable"),s=e("./_stream_writable");e("inherits")(l,i);for(var o=n(s.prototype),a=0;a<o.length;a++){var c=o[a];l.prototype[c]||(l.prototype[c]=s.prototype[c])}function l(e){if(!(this instanceof l))return new l(e);i.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",h)))}function h(){this._writableState.ended||r.nextTick(u,this)}function u(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}).call(this)}).call(this,e("_process"))},{"./_stream_readable":92,"./_stream_writable":94,_process:77,inherits:58}],91:[function(e,t,r){t.exports=i;var n=e("./_stream_transform");function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}e("inherits")(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},{"./_stream_transform":93,inherits:58}],92:[function(e,t,r){(function(r,n){(function(){var i;t.exports=_,_.ReadableState=A;e("events").EventEmitter;var s=function(e,t){return e.listeners(t).length},o=e("./internal/streams/stream"),a=e("buffer").Buffer,c=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var l,h=e("util");l=h&&h.debuglog?h.debuglog("stream"):function(){};var u,f,p,d=e("./internal/streams/buffer_list"),g=e("./internal/streams/destroy"),m=e("./internal/streams/state").getHighWaterMark,y=e("../errors").codes,b=y.ERR_INVALID_ARG_TYPE,v=y.ERR_STREAM_PUSH_AFTER_EOF,w=y.ERR_METHOD_NOT_IMPLEMENTED,S=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;e("inherits")(_,o);var P=g.errorOrDestroy,T=["error","close","destroy","pause","resume"];function A(t,r,n){i=i||e("./_stream_duplex"),t=t||{},"boolean"!=typeof n&&(n=r instanceof i),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=m(this,t,"readableHighWaterMark",n),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(u||(u=e("string_decoder/").StringDecoder),this.decoder=new u(t.encoding),this.encoding=t.encoding)}function _(t){if(i=i||e("./_stream_duplex"),!(this instanceof _))return new _(t);var r=this instanceof i;this._readableState=new A(t,this,r),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),o.call(this)}function E(e,t,r,n,i){l("readableAddChunk",t);var s,o=e._readableState;if(null===t)o.reading=!1,function(e,t){if(l("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?D(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,x(e)))}(e,o);else if(i||(s=function(e,t){var r;n=t,a.isBuffer(n)||n instanceof c||"string"==typeof t||void 0===t||e.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(o,t)),s)P(e,s);else if(o.objectMode||t&&t.length>0)if("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===a.prototype||(t=function(e){return a.from(e)}(t)),n)o.endEmitted?P(e,new S):C(e,o,t,!0);else if(o.ended)P(e,new v);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?C(e,o,t,!1):R(e,o)):C(e,o,t,!1)}else n||(o.reading=!1,R(e,o));return!o.ended&&(o.length<o.highWaterMark||0===o.length)}function C(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&D(e)),R(e,t)}Object.defineProperty(_.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),_.prototype.destroy=g.destroy,_.prototype._undestroy=g.undestroy,_.prototype._destroy=function(e,t){t(e)},_.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=a.from(e,t),t=""),r=!0),E(this,e,t,!1,r)},_.prototype.unshift=function(e){return E(this,e,null,!0,!1)},_.prototype.isPaused=function(){return!1===this._readableState.flowing},_.prototype.setEncoding=function(t){u||(u=e("string_decoder/").StringDecoder);var r=new u(t);this._readableState.decoder=r,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=r.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var O=1073741824;function M(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=O?e=O:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function D(e){var t=e._readableState;l("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(l("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(x,e))}function x(e){var t=e._readableState;l("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,B(e)}function R(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(j,e,t))}function j(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(l("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function I(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function L(e){l("readable nexttick read 0"),e.read(0)}function N(e,t){l("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),B(e),t.flowing&&!t.reading&&e.read(0)}function B(e){var t=e._readableState;for(l("flow",t.flowing);t.flowing&&null!==e.read(););}function U(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function k(e){var t=e._readableState;l("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(F,t,e))}function F(e,t){if(l("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function H(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}_.prototype.read=function(e){l("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return l("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?k(this):D(this),null;if(0===(e=M(e,t))&&t.ended)return 0===t.length&&k(this),null;var n,i=t.needReadable;return l("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&l("length less than watermark",i=!0),t.ended||t.reading?l("reading or ended",i=!1):i&&(l("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=M(r,t))),null===(n=e>0?U(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&k(this)),null!==n&&this.emit("data",n),n},_.prototype._read=function(e){P(this,new w("_read()"))},_.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,l("pipe count=%d opts=%j",i.pipesCount,t);var o=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?c:m;function a(t,r){l("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,l("cleanup"),e.removeListener("close",d),e.removeListener("finish",g),e.removeListener("drain",h),e.removeListener("error",p),e.removeListener("unpipe",a),n.removeListener("end",c),n.removeListener("end",m),n.removeListener("data",f),u=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||h())}function c(){l("onend"),e.end()}i.endEmitted?r.nextTick(o):n.once("end",o),e.on("unpipe",a);var h=function(e){return function(){var t=e._readableState;l("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,B(e))}}(n);e.on("drain",h);var u=!1;function f(t){l("ondata");var r=e.write(t);l("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==H(i.pipes,e))&&!u&&(l("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function p(t){l("onerror",t),m(),e.removeListener("error",p),0===s(e,"error")&&P(e,t)}function d(){e.removeListener("finish",g),m()}function g(){l("onfinish"),e.removeListener("close",d),m()}function m(){l("unpipe"),n.unpipe(e)}return n.on("data",f),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",p),e.once("close",d),e.once("finish",g),e.emit("pipe",n),i.flowing||(l("pipe resume"),n.resume()),e},_.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s<i;s++)n[s].emit("unpipe",this,{hasUnpiped:!1});return this}var o=H(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},_.prototype.on=function(e,t){var n=o.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,l("on readable",i.length,i.reading),i.length?D(this):i.reading||r.nextTick(L,this))),n},_.prototype.addListener=_.prototype.on,_.prototype.removeListener=function(e,t){var n=o.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(I,this),n},_.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(I,this),t},_.prototype.resume=function(){var e=this._readableState;return e.flowing||(l("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(N,e,t))}(this,e)),e.paused=!1,this},_.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},_.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(l("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(l("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var s=0;s<T.length;s++)e.on(T[s],this.emit.bind(this,T[s]));return this._read=function(t){l("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(_.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=e("./internal/streams/async_iterator")),f(this)}),Object.defineProperty(_.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(_.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(_.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),_._fromList=U,Object.defineProperty(_.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(_.from=function(t,r){return void 0===p&&(p=e("./internal/streams/from")),p(_,t,r)})}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":89,"./_stream_duplex":90,"./internal/streams/async_iterator":95,"./internal/streams/buffer_list":96,"./internal/streams/destroy":97,"./internal/streams/from":99,"./internal/streams/state":101,"./internal/streams/stream":102,_process:77,buffer:19,events:25,inherits:58,"string_decoder/":104,util:17}],93:[function(e,t,r){t.exports=h;var n=e("../errors").codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,s=n.ERR_MULTIPLE_CALLBACK,o=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,c=e("./_stream_duplex");function l(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new s);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function h(e){if(!(this instanceof h))return new h(e);c.call(this,e),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",u)}function u(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?f(this,null,null):this._flush((function(t,r){f(e,t,r)}))}function f(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new a;if(e._transformState.transforming)throw new o;return e.push(null)}e("inherits")(h,c),h.prototype.push=function(e,t){return this._transformState.needTransform=!1,c.prototype.push.call(this,e,t)},h.prototype._transform=function(e,t,r){r(new i("_transform()"))},h.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},h.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},h.prototype._destroy=function(e,t){c.prototype._destroy.call(this,e,(function(e){t(e)}))}},{"../errors":89,"./_stream_duplex":90,inherits:58}],94:[function(e,t,r){(function(r,n){(function(){function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var s;t.exports=_,_.WritableState=A;var o={deprecate:e("util-deprecate")},a=e("./internal/streams/stream"),c=e("buffer").Buffer,l=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var h,u=e("./internal/streams/destroy"),f=e("./internal/streams/state").getHighWaterMark,p=e("../errors").codes,d=p.ERR_INVALID_ARG_TYPE,g=p.ERR_METHOD_NOT_IMPLEMENTED,m=p.ERR_MULTIPLE_CALLBACK,y=p.ERR_STREAM_CANNOT_PIPE,b=p.ERR_STREAM_DESTROYED,v=p.ERR_STREAM_NULL_VALUES,w=p.ERR_STREAM_WRITE_AFTER_END,S=p.ERR_UNKNOWN_ENCODING,P=u.errorOrDestroy;function T(){}function A(t,n,o){s=s||e("./_stream_duplex"),t=t||{},"boolean"!=typeof o&&(o=n instanceof s),this.objectMode=!!t.objectMode,o&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=f(this,t,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,i=n.sync,s=n.writecb;if("function"!=typeof s)throw new m;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,i,s){--t.pendingcb,n?(r.nextTick(s,i),r.nextTick(x,e,t),e._writableState.errorEmitted=!0,P(e,i)):(s(i),e._writableState.errorEmitted=!0,P(e,i),x(e,t))}(e,n,i,t,s);else{var o=M(n)||e.destroyed;o||n.corked||n.bufferProcessing||!n.bufferedRequest||O(e,n),i?r.nextTick(C,e,n,o,s):C(e,n,o,s)}}(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function _(t){var r=this instanceof(s=s||e("./_stream_duplex"));if(!r&&!h.call(_,this))return new _(t);this._writableState=new A(t,this,r),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),a.call(this)}function E(e,t,r,n,i,s,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new b("write")):r?e._writev(i,t.onwrite):e._write(i,s,t.onwrite),t.sync=!1}function C(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),x(e,t)}function O(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,s=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var a=0,c=!0;r;)s[a]=r,r.isBuf||(c=!1),r=r.next,a+=1;s.allBuffers=c,E(e,t,!0,t.length,s,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,h=r.encoding,u=r.callback;if(E(e,t,!1,t.objectMode?1:l.length,l,h,u),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function M(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function D(e,t){e._final((function(r){t.pendingcb--,r&&P(e,r),t.prefinished=!0,e.emit("prefinish"),x(e,t)}))}function x(e,t){var n=M(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,r.nextTick(D,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var i=e._readableState;(!i||i.autoDestroy&&i.endEmitted)&&e.destroy()}return n}e("inherits")(_,a),A.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(A.prototype,"buffer",{get:o.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(_,Symbol.hasInstance,{value:function(e){return!!h.call(this,e)||this===_&&(e&&e._writableState instanceof A)}})):h=function(e){return e instanceof this},_.prototype.pipe=function(){P(this,new y)},_.prototype.write=function(e,t,n){var i,s=this._writableState,o=!1,a=!s.objectMode&&(i=e,c.isBuffer(i)||i instanceof l);return a&&!c.isBuffer(e)&&(e=function(e){return c.from(e)}(e)),"function"==typeof t&&(n=t,t=null),a?t="buffer":t||(t=s.defaultEncoding),"function"!=typeof n&&(n=T),s.ending?function(e,t){var n=new w;P(e,n),r.nextTick(t,n)}(this,n):(a||function(e,t,n,i){var s;return null===n?s=new v:"string"==typeof n||t.objectMode||(s=new d("chunk",["string","Buffer"],n)),!s||(P(e,s),r.nextTick(i,s),!1)}(this,s,e,n))&&(s.pendingcb++,o=function(e,t,r,n,i,s){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,r));return t}(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var a=t.objectMode?1:n.length;t.length+=a;var l=t.length<t.highWaterMark;l||(t.needDrain=!0);if(t.writing||t.corked){var h=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:s,next:null},h?h.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else E(e,t,!1,a,n,i,s);return l}(this,s,a,e,t,n)),o},_.prototype.cork=function(){this._writableState.corked++},_.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||O(this,e))},_.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new S(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(_.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(_.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),_.prototype._write=function(e,t,r){r(new g("_write()"))},_.prototype._writev=null,_.prototype.end=function(e,t,n){var i=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,n){t.ending=!0,x(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,i,n),this},Object.defineProperty(_.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(_.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),_.prototype.destroy=u.destroy,_.prototype._undestroy=u.undestroy,_.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":89,"./_stream_duplex":90,"./internal/streams/destroy":97,"./internal/streams/state":101,"./internal/streams/stream":102,_process:77,buffer:19,inherits:58,"util-deprecate":108}],95:[function(e,t,r){(function(r){(function(){var n;function i(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=e("./end-of-stream"),o=Symbol("lastResolve"),a=Symbol("lastReject"),c=Symbol("error"),l=Symbol("ended"),h=Symbol("lastPromise"),u=Symbol("handlePromise"),f=Symbol("stream");function p(e,t){return{value:e,done:t}}function d(e){var t=e[o];if(null!==t){var r=e[f].read();null!==r&&(e[h]=null,e[o]=null,e[a]=null,t(p(r,!1)))}}function g(e){r.nextTick(d,e)}var m=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((i(n={get stream(){return this[f]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[l])return Promise.resolve(p(void 0,!0));if(this[f].destroyed)return new Promise((function(t,n){r.nextTick((function(){e[c]?n(e[c]):t(p(void 0,!0))}))}));var n,i=this[h];if(i)n=new Promise(function(e,t){return function(r,n){e.then((function(){t[l]?r(p(void 0,!0)):t[u](r,n)}),n)}}(i,this));else{var s=this[f].read();if(null!==s)return Promise.resolve(p(s,!1));n=new Promise(this[u])}return this[h]=n,n}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var e=this;return new Promise((function(t,r){e[f].destroy(null,(function(e){e?r(e):t(p(void 0,!0))}))}))})),n),m);t.exports=function(e){var t,r=Object.create(y,(i(t={},f,{value:e,writable:!0}),i(t,o,{value:null,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,c,{value:null,writable:!0}),i(t,l,{value:e._readableState.endEmitted,writable:!0}),i(t,u,{value:function(e,t){var n=r[f].read();n?(r[h]=null,r[o]=null,r[a]=null,e(p(n,!1))):(r[o]=e,r[a]=t)},writable:!0}),t));return r[h]=null,s(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[a];return null!==t&&(r[h]=null,r[o]=null,r[a]=null,t(e)),void(r[c]=e)}var n=r[o];null!==n&&(r[h]=null,r[o]=null,r[a]=null,n(p(void 0,!0))),r[l]=!0})),e.on("readable",g.bind(null,r)),r}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":98,_process:77}],96:[function(e,t,r){function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return(t=a(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var c=e("buffer").Buffer,l=e("util").inspect,h=l&&l.custom||"inspect";t.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r,n;return t=e,(r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return c.alloc(0);for(var t,r,n,i=c.allocUnsafe(e>>>0),s=this.head,o=0;s;)t=s.data,r=i,n=o,c.prototype.copy.call(t,r,n),o+=s.data.length,s=s.next;return i}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,s=e>i.length?i.length:e;if(s===i.length?n+=i:n+=i.slice(0,e),0==(e-=s)){s===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(s));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=c.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,s=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,s),0==(e-=s)){s===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(s));break}++n}return this.length-=n,t}},{key:h,value:function(e,t){return l(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&o(t.prototype,r),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},{buffer:19,util:17}],97:[function(e,t,r){(function(e){(function(){function r(e,t){i(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function i(e,t){e.emit("error",t)}t.exports={destroy:function(t,s){var o=this,a=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return a||c?(s?s(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(i,this,t)):e.nextTick(i,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!s&&t?o._writableState?o._writableState.errorEmitted?e.nextTick(n,o):(o._writableState.errorEmitted=!0,e.nextTick(r,o,t)):e.nextTick(r,o,t):s?(e.nextTick(n,o),s(t)):e.nextTick(n,o)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}}).call(this)}).call(this,e("_process"))},{_process:77}],98:[function(e,t,r){var n=e("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function e(t,r,s){if("function"==typeof r)return e(t,null,r);r||(r={}),s=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(s||i);var o=r.readable||!1!==r.readable&&t.readable,a=r.writable||!1!==r.writable&&t.writable,c=function(){t.writable||h()},l=t._writableState&&t._writableState.finished,h=function(){a=!1,l=!0,o||s.call(t)},u=t._readableState&&t._readableState.endEmitted,f=function(){o=!1,u=!0,a||s.call(t)},p=function(e){s.call(t,e)},d=function(){var e;return o&&!u?(t._readableState&&t._readableState.ended||(e=new n),s.call(t,e)):a&&!l?(t._writableState&&t._writableState.ended||(e=new n),s.call(t,e)):void 0},g=function(){t.req.on("finish",h)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?a&&!t._writableState&&(t.on("end",c),t.on("close",c)):(t.on("complete",h),t.on("abort",d),t.req?g():t.on("request",g)),t.on("end",f),t.on("finish",h),!1!==r.error&&t.on("error",p),t.on("close",d),function(){t.removeListener("complete",h),t.removeListener("abort",d),t.removeListener("request",g),t.req&&t.req.removeListener("finish",h),t.removeListener("end",c),t.removeListener("close",c),t.removeListener("finish",h),t.removeListener("end",f),t.removeListener("error",p),t.removeListener("close",d)}}},{"../../../errors":89}],99:[function(e,t,r){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],100:[function(e,t,r){var n;var i=e("../../../errors").codes,s=i.ERR_MISSING_ARGS,o=i.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function c(e){e()}function l(e,t){return e.pipe(t)}t.exports=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var h,u=function(e){return e.length?"function"!=typeof e[e.length-1]?a:e.pop():a}(r);if(Array.isArray(r[0])&&(r=r[0]),r.length<2)throw new s("streams");var f=r.map((function(t,i){var s=i<r.length-1;return function(t,r,i,s){s=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(s);var a=!1;t.on("close",(function(){a=!0})),void 0===n&&(n=e("./end-of-stream")),n(t,{readable:r,writable:i},(function(e){if(e)return s(e);a=!0,s()}));var c=!1;return function(e){if(!a&&!c)return c=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void s(e||new o("pipe"))}}(t,s,i>0,(function(e){h||(h=e),e&&f.forEach(c),s||(f.forEach(c),u(h))}))}));return r.reduce(l)}},{"../../../errors":89,"./end-of-stream":98}],101:[function(e,t,r){var n=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,r,i){var s=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new n(i?r:"highWaterMark",s);return Math.floor(s)}return e.objectMode?16:16384}}},{"../../../errors":89}],102:[function(e,t,r){t.exports=e("events").EventEmitter},{events:25}],103:[function(e,t,r){(r=t.exports=e("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"),r.finished=e("./lib/internal/streams/end-of-stream.js"),r.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":90,"./lib/_stream_passthrough.js":91,"./lib/_stream_readable.js":92,"./lib/_stream_transform.js":93,"./lib/_stream_writable.js":94,"./lib/internal/streams/end-of-stream.js":98,"./lib/internal/streams/pipeline.js":100}],104:[function(e,t,r){var n=e("safe-buffer").Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=l,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=h,this.end=u,t=3;break;default:return this.write=f,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function h(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function u(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}r.StringDecoder=s,s.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},s.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},s.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=o(t[n]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if(i=o(t[n]),i>=0)return i>0&&(e.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if(i=o(t[n]),i>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},s.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":82}],105:[function(e,t,r){(function(t,n){(function(){var i=e("process/browser.js").nextTick,s=Function.prototype.apply,o=Array.prototype.slice,a={},c=0;function l(e,t){this._id=e,this._clearFn=t}r.setTimeout=function(){return new l(s.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new l(s.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(e){e.close()},l.prototype.unref=l.prototype.ref=function(){},l.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},r.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},r._unrefActive=r.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r.setImmediate="function"==typeof t?t:function(e){var t=c++,n=!(arguments.length<2)&&o.call(arguments,1);return a[t]=!0,i((function(){a[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))})),t},r.clearImmediate="function"==typeof n?n:function(e){delete a[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":77,timers:105}],106:[function(e,t,r){var n=e("punycode"),i=e("./util");function s(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}r.parse=v,r.resolve=function(e,t){return v(e,!1,!0).resolve(t)},r.resolveObject=function(e,t){return e?v(e,!1,!0).resolveObject(t):t},r.format=function(e){i.isString(e)&&(e=v(e));return e instanceof s?e.format():s.prototype.format.call(e)},r.Url=s;var o=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),h=["'"].concat(l),u=["%","/","?",";","#"].concat(h),f=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=e("querystring");function v(e,t,r){if(e&&i.isObject(e)&&e instanceof s)return e;var n=new s;return n.parse(e,t,r),n}s.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var s=e.indexOf("?"),a=-1!==s&&s<e.indexOf("#")?"?":"#",l=e.split(a);l[0]=l[0].replace(/\\/g,"/");var v=e=l.join(a);if(v=v.trim(),!r&&1===e.split("#").length){var w=c.exec(v);if(w)return this.path=v,this.href=v,this.pathname=w[1],w[2]?(this.search=w[2],this.query=t?b.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var S=o.exec(v);if(S){var P=(S=S[0]).toLowerCase();this.protocol=P,v=v.substr(S.length)}if(r||S||v.match(/^\/\/[^@\/]+@[^@\/]+/)){var T="//"===v.substr(0,2);!T||S&&m[S]||(v=v.substr(2),this.slashes=!0)}if(!m[S]&&(T||S&&!y[S])){for(var A,_,E=-1,C=0;C<f.length;C++){-1!==(O=v.indexOf(f[C]))&&(-1===E||O<E)&&(E=O)}-1!==(_=-1===E?v.lastIndexOf("@"):v.lastIndexOf("@",E))&&(A=v.slice(0,_),v=v.slice(_+1),this.auth=decodeURIComponent(A)),E=-1;for(C=0;C<u.length;C++){var O;-1!==(O=v.indexOf(u[C]))&&(-1===E||O<E)&&(E=O)}-1===E&&(E=v.length),this.host=v.slice(0,E),v=v.slice(E),this.parseHost(),this.hostname=this.hostname||"";var M="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!M)for(var D=this.hostname.split(/\./),x=(C=0,D.length);C<x;C++){var R=D[C];if(R&&!R.match(p)){for(var j="",I=0,L=R.length;I<L;I++)R.charCodeAt(I)>127?j+="x":j+=R[I];if(!j.match(p)){var N=D.slice(0,C),B=D.slice(C+1),U=R.match(d);U&&(N.push(U[1]),B.unshift(U[2])),B.length&&(v="/"+B.join(".")+v),this.hostname=N.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),M||(this.hostname=n.toASCII(this.hostname));var k=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+k,this.href+=this.host,M&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==v[0]&&(v="/"+v))}if(!g[P])for(C=0,x=h.length;C<x;C++){var H=h[C];if(-1!==v.indexOf(H)){var V=encodeURIComponent(H);V===H&&(V=escape(H)),v=v.split(H).join(V)}}var W=v.indexOf("#");-1!==W&&(this.hash=v.substr(W),v=v.slice(0,W));var z=v.indexOf("?");if(-1!==z?(this.search=v.substr(z),this.query=v.substr(z+1),t&&(this.query=b.parse(this.query)),v=v.slice(0,z)):t&&(this.search="",this.query={}),v&&(this.pathname=v),y[P]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){k=this.pathname||"";var q=this.search||"";this.path=k+q}return this.href=this.format(),this},s.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",s=!1,o="";this.host?s=e+this.host:this.hostname&&(s=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(s+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(o=b.stringify(this.query));var a=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||y[t])&&!1!==s?(s="//"+(s||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):s||(s=""),n&&"#"!==n.charAt(0)&&(n="#"+n),a&&"?"!==a.charAt(0)&&(a="?"+a),t+s+(r=r.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(a=a.replace("#","%23"))+n},s.prototype.resolve=function(e){return this.resolveObject(v(e,!1,!0)).format()},s.prototype.resolveObject=function(e){if(i.isString(e)){var t=new s;t.parse(e,!1,!0),e=t}for(var r=new s,n=Object.keys(this),o=0;o<n.length;o++){var a=n[o];r[a]=this[a]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var c=Object.keys(e),l=0;l<c.length;l++){var h=c[l];"protocol"!==h&&(r[h]=e[h])}return y[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!y[e.protocol]){for(var u=Object.keys(e),f=0;f<u.length;f++){var p=u[f];r[p]=e[p]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||m[e.protocol])r.pathname=e.pathname;else{for(var d=(e.pathname||"").split("/");d.length&&!(e.host=d.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),r.pathname=d.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var g=r.pathname||"",b=r.search||"";r.path=g+b}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var v=r.pathname&&"/"===r.pathname.charAt(0),w=e.host||e.pathname&&"/"===e.pathname.charAt(0),S=w||v||r.host&&e.pathname,P=S,T=r.pathname&&r.pathname.split("/")||[],A=(d=e.pathname&&e.pathname.split("/")||[],r.protocol&&!y[r.protocol]);if(A&&(r.hostname="",r.port=null,r.host&&(""===T[0]?T[0]=r.host:T.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===d[0]?d[0]=e.host:d.unshift(e.host)),e.host=null),S=S&&(""===d[0]||""===T[0])),w)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,T=d;else if(d.length)T||(T=[]),T.pop(),T=T.concat(d),r.search=e.search,r.query=e.query;else if(!i.isNullOrUndefined(e.search)){if(A)r.hostname=r.host=T.shift(),(M=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=M.shift(),r.host=r.hostname=M.shift());return r.search=e.search,r.query=e.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!T.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var _=T.slice(-1)[0],E=(r.host||e.host||T.length>1)&&("."===_||".."===_)||""===_,C=0,O=T.length;O>=0;O--)"."===(_=T[O])?T.splice(O,1):".."===_?(T.splice(O,1),C++):C&&(T.splice(O,1),C--);if(!S&&!P)for(;C--;C)T.unshift("..");!S||""===T[0]||T[0]&&"/"===T[0].charAt(0)||T.unshift(""),E&&"/"!==T.join("/").substr(-1)&&T.push("");var M,D=""===T[0]||T[0]&&"/"===T[0].charAt(0);A&&(r.hostname=r.host=D?"":T.length?T.shift():"",(M=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=M.shift(),r.host=r.hostname=M.shift()));return(S=S||r.host&&T.length)&&!D&&T.unshift(""),T.length?r.pathname=T.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},s.prototype.parseHost=function(){var e=this.host,t=a.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{"./util":107,punycode:78,querystring:81}],107:[function(e,t,r){t.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},{}],108:[function(e,t,r){(function(e){(function(){function r(t){try{if(!e.localStorage)return!1}catch(e){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],109:[function(e,t,r){t.exports=function e(t,r){if(t&&r)return e(t)(r);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach((function(e){n[e]=t[e]})),n;function n(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];var n=t.apply(this,e),i=e[e.length-1];return"function"==typeof n&&n!==i&&Object.keys(i).forEach((function(e){n[e]=i[e]})),n}}},{}],110:[function(e,t,r){t.exports=function(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var i in r)n.call(r,i)&&(e[i]=r[i])}return e};var n=Object.prototype.hasOwnProperty},{}],111:[function(e,t,r){const n=e("fable").ServiceProviderBase,i="#PICT-CSS";t.exports=class extends n{constructor(e,t,r){super(e,t,r),void 0===this.options.CSSElementAddress&&(this.options.CSSElementAddress=i),this.inlineCSSMap={}}addCSS(e,t,r,n){let i=void 0!==r?r:1e3,s="string"==typeof n?n:"Unknown";this.inlineCSSMap[e]={Hash:e,Content:t,Provider:s,Priority:i}}removeCSS(e){delete this.inlineCSSMap[e]}generateCSS(){let e="",t=Object.keys(this.inlineCSSMap);t.sort(((e,t)=>this.inlineCSSMap[e].Priority-this.inlineCSSMap[t].Priority));for(let r=0;r<t.length;r++){let n=this.inlineCSSMap[t[r]],i=n.Hash;n.Hash!=n.Provider&&(i="".concat(i," from ").concat(n.Provider)),e+="/* ".concat(i," */\n").concat(n.Content,"\n")}return e}injectCSS(){this.services.ContentAssignment.assignContent(this.options.CSSElementAddress,this.generateCSS())}}},{fable:40}],112:[function(e,t,r){const n=e("fable").ServiceProviderBase;t.exports=class extends n{constructor(e,t,r){super(e,t,r),this.serviceType="PictContentAssignment",this.inBrowser=!1,this.hasDocument=!1,"object"==typeof window&&(this.inBrowser=!0,void 0!==window.document&&"function"==typeof window.document.querySelectorAll&&(this.hasDocument=!0)),this.hasJquery=!1,this.jQuery=!1,this.inBrowser&&void 0!==window.jQuery&&(this.hasJquery=!0),this.customAssignFunction=!1,this.customPrependFunction=!1,this.customAppendFunction=!1,this.customReadFunction=!1,this.customGetElementFunction=!1}getElement(e){if(this.customGetElementFunction)return this.customGetElementFunction(e);if(this.hasJquery){let t=window.jQuery(e);if(0==t.length)return[];{let e=[];for(let r=0;r<t.length;r++)e.push(t[0]);return e}}return this.inBrowser&&this.hasDocument?window.document.querySelectorAll(e):(this.log.trace("PICT Content GET ELEMENT for [".concat(e,"] will return empty because none of the browser methods are available")),[])}assignContent(e,t){if(this.customAssignFunction)return this.customAssignFunction(e,t);if(this.hasJquery){window.jQuery(e).html(t)}else if(this.inBrowser&&this.hasDocument){let r=window.document.querySelectorAll(e);for(let e=0;e<r.length;e++)switch(r[e].tagName){case"INPUT":case"BUTTON":case"TEXTAREA":r[e].value=t;break;case"SCRIPT":case"A":r[e].text=t;break;default:r[e].innerHTML=t}}else this.log.trace("PICT Content ASSIGN to [".concat(e,"]:"),t)}appendContent(e,t){if(this.customAppendFunction)return this.customAppendFunction(e,t);if(this.hasJquery){window.jQuery(e).append(t)}else if(this.inBrowser&&this.hasDocument){let r=window.document.querySelectorAll(e);for(let e=0;e<r.length;e++)r[e].insertAdjacentHTML("beforeend",t)}else this.log.trace("PICT Content APPEND to [".concat(e,"]:"),t)}prependContent(e,t){if(this.customAppendFunction)return this.customPrependFunction(e,t);if(this.hasJquery){window.jQuery(e).prepend(t)}else if(this.inBrowser&&this.hasDocument){let r=window.document.querySelectorAll(e);for(let e=0;e<r.length;e++)r[e].insertAdjacentHTML("afterbegin",t)}else this.log.trace("PICT Content PREPEND in [".concat(e,"]:"),t)}readContent(e){if(this.customReadFunction)return this.customReadFunction(e);if(this.hasJquery){return window.jQuery(e).html()}if(!this.inBrowser||!this.hasDocument)return this.log.trace("PICT Content READ from [".concat(e,"]...")),"";{let t=window.document.querySelectorAll(e);if(t.length<1)return null;if(1==t.length)return"INPUT"==t[0].tagName||"TEXTAREA"==t[0].tagName?t[0].value:"SCRIPT"==t[0].tagName?t[0].text:t[0].innerHTML}}addClass(e,t){if(this.customAddClassFunction)return this.customAddClassFunction(e,t);if(this.hasJquery){window.jQuery(e).addClass(t)}else if(this.inBrowser&&this.hasDocument){let r=window.document.querySelectorAll(e);for(let e=0;e<r.length;e++)r[e].classList.add(t)}else this.log.trace("PICT Content ADDCLASS to [".concat(e,"]:"),t)}removeClass(e,t){if(this.customRemoveClassFunction)return this.customRemoveClassFunction(e,t);if(this.hasJquery){window.jQuery(e).removeClass(t)}else if(this.inBrowser&&this.hasDocument){let r=window.document.querySelectorAll(e);for(let e=0;e<r.length;e++)r[e].classList.remove(t)}else this.log.trace("PICT Content REMOVECLASS from [".concat(e,"]:"),t)}toggleClass(e,t){}hasClass(e,t){}}},{fable:40}],113:[function(e,t,r){const n=e("fable").ServiceProviderBase;t.exports=class extends n{constructor(e,t,r){super(e,t,r),this.serviceType="PictDataProvider"}getDataByAddress(e,t){let r=void 0===t?{}:t;return this.fable.manifest.getValueByHash({AppData:this.AppData,Bundle:this.Bundle,Record:r},e)}}},{fable:40}],114:[function(e,t,r){const n=e("fable").ServiceProviderBase;t.exports=class extends n{constructor(e,t,r){super(e,t,r),_defineProperty2(this,"getEntitySet",(function(e,t,r){this.initializeCache(e),this.cache[e].prune((()=>{let n={url:"".concat(this.options.urlPrefix).concat(e,"s/Count/FilteredTo/").concat(t)};return n=this.prepareRequestOptions(n),this.restClient.getJSON(n,((i,s,o)=>{if(i)return this.log.error("Error getting bulk entity count of [".concat(e,"] filtered to [").concat(t,"] from server [").concat(n.url,"]: ").concat(i)),r(i);let a=0;o.Count&&(a=o.Count);let c=[],l=this.options.downloadBatchSize;for(let r=0;r<a/l;r++)c.push("".concat(this.options.urlPrefix).concat(e,"s/FilteredTo/").concat(t,"/").concat(r*l,"/").concat(l));let h=[];this.fable.Utility.eachLimit(c,1,((e,t)=>{let r={url:"".concat(this.options.urlPrefix).concat(e)};r=this.prepareRequestOptions(r),this.restClient.getJSON(e,((e,r,n)=>(h=h.concat(n),t(e))))}),(e=>r(e,h)))}))}))})),this.serviceType="PictMeadowProvider",this.fable.settings.PictDefaultURLPrefix?this.options.urlPrefix=this.fable.settings.PictDefaultURLPrefix:this.options.urlPrefix||(this.options.urlPrefix="/1.0/"),this.fable.settings.PictDefaultDownloadBatchSize?this.options.downloadBatchSize=this.fable.settings.PictDefaultDownloadBatchSize:this.options.downloadBatchSize||(this.options.downloadBatchSize=100),this.restClient=this.fable.serviceManager.instantiateServiceProviderWithoutRegistration("RestClient"),this.cache={},this.prepareRequestOptions=e=>e}initializeCache(e){this.cache.hasOwnProperty(e)||(this.cache[e]=this.fable.serviceManager.instantiateServiceProviderWithoutRegistration("ObjectCache"),this.cache[e].maxAge=3e4,this.cache[e].maxLength=1e4,this.fable.Bundle[e]=this.cache[e].RecordMap)}getEntity(e,t,r){this.initializeCache(e),this.cache[e].prune((()=>{let n=this.cache[e].read(t);if(n)return n;let i={url:"".concat(this.options.urlPrefix).concat(e,"/").concat(t)};return i=this.prepareRequestOptions(i),this.restClient.getJSON(i,((n,i,s)=>(s&&this.cache[e].put(s,t),r(n,s))))}))}}},{fable:40}],115:[function(e,t,r){const n=e("fable").ServiceProviderBase;t.exports=class extends n{constructor(e,t,r){super(e,t,r),this.serviceType="PictTemplateProvider",this.templates={},this.templateSources={},this.defaultTemplates=[],this.loadTemplateFunction=e=>!1}addTemplate(e,t,r){this.templates[e]=t,this.templateSources[e]="string"==typeof r?r:"Direct addTemplate('".concat(e,"') function load into PictTemplateProvider [").concat(this.UUID,"]::[").concat(this.Hash,"]")}addDefaultTemplate(e,t,r,n){let i={prefix:e,postfix:t,template:r,source:"string"==typeof n?n:"Direct addDefaultTemplate('".concat(e,"','").concat(t,"',..) function load into PictTemplateProvider [").concat(this.UUID,"]::[").concat(this.Hash,"]")};"string"!=typeof r&&this.log.error("PictTemplateProvider.addDefaultTemplate: pTemplate is not a string."),this.defaultTemplates.push(i)}checkDefaultTemplateHash(e){for(let t=0;t<this.defaultTemplates.length;t++)if(e.indexOf(this.defaultTemplates[t].postfix)==e.length-this.defaultTemplates[t].postfix.length&&0==e.indexOf(this.defaultTemplates[t].prefix))return this.templates[e]=this.defaultTemplates[t].template,this.templateSources[e]="Auto created in checkDefaultTemplateHash('".concat(e,"') function by PictTemplateProvider [").concat(this.UUID,"]::[").concat(this.Hash,"] from [").concat(this.defaultTemplates[t].prefix,"]...[").concat(this.defaultTemplates[t].postfix,"]"),this.templates[e];return!1}getTemplate(e){return this.templates.hasOwnProperty(e)||this.loadTemplate(e),this.templates.hasOwnProperty(e)||this.checkDefaultTemplateHash(e),!!this.templates.hasOwnProperty(e)&&this.templates[e]}loadTemplate(e){let t=this.loadTemplateFunction(e);return t&&(this.templates[e]=t.template,this.templateSources[e]="Loaded in loadTemplate('".concat(e,"') function by PictTemplateProvider [").concat(this.UUID,"]::[").concat(this.Hash,"] from [").concat(t.source,"]")),t}}},{fable:40}],116:[function(e,t,r){const n=e("fable");t.exports=class extends n{constructor(t){super(t),this.isBrowser=new Function("try {return (this===window);} catch(pError) {return false;}"),this.serviceManager.addAndInstantiateServiceType("TemplateProvider",e("./Pict-Template-Provider.js")),this.serviceManager.addAndInstantiateServiceType("EntityProvider",e("./Pict-Meadow-EntityProvider.js")),this.serviceManager.addAndInstantiateServiceType("DataProvider",e("./Pict-DataProvider.js")),this.serviceManager.addAndInstantiateServiceType("ContentAssignment",e("./Pict-Content-Assignment.js")),this.serviceManager.addAndInstantiateServiceType("CSSMap",e("./Pict-CSS.js")),this.serviceManager.instantiateServiceProvider("MetaTemplate"),this.serviceManager.instantiateServiceProvider("DataGeneration"),this.manifest=this.serviceManager.instantiateServiceProvider("Manifest"),this.AppData={},this.Bundle={},this.LogNoisiness=0,this.settings.Manifests&&this.loadManifestSet(this.settings.Manifests),this._DefaultPictTemplatesInitialized=!1,this.initializePictTemplateEngine(),this.serviceManager.addServiceType("PictView",e("pict-view")),this.serviceManager.addServiceType("PictApplication",e("pict-application")),this.views=this.serviceManager.servicesMap.PictView}loadManifestSet(e){if("object"!=typeof e)return this.log.warn("PICT [".concat(this.UUID,"] could not load Manifest Set; pManifestSet was not an object.")),!1;let t=Object.keys(e);if(t.length>0)for(let r=0;r<t.length;r++){let n=t[r];this.serviceManager.instantiateServiceProvider("Manifest",e[n],n)}}addView(e,t,r){let n="object"==typeof t?t:{},i="string"==typeof e?e:this.fable.getUUID();return void 0!==r?(r.hasOwnProperty("default_configuration")&&(n=this.fable.Utility.extend({},r.default_configuration,n)),this.serviceManager.instantiateServiceProviderFromPrototype("PictView",n,i,r)):this.serviceManager.instantiateServiceProvider("PictView",n,i)}addApplication(e,t,r){let n="object"==typeof t?t:{},i="string"==typeof e?e:this.fable.getUUID();return void 0!==r?(r.hasOwnProperty("default_configuration")&&(n=this.fable.Utility.extend({},r.default_configuration,n)),this.serviceManager.instantiateServiceProviderFromPrototype("PictApplication",n,i,r)):this.serviceManager.instantiateServiceProvider("PictApplication",n,i)}initializePictTemplateEngine(){if(!this._DefaultPictTemplatesInitialized){let e=(e,t,r)=>{let n=e.trim(),i="object"==typeof t?t:{};this.LogNoisiness>4?this.log.trace("PICT Template [fEntityRender]::[".concat(n,"] with tmpData:"),i):this.LogNoisiness>0&&this.log.trace("PICT Template [fEntityRender]::[".concat(n,"]"));let s=!1,o=!1,a=!1;if(n.indexOf("|")<0){let e=n.indexOf(":");s=n.substring(0,e),o=n.substring(e+1)}else{let e=n.indexOf(":");s=n.substring(0,e);let t=n.indexOf("|");o=n.substring(e+1,t),a=n.substring(t+1)}if(o=isNaN(o)?this.manifest.getValueByHash({AppData:this.AppData,Bundle:this.Bundle,Record:i},o):parseInt(o),!s||!o)return this.log.warn("Pict: Entity Render: Entity or entity ID not resolved for [".concat(n,"]")),r(Error("Pict: Entity Render: Entity or entity ID not resolved for [".concat(n,"]")),"");this.EntityProvider.getEntity(s,o,((e,t)=>e?(this.log.error("Pict: Entity Render: Error getting entity [".concat(s,"] with ID [").concat(o,"] for [").concat(n,"]: ").concat(e),e),r(e,"")):r(null,a?this.parseTemplateByHash(a,t):"")))};this.MetaTemplate.addPatternAsync("{~E:","~}",e),this.MetaTemplate.addPatternAsync("{~Entity:","~}",e);let t=(e,t)=>{let r=e.trim(),n="object"==typeof t?t:{};this.LogNoisiness>4?this.log.trace("PICT Template [fNotEmptyRender]::[".concat(r,"] with tmpData:"),n):this.LogNoisiness>2&&this.log.trace("PICT Template [fNotEmptyRender]::[".concat(r,"]"));let i=r.split("|");return this.manifest.getValueByHash({AppData:this.AppData,Bundle:this.Bundle,Record:n},i[0])?i[1]:""};this.MetaTemplate.addPattern("{~NotEmpty:","~}",t),this.MetaTemplate.addPattern("{~NE:","~}",t);let r=(e,t)=>{let r=e.trim(),n="object"==typeof t?t:{};this.LogNoisiness>4?this.log.trace("PICT Template [fTemplateRender]::[".concat(r,"] with tmpData:"),n):this.LogNoisiness>0&&this.log.trace("PICT Template [fTemplateRender]::[".concat(r,"]"));let i=!1,s=!1,o=r.indexOf(":");return i=r.substring(0,o),o>-1?s=r.substring(o+1):i=r,i?s?this.parseTemplateByHash(i,this.manifest.getValueByHash({AppData:this.AppData,Bundle:this.Bundle,Record:n},s)):this.parseTemplateByHash(i,t):(this.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(r,"]")),"Pict: Template Render: TemplateHash not resolved for [".concat(r,"]"))};this.MetaTemplate.addPattern("{~T:","~}",r),this.MetaTemplate.addPattern("{~Template:","~}",r);let n=(e,t)=>{let r=e.trim(),n="object"==typeof t?t:{};this.LogNoisiness>4?this.log.trace("PICT Template [fTemplateSetRender]::[".concat(r,"] with tmpData:"),n):this.LogNoisiness>0&&this.log.trace("PICT Template [fTemplateSetRender]::[".concat(r,"]"));let i=!1,s=!1,o=r.indexOf(":");return i=r.substring(0,o),o>-1?s=r.substring(o+1):i=r,i?s?this.parseTemplateSetByHash(i,this.manifest.getValueByHash({AppData:this.AppData,Bundle:this.Bundle,Record:n},s)):this.parseTemplateSetByHash(i,t):(this.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(r,"]")),"Pict: Template Render: TemplateHash not resolved for [".concat(r,"]"))};this.MetaTemplate.addPattern("{~TS:","~}",n),this.MetaTemplate.addPattern("{~TemplateSet:","~}",n);let i=(e,t)=>{let r=e.trim(),n="object"==typeof t?t:{};this.LogNoisiness>4?this.log.trace("PICT Template [fDataRender]::[".concat(r,"] with tmpData:"),n):this.LogNoisiness>3&&this.log.trace("PICT Template [fDataRender]::[".concat(r,"]"));let i=this.manifest.getValueByHash({AppData:this.AppData,Bundle:this.Bundle,Record:n},r);return null==i||"undefined"==i||void 0===i?"":i};this.MetaTemplate.addPattern("{~D:","~}",i),this.MetaTemplate.addPattern("{~Data:","~}",i),this.MetaTemplate.addPattern("{~Dollars:","~}",((e,t)=>{let r=e.trim(),n="object"==typeof t?t:{};this.LogNoisiness>4?this.log.trace("PICT Template [fDollars]::[".concat(r,"] with tmpData:"),n):this.LogNoisiness>3&&this.log.trace("PICT Template [fDollars]::[".concat(r,"]"));let i=this.manifest.getValueByHash({AppData:this.AppData,Bundle:this.Bundle,Record:n},r);return this.DataFormat.formatterDollars(i)})),this.MetaTemplate.addPattern("{~Digits:","~}",((e,t)=>{let r=e.trim(),n="object"==typeof t?t:{};this.LogNoisiness>4?this.log.trace("PICT Template [fDigits]::[".concat(r,"] with tmpData:"),n):this.LogNoisiness>3&&this.log.trace("PICT Template [fDigits]::[".concat(r,"]"));let i=this.manifest.getValueByHash({AppData:this.AppData,Bundle:this.Bundle,Record:n},r);return this.DataFormat.formatterAddCommasToNumber(this.DataFormat.formatterRoundNumber(i,2))}));let s=(e,t)=>{let r=e.trim();this.LogNoisiness>3&&this.log.trace("PICT Template [fRandomNumberString]::[".concat(r,"]"));let n=4,i=9999;if(r.length>0){let e=r.split(",");e.length>0&&(n=parseInt(e[0])),e.length>1&&(i=parseInt(e[1]))}return this.DataGeneration.randomNumericString(n,i)};this.MetaTemplate.addPattern("{~RandomNumberString:","~}",s),this.MetaTemplate.addPattern("{~RNS:","~}",s);let o=(e,t)=>{let r=e.trim();this.LogNoisiness>3&&this.log.trace("PICT Template [fRandomNumber]::[".concat(r,"]"));let n=0,i=9999999;if(r.length>0){let e=r.split(",");e.length>0&&(n=parseInt(e[0])),e.length>1&&(i=parseInt(e[1]))}return this.DataGeneration.randomIntegerBetween(n,i)};this.MetaTemplate.addPattern("{~RandomNumber:","~}",o),this.MetaTemplate.addPattern("{~RN:","~}",o);let a=(e,t)=>{let r=e.trim(),n="object"==typeof t?t:{};this.LogNoisiness>4?this.log.trace("PICT Template [fPascalCaseIdentifier]::[".concat(r,"] with tmpData:"),n):this.LogNoisiness>3&&this.log.trace("PICT Template [fPascalCaseIdentifier]::[".concat(r,"]"));let i=this.manifest.getValueByHash({AppData:this.AppData,Bundle:this.Bundle,Record:n},r);return null==i||"undefined"==i||void 0===i?"":this.DataFormat.cleanNonAlphaCharacters(this.DataFormat.capitalizeEachWord(i))};this.MetaTemplate.addPattern("{~PascalCaseIdentifier:","~}",a);let c=(e,t)=>{let r=e.trim(),n="object"==typeof t?t:{},i=this.manifest.getValueByHash({AppData:this.AppData,Bundle:this.Bundle,Record:n},r),s=typeof i;return null==i||"undefined"==s?this.log.trace("PICT Template Log Value: [".concat(r,"] is ").concat(s,".")):"object"==s?this.log.trace("PICT Template Log Value: [".concat(r,"] is an obect."),i):this.log.trace("PICT Template Log Value: [".concat(r,"] if a ").concat(s," = [").concat(i,"]")),""};this.MetaTemplate.addPattern("{~LogValue:","~}",c),this.MetaTemplate.addPattern("{~LV:","~}",c);let l=(e,t)=>{let r=e.trim();return this.log.trace("PICT Template Log Message: ".concat(r)),""};this.MetaTemplate.addPattern("{~LogStatement:","~}",l),this.MetaTemplate.addPattern("{~LS:","~}",l);let h=(e,t)=>{let r=e.trim(),n=new Error("PICT Template Breakpoint: ".concat(r));return this.log.trace("PICT Template Breakpoint: ".concat(r),n.stack),""};this.MetaTemplate.addPattern("{~Breakpoint","~}",h),this._DefaultPictTemplatesInitialized=!0}}parseTemplate(e,t,r){let n="object"==typeof t?t:{};return this.MetaTemplate.parseString(e,n,r)}parseTemplateByHash(e,t,r){let n=this.TemplateProvider.getTemplate(e);return n?this.parseTemplate(n,t,r):""}parseTemplateSet(e,t,r){let n="";if("function"!=typeof r){if(Array.isArray(t)||"object"==typeof t){if(Array.isArray(t))for(let r=0;r<t.length;r++)n+=this.parseTemplate(e,t[r]);else{let r=Object.keys(t);for(let i=0;i<r.length;i++)n+=this.parseTemplate(e,t[r[i]])}return n}return""}if(!Array.isArray(t)&&"object"!=typeof t)return r(Error("Pict: Template Set: pDataSet is not an array or object."),"");this.Utility.eachLimit(t,1,((t,r)=>this.parseTemplate(e,t,((e,t)=>(n+=t,r())))),(e=>r(e,n)))}parseTemplateSetByHash(e,t,r){let n=this.TemplateProvider.getTemplate(e);return n?this.parseTemplateSet(n,t,r):""}},t.exports.PictApplicationClass=e("pict-application"),t.exports.PictViewClass=e("pict-view"),t.exports.EnvironmentLog=e("./environments/Pict-Environment-Log.js"),t.exports.isBrowser=new Function("try {return (this===window);} catch(pError) {return false;}")},{"./Pict-CSS.js":111,"./Pict-Content-Assignment.js":112,"./Pict-DataProvider.js":113,"./Pict-Meadow-EntityProvider.js":114,"./Pict-Template-Provider.js":115,"./environments/Pict-Environment-Log.js":117,fable:40,"pict-application":72,"pict-view":73}],117:[function(e,t,r){t.exports=class{constructor(e,t){this.contentMap="object"==typeof t?t:{},this.pict=e,this.truncateContentLength=256,this.storeEventLog=!0,this.eventLog={},this.eventLog.GetElement=[],this.eventLog.Read=[],this.eventLog.Prepend=[],this.eventLog.Append=[],this.eventLog.Assign=[],this.pict.ContentAssignment.customGetElementFunction=this.customGetElementFunction.bind(this),this.pict.ContentAssignment.customReadFunction=this.customReadFunction.bind(this),this.pict.ContentAssignment.customAppendFunction=this.customAppendFunction.bind(this),this.pict.ContentAssignment.customPrependFunction=this.customPrependFunction.bind(this),this.pict.ContentAssignment.customAssignFunction=this.customAssignFunction.bind(this)}createEventLogEntry(e,t){let r=void 0===t?"":t;return{TimeStamp:this.pict.log.getTimeStamp(),Hash:e,Content:r}}customGetElementFunction(e){return this.storeEventLog&&this.eventLog.GetElement.push(this.createEventLogEntry(e)),this.pict.log.info("Mocking an GET of Address -> [".concat(e,"]")),""}customReadFunction(e){return this.storeEventLog&&this.eventLog.Read.push(this.createEventLogEntry(e)),this.pict.log.info("Mocking an READ from Address -> [".concat(e,"]")),this.contentMap.hasOwnProperty(e)?this.contentMap[e]:(this.pict.log.warn("Mock read from Address ".concat(e," did not find a value in the content map.")),"")}customAppendFunction(e,t){return this.storeEventLog&&this.eventLog.Append.push(this.createEventLogEntry(e,t)),t.length>this.truncateContentLength?this.pict.log.info("Mocking an APPEND to Address -> [".concat(e,"] (log truncated to first ").concat(this.truncateContentLength," characters)"),{Content:t.substring(0,this.truncateContentLength)}):this.pict.log.info("Mocking an APPEND to Address -> [".concat(e,"]"),{Content:t}),""}customPrependFunction(e,t){return this.storeEventLog&&this.eventLog.Prepend.push(this.createEventLogEntry(e,t)),t.length>this.truncateContentLength?this.pict.log.info("Mocking an PREPEND to Address -> [".concat(e,"] (log truncated to first ").concat(this.truncateContentLength," characters)"),{Content:t.substring(0,this.truncateContentLength)}):this.pict.log.info("Mocking an PREPEND to Address -> [".concat(e,"]"),{Content:t}),""}customAssignFunction(e,t){return this.storeEventLog&&this.eventLog.Assign.push(this.createEventLogEntry(e,t)),t.length>this.truncateContentLength?this.pict.log.info("Mocking an ASSIGN to Address -> [".concat(e,"] (log truncated to first ").concat(this.truncateContentLength," characters)"),{Content:t.substring(0,this.truncateContentLength)}):this.pict.log.info("Mocking an ASSIGN to Address -> [".concat(e,"]"),{Content:t}),""}}},{}]},{},[116])(116)}));
|
|
11
|
+
var n=t("./WordTree.js"),i=t("./StringParser.js");e.exports=class{constructor(){this.WordTree=new n,this.StringParser=new i,this.ParseTree=this.WordTree.ParseTree}addPattern(t,e,r){return this.WordTree.addPattern(t,e,r)}parseString(t,e){return this.StringParser.parseString(t,this.ParseTree,e)}}},{"./StringParser.js":76,"./WordTree.js":77}],76:[function(t,e,r){e.exports=class{constructor(){}newParserState(t){return{ParseTree:t,Asynchronous:!1,Output:"",OutputBuffer:"",Pattern:{},PatternMatch:!1,PatternMatchEnd:!1}}appendOutputBuffer(t,e){e.OutputBuffer+=t}flushOutputBuffer(t){t.Output+=t.OutputBuffer,t.OutputBuffer=""}resetOutputBuffer(t){return this.flushOutputBuffer(t),t.Pattern=!1,t.PatternStartNode=!1,t.StartPatternMatchComplete=!1,t.EndPatternMatchBegan=!1,t.PatternMatch=!1,!0}parseCharacter(t,e,r){if(e.PatternMatch)if(!e.StartPatternMatchComplete&&e.Pattern.hasOwnProperty(t))e.Pattern=e.Pattern[t],this.appendOutputBuffer(t,e);else if(e.EndPatternMatchBegan)if(e.Pattern.PatternEnd.hasOwnProperty(t)){if(e.Pattern=e.Pattern.PatternEnd[t],this.appendOutputBuffer(t,e),e.Pattern.hasOwnProperty("Parse"))return e.OutputBuffer=e.Pattern.Parse(e.OutputBuffer.substr(e.Pattern.PatternStartString.length,e.OutputBuffer.length-(e.Pattern.PatternStartString.length+e.Pattern.PatternEndString.length)),r),this.resetOutputBuffer(e)}else e.PatternStartNode.PatternEnd.hasOwnProperty(t)?(e.Pattern=e.PatternStartNode.PatternEnd[t],this.appendOutputBuffer(t,e)):(e.EndPatternMatchBegan=!1,this.appendOutputBuffer(t,e));else if(e.Pattern.hasOwnProperty("PatternEnd")){if(e.StartPatternMatchComplete||(e.StartPatternMatchComplete=!0,e.PatternStartNode=e.Pattern),this.appendOutputBuffer(t,e),e.Pattern.PatternEnd.hasOwnProperty(t)&&(e.EndPatternMatchBegan=!0,e.Pattern=e.Pattern.PatternEnd[t],e.Pattern.hasOwnProperty("Parse")))return e.OutputBuffer=e.Pattern.Parse(e.OutputBuffer.substr(e.Pattern.PatternStartString.length,e.OutputBuffer.length-(e.Pattern.PatternStartString.length+e.Pattern.PatternEndString.length)),r),this.resetOutputBuffer(e)}else this.resetOutputBuffer(e);if(!e.PatternMatch){if(e.ParseTree.hasOwnProperty(t))return this.resetOutputBuffer(e),this.appendOutputBuffer(t,e),e.Pattern=e.ParseTree[t],e.PatternMatch=!0,!0;this.appendOutputBuffer(t,e)}return!1}parseString(t,e,r){let n=this.newParserState(e);for(var i=0;i<t.length;i++)this.parseCharacter(t[i],n,r);return this.flushOutputBuffer(n),n.Output}}},{}],77:[function(t,e,r){e.exports=class{constructor(){this.ParseTree={}}addChild(t,e){return t.hasOwnProperty(e)||(t[e]={}),t[e]}addEndChild(t,e){return t.hasOwnProperty("PatternEnd")||(t.PatternEnd={}),t.PatternEnd[e]={},t.PatternEnd[e]}addPattern(t,e,r){if(t.length<1)return!1;if("string"==typeof e&&e.length<1)return!1;let n=this.ParseTree;for(var i=0;i<t.length;i++)n=this.addChild(n,t[i],i);n.hasOwnProperty("PatternEnd")||(n.PatternEnd={});let s="string"==typeof e?e:t;for(let t=0;t<s.length;t++)n=this.addEndChild(n,s[t],t);return n.PatternStartString=t,n.PatternEndString=s,n.Parse="function"==typeof r?r:"string"==typeof r?()=>r:t=>t,!0}}},{}],78:[function(t,e,r){var n,i,s=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function l(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(t){i=a}}();var c,h=[],u=!1,f=-1;function p(){u&&c&&(u=!1,c.length?h=c.concat(h):f=-1,h.length&&d())}function d(){if(!u){var t=l(p);u=!0;for(var e=h.length;e;){for(c=h,h=[];++f<e;)c&&c[f].run();f=-1,e=h.length}c=null,u=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{return i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function g(t,e){this.fun=t,this.array=e}function m(){}s.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];h.push(new g(t,e)),1!==h.length||u||l(d)},g.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=m,s.addListener=m,s.once=m,s.off=m,s.removeListener=m,s.removeAllListeners=m,s.emit=m,s.prependListener=m,s.prependOnceListener=m,s.listeners=function(t){return[]},s.binding=function(t){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(t){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},{}],79:[function(t,e,r){(function(t){(function(){!function(n){var i="object"==typeof r&&r&&!r.nodeType&&r,s="object"==typeof e&&e&&!e.nodeType&&e,o="object"==typeof t&&t;o.global!==o&&o.window!==o&&o.self!==o||(n=o);var a,l,c=2147483647,h=36,u=1,f=26,p=38,d=700,g=72,m=128,y="-",b=/^xn--/,v=/[^\x20-\x7E]/,w=/[\x2E\u3002\uFF0E\uFF61]/g,S={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},P=h-u,T=Math.floor,A=String.fromCharCode;function _(t){throw new RangeError(S[t])}function E(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function O(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+E((t=t.replace(w,".")).split("."),e).join(".")}function C(t){for(var e,r,n=[],i=0,s=t.length;i<s;)(e=t.charCodeAt(i++))>=55296&&e<=56319&&i<s?56320==(64512&(r=t.charCodeAt(i++)))?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--):n.push(e);return n}function M(t){return E(t,(function(t){var e="";return t>65535&&(e+=A((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=A(t)})).join("")}function R(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function x(t,e,r){var n=0;for(t=r?T(t/d):t>>1,t+=T(t/e);t>P*f>>1;n+=h)t=T(t/P);return T(n+(P+1)*t/(t+p))}function D(t){var e,r,n,i,s,o,a,l,p,d,b,v=[],w=t.length,S=0,P=m,A=g;for((r=t.lastIndexOf(y))<0&&(r=0),n=0;n<r;++n)t.charCodeAt(n)>=128&&_("not-basic"),v.push(t.charCodeAt(n));for(i=r>0?r+1:0;i<w;){for(s=S,o=1,a=h;i>=w&&_("invalid-input"),((l=(b=t.charCodeAt(i++))-48<10?b-22:b-65<26?b-65:b-97<26?b-97:h)>=h||l>T((c-S)/o))&&_("overflow"),S+=l*o,!(l<(p=a<=A?u:a>=A+f?f:a-A));a+=h)o>T(c/(d=h-p))&&_("overflow"),o*=d;A=x(S-s,e=v.length+1,0==s),T(S/e)>c-P&&_("overflow"),P+=T(S/e),S%=e,v.splice(S++,0,P)}return M(v)}function j(t){var e,r,n,i,s,o,a,l,p,d,b,v,w,S,P,E=[];for(v=(t=C(t)).length,e=m,r=0,s=g,o=0;o<v;++o)(b=t[o])<128&&E.push(A(b));for(n=i=E.length,i&&E.push(y);n<v;){for(a=c,o=0;o<v;++o)(b=t[o])>=e&&b<a&&(a=b);for(a-e>T((c-r)/(w=n+1))&&_("overflow"),r+=(a-e)*w,e=a,o=0;o<v;++o)if((b=t[o])<e&&++r>c&&_("overflow"),b==e){for(l=r,p=h;!(l<(d=p<=s?u:p>=s+f?f:p-s));p+=h)P=l-d,S=h-d,E.push(A(R(d+P%S,0))),l=T(P/S);E.push(A(R(l,0))),s=x(r,w,n==i),r=0,++n}++r,++e}return E.join("")}if(a={version:"1.4.1",ucs2:{decode:C,encode:M},decode:D,encode:j,toASCII:function(t){return O(t,(function(t){return v.test(t)?"xn--"+j(t):t}))},toUnicode:function(t){return O(t,(function(t){return b.test(t)?D(t.slice(4).toLowerCase()):t}))}},i&&s)if(e.exports==i)s.exports=a;else for(l in a)a.hasOwnProperty(l)&&(i[l]=a[l]);else n.punycode=a}(this)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],80:[function(t,e,r){function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,s){e=e||"&",r=r||"=";var o={};if("string"!=typeof t||0===t.length)return o;var a=/\+/g;t=t.split(e);var l=1e3;s&&"number"==typeof s.maxKeys&&(l=s.maxKeys);var c=t.length;l>0&&c>l&&(c=l);for(var h=0;h<c;++h){var u,f,p,d,g=t[h].replace(a,"%20"),m=g.indexOf(r);m>=0?(u=g.substr(0,m),f=g.substr(m+1)):(u=g,f=""),p=decodeURIComponent(u),d=decodeURIComponent(f),n(o,p)?i(o[p])?o[p].push(d):o[p]=[o[p],d]:o[p]=d}return o};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],81:[function(t,e,r){var n=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};e.exports=function(t,e,r,a){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?s(o(t),(function(o){var a=encodeURIComponent(n(o))+r;return i(t[o])?s(t[o],(function(t){return a+encodeURIComponent(n(t))})).join(e):a+encodeURIComponent(n(t[o]))})).join(e):a?encodeURIComponent(n(a))+r+encodeURIComponent(n(t)):""};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function s(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n<t.length;n++)r.push(e(t[n],n));return r}var o=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}},{}],82:[function(t,e,r){r.decode=r.parse=t("./decode"),r.encode=r.stringify=t("./encode")},{"./decode":80,"./encode":81}],83:[function(t,e,r){/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var n=t("buffer"),i=n.Buffer;function s(t,e){for(var r in t)e[r]=t[r]}function o(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(s(n,r),r.Buffer=o),o.prototype=Object.create(i.prototype),s(i,o),o.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},o.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},o.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},o.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},{buffer:19}],84:[function(t,e,r){(function(t){(function(){/*! simple-concat. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */e.exports=function(e,r){var n=[];e.on("data",(function(t){n.push(t)})),e.once("end",(function(){r&&r(null,t.concat(n)),r=null})),e.once("error",(function(t){r&&r(t),r=null}))}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:19}],85:[function(t,e,r){(function(r){(function(){/*! simple-get. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */e.exports=u;const n=t("simple-concat"),i=t("decompress-response"),s=t("http"),o=t("https"),a=t("once"),l=t("querystring"),c=t("url"),h=t=>null!==t&&"object"==typeof t&&"function"==typeof t.pipe;function u(t,e){if(t=Object.assign({maxRedirects:10},"string"==typeof t?{url:t}:t),e=a(e),t.url){const{hostname:e,port:r,protocol:n,auth:i,path:s}=c.parse(t.url);delete t.url,e||r||n||i?Object.assign(t,{hostname:e,port:r,protocol:n,auth:i,path:s}):t.path=s}const n={"accept-encoding":"gzip, deflate"};let f;t.headers&&Object.keys(t.headers).forEach((e=>n[e.toLowerCase()]=t.headers[e])),t.headers=n,t.body?f=t.json&&!h(t.body)?JSON.stringify(t.body):t.body:t.form&&(f="string"==typeof t.form?t.form:l.stringify(t.form),t.headers["content-type"]="application/x-www-form-urlencoded"),f&&(t.method||(t.method="POST"),h(f)||(t.headers["content-length"]=r.byteLength(f)),t.json&&!t.form&&(t.headers["content-type"]="application/json")),delete t.body,delete t.form,t.json&&(t.headers.accept="application/json"),t.method&&(t.method=t.method.toUpperCase());const p=t.hostname,d=("https:"===t.protocol?o:s).request(t,(r=>{if(!1!==t.followRedirects&&r.statusCode>=300&&r.statusCode<400&&r.headers.location){t.url=r.headers.location,delete t.headers.host,r.resume();const n=c.parse(t.url).hostname;return null!==n&&n!==p&&(delete t.headers.cookie,delete t.headers.authorization),"POST"===t.method&&[301,302].includes(r.statusCode)&&(t.method="GET",delete t.headers["content-length"],delete t.headers["content-type"]),0==t.maxRedirects--?e(new Error("too many redirects")):u(t,e)}const n="function"==typeof i&&"HEAD"!==t.method;e(null,n?i(r):r)}));return d.on("timeout",(()=>{d.abort(),e(new Error("Request timed out"))})),d.on("error",e),h(f)?f.on("error",e).pipe(d):d.end(f),d}u.concat=(t,e)=>u(t,((r,i)=>{if(r)return e(r);n(i,((r,n)=>{if(r)return e(r);if(t.json)try{n=JSON.parse(n.toString())}catch(r){return e(r,i,n)}e(null,i,n)}))})),["get","post","put","patch","head","delete"].forEach((t=>{u[t]=(e,r)=>("string"==typeof e&&(e={url:e}),u(Object.assign({method:t.toUpperCase()},e),r))}))}).call(this)}).call(this,t("buffer").Buffer)},{buffer:19,"decompress-response":17,http:86,https:56,once:71,querystring:82,"simple-concat":84,url:107}],86:[function(t,e,r){(function(e){(function(){var n=t("./lib/request"),i=t("./lib/response"),s=t("xtend"),o=t("builtin-status-codes"),a=t("url"),l=r;l.request=function(t,r){t="string"==typeof t?a.parse(t):s(t);var i=-1===e.location.protocol.search(/^https?:$/)?"http:":"",o=t.protocol||i,l=t.hostname||t.host,c=t.port,h=t.path||"/";l&&-1!==l.indexOf(":")&&(l="["+l+"]"),t.url=(l?o+"//"+l:"")+(c?":"+c:"")+h,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var u=new n(t);return r&&u.on("response",r),u},l.get=function(t,e){var r=l.request(t,e);return r.end(),r},l.ClientRequest=n,l.IncomingMessage=i.IncomingMessage,l.Agent=function(){},l.Agent.defaultMaxSockets=4,l.globalAgent=new l.Agent,l.STATUS_CODES=o,l.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/request":88,"./lib/response":89,"builtin-status-codes":20,url:107,xtend:111}],87:[function(t,e,r){(function(t){(function(){var e;function n(){if(void 0!==e)return e;if(t.XMLHttpRequest){e=new t.XMLHttpRequest;try{e.open("GET",t.XDomainRequest?"/":"https://example.com")}catch(t){e=null}}else e=null;return e}function i(t){var e=n();if(!e)return!1;try{return e.responseType=t,e.responseType===t}catch(t){}return!1}function s(t){return"function"==typeof t}r.fetch=s(t.fetch)&&s(t.ReadableStream),r.writableStream=s(t.WritableStream),r.abortController=s(t.AbortController),r.arraybuffer=r.fetch||i("arraybuffer"),r.msstream=!r.fetch&&i("ms-stream"),r.mozchunkedarraybuffer=!r.fetch&&i("moz-chunked-arraybuffer"),r.overrideMimeType=r.fetch||!!n()&&s(n().overrideMimeType),e=null}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],88:[function(t,e,r){(function(r,n,i){(function(){var s=t("./capability"),o=t("inherits"),a=t("./response"),l=t("readable-stream"),c=a.IncomingMessage,h=a.readyStates;var u=e.exports=function(t){var e,r=this;l.Writable.call(r),r._opts=t,r._body=[],r._headers={},t.auth&&r.setHeader("Authorization","Basic "+i.from(t.auth).toString("base64")),Object.keys(t.headers).forEach((function(e){r.setHeader(e,t.headers[e])}));var n=!0;if("disable-fetch"===t.mode||"requestTimeout"in t&&!s.abortController)n=!1,e=!0;else if("prefer-streaming"===t.mode)e=!1;else if("allow-wrong-content-type"===t.mode)e=!s.overrideMimeType;else{if(t.mode&&"default"!==t.mode&&"prefer-fast"!==t.mode)throw new Error("Invalid value for opts.mode");e=!0}r._mode=function(t,e){return s.fetch&&e?"fetch":s.mozchunkedarraybuffer?"moz-chunked-arraybuffer":s.msstream?"ms-stream":s.arraybuffer&&t?"arraybuffer":"text"}(e,n),r._fetchTimer=null,r._socketTimeout=null,r._socketTimer=null,r.on("finish",(function(){r._onFinish()}))};o(u,l.Writable),u.prototype.setHeader=function(t,e){var r=t.toLowerCase();-1===f.indexOf(r)&&(this._headers[r]={name:t,value:e})},u.prototype.getHeader=function(t){var e=this._headers[t.toLowerCase()];return e?e.value:null},u.prototype.removeHeader=function(t){delete this._headers[t.toLowerCase()]},u.prototype._onFinish=function(){var t=this;if(!t._destroyed){var e=t._opts;"timeout"in e&&0!==e.timeout&&t.setTimeout(e.timeout);var i=t._headers,o=null;"GET"!==e.method&&"HEAD"!==e.method&&(o=new Blob(t._body,{type:(i["content-type"]||{}).value||""}));var a=[];if(Object.keys(i).forEach((function(t){var e=i[t].name,r=i[t].value;Array.isArray(r)?r.forEach((function(t){a.push([e,t])})):a.push([e,r])})),"fetch"===t._mode){var l=null;if(s.abortController){var c=new AbortController;l=c.signal,t._fetchAbortController=c,"requestTimeout"in e&&0!==e.requestTimeout&&(t._fetchTimer=n.setTimeout((function(){t.emit("requestTimeout"),t._fetchAbortController&&t._fetchAbortController.abort()}),e.requestTimeout))}n.fetch(t._opts.url,{method:t._opts.method,headers:a,body:o||void 0,mode:"cors",credentials:e.withCredentials?"include":"same-origin",signal:l}).then((function(e){t._fetchResponse=e,t._resetTimers(!1),t._connect()}),(function(e){t._resetTimers(!0),t._destroyed||t.emit("error",e)}))}else{var u=t._xhr=new n.XMLHttpRequest;try{u.open(t._opts.method,t._opts.url,!0)}catch(e){return void r.nextTick((function(){t.emit("error",e)}))}"responseType"in u&&(u.responseType=t._mode),"withCredentials"in u&&(u.withCredentials=!!e.withCredentials),"text"===t._mode&&"overrideMimeType"in u&&u.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in e&&(u.timeout=e.requestTimeout,u.ontimeout=function(){t.emit("requestTimeout")}),a.forEach((function(t){u.setRequestHeader(t[0],t[1])})),t._response=null,u.onreadystatechange=function(){switch(u.readyState){case h.LOADING:case h.DONE:t._onXHRProgress()}},"moz-chunked-arraybuffer"===t._mode&&(u.onprogress=function(){t._onXHRProgress()}),u.onerror=function(){t._destroyed||(t._resetTimers(!0),t.emit("error",new Error("XHR error")))};try{u.send(o)}catch(e){return void r.nextTick((function(){t.emit("error",e)}))}}}},u.prototype._onXHRProgress=function(){var t=this;t._resetTimers(!1),function(t){try{var e=t.status;return null!==e&&0!==e}catch(t){return!1}}(t._xhr)&&!t._destroyed&&(t._response||t._connect(),t._response._onXHRProgress(t._resetTimers.bind(t)))},u.prototype._connect=function(){var t=this;t._destroyed||(t._response=new c(t._xhr,t._fetchResponse,t._mode,t._resetTimers.bind(t)),t._response.on("error",(function(e){t.emit("error",e)})),t.emit("response",t._response))},u.prototype._write=function(t,e,r){this._body.push(t),r()},u.prototype._resetTimers=function(t){var e=this;n.clearTimeout(e._socketTimer),e._socketTimer=null,t?(n.clearTimeout(e._fetchTimer),e._fetchTimer=null):e._socketTimeout&&(e._socketTimer=n.setTimeout((function(){e.emit("timeout")}),e._socketTimeout))},u.prototype.abort=u.prototype.destroy=function(t){var e=this;e._destroyed=!0,e._resetTimers(!0),e._response&&(e._response._destroyed=!0),e._xhr?e._xhr.abort():e._fetchAbortController&&e._fetchAbortController.abort(),t&&e.emit("error",t)},u.prototype.end=function(t,e,r){"function"==typeof t&&(r=t,t=void 0),l.Writable.prototype.end.call(this,t,e,r)},u.prototype.setTimeout=function(t,e){var r=this;e&&r.once("timeout",e),r._socketTimeout=t,r._resetTimers(!1)},u.prototype.flushHeaders=function(){},u.prototype.setNoDelay=function(){},u.prototype.setSocketKeepAlive=function(){};var f=["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,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"./capability":87,"./response":89,_process:78,buffer:19,inherits:58,"readable-stream":104}],89:[function(t,e,r){(function(e,n,i){(function(){var s=t("./capability"),o=t("inherits"),a=t("readable-stream"),l=r.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},c=r.IncomingMessage=function(t,r,n,o){var l=this;if(a.Readable.call(l),l._mode=n,l.headers={},l.rawHeaders=[],l.trailers={},l.rawTrailers=[],l.on("end",(function(){e.nextTick((function(){l.emit("close")}))})),"fetch"===n){if(l._fetchResponse=r,l.url=r.url,l.statusCode=r.status,l.statusMessage=r.statusText,r.headers.forEach((function(t,e){l.headers[e.toLowerCase()]=t,l.rawHeaders.push(e,t)})),s.writableStream){var c=new WritableStream({write:function(t){return o(!1),new Promise((function(e,r){l._destroyed?r():l.push(i.from(t))?e():l._resumeFetch=e}))},close:function(){o(!0),l._destroyed||l.push(null)},abort:function(t){o(!0),l._destroyed||l.emit("error",t)}});try{return void r.body.pipeTo(c).catch((function(t){o(!0),l._destroyed||l.emit("error",t)}))}catch(d){}}var h=r.body.getReader();function p(){h.read().then((function(t){l._destroyed||(o(t.done),t.done?l.push(null):(l.push(i.from(t.value)),p()))})).catch((function(t){o(!0),l._destroyed||l.emit("error",t)}))}p()}else{if(l._xhr=t,l._pos=0,l.url=t.responseURL,l.statusCode=t.status,l.statusMessage=t.statusText,t.getAllResponseHeaders().split(/\r?\n/).forEach((function(t){var e=t.match(/^([^:]+):\s*(.*)/);if(e){var r=e[1].toLowerCase();"set-cookie"===r?(void 0===l.headers[r]&&(l.headers[r]=[]),l.headers[r].push(e[2])):void 0!==l.headers[r]?l.headers[r]+=", "+e[2]:l.headers[r]=e[2],l.rawHeaders.push(e[1],e[2])}})),l._charset="x-user-defined",!s.overrideMimeType){var u=l.rawHeaders["mime-type"];if(u){var f=u.match(/;\s*charset=([^;])(;|$)/);f&&(l._charset=f[1].toLowerCase())}l._charset||(l._charset="utf-8")}}};o(c,a.Readable),c.prototype._read=function(){var t=this._resumeFetch;t&&(this._resumeFetch=null,t())},c.prototype._onXHRProgress=function(t){var e=this,r=e._xhr,s=null;switch(e._mode){case"text":if((s=r.responseText).length>e._pos){var o=s.substr(e._pos);if("x-user-defined"===e._charset){for(var a=i.alloc(o.length),c=0;c<o.length;c++)a[c]=255&o.charCodeAt(c);e.push(a)}else e.push(o,e._charset);e._pos=s.length}break;case"arraybuffer":if(r.readyState!==l.DONE||!r.response)break;s=r.response,e.push(i.from(new Uint8Array(s)));break;case"moz-chunked-arraybuffer":if(s=r.response,r.readyState!==l.LOADING||!s)break;e.push(i.from(new Uint8Array(s)));break;case"ms-stream":if(s=r.response,r.readyState!==l.LOADING)break;var h=new n.MSStreamReader;h.onprogress=function(){h.result.byteLength>e._pos&&(e.push(i.from(new Uint8Array(h.result.slice(e._pos)))),e._pos=h.result.byteLength)},h.onload=function(){t(!0),e.push(null)},h.readAsArrayBuffer(s)}e._xhr.readyState===l.DONE&&"ms-stream"!==e._mode&&(t(!0),e.push(null))}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"./capability":87,_process:78,buffer:19,inherits:58,"readable-stream":104}],90:[function(t,e,r){var n={};function i(t,e,r){r||(r=Error);var i=function(t){var r,n;function i(r,n,i){return t.call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,n,i))||this}return n=t,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);i.prototype.name=r.name,i.prototype.code=t,n[t]=i}function s(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}i("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,i,o,a;if("string"==typeof e&&(i="not ",e.substr(!o||o<0?0:+o,i.length)===i)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))a="The ".concat(t," ").concat(n," ").concat(s(e,"type"));else{var l=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";a='The "'.concat(t,'" ').concat(l," ").concat(n," ").concat(s(e,"type"))}return a+=". Received type ".concat(typeof r)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=n},{}],91:[function(t,e,r){(function(r){(function(){var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};e.exports=c;var i=t("./_stream_readable"),s=t("./_stream_writable");t("inherits")(c,i);for(var o=n(s.prototype),a=0;a<o.length;a++){var l=o[a];c.prototype[l]||(c.prototype[l]=s.prototype[l])}function c(t){if(!(this instanceof c))return new c(t);i.call(this,t),s.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",h)))}function h(){this._writableState.ended||r.nextTick(u,this)}function u(t){t.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})}).call(this)}).call(this,t("_process"))},{"./_stream_readable":93,"./_stream_writable":95,_process:78,inherits:58}],92:[function(t,e,r){e.exports=i;var n=t("./_stream_transform");function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}t("inherits")(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},{"./_stream_transform":94,inherits:58}],93:[function(t,e,r){(function(r,n){(function(){var i;e.exports=_,_.ReadableState=A;t("events").EventEmitter;var s=function(t,e){return t.listeners(e).length},o=t("./internal/streams/stream"),a=t("buffer").Buffer,l=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var c,h=t("util");c=h&&h.debuglog?h.debuglog("stream"):function(){};var u,f,p,d=t("./internal/streams/buffer_list"),g=t("./internal/streams/destroy"),m=t("./internal/streams/state").getHighWaterMark,y=t("../errors").codes,b=y.ERR_INVALID_ARG_TYPE,v=y.ERR_STREAM_PUSH_AFTER_EOF,w=y.ERR_METHOD_NOT_IMPLEMENTED,S=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;t("inherits")(_,o);var P=g.errorOrDestroy,T=["error","close","destroy","pause","resume"];function A(e,r,n){i=i||t("./_stream_duplex"),e=e||{},"boolean"!=typeof n&&(n=r instanceof i),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=m(this,e,"readableHighWaterMark",n),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(u||(u=t("string_decoder/").StringDecoder),this.decoder=new u(e.encoding),this.encoding=e.encoding)}function _(e){if(i=i||t("./_stream_duplex"),!(this instanceof _))return new _(e);var r=this instanceof i;this._readableState=new A(e,this,r),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),o.call(this)}function E(t,e,r,n,i){c("readableAddChunk",e);var s,o=t._readableState;if(null===e)o.reading=!1,function(t,e){if(c("onEofChunk"),e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?R(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,x(t)))}(t,o);else if(i||(s=function(t,e){var r;n=e,a.isBuffer(n)||n instanceof l||"string"==typeof e||void 0===e||t.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],e));var n;return r}(o,e)),s)P(t,s);else if(o.objectMode||e&&e.length>0)if("string"==typeof e||o.objectMode||Object.getPrototypeOf(e)===a.prototype||(e=function(t){return a.from(t)}(e)),n)o.endEmitted?P(t,new S):O(t,o,e,!0);else if(o.ended)P(t,new v);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||0!==e.length?O(t,o,e,!1):D(t,o)):O(t,o,e,!1)}else n||(o.reading=!1,D(t,o));return!o.ended&&(o.length<o.highWaterMark||0===o.length)}function O(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&R(t)),D(t,e)}Object.defineProperty(_.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),_.prototype.destroy=g.destroy,_.prototype._undestroy=g.undestroy,_.prototype._destroy=function(t,e){e(t)},_.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=a.from(t,e),e=""),r=!0),E(this,t,e,!1,r)},_.prototype.unshift=function(t){return E(this,t,null,!0,!1)},_.prototype.isPaused=function(){return!1===this._readableState.flowing},_.prototype.setEncoding=function(e){u||(u=t("string_decoder/").StringDecoder);var r=new u(e);this._readableState.decoder=r,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=r.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var C=1073741824;function M(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=C?t=C:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function R(t){var e=t._readableState;c("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(c("emitReadable",e.flowing),e.emittedReadable=!0,r.nextTick(x,t))}function x(t){var e=t._readableState;c("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,B(t)}function D(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(j,t,e))}function j(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(c("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function I(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function L(t){c("readable nexttick read 0"),t.read(0)}function N(t,e){c("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),B(t),e.flowing&&!e.reading&&t.read(0)}function B(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function U(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function k(t){var e=t._readableState;c("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,r.nextTick(F,e,t))}function F(t,e){if(c("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function H(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}_.prototype.read=function(t){c("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?k(this):R(this),null;if(0===(t=M(t,e))&&e.ended)return 0===e.length&&k(this),null;var n,i=e.needReadable;return c("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&c("length less than watermark",i=!0),e.ended||e.reading?c("reading or ended",i=!1):i&&(c("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=M(r,e))),null===(n=t>0?U(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&k(this)),null!==n&&this.emit("data",n),n},_.prototype._read=function(t){P(this,new w("_read()"))},_.prototype.pipe=function(t,e){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,e);var o=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?l:m;function a(e,r){c("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),t.removeListener("close",d),t.removeListener("finish",g),t.removeListener("drain",h),t.removeListener("error",p),t.removeListener("unpipe",a),n.removeListener("end",l),n.removeListener("end",m),n.removeListener("data",f),u=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||h())}function l(){c("onend"),t.end()}i.endEmitted?r.nextTick(o):n.once("end",o),t.on("unpipe",a);var h=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,B(t))}}(n);t.on("drain",h);var u=!1;function f(e){c("ondata");var r=t.write(e);c("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==H(i.pipes,t))&&!u&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function p(e){c("onerror",e),m(),t.removeListener("error",p),0===s(t,"error")&&P(t,e)}function d(){t.removeListener("finish",g),m()}function g(){c("onfinish"),t.removeListener("close",d),m()}function m(){c("unpipe"),n.unpipe(t)}return n.on("data",f),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",p),t.once("close",d),t.once("finish",g),t.emit("pipe",n),i.flowing||(c("pipe resume"),n.resume()),t},_.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s<i;s++)n[s].emit("unpipe",this,{hasUnpiped:!1});return this}var o=H(e.pipes,t);return-1===o||(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},_.prototype.on=function(t,e){var n=o.prototype.on.call(this,t,e),i=this._readableState;return"data"===t?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?R(this):i.reading||r.nextTick(L,this))),n},_.prototype.addListener=_.prototype.on,_.prototype.removeListener=function(t,e){var n=o.prototype.removeListener.call(this,t,e);return"readable"===t&&r.nextTick(I,this),n},_.prototype.removeAllListeners=function(t){var e=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||r.nextTick(I,this),e},_.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,r.nextTick(N,t,e))}(this,t)),t.paused=!1,this},_.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},_.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var s=0;s<T.length;s++)t.on(T[s],this.emit.bind(this,T[s]));return this._read=function(e){c("wrapped _read",e),n&&(n=!1,t.resume())},this},"function"==typeof Symbol&&(_.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=t("./internal/streams/async_iterator")),f(this)}),Object.defineProperty(_.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(_.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(_.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),_._fromList=U,Object.defineProperty(_.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(_.from=function(e,r){return void 0===p&&(p=t("./internal/streams/from")),p(_,e,r)})}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":90,"./_stream_duplex":91,"./internal/streams/async_iterator":96,"./internal/streams/buffer_list":97,"./internal/streams/destroy":98,"./internal/streams/from":100,"./internal/streams/state":102,"./internal/streams/stream":103,_process:78,buffer:19,events:25,inherits:58,"string_decoder/":105,util:17}],94:[function(t,e,r){e.exports=h;var n=t("../errors").codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,s=n.ERR_MULTIPLE_CALLBACK,o=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,l=t("./_stream_duplex");function c(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new s);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function h(t){if(!(this instanceof h))return new h(t);l.call(this,t),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",u)}function u(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?f(this,null,null):this._flush((function(e,r){f(t,e,r)}))}function f(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new a;if(t._transformState.transforming)throw new o;return t.push(null)}t("inherits")(h,l),h.prototype.push=function(t,e){return this._transformState.needTransform=!1,l.prototype.push.call(this,t,e)},h.prototype._transform=function(t,e,r){r(new i("_transform()"))},h.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},h.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},h.prototype._destroy=function(t,e){l.prototype._destroy.call(this,t,(function(t){e(t)}))}},{"../errors":90,"./_stream_duplex":91,inherits:58}],95:[function(t,e,r){(function(r,n){(function(){function i(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;t.entry=null;for(;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}var s;e.exports=_,_.WritableState=A;var o={deprecate:t("util-deprecate")},a=t("./internal/streams/stream"),l=t("buffer").Buffer,c=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var h,u=t("./internal/streams/destroy"),f=t("./internal/streams/state").getHighWaterMark,p=t("../errors").codes,d=p.ERR_INVALID_ARG_TYPE,g=p.ERR_METHOD_NOT_IMPLEMENTED,m=p.ERR_MULTIPLE_CALLBACK,y=p.ERR_STREAM_CANNOT_PIPE,b=p.ERR_STREAM_DESTROYED,v=p.ERR_STREAM_NULL_VALUES,w=p.ERR_STREAM_WRITE_AFTER_END,S=p.ERR_UNKNOWN_ENCODING,P=u.errorOrDestroy;function T(){}function A(e,n,o){s=s||t("./_stream_duplex"),e=e||{},"boolean"!=typeof o&&(o=n instanceof s),this.objectMode=!!e.objectMode,o&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=f(this,e,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,i=n.sync,s=n.writecb;if("function"!=typeof s)throw new m;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,i,s){--e.pendingcb,n?(r.nextTick(s,i),r.nextTick(x,t,e),t._writableState.errorEmitted=!0,P(t,i)):(s(i),t._writableState.errorEmitted=!0,P(t,i),x(t,e))}(t,n,i,e,s);else{var o=M(n)||t.destroyed;o||n.corked||n.bufferProcessing||!n.bufferedRequest||C(t,n),i?r.nextTick(O,t,n,o,s):O(t,n,o,s)}}(n,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function _(e){var r=this instanceof(s=s||t("./_stream_duplex"));if(!r&&!h.call(_,this))return new _(e);this._writableState=new A(e,this,r),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),a.call(this)}function E(t,e,r,n,i,s,o){e.writelen=n,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new b("write")):r?t._writev(i,e.onwrite):t._write(i,s,e.onwrite),e.sync=!1}function O(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),x(t,e)}function C(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,s=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var a=0,l=!0;r;)s[a]=r,r.isBuf||(l=!1),r=r.next,a+=1;s.allBuffers=l,E(t,e,!0,e.length,s,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new i(e),e.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,h=r.encoding,u=r.callback;if(E(t,e,!1,e.objectMode?1:c.length,c,h,u),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function M(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function R(t,e){t._final((function(r){e.pendingcb--,r&&P(t,r),e.prefinished=!0,t.emit("prefinish"),x(t,e)}))}function x(t,e){var n=M(e);if(n&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,r.nextTick(R,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return n}t("inherits")(_,a),A.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(A.prototype,"buffer",{get:o.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(_,Symbol.hasInstance,{value:function(t){return!!h.call(this,t)||this===_&&(t&&t._writableState instanceof A)}})):h=function(t){return t instanceof this},_.prototype.pipe=function(){P(this,new y)},_.prototype.write=function(t,e,n){var i,s=this._writableState,o=!1,a=!s.objectMode&&(i=t,l.isBuffer(i)||i instanceof c);return a&&!l.isBuffer(t)&&(t=function(t){return l.from(t)}(t)),"function"==typeof e&&(n=e,e=null),a?e="buffer":e||(e=s.defaultEncoding),"function"!=typeof n&&(n=T),s.ending?function(t,e){var n=new w;P(t,n),r.nextTick(e,n)}(this,n):(a||function(t,e,n,i){var s;return null===n?s=new v:"string"==typeof n||e.objectMode||(s=new d("chunk",["string","Buffer"],n)),!s||(P(t,s),r.nextTick(i,s),!1)}(this,s,t,n))&&(s.pendingcb++,o=function(t,e,r,n,i,s){if(!r){var o=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=l.from(e,r));return e}(e,n,i);n!==o&&(r=!0,i="buffer",n=o)}var a=e.objectMode?1:n.length;e.length+=a;var c=e.length<e.highWaterMark;c||(e.needDrain=!0);if(e.writing||e.corked){var h=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:s,next:null},h?h.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else E(t,e,!1,a,n,i,s);return c}(this,s,a,t,e,n)),o},_.prototype.cork=function(){this._writableState.corked++},_.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||C(this,t))},_.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new S(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(_.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(_.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),_.prototype._write=function(t,e,r){r(new g("_write()"))},_.prototype._writev=null,_.prototype.end=function(t,e,n){var i=this._writableState;return"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,n){e.ending=!0,x(t,e),n&&(e.finished?r.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,i,n),this},Object.defineProperty(_.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(_.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),_.prototype.destroy=u.destroy,_.prototype._undestroy=u.undestroy,_.prototype._destroy=function(t,e){e(t)}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":90,"./_stream_duplex":91,"./internal/streams/destroy":98,"./internal/streams/state":102,"./internal/streams/stream":103,_process:78,buffer:19,inherits:58,"util-deprecate":109}],96:[function(t,e,r){(function(r){(function(){var n;function i(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s=t("./end-of-stream"),o=Symbol("lastResolve"),a=Symbol("lastReject"),l=Symbol("error"),c=Symbol("ended"),h=Symbol("lastPromise"),u=Symbol("handlePromise"),f=Symbol("stream");function p(t,e){return{value:t,done:e}}function d(t){var e=t[o];if(null!==e){var r=t[f].read();null!==r&&(t[h]=null,t[o]=null,t[a]=null,e(p(r,!1)))}}function g(t){r.nextTick(d,t)}var m=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((i(n={get stream(){return this[f]},next:function(){var t=this,e=this[l];if(null!==e)return Promise.reject(e);if(this[c])return Promise.resolve(p(void 0,!0));if(this[f].destroyed)return new Promise((function(e,n){r.nextTick((function(){t[l]?n(t[l]):e(p(void 0,!0))}))}));var n,i=this[h];if(i)n=new Promise(function(t,e){return function(r,n){t.then((function(){e[c]?r(p(void 0,!0)):e[u](r,n)}),n)}}(i,this));else{var s=this[f].read();if(null!==s)return Promise.resolve(p(s,!1));n=new Promise(this[u])}return this[h]=n,n}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var t=this;return new Promise((function(e,r){t[f].destroy(null,(function(t){t?r(t):e(p(void 0,!0))}))}))})),n),m);e.exports=function(t){var e,r=Object.create(y,(i(e={},f,{value:t,writable:!0}),i(e,o,{value:null,writable:!0}),i(e,a,{value:null,writable:!0}),i(e,l,{value:null,writable:!0}),i(e,c,{value:t._readableState.endEmitted,writable:!0}),i(e,u,{value:function(t,e){var n=r[f].read();n?(r[h]=null,r[o]=null,r[a]=null,t(p(n,!1))):(r[o]=t,r[a]=e)},writable:!0}),e));return r[h]=null,s(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[a];return null!==e&&(r[h]=null,r[o]=null,r[a]=null,e(t)),void(r[l]=t)}var n=r[o];null!==n&&(r[h]=null,r[o]=null,r[a]=null,n(p(void 0,!0))),r[c]=!0})),t.on("readable",g.bind(null,r)),r}}).call(this)}).call(this,t("_process"))},{"./end-of-stream":99,_process:78}],97:[function(t,e,r){function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function s(t,e,r){return(e=a(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function a(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}var l=t("buffer").Buffer,c=t("util").inspect,h=c&&c.custom||"inspect";e.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,r,n;return e=t,(r=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return l.alloc(0);for(var e,r,n,i=l.allocUnsafe(t>>>0),s=this.head,o=0;s;)e=s.data,r=i,n=o,l.prototype.copy.call(e,r,n),o+=s.data.length,s=s.next;return i}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,n=e.data;for(t-=n.length;e=e.next;){var i=e.data,s=t>i.length?i.length:t;if(s===i.length?n+=i:n+=i.slice(0,t),0==(t-=s)){s===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(s));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=l.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,s=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,s),0==(t-=s)){s===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(s));break}++n}return this.length-=n,e}},{key:h,value:function(t,e){return c(this,i(i({},e),{},{depth:0,customInspect:!1}))}}])&&o(e.prototype,r),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}()},{buffer:19,util:17}],98:[function(t,e,r){(function(t){(function(){function r(t,e){i(t,e),n(t)}function n(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function i(t,e){t.emit("error",e)}e.exports={destroy:function(e,s){var o=this,a=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return a||l?(s?s(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t.nextTick(i,this,e)):t.nextTick(i,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!s&&e?o._writableState?o._writableState.errorEmitted?t.nextTick(n,o):(o._writableState.errorEmitted=!0,t.nextTick(r,o,e)):t.nextTick(r,o,e):s?(t.nextTick(n,o),s(e)):t.nextTick(n,o)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}}).call(this)}).call(this,t("_process"))},{_process:78}],99:[function(t,e,r){var n=t("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function t(e,r,s){if("function"==typeof r)return t(e,null,r);r||(r={}),s=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}(s||i);var o=r.readable||!1!==r.readable&&e.readable,a=r.writable||!1!==r.writable&&e.writable,l=function(){e.writable||h()},c=e._writableState&&e._writableState.finished,h=function(){a=!1,c=!0,o||s.call(e)},u=e._readableState&&e._readableState.endEmitted,f=function(){o=!1,u=!0,a||s.call(e)},p=function(t){s.call(e,t)},d=function(){var t;return o&&!u?(e._readableState&&e._readableState.ended||(t=new n),s.call(e,t)):a&&!c?(e._writableState&&e._writableState.ended||(t=new n),s.call(e,t)):void 0},g=function(){e.req.on("finish",h)};return!function(t){return t.setHeader&&"function"==typeof t.abort}(e)?a&&!e._writableState&&(e.on("end",l),e.on("close",l)):(e.on("complete",h),e.on("abort",d),e.req?g():e.on("request",g)),e.on("end",f),e.on("finish",h),!1!==r.error&&e.on("error",p),e.on("close",d),function(){e.removeListener("complete",h),e.removeListener("abort",d),e.removeListener("request",g),e.req&&e.req.removeListener("finish",h),e.removeListener("end",l),e.removeListener("close",l),e.removeListener("finish",h),e.removeListener("end",f),e.removeListener("error",p),e.removeListener("close",d)}}},{"../../../errors":90}],100:[function(t,e,r){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],101:[function(t,e,r){var n;var i=t("../../../errors").codes,s=i.ERR_MISSING_ARGS,o=i.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function l(t){t()}function c(t,e){return t.pipe(e)}e.exports=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];var h,u=function(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}(r);if(Array.isArray(r[0])&&(r=r[0]),r.length<2)throw new s("streams");var f=r.map((function(e,i){var s=i<r.length-1;return function(e,r,i,s){s=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(s);var a=!1;e.on("close",(function(){a=!0})),void 0===n&&(n=t("./end-of-stream")),n(e,{readable:r,writable:i},(function(t){if(t)return s(t);a=!0,s()}));var l=!1;return function(t){if(!a&&!l)return l=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void s(t||new o("pipe"))}}(e,s,i>0,(function(t){h||(h=t),t&&f.forEach(l),s||(f.forEach(l),u(h))}))}));return r.reduce(c)}},{"../../../errors":90,"./end-of-stream":99}],102:[function(t,e,r){var n=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(t,e,r,i){var s=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new n(i?r:"highWaterMark",s);return Math.floor(s)}return t.objectMode?16:16384}}},{"../../../errors":90}],103:[function(t,e,r){e.exports=t("events").EventEmitter},{events:25}],104:[function(t,e,r){(r=e.exports=t("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=t("./lib/_stream_writable.js"),r.Duplex=t("./lib/_stream_duplex.js"),r.Transform=t("./lib/_stream_transform.js"),r.PassThrough=t("./lib/_stream_passthrough.js"),r.finished=t("./lib/internal/streams/end-of-stream.js"),r.pipeline=t("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":91,"./lib/_stream_passthrough.js":92,"./lib/_stream_readable.js":93,"./lib/_stream_transform.js":94,"./lib/_stream_writable.js":95,"./lib/internal/streams/end-of-stream.js":99,"./lib/internal/streams/pipeline.js":101}],105:[function(t,e,r){var n=t("safe-buffer").Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=l,this.end=c,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=h,this.end=u,e=3;break;default:return this.write=f,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function o(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function l(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function h(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function u(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function f(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}r.StringDecoder=s,s.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},s.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},s.prototype.text=function(t,e){var r=function(t,e,r){var n=e.length-1;if(n<r)return 0;var i=o(e[n]);if(i>=0)return i>0&&(t.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if(i=o(e[n]),i>=0)return i>0&&(t.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if(i=o(e[n]),i>=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},s.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":83}],106:[function(t,e,r){(function(e,n){(function(){var i=t("process/browser.js").nextTick,s=Function.prototype.apply,o=Array.prototype.slice,a={},l=0;function c(t,e){this._id=t,this._clearFn=e}r.setTimeout=function(){return new c(s.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new c(s.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(t){t.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},r.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},r._unrefActive=r.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r.setImmediate="function"==typeof e?e:function(t){var e=l++,n=!(arguments.length<2)&&o.call(arguments,1);return a[e]=!0,i((function(){a[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))})),e},r.clearImmediate="function"==typeof n?n:function(t){delete a[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":78,timers:106}],107:[function(t,e,r){var n=t("punycode"),i=t("./util");function s(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}r.parse=v,r.resolve=function(t,e){return v(t,!1,!0).resolve(e)},r.resolveObject=function(t,e){return t?v(t,!1,!0).resolveObject(e):e},r.format=function(t){i.isString(t)&&(t=v(t));return t instanceof s?t.format():s.prototype.format.call(t)},r.Url=s;var o=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,l=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),h=["'"].concat(c),u=["%","/","?",";","#"].concat(h),f=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=t("querystring");function v(t,e,r){if(t&&i.isObject(t)&&t instanceof s)return t;var n=new s;return n.parse(t,e,r),n}s.prototype.parse=function(t,e,r){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var s=t.indexOf("?"),a=-1!==s&&s<t.indexOf("#")?"?":"#",c=t.split(a);c[0]=c[0].replace(/\\/g,"/");var v=t=c.join(a);if(v=v.trim(),!r&&1===t.split("#").length){var w=l.exec(v);if(w)return this.path=v,this.href=v,this.pathname=w[1],w[2]?(this.search=w[2],this.query=e?b.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var S=o.exec(v);if(S){var P=(S=S[0]).toLowerCase();this.protocol=P,v=v.substr(S.length)}if(r||S||v.match(/^\/\/[^@\/]+@[^@\/]+/)){var T="//"===v.substr(0,2);!T||S&&m[S]||(v=v.substr(2),this.slashes=!0)}if(!m[S]&&(T||S&&!y[S])){for(var A,_,E=-1,O=0;O<f.length;O++){-1!==(C=v.indexOf(f[O]))&&(-1===E||C<E)&&(E=C)}-1!==(_=-1===E?v.lastIndexOf("@"):v.lastIndexOf("@",E))&&(A=v.slice(0,_),v=v.slice(_+1),this.auth=decodeURIComponent(A)),E=-1;for(O=0;O<u.length;O++){var C;-1!==(C=v.indexOf(u[O]))&&(-1===E||C<E)&&(E=C)}-1===E&&(E=v.length),this.host=v.slice(0,E),v=v.slice(E),this.parseHost(),this.hostname=this.hostname||"";var M="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!M)for(var R=this.hostname.split(/\./),x=(O=0,R.length);O<x;O++){var D=R[O];if(D&&!D.match(p)){for(var j="",I=0,L=D.length;I<L;I++)D.charCodeAt(I)>127?j+="x":j+=D[I];if(!j.match(p)){var N=R.slice(0,O),B=R.slice(O+1),U=D.match(d);U&&(N.push(U[1]),B.unshift(U[2])),B.length&&(v="/"+B.join(".")+v),this.hostname=N.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),M||(this.hostname=n.toASCII(this.hostname));var k=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+k,this.href+=this.host,M&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==v[0]&&(v="/"+v))}if(!g[P])for(O=0,x=h.length;O<x;O++){var H=h[O];if(-1!==v.indexOf(H)){var V=encodeURIComponent(H);V===H&&(V=escape(H)),v=v.split(H).join(V)}}var W=v.indexOf("#");-1!==W&&(this.hash=v.substr(W),v=v.slice(0,W));var z=v.indexOf("?");if(-1!==z?(this.search=v.substr(z),this.query=v.substr(z+1),e&&(this.query=b.parse(this.query)),v=v.slice(0,z)):e&&(this.search="",this.query={}),v&&(this.pathname=v),y[P]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){k=this.pathname||"";var q=this.search||"";this.path=k+q}return this.href=this.format(),this},s.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",s=!1,o="";this.host?s=t+this.host:this.hostname&&(s=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(s+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(o=b.stringify(this.query));var a=this.search||o&&"?"+o||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||y[e])&&!1!==s?(s="//"+(s||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):s||(s=""),n&&"#"!==n.charAt(0)&&(n="#"+n),a&&"?"!==a.charAt(0)&&(a="?"+a),e+s+(r=r.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(a=a.replace("#","%23"))+n},s.prototype.resolve=function(t){return this.resolveObject(v(t,!1,!0)).format()},s.prototype.resolveObject=function(t){if(i.isString(t)){var e=new s;e.parse(t,!1,!0),t=e}for(var r=new s,n=Object.keys(this),o=0;o<n.length;o++){var a=n[o];r[a]=this[a]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var l=Object.keys(t),c=0;c<l.length;c++){var h=l[c];"protocol"!==h&&(r[h]=t[h])}return y[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!y[t.protocol]){for(var u=Object.keys(t),f=0;f<u.length;f++){var p=u[f];r[p]=t[p]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||m[t.protocol])r.pathname=t.pathname;else{for(var d=(t.pathname||"").split("/");d.length&&!(t.host=d.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),r.pathname=d.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var g=r.pathname||"",b=r.search||"";r.path=g+b}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var v=r.pathname&&"/"===r.pathname.charAt(0),w=t.host||t.pathname&&"/"===t.pathname.charAt(0),S=w||v||r.host&&t.pathname,P=S,T=r.pathname&&r.pathname.split("/")||[],A=(d=t.pathname&&t.pathname.split("/")||[],r.protocol&&!y[r.protocol]);if(A&&(r.hostname="",r.port=null,r.host&&(""===T[0]?T[0]=r.host:T.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===d[0]?d[0]=t.host:d.unshift(t.host)),t.host=null),S=S&&(""===d[0]||""===T[0])),w)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,T=d;else if(d.length)T||(T=[]),T.pop(),T=T.concat(d),r.search=t.search,r.query=t.query;else if(!i.isNullOrUndefined(t.search)){if(A)r.hostname=r.host=T.shift(),(M=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=M.shift(),r.host=r.hostname=M.shift());return r.search=t.search,r.query=t.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!T.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var _=T.slice(-1)[0],E=(r.host||t.host||T.length>1)&&("."===_||".."===_)||""===_,O=0,C=T.length;C>=0;C--)"."===(_=T[C])?T.splice(C,1):".."===_?(T.splice(C,1),O++):O&&(T.splice(C,1),O--);if(!S&&!P)for(;O--;O)T.unshift("..");!S||""===T[0]||T[0]&&"/"===T[0].charAt(0)||T.unshift(""),E&&"/"!==T.join("/").substr(-1)&&T.push("");var M,R=""===T[0]||T[0]&&"/"===T[0].charAt(0);A&&(r.hostname=r.host=R?"":T.length?T.shift():"",(M=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=M.shift(),r.host=r.hostname=M.shift()));return(S=S||r.host&&T.length)&&!R&&T.unshift(""),T.length?r.pathname=T.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},s.prototype.parseHost=function(){var t=this.host,e=a.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":108,punycode:79,querystring:82}],108:[function(t,e,r){e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],109:[function(t,e,r){(function(t){(function(){function r(e){try{if(!t.localStorage)return!1}catch(t){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=function(t,e){if(r("noDeprecation"))return t;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],110:[function(t,e,r){e.exports=function t(e,r){if(e&&r)return t(e)(r);if("function"!=typeof e)throw new TypeError("need wrapper function");return Object.keys(e).forEach((function(t){n[t]=e[t]})),n;function n(){for(var t=new Array(arguments.length),r=0;r<t.length;r++)t[r]=arguments[r];var n=e.apply(this,t),i=t[t.length-1];return"function"==typeof n&&n!==i&&Object.keys(i).forEach((function(t){n[t]=i[t]})),n}}},{}],111:[function(t,e,r){e.exports=function(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];for(var i in r)n.call(r,i)&&(t[i]=r[i])}return t};var n=Object.prototype.hasOwnProperty},{}],112:[function(t,e,r){const n=t("fable").ServiceProviderBase,i="#PICT-CSS";e.exports=class extends n{constructor(t,e,r){super(t,e,r),void 0===this.options.CSSElementAddress&&(this.options.CSSElementAddress=i),this.inlineCSSMap={}}addCSS(t,e,r,n){let i=void 0!==r?r:1e3,s="string"==typeof n?n:"Unknown";this.inlineCSSMap[t]={Hash:t,Content:e,Provider:s,Priority:i}}removeCSS(t){delete this.inlineCSSMap[t]}generateCSS(){let t="",e=Object.keys(this.inlineCSSMap);e.sort(((t,e)=>this.inlineCSSMap[t].Priority-this.inlineCSSMap[e].Priority));for(let r=0;r<e.length;r++){let n=this.inlineCSSMap[e[r]],i=n.Hash;n.Hash!=n.Provider&&(i="".concat(i," from ").concat(n.Provider)),t+="/* ".concat(i," */\n").concat(n.Content,"\n")}return t}injectCSS(){this.services.ContentAssignment.assignContent(this.options.CSSElementAddress,this.generateCSS())}}},{fable:40}],113:[function(t,e,r){const n=t("fable").ServiceProviderBase;e.exports=class extends n{constructor(t,e,r){super(t,e,r),this.serviceType="PictContentAssignment",this.inBrowser=!1,this.hasDocument=!1,"object"==typeof window&&(this.inBrowser=!0,void 0!==window.document&&"function"==typeof window.document.querySelectorAll&&(this.hasDocument=!0)),this.hasJquery=!1,this.jQuery=!1,this.inBrowser&&void 0!==window.jQuery&&(this.hasJquery=!0),this.customAssignFunction=!1,this.customPrependFunction=!1,this.customAppendFunction=!1,this.customReadFunction=!1,this.customGetElementFunction=!1}getElement(t){if(this.customGetElementFunction)return this.customGetElementFunction(t);if(this.hasJquery){let e=window.jQuery(t);if(0==e.length)return[];{let t=[];for(let r=0;r<e.length;r++)t.push(e[0]);return t}}return this.inBrowser&&this.hasDocument?window.document.querySelectorAll(t):(this.log.trace("PICT Content GET ELEMENT for [".concat(t,"] will return empty because none of the browser methods are available")),[])}assignContent(t,e){if(this.customAssignFunction)return this.customAssignFunction(t,e);if(this.hasJquery){window.jQuery(t).html(e)}else if(this.inBrowser&&this.hasDocument){let r=window.document.querySelectorAll(t);for(let t=0;t<r.length;t++)switch(r[t].tagName){case"INPUT":case"BUTTON":case"TEXTAREA":r[t].value=e;break;case"SCRIPT":case"A":r[t].text=e;break;default:r[t].innerHTML=e}}else this.log.trace("PICT Content ASSIGN to [".concat(t,"]:"),e)}appendContent(t,e){if(this.customAppendFunction)return this.customAppendFunction(t,e);if(this.hasJquery){window.jQuery(t).append(e)}else if(this.inBrowser&&this.hasDocument){let r=window.document.querySelectorAll(t);for(let t=0;t<r.length;t++)r[t].insertAdjacentHTML("beforeend",e)}else this.log.trace("PICT Content APPEND to [".concat(t,"]:"),e)}prependContent(t,e){if(this.customAppendFunction)return this.customPrependFunction(t,e);if(this.hasJquery){window.jQuery(t).prepend(e)}else if(this.inBrowser&&this.hasDocument){let r=window.document.querySelectorAll(t);for(let t=0;t<r.length;t++)r[t].insertAdjacentHTML("afterbegin",e)}else this.log.trace("PICT Content PREPEND in [".concat(t,"]:"),e)}readContent(t){if(this.customReadFunction)return this.customReadFunction(t);if(this.hasJquery){return window.jQuery(t).html()}if(!this.inBrowser||!this.hasDocument)return this.log.trace("PICT Content READ from [".concat(t,"]...")),"";{let e=window.document.querySelectorAll(t);if(e.length<1)return null;if(1==e.length)return"INPUT"==e[0].tagName||"TEXTAREA"==e[0].tagName?e[0].value:"SCRIPT"==e[0].tagName?e[0].text:e[0].innerHTML}}addClass(t,e){if(this.customAddClassFunction)return this.customAddClassFunction(t,e);if(this.hasJquery){window.jQuery(t).addClass(e)}else if(this.inBrowser&&this.hasDocument){let r=window.document.querySelectorAll(t);for(let t=0;t<r.length;t++)r[t].classList.add(e)}else this.log.trace("PICT Content ADDCLASS to [".concat(t,"]:"),e)}removeClass(t,e){if(this.customRemoveClassFunction)return this.customRemoveClassFunction(t,e);if(this.hasJquery){window.jQuery(t).removeClass(e)}else if(this.inBrowser&&this.hasDocument){let r=window.document.querySelectorAll(t);for(let t=0;t<r.length;t++)r[t].classList.remove(e)}else this.log.trace("PICT Content REMOVECLASS from [".concat(t,"]:"),e)}toggleClass(t,e){}hasClass(t,e){}}},{fable:40}],114:[function(t,e,r){const n=t("fable").ServiceProviderBase;e.exports=class extends n{constructor(t,e,r){super(t,e,r),this.serviceType="PictDataProvider"}getDataByAddress(t,e){let r=void 0===e?{}:e;return this.fable.manifest.getValueByHash({AppData:this.AppData,Bundle:this.Bundle,Record:r},t)}}},{fable:40}],115:[function(t,e,r){const n=t("fable").ServiceProviderBase;e.exports=class extends n{constructor(t,e,r){super(t,e,r),_defineProperty2(this,"getEntitySet",(function(t,e,r){this.initializeCache(t),this.cache[t].prune((()=>{let n={url:"".concat(this.options.urlPrefix).concat(t,"s/Count/FilteredTo/").concat(e)};return n=this.prepareRequestOptions(n),this.restClient.getJSON(n,((i,s,o)=>{if(i)return this.log.error("Error getting bulk entity count of [".concat(t,"] filtered to [").concat(e,"] from server [").concat(n.url,"]: ").concat(i)),r(i);let a=0;o.Count&&(a=o.Count);let l=[],c=this.options.downloadBatchSize;for(let r=0;r<a/c;r++)l.push("".concat(this.options.urlPrefix).concat(t,"s/FilteredTo/").concat(e,"/").concat(r*c,"/").concat(c));let h=[];this.fable.Utility.eachLimit(l,1,((t,e)=>{let r={url:"".concat(this.options.urlPrefix).concat(t)};r=this.prepareRequestOptions(r),this.restClient.getJSON(t,((t,r,n)=>(h=h.concat(n),e(t))))}),(t=>r(t,h)))}))}))})),this.serviceType="PictMeadowProvider",this.fable.settings.PictDefaultURLPrefix?this.options.urlPrefix=this.fable.settings.PictDefaultURLPrefix:this.options.urlPrefix||(this.options.urlPrefix="/1.0/"),this.fable.settings.PictDefaultDownloadBatchSize?this.options.downloadBatchSize=this.fable.settings.PictDefaultDownloadBatchSize:this.options.downloadBatchSize||(this.options.downloadBatchSize=100),this.restClient=this.fable.serviceManager.instantiateServiceProviderWithoutRegistration("RestClient"),this.cache={},this.prepareRequestOptions=t=>t}initializeCache(t){this.cache.hasOwnProperty(t)||(this.cache[t]=this.fable.serviceManager.instantiateServiceProviderWithoutRegistration("ObjectCache"),this.cache[t].maxAge=3e4,this.cache[t].maxLength=1e4,this.fable.Bundle[t]=this.cache[t].RecordMap)}getEntity(t,e,r){this.initializeCache(t),this.cache[t].prune((()=>{let n=this.cache[t].read(e);if(n)return n;let i={url:"".concat(this.options.urlPrefix).concat(t,"/").concat(e)};return i=this.prepareRequestOptions(i),this.restClient.getJSON(i,((n,i,s)=>(s&&this.cache[t].put(s,e),r(n,s))))}))}}},{fable:40}],116:[function(t,e,r){const n=t("fable").ServiceProviderBase;e.exports=class extends n{constructor(t,e,r){super(t,e,r),this.serviceType="PictTemplateProvider",this.templates={},this.templateSources={},this.defaultTemplates=[],this.loadTemplateFunction=t=>!1}addTemplate(t,e,r){this.templates[t]=e,this.templateSources[t]="string"==typeof r?r:"Direct addTemplate('".concat(t,"') function load into PictTemplateProvider [").concat(this.UUID,"]::[").concat(this.Hash,"]")}addDefaultTemplate(t,e,r,n){let i={prefix:t,postfix:e,template:r,source:"string"==typeof n?n:"Direct addDefaultTemplate('".concat(t,"','").concat(e,"',..) function load into PictTemplateProvider [").concat(this.UUID,"]::[").concat(this.Hash,"]")};"string"!=typeof r&&this.log.error("PictTemplateProvider.addDefaultTemplate: pTemplate is not a string."),this.defaultTemplates.push(i)}checkDefaultTemplateHash(t){for(let e=0;e<this.defaultTemplates.length;e++)if(t.indexOf(this.defaultTemplates[e].postfix)==t.length-this.defaultTemplates[e].postfix.length&&0==t.indexOf(this.defaultTemplates[e].prefix))return this.templates[t]=this.defaultTemplates[e].template,this.templateSources[t]="Auto created in checkDefaultTemplateHash('".concat(t,"') function by PictTemplateProvider [").concat(this.UUID,"]::[").concat(this.Hash,"] from [").concat(this.defaultTemplates[e].prefix,"]...[").concat(this.defaultTemplates[e].postfix,"]"),this.templates[t];return!1}getTemplate(t){return this.templates.hasOwnProperty(t)||this.loadTemplate(t),this.templates.hasOwnProperty(t)||this.checkDefaultTemplateHash(t),!!this.templates.hasOwnProperty(t)&&this.templates[t]}loadTemplate(t){let e=this.loadTemplateFunction(t);return e&&(this.templates[t]=e.template,this.templateSources[t]="Loaded in loadTemplate('".concat(t,"') function by PictTemplateProvider [").concat(this.UUID,"]::[").concat(this.Hash,"] from [").concat(e.source,"]")),e}}},{fable:40}],117:[function(t,e,r){const n=t("fable");e.exports=class extends n{constructor(e){super(e),this.isBrowser=new Function("try {return (this===window);} catch(pError) {return false;}"),this.serviceManager.addAndInstantiateServiceType("TemplateProvider",t("./Pict-Template-Provider.js")),this.serviceManager.addAndInstantiateServiceType("EntityProvider",t("./Pict-Meadow-EntityProvider.js")),this.serviceManager.addAndInstantiateServiceType("DataProvider",t("./Pict-DataProvider.js")),this.serviceManager.addAndInstantiateServiceType("ContentAssignment",t("./Pict-Content-Assignment.js")),this.serviceManager.addAndInstantiateServiceType("CSSMap",t("./Pict-CSS.js")),this.serviceManager.instantiateServiceProvider("MetaTemplate"),this.serviceManager.instantiateServiceProvider("DataGeneration"),this.manifest=this.serviceManager.instantiateServiceProvider("Manifest"),this.AppData={},this.Bundle={},this.LogNoisiness=0,this.settings.Manifests&&this.loadManifestSet(this.settings.Manifests),this._DefaultPictTemplatesInitialized=!1,this.initializePictTemplateEngine(),this.serviceManager.addServiceType("PictView",t("pict-view")),this.serviceManager.addServiceType("PictApplication",t("pict-application")),this.views=this.serviceManager.servicesMap.PictView}loadManifestSet(t){if("object"!=typeof t)return this.log.warn("PICT [".concat(this.UUID,"] could not load Manifest Set; pManifestSet was not an object.")),!1;let e=Object.keys(t);if(e.length>0)for(let r=0;r<e.length;r++){let n=e[r];this.serviceManager.instantiateServiceProvider("Manifest",t[n],n)}}addView(t,e,r){let n="object"==typeof e?e:{},i="string"==typeof t?t:this.fable.getUUID();return void 0!==r?(r.hasOwnProperty("default_configuration")&&(n=this.fable.Utility.extend({},r.default_configuration,n)),this.serviceManager.instantiateServiceProviderFromPrototype("PictView",n,i,r)):this.serviceManager.instantiateServiceProvider("PictView",n,i)}addApplication(t,e,r){let n="object"==typeof e?e:{},i="string"==typeof t?t:this.fable.getUUID();return void 0!==r?(r.hasOwnProperty("default_configuration")&&(n=this.fable.Utility.extend({},r.default_configuration,n)),this.serviceManager.instantiateServiceProviderFromPrototype("PictApplication",n,i,r)):this.serviceManager.instantiateServiceProvider("PictApplication",n,i)}initializePictTemplateEngine(){if(!this._DefaultPictTemplatesInitialized){let t=(t,e,r)=>{let n=t.trim(),i="object"==typeof e?e:{};this.LogNoisiness>4?this.log.trace("PICT Template [fEntityRender]::[".concat(n,"] with tmpData:"),i):this.LogNoisiness>0&&this.log.trace("PICT Template [fEntityRender]::[".concat(n,"]"));let s=!1,o=!1,a=!1;if(n.indexOf("|")<0){let t=n.indexOf(":");s=n.substring(0,t),o=n.substring(t+1)}else{let t=n.indexOf(":");s=n.substring(0,t);let e=n.indexOf("|");o=n.substring(t+1,e),a=n.substring(e+1)}if(o=isNaN(o)?this.manifest.getValueByHash({AppData:this.AppData,Bundle:this.Bundle,Record:i},o):parseInt(o),!s||!o)return this.log.warn("Pict: Entity Render: Entity or entity ID not resolved for [".concat(n,"]")),r(Error("Pict: Entity Render: Entity or entity ID not resolved for [".concat(n,"]")),"");this.EntityProvider.getEntity(s,o,((t,e)=>t?(this.log.error("Pict: Entity Render: Error getting entity [".concat(s,"] with ID [").concat(o,"] for [").concat(n,"]: ").concat(t),t),r(t,"")):r(null,a?this.parseTemplateByHash(a,e):"")))};this.MetaTemplate.addPatternAsync("{~E:","~}",t),this.MetaTemplate.addPatternAsync("{~Entity:","~}",t);let e=(t,e)=>{let r=t.trim(),n="object"==typeof e?e:{};this.LogNoisiness>4?this.log.trace("PICT Template [fNotEmptyRender]::[".concat(r,"] with tmpData:"),n):this.LogNoisiness>2&&this.log.trace("PICT Template [fNotEmptyRender]::[".concat(r,"]"));let i=r.split("|");return this.manifest.getValueByHash({AppData:this.AppData,Bundle:this.Bundle,Record:n},i[0])?i[1]:""};this.MetaTemplate.addPattern("{~NotEmpty:","~}",e),this.MetaTemplate.addPattern("{~NE:","~}",e);let r=(t,e)=>{let r=t.trim(),n="object"==typeof e?e:{};this.LogNoisiness>4?this.log.trace("PICT Template [fTemplateRender]::[".concat(r,"] with tmpData:"),n):this.LogNoisiness>0&&this.log.trace("PICT Template [fTemplateRender]::[".concat(r,"]"));let i=!1,s=!1,o=r.indexOf(":");return i=r.substring(0,o),o>-1?s=r.substring(o+1):i=r,i?s?this.parseTemplateByHash(i,this.manifest.getValueByHash({AppData:this.AppData,Bundle:this.Bundle,Record:n},s)):this.parseTemplateByHash(i,e):(this.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(r,"]")),"Pict: Template Render: TemplateHash not resolved for [".concat(r,"]"))};this.MetaTemplate.addPattern("{~T:","~}",r),this.MetaTemplate.addPattern("{~Template:","~}",r);let n=(t,e)=>{let r=t.trim(),n="object"==typeof e?e:{};this.LogNoisiness>4?this.log.trace("PICT Template [fTemplateSetRender]::[".concat(r,"] with tmpData:"),n):this.LogNoisiness>0&&this.log.trace("PICT Template [fTemplateSetRender]::[".concat(r,"]"));let i=!1,s=!1,o=r.indexOf(":");return i=r.substring(0,o),o>-1?s=r.substring(o+1):i=r,i?s?this.parseTemplateSetByHash(i,this.manifest.getValueByHash({AppData:this.AppData,Bundle:this.Bundle,Record:n},s)):this.parseTemplateSetByHash(i,e):(this.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(r,"]")),"Pict: Template Render: TemplateHash not resolved for [".concat(r,"]"))};this.MetaTemplate.addPattern("{~TS:","~}",n),this.MetaTemplate.addPattern("{~TemplateSet:","~}",n);let i=(t,e)=>{let r=t.trim(),n="object"==typeof e?e:{};this.LogNoisiness>4?this.log.trace("PICT Template [fDataRender]::[".concat(r,"] with tmpData:"),n):this.LogNoisiness>3&&this.log.trace("PICT Template [fDataRender]::[".concat(r,"]"));let i=this.manifest.getValueByHash({AppData:this.AppData,Bundle:this.Bundle,Record:n},r);return null==i||"undefined"==i||void 0===i?"":i};this.MetaTemplate.addPattern("{~D:","~}",i),this.MetaTemplate.addPattern("{~Data:","~}",i),this.MetaTemplate.addPattern("{~Dollars:","~}",((t,e)=>{let r=t.trim(),n="object"==typeof e?e:{};this.LogNoisiness>4?this.log.trace("PICT Template [fDollars]::[".concat(r,"] with tmpData:"),n):this.LogNoisiness>3&&this.log.trace("PICT Template [fDollars]::[".concat(r,"]"));let i=this.manifest.getValueByHash({AppData:this.AppData,Bundle:this.Bundle,Record:n},r);return this.DataFormat.formatterDollars(i)})),this.MetaTemplate.addPattern("{~Digits:","~}",((t,e)=>{let r=t.trim(),n="object"==typeof e?e:{};this.LogNoisiness>4?this.log.trace("PICT Template [fDigits]::[".concat(r,"] with tmpData:"),n):this.LogNoisiness>3&&this.log.trace("PICT Template [fDigits]::[".concat(r,"]"));let i=this.manifest.getValueByHash({AppData:this.AppData,Bundle:this.Bundle,Record:n},r);return this.DataFormat.formatterAddCommasToNumber(this.DataFormat.formatterRoundNumber(i,2))}));let s=(t,e)=>{let r=t.trim();this.LogNoisiness>3&&this.log.trace("PICT Template [fRandomNumberString]::[".concat(r,"]"));let n=4,i=9999;if(r.length>0){let t=r.split(",");t.length>0&&(n=parseInt(t[0])),t.length>1&&(i=parseInt(t[1]))}return this.DataGeneration.randomNumericString(n,i)};this.MetaTemplate.addPattern("{~RandomNumberString:","~}",s),this.MetaTemplate.addPattern("{~RNS:","~}",s);let o=(t,e)=>{let r=t.trim();this.LogNoisiness>3&&this.log.trace("PICT Template [fRandomNumber]::[".concat(r,"]"));let n=0,i=9999999;if(r.length>0){let t=r.split(",");t.length>0&&(n=parseInt(t[0])),t.length>1&&(i=parseInt(t[1]))}return this.DataGeneration.randomIntegerBetween(n,i)};this.MetaTemplate.addPattern("{~RandomNumber:","~}",o),this.MetaTemplate.addPattern("{~RN:","~}",o);let a=(t,e)=>{let r=t.trim(),n="object"==typeof e?e:{};this.LogNoisiness>4?this.log.trace("PICT Template [fPascalCaseIdentifier]::[".concat(r,"] with tmpData:"),n):this.LogNoisiness>3&&this.log.trace("PICT Template [fPascalCaseIdentifier]::[".concat(r,"]"));let i=this.manifest.getValueByHash({AppData:this.AppData,Bundle:this.Bundle,Record:n},r);return null==i||"undefined"==i||void 0===i?"":this.DataFormat.cleanNonAlphaCharacters(this.DataFormat.capitalizeEachWord(i))};this.MetaTemplate.addPattern("{~PascalCaseIdentifier:","~}",a);let l=(t,e)=>{let r=t.trim(),n="object"==typeof e?e:{},i=this.manifest.getValueByHash({AppData:this.AppData,Bundle:this.Bundle,Record:n},r),s=typeof i;return null==i||"undefined"==s?this.log.trace("PICT Template Log Value: [".concat(r,"] is ").concat(s,".")):"object"==s?this.log.trace("PICT Template Log Value: [".concat(r,"] is an obect."),i):this.log.trace("PICT Template Log Value: [".concat(r,"] if a ").concat(s," = [").concat(i,"]")),""};this.MetaTemplate.addPattern("{~LogValue:","~}",l),this.MetaTemplate.addPattern("{~LV:","~}",l);let c=(t,e)=>{let r=t.trim();return this.log.trace("PICT Template Log Message: ".concat(r)),""};this.MetaTemplate.addPattern("{~LogStatement:","~}",c),this.MetaTemplate.addPattern("{~LS:","~}",c);let h=(t,e)=>{let r=t.trim(),n=new Error("PICT Template Breakpoint: ".concat(r));return this.log.trace("PICT Template Breakpoint: ".concat(r),n.stack),""};this.MetaTemplate.addPattern("{~Breakpoint","~}",h),this._DefaultPictTemplatesInitialized=!0}}parseTemplate(t,e,r){let n="object"==typeof e?e:{};return this.MetaTemplate.parseString(t,n,r)}parseTemplateByHash(t,e,r){let n=this.TemplateProvider.getTemplate(t);return n?this.parseTemplate(n,e,r):""}parseTemplateSet(t,e,r){let n="";if("function"!=typeof r){if(Array.isArray(e)||"object"==typeof e){if(Array.isArray(e))for(let r=0;r<e.length;r++)n+=this.parseTemplate(t,e[r]);else{let r=Object.keys(e);for(let i=0;i<r.length;i++)n+=this.parseTemplate(t,e[r[i]])}return n}return""}if(!Array.isArray(e)&&"object"!=typeof e)return r(Error("Pict: Template Set: pDataSet is not an array or object."),"");this.Utility.eachLimit(e,1,((e,r)=>this.parseTemplate(t,e,((t,e)=>(n+=e,r())))),(t=>r(t,n)))}parseTemplateSetByHash(t,e,r){let n=this.TemplateProvider.getTemplate(t);return n?this.parseTemplateSet(n,e,r):""}},e.exports.PictApplicationClass=t("pict-application"),e.exports.PictViewClass=t("pict-view"),e.exports.EnvironmentLog=t("./environments/Pict-Environment-Log.js"),e.exports.isBrowser=new Function("try {return (this===window);} catch(pError) {return false;}")},{"./Pict-CSS.js":112,"./Pict-Content-Assignment.js":113,"./Pict-DataProvider.js":114,"./Pict-Meadow-EntityProvider.js":115,"./Pict-Template-Provider.js":116,"./environments/Pict-Environment-Log.js":118,fable:40,"pict-application":73,"pict-view":74}],118:[function(t,e,r){e.exports=class{constructor(t,e){this.contentMap="object"==typeof e?e:{},this.pict=t,this.truncateContentLength=256,this.storeEventLog=!0,this.eventLog={},this.eventLog.GetElement=[],this.eventLog.Read=[],this.eventLog.Prepend=[],this.eventLog.Append=[],this.eventLog.Assign=[],this.pict.ContentAssignment.customGetElementFunction=this.customGetElementFunction.bind(this),this.pict.ContentAssignment.customReadFunction=this.customReadFunction.bind(this),this.pict.ContentAssignment.customAppendFunction=this.customAppendFunction.bind(this),this.pict.ContentAssignment.customPrependFunction=this.customPrependFunction.bind(this),this.pict.ContentAssignment.customAssignFunction=this.customAssignFunction.bind(this)}createEventLogEntry(t,e){let r=void 0===e?"":e;return{TimeStamp:this.pict.log.getTimeStamp(),Hash:t,Content:r}}customGetElementFunction(t){return this.storeEventLog&&this.eventLog.GetElement.push(this.createEventLogEntry(t)),this.pict.log.info("Mocking an GET of Address -> [".concat(t,"]")),""}customReadFunction(t){return this.storeEventLog&&this.eventLog.Read.push(this.createEventLogEntry(t)),this.pict.log.info("Mocking an READ from Address -> [".concat(t,"]")),this.contentMap.hasOwnProperty(t)?this.contentMap[t]:(this.pict.log.warn("Mock read from Address ".concat(t," did not find a value in the content map.")),"")}customAppendFunction(t,e){return this.storeEventLog&&this.eventLog.Append.push(this.createEventLogEntry(t,e)),e.length>this.truncateContentLength?this.pict.log.info("Mocking an APPEND to Address -> [".concat(t,"] (log truncated to first ").concat(this.truncateContentLength," characters)"),{Content:e.substring(0,this.truncateContentLength)}):this.pict.log.info("Mocking an APPEND to Address -> [".concat(t,"]"),{Content:e}),""}customPrependFunction(t,e){return this.storeEventLog&&this.eventLog.Prepend.push(this.createEventLogEntry(t,e)),e.length>this.truncateContentLength?this.pict.log.info("Mocking an PREPEND to Address -> [".concat(t,"] (log truncated to first ").concat(this.truncateContentLength," characters)"),{Content:e.substring(0,this.truncateContentLength)}):this.pict.log.info("Mocking an PREPEND to Address -> [".concat(t,"]"),{Content:e}),""}customAssignFunction(t,e){return this.storeEventLog&&this.eventLog.Assign.push(this.createEventLogEntry(t,e)),e.length>this.truncateContentLength?this.pict.log.info("Mocking an ASSIGN to Address -> [".concat(t,"] (log truncated to first ").concat(this.truncateContentLength," characters)"),{Content:e.substring(0,this.truncateContentLength)}):this.pict.log.info("Mocking an ASSIGN to Address -> [".concat(t,"]"),{Content:e}),""}}},{}]},{},[117])(117)}));
|
|
12
12
|
//# sourceMappingURL=pict.min.js.map
|