mirror of
https://github.com/google/earthengine-api.git
synced 2025-12-08 19:26:12 +00:00
126 lines
66 KiB
JavaScript
126 lines
66 KiB
JavaScript
(function() {var h,aa=aa||{},k=this,l=function(a){return void 0!==a},ba=function(){},ca=function(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=
|
|
typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==b&&"undefined"==typeof a.call)return"object";return b},m=function(a){return"array"==ca(a)},da=function(a){var b=ca(a);return"array"==b||"object"==b&&"number"==typeof a.length},p=function(a){return"string"==typeof a},ea=function(a){return"number"==typeof a},fa=function(a){return"function"==ca(a)},q=function(a){var b=typeof a;return"object"==b&&null!=a||"function"==b},ga=function(a,
|
|
b,c){return a.call.apply(a.bind,arguments)},ha=function(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}},r=function(a,b,c){r=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ga:ha;return r.apply(null,arguments)},ia=Date.now||function(){return+new Date},
|
|
s=function(a,b){var c=a.split("."),d=k;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)!c.length&&l(b)?d[e]=b:d=d[e]?d[e]:d[e]={}},t=function(a,b){function c(){}c.prototype=b.prototype;a.n=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.Cb=function(a,c,f){return b.prototype[c].apply(a,Array.prototype.slice.call(arguments,2))}};
|
|
Function.prototype.bind=Function.prototype.bind||function(a,b){if(1<arguments.length){var c=Array.prototype.slice.call(arguments,1);c.unshift(this,a);return r.apply(null,c)}return r(this,a)};var ja=function(a){if(Error.captureStackTrace)Error.captureStackTrace(this,ja);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))};t(ja,Error);ja.prototype.name="CustomError";var ka=function(a,b){for(var c=a.split("%s"),d="",e=Array.prototype.slice.call(arguments,1);e.length&&1<c.length;)d+=c.shift()+e.shift();return d+c.join("%s")},ua=function(a){if(!la.test(a))return a;-1!=a.indexOf("&")&&(a=a.replace(ma,"&"));-1!=a.indexOf("<")&&(a=a.replace(na,"<"));-1!=a.indexOf(">")&&(a=a.replace(oa,">"));-1!=a.indexOf('"')&&(a=a.replace(pa,"""));-1!=a.indexOf("'")&&(a=a.replace(qa,"'"));-1!=a.indexOf("\x00")&&(a=a.replace(ra,"�"));return a},ma=/&/g,na=/</g,
|
|
oa=/>/g,pa=/"/g,qa=/'/g,ra=/\x00/g,la=/[\x00&<>"']/,va=function(a,b){return a<b?-1:a>b?1:0};var wa=function(a,b){b.unshift(a);ja.call(this,ka.apply(null,b));b.shift()};t(wa,ja);wa.prototype.name="AssertionError";var xa=function(a,b,c){if(!a){var d="Assertion failed";if(b)var d=d+(": "+b),e=Array.prototype.slice.call(arguments,2);throw new wa(""+d,e||[]);}return a},ya=function(a,b){throw new wa("Failure"+(a?": "+a:""),Array.prototype.slice.call(arguments,1));};var u=Array.prototype,za=u.indexOf?function(a,b,c){xa(null!=a.length);return u.indexOf.call(a,b,c)}:function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if(p(a))return p(b)&&1==b.length?a.indexOf(b,c):-1;for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},Aa=u.forEach?function(a,b,c){xa(null!=a.length);u.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=p(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)},v=u.map?function(a,b,c){xa(null!=a.length);return u.map.call(a,b,c)}:
|
|
function(a,b,c){for(var d=a.length,e=Array(d),f=p(a)?a.split(""):a,g=0;g<d;g++)g in f&&(e[g]=b.call(c,f[g],g,a));return e},Ca=function(a){var b;t:{b=Ba;for(var c=a.length,d=p(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break t}b=-1}return 0>b?null:p(a)?a.charAt(b):a[b]},Da=function(a,b){var c=za(a,b),d;if(d=0<=c)xa(null!=a.length),u.splice.call(a,c,1);return d},Ea=function(a){return u.concat.apply(u,arguments)},Fa=function(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c],
|
|
e;if(m(d)||(e=da(d))&&Object.prototype.hasOwnProperty.call(d,"callee"))a.push.apply(a,d);else if(e)for(var f=a.length,g=d.length,n=0;n<g;n++)a[f+n]=d[n];else a.push(d)}},Ga=function(a,b,c){xa(null!=a.length);return 2>=arguments.length?u.slice.call(a,b):u.slice.call(a,b,c)},Ha=function(a){for(var b=[],c=0;c<a;c++)b[c]="Object";return b};var Ia=function(a,b){for(var c in a)b.call(void 0,a[c],c,a)},Ka=function(a){var b=Ja,c={},d;for(d in b)a.call(void 0,b[d],d,b)&&(c[d]=b[d]);return c},La=function(a,b,c){var d={},e;for(e in a)d[e]=b.call(c,a[e],e,a);return d},Ma=function(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b},Na=function(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b},Oa=function(a,b){b in a&&delete a[b]},w=function(a){var b={},c;for(c in a)b[c]=a[c];return b},Pa=function(a){var b=ca(a);if("object"==b||"array"==b){if(a.clone)return a.clone();
|
|
var b="array"==b?[]:{},c;for(c in a)b[c]=Pa(a[c]);return b}return a},Qa="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),Ra=function(a,b){for(var c,d,e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(var f=0;f<Qa.length;f++)c=Qa[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}};var Sa=function(a){a=String(a);if(/^\s*$/.test(a)?0:/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+a+")")}catch(b){}throw Error("Invalid JSON string: "+a);},Ta=function(a){return eval("("+a+")")},Ua=function(a){this.aa=a};Ua.prototype.h=function(a){var b=[];Va(this,a,b);return b.join("")};
|
|
var Va=function(a,b,c){switch(typeof b){case "string":Wa(b,c);break;case "number":c.push(isFinite(b)&&!isNaN(b)?b:"null");break;case "boolean":c.push(b);break;case "undefined":c.push("null");break;case "object":if(null==b){c.push("null");break}if(m(b)){var d=b.length;c.push("[");for(var e="",f=0;f<d;f++)c.push(e),e=b[f],Va(a,a.aa?a.aa.call(b,String(f),e):e,c),e=",";c.push("]");break}c.push("{");d="";for(f in b)Object.prototype.hasOwnProperty.call(b,f)&&(e=b[f],"function"!=typeof e&&(c.push(d),Wa(f,
|
|
c),c.push(":"),Va(a,a.aa?a.aa.call(b,f,e):e,c),d=","));c.push("}");break;case "function":break;default:throw Error("Unknown type: "+typeof b);}},Xa={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Ya=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g,Wa=function(a,b){b.push('"',a.replace(Ya,function(a){if(a in Xa)return Xa[a];var b=a.charCodeAt(0),e="\\u";16>b?e+="000":256>b?e+="00":4096>b&&(e+="0");return Xa[a]=
|
|
e+b.toString(16)}),'"')};var Za=function(){this.M=this.M;this.$=this.$};Za.prototype.M=!1;Za.prototype.Ka=function(){this.M||(this.M=!0,this.C())};Za.prototype.C=function(){if(this.$)for(;this.$.length;)this.$.shift()()};var $a=function(a,b){this.type=a;this.currentTarget=this.target=b;this.defaultPrevented=this.Z=!1;this.Qa=!0};$a.prototype.C=function(){};$a.prototype.Ka=function(){};var ab;t:{var bb=k.navigator;if(bb){var cb=bb.userAgent;if(cb){ab=cb;break t}}ab=""}var db=function(a){return-1!=ab.indexOf(a)};var eb=db("Opera")||db("OPR"),x=db("Trident")||db("MSIE"),fb=db("Gecko")&&-1==ab.toLowerCase().indexOf("webkit")&&!(db("Trident")||db("MSIE")),gb=-1!=ab.toLowerCase().indexOf("webkit"),hb=function(){var a=k.document;return a?a.documentMode:void 0},ib=function(){var a="",b;if(eb&&k.opera)return a=k.opera.version,fa(a)?a():a;fb?b=/rv\:([^\);]+)(\)|;)/:x?b=/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/:gb&&(b=/WebKit\/(\S+)/);b&&(a=(a=b.exec(ab))?a[1]:"");return x&&(b=hb(),b>parseFloat(a))?String(b):a}(),jb={},
|
|
y=function(a){var b;if(!(b=jb[a])){b=0;for(var c=String(ib).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),d=String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),e=Math.max(c.length,d.length),f=0;0==b&&f<e;f++){var g=c[f]||"",n=d[f]||"",C=RegExp("(\\d*)(\\D*)","g"),E=RegExp("(\\d*)(\\D*)","g");do{var z=C.exec(g)||["","",""],sa=E.exec(n)||["","",""];if(0==z[0].length&&0==sa[0].length)break;b=va(0==z[1].length?0:parseInt(z[1],10),0==sa[1].length?0:parseInt(sa[1],10))||va(0==z[2].length,0==sa[2].length)||
|
|
va(z[2],sa[2])}while(0==b)}b=jb[a]=0<=b}return b},kb=k.document,lb=kb&&x?hb()||("CSS1Compat"==kb.compatMode?parseInt(ib,10):5):void 0;x&&y("9");!gb||y("528");fb&&y("1.9b")||x&&y("8")||eb&&y("9.5")||gb&&y("528");fb&&!y("8")||x&&y("9");var mb="closure_listenable_"+(1E6*Math.random()|0),nb=0;var ob=function(a,b,c,d,e){this.na=a;this.Wa=null;this.src=b;this.type=c;this.Aa=!!d;this.ma=e;this.key=++nb;this.oa=this.pa=!1},pb=function(a){a.oa=!0;a.na=null;a.Wa=null;a.src=null;a.ma=null};var qb=function(a){this.src=a;this.o={};this.qa=0};qb.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.o[f];a||(a=this.o[f]=[],this.qa++);var g;t:{for(g=0;g<a.length;++g){var n=a[g];if(!n.oa&&n.na==b&&n.Aa==!!d&&n.ma==e)break t}g=-1}-1<g?(b=a[g],c||(b.pa=!1)):(b=new ob(b,this.src,f,!!d,e),b.pa=c,a.push(b));return b};qb.prototype.Ua=function(){var a=0,b;for(b in this.o){for(var c=this.o[b],d=0;d<c.length;d++)++a,pb(c[d]);delete this.o[b];this.qa--}};var rb=function(){Za.call(this);this.A=new qb(this);this.Ya=this;this.sa=null};t(rb,Za);rb.prototype[mb]=!0;
|
|
rb.prototype.dispatchEvent=function(a){sb(this);var b,c=this.sa;if(c){b=[];for(var d=1;c;c=c.sa)b.push(c),xa(1E3>++d,"infinite loop")}c=this.Ya;d=a.type||a;if(p(a))a=new $a(a,c);else if(a instanceof $a)a.target=a.target||c;else{var e=a;a=new $a(d,c);Ra(a,e)}var e=!0,f;if(b)for(var g=b.length-1;!a.Z&&0<=g;g--)f=a.currentTarget=b[g],e=tb(f,d,!0,a)&&e;a.Z||(f=a.currentTarget=c,e=tb(f,d,!0,a)&&e,a.Z||(e=tb(f,d,!1,a)&&e));if(b)for(g=0;!a.Z&&g<b.length;g++)f=a.currentTarget=b[g],e=tb(f,d,!1,a)&&e;return e};
|
|
rb.prototype.C=function(){rb.n.C.call(this);this.A&&this.A.Ua();this.sa=null};rb.prototype.$a=function(a){sb(this);this.A.add("complete",a,!1,void 0,void 0)};rb.prototype.ab=function(a){this.A.add("ready",a,!0,void 0,void 0)};
|
|
var tb=function(a,b,c,d){b=a.A.o[String(b)];if(!b)return!0;b=b.concat();for(var e=!0,f=0;f<b.length;++f){var g=b[f];if(g&&!g.oa&&g.Aa==c){var n=g.na,C=g.ma||g.src;if(g.pa){var E=a.A,z=g.type;z in E.o&&Da(E.o[z],g)&&(pb(g),0==E.o[z].length&&(delete E.o[z],E.qa--))}e=!1!==n.call(C,d)&&e}}return e&&0!=d.Qa},sb=function(a){xa(a.A,"Event target is not initialized. Did you call the superclass (goog.events.EventTarget) constructor?")};var ub="StopIteration"in k?k.StopIteration:Error("StopIteration"),vb=function(){};vb.prototype.next=function(){throw ub;};vb.prototype.ib=function(){return this};var wb=function(a,b){this.u={};this.i=[];this.ra=this.m=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else a&&this.Sa(a)};wb.prototype.q=function(){xb(this);for(var a=[],b=0;b<this.i.length;b++)a.push(this.u[this.i[b]]);return a};wb.prototype.t=function(){xb(this);return this.i.concat()};wb.prototype.W=function(a){return Object.prototype.hasOwnProperty.call(this.u,a)};
|
|
var xb=function(a){if(a.m!=a.i.length){for(var b=0,c=0;b<a.i.length;){var d=a.i[b];Object.prototype.hasOwnProperty.call(a.u,d)&&(a.i[c++]=d);b++}a.i.length=c}if(a.m!=a.i.length){for(var e={},c=b=0;b<a.i.length;)d=a.i[b],Object.prototype.hasOwnProperty.call(e,d)||(a.i[c++]=d,e[d]=1),b++;a.i.length=c}};h=wb.prototype;h.get=function(a,b){return Object.prototype.hasOwnProperty.call(this.u,a)?this.u[a]:b};
|
|
h.set=function(a,b){Object.prototype.hasOwnProperty.call(this.u,a)||(this.m++,this.i.push(a),this.ra++);this.u[a]=b};h.Sa=function(a){var b;a instanceof wb?(b=a.t(),a=a.q()):(b=Na(a),a=Ma(a));for(var c=0;c<b.length;c++)this.set(b[c],a[c])};h.forEach=function(a,b){for(var c=this.t(),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};h.clone=function(){return new wb(this)};
|
|
h.ib=function(a){xb(this);var b=0,c=this.i,d=this.u,e=this.ra,f=this,g=new vb;g.next=function(){for(;;){if(e!=f.ra)throw Error("The map has changed since the iterator was created");if(b>=c.length)throw ub;var g=c[b++];return a?g:d[g]}};return g};var yb=function(a){if("function"==typeof a.q)return a.q();if(p(a))return a.split("");if(da(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return Ma(a)},zb=function(a,b){if("function"==typeof a.forEach)a.forEach(b,void 0);else if(da(a)||p(a))Aa(a,b,void 0);else{var c;if("function"==typeof a.t)c=a.t();else if("function"!=typeof a.q)if(da(a)||p(a)){c=[];for(var d=a.length,e=0;e<d;e++)c.push(e)}else c=Na(a);else c=void 0;for(var d=yb(a),e=d.length,f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],
|
|
a)}};var Bb=function(a){var b;b||(b=Ab(a||arguments.callee.caller,[]));return b},Ab=function(a,b){var c=[];if(0<=za(b,a))c.push("[...circular reference...]");else if(a&&50>b.length){c.push(Cb(a)+"(");for(var d=a.arguments,e=0;d&&e<d.length;e++){0<e&&c.push(", ");var f;f=d[e];switch(typeof f){case "object":f=f?"object":"null";break;case "string":break;case "number":f=String(f);break;case "boolean":f=f?"true":"false";break;case "function":f=(f=Cb(f))?f:"[fn]";break;default:f=typeof f}40<f.length&&(f=f.substr(0,
|
|
40)+"...");c.push(f)}b.push(a);c.push(")\n");try{c.push(Ab(a.caller,b))}catch(g){c.push("[exception trying to get caller]\n")}}else a?c.push("[...long stack...]"):c.push("[end]");return c.join("")},Cb=function(a){if(Db[a])return Db[a];a=String(a);if(!Db[a]){var b=/function ([^\(]+)/.exec(a);Db[a]=b?b[1]:"[Anonymous]"}return Db[a]},Db={};var Eb=function(a,b,c,d,e){this.reset(a,b,c,d,e)};Eb.prototype.Ea=null;Eb.prototype.Da=null;var Fb=0;Eb.prototype.reset=function(a,b,c,d,e){"number"==typeof e||Fb++;d||ia();this.N=a;this.Xa=b;delete this.Ea;delete this.Da};Eb.prototype.Ha=function(a){this.N=a};var Gb=function(a){this.Ta=a;this.Ca=this.ta=this.N=this.Y=null},Hb=function(a,b){this.name=a;this.value=b};Hb.prototype.toString=function(){return this.name};var Ib=new Hb("SEVERE",1E3),Jb=new Hb("CONFIG",700),Kb=new Hb("FINE",500);Gb.prototype.getParent=function(){return this.Y};Gb.prototype.cb=function(){this.ta||(this.ta={});return this.ta};Gb.prototype.Ha=function(a){this.N=a};var Lb=function(a){if(a.N)return a.N;if(a.Y)return Lb(a.Y);ya("Root logger has no level set.");return null};
|
|
Gb.prototype.log=function(a,b,c){if(a.value>=Lb(this).value)for(fa(b)&&(b=b()),a=this.Fa(a,b,c,Gb.prototype.log),b="log:"+a.Xa,k.console&&(k.console.timeStamp?k.console.timeStamp(b):k.console.markTimeline&&k.console.markTimeline(b)),k.msWriteProfilerMark&&k.msWriteProfilerMark(b),b=this;b;){c=b;var d=a;if(c.Ca)for(var e=0,f=void 0;f=c.Ca[e];e++)f(d);b=b.getParent()}};
|
|
Gb.prototype.Fa=function(a,b,c,d){a=new Eb(a,String(b),this.Ta);if(c){a.Ea=c;var e;d=d||Gb.prototype.Fa;try{var f;var g;e:{b=["window","location","href"];for(var n=k,C;C=b.shift();)if(null!=n[C])n=n[C];else{g=null;break e}g=n}if(p(c))f={message:c,name:"Unknown error",lineNumber:"Not available",fileName:g,stack:"Not available"};else{var E,z;C=!1;try{E=c.lineNumber||c.line||"Not available"}catch(sa){E="Not available",C=!0}try{z=c.fileName||c.filename||c.sourceURL||k.$googDebugFname||g}catch(ta){z="Not available",
|
|
C=!0}f=!C&&c.lineNumber&&c.fileName&&c.stack&&c.message&&c.name?c:{message:c.message||"Not available",name:c.name||"UnknownError",lineNumber:E,fileName:z,stack:c.stack||"Not available"}}e="Message: "+ua(f.message)+'\nUrl: <a href="view-source:'+f.fileName+'" target="_new">'+f.fileName+"</a>\nLine: "+f.lineNumber+"\n\nBrowser stack:\n"+ua(f.stack+"-> ")+"[end]\n\nJS stack traversal:\n"+ua(Bb(d)+"-> ")}catch(le){e="Exception trying to expose exception! You win, we lose. "+le}a.Da=e}return a};
|
|
var Mb={},Nb=null,Ob=function(a){Nb||(Nb=new Gb(""),Mb[""]=Nb,Nb.Ha(Jb));var b;if(!(b=Mb[a])){b=new Gb(a);var c=a.lastIndexOf("."),d=a.substr(c+1),c=Ob(a.substr(0,c));c.cb()[d]=b;b.Y=c;Mb[a]=b}return b};var A=function(a,b){a&&a.log(Kb,b,void 0)};[].push(function(){});var Pb=function(a,b,c){if(fa(a))c&&(a=r(a,c));else if(a&&"function"==typeof a.handleEvent)a=r(a.handleEvent,a);else throw Error("Invalid listener argument");return 2147483647<b?-1:k.setTimeout(a,b||0)};var Qb=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/,Rb=gb,Sb=function(a,b){if(Rb){Rb=!1;var c=k.location;if(c){var d=c.href;if(d&&(d=(d=Sb(3,d))?decodeURI(d):d)&&d!=c.hostname)throw Rb=!0,Error();}}return b.match(Qb)[a]||null};var Tb=function(){};Tb.prototype.Ja=null;Tb.prototype.I=function(){var a;(a=this.Ja)||(a={},Ub(this)&&(a[0]=!0,a[1]=!0),a=this.Ja=a);return a};var Vb=function(a,b){this.hb=a;this.gb=b};t(Vb,Tb);Vb.prototype.da=function(){return this.hb()};Vb.prototype.I=function(){return this.gb()};var B=function(){return B.Ga.da()};B.fb=!1;B.I=function(){return B.Ga.I()};B.Hb=function(a,b){B.La(new Vb(xa(a),xa(b)))};B.La=function(a){B.Ga=a};var Wb=function(){};t(Wb,Tb);Wb.prototype.da=function(){var a=Ub(this);return a?new ActiveXObject(a):new XMLHttpRequest};
|
|
var Ub=function(a){if(B.fb)return"";if(!a.Ia&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var b=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],c=0;c<b.length;c++){var d=b[c];try{return new ActiveXObject(d),a.Ia=d}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return a.Ia};B.La(new Wb);var D=function(a){rb.call(this);this.headers=new wb;this.T=a||null;this.s=!1;this.P=this.a=null;this.H=this.wa=this.Q="";this.w=this.ba=this.O=this.ca=!1;this.B=0;this.R=null;this.xa="";this.S=this.Na=!1};t(D,rb);var Xb=D.prototype,Yb=Ob("goog.net.XhrIo");Xb.k=Yb;var Zb=/^https?$/i,$b=["POST","PUT"],ac=[],cc=function(a,b,c,d){var e=bc,f=new D;ac.push(f);b&&f.$a(b);f.ab(f.Za);e&&(f.B=Math.max(0,e));f.send(a,c,d,{"Content-Type":"application/x-www-form-urlencoded"})};
|
|
D.prototype.Za=function(){this.Ka();Da(ac,this)};
|
|
D.prototype.send=function(a,b,c,d){if(this.a)throw Error("[goog.net.XhrIo] Object is active with another request="+this.Q+"; newUri="+a);b=b?b.toUpperCase():"GET";this.Q=a;this.H="";this.wa=b;this.ca=!1;this.s=!0;this.a=this.T?this.T.da():B();this.P=this.T?this.T.I():B.I();this.a.onreadystatechange=r(this.ya,this);try{A(this.k,dc(this,"Opening Xhr")),this.ba=!0,this.a.open(b,String(a),!0),this.ba=!1}catch(e){A(this.k,dc(this,"Error opening Xhr: "+e.message));ec(this,e);return}a=c||"";var f=this.headers.clone();
|
|
d&&zb(d,function(a,b){f.set(b,a)});d=Ca(f.t());c=k.FormData&&a instanceof k.FormData;!(0<=za($b,b))||d||c||f.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");f.forEach(function(a,b){this.a.setRequestHeader(b,a)},this);this.xa&&(this.a.responseType=this.xa);"withCredentials"in this.a&&(this.a.withCredentials=this.Na);try{fc(this),0<this.B&&(this.S=gc(this.a),A(this.k,dc(this,"Will abort after "+this.B+"ms if incomplete, xhr2 "+this.S)),this.S?(this.a.timeout=this.B,this.a.ontimeout=
|
|
r(this.za,this)):this.R=Pb(this.za,this.B,this)),A(this.k,dc(this,"Sending request")),this.O=!0,this.a.send(a),this.O=!1}catch(g){A(this.k,dc(this,"Send error: "+g.message)),ec(this,g)}};var gc=function(a){return x&&y(9)&&ea(a.timeout)&&l(a.ontimeout)},Ba=function(a){return"content-type"==a.toLowerCase()};D.prototype.za=function(){"undefined"!=typeof aa&&this.a&&(this.H="Timed out after "+this.B+"ms, aborting",A(this.k,dc(this,this.H)),this.dispatchEvent("timeout"),this.abort(8))};
|
|
var ec=function(a,b){a.s=!1;a.a&&(a.w=!0,a.a.abort(),a.w=!1);a.H=b;hc(a);ic(a)},hc=function(a){a.ca||(a.ca=!0,a.dispatchEvent("complete"),a.dispatchEvent("error"))};D.prototype.abort=function(){this.a&&this.s&&(A(this.k,dc(this,"Aborting")),this.s=!1,this.w=!0,this.a.abort(),this.w=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),ic(this))};D.prototype.C=function(){this.a&&(this.s&&(this.s=!1,this.w=!0,this.a.abort(),this.w=!1),ic(this,!0));D.n.C.call(this)};
|
|
D.prototype.ya=function(){this.M||(this.ba||this.O||this.w?jc(this):this.Va())};D.prototype.Va=function(){jc(this)};
|
|
var jc=function(a){if(a.s&&"undefined"!=typeof aa)if(a.P[1]&&4==kc(a)&&2==a.getStatus())A(a.k,dc(a,"Local request error detected and ignored"));else if(a.O&&4==kc(a))Pb(a.ya,0,a);else if(a.dispatchEvent("readystatechange"),4==kc(a)){A(a.k,dc(a,"Request complete"));a.s=!1;try{var b=a.getStatus(),c,d;t:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:d=!0;break t;default:d=!1}if(!(c=d)){var e;if(e=0===b){var f=Sb(1,String(a.Q));if(!f&&self.location)var g=self.location.protocol,
|
|
f=g.substr(0,g.length-1);e=!Zb.test(f?f.toLowerCase():"")}c=e}if(c)a.dispatchEvent("complete"),a.dispatchEvent("success");else{var n;try{n=2<kc(a)?a.a.statusText:""}catch(C){A(a.k,"Can not get status: "+C.message),n=""}a.H=n+" ["+a.getStatus()+"]";hc(a)}}finally{ic(a)}}},ic=function(a,b){if(a.a){fc(a);var c=a.a,d=a.P[0]?ba:null;a.a=null;a.P=null;b||a.dispatchEvent("ready");try{c.onreadystatechange=d}catch(e){(c=a.k)&&c.log(Ib,"Problem encountered resetting onreadystatechange: "+e.message,void 0)}}},
|
|
fc=function(a){a.a&&a.S&&(a.a.ontimeout=null);ea(a.R)&&(k.clearTimeout(a.R),a.R=null)},kc=function(a){return a.a?a.a.readyState:0};D.prototype.getStatus=function(){try{return 2<kc(this)?this.a.status:-1}catch(a){return-1}};var dc=function(a,b){return b+" ["+a.wa+" "+a.Q+" "+a.getStatus()+"]"};var lc=function(a,b,c){this.p=a||null;this.bb=!!c},nc=function(a){if(!a.g&&(a.g=new wb,a.m=0,a.p))for(var b=a.p.split("&"),c=0;c<b.length;c++){var d=b[c].indexOf("="),e=null,f=null;0<=d?(e=b[c].substring(0,d),f=b[c].substring(d+1)):e=b[c];e=decodeURIComponent(e.replace(/\+/g," "));e=mc(a,e);a.add(e,f?decodeURIComponent(f.replace(/\+/g," ")):"")}};h=lc.prototype;h.g=null;h.m=null;h.add=function(a,b){nc(this);this.p=null;a=mc(this,a);var c=this.g.get(a);c||this.g.set(a,c=[]);c.push(b);this.m++;return this};
|
|
h.W=function(a){nc(this);a=mc(this,a);return this.g.W(a)};h.t=function(){nc(this);for(var a=this.g.q(),b=this.g.t(),c=[],d=0;d<b.length;d++)for(var e=a[d],f=0;f<e.length;f++)c.push(b[d]);return c};h.q=function(a){nc(this);var b=[];if(p(a))this.W(a)&&(b=Ea(b,this.g.get(mc(this,a))));else{a=this.g.q();for(var c=0;c<a.length;c++)b=Ea(b,a[c])}return b};h.set=function(a,b){nc(this);this.p=null;a=mc(this,a);this.W(a)&&(this.m-=this.g.get(a).length);this.g.set(a,[b]);this.m++;return this};
|
|
h.get=function(a,b){var c=a?this.q(a):[];return 0<c.length?String(c[0]):b};h.toString=function(){if(this.p)return this.p;if(!this.g)return"";for(var a=[],b=this.g.t(),c=0;c<b.length;c++)for(var d=b[c],e=encodeURIComponent(String(d)),d=this.q(d),f=0;f<d.length;f++){var g=e;""!==d[f]&&(g+="="+encodeURIComponent(String(d[f])));a.push(g)}return this.p=a.join("&")};h.clone=function(){var a=new lc;a.p=this.p;this.g&&(a.g=this.g.clone(),a.m=this.m);return a};
|
|
var mc=function(a,b){var c=String(b);a.bb&&(c=c.toLowerCase());return c};var oc=null,pc=null,qc=null,rc=!1,bc=0,sc={Db:"CANCEL",Gb:"UPDATE"},tc=function(a,b,c){null!=a?oc=a:rc||(oc="/api");null!=b?pc=b:rc||(pc="https://earthengine.googleapis.com");l(c)&&(qc=c);rc=!0};s("ee.data.setDeadline",function(a){bc=a});s("ee.data.getApiBaseUrl",function(){return oc});s("ee.data.getTileBaseUrl",function(){return pc});
|
|
s("ee.data.getInfo",function(a,b){k.console&&k.console.error&&k.console.error("ee.data.getInfo is DEPRECATED. Use ee.data.getValue() instead.");return F("/info",(new lc).add("id",a),b)});s("ee.data.getList",function(a,b){var c=G(a);return F("/list",c,b)});var uc=function(a,b){a=w(a);return F("/mapid",G(a),b)};s("ee.data.getMapId",uc);s("ee.data.getTileUrl",function(a,b,c,d){var e=Math.pow(2,d);b%=e;0>b&&(b+=e);return[pc,"map",a.mapid,d,b,c].join("/")+"?token="+a.token});
|
|
var vc=function(a,b){a=w(a);return F("/value",G(a),b)};s("ee.data.getValue",vc);var wc=function(a,b){a=w(a);m(a.size)&&(a.size=a.size.join("x"));var c=G(a).add("getid","1");return F("/thumb",c,b)};s("ee.data.getThumbId",wc);var xc=function(a){return pc+"/api/thumb?thumbid="+a.thumbid+"&token="+a.token};s("ee.data.makeThumbUrl",xc);var yc=function(a,b){a=w(a);return F("/download",G(a),b)};s("ee.data.getDownloadId",yc);var zc=function(a){return pc+"/api/download?docid="+a.docid+"&token="+a.token};
|
|
s("ee.data.makeDownloadUrl",zc);var Ac=function(a,b){a=w(a);return F("/table",G(a),b)};s("ee.data.getTableDownloadId",Ac);var Bc=function(a){return pc+"/api/table?docid="+a.docid+"&token="+a.token};s("ee.data.makeTableDownloadUrl",Bc);s("ee.data.createAsset",function(a,b,c,d){a={value:a};void 0!==b&&(a.id=b);a.force=c||!1;return F("/create",G(a),d)});s("ee.data.createFolder",function(a,b,c){return F("/createfolder",G({id:a,force:b||!1}),c)});
|
|
s("ee.data.newTaskId",function(a,b){var c={};ea(a)&&(c.count=a);return F("/newtaskid",G(c),b)});s("ee.data.getTaskStatus",function(a,b){if(p(a))a=[a];else if(!m(a))throw Error("Invalid task_id: expected a string or an array of strings.");return F("/taskstatus?q="+a.join(),null,b,"GET")});s("ee.data.getTaskList",function(a){return F("/tasklist",null,a,"GET")});s("ee.data.cancelTask",function(a,b){return Cc(a,"CANCEL",b)});
|
|
var Cc=function(a,b,c){if(p(a))a=[a];else if(!m(a))throw Error("Invalid task_id: expected a string or an array of strings.");var d;t:{for(d in sc)if(sc[d]==b){d=!0;break t}d=!1}if(!d)throw Error("Invalid action: "+b);return F("/updatetask",G({id:a,action:b}),c,"POST")};s("ee.data.updateTask",Cc);s("ee.data.prepareValue",function(a,b,c){b=w(b);b.tid=a;return F("/prepare",G(b),c)});s("ee.data.startProcessing",function(a,b,c){b=w(b);b.id=a;return F("/processingrequest",G(b),c)});
|
|
var F=function(a,b,c,d){function e(a,b){var c=!1;try{var d=Ta(a),e=d.data}catch(f){c=!0}var ta=void 0;c||!("data"in d||"error"in d)?ta="Malformed response: "+a:"error"in d&&(ta=d.error.message);if(b)return b(e,ta),null;if(!ta)return e;throw Error(ta);}tc();d=d||"POST";null!=qc&&("GET"==d?(a+=-1!=a.indexOf("?")?"&":"?",a+="xsrfToken="+qc):(b||(b=new lc),b.add("xsrfToken",qc)));a=oc+a;b=b?b.toString():"";if(c)return cc(a,function(a){var b;a=a.target;try{b=a.a?a.a.responseText:""}catch(d){A(a.k,"Can not get responseText: "+
|
|
d.message),b=""}return e(b,c)},d,b),null;var f=B();f.open(d,a,!1);f.setRequestHeader("Content-Type","application/x-www-form-urlencoded");f.send(b);return e(f.responseText,null)},G=function(a){var b=new lc,c;for(c in a)b.set(c,a[c]);return b};var Dc=function(){};var Ec=function(){this.r=-1};var Fc=function(){this.r=-1;this.r=64;this.f=Array(4);this.Ra=Array(this.r);this.X=this.L=0;this.reset()};t(Fc,Ec);Fc.prototype.reset=function(){this.f[0]=1732584193;this.f[1]=4023233417;this.f[2]=2562383102;this.f[3]=271733878;this.X=this.L=0};
|
|
var Gc=function(a,b,c){c||(c=0);var d=Array(16);if(p(b))for(var e=0;16>e;++e)d[e]=b.charCodeAt(c++)|b.charCodeAt(c++)<<8|b.charCodeAt(c++)<<16|b.charCodeAt(c++)<<24;else for(e=0;16>e;++e)d[e]=b[c++]|b[c++]<<8|b[c++]<<16|b[c++]<<24;b=a.f[0];c=a.f[1];var e=a.f[2],f=a.f[3],g=0,g=b+(f^c&(e^f))+d[0]+3614090360&4294967295;b=c+(g<<7&4294967295|g>>>25);g=f+(e^b&(c^e))+d[1]+3905402710&4294967295;f=b+(g<<12&4294967295|g>>>20);g=e+(c^f&(b^c))+d[2]+606105819&4294967295;e=f+(g<<17&4294967295|g>>>15);g=c+(b^e&
|
|
(f^b))+d[3]+3250441966&4294967295;c=e+(g<<22&4294967295|g>>>10);g=b+(f^c&(e^f))+d[4]+4118548399&4294967295;b=c+(g<<7&4294967295|g>>>25);g=f+(e^b&(c^e))+d[5]+1200080426&4294967295;f=b+(g<<12&4294967295|g>>>20);g=e+(c^f&(b^c))+d[6]+2821735955&4294967295;e=f+(g<<17&4294967295|g>>>15);g=c+(b^e&(f^b))+d[7]+4249261313&4294967295;c=e+(g<<22&4294967295|g>>>10);g=b+(f^c&(e^f))+d[8]+1770035416&4294967295;b=c+(g<<7&4294967295|g>>>25);g=f+(e^b&(c^e))+d[9]+2336552879&4294967295;f=b+(g<<12&4294967295|g>>>20);g=
|
|
e+(c^f&(b^c))+d[10]+4294925233&4294967295;e=f+(g<<17&4294967295|g>>>15);g=c+(b^e&(f^b))+d[11]+2304563134&4294967295;c=e+(g<<22&4294967295|g>>>10);g=b+(f^c&(e^f))+d[12]+1804603682&4294967295;b=c+(g<<7&4294967295|g>>>25);g=f+(e^b&(c^e))+d[13]+4254626195&4294967295;f=b+(g<<12&4294967295|g>>>20);g=e+(c^f&(b^c))+d[14]+2792965006&4294967295;e=f+(g<<17&4294967295|g>>>15);g=c+(b^e&(f^b))+d[15]+1236535329&4294967295;c=e+(g<<22&4294967295|g>>>10);g=b+(e^f&(c^e))+d[1]+4129170786&4294967295;b=c+(g<<5&4294967295|
|
|
g>>>27);g=f+(c^e&(b^c))+d[6]+3225465664&4294967295;f=b+(g<<9&4294967295|g>>>23);g=e+(b^c&(f^b))+d[11]+643717713&4294967295;e=f+(g<<14&4294967295|g>>>18);g=c+(f^b&(e^f))+d[0]+3921069994&4294967295;c=e+(g<<20&4294967295|g>>>12);g=b+(e^f&(c^e))+d[5]+3593408605&4294967295;b=c+(g<<5&4294967295|g>>>27);g=f+(c^e&(b^c))+d[10]+38016083&4294967295;f=b+(g<<9&4294967295|g>>>23);g=e+(b^c&(f^b))+d[15]+3634488961&4294967295;e=f+(g<<14&4294967295|g>>>18);g=c+(f^b&(e^f))+d[4]+3889429448&4294967295;c=e+(g<<20&4294967295|
|
|
g>>>12);g=b+(e^f&(c^e))+d[9]+568446438&4294967295;b=c+(g<<5&4294967295|g>>>27);g=f+(c^e&(b^c))+d[14]+3275163606&4294967295;f=b+(g<<9&4294967295|g>>>23);g=e+(b^c&(f^b))+d[3]+4107603335&4294967295;e=f+(g<<14&4294967295|g>>>18);g=c+(f^b&(e^f))+d[8]+1163531501&4294967295;c=e+(g<<20&4294967295|g>>>12);g=b+(e^f&(c^e))+d[13]+2850285829&4294967295;b=c+(g<<5&4294967295|g>>>27);g=f+(c^e&(b^c))+d[2]+4243563512&4294967295;f=b+(g<<9&4294967295|g>>>23);g=e+(b^c&(f^b))+d[7]+1735328473&4294967295;e=f+(g<<14&4294967295|
|
|
g>>>18);g=c+(f^b&(e^f))+d[12]+2368359562&4294967295;c=e+(g<<20&4294967295|g>>>12);g=b+(c^e^f)+d[5]+4294588738&4294967295;b=c+(g<<4&4294967295|g>>>28);g=f+(b^c^e)+d[8]+2272392833&4294967295;f=b+(g<<11&4294967295|g>>>21);g=e+(f^b^c)+d[11]+1839030562&4294967295;e=f+(g<<16&4294967295|g>>>16);g=c+(e^f^b)+d[14]+4259657740&4294967295;c=e+(g<<23&4294967295|g>>>9);g=b+(c^e^f)+d[1]+2763975236&4294967295;b=c+(g<<4&4294967295|g>>>28);g=f+(b^c^e)+d[4]+1272893353&4294967295;f=b+(g<<11&4294967295|g>>>21);g=e+(f^
|
|
b^c)+d[7]+4139469664&4294967295;e=f+(g<<16&4294967295|g>>>16);g=c+(e^f^b)+d[10]+3200236656&4294967295;c=e+(g<<23&4294967295|g>>>9);g=b+(c^e^f)+d[13]+681279174&4294967295;b=c+(g<<4&4294967295|g>>>28);g=f+(b^c^e)+d[0]+3936430074&4294967295;f=b+(g<<11&4294967295|g>>>21);g=e+(f^b^c)+d[3]+3572445317&4294967295;e=f+(g<<16&4294967295|g>>>16);g=c+(e^f^b)+d[6]+76029189&4294967295;c=e+(g<<23&4294967295|g>>>9);g=b+(c^e^f)+d[9]+3654602809&4294967295;b=c+(g<<4&4294967295|g>>>28);g=f+(b^c^e)+d[12]+3873151461&4294967295;
|
|
f=b+(g<<11&4294967295|g>>>21);g=e+(f^b^c)+d[15]+530742520&4294967295;e=f+(g<<16&4294967295|g>>>16);g=c+(e^f^b)+d[2]+3299628645&4294967295;c=e+(g<<23&4294967295|g>>>9);g=b+(e^(c|~f))+d[0]+4096336452&4294967295;b=c+(g<<6&4294967295|g>>>26);g=f+(c^(b|~e))+d[7]+1126891415&4294967295;f=b+(g<<10&4294967295|g>>>22);g=e+(b^(f|~c))+d[14]+2878612391&4294967295;e=f+(g<<15&4294967295|g>>>17);g=c+(f^(e|~b))+d[5]+4237533241&4294967295;c=e+(g<<21&4294967295|g>>>11);g=b+(e^(c|~f))+d[12]+1700485571&4294967295;b=c+
|
|
(g<<6&4294967295|g>>>26);g=f+(c^(b|~e))+d[3]+2399980690&4294967295;f=b+(g<<10&4294967295|g>>>22);g=e+(b^(f|~c))+d[10]+4293915773&4294967295;e=f+(g<<15&4294967295|g>>>17);g=c+(f^(e|~b))+d[1]+2240044497&4294967295;c=e+(g<<21&4294967295|g>>>11);g=b+(e^(c|~f))+d[8]+1873313359&4294967295;b=c+(g<<6&4294967295|g>>>26);g=f+(c^(b|~e))+d[15]+4264355552&4294967295;f=b+(g<<10&4294967295|g>>>22);g=e+(b^(f|~c))+d[6]+2734768916&4294967295;e=f+(g<<15&4294967295|g>>>17);g=c+(f^(e|~b))+d[13]+1309151649&4294967295;
|
|
c=e+(g<<21&4294967295|g>>>11);g=b+(e^(c|~f))+d[4]+4149444226&4294967295;b=c+(g<<6&4294967295|g>>>26);g=f+(c^(b|~e))+d[11]+3174756917&4294967295;f=b+(g<<10&4294967295|g>>>22);g=e+(b^(f|~c))+d[2]+718787259&4294967295;e=f+(g<<15&4294967295|g>>>17);g=c+(f^(e|~b))+d[9]+3951481745&4294967295;a.f[0]=a.f[0]+b&4294967295;a.f[1]=a.f[1]+(e+(g<<21&4294967295|g>>>11))&4294967295;a.f[2]=a.f[2]+e&4294967295;a.f[3]=a.f[3]+f&4294967295};
|
|
Fc.prototype.update=function(a,b){l(b)||(b=a.length);for(var c=b-this.r,d=this.Ra,e=this.L,f=0;f<b;){if(0==e)for(;f<=c;)Gc(this,a,f),f+=this.r;if(p(a))for(;f<b;){if(d[e++]=a.charCodeAt(f++),e==this.r){Gc(this,d);e=0;break}}else for(;f<b;)if(d[e++]=a[f++],e==this.r){Gc(this,d);e=0;break}}this.L=e;this.X+=b};
|
|
var Ic=function(){var a=Hc,b=Array((56>a.L?a.r:2*a.r)-a.L);b[0]=128;for(var c=1;c<b.length-8;++c)b[c]=0;for(var d=8*a.X,c=b.length-8;c<b.length;++c)b[c]=d&255,d/=256;a.update(b);b=Array(16);for(c=d=0;4>c;++c)for(var e=0;32>e;e+=8)b[d++]=a.f[c]>>>e&255;return b};var Jc=function(a){this.U="__ee_hash__";this.ka=!1!==a;this.F=[];this.D={};this.la=[]};s("ee.Serializer",Jc);var Kc=new Ua,Hc=new Fc,Mc=function(a,b){return Lc(new Jc(l(b)?b:!0),a)};s("ee.Serializer.encode",Mc);var Nc=function(a){return Kc.h(Mc(a))};s("ee.Serializer.toJSON",Nc);var Oc=function(a){a=Lc(new Jc(!1),a);return"JSON"in k?k.JSON.stringify(a,null," "):Kc.h(a)};s("ee.Serializer.toReadableJSON",Oc);
|
|
var Lc=function(a,b){var c=a.V(b);a.ka&&(c=q(c)&&"ValueRef"==c.type&&1==a.F.length?a.F[0][1]:{type:"CompoundValue",scope:a.F,value:c},a.F=[],Aa(a.la,r(function(a){delete a[this.U]},a)),a.la=[],a.D={});return c};
|
|
Jc.prototype.V=function(a){if(!l(a))throw Error("Can't encode an undefined value.");var b,c=q(a)?a[this.U]:null;if(this.ka&&null!=c&&this.D[c])return{type:"ValueRef",value:this.D[c]};if(null===a||"boolean"==typeof a||ea(a)||p(a))return a;if(q(a)&&"function"==typeof a.getFullYear)return{type:"Invocation",functionName:"Date",arguments:{value:Math.floor(a.getTime())}};if(a instanceof Dc){if(b=a.e(r(this.V,this)),!(m(b)||q(b)&&"ArgumentRef"!=b.type))return b}else if(m(a))b=v(a,function(a){return this.V(a)},
|
|
this);else if(q(a)&&!fa(a))b=La(a,function(a){if(!fa(a))return this.V(a)},this),Oa(b,this.U),b={type:"Dictionary",value:b};else throw Error("Can't encode object: "+a);if(this.ka){Hc.reset();Hc.update(Kc.h(b));var c=Ic().toString(),d;this.D[c]?d=this.D[c]:(d=String(this.F.length),this.F.push([d,b]),this.D[c]=d);a[this.U]=c;this.la.push(a);return{type:"ValueRef",value:d}}return b};var H=function(a,b,c){if(!(this instanceof H))return I(H,arguments);if(c&&(a||b))throw Error('When "opt_varName" is specified, "func" and "args" must be null.');if(a&&!b)throw Error('When "func" is specified, "args" must not be null.');this.b=a;this.c=b;this.d=c||null};t(H,Dc);s("ee.ComputedObject",H);H.prototype.j=function(a){return vc({json:this.h()},a)};s("ee.ComputedObject.prototype.getInfo",H.prototype.j);
|
|
H.prototype.e=function(a){if(null===this.b&&null===this.c)return{type:"ArgumentRef",value:this.d};var b={},c;for(c in this.c)l(this.c[c])&&(b[c]=a(this.c[c]));b={type:"Invocation",arguments:b};a=a(this.b);b[p(a)?"functionName":"function"]=a;return b};H.prototype.h=function(){return Nc(this)};s("ee.ComputedObject.prototype.serialize",H.prototype.h);H.prototype.toString=function(){return"ee."+this.name()+"("+Oc(this)+")"};s("ee.ComputedObject.prototype.toString",H.prototype.toString);
|
|
H.prototype.name=function(){return"ComputedObject"};var Pc=function(a,b){if(b instanceof a.constructor)return b;var c=function(){};c.prototype=a.constructor.prototype;c=new c;c.b=b.b;c.c=b.c;c.d=b.d;return c},I=function(a,b){function c(){return a.apply(this,b)}c.prototype=a.prototype;return new c};var J=function(){if(!(this instanceof J))return new J};t(J,Dc);s("ee.Function",J);var Qc=function(a){return a};J.prototype.call=function(a){return this.apply(Rc(this,Array.prototype.slice.call(arguments,0)))};s("ee.Function.prototype.call",J.prototype.call);J.prototype.apply=function(a){a=new H(this,Sc(this,a));return Qc(a,this.l().returns)};s("ee.Function.prototype.apply",J.prototype.apply);
|
|
var Sc=function(a,b){for(var c=a.l().args,d={},e={},f=0;f<c.length;f++){var g=c[f].name;if(g in b&&l(b[g]))d[g]=Qc(b[g],c[f].type);else if(!c[f].optional)throw Error("Required argument ("+g+") missing to function: "+a);e[g]=!0}var c=[],n;for(n in b)e[n]||c.push(n);if(0<c.length)throw Error("Unrecognized arguments ("+c+") to function: "+a);return d},Rc=function(a,b){var c=a.l().args;if(c.length<b.length)throw Error("Too many ("+b.length+") arguments to function: "+a);for(var d={},e=0;e<b.length;e++)d[c[e].name]=
|
|
b[e];return d};
|
|
J.prototype.toString=function(a,b){var c=this.l(),d=[];d.push(a||c.name);d.push("(");d.push(v(c.args.slice(b?1:0),function(a){return a.name}).join(", "));d.push(")\n");d.push("\n");c.description?d.push(c.description):d.push("Undocumented.");d.push("\n");if(c.args.length){d.push("\nArgs:\n");for(var e=0;e<c.args.length;e++){b&&0==e?d.push(" this:"):d.push("\n ");var f=c.args[e];d.push(f.name);d.push(" (");d.push(f.type);f.optional&&d.push(", optional");d.push("): ");f.description?d.push(f.description):
|
|
d.push("Undocumented.")}}return d.join("")};J.prototype.h=function(){return Nc(this)};var Tc={},Uc=function(a){return a.prototype instanceof H?a.prototype.name.call(null):a==Number?"Number":a==String?"String":a==Array?"Array":a==Date?"Date":"Object"},Vc=function(a,b){if(b==a)return!0;switch(a){case "Element":case "EEObject":return"EEObject"==b||"Element"==b||"Image"==b||"Feature"==b||"Collection"==b||"ImageCollection"==b||"FeatureCollection"==b;case "FeatureCollection":case "Collection":return"Collection"==b||"ImageCollection"==b||"FeatureCollection"==b;case "Object":return!0;default:return!1}},
|
|
Wc=function(a){return ea(a)||a instanceof H&&"Number"==a.name()},Xc=function(a){return p(a)||a instanceof H&&"String"==a.name()},Yc=function(a){return q(a)&&!fa(a)?(a=Object.getPrototypeOf(a),null!==a&&null===Object.getPrototypeOf(a)):!1};var K=function(a,b){if(!l(b))return Zc(a);if(!(this instanceof K))return I(K,arguments);this.G=Pa(b);this.G.name=a};t(K,J);s("ee.ApiFunction",K);var L=function(a,b){return J.prototype.call.apply(Zc(a),Array.prototype.slice.call(arguments,1))};s("ee.ApiFunction._call",L);var $c=function(a,b){return Zc(a).apply(b)};s("ee.ApiFunction._apply",$c);K.prototype.e=function(){return this.G.name};K.prototype.l=function(){return this.G};
|
|
var Ja=null,ad={},cd=function(){bd();return La(Ja,function(a){return a.l()})},dd=function(){bd();return Ka(function(a,b){return!ad[b]})},Zc=function(a){var b=ed(a);if(!b)throw Error("Unknown built-in function name: "+a);return b};s("ee.ApiFunction.lookup",Zc);
|
|
var ed=function(a){bd();return Ja[a]||null},bd=function(a,b){if(Ja)a&&a();else{var c=function(c,e){e?b&&b(Error(e)):(Ja=La(c,function(a,b){a.returns=a.returns.replace(/<.*>/,"");for(var c=0;c<a.args.length;c++)a.args[c].type=a.args[c].type.replace(/<.*>/,"");return new K(b,a)}),a&&a())};a?F("/algorithms",null,c,"GET"):c(F("/algorithms",null,void 0,"GET"))}},M=function(a,b,c,d){bd();var e=d||"";Ia(Ja,function(d,g){var n=g.split(".");if(2==n.length&&n[0]==b){var C=e+n[1],E=d.l();ad[g]=!0;var z=!1;E.args.length&&
|
|
(n=E.args[0].type,z="Object"!=n&&Vc(n,c));n=z?a.prototype:a;C in n||(n[C]=function(a){var b=Array.prototype.slice.call(arguments,0),c=!1;if(1==b.length&&Yc(b[0])){var e=E.args;z&&(e=e.slice(1));e.length&&(c=!((1==e.length||e[1].optional)&&"Dictionary"==e[0].type))}if(c){if(b=w(b[0]),z){c=E.args[0].name;if(c in b)throw Error("Named args for "+C+" can't contain keyword "+c);b[c]=this}}else b=Rc(d,z?[this].concat(b):b);return d.apply(b)},n[C].toString=r(d.toString,d,C,z),n[C].signature=E)}})},N=function(a){var b=
|
|
function(a){for(var b in a)fa(a[b])&&a[b].signature&&delete a[b]};b(a);b(a.prototype)};var O=function(a,b,c){H.call(this,a,b,c);fd()};t(O,H);s("ee.Element",O);var gd=!1,fd=function(){gd||(M(O,"Element","Element"),gd=!0)};O.prototype.name=function(){return"Element"};
|
|
O.prototype.set=function(a){var b;if(1>=arguments.length){var c=arguments[0];if(b=Yc(c))t:{b=Na(c);var d=["properties"];if(da(b)&&da(d)&&b.length==d.length){for(var e=b.length,f=0;f<e;f++)if(b[f]!==d[f]){b=!1;break t}b=!0}else b=!1}b&&q(c.properties)&&(c=c.properties);if(Yc(c)){b=this;for(var g in c)d=c[g],b=L("Element.set",b,g,d)}else if(c instanceof H&&ed("Element.setMulti"))b=L("Element.setMulti",this,c);else throw Error("When Element.set() is passed one argument, it must be a dictionary.");}else{if(0!=
|
|
arguments.length%2)throw Error("When Element.set() is passed multiple arguments, there must be an even number of them.");b=this;for(c=0;c<arguments.length;c+=2)g=arguments[c],d=arguments[c+1],b=L("Element.set",b,g,d)}return Pc(this,b)};s("ee.Element.prototype.set",O.prototype.set);var P=function(a){if(!(this instanceof P))return I(P,arguments);if(a instanceof P)return a;hd();if(m(a)){if(0==a.length)throw Error("Empty list specified for ee.Filter().");if(1==a.length)return new P(a[0]);H.call(this,new K("Filter.and"),{filters:a});this.K=a}else if(a instanceof H)H.call(this,a.b,a.c,a.d),this.K=[a];else{if(l(a))throw Error("Invalid argument specified for ee.Filter(): "+a);H.call(this,null,null);this.K=[]}};t(P,H);s("ee.Filter",P);
|
|
var id=!1,hd=function(){id||(M(P,"Filter","Filter"),id=!0)},jd={equals:"equals",less_than:"lessThan",greater_than:"greaterThan",contains:"stringContains",starts_with:"stringStartsWith",ends_with:"stringEndsWith"};P.prototype.length=function(){return this.K.length};P.prototype.length=P.prototype.length;var Q=function(a,b){var c=a.K.slice(0);b instanceof P?Fa(c,b.K):b instanceof Array?Fa(c,b):c.push(b);return new P(c)};P.prototype.v=function(){return L("Filter.not",this)};P.prototype.not=P.prototype.v;
|
|
var kd=function(a,b,c){b=b.toLowerCase();var d=!1;0==b.lastIndexOf("not_",0)&&(d=!0,b=b.substring(4));if(!(b in jd))throw Error("Unknown filtering operator: "+b);a=L("Filter."+jd[b],a,c);return d?a.v():a};P.metadata=kd;var ld=function(a,b){return L("Filter.equals",a,b)};P.eq=ld;var md=function(a,b){return ld(a,b).v()};P.neq=md;var nd=function(a,b){return L("Filter.lessThan",a,b)};P.lt=nd;var od=function(a,b){return nd(a,b).v()};P.gte=od;var pd=function(a,b){return L("Filter.greaterThan",a,b)};
|
|
P.gt=pd;var qd=function(a,b){return pd(a,b).v()};P.lte=qd;var rd=function(a,b){return L("Filter.stringContains",a,b)};P.contains=rd;var sd=function(a,b){return rd(a,b).v()};P.not_contains=sd;var td=function(a,b){return L("Filter.stringStartsWith",a,b)};P.starts_with=td;var ud=function(a,b){return td(a,b).v()};P.not_starts_with=ud;var vd=function(a,b){return L("Filter.stringEndsWith",a,b)};P.ends_with=vd;var wd=function(a,b){return vd(a,b).v()};P.not_ends_with=wd;
|
|
var xd=function(a){return L("Filter.and",Array.prototype.slice.call(arguments))};P.and=xd;P.or=function(a){return L("Filter.or",Array.prototype.slice.call(arguments))};var yd=function(a,b){var c=L("DateRange",a,b);return $c("Filter.dateRangeContains",{leftValue:c,rightField:"system:time_start"})};P.date=yd;var zd=function(a,b,c,d){return $c("Filter.listContains",{leftField:c,rightValue:d,rightField:a,leftValue:b})};P.inList=zd;
|
|
var Ad=function(a,b){return $c("Filter.intersects",{leftField:".all",rightValue:L("Feature",a),maxError:b})};P.bounds=Ad;P.prototype.mb=function(){return Q(this,ld.apply(null,[].slice.call(arguments)))};P.prototype.eq=P.prototype.mb;P.prototype.xb=function(){return Q(this,md.apply(null,[].slice.call(arguments)))};P.prototype.neq=P.prototype.xb;P.prototype.vb=function(){return Q(this,nd.apply(null,[].slice.call(arguments)))};P.prototype.lt=P.prototype.vb;
|
|
P.prototype.tb=function(){return Q(this,od.apply(null,[].slice.call(arguments)))};P.prototype.gte=P.prototype.tb;P.prototype.sb=function(){return Q(this,pd.apply(null,[].slice.call(arguments)))};P.prototype.gt=P.prototype.sb;P.prototype.wb=function(){return Q(this,qd.apply(null,[].slice.call(arguments)))};P.prototype.lte=P.prototype.wb;P.prototype.contains=function(){return Q(this,rd.apply(null,[].slice.call(arguments)))};P.prototype.contains=P.prototype.contains;
|
|
P.prototype.yb=function(){return Q(this,sd.apply(null,[].slice.call(arguments)))};P.prototype.not_contains=P.prototype.yb;P.prototype.Bb=function(){return Q(this,td.apply(null,[].slice.call(arguments)))};P.prototype.starts_with=P.prototype.Bb;P.prototype.Ab=function(){return Q(this,ud.apply(null,[].slice.call(arguments)))};P.prototype.not_starts_with=P.prototype.Ab;P.prototype.lb=function(){return Q(this,vd.apply(null,[].slice.call(arguments)))};P.prototype.ends_with=P.prototype.lb;
|
|
P.prototype.zb=function(){return Q(this,wd.apply(null,[].slice.call(arguments)))};P.prototype.not_ends_with=P.prototype.zb;P.prototype.jb=function(){return Q(this,xd.apply(null,[].slice.call(arguments)))};P.prototype.and=P.prototype.jb;P.prototype.kb=function(){return Q(this,yd.apply(null,[].slice.call(arguments)))};P.prototype.date=P.prototype.kb;P.prototype.ub=function(){return Q(this,zd.apply(null,[].slice.call(arguments)))};P.prototype.inList=P.prototype.ub;
|
|
P.prototype.bounds=function(){return Q(this,Ad.apply(null,[].slice.call(arguments)))};P.prototype.bounds=P.prototype.bounds;P.prototype.name=function(){return"Filter"};var R=function(a,b,c){O.call(this,a,b,c);Bd()};t(R,O);s("ee.Collection",R);var Cd=!1,Bd=function(){Cd||(M(R,"Collection","Collection"),M(R,"AggregateFeatureCollection","Collection","aggregate_"),Cd=!0)};R.prototype.filter=function(a){if(!a)throw Error("Empty filters.");return Pc(this,L("Collection.filter",this,a))};s("ee.Collection.prototype.filter",R.prototype.filter);R.prototype.qb=function(a,b,c){return this.filter(kd(a,b,c))};s("ee.Collection.prototype.filterMetadata",R.prototype.qb);
|
|
R.prototype.ob=function(a){return this.filter(Ad(a))};s("ee.Collection.prototype.filterBounds",R.prototype.ob);R.prototype.pb=function(a,b){return this.filter(yd(a,b))};s("ee.Collection.prototype.filterDate",R.prototype.pb);R.prototype.limit=function(a,b,c){return Pc(this,L("Collection.limit",this,a,b,c))};s("ee.Collection.prototype.limit",R.prototype.limit);R.prototype.sort=function(a,b){return Pc(this,L("Collection.limit",this,void 0,a,b))};s("ee.Collection.prototype.sort",R.prototype.sort);
|
|
R.prototype.name=function(){return"Collection"};R.prototype.elementType=function(){return O};R.prototype.map=function(a){var b=this.elementType();return Pc(this,L("Collection.map",this,function(c){return a(new b(c))}))};s("ee.Collection.prototype.map",R.prototype.map);R.prototype.va=function(a,b){var c=l(b)?b:null,d=this.elementType();return L("Collection.iterate",this,function(b,c){return a(new d(b),c)},c)};s("ee.Collection.prototype.iterate",R.prototype.va);var S=function(a){if(!(this instanceof S))return I(S,arguments);if(a instanceof S)return a;Dd();if(ea(a))H.call(this,null,null),this.ja=a;else if(a instanceof H)H.call(this,a.b,a.c,a.d),this.ja=null;else throw Error("Invalid argument specified for ee.Number(): "+a);};t(S,H);s("ee.Number",S);var Ed=!1,Dd=function(){Ed||(M(S,"Number","Number"),Ed=!0)};S.prototype.e=function(a){return ea(this.ja)?this.ja:S.n.e.call(this,a)};S.prototype.name=function(){return"Number"};var T=function(a){if(!(this instanceof T))return I(T,arguments);if(a instanceof T)return a;Fd();if(p(a))H.call(this,null,null),this.ga=a;else if(a instanceof H)this.ga=null,a.b&&"String"==a.b.l().returns?H.call(this,a.b,a.c,a.d):H.call(this,new K("String"),{input:a},null);else throw Error("Invalid argument specified for ee.String(): "+a);};t(T,H);s("ee.String",T);var Gd=!1,Fd=function(){Gd||(M(T,"String","String"),Gd=!0)};T.prototype.e=function(a){return p(this.ga)?this.ga:T.n.e.call(this,a)};
|
|
T.prototype.name=function(){return"String"};var Hd=function(a,b){if(!(this instanceof Hd))return I(Hd,arguments);for(var c=[],d=a.args,e=0;e<d.length;e++){var f=d[e],g=f.type;c.push(Id(g in Tc?Tc[g]:null,f.name))}if(!l(b.apply(null,c)))throw Error("User-defined methods must return a value.");this.G=Jd(a,c,b);this.eb=b.apply(null,c)};t(Hd,J);s("ee.CustomFunction",Hd);Hd.prototype.e=function(a){return{type:"Function",argumentNames:v(this.G.args,function(a){return a.name}),body:a(this.eb)}};Hd.prototype.l=function(){return this.G};
|
|
var Id=function(a,b){a=a||Object;if(!(a.prototype instanceof H))if(a&&a!=Object)if(a==String)a=T;else if(a==Number)a=S;else if(a==Array)a=k.ee.List;else throw Error("Variables must be of an EE type, e.g. ee.Image or ee.Number.");else a=H;var c=function(){};c.prototype=a.prototype;c=new c;c.b=null;c.c=null;c.d=b;return c},Kd=function(a,b){var c=v(b,function(a){return{name:null,type:p(a)?a:Uc(a)}}),c={name:"",returns:p("Object")?"Object":Uc("Object"),args:c};return new Hd(c,a)},Jd=function(a,b,c){for(var d=
|
|
[],e=0;e<b.length;e++)null===b[e].d&&d.push(e);if(0==d.length)return a;var f=function(a){var b=0;q(a)&&!fa(a)&&("Function"==a.type&&b++,Ia(a,function(a){b+=f(a)}));return b},e=Mc(c.apply(null,b));c="_MAPPING_VAR_"+f(e)+"_";for(e=0;e<d.length;e++){var g=d[e],n=c+e;b[g].d=n;a.args[g].name=n}return a};var Ld=function(a,b){if(!(this instanceof Ld))return I(Ld,arguments);if(a instanceof Ld)return a;Md();var c=new K("Date"),d={},e=null;if(Xc(a)){if(d.value=a,b)if(Xc(b))d.timeZone=b;else throw Error("Invalid argument specified for ee.Date(..., opt_tz): "+b);}else if(Wc(a))d.value=a;else if(q(a)&&"function"==typeof a.getFullYear)d.value=Math.floor(a.getTime());else if(a instanceof H)a.b&&"Date"==a.b.l().returns?(c=a.b,d=a.c,e=a.d):d.value=a;else throw Error("Invalid argument specified for ee.Date(): "+
|
|
a);H.call(this,c,d,e)};t(Ld,H);s("ee.Date",Ld);var Nd=!1,Md=function(){Nd||(M(Ld,"Date","Date"),Nd=!0)};Ld.prototype.name=function(){return"Date"};var U=function(a,b,c){if(!(this instanceof U))return I(U,arguments);Od();var d=null!=b||null!=c;if(a instanceof H&&!(a instanceof U&&a.J)){if(d)throw Error("Setting the CRS or geodesic on a computed Geometry is not suported. Use Geometry.transform().");H.call(this,a.b,a.c,a.d)}else{a instanceof U&&(a=a.e());if(3<arguments.length)throw Error("The Geometry constructor takes at most 3 arguments ("+arguments.length+" given)");if(!Pd(a))throw Error("Invalid GeoJSON geometry: "+JSON.stringify(a));H.call(this,
|
|
null,null);this.J=a.type;this.Oa=a.coordinates||null;this.Pa=a.geometries||null;if(null!=b)this.fa=b;else if("crs"in a)if(q(a.crs)&&"name"==a.crs.type&&q(a.crs.properties)&&p(a.crs.properties.name))this.fa=a.crs.properties.name;else throw Error("Invalid CRS declaration in GeoJSON: "+(new Ua).h(a.crs));this.ea=c;!l(c)&&"geodesic"in a&&(this.ea=Boolean(a.geodesic))}};t(U,H);s("ee.Geometry",U);
|
|
var Qd=!1,Od=function(){Qd||(M(U,"Geometry","Geometry"),Qd=!0)},Rd=function(a,b){if(!(this instanceof Rd))return Sd(Rd,arguments);if(2<arguments.length)throw Error("The Geometry.Point constructor takes at most 2 arguments ("+arguments.length+" given)");if(1==arguments.length&&m(arguments[0])&&2==arguments[0].length){var c=arguments[0];a=c[0];b=c[1]}U.call(this,{type:"Point",coordinates:[a,b]})};t(Rd,U);U.Point=Rd;
|
|
var Td=function(a){if(!(this instanceof Td))return Sd(Td,arguments);U.call(this,{type:"MultiPoint",coordinates:Ud(a,2,arguments)})};t(Td,U);U.MultiPoint=Td;var Vd=function(a,b,c,d){if(!(this instanceof Vd))return I(Vd,arguments);if(4<arguments.length)throw Error("The Geometry.Rectangle constructor takes at most 4 arguments ("+arguments.length+" given)");if(m(a)){var e=a;a=e[0];b=e[1];c=e[2];d=e[3]}U.call(this,{type:"Polygon",coordinates:[[[a,d],[a,b],[c,b],[c,d]]]})};t(Vd,U);U.Rectangle=Vd;
|
|
var Wd=function(a){if(!(this instanceof Wd))return Sd(Wd,arguments);U.call(this,{type:"LineString",coordinates:Ud(a,2,arguments)})};t(Wd,U);U.LineString=Wd;var Xd=function(a){if(!(this instanceof Xd))return Sd(Xd,arguments);U.call(this,{type:"LinearRing",coordinates:Ud(a,2,arguments)})};t(Xd,U);U.LinearRing=Xd;var Yd=function(a){if(!(this instanceof Yd))return Sd(Yd,arguments);U.call(this,{type:"MultiLineString",coordinates:Ud(a,3,arguments)})};t(Yd,U);U.MultiLineString=Yd;
|
|
var Zd=function(a){if(!(this instanceof Zd))return Sd(Zd,arguments);U.call(this,{type:"Polygon",coordinates:Ud(a,3,arguments)})};t(Zd,U);U.Polygon=Zd;var $d=function(a){if(!(this instanceof $d))return Sd($d,arguments);U.call(this,{type:"MultiPolygon",coordinates:Ud(a,4,arguments)})};t($d,U);U.MultiPolygon=$d;
|
|
U.prototype.e=function(a){if(!this.J){if(!a)throw Error("Must specify an encode function when encoding a computed geometry.");return H.prototype.e.call(this,a)}a={type:this.J};"GeometryCollection"==this.J?a.geometries=this.Pa:a.coordinates=this.Oa;null!=this.fa&&(a.crs={type:"name",properties:{name:this.fa}});null!=this.ea&&(a.geodesic=this.ea);return a};U.prototype.Ba=function(){if(this.b)throw Error("Can't convert a computed Geometry to GeoJSON. Use getInfo() instead.");return this.e()};
|
|
U.prototype.toGeoJSON=U.prototype.Ba;U.prototype.Ma=function(){if(this.b)throw Error("Can't convert a computed Geometry to GeoJSON. Use getInfo() instead.");return(new Ua).h(this.Ba())};U.prototype.toGeoJSONString=U.prototype.Ma;U.prototype.type=function(){if(this.b)throw Error("Can't get the type of a computed Geometry to GeoJSON. Use getInfo() instead.");return this.J};U.prototype.type=U.prototype.type;U.prototype.h=function(){return Nc(this)};U.prototype.serialize=U.prototype.h;
|
|
U.prototype.toString=function(){return"ee.Geometry("+this.Ma()+")"};
|
|
var Pd=function(a){var b=a.type;if("GeometryCollection"==b){b=a.geometries;if(!m(b))return!1;for(a=0;a<b.length;a++)if(!Pd(b[a]))return!1;return!0}a=ae(a.coordinates);return"Point"==b&&1==a||"MultiPoint"==b&&2==a||"LineString"==b&&2==a||"LinearRing"==b&&2==a||"MultiLineString"==b&&3==a||"Polygon"==b&&3==a||"MultiPolygon"==b&&4==a},ae=function(a){if(!m(a))return-1;if(m(a[0])){for(var b=ae(a[0]),c=1;c<a.length;c++)if(ae(a[c])!=b)return-1;return b+1}for(c=0;c<a.length;c++)if(!ea(a[c]))return-1;return 0==
|
|
a.length%2?1:-1},Ud=function(a,b,c){if(2>b||4<b)throw Error("Unexpected nesting level.");if(!m(a)&&c&&(a=Array.prototype.slice.call(c),"number"==typeof a[0])){if(0!=a.length%2)throw Error("Invalid number of coordinates: "+a.length);c=[];for(var d=0;d<a.length;d+=2)c.push([a[d],a[d+1]]);a=c}c=a;for(d=0;m(c);)c=c[0],d++;for(;d<b;)a=[a],d++;if(ae(a)!=b)throw Error("Invalid geometry");return a},Sd=function(a,b){var c=function(){};c.prototype=a.prototype;var c=new c,d=a.apply(c,b);return void 0!==d?d:
|
|
c};U.prototype.name=function(){return"Geometry"};s("ee.Deserializer",function(){});s("ee.Deserializer.fromJSON",function(a){return be(Sa(a))});var be=function(a){var b={};if(q(a)&&"CompoundValue"==a.type){for(var c=a.scope,d=0;d<c.length;d++){var e=c[d][0],f=c[d][1];if(e in b)throw Error('Duplicate scope key "'+e+'" in scope #'+d+".");b[e]=ce(f,b)}a=a.value}return ce(a,b)};s("ee.Deserializer.decode",be);
|
|
var ce=function(a,b){if(null===a||ea(a)||"boolean"==typeof a||p(a))return a;if(m(a))return v(a,function(a){return ce(a,b)});if(!q(a)||fa(a))throw Error("Cannot decode object: "+a);var c=a.type;switch(c){case "ValueRef":if(a.value in b)return b[a.value];throw Error("Unknown ValueRef: "+a);case "ArgumentRef":c=a.value;if(!p(c))throw Error("Invalid variable name: "+c);return Id(Object,c);case "Date":c=a.value;if(!ea(c))throw Error("Invalid date value: "+c);return new Ld(c/1E3);case "Bytes":return c=
|
|
new Dc,c.e=function(){return a},c;case "Invocation":var c="functionName"in a?Zc(a.functionName):ce(a["function"],b),d=La(a.arguments,function(a){return ce(a,b)});if(c instanceof J)return c.apply(d);if(c instanceof H)return new H(c,d);throw Error("Invalid function value: "+a["function"]);case "Dictionary":return La(a.value,function(a){return ce(a,b)});case "Function":var e=ce(a.body,b),c={name:"",args:v(a.argumentNames,function(a){return{name:a,type:"Object",optional:!1}}),returns:"Object"};return new Hd(c,
|
|
function(){return e});case "Point":case "MultiPoint":case "LineString":case "MultiLineString":case "Polygon":case "MultiPolygon":case "LinearRing":case "GeometryCollection":return new U(a);case "CompoundValue":throw Error("Nested CompoundValues are disallowed.");default:throw Error("Unknown encoded object type: "+c);}};var V=function(a){if(!(this instanceof V))return I(V,arguments);if(a instanceof V)return a;de();if(Yc(a))H.call(this,null,null),this.ha=a;else if(a instanceof H)H.call(this,a.b,a.c,a.d),this.ha=null;else throw Error("Invalid argument specified for ee.Dictionary(): "+a);};t(V,H);s("ee.Dictionary",V);var fe=!1,de=function(){fe||(M(V,"Dictionary","Dictionary"),fe=!0)};V.prototype.e=function(a){return null===this.ha?V.n.e.call(this,a):a(this.ha)};V.prototype.name=function(){return"Dictionary"};var W=function(a,b){if(!(this instanceof W))return I(W,arguments);if(a instanceof W){if(b)throw Error("Can't create Feature out of a Feature and properties.");return a}if(2<arguments.length)throw Error("The Feature constructor takes at most 2 arguments ("+arguments.length+" given)");ge();if(a instanceof U||null===a)O.call(this,new K("Feature"),{geometry:a,metadata:b||null});else if(a instanceof H)O.call(this,a.b,a.c,a.d);else if("Feature"==a.type){var c=a.properties||{};if("id"in a){if("system:index"in
|
|
c)throw Error('Can\t specify both "id" and "system:index".');c=w(c);c["system:index"]=a.id}O.call(this,new K("Feature"),{geometry:new U(a.geometry),metadata:c})}else O.call(this,new K("Feature"),{geometry:new U(a),metadata:b||null})};t(W,O);s("ee.Feature",W);var he=!1,ge=function(){he||(M(W,"Feature","Feature"),he=!0)};W.prototype.j=function(a){return W.n.j.call(this,a)};W.prototype.getInfo=W.prototype.j;W.prototype.getMap=function(a,b){return L("Collection",[this]).getMap(a,b)};
|
|
W.prototype.getMap=W.prototype.getMap;W.Point=function(a,b){return Rd.apply(null,arguments)};W.MultiPoint=function(a){return Td.apply(null,arguments)};W.Rectangle=function(a,b,c,d){return new Vd(a,b,c,d)};W.LineString=function(a){return Wd.apply(null,arguments)};W.LinearRing=function(a){return Xd.apply(null,arguments)};W.MultiLine=function(a){return Yd.apply(null,arguments)};W.Polygon=function(a){return Zd.apply(null,arguments)};W.MultiPolygon=function(a){return $d.apply(null,arguments)};
|
|
W.prototype.name=function(){return"Feature"};var X=function(a){if(!(this instanceof X))return I(X,arguments);if(a instanceof X)return a;ie();if(m(a))H.call(this,null,null),this.ia=a;else if(a instanceof H)H.call(this,a.b,a.c,a.d),this.ia=null;else throw Error("Invalid argument specified for ee.List(): "+a);};t(X,H);s("ee.List",X);var je=!1,ie=function(){je||(M(X,"List","List"),je=!0)};X.prototype.e=function(a){return m(this.ia)?v(this.ia,function(b){return a(b)}):X.n.e.call(this,a)};
|
|
X.prototype.va=function(a,b){var c=Kd(a,Ha(2));return L("List.iterate",this,c,b)};X.prototype.iterate=X.prototype.va;X.prototype.name=function(){return"List"};var Y=function(a,b){if(!(this instanceof Y))return I(Y,arguments);if(a instanceof Y)return a;if(2<arguments.length)throw Error("The FeatureCollection constructor takes at most 2 arguments ("+arguments.length+" given)");ke();a instanceof U&&(a=new W(a));a instanceof W&&(a=[a]);if(Wc(a)||Xc(a)){var c={tableId:a};b&&(c.geometryColumn=b);R.call(this,new K("Collection.loadTable"),c)}else if(m(a))R.call(this,new K("Collection"),{features:v(a,function(a){return new W(a)})});else if(a instanceof X)R.call(this,
|
|
new K("Collection"),{features:a});else if(a instanceof H)R.call(this,a.b,a.c,a.d);else throw Error("Unrecognized argument type to convert to a FeatureCollection: "+a);};t(Y,R);s("ee.FeatureCollection",Y);var me=!1,ke=function(){me||(M(Y,"FeatureCollection","FeatureCollection"),me=!0)};Y.prototype.getMap=function(a,b){var c=$c("Collection.draw",{collection:this,color:(a||{}).color||"000000"});if(b)c.getMap(null,b);else return c.getMap()};Y.prototype.getMap=Y.prototype.getMap;
|
|
Y.prototype.j=function(a){return Y.n.j.call(this,a)};Y.prototype.getInfo=Y.prototype.j;Y.prototype.ua=function(a,b,c,d){var e={};e.table=this.h();a&&(e.format=a.toUpperCase());c&&(e.filename=c);b&&(e.selectors=b);if(d)Ac(e,function(a,b){a?d(Bc(a)):d(null,b)});else return Bc(Ac(e))};Y.prototype.getDownloadURL=Y.prototype.ua;Y.prototype.name=function(){return"FeatureCollection"};Y.prototype.elementType=function(){return W};var Z=function(a){if(!(this instanceof Z))return I(Z,arguments);if(a instanceof Z)return a;ne();var b=arguments.length;if(0==b||1==b&&!l(a))O.call(this,new K("Image.mask"),{image:new Z(0),mask:new Z(0)});else if(1==b)if(Wc(a))O.call(this,new K("Image.constant"),{value:a});else if(Xc(a))O.call(this,new K("Image.load"),{id:a});else{if(m(a))return oe(v(a,function(a){return new Z(a)}));if(a instanceof H)"Array"==a.name()?O.call(this,new K("Image.constant"),{value:a}):O.call(this,a.b,a.c,a.d);else throw Error("Unrecognized argument type to convert to an Image: "+
|
|
a);}else if(2==b){var b=arguments[0],c=arguments[1];if(Xc(b)&&Wc(c))O.call(this,new K("Image.load"),{id:b,version:c});else throw Error("Unrecognized argument types to convert to an Image: "+arguments);}else throw Error("The Image constructor takes at most 2 arguments ("+b+" given)");};t(Z,O);s("ee.Image",Z);var pe=!1,ne=function(){pe||(M(Z,"Image","Image"),M(Z,"Window","Image","focal_"),pe=!0)};Z.prototype.j=function(a){return Z.n.j.call(this,a)};Z.prototype.getInfo=Z.prototype.j;
|
|
Z.prototype.getMap=function(a,b){var c=a?w(a):{};c.image=this.h();if(b)uc(c,r(function(a,c){a&&(a.image=this);b(a,c)},this));else return c=uc(c),c.image=this,c};Z.prototype.getMap=Z.prototype.getMap;Z.prototype.ua=function(a,b){var c=a?w(a):{};c.image=this.h();if(b)yc(c,function(a,c){a?b(zc(a)):b(null,c)});else return zc(yc(c))};Z.prototype.getDownloadURL=Z.prototype.ua;Z.prototype.rb=function(a){a=a?w(a):{};a.image=this.h();return xc(wc(a))};Z.prototype.getThumbURL=Z.prototype.rb;
|
|
Z.rgb=function(a,b,c){return oe([a,b,c],["vis-red","vis-green","vis-blue"])};Z.cat=function(a){return oe(Array.prototype.slice.call(arguments),null)};var oe=function(a,b){if(0==a.length)throw Error("Can't combine 0 images.");for(var c=new Z(a[0]),d=1;d<a.length;d++)c=L("Image.addBands",c,a[d]);b&&(c=c.select([".*"],b));return c};
|
|
Z.prototype.select=function(a,b){l(a)||(a=[]);var c={input:this,bandSelectors:a};if(Xc(a)||Wc(a)){a=Array.prototype.slice.call(arguments);for(var d=0;d<a.length;d++)if(!(Xc(a[d])||Wc(a[d])||a[d]instanceof H))throw Error("Illegal argument to select(): "+a[d]);c.bandSelectors=a}else b&&(c.newNames=b);return $c("Image.select",c)};Z.prototype.select=Z.prototype.select;
|
|
Z.prototype.nb=function(a,b){var c=L("Image.parseExpression",a,"DEFAULT_EXPRESSION_IMAGE"),d=["DEFAULT_EXPRESSION_IMAGE"],e={DEFAULT_EXPRESSION_IMAGE:this};if(b)for(var f in b)d.push(f),e[f]=new Z(b[f]);f=new J;f.e=function(a){return c.e(a)};f.l=function(){return{name:"",args:v(d,function(a){return{name:a,type:"Image",optional:!1}},this),returns:"Image"}};return f.apply(e)};Z.prototype.expression=Z.prototype.nb;Z.prototype.clip=function(a){try{a=new U(a)}catch(b){}return L("Image.clip",this,a)};
|
|
Z.prototype.clip=Z.prototype.clip;Z.prototype.name=function(){return"Image"};var $=function(a){if(!(this instanceof $))return I($,arguments);if(a instanceof $)return a;if(1!=arguments.length)throw Error("The ImageCollection constructor takes exactly 1 argument ("+arguments.length+" given)");qe();a instanceof Z&&(a=[a]);if(Xc(a))R.call(this,new K("ImageCollection.load"),{id:a});else if(m(a))R.call(this,new K("ImageCollection.fromImages"),{images:v(a,function(a){return new Z(a)})});else if(a instanceof H)R.call(this,a.b,a.c,a.d);else throw Error("Unrecognized argument type to convert to an ImageCollection: "+
|
|
a);};t($,R);s("ee.ImageCollection",$);var re=!1,qe=function(){re||(M($,"ImageCollection","ImageCollection"),M($,"reduce","ImageCollection"),re=!0)};$.prototype.getMap=function(a,b){var c=L("ImageCollection.mosaic",this);if(b)c.getMap(a,b);else return c.getMap(a)};$.prototype.getMap=$.prototype.getMap;$.prototype.j=function(a){return $.n.j.call(this,a)};$.prototype.getInfo=$.prototype.j;$.prototype.select=function(a,b){var c=arguments;return this.map(function(a){return a.select.apply(a,c)})};
|
|
$.prototype.select=$.prototype.select;$.prototype.name=function(){return"ImageCollection"};$.prototype.elementType=function(){return Z};s("ee.initialize",function(a,b,c,d,e){if("ready"!=se||a||b){var f=null!=c;if(d)if(f)te.push(d);else throw Error("Can't pass an error callback without a success callback.");if("loading"==se&&f)ue.push(c);else if(se="loading",tc(a,b,e),f)ue.push(c),bd(ve,we);else try{bd(),ve()}catch(g){throw we(g),g;}}else c&&c()});
|
|
s("ee.reset",function(){se="not_ready";qc=pc=oc=null;rc=!1;Ja=null;ad={};N(Ld);Nd=!1;N(V);fe=!1;N(O);gd=!1;N(Z);pe=!1;N(W);he=!1;N(R);Cd=!1;N($);re=!1;N(Y);me=!1;N(P);id=!1;N(U);Qd=!1;N(X);je=!1;N(S);Ed=!1;N(T);Gd=!1;for(var a=k.ee,b=0;b<xe.length;b++){var c=xe[b];N(a[c]);delete a[c]}xe=[];Tc=a;var a=ye,d;for(d in a)delete a[d]});s("ee.InitState",{Eb:"not_ready",LOADING:"loading",Fb:"ready"});s("ee.InitState.NOT_READY","not_ready");s("ee.InitState.LOADING","loading");s("ee.InitState.READY","ready");
|
|
var se="not_ready",ue=[],te=[];s("ee.TILE_SIZE",256);var xe=[],ye={};s("ee.Algorithms",ye);s("ee.call",function(a,b){p(a)&&(a=new K(a));return J.prototype.call.apply(a,Array.prototype.slice.call(arguments,1))});s("ee.apply",function(a,b){p(a)&&(a=new K(a));return a.apply(b)});
|
|
var ve=function(){if("loading"==se){try{Md();de();fd();ne();ge();Bd();qe();ke();hd();Od();ie();Dd();Fd();var a=cd(),b={},c={},d;for(d in a){b[-1!=d.indexOf(".")?d.slice(0,d.indexOf(".")):d]=!0;var e=a[d].returns.replace(/<.*>/,"");c[e]=!0}var f=k.ee,g;for(g in b)g in c&&!(g in f)&&(f[g]=ze(g),xe.push(g),a[g]?(f[g].signature=a[g],f[g].signature.isConstructor=!0,ad[g]=!0):f[g].signature={});Tc=f;Ae()}catch(n){we(n);return}se="ready";for(te=[];0<ue.length;)ue.shift()()}},we=function(a){if("loading"==
|
|
se)for(se="not_ready",ue=[];0<te.length;)te.shift()(a)},Ae=function(){var a=dd();Na(a).sort().forEach(function(b){var c=a[b],d=c.l();if(!d.hidden){b=b.split(".");var e=ye;for(e.signature={};1<b.length;){var f=b[0];f in e||(e[f]={signature:{}});e=e[f];b=Ga(b,1)}f=r(c.call,c);f.signature=d;f.toString=r(c.toString,c);e[b[0]]=f}})},ze=function(a){var b=function(b){var d=k.ee[a],e=Array.prototype.slice.call(arguments),f=1==e.length;if(f&&e[0]instanceof d)return e[0];if(!(this instanceof d))return I(d,
|
|
e);var d=ed(a),g=!(e[0]instanceof H),n=!1;d&&(f?g?n=!0:e[0].b!=d&&(n=!0):n=!0);if(n)H.call(this,d,Sc(d,Rc(d,e)));else{if(!f)throw Error("Too many arguments for ee."+a+"(): "+e);if(g)throw Error("Invalid argument for ee."+a+"(): "+e+". Must be a ComputedObject.");e=e[0];H.call(this,e.b,e.c,e.d)}};t(b,H);b.prototype.name=function(){return a};M(b,a,a);return b},Qc=function(a,b){if(null===a)return null;if(l(a)){var c=k.ee;switch(b){case "Image":return new Z(a);case "Feature":return a instanceof R?L("Feature",
|
|
L("Collection.geometry",a)):new W(a);case "Element":case "EEObject":if(a instanceof O)return a;if(a instanceof H)return new O(a.b,a.c,a.d);throw Error("Cannot convert "+a+" to Element.");case "Geometry":return a instanceof Y?L("Collection.geometry",a):new U(a);case "FeatureCollection":case "Collection":return a instanceof R?a:new Y(a);case "ImageCollection":return new $(a);case "Filter":return new P(a);case "Algorithm":if(p(a))return new K(a);if(fa(a))return Kd(a,Ha(a.length));if(a instanceof Dc)return a;
|
|
throw Error("Argument is not a function: "+a);case "String":return Xc(a)||a instanceof T||a instanceof H?new T(a):a;case "Dictionary":return Yc(a)?a:new V(a);case "List":return new X(a);case "Number":case "Float":case "Long":case "Integer":case "Short":case "Byte":return new S(a);default:if(b in c){var d=ed(b);if(a instanceof c[b])return a;if(d)return new c[b](a);if(p(a)){if(a in c[b])return c[b][a].call();throw Error("Unknown algorithm: "+b+"."+a);}return new c[b](a)}return a}}};!fb&&!x||x&&x&&9<=lb||fb&&y("1.9.1");x&&y("9");x&&y("11");})();
|
|
//@ sourceMappingURL=ee_api_js.sourcemap
|