mirror of
https://github.com/google/earthengine-api.git
synced 2025-12-08 19:26:12 +00:00
75 lines
42 KiB
JavaScript
75 lines
42 KiB
JavaScript
(function() {function g(a){throw a;}
|
|
var i=void 0,j=!0,k=null,m=!1,n,aa=aa||{},p=this,ba=function(a){a=a.split(".");for(var b=p,c;c=a.shift();)if(b[c]!=k)b=b[c];else return k;return b},ca=function(){},da=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},q=function(a){return"array"==da(a)},ea=function(a){var b=da(a);return"array"==b||"object"==b&&"number"==typeof a.length},r=function(a){return"string"==typeof a},fa=function(a){return"number"==typeof a},ga=function(a){return"function"==da(a)},ja=function(a){return a[ha]||
|
|
(a[ha]=++ia)},ha="closure_uid_"+Math.floor(2147483648*Math.random()).toString(36),ia=0,ka=function(a,b,c){return a.call.apply(a.bind,arguments)},la=function(a,b,c){a||g(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)}},s=function(a,b,c){s=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?
|
|
ka:la;return s.apply(k,arguments)},ma=function(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=Array.prototype.slice.call(arguments);b.unshift.apply(b,c);return a.apply(this,b)}},na=Date.now||function(){return+new Date},v=function(a,b){var c=a.split("."),d=p;!(c[0]in d)&&d.execScript&&d.execScript("var "+c[0]);for(var f;c.length&&(f=c.shift());)!c.length&&b!==i?d[f]=b:d=d[f]?d[f]:d[f]={}},w=function(a,b){function c(){}c.prototype=b.prototype;a.N=b.prototype;a.prototype=
|
|
new c;a.prototype.constructor=a};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 s.apply(k,c)}return s(this,a)};var oa=function(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b},pa=function(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b},qa=function(a){var b={},c;for(c in a)b[c]=a[c];return b},ra="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),sa=function(a,b){for(var c,d,f=1;f<arguments.length;f++){d=arguments[f];for(c in d)a[c]=d[c];for(var e=0;e<ra.length;e++)c=ra[e],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}},ta=function(a){var b=
|
|
arguments.length;if(1==b&&q(arguments[0]))return ta.apply(k,arguments[0]);b%2&&g(Error("Uneven number of arguments"));for(var c={},d=0;d<b;d+=2)c[arguments[d]]=arguments[d+1];return c};var ua=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){}g(Error("Invalid JSON string: "+a))},va=function(a){this.F=a};va.prototype.d=function(a){var b=[];wa(this,a,b);return b.join("")};
|
|
var wa=function(a,b,c){switch(typeof b){case "string":xa(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(b==k){c.push("null");break}if(q(b)){var d=b.length;c.push("[");for(var f="",e=0;e<d;e++)c.push(f),f=b[e],wa(a,a.F?a.F.call(b,String(e),f):f,c),f=",";c.push("]");break}a.Y(b,c);break;case "function":break;default:g(Error("Unknown type: "+typeof b))}},ya={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b",
|
|
"\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},za=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g,xa=function(a,b){b.push('"',a.replace(za,function(a){if(a in ya)return ya[a];var b=a.charCodeAt(0),f="\\u";16>b?f+="000":256>b?f+="00":4096>b&&(f+="0");return ya[a]=f+b.toString(16)}),'"')};
|
|
va.prototype.Y=function(a,b){b.push("{");var c="",d;for(d in a)if(Object.prototype.hasOwnProperty.call(a,d)){var f=a[d];"function"!=typeof f&&(b.push(c),xa(d,b),b.push(":"),wa(this,this.F?this.F.call(a,d,f):f,b),c=",")}b.push("}")};var Aa=function(a){Error.captureStackTrace?Error.captureStackTrace(this,Aa):this.stack=Error().stack||"";a&&(this.message=String(a))};w(Aa,Error);Aa.prototype.name="CustomError";var Ba=function(a,b){for(var c=1;c<arguments.length;c++){var d=String(arguments[c]).replace(/\$/g,"$$$$");a=a.replace(/\%s/,d)}return a},Ha=function(a){if(!Ca.test(a))return a;-1!=a.indexOf("&")&&(a=a.replace(Da,"&"));-1!=a.indexOf("<")&&(a=a.replace(Ea,"<"));-1!=a.indexOf(">")&&(a=a.replace(Fa,">"));-1!=a.indexOf('"')&&(a=a.replace(Ga,"""));return a},Da=/&/g,Ea=/</g,Fa=/>/g,Ga=/\"/g,Ca=/[&<>\"]/;var Ia=function(a,b){b.unshift(a);Aa.call(this,Ba.apply(k,b));b.shift()};w(Ia,Aa);Ia.prototype.name="AssertionError";var Ja=function(a,b,c){if(!a){var d=Array.prototype.slice.call(arguments,2),f="Assertion failed";if(b)var f=f+(": "+b),e=d;g(new Ia(""+f,e||[]))}},Ka=function(a,b){g(new Ia("Failure"+(a?": "+a:""),Array.prototype.slice.call(arguments,1)))};var x=Array.prototype,La=x.indexOf?function(a,b,c){Ja(a.length!=k);return x.indexOf.call(a,b,c)}:function(a,b,c){c=c==k?0:0>c?Math.max(0,a.length+c):c;if(r(a))return!r(b)||1!=b.length?-1:a.indexOf(b,c);for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},Ma=x.forEach?function(a,b,c){Ja(a.length!=k);x.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,f=r(a)?a.split(""):a,e=0;e<d;e++)e in f&&b.call(c,f[e],e,a)},Na=x.map?function(a,b,c){Ja(a.length!=k);return x.map.call(a,b,c)}:function(a,
|
|
b,c){for(var d=a.length,f=Array(d),e=r(a)?a.split(""):a,h=0;h<d;h++)h in e&&(f[h]=b.call(c,e[h],h,a));return f},Oa=function(a,b){var c=La(a,b);0<=c&&(Ja(a.length!=k),x.splice.call(a,c,1))},Pa=function(a){return x.concat.apply(x,arguments)},Qa=function(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c],f;if(q(d)||(f=ea(d))&&Object.prototype.hasOwnProperty.call(d,"callee"))a.push.apply(a,d);else if(f)for(var e=a.length,h=d.length,l=0;l<h;l++)a[e+l]=d[l];else a.push(d)}};var Ra="StopIteration"in p?p.StopIteration:Error("StopIteration"),Sa=function(){};Sa.prototype.next=function(){g(Ra)};Sa.prototype.Na=function(){return this};var Ta=function(a){if("function"==typeof a.l)return a.l();if(r(a))return a.split("");if(ea(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return oa(a)},Ua=function(a,b,c){if("function"==typeof a.forEach)a.forEach(b,c);else if(ea(a)||r(a))Ma(a,b,c);else{var d;if("function"==typeof a.u)d=a.u();else if("function"!=typeof a.l)if(ea(a)||r(a)){d=[];for(var f=a.length,e=0;e<f;e++)d.push(e)}else d=pa(a);else d=i;for(var f=Ta(a),e=f.length,h=0;h<e;h++)b.call(c,f[h],d&&d[h],a)}};var y=function(a,b){this.o={};this.f=[];var c=arguments.length;if(1<c){c%2&&g(Error("Uneven number of arguments"));for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else if(a){a instanceof y?(c=a.u(),d=a.l()):(c=pa(a),d=oa(a));for(var f=0;f<c.length;f++)this.set(c[f],d[f])}};n=y.prototype;n.b=0;n.X=0;n.l=function(){Va(this);for(var a=[],b=0;b<this.f.length;b++)a.push(this.o[this.f[b]]);return a};n.u=function(){Va(this);return this.f.concat()};
|
|
n.v=function(a){return Object.prototype.hasOwnProperty.call(this.o,a)};var Va=function(a){if(a.b!=a.f.length){for(var b=0,c=0;b<a.f.length;){var d=a.f[b];Object.prototype.hasOwnProperty.call(a.o,d)&&(a.f[c++]=d);b++}a.f.length=c}if(a.b!=a.f.length){for(var f={},c=b=0;b<a.f.length;)d=a.f[b],Object.prototype.hasOwnProperty.call(f,d)||(a.f[c++]=d,f[d]=1),b++;a.f.length=c}};y.prototype.get=function(a,b){return Object.prototype.hasOwnProperty.call(this.o,a)?this.o[a]:b};
|
|
y.prototype.set=function(a,b){Object.prototype.hasOwnProperty.call(this.o,a)||(this.b++,this.f.push(a),this.X++);this.o[a]=b};y.prototype.R=function(){return new y(this)};y.prototype.Na=function(a){Va(this);var b=0,c=this.f,d=this.o,f=this.X,e=this,h=new Sa;h.next=function(){for(;;){f!=e.X&&g(Error("The map has changed since the iterator was created"));b>=c.length&&g(Ra);var h=c[b++];return a?h:d[h]}};return h};var z,Wa,Xa,Ya,Za=function(){return p.navigator?p.navigator.userAgent:k};Ya=Xa=Wa=z=m;var $a;if($a=Za()){var ab=p.navigator;z=0==$a.indexOf("Opera");Wa=!z&&-1!=$a.indexOf("MSIE");Xa=!z&&-1!=$a.indexOf("WebKit");Ya=!z&&!Xa&&"Gecko"==ab.product}var bb=z,A=Wa,cb=Ya,B=Xa,db=function(){var a=p.document;return a?a.documentMode:i},eb;
|
|
a:{var fb="",gb;if(bb&&p.opera)var hb=p.opera.version,fb="function"==typeof hb?hb():hb;else if(cb?gb=/rv\:([^\);]+)(\)|;)/:A?gb=/MSIE\s+([^\);]+)(\)|;)/:B&&(gb=/WebKit\/(\S+)/),gb)var ib=gb.exec(Za()),fb=ib?ib[1]:"";if(A){var jb=db();if(jb>parseFloat(fb)){eb=String(jb);break a}}eb=fb}
|
|
var kb=eb,lb={},D=function(a){var b;if(!(b=lb[a])){b=0;for(var c=String(kb).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),d=String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),f=Math.max(c.length,d.length),e=0;0==b&&e<f;e++){var h=c[e]||"",l=d[e]||"",t=RegExp("(\\d*)(\\D*)","g"),F=RegExp("(\\d*)(\\D*)","g");do{var u=t.exec(h)||["","",""],C=F.exec(l)||["","",""];if(0==u[0].length&&0==C[0].length)break;b=((0==u[1].length?0:parseInt(u[1],10))<(0==C[1].length?0:parseInt(C[1],10))?-1:(0==u[1].length?
|
|
0:parseInt(u[1],10))>(0==C[1].length?0:parseInt(C[1],10))?1:0)||((0==u[2].length)<(0==C[2].length)?-1:(0==u[2].length)>(0==C[2].length)?1:0)||(u[2]<C[2]?-1:u[2]>C[2]?1:0)}while(0==b)}b=lb[a]=0<=b}return b},mb=p.document,nb=!mb||!A?i:db()||("CSS1Compat"==mb.compatMode?parseInt(kb,10):5);var pb=function(a){return ob(a||arguments.callee.caller,[])},ob=function(a,b){var c=[];if(0<=La(b,a))c.push("[...circular reference...]");else if(a&&50>b.length){c.push(qb(a)+"(");for(var d=a.arguments,f=0;f<d.length;f++){0<f&&c.push(", ");var e;e=d[f];switch(typeof e){case "object":e=e?"object":"null";break;case "string":break;case "number":e=String(e);break;case "boolean":e=e?"true":"false";break;case "function":e=(e=qb(e))?e:"[fn]";break;default:e=typeof e}40<e.length&&(e=e.substr(0,40)+"...");
|
|
c.push(e)}b.push(a);c.push(")\n");try{c.push(ob(a.caller,b))}catch(h){c.push("[exception trying to get caller]\n")}}else a?c.push("[...long stack...]"):c.push("[end]");return c.join("")},qb=function(a){if(rb[a])return rb[a];a=String(a);if(!rb[a]){var b=/function ([^\(]+)/.exec(a);rb[a]=b?b[1]:"[Anonymous]"}return rb[a]},rb={};var sb=function(a,b,c,d,f){this.reset(a,b,c,d,f)};sb.prototype.na=k;sb.prototype.ma=k;var tb=0;sb.prototype.reset=function(a,b,c,d,f){"number"==typeof f||tb++;d||na();this.B=a;this.Fa=b;delete this.na;delete this.ma};sb.prototype.sa=function(a){this.B=a};var E=function(a){this.Ia=a};E.prototype.Q=k;E.prototype.B=k;E.prototype.Z=k;E.prototype.va=k;var ub=function(a,b){this.name=a;this.value=b};ub.prototype.toString=function(){return this.name};var vb=new ub("SEVERE",1E3),wb=new ub("WARNING",900),xb=new ub("CONFIG",700),yb=new ub("FINE",500);E.prototype.getParent=function(){return this.Q};E.prototype.sa=function(a){this.B=a};var zb=function(a){if(a.B)return a.B;if(a.Q)return zb(a.Q);Ka("Root logger has no level set.");return k};
|
|
E.prototype.log=function(a,b,c){if(a.value>=zb(this).value){a=this.Ja(a,b,c);b="log:"+a.Fa;p.console&&(p.console.timeStamp?p.console.timeStamp(b):p.console.markTimeline&&p.console.markTimeline(b));p.msWriteProfilerMark&&p.msWriteProfilerMark(b);for(b=this;b;){c=b;var d=a;if(c.va)for(var f=0,e=i;e=c.va[f];f++)e(d);b=b.getParent()}}};
|
|
E.prototype.Ja=function(a,b,c){var d=new sb(a,String(b),this.Ia);if(c){d.na=c;var f;var e=arguments.callee.caller;try{var h;var l=ba("window.location.href");if(r(c))h={message:c,name:"Unknown error",lineNumber:"Not available",fileName:l,stack:"Not available"};else{var t,F,u=m;try{t=c.lineNumber||c.cb||"Not available"}catch(C){t="Not available",u=j}try{F=c.fileName||c.filename||c.sourceURL||l}catch(I){F="Not available",u=j}h=u||!c.lineNumber||!c.fileName||!c.stack?{message:c.message,name:c.name,lineNumber:t,
|
|
fileName:F,stack:c.stack||"Not available"}:c}f="Message: "+Ha(h.message)+'\nUrl: <a href="view-source:'+h.fileName+'" target="_new">'+h.fileName+"</a>\nLine: "+h.lineNumber+"\n\nBrowser stack:\n"+Ha(h.stack+"-> ")+"[end]\n\nJS stack traversal:\n"+Ha(pb(e)+"-> ")}catch(V){f="Exception trying to expose exception! You win, we lose. "+V}d.ma=f}return d};
|
|
var G=function(a,b){a.log(yb,b,i)},Ab={},Bb=k,Cb=function(a){Bb||(Bb=new E(""),Ab[""]=Bb,Bb.sa(xb));var b;if(!(b=Ab[a])){b=new E(a);var c=a.lastIndexOf("."),d=a.substr(c+1),c=Cb(a.substr(0,c));c.Z||(c.Z={});c.Z[d]=b;b.Q=c;Ab[a]=b}return b};var Db=function(a){Db[" "](a);return a};Db[" "]=ca;var Eb;if(!(Eb=!A))Eb=A&&9<=nb;var Fb=Eb,Gb=A&&!D("9");!B||D("528");cb&&D("1.9b")||A&&D("8")||bb&&D("9.5")||B&&D("528");cb&&!D("8")||A&&D("9");var Hb=function(){};Hb.prototype.ta=m;Hb.prototype.ya=function(){this.ta||(this.ta=j,this.s())};Hb.prototype.s=function(){if(this.Aa)for(;this.Aa.length;)this.Aa.shift()()};var H=function(a,b){this.type=a;this.currentTarget=this.target=b};n=H.prototype;n.s=function(){};n.ya=function(){};n.t=m;n.defaultPrevented=m;n.P=j;n.preventDefault=function(){this.defaultPrevented=j;this.P=m};var Ib=function(a,b){a&&this.j(a,b)};w(Ib,H);n=Ib.prototype;n.target=k;n.relatedTarget=k;n.offsetX=0;n.offsetY=0;n.clientX=0;n.clientY=0;n.screenX=0;n.screenY=0;n.button=0;n.keyCode=0;n.charCode=0;n.ctrlKey=m;n.altKey=m;n.shiftKey=m;n.metaKey=m;n.qa=k;
|
|
n.j=function(a,b){var c=this.type=a.type;H.call(this,c);this.target=a.target||a.srcElement;this.currentTarget=b;var d=a.relatedTarget;if(d){if(cb){var f;a:{try{Db(d.nodeName);f=j;break a}catch(e){}f=m}f||(d=k)}}else"mouseover"==c?d=a.fromElement:"mouseout"==c&&(d=a.toElement);this.relatedTarget=d;this.offsetX=B||a.offsetX!==i?a.offsetX:a.layerX;this.offsetY=B||a.offsetY!==i?a.offsetY:a.layerY;this.clientX=a.clientX!==i?a.clientX:a.pageX;this.clientY=a.clientY!==i?a.clientY:a.pageY;this.screenX=a.screenX||
|
|
0;this.screenY=a.screenY||0;this.button=a.button;this.keyCode=a.keyCode||0;this.charCode=a.charCode||("keypress"==c?a.keyCode:0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.state=a.state;this.qa=a;a.defaultPrevented&&this.preventDefault();delete this.t};
|
|
n.preventDefault=function(){Ib.N.preventDefault.call(this);var a=this.qa;if(a.preventDefault)a.preventDefault();else if(a.returnValue=m,Gb)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};n.s=function(){};var Jb=0;var Kb=function(){};n=Kb.prototype;n.key=0;n.q=m;n.M=m;n.j=function(a,b,c,d,f,e){ga(a)?this.ka=j:a&&a.handleEvent&&ga(a.handleEvent)?this.ka=m:g(Error("Invalid listener argument"));this.n=a;this.ia=b;this.src=c;this.type=d;this.capture=!!f;this.V=e;this.M=m;this.key=++Jb;this.q=m};n.handleEvent=function(a){return this.ka?this.n.call(this.V||this.src,a):this.n.handleEvent.call(this.n,a)};var Lb={},J={},K={},L={},Mb=function(a,b,c,d,f){if(q(b))for(var e=0;e<b.length;e++)Mb(a,b[e],c,d,f);else a:{b||g(Error("Invalid event type"));d=!!d;var h=J;b in h||(h[b]={b:0,g:0});h=h[b];d in h||(h[d]={b:0,g:0},h.b++);var h=h[d],e=ja(a),l;h.g++;if(h[e]){l=h[e];for(var t=0;t<l.length;t++)if(h=l[t],h.n==c&&h.V==f){if(h.q)break;l[t].M=m;break a}}else l=h[e]=[],h.b++;var F=Nb,u=Fb?function(a){return F.call(u.src,u.n,a)}:function(a){a=F.call(u.src,u.n,a);if(!a)return a},t=u,h=new Kb;h.j(c,t,a,b,d,f);
|
|
h.M=m;t.src=a;t.n=h;l.push(h);K[e]||(K[e]=[]);K[e].push(h);a.addEventListener?(a==p||!a.ha)&&a.addEventListener(b,t,d):a.attachEvent(b in L?L[b]:L[b]="on"+b,t);Lb[h.key]=h}},Ob=function(a,b,c,d,f){if(q(b))for(var e=0;e<b.length;e++)Ob(a,b[e],c,d,f);else{d=!!d;a:{e=J;if(b in e&&(e=e[b],d in e&&(e=e[d],a=ja(a),e[a]))){a=e[a];break a}a=k}if(a)for(e=0;e<a.length;e++)if(a[e].n==c&&a[e].capture==d&&a[e].V==f){Pb(a[e].key);break}}},Pb=function(a){if(Lb[a]){var b=Lb[a];if(!b.q){var c=b.src,d=b.type,f=b.ia,
|
|
e=b.capture;c.removeEventListener?(c==p||!c.ha)&&c.removeEventListener(d,f,e):c.detachEvent&&c.detachEvent(d in L?L[d]:L[d]="on"+d,f);c=ja(c);K[c]&&(f=K[c],Oa(f,b),0==f.length&&delete K[c]);b.q=j;if(b=J[d][e][c])b.ja=j,Qb(d,e,c,b);delete Lb[a]}}},Qb=function(a,b,c,d){if(!d.O&&d.ja){for(var f=0,e=0;f<d.length;f++)d[f].q?d[f].ia.src=k:(f!=e&&(d[e]=d[f]),e++);d.length=e;d.ja=m;0==e&&(delete J[a][b][c],J[a][b].b--,0==J[a][b].b&&(delete J[a][b],J[a].b--),0==J[a].b&&delete J[a])}},Sb=function(a,b,c,d,f){var e=
|
|
1;b=ja(b);if(a[b]){var h=--a.g,l=a[b];l.O?l.O++:l.O=1;try{for(var t=l.length,F=0;F<t;F++){var u=l[F];u&&!u.q&&(e&=Rb(u,f)!==m)}}finally{a.g=Math.max(h,a.g),l.O--,Qb(c,d,b,l)}}return Boolean(e)},Rb=function(a,b){a.M&&Pb(a.key);return a.handleEvent(b)},Nb=function(a,b){if(a.q)return j;var c=a.type,d=J;if(!(c in d))return j;var d=d[c],f,e;if(!Fb){f=b||ba("window.event");var h=j in d,l=m in d;if(h){if(0>f.keyCode||f.returnValue!=i)return j;a:{var t=m;if(0==f.keyCode)try{f.keyCode=-1;break a}catch(F){t=
|
|
j}if(t||f.returnValue==i)f.returnValue=j}}t=new Ib;t.j(f,this);f=j;try{if(h){for(var u=[],C=t.currentTarget;C;C=C.parentNode)u.push(C);e=d[j];e.g=e.b;for(var I=u.length-1;!t.t&&0<=I&&e.g;I--)t.currentTarget=u[I],f&=Sb(e,u[I],c,j,t);if(l){e=d[m];e.g=e.b;for(I=0;!t.t&&I<u.length&&e.g;I++)t.currentTarget=u[I],f&=Sb(e,u[I],c,m,t)}}else f=Rb(a,t)}finally{u&&(u.length=0)}return f}c=new Ib(b,this);return f=Rb(a,c)};var Tb=function(){};w(Tb,Hb);n=Tb.prototype;n.ha=j;n.W=k;n.addEventListener=function(a,b,c,d){Mb(this,a,b,c,d)};n.removeEventListener=function(a,b,c,d){Ob(this,a,b,c,d)};
|
|
n.dispatchEvent=function(a){var b=a.type||a,c=J;if(b in c){if(r(a))a=new H(a,this);else if(a instanceof H)a.target=a.target||this;else{var d=a;a=new H(b,this);sa(a,d)}var d=1,f,c=c[b],b=j in c,e;if(b){f=[];for(e=this;e;e=e.W)f.push(e);e=c[j];e.g=e.b;for(var h=f.length-1;!a.t&&0<=h&&e.g;h--)a.currentTarget=f[h],d&=Sb(e,f[h],a.type,j,a)&&a.P!=m}if(m in c)if(e=c[m],e.g=e.b,b)for(h=0;!a.t&&h<f.length&&e.g;h++)a.currentTarget=f[h],d&=Sb(e,f[h],a.type,m,a)&&a.P!=m;else for(f=this;!a.t&&f&&e.g;f=f.W)a.currentTarget=
|
|
f,d&=Sb(e,f,a.type,m,a)&&a.P!=m;a=Boolean(d)}else a=j;return a};n.s=function(){Tb.N.s.call(this);var a=0;if(this!=k){var b=ja(this);if(K[b])for(var b=K[b],c=b.length-1;0<=c;c--)Pb(b[c].key),a++}else for(c in b=function(b,c){Pb(c);a++},Lb)b.call(i,0,c);this.W=k};var Ub=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$"),Vb=B,Wb=function(a,b){if(Vb){Vb=m;var c=p.location;if(c){var d=c.href;if(d&&(d=(d=Wb(3,d))&&decodeURIComponent(d))&&d!=c.hostname)Vb=j,g(Error())}}return b.match(Ub)[a]||k};var Xb=function(){};Xb.prototype.xa=k;Xb.prototype.z=function(){var a;if(!(a=this.xa))a={},Yb(this)&&(a[0]=j,a[1]=j),a=this.xa=a;return a};var Zb=function(a,b){this.Ma=a;this.La=b};w(Zb,Xb);Zb.prototype.T=function(){return this.Ma()};Zb.prototype.z=function(){return this.La()};var M=function(){return M.ra.T()};M.Ka=m;M.z=function(){return M.ra.z()};M.gb=function(a,b){M.Ca(new Zb(a,b))};M.Ca=function(a){M.ra=a};var $b=function(){};w($b,Xb);$b.prototype.T=function(){var a=Yb(this);return a?new ActiveXObject(a):new XMLHttpRequest};
|
|
var Yb=function(a){if(M.Ka)return"";if(!a.wa&&"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.wa=d}catch(f){}}g(Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed"))}return a.wa};M.Ca(new $b);var N=function(a){this.headers=new y;this.L=a||k};w(N,Tb);N.prototype.h=Cb("goog.net.XhrIo");var ac=/^https?$/i,bc=[],dc=function(a,b,c,d,f,e,h){var l=new N;bc.push(l);b&&Mb(l,"complete",b);Mb(l,"ready",ma(cc,l));e&&(l.A=Math.max(0,e));h&&(l.fa=h);l.send(a,c,d,f)},cc=function(a){a.ya();Oa(bc,a)};n=N.prototype;n.m=m;n.a=k;n.J=k;n.K="";n.ea="";n.w="";n.U=m;n.I=m;n.S=m;n.r=m;n.A=0;n.p=k;n.ga="";n.fa=m;
|
|
n.send=function(a,b,c,d){this.a&&g(Error("[goog.net.XhrIo] Object is active with another request="+this.K+"; newUri="+a));b=b?b.toUpperCase():"GET";this.K=a;this.w="";this.ea=b;this.U=m;this.m=j;this.a=this.L?this.L.T():M();this.J=this.L?this.L.z():M.z();this.a.onreadystatechange=s(this.da,this);try{G(this.h,O(this,"Opening Xhr")),this.S=j,this.a.open(b,a,j),this.S=m}catch(f){G(this.h,O(this,"Error opening Xhr: "+f.message));ec(this,f);return}a=c||"";var e=this.headers.R();d&&Ua(d,function(a,b){e.set(b,
|
|
a)});d=p.FormData&&a instanceof p.FormData;"POST"==b&&(!e.v("Content-Type")&&!d)&&e.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");Ua(e,function(a,b){this.a.setRequestHeader(b,a)},this);this.ga&&(this.a.responseType=this.ga);"withCredentials"in this.a&&(this.a.withCredentials=this.fa);try{this.p&&(p.clearTimeout(this.p),this.p=k),0<this.A&&(G(this.h,O(this,"Will abort after "+this.A+"ms if incomplete")),this.p=p.setTimeout(s(this.Da,this),this.A)),G(this.h,O(this,"Sending request")),
|
|
this.I=j,this.a.send(a),this.I=m}catch(h){G(this.h,O(this,"Send error: "+h.message)),ec(this,h)}};n.Da=function(){"undefined"!=typeof aa&&this.a&&(this.w="Timed out after "+this.A+"ms, aborting",G(this.h,O(this,this.w)),this.dispatchEvent("timeout"),this.abort(8))};var ec=function(a,b){a.m=m;a.a&&(a.r=j,a.a.abort(),a.r=m);a.w=b;fc(a);gc(a)},fc=function(a){a.U||(a.U=j,a.dispatchEvent("complete"),a.dispatchEvent("error"))};
|
|
N.prototype.abort=function(){this.a&&this.m&&(G(this.h,O(this,"Aborting")),this.m=m,this.r=j,this.a.abort(),this.r=m,this.dispatchEvent("complete"),this.dispatchEvent("abort"),gc(this))};N.prototype.s=function(){this.a&&(this.m&&(this.m=m,this.r=j,this.a.abort(),this.r=m),gc(this,j));N.N.s.call(this)};N.prototype.da=function(){!this.S&&!this.I&&!this.r?this.Ga():hc(this)};N.prototype.Ga=function(){hc(this)};
|
|
var hc=function(a){if(a.m&&"undefined"!=typeof aa)if(a.J[1]&&4==ic(a)&&2==jc(a))G(a.h,O(a,"Local request error detected and ignored"));else if(a.I&&4==ic(a))p.setTimeout(s(a.da,a),0);else if(a.dispatchEvent("readystatechange"),4==ic(a)){G(a.h,O(a,"Request complete"));a.m=m;try{var b=jc(a),c,d;a:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:d=j;break a;default:d=m}if(!(c=d)){var f;if(f=0===b){var e=Wb(1,String(a.K));if(!e&&self.location)var h=self.location.protocol,e=h.substr(0,
|
|
h.length-1);f=!ac.test(e?e.toLowerCase():"")}c=f}if(c)a.dispatchEvent("complete"),a.dispatchEvent("success");else{var l;try{l=2<ic(a)?a.a.statusText:""}catch(t){G(a.h,"Can not get status: "+t.message),l=""}a.w=l+" ["+jc(a)+"]";fc(a)}}finally{gc(a)}}},gc=function(a,b){if(a.a){var c=a.a,d=a.J[0]?ca:k;a.a=k;a.J=k;a.p&&(p.clearTimeout(a.p),a.p=k);b||a.dispatchEvent("ready");try{c.onreadystatechange=d}catch(f){a.h.log(vb,"Problem encountered resetting onreadystatechange: "+f.message,i)}}},ic=function(a){return a.a?
|
|
a.a.readyState:0},jc=function(a){try{return 2<ic(a)?a.a.status:-1}catch(b){return a.h.log(wb,"Can not get status: "+b.message,i),-1}};N.prototype.oa=function(){try{return this.a?this.a.responseText:""}catch(a){return G(this.h,"Can not get responseText: "+a.message),""}};var O=function(a,b){return b+" ["+a.ea+" "+a.K+" "+jc(a)+"]"};var kc=function(a,b,c){this.k=a||k;this.Ha=!!c},mc=function(a){if(!a.e&&(a.e=new y,a.b=0,a.k))for(var b=a.k.split("&"),c=0;c<b.length;c++){var d=b[c].indexOf("="),f=k,e=k;0<=d?(f=b[c].substring(0,d),e=b[c].substring(d+1)):f=b[c];f=decodeURIComponent(f.replace(/\+/g," "));f=lc(a,f);a.add(f,e?decodeURIComponent(e.replace(/\+/g," ")):"")}};n=kc.prototype;n.e=k;n.b=k;n.add=function(a,b){mc(this);this.k=k;a=lc(this,a);var c=this.e.get(a);c||this.e.set(a,c=[]);c.push(b);this.b++;return this};
|
|
n.v=function(a){mc(this);a=lc(this,a);return this.e.v(a)};n.u=function(){mc(this);for(var a=this.e.l(),b=this.e.u(),c=[],d=0;d<b.length;d++)for(var f=a[d],e=0;e<f.length;e++)c.push(b[d]);return c};n.l=function(a){mc(this);var b=[];if(a)this.v(a)&&(b=Pa(b,this.e.get(lc(this,a))));else{a=this.e.l();for(var c=0;c<a.length;c++)b=Pa(b,a[c])}return b};n.set=function(a,b){mc(this);this.k=k;a=lc(this,a);this.v(a)&&(this.b-=this.e.get(a).length);this.e.set(a,[b]);this.b++;return this};
|
|
n.get=function(a,b){var c=a?this.l(a):[];return 0<c.length?String(c[0]):b};n.toString=function(){if(this.k)return this.k;if(!this.e)return"";for(var a=[],b=this.e.u(),c=0;c<b.length;c++)for(var d=b[c],f=encodeURIComponent(String(d)),d=this.l(d),e=0;e<d.length;e++){var h=f;""!==d[e]&&(h+="="+encodeURIComponent(String(d[e])));a.push(h)}return this.k=a.join("&")};n.R=function(){var a=new kc;a.k=this.k;this.e&&(a.e=this.e.R(),a.b=this.b);return a};
|
|
var lc=function(a,b){var c=String(b);a.Ha&&(c=c.toLowerCase());return c};var pc=function(a,b,c){if(!("ready"==nc&&!a&&!b))if("loading"==nc&&g(Error("Already loading.")),nc="loading",oc=a||"/api",a=function(){P.i(Q,"Image");P.i(R,"Feature");P.i(S,"FeatureCollection");P.i(Q,"Window","focal_");P.i(T,"ImageCollection");P.i(T,"reduce");P.i(U,"Collection");P.i(U,"AggregateFeatureCollection","aggregate_",P.Ea);P.i(T,"Image","map_",P.la);P.i(S,"Feature","map_",P.la);nc="ready";c&&c()},c)P.j(a);else try{P.j(),a()}catch(d){alert("Could not read algorithm list.")}},nc="not_ready",
|
|
oc=k,qc=function(a,b){var c={c:{type:"Variable",name:b}};c.__proto__=a.prototype;return c},rc=function(a,b){return{type:"Algorithm",args:a,body:b}};v("ee.initialize",pc);v("ee.InitState",{eb:"not_ready",LOADING:"loading",fb:"ready"});v("ee.InitState.NOT_READY","not_ready");v("ee.InitState.LOADING","loading");v("ee.InitState.READY","ready");v("ee.ready",function(){return nc});
|
|
v("ee.call",function(a,b){if(r(a)){var c=P.get(a),d=Array.prototype.slice.call(arguments,1);return P.D(c,d,{})}c=a.args;(!c||c.length>arguments.length-1)&&g(Error("Missing lambda arguments: "+c.slice(arguments.length-1)));for(var d={algorithm:a},f=1;f<arguments.length;f++)d[c[f-1]]=arguments[f];return d});v("ee.apply",function(a,b){if(r(a)){var c=P.get(a);return P.D(c,[],b)}c=qa(b);c.algorithm=a;return c});v("ee.variable",qc);v("ee.lambda",rc);v("ee.TILE_SIZE",256);var tc=function(a,b){return W("/mapid",sc(a),b)},uc=function(a,b){return W("/value",sc(a),b)},vc=function(a,b){return W("/download",sc(a),b)},wc=function(a){return oc+"/download?docid="+a.docid+"&token="+a.token},W=function(a,b,c,d){function f(a,b){var c=m;try{var d=ua(a),e=d.data,f=d.error}catch(I){c=j}var V=i;c||!e&&!f?V="Malformed request: "+a:f&&(V=d.error.message);if(b)b(e,V);else{if(!V)return e;g(Error(V))}}d=d||"POST";a=oc+a;b=b?b.toString():"";if(c)dc(a,function(a){return f(a.target.oa(),
|
|
c)},d,b);else{var e=M();e.open(d,a,m);e.setRequestHeader("Content-type","application/x-www-form-urlencoded");e.send(b);return f(e.responseText,k)}},sc=function(a){var b=new kc,c;for(c in a)b.set(c,a[c]);return b};v("ee.data",function(){});v("ee.data.getInfo",function(a,b){return W("/info",(new kc).add("id",a),b)});v("ee.data.getList",function(a,b){return W("/list",(new kc).add("id",a),b)});v("ee.data.getMapId",tc);v("ee.data.getValue",uc);
|
|
v("ee.data.getThumbId",function(a,b){var c=sc(a).add("getid","1");return W("/thumb",c,b)});v("ee.data.getDownloadId",vc);v("ee.data.makeDownloadUrl",wc);v("ee.data.send_",W);
|
|
v("ee.data.setupMockSend",function(a){var b=a||{};dc=function(a,c,e,h){var l=new function(){};l.target={};l.target.oa=function(){return a in b?r(b[a])?b[a]:b[a](a,c,e,h):'{"error": {}}'};setTimeout(s(c,l,l),0)};var c=function(){};c.prototype.open=function(a,b){this.url=b;this.method=a};c.prototype.setRequestHeader=function(){};c.prototype.send=function(a){this.responseText=this.url in b?r(b[this.url])?b[this.url]:b[this.url](this.url,this.method,a):(new va(i)).d({data:{url:this.url,method:this.method,
|
|
data:a}})};M=function(){return new c}});v("ee.data.parse",function(a){return ua(a)});var xc=function(a){this.F=a};w(xc,va);var X=function(a){return(new xc).d(a)},yc=function(a){a=X(a);return"JSON"in window?window.JSON.stringify(window.JSON.parse(a),k," "):a};xc.prototype.Y=function(a,b){"serialize"in a?b.push(a.d()):xc.N.Y.call(this,a,b)};v("ee.Serializer",xc);v("ee.Serializer.toJSON",X);v("ee.Serializer.toReadableJSON",yc);var Y=function(a){if(!(this instanceof Y))return new Y(a);pc();if(a instanceof Y)return a;this.G=a instanceof Array?a:a?[a]:[]};Y.prototype.length=function(){return this.G.length};
|
|
var Z=function(a,b){var c=a.G.slice(0);b instanceof Y?Qa(c,b.G):b instanceof Array?Qa(c,b):c.push(b);return new Y(c)},$=function(a,b,c){return new Y(ta("property",a,b,c))},zc=function(a,b){return $(a,"equals",b)},Ac=function(a,b){return $(a,"not_equals",b)},Bc=function(a,b){return $(a,"less_than",b)},Cc=function(a,b){return $(a,"not_less_than",b)},Dc=function(a,b){return $(a,"greater_than",b)},Ec=function(a,b){return $(a,"not_greater_than",b)},Fc=function(a,b){return $(a,"contains",b)},Gc=function(a,
|
|
b){return $(a,"not_contains",b)},Hc=function(a,b){return $(a,"starts_with",b)},Ic=function(a,b){return $(a,"not_starts_with",b)},Jc=function(a,b){return $(a,"ends_with",b)},Kc=function(a,b){return $(a,"not_ends_with",b)},Lc=function(a){var b=Array.prototype.slice.call(arguments);return new Y({and:b})},Mc=function(a,b){var c=function(a){return a instanceof Date?a.getTime():"string"==typeof a?(new Date(a)).getTime():a},d={property:"system:time_start",not_less_than:c(a)};b&&(d=[d,{property:"system:time_start",
|
|
not_greater_than:c(b)}]);return new Y(d)},Nc=function(a){a instanceof S&&(a={algorithm:"ExtractGeometry",collection:a});return new Y({geometry:a})};n=Y.prototype;n.Sa=function(){return Z(this,zc.apply(k,[].slice.call(arguments)))};n.Ya=function(){return Z(this,Ac.apply(k,[].slice.call(arguments)))};n.Wa=function(){return Z(this,Bc.apply(k,[].slice.call(arguments)))};n.Va=function(){return Z(this,Cc.apply(k,[].slice.call(arguments)))};n.Ua=function(){return Z(this,Dc.apply(k,[].slice.call(arguments)))};
|
|
n.Xa=function(){return Z(this,Ec.apply(k,[].slice.call(arguments)))};n.contains=function(){return Z(this,Fc.apply(k,[].slice.call(arguments)))};n.Za=function(){return Z(this,Gc.apply(k,[].slice.call(arguments)))};n.bb=function(){return Z(this,Hc.apply(k,[].slice.call(arguments)))};n.ab=function(){return Z(this,Ic.apply(k,[].slice.call(arguments)))};n.Ra=function(){return Z(this,Jc.apply(k,[].slice.call(arguments)))};n.$a=function(){return Z(this,Kc.apply(k,[].slice.call(arguments)))};
|
|
n.Oa=function(){return Z(this,Lc.apply(k,[].slice.call(arguments)))};n.Qa=function(){return Z(this,Mc.apply(k,[].slice.call(arguments)))};n.bounds=function(){return Z(this,Nc.apply(k,[].slice.call(arguments)))};n.d=function(){return X(this.G)};n.toString=function(){return"ee.Filter("+yc(this.G)+")"};v("ee.Filter",Y);Y.prototype.length=Y.prototype.length;Y.prototype.and=Y.prototype.Oa;Y.prototype.eq=Y.prototype.Sa;Y.prototype.neq=Y.prototype.Ya;Y.prototype.lt=Y.prototype.Wa;Y.prototype.gte=Y.prototype.Va;
|
|
Y.prototype.gt=Y.prototype.Ua;Y.prototype.lte=Y.prototype.Xa;Y.prototype.contains=Y.prototype.contains;Y.prototype.not_contains=Y.prototype.Za;Y.prototype.starts_with=Y.prototype.bb;Y.prototype.not_starts_with=Y.prototype.ab;Y.prototype.ends_with=Y.prototype.Ra;Y.prototype.not_ends_with=Y.prototype.$a;Y.prototype.bounds=Y.prototype.bounds;Y.prototype.date=Y.prototype.Qa;Y.prototype.serialize=Y.prototype.d;Y.prototype.toString=Y.prototype.toString;Y.and=Lc;
|
|
Y.or=function(a){var b=Array.prototype.slice.call(arguments);return new Y({or:b})};Y.eq=zc;Y.neq=Ac;Y.lt=Bc;Y.gte=Cc;Y.gt=Dc;Y.lte=Ec;Y.contains=Fc;Y.not_contains=Gc;Y.starts_with=Hc;Y.not_starts_with=Ic;Y.ends_with=Jc;Y.not_ends_with=Kc;Y.bounds=Nc;Y.date=Mc;var U=function(a){this.c=a};U.prototype.filter=function(a){a||g(Error("Empty filters."));var b;Oc(this)?(b=this.c.collection,a=Z(this.c.filters,a)):b=this.c;return new this.constructor({algorithm:"FilterFeatureCollection",collection:b,filters:a})};var Oc=function(a){return"FilterFeatureCollection"==a.c.algorithm};n=U.prototype;n.ba=function(a,b,c){return this.filter($(a,b,c))};n.$=function(a){return this.filter(Nc(a))};n.aa=function(a,b){return this.filter(Mc(a,b))};
|
|
n.H=function(a){return uc({json:this.d()},a)};n.d=function(){for(var a=this;Oc(a)&&0==a.c.filters.length();)a=a.c.collection;return X(a.c)};n.ca=function(a,b,c){a={algorithm:"LimitFeatureCollection",collection:this,limit:a};b&&(a.key=b,c&&(a.ascending=c));return new this.constructor(a)};n.sort=function(a,b){var c={algorithm:"LimitFeatureCollection",collection:this,key:a};b&&(c.ascending=b);return new this.constructor(c)};n.geometry=function(){return{algorithm:"ExtractGeometry",collection:this}};
|
|
var Qc=function(a,b,c,d,f,e){ga(c)&&(d&&g(Error("Can't use dynamicArgs with a mapped JS function.")),d="_MAPPING_VAR_"+Pc++,c=rc([d],c(qc(b,d))),d=ta(d,".all"));b={algorithm:"Collection.map",collection:a,baseAlgorithm:c};d&&(b.dynamicArgs=d);f&&(b.constantArgs=f);e&&(b.destination=e);return new a.constructor(b)},Pc=0;v("ee.Collection",U);U.prototype.filter=U.prototype.filter;U.prototype.filterMetadata=U.prototype.ba;U.prototype.filterBounds=U.prototype.$;U.prototype.filterDate=U.prototype.aa;
|
|
U.prototype.getInfo=U.prototype.H;U.prototype.serialize=U.prototype.d;U.prototype.limit=U.prototype.ca;U.prototype.sort=U.prototype.sort;U.isFilterFeatureCollection_=Oc;var Q=function(a){if(!(this instanceof Q))return new Q(a);pc();if(fa(a))a={algorithm:"Constant",value:a};else if(r(a))a={type:"Image",id:a};else{if(q(a))return Rc(Na(a,function(a){return new Q(a)}));if(a instanceof Q)return a}this.c=a};Q.prototype.H=function(){return uc({json:this.d()})};Q.prototype.getMap=function(a,b){var c=a||{};c.image=this.d();if(b)tc(c,s(function(a,c){a&&(a.image=this);b(a,c)},this));else return c=tc(c),c.image=this,c};
|
|
Q.prototype.Ta=function(a){a=a||{};a.image=this.d();a=vc(a);return wc(a)};Q.prototype.d=function(){return X(this.c)};var Rc=function(a,b){0==a.length&&g(Error("Can't combine 0 images."));for(var c=new Q(a[0]),d=1;d<a.length;d++)c=new Q({algorithm:"Image.addBands",dstImg:c,srcImg:new Q(a[d])});b&&(c=c.select([".*"],b));return c};
|
|
Q.prototype.select=function(a,b){var c={algorithm:"Image.select",input:this,bandSelectors:a};if(q(a))b&&(c.newNames=b);else{a=Array.prototype.slice.call(arguments);for(var d=0;d<a.length;d++)!r(a[d])&&!fa(a[d])&&g(Error("Illegal argument to select(): "+a[d]));c.bandSelectors=a}return new Q(c)};Q.prototype.toString=function(){return"ee.Image("+yc(this.c)+")"};v("ee.Image",Q);Q.prototype.getInfo=Q.prototype.H;Q.prototype.getDownloadURL=Q.prototype.Ta;Q.prototype.getMap=Q.prototype.getMap;
|
|
Q.prototype.select=Q.prototype.select;Q.prototype.serialize=Q.prototype.d;Q.cat=function(a){var b=Array.prototype.slice.call(arguments);return Rc(b,k)};Q.combine_=Rc;Q.rgb=function(a,b,c){return Rc([a,b,c],["vis-red","vis-green","vis-blue"])};Q.toString=Q.toString;var R=function(a,b){if(!(this instanceof R))return new R(a,b);pc();if(a instanceof R)return b&&g(Error("Can't create Feature out of a Feature and properties.")),a;"algorithm"in a?this.c=b?{algorithm:"Feature",geometry:a,metadata:b}:a:Sc(a)?this.c={algorithm:"Feature",geometry:a,metadata:b||{}}:g(Error("Not a geometry, feature or JSON description."))};
|
|
R.prototype.getMap=function(a,b){var c=new Q({algorithm:"DrawVector",collection:{type:"FeatureCollection",features:[this]},color:(a||{}).color||"000000"});if(b)c.getMap(k,b);else return c.getMap()};
|
|
var Sc=function(a){var b=a.type;a=Tc(a.coordinates);return"Point"==b&&1==a||"MultiPoint"==b&&2==a||"LineString"==b&&2==a||"LinearRing"==b&&2==a||"MultiLine"==b&&3==a||"Polygon"==b&&3==a||"MultiPolygon"==b&&4==a},Tc=function(a){if(!q(a))return-1;if(q(a[0])){for(var b=Tc(a[0]),c=1;c<a.length;c++)if(Tc(a[c])!=b)return-1;return b+1}for(c=0;c<a.length;c++)if(!fa(a[c]))return-1;return 0==a.length%2?1:-1},Uc=function(a,b,c){(2>b||4<b)&&g(Error("Unexpected nesting level."));if(!q(a)&&c&&(a=Array.prototype.slice.call(c),
|
|
"number"==typeof a[0])){0!=a.length%2&&g(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;q(c);)c=c[0],d++;for(;d<b;)a=[a],d++;Tc(a)!=b&&g(Error("Invalid geometry"));return a};R.prototype.d=function(){return X(this.c)};R.prototype.toString=function(){return"ee.Feature("+yc(this.c)+")"};v("ee.Feature",R);R.validGeometry=Sc;R.validCoordinates=Tc;R.Point=function(a,b){return{type:"Point",coordinates:[a,b]}};
|
|
R.MultiPoint=function(a){return{type:"MultiPoint",coordinates:Uc(a,2,arguments)}};R.Rectangle=function(a,b,c,d){q(a)&&(d=a,a=d[0],b=d[1],c=d[2],d=d[3]);return{type:"Polygon",coordinates:[[[a,d],[a,b],[c,b],[c,d]]]}};R.LineString=function(a){return{type:"LineString",coordinates:Uc(a,2,arguments)}};R.LinearRing=function(a){return{type:"LinearRing",coordinates:Uc(a,2,arguments)}};R.MultiLine=function(a){return{type:"MultiLine",coordinates:Uc(a,3,arguments)}};
|
|
R.Polygon=function(a){return{type:"Polygon",coordinates:Uc(a,3,arguments)}};R.MultiPolygon=function(a){return{type:"MultiPolygon",coordinates:Uc(a,4,arguments)}};R.getMap=R.prototype.getMap;R.prototype.serialize=R.prototype.d;R.prototype.toString=R.prototype.toString;var S=function(a,b){if(!(this instanceof S))return new S(a,b);pc();a instanceof R&&(a=[a]);if(r(a))a={type:"FeatureCollection",id:a},b&&(a.geo_column=b);else if(fa(a))a={type:"FeatureCollection",table_id:a},b&&(a.geo_column=b);else if(q(a))a={type:"FeatureCollection",features:Na(a,function(a){return new R(a)})};else if(a instanceof S)return a;this.c=a};w(S,U);S.prototype.getMap=function(a,b){var c=new Q({algorithm:"DrawVector",collection:this,color:(a||{}).color||"000000"});if(b)c.getMap(k,b);else return c.getMap()};
|
|
S.prototype.toString=function(){return"ee.FeatureCollection("+yc(this.c)+")"};S.prototype.map=function(a,b,c,d){return Qc(this,R,a,b,c,d)};v("ee.FeatureCollection",S);S.prototype.filter=S.prototype.filter;S.prototype.filterDate=S.prototype.aa;S.prototype.filterMetadata=S.prototype.ba;S.prototype.filterBounds=S.prototype.$;S.prototype.getInfo=S.prototype.H;S.prototype.limit=S.prototype.ca;S.prototype.serialize=S.prototype.d;S.prototype.sort=S.prototype.sort;S.prototype.map=S.prototype.map;
|
|
S.prototype.geometry=S.prototype.geometry;S.prototype.getMap=S.prototype.getMap;S.prototype.toString=S.prototype.toString;var T=function(a){if(!(this instanceof T))return new T(a);pc();a instanceof Q&&(a=[a]);if(r(a))a={type:"ImageCollection",id:a};else if(q(a))a={type:"ImageCollection",images:Na(a,function(a){return new Q(a)})};else if(a instanceof T)return a;this.c=a};w(T,U);n=T.prototype;n.getMap=function(a,b){var c=this.za();if(b)c.getMap(a,b);else return c.getMap(a)};n.za=function(){return new Q({creator:"SimpleMosaic",args:[this]})};
|
|
n.Pa=function(a){return new T({algorithm:"CombineCollectionBands",primary:this,secondary:a})};n.toString=function(){return"ee.ImageCollection("+yc(this.c)+")"};n.map=function(a,b,c,d){return Qc(this,Q,a,b,c,d)};v("ee.ImageCollection",T);T.prototype.getMap=T.prototype.getMap;T.prototype.mosaic=T.prototype.za;T.prototype.combine=T.prototype.Pa;T.prototype.filter=T.prototype.filter;T.prototype.filterDate=T.prototype.aa;T.prototype.filterMetadata=T.prototype.ba;T.prototype.filterBounds=T.prototype.$;
|
|
T.prototype.getInfo=T.prototype.H;T.prototype.limit=T.prototype.ca;T.prototype.serialize=T.prototype.d;T.prototype.sort=T.prototype.sort;T.prototype.map=T.prototype.map;T.prototype.toString=T.prototype.toString;var P={j:function(a){P.C||(a?W("/algorithms",sc({}),function(b){P.C=b;a()},"GET"):P.C=W("/algorithms",sc({}),i,"GET"))},get:function(a){P.j();var b=P.C[a];b||g(Error("Unknown algorithm"));a in b||(b.name=a);return b},D:function(a,b,c){b=b||[];c=c||{};var d=a.args,f=b.length+c.length;f>d.length&&g(Error("Incorrect number of arguments: "+a.name+" expects no more than "+d.length+" arguments, got "+f+"."));for(var f={},e=0;e<d.length;e++)f[d[e].name]=j;var e=[],h;for(h in c)h in f||e.push(h);0<e.length&&
|
|
g(Error("Unrecognized arguments: "+a.name+"("+e+")"));for(e=0;e<b.length;e++)h=d[e].name,h in c&&g(Error("Argument already set: "+a.name+"("+h+")")),c[h]=b[e];for(e=0;e<d.length;e++)h=d[e].name,h in c?c[h]=P.Ba(d[e].type,c[h]):d[e].optional||g("Missing required argument: "+h);c.algorithm=a.name;return P.Ba(a.returns,c)},pa:function(a,b){var c=function(){var c=Array.prototype.slice.call(arguments,0);c.unshift(this);return P.D(a,c,b)};P.ua(c,a);return c},Ea:function(a,b){var c=P.pa(a,b),d=function(){var a=
|
|
arguments,b=i,d=arguments[arguments.length-1];d&&ga(d)&&(b=d,a=Array.prototype.slice.call(arguments,0,arguments.length-1));a=c.apply(this,a);return uc({json:X(a)},b)};d.signature=c.signature;d.toString=c.toString;return d},la:function(a,b){var c=function(){var c=Array.prototype.slice.call(arguments,0),d=qa(a);d.returns=k;d.args=a.args.slice(1);d=P.D(d,c,b);"algorithm"in d&&delete d.algorithm;var h={};h[a.args[0].name]=".all";c="Image"==a.returns?T:S;d={constantArgs:d,baseAlgorithm:a.name,collection:this,
|
|
dynamicArgs:h,algorithm:"MapAlgorithm"};"Image"==a.returns||("EEObject"==a.returns||"Feature"==a.returns)||(d.destination=a.name.split(".").pop());return new c(d)},d=qa(a);d.name="Map("+a.name+", this)";d.args=d.args.slice();d.args[0]=qa(d.args[0]);d.args[0].name="["+d.args[0].name+"]";d.args[0].type+="Collection";P.ua(c,d);return c},ua:function(a,b){a.signature=b;a.toString=function(){var a=[];a.push(b.name);a.push("(");a.push(Na(b.args.slice(1),function(a){return a.name}).join(", "));a.push(")\n\n");
|
|
a.push(b.description);a.push("\n\nArgs:\n");for(var d=0;d<b.args.length;d++){0==d?a.push(" this:"):a.push("\n ");var f=b.args[d];a.push(f.name);a.push(" (");a.push(f.type);f.optional&&a.push(", optional");a.push("): ");a.push(f.description)}return a.join("")}},i:function(a,b,c,d){P.j();c=c||"";d=d||P.pa;for(var f in P.C){var e=f.split(".");if(2==e.length&&e[0]==b){var e=c+e[1],h=P.C[f];h.name=f;e in a.prototype&&(e+="_");a.prototype[e]=d(h)}}},Ba:function(a,b){switch(a){case "Image":return new Q(b);
|
|
case "ImageCollection":return new T(b);case "Feature":case "EEObject":return b instanceof U?{type:"Feature",geometry:b.geometry(),properties:{}}:new R(b);case "FeatureCollection":case "EECollection":return new S(b);case "ErrorMargin":return fa(b)?{type:"ErrorMargin",unit:"meters",value:b}:b;default:return b}}};v("ee.Algorithms",P);v("ee.Algorithms.addFunctions",P.i);v("ee.Algorithms.applySignature_",P.D);v("ee.Algorithms.init",P.j);v("ee.Algorithms.get",P.get);})();
|