{"size": 3652, "ext": "js", "max_stars_repo_path": "arcgis_js_api/library/4.11/dstore/Trackable.js", "max_stars_repo_name": "mozenberger/data-management-tools", "max_stars_repo_stars_event_min_datetime": "2019-05-06T08:23:55.000Z", "max_stars_repo_stars_event_max_datetime": "2020-04-04T12:58:11.000Z", "max_issues_repo_path": "arcgis_js_api/library/4.11/dstore/Trackable.js", "max_issues_repo_name": "mozenberger/data-management-tools", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "arcgis_js_api/library/4.11/dstore/Trackable.js", "max_forks_repo_name": "mozenberger/data-management-tools", "max_forks_repo_forks_event_min_datetime": "2019-06-14T09:54:40.000Z", "max_forks_repo_forks_event_max_datetime": "2020-04-13T14:47:30.000Z"}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": 2, "avg_line_length": 405.7777777778, "max_line_length": 529, "alphanum_fraction": 0.654162103}
//>>built
define("dojo/_base/lang dojo/_base/declare dojo/aspect dojo/when dojo/promise/all dojo/_base/array dojo/on".split(" "),function(D,z,H,B,p,E,I){function F(h,l,u){for(var r=h.length-1;0<=r;--r){var n=h[r],y=n.start,n=y+n.count;if(l>n){h.splice(r+1,0,{start:l,count:u-l});return}u>=y&&(l=Math.min(l,y),u=Math.max(u,n),h.splice(r,1))}h.unshift({start:l,count:u-l})}var J=0,C={track:function(){function h(){return function(){var a=this,b=this.inherited(arguments);B(b,function(b){b=a._results=b.slice();a._partialResults&&
(a._partialResults=null);a._ranges=[];F(a._ranges,0,b.length)});return b}}function l(){return function(a){var b=this,e=a.start,f=a.end,g=this.inherited(arguments);this._results||B(g,function(c){return B(c.totalLength,function(a){var d=b._partialResults||(b._partialResults=[]);f=Math.min(f,e+c.length);d.length=a;a=[e,f-e].concat(c);d.splice.apply(d,a);F(b._ranges,e,f);return c})});return g}}function u(a,b){J++;var e=b.target;b=D.delegate(b,C[a]);var f=b.beforeId;B(t._results||t._partialResults,function(g){if(g){var c,
d,h,m=t._ranges,k,l="id"in b?b.id:r.getIdentity(e),n=-1,v=-1,q=-1,w=-1,p;if("delete"===a||"update"===a)for(c=0;-1===n&&c<m.length;++c)for(k=m[c],d=k.start,h=d+k.count;d<h;++d)if(r.getIdentity(g[d])==l){n=b.previousIndex=d;v=c;p=f==l;g.splice(n,1);k.count--;for(d=c+1;d<m.length;++d)m[d].start--;break}if("add"===a||"update"===a){if(A){if(A([e]).length){var x=0;h=m.length-1;for(p=-1;x<=h&&-1===q;)c=x+Math.round((h-x)/2),k=m[c],v=g.slice(k.start,k.start+k.count),void 0!==f&&(p=null===f?v.length:G(v,f)),
-1===p&&(p=n>=Math.max(0,k.start-1)&&n<=k.start+k.count?n:r.defaultNewToStart?0:v.length),v.splice(p,0,e),d=E.indexOf(A(v),e),l=k.start+d,0===d&&0!==k.start?h=c-1:d>=v.length-1&&l<g.length?x=c+1:(q=l,w=c);if(-1===q&&0<x&&x<m.length)var u=!0}}else{d=-1;if(void 0===f||p)"update"===a?(q=n,w=v):r.defaultNewToStart?d=q=0:(q=g.length,d=m.length-1);else if(null===f)q=g.length,d=m.length-1;else for(c=0,h=m.length;-1===w&&c<h;++c)k=m[c],q=G(g,f,k.start,k.start+k.count),-1!==q&&(w=c);-1!==d&&-1===w&&(k=m[d])&&
k.start<=q&&q<=k.start+k.count&&(w=d)}if(-1<q&&-1<w)for(b.index=q,g.splice(q,0,e),m[w].count++,c=w+1;c<m.length;++c)m[c].start++;else if(u)for(b.beforeIndex=m[x].start,c=x;c<m.length;++c)m[c].start++}b.totalLength=g.length}(g=t["on_tracked"+a])&&g.call(t,b)})}var r=this.store||this,n=[],y={add:1,update:1,"delete":1},p;for(p in y)n.push(this.on(p,function(a){return function(b){u(a,b)}}(p)));var t=z.safeMixin(D.delegate(this),{_ranges:[],fetch:h(),fetchRange:l(),releaseRange:function(a,b){if(this._partialResults){a:for(var e=
this._ranges,f=0,g;g=e[f];++f){var c=g.start,d=c+g.count;if(a<=c)if(b>=d)e.splice(f,1);else{g.start=b;g.count=d-g.start;break a}else if(a<d)if(b>c){e.splice(f,1,{start:c,count:a-c},{start:b,count:d-b});break a}else g.count=a-g.start}for(;a<b;++a)delete this._partialResults[a]}},on:function(a,b){var e=this,f=this.getInherited(arguments);return I.parse(t,a,b,function(a,c){return c in y?H.after(t,"on_tracked"+c,b,!0):f.call(e,c,b)})},tracking:{remove:function(){for(;0<n.length;)n.pop().remove();this.remove=
function(){}}},track:null});this.fetchSync&&(z.safeMixin(t,{fetchSync:h(),fetchRangeSync:l()}),t.fetchSync());var A;E.forEach(this.queryLog,function(a){var b=A,e=a.querier;e&&(A=b?function(a){return e(b(a))}:e)});var C={add:{index:void 0},update:{previousIndex:void 0,index:void 0},"delete":{previousIndex:void 0}},G=function(a,b,e,f){f=void 0!==f?f:a.length;for(e=void 0!==e?e:0;e<f;++e)if(r.getIdentity(a[e])===b)return e;return-1};return t}};p=z(null,C);p.create=function(h,l){h=z.safeMixin(D.delegate(h),
C);z.safeMixin(h,l);return h};return p});