UNPKG

falcor

Version:

A JavaScript library for efficient data fetching.

1 lines 79.2 kB
!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).falcor=e()}(function(){return function i(a,s,u){function c(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(f)return f(t,!0);var n=new Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}var o=s[t]={exports:{}};a[t][0].call(o.exports,function(e){return c(a[t][1][e]||e)},o,o.exports,i,a,s,u)}return s[t].exports}for(var f="function"==typeof require&&require,e=0;e<u.length;e++)c(u[e]);return c}({1:[function(e,t,r){var n=e(33),o=e(120);n.atom=o.atom,n.ref=o.ref,n.error=o.error,n.pathValue=o.pathValue,n.HttpDataSource=e(115),t.exports=n},{115:115,120:120,33:33}],2:[function(e,t,r){function n(){}var o=e(4),i=e(3),a=e(43),s=e(51),u=e(49),c=e(50),f=e(65),p=e(64),l=e(39),h=e(124),d=e(77),v=e(89),y=e(91),_=e(87),g=e(88),x=e(67),m=e(66),b=e(120),w=0,$=e(105),P=e(18),k=e(23),E=e(58);function O(e){var t=e||{};this._root=t._root||new o(t),this._path=t.path||t._path||[],this._source=t.source||t._source,this._request=t.request||t._request||new a(this,t.scheduler||new p),this._ID=w++,"number"==typeof t.maxSize?this._maxSize=t.maxSize:this._maxSize=t._maxSize||O.prototype._maxSize,"number"==typeof t.maxRetries?this._maxRetries=t.maxRetries:this._maxRetries=t._maxRetries||O.prototype._maxRetries,"number"==typeof t.collectRatio?this._collectRatio=t.collectRatio:this._collectRatio=t._collectRatio||O.prototype._collectRatio,(t.boxed||t.hasOwnProperty("_boxed"))&&(this._boxed=t.boxed||t._boxed),(t.materialized||t.hasOwnProperty("_materialized"))&&(this._materialized=t.materialized||t._materialized),"boolean"==typeof t.treatErrorsAsValues?this._treatErrorsAsValues=t.treatErrorsAsValues:t.hasOwnProperty("_treatErrorsAsValues")?this._treatErrorsAsValues=t._treatErrorsAsValues:this._treatErrorsAsValues=!1,"boolean"==typeof t.disablePathCollapse?this._enablePathCollapse=!t.disablePathCollapse:t.hasOwnProperty("_enablePathCollapse")?this._enablePathCollapse=t._enablePathCollapse:this._enablePathCollapse=!0,"boolean"==typeof t.disableRequestDeduplication?this._enableRequestDeduplication=!t.disableRequestDeduplication:t.hasOwnProperty("_enableRequestDeduplication")?this._enableRequestDeduplication=t._enableRequestDeduplication:this._enableRequestDeduplication=!0,this._useServerPaths=t._useServerPaths||!1,this._allowFromWhenceYouCame=t.allowFromWhenceYouCame||t._allowFromWhenceYouCame||!1,this._treatDataSourceErrorsAsJSONGraphErrors=t._treatDataSourceErrorsAsJSONGraphErrors||!1,t.cache&&this.setCache(t.cache)}(t.exports=O).ref=b.ref,O.atom=b.atom,O.error=b.error,O.pathValue=b.pathValue,(O.prototype.constructor=O).prototype._materialized=!1,O.prototype._boxed=!1,O.prototype._progressive=!1,O.prototype._treatErrorsAsValues=!1,O.prototype._maxSize=Math.pow(2,53)-1,O.prototype._maxRetries=3,O.prototype._collectRatio=.75,O.prototype._enablePathCollapse=!0,O.prototype._enableRequestDeduplication=!0,O.prototype.get=e(57),O.prototype._getOptimizedBoundPath=function(){return this._path?this._path.slice():this._path},O.prototype._getWithPaths=e(56),O.prototype.set=e(60),O.prototype.preload=function(){var t=$(arguments,E,"preload");if(!0!==t)return new s(function(e){e.onError(t)});var e=Array.prototype.slice.call(arguments),r=this;return new s(function(t){return r.get.apply(r,e).subscribe(function(){},function(e){t.onError(e)},function(){t.onCompleted()})})},O.prototype.call=function(){for(var e=-1,t=arguments.length,r=new Array(t);++e<t;){var n=arguments[e],o=typeof(r[e]=n);if(1<e&&!Array.isArray(n)||0===e&&!Array.isArray(n)&&"string"!=o||1===e&&!Array.isArray(n)&&!y(n))return new s(function(e){e.onError(new Error("Invalid argument"))})}return new u(this,r[0],r[1],r[2],r[3])},O.prototype.invalidate=function(){for(var e=-1,t=arguments.length,r=[];++e<t;)if(r[e]=h.fromPath(arguments[e]),!Array.isArray(r[e])||!r[e].length)throw new Error("Invalid argument");new c(this,r).subscribe(n,function(e){throw e})},O.prototype.deref=e(6),O.prototype._hasValidParentReference=e(5),O.prototype.getValue=e(20),O.prototype.setValue=e(69),O.prototype._getValueSync=e(28),O.prototype._setValueSync=e(70),O.prototype._derefSync=e(7),O.prototype.setCache=function(e){var t,r,n,o=this._root.cache;return e!==o?(t=this._root,r=this._path,this._path=[],this._root.cache={},void 0!==o&&l(t,t.expired,d(o),0),g(e)?n=m(this,[e])[0]:_(e)?n=x(this,[e])[0]:v(e)&&(n=x(this,[{json:e}])[0]),n&&k.getWithPathsAsPathMap(this,n,[]),this._path=r):void 0===o&&(this._root.cache={}),this},O.prototype.getCache=function(){var e=Array.prototype.slice.call(arguments);if(0===e.length)return P(this._root.cache);var t=[{}],r=this._path;return k.getWithPathsAsJSONGraph(this,e,t),this._path=r,t[0].jsonGraph},O.prototype._setMaxSize=function(e){var t,r,n,o=this._maxSize;(this._maxSize=e)<o&&(n=(r=(t=this._root).cache).$_version,l(t,t.expired,d(r),this._maxSize,this._collectRatio,n))},O.prototype.getVersion=function(e){var t=e&&h.fromPath(e)||[];if(!1===Array.isArray(t))throw new Error("Model#getVersion must be called with an Array path.");return this._path.length&&(t=this._path.concat(t)),this._getVersion(this,t)},O.prototype._syncCheck=function(e){if(Boolean(this._source)&&this._root.syncRefCount<=0&&!1===this._root.unsafeMode)throw new Error("Model#"+e+" may only be called within the context of a request selector.");return!0},O.prototype._clone=function(e){var t=new this.constructor(this);for(var r in e){var n=e[r];"delete"===n?delete t[r]:t[r]=n}return t.setCache=void 0,t},O.prototype.batch=function(e){var t="number"==typeof e?new f(Math.round(Math.abs(e))):e&&e.schedule?e:new f(1),r=this._clone();return r._request=new a(r,t),r},O.prototype.unbatch=function(){var e=this._clone();return e._request=new a(e,new p),e},O.prototype.treatErrorsAsValues=function(){return this._clone({_treatErrorsAsValues:!0})},O.prototype.asDataSource=function(){return new i(this)},O.prototype._materialize=function(){return this._clone({_materialized:!0})},O.prototype._dematerialize=function(){return this._clone({_materialized:"delete"})},O.prototype.boxValues=function(){return this._clone({_boxed:!0})},O.prototype.unboxValues=function(){return this._clone({_boxed:"delete"})},O.prototype.withoutDataSource=function(){return this._clone({_source:"delete"})},O.prototype.toJSON=function(){return{$type:"ref",value:this._path}},O.prototype.getPath=function(){return this._path?this._path.slice():this._path},O.prototype._fromWhenceYouCame=function(e){return this._clone({_allowFromWhenceYouCame:void 0===e||e})},O.prototype._getBoundValue=e(17),O.prototype._getVersion=e(22),O.prototype._getPathValuesAsPathMap=k.getWithPathsAsPathMap,O.prototype._getPathValuesAsJSONG=k.getWithPathsAsJSONGraph,O.prototype._setPathValues=e(68),O.prototype._setPathMaps=e(67),O.prototype._setJSONGs=e(66),O.prototype._setCache=e(67),O.prototype._invalidatePathValues=e(38),O.prototype._invalidatePathMaps=e(37)},{105:105,120:120,124:124,17:17,18:18,20:20,22:22,23:23,28:28,3:3,37:37,38:38,39:39,4:4,43:43,49:49,5:5,50:50,51:51,56:56,57:57,58:58,6:6,60:60,64:64,65:65,66:66,67:67,68:68,69:69,7:7,70:70,77:77,87:87,88:88,89:89,91:91}],3:[function(e,t,r){function n(e){this._model=e._materialize().treatErrorsAsValues()}n.prototype.get=function(e){return this._model.get.apply(this._model,e)._toJSONG()},n.prototype.set=function(e){return this._model.set(e)._toJSONG()},n.prototype.call=function(e,t,r,n){var o=[e,t,r];return Array.prototype.push.apply(o,n),this._model.call.apply(this._model,o)._toJSONG()},t.exports=n},{}],4:[function(e,t,r){var n=e(85),o=e(80);function i(e){var t=e||{};this.syncRefCount=0,this.expired=t.expired||[],this.unsafeMode=t.unsafeMode||!1,this.cache={},n(t.comparator)&&(this.comparator=t.comparator),n(t.errorSelector)&&(this.errorSelector=t.errorSelector),n(t.onChange)&&(this.onChange=t.onChange)}i.prototype.errorSelector=function(e,t){return t},i.prototype.comparator=function(e,t){return o(e,"value")&&o(t,"value")?e.value===t.value&&e.$type===t.$type&&e.$expires===t.$expires:e===t},t.exports=i},{80:80,85:85}],5:[function(e,t,r){t.exports=function(){var e=this._referenceContainer;return!this._allowFromWhenceYouCame||(!0===e||!1!==e&&((!e||void 0!==e.$_parent)&&(!e||!e.$_invalidated)))}},{}],6:[function(e,t,r){var c=e(9),f=e(19),p=e(110);t.exports=function(e){var t,r=e&&e.$__path,n=e&&e.$__refPath,o=e&&e.$__toReference;if(r){var i="e";if(o&&(i=!1,t=f(this,o),n&&t&&t.$type===p))for(var a=t.value,s=0,u=n.length,i=!0;i&&s<u;++s)a[s]!==n[s]&&(i=!1);return i?"e"===i&&(t=!0):t=!1,this._clone({_path:r,_referenceContainer:t})}throw new c}},{110:110,19:19,9:9}],7:[function(e,t,r){var i=e(124),a=e(17),s=e(10);t.exports=function(e){var t=i.fromPath(e);if(!Array.isArray(t))throw new Error("Model#derefSync must be called with an Array path.");var r=a(this,this._path.concat(t),!1),n=r.path,o=r.value;if(r.found&&void 0!==o){if(o.$type)throw new s(n,n);return this._clone({_path:n})}}},{10:10,124:124,17:17}],8:[function(e,t,r){function n(){var e=new Error("It is not legal to use the JSON Graph format from a bound Model. JSON Graph format can only be used from a root model.");return e.name="BoundJSONGraphModelError",Object.setPrototypeOf&&Object.setPrototypeOf(e,Object.getPrototypeOf(this)),Error.captureStackTrace&&Error.captureStackTrace(e,n),e}e(14)(n),t.exports=n},{14:14}],9:[function(e,t,r){function n(){var e=new Error("Deref can only be used with a non-primitive object from get, set, or call.");return e.name="InvalidDerefInputError",Object.setPrototypeOf&&Object.setPrototypeOf(e,Object.getPrototypeOf(this)),Error.captureStackTrace&&Error.captureStackTrace(e,n),e}e(14)(n),t.exports=n},{14:14}],10:[function(e,t,r){function n(e,t){var r=new Error("The boundPath of the model is not valid since a value or error was found before the path end.");return r.name="InvalidModelError",r.boundPath=e,r.shortedPath=t,Object.setPrototypeOf&&Object.setPrototypeOf(r,Object.getPrototypeOf(this)),Error.captureStackTrace&&Error.captureStackTrace(r,n),r}e(14)(n),t.exports=n},{14:14}],11:[function(e,t,r){function n(e){var t=new Error("An exception was thrown when making a request.");return t.name="InvalidSourceError",t.innerError=e,Object.setPrototypeOf&&Object.setPrototypeOf(t,Object.getPrototypeOf(this)),Error.captureStackTrace&&Error.captureStackTrace(t,n),t}e(14)(n),t.exports=n},{14:14}],12:[function(e,t,r){function n(e){var t=new Error("The allowed number of retries have been exceeded.");return t.name="MaxRetryExceededError",t.missingOptimizedPaths=e||[],Object.setPrototypeOf&&Object.setPrototypeOf(t,Object.getPrototypeOf(this)),Error.captureStackTrace&&Error.captureStackTrace(t,n),t}e(14)(n),n.is=function(e){return e&&"MaxRetryExceededError"===e.name},t.exports=n},{14:14}],13:[function(e,t,r){function n(){var e=new Error("`null` and `undefined` are not allowed in branch key positions");return e.name="NullInPathError",Object.setPrototypeOf&&Object.setPrototypeOf(e,Object.getPrototypeOf(this)),Error.captureStackTrace&&Error.captureStackTrace(e,n),e}e(14)(n),t.exports=n},{14:14}],14:[function(e,t,r){t.exports=function(e){e.prototype=Object.create(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,Error):e.__proto__=Error}},{}],15:[function(e,t,r){var y=e(73),_=e(26),g=e(30),x=e(110),m=e(40);t.exports=function(e,t,r,n,o,i,a){for(var s,u=r,c=o,f=n,p=0;;){if(!(s=0===p&&f.$_context?(p=c.length,f.$_context):u[c[p++]])){u=void 0;break}var l=s.$type,h=l&&s.value||s;if(p<c.length){if(l){u=s;break}u=s}else{if(u=s,l&&g(s))break;if(f.$_context||y(f,s),l!==x)break;a?_(e,s,i,null,null,null,null,c,c.length,a):m(e._root,s),p=0,c=h,f=s,u=t}}if(p<c.length&&void 0!==u){for(var d=[],v=0;v<p;v++)d[v]=c[v];c=d}return[u,c,f]}},{110:110,26:26,30:30,40:40,73:73}],16:[function(e,t,r){var g=e(19),x=e(10),m=e(8);t.exports=function(y,_){return function(e,t,r){var n,o,i,a,s,u=_?r:[{}],c=u[0],f={values:u,optimizedPaths:[]},p=e._root.cache,l=e._path,h=p,d=[],v=[];if(l.length){if(_)return{criticalError:new m};if(o=(n=e._getOptimizedBoundPath()).length,(h=g(e,n))&&h.$type)return{criticalError:new x(l,n)};s=e._referenceContainer}else n=[],o=0;for(i=0,a=t.length;i<a;i++)y(e,p,h,t[i],0,c,f,v,d,n,o,_,!1,s);return function e(t,r){if(t!==r&&null!==t&&"object"==typeof t&&!t.$type&&null!==r&&"object"==typeof r&&!r.$type)for(var n in r){var o;"$__path"!==n&&(void 0===(o=t[n])?t[n]=r[n]:e(o,r[n]))}}(c,t.length?r[0]:_?{jsonGraph:{},paths:[]}:{json:{}}),f}}},{10:10,19:19,8:8}],17:[function(e,t,r){var f=e(21),p=e(10);t.exports=function(e,t,r){var n,o,i,a,s=t,u=t,c=e._boxed;for(r=e._materialized,n=e._treatErrorsAsValues,e._boxed=!0,e._materialized=void 0===r||r,e._treatErrorsAsValues=!0,o=f(e,s.concat(null),!0),e._boxed=c,e._materialized=r,e._treatErrorsAsValues=n,s=o.optimizedPath,i=o.shorted,a=o.found,o=o.value;s.length&&null===s[s.length-1];)s.pop();if(a&&i)throw new p(u,s);return{path:s,value:o,shorted:i,found:a}}},{10:10,21:21}],18:[function(e,t,r){var c=e(86);function f(e){for(var t,r={},n=Object.keys(e),o=0,i=n.length;o<i;o++)t=n[o],c(t)||(r[t]=e[t]);return r}t.exports=function(e){var t={};return function a(s,u,e){Object.keys(s).filter(function(e){return!c(e)&&void 0!==s[e]}).forEach(function(e){var t=s[e],r=u[e];if(r=r||(u[e]={}),t.$type){var n,o=t.value&&"object"==typeof t.value,i=!t.$_modelCreated;return n=o||i?f(t):t.value,void(u[e]=n)}a(t,r,e)})}(e,t),t}},{86:86}],19:[function(e,t,r){t.exports=function(e,t){for(var r=e._root.cache,n=-1,o=t.length;++n<o&&r&&!r.$type;)r=r[t[n]];return r}},{}],20:[function(e,t,r){var o=e(51),a=e(124);t.exports=function(e){for(var i=a.fromPath(e),t=0,r=i.length;++t<r;)if("object"==typeof i[t])return new o(function(e){e.onError(new Error("Paths must be simple paths"))});var n=this;return new o(function(o){return n.get(i).subscribe(function(e){for(var t=e.json,r=-1,n=i.length;t&&++r<n;)t=t[i[r]];o.onNext(t)},function(e){o.onError(e)},function(){o.onCompleted()})})}},{124:124,51:51}],21:[function(e,t,r){var x=e(15),m=e(29),b=e(30),w=e(40),$=e(110),P=e(108),k=e(109);t.exports=function(e,t,r){for(var n,o,i,a,s,u=e._root.cache,c=t.length,f=[],p=!1,l=!1,h=0,d=u,v=u,y=u,_=!0,g=!1;d&&h<c;){if(null!==(n=t[h++])&&(d=v[n],f[f.length]=n),!d){_=!(p=!(y=void 0));break}if((i=d.$type)===P&&void 0===d.value){y=void 0,_=!1,p=h<c;break}if(h<c){if(i===$){if(b(d)){g=!0,y=void 0;break}if(!(s=(a=x(e,u,u,d,d.value))[0])){d=y=void 0,_=!1;break}i=s.$type,d=s,f=a[1].slice(0)}if(i)break}else y=d;v=d}if(h<c&&!g){for(o=h;o<c;++o)if(null!==t[h]){l=!0;break}for(y=l?void(p=!0):d,o=h;o<c;++o)null!==t[o]&&(f[f.length]=t[o])}if(y&&i&&(b(y)?y=void 0:w(e._root,y)),y&&i===k&&!e._treatErrorsAsValues)throw{path:h===c?t:t.slice(0,h),value:y.value};return{value:y=y&&e._boxed?Boolean(i)&&!r?m(y):y:!y&&e._materialized?{$type:P}:y&&y.value,shorted:p,optimizedPath:f,found:_}}},{108:108,109:109,110:110,15:15,29:29,30:30,40:40}],22:[function(e,t,r){var o=e(21);t.exports=function(e,t){var r=o({_boxed:!0,_root:e._root,_treatErrorsAsValues:e._treatErrorsAsValues},t,!0).value,n=r&&r.$_version;return null==n?-1:n}},{21:21}],23:[function(e,t,r){var n=e(16),o=e(32),i=n(o,!1),a=n(o,!0);t.exports={getValueSync:e(21),getBoundValue:e(17),getWithPathsAsPathMap:i,getWithPathsAsJSONGraph:a}},{16:16,17:17,21:21,32:32}],24:[function(e,t,r){var a=e(40),s=e(29);t.exports=function(e,t,r,n,o){var i=t.value;o.errors||(o.errors=[]),e._boxed&&(i=s(t)),o.errors.push({path:n.slice(0,r),value:i}),a(e._root,t)}},{29:29,40:40}],25:[function(e,t,r){t.exports=function(e,t,r,n,o,i,a){var s;if(n.requestedMissingPaths||(n.requestedMissingPaths=[],n.optimizedMissingPaths=[]),r<t.length){for(var u=r;u<t.length;++u)if(function(e){if(null===e||"object"!=typeof e)return!1;var t=Array.isArray(e);{if(t&&e.length)return!1;if(t)return!0}var r=e.from,n=e.to;if(void 0===r||r<=n)return!1;return!0}(t[u]))return;s=t.slice(r)}else s=[];!function(e,t,r,n,o,i){var a=r.slice(0,t);Array.prototype.push.apply(a,e),i.requestedMissingPaths[i.requestedMissingPaths.length]=a;var s=n.slice(0,o);Array.prototype.push.apply(s,e),i.optimizedMissingPaths[i.optimizedMissingPaths.length]=s}(s,r,o,i,a,n)}},{}],26:[function(e,t,r){var P=e(40),k=e(29),E=e(110),O=e(108),S=e(109);t.exports=function(e,t,r,n,o,i,a,s,u,c){if(t&&P(e._root,t),r){var f,p,l,h,d,v,y,_,g,x=null,m=!1,b=t&&t.$type,w=t&&t.value;void 0===w&&(m=e._materialized),g=m?{$type:O}:e._boxed?k(t):c||b!==E?b===E||b===S?c?k(t):w:c?(y=w&&"object"==typeof w,_=!t||!t.$_modelCreated,y||_?k(t):w):t&&void 0===b&&void 0===w?{}:w:void 0;var $=!1;if(c){for((d=r.jsonGraph)||($=!0,d=r.jsonGraph={},r.paths=[]),f=0,p=u-1;f<p;f++)d[h=s[f]]||($=!0,d[h]={}),d=d[h];d[h=s[f]]=m?{$type:O}:g,a&&r.paths.push(a.slice(0,n))}else if(0===n)$=!0,r.json=g;else{for((d=r.json)||($=!0,d=r.json={}),f=0;f<n-1;f++)d[l=a[f]]||($=!0,d[l]=i[f]),d=(x=d)[v=l];l=a[f],void 0!==g&&(null!=l?($=!0,d[l]||(d[l]=g)):x[v]=g)}o&&(o.hasValues=$)}}},{108:108,109:109,110:110,29:29,40:40}],27:[function(e,t,r){var d=e(30),v=e(109),y=e(24),_=e(26),g=e(25),x=e(31),m=e(75),b=e(74);t.exports=function(e,t,r,n,o,i,a,s,u,c,f,p){var l=t&&t.$type;if(!t||!l){var h=x(e);return!h&&f||_(e,t,o,n,i,a,s,u,c,f),void(h||g(e,r,n,i,s,u,c))}!d(t)||t.$_version===b.getVersion()&&0===t.$expires?l===v?(p&&(s[n]=null,n+=1),f||e._treatErrorsAsValues?_(e,t,o,n,i,a,s,u,c,f):(_(e,void 0,o,n,i,a,s,u,c,f),y(e,t,n,s,i))):(p&&(s[n]=null,n+=1),_(e,t,o,n,i,a,s,u,c,f)):(t.$_invalidated||m(t,e._root.expired,e._root),g(e,r,n,i,s,u,c))}},{109:109,24:24,25:25,26:26,30:30,31:31,74:74,75:75}],28:[function(e,t,r){var n=e(124),o=e(21);t.exports=function(e){var t=n.fromPath(e);if(!1===Array.isArray(t))throw new Error("Model#_getValueSync must be called with an Array path.");return this._path.length&&(t=this._path.concat(t)),this._syncCheck("getValueSync"),o(this,t).value}},{124:124,21:21}],29:[function(e,t,r){var n=e(34);t.exports=function(e){if(void 0===e)return e;var t={};for(var r in e)0!==r.lastIndexOf(n,0)&&(t[r]=e[r]);return t}},{34:34}],30:[function(e,t,r){t.exports=e(84)},{84:84}],31:[function(e,t,r){t.exports=function(e){return e._materialized&&!e._source}},{}],32:[function(e,t,r){var C=e(15),R=e(27),V=e(26),q=e(30),T=e(136).iterateKeySet,M=e(110),z=e(40);t.exports=function e(t,r,n,o,i,a,s,u,c,f,p,l,h,d){var v=h,y=f,_=d;if(n&&!n.$type&&i!==o.length){var g=o[i],x=!1,m=g;null!==g&&"object"==typeof g&&(m=T(g,x={}));var b,w,$,P,k,E,O,S,j=t._allowFromWhenceYouCame,A=p+1,N=i+1;do{null!=m?(v=!1,y[p]=m,E=y,O=A,(P=n[c[i]=m])&&(w=(b=P.$type)&&P.value||P,N<o.length&&b&&b===M&&!q(P)&&(z(t._root,P),l&&V(t,P,a,N,s,null,null,y,O,l),v=!0,P=($=C(t,r,r,P,w,a,l))[0],k=$[1],_=$[2],E=k.slice(),O=k.length),P&&(S=_&&j?{$__path:P.$_absolutePath,$__refPath:_.value,$__toReference:_.$_absolutePath}:{$__path:P.$_absolutePath},u[i]=S)),e(t,r,P,o,N,a,s,u,c,E,O,l,v,_),x&&!x.done&&(m=T(g,x))):(V(t,n,a,i,s,u,c,y,p,l),x&&!x.done&&(m=T(g,x)))}while(x&&!x.done)}else R(t,n,o,i,a,s,u,c,y,p,l,v)}},{110:110,136:136,15:15,26:26,27:27,30:30,40:40}],33:[function(e,t,r){"use strict";function n(e){return new n.Model(e)}n.keys=function(e){if(e)return Object.keys(e).filter(function(e){return"$__path"!==e})},(t.exports=n).Model=e(2)},{2:2}],34:[function(e,t,r){var n=e(36);t.exports=n+"_"},{36:36}],35:[function(e,t,r){t.exports=e(34)+"ref"},{34:34}],36:[function(e,t,r){t.exports="$"},{}],37:[function(e,t,r){var f=e(73),v=e(36),c=e(110),y=e(17),p=e(40),_=e(77),g=e(80),x=e(89),l=e(84),m=e(85),b=e(91),h=e(75),w=e(81),$=e(104),P=e(98);function k(e,t,r,n,o,i,a){for(var s=r.$type;s===c;){var u=function(e,t,r,n){if(l(t))return h(t,r,n),[void 0,e];p(n,t);var o=t,i=t.value,a=e;if(null!=(t=t.$_context))a=t.$_parent||e;else{var s=0,u=i.length-1,a=t=e;do{var c=k(e,a,t,i[s],s<u,r,n);if(t=c[0],b(t))return c;a=c[1]}while(s++<u);o.$_context!==t&&f(o,t)}return[t,a]}(e,r,i,a);if(r=u[0],b(r))return u;t=u[1],s=r&&r.$type}if(void 0!==s)return[r,t];if(null==n){if(o)throw new Error("`null` is not allowed in branch key positions.");r&&(n=r.$_key)}else r=(t=r)[n];return[r,t]}t.exports=function(e,t){for(var r=e._root,n=r,o=r.expired,i=w(),a=e._path,s=r.cache,u=a.length?y(e,a).value:s,c=u.$_parent||s,f=s.$_version,p=-1,l=t.length;++p<l;){!function e(t,r,n,o,i,a,s){if(b(t)||t.$type)return;for(var u in t){var c,f,p,l,h;u[0]!==v&&g(t,u)&&(c=t[u],f=x(c)&&!c.$type,p=k(r,n,o,u,f,a,s),l=p[0],h=p[1],l&&(f?e(c,r,h,l,i,a,s):P(l,h,u,s)&&$(h,_(l),s,i)))}}(t[p].json,s,c,u,i,o,n)}var h=s.$_version,d=r.onChange;m(d)&&f!==h&&d()}},{104:104,110:110,17:17,36:36,40:40,73:73,75:75,77:77,80:80,81:81,84:84,85:85,89:89,91:91,98:98}],38:[function(e,t,r){var p=e(35),c=e(110),v=e(17),l=e(40),y=e(77),h=e(84),_=e(85),d=e(91),g=e(75),x=e(136).iterateKeySet,m=e(81),b=e(104),w=e(98);function $(e,t,r,n,o,i,a){for(var s=r.$type;s===c;){var u=function(e,t,r,n){if(h(t))return g(t,r,n),[void 0,e];l(n,t);var o=t,i=t.value,a=e;if(null!=(t=t.$_context))a=t.$_parent||e;else{var s,u=0,c=i.length-1,a=t=e;do{var f=$(e,a,t,i[u],u<c,r,n);if(t=f[0],d(t))return f;a=f[1]}while(u++<c);o.$_context!==t&&(s=t.$_refsLength||0,t.$_refsLength=s+1,(t[p+s]=o).$_context=t,o.$_refIndex=s)}return[t,a]}(e,r,i,a);if(r=u[0],d(r))return u;t=u[1],s=r.$type}if(void 0!==s)return[r,t];if(null==n){if(o)throw new Error("`null` is not allowed in branch key positions.");r&&(n=r.$_key)}else r=(t=r)[n];return[r,t]}t.exports=function(e,t){for(var r=e._root,n=r,o=r.expired,i=m(),a=e._path,s=r.cache,u=a.length?v(e,a).value:s,c=u.$_parent||s,f=s.$_version,p=-1,l=t.length;++p<l;){!function e(t,r,n,o,i,a,s,u){var c={};var f=r<t.length-1;var p=t[r];var l=x(p,c);do{var h=$(n,o,i,l,f,s,u),d=h[0],v=h[1];d&&(f?e(t,r+1,n,v,d,a,s,u):w(d,v,l,u,void 0)&&b(v,y(d),u,a)),l=x(p,c)}while(!c.done)}(t[p],0,s,c,u,i,o,n)}var h=s.$_version,d=r.onChange;_(d)&&f!==h&&d()}},{104:104,110:110,136:136,17:17,35:35,40:40,75:75,77:77,81:81,84:84,85:85,91:91,98:98}],39:[function(e,t,r){var d=e(97),v=e(104);t.exports=function(e,t,r,n,o,i){var a=r,s=o;"number"!=typeof s&&(s=.75);var u,c,f="number"==typeof i,p=n*s;for(h=t.pop();h;)a-=c=h.$size||0,!0==f?v(h,c,e,i):(u=h.$_parent)&&d(h,u,h.$_key,e),h=t.pop();if(n<=a){for(var l=e.$_tail,h=l;p<=a&&h;)l=l.$_prev,a-=c=h.$size||0,!0==f&&v(h,c,e,i),h=l;null==(e.$_tail=e.$_prev=h)?e.$_head=e.$_next=void 0:h.$_next=void 0}}},{104:104,97:97}],40:[function(e,t,r){var i=e(111);t.exports=function(e,t){var r,n,o;t.$expires!==i&&((r=e.$_head)?r!==t&&(n=t.$_prev,(o=t.$_next)&&(o.$_prev=n),n&&(n.$_next=o),t.$_prev=void 0,(((e.$_head=t).$_next=r).$_prev=t)===e.$_tail&&(e.$_tail=n)):e.$_head=e.$_tail=t)}},{111:111}],41:[function(e,t,r){t.exports=function(e,t){var r=t.$_prev,n=t.$_next;n&&(n.$_prev=r),r&&(r.$_next=n),t.$_prev=t.$_next=void 0,t===e.$_head&&(e.$_head=n),t===e.$_tail&&(e.$_tail=r)}},{}],42:[function(e,t,r){function n(e,t,r){this.sent=!1,this.scheduled=!1,this.requestQueue=t,this.id=++o,this.type=i,this._scheduler=e,this._attemptCount=r,this._pathMap={},this._optimizedPaths=[],this._requestedPaths=[],this._callbacks=[],this._count=0,this._disposable=null,this._collapsed=null,this._disposed=!1}var u=e(45),s=e(46),l=e(81),h=e(74),o=0,i=e(44).GetRequest,d=e(66),v=e(68),y=e(109),_=[],g=e(11);function x(r,n){var o=!1;return function(){var e,t;o||r._disposed||(o=!0,r._callbacks[n]=null,r._optimizedPaths[n]=[],r._requestedPaths[n]=[],e=--r._count,t=r._disposable,0==e&&(t.unsubscribe?t.unsubscribe():t.dispose(),r.requestQueue.removeRequest(r)))}}n.prototype={batch:function(e,t,r){var n,o,c=this,i=c._optimizedPaths,f=c._requestedPaths,p=c._callbacks,a=i.length;return i[a]=t,f[a]=e,p[a]=r,++c._count,c.scheduled||(c.scheduled=!0,o=c._scheduler.schedule(function(){n=s(c,i,function(e,t){var r,n,o,i=c.requestQueue.model;if(c.requestQueue.removeRequest(c),c._disposed=!0,i._treatDataSourceErrorsAsJSONGraphErrors?e instanceof g:e)for(r=0,o=p.length;r<o;++r)(n=p[r])&&n(e);else if(c._count){var a=l.getCurrentVersion();h.setVersion(a);var s={hasInvalidatedResult:!1},u=i._useServerPaths&&t&&void 0===t.paths?new Error("Server responses must include a 'paths' field when Model._useServerPaths === true"):void 0;for(u||c._merge(f,e,t,s),r=0,o=p.length;r<o;++r)(n=p[r])&&n(u||e,t,s.hasInvalidatedResult);h.setVersion(null)}}),c._disposable=n}),c._disposable=n||o),x(c,a)},add:function(e,t,r){var n,o=this,i=u(e,t,o._pathMap),a=!1,s=!1;return i.intersection.length&&(a=!0,n=o._callbacks.length,o._callbacks[n]=r,o._requestedPaths[n]=i.intersection,o._optimizedPaths[n]=[],++o._count,s=x(o,n)),[a,i.requestedComplement,i.optimizedComplement,s]},_merge:function(e,t,r,n){var o=this.requestQueue.model,i=o._root,a=i.errorSelector,s=i.comparator,u=o._path;o._path=_;var c,f,p=o._useServerPaths?r.paths:function(e){for(var t=[],r=-1,n=0,o=e.length;n<o;++n)for(var i=e[n],a=0,s=i.length;a<s;++a)t[++r]=i[a];return t}(e);t&&o._treatDataSourceErrorsAsJSONGraphErrors?((c=t)instanceof Error&&(c={message:c.message}),c.$type||(c={$type:y,value:c}),f=p.map(function(e){return{path:e,value:c}}),v(o,f,null,a,s,n)):d(o,[{paths:p,jsonGraph:r.jsonGraph}],null,a,s,n),o._path=u}},t.exports=n},{109:109,11:11,44:44,45:45,46:46,66:66,68:68,74:74,81:81}],43:[function(e,t,r){var y=e(44),n=e(47),_=e(42),o=e(136);function i(e,t){this.model=e,this.scheduler=t,this.requests=this._requests=[]}i.prototype={setScheduler:function(e){this.scheduler=e},set:function(e,t,r){return this.model._enablePathCollapse&&(e.paths=o.collapse(e.paths)),void 0===r&&(r=t,t=void 0),n(e,this.model,t,r)},get:function(e,t,r,n){var o,i,a,s,u=[],c=0,f=this._requests,p=t,l=e,h=!1;for(void 0===n&&(n=r,r=void 0),o=0,i=f.length;o<i;++o)if((a=f[o]).type===y.GetRequest){if(!a.sent){a.batch(l,p,v),l=p=null,++c;break}if(this.model._enableRequestDeduplication){var d=a.add(l,p,v);if(d[0]&&(l=d[1],p=d[2],u[u.length]=d[3],++c,!p.length))break}}function v(e,t,r){h||0===--c&&n(e,t,r)}return p&&p.length&&(a=new _(this.scheduler,this,r),f[f.length]=a,++c,s=a.batch(l,p,v),u[u.length]=s),function(){if(!h&&0!==c){h=!0;for(var e=u.length,t=0;t<e;++t)u[t]()}}},removeRequest:function(e){for(var t=this._requests,r=t.length;0<=--r;)if(t[r].id===e.id){t.splice(r,1);break}}},t.exports=i},{136:136,42:42,44:44,47:47}],44:[function(e,t,r){t.exports={GetRequest:"GET"}},{}],45:[function(e,t,r){var y=e(136).iterateKeySet;function f(e,t,r){for(var n=e.length-t.length,o=0;r&&o<-n;o++)r=r[t[o]];return r?0==n?_(e,t,r,0,[],[]):0<n?_(e,t,r,0,e.slice(0,n),[]):_(e,t,r,-n,[],t.slice(0,-n)):[[],[t],[e]]}function _(e,t,r,n,o,i){for(var a=e.length-t.length,s=[],u=[],c=[],f=t.length;n<f;++n){var p=t[n];if(p&&"object"==typeof p){for(var l={},h=y(p,l);!l.done;){var d,v=r[h];void 0===v?(c[c.length]=x(i,h,t,n+1),u[u.length]=x(o,h,e,n+1+a)):n===f-1?s[s.length]=m(o,h):(d=_(e,t,v,n+1,m(o,h),m(i,h)),Array.prototype.push.apply(s,d[0]),Array.prototype.push.apply(c,d[1]),Array.prototype.push.apply(u,d[2])),h=y(p,l)}break}if(r=r[p],i[i.length]=t[n],o[o.length]=e[n+a],void 0===r){c[c.length]=g(i,t,n+1),u[u.length]=g(o,e,n+a+1);break}n===f-1&&(s[s.length]=o)}return[s,c,u]}function g(e,t,r){var n=e.slice(),o=n.length,i=t.length-r;n.length=o+i;for(var a=0;a<i;++a)n[o+a]=t[r+a];return n}function x(e,t,r,n){var o=e.concat(t),i=o.length,a=r.length-n;o.length=i+a;for(var s=0;s<a;++s)o[i+s]=r[n+s];return o}function m(e,t){var r=e.slice();return r.push(t),r}t.exports=function(e,t,r){for(var n=[],o=[],i=[],a=0,s=t.length;a<s;++a){var u=t[a],c=f(e[a],u,r[u.length]);Array.prototype.push.apply(i,c[0]),Array.prototype.push.apply(n,c[1]),Array.prototype.push.apply(o,c[2])}return{intersection:i,optimizedComplement:n,requestedComplement:o}},t.exports.__test={findPartialIntersections:f}},{136:136}],46:[function(e,t,r){var n=e(136),m=n.toTree,b=n.toPaths,w=e(11);t.exports=function(e,t,r){if(0===e._count)return e.requestQueue.removeRequest(e),null;var n;e.sent=!0,e.scheduled=!1;var o,i,a=e.requestQueue.model;if(a._enablePathCollapse||a._enableRequestDeduplication){for(var s=e._pathMap,u=0,c=t.length;u<c;++u)for(var f=t[u],p=0,l=f.length;p<l;++p){var h,d=f[p],v=d.length;s[v]?(h=s[v])[h.length]=d:s[v]=[d]}for(var y=Object.keys(s),_=0,g=y.length;_<g;++_){var x=y[_];s[x]=m(s[x])}}n=a._enablePathCollapse?b(e._pathMap):1===t.length?t[0]:Array.prototype.concat.apply([],t);try{o=a._source.get(n,e._attemptCount)}catch(e){return r(new w),null}return o.subscribe(function(e){i=e},function(e){r(e,i)},function(){r(null,i)})}},{11:11,136:136}],47:[function(e,t,r){var l=e(66),h=e(68),d=e(11),v=[],y={dispose:function(){}};t.exports=function(e,r,t,n){var o,i,a=e.paths,s=r._root,u=s.errorSelector,c=s.comparator,f=r._path;try{i=r._source.set(e,t)}catch(e){return n(new d),y}var p=i.subscribe(function(e){var t;p&&p.disposed||(r._path=v,t=l(r,[{paths:a,jsonGraph:e.jsonGraph}],null,u,c),e.paths=t[1],r._path=f,o=e)},function(t){p&&p.disposed||(r._path=v,h(r,a.map(function(e){return{path:e,value:t}}),null,u,c),r._path=f,n(t))},function(){n(null,o)});return p}},{11:11,66:66,68:68}],48:[function(e,t,r){function n(e){this.disposed=!1,this.currentDisposable=e}n.prototype={dispose:function(){var e;!this.disposed&&this.currentDisposable&&(this.disposed=!0,(e=this.currentDisposable).dispose?e.dispose():e())}},t.exports=n},{}],49:[function(e,t,r){var n=e(51),f=e(11),i=e(124);function o(e,t,r,n,o){this.callPath=i.fromPath(t),this.args=r,o&&(this.paths=o.map(i.fromPath)),n&&(this.suffix=n.map(i.fromPath)),this.model=e}(o.prototype=Object.create(n.prototype))._subscribe=function(t){var r,e,n=this.callPath,o=this.args,i=this.suffix,a=this.paths,s=this.model,u=s._clone({_path:[]}),c=s._path.concat(n);if(s._source){try{e=s._source.call(c,o,i,a)}catch(e){return void t.onError(new f(e))}return e.subscribe(function(e){r=e},function(e){t.onError(e)},function(){var e=r.invalidated;e&&e.length&&u.invalidate.apply(u,e),u.withoutDataSource().set(r).subscribe(function(e){t.onNext(e)},function(e){t.onError(e)},function(){t.onCompleted()})})}t.onError(new Error("function does not exist"))},t.exports=o},{11:11,124:124,51:51}],50:[function(e,t,r){var c=Array.isArray,n=e(51),f=e(90),p=e(87),o={dispose:function(){}};function i(e,t){this._model=e;for(var r,n,o=[],i=-1,a=t.length;++i<a;){var s,u=t[i];if(c(u))s="PathValues";else if(f(u))s="PathValues";else{if(!p(u))throw new Error("Invalid Input");s="PathMaps"}n!==s&&(r={inputType:n=s,arguments:[]},o.push(r)),r.arguments.push(u)}this._groups=o}(i.prototype=Object.create(n.prototype)).progressively=function(){return this},i.prototype._toJSONG=function(){return this},i.prototype._subscribe=function(e){var n=this._model;return this._groups.forEach(function(e){var t=e.inputType,r=e.arguments;(0,n["_invalidate"+t])(n,r)}),e.onCompleted(),o},t.exports=i},{51:51,87:87,90:90}],51:[function(o,a,e){(function(r){var i=o(52),e=o(158).default,t=o(107);function n(e){this._subscribe=e}n.prototype[e]=function(){return t(this)},n.prototype._toJSONG=function(){return this},n.prototype.progressively=function(){return this},n.prototype.subscribe=n.prototype.forEach=function(e,t,r){var n=new i(e,t,r),o=this._subscribe(n);switch(typeof o){case"function":return{dispose:function(){n._closed||(n._closed=!0,o())}};case"object":return{dispose:function(){n._closed||(n._closed=!0,null!==o&&o.dispose())}};default:return{dispose:function(){n._closed=!0}}}},n.prototype.then=function(e,t){var i=this;return i._promise||(i._promise=new r(function(t,r){var n=!1,o=[];i.subscribe(function(e){o[o.length]=e},function(e){n=!0,r(e)},function(){var e=o;o.length<=1&&(e=o[0]),!1===n&&t(e)})})),i._promise.then(e,t)},a.exports=n}).call(this,"function"==typeof Promise?Promise:o(150))},{107:107,150:150,158:158,52:52}],52:[function(e,t,r){var n=e(94);function o(t,e,r){this._observer=t&&"object"==typeof t?{onNext:"function"==typeof t.onNext?function(e){t.onNext(e)}:n,onError:"function"==typeof t.onError?function(e){t.onError(e)}:n,onCompleted:"function"==typeof t.onCompleted?function(){t.onCompleted()}:n}:{onNext:"function"==typeof t?t:n,onError:"function"==typeof e?e:n,onCompleted:"function"==typeof r?r:n}}o.prototype={onNext:function(e){this._closed||this._observer.onNext(e)},onError:function(e){this._closed||(this._closed=!0,this._observer.onError(e))},onCompleted:function(){this._closed||(this._closed=!0,this._observer.onCompleted())}},t.exports=o},{94:94}],53:[function(e,t,r){function n(e,t,r,n,o){this.model=e,this.currentRemainingPaths=t,this.isJSONGraph=r||!1,this.isProgressive=n||!1,this.forceCollect=o||!1}var o=e(51),c=e(54),f=e(55),p={dispose:function(){}},l=e(39),h=e(77);(n.prototype=Object.create(o.prototype))._toJSONG=function(){return new n(this.model,this.currentRemainingPaths,!0,this.isProgressive,this.forceCollect)},n.prototype.progressively=function(){return new n(this.model,this.currentRemainingPaths,this.isJSONGraph,!0,this.forceCollect)},n.prototype._subscribe=function(e){var t,r,n,o=[],i=this.model,a=e.isJSONG=this.isJSONGraph,s=this.isProgressive,u=c(i,this.currentRemainingPaths,e,s,a,[{}],o);return u?f(this,i,u,e,o,1):(this.forceCollect&&(n=(r=(t=i._root).cache).$_version,l(t,t.expired,h(r),i._maxSize,i._collectRatio,n)),p)},t.exports=n},{39:39,51:51,54:54,55:55,77:77}],54:[function(e,t,r){var n=e(23),d=n.getWithPathsAsJSONGraph,v=n.getWithPathsAsPathMap;t.exports=function(e,t,r,n,o,i,a){var s=(o?d:v)(e,t,i),u=s.values&&s.values[0],c=!s.requestedMissingPaths||!s.requestedMissingPaths.length||!e._source;if(s.errors)for(var f=s.errors,p=a.length,l=0,h=f.length;l<h;++l,++p)a[p]=f[l];return(n||c&&void 0!==u)&&r.onNext(u),s.criticalError?(r.onError(s.criticalError),null):c?(a.length?r.onError(a):r.onCompleted(),null):s}},{23:23}],55:[function(e,t,r){var g=e(54),s=e(12),x=e(39),m=e(77),u=e(48),b=e(11);t.exports=function c(f,p,l,h,d,v){if(v>p._maxRetries)return h.onError(new s(l.optimizedMissingPaths)),{dispose:function(){}};var e=p._request,y=l.requestedMissingPaths,t=l.optimizedMissingPaths,_=new u,r=[],n=p._path;if(n.length)for(var o=0,i=y.length;o<i;++o)r[o]=n.concat(y[o]);else r=y;var a=e.get(r,t,v,function(e,t,r){if(p._treatDataSourceErrorsAsJSONGraphErrors?e instanceof b:e)return l.hasValues&&h.onNext(l.values&&l.values[0]),void h.onError(e);var n,o,i,a,s=r?(n=f.currentRemainingPaths,[{}]):(n=y,l.values),u=g(p,n,h,f.isProgressive,f.isJSONGraph,s,d);u?_.currentDisposable=c(f,p,u,h,d,v+1):(a=(i=(o=p._root).cache).$_version,x(o,o.expired,m(i),p._maxSize,p._collectRatio,a))});return _.currentDisposable=a,_}},{11:11,12:12,39:39,48:48,54:54,77:77}],56:[function(e,t,r){var n=e(53);t.exports=function(e){return new n(this,e)}},{53:53}],57:[function(e,t,r){var n=e(124),o=e(51),i=e(58),a=e(105),s=e(53);t.exports=function(){var t=a(arguments,i,"get");if(!0!==t)return new o(function(e){e.onError(t)});var e=n.fromPathsOrPathValues(arguments);return new s(this,e)}},{105:105,124:124,51:51,53:53,58:58}],58:[function(e,t,r){t.exports={path:!0,pathSyntax:!0}},{}],59:[function(e,t,r){function n(e,t,r,n){this._model=e,this._isJSONGraph=r||!1,this._isProgressive=n||!1,this._initialArgs=t,this._value=[{}];for(var o,i,a=[],s=-1,u=t.length;++s<u;){var c,f=t[s];l(f)||"string"==typeof f?(f=p.fromPath(f),c="PathValues"):h(f)?(f.path=p.fromPath(f.path),c="PathValues"):d(f)?c="JSONGs":v(f)&&(c="PathMaps"),i!==c&&(o={inputType:i=c,arguments:[]},a.push(o)),o.arguments.push(f)}this._groups=a}var o=e(51),p=e(124),l=Array.isArray,h=e(90),d=e(88),v=e(87),i=e(62);(n.prototype=Object.create(o.prototype))._subscribe=function(e){var t=this._groups,r=this._model,n=this._isJSONGraph,o=this._isProgressive;return i(r,e,t,n,o,1)},n.prototype._toJSONG=function(){return new n(this._model,this._initialArgs,!0,this._isProgressive)},n.prototype.progressively=function(){return new n(this._model,this._initialArgs,this._isJSONGraph,!0)},t.exports=n},{124:124,51:51,62:62,87:87,88:88,90:90}],60:[function(e,t,r){var o=e(63),i=e(105),a=e(59),s=e(51);t.exports=function(){var t=i(arguments,o,"set");if(!0!==t)return new s(function(e){e.onError(t)});for(var e=-1,r=arguments.length,n=[];++e<r;)n[e]=arguments[e];return new a(this,n)}},{105:105,51:51,59:59,63:63}],61:[function(e,t,r){var l=e(71);function h(e){return e.path}function d(e){return e.paths}t.exports=function(e,t){for(var r=e._root.errorSelector,n=-1,o=t.length,i=[],a=[],s={requestedPaths:i,optimizedPaths:a};++n<o;){var u,c=t[n],f=c.inputType,p=c.arguments;0<p.length&&(u=(0,e["_set"+f])(e,p,null,r),a.push.apply(a,u[1]),"PathValues"===f?i.push.apply(i,p.map(h)):"JSONGs"===f?i.push.apply(i,l(p,d)):i.push.apply(i,u[0]))}return s}},{71:71}],62:[function(e,t,r){var x=[],m=e(48),i=e(53),b=e(61),w=e(23).getWithPathsAsPathMap,$=e(11),P=e(12);function k(e,t,r,n,o){return new i(e,r,n,o,!0).subscribe(t)}t.exports=function n(o,i,a,s,u,c){var f,e=b(o,a),p=e.optimizedPaths,l=e.requestedPaths;if(c>o._maxRetries)return i.onError(new P(p)),{dispose:function(){}};if(void 0===o._source)return k(o,i,l,s,u);if(u){var t=w(o,l,[{}]);if(t.criticalError)return i.onError(t.criticalError),null;i.onNext(t.values[0]),f=o._root.cache.$_version}var r,h,d,v,y=(h=p,d=(r=o)._path,v={},r._path=x,r._getPathValuesAsJSONG(r._materialize().withoutDataSource(),h,[v]),r._path=d,v),_=new m,g=o._request.set(y,c,function(e,t){if(e instanceof $)i.onError(e);else{var r=!1;if(!e&&p.length!==t.paths.length||(r=!0),u)if(!(o._root.cache.$_version!==f))return void i.onCompleted();r?_.currentDisposable=k(o,i,l,s,u):n(o,i,a,s,u,c+1)}});return _.currentDisposable=g,_}},{11:11,12:12,23:23,48:48,53:53,61:61}],63:[function(e,t,r){t.exports={pathValue:!0,pathSyntax:!0,json:!0,jsonGraph:!0}},{}],64:[function(e,t,r){var n={dispose:function(){}};function o(){}o.prototype.schedule=function(e){return e(),n},o.prototype.scheduleWithState=function(e,t){return t(this,e),n},t.exports=o},{}],65:[function(e,t,r){function n(e){this.delay=e}function o(e){this.id=e,this.disposed=!1}n.prototype.schedule=function(e){var t=setTimeout(e,this.delay);return new o(t)},n.prototype.scheduleWithState=function(e,t){var r=this,n=setTimeout(function(){t(r,e)},this.delay);return new o(n)},o.prototype.dispose=function(){this.disposed||(clearTimeout(this.id),this.disposed=!0)},t.exports=n},{}],66:[function(e,t,r){var b=e(73),g=e(110),w=e(83),k=e(85),$=e(91),P=e(75),O=e(136).iterateKeySet,E=e(81),x=e(92),m=e(13);t.exports=function(e,t,r,n,o,i){for(var a=e._root,s=a,u=a.expired,c=E(),f=a.cache,p=f.$_version,l=[],h=[],d=[],v=[],y=-1,_=t.length;++y<_;)for(var g=t[y],x=g.paths,m=g.jsonGraph,b=-1,w=x.length;++b<w;){(function e(t,r,n,o,i,a,s,u,c,f,p,l,h,d,v,y,_,g){var x={};var m=r<t.length-1;var b=t[r];var w=O(b,x);var $=l.index;for(;;){p.depth=r;var P=j(n,o,i,a,s,u,w,m,p,l,h,d,v,y,_,g);p[r]=w,p.index=r,l[l.index++]=w;var k=P[0],E=P[1];if(k&&(m?e(t,r+1,n,E,k,a,P[3],P[2],c,f,p,l,h,d,v,y,_,g):(c.push(p.slice(0,p.index+1)),f.push(l.slice(0,l.index)))),w=O(b,x),x.done)break;l.index=$}})(x[b],h.index=0,f,f,f,m,m,m,d,v,l,h,c,u,s,o,n,i)}var $=f.$_version,P=a.onChange;return k(P)&&p!==$&&P(),[d,v]};var S=new Array(4);function j(e,t,r,n,o,i,a,s,u,c,f,p,l,h,d,v){for(var y=r.$type;y===g;){var _=function(e,t,r,n,o,i,a,s,u,c,f,p){var l=t.value;if(i.length=0,i.push.apply(i,l),w(t))return i.index=l.length,P(t,s,u),S[0]=void 0,S[1]=e,S[2]=n,S[3]=r,S;var h=0,d=t,v=l.length-1,y=t=e,_=n=r;do{var g=l[h],x=h<v;i.index=h;var m=j(e,y,t,r,_,n,g,x,o,i,a,s,u,c,f,p);if(t=m[0],$(t))return i.index=h,m;y=m[1],n=m[2],_=m[3]}while(h++<v);return i.index=h,d.$_context!==t&&b(d,t),S[0]=t,S[1]=y,S[2]=n,S[3]=_,S}(e,r,n,i,u,c,f,p,l,h,d,v);if(r=_[0],$(r))return _;t=_[1],i=_[2],o=_[3],y=r.$type}if(void 0!==y)return S[0]=r,S[1]=t,S[2]=i,S[3]=o,S;if(null==a){if(s)throw new m;r&&(a=r.$_key)}else o=i,r=(t=r)[a],i=o&&o[a];return r=x(t,r,i,a,u,c,f,p,l,h,d,v),S[0]=r,S[1]=t,S[2]=i,S[3]=o,S}},{110:110,13:13,136:136,73:73,75:75,81:81,83:83,85:85,91:91,92:92}],67:[function(e,t,r){var y=e(73),o=e(36),_=e(110),P=e(17),i=Array.isArray,a=e(80),k=e(89),g=e(84),E=e(85),x=e(91),m=e(75),O=e(81),b=e(93),w=e(13);function S(e,t,r,n,o,i,a,s,u,c,f,p,l,h){for(var d=r.$type;d===_;){var v=function(e,t,r,n,o,i,a,s,u,c){var f=r.value;if(o.length=0,o.push.apply(o,f),g(r))return o.index=f.length,m(r,a,s),[void 0,t];var p=r,l=t;if(null!=(r=r.$_context))l=r.$_parent||t,o.index=f.length;else{var h=0,d=f.length-1;o.index=h,l=r=t;do{var v=S(t,l,r,f[h],e,h<d,!0,n,o,i,a,s,u,c);if(r=v[0],x(r))return o.index=h,v;l=v[1]}while(h++<d);o.index=h,p.$_context!==r&&y(p,r)}return[r,l]}(o,e,r,s,u,c,f,p,l,h);if(r=v[0],x(r))return v;t=v[1],d=r&&r.$type}if(void 0!==d)return[r,t];if(null==n){if(i)throw new w;r&&(n=r.$_key)}else r=(t=r)[n];return[r=b(t,r,n,o,i,a,s,u,c,f,p,l,h),t]}function j(e){if(k(e)&&!e.$type){var t=[],r=0;for(var n in i(e)&&(t[r++]="length"),e)n[0]!==o&&a(e,n)&&(t[r++]=n);return t}}t.exports=function(e,t,r,n,o){for(var i=e._root,a=i,s=i.expired,u=O(),c=e._path,f=i.cache,p=c.length?P(e,c).value:f,l=p.$_parent||f,h=f.$_version,d=[],v=[],y=[],_=c.length,g=-1,x=t.length;++g<x;){var m=t[g],b=c.slice(0);b.index=_,function e(t,r,n,o,i,a,s,u,c,f,p,l,h,d){var v=j(t);if(v&&v.length)for(var y=0,_=v.length,g=c.index;;){var x=v[y],m=t[x],b=k(m)&&!m.$type;u.depth=r;var w=S(n,o,i,x,m,b,!1,u,c,f,p,l,h,d);u[r]=x,u.index=r,c[c.index++]=x;var $=w[0],P=w[1];if($&&(b?e(m,r+1,n,P,$,a,s,u,c,f,p,l,h,d):(a.push(u.slice(0,u.index+1)),s.push(c.slice(0,c.index)))),++y>=_)break;c.index=g}}(m.json,0,f,l,p,v,y,d,b,u,s,a,o,n)}var w=f.$_version,$=i.onChange;return E($)&&h!==w&&$(),[v,y]}},{110:110,13:13,17:17,36:36,73:73,75:75,80:80,81:81,84:84,85:85,89:89,91:91,93:93}],68:[function(e,t,r){var x=e(73),_=e(110),E=e(17),m=e(84),O=e(85),b=e(91),w=e(75),S=e(136).iterateKeySet,j=e(81),g=e(93),$=e(13);function A(e,t,r,n,o,i,a,s,u,c,f,p,l,h,d){for(var v=r.$type;v===_;){var y=function(e,t,r,n,o,i,a,s,u,c,f){var p=r.value;if(o.length=0,o.push.apply(o,p),m(r))return o.index=p.length,w(r,a,s),[void 0,t];var l=r,h=t;if(null!=(r=r.$_context))h=r.$_parent||t,o.index=p.length;else{var d=0,v=p.length-1,h=r=t;do{var y=p[d],_=d<v;o.index=d;var g=A(t,h,r,y,e,_,!0,n,o,i,a,s,u,c,f);if(r=g[0],b(r))return o.index=d,g;h=g[1]}while(d++<v);o.index=d,l.$_context!==r&&x(l,r)}return[r,h]}(o,e,r,s,u,c,f,p,l,h,d);if(r=y[0],b(r))return y;t=y[1],v=r.$type}if(i&&void 0!==v)return[r,t];if(null==n){if(i)throw new $;r&&(n=r.$_key)}else r=(t=r)[n];return[r=g(t,r,n,o,i,a,s,u,c,f,p,l,h,d),t]}t.exports=function(e,t,r,n,o){for(var i=e._root,a=i,s=i.expired,u=j(),c=e._path,f=i.cache,p=c.length?E(e,c).value:f,l=p.$_parent||f,h=f.$_version,d=[],v=[],y=[],_=c.length,g=-1,x=t.length;++g<x;){var m=t[g],b=m.path,w=m.value,$=c.slice(0);$.index=_,function e(t,r,n,o,i,a,s,u,c,f,p,l,h,d,v,y){var _={};var g=n<r.length-1;var x=r[n];var m=S(x,_);var b=f.index;for(;;){c.depth=n;var w=A(o,i,a,m,t,g,!1,c,f,p,l,h,d,v,y);c[n]=m,c.index=n,f[f.index++]=m;var $=w[0],P=w[1];if($&&(g?e(t,r,n+1,o,P,$,s,u,c,f,p,l,h,d,v):(s.push(c.slice(0,c.index+1)),u.push(f.slice(0,f.index)))),m=S(x,_),_.done)break;f.index=b}}(w,b,0,f,l,p,v,y,d,$,u,s,a,o,n)}var P=f.$_version,k=i.onChange;return O(k)&&h!==P&&k(),[v,y]}},{110:110,13:13,136:136,17:17,73:73,75:75,81:81,84:84,85:85,91:91,93:93}],69:[function(e,t,r){var s=e(120),u=e(51),c=e(90);t.exports=function(e,t){for(var r=c(e)?e:s.pathValue(e,t),n=0,i=r.path,o=i.length;++n<o;)if("object"==typeof i[n])return new u(function(e){e.onError(new Error("Paths must be simple paths"))});var a=this;return new u(function(o){return a.set(r).subscribe(function(e){for(var t=e.json,r=-1,n=i.length;t&&++r<n;)t=t[i[r]];o.onNext(t)},function(e){o.onError(e)},function(){o.onCompleted()})})}},{120:120,51:51,90:90}],70:[function(e,t,r){var u=e(124),c=e(90),f=e(68);t.exports=function(e,t,r,n){var o=u.fromPath(e),i=t,a=r,s=n,i=c(o)?(s=a,a=i,o):{path:o,value:i};if(!1===c(i))throw new Error("Model#setValueSync must be called with an Array path.");return"function"!=typeof a&&(a=this._root._errorSelector),"function"!=typeof s&&(s=this._root._comparator),this._syncCheck("setValueSync"),f(this,[i]),this._getValueSync(i.path)}},{124:124,68:68,90:90}],71:[function(e,t,r){t.exports=function(e,t){for(var r=-1,n=-1,o=e.length,i=[];++n<o;)for(var a=t(e[n],n,e),s=-1,u=a.length;++s<u;)i[++r]=a[s];return i}},{}],72:[function(e,t,r){var o=e(34),i=e(80),a=Array.isArray,s=e(89);t.exports=function(e){var t=e;if(s(t)){t=a(e)?[]:{};var r=e;for(var n in r)0!==n.lastIndexOf(o,0)&&i(r,n)&&(t[n]=r[n])}return t}},{34:34,80:80,89:89}],73:[function(e,t,r){var n=e(35);t.exports=function(e,t){var r=t.$_refsLength||0;t[n+r]=e,t.$_refsLength=r+1,e.$_refIndex=r,e.$_context=t}},{35:35}],74:[function(e,t,r){var n=null;r.setVersion=function(e){n=e},r.getVersion=function(){return n}},{}],75:[function(e,t,r){var n=e(41);t.exports=function(e,t,r){return e.$_invalidated||(e.$_invalidated=!0,t.push(e),n(r,e)),e}},{41:41}],76:[function(e,t,r){var n=e(89);t.exports=function(e){return n(e)&&e.$expires||void 0}},{89:89}],77:[function(e,t,r){var n=e(89);t.exports=function(e){return n(e)&&e.$size||0}},{89:89}],78:[function(e,t,r){var n=e(89);t.exports=function(e){return n(e)&&e.$timestamp||void 0}},{89:89}],79:[function(e,t,r){var n=e(89);t.exports=function(e,t){var r=n(e)&&e.$type||void 0;return t&&r?"branch":r}},{89:89}],80:[function(e,t,r){var n=e(89),o=Object.prototype.hasOwnProperty;t.exports=function(e,t){return n(e)&&o.call(e,t)}},{89:89}],81:[function(e,t,r){var n=1;t.exports=function(){return n++},t.exports.getCurrentVersion=function(){return n}},{}],82:[function(e,t,r){t.exports=function(e,t,r,n,o){return e.$_key=r,e.$_parent=t,void 0!==n&&(e.$_version=n),e.$_absolutePath||(Array.isArray(r)?(e.$_absolutePath=o.slice(0,o.index),Array.prototype.push.apply(e.$_absolutePath,r)):(e.$_absolutePath=o.slice(0,o.index),e.$_absolutePath.push(r))),t[r]=e}},{}],83:[function(e,t,r){var n=e(95),o=e(112),i=e(111);t.exports=function(e){var t=e.$expires;return null!=t&&t!==i&&t!==o&&t<n()}},{111:111,112:112,95:95}],84:[function(e,t,r){var n=e(95),o=e(112),i=e(111);t.exports=function(e){var t=e.$expires;return null!=t&&t!==i&&(t===o||t<n())}},{111:111,112:112,95:95}],85:[function(e,t,r){t.exports=function(e){return Boolean(e)&&"function"==typeof e}},{}],86:[function(e,t,r){var n=e(34);t.exports=function(e){return"$size"===e||0===e.lastIndexOf(n,0)}},{34:34}],87:[function(e,t,r){var n=e(89);t.exports=function(e){return n(e)&&"json"in e}},{89:89}],88:[function(e,t,r){var n=Array.isArray,o=e(89);t.exports=function(e){return o(e)&&n(e.paths)&&(o(e.jsonGraph)||o(e.jsong)||o(e.json)||o(e.values)||o(e.value))}},{89:89}],89:[function(e,t,r){t.exports=function(e){return null!==e&&"object"==typeof e}},{}],90:[function(e,t,r){var n=Array.isArray,o=e(89);t.exports=function(e){return o(e)&&(n(e.path)||"string"==typeof e.path)}},{89:89}],91:[function(e,t,r){t.exports=function(e){return null==e||"object"!=typeof e}},{}],92:[function(e,t,r){var b=e(110),w=e(109),$=e(77),P=e(78),k=e(89),E=e(84),O=e(85),S=e(106),j=e(82),A=e(75),N=e(99),C=e(104),R=e(96);t.exports=function(e,t,r,n,o,i,a,s,u,c,f,p){var l,h,d,v,y,_,g,x,m=t&&void 0!==t.value?t.value:t;if(m===r){if(null===r)return t=S(r,void 0,r),e=C(e,-t.$size,u,a),t=j(t,e,n,void 0,i);if(void 0===r)return r;if((v=k(t))&&null==(h=t.$type))return null==t.$_parent&&j(t,e,n,a,i),t}else(v=k(t))&&(h=t.$type);if(h!==b){if((y=k(r))&&(d=r.$type),v&&!h&&(null==r||y&&!d))return t}else{if(null==r)return E(t)?void A(t,s,u):t;if((y=k(r))&&(d=r.$type)===b)if(t===r){if(null!=t.$_parent)return t}else if(_=t.$timestamp,g=r.$timestamp,!E(t)&&!E(r)&&g<_)return}return h&&y&&!d?j(N(t,r,e,n,u,p),e,n,void 0,i):(d||!y?(d===w&&O(f)&&(d=(r=f(R(o,n),r)).$type||d),d&&t===r?null==t.$_parent&&(t=S(t,d,t.value),e=C(e,-t.$size,u,a),t=j(t,e,n,a,i)):(x=!0,(h&&!E(t)||!v)&&(x=P(r)<P(t)==!1)&&(h||d)&&O(c)&&(x=!c(m,r,i.slice(0,i.index))),x&&(r=S(r,d,d?r.value:r),l=$(t)-$(r),t=N(t,r,e,n,u,p),e=C(e,l,u,a),t=j(t,e,n,a,i))),E(t)&&A(t,s,u)):null==t&&(t=j({},e,n,void 0,i)),t)}},{104:104,106:106,109:109,110:110,75:75,77:77,78:78,82:82,84:84,85:85,89:89,96:96,99:99}],93:[function(e,t,r){var x=e(110),m=e(109),b=e(79),w=e(77),$=e(78),P=e(84),k=e(91),E=e(85),O=e(106),S=e(75),j=e(82),A=e(99),N=e(104),C=e(103),R=e(96);t.exports=function(e,t,r,n,o,i,a,s,u,c,f,p,l,h){var d,v,y,_,g=b(t,i);return o||i?(g&&P(t)&&(g="expired",S(t,c,f)),(g&&g!==x||k(t))&&(t=A(t,{},e,r,f,h),t=j(t,e,r,u,s),t=C(t,u))):(v=b(d=n),y=$(d)<$(t)==!1,(g||v)&&E(p)&&(y=!p(t,d,s.slice(0,s.index))),y&&(v===m&&E(l)&&(v=(d=l(R(a,r),d)).$type||v),d=O(d,v,v?d.value:d),_=w(t)-w(d),t=A(t,d,e,r,f,h),e=N(e,_,f,u),t=j(t,e,r,u,s))),t}},{103:103,104:104,106:106,109:109,110:110,75:75,77:77,78:78,79:79,82:82,84:84,85:85,91:91,96:96,99:99}],94:[function(e,t,r){t.exports=function(){}},{}],95:[function(e,t,r){t.exports=Date.now},{}],96:[function(e,t,r){t.exports=function(e,t){var r=e.slice(0,e.depth);return r[r.length]=t,r}},{}],97:[function(e,t,r){var i=e(110),a=e(41),s=e(89),u=e(101),c=e(102);t.exports=function(e,t,r,n){if(s(e)){var o=e.$type;return o&&(o===i&&c(e),a(n,e)),u(e),!(t[r]=e.$_parent=void 0)}return!1}},{101:101,102:102,110:110,41:41,89:89}],98:[function(e,t,r){var s=e(80),u=e(36),c=e(97);t.exports=function e(t,r,n,o,i){if(c(t,r,n,o)){if(void 0!==t.$type&&i&&t.$_absolutePath&&(i.hasInvalidatedResult=!0),null==t.$type)for(var a in t)a[0]!==u&&s(t,a)&&e(t[a],t,a,o,i);return!0}return!1}},{36:36,80:80,97:97}],99:[function(e,t,r){var a=e(89),s=e(100),u=e(98);t.exports=function(e,t,r,n,o,i){return e===t?e:(a(e)&&(s(e,t),u(e,r,n,o,i)),r[n]=t)}},{100:100,89:89,98:98}],100:[function(e,t,r){var a=e(35);t.exports=function(e,t){for(var r=e.$_refsLength||0,n=t.$_refsLength||0,o=-1;++o<r;){var i=e[a+o];void 0!==i&&((i.$_context=t)[a+(n+o)]=i,e[a+o]=void 0)}return t.$_refsLength=r+n,e.$_refsLength=void 0,t}},{35:35}],101:[function(e,t,r){var o=e(35);t.exports=function(e){for(var t=-1,r=e.$_refsLength||0;++t<r;){var n=e[o+t];null!=n&&(n.$_context=n.$_refIndex=e[o+t]=void 0)}return e.$_refsLength=void 0,e}},{35:35}],102:[function(e,t,r){var o=e(35);t.exports=function(e){var t=e.$_context;if(t){for(var r=(e.$_refIndex||0)-1,n=(t.$_refsLength||0)-1;++r<=n;)t[o+r]=t[o+(r+1)];t.$_refsLength=n,e.$_refIndex=e.$_context=t=void 0}return e}},{35:35}],103:[function(e,t,r){var s=e(35);t.exports=function(e,t){var r=[e],n=0;do