/*!
 * https://github.com/es-shims/es5-shim
 * @license es5-shim Copyright 2009-2015 by contributors, MIT License
 * see https://github.com/es-shims/es5-shim/blob/master/LICENSE
 */
(function(t,r){"use strict";typeof define=="function"&&define.amd?define(r):typeof exports=="object"?module.exports=r():t.returnExports=r()})(this,function(){var t=Array,r=t.prototype,e=Object,n=e.prototype,i=Function,a=i.prototype,o=String,f=o.prototype,u=Number,l=u.prototype,s=r.slice,c=r.splice,v=r.push,h=r.unshift,p=r.concat,y=r.join,d=a.call,g=a.apply,w=Math.max,b=Math.min,T=n.toString,m=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",S=Function.prototype.toString,x=/^\s*class /,O=function(t){try{var r=S.call(t),e=r.replace(/\/\/.*\n/g,""),n=e.replace(/\/\*[.\s\S]*\*\//g,""),i=n.replace(/\n/gm," ").replace(/ {2}/g," ");return x.test(i)}catch(a){return!1}},E=function(t){try{return O(t)?!1:(S.call(t),!0)}catch(r){return!1}},j="[object Function]",I="[object GeneratorFunction]",D=function(t){if(!t||typeof t!="function"&&typeof t!="object")return!1;if(m)return E(t);if(O(t))return!1;var r=T.call(t);return r===j||r===I},M,U=RegExp.prototype.exec,F=function(t){try{return U.call(t),!0}catch(r){return!1}},$="[object RegExp]";M=function(t){return typeof t!="object"?!1:m?F(t):T.call(t)===$};var N,C=String.prototype.valueOf,k=function(t){try{return C.call(t),!0}catch(r){return!1}},A="[object String]";N=function(t){return typeof t=="string"?!0:typeof t!="object"?!1:m?k(t):T.call(t)===A};var R=e.defineProperty&&function(){try{var t={};e.defineProperty(t,"x",{enumerable:!1,value:t});for(var r in t)return!1;return t.x===t}catch(n){return!1}}(),P=function(t){var r;return r=R?function(t,r,n,i){!i&&r in t||e.defineProperty(t,r,{configurable:!0,enumerable:!1,writable:!0,value:n})}:function(t,r,e,n){!n&&r in t||(t[r]=e)},function(e,n,i){for(var a in n)t.call(n,a)&&r(e,a,n[a],i)}}(n.hasOwnProperty),J=function(t){var r=typeof t;return t===null||r!=="object"&&r!=="function"},Y=u.isNaN||function(t){return t!==t},Z={ToInteger:function(t){var r=+t;return Y(r)?r=0:r!==0&&r!==1/0&&r!==-(1/0)&&(r=(r>0||-1)*Math.floor(Math.abs(r))),r},ToPrimitive:function(t){var r,e,n;if(J(t))return t;if((e=t.valueOf,D(e)&&(r=e.call(t),J(r)))||(n=t.toString,D(n)&&(r=n.call(t),J(r))))return r;throw new TypeError;},ToObject:function(t){if(t==null)throw new TypeError("can't convert "+t+" to object");return e(t)},ToUint32:function(t){return t>>>0}},z=function(){};P(a,{bind:function(t){var r=this;if(!D(r))throw new TypeError("Function.prototype.bind called on incompatible "+r);for(var n=s.call(arguments,1),a,o=function(){if(this instanceof a){var i=g.call(r,this,p.call(n,s.call(arguments)));return e(i)===i?i:this}return g.call(r,t,p.call(n,s.call(arguments)))},f=w(0,r.length-n.length),u=[],l=0;l<f;l++)v.call(u,"$"+l);return a=i("binder","return function ("+y.call(u,",")+"){ return binder.apply(this, arguments); }")(o),r.prototype&&(z.prototype=r.prototype,a.prototype=new z,z.prototype=null),a}});var G=d.bind(n.hasOwnProperty),H=d.bind(n.toString),W=d.bind(s),B=g.bind(s);if(typeof document=="object"&&document&&document.documentElement)try{W(document.documentElement.childNodes)}catch(X){var L=W,q=B;W=function(t){for(var r=[],e=t.length;e-->0;)r[e]=t[e];return q(r,L(arguments,1))};B=function(t,r){return q(W(t),r)}}var K=d.bind(f.slice),Q=d.bind(f.split),V=d.bind(f.indexOf),_=d.bind(v),tt=d.bind(n.propertyIsEnumerable),rt=d.bind(r.sort),et=t.isArray||function(t){return H(t)==="[object Array]"},nt=[].unshift(0)!==1;P(r,{unshift:function(){return h.apply(this,arguments),this.length}},nt);P(t,{isArray:et});var it=e("a"),at=it[0]!=="a"||!(0 in it),ot=function(t){var r=!0,e=!0,n=!1;if(t)try{t.call("foo",function(t,e,n){typeof n!="object"&&(r=!1)});t.call([1],function(){"use strict";e=typeof this=="string"},"x")}catch(i){n=!0}return!!t&&!n&&r&&e};P(r,{forEach:function(t){var r=Z.ToObject(this),e=at&&N(this)?Q(this,""):r,n=-1,i=Z.ToUint32(e.length),a;if(arguments.length>1&&(a=arguments[1]),!D(t))throw new TypeError("Array.prototype.forEach callback must be a function");while(++n<i)n in e&&(typeof a=="undefined"?t(e[n],n,r):t.call(a,e[n],n,r))}},!ot(r.forEach));P(r,{map:function(r){var e=Z.ToObject(this),n=at&&N(this)?Q(this,""):e,i=Z.ToUint32(n.length),a=t(i),o;if(arguments.length>1&&(o=arguments[1]),!D(r))throw new TypeError("Array.prototype.map callback must be a function");for(var f=0;f<i;f++)f in n&&(a[f]=typeof o=="undefined"?r(n[f],f,e):r.call(o,n[f],f,e));return a}},!ot(r.map));P(r,{filter:function(t){var r=Z.ToObject(this),e=at&&N(this)?Q(this,""):r,n=Z.ToUint32(e.length),i=[],a,o;if(arguments.length>1&&(o=arguments[1]),!D(t))throw new TypeError("Array.prototype.filter callback must be a function");for(var f=0;f<n;f++)f in e&&(a=e[f],(typeof o=="undefined"?t(a,f,r):t.call(o,a,f,r))&&_(i,a));return i}},!ot(r.filter));P(r,{every:function(t){var r=Z.ToObject(this),e=at&&N(this)?Q(this,""):r,n=Z.ToUint32(e.length),i;if(arguments.length>1&&(i=arguments[1]),!D(t))throw new TypeError("Array.prototype.every callback must be a function");for(var a=0;a<n;a++)if(a in e&&!(typeof i=="undefined"?t(e[a],a,r):t.call(i,e[a],a,r)))return!1;return!0}},!ot(r.every));P(r,{some:function(t){var r=Z.ToObject(this),e=at&&N(this)?Q(this,""):r,n=Z.ToUint32(e.length),i;if(arguments.length>1&&(i=arguments[1]),!D(t))throw new TypeError("Array.prototype.some callback must be a function");for(var a=0;a<n;a++)if(a in e&&(typeof i=="undefined"?t(e[a],a,r):t.call(i,e[a],a,r)))return!0;return!1}},!ot(r.some));var ft=!1;r.reduce&&(ft=typeof r.reduce.call("es5",function(t,r,e,n){return n})=="object");P(r,{reduce:function(t){var r=Z.ToObject(this),e=at&&N(this)?Q(this,""):r,n=Z.ToUint32(e.length);if(!D(t))throw new TypeError("Array.prototype.reduce callback must be a function");if(n===0&&arguments.length===1)throw new TypeError("reduce of empty array with no initial value");var i=0,a;if(arguments.length>=2)a=arguments[1];else do{if(i in e){a=e[i++];break}if(++i>=n)throw new TypeError("reduce of empty array with no initial value");}while(1);for(;i<n;i++)i in e&&(a=t(a,e[i],i,r));return a}},!ft);var ut=!1;r.reduceRight&&(ut=typeof r.reduceRight.call("es5",function(t,r,e,n){return n})=="object");P(r,{reduceRight:function(t){var r=Z.ToObject(this),e=at&&N(this)?Q(this,""):r,n=Z.ToUint32(e.length);if(!D(t))throw new TypeError("Array.prototype.reduceRight callback must be a function");if(n===0&&arguments.length===1)throw new TypeError("reduceRight of empty array with no initial value");var i,a=n-1;if(arguments.length>=2)i=arguments[1];else do{if(a in e){i=e[a--];break}if(--a<0)throw new TypeError("reduceRight of empty array with no initial value");}while(1);if(a<0)return i;do a in e&&(i=t(i,e[a],a,r));while(a--);return i}},!ut);var lt=r.indexOf&&[0,1].indexOf(1,2)!==-1;P(r,{indexOf:function(t){var r=at&&N(this)?Q(this,""):Z.ToObject(this),e=Z.ToUint32(r.length);if(e===0)return-1;var n=0;for(arguments.length>1&&(n=Z.ToInteger(arguments[1])),n=n>=0?n:w(0,e+n);n<e;n++)if(n in r&&r[n]===t)return n;return-1}},lt);var st=r.lastIndexOf&&[0,1].lastIndexOf(0,-3)!==-1;P(r,{lastIndexOf:function(t){var r=at&&N(this)?Q(this,""):Z.ToObject(this),e=Z.ToUint32(r.length);if(e===0)return-1;var n=e-1;for(arguments.length>1&&(n=b(n,Z.ToInteger(arguments[1]))),n=n>=0?n:e-Math.abs(n);n>=0;n--)if(n in r&&t===r[n])return n;return-1}},st);var ct=function(){var t=[1,2],r=t.splice();return t.length===2&&et(r)&&r.length===0}();P(r,{splice:function(){return arguments.length===0?[]:c.apply(this,arguments)}},!ct);var vt=function(){var t={};return r.splice.call(t,0,0,1),t.length===1}();P(r,{splice:function(t,r){if(arguments.length===0)return[];var e=arguments;return this.length=w(Z.ToInteger(this.length),0),arguments.length>0&&typeof r!="number"&&(e=W(arguments),e.length<2?_(e,this.length-t):e[1]=Z.ToInteger(r)),c.apply(this,e)}},!vt);var ht=function(){var r=new t(1e5);return r[8]="x",r.splice(1,1),r.indexOf("x")===7}(),pt=function(){var t=256,r=[];return r[t]="a",r.splice(t+1,0,"b"),r[t]==="a"}();P(r,{splice:function(t,r){for(var e=Z.ToObject(this),n=[],i=Z.ToUint32(e.length),a=Z.ToInteger(t),f=a<0?w(i+a,0):b(a,i),u=b(w(Z.ToInteger(r),0),i-f),l=0,s;l<u;)s=o(f+l),G(e,s)&&(n[l]=e[s]),l+=1;var c=W(arguments,2),v=c.length,h;if(v<u){l=f;for(var p=i-u;l<p;)s=o(l+u),h=o(l+v),G(e,s)?e[h]=e[s]:delete e[h],l+=1;l=i;for(var y=i-u+v;l>y;)delete e[l-1],l-=1}else if(v>u)for(l=i-u;l>f;)s=o(l+u-1),h=o(l+v-1),G(e,s)?e[h]=e[s]:delete e[h],l-=1;l=f;for(var d=0;d<c.length;++d)e[l]=c[d],l+=1;return e.length=i-u+v,n}},!ht||!pt);var yt=r.join,dt;try{dt=Array.prototype.join.call("123",",")!=="1,2,3"}catch(X){dt=!0}dt&&P(r,{join:function(t){var r=typeof t=="undefined"?",":t;return yt.call(N(this)?Q(this,""):this,r)}},dt);var gt=[1,2].join(undefined)!=="1,2";gt&&P(r,{join:function(t){var r=typeof t=="undefined"?",":t;return yt.call(this,r)}},gt);var wt=function(){for(var r=Z.ToObject(this),e=Z.ToUint32(r.length),n=0;n<arguments.length;)r[e+n]=arguments[n],n+=1;return r.length=e+n,e+n},bt=function(){var t={},r=Array.prototype.push.call(t,undefined);return r!==1||t.length!==1||typeof t[0]!="undefined"||!G(t,0)}();P(r,{push:function(){return et(this)?v.apply(this,arguments):wt.apply(this,arguments)}},bt);var Tt=function(){var t=[],r=t.push(undefined);return r!==1||t.length!==1||typeof t[0]!="undefined"||!G(t,0)}();P(r,{push:wt},Tt);P(r,{slice:function(){var e=N(this)?Q(this,""):this;return B(e,arguments)}},at);var mt=function(){try{[1,2].sort(null)}catch(t){try{[1,2].sort({})}catch(r){return!1}}return!0}(),Dt=function(){try{return[1,2].sort(/a/),!1}catch(t){}return!0}(),St=function(){try{return[1,2].sort(undefined),!0}catch(t){}return!1}();P(r,{sort:function(t){if(typeof t=="undefined")return rt(this);if(!D(t))throw new TypeError("Array.prototype.sort callback must be a function");return rt(this,t)}},mt||!St||!Dt);var xt=!tt({toString:null},"toString"),Ot=tt(function(){},"prototype"),Et=!G("x","0"),jt=function(t){var r=t.constructor;return r&&r.prototype===t},It={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0,$width:!0,$height:!0,$top:!0,$localStorage:!0},Mt=function(){if(typeof window=="undefined")return!1;for(var t in window)try{!It["$"+t]&&G(window,t)&&window[t]!==null&&typeof window[t]=="object"&&jt(window[t])}catch(r){return!0}return!1}(),Ut=function(t){if(typeof window=="undefined"||!Mt)return jt(t);try{return jt(t)}catch(r){return!1}},Ft=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],$t=Ft.length,Nt=function(t){return H(t)==="[object Arguments]"},Ct=function(t){return t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&!et(t)&&D(t.callee)},kt=Nt(arguments)?Nt:Ct;P(e,{keys:function(t){var r=D(t),e=kt(t),n=t!==null&&typeof t=="object",i=n&&N(t);if(!n&&!r&&!e)throw new TypeError("Object.keys called on a non-object");var a=[],f=Ot&&r;if(i&&Et||e)for(var u=0;u<t.length;++u)_(a,o(u));if(!e)for(var l in t)f&&l==="prototype"||!G(t,l)||_(a,o(l));if(xt)for(var s=Ut(t),c=0;c<$t;c++){var v=Ft[c];s&&v==="constructor"||!G(t,v)||_(a,v)}return a}});var At=e.keys&&function(){return e.keys(arguments).length===2}(1,2),Rt=e.keys&&function(){var t=e.keys(arguments);return arguments.length!==1||t.length!==1||t[0]!==1}(1),Pt=e.keys;P(e,{keys:function(t){return kt(t)?Pt(W(t)):Pt(t)}},!At||Rt);var Jt=new Date(-0xc782b5b342b24).getUTCMonth()!==0,Yt=new Date(-0x55d318d56a724),Zt=new Date(14496624e5),zt=Yt.toUTCString()!=="Mon, 01 Jan -45875 11:59:59 GMT",Gt,Ht,Wt=Yt.getTimezoneOffset();Wt<-720?(Gt=Yt.toDateString()!=="Tue Jan 02 -45875",Ht=!/^Thu Dec 10 2015 \d\d:\d\d:\d\d GMT[-+]\d\d\d\d(?: |$)/.test(String(Zt))):(Gt=Yt.toDateString()!=="Mon Jan 01 -45875",Ht=!/^Wed Dec 09 2015 \d\d:\d\d:\d\d GMT[-+]\d\d\d\d(?: |$)/.test(String(Zt)));var Bt=d.bind(Date.prototype.getFullYear),Xt=d.bind(Date.prototype.getMonth),Lt=d.bind(Date.prototype.getDate),qt=d.bind(Date.prototype.getUTCFullYear),Kt=d.bind(Date.prototype.getUTCMonth),Qt=d.bind(Date.prototype.getUTCDate),Vt=d.bind(Date.prototype.getUTCDay),_t=d.bind(Date.prototype.getUTCHours),tr=d.bind(Date.prototype.getUTCMinutes),rr=d.bind(Date.prototype.getUTCSeconds),er=d.bind(Date.prototype.getUTCMilliseconds),nr=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ir=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ar=function(t,r){return Lt(new Date(r,t,0))};P(Date.prototype,{getFullYear:function(){if(!this||!(this instanceof Date))throw new TypeError("this is not a Date object.");var t=Bt(this);return t<0&&Xt(this)>11?t+1:t},getMonth:function(){if(!this||!(this instanceof Date))throw new TypeError("this is not a Date object.");var t=Bt(this),r=Xt(this);return t<0&&r>11?0:r},getDate:function(){if(!this||!(this instanceof Date))throw new TypeError("this is not a Date object.");var t=Bt(this),r=Xt(this),e=Lt(this);if(t<0&&r>11){if(r===12)return e;var n=ar(0,t+1);return n-e+1}return e},getUTCFullYear:function(){if(!this||!(this instanceof Date))throw new TypeError("this is not a Date object.");var t=qt(this);return t<0&&Kt(this)>11?t+1:t},getUTCMonth:function(){if(!this||!(this instanceof Date))throw new TypeError("this is not a Date object.");var t=qt(this),r=Kt(this);return t<0&&r>11?0:r},getUTCDate:function(){if(!this||!(this instanceof Date))throw new TypeError("this is not a Date object.");var t=qt(this),r=Kt(this),e=Qt(this);if(t<0&&r>11){if(r===12)return e;var n=ar(0,t+1);return n-e+1}return e}},Jt);P(Date.prototype,{toUTCString:function(){if(!this||!(this instanceof Date))throw new TypeError("this is not a Date object.");var t=Vt(this),r=Qt(this),e=Kt(this),n=qt(this),i=_t(this),a=tr(this),o=rr(this);return nr[t]+", "+(r<10?"0"+r:r)+" "+ir[e]+" "+n+" "+(i<10?"0"+i:i)+":"+(a<10?"0"+a:a)+":"+(o<10?"0"+o:o)+" GMT"}},Jt||zt);P(Date.prototype,{toDateString:function(){if(!this||!(this instanceof Date))throw new TypeError("this is not a Date object.");var t=this.getDay(),r=this.getDate(),e=this.getMonth(),n=this.getFullYear();return nr[t]+" "+ir[e]+" "+(r<10?"0"+r:r)+" "+n}},Jt||Gt);(Jt||Ht)&&(Date.prototype.toString=function(){if(!this||!(this instanceof Date))throw new TypeError("this is not a Date object.");var t=this.getDay(),r=this.getDate(),e=this.getMonth(),n=this.getFullYear(),i=this.getHours(),a=this.getMinutes(),o=this.getSeconds(),f=this.getTimezoneOffset(),u=Math.floor(Math.abs(f)/60),l=Math.floor(Math.abs(f)%60);return nr[t]+" "+ir[e]+" "+(r<10?"0"+r:r)+" "+n+" "+(i<10?"0"+i:i)+":"+(a<10?"0"+a:a)+":"+(o<10?"0"+o:o)+" GMT"+(f>0?"-":"+")+(u<10?"0"+u:u)+(l<10?"0"+l:l)},R&&e.defineProperty(Date.prototype,"toString",{configurable:!0,enumerable:!1,writable:!0}));var or=-621987552e5,fr="-000001",ur=Date.prototype.toISOString&&new Date(or).toISOString().indexOf(fr)===-1,lr=Date.prototype.toISOString&&new Date(-1).toISOString()!=="1969-12-31T23:59:59.999Z",sr=d.bind(Date.prototype.getTime);P(Date.prototype,{toISOString:function(){if(!isFinite(this)||!isFinite(sr(this)))throw new RangeError("Date.prototype.toISOString called on non-finite value.");var t=qt(this),r=Kt(this);t+=Math.floor(r/12);r=(r%12+12)%12;var e=[r+1,Qt(this),_t(this),tr(this),rr(this)];t=(t<0?"-":t>9999?"+":"")+K("00000"+Math.abs(t),0<=t&&t<=9999?-4:-6);for(var n=0;n<e.length;++n)e[n]=K("00"+e[n],-2);return t+"-"+W(e,0,2).join("-")+"T"+W(e,2).join(":")+"."+K("000"+er(this),-3)+"Z"}},ur||lr);var cr=function(){try{return Date.prototype.toJSON&&new Date(NaN).toJSON()===null&&new Date(or).toJSON().indexOf(fr)!==-1&&Date.prototype.toJSON.call({toISOString:function(){return!0}})}catch(t){return!1}}();cr||(Date.prototype.toJSON=function(){var r=e(this),n=Z.ToPrimitive(r);if(typeof n=="number"&&!isFinite(n))return null;var i=r.toISOString;if(!D(i))throw new TypeError("toISOString property is not callable");return i.call(r)});var vr=Date.parse("+033658-09-27T01:46:40.000Z")===1e15,hr=!isNaN(Date.parse("2012-04-04T24:00:00.500Z"))||!isNaN(Date.parse("2012-11-31T23:59:59.000Z"))||!isNaN(Date.parse("2012-12-31T23:59:60.000Z")),pr=isNaN(Date.parse("2000-01-01T00:00:00.000Z"));if(pr||hr||!vr){var yr=Math.pow(2,31)-1,dr=Y(new Date(1970,0,1,0,0,0,yr+1).getTime());Date=function(t){var r=function(e,n,i,a,f,u,l){var s=arguments.length,c;if(this instanceof t){var v=u,h=l;if(dr&&s>=7&&l>yr){var p=Math.floor(l/yr)*yr,y=Math.floor(p/1e3);v+=y;h-=y*1e3}c=s===1&&o(e)===e?new t(r.parse(e)):s>=7?new t(e,n,i,a,f,v,h):s>=6?new t(e,n,i,a,f,v):s>=5?new t(e,n,i,a,f):s>=4?new t(e,n,i,a):s>=3?new t(e,n,i):s>=2?new t(e,n):s>=1?new t(e instanceof t?+e:e):new t}else c=t.apply(this,arguments);return J(c)||P(c,{constructor:r},!0),c},e=new RegExp("^(\\d{4}|[+-]\\d{6})(?:-(\\d{2})(?:-(\\d{2})(?:T(\\d{2}):(\\d{2})(?::(\\d{2})(?:(\\.\\d{1,}))?)?(Z|(?:([-+])(\\d{2}):(\\d{2})))?)?)?)?$"),n=[0,31,59,90,120,151,181,212,243,273,304,334,365],i=function(t,r){var e=r>1?1:0;return n[r]+Math.floor((t-1969+e)/4)-Math.floor((t-1901+e)/100)+Math.floor((t-1601+e)/400)+365*(t-1970)},a=function(r){var e=0,n=r;if(dr&&n>yr){var i=Math.floor(n/yr)*yr,a=Math.floor(i/1e3);e+=a;n-=a*1e3}return u(new t(1970,0,1,0,0,e,n))};for(var f in t)G(t,f)&&(r[f]=t[f]);P(r,{now:t.now,UTC:t.UTC},!0);r.prototype=t.prototype;P(r.prototype,{constructor:r},!0);var l=function(r){var n=e.exec(r);if(n){var o=u(n[1]),f=u(n[2]||1)-1,l=u(n[3]||1)-1,s=u(n[4]||0),c=u(n[5]||0),v=u(n[6]||0),h=Math.floor(u(n[7]||0)*1e3),p=Boolean(n[4]&&!n[8]),y=n[9]==="-"?1:-1,d=u(n[10]||0),g=u(n[11]||0),w,b=c>0||v>0||h>0;return s<(b?24:25)&&c<60&&v<60&&h<1e3&&f>-1&&f<12&&d<24&&g<60&&l>-1&&l<i(o,f+1)-i(o,f)&&(w=((i(o,f)+l)*24+s+d*y)*60,w=((w+c+g*y)*60+v)*1e3+h,p&&(w=a(w)),-864e13<=w&&w<=864e13)?w:NaN}return t.parse.apply(this,arguments)};return P(r,{parse:l}),r}(Date)}Date.now||(Date.now=function(){return(new Date).getTime()});var gr=l.toFixed&&(8e-5.toFixed(3)!=="0.000"||.9.toFixed(0)!=="1"||1.255.toFixed(2)!=="1.25"||1000000000000000128..toFixed(0)!=="1000000000000000128"),wr={base:1e7,size:6,data:[0,0,0,0,0,0],multiply:function(t,r){for(var e=-1,n=r;++e<wr.size;)n+=t*wr.data[e],wr.data[e]=n%wr.base,n=Math.floor(n/wr.base)},divide:function(t){for(var r=wr.size,e=0;--r>=0;)e+=wr.data[r],wr.data[r]=Math.floor(e/t),e=e%t*wr.base},numToString:function(){for(var t=wr.size,r="";--t>=0;)if(r!==""||t===0||wr.data[t]!==0){var e=o(wr.data[t]);r===""?r=e:r+=K("0000000",0,7-e.length)+e}return r},pow:function pow(t,r,e){return r===0?e:r%2==1?pow(t,r-1,e*t):pow(t*t,r/2,e)},log:function(t){for(var r=0,e=t;e>=4096;)r+=12,e/=4096;while(e>=2)r+=1,e/=2;return r}},br=function(t){var r,e,n,i,a,f,l,s;if(r=u(t),r=Y(r)?0:Math.floor(r),r<0||r>20)throw new RangeError("Number.toFixed called with invalid number of decimals");if(e=u(this),Y(e))return"NaN";if(e<=-1e21||e>=1e21)return o(e);if(n="",e<0&&(n="-",e=-e),i="0",e>1e-21)if(a=wr.log(e*wr.pow(2,69,1))-69,f=a<0?e*wr.pow(2,-a,1):e/wr.pow(2,a,1),f*=4503599627370496,a=52-a,a>0){for(wr.multiply(0,f),l=r;l>=7;)wr.multiply(1e7,0),l-=7;for(wr.multiply(wr.pow(10,l,1),0),l=a-1;l>=23;)wr.divide(8388608),l-=23;wr.divide(1<<l);wr.multiply(1,1);wr.divide(2);i=wr.numToString()}else wr.multiply(0,f),wr.multiply(1<<-a,0),i=wr.numToString()+K("0.00000000000000000000",2,2+r);return r>0?(s=i.length,i=s<=r?n+K("0.0000000000000000000",0,r-s+2)+i:n+K(i,0,s-r)+"."+K(i,s-r)):i=n+i,i};P(l,{toFixed:br},gr);var Tr=function(){try{return 1..toPrecision(undefined)==="1"}catch(t){return!0}}(),mr=l.toPrecision;P(l,{toPrecision:function(t){return typeof t=="undefined"?mr.call(this):mr.call(this,t)}},Tr);"ab".split(/(?:ab)*/).length!==2||".".split(/(.?)(.?)/).length!==4||"tesst".split(/(s)*/)[1]==="t"||"test".split(/(?:)/,-1).length!==4||"".split(/.?/).length||".".split(/()()/).length>1?function(){var t=typeof/()??/.exec("")[1]=="undefined",r=Math.pow(2,32)-1;f.split=function(e,n){var i=String(this);if(typeof e=="undefined"&&n===0)return[];if(!M(e))return Q(this,e,n);var a=[],o=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),f=0,u,l,s,c,h=new RegExp(e.source,o+"g");t||(u=new RegExp("^"+h.source+"$(?!\\s)",o));var p=typeof n=="undefined"?r:Z.ToUint32(n);for(l=h.exec(i);l;){if(s=l.index+l[0].length,s>f&&(_(a,K(i,f,l.index)),!t&&l.length>1&&l[0].replace(u,function(){for(var t=1;t<arguments.length-2;t++)typeof arguments[t]=="undefined"&&(l[t]=void 0)}),l.length>1&&l.index<i.length&&v.apply(a,W(l,1)),c=l[0].length,f=s,a.length>=p))break;h.lastIndex===l.index&&h.lastIndex++;l=h.exec(i)}return f===i.length?(c||!h.test(""))&&_(a,""):_(a,K(i,f)),a.length>p?W(a,0,p):a}}():"0".split(void 0,0).length&&(f.split=function(t,r){return typeof t=="undefined"&&r===0?[]:Q(this,t,r)});var Dr=f.replace,Sr=function(){var t=[];return"x".replace(/x(.)?/g,function(r,e){_(t,e)}),t.length===1&&typeof t[0]=="undefined"}();Sr||(f.replace=function(t,r){var e=D(r),n=M(t)&&/\)[*?]/.test(t.source);if(e&&n){var i=function(e){var n=arguments.length,i=t.lastIndex;t.lastIndex=0;var a=t.exec(e)||[];return t.lastIndex=i,_(a,arguments[n-2],arguments[n-1]),r.apply(this,a)};return Dr.call(this,t,i)}return Dr.call(this,t,r)});var xr=f.substr,Or="".substr&&"0b".substr(-1)!=="b";P(f,{substr:function(t,r){var e=t;return t<0&&(e=w(this.length+t,0)),xr.call(this,e,r)}},Or);var Er="\t\n\x0b\f\r   ᠎             　\u2028\u2029﻿",Ir="["+Er+"]",Mr=new RegExp("^"+Ir+Ir+"*"),Ur=new RegExp(Ir+Ir+"*$"),Fr=f.trim&&(Er.trim()||!"​".trim());P(f,{trim:function(){if(typeof this=="undefined"||this===null)throw new TypeError("can't convert "+this+" to object");return o(this).replace(Mr,"").replace(Ur,"")}},Fr);var $r=d.bind(String.prototype.trim),Nr=f.lastIndexOf&&"abcあい".lastIndexOf("あい",2)!==-1;P(f,{lastIndexOf:function(t){if(typeof this=="undefined"||this===null)throw new TypeError("can't convert "+this+" to object");for(var r=o(this),e=o(t),n=arguments.length>1?u(arguments[1]):NaN,i=Y(n)?Infinity:Z.ToInteger(n),a=b(w(i,0),r.length),f=e.length,l=a+f;l>0;){l=w(0,l-f);var s=V(K(r,l,a+f),e);if(s!==-1)return l+s}return-1}},Nr);var Cr=f.lastIndexOf;if(P(f,{lastIndexOf:function(){return Cr.apply(this,arguments)}},f.lastIndexOf.length!==1),(parseInt(Er+"08")!==8||parseInt(Er+"0x16")!==22)&&(parseInt=function(t){var r=/^[-+]?0[xX]/;return function(e,n){typeof e=="symbol"&&""+e;var i=$r(String(e)),a=u(n)||(r.test(i)?16:10);return t(i,a)}}(parseInt)),1/parseFloat("-0")!=-Infinity&&(parseFloat=function(t){return function(r){var e=$r(String(r)),n=t(e);return n===0&&K(e,0,1)==="-"?-0:n}}(parseFloat)),String(new RangeError("test"))!=="RangeError: test"){var kr=function(){if(typeof this=="undefined"||this===null)throw new TypeError("can't convert "+this+" to object");var t=this.name;typeof t=="undefined"?t="Error":typeof t!="string"&&(t=o(t));var r=this.message;return(typeof r=="undefined"?r="":typeof r!="string"&&(r=o(r)),!t)?r:r?t+": "+r:t};Error.prototype.toString=kr}if(R){var Ar=function(t,r){if(tt(t,r)){var e=Object.getOwnPropertyDescriptor(t,r);e.configurable&&(e.enumerable=!1,Object.defineProperty(t,r,e))}};Ar(Error.prototype,"message");Error.prototype.message!==""&&(Error.prototype.message="");Ar(Error.prototype,"name")}if(String(/a/gim)!=="/a/gim"){var Rr=function(){var t="/"+this.source+"/";return this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),t};RegExp.prototype.toString=Rr}});!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.ES6Promise=e()}(this,function(){"use strict";function t(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function e(t){return"function"==typeof t}function n(t){B=t}function r(t){G=t}function o(){return function(){return process.nextTick(a)}}function i(){return"undefined"!=typeof z?function(){z(a)}:c()}function s(){var t=0,e=new J(a),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function u(){var t=new MessageChannel;return t.port1.onmessage=a,function(){return t.port2.postMessage(0)}}function c(){var t=setTimeout;return function(){return t(a,1)}}function a(){for(var t=0;t<W;t+=2){var e=V[t],n=V[t+1];e(n);V[t]=void 0;V[t+1]=void 0}W=0}function f(){try{var t=Function("return this")().require("vertx");return z=t.runOnLoop||t.runOnContext,i()}catch(e){return c()}}function l(t,e){var n=this,r=new this.constructor(p);void 0===r[Z]&&O(r);var o=n._state;if(o){var i=arguments[o-1];G(function(){return P(o,r,i,n._result)})}else E(n,r,t,e);return r}function h(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(p);return g(n,t),n}function p(){}function v(){return new TypeError("You cannot resolve a promise with itself")}function d(){return new TypeError("A promises callback cannot return that same promise.")}function _(t){try{return t.then}catch(e){return nt.error=e,nt}}function y(t,e,n,r){try{t.call(e,n,r)}catch(o){return o}}function m(t,e,n){G(function(t){var r=!1,o=y(n,e,function(n){r||(r=!0,e!==n?g(t,n):S(t,n))},function(e){r||(r=!0,j(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&o&&(r=!0,j(t,o))},t)}function b(t,e){e._state===tt?S(t,e._result):e._state===et?j(t,e._result):E(e,void 0,function(e){return g(t,e)},function(e){return j(t,e)})}function w(t,n,r){n.constructor===t.constructor&&r===l&&n.constructor.resolve===h?b(t,n):r===nt?(j(t,nt.error),nt.error=null):void 0===r?S(t,n):e(r)?m(t,n,r):S(t,n)}function g(e,n){e===n?j(e,v()):t(n)?w(e,n,_(n)):S(e,n)}function A(t){t._onerror&&t._onerror(t._result);T(t)}function S(t,e){t._state===$&&(t._result=e,t._state=tt,0!==t._subscribers.length&&G(T,t))}function j(t,e){t._state===$&&(t._state=et,t._result=e,G(A,t))}function E(t,e,n,r){var o=t._subscribers,i=o.length;t._onerror=null;o[i]=e;o[i+tt]=n;o[i+et]=r;0===i&&t._state&&G(T,t)}function T(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,o=void 0,i=t._result,s=0;s<e.length;s+=3)r=e[s],o=e[s+n],r?P(n,r,o,i):o(i);t._subscribers.length=0}}function M(t,e){try{return t(e)}catch(n){return nt.error=n,nt}}function P(t,n,r,o){var i=e(r),s=void 0,u=void 0,c=void 0,a=void 0;if(i){if(s=M(r,o),s===nt?(a=!0,u=s.error,s.error=null):c=!0,n===s)return void j(n,d())}else s=o,c=!0;n._state!==$||(i&&c?g(n,s):a?j(n,u):t===tt?S(n,s):t===et&&j(n,s))}function x(t,e){try{e(function(e){g(t,e)},function(e){j(t,e)})}catch(n){j(t,n)}}function C(){return rt++}function O(t){t[Z]=rt++;t._state=void 0;t._result=void 0;t._subscribers=[]}function k(){return new Error("Array Methods must be provided an Array")}function F(t){return new ot(this,t).promise}function Y(t){var e=this;return new e(U(t)?function(n,r){for(var o=t.length,i=0;i<o;i++)e.resolve(t[i]).then(n,r)}:function(t,e){return e(new TypeError("You must pass an array to race."))})}function q(t){var e=this,n=new e(p);return j(n,t),n}function D(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");}function K(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");}function L(){var t=void 0;if("undefined"!=typeof global)t=global;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment");}var n=t.Promise;if(n){var r=null;try{r=Object.prototype.toString.call(n.resolve())}catch(e){}if("[object Promise]"===r&&!n.cast)return}t.Promise=it}var N=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var U=N,W=0,z=void 0,B=void 0,G=function(t,e){V[W]=t;V[W+1]=e;W+=2;2===W&&(B?B(a):X())},H="undefined"!=typeof window?window:void 0,I=H||{},J=I.MutationObserver||I.WebKitMutationObserver,Q="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),R="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,V=new Array(1e3),X=Q?o():J?s():R?u():void 0===H&&"function"==typeof require?f():c();var Z=Math.random().toString(36).substring(2),$=void 0,tt=1,et=2,nt={error:null},rt=0,ot=function(){function t(t,e){this._instanceConstructor=t;this.promise=new t(p);this.promise[Z]||O(this.promise);U(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?S(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&S(this.promise,this._result))):j(this.promise,k())}return t.prototype._enumerate=function(t){for(var e=0;this._state===$&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===h){var o=_(t);if(o===l&&t._state!==$)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(n===it){var i=new n(p);w(i,t,o);this._willSettleAt(i,e)}else this._willSettleAt(new n(function(e){return e(t)}),e)}else this._willSettleAt(r(t),e)},t.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===$&&(this._remaining--,t===et?j(r,n):this._result[e]=n);0===this._remaining&&S(r,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;E(t,void 0,function(t){return n._settledAt(tt,e,t)},function(t){return n._settledAt(et,e,t)})},t}(),it=function(){function t(e){this[Z]=C();this._result=this._state=void 0;this._subscribers=[];p!==e&&("function"!=typeof e&&D(),this instanceof t?x(this,e):K())}return t.prototype["catch"]=function(t){return this.then(null,t)},t.prototype["finally"]=function(t){var n=this,r=n.constructor;return e(t)?n.then(function(e){return r.resolve(t()).then(function(){return e})},function(e){return r.resolve(t()).then(function(){throw e;})}):n.then(t,t)},t}();return it.prototype.then=l,it.all=F,it.race=Y,it.resolve=h,it.reject=q,it._setScheduler=n,it._setAsap=r,it._asap=G,it.polyfill=L,it.Promise=it,it});
/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice};S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a};S.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e);},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){for(var t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:y});"function"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]);S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,S="sizzle"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),D=function(e,t){return e===t&&(l=!0),0},j={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",B=new RegExp(M+"+","g"),$=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes);t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){for((f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;o--;)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t);t=null}}function fe(e,t){for(var n=e.split("|"),r=n.length;r--;)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){for(var n,r=a([],e.length,o),i=r.length;i--;)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="<a id='"+S+"'><\/a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''><\/option><\/select>";e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")");e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")");e.querySelectorAll("[id~="+S+"-]").length||v.push("~=");(t=C.createElement("input")).setAttribute("name","");e.appendChild(t);e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")");e.querySelectorAll(":checked").length||v.push(":checked");e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]");e.querySelectorAll("\\\f");v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'><\/a><select disabled='disabled'><option/><\/select>";var t=C.createElement("input");t.setAttribute("type","hidden");e.appendChild(t).setAttribute("name","D");e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?=");2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled");a.appendChild(e).disabled=!0;2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled");e.querySelectorAll("*,:x");v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*");c.call(e,"[s!='']:x");s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!=C&&T(e),y(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&j.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e);},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(D),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(B," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,v){var y="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===v?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=y!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(y){while(l){for(a=e;a=a[l];)if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){for(d=(s=(r=(i=(o=(a=c)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1])&&r[2],a=s&&c.childNodes[s];a=++s&&a&&a[l]||(d=s=0)||u.pop();)if(1===a.nodeType&&++d&&a===e){i[h]=[k,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[k,d]),a===e))break;return(d-=v)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){for(var n,r=a(e,o),i=r.length;i--;)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace($,"$1"));return s[S]?le(function(e,t,n,r){for(var i,o=s(e,null,r,[]),a=e.length;a--;)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-");while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[k,p];if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[S]||(e[S]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===k&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){for(var r=i.length;r--;)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,v,y,e){return v&&!v[S]&&(v=Ce(v)),y&&!y[S]&&(y=Ce(y,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?y||(e?d:l||v)?[]:t:f;if(g&&g(f,p,n,r),v)for(i=Te(p,u),v(i,[],n,r),o=i.length;o--;)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a));if(e){if(y||d){if(y){for(i=[],o=p.length;o--;)(a=p[o])&&i.push(f[o]=a);y(null,p=[],i,r)}for(o=p.length;o--;)(a=p[o])&&-1<(i=y?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),y?y(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace($,"$1"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+" "];if(l)return t?0:l.slice(0);for(a=e,s=[],u=b.preFilter;a;){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace($," ")}),a=a.slice(n.length)),b.filter)(r=G[o].exec(a))&&(!u[o]||(r=u[o](r)))&&(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,v,y,m,x,r,i=[],o=[],a=A[e+" "];if(!a){for(t||(t=h(e)),n=t.length;n--;)(a=Ee(t[n]))[S]?i.push(a):o.push(a);(a=A(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=k+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){for(a=0,t||o.ownerDocument==C||(T(o),n=!E);s=v[a++];)if(s(o,t||C,n)){r.push(o);break}i&&(k=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){for(a=0;s=y[a++];)s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f);i&&!e&&0<f.length&&1<u+y.length&&se.uniqueSort(r)}return i&&(k=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode);e=e.slice(o.shift().value.length)}for(i=G.needsContext.test(e)?0:o.length;i--;){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},d.sortStable=S.split("").sort(D).join("")===S,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'><\/a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);S.find=d;S.expr=d.selectors;S.expr[":"]=S.expr.pseudos;S.uniqueSort=S.unique=d.uniqueSort;S.text=d.getText;S.isXMLDoc=d.isXML;S.contains=d.contains;S.escapeSelector=d.escape;var h=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},T=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=S.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1<i.call(n,e)!==r}):S.filter(n,e,r)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))};S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return 1<r?S.uniqueSort(n):n},filter:function(e){return this.pushStack(D(this,e||[],!1))},not:function(e){return this.pushStack(D(this,e||[],!0))},is:function(e){return!!D(this,"string"==typeof e&&k.test(e)?S(e):e||[],!1).length}});var j,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn;j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&S(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(S(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t,n){return h(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return h(e,"nextSibling")},prevAll:function(e){return h(e,"previousSibling")},nextUntil:function(e,t,n){return h(e,"nextSibling",n)},prevUntil:function(e,t,n){return h(e,"previousSibling",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(r,i){S.fn[r]=function(e,t){var n=S.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=S.filter(t,n)),1<this.length&&(H[r]||S.uniqueSort(n),L.test(r)&&n.reverse()),this.pushStack(n)}});var P=/[^\x20\t\r\n\f]+/g;function R(e){return e}function M(e){throw e;}function I(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},S.each(e.match(P)||[],function(e,t){n[t]=!0}),n):S.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1)for(t=u.shift();++l<s.length;)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1);r.memory||(t=!1);i=!1;a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){S.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return S.each(arguments,function(e,t){for(var n;-1<(n=S.inArray(t,s,n));)s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<S.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f};S.extend({Deferred:function(e){var o=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return S.Deferred(function(r){S.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})});i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then;m(t)?s?t.call(e,l(u,o,R,s),l(u,o,M,s)):(u++,t.call(e,l(u,o,R,s),l(u,o,M,s),l(u,o,R,o.notifyWith))):(a!==R&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,t.stackTrace);u<=i+1&&(a!==M&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(S.Deferred.getStackHook&&(t.stackTrace=S.Deferred.getStackHook()),C.setTimeout(t))}}return S.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:R,e.notifyWith));o[1][3].add(l(0,e,m(t)?t:R));o[2][3].add(l(0,e,m(n)?n:M))}).promise()},promise:function(e){return null!=e?S.extend(e,a):a}},s={};return S.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add;r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock);n.add(t[3].fire);s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this};s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=S.Deferred(),a=function(t){return function(e){r[t]=this;i[t]=1<arguments.length?s.call(arguments):e;--n||o.resolveWith(r,i)}};if(n<=1&&(I(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)I(i[t],a(t),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&W.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)};S.readyException=function(e){C.setTimeout(function(){throw e;})};var F=S.Deferred();function B(){E.removeEventListener("DOMContentLoaded",B);C.removeEventListener("load",B);S.ready()}S.fn.ready=function(e){return F.then(e)["catch"](function(e){S.readyException(e)}),this};S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0)!==e&&0<--S.readyWait||F.resolveWith(E,[S])}});S.ready.then=F.then;"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(S.ready):(E.addEventListener("DOMContentLoaded",B),C.addEventListener("load",B));var $=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===w(n))for(s in i=!0,n)$(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(S(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function X(e){return e.replace(_,"ms-").replace(z,U)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=S.expando+G.uid++}G.uid=1;G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[X(t)]=n;else for(r in t)i[X(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t)for(n=(t=Array.isArray(t)?t.map(X):(t=X(t))in r?[t]:t.match(P)||[]).length;n--;)delete r[t[n]];(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Z(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(K,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:J.test(i)?JSON.parse(i):i)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}});S.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){for(t=a.length;t--;)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=X(r.slice(5)),Z(o,r,i[r]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){Q.set(this,n)}):$(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=Q.get(o,n))?t:void 0!==(t=Z(o,n))?t:void 0;this.each(function(){Q.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}});S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--);i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){S.dequeue(e,t)},o));!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:S.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}});S.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?S.queue(this[0],t):void 0===n?this:this.each(function(){var e=S.queue(this,t,n);S._queueHooks(this,t);"fx"===t&&"inprogress"!==e[0]&&S.dequeue(this,t)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=S.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=Y.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=E.documentElement,ie=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ie(e)&&"none"===S.css(e,"display")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,"")},u=s(),l=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==l&&+u)&&te.exec(S.css(e,t));if(c&&c[3]!==l){for(u/=2,l=l||c[3],c=+u||1;a--;)S.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2;S.style(e,t,c+l);n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ue={};function le(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Y.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ae(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ue[s])||(o=a.body.appendChild(a.createElement(s)),u=S.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ue[s]=u)))):"none"!==n&&(l[c]="none",Y.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}S.fn.extend({show:function(){return le(this,!0)},hide:function(){return le(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?S(this).show():S(this).hide()})}});var ce,fe,pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div"));(fe=E.createElement("input")).setAttribute("type","radio");fe.setAttribute("checked","checked");fe.setAttribute("name","t");ce.appendChild(fe);y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked;ce.innerHTML="<textarea>x<\/textarea>";y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue;ce.innerHTML="<option><\/option>";y.option=!!ce.lastChild;var ge={thead:[1,"<table>","<\/table>"],col:[2,"<table><colgroup>","<\/colgroup><\/table>"],tr:[2,"<table><tbody>","<\/tbody><\/table>"],td:[3,"<table><tbody><tr>","<\/tr><\/tbody><\/table>"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead;ge.th=ge.td;y.option||(ge.optgroup=ge.option=[1,"<select multiple='multiple'>","<\/select>"]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))S.merge(p,o.nodeType?[o]:o);else if(me.test(o)){for(a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],c=u[0];c--;)a=a.lastChild;S.merge(p,a.childNodes);(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));for(f.textContent="",d=0;o=p[d++];)if(r&&-1<S.inArray(o,r))i&&i.push(o);else if(l=ie(o),a=ve(f.appendChild(o),"script"),l&&ye(a),n)for(c=0;o=a[c++];)he.test(o.type||"")&&n.push(o);return f}var be=/^key/,we=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Te=/^([^.]*)(?:\.(.+)|)/;function Ce(){return!0}function Ee(){return!1}function Se(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function ke(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)ke(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Ee;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,r,n)})}function Ae(e,i,o){o?(Y.set(e,i,!1),S.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Y.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(S.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Y.set(this,i,r),t=o(this,i),this[i](),r!==(n=Y.get(this,i))||t?Y.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Y.set(this,i,{value:S.event.trigger(S.extend(r[0],S.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,i)&&S.event.add(e,i,Ce)}S.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.get(t);if(V(t))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(re,i),n.guid||(n.guid=S.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){if("undefined"!=typeof S&&S.event.triggered!==e.type)return S.event.dispatch.apply(t,arguments)}),l=(e=(e||"").match(P)||[""]).length;l--;)d=g=(s=Te.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=S.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=S.event.special[d]||{},c=S.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[d]=!0)},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.hasData(e)&&Y.get(e);if(v&&(u=v.events)){for(l=(t=(t||"").match(P)||[""]).length;l--;)if(d=g=(s=Te.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){for(f=S.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||S.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)S.event.remove(e,d+t[l],n,r,!0);S.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=S.event.fix(e),l=(Y.get(this,"events")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){for(a=S.event.handlers.call(this,u,l),t=0;(i=a[t++])&&!u.isPropagationStopped();)for(u.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!u.isImmediatePropagationStopped();)u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<S(i,this).index(l):S.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Ae(t,"click",Ce),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Ae(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Y.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}};S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)};S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ce:Ee,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e;t&&S.extend(this,t);this.timeStamp=e&&e.timeStamp||Date.now();this[S.expando]=!0};S.Event.prototype={constructor:S.Event,isDefaultPrevented:Ee,isPropagationStopped:Ee,isImmediatePropagationStopped:Ee,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ce;e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ce;e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ce;e&&!this.isSimulated&&e.stopImmediatePropagation();this.stopPropagation()}};S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&be.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&we.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},S.event.addProp);S.each({focus:"focusin",blur:"focusout"},function(e,t){S.event.special[e]={setup:function(){return Ae(this,e,Se),!1},trigger:function(){return Ae(this,e),!0},delegateType:t}});S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){S.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||S.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}});S.fn.extend({on:function(e,t,n,r){return ke(this,e,t,n,r)},one:function(e,t,n,r){return ke(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Ee),this.each(function(){S.event.remove(this,e,n,t)})}});var Ne=/<script|<style|<link/i,De=/checked\s*(?:[^=]|=\s*.checked.)/i,je=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)S.event.add(t,i,s[i][n]);Q.hasData(e)&&(o=Q.access(e),a=S.extend({},o),Q.set(t,a))}}function Pe(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!y.checkClone&&De.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html()));Pe(t,r,i,o)});if(f&&(t=(e=xe(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=S.map(ve(e,"script"),Le)).length;c<f;c++)u=e,c!==p&&(u=S.clone(u,!0,!0),s&&S.merge(a,ve(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,S.map(a,He),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Y.access(u,"globalEval")&&S.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):b(u.textContent.replace(je,""),u,l))}return n}function Re(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(ve(r)),r.parentNode&&(n&&ie(r)&&ye(ve(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=ie(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ve(e),a=a||ve(c),r=0,i=o.length;r<i;r++)Oe(o[r],a[r]);else Oe(e,c);return 0<(a=ve(c,"script")).length&&ye(a,!f&&ve(e,"script")),c},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}});S.fn.extend({detach:function(e){return Re(this,e,!0)},remove:function(e){return Re(this,e)},text:function(e){return $(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Pe(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||qe(this,e).appendChild(e)})},prepend:function(){return Pe(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=qe(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return $(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ne.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return Pe(this,arguments,function(e){var t=this.parentNode;S.inArray(this,n)<0&&(S.cleanData(ve(this)),t&&t.replaceChild(e,this))},n)}});S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){S.fn[e]=function(e){for(var t,n=[],r=S(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),S(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var Me=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Ie=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},We=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Fe=new RegExp(ne.join("|"),"i");function Be(e,t,n){var r,i,o,a,s=e.style;return(n=n||Ie(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||ie(e)||(a=S.style(e,t)),!y.pixelBoxStyles()&&Me.test(a)&&Fe.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function $e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0";l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%";re.appendChild(u).appendChild(l);var e=C.getComputedStyle(l);n="1%"!==e.top;s=12===t(e.marginLeft);l.style.right="60%";o=36===t(e.right);r=36===t(e.width);l.style.position="absolute";i=12===t(l.offsetWidth/3);re.removeChild(u);l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=E.createElement("div"),l=E.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===l.style.backgroundClip,S.extend(y,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=E.createElement("table"),t=E.createElement("tr"),n=E.createElement("div"),e.style.cssText="position:absolute;left:-11111px",t.style.height="1px",n.style.height="9px",re.appendChild(e).appendChild(t).appendChild(n),r=C.getComputedStyle(t),a=3<parseInt(r.height),re.removeChild(e)),a}}))}();var _e=["Webkit","Moz","ms"],ze=E.createElement("div").style,Ue={};function Xe(e){var t=S.cssProps[e]||Ue[e];return t||(e in ze?e:Ue[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=_e.length;n--;)if((e=_e[n]+t)in ze)return e}(e)||e)}var Ve=/^(none|table(?!-c[ea]).+)/,Ge=/^--/,Ye={position:"absolute",visibility:"hidden",display:"block"},Qe={letterSpacing:"0",fontWeight:"400"};function Je(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ke(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=S.css(e,n+ne[a],!0,i)),r?("content"===n&&(u-=S.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(u-=S.css(e,"border"+ne[a]+"Width",!0,i))):(u+=S.css(e,"padding"+ne[a],!0,i),"padding"!==n?u+=S.css(e,"border"+ne[a]+"Width",!0,i):s+=S.css(e,"border"+ne[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function Ze(e,t,n){var r=Ie(e),i=(!y.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,a=Be(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Me.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&i||!y.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Ke(e,t,n||(i?"border":"content"),o,r,a)+"px"}function et(e,t,n,r,i){return new et.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Be(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),u=Ge.test(t),l=e.style;if(u||(t=Xe(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"==(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o="number");null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=X(t);return Ge.test(t)||(t=Xe(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Be(e,t,r)),"normal"===i&&t in Qe&&(i=Qe[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}});S.each(["height","width"],function(e,u){S.cssHooks[u]={get:function(e,t,n){if(t)return!Ve.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Ze(e,u,n):We(e,Ye,function(){return Ze(e,u,n)})},set:function(e,t,n){var r,i=Ie(e),o=!y.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===S.css(e,"boxSizing",!1,i),s=n?Ke(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-Ke(e,u,"border",!1,i)-.5)),s&&(r=te.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=S.css(e,u)),Je(0,t,s)}}});S.cssHooks.marginLeft=$e(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Be(e,"marginLeft"))||e.getBoundingClientRect().left-We(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"});S.each({margin:"",padding:"",border:"Width"},function(i,o){S.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+ne[t]+o]=r[t]||r[t-2]||r[0];return n}};"margin"!==i&&(S.cssHooks[i+o].set=Je)});S.fn.extend({css:function(e,t){return $(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Ie(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,1<arguments.length)}});((S.Tween=et).prototype={constructor:et,init:function(e,t,n,r,i,o){this.elem=e;this.prop=n;this.easing=i||S.easing._default;this.options=t;this.start=this.now=this.cur();this.end=r;this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var e=et.propHooks[this.prop];return e&&e.get?e.get(this):et.propHooks._default.get(this)},run:function(e){var t,n=et.propHooks[this.prop];return this.pos=this.options.duration?t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):et.propHooks._default.set(this),this}}).init.prototype=et.prototype;(et.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[Xe(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=et.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}};S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"};S.fx=et.prototype.init;S.fx.step={};var tt,nt,rt,it,ot=/^(?:toggle|show|hide)$/,at=/queueHooks$/;function st(){nt&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(st):C.setTimeout(st,S.fx.interval),S.fx.tick())}function ut(){return C.setTimeout(function(){tt=void 0}),tt=Date.now()}function lt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ct(e,t,n){for(var r,i=(ft.tweeners[t]||[]).concat(ft.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ft(o,e,t){var n,a,r=0,i=ft.prefilters.length,s=S.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=tt||ut(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},t),originalProperties:e,originalOptions:t,startTime:tt||ut(),duration:t.duration,tweens:[],createTween:function(e,t){var n=S.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=X(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=S.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=ft.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return S.map(c,ct,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(ft,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],ft.tweeners[n]=ft.tweeners[n]||[],ft.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),v=Y.get(e,"fxshow");for(r in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--;S.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],ot.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||S.style(e,r)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Y.get(e,"display")),"none"===(c=S.css(e,"display"))&&(l?c=l:(le([e],!0),l=e.style.display||l,c=S.css(e,"display"),le([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===S.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0];h.overflowX=n.overflow[1];h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=Y.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&le([e],!0),p.done(function(){for(r in g||le([e]),Y.remove(e,"fxshow"),d)S.style(e,r,d[r])})),u=ct(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?ft.prefilters.unshift(e):ft.prefilters.push(e)}});S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration=r.duration in S.fx.speeds?S.fx.speeds[r.duration]:S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this);r.queue&&S.dequeue(this,r.queue)},r};S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=S.isEmptyObject(t),o=S.speed(e,n,r),a=function(){var e=ft(this,S.extend({},t),o);(i||Y.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop;t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=S.timers,r=Y.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&at.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||S.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Y.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=S.timers,o=n?n.length:0;for(t.finish=!0,S.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}});S.each(["toggle","show","hide"],function(e,r){var i=S.fn[r];S.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(lt(r,!0),e,t,n)}});S.each({slideDown:lt("show"),slideUp:lt("hide"),slideToggle:lt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){S.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}});S.timers=[];S.fx.tick=function(){var e,t=0,n=S.timers;for(tt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop();tt=void 0};S.fx.timer=function(e){S.timers.push(e);S.fx.start()};S.fx.interval=13;S.fx.start=function(){nt||(nt=!0,st())};S.fx.stop=function(){nt=null};S.fx.speeds={slow:600,fast:200,_default:400};S.fn.delay=function(r,e){return r=S.fx&&S.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})};rt=E.createElement("input");it=E.createElement("select").appendChild(E.createElement("option"));rt.type="checkbox";y.checkOn=""!==rt.value;y.optSelected=it.selected;(rt=E.createElement("input")).value="t";rt.type="radio";y.radioValue="t"===rt.value;var pt,dt=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return $(this,S.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}});S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?pt:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}});pt={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}};S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var a=dt[t]||S.find.attr;dt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=dt[o],dt[o]=r,r=null!=a(e,t,n)?o:null,dt[o]=i),r}});var ht=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;function vt(e){return(e.match(P)||[]).join(" ")}function yt(e){return e.getAttribute&&e.getAttribute("class")||""}function mt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}S.fn.extend({prop:function(e,t){return $(this,S.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}});S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):ht.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}});y.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}});S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this});S.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).addClass(t.call(this,e,yt(this)))});if((e=mt(t)).length)while(n=this[u++])if(i=yt(n),r=1===n.nodeType&&" "+vt(i)+" "){for(a=0;o=e[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).removeClass(t.call(this,e,yt(this)))});if(!arguments.length)return this.attr("class","");if((e=mt(t)).length)while(n=this[u++])if(i=yt(n),r=1===n.nodeType&&" "+vt(i)+" "){for(a=0;o=e[a++];)while(-1<r.indexOf(" "+o+" "))r=r.replace(" "+o+" "," ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(i,t){var o=typeof i,a="string"===o||Array.isArray(i);return"boolean"==typeof t&&a?t?this.addClass(i):this.removeClass(i):m(i)?this.each(function(e){S(this).toggleClass(i.call(this,e,yt(this),t),t)}):this.each(function(){var e,t,n,r;if(a)for(t=0,n=S(this),r=mt(i);e=r[t++];)n.hasClass(e)?n.removeClass(e):n.addClass(e);else void 0!==i&&"boolean"!==o||((e=yt(this))&&Y.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===i?"":Y.get(this,"__className__")||""))})},hasClass:function(e){for(var n,r=0,t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&-1<(" "+vt(yt(n))+" ").indexOf(t))return!0;return!1}});var xt=/\r/g;S.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,S(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=S.map(t,function(e){return null==e?"":e+""})),(r=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=S.valHooks[t.type]||S.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(xt,""):null==e?"":e:void 0}});S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:vt(S.text(e))}},select:{get:function(e){for(var t,n,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length,r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;s.push(t)}return s},set:function(e,t){for(var n,r,i=e.options,o=S.makeArray(t),a=i.length;a--;)((r=i[a]).selected=-1<S.inArray(S.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}});S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<S.inArray(S(e).val(),t)}};y.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});y.focusin="onfocusin"in C;var bt=/^(?:focusinfocus|focusoutblur)$/,wt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=v.call(e,"type")?e.type:e,h=v.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!bt.test(d+S.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[S.expando]?e:new S.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),c=S.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,bt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}for(i=0;(o=p[i++])&&!e.isPropagationStopped();)f=o,e.type=1<i?s:c.bindType||d,(l=(Y.get(o,"events")||Object.create(null))[e.type]&&Y.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&V(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!V(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),S.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,wt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,wt),S.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}});S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}});y.focusin||S.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){S.event.simulate(r,e.target,S.event.fix(e))};S.event.special[r]={setup:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r);t||e.addEventListener(n,i,!0);Y.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r)-1;t?Y.access(e,r,t):(e.removeEventListener(n,i,!0),Y.remove(e,r))}}});var Tt=C.location,Ct={guid:Date.now()},Et=/\?/;S.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||S.error("Invalid XML: "+e),t};var St=/\[\]$/,kt=/\r?\n/g,At=/^(?:submit|button|image|reset|file)$/i,Nt=/^(?:input|select|textarea|keygen)/i;function Dt(n,e,r,i){var t;if(Array.isArray(e))S.each(e,function(e,t){r||St.test(n)?i(n,t):Dt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)Dt(n+"["+t+"]",e[t],r,i)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)Dt(n,e[n],t,i);return r.join("&")};S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&Nt.test(this.nodeName)&&!At.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(kt,"\r\n")}}):{name:t.name,value:n.replace(kt,"\r\n")}}).get()}});var jt=/%20/g,qt=/#.*$/,Lt=/([?&])_=[^&]*/,Ht=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ot=/^(?:GET|HEAD)$/,Pt=/^\/\//,Rt={},Mt={},It="*/".concat("*"),Wt=E.createElement("a");function Ft(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(P)||[];if(m(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Bt(t,i,o,a){var s={},u=t===Mt;function l(e){var r;return s[e]=!0,S.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function $t(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Wt.href=Tt.href;S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Tt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Tt.protocol),global:!0,processData:!0,"async":!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":It,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?$t($t(e,S.ajaxSettings),t):$t(S.ajaxSettings,e)},ajaxPrefilter:Ft(Rt),ajaxTransport:Ft(Mt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0);t=t||{};var c,f,p,n,d,r,h,g,i,o,v=S.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?S(y):S.event,x=S.Deferred(),b=S.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n)for(n={};t=Ht.exec(p);)n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||Tt.href)+"").replace(Pt,Tt.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(P)||[""],null==v.crossDomain){r=E.createElement("a");try{r.href=v.url;r.href=r.href;v.crossDomain=Wt.protocol+"//"+Wt.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=S.param(v.data,v.traditional)),Bt(Rt,v,t,T),h)return T;for(i in(g=S.event&&v.global)&&0==S.active++&&S.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Ot.test(v.type),f=v.url.replace(qt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(jt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(Et.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Lt,"$1"),o=(Et.test(f)?"&":"?")+"_="+Ct.guid+++o),v.url=f+o),v.ifModified&&(S.lastModified[f]&&T.setRequestHeader("If-Modified-Since",S.lastModified[f]),S.etag[f]&&T.setRequestHeader("If-None-Match",S.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+It+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Bt(Mt,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1;c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){for(var r,i,o,a,s=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),!i&&-1<S.inArray("script",v.dataTypes)&&(v.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(S.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(S.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--S.active||S.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}});S.each(["get","post"],function(e,i){S[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),S.ajax(S.extend({url:e,type:i,dataType:r,data:t,success:n},S.isPlainObject(e)&&e))}});S.ajaxPrefilter(function(e){for(var t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")});S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,"async":!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})};S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){S(this).wrapInner(n.call(this,e))}):this.each(function(){var e=S(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){S(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}});S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)};S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)};S.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var _t={0:200,1223:204},zt=S.ajaxSettings.xhr();y.cors=!!zt&&"withCredentials"in zt;y.ajax=zt=!!zt;S.ajaxTransport(function(i){var o,a;if(y.cors||zt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(_t[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}};r.onload=o();a=r.onerror=r.ontimeout=o("error");void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})};o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e;}},abort:function(){o&&o()}}});S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)});S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}});S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1);e.crossDomain&&(e.type="GET")});S.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=S("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove();i=null;e&&t("error"===e.type?404:200,e.type)});E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}});S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i;e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r));o&&m(i)&&i(o[0]);o=i=void 0}),"script"});y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="<form><\/form><form><\/form>",2===Ut.childNodes.length);S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o};S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=vt(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&S.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments;a.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this};S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length};S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative");s=c.offset();o=S.css(e,"top");u=S.css(e,"left");("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0);m(t)&&(t=t.call(e,n,S.extend({},s)));null!=t.top&&(f.top=t.top-s.top+a);null!=t.left&&(f.left=t.left-s.left+i);"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}};S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];if(r)return r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===S.css(e,"position");)e=e.offsetParent;return e||re})}});S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}});S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})});S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})});S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}});S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}});S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var Gt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i};S.holdReady=function(e){e?S.readyWait++:S.ready(!0)};S.isArray=Array.isArray;S.parseJSON=JSON.parse;S.nodeName=A;S.isFunction=m;S.isWindow=x;S.camelCase=X;S.type=w;S.now=Date.now;S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))};S.trim=function(e){return null==e?"":(e+"").replace(Gt,"")};"function"==typeof define&&define.amd&&define("jquery",[],function(){return S});var Yt=C.jQuery,Qt=C.$;return S.noConflict=function(e){return C.$===S&&(C.$=Qt),e&&C.jQuery===S&&(C.jQuery=Yt),S},"undefined"==typeof e&&(C.jQuery=C.$=S),S});
/*!
 * Bootstrap v3.4.1 (https://getbootstrap.com/)
 * Copyright 2011-2019 Twitter, Inc.
 * Licensed under the MIT license
 */
if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");!function(){"use strict";var e=jQuery.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1||3<e[0])throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4");}(),function(n){"use strict";n.fn.emulateTransitionEnd=function(t){var e=!1,i=this;n(this).one("bsTransitionEnd",function(){e=!0});return setTimeout(function(){e||n(i).trigger(n.support.transition.end)},t),this};n(function(){n.support.transition=function(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(t.style[i]!==undefined)return{end:e[i]};return!1}();n.support.transition&&(n.event.special.bsTransitionEnd={bindType:n.support.transition.end,delegateType:n.support.transition.end,handle:function(t){if(n(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery),function(s){"use strict";var e='[data-dismiss="alert"]',a=function(t){s(t).on("click",e,this.close)};a.VERSION="3.4.1";a.TRANSITION_DURATION=150;a.prototype.close=function(t){var e=s(this),i=e.attr("data-target");i||(i=(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,""));i="#"===i?[]:i;var o=s(document).find(i);function n(){o.detach().trigger("closed.bs.alert").remove()}t&&t.preventDefault();o.length||(o=e.closest(".alert"));o.trigger(t=s.Event("close.bs.alert"));t.isDefaultPrevented()||(o.removeClass("in"),s.support.transition&&o.hasClass("fade")?o.one("bsTransitionEnd",n).emulateTransitionEnd(a.TRANSITION_DURATION):n())};var t=s.fn.alert;s.fn.alert=function(i){return this.each(function(){var t=s(this),e=t.data("bs.alert");e||t.data("bs.alert",e=new a(this));"string"==typeof i&&e[i].call(t)})};s.fn.alert.Constructor=a;s.fn.alert.noConflict=function(){return s.fn.alert=t,this};s(document).on("click.bs.alert.data-api",e,a.prototype.close)}(jQuery),function(s){"use strict";var n=function(t,e){this.$element=s(t);this.options=s.extend({},n.DEFAULTS,e);this.isLoading=!1};function i(o){return this.each(function(){var t=s(this),e=t.data("bs.button"),i="object"==typeof o&&o;e||t.data("bs.button",e=new n(this,i));"toggle"==o?e.toggle():o&&e.setState(o)})}n.VERSION="3.4.1";n.DEFAULTS={loadingText:"loading..."};n.prototype.setState=function(t){var e="disabled",i=this.$element,o=i.is("input")?"val":"html",n=i.data();t+="Text";null==n.resetText&&i.data("resetText",i[o]());setTimeout(s.proxy(function(){i[o](null==n[t]?this.options[t]:n[t]);"loadingText"==t?(this.isLoading=!0,i.addClass(e).attr(e,e).prop(e,!0)):this.isLoading&&(this.isLoading=!1,i.removeClass(e).removeAttr(e).prop(e,!1))},this),0)};n.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")?(i.prop("checked")&&(t=!1),e.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==i.prop("type")&&(i.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active"));i.prop("checked",this.$element.hasClass("active"));t&&i.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var t=s.fn.button;s.fn.button=i;s.fn.button.Constructor=n;s.fn.button.noConflict=function(){return s.fn.button=t,this};s(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(t){var e=s(t.target).closest(".btn");i.call(e,"toggle");s(t.target).is('input[type="radio"], input[type="checkbox"]')||(t.preventDefault(),e.is("input,button")?e.trigger("focus"):e.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(t){s(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))})}(jQuery),function(p){"use strict";var c=function(t,e){this.$element=p(t);this.$indicators=this.$element.find(".carousel-indicators");this.options=e;this.paused=null;this.sliding=null;this.interval=null;this.$active=null;this.$items=null;this.options.keyboard&&this.$element.on("keydown.bs.carousel",p.proxy(this.keydown,this));"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",p.proxy(this.pause,this)).on("mouseleave.bs.carousel",p.proxy(this.cycle,this))};function r(n){return this.each(function(){var t=p(this),e=t.data("bs.carousel"),i=p.extend({},c.DEFAULTS,t.data(),"object"==typeof n&&n),o="string"==typeof n?n:i.slide;e||t.data("bs.carousel",e=new c(this,i));"number"==typeof n?e.to(n):o?e[o]():i.interval&&e.pause().cycle()})}c.VERSION="3.4.1";c.TRANSITION_DURATION=600;c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0};c.prototype.keydown=function(t){if(!/input|textarea/i.test(t.target.tagName)){switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()}};c.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(p.proxy(this.next,this),this.options.interval)),this};c.prototype.getItemIndex=function(t){return this.$items=t.parent().children(".item"),this.$items.index(t||this.$active)};c.prototype.getItemForDirection=function(t,e){var i=this.getItemIndex(e);if(("prev"==t&&0===i||"next"==t&&i==this.$items.length-1)&&!this.options.wrap)return e;var o=(i+("prev"==t?-1:1))%this.$items.length;return this.$items.eq(o)};c.prototype.to=function(t){var e=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(t>this.$items.length-1||t<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){e.to(t)}):i==t?this.pause().cycle():this.slide(i<t?"next":"prev",this.$items.eq(t))};c.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&p.support.transition&&(this.$element.trigger(p.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this};c.prototype.next=function(){if(!this.sliding)return this.slide("next")};c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")};c.prototype.slide=function(t,e){var i=this.$element.find(".item.active"),o=e||this.getItemForDirection(t,i),n=this.interval,s="next"==t?"left":"right",a=this;if(o.hasClass("active"))return this.sliding=!1;var r=o[0],l=p.Event("slide.bs.carousel",{relatedTarget:r,direction:s});if(this.$element.trigger(l),!l.isDefaultPrevented()){if(this.sliding=!0,n&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var h=p(this.$indicators.children()[this.getItemIndex(o)]);h&&h.addClass("active")}var d=p.Event("slid.bs.carousel",{relatedTarget:r,direction:s});return p.support.transition&&this.$element.hasClass("slide")?(o.addClass(t),"object"==typeof o&&o.length&&o[0].offsetWidth,i.addClass(s),o.addClass(s),i.one("bsTransitionEnd",function(){o.removeClass([t,s].join(" ")).addClass("active");i.removeClass(["active",s].join(" "));a.sliding=!1;setTimeout(function(){a.$element.trigger(d)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(i.removeClass("active"),o.addClass("active"),this.sliding=!1,this.$element.trigger(d)),n&&this.cycle(),this}};var t=p.fn.carousel;p.fn.carousel=r;p.fn.carousel.Constructor=c;p.fn.carousel.noConflict=function(){return p.fn.carousel=t,this};var e=function(t){var e=p(this),i=e.attr("href");i&&(i=i.replace(/.*(?=#[^\s]+$)/,""));var o=e.attr("data-target")||i,n=p(document).find(o);if(n.hasClass("carousel")){var s=p.extend({},n.data(),e.data()),a=e.attr("data-slide-to");a&&(s.interval=!1);r.call(n,s);a&&n.data("bs.carousel").to(a);t.preventDefault()}};p(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e);p(window).on("load",function(){p('[data-ride="carousel"]').each(function(){var t=p(this);r.call(t,t.data())})})}(jQuery),function(a){"use strict";var r=function(t,e){this.$element=a(t);this.options=a.extend({},r.DEFAULTS,e);this.$trigger=a('[data-toggle="collapse"][href="#'+t.id+'"],[data-toggle="collapse"][data-target="#'+t.id+'"]');this.transitioning=null;this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger);this.options.toggle&&this.toggle()};function n(t){var e,i=t.attr("data-target")||(e=t.attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"");return a(document).find(i)}function l(o){return this.each(function(){var t=a(this),e=t.data("bs.collapse"),i=a.extend({},r.DEFAULTS,t.data(),"object"==typeof o&&o);!e&&i.toggle&&/show|hide/.test(o)&&(i.toggle=!1);e||t.data("bs.collapse",e=new r(this,i));"string"==typeof o&&e[o]()})}r.VERSION="3.4.1";r.TRANSITION_DURATION=350;r.DEFAULTS={toggle:!0};r.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"};r.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var t,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(t=e.data("bs.collapse"))&&t.transitioning)){var i=a.Event("show.bs.collapse");if(this.$element.trigger(i),!i.isDefaultPrevented()){e&&e.length&&(l.call(e,"hide"),t||e.data("bs.collapse",null));var o=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[o](0).attr("aria-expanded",!0);this.$trigger.removeClass("collapsed").attr("aria-expanded",!0);this.transitioning=1;var n=function(){this.$element.removeClass("collapsing").addClass("collapse in")[o]("");this.transitioning=0;this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return n.call(this);var s=a.camelCase(["scroll",o].join("-"));this.$element.one("bsTransitionEnd",a.proxy(n,this)).emulateTransitionEnd(r.TRANSITION_DURATION)[o](this.$element[0][s])}}}};r.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var t=a.Event("hide.bs.collapse");if(this.$element.trigger(t),!t.isDefaultPrevented()){var e=this.dimension();this.$element[e](this.$element[e]())[0].offsetHeight;this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1);this.$trigger.addClass("collapsed").attr("aria-expanded",!1);this.transitioning=1;var i=function(){this.transitioning=0;this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!a.support.transition)return i.call(this);this.$element[e](0).one("bsTransitionEnd",a.proxy(i,this)).emulateTransitionEnd(r.TRANSITION_DURATION)}}};r.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};r.prototype.getParent=function(){return a(document).find(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(t,e){var i=a(e);this.addAriaAndCollapsedClass(n(i),i)},this)).end()};r.prototype.addAriaAndCollapsedClass=function(t,e){var i=t.hasClass("in");t.attr("aria-expanded",i);e.toggleClass("collapsed",!i).attr("aria-expanded",i)};var t=a.fn.collapse;a.fn.collapse=l;a.fn.collapse.Constructor=r;a.fn.collapse.noConflict=function(){return a.fn.collapse=t,this};a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(t){var e=a(this);e.attr("data-target")||t.preventDefault();var i=n(e),o=i.data("bs.collapse")?"toggle":e.data();l.call(i,o)})}(jQuery),function(a){"use strict";var r='[data-toggle="dropdown"]',o=function(t){a(t).on("click.bs.dropdown",this.toggle)};function l(t){var e=t.attr("data-target");e||(e=(e=t.attr("href"))&&/#[A-Za-z]/.test(e)&&e.replace(/.*(?=#[^\s]*$)/,""));var i="#"!==e?a(document).find(e):null;return i&&i.length?i:t.parent()}function s(o){o&&3===o.which||(a(".dropdown-backdrop").remove(),a(r).each(function(){var t=a(this),e=l(t),i={relatedTarget:this};e.hasClass("open")&&(o&&"click"==o.type&&/input|textarea/i.test(o.target.tagName)&&a.contains(e[0],o.target)||(e.trigger(o=a.Event("hide.bs.dropdown",i)),o.isDefaultPrevented()||(t.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",i)))))}))}o.VERSION="3.4.1";o.prototype.toggle=function(t){var e=a(this);if(!e.is(".disabled, :disabled")){var i=l(e),o=i.hasClass("open");if(s(),!o){"ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",s);var n={relatedTarget:this};if(i.trigger(t=a.Event("show.bs.dropdown",n)),t.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true");i.toggleClass("open").trigger(a.Event("shown.bs.dropdown",n))}return!1}};o.prototype.keydown=function(t){if(/(38|40|27|32)/.test(t.which)&&!/input|textarea/i.test(t.target.tagName)){var e=a(this);if(t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled")){var i=l(e),o=i.hasClass("open");if(!o&&27!=t.which||o&&27==t.which)return 27==t.which&&i.find(r).trigger("focus"),e.trigger("click");var n=i.find(".dropdown-menu li:not(.disabled):visible a");if(n.length){var s=n.index(t.target);38==t.which&&0<s&&s--;40==t.which&&s<n.length-1&&s++;~s||(s=0);n.eq(s).trigger("focus")}}}};var t=a.fn.dropdown;a.fn.dropdown=function(i){return this.each(function(){var t=a(this),e=t.data("bs.dropdown");e||t.data("bs.dropdown",e=new o(this));"string"==typeof i&&e[i].call(t)})};a.fn.dropdown.Constructor=o;a.fn.dropdown.noConflict=function(){return a.fn.dropdown=t,this};a(document).on("click.bs.dropdown.data-api",s).on("click.bs.dropdown.data-api",".dropdown form",function(t){t.stopPropagation()}).on("click.bs.dropdown.data-api",r,o.prototype.toggle).on("keydown.bs.dropdown.data-api",r,o.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",o.prototype.keydown)}(jQuery),function(a){"use strict";var s=function(t,e){this.options=e;this.$body=a(document.body);this.$element=a(t);this.$dialog=this.$element.find(".modal-dialog");this.$backdrop=null;this.isShown=null;this.originalBodyPad=null;this.scrollbarWidth=0;this.ignoreBackdropClick=!1;this.fixedContent=".navbar-fixed-top, .navbar-fixed-bottom";this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};function r(o,n){return this.each(function(){var t=a(this),e=t.data("bs.modal"),i=a.extend({},s.DEFAULTS,t.data(),"object"==typeof o&&o);e||t.data("bs.modal",e=new s(this,i));"string"==typeof o?e[o](n):i.show&&e.show(n)})}s.VERSION="3.4.1";s.TRANSITION_DURATION=300;s.BACKDROP_TRANSITION_DURATION=150;s.DEFAULTS={backdrop:!0,keyboard:!0,show:!0};s.prototype.toggle=function(t){return this.isShown?this.hide():this.show(t)};s.prototype.show=function(i){var o=this,t=a.Event("show.bs.modal",{relatedTarget:i});this.$element.trigger(t);this.isShown||t.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){o.$element.one("mouseup.dismiss.bs.modal",function(t){a(t.target).is(o.$element)&&(o.ignoreBackdropClick=!0)})}),this.backdrop(function(){var t=a.support.transition&&o.$element.hasClass("fade");o.$element.parent().length||o.$element.appendTo(o.$body);o.$element.show().scrollTop(0);o.adjustDialog();t&&o.$element[0].offsetWidth;o.$element.addClass("in");o.enforceFocus();var e=a.Event("shown.bs.modal",{relatedTarget:i});t?o.$dialog.one("bsTransitionEnd",function(){o.$element.trigger("focus").trigger(e)}).emulateTransitionEnd(s.TRANSITION_DURATION):o.$element.trigger("focus").trigger(e)}))};s.prototype.hide=function(t){t&&t.preventDefault();t=a.Event("hide.bs.modal");this.$element.trigger(t);this.isShown&&!t.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(s.TRANSITION_DURATION):this.hideModal())};s.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(t){document===t.target||this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.trigger("focus")},this))};s.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(t){27==t.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")};s.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")};s.prototype.hideModal=function(){var t=this;this.$element.hide();this.backdrop(function(){t.$body.removeClass("modal-open");t.resetAdjustments();t.resetScrollbar();t.$element.trigger("hidden.bs.modal")})};s.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove();this.$backdrop=null};s.prototype.backdrop=function(t){var e=this,i=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var o=a.support.transition&&i;if(this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+i).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(t){this.ignoreBackdropClick?this.ignoreBackdropClick=!1:t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide())},this)),o&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;o?this.$backdrop.one("bsTransitionEnd",t).emulateTransitionEnd(s.BACKDROP_TRANSITION_DURATION):t()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var n=function(){e.removeBackdrop();t&&t()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",n).emulateTransitionEnd(s.BACKDROP_TRANSITION_DURATION):n()}else t&&t()};s.prototype.handleUpdate=function(){this.adjustDialog()};s.prototype.adjustDialog=function(){var t=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})};s.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})};s.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth<t;this.scrollbarWidth=this.measureScrollbar()};s.prototype.setScrollbar=function(){var t=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"";var n=this.scrollbarWidth;this.bodyIsOverflowing&&(this.$body.css("padding-right",t+n),a(this.fixedContent).each(function(t,e){var i=e.style.paddingRight,o=a(e).css("padding-right");a(e).data("padding-right",i).css("padding-right",parseFloat(o)+n+"px")}))};s.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad);a(this.fixedContent).each(function(t,e){var i=a(e).data("padding-right");a(e).removeData("padding-right");e.style.paddingRight=i||""})};s.prototype.measureScrollbar=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure";this.$body.append(t);var e=t.offsetWidth-t.clientWidth;return this.$body[0].removeChild(t),e};var t=a.fn.modal;a.fn.modal=r;a.fn.modal.Constructor=s;a.fn.modal.noConflict=function(){return a.fn.modal=t,this};a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var e=a(this),i=e.attr("href"),o=e.attr("data-target")||i&&i.replace(/.*(?=#[^\s]+$)/,""),n=a(document).find(o),s=n.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(i)&&i},n.data(),e.data());e.is("a")&&t.preventDefault();n.one("show.bs.modal",function(t){t.isDefaultPrevented()||n.one("hidden.bs.modal",function(){e.is(":visible")&&e.trigger("focus")})});r.call(n,s,this)})}(jQuery),function(g){"use strict";var o=["sanitize","whiteList","sanitizeFn"],a=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],r=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,l=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function u(t,e){var i=t.nodeName.toLowerCase();if(-1!==g.inArray(i,e))return-1===g.inArray(i,a)||Boolean(t.nodeValue.match(r)||t.nodeValue.match(l));for(var o=g(e).filter(function(t,e){return e instanceof RegExp}),n=0,s=o.length;n<s;n++)if(i.match(o[n]))return!0;return!1}function n(t,e,i){if(0===t.length)return t;if(i&&"function"==typeof i)return i(t);if(!document.implementation||!document.implementation.createHTMLDocument)return t;var o=document.implementation.createHTMLDocument("sanitization");o.body.innerHTML=t;for(var n=g.map(e,function(t,e){return e}),s=g(o.body).find("*"),a=0,r=s.length;a<r;a++){var l=s[a],h=l.nodeName.toLowerCase();if(-1!==g.inArray(h,n))for(var d=g.map(l.attributes,function(t){return t}),p=[].concat(e["*"]||[],e[h]||[]),c=0,f=d.length;c<f;c++)u(d[c],p)||l.removeAttribute(d[c].nodeName);else l.parentNode.removeChild(l)}return o.body.innerHTML}var m=function(t,e){this.type=null;this.options=null;this.enabled=null;this.timeout=null;this.hoverState=null;this.$element=null;this.inState=null;this.init("tooltip",t,e)};m.VERSION="3.4.1";m.TRANSITION_DURATION=150;m.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"><\/div><div class="tooltip-inner"><\/div><\/div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0},sanitize:!0,sanitizeFn:null,whiteList:{"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]}};m.prototype.init=function(t,e,i){if(this.enabled=!0,this.type=t,this.$element=g(e),this.options=this.getOptions(i),this.$viewport=this.options.viewport&&g(document).find(g.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var o=this.options.trigger.split(" "),n=o.length;n--;){var s=o[n];if("click"==s)this.$element.on("click."+this.type,this.options.selector,g.proxy(this.toggle,this));else if("manual"!=s){var a="hover"==s?"mouseenter":"focusin",r="hover"==s?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,g.proxy(this.enter,this));this.$element.on(r+"."+this.type,this.options.selector,g.proxy(this.leave,this))}}this.options.selector?this._options=g.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()};m.prototype.getDefaults=function(){return m.DEFAULTS};m.prototype.getOptions=function(t){var e=this.$element.data();for(var i in e)e.hasOwnProperty(i)&&-1!==g.inArray(i,o)&&delete e[i];return(t=g.extend({},this.getDefaults(),e,t)).delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t.sanitize&&(t.template=n(t.template,t.whiteList,t.sanitizeFn)),t};m.prototype.getDelegateOptions=function(){var i={},o=this.getDefaults();return this._options&&g.each(this._options,function(t,e){o[t]!=e&&(i[t]=e)}),i};m.prototype.enter=function(t){var e=t instanceof this.constructor?t:g(t.currentTarget).data("bs."+this.type);if(e||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e)),t instanceof g.Event&&(e.inState["focusin"==t.type?"focus":"hover"]=!0),e.tip().hasClass("in")||"in"==e.hoverState)e.hoverState="in";else{if(clearTimeout(e.timeout),e.hoverState="in",!e.options.delay||!e.options.delay.show)return e.show();e.timeout=setTimeout(function(){"in"==e.hoverState&&e.show()},e.options.delay.show)}};m.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1};m.prototype.leave=function(t){var e=t instanceof this.constructor?t:g(t.currentTarget).data("bs."+this.type);if(e||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e)),t instanceof g.Event&&(e.inState["focusout"==t.type?"focus":"hover"]=!1),!e.isInStateTrue()){if(clearTimeout(e.timeout),e.hoverState="out",!e.options.delay||!e.options.delay.hide)return e.hide();e.timeout=setTimeout(function(){"out"==e.hoverState&&e.hide()},e.options.delay.hide)}};m.prototype.show=function(){var t=g.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);var e=g.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(t.isDefaultPrevented()||!e)return;var i=this,o=this.tip(),n=this.getUID(this.type);this.setContent();o.attr("id",n);this.$element.attr("aria-describedby",n);this.options.animation&&o.addClass("fade");var s="function"==typeof this.options.placement?this.options.placement.call(this,o[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,r=a.test(s);r&&(s=s.replace(a,"")||"top");o.detach().css({top:0,left:0,display:"block"}).addClass(s).data("bs."+this.type,this);this.options.container?o.appendTo(g(document).find(this.options.container)):o.insertAfter(this.$element);this.$element.trigger("inserted.bs."+this.type);var l=this.getPosition(),h=o[0].offsetWidth,d=o[0].offsetHeight;if(r){var p=s,c=this.getPosition(this.$viewport);s="bottom"==s&&l.bottom+d>c.bottom?"top":"top"==s&&l.top-d<c.top?"bottom":"right"==s&&l.right+h>c.width?"left":"left"==s&&l.left-h<c.left?"right":s;o.removeClass(p).addClass(s)}var f=this.getCalculatedOffset(s,l,h,d);this.applyPlacement(f,s);var u=function(){var t=i.hoverState;i.$element.trigger("shown.bs."+i.type);i.hoverState=null;"out"==t&&i.leave(i)};g.support.transition&&this.$tip.hasClass("fade")?o.one("bsTransitionEnd",u).emulateTransitionEnd(m.TRANSITION_DURATION):u()}};m.prototype.applyPlacement=function(t,e){var i=this.tip(),o=i[0].offsetWidth,n=i[0].offsetHeight,s=parseInt(i.css("margin-top"),10),a=parseInt(i.css("margin-left"),10);isNaN(s)&&(s=0);isNaN(a)&&(a=0);t.top+=s;t.left+=a;g.offset.setOffset(i[0],g.extend({using:function(t){i.css({top:Math.round(t.top),left:Math.round(t.left)})}},t),0);i.addClass("in");var r=i[0].offsetWidth,l=i[0].offsetHeight;"top"==e&&l!=n&&(t.top=t.top+n-l);var h=this.getViewportAdjustedDelta(e,t,r,l);h.left?t.left+=h.left:t.top+=h.top;var d=/top|bottom/.test(e),p=d?2*h.left-o+r:2*h.top-n+l,c=d?"offsetWidth":"offsetHeight";i.offset(t);this.replaceArrow(p,i[0][c],d)};m.prototype.replaceArrow=function(t,e,i){this.arrow().css(i?"left":"top",50*(1-t/e)+"%").css(i?"top":"left","")};m.prototype.setContent=function(){var t=this.tip(),e=this.getTitle();this.options.html?(this.options.sanitize&&(e=n(e,this.options.whiteList,this.options.sanitizeFn)),t.find(".tooltip-inner").html(e)):t.find(".tooltip-inner").text(e);t.removeClass("fade in top bottom left right")};m.prototype.hide=function(t){var e=this,i=g(this.$tip),o=g.Event("hide.bs."+this.type);function n(){"in"!=e.hoverState&&i.detach();e.$element&&e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type);t&&t()}if(this.$element.trigger(o),!o.isDefaultPrevented())return i.removeClass("in"),g.support.transition&&i.hasClass("fade")?i.one("bsTransitionEnd",n).emulateTransitionEnd(m.TRANSITION_DURATION):n(),this.hoverState=null,this};m.prototype.fixTitle=function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")};m.prototype.hasContent=function(){return this.getTitle()};m.prototype.getPosition=function(t){var e=(t=t||this.$element)[0],i="BODY"==e.tagName,o=e.getBoundingClientRect();null==o.width&&(o=g.extend({},o,{width:o.right-o.left,height:o.bottom-o.top}));var n=window.SVGElement&&e instanceof window.SVGElement,s=i?{top:0,left:0}:n?null:t.offset(),a={scroll:i?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop()},r=i?{width:g(window).width(),height:g(window).height()}:null;return g.extend({},o,a,r,s)};m.prototype.getCalculatedOffset=function(t,e,i,o){return"bottom"==t?{top:e.top+e.height,left:e.left+e.width/2-i/2}:"top"==t?{top:e.top-o,left:e.left+e.width/2-i/2}:"left"==t?{top:e.top+e.height/2-o/2,left:e.left-i}:{top:e.top+e.height/2-o/2,left:e.left+e.width}};m.prototype.getViewportAdjustedDelta=function(t,e,i,o){var n={top:0,left:0};if(!this.$viewport)return n;var s=this.options.viewport&&this.options.viewport.padding||0,a=this.getPosition(this.$viewport);if(/right|left/.test(t)){var r=e.top-s-a.scroll,l=e.top+s-a.scroll+o;r<a.top?n.top=a.top-r:l>a.top+a.height&&(n.top=a.top+a.height-l)}else{var h=e.left-s,d=e.left+s+i;h<a.left?n.left=a.left-h:d>a.right&&(n.left=a.left+a.width-d)}return n};m.prototype.getTitle=function(){var t=this.$element,e=this.options;return t.attr("data-original-title")||("function"==typeof e.title?e.title.call(t[0]):e.title)};m.prototype.getUID=function(t){for(;t+=~~(1e6*Math.random()),document.getElementById(t););return t};m.prototype.tip=function(){if(!this.$tip&&(this.$tip=g(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip};m.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")};m.prototype.enable=function(){this.enabled=!0};m.prototype.disable=function(){this.enabled=!1};m.prototype.toggleEnabled=function(){this.enabled=!this.enabled};m.prototype.toggle=function(t){var e=this;t&&((e=g(t.currentTarget).data("bs."+this.type))||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e)));t?(e.inState.click=!e.inState.click,e.isInStateTrue()?e.enter(e):e.leave(e)):e.tip().hasClass("in")?e.leave(e):e.enter(e)};m.prototype.destroy=function(){var t=this;clearTimeout(this.timeout);this.hide(function(){t.$element.off("."+t.type).removeData("bs."+t.type);t.$tip&&t.$tip.detach();t.$tip=null;t.$arrow=null;t.$viewport=null;t.$element=null})};m.prototype.sanitizeHtml=function(t){return n(t,this.options.whiteList,this.options.sanitizeFn)};var e=g.fn.tooltip;g.fn.tooltip=function(o){return this.each(function(){var t=g(this),e=t.data("bs.tooltip"),i="object"==typeof o&&o;!e&&/destroy|hide/.test(o)||(e||t.data("bs.tooltip",e=new m(this,i)),"string"==typeof o&&e[o]())})};g.fn.tooltip.Constructor=m;g.fn.tooltip.noConflict=function(){return g.fn.tooltip=e,this}}(jQuery),function(n){"use strict";var s=function(t,e){this.init("popover",t,e)};if(!n.fn.tooltip)throw new Error("Popover requires tooltip.js");s.VERSION="3.4.1";s.DEFAULTS=n.extend({},n.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"><\/div><h3 class="popover-title"><\/h3><div class="popover-content"><\/div><\/div>'});((s.prototype=n.extend({},n.fn.tooltip.Constructor.prototype)).constructor=s).prototype.getDefaults=function(){return s.DEFAULTS};s.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),i=this.getContent();if(this.options.html){var o=typeof i;this.options.sanitize&&(e=this.sanitizeHtml(e),"string"===o&&(i=this.sanitizeHtml(i)));t.find(".popover-title").html(e);t.find(".popover-content").children().detach().end()["string"===o?"html":"append"](i)}else t.find(".popover-title").text(e),t.find(".popover-content").children().detach().end().text(i);t.removeClass("fade top bottom left right in");t.find(".popover-title").html()||t.find(".popover-title").hide()};s.prototype.hasContent=function(){return this.getTitle()||this.getContent()};s.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)};s.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var t=n.fn.popover;n.fn.popover=function(o){return this.each(function(){var t=n(this),e=t.data("bs.popover"),i="object"==typeof o&&o;!e&&/destroy|hide/.test(o)||(e||t.data("bs.popover",e=new s(this,i)),"string"==typeof o&&e[o]())})};n.fn.popover.Constructor=s;n.fn.popover.noConflict=function(){return n.fn.popover=t,this}}(jQuery),function(s){"use strict";function n(t,e){this.$body=s(document.body);this.$scrollElement=s(t).is(document.body)?s(window):s(t);this.options=s.extend({},n.DEFAULTS,e);this.selector=(this.options.target||"")+" .nav li > a";this.offsets=[];this.targets=[];this.activeTarget=null;this.scrollHeight=0;this.$scrollElement.on("scroll.bs.scrollspy",s.proxy(this.process,this));this.refresh();this.process()}function e(o){return this.each(function(){var t=s(this),e=t.data("bs.scrollspy"),i="object"==typeof o&&o;e||t.data("bs.scrollspy",e=new n(this,i));"string"==typeof o&&e[o]()})}n.VERSION="3.4.1";n.DEFAULTS={offset:10};n.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)};n.prototype.refresh=function(){var t=this,o="offset",n=0;this.offsets=[];this.targets=[];this.scrollHeight=this.getScrollHeight();s.isWindow(this.$scrollElement[0])||(o="position",n=this.$scrollElement.scrollTop());this.$body.find(this.selector).map(function(){var t=s(this),e=t.data("target")||t.attr("href"),i=/^#./.test(e)&&s(e);return i&&i.length&&i.is(":visible")&&[[i[o]().top+n,e]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){t.offsets.push(this[0]);t.targets.push(this[1])})};n.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=this.getScrollHeight(),o=this.options.offset+i-this.$scrollElement.height(),n=this.offsets,s=this.targets,a=this.activeTarget;if(this.scrollHeight!=i&&this.refresh(),o<=e)return a!=(t=s[s.length-1])&&this.activate(t);if(a&&e<n[0])return this.activeTarget=null,this.clear();for(t=n.length;t--;)a!=s[t]&&e>=n[t]&&(n[t+1]===undefined||e<n[t+1])&&this.activate(s[t])};n.prototype.activate=function(t){this.activeTarget=t;this.clear();var e=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=s(e).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active"));i.trigger("activate.bs.scrollspy")};n.prototype.clear=function(){s(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var t=s.fn.scrollspy;s.fn.scrollspy=e;s.fn.scrollspy.Constructor=n;s.fn.scrollspy.noConflict=function(){return s.fn.scrollspy=t,this};s(window).on("load.bs.scrollspy.data-api",function(){s('[data-spy="scroll"]').each(function(){var t=s(this);e.call(t,t.data())})})}(jQuery),function(r){"use strict";var a=function(t){this.element=r(t)};function e(i){return this.each(function(){var t=r(this),e=t.data("bs.tab");e||t.data("bs.tab",e=new a(this));"string"==typeof i&&e[i]()})}a.VERSION="3.4.1";a.TRANSITION_DURATION=150;a.prototype.show=function(){var t=this.element,e=t.closest("ul:not(.dropdown-menu)"),i=t.data("target");if(i||(i=(i=t.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,"")),!t.parent("li").hasClass("active")){var o=e.find(".active:last a"),n=r.Event("hide.bs.tab",{relatedTarget:t[0]}),s=r.Event("show.bs.tab",{relatedTarget:o[0]});if(o.trigger(n),t.trigger(s),!s.isDefaultPrevented()&&!n.isDefaultPrevented()){var a=r(document).find(i);this.activate(t.closest("li"),e);this.activate(a,a.parent(),function(){o.trigger({type:"hidden.bs.tab",relatedTarget:t[0]});t.trigger({type:"shown.bs.tab",relatedTarget:o[0]})})}}};a.prototype.activate=function(t,e,i){var o=e.find("> .active"),n=i&&r.support.transition&&(o.length&&o.hasClass("fade")||!!e.find("> .fade").length);function s(){o.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1);t.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0);n?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade");t.parent(".dropdown-menu").length&&t.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0);i&&i()}o.length&&n?o.one("bsTransitionEnd",s).emulateTransitionEnd(a.TRANSITION_DURATION):s();o.removeClass("in")};var t=r.fn.tab;r.fn.tab=e;r.fn.tab.Constructor=a;r.fn.tab.noConflict=function(){return r.fn.tab=t,this};var i=function(t){t.preventDefault();e.call(r(this),"show")};r(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',i).on("click.bs.tab.data-api",'[data-toggle="pill"]',i)}(jQuery),function(l){"use strict";var h=function(t,e){this.options=l.extend({},h.DEFAULTS,e);var i=this.options.target===h.DEFAULTS.target?l(this.options.target):l(document).find(this.options.target);this.$target=i.on("scroll.bs.affix.data-api",l.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",l.proxy(this.checkPositionWithEventLoop,this));this.$element=l(t);this.affixed=null;this.unpin=null;this.pinnedOffset=null;this.checkPosition()};function i(o){return this.each(function(){var t=l(this),e=t.data("bs.affix"),i="object"==typeof o&&o;e||t.data("bs.affix",e=new h(this,i));"string"==typeof o&&e[o]()})}h.VERSION="3.4.1";h.RESET="affix affix-top affix-bottom";h.DEFAULTS={offset:0,target:window};h.prototype.getState=function(t,e,i,o){var n=this.$target.scrollTop(),s=this.$element.offset(),a=this.$target.height();if(null!=i&&"top"==this.affixed)return n<i&&"top";if("bottom"==this.affixed)return null!=i?!(n+this.unpin<=s.top)&&"bottom":!(n+a<=t-o)&&"bottom";var r=null==this.affixed,l=r?n:s.top;return null!=i&&n<=i?"top":null!=o&&t-o<=l+(r?a:e)&&"bottom"};h.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(h.RESET).addClass("affix");var t=this.$target.scrollTop(),e=this.$element.offset();return this.pinnedOffset=e.top-t};h.prototype.checkPositionWithEventLoop=function(){setTimeout(l.proxy(this.checkPosition,this),1)};h.prototype.checkPosition=function(){if(this.$element.is(":visible")){var t=this.$element.height(),e=this.options.offset,i=e.top,o=e.bottom,n=Math.max(l(document).height(),l(document.body).height());"object"!=typeof e&&(o=i=e);"function"==typeof i&&(i=e.top(this.$element));"function"==typeof o&&(o=e.bottom(this.$element));var s=this.getState(n,t,i,o);if(this.affixed!=s){null!=this.unpin&&this.$element.css("top","");var a="affix"+(s?"-"+s:""),r=l.Event(a+".bs.affix");if(this.$element.trigger(r),r.isDefaultPrevented())return;this.affixed=s;this.unpin="bottom"==s?this.getPinnedOffset():null;this.$element.removeClass(h.RESET).addClass(a).trigger(a.replace("affix","affixed")+".bs.affix")}"bottom"==s&&this.$element.offset({top:n-t-o})}};var t=l.fn.affix;l.fn.affix=i;l.fn.affix.Constructor=h;l.fn.affix.noConflict=function(){return l.fn.affix=t,this};l(window).on("load",function(){l('[data-spy="affix"]').each(function(){var t=l(this),e=t.data();e.offset=e.offset||{};null!=e.offsetBottom&&(e.offset.bottom=e.offsetBottom);null!=e.offsetTop&&(e.offset.top=e.offsetTop);i.call(t,e)})})}(jQuery);var sidebar=function(obj,e){var s=obj,i=s.find("ul.sidebar-tabs, .sidebar-tabs > ul"),a=s.children(".sidebar-content").first();return e=$.extend({position:"left"},e||{}),s.addClass("sidebar-"+e.position),collPanes=s.find(".sidebar-pane"),collPanes.each(function(){var target=$(this),targetId=target.attr("id");target&&$("a[href = '#"+targetId+"']").not(".sidebar-tabs a").click(function(e){e.preventDefault();var aTarget=$(this);aTarget.hasClass("active")?s.close(aTarget):aTarget.hasClass("disabled")||s.open(this.hash.slice(1),aTarget,!0)})}),i.children("li").children("a").on("click",function(e){e.preventDefault();var i=$(this).closest("li");i.hasClass("active")?s.close():i.hasClass("disabled")||s.open(this.hash.slice(1),i,!1)}),s.find(".sidebar-close").on("click",function(){s.close()}),s.open=function(e,l,fromStandaloneSender){fromStandaloneSender||"undefined"==typeof l&&(l=i.find('li > a[href="#'+e+'"]').parent());a.children(".sidebar-pane.active").removeClass("active");a.children("#"+e).addClass("active");s.deactivateActivaters();l.addClass("active");s.trigger("content",{id:e});s.hasClass("collapsed")&&(s.trigger("opening"),s.removeClass("collapsed"))},s.close=function(sender){typeof sender!="undefined"&&sender.removeClass("active");s.deactivateActivaters();s.hasClass("collapsed")||(s.trigger("closing"),s.addClass("collapsed"))},s.deactivateActivaters=function(){i.children("li.active").removeClass("active");collPanes.each(function(){var target=$(this),targetId=target.attr("id");target&&$("a[href = '#"+targetId+"']").each(function(){$(this).removeClass("active")})})},s};!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ol=e():t.ol=e()}(window,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if((1&e&&(t=r(t)),8&e)||4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=7)}([function(t){t.exports=function(){"use strict";function t(t,n,i,o,a){!function t(r,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=n-i+1,l=Math.log(s),h=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*h*(s-h)/s)*(u-s/2<0?-1:1);t(r,n,Math.max(i,Math.floor(n-u*h/s+c)),Math.min(o,Math.floor(n+(s-u)*h/s+c)),a)}var p=r[n],f=i,d=o;for(e(r,i,n),a(r[o],p)>0&&e(r,i,o);f<d;){for(e(r,f,d),f++,d--;a(r[f],p)<0;)f++;for(;a(r[d],p)>0;)d--}0===a(r[i],p)?e(r,i,d):e(r,++d,o);d<=n&&(i=d+1);n<=d&&(o=d-1)}}(t,n,i||0,o||t.length-1,a||r)}function e(t,e,r){var n=t[e];t[e]=t[r];t[r]=n}function r(t,e){return t<e?-1:t>e?1:0}var n=function(t){void 0===t&&(t=9);this._maxEntries=Math.max(4,t);this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries));this.clear()};function i(t,e,r){if(!r)return e.indexOf(t);for(var n=0;n<e.length;n++)if(r(t,e[n]))return n;return-1}function o(t,e){a(t,0,t.children.length,e,t)}function a(t,e,r,n,i){i||(i=d(null));i.minX=1/0;i.minY=1/0;i.maxX=-1/0;i.maxY=-1/0;for(var o=e;o<r;o++){var a=t.children[o];s(i,t.leaf?n(a):a)}return i}function s(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function u(t,e){return t.minX-e.minX}function l(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function c(t){return t.maxX-t.minX+(t.maxY-t.minY)}function p(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function f(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function d(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function _(e,r,n,i,o){for(var a=[r,n];a.length;)if(!((n=a.pop())-(r=a.pop())<=i)){var s=r+Math.ceil((n-r)/i/2)*i;t(e,s,r,n,o);a.push(r,s,s,n)}}return n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(t){var e=this.data,r=[];if(!f(t,e))return r;for(var n=this.toBBox,i=[];e;){for(var o=0;o<e.children.length;o++){var a=e.children[o],s=e.leaf?n(a):a;f(t,s)&&(e.leaf?r.push(a):p(t,s)?this._all(a,r):i.push(a))}e=i.pop()}return r},n.prototype.collides=function(t){var e=this.data;if(!f(t,e))return!1;for(var r=[];e;){for(var n=0;n<e.children.length;n++){var i=e.children[n],o=e.leaf?this.toBBox(i):i;if(f(t,o)){if(e.leaf||p(t,o))return!0;r.push(i)}}e=r.pop()}return!1},n.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var r=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var n=this.data;this.data=r;r=n}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},n.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},n.prototype.clear=function(){return this.data=d([]),this},n.prototype.remove=function(t,e){if(!t)return this;for(var r,n,o,a=this.data,s=this.toBBox(t),u=[],l=[];a||u.length;){if(a||(a=u.pop(),n=u[u.length-1],r=l.pop(),o=!0),a.leaf){var h=i(t,a.children,e);if(-1!==h)return a.children.splice(h,1),u.push(a),this._condense(u),this}o||a.leaf||!p(a,s)?n?(r++,a=n.children[r],o=!1):a=null:(u.push(a),l.push(r),r=0,n=a,a=a.children[0])}return this},n.prototype.toBBox=function(t){return t},n.prototype.compareMinX=function(t,e){return t.minX-e.minX},n.prototype.compareMinY=function(t,e){return t.minY-e.minY},n.prototype.toJSON=function(){return this.data},n.prototype.fromJSON=function(t){return this.data=t,this},n.prototype._all=function(t,e){for(var r=[];t;)t.leaf?e.push.apply(e,t.children):r.push.apply(r,t.children),t=r.pop();return e},n.prototype._build=function(t,e,r,n){var i,a=r-e+1,s=this._maxEntries;if(a<=s)return o(i=d(t.slice(e,r+1)),this.toBBox),i;n||(n=Math.ceil(Math.log(a)/Math.log(s)),s=Math.ceil(a/Math.pow(s,n-1)));(i=d([])).leaf=!1;i.height=n;var u=Math.ceil(a/s),l=u*Math.ceil(Math.sqrt(s));_(t,e,r,l,this.compareMinX);for(var h=e;h<=r;h+=l){var c=Math.min(h+l-1,r);_(t,h,c,u,this.compareMinY);for(var p=h;p<=c;p+=u){var f=Math.min(p+u-1,c);i.children.push(this._build(t,p,f,n-1))}}return o(i,this.toBBox),i},n.prototype._chooseSubtree=function(t,e,r,n){for(;n.push(e),!e.leaf&&n.length-1!==r;){for(var i=1/0,o=1/0,a=void 0,s=0;s<e.children.length;s++){var u=e.children[s],l=h(u),c=(p=t,f=u,(Math.max(f.maxX,p.maxX)-Math.min(f.minX,p.minX))*(Math.max(f.maxY,p.maxY)-Math.min(f.minY,p.minY))-l);c<o?(o=c,i=l<i?l:i,a=u):c===o&&l<i&&(i=l,a=u)}e=a||e.children[0]}var p,f;return e},n.prototype._insert=function(t,e,r){var n=r?t:this.toBBox(t),i=[],o=this._chooseSubtree(n,this.data,e,i);for(o.children.push(t),s(o,n);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(n,i,e)},n.prototype._split=function(t,e){var r=t[e],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);var a=this._chooseSplitIndex(r,i,n),s=d(r.children.splice(a,r.children.length-a));s.height=r.height;s.leaf=r.leaf;o(r,this.toBBox);o(s,this.toBBox);e?t[e-1].children.push(s):this._splitRoot(r,s)},n.prototype._splitRoot=function(t,e){this.data=d([t,e]);this.data.height=t.height+1;this.data.leaf=!1;o(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(t,e,r){for(var n,i,o,s,u,l,c,p=1/0,f=1/0,d=e;d<=r-e;d++){var _=a(t,0,d,this.toBBox),g=a(t,d,r,this.toBBox),y=(i=_,o=g,s=Math.max(i.minX,o.minX),u=Math.max(i.minY,o.minY),l=Math.min(i.maxX,o.maxX),c=Math.min(i.maxY,o.maxY),Math.max(0,l-s)*Math.max(0,c-u)),v=h(_)+h(g);y<p?(p=y,n=d,f=v<f?v:f):y===p&&v<f&&(f=v,n=d)}return n||r-e},n.prototype._chooseSplitAxis=function(t,e,r){var n=t.leaf?this.compareMinX:u,i=t.leaf?this.compareMinY:l;this._allDistMargin(t,e,r,n)<this._allDistMargin(t,e,r,i)&&t.children.sort(n)},n.prototype._allDistMargin=function(t,e,r,n){t.children.sort(n);for(var i=this.toBBox,o=a(t,0,e,i),u=a(t,r-e,r,i),l=c(o)+c(u),h=e;h<r-e;h++){var p=t.children[h];s(o,t.leaf?i(p):p);l+=c(o)}for(var f=r-e-1;f>=e;f--){var d=t.children[f];s(u,t.leaf?i(d):d);l+=c(u)}return l},n.prototype._adjustParentBBoxes=function(t,e,r){for(var n=r;n>=0;n--)s(e[n],t)},n.prototype._condense=function(t){for(var e=t.length-1,r=void 0;e>=0;e--)0===t[e].children.length?e>0?(r=t[e-1].children).splice(r.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},n}()},function(t){
/*!
 * PEP v0.5.3 | https://github.com/jquery/PEP
 * Copyright jQuery Foundation and other contributors | http://jquery.org/license
 */
t.exports=function(){"use strict";var t=["bubbles","cancelable","view","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","pageX","pageY"],e=[!1,!1,null,0,0,0,0,!1,!1,!1,!1,0,null,0,0];function r(r,n){n=n||Object.create(null);var i=document.createEvent("Event");i.initEvent(r,n.bubbles||!1,n.cancelable||!1);for(var o,a=2;a<t.length;a++)i[o=t[a]]=n[o]||e[a];i.buttons=n.buttons||0;var s=0;return s=void 0!==n.pressure&&i.buttons?n.pressure:i.buttons?.5:0,i.x=i.clientX,i.y=i.clientY,i.pointerId=n.pointerId||0,i.width=n.width||1,i.height=n.height||1,i.pressure=s,i.tiltX=n.tiltX||0,i.tiltY=n.tiltY||0,i.twist=n.twist||0,i.tangentialPressure=n.tangentialPressure||0,i.pointerType=n.pointerType||"",i.hwTimestamp=n.hwTimestamp||0,i.isPrimary=n.isPrimary||!1,i.detail=0,i}var n=window.Map&&window.Map.prototype.forEach?Map:i;function i(){this.array=[];this.size=0}i.prototype={set:function(t,e){if(void 0===e)return this.delete(t);this.has(t)||this.size++;this.array[t]=e},has:function(t){return void 0!==this.array[t]},"delete":function(t){this.has(t)&&(delete this.array[t],this.size--)},get:function(t){return this.array[t]},clear:function(){this.array.length=0;this.size=0},forEach:function(t,e){return this.array.forEach(function(r,n){t.call(e,r,n,this)},this)}};var o=["bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","buttons","pointerId","width","height","pressure","tiltX","tiltY","pointerType","hwTimestamp","isPrimary","type","target","currentTarget","which","pageX","pageY","timeStamp"],a=[!1,!1,null,null,0,0,0,0,!1,!1,!1,!1,0,null,0,0,0,0,0,0,0,"",0,!1,"",null,null,0,0,0,0],s={pointerover:1,pointerout:1,pointerenter:1,pointerleave:1},u="undefined"!=typeof SVGElementInstance,l={pointermap:new n,eventMap:Object.create(null),captureInfo:Object.create(null),eventSources:Object.create(null),eventSourceList:[],registerSource:function(t,e){var r=e,n=r.events;n&&(n.forEach(function(t){r[t]&&(this.eventMap[t]=r[t].bind(r))},this),this.eventSources[t]=r,this.eventSourceList.push(r))},register:function(t){for(var e,r=this.eventSourceList.length,n=0;n<r&&(e=this.eventSourceList[n]);n++)e.register.call(e,t)},unregister:function(t){for(var e,r=this.eventSourceList.length,n=0;n<r&&(e=this.eventSourceList[n]);n++)e.unregister.call(e,t)},contains:function(t,e){try{return t.contains(e)}catch(t){return!1}},down:function(t){t.bubbles=!0;this.fireEvent("pointerdown",t)},move:function(t){t.bubbles=!0;this.fireEvent("pointermove",t)},up:function(t){t.bubbles=!0;this.fireEvent("pointerup",t)},enter:function(t){t.bubbles=!1;this.fireEvent("pointerenter",t)},leave:function(t){t.bubbles=!1;this.fireEvent("pointerleave",t)},over:function(t){t.bubbles=!0;this.fireEvent("pointerover",t)},out:function(t){t.bubbles=!0;this.fireEvent("pointerout",t)},cancel:function(t){t.bubbles=!0;this.fireEvent("pointercancel",t)},leaveOut:function(t){this.out(t);this.propagate(t,this.leave,!1)},enterOver:function(t){this.over(t);this.propagate(t,this.enter,!0)},eventHandler:function(t){if(!t._handledByPE){var e=t.type,r=this.eventMap&&this.eventMap[e];r&&r(t);t._handledByPE=!0}},listen:function(t,e){e.forEach(function(e){this.addEvent(t,e)},this)},unlisten:function(t,e){e.forEach(function(e){this.removeEvent(t,e)},this)},addEvent:function(t,e){t.addEventListener(e,this.boundHandler)},removeEvent:function(t,e){t.removeEventListener(e,this.boundHandler)},makeEvent:function(t,e){this.captureInfo[e.pointerId]&&(e.relatedTarget=null);var n=new r(t,e);return e.preventDefault&&(n.preventDefault=e.preventDefault),n._target=n._target||e.target,n},fireEvent:function(t,e){var r=this.makeEvent(t,e);return this.dispatchEvent(r)},cloneEvent:function(t){for(var e,r=Object.create(null),n=0;n<o.length;n++)r[e=o[n]]=t[e]||a[n],u&&("target"===e||"relatedTarget"===e)&&r[e]instanceof SVGElementInstance&&(r[e]=r[e].correspondingUseElement);return t.preventDefault&&(r.preventDefault=function(){t.preventDefault()}),r},getTarget:function(t){var e=this.captureInfo[t.pointerId];return e?t._target!==e&&t.type in s?void 0:e:t._target},propagate:function(t,e,r){for(var n=t.target,i=[];null!=n&&n!==document&&!n.contains(t.relatedTarget);)if(i.push(n),!(n=n.parentNode))return;r&&i.reverse();i.forEach(function(r){t.target=r;e.call(this,t)},this)},setCapture:function(t,e,n){this.captureInfo[t]&&this.releaseCapture(t,n);this.captureInfo[t]=e;this.implicitRelease=this.releaseCapture.bind(this,t,n);document.addEventListener("pointerup",this.implicitRelease);document.addEventListener("pointercancel",this.implicitRelease);var i=new r("gotpointercapture",{bubbles:!0});i.pointerId=t;i._target=e;n||this.asyncDispatchEvent(i)},releaseCapture:function(t,e){var n=this.captureInfo[t];if(n){this.captureInfo[t]=void 0;document.removeEventListener("pointerup",this.implicitRelease);document.removeEventListener("pointercancel",this.implicitRelease);var i=new r("lostpointercapture",{bubbles:!0});i.pointerId=t;i._target=n;e||this.asyncDispatchEvent(i)}},dispatchEvent:function(t){var e=this.getTarget(t);if(e)return e.dispatchEvent(t)},asyncDispatchEvent:function(t){requestAnimationFrame(this.dispatchEvent.bind(this,t))}};l.boundHandler=l.eventHandler.bind(l);var h={shadow:function(t){if(t)return t.shadowRoot||t.webkitShadowRoot},canTarget:function(t){return t&&Boolean(t.elementFromPoint)},targetingShadow:function(t){var e=this.shadow(t);if(this.canTarget(e))return e},olderShadow:function(t){var e=t.olderShadowRoot;if(!e){var r=t.querySelector("shadow");r&&(e=r.olderShadowRoot)}return e},allShadows:function(t){for(var e=[],r=this.shadow(t);r;)e.push(r),r=this.olderShadow(r);return e},searchRoot:function(t,e,r){if(t){for(var n,o=t.elementFromPoint(e,r),i=this.targetingShadow(o);i;){if(n=i.elementFromPoint(e,r)){var a=this.targetingShadow(n);return this.searchRoot(a,e,r)||n}i=this.olderShadow(i)}return o}},owner:function(t){for(var e=t;e.parentNode;)e=e.parentNode;return e.nodeType!==Node.DOCUMENT_NODE&&e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&(e=document),e},findTarget:function(t){var e=t.clientX,r=t.clientY,n=this.owner(t.target);return n.elementFromPoint(e,r)||(n=document),this.searchRoot(n,e,r)}},c=Array.prototype.forEach.call.bind(Array.prototype.forEach),p=Array.prototype.map.call.bind(Array.prototype.map),f=Array.prototype.slice.call.bind(Array.prototype.slice),d=Array.prototype.filter.call.bind(Array.prototype.filter),_=window.MutationObserver||window.WebKitMutationObserver,g={subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0,attributeFilter:["touch-action"]};function y(t,e,r,n){this.addCallback=t.bind(n);this.removeCallback=e.bind(n);this.changedCallback=r.bind(n);_&&(this.observer=new _(this.mutationWatcher.bind(this)))}function v(t){return"{ -ms-touch-action: "+t+"; touch-action: "+t+"; }"}y.prototype={watchSubtree:function(t){this.observer&&h.canTarget(t)&&this.observer.observe(t,g)},enableOnSubtree:function(t){this.watchSubtree(t);t===document&&"complete"!==document.readyState?this.installOnLoad():this.installNewSubtree(t)},installNewSubtree:function(t){c(this.findElements(t),this.addElement,this)},findElements:function(t){return t.querySelectorAll?t.querySelectorAll("[touch-action]"):[]},removeElement:function(t){this.removeCallback(t)},addElement:function(t){this.addCallback(t)},elementChanged:function(t,e){this.changedCallback(t,e)},concatLists:function(t,e){return t.concat(f(e))},installOnLoad:function(){document.addEventListener("readystatechange",function(){"complete"===document.readyState&&this.installNewSubtree(document)}.bind(this))},isElement:function(t){return t.nodeType===Node.ELEMENT_NODE},flattenMutationTree:function(t){var e=p(t,this.findElements,this);return e.push(d(t,this.isElement)),e.reduce(this.concatLists,[])},mutationWatcher:function(t){t.forEach(this.mutationHandler,this)},mutationHandler:function(t){"childList"===t.type?(this.flattenMutationTree(t.addedNodes).forEach(this.addElement,this),this.flattenMutationTree(t.removedNodes).forEach(this.removeElement,this)):"attributes"===t.type&&this.elementChanged(t.target,t.oldValue)}};var m=[{selector:'[touch-action="none"]',value:"none"},{selector:'[touch-action="auto"]',value:"auto"},{selector:'[touch-action~="pan-x"]',value:"pan-x"},{selector:'[touch-action~="pan-y"]',value:"pan-y"},{selector:'[touch-action~="pan-up"]',value:"pan-up"},{selector:'[touch-action~="pan-down"]',value:"pan-down"},{selector:'[touch-action~="pan-left"]',value:"pan-left"},{selector:'[touch-action~="pan-right"]',value:"pan-right"}],E="",T=window.PointerEvent||window.MSPointerEvent,S=!window.ShadowDOMPolyfill&&document.head.createShadowRoot,w=l.pointermap,x=[1,4,2,8,16],O=!1;try{O=1===new MouseEvent("test",{buttons:1}).buttons}catch(t){}var R,C={POINTER_ID:1,POINTER_TYPE:"mouse",events:["mousedown","webkitmouseforcechanged","mousemove","mouseup","mouseover","mouseout"],register:function(t){l.listen(t,this.events)},unregister:function(t){l.unlisten(t,this.events)},lastTouches:[],isEventSimulatedFromTouch:function(t){for(var e,r=this.lastTouches,n=t.clientX,i=t.clientY,o=0,a=r.length;o<a&&(e=r[o]);o++){var s=Math.abs(n-e.x),u=Math.abs(i-e.y);if(s<=25&&u<=25)return!0}},prepareEvent:function(t){var e=l.cloneEvent(t),r=e.preventDefault;return e.preventDefault=function(){t.preventDefault();r()},e.pointerId=this.POINTER_ID,e.isPrimary=!0,e.pointerType=this.POINTER_TYPE,"webkitForce"in t&&(e.pressure=t.webkitForce-MouseEvent.WEBKIT_FORCE_AT_MOUSE_DOWN),e},prepareButtonsForMove:function(t,e){var r=w.get(this.POINTER_ID);t.buttons=0!==e.which&&r?r.buttons:0;e.buttons=t.buttons},mousedown:function(t){if(!this.isEventSimulatedFromTouch(t)){var e=w.get(this.POINTER_ID),r=this.prepareEvent(t);O||(r.buttons=x[r.button],e&&(r.buttons|=e.buttons),t.buttons=r.buttons);w.set(this.POINTER_ID,t);e&&0!==e.buttons?l.move(r):l.down(r)}},webkitmouseforcechanged:function(t){this.mousemove(t)},mousemove:function(t){if(!this.isEventSimulatedFromTouch(t)){var e=this.prepareEvent(t);O||this.prepareButtonsForMove(e,t);e.button=-1;w.set(this.POINTER_ID,t);l.move(e)}},mouseup:function(t){if(!this.isEventSimulatedFromTouch(t)){var e=w.get(this.POINTER_ID),r=this.prepareEvent(t);if(!O){var n=x[r.button];r.buttons=e?e.buttons&~n:0;t.buttons=r.buttons}w.set(this.POINTER_ID,t);r.buttons&=~x[r.button];0===r.buttons?l.up(r):l.move(r)}},mouseover:function(t){if(!this.isEventSimulatedFromTouch(t)){var e=this.prepareEvent(t);O||this.prepareButtonsForMove(e,t);e.button=-1;w.set(this.POINTER_ID,t);l.enterOver(e)}},mouseout:function(t){if(!this.isEventSimulatedFromTouch(t)){var e=this.prepareEvent(t);O||this.prepareButtonsForMove(e,t);e.button=-1;l.leaveOut(e)}},cancel:function(t){var e=this.prepareEvent(t);l.cancel(e);this.deactivateMouse()},deactivateMouse:function(){w.delete(this.POINTER_ID)}},P=l.captureInfo,I=h.findTarget.bind(h),b=h.allShadows.bind(h),L=l.pointermap,M={events:["touchstart","touchmove","touchforcechange","touchend","touchcancel"],register:function(t){R.enableOnSubtree(t)},unregister:function(){},elementAdded:function(t){var e=t.getAttribute("touch-action"),r=this.touchActionToScrollType(e);"number"==typeof r&&(t._scrollType=r,l.listen(t,this.events),b(t).forEach(function(t){t._scrollType=r;l.listen(t,this.events)},this))},elementRemoved:function(t){if(L.size>0){var e=this.events;t.addEventListener("touchend",function(){t._scrollType=void 0;l.unlisten(t,e)})}else t._scrollType=void 0,l.unlisten(t,this.events);b(t).forEach(function(t){t._scrollType=void 0;l.unlisten(t,this.events)},this)},elementChanged:function(t,e){var r=t.getAttribute("touch-action"),n=this.touchActionToScrollType(r),i=this.touchActionToScrollType(e);"number"==typeof n&&"number"==typeof i?(t._scrollType=n,b(t).forEach(function(t){t._scrollType=n},this)):"number"==typeof i?this.elementRemoved(t):"number"==typeof n&&this.elementAdded(t)},scrollTypes:{UP:function(t){return t.includes("pan-y")||t.includes("pan-up")?1:0},DOWN:function(t){return t.includes("pan-y")||t.includes("pan-down")?2:0},LEFT:function(t){return t.includes("pan-x")||t.includes("pan-left")?4:0},RIGHT:function(t){return t.includes("pan-x")||t.includes("pan-right")?8:0}},touchActionToScrollType:function(t){if(t){if("auto"===t)return 15;if("none"===t)return 0;var e=t.split(" "),r=this.scrollTypes;return r.UP(e)|r.DOWN(e)|r.LEFT(e)|r.RIGHT(e)}},POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(t){return this.firstTouch===t.identifier},setPrimaryTouch:function(t){(0===L.size||1===L.size&&L.has(1))&&(this.firstTouch=t.identifier,this.firstXY={X:t.clientX,Y:t.clientY},this.scrolling=!1)},removePrimaryPointer:function(t){t.isPrimary&&(this.firstTouch=null,this.firstXY=null)},typeToButtons:function(t){var e=0;return"touchstart"!==t&&"touchmove"!==t&&"touchforcechange"!==t||(e=1),e},touchToPointer:function(t){var e=this.currentTouchEvent,r=l.cloneEvent(t),n=r.pointerId=t.identifier+2;if(r.target=P[n]||I(r),r.bubbles=!0,r.cancelable=!0,r.button=0,r.buttons=this.typeToButtons(e.type),r.width=2*(t.radiusX||t.webkitRadiusX||0),r.height=2*(t.radiusY||t.webkitRadiusY||0),r.pressure=void 0!==t.force?t.force:void 0!==t.webkitForce?t.webkitForce:void 0,r.isPrimary=this.isPrimaryTouch(t),t.altitudeAngle){var i=Math.tan(t.altitudeAngle),o=180/Math.PI;r.tiltX=Math.atan(Math.cos(t.azimuthAngle)/i)*o;r.tiltY=Math.atan(Math.sin(t.azimuthAngle)/i)*o}else r.tiltX=0,r.tiltY=0;r.pointerType="stylus"===t.touchType?"pen":this.POINTER_TYPE;r.altKey=e.altKey;r.ctrlKey=e.ctrlKey;r.metaKey=e.metaKey;r.shiftKey=e.shiftKey;var a=this;return r.preventDefault=function(){a.scrolling=!1;a.firstXY=null;e.preventDefault()},r},processTouches:function(t,e){var r=t.changedTouches;this.currentTouchEvent=t;for(var n,i=0;i<r.length;i++)n=r[i],e.call(this,this.touchToPointer(n))},shouldScroll:function(t){if(this.firstXY){var e,r=t.currentTarget._scrollType;if(0===r)e=!1;else if(15===r)e=!0;else{var n=t.changedTouches[0],i=n.clientY-this.firstXY.Y,o=Math.abs(i),a=n.clientX-this.firstXY.X,s=Math.abs(a),u=1&r,l=2&r,h=4&r,c=8&r;h&&c?e=s>o:h?e=s>o&&a>0:c&&(e=s>o&&a<0);e||(u&&l?e=s<o:u?e=s<o&&i>0:l&&(e=s<o&&i<0))}return this.firstXY=null,e}},findTouch:function(t,e){for(var r,n=0,i=t.length;n<i&&(r=t[n]);n++)if(r.identifier===e)return!0},vacuumTouches:function(t){var e=t.touches;if(L.size>=e.length){var r=[];L.forEach(function(t,n){if(1!==n&&!this.findTouch(e,n-2)){var i=t.out;r.push(i)}},this);r.forEach(this.cancelOut,this)}},touchstart:function(t){this.vacuumTouches(t);this.setPrimaryTouch(t.changedTouches[0]);this.dedupSynthMouse(t);this.scrolling||this.processTouches(t,this.overDown)},overDown:function(t){L.set(t.pointerId,{target:t.target,out:t,outTarget:t.target});l.enterOver(t);l.down(t)},touchforcechange:function(t){this.touchmove(t)},touchmove:function(t){this.scrolling||(this.shouldScroll(t)?(this.scrolling=!0,this.touchcancel(t)):("touchforcechange"!==t.type&&t.preventDefault(),this.processTouches(t,this.moveOverOut)))},moveOverOut:function(t){var e=t,r=L.get(e.pointerId);if(r){var n=r.out,i=r.outTarget;l.move(e);n&&i!==e.target&&(n.relatedTarget=e.target,e.relatedTarget=i,n.target=i,e.target?(l.leaveOut(n),l.enterOver(e)):(e.target=i,e.relatedTarget=null,this.cancelOut(e)));r.out=e;r.outTarget=e.target}},touchend:function(t){this.dedupSynthMouse(t);this.processTouches(t,this.upOut)},upOut:function(t){this.scrolling||(l.up(t),l.leaveOut(t));this.cleanUpPointer(t)},touchcancel:function(t){this.processTouches(t,this.cancelOut)},cancelOut:function(t){l.cancel(t);l.leaveOut(t);this.cleanUpPointer(t)},cleanUpPointer:function(t){L.delete(t.pointerId);this.removePrimaryPointer(t)},dedupSynthMouse:function(t){var e=C.lastTouches,r=t.changedTouches[0];if(this.isPrimaryTouch(r)){var n={x:r.clientX,y:r.clientY};e.push(n);var i=function(t,e){var r=t.indexOf(e);r>-1&&t.splice(r,1)}.bind(null,e,n);setTimeout(i,2500)}}};R=new y(M.elementAdded,M.elementRemoved,M.elementChanged,M);var F,A,N,D=l.pointermap,G=window.MSPointerEvent&&"number"==typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE,j={events:["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerOut","MSPointerOver","MSPointerCancel","MSGotPointerCapture","MSLostPointerCapture"],register:function(t){l.listen(t,this.events)},unregister:function(t){l.unlisten(t,this.events)},POINTER_TYPES:["","unavailable","touch","pen","mouse"],prepareEvent:function(t){var e=t;return G&&((e=l.cloneEvent(t)).pointerType=this.POINTER_TYPES[t.pointerType]),e},cleanup:function(t){D.delete(t)},MSPointerDown:function(t){D.set(t.pointerId,t);var e=this.prepareEvent(t);l.down(e)},MSPointerMove:function(t){var e=this.prepareEvent(t);l.move(e)},MSPointerUp:function(t){var e=this.prepareEvent(t);l.up(e);this.cleanup(t.pointerId)},MSPointerOut:function(t){var e=this.prepareEvent(t);l.leaveOut(e)},MSPointerOver:function(t){var e=this.prepareEvent(t);l.enterOver(e)},MSPointerCancel:function(t){var e=this.prepareEvent(t);l.cancel(e);this.cleanup(t.pointerId)},MSLostPointerCapture:function(t){var e=l.makeEvent("lostpointercapture",t);l.dispatchEvent(e)},MSGotPointerCapture:function(t){var e=l.makeEvent("gotpointercapture",t);l.dispatchEvent(e)}};function k(t){if(!l.pointermap.has(t)){var e=new Error("NotFoundError");throw e.name="NotFoundError",e;}}function U(t){for(var e=t.parentNode;e&&e!==t.ownerDocument;)e=e.parentNode;if(!e){var r=new Error("InvalidStateError");throw r.name="InvalidStateError",r;}}function B(t){return 0!==l.pointermap.get(t).buttons}return window.navigator.msPointerEnabled?(F=function(t){k(t);U(this);B(t)&&(l.setCapture(t,this,!0),this.msSetPointerCapture(t))},A=function(t){k(t);l.releaseCapture(t,!0);this.msReleasePointerCapture(t)}):(F=function(t){k(t);U(this);B(t)&&l.setCapture(t,this)},A=function(t){k(t);l.releaseCapture(t)}),N=function(t){return!!l.captureInfo[t]},function(){if(T){m.forEach(function(t){E+=t.selector+v(t.value)+"\n";S&&(E+=function(t){return"body /shadow-deep/ "+t}(t.selector)+v(t.value)+"\n")});var t=document.createElement("style");t.textContent=E;document.head.appendChild(t)}}(),function(){if(!window.PointerEvent){if(window.PointerEvent=r,window.navigator.msPointerEnabled){var t=window.navigator.msMaxTouchPoints;Object.defineProperty(window.navigator,"maxTouchPoints",{value:t,enumerable:!0});l.registerSource("ms",j)}else Object.defineProperty(window.navigator,"maxTouchPoints",{value:0,enumerable:!0}),l.registerSource("mouse",C),void 0!==window.ontouchstart&&l.registerSource("touch",M);l.register(document)}}(),window.Element&&!Element.prototype.setPointerCapture&&Object.defineProperties(Element.prototype,{setPointerCapture:{value:F},releasePointerCapture:{value:A},hasPointerCapture:{value:N}}),{dispatcher:l,Installer:y,PointerEvent:r,PointerMap:n,targetFinding:h}}()},function(t,e,r){"use strict";t.exports=i;var n=r(4);function i(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0);this.pos=0;this.type=0;this.length=this.buf.length}i.Varint=0;i.Fixed64=1;i.Bytes=2;i.Fixed32=5;var o="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function a(t){return t.type===i.Bytes?t.readVarint()+t.pos:t.pos+1}function s(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function u(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function l(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function h(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function c(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function p(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function f(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function d(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function _(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function g(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function y(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function v(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function m(t,e,r){t[r]=e;t[r+1]=e>>>8;t[r+2]=e>>>16;t[r+3]=e>>>24}function E(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}i.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=7&n;t(i,e,this);this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=v(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=E(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=v(this.buf,this.pos)+4294967296*v(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=v(this.buf,this.pos)+4294967296*E(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=n.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=n.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,o=r.buf;if((i=o[r.pos++],n=(112&i)>>4,i<128)||(i=o[r.pos++],n|=(127&i)<<3,i<128)||(i=o[r.pos++],n|=(127&i)<<10,i<128)||(i=o[r.pos++],n|=(127&i)<<17,i<128)||(i=o[r.pos++],n|=(127&i)<<24,i<128)||(i=o[r.pos++],n|=(1&i)<<31,i<128))return s(t,n,e);throw new Error("Expected varint not more than 10 bytes");}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&o?function(t,e,r){return o.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var n="",i=e;i<r;){var o,a,s,u=t[i],l=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h>r)break;1===h?u<128&&(l=u):2===h?128==(192&(o=t[i+1]))&&(l=(31&u)<<6|63&o)<=127&&(l=null):3===h?(o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&((l=(15&u)<<12|(63&o)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===h&&(o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null));null===l?(l=65533,h=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l);n+=String.fromCharCode(l);i+=h}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==i.Bytes)return t.push(this.readVarint(e));var r=a(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==i.Bytes)return t.push(this.readSVarint());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==i.Bytes)return t.push(this.readBoolean());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==i.Bytes)return t.push(this.readFloat());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==i.Bytes)return t.push(this.readDouble());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==i.Bytes)return t.push(this.readFixed32());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==i.Bytes)return t.push(this.readSFixed32());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==i.Bytes)return t.push(this.readFixed64());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==i.Bytes)return t.push(this.readSFixed64());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===i.Varint)for(;this.buf[this.pos++]>127;);else if(e===i.Bytes)this.pos=this.readVarint()+this.pos;else if(e===i.Fixed32)this.pos+=4;else{if(e!==i.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf);this.buf=r;this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4);m(this.buf,t,this.pos);this.pos+=4},writeSFixed32:function(t){this.realloc(4);m(this.buf,t,this.pos);this.pos+=4},writeFixed64:function(t){this.realloc(8);m(this.buf,-1&t,this.pos);m(this.buf,Math.floor(t*(1/4294967296)),this.pos+4);this.pos+=8},writeSFixed64:function(t){this.realloc(8);m(this.buf,-1&t,this.pos);m(this.buf,Math.floor(t*(1/4294967296)),this.pos+4);this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128;t>>>=7;r.buf[r.pos++]=127&t|128;t>>>=7;r.buf[r.pos++]=127&t|128;t>>>=7;r.buf[r.pos++]=127&t|128;t>>>=7;r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;(e.buf[e.pos++]|=r|((t>>>=3)?128:0),t)&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t)&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t)&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t)&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t)&&(e.buf[e.pos++]=127&t)}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t);this.realloc(4*t.length);this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,o=0;o<e.length;o++){if((n=e.charCodeAt(o))>55295&&n<57344){if(!i){n>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239;t[r++]=191;t[r++]=189;i=n;continue}n=i-55296<<10|n-56320|65536;i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&u(e,r,this);this.pos=e-1;this.writeVarint(r);this.pos+=r},writeFloat:function(t){this.realloc(4);n.write(this.buf,t,this.pos,!0,23,4);this.pos+=4},writeDouble:function(t){this.realloc(8);n.write(this.buf,t,this.pos,!0,52,8);this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e);this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&u(r,n,this);this.pos=r-1;this.writeVarint(n);this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,i.Bytes);this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,l,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,h,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,c,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,_,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,g,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,y,e)},writeBytesField:function(t,e){this.writeTag(t,i.Bytes);this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,i.Fixed32);this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,i.Fixed32);this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,i.Fixed64);this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,i.Fixed64);this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,i.Varint);this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,i.Varint);this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,i.Bytes);this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,i.Fixed32);this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,i.Fixed64);this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},function(t,e,r){var n=r(5);e.Processor=n},function(t,e){e.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,l=u>>1,h=-7,c=r?i-1:0,p=r?-1:1,f=t[e+c];for(c+=p,o=f&(1<<-h)-1,f>>=-h,h+=s;h>0;o=256*o+t[e+c],c+=p,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=256*a+t[e+c],c+=p,h-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n);o-=l}return(f?-1:1)*a*Math.pow(2,o-n)};e.write=function(t,e,r,n,i,o){var a,s,u,l=8*o-i-1,h=(1<<l)-1,c=h>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?1:-1,_=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+c>=1?p/u:p*Math.pow(2,1-c))*u>=2&&(a++,u/=2),a+c>=h?(s=0,a=h):a+c>=1?(s=(e*u-1)*Math.pow(2,i),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;t[r+f]=255&a,f+=d,a/=256,l-=8);t[r+f-d]|=128*_}},function(t,e,r){var n=r(6).newImageData;function i(t){var e=!0;try{new ImageData(10,10)}catch(t){e=!1}function r(t,r,n){return e?new ImageData(t,r,n):{data:t,width:r,height:n}}return function(e){var n,i,o=e.buffers,a=e.meta,s=e.imageOps,u=e.width,l=e.height,h=o.length,c=o[0].byteLength;if(s){var p=new Array(h);for(i=0;i<h;++i)p[i]=r(new Uint8ClampedArray(o[i]),u,l);n=t(p,a).data}else{n=new Uint8ClampedArray(c);var f=new Array(h),d=new Array(h);for(i=0;i<h;++i)f[i]=new Uint8ClampedArray(o[i]),d[i]=[0,0,0,0];for(var _=0;_<c;_+=4){for(var g=0;g<h;++g){var y=f[g];d[g][0]=y[_];d[g][1]=y[_+1];d[g][2]=y[_+2];d[g][3]=y[_+3]}var v=t(d,a);n[_]=v[0];n[_+1]=v[1];n[_+2]=v[2];n[_+3]=v[3]}}return n.buffer}}function o(t,e){var r=Object.keys(t.lib||{}).map(function(e){return"var "+e+" = "+t.lib[e].toString()+";"}).concat(["var __minion__ = ("+i.toString()+")(",t.operation.toString(),");",'self.addEventListener("message", function(event) {',"  var buffer = __minion__(event.data);","  self.postMessage({buffer: buffer, meta: event.data.meta}, [buffer]);","});"]),n=new Blob(r,{type:"text/javascript"}),o=URL.createObjectURL(n),a=new Worker(o);return a.addEventListener("message",e),a}function a(t){var e;this._imageOps=!!t.imageOps;var r=[];if(e=0===t.threads?0:this._imageOps?1:t.threads||1)for(var n=0;n<e;++n)r[n]=o(t,this._onWorkerMessage.bind(this,n));else r[0]=function(t,e){var r=i(t.operation);return{postMessage:function(t){setTimeout(function(){e({data:{buffer:r(t),meta:t.meta}})},0)}}}(t,this._onWorkerMessage.bind(this,0));this._workers=r;this._queue=[];this._maxQueueLength=t.queue||1/0;this._running=0;this._dataLookup={};this._job=null}a.prototype.process=function(t,e,r){this._enqueue({inputs:t,meta:e,callback:r});this._dispatch()};a.prototype.destroy=function(){for(var t in this)this[t]=null;this._destroyed=!0};a.prototype._enqueue=function(t){for(this._queue.push(t);this._queue.length>this._maxQueueLength;)this._queue.shift().callback(null,null)};a.prototype._dispatch=function(){if(0===this._running&&this._queue.length>0){var t=this._job=this._queue.shift(),e=t.inputs[0].width,r=t.inputs[0].height,n=t.inputs.map(function(t){return t.data.buffer}),i=this._workers.length;if(this._running=i,1===i)this._workers[0].postMessage({buffers:n,meta:t.meta,imageOps:this._imageOps,width:e,height:r},n);else for(var o=t.inputs[0].data.length,a=4*Math.ceil(o/4/i),s=0;s<i;++s){for(var u=s*a,l=[],h=0,c=n.length;h<c;++h)l.push(n[s].slice(u,u+a));this._workers[s].postMessage({buffers:l,meta:t.meta,imageOps:this._imageOps,width:e,height:r},l)}}};a.prototype._onWorkerMessage=function(t,e){this._destroyed||(this._dataLookup[t]=e.data,--this._running,0===this._running&&this._resolveJob())};a.prototype._resolveJob=function(){var t,e,r=this._job,i=this._workers.length;if(1===i)t=new Uint8ClampedArray(this._dataLookup[0].buffer),e=this._dataLookup[0].meta;else{var o=r.inputs[0].data.length;t=new Uint8ClampedArray(o);e=new Array(o);for(var a=4*Math.ceil(o/4/i),s=0;s<i;++s){var u=this._dataLookup[s].buffer,l=s*a;t.set(new Uint8ClampedArray(u),l);e[s]=this._dataLookup[s].meta}}this._job=null;this._dataLookup={};r.callback(null,n(t,r.inputs[0].width,r.inputs[0].height),e);this._dispatch()};t.exports=a},function(t,e){var r=!0;try{new ImageData(10,10)}catch(t){r=!1}var n=document.createElement("canvas").getContext("2d");e.newImageData=function(t,e,i){if(r)return new ImageData(t,e,i);var o=n.createImageData(e,i);return o.data.set(t),o}},function(t,e,r){"use strict";function n(){return function(){throw new Error("Unimplemented abstract method.");}()}r.r(e);var i=0;function o(t){return t.ol_uid||(t.ol_uid=String(++i))}var a,s="6.1.1",u=(a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}a(t,e);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),l=function(t){function e(e){var r=this,n="Assertion failed. See https://openlayers.org/en/"+("latest"===s?s:"v"+s.split("-")[0])+"/doc/errors/#"+e+" for details.";return(r=t.call(this,n)||this).code=e,r.name="AssertionError",r.message=n,r}return u(e,t),e}(Error),h={ADD:"add",REMOVE:"remove"},c="propertychange",p="function"==typeof Object.assign?Object.assign:function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(t),n=1,i=arguments.length;n<i;++n){var o=arguments[n];if(null!=o)for(var a in o)o.hasOwnProperty(a)&&(r[a]=o[a])}return r};function f(t){for(var e in t)delete t[e]}var d="function"==typeof Object.values?Object.values:function(t){var e=[];for(var r in t)e.push(t[r]);return e};function _(t){for(var e in t)return!1;return!e}function g(t,e,r,n,i){if(n&&n!==t&&(r=r.bind(n)),i){var o=r;r=function(){t.removeEventListener(e,r);o.apply(this,arguments)}}var a={target:t,type:e,listener:r};return t.addEventListener(e,r),a}function y(t,e,r,n){return g(t,e,r,n,!0)}function v(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),f(t))}var m=function(){function t(){this.disposed_=!1}return t.prototype.dispose=function(){this.disposed_||(this.disposed_=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function E(t,e){return t>e?1:t<e?-1:0}function T(t,e){return t.indexOf(e)>=0}function S(t,e,r){var n=t.length;if(t[0]<=e)return 0;if(e<=t[n-1])return n-1;var i=void 0;if(r>0){for(i=1;i<n;++i)if(t[i]<e)return i-1}else if(r<0){for(i=1;i<n;++i)if(t[i]<=e)return i}else for(i=1;i<n;++i){if(t[i]==e)return i;if(t[i]<e)return t[i-1]-e<e-t[i]?i-1:i}return n-1}function w(t,e,r){for(;e<r;){var n=t[e];t[e]=t[r];t[r]=n;++e;--r}}function x(t,e){for(var r=Array.isArray(e)?e:[e],n=r.length,i=0;i<n;i++)t[t.length]=r[i]}function O(t,e){for(var r,n=t.length>>>0,i=0;i<n;i++)if(e(r=t[i],i,t))return r;return null}function R(t,e){var r=t.length;if(r!==e.length)return!1;for(var n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}function C(t,e){var r;return t.every(function(n,i){return r=i,!e(n,i,t)})?-1:r}function P(){return!0}function I(){return!1}function b(){}function L(t){t.stopPropagation()}var M=function(){function t(t){this.propagationStopped;this.type=t;this.target=null}return t.prototype.preventDefault=function(){this.propagationStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}(),F=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),A=function(t){function e(e){var r=t.call(this)||this;return r.eventTarget_=e,r.pendingRemovals_={},r.dispatching_={},r.listeners_={},r}return F(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var r=this.listeners_[t];r||(r=[],this.listeners_[t]=r);-1===r.indexOf(e)&&r.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t?new M(t):t,r=e.type;e.target||(e.target=this.eventTarget_||this);var n,i=this.listeners_[r];if(i){r in this.dispatching_||(this.dispatching_[r]=0,this.pendingRemovals_[r]=0);++this.dispatching_[r];for(var o=0,a=i.length;o<a;++o)if(!1===i[o].call(this,e)||e.propagationStopped){n=!1;break}if(--this.dispatching_[r],0===this.dispatching_[r]){var s=this.pendingRemovals_[r];for(delete this.pendingRemovals_[r];s--;)this.removeEventListener(r,b);delete this.dispatching_[r]}return n}},e.prototype.disposeInternal=function(){f(this.listeners_)},e.prototype.getListeners=function(t){return this.listeners_[t]},e.prototype.hasListener=function(t){return t?t in this.listeners_:Object.keys(this.listeners_).length>0},e.prototype.removeEventListener=function(t,e){var r=this.listeners_[t];if(r){var n=r.indexOf(e);-1!==n&&(t in this.pendingRemovals_?(r[n]=b,++this.pendingRemovals_[t]):(r.splice(n,1),0===r.length&&delete this.listeners_[t]))}},e}(m),N={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",WHEEL:"wheel"},D=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),G=function(t){function e(){var e=t.call(this)||this;return e.revision_=0,e}return D(e,t),e.prototype.changed=function(){++this.revision_;this.dispatchEvent(N.CHANGE)},e.prototype.getRevision=function(){return this.revision_},e.prototype.on=function(t,e){if(Array.isArray(t)){for(var r=t.length,n=new Array(r),i=0;i<r;++i)n[i]=g(this,t[i],e);return n}return g(this,t,e)},e.prototype.once=function(t,e){if(Array.isArray(t)){for(var r=t.length,n=new Array(r),i=0;i<r;++i)n[i]=y(this,t[i],e);return n}return y(this,t,e)},e.prototype.un=function(t,e){if(Array.isArray(t))for(var r=0,n=t.length;r<n;++r)this.removeEventListener(t[r],e);else this.removeEventListener(t,e)},e}(A),j=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),k=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.key=r,i.oldValue=n,i}return j(e,t),e}(M),U=function(t){function e(e){var r=t.call(this)||this;return o(r),r.values_={},void 0!==e&&r.setProperties(e),r}return j(e,t),e.prototype.get=function(t){var e;return this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e},e.prototype.getKeys=function(){return Object.keys(this.values_)},e.prototype.getProperties=function(){return p({},this.values_)},e.prototype.notify=function(t,e){var r;r=Y(t);this.dispatchEvent(new k(r,t,e));r=c;this.dispatchEvent(new k(r,t,e))},e.prototype.set=function(t,e,r){if(r)this.values_[t]=e;else{var n=this.values_[t];this.values_[t]=e;n!==e&&this.notify(t,n)}},e.prototype.setProperties=function(t,e){for(var r in t)this.set(r,t[r],e)},e.prototype.unset=function(t,e){if(t in this.values_){var r=this.values_[t];delete this.values_[t];e||this.notify(t,r)}},e}(G),B={};function Y(t){return B.hasOwnProperty(t)?B[t]:B[t]="change:"+t}var z=U,X=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),V="length",W=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.element=r,i.index=n,i}return X(e,t),e}(M),Z=function(t){function e(e,r){var n=t.call(this)||this,i=r||{};if(n.unique_=!!i.unique,n.array_=e||[],n.unique_)for(var o=0,a=n.array_.length;o<a;++o)n.assertUnique_(n.array_[o],o);return n.updateLength_(),n}return X(e,t),e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,r=t.length;e<r;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,r=0,n=e.length;r<n;++r)t(e[r],r,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get(V)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e);this.array_.splice(t,0,e);this.updateLength_();this.dispatchEvent(new W(h.ADD,e,t))},e.prototype.pop=function(){return this.removeAt(this.getLength()-1)},e.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},e.prototype.remove=function(t){for(var e=this.array_,r=0,n=e.length;r<n;++r)if(e[r]===t)return this.removeAt(r)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new W(h.REMOVE,e,t)),e},e.prototype.setAt=function(t,e){var r=this.getLength();if(t<r){this.unique_&&this.assertUnique_(e,t);var n=this.array_[t];this.array_[t]=e;this.dispatchEvent(new W(h.REMOVE,n,t));this.dispatchEvent(new W(h.ADD,e,t))}else{for(var i=r;i<t;++i)this.insertAt(i,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set(V,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var r=0,n=this.array_.length;r<n;++r)if(this.array_[r]===t&&r!==e)throw new l(58);},e}(z);function K(t,e){if(!t)throw new l(e);}var H=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),q=function(t){function e(e){var r=t.call(this)||this;if(r.id_=void 0,r.geometryName_="geometry",r.style_=null,r.styleFunction_=void 0,r.geometryChangeKey_=null,r.addEventListener(Y(r.geometryName_),r.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){var n=e;r.setGeometry(n)}else{var i=e;r.setProperties(i)}return r}return H(e,t),e.prototype.clone=function(){var t=new e(this.getProperties());t.setGeometryName(this.getGeometryName());var r=this.getGeometry();r&&t.setGeometry(r.clone());var n=this.getStyle();return n&&t.setStyle(n),t},e.prototype.getGeometry=function(){return this.get(this.geometryName_)},e.prototype.getId=function(){return this.id_},e.prototype.getGeometryName=function(){return this.geometryName_},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.handleGeometryChange_=function(){this.changed()},e.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(v(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=g(t,N.CHANGE,this.handleGeometryChange_,this));this.changed()},e.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},e.prototype.setStyle=function(t){this.style_=t;this.styleFunction_=t?function(t){if("function"==typeof t)return t;var e;return Array.isArray(t)?e=t:(K("function"==typeof t.getZIndex,41),e=[t]),function(){return e}}(t):void 0;this.changed()},e.prototype.setId=function(t){this.id_=t;this.changed()},e.prototype.setGeometryName=function(t){this.removeEventListener(Y(this.geometryName_),this.handleGeometryChanged_);this.geometryName_=t;this.addEventListener(Y(this.geometryName_),this.handleGeometryChanged_);this.handleGeometryChanged_()},e}(z),J={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},Q={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function $(t){for(var e=st(),r=0,n=t.length;r<n;++r)dt(e,t[r]);return e}function tt(t,e,r){return r?(r[0]=t[0]-e,r[1]=t[1]-e,r[2]=t[2]+e,r[3]=t[3]+e,r):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function et(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function rt(t,e,r){var n,i;return(n=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*n+(i=r<t[1]?t[1]-r:t[3]<r?r-t[3]:0)*i}function nt(t,e){return ot(t,e[0],e[1])}function it(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function ot(t,e,r){return t[0]<=e&&e<=t[2]&&t[1]<=r&&r<=t[3]}function at(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=e[0],s=e[1],u=Q.UNKNOWN;return a<r?u|=Q.LEFT:a>i&&(u|=Q.RIGHT),s<n?u|=Q.BELOW:s>o&&(u|=Q.ABOVE),u===Q.UNKNOWN&&(u=Q.INTERSECTING),u}function st(){return[1/0,1/0,-1/0,-1/0]}function ut(t,e,r,n,i){return i?(i[0]=t,i[1]=e,i[2]=r,i[3]=n,i):[t,e,r,n]}function lt(t){return ut(1/0,1/0,-1/0,-1/0,t)}function ht(t,e){var r=t[0],n=t[1];return ut(r,n,r,n,e)}function ct(t,e,r,n,i){return gt(lt(i),t,e,r,n)}function pt(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function ft(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function dt(t,e){e[0]<t[0]&&(t[0]=e[0]);e[0]>t[2]&&(t[2]=e[0]);e[1]<t[1]&&(t[1]=e[1]);e[1]>t[3]&&(t[3]=e[1])}function _t(t,e){for(var r=0,n=e.length;r<n;++r)dt(t,e[r]);return t}function gt(t,e,r,n,i){for(;r<n;r+=i)yt(t,e[r],e[r+1]);return t}function yt(t,e,r){t[0]=Math.min(t[0],e);t[1]=Math.min(t[1],r);t[2]=Math.max(t[2],e);t[3]=Math.max(t[3],r)}function vt(t,e){var r;return(r=e(Et(t)))?r:(r=e(Tt(t)))?r:(r=e(Pt(t)))?r:(r=e(Ct(t)))||!1}function mt(t){var e=0;return Lt(t)||(e=It(t)*Ot(t)),e}function Et(t){return[t[0],t[1]]}function Tt(t){return[t[2],t[1]]}function St(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function wt(t,e){var r;return e===J.BOTTOM_LEFT?r=Et(t):e===J.BOTTOM_RIGHT?r=Tt(t):e===J.TOP_LEFT?r=Ct(t):e===J.TOP_RIGHT?r=Pt(t):K(!1,13),r}function xt(t,e,r,n,i){var o=e*n[0]/2,a=e*n[1]/2,s=Math.cos(r),u=Math.sin(r),l=o*s,h=o*u,c=a*s,p=a*u,f=t[0],d=t[1],_=f-l+p,g=f-l-p,y=f+l-p,v=f+l+p,m=d-h-c,E=d-h+c,T=d+h+c,S=d+h-c;return ut(Math.min(_,g,y,v),Math.min(m,E,T,S),Math.max(_,g,y,v),Math.max(m,E,T,S),i)}function Ot(t){return t[3]-t[1]}function Rt(t,e,r){var n=r||[1/0,1/0,-1/0,-1/0];return bt(t,e)?(n[0]=t[0]>e[0]?t[0]:e[0],n[1]=t[1]>e[1]?t[1]:e[1],n[2]=t[2]<e[2]?t[2]:e[2],n[3]=t[3]<e[3]?t[3]:e[3]):lt(n),n}function Ct(t){return[t[0],t[3]]}function Pt(t){return[t[2],t[3]]}function It(t){return t[2]-t[0]}function bt(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Lt(t){return t[2]<t[0]||t[3]<t[1]}function Mt(t,e){var r=(t[2]-t[0])/2*(e-1),n=(t[3]-t[1])/2*(e-1);t[0]-=r;t[2]+=r;t[1]-=n;t[3]+=n}function Ft(t,e,r){var n=[t[0],t[1],t[0],t[3],t[2],t[1],t[2],t[3]];return e(n,n,2),function(t,e,r){return ut(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),r)}([n[0],n[2],n[4],n[6]],[n[1],n[3],n[5],n[7]],r)}var At={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"},Nt={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"};function Dt(t,e,r,n,i,o){for(var a=o||[],s=0,u=e;u<r;u+=n){var l=t[u],h=t[u+1];a[s++]=i[0]*l+i[2]*h+i[4];a[s++]=i[1]*l+i[3]*h+i[5]}return o&&a.length!=s&&(a.length=s),a}function Gt(t,e,r,n,i,o,a){for(var s=a||[],u=Math.cos(i),l=Math.sin(i),h=o[0],c=o[1],p=0,f=e;f<r;f+=n){var d=t[f]-h,_=t[f+1]-c;s[p++]=h+d*u-_*l;s[p++]=c+d*l+_*u;for(var g=f+2;g<f+n;++g)s[p++]=t[g]}return a&&s.length!=p&&(s.length=p),s}function jt(t,e,r,n,i,o,a){for(var s=a||[],u=0,l=e;l<r;l+=n){s[u++]=t[l]+i;s[u++]=t[l+1]+o;for(var h=l+2;h<l+n;++h)s[u++]=t[h]}return a&&s.length!=u&&(s.length=u),s}function kt(t,e,r){return Math.min(Math.max(t,e),r)}var Ut="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2};function Bt(t,e,r,n,i,o){var a=i-r,s=o-n;if(0!==a||0!==s){var u=((t-r)*a+(e-n)*s)/(a*a+s*s);u>1?(r=i,n=o):u>0&&(r+=a*u,n+=s*u)}return Yt(t,e,r,n)}function Yt(t,e,r,n){var i=r-t,o=n-e;return i*i+o*o}function zt(t){return 180*t/Math.PI}function Xt(t){return t*Math.PI/180}function Vt(t,e){var r=t%e;return r*e<0?r+e:r}function Wt(t,e,r){return t+r*(e-t)}
/**
 * @license
 * Latitude/longitude spherical geodesy formulae taken from
 * http://www.movable-type.co.uk/scripts/latlong.html
 * Licensed under CC-BY-3.0.
 */
var Zt=6371008.8;function Kt(t,e,r){var n=r||Zt,i=Xt(t[1]),o=Xt(e[1]),a=(o-i)/2,s=Xt(e[0]-t[0])/2,u=Math.sin(a)*Math.sin(a)+Math.sin(s)*Math.sin(s)*Math.cos(i)*Math.cos(o);return 2*n*Math.atan2(Math.sqrt(u),Math.sqrt(1-u))}function Ht(t,e){for(var r=0,n=0,i=t.length;n<i-1;++n)r+=Kt(t[n],t[n+1],e);return r}function qt(t,e){for(var r=0,n=t.length,i=t[n-1][0],o=t[n-1][1],a=0;a<n;a++){var s=t[a][0],u=t[a][1];r+=Xt(s-i)*(2+Math.sin(Xt(o))+Math.sin(Xt(u)));i=s;o=u}return r*e*e/2}function Jt(t,e,r,n){var i=n||Zt,o=Xt(t[1]),a=Xt(t[0]),s=e/i,u=Math.asin(Math.sin(o)*Math.cos(s)+Math.cos(o)*Math.sin(s)*Math.cos(r));return[zt(a+Math.atan2(Math.sin(r)*Math.sin(s)*Math.cos(o),Math.cos(s)-Math.sin(o)*Math.sin(u))),zt(u)]}var Qt={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},$t={};$t[Qt.DEGREES]=12741994*Math.PI/360;$t[Qt.FEET]=.3048;$t[Qt.METERS]=1;$t[Qt.USFEET]=1200/3937;var te=Qt,ee=function(){function t(t){this.code_=t.code;this.units_=t.units;this.extent_=void 0!==t.extent?t.extent:null;this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null;this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu";this.global_=void 0!==t.global&&t.global;this.canWrapX_=!(!this.global_||!this.extent_);this.getPointResolutionFunc_=t.getPointResolution;this.defaultTileGrid_=null;this.metersPerUnit_=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||$t[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t;this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t;this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}(),re=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ne=6378137,ie=Math.PI*ne,oe=[-ie,-ie,ie,ie],ae=[-180,-85,180,85],se=function(t){function e(e){return t.call(this,{code:e,units:te.METERS,extent:oe,global:!0,worldExtent:ae,getPointResolution:function(t,e){return t/Ut(e[1]/ne)}})||this}return re(e,t),e}(ee),ue=[new se("EPSG:3857"),new se("EPSG:102100"),new se("EPSG:102113"),new se("EPSG:900913"),new se("urn:ogc:def:crs:EPSG:6.18:3:3857"),new se("urn:ogc:def:crs:EPSG::3857"),new se("http://www.opengis.net/gml/srs/epsg.xml#3857")];function le(t,e,r){var n=t.length,i=r>1?r:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(n));for(var a=ie,s=0;s<n;s+=i){o[s]=a*t[s]/180;var u=ne*Math.log(Math.tan(Math.PI*(+t[s+1]+90)/360));u>a?u=a:u<-a&&(u=-a);o[s+1]=u}return o}function he(t,e,r){var n=t.length,i=r>1?r:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(n));for(var a=0;a<n;a+=i)o[a]=180*t[a]/ie,o[a+1]=360*Math.atan(Math.exp(t[a+1]/ne))/Math.PI-90;return o}var ce=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),pe=[-180,-90,180,90],fe=6378137*Math.PI/180,de=function(t){function e(e,r){return t.call(this,{code:e,units:te.DEGREES,extent:pe,axisOrientation:r,global:!0,metersPerUnit:fe,worldExtent:pe})||this}return ce(e,t),e}(ee),_e=[new de("CRS:84"),new de("EPSG:4326","neu"),new de("urn:ogc:def:crs:EPSG::4326","neu"),new de("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new de("urn:ogc:def:crs:OGC:1.3:CRS84"),new de("urn:ogc:def:crs:OGC:2:84"),new de("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new de("urn:x-ogc:def:crs:EPSG:4326","neu")],ge={};function ye(t,e,r){var n=t.getCode(),i=e.getCode();n in ge||(ge[n]={});ge[n][i]=r}function ve(t,e){var r;return t in ge&&e in ge[t]&&(r=ge[t][e]),r}var me={};function Ee(t,e){var n;if(void 0!==e){for(var i=0,o=t.length;i<o;++i)e[i]=t[i];n=e}else n=t.slice();return n}function Te(t,e){if(void 0!==e&&t!==e){for(var n=0,i=t.length;n<i;++n)e[n]=t[n];t=e}return t}function Se(t){!function(t,e){me[t]=e}(t.getCode(),t);ye(t,t,Ee)}function we(t){return"string"==typeof t?me[t]||null:t||null}function xe(t,e,r,n){var i,o=(t=we(t)).getPointResolutionFunc();if(o)i=o(e,r),n&&n!==t.getUnits()&&(a=t.getMetersPerUnit())&&(i=i*a/$t[n]);else if((t.getUnits()!=te.DEGREES||n)&&n!=te.DEGREES){var a,s=be(t,we("EPSG:4326")),u=[r[0]-e/2,r[1],r[0]+e/2,r[1],r[0],r[1]-e/2,r[0],r[1]+e/2];i=(Kt((u=s(u,u,2)).slice(0,2),u.slice(2,4))+Kt(u.slice(4,6),u.slice(6,8)))/2;void 0!==(a=n?$t[n]:t.getMetersPerUnit())&&(i/=a)}else i=e;return i}function Oe(t){!function(t){t.forEach(Se)}(t);t.forEach(function(e){t.forEach(function(t){e!==t&&ye(e,t,Ee)})})}function Re(t,e){return t?"string"==typeof t?we(t):t:we(e)}function Ce(t){return function(e,r,n){for(var i=e.length,o=void 0!==n?n:2,a=void 0!==r?r:new Array(i),s=0;s<i;s+=o){var u=t([e[s],e[s+1]]);a[s]=u[0];a[s+1]=u[1];for(var l=o-1;l>=2;--l)a[s+l]=e[s+l]}return a}}function Pe(t,e,r,n){var i=we(t),o=we(e);ye(i,o,Ce(r));ye(o,i,Ce(n))}function Ie(t,e){if(t===e)return!0;var r=t.getUnits()===e.getUnits();return t.getCode()===e.getCode()?r:be(t,e)===Ee&&r}function be(t,e){var r=ve(t.getCode(),e.getCode());return r||(r=Te),r}function Le(t,e){return be(we(t),we(e))}function Me(t,e,r){return Le(e,r)(t,void 0,t.length)}function Fe(t,e,r){return Ft(t,Le(e,r))}var Ae,Ne,De,Ge=null;function je(){return Ge}function ke(t,e){return Ge?Me(t,e,Ge):t}function Ue(t,e){return Ge?Me(t,Ge,e):t}function Be(t,e){return Ge?Fe(t,e,Ge):t}function Ye(t,e){return Ge?Fe(t,Ge,e):t}Oe(ue);Oe(_e);Ae=ue;Ne=le;De=he;_e.forEach(function(t){Ae.forEach(function(e){ye(t,e,Ne);ye(e,t,De)})});var ze=new Array(6);function Xe(t){return We(t,1,0,0,1,0,0)}function Ve(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=e[0],l=e[1],h=e[2],c=e[3],p=e[4],f=e[5];return t[0]=r*u+i*l,t[1]=n*u+o*l,t[2]=r*h+i*c,t[3]=n*h+o*c,t[4]=r*p+i*f+a,t[5]=n*p+o*f+s,t}function We(t,e,r,n,i,o,a){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t}function Ze(t,e){var r=e[0],n=e[1];return e[0]=t[0]*r+t[2]*n+t[4],e[1]=t[1]*r+t[3]*n+t[5],e}function Ke(t,e,r){return Ve(t,We(ze,e,0,0,r,0,0))}function He(t,e,r,n,i,o,a,s){var u=Math.sin(o),l=Math.cos(o);return t[0]=n*l,t[1]=i*u,t[2]=-n*u,t[3]=i*l,t[4]=a*n*l-s*n*u+e,t[5]=a*i*u+s*i*l+r,t}function qe(t,e){var r,n=(r=e)[0]*r[3]-r[1]*r[2];K(0!==n,32);var i=e[0],o=e[1],a=e[2],s=e[3],u=e[4],l=e[5];return t[0]=s/n,t[1]=-o/n,t[2]=-a/n,t[3]=i/n,t[4]=(a*l-s*u)/n,t[5]=-(i*l-o*u)/n,t}function Je(t){return"matrix("+t.join(", ")+")"}var Qe=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$e=[1,0,0,1,0,0],tr=function(t){function e(){var e,r,n,i,o,a=t.call(this)||this;return a.extent_=[1/0,1/0,-1/0,-1/0],a.extentRevision_=-1,a.simplifiedGeometryMaxMinSquaredTolerance=0,a.simplifiedGeometryRevision=0,a.simplifyTransformedInternal=(e=function(t,e,r){if(!r)return this.getSimplifiedGeometry(e);var n=this.clone();return n.applyTransform(r),n.getSimplifiedGeometry(e)},o=!1,function(){var t=Array.prototype.slice.call(arguments);return o&&this===i&&R(t,n)||(o=!0,i=this,n=t,r=e.apply(this,arguments)),r}),a}return Qe(e,t),e.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},e.prototype.clone=function(){return n()},e.prototype.closestPointXY=function(){return n()},e.prototype.containsXY=function(t,e){var r=this.getClosestPoint([t,e]);return r[0]===t&&r[1]===e},e.prototype.getClosestPoint=function(t,e){var r=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],r,1/0),r},e.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},e.prototype.computeExtent=function(){return n()},e.prototype.getExtent=function(t){return this.extentRevision_!=this.getRevision()&&(this.extent_=this.computeExtent(this.extent_),this.extentRevision_=this.getRevision()),function(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}(this.extent_,t)},e.prototype.rotate=function(){n()},e.prototype.scale=function(){n()},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(){return n()},e.prototype.getType=function(){return n()},e.prototype.applyTransform=function(){n()},e.prototype.intersectsExtent=function(){return n()},e.prototype.translate=function(){n()},e.prototype.transform=function(t,e){var r=we(t),n=r.getUnits()==te.TILE_PIXELS?function(t,n,i){var o=r.getExtent(),a=r.getWorldExtent(),s=Ot(a)/Ot(o);return He($e,a[0],a[3],s,-s,0,0,0),Dt(t,0,t.length,i,$e,n),Le(r,e)(t,n,i)}:Le(r,e);return this.applyTransform(n),this},e}(z),er=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function rr(t){var e;return t==At.XY?e=2:t==At.XYZ||t==At.XYM?e=3:t==At.XYZM&&(e=4),e}var nr=function(t){function e(){var e=t.call(this)||this;return e.layout=At.XY,e.stride=2,e.flatCoordinates=null,e}return er(e,t),e.prototype.computeExtent=function(t){return ct(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinates=function(){return n()},e.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.getFlatCoordinates=function(){return this.flatCoordinates},e.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},e.prototype.getLayout=function(){return this.layout},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},e.prototype.getSimplifiedGeometryInternal=function(){return this},e.prototype.getStride=function(){return this.stride},e.prototype.setFlatCoordinates=function(t,e){this.stride=rr(t);this.layout=t;this.flatCoordinates=e},e.prototype.setCoordinates=function(){n()},e.prototype.setLayout=function(t,e,r){var n;if(t)n=rr(t);else{for(var i=0;i<r;++i){if(0===e.length)return this.layout=At.XY,void(this.stride=2);e=e[0]}t=function(t){var e;return 2==t?e=At.XY:3==t?e=At.XYZ:4==t&&(e=At.XYZM),e}(n=e.length)}this.layout=t;this.stride=n},e.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},e.prototype.rotate=function(t,e){var r=this.getFlatCoordinates();if(r){var n=this.getStride();Gt(r,0,r.length,n,t,e,r);this.changed()}},e.prototype.scale=function(t,e,r){var n=e;void 0===n&&(n=t);var i=r;i||(i=St(this.getExtent()));var o=this.getFlatCoordinates();if(o){var a=this.getStride();!function(t,e,r,n,i,o,a,s){for(var u=s||[],l=a[0],h=a[1],c=0,p=e;p<r;p+=n){var f=t[p]-l,d=t[p+1]-h;u[c++]=l+i*f;u[c++]=h+o*d;for(var _=p+2;_<p+n;++_)u[c++]=t[_]}s&&u.length!=c&&(u.length=c)}(o,0,o.length,a,t,n,i,o);this.changed()}},e.prototype.translate=function(t,e){var r=this.getFlatCoordinates();if(r){var n=this.getStride();jt(r,0,r.length,n,t,e,r);this.changed()}},e}(tr);function ir(t,e,r,n){for(var i=0,o=t[r-n],a=t[r-n+1];e<r;e+=n){var s=t[e],u=t[e+1];i+=a*s-o*u;o=s;a=u}return i/2}function or(t,e,r,n){for(var i=0,o=0,a=r.length;o<a;++o){var s=r[o];i+=ir(t,e,s,n);e=s}return i}function ar(t,e,r,n,i,o,a){var s,u=t[e],l=t[e+1],h=t[r]-u,c=t[r+1]-l;if(0===h&&0===c)s=e;else{var p=((i-u)*h+(o-l)*c)/(h*h+c*c);if(p>1)s=r;else{if(p>0){for(var f=0;f<n;++f)a[f]=Wt(t[e+f],t[r+f],p);return void(a.length=n)}s=e}}for(f=0;f<n;++f)a[f]=t[s+f];a.length=n}function sr(t,e,r,n,i){var o=t[e],a=t[e+1];for(e+=n;e<r;e+=n){var s=t[e],u=t[e+1],l=Yt(o,a,s,u);l>i&&(i=l);o=s;a=u}return i}function ur(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o];i=sr(t,e,s,n,i);e=s}return i}function lr(t,e,r,n,i,o,a,s,u,l,h){if(e==r)return l;var c,p;if(0===i){if((p=Yt(a,s,t[e],t[e+1]))<l){for(c=0;c<n;++c)u[c]=t[e+c];return u.length=n,p}return l}for(var f=h||[NaN,NaN],d=e+n;d<r;)if(ar(t,d-n,d,n,a,s,f),(p=Yt(a,s,f[0],f[1]))<l){for(l=p,c=0;c<n;++c)u[c]=f[c];u.length=n;d+=n}else d+=n*Math.max((Math.sqrt(p)-Math.sqrt(l))/i|0,1);if(o&&(ar(t,r-n,e,n,a,s,f),(p=Yt(a,s,f[0],f[1]))<l)){for(l=p,c=0;c<n;++c)u[c]=f[c];u.length=n}return l}function hr(t,e,r,n,i,o,a,s,u,l,h){for(var c=h||[NaN,NaN],p=0,f=r.length;p<f;++p){var d=r[p];l=lr(t,e,d,n,i,o,a,s,u,l,c);e=d}return l}function cr(t,e,r){for(var i=0,o=r.length;i<o;++i)t[e++]=r[i];return e}function pr(t,e,r,n){for(var i=0,o=r.length;i<o;++i)for(var a=r[i],s=0;s<n;++s)t[e++]=a[s];return e}function fr(t,e,r,n,i){for(var o=i||[],a=0,s=0,u=r.length;s<u;++s){var l=pr(t,e,r[s],n);o[a++]=l;e=l}return o.length=a,o}function dr(t,e,r,n,i){for(var o=void 0!==i?i:[],a=0,s=e;s<r;s+=n)o[a++]=t.slice(s,s+n);return o.length=a,o}function _r(t,e,r,n,i){for(var o=void 0!==i?i:[],a=0,s=0,u=r.length;s<u;++s){var l=r[s];o[a++]=dr(t,e,l,n,o[a]);e=l}return o.length=a,o}function gr(t,e,r,n,i){for(var o=void 0!==i?i:[],a=0,s=0,u=r.length;s<u;++s){var l=r[s];o[a++]=_r(t,e,l,n,o[a]);e=l[l.length-1]}return o.length=a,o}function yr(t,e,r,n,i,o,a){var s=(r-e)/n;if(s<3){for(;e<r;e+=n)o[a++]=t[e],o[a++]=t[e+1];return a}var u=new Array(s);u[0]=1;u[s-1]=1;for(var l=[e,r-n],h=0;l.length>0;){for(var c=l.pop(),p=l.pop(),f=0,d=t[p],_=t[p+1],g=t[c],y=t[c+1],v=p+n;v<c;v+=n){var m=Bt(t[v],t[v+1],d,_,g,y);m>f&&(h=v,f=m)}f>i&&(u[(h-e)/n]=1,p+n<h&&l.push(p,h),h+n<c&&l.push(h,c))}for(v=0;v<s;++v)u[v]&&(o[a++]=t[e+v*n],o[a++]=t[e+v*n+1]);return a}function vr(t,e,r,n,i,o,a,s){for(var u=0,l=r.length;u<l;++u){var h=r[u];a=yr(t,e,h,n,i,o,a);s.push(a);e=h}return a}function mr(t,e){return e*Math.round(t/e)}function Er(t,e,r,n,i,o,a){if(e==r)return a;var s,u,l=mr(t[e],i),h=mr(t[e+1],i);e+=n;o[a++]=l;o[a++]=h;do if(s=mr(t[e],i),u=mr(t[e+1],i),(e+=n)==r)return o[a++]=s,o[a++]=u,a;while(s==l&&u==h);for(;e<r;){var c=mr(t[e],i),p=mr(t[e+1],i);if(e+=n,c!=s||p!=u){var f=s-l,d=u-h,_=c-l,g=p-h;f*g==d*_&&(f<0&&_<f||f==_||f>0&&_>f)&&(d<0&&g<d||d==g||d>0&&g>d)?(s=c,u=p):(o[a++]=s,o[a++]=u,l=s,h=u,s=c,u=p)}}return o[a++]=s,o[a++]=u,a}function Tr(t,e,r,n,i,o,a,s){for(var u=0,l=r.length;u<l;++u){var h=r[u];a=Er(t,e,h,n,i,o,a);s.push(a);e=h}return a}var Sr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wr=function(t){function e(e,r){var n=t.call(this)||this;return n.maxDelta_=-1,n.maxDeltaRevision_=-1,void 0===r||Array.isArray(e[0])?n.setCoordinates(e,r):n.setFlatCoordinates(r,e),n}return Sr(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,r,n){return n<rt(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(sr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),lr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,r,n))},e.prototype.getArea=function(){return ir(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return dr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[];return r.length=yr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r,0),new e(r,At.XY)},e.prototype.getType=function(){return Nt.LINEAR_RING},e.prototype.intersectsExtent=function(){return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1);this.flatCoordinates||(this.flatCoordinates=[]);this.flatCoordinates.length=pr(this.flatCoordinates,0,t,this.stride);this.changed()},e}(nr),xr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Or=function(t){function e(e,r){var n=t.call(this)||this;return n.setCoordinates(e,r),n}return xr(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,r,n){var i=this.flatCoordinates,o=Yt(t,e,i[0],i[1]);if(o<n){for(var a=this.stride,s=0;s<a;++s)r[s]=i[s];return r.length=a,o}return n},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return ht(this.flatCoordinates,t)},e.prototype.getType=function(){return Nt.POINT},e.prototype.intersectsExtent=function(t){return ot(t,this.flatCoordinates[0],this.flatCoordinates[1])},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,0);this.flatCoordinates||(this.flatCoordinates=[]);this.flatCoordinates.length=cr(this.flatCoordinates,0,t,this.stride);this.changed()},e}(nr);function Rr(t,e,r,n,i){return!vt(i,function(i){return!Cr(t,e,r,n,i[0],i[1])})}function Cr(t,e,r,n,i,o){for(var a=0,s=t[r-n],u=t[r-n+1];e<r;e+=n){var l=t[e],h=t[e+1];u<=o?h>o&&(l-s)*(o-u)-(i-s)*(h-u)>0&&a++:h<=o&&(l-s)*(o-u)-(i-s)*(h-u)<0&&a--;s=l;u=h}return 0!==a}function Pr(t,e,r,n,i,o){if(0===r.length||!Cr(t,e,r[0],n,i,o))return!1;for(var a=1,s=r.length;a<s;++a)if(Cr(t,r[a-1],r[a],n,i,o))return!1;return!0}function Ir(t,e,r,n,i,o,a){for(var s,u,l,h,c,p,f,d=i[o+1],_=[],g=0,y=r.length;g<y;++g){var v=r[g];for(h=t[v-n],p=t[v-n+1],s=e;s<v;s+=n)c=t[s],f=t[s+1],(d<=p&&f<=d||p<=d&&d<=f)&&(l=(d-p)/(f-p)*(c-h)+h,_.push(l)),h=c,p=f}var m=NaN,T=-1/0;for(_.sort(E),h=_[0],s=1,u=_.length;s<u;++s){c=_[s];var S=Math.abs(c-h);S>T&&Pr(t,e,r,n,l=(h+c)/2,d)&&(m=l,T=S);h=c}return isNaN(m)&&(m=i[o]),a?(a.push(m,d,T),a):[m,d,T]}function br(t,e,r,n,i){for(var o=[],a=0,s=r.length;a<s;++a){var u=r[a];o=Ir(t,e,u,n,i,2*a,o);e=u[u.length-1]}return o}function Lr(t,e,r,n,i){for(var o,a=[t[e],t[e+1]],s=[];e+n<r;e+=n){if(s[0]=t[e+n],s[1]=t[e+n+1],o=i(a,s))return o;a[0]=s[0];a[1]=s[1]}return!1}function Mr(t,e,r,n,i){var o=gt([1/0,1/0,-1/0,-1/0],t,e,r,n);return!!bt(i,o)&&(!!it(i,o)||o[0]>=i[0]&&o[2]<=i[2]||o[1]>=i[1]&&o[3]<=i[3]||Lr(t,e,r,n,function(t,e){return function(t,e,r){var n=!1,i=at(t,e),o=at(t,r);if(i===Q.INTERSECTING||o===Q.INTERSECTING)n=!0;else{var a=t[0],s=t[1],u=t[2],l=t[3],h=e[0],c=e[1],p=r[0],f=r[1],d=(f-c)/(p-h),_=void 0,g=void 0;o&Q.ABOVE&&!(i&Q.ABOVE)&&(n=(_=p-(f-l)/d)>=a&&_<=u);n||!(o&Q.RIGHT)||i&Q.RIGHT||(n=(g=f-(p-u)*d)>=s&&g<=l);n||!(o&Q.BELOW)||i&Q.BELOW||(n=(_=p-(f-s)/d)>=a&&_<=u);n||!(o&Q.LEFT)||i&Q.LEFT||(n=(g=f-(p-a)*d)>=s&&g<=l)}return n}(i,t,e)}))}function Fr(t,e,r,n,i){if(!function(t,e,r,n,i){return!!Mr(t,e,r,n,i)||!!Cr(t,e,r,n,i[0],i[1])||!!Cr(t,e,r,n,i[0],i[3])||!!Cr(t,e,r,n,i[2],i[1])||!!Cr(t,e,r,n,i[2],i[3])}(t,e,r[0],n,i))return!1;if(1===r.length)return!0;for(var o=1,a=r.length;o<a;++o)if(Rr(t,r[o-1],r[o],n,i)&&!Mr(t,r[o-1],r[o],n,i))return!1;return!0}function Ar(t,e,r,n){for(;e<r-n;){for(var i=0;i<n;++i){var o=t[e+i];t[e+i]=t[r-n+i];t[r-n+i]=o}e+=n;r-=n}}function Nr(t,e,r,n){for(var i=0,o=t[r-n],a=t[r-n+1];e<r;e+=n){var s=t[e],u=t[e+1];i+=(s-o)*(u+a);o=s;a=u}return i>0}function Dr(t,e,r,n,i){for(var o=void 0!==i&&i,a=0,s=r.length;a<s;++a){var u=r[a],l=Nr(t,e,u,n);if(0===a){if(o&&l||!o&&!l)return!1}else if(o&&!l||!o&&l)return!1;e=u}return!0}function Gr(t,e,r,n,i){for(var o=void 0!==i&&i,a=0,s=r.length;a<s;++a){var u=r[a],l=Nr(t,e,u,n);(0===a?o&&l||!o&&!l:o&&!l||!o&&l)&&Ar(t,e,u,n);e=u}return e}function jr(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o)e=Gr(t,e,r[o],n,i);return e}var kr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ur=function(t){function e(e,r,n){var i=t.call(this)||this;return i.ends_=[],i.flatInteriorPointRevision_=-1,i.flatInteriorPoint_=null,i.maxDelta_=-1,i.maxDeltaRevision_=-1,i.orientedRevision_=-1,i.orientedFlatCoordinates_=null,void 0!==r&&n?(i.setFlatCoordinates(r,e),i.ends_=n):i.setCoordinates(e,r),i}return kr(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?x(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice();this.ends_.push(this.flatCoordinates.length);this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},e.prototype.closestPointXY=function(t,e,r,n){return n<rt(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ur(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),hr(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,r,n))},e.prototype.containsXY=function(t,e){return Pr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return or(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Gr(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,_r(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=St(this.getExtent());this.flatInteriorPoint_=Ir(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0);this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new Or(this.getFlatInteriorPoint(),At.XYM)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new wr(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,r=this.ends_,n=[],i=0,o=0,a=r.length;o<a;++o){var s=r[o],u=new wr(e.slice(i,s),t);n.push(u);i=s}return n},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;Dr(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Gr(this.orientedFlatCoordinates_,0,this.ends_,this.stride));this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],n=[];return r.length=Tr(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),r,0,n),new e(r,At.XY,n)},e.prototype.getType=function(){return Nt.POLYGON},e.prototype.intersectsExtent=function(t){return Fr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2);this.flatCoordinates||(this.flatCoordinates=[]);var r=fr(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===r.length?0:r[r.length-1];this.changed()},e}(nr),Br=Ur;function Yr(t,e,r,n){for(var i=r||32,o=[],a=0;a<i;++a)x(o,Jt(t,e,2*Math.PI*a/i,n));return o.push(o[0],o[1]),new Ur(o,At.XY,[o.length])}function zr(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=[e,r,e,i,n,i,n,r,e,r];return new Ur(o,At.XY,[o.length])}function Xr(t,e,r){for(var n=e||32,i=t.getStride(),o=t.getLayout(),a=t.getCenter(),s=i*(n+1),u=new Array(s),l=0;l<s;l+=i){u[l]=0;u[l+1]=0;for(var h=2;h<i;h++)u[l+h]=a[h]}var c=[u.length],p=new Ur(u,o,c);return Vr(p,a,t.getRadius(),r),p}function Vr(t,e,r,n){for(var i=t.getFlatCoordinates(),o=t.getStride(),a=i.length/o-1,s=n||0,u=0;u<=a;++u){var l=u*o,h=s+2*Vt(u,a)*Math.PI/a;i[l]=e[0]+r*Math.cos(h);i[l+1]=e[1]+r*Math.sin(h)}t.changed()}var Wr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Zr={ACCURACY:"accuracy",ACCURACY_GEOMETRY:"accuracyGeometry",ALTITUDE:"altitude",ALTITUDE_ACCURACY:"altitudeAccuracy",HEADING:"heading",POSITION:"position",PROJECTION:"projection",SPEED:"speed",TRACKING:"tracking",TRACKING_OPTIONS:"trackingOptions"},Kr=function(t){function e(e){var r=t.call(this,N.ERROR)||this;return r.code=e.code,r.message=e.message,r}return Wr(e,t),e}(M),Hr=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.position_=null,r.transform_=Te,r.watchId_=void 0,r.addEventListener(Y(Zr.PROJECTION),r.handleProjectionChanged_),r.addEventListener(Y(Zr.TRACKING),r.handleTrackingChanged_),void 0!==n.projection&&r.setProjection(n.projection),void 0!==n.trackingOptions&&r.setTrackingOptions(n.trackingOptions),r.setTracking(void 0!==n.tracking&&n.tracking),r}return Wr(e,t),e.prototype.disposeInternal=function(){this.setTracking(!1);t.prototype.disposeInternal.call(this)},e.prototype.handleProjectionChanged_=function(){var t=this.getProjection();t&&(this.transform_=be(we("EPSG:4326"),t),this.position_&&this.set(Zr.POSITION,this.transform_(this.position_)))},e.prototype.handleTrackingChanged_=function(){if("geolocation"in navigator){var t=this.getTracking();t&&void 0===this.watchId_?this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions()):t||void 0===this.watchId_||(navigator.geolocation.clearWatch(this.watchId_),this.watchId_=void 0)}},e.prototype.positionChange_=function(t){var e=t.coords;this.set(Zr.ACCURACY,e.accuracy);this.set(Zr.ALTITUDE,null===e.altitude?void 0:e.altitude);this.set(Zr.ALTITUDE_ACCURACY,null===e.altitudeAccuracy?void 0:e.altitudeAccuracy);this.set(Zr.HEADING,null===e.heading?void 0:Xt(e.heading));this.position_?(this.position_[0]=e.longitude,this.position_[1]=e.latitude):this.position_=[e.longitude,e.latitude];var r=this.transform_(this.position_);this.set(Zr.POSITION,r);this.set(Zr.SPEED,null===e.speed?void 0:e.speed);var n=Yr(this.position_,e.accuracy);n.applyTransform(this.transform_);this.set(Zr.ACCURACY_GEOMETRY,n);this.changed()},e.prototype.positionError_=function(t){this.setTracking(!1);this.dispatchEvent(new Kr(t))},e.prototype.getAccuracy=function(){return this.get(Zr.ACCURACY)},e.prototype.getAccuracyGeometry=function(){return this.get(Zr.ACCURACY_GEOMETRY)||null},e.prototype.getAltitude=function(){return this.get(Zr.ALTITUDE)},e.prototype.getAltitudeAccuracy=function(){return this.get(Zr.ALTITUDE_ACCURACY)},e.prototype.getHeading=function(){return this.get(Zr.HEADING)},e.prototype.getPosition=function(){return this.get(Zr.POSITION)},e.prototype.getProjection=function(){return this.get(Zr.PROJECTION)},e.prototype.getSpeed=function(){return this.get(Zr.SPEED)},e.prototype.getTracking=function(){return this.get(Zr.TRACKING)},e.prototype.getTrackingOptions=function(){return this.get(Zr.TRACKING_OPTIONS)},e.prototype.setProjection=function(t){this.set(Zr.PROJECTION,we(t))},e.prototype.setTracking=function(t){this.set(Zr.TRACKING,t)},e.prototype.setTrackingOptions=function(t){this.set(Zr.TRACKING_OPTIONS,t)},e}(z),qr=function(){function t(t,e,r){this.decay_=t;this.minVelocity_=e;this.delay_=r;this.points_=[];this.angle_=0;this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0;this.angle_=0;this.initialVelocity_=0},t.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;for(var r=e-3;r>0&&this.points_[r+2]>t;)r-=3;var n=this.points_[e+2]-this.points_[r+2];if(n<1e3/60)return!1;var i=this.points_[e]-this.points_[r],o=this.points_[e+1]-this.points_[r+1];return this.angle_=Math.atan2(o,i),this.initialVelocity_=Math.sqrt(i*i+o*o)/n,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),Jr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qr=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.map=r,i.frameState=void 0!==n?n:null,i}return Jr(e,t),e}(M),$r=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),tn=function(t){function e(e,r,n,i,o){var a=t.call(this,e,r,o)||this;return a.originalEvent=n,a.pixel_=null,a.coordinate_=null,a.dragging=void 0!==i&&i,a}return $r(e,t),Object.defineProperty(e.prototype,"pixel",{get:function(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_},set:function(t){this.pixel_=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"coordinate",{get:function(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_},set:function(t){this.coordinate_=t},enumerable:!0,configurable:!0}),e.prototype.preventDefault=function(){t.prototype.preventDefault.call(this);this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this);this.originalEvent.stopPropagation()},e}(Qr),en=(r(1),"undefined"!=typeof navigator?navigator.userAgent.toLowerCase():""),rn=-1!==en.indexOf("firefox"),nn=(-1!==en.indexOf("safari")&&en.indexOf("chrom"),-1!==en.indexOf("webkit")&&-1==en.indexOf("edge")),on=-1!==en.indexOf("macintosh"),an=window.devicePixelRatio||1,sn="undefined"!=typeof Image&&Image.prototype.decode,un={SINGLECLICK:"singleclick",CLICK:N.CLICK,DBLCLICK:N.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},ln=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),hn=function(t){function e(e,r,n,i,o){var a=t.call(this,e,r,n,i,o)||this;return a.pointerEvent=n,a}return ln(e,t),e}(tn),cn={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},pn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),fn=function(t){function e(e,r){var n=t.call(this,e)||this;n.map_=e;n.clickTimeoutId_;n.dragging_=!1;n.dragListenerKeys_=[];n.moveTolerance_=r?r*an:an;n.down_=null;var i=n.map_.getViewport();return n.activePointers_=0,n.trackedTouches_={},n.element_=i,n.pointerdownListenerKey_=g(i,cn.POINTERDOWN,n.handlePointerDown_,n),n.relayedListenerKey_=g(i,cn.POINTERMOVE,n.relayEvent_,n),n}return pn(e,t),e.prototype.emulateClick_=function(t){var e=new hn(un.CLICK,this.map_,t);this.dispatchEvent(e);void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new hn(un.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new hn(un.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==un.POINTERUP||e.type==un.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==un.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0);this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new hn(un.POINTERUP,this.map_,t);this.dispatchEvent(e);e.propagationStopped||this.dragging_||!this.isMouseActionButton_(t)||this.emulateClick_(this.down_);0===this.activePointers_&&(this.dragListenerKeys_.forEach(v),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},e.prototype.isMouseActionButton_=function(t){return 0===t.button},e.prototype.handlePointerDown_=function(t){this.updateActivePointers_(t);var e=new hn(un.POINTERDOWN,this.map_,t);this.dispatchEvent(e);this.down_=t;0===this.dragListenerKeys_.length&&this.dragListenerKeys_.push(g(document,un.POINTERMOVE,this.handlePointerMove_,this),g(document,un.POINTERUP,this.handlePointerUp_,this),g(this.element_,un.POINTERCANCEL,this.handlePointerUp_,this))},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new hn(un.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(e)}},e.prototype.relayEvent_=function(t){var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new hn(t.type,this.map_,t,e))},e.prototype.isMoving_=function(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(v(this.relayedListenerKey_),this.relayedListenerKey_=null);this.pointerdownListenerKey_&&(v(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null);this.dragListenerKeys_.forEach(v);this.dragListenerKeys_.length=0;this.element_=null;t.prototype.disposeInternal.call(this)},e}(A),dn="postrender",_n="movestart",gn="moveend",yn={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},vn="prerender",mn="postrender",En="precompose",Tn="postcompose",Sn="rendercomplete",wn={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4,ABORT:5},xn=function(){function t(t,e){this.priorityFunction_=t;this.keyFunction_=e;this.elements_=[];this.priorities_=[];this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0;this.priorities_.length=0;f(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,r=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var n=this.keyFunction_(r);return delete this.queuedElements_[n],r},t.prototype.enqueue=function(t){K(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=1/0&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){for(var t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,r=this.priorities_,n=e.length,i=e[t],o=r[t],a=t;t<n>>1;){var s=this.getLeftChildIndex_(t),u=this.getRightChildIndex_(t),l=u<n&&r[u]<r[s]?u:s;e[t]=e[l];r[t]=r[l];t=l}e[t]=i;r[t]=o;this.siftDown_(a,t)},t.prototype.siftDown_=function(t,e){for(var r=this.elements_,n=this.priorities_,i=r[e],o=n[e];e>t;){var a=this.getParentIndex_(e);if(!(n[a]>o))break;r[e]=r[a];n[e]=n[a];e=a}r[e]=i;n[e]=o},t.prototype.reprioritize=function(){for(var t,r,n=this.priorityFunction_,i=this.elements_,o=this.priorities_,a=0,s=i.length,e=0;e<s;++e)(r=n(t=i[e]))==1/0?delete this.queuedElements_[this.keyFunction_(t)]:(o[a]=r,i[a++]=t);i.length=a;o.length=a;this.heapify_()},t}(),On=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Rn=function(t){function e(e,r){var n=t.call(this,function(t){return e.apply(null,t)},function(t){return t[0].getKey()})||this;return n.boundHandleTileChange_=n.handleTileChange.bind(n),n.tileChangeCallback_=r,n.tilesLoading_=0,n.tilesLoadingKeys_={},n}return On(e,t),e.prototype.enqueue=function(e){var r=t.prototype.enqueue.call(this,e);return r&&e[0].addEventListener(N.CHANGE,this.boundHandleTileChange_),r},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,r=e.getState();if(e.hifi&&r===wn.LOADED||r===wn.ERROR||r===wn.EMPTY||r===wn.ABORT){e.removeEventListener(N.CHANGE,this.boundHandleTileChange_);var n=e.getKey();n in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[n],--this.tilesLoading_);this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var r,n,i,o=0,a=!1;this.tilesLoading_<t&&o<e&&this.getCount()>0;)i=(n=this.dequeue()[0]).getKey(),(r=n.getState())===wn.ABORT?a=!0:r!==wn.IDLE||i in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[i]=!0,++this.tilesLoading_,++o,n.load());0===o&&a&&this.tileChangeCallback_()},e}(xn),Cn=42,Pn=256;function In(t,e,r){return function(n,i,o,a){if(n){var s=e?0:o[0]*i,u=e?0:o[1]*i,l=t[0]+s/2,h=t[2]-s/2,c=t[1]+u/2,p=t[3]-u/2;l>h&&(h=l=(h+l)/2);c>p&&(p=c=(p+c)/2);var f=kt(n[0],l,h),d=kt(n[1],c,p),_=30*i;return a&&r&&(f+=-_*Math.log(1+Math.max(0,l-n[0])/_)+_*Math.log(1+Math.max(0,n[0]-h)/_),d+=-_*Math.log(1+Math.max(0,c-n[1])/_)+_*Math.log(1+Math.max(0,n[1]-p)/_)),[f,d]}}}function bn(t){return t}function Ln(t,e,r){var n=It(e)/r[0],i=Ot(e)/r[1];return Math.min(t,Math.min(n,i))}function Mn(t,e,r){var n=Math.min(t,e);return n*=Math.log(1+50*Math.max(0,t/e-1))/50+1,r&&(n=Math.max(n,r),n/=Math.log(1+50*Math.max(0,r/t-1))/50+1),kt(n,r/2,2*e)}function Fn(t,e,r,n){return function(i,o,a,s){if(void 0!==i){var u=n?Ln(t,n,a):t;return(void 0===r||r)&&s?Mn(i,u,e):kt(i,e,u)}}}function An(t){if(void 0!==t)return 0}function Nn(t){if(void 0!==t)return t}var Dn=0,Gn=1,jn="center",kn="resolution",Un="rotation";function Bn(t,e,r){var n=void 0!==r?t.toFixed(r):""+t,i=n.indexOf(".");return(i=-1===i?n.length:i)>e?n:new Array(1+e-i).join("0")+n}function Yn(t,e){for(var r=(""+t).split("."),n=(""+e).split("."),i=0;i<Math.max(r.length,n.length);i++){var o=parseInt(r[i]||"0",10),a=parseInt(n[i]||"0",10);if(o>a)return 1;if(a>o)return-1}return 0}function zn(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function Xn(t,e){var r,n,i=t[0],o=t[1],a=e[0],s=e[1],u=a[0],l=a[1],h=s[0],c=s[1],p=h-u,f=c-l,d=0===p&&0===f?0:(p*(i-u)+f*(o-l))/(p*p+f*f||0);return d<=0?(r=u,n=l):d>=1?(r=h,n=c):(r=u+d*p,n=l+d*f),[r,n]}function Vn(t,e,r){var n=Vt(e+180,360)-180,i=Math.abs(3600*n),o=r||0,a=Math.pow(10,o),s=Math.floor(i/3600),u=Math.floor((i-3600*s)/60),l=i-3600*s-60*u;return(l=Math.ceil(l*a)/a)>=60&&(l=0,u+=1),u>=60&&(u=0,s+=1),s+"° "+Bn(u,2)+"′ "+Bn(l,2,o)+"″"+(0==n?"":" "+t.charAt(n<0?1:0))}function Wn(t,e,r){return t?e.replace("{x}",t[0].toFixed(r)).replace("{y}",t[1].toFixed(r)):""}function Zn(t,e){for(var r=!0,n=t.length-1;n>=0;--n)if(t[n]!=e[n]){r=!1;break}return r}function Kn(t,e){var r=Math.cos(e),n=Math.sin(e),i=t[0]*r-t[1]*n,o=t[1]*r+t[0]*n;return t[0]=i,t[1]=o,t}function Hn(t,e){return t[0]*=e,t[1]*=e,t}function qn(t,e){var r=t[0]-e[0],n=t[1]-e[1];return r*r+n*n}function Jn(t,e){return Math.sqrt(qn(t,e))}function Qn(t,e){return qn(t,Xn(t,e))}function $n(t,e){return Wn(t,"{x}, {y}",e)}function ti(t){return Math.pow(t,3)}function ei(t){return 1-ti(1-t)}function ri(t){return 3*t*t-2*t*t*t}function ni(t){return t}var ii=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),oi=0;function ai(t,e){setTimeout(function(){t(e)},0)}function si(t){return!(t.sourceCenter&&t.targetCenter&&!Zn(t.sourceCenter,t.targetCenter))&&t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation}var ui=function(t){function e(e){var r=t.call(this)||this,n=p({},e);return r.hints_=[0,0],r.animations_=[],r.updateAnimationKey_,r.projection_=Re(n.projection,"EPSG:3857"),r.targetCenter_=null,r.targetResolution_,r.targetRotation_,n.center&&(n.center=Ue(n.center,r.projection_)),n.extent&&(n.extent=Ye(n.extent,r.projection_)),r.applyOptions_(n),r}return ii(e,t),e.prototype.applyOptions_=function(t){var e=function(t){var e,r,n,i=void 0!==t.minZoom?t.minZoom:oi,o=void 0!==t.maxZoom?t.maxZoom:28,a=void 0!==t.zoomFactor?t.zoomFactor:2,s=void 0!==t.multiWorld&&t.multiWorld,u=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,l=Re(t.projection,"EPSG:3857"),h=l.getExtent(),c=t.constrainOnlyCenter,p=t.extent;if(s||p||!l.isGlobal()||(c=!1,p=h),void 0!==t.resolutions){var f=t.resolutions;r=f[i];n=void 0!==f[o]?f[o]:f[f.length-1];e=t.constrainResolution?function(t,e,r){return function(n,i,o,a){if(void 0!==n){var s=t[0],u=t[t.length-1],l=r?Ln(s,r,o):s;if(a)return void 0===e||e?Mn(n,l,u):kt(n,u,l);var h=Math.min(l,n),c=Math.floor(S(t,h,i));return t[c]>l&&c<t.length-1?t[c+1]:t[c]}}}(f,u,!c&&p):Fn(r,n,u,!c&&p)}else{var d=(h?Math.max(It(h),Ot(h)):360*$t[te.DEGREES]/l.getMetersPerUnit())/Pn/Math.pow(2,oi),_=d/Math.pow(2,28-oi);void 0!==(r=t.maxResolution)?i=0:r=d/Math.pow(a,i);void 0===(n=t.minResolution)&&(n=void 0!==t.maxZoom?void 0!==t.maxResolution?r/Math.pow(a,o):d/Math.pow(a,o):_);o=i+Math.floor(Math.log(r/n)/Math.log(a));n=r/Math.pow(a,o-i);e=t.constrainResolution?function(t,e,r,n,i){return function(o,a,s,u){if(void 0!==o){var l=i?Ln(e,i,s):e,h=void 0!==r?r:0;if(u)return void 0===n||n?Mn(o,l,h):kt(o,h,l);var c=Math.ceil(Math.log(e/l)/Math.log(t)-1e-9),p=-a*(.5-1e-9)+.5,f=Math.min(l,o),d=Math.floor(Math.log(e/f)/Math.log(t)+p),_=Math.max(c,d);return kt(e/Math.pow(t,_),h,l)}}}(a,r,n,u,!c&&p):Fn(r,n,u,!c&&p)}return{constraint:e,maxResolution:r,minResolution:n,minZoom:i,zoomFactor:a}}(t);this.maxResolution_=e.maxResolution;this.minResolution_=e.minResolution;this.zoomFactor_=e.zoomFactor;this.resolutions_=t.resolutions;this.minZoom_=e.minZoom;var r=function(t){if(void 0!==t.extent){var e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return In(t.extent,t.constrainOnlyCenter,e)}var r=Re(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&r.isGlobal()){var n=r.getExtent().slice();return n[0]=-1/0,n[2]=1/0,In(n,!1,!1)}return bn}(t),n=e.constraint,i=function(t){if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?(o=i||Xt(5),function(t,e){return e?t:void 0!==t?Math.abs(t)<=o?0:t:void 0}):!1===e?Nn:"number"==typeof e?(r=e,n=2*Math.PI/r,function(t,e){return e?t:void 0!==t?t=Math.floor(t/n+.5)*n:void 0}):Nn}return An;var r,n,i,o}(t);this.constraints_={center:r,resolution:n,rotation:i};this.setRotation(void 0!==t.rotation?t.rotation:0);this.setCenterInternal(void 0!==t.center?t.center:null);void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom);this.resolveConstraints(0);this.setProperties({});this.options_=t},e.prototype.getUpdatedOptions_=function(t){var e=p({},this.options_);return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),p({},e,t)},e.prototype.animate=function(){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var e=new Array(arguments.length),r=0;r<e.length;++r){var n=arguments[r];n.center&&((n=p({},n)).center=Ue(n.center,this.getProjection()));n.anchor&&((n=p({},n)).anchor=Ue(n.anchor,this.getProjection()));e[r]=n}this.animateInternal.apply(this,e)},e.prototype.animateInternal=function(){var e,r=arguments.length;if(r>1&&"function"==typeof arguments[r-1]&&(e=arguments[r-1],--r),!this.isDef()){var n=arguments[r-1];return n.center&&this.setCenterInternal(n.center),void 0!==n.zoom&&this.setZoom(n.zoom),void 0!==n.rotation&&this.setRotation(n.rotation),void(e&&ai(e,!0))}for(var i=Date.now(),o=this.targetCenter_.slice(),a=this.targetResolution_,s=this.targetRotation_,u=[],l=0;l<r;++l){var h=arguments[l],c={start:i,complete:!1,anchor:h.anchor,duration:void 0!==h.duration?h.duration:1e3,easing:h.easing||ri,callback:e};if(h.center&&(c.sourceCenter=o,c.targetCenter=h.center.slice(),o=c.targetCenter),void 0!==h.zoom?(c.sourceResolution=a,c.targetResolution=this.getResolutionForZoom(h.zoom),a=c.targetResolution):h.resolution&&(c.sourceResolution=a,c.targetResolution=h.resolution,a=c.targetResolution),void 0!==h.rotation){c.sourceRotation=s;var p=Vt(h.rotation-s+Math.PI,2*Math.PI)-Math.PI;c.targetRotation=s+p;s=c.targetRotation}si(c)?c.complete=!0:i+=c.duration;u.push(c)}this.animations_.push(u);this.setHint(Dn,1);this.updateAnimations_()},e.prototype.getAnimating=function(){return this.hints_[Dn]>0},e.prototype.getInteracting=function(){return this.hints_[Gn]>0},e.prototype.cancelAnimations=function(){this.setHint(Dn,-this.hints_[Dn]);for(var t=0,e=this.animations_.length;t<e;++t){var r=this.animations_[t];r[0].callback&&ai(r[0].callback,!1)}this.animations_.length=0},e.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),e=!1,r=this.animations_.length-1;r>=0;--r){for(var n=this.animations_[r],i=!0,o=0,a=n.length;o<a;++o){var s=n[o];if(!s.complete){var u=t-s.start,l=s.duration>0?u/s.duration:1;l>=1?(s.complete=!0,l=1):i=!1;var h=s.easing(l);if(s.sourceCenter){var c=s.sourceCenter[0],p=s.sourceCenter[1],f=c+h*(s.targetCenter[0]-c),d=p+h*(s.targetCenter[1]-p);this.targetCenter_=[f,d]}if(s.sourceResolution&&s.targetResolution){var _=1===h?s.targetResolution:s.sourceResolution+h*(s.targetResolution-s.sourceResolution);if(s.anchor){var g=this.getSizeFromViewport_(this.getRotation()),y=this.constraints_.resolution(_,0,g,!0);this.targetCenter_=this.calculateCenterZoom(y,s.anchor)}this.targetResolution_=_;this.applyTargetState_(!0)}if(void 0!==s.sourceRotation&&void 0!==s.targetRotation){var v=1===h?Vt(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+h*(s.targetRotation-s.sourceRotation);if(s.anchor){var m=this.constraints_.rotation(v,!0);this.targetCenter_=this.calculateCenterRotate(m,s.anchor)}this.targetRotation_=v}if(this.applyTargetState_(!0),e=!0,!s.complete)break}}if(i){this.animations_[r]=null;this.setHint(Dn,-1);var E=n[0].callback;E&&ai(E,!0)}}this.animations_=this.animations_.filter(Boolean);e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var r,n=this.getCenterInternal();return void 0!==n&&(Kn(r=[n[0]-e[0],n[1]-e[1]],t-this.getRotation()),zn(r,e)),r},e.prototype.calculateCenterZoom=function(t,e){var r,n=this.getCenterInternal(),i=this.getResolution();return void 0!==n&&void 0!==i&&(r=[e[0]-t*(e[0]-n[0])/i,e[1]-t*(e[1]-n[1])/i]),r},e.prototype.getSizeFromViewport_=function(t){var e=[100,100],r='.ol-viewport[data-view="'+o(this)+'"]',n=document.querySelector(r);if(n){var i=getComputedStyle(n);e[0]=parseInt(i.width,10);e[1]=parseInt(i.height,10)}if(t){var a=e[0],s=e[1];e[0]=Math.abs(a*Math.cos(t))+Math.abs(s*Math.sin(t));e[1]=Math.abs(a*Math.sin(t))+Math.abs(s*Math.cos(t))}return e},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?ke(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(jn)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){return Be(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getSizeFromViewport_(),r=this.getCenterInternal();K(r,1);var n=this.getResolution();K(void 0!==n,2);var i=this.getRotation();return K(void 0!==i,3),xt(r,n,i,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(kn)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(Ye(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var r=e||this.getSizeFromViewport_(),n=It(t)/r[0],i=Ot(t)/r[1];return Math.max(n,i)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,r=this.maxResolution_,n=this.minResolution_,i=Math.log(r/n)/Math.log(e);return function(t){return r/Math.pow(e,t*i)}},e.prototype.getRotation=function(){return this.get(Un)},e.prototype.getValueForResolutionFunction=function(t){var e=t||2,r=this.maxResolution_,n=this.minResolution_,i=Math.log(r/n)/Math.log(e);return function(t){return Math.log(r/t)/Math.log(e)/i}},e.prototype.getState=function(){var t=this.getCenterInternal(),e=this.getProjection(),r=this.getResolution(),n=this.getRotation();return{center:t.slice(0),projection:void 0!==e?e:null,resolution:r,rotation:n,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,r,n=this.minZoom_||0;if(this.resolutions_){var i=S(this.resolutions_,t,1);n=i;e=this.resolutions_[i];r=i==this.resolutions_.length-1?2:e/this.resolutions_[i+1]}else e=this.maxResolution_,r=this.zoomFactor_;return n+Math.log(e/t)/Math.log(r)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=kt(Math.floor(t),0,this.resolutions_.length-2),r=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(r,kt(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var r,n=p({size:this.getSizeFromViewport_()},e||{});if(K(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))K(!Lt(t),25),r=zr(i=Ye(t,this.getProjection()));else if(t.getType()===Nt.CIRCLE){var i;(r=zr(i=Ye(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),St(i))}else{var o=je();r=o?r.clone().transform(o,this.getProjection()):t}this.fitInternal(r,n)},e.prototype.fitInternal=function(t,e){var r=e||{},n=r.size;n||(n=this.getSizeFromViewport_());var i,o=void 0!==r.padding?r.padding:[0,0,0,0],a=void 0!==r.nearest&&r.nearest;i=void 0!==r.minResolution?r.minResolution:void 0!==r.maxZoom?this.getResolutionForZoom(r.maxZoom):0;for(var s=t.getFlatCoordinates(),u=this.getRotation(),l=Math.cos(-u),h=Math.sin(-u),c=1/0,p=1/0,f=-1/0,d=-1/0,_=t.getStride(),g=0,y=s.length;g<y;g+=_){var v=s[g]*l-s[g+1]*h,m=s[g]*h+s[g+1]*l;c=Math.min(c,v);p=Math.min(p,m);f=Math.max(f,v);d=Math.max(d,m)}var E=this.getResolutionForExtentInternal([c,p,f,d],[n[0]-o[1]-o[3],n[1]-o[0]-o[2]]);E=isNaN(E)?i:Math.max(E,i);E=this.getConstrainedResolution(E,a?0:1);h=-h;var T=(c+f)/2,S=(p+d)/2,w=[(T+=(o[1]-o[3])/2*E)*l-(S+=(o[0]-o[2])/2*E)*h,S*l+T*h],x=r.callback?r.callback:b;void 0!==r.duration?this.animateInternal({resolution:E,center:this.getConstrainedCenter(w,E),duration:r.duration,easing:r.easing},x):(this.targetResolution_=E,this.targetCenter_=w,this.applyTargetState_(!1,!0),ai(x,!0))},e.prototype.centerOn=function(t,e,r){this.centerOnInternal(Ue(t,this.getProjection()),e,r)},e.prototype.centerOnInternal=function(t,e,r){var n=this.getRotation(),i=Math.cos(-n),o=Math.sin(-n),a=t[0]*i-t[1]*o,s=t[1]*i+t[0]*o,u=this.getResolution(),l=(a+=(e[0]/2-r[0])*u)*i-(s+=(r[1]-e[1]/2)*u)*(o=-o),h=s*i+a*o;this.setCenterInternal([l,h])},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=ke(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustCenterInternal=function(t){var e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustResolution=function(t,e){var r=e&&Ue(e,this.getProjection());this.adjustResolutionInternal(t,r)},e.prototype.adjustResolutionInternal=function(t,e){var r=this.getAnimating()||this.getInteracting(),n=this.getSizeFromViewport_(this.getRotation()),i=this.constraints_.resolution(this.targetResolution_*t,0,n,r);void 0!==e&&(this.targetCenter_=this.calculateCenterZoom(i,e));this.targetResolution_*=t;this.applyTargetState_()},e.prototype.adjustZoom=function(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)},e.prototype.adjustRotation=function(t,e){e&&(e=Ue(e,this.getProjection()));this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var r=this.getAnimating()||this.getInteracting(),n=this.constraints_.rotation(this.targetRotation_+t,r);void 0!==e&&(this.targetCenter_=this.calculateCenterRotate(n,e));this.targetRotation_+=t;this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(Ue(t,this.getProjection()))},e.prototype.setCenterInternal=function(t){this.targetCenter_=t;this.applyTargetState_()},e.prototype.setHint=function(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]},e.prototype.setResolution=function(t){this.targetResolution_=t;this.applyTargetState_()},e.prototype.setRotation=function(t){this.targetRotation_=t;this.applyTargetState_()},e.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},e.prototype.applyTargetState_=function(t,e){var r=this.getAnimating()||this.getInteracting()||e,n=this.constraints_.rotation(this.targetRotation_,r),i=this.getSizeFromViewport_(n),o=this.constraints_.resolution(this.targetResolution_,0,i,r),a=this.constraints_.center(this.targetCenter_,o,i,r);this.get(Un)!==n&&this.set(Un,n);this.get(kn)!==o&&this.set(kn,o);this.get(jn)&&Zn(this.get(jn),a)||this.set(jn,a);this.getAnimating()&&!t&&this.cancelAnimations()},e.prototype.resolveConstraints=function(t,e,r){var n=void 0!==t?t:200,i=e||0,o=this.constraints_.rotation(this.targetRotation_),a=this.getSizeFromViewport_(o),s=this.constraints_.resolution(this.targetResolution_,i,a),u=this.constraints_.center(this.targetCenter_,s,a);if(0===n)return this.targetResolution_=s,this.targetRotation_=o,this.targetCenter_=u,void this.applyTargetState_();this.getResolution()===s&&this.getRotation()===o&&this.getCenterInternal()&&Zn(this.getCenterInternal(),u)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:o,center:u,resolution:s,duration:n,easing:ei,anchor:r}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0);this.setHint(Gn,1)},e.prototype.endInteraction=function(t,e,r){var n=r&&Ue(r,this.getProjection());this.endInteractionInternal(t,e,n)},e.prototype.endInteractionInternal=function(t,e,r){this.setHint(Gn,-1);this.resolveConstraints(t,e,r)},e.prototype.getConstrainedCenter=function(t,e){var r=this.getSizeFromViewport_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),r)},e.prototype.getConstrainedZoom=function(t,e){var r=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(r,e))},e.prototype.getConstrainedResolution=function(t,e){var r=e||0,n=this.getSizeFromViewport_(this.getRotation());return this.constraints_.resolution(t,r,n)},e}(z);function li(t,e){var r=document.createElement("canvas");return t&&(r.width=t),e&&(r.height=e),r.getContext("2d")}function hi(t){var e=t.offsetWidth,r=getComputedStyle(t);return e+(parseInt(r.marginLeft,10)+parseInt(r.marginRight,10))}function ci(t){var e=t.offsetHeight,r=getComputedStyle(t);return e+(parseInt(r.marginTop,10)+parseInt(r.marginBottom,10))}function pi(t,e){var r=e.parentNode;r&&r.replaceChild(t,e)}function fi(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function di(t){for(;t.lastChild;)t.removeChild(t.lastChild)}var _i={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source"},gi=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),yi=function(t){function e(e){var r=t.call(this)||this,n=p({},e);return n[_i.OPACITY]=void 0!==e.opacity?e.opacity:1,K("number"==typeof n[_i.OPACITY],64),n[_i.VISIBLE]=void 0===e.visible||e.visible,n[_i.Z_INDEX]=e.zIndex,n[_i.MAX_RESOLUTION]=void 0!==e.maxResolution?e.maxResolution:1/0,n[_i.MIN_RESOLUTION]=void 0!==e.minResolution?e.minResolution:0,n[_i.MIN_ZOOM]=void 0!==e.minZoom?e.minZoom:-1/0,n[_i.MAX_ZOOM]=void 0!==e.maxZoom?e.maxZoom:1/0,r.className_=void 0!==n.className?e.className:"ol-layer",delete n.className,r.setProperties(n),r.state_=null,r}return gi(e,t),e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},r=this.getZIndex();return e.opacity=kt(Math.round(100*this.getOpacity())/100,0,1),e.sourceState=this.getSourceState(),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==r?r:!1===e.managed?1/0:0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},e.prototype.getLayersArray=function(){return n()},e.prototype.getLayerStatesArray=function(){return n()},e.prototype.getExtent=function(){return this.get(_i.EXTENT)},e.prototype.getMaxResolution=function(){return this.get(_i.MAX_RESOLUTION)},e.prototype.getMinResolution=function(){return this.get(_i.MIN_RESOLUTION)},e.prototype.getMinZoom=function(){return this.get(_i.MIN_ZOOM)},e.prototype.getMaxZoom=function(){return this.get(_i.MAX_ZOOM)},e.prototype.getOpacity=function(){return this.get(_i.OPACITY)},e.prototype.getSourceState=function(){return n()},e.prototype.getVisible=function(){return this.get(_i.VISIBLE)},e.prototype.getZIndex=function(){return this.get(_i.Z_INDEX)},e.prototype.setExtent=function(t){this.set(_i.EXTENT,t)},e.prototype.setMaxResolution=function(t){this.set(_i.MAX_RESOLUTION,t)},e.prototype.setMinResolution=function(t){this.set(_i.MIN_RESOLUTION,t)},e.prototype.setMaxZoom=function(t){this.set(_i.MAX_ZOOM,t)},e.prototype.setMinZoom=function(t){this.set(_i.MIN_ZOOM,t)},e.prototype.setOpacity=function(t){K("number"==typeof t,64);this.set(_i.OPACITY,t)},e.prototype.setVisible=function(t){this.set(_i.VISIBLE,t)},e.prototype.setZIndex=function(t){this.set(_i.Z_INDEX,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null);t.prototype.disposeInternal.call(this)},e}(z),vi={UNDEFINED:"undefined",LOADING:"loading",READY:"ready",ERROR:"error"},mi=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ei={LAYERS:"layers"},Ti=function(t){function e(e){var r=this,n=e||{},i=p({},n);delete i.layers;var o=n.layers;return(r=t.call(this,i)||this).layersListenerKeys_=[],r.listenerKeys_={},r.addEventListener(Y(Ei.LAYERS),r.handleLayersChanged_),o?Array.isArray(o)?o=new Z(o.slice(),{unique:!0}):K("function"==typeof o.getArray,43):o=new Z(void 0,{unique:!0}),r.setLayers(o),r}return mi(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(v);this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(g(t,h.ADD,this.handleLayersAdd_,this),g(t,h.REMOVE,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(v);f(this.listenerKeys_);for(var r=t.getArray(),n=0,i=r.length;n<i;n++){var a=r[n];this.listenerKeys_[o(a)]=[g(a,c,this.handleLayerChange_,this),g(a,N.CHANGE,this.handleLayerChange_,this)]}this.changed()},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.listenerKeys_[o(e)]=[g(e,c,this.handleLayerChange_,this),g(e,N.CHANGE,this.handleLayerChange_,this)];this.changed()},e.prototype.handleLayersRemove_=function(t){var e=o(t.element);this.listenerKeys_[e].forEach(v);delete this.listenerKeys_[e];this.changed()},e.prototype.getLayers=function(){return this.get(Ei.LAYERS)},e.prototype.setLayers=function(t){this.set(Ei.LAYERS,t)},e.prototype.getLayersArray=function(t){var e=void 0!==t?t:[];return this.getLayers().forEach(function(t){t.getLayersArray(e)}),e},e.prototype.getLayerStatesArray=function(t){var e=void 0!==t?t:[],r=e.length;this.getLayers().forEach(function(t){t.getLayerStatesArray(e)});for(var n=this.getLayerState(),i=r,o=e.length;i<o;i++){var a=e[i];a.opacity*=n.opacity;a.visible=a.visible&&n.visible;a.maxResolution=Math.min(a.maxResolution,n.maxResolution);a.minResolution=Math.max(a.minResolution,n.minResolution);a.minZoom=Math.max(a.minZoom,n.minZoom);a.maxZoom=Math.min(a.maxZoom,n.maxZoom);void 0!==n.extent&&(a.extent=void 0!==a.extent?Rt(a.extent,n.extent):n.extent)}return e},e.prototype.getSourceState=function(){return vi.READY},e}(yi);function Si(t,e,r){return void 0===r&&(r=[0,0]),r[0]=t[0]+2*e,r[1]=t[1]+2*e,r}function wi(t,e,r){return void 0===r&&(r=[0,0]),r[0]=t[0]*e+.5|0,r[1]=t[1]*e+.5|0,r}function xi(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var Oi=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Ri(t,e){t.style.msTouchAction=e;t.style.touchAction=e;t.setAttribute("touch-action",e)}var Ci,Pi,Ii=function(t){function e(e){var r=t.call(this)||this,n=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var r,n,i,o={},a=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new Ti({layers:t.layers});return o[yn.LAYERGROUP]=a,o[yn.TARGET]=t.target,o[yn.VIEW]=void 0!==t.view?t.view:new ui,void 0!==t.controls&&(Array.isArray(t.controls)?r=new Z(t.controls.slice()):(K("function"==typeof t.controls.getArray,47),r=t.controls)),void 0!==t.interactions&&(Array.isArray(t.interactions)?n=new Z(t.interactions.slice()):(K("function"==typeof t.interactions.getArray,48),n=t.interactions)),void 0!==t.overlays?Array.isArray(t.overlays)?i=new Z(t.overlays.slice()):(K("function"==typeof t.overlays.getArray,49),i=t.overlays):i=new Z,{controls:r,interactions:n,keyboardEventTarget:e,overlays:i,values:o}}(e);r.boundHandleBrowserEvent_=r.handleBrowserEvent.bind(r);r.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16;r.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:an;r.postRenderTimeoutHandle_;r.animationDelayKey_;r.animationDelay_=function(){this.animationDelayKey_=void 0;this.renderFrame_(Date.now())}.bind(r);r.coordinateToPixelTransform_=[1,0,0,1,0,0];r.pixelToCoordinateTransform_=[1,0,0,1,0,0];r.frameIndex_=0;r.frameState_=null;r.previousExtent_=null;r.viewPropertyListenerKey_=null;r.viewChangeListenerKey_=null;r.layerGroupPropertyListenerKeys_=null;r.viewport_=document.createElement("div");r.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":"");r.viewport_.style.position="relative";r.viewport_.style.overflow="hidden";r.viewport_.style.width="100%";r.viewport_.style.height="100%";r.overlayContainer_=document.createElement("div");r.overlayContainer_.style.position="absolute";r.overlayContainer_.style.zIndex="0";r.overlayContainer_.style.width="100%";r.overlayContainer_.style.height="100%";r.overlayContainer_.className="ol-overlaycontainer";r.viewport_.appendChild(r.overlayContainer_);r.overlayContainerStopEvent_=document.createElement("div");r.overlayContainerStopEvent_.style.position="absolute";r.overlayContainerStopEvent_.style.zIndex="0";r.overlayContainerStopEvent_.style.width="100%";r.overlayContainerStopEvent_.style.height="100%";r.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent";r.viewport_.appendChild(r.overlayContainerStopEvent_);r.mapBrowserEventHandler_=new fn(r,e.moveTolerance);var i=r.handleMapBrowserEvent.bind(r);for(var o in un)r.mapBrowserEventHandler_.addEventListener(un[o],i);r.keyboardEventTarget_=n.keyboardEventTarget;r.keyHandlerKeys_=null;r.focusHandlerKeys_=null;var a=r.handleBrowserEvent.bind(r);return r.viewport_.addEventListener(N.CONTEXTMENU,a,!1),r.viewport_.addEventListener(N.WHEEL,a,!1),r.controls=n.controls||new Z,r.interactions=n.interactions||new Z,r.overlays_=n.overlays,r.overlayIdIndex_={},r.renderer_=null,r.handleResize_,r.postRenderFunctions_=[],r.tileQueue_=new Rn(r.getTilePriority.bind(r),r.handleTileChange_.bind(r)),r.addEventListener(Y(yn.LAYERGROUP),r.handleLayerGroupChanged_),r.addEventListener(Y(yn.VIEW),r.handleViewChanged_),r.addEventListener(Y(yn.SIZE),r.handleSizeChanged_),r.addEventListener(Y(yn.TARGET),r.handleTargetChanged_),r.setProperties(n.values),r.controls.forEach(function(t){t.setMap(this)}.bind(r)),r.controls.addEventListener(h.ADD,function(t){t.element.setMap(this)}.bind(r)),r.controls.addEventListener(h.REMOVE,function(t){t.element.setMap(null)}.bind(r)),r.interactions.forEach(function(t){t.setMap(this)}.bind(r)),r.interactions.addEventListener(h.ADD,function(t){t.element.setMap(this)}.bind(r)),r.interactions.addEventListener(h.REMOVE,function(t){t.element.setMap(null)}.bind(r)),r.overlays_.forEach(r.addOverlayInternal_.bind(r)),r.overlays_.addEventListener(h.ADD,function(t){this.addOverlayInternal_(t.element)}.bind(r)),r.overlays_.addEventListener(h.REMOVE,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()];t.element.setMap(null)}.bind(r)),r}return Oi(e,t),e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method");},e.prototype.addControl=function(t){this.getControls().push(t)},e.prototype.addInteraction=function(t){this.getInteractions().push(t)},e.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},e.prototype.addOverlay=function(t){this.getOverlays().push(t)},e.prototype.addOverlayInternal_=function(t){var e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t);t.setMap(this)},e.prototype.disposeInternal=function(){this.mapBrowserEventHandler_.dispose();this.viewport_.removeEventListener(N.CONTEXTMENU,this.boundHandleBrowserEvent_);this.viewport_.removeEventListener(N.WHEEL,this.boundHandleBrowserEvent_);void 0!==this.handleResize_&&(removeEventListener(N.RESIZE,this.handleResize_,!1),this.handleResize_=void 0);this.setTarget(null);t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,e,r){if(this.frameState_){var n=this.getCoordinateFromPixelInternal(t),i=void 0!==(r=void 0!==r?r:{}).hitTolerance?r.hitTolerance*this.frameState_.pixelRatio:0,o=void 0!==r.layerFilter?r.layerFilter:P,a=!1!==r.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(n,this.frameState_,i,a,e,null,o,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var r=[];return this.forEachFeatureAtPixel(t,function(t){r.push(t)},e),r},e.prototype.forEachLayerAtPixel=function(t,e,r){if(this.frameState_){var n=r||{},i=void 0!==n.hitTolerance?n.hitTolerance*this.frameState_.pixelRatio:0,o=n.layerFilter||P;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,i,e,o)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var r=this.getCoordinateFromPixelInternal(t),n=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:P,i=void 0!==e.hitTolerance?e.hitTolerance*this.frameState_.pixelRatio:0,o=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(r,this.frameState_,i,o,n,null)},e.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},e.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},e.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),r="changedTouches"in t?t.changedTouches[0]:t;return[r.clientX-e.left,r.clientY-e.top]},e.prototype.getTarget=function(){return this.get(yn.TARGET)},e.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},e.prototype.getCoordinateFromPixel=function(t){return ke(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?Ze(e.pixelToCoordinateTransform,t.slice()):null},e.prototype.getControls=function(){return this.controls},e.prototype.getOverlays=function(){return this.overlays_},e.prototype.getOverlayById=function(t){var e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getInteractions=function(){return this.interactions},e.prototype.getLayerGroup=function(){return this.get(yn.LAYERGROUP)},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoading=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,r=t.length;e<r;++e){var n=t[e].layer.getSource();if(n&&n.loading)return!0}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=Ue(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},e.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?Ze(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(yn.SIZE)},e.prototype.getView=function(){return this.get(yn.VIEW)},e.prototype.getViewport=function(){return this.viewport_},e.prototype.getOverlayContainer=function(){return this.overlayContainer_},e.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},e.prototype.getTilePriority=function(t,e,r,n){var i=this.frameState_;if(!(i&&e in i.wantedTiles)||!i.wantedTiles[e][t.getKey()])return 1/0;var o=i.viewState.center,a=r[0]-o[0],s=r[1]-o[1];return 65536*Math.log(n)+Math.sqrt(a*a+s*s)/n},e.prototype.handleBrowserEvent=function(t,e){var r=e||t.type,n=new tn(r,this,t);this.handleMapBrowserEvent(n)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){for(var e=t.originalEvent.target;e instanceof HTMLElement;){if(e.parentElement===this.overlayContainerStopEvent_)return;e=e.parentElement}t.frameState=this.frameState_;var r=this.getInteractions().getArray();if(!1!==this.dispatchEvent(t))for(var n=r.length-1;n>=0;n--){var i=r[n];if(i.getActive()&&!i.handleEvent(t))break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var r=this.maxTilesLoading_,n=r;if(t){var i=t.viewHints;if(i[Dn]||i[Gn]){var o=!sn&&Date.now()-t.time>8;r=o?0:8;n=o?0:2}}e.getTilesLoading()<r&&(e.reprioritize(),e.loadMoreTiles(r,n))}!t||!this.hasListener(Sn)||t.animate||this.tileQueue_.getTilesLoading()||this.getLoading()||this.renderer_.dispatchRenderEvent(Sn,t);for(var a=this.postRenderFunctions_,s=0,u=a.length;s<u;++s)a[s](this,t);a.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&this.getView().resolveConstraints(0);this.render()},e.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()&&(t=this.getTargetElement()),this.focusHandlerKeys_){for(var e=0,r=this.focusHandlerKeys_.length;e<r;++e)v(this.focusHandlerKeys_[e]);this.focusHandlerKeys_=null}if(this.keyHandlerKeys_){for(e=0,r=this.keyHandlerKeys_.length;e<r;++e)v(this.keyHandlerKeys_[e]);this.keyHandlerKeys_=null}if(t){t.appendChild(this.viewport_);this.renderer_||(this.renderer_=this.createRenderer());var n=!0;t.hasAttribute("tabindex")&&(n=document.activeElement===t,this.focusHandlerKeys_=[g(t,N.FOCUS,Ri.bind(this,this.viewport_,"none")),g(t,N.BLUR,Ri.bind(this,this.viewport_,"auto"))]);Ri(this.viewport_,n?"none":"auto");var i=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.keyHandlerKeys_=[g(i,N.KEYDOWN,this.handleBrowserEvent,this),g(i,N.KEYPRESS,this.handleBrowserEvent,this)];this.handleResize_||(this.handleResize_=this.updateSize.bind(this),window.addEventListener(N.RESIZE,this.handleResize_,!1))}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0),fi(this.viewport_),void 0!==this.handleResize_&&(removeEventListener(N.RESIZE,this.handleResize_,!1),this.handleResize_=void 0);this.updateSize()},e.prototype.handleTileChange_=function(){this.render()},e.prototype.handleViewPropertyChanged_=function(){this.render()},e.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(v(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null);this.viewChangeListenerKey_&&(v(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.viewport_.setAttribute("data-view",o(t)),this.viewPropertyListenerKey_=g(t,c,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=g(t,N.CHANGE,this.handleViewPropertyChanged_,this),t.resolveConstraints(0));this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(v),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.layerGroupPropertyListenerKeys_=[g(t,c,this.render,this),g(t,N.CHANGE,this.render,this)]);this.render()},e.prototype.isRendered=function(){return!!this.frameState_},e.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_);this.animationDelay_()},e.prototype.redrawText=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,r=t.length;e<r;++e){var n=t[e].layer;n.hasRenderer()&&n.getRenderer().handleFontsChanged()}},e.prototype.render=function(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},e.prototype.removeControl=function(t){return this.getControls().remove(t)},e.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},e.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},e.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var e=this.getSize(),r=this.getView(),n=this.frameState_,i=null;if(void 0!==e&&function(t){return t[0]>0&&t[1]>0}(e)&&r&&r.isDef()){var o=r.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=r.getState();i={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterItems:n?n.declutterItems:[],extent:xt(a.center,a.resolution,a.rotation,e),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:e,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:a,viewHints:o,wantedTiles:{}}}(this.frameState_=i,this.renderer_.renderFrame(i),i)&&((i.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,i.postRenderFunctions),n)&&(this.previousExtent_&&(Lt(this.previousExtent_)||pt(i.extent,this.previousExtent_))||(this.dispatchEvent(new Qr(_n,this,n)),this.previousExtent_=lt(this.previousExtent_))),!this.previousExtent_||i.viewHints[Dn]||i.viewHints[Gn]||pt(i.extent,this.previousExtent_)||(this.dispatchEvent(new Qr(gn,this,i)),et(i.extent,this.previousExtent_)));this.dispatchEvent(new Qr(dn,this,i));this.postRenderTimeoutHandle_=setTimeout(this.handlePostRender.bind(this),0)},e.prototype.setLayerGroup=function(t){this.set(yn.LAYERGROUP,t)},e.prototype.setSize=function(t){this.set(yn.SIZE,t)},e.prototype.setTarget=function(t){this.set(yn.TARGET,t)},e.prototype.setView=function(t){this.set(yn.VIEW,t)},e.prototype.updateSize=function(){var t=this.getTargetElement();if(t){var e=getComputedStyle(t);this.setSize([t.offsetWidth-parseFloat(e.borderLeftWidth)-parseFloat(e.paddingLeft)-parseFloat(e.paddingRight)-parseFloat(e.borderRightWidth),t.offsetHeight-parseFloat(e.borderTopWidth)-parseFloat(e.paddingTop)-parseFloat(e.paddingBottom)-parseFloat(e.borderBottomWidth)])}else this.setSize(void 0)},e}(z),bi=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Li=function(t){function e(e){var r=t.call(this)||this;return r.element=e.element?e.element:null,r.target_=null,r.map_=null,r.listenerKeys=[],r.render=e.render?e.render:b,e.target&&r.setTarget(e.target),r}return bi(e,t),e.prototype.disposeInternal=function(){fi(this.element);t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&fi(this.element);for(var e=0,r=this.listenerKeys.length;e<r;++e)v(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,this.map_)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==b&&this.listenerKeys.push(g(t,dn,this.render,this)),t.render())},e.prototype.setTarget=function(t){this.target_="string"==typeof t?document.getElementById(t):t},e}(z),Mi="ol-hidden",Fi="ol-selectable",Ai="ol-unselectable",Ni="ol-unsupported",Di="ol-control",Gi="ol-collapsed",ji=(Pi={},function(t){if(Ci||(Ci=document.createElement("div").style),!(t in Pi)){Ci.font=t;var e=Ci.fontFamily,r=Ci.fontWeight,n=Ci.fontStyle;if(Ci.font="",!e)return null;var i=e.split(/,\s?/);Pi[t]={families:i,weight:r,style:n}}return Pi[t]}),ki=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Ui(t,e){if(!t.visible)return!1;var r=e.resolution;if(r<t.minResolution||r>=t.maxResolution)return!1;var n=e.zoom;return n>t.minZoom&&n<=t.maxZoom}var Bi=function(t){function e(e){var r=this,n=p({},e);delete n.source;(r=t.call(this,n)||this).mapPrecomposeKey_=null;r.mapRenderKey_=null;r.sourceChangeKey_=null;r.renderer_=null;e.render&&(r.render=e.render);e.map&&r.setMap(e.map);r.addEventListener(Y(_i.SOURCE),r.handleSourcePropertyChange_);var i=e.source?e.source:null;return r.setSource(i),r}return ki(e,t),e.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},e.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},e.prototype.getSource=function(){return this.get(_i.SOURCE)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():vi.UNDEFINED},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(v(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=g(t,N.CHANGE,this.handleSourceChange_,this));this.changed()},e.prototype.getFeatures=function(t){return this.renderer_.getFeatures(t)},e.prototype.render=function(t,e){var r=this.getRenderer();if(r.prepareFrame(t))return r.renderFrame(t,e)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(v(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null);t||this.changed();this.mapRenderKey_&&(v(this.mapRenderKey_),this.mapRenderKey_=null);t&&(this.mapPrecomposeKey_=g(t,En,function(t){t.frameState.layerStatesArray.push(this.getLayerState(!1))},this),this.mapRenderKey_=g(this,N.CHANGE,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(_i.SOURCE,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.setSource(null);t.prototype.disposeInternal.call(this)},e}(yi),Yi=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function zi(t){this.updateElement_(t.frameState)}var Xi=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{element:document.createElement("div"),render:n.render||zi,target:n.target})||this).ulElement_=document.createElement("ul");r.collapsed_=void 0===n.collapsed||n.collapsed;r.overrideCollapsible_=void 0!==n.collapsible;r.collapsible_=void 0===n.collapsible||n.collapsible;r.collapsible_||(r.collapsed_=!1);var i=void 0!==n.className?n.className:"ol-attribution",o=void 0!==n.tipLabel?n.tipLabel:"Attributions",a=void 0!==n.collapseLabel?n.collapseLabel:"»";"string"==typeof a?(r.collapseLabel_=document.createElement("span"),r.collapseLabel_.textContent=a):r.collapseLabel_=a;var s=void 0!==n.label?n.label:"i";"string"==typeof s?(r.label_=document.createElement("span"),r.label_.textContent=s):r.label_=s;var u=r.collapsible_&&!r.collapsed_?r.collapseLabel_:r.label_,l=document.createElement("button");l.setAttribute("type","button");l.title=o;l.appendChild(u);l.addEventListener(N.CLICK,r.handleClick_.bind(r),!1);var h=i+" "+Ai+" "+Di+(r.collapsed_&&r.collapsible_?" "+Gi:"")+(r.collapsible_?"":" ol-uncollapsible"),c=r.element;return c.className=h,c.appendChild(r.ulElement_),c.appendChild(l),r.renderedAttributions_=[],r.renderedVisible_=!0,r}return Yi(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},r=[],n=t.layerStatesArray,i=0,o=n.length;i<o;++i){var a=n[i];if(Ui(a,t.viewState)){var s=a.layer.getSource();if(s){var u=s.getAttributions();if(u){var l=u(t);if(l)if(this.overrideCollapsible_||!1!==s.getAttributionsCollapsible()||this.setCollapsible(!1),Array.isArray(l))for(var h=0,c=l.length;h<c;++h)l[h]in e||(r.push(l[h]),e[l[h]]=!0);else l in e||(r.push(l),e[l]=!0)}}}}return r},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),r=e.length>0;if(this.renderedVisible_!=r&&(this.element.style.display=r?"":"none",this.renderedVisible_=r),!R(e,this.renderedAttributions_)){di(this.ulElement_);for(var n=0,i=e.length;n<i;++n){var o=document.createElement("li");o.innerHTML=e[n];this.ulElement_.appendChild(o)}this.renderedAttributions_=e}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.handleClick_=function(t){t.preventDefault();this.handleToggle_()},e.prototype.handleToggle_=function(){this.element.classList.toggle(Gi);this.collapsed_?pi(this.collapseLabel_,this.label_):pi(this.label_,this.collapseLabel_);this.collapsed_=!this.collapsed_},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e}(Li),Vi=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Wi(t){var e=t.frameState;if(e){var r=e.viewState.rotation;if(r!=this.rotation_){var n="rotate("+r+"rad)";if(this.autoHide_){var i=this.element.classList.contains(Mi);i||0!==r?i&&0!==r&&this.element.classList.remove(Mi):this.element.classList.add(Mi)}this.label_.style.transform=n}this.rotation_=r}}var Zi=function(t){function e(e){var r=this,n=e||{};r=t.call(this,{element:document.createElement("div"),render:n.render||Wi,target:n.target})||this;var i=void 0!==n.className?n.className:"ol-rotate",o=void 0!==n.label?n.label:"⇧";r.label_=null;"string"==typeof o?(r.label_=document.createElement("span"),r.label_.className="ol-compass",r.label_.textContent=o):(r.label_=o,r.label_.classList.add("ol-compass"));var a=n.tipLabel?n.tipLabel:"Reset rotation",s=document.createElement("button");s.className=i+"-reset";s.setAttribute("type","button");s.title=a;s.appendChild(r.label_);s.addEventListener(N.CLICK,r.handleClick_.bind(r),!1);var u=i+" "+Ai+" "+Di,l=r.element;return l.className=u,l.appendChild(s),r.callResetNorth_=n.resetNorth?n.resetNorth:void 0,r.duration_=void 0!==n.duration?n.duration:250,r.autoHide_=void 0===n.autoHide||n.autoHide,r.rotation_=void 0,r.autoHide_&&r.element.classList.add(Mi),r}return Vi(e,t),e.prototype.handleClick_=function(t){t.preventDefault();void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},e.prototype.resetNorth_=function(){var t=this.getMap().getView();t&&void 0!==t.getRotation()&&(this.duration_>0?t.animate({rotation:0,duration:this.duration_,easing:ei}):t.setRotation(0))},e}(Li),Ki=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Hi=function(t){function e(e){var r=this,n=e||{};r=t.call(this,{element:document.createElement("div"),target:n.target})||this;var i=void 0!==n.className?n.className:"ol-zoom",o=void 0!==n.delta?n.delta:1,a=void 0!==n.zoomInLabel?n.zoomInLabel:"+",s=void 0!==n.zoomOutLabel?n.zoomOutLabel:"−",u=void 0!==n.zoomInTipLabel?n.zoomInTipLabel:"Zoom in",l=void 0!==n.zoomOutTipLabel?n.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=i+"-in";h.setAttribute("type","button");h.title=u;h.appendChild("string"==typeof a?document.createTextNode(a):a);h.addEventListener(N.CLICK,r.handleClick_.bind(r,o),!1);var c=document.createElement("button");c.className=i+"-out";c.setAttribute("type","button");c.title=l;c.appendChild("string"==typeof s?document.createTextNode(s):s);c.addEventListener(N.CLICK,r.handleClick_.bind(r,-o),!1);var p=i+" "+Ai+" "+Di,f=r.element;return f.className=p,f.appendChild(h),f.appendChild(c),r.duration_=void 0!==n.duration?n.duration:250,r}return Ki(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault();this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var r=e.getZoom();if(void 0!==r){var n=e.getConstrainedZoom(r+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:n,duration:this.duration_,easing:ei})):e.setZoom(n)}}},e}(Li);function qi(t){var e=t||{},r=new Z;return(void 0===e.zoom||e.zoom)&&r.push(new Hi(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&r.push(new Zi(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&r.push(new Xi(e.attributionOptions)),r}var Ji={ACTIVE:"active"},Qi=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function $i(t,e,r,n){var i=t.getZoom();if(void 0!==i){var o=t.getConstrainedZoom(i+e),a=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations();t.animate({resolution:a,anchor:r,duration:void 0!==n?n:250,easing:ei})}}var to=function(t){function e(e){var r=t.call(this)||this;return e.handleEvent&&(r.handleEvent=e.handleEvent),r.map_=null,r.setActive(!0),r}return Qi(e,t),e.prototype.getActive=function(){return this.get(Ji.ACTIVE)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(){return!0},e.prototype.setActive=function(t){this.set(Ji.ACTIVE,t)},e.prototype.setMap=function(t){this.map_=t},e}(z),eo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function ro(t){var e=!1;if(t.type==un.DBLCLICK){var r=t.originalEvent,n=t.map,i=t.coordinate,o=r.shiftKey?-this.delta_:this.delta_;$i(n.getView(),o,i,this.duration_);t.preventDefault();e=!0}return!e}var no=function(t){function e(e){var r=t.call(this,{handleEvent:ro})||this,n=e||{};return r.delta_=n.delta?n.delta:1,r.duration_=void 0!==n.duration?n.duration:250,r}return eo(e,t),e}(to),io=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},oo=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},ao=function(t){return t.target.getTargetElement()===document.activeElement},so=P,uo=function(t){var e=t.originalEvent;return 0==e.button&&!(nn&&on&&e.ctrlKey)},lo=I,ho=function(t){return t.type==un.SINGLECLICK},co=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},po=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},fo=function(t){var e=t.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},_o=function(t){var e=t.pointerEvent;return K(void 0!==e,56),"mouse"==e.pointerType},go=function(t){var e=t.pointerEvent;return K(void 0!==e,56),e.isPrimary&&0===e.button},yo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function vo(t){for(var e=t.length,r=0,n=0,i=0;i<e;i++)r+=t[i].clientX,n+=t[i].clientY;return[r/e,n/e]}var mo=function(t){function e(e){var r=this,n=e||{};return r=t.call(this,n)||this,n.handleDownEvent&&(r.handleDownEvent=n.handleDownEvent),n.handleDragEvent&&(r.handleDragEvent=n.handleDragEvent),n.handleMoveEvent&&(r.handleMoveEvent=n.handleMoveEvent),n.handleUpEvent&&(r.handleUpEvent=n.handleUpEvent),n.stopDown&&(r.stopDown=n.stopDown),r.handlingDownUpSequence=!1,r.trackedPointers_={},r.targetPointers=[],r}return yo(e,t),e.prototype.handleDownEvent=function(){return!1},e.prototype.handleDragEvent=function(){},e.prototype.handleEvent=function(t){if(!t.pointerEvent)return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==un.POINTERDRAG)this.handleDragEvent(t);else if(t.type==un.POINTERUP){var r=this.handleUpEvent(t);this.handlingDownUpSequence=r&&this.targetPointers.length>0}}else if(t.type==un.POINTERDOWN){var n=this.handleDownEvent(t);n&&t.preventDefault();this.handlingDownUpSequence=n;e=this.stopDown(n)}else t.type==un.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(){},e.prototype.handleUpEvent=function(){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===un.POINTERDOWN||e===un.POINTERDRAG||e===un.POINTERUP}(t)){var e=t.pointerEvent,r=e.pointerId.toString();t.type==un.POINTERUP?delete this.trackedPointers_[r]:t.type==un.POINTERDOWN?this.trackedPointers_[r]=e:r in this.trackedPointers_&&(this.trackedPointers_[r]=e);this.targetPointers=d(this.trackedPointers_)}},e}(to),Eo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function To(t){return co(t)&&go(t)}var So=function(t){function e(e){var r=t.call(this,{stopDown:I})||this,n=e||{};return r.kinetic_=n.kinetic,r.lastCentroid=null,r.lastPointersCount_,r.panning_=!1,r.condition_=n.condition?n.condition:To,r.noKinetic_=!1,r}return Eo(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e=this.targetPointers,r=vo(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(r[0],r[1]),this.lastCentroid){var n=[this.lastCentroid[0]-r[0],r[1]-this.lastCentroid[1]],i=t.map.getView();Hn(n,i.getResolution());Kn(n,i.getRotation());i.adjustCenterInternal(n)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=r;this.lastPointersCount_=e.length},e.prototype.handleUpEvent=function(t){var e=t.map,r=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var n=this.kinetic_.getDistance(),i=this.kinetic_.getAngle(),o=r.getCenterInternal(),a=e.getPixelFromCoordinateInternal(o),s=e.getCoordinateFromPixelInternal([a[0]-n*Math.cos(i),a[1]-n*Math.sin(i)]);r.animateInternal({center:r.getConstrainedCenter(s),duration:500,easing:ei})}return this.panning_&&(this.panning_=!1,r.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(mo),wo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),xo=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,{stopDown:I})||this).condition_=n.condition?n.condition:oo,r.lastAngle_=void 0,r.duration_=void 0!==n.duration?n.duration:250,r}return wo(e,t),e.prototype.handleDragEvent=function(t){if(_o(t)){var e=t.map,r=e.getView();if(r.getConstraints().rotation!==An){var n=e.getSize(),i=t.pixel,o=Math.atan2(n[1]/2-i[1],i[0]-n[0]/2);if(void 0!==this.lastAngle_){var a=o-this.lastAngle_;r.adjustRotationInternal(-a)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){return!_o(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!_o(t)&&!(!uo(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0)},e}(mo),Oo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ro=function(t){function e(e){var r=t.call(this)||this;return r.geometry_=null,r.element_=document.createElement("div"),r.element_.style.position="absolute",r.element_.className="ol-box "+e,r.map_=null,r.startPixel_=null,r.endPixel_=null,r}return Oo(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,r=this.element_.style;r.left=Math.min(t[0],e[0])+"px";r.top=Math.min(t[1],e[1])+"px";r.width=Math.abs(e[0]-t[0])+"px";r.height=Math.abs(e[1]-t[1])+"px"},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit";e.top="inherit";e.width="inherit";e.height="inherit"}this.map_=t;this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t;this.endPixel_=e;this.createOrUpdateGeometry();this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,r=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);r[4]=r[0].slice();this.geometry_?this.geometry_.setCoordinates([r]):this.geometry_=new Br([r])},e.prototype.getGeometry=function(){return this.geometry_},e}(m),Co=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Po="boxstart",Io="boxdrag",bo="boxend",Lo=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.coordinate=r,i.mapBrowserEvent=n,i}return Co(e,t),e}(M),Mo=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.box_=new Ro(n.className||"ol-dragbox"),r.minArea_=void 0!==n.minArea?n.minArea:64,r.onBoxEnd_=n.onBoxEnd?n.onBoxEnd:b,r.startPixel_=null,r.condition_=n.condition?n.condition:so,r.boxEndCondition_=n.boxEndCondition?n.boxEndCondition:r.defaultBoxEndCondition,r}return Co(e,t),e.prototype.defaultBoxEndCondition=function(t,e,r){var n=r[0]-e[0],i=r[1]-e[1];return n*n+i*i>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){_o(t)&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Lo(Io,t.coordinate,t)))},e.prototype.handleUpEvent=function(t){return!_o(t)||(this.box_.setMap(null),this.boxEndCondition_(t,this.startPixel_,t.pixel)&&(this.onBoxEnd_(t),this.dispatchEvent(new Lo(bo,t.coordinate,t))),!1)},e.prototype.handleDownEvent=function(t){return!!_o(t)&&!(!uo(t)||!this.condition_(t))&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Lo(Po,t.coordinate,t)),!0)},e}(mo),Fo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Ao(){var t,e,r=this.getMap(),n=r.getView(),i=r.getSize(),o=this.getGeometry().getExtent();if(this.out_){var a=n.calculateExtentInternal(i),s=(t=[r.getPixelFromCoordinateInternal(Et(o)),r.getPixelFromCoordinateInternal(Pt(o))],_t(lt(e),t));Mt(a,1/n.getResolutionForExtentInternal(s,i));o=a}var u=n.getConstrainedResolution(n.getResolutionForExtentInternal(o,i)),l=n.getConstrainedCenter(St(o),u);n.animateInternal({resolution:u,center:l,duration:this.duration_,easing:ei})}var No=function(t){function e(e){var r=this,n=e||{},i=n.condition?n.condition:po;return(r=t.call(this,{condition:i,className:n.className||"ol-dragzoom",minArea:n.minArea,onBoxEnd:Ao})||this).duration_=void 0!==n.duration?n.duration:200,r.out_=void 0!==n.out&&n.out,r}return Fo(e,t),e}(Mo),Do={LEFT:37,UP:38,RIGHT:39,DOWN:40},Go=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function jo(t){var e=!1;if(t.type==N.KEYDOWN){var r=t.originalEvent.keyCode;if(this.condition_(t)&&(r==Do.DOWN||r==Do.LEFT||r==Do.RIGHT||r==Do.UP)){var n=t.map.getView(),i=n.getResolution()*this.pixelDelta_,o=0,a=0;r==Do.DOWN?a=-i:r==Do.LEFT?o=-i:r==Do.RIGHT?o=i:a=i;var s=[o,a];Kn(s,n.getRotation()),function(t,e,r){var n=t.getCenterInternal();if(n){var i=[n[0]+e[0],n[1]+e[1]];t.animateInternal({duration:void 0!==r?r:250,easing:ni,center:t.getConstrainedCenter(i)})}}(n,s,this.duration_);t.preventDefault();e=!0}}return!e}var ko=function(t){function e(e){var r=t.call(this,{handleEvent:jo})||this,n=e||{};return r.defaultCondition_=function(t){return co(t)&&fo(t)},r.condition_=void 0!==n.condition?n.condition:r.defaultCondition_,r.duration_=void 0!==n.duration?n.duration:100,r.pixelDelta_=void 0!==n.pixelDelta?n.pixelDelta:128,r}return Go(e,t),e}(to),Uo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Bo(t){var e=!1;if(t.type==N.KEYDOWN||t.type==N.KEYPRESS){var r=t.originalEvent.charCode;if(this.condition_(t)&&(r=="+".charCodeAt(0)||r=="-".charCodeAt(0))){var n=t.map,i=r=="+".charCodeAt(0)?this.delta_:-this.delta_;$i(n.getView(),i,void 0,this.duration_);t.preventDefault();e=!0}}return!e}var Yo=function(t){function e(e){var r=t.call(this,{handleEvent:Bo})||this,n=e||{};return r.condition_=n.condition?n.condition:fo,r.delta_=n.delta?n.delta:1,r.duration_=void 0!==n.duration?n.duration:100,r}return Uo(e,t),e}(to),zo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Xo="trackpad",Vo="wheel",Wo=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,n)||this).totalDelta_=0,r.lastDelta_=0,r.maxDelta_=void 0!==n.maxDelta?n.maxDelta:1,r.duration_=void 0!==n.duration?n.duration:250,r.timeout_=void 0!==n.timeout?n.timeout:80,r.useAnchor_=void 0===n.useAnchor||n.useAnchor,r.condition_=n.condition?n.condition:so,r.lastAnchor_=null,r.startTime_=void 0,r.timeoutId_,r.mode_=void 0,r.trackpadEventGap_=400,r.trackpadTimeoutId_,r.trackpadDeltaPerZoom_=300,r}return zo(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0;this.getMap().getView().endInteraction(void 0,Math.sign(this.lastDelta_),this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t)||t.type!==N.WHEEL)return!0;t.preventDefault();var e,r=t.map,n=t.originalEvent;if(this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==N.WHEEL&&(e=n.deltaY,rn&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=an),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var i=Date.now();if(void 0===this.startTime_&&(this.startTime_=i),(!this.mode_||i-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?Xo:Vo),this.mode_===Xo){var o=r.getView();return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):o.beginInteraction(),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.trackpadEventGap_),o.adjustZoom(-e/this.trackpadDeltaPerZoom_,this.lastAnchor_),this.startTime_=i,!1}this.totalDelta_+=e;var a=Math.max(this.timeout_-(i-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,r),a),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();$i(e,-kt(this.totalDelta_,-this.maxDelta_,this.maxDelta_),this.lastAnchor_,this.duration_);this.mode_=void 0;this.totalDelta_=0;this.lastAnchor_=null;this.startTime_=void 0;this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t;t||(this.lastAnchor_=null)},e}(to),Zo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ko=function(t){function e(e){var r=this,n=e||{},i=n;return i.stopDown||(i.stopDown=I),(r=t.call(this,i)||this).anchor_=null,r.lastAngle_=void 0,r.rotating_=!1,r.rotationDelta_=0,r.threshold_=void 0!==n.threshold?n.threshold:.3,r.duration_=void 0!==n.duration?n.duration:250,r}return Zo(e,t),e.prototype.handleDragEvent=function(t){var e=0,r=this.targetPointers[0],n=this.targetPointers[1],i=Math.atan2(n.clientY-r.clientY,n.clientX-r.clientX);if(void 0!==this.lastAngle_){var o=i-this.lastAngle_;this.rotationDelta_+=o;!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0);e=o}this.lastAngle_=i;var a=t.map,s=a.getView();if(s.getConstraints().rotation!==An){var u=a.getViewport().getBoundingClientRect(),l=vo(this.targetPointers);l[0]-=u.left;l[1]-=u.top;this.anchor_=a.getCoordinateFromPixelInternal(l);this.rotating_&&(a.render(),s.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(mo),Ho=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),qo=function(t){function e(e){var r=this,n=e||{},i=n;return i.stopDown||(i.stopDown=I),(r=t.call(this,i)||this).anchor_=null,r.duration_=void 0!==n.duration?n.duration:400,r.lastDistance_=void 0,r.lastScaleDelta_=1,r}return Ho(e,t),e.prototype.handleDragEvent=function(t){var e=1,r=this.targetPointers[0],n=this.targetPointers[1],i=r.clientX-n.clientX,o=r.clientY-n.clientY,a=Math.sqrt(i*i+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/a);this.lastDistance_=a;var s=t.map,u=s.getView();1!=e&&(this.lastScaleDelta_=e);var l=s.getViewport().getBoundingClientRect(),h=vo(this.targetPointers);h[0]-=l.left;h[1]-=l.top;this.anchor_=s.getCoordinateFromPixelInternal(h);s.render();u.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),r=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,r),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(mo);function Jo(t){var e=t||{},r=new Z,n=new qr(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&r.push(new xo),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&r.push(new no({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&r.push(new So({condition:e.onFocusOnly?ao:void 0,kinetic:n})),(void 0===e.pinchRotate||e.pinchRotate)&&r.push(new Ko),(void 0===e.pinchZoom||e.pinchZoom)&&r.push(new qo({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(r.push(new ko),r.push(new Yo({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&r.push(new Wo({condition:e.onFocusOnly?ao:void 0,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&r.push(new No({duration:e.zoomDuration})),r}var Qo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$o=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.inversePixelTransform=r,o.frameState=n,o.context=i,o}return Qo(e,t),e}(M),ta=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,ea=/^([a-z]*)$|^hsla?\(.*\)$/i;function ra(t){return"string"==typeof t?t:sa(t)}function na(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var r=getComputedStyle(e).color;return document.body.removeChild(e),r}return""}var ia=function(){var t={},e=0;return function(r){var n;if(t.hasOwnProperty(r))n=t[r];else{if(e>=1024){var i=0;for(var o in t)0==(3&i++)&&(delete t[o],--e)}n=function(t){var e,r,n,i,o;if(ea.exec(t)&&(t=na(t)),ta.exec(t)){var a=t.length-1,s=a<=4?1:2;var u=4===a||8===a;e=parseInt(t.substr(1+0*s,s),16);r=parseInt(t.substr(1+1*s,s),16);n=parseInt(t.substr(1+2*s,s),16);i=u?parseInt(t.substr(1+3*s,s),16):255;1==s&&(e=(e<<4)+e,r=(r<<4)+r,n=(n<<4)+n,u&&(i=(i<<4)+i));o=[e,r,n,i/255]}else 0==t.indexOf("rgba(")?aa(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),aa(o)):K(!1,14);return o}(r);t[r]=n;++e}return n}}();function oa(t){return Array.isArray(t)?t:ia(t)}function aa(t){return t[0]=kt(t[0]+.5|0,0,255),t[1]=kt(t[1]+.5|0,0,255),t[2]=kt(t[2]+.5|0,0,255),t[3]=kt(t[3],0,1),t}function sa(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var r=t[1];r!=(0|r)&&(r=r+.5|0);var n=t[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+r+","+n+","+(void 0===t[3]?1:t[3])+")"}var ua=function(){function t(){this.cache_={};this.cacheSize_=0;this.maxCacheSize_=32}return t.prototype.clear=function(){this.cache_={};this.cacheSize_=0},t.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var r=this.cache_[e];0!=(3&t++)||r.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,r){var n=la(t,e,r);return n in this.cache_?this.cache_[n]:null},t.prototype.set=function(t,e,r,n){var i=la(t,e,r);this.cache_[i]=n;++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t;this.expire()},t}();function la(t,e,r){return e+":"+t+":"+(r?ra(r):"null")}var ha=new ua;function ca(t){return Array.isArray(t)?sa(t):t}var pa,fa=function(){function t(){}return t.prototype.drawCustom=function(){},t.prototype.drawGeometry=function(){},t.prototype.setStyle=function(){},t.prototype.drawCircle=function(){},t.prototype.drawFeature=function(){},t.prototype.drawGeometryCollection=function(){},t.prototype.drawLineString=function(){},t.prototype.drawMultiLineString=function(){},t.prototype.drawMultiPoint=function(){},t.prototype.drawMultiPolygon=function(){},t.prototype.drawPoint=function(){},t.prototype.drawPolygon=function(){},t.prototype.drawText=function(){},t.prototype.setFillStrokeStyle=function(){},t.prototype.setImageStyle=function(){},t.prototype.setTextStyle=function(){},t}(),da=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),_a=function(t){function e(e){var r=t.call(this)||this;return r.highWaterMark=void 0!==e?e:2048,r.count_=0,r.entries_={},r.oldest_=null,r.newest_=null,r}return da(e,t),e.prototype.canExpireCache=function(){return this.getCount()>this.highWaterMark},e.prototype.clear=function(){this.count_=0;this.entries_={};this.oldest_=null;this.newest_=null;this.dispatchEvent(N.CLEAR)},e.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},e.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},e.prototype.get=function(t){var r=this.entries_[t];return K(void 0!==r,15),r===this.newest_?r.value_:(r===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(r.newer.older=r.older,r.older.newer=r.newer),r.newer=null,r.older=this.newest_,this.newest_.newer=r,this.newest_=r,r.value_)},e.prototype.remove=function(t){var e=this.entries_[t];return K(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},e.prototype.getCount=function(){return this.count_},e.prototype.getKeys=function(){for(var e=new Array(this.count_),r=0,t=this.newest_;t;t=t.older)e[r++]=t.key_;return e},e.prototype.getValues=function(){for(var e=new Array(this.count_),r=0,t=this.newest_;t;t=t.older)e[r++]=t.value_;return e},e.prototype.peekLast=function(){return this.oldest_.value_},e.prototype.peekLastKey=function(){return this.oldest_.key_},e.prototype.peekFirstKey=function(){return this.newest_.key_},e.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},e.prototype.replace=function(t,e){this.get(t);this.entries_[t].value_=e},e.prototype.set=function(t,e){K(!(t in this.entries_),16);var r={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=r:this.oldest_=r;this.newest_=r;this.entries_[t]=r;++this.count_},e.prototype.setSize=function(t){this.highWaterMark=t},e}(A),ga=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ya=function(t){function e(e){var r=t.call(this,e)||this;return r.consumers={},r}return ga(e,t),e.prototype.clear=function(){this.consumers={};t.prototype.clear.call(this)},e.prototype.get=function(e,r){var n=t.prototype.get.call(this,e),i=o(r);return i in this.consumers||(this.consumers[i]={}),this.consumers[i][e]=!0,n},e.prototype.prune=function(){t:for(;this.canExpireCache();){var t=this.peekLastKey();for(var e in this.consumers)if(t in this.consumers[e])break t;var r=this.pop();for(var e in r.width=0,r.height=0,this.consumers)delete this.consumers[e][t]}},e.prototype.release=function(t){delete this.consumers[o(t)]},e}(_a),va=[],ma=[0,0,0,0],Ea=new ya,Ta={},Sa=null,wa={},xa=function(){var t,e,r=100,n=Ta,i="32px ",o=["monospace","serif"],a=o.length,s="wmytzilWMYTZIL@#/&?$%10";function u(t,r,n){for(var u=Oa(),l=!0,h=0;h<a;++h){var c=o[h];if(u.font=t+" "+r+" "+i+c,e=u.measureText(s).width,n!=c){u.font=t+" "+r+" "+i+n+","+c;var p=u.measureText(s).width;l=l&&p!=e}}return!!l}function l(){var e=!0;for(var i in n)n[i]<r&&(u.apply(this,i.split("\n"))?(n[i]=r,f(wa),Sa=null,pa=void 0,Ea.getCount()&&Ea.clear()):(++n[i],e=!1));e&&(clearInterval(t),t=void 0)}return function(e){var i=ji(e);if(i)for(var o=i.families,a=0,s=o.length;a<s;++a){var h=o[a],c=i.style+"\n"+i.weight+"\n"+h;c in n||(n[c]=r,u(i.style,i.weight,h)||(n[c]=0,void 0===t&&(t=setInterval(l,32))))}}}();function Oa(){return Sa||(Sa=li(1,1)),Sa}var Ra,Ca,Pa=(Ca=wa,function(t){var e=Ca[t];return null==e&&(Ra||((Ra=document.createElement("div")).innerHTML="M",Ra.style.margin="0 !important",Ra.style.padding="0 !important",Ra.style.position="absolute !important",Ra.style.left="-99999px !important"),Ra.style.font=t,document.body.appendChild(Ra),e=Ra.offsetHeight,Ca[t]=e,document.body.removeChild(Ra)),e});function Ia(t,e){var r=Oa();return t!=pa&&(r.font=t,pa=r.font),r.measureText(e).width}function ba(t,e,r){if(e in r)return r[e];var n=Ia(t,e);return r[e]=n,n}function La(t,e,r,n){0!==e&&(t.translate(r,n),t.rotate(e),t.translate(-r,-n))}var Ma=[1,0,0,1,0,0];function Fa(t,e,r,n,i,o,a,s,u,l,h){var c;1!=r&&(c=t.globalAlpha,t.globalAlpha=c*r);e&&t.setTransform.apply(t,e);t.drawImage(n,i,o,a,s,u,l,a*h,s*h);1!=r&&(t.globalAlpha=c);e&&t.setTransform.apply(t,Ma)}var Aa=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Na=function(t){function e(e,r,n,i,o,a,s){var u=t.call(this)||this;return u.context_=e,u.pixelRatio_=r,u.extent_=n,u.transform_=i,u.viewRotation_=o,u.squaredTolerance_=a,u.userTransform_=s,u.contextFillState_=null,u.contextStrokeState_=null,u.contextTextState_=null,u.fillState_=null,u.strokeState_=null,u.image_=null,u.imageAnchorX_=0,u.imageAnchorY_=0,u.imageHeight_=0,u.imageOpacity_=0,u.imageOriginX_=0,u.imageOriginY_=0,u.imageRotateWithView_=!1,u.imageRotation_=0,u.imageScale_=0,u.imageWidth_=0,u.text_="",u.textOffsetX_=0,u.textOffsetY_=0,u.textRotateWithView_=!1,u.textRotation_=0,u.textScale_=0,u.textFillState_=null,u.textStrokeState_=null,u.textState_=null,u.pixelCoordinates_=[],u.tmpLocalTransform_=[1,0,0,1,0,0],u}return Aa(e,t),e.prototype.drawImages_=function(t,e,r){if(this.image_){var i=Dt(t,e,r,2,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.tmpLocalTransform_,s=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=s*this.imageOpacity_);var u=this.imageRotation_;this.imageRotateWithView_&&(u+=this.viewRotation_);for(var l=0,h=i.length;l<h;l+=2){var c=i[l]-this.imageAnchorX_,p=i[l+1]-this.imageAnchorY_;if(0!==u||1!=this.imageScale_){var f=c+this.imageAnchorX_,d=p+this.imageAnchorY_;He(a,f,d,this.imageScale_,this.imageScale_,u,-f,-d);o.setTransform.apply(o,a)}o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,c,p,this.imageWidth_,this.imageHeight_)}0===u&&1==this.imageScale_||o.setTransform(1,0,0,1,0,0);1!=this.imageOpacity_&&(o.globalAlpha=s)}},e.prototype.drawText_=function(t,e,r,n){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_);this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_);this.setContextTextState_(this.textState_);var i=Dt(t,e,r,n,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.textRotation_;for(this.textRotateWithView_&&(a+=this.viewRotation_);e<r;e+=n){var s=i[e]+this.textOffsetX_,u=i[e+1]+this.textOffsetY_;if(0!==a||1!=this.textScale_){var l=He(this.tmpLocalTransform_,s,u,this.textScale_,this.textScale_,a,-s,-u);o.setTransform.apply(o,l)}this.textStrokeState_&&o.strokeText(this.text_,s,u);this.textFillState_&&o.fillText(this.text_,s,u)}0===a&&1==this.textScale_||o.setTransform(1,0,0,1,0,0)}},e.prototype.moveToLineTo_=function(t,e,r,n,i){var o=this.context_,a=Dt(t,e,r,n,this.transform_,this.pixelCoordinates_);o.moveTo(a[0],a[1]);var s=a.length;i&&(s-=2);for(var u=2;u<s;u+=2)o.lineTo(a[u],a[u+1]);return i&&o.closePath(),r},e.prototype.drawRings_=function(t,e,r,n){for(var i=0,o=r.length;i<o;++i)e=this.moveToLineTo_(t,e,r[i],n,!0);return e},e.prototype.drawCircle=function(t){if(bt(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_);this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=function(t,e,r){var n=t.getFlatCoordinates();if(n){var i=t.getStride();return Dt(n,0,n.length,i,e,r)}return null}(t,this.transform_,this.pixelCoordinates_),r=e[2]-e[0],n=e[3]-e[1],i=Math.sqrt(r*r+n*n),o=this.context_;o.beginPath();o.arc(e[0],e[1],i,0,2*Math.PI);this.fillState_&&o.fill();this.strokeState_&&o.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke());this.setImageStyle(t.getImage());this.setTextStyle(t.getText())},e.prototype.setTransform=function(t){this.transform_=t},e.prototype.drawGeometry=function(t){switch(t.getType()){case Nt.POINT:this.drawPoint(t);break;case Nt.LINE_STRING:this.drawLineString(t);break;case Nt.POLYGON:this.drawPolygon(t);break;case Nt.MULTI_POINT:this.drawMultiPoint(t);break;case Nt.MULTI_LINE_STRING:this.drawMultiLineString(t);break;case Nt.MULTI_POLYGON:this.drawMultiPolygon(t);break;case Nt.GEOMETRY_COLLECTION:this.drawGeometryCollection(t);break;case Nt.CIRCLE:this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var r=e.getGeometryFunction()(t);r&&bt(this.extent_,r.getExtent())&&(this.setStyle(e),this.drawGeometry(r))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),r=0,n=e.length;r<n;++r)this.drawGeometry(e[r])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),r=t.getStride();this.image_&&this.drawImages_(e,0,e.length,r);""!==this.text_&&this.drawText_(e,0,e.length,r)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),r=t.getStride();this.image_&&this.drawImages_(e,0,e.length,r);""!==this.text_&&this.drawText_(e,0,e.length,r)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),bt(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,r=t.getFlatCoordinates();e.beginPath();this.moveToLineTo_(r,0,r.length,t.getStride(),!1);e.stroke()}if(""!==this.text_){var n=t.getFlatMidpoint();this.drawText_(n,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(bt(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var r=this.context_,n=t.getFlatCoordinates(),i=0,o=t.getEnds(),a=t.getStride();r.beginPath();for(var s=0,u=o.length;s<u;++s)i=this.moveToLineTo_(n,i,o[s],a,!1);r.stroke()}if(""!==this.text_){var l=t.getFlatMidpoints();this.drawText_(l,0,l.length,2)}}},e.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),bt(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_);this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_;e.beginPath();this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride());this.fillState_&&e.fill();this.strokeState_&&e.stroke()}if(""!==this.text_){var r=t.getFlatInteriorPoint();this.drawText_(r,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),bt(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_);this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_,r=t.getOrientedFlatCoordinates(),n=0,i=t.getEndss(),o=t.getStride();e.beginPath();for(var a=0,s=i.length;a<s;++a){var u=i[a];n=this.drawRings_(r,n,u,o)}this.fillState_&&e.fill();this.strokeState_&&e.stroke()}if(""!==this.text_){var l=t.getFlatInteriorPoints();this.drawText_(l,0,l.length,2)}}},e.prototype.setContextFillState_=function(t){var e=this.context_,r=this.contextFillState_;r?r.fillStyle!=t.fillStyle&&(r.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var e=this.context_,r=this.contextStrokeState_;r?(r.lineCap!=t.lineCap&&(r.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(R(r.lineDash,t.lineDash)||e.setLineDash(r.lineDash=t.lineDash),r.lineDashOffset!=t.lineDashOffset&&(r.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),r.lineJoin!=t.lineJoin&&(r.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),r.lineWidth!=t.lineWidth&&(r.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),r.miterLimit!=t.miterLimit&&(r.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),r.strokeStyle!=t.strokeStyle&&(r.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var e=this.context_,r=this.contextTextState_,n=t.textAlign?t.textAlign:"center";r?(r.font!=t.font&&(r.font=t.font,e.font=t.font),r.textAlign!=n&&(r.textAlign=n,e.textAlign=n),r.textBaseline!=t.textBaseline&&(r.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=n,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:n,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){if(t){var r=t.getColor();this.fillState_={fillStyle:ca(r||"#000")}}else this.fillState_=null;if(e){var n=e.getColor(),i=e.getLineCap(),o=e.getLineDash(),a=e.getLineDashOffset(),s=e.getLineJoin(),u=e.getWidth(),l=e.getMiterLimit();this.strokeState_={lineCap:void 0!==i?i:"round",lineDash:o||va,lineDashOffset:a||0,lineJoin:void 0!==s?s:"round",lineWidth:this.pixelRatio_*(void 0!==u?u:1),miterLimit:void 0!==l?l:10,strokeStyle:ca(n||"#000")}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){if(t){var e=t.getAnchor(),r=t.getImage(1),n=t.getOrigin(),i=t.getSize();this.imageAnchorX_=e[0];this.imageAnchorY_=e[1];this.imageHeight_=i[1];this.image_=r;this.imageOpacity_=t.getOpacity();this.imageOriginX_=n[0];this.imageOriginY_=n[1];this.imageRotateWithView_=t.getRotateWithView();this.imageRotation_=t.getRotation();this.imageScale_=t.getScale()*this.pixelRatio_;this.imageWidth_=i[0]}else this.image_=null},e.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var r=e.getColor();this.textFillState_={fillStyle:ca(r||"#000")}}else this.textFillState_=null;var n=t.getStroke();if(n){var i=n.getColor(),o=n.getLineCap(),a=n.getLineDash(),s=n.getLineDashOffset(),u=n.getLineJoin(),l=n.getWidth(),h=n.getMiterLimit();this.textStrokeState_={lineCap:void 0!==o?o:"round",lineDash:a||va,lineDashOffset:s||0,lineJoin:void 0!==u?u:"round",lineWidth:void 0!==l?l:1,miterLimit:void 0!==h?h:10,strokeStyle:ca(i||"#000")}}else this.textStrokeState_=null;var c=t.getFont(),p=t.getOffsetX(),f=t.getOffsetY(),d=t.getRotateWithView(),_=t.getRotation(),g=t.getScale(),y=t.getText(),v=t.getTextAlign(),m=t.getTextBaseline();this.textState_={font:void 0!==c?c:"10px sans-serif",textAlign:void 0!==v?v:"center",textBaseline:void 0!==m?m:"middle"};this.text_=void 0!==y?y:"";this.textOffsetX_=void 0!==p?this.pixelRatio_*p:0;this.textOffsetY_=void 0!==f?this.pixelRatio_*f:0;this.textRotateWithView_=void 0!==d&&d;this.textRotation_=void 0!==_?_:0;this.textScale_=this.pixelRatio_*(void 0!==g?g:1)}else this.text_=""},e}(fa),Da={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4},Ga={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"},ja=.5,ka={Point:function(t,e,r,n){var i=r.getImage();if(i){if(i.getImageState()!=Da.LOADED)return;var o=t.getBuilder(r.getZIndex(),Ga.IMAGE);o.setImageStyle(i,t.addDeclutter(!1));o.drawPoint(e,n)}var a=r.getText();if(a){var s=t.getBuilder(r.getZIndex(),Ga.TEXT);s.setTextStyle(a,t.addDeclutter(!!i));s.drawText(e,n)}},LineString:function(t,e,r,n){var i=r.getStroke();if(i){var o=t.getBuilder(r.getZIndex(),Ga.LINE_STRING);o.setFillStrokeStyle(null,i);o.drawLineString(e,n)}var a=r.getText();if(a){var s=t.getBuilder(r.getZIndex(),Ga.TEXT);s.setTextStyle(a,t.addDeclutter(!1));s.drawText(e,n)}},Polygon:function(t,e,r,n){var i=r.getFill(),o=r.getStroke();if(i||o){var a=t.getBuilder(r.getZIndex(),Ga.POLYGON);a.setFillStrokeStyle(i,o);a.drawPolygon(e,n)}var s=r.getText();if(s){var u=t.getBuilder(r.getZIndex(),Ga.TEXT);u.setTextStyle(s,t.addDeclutter(!1));u.drawText(e,n)}},MultiPoint:function(t,e,r,n){var i=r.getImage();if(i){if(i.getImageState()!=Da.LOADED)return;var o=t.getBuilder(r.getZIndex(),Ga.IMAGE);o.setImageStyle(i,t.addDeclutter(!1));o.drawMultiPoint(e,n)}var a=r.getText();if(a){var s=t.getBuilder(r.getZIndex(),Ga.TEXT);s.setTextStyle(a,t.addDeclutter(!!i));s.drawText(e,n)}},MultiLineString:function(t,e,r,n){var i=r.getStroke();if(i){var o=t.getBuilder(r.getZIndex(),Ga.LINE_STRING);o.setFillStrokeStyle(null,i);o.drawMultiLineString(e,n)}var a=r.getText();if(a){var s=t.getBuilder(r.getZIndex(),Ga.TEXT);s.setTextStyle(a,t.addDeclutter(!1));s.drawText(e,n)}},MultiPolygon:function(t,e,r,n){var i=r.getFill(),o=r.getStroke();if(o||i){var a=t.getBuilder(r.getZIndex(),Ga.POLYGON);a.setFillStrokeStyle(i,o);a.drawMultiPolygon(e,n)}var s=r.getText();if(s){var u=t.getBuilder(r.getZIndex(),Ga.TEXT);u.setTextStyle(s,t.addDeclutter(!1));u.drawText(e,n)}},GeometryCollection:function(t,e,r,n){for(var a=e.getGeometriesArray(),i=0,o=a.length;i<o;++i)ka[a[i].getType()](t,a[i],r,n)},Circle:function(t,e,r,n){var i=r.getFill(),o=r.getStroke();if(i||o){var a=t.getBuilder(r.getZIndex(),Ga.CIRCLE);a.setFillStrokeStyle(i,o);a.drawCircle(e,n)}var s=r.getText();if(s){var u=t.getBuilder(r.getZIndex(),Ga.TEXT);u.setTextStyle(s,t.addDeclutter(!1));u.drawText(e,n)}}};function Ua(t,e){return parseInt(o(t),10)-parseInt(o(e),10)}function Ba(t,e){var r=Ya(t,e);return r*r}function Ya(t,e){return ja*t/e}function za(t,e,r,n,i,o){var a=!1,s=r.getImage();if(s){var u=s.getImageState();u==Da.LOADED||u==Da.ERROR?s.unlistenImageChange(i):(u==Da.IDLE&&s.load(),u=s.getImageState(),s.listenImageChange(i),a=!0)}return function(t,e,r,n,i){var o=r.getGeometryFunction()(e);if(o){var a=o.simplifyTransformed(n,i);r.getRenderer()?!function t(e,r,n,i){if(r.getType()==Nt.GEOMETRY_COLLECTION){for(var o=r.getGeometries(),a=0,s=o.length;a<s;++a)t(e,o[a],n,i);return}var u=e.getBuilder(n.getZIndex(),Ga.DEFAULT);u.drawCustom(r,i,n.getRenderer())}(t,a,r,e):ka[a.getType()](t,a,r,e)}}(t,e,r,n,o),a}function Xa(t,e){e&&e.clear();for(var r=t.declutterItems,n=r.length-1;n>=0;--n)for(var i=r[n],o=i.items,a=0,s=o.length;a<s;a+=3)e=o[a].renderDeclutter(o[a+1],o[a+2],i.opacity,e);return r.length=0,e}var Va=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Wa(){ha.expire()}var Za=function(t){function e(e){var r=t.call(this)||this;return r.map_=e,r.declutterTree_=null,r}return Va(e,t),e.prototype.dispatchRenderEvent=function(){n()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,r=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;He(r,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]);qe(n,r)},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i,o,a,s){var u,l=e.viewState;function h(t,e,r){return i.call(o,e,t?r:null)}var c=l.projection,p=t,f=[[0,0]];if(c.canWrapX()){var d=c.getExtent(),_=It(d),g=t[0];(g<d[0]||g>d[2])&&(p=[g+_*Math.ceil((d[0]-g)/_),t[1]]);n&&f.push([-_,0],[_,0])}var y,v=e.layerStatesArray,m=v.length;this.declutterTree_&&(y=this.declutterTree_.all().map(function(t){return t.value}));for(var E=[],T=0;T<f.length;T++)for(var S=m-1;S>=0;--S){var w=v[S],x=w.layer;if(x.hasRenderer()&&Ui(w,l)&&a.call(s,x)){var O=x.getRenderer(),R=x.getSource();if(O&&R){var C=R.getWrapX()?p:t,P=h.bind(null,w.managed);E[0]=C[0]+f[T][0];E[1]=C[1]+f[T][1];u=O.forEachFeatureAtCoordinate(E,e,r,P,y)}if(u)return u}}},e.prototype.forEachLayerAtPixel=function(){return n()},e.prototype.hasFeatureAtCoordinate=function(t,e,r,n,i,o){return void 0!==this.forEachFeatureAtCoordinate(t,e,r,n,P,this,i,o)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){this.declutterTree_=Xa(t,this.declutterTree_)},e.prototype.scheduleExpireIconCache=function(t){ha.canExpireCache()&&t.postRenderFunctions.push(Wa)},e}(m),Ka=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ha=function(t){function e(e){var r=t.call(this,e)||this;r.labelCacheKey_=g(Ea,N.CLEAR,e.redrawText.bind(e));r.element_=document.createElement("div");var n=r.element_.style;n.position="absolute";n.width="100%";n.height="100%";n.zIndex="0";r.element_.className=Ai+" ol-layers";var i=e.getViewport();return i.insertBefore(r.element_,i.firstChild||null),r.children_=[],r.renderedVisible_=!0,r}return Ka(e,t),e.prototype.dispatchRenderEvent=function(t,e){var r=this.getMap();if(r.hasListener(t)){var n=new $o(t,void 0,e);r.dispatchEvent(n)}},e.prototype.disposeInternal=function(){v(this.labelCacheKey_);t.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(e){if(e){this.calculateMatrices2D(e);this.dispatchRenderEvent(En,e);var r=e.layerStatesArray.sort(function(t,e){return t.zIndex-e.zIndex}),n=e.viewState;this.children_.length=0;for(var i=null,o=0,a=r.length;o<a;++o){var s=r[o];if(e.layerIndex=o,Ui(s,n)&&(s.sourceState==vi.READY||s.sourceState==vi.UNDEFINED)){var u=s.layer.render(e,i);u&&u!==i&&(this.children_.push(u),i=u)}}t.prototype.renderFrame.call(this,e),function(t,e){for(var r=t.childNodes,n=0;;++n){var i=r[n],o=e[n];if(!i&&!o)break;i!==o&&(i?o?t.insertBefore(o,i):(t.removeChild(i),--n):t.appendChild(o))}}(this.element_,this.children_);this.dispatchRenderEvent(Tn,e);this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0);this.scheduleExpireIconCache(e)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,r,n,i){for(var o=e.viewState,a=e.layerStatesArray,s=a.length-1;s>=0;--s){var u=a[s],l=u.layer;if(l.hasRenderer()&&Ui(u,o)&&i(l)){var h=l.getRenderer().getDataAtPixel(t,e,r);if(h){var c=n(l,h);if(c)return c}}}},e}(Za),qa=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ja=function(t){function e(e){return(e=p({},e)).controls||(e.controls=qi()),e.interactions||(e.interactions=Jo()),t.call(this,e)||this}return qa(e,t),e.prototype.createRenderer=function(){return new Ha(this)},e}(Ii),Qa={BOTTOM_LEFT:"bottom-left",BOTTOM_CENTER:"bottom-center",BOTTOM_RIGHT:"bottom-right",CENTER_LEFT:"center-left",CENTER_CENTER:"center-center",CENTER_RIGHT:"center-right",TOP_LEFT:"top-left",TOP_CENTER:"top-center",TOP_RIGHT:"top-right"},$a=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ts={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"},es=function(t){function e(e){var r=t.call(this)||this;return r.options=e,r.id=e.id,r.insertFirst=void 0===e.insertFirst||e.insertFirst,r.stopEvent=void 0===e.stopEvent||e.stopEvent,r.element=document.createElement("div"),r.element.className=void 0!==e.className?e.className:"ol-overlay-container "+Fi,r.element.style.position="absolute",r.autoPan=void 0!==e.autoPan&&e.autoPan,r.autoPanAnimation=e.autoPanAnimation||{},r.autoPanMargin=void 0!==e.autoPanMargin?e.autoPanMargin:20,r.rendered={bottom_:"",left_:"",right_:"",top_:"",visible:!0},r.mapPostrenderListenerKey=null,r.addEventListener(Y(ts.ELEMENT),r.handleElementChanged),r.addEventListener(Y(ts.MAP),r.handleMapChanged),r.addEventListener(Y(ts.OFFSET),r.handleOffsetChanged),r.addEventListener(Y(ts.POSITION),r.handlePositionChanged),r.addEventListener(Y(ts.POSITIONING),r.handlePositioningChanged),void 0!==e.element&&r.setElement(e.element),r.setOffset(void 0!==e.offset?e.offset:[0,0]),r.setPositioning(void 0!==e.positioning?e.positioning:Qa.TOP_LEFT),void 0!==e.position&&r.setPosition(e.position),r}return $a(e,t),e.prototype.getElement=function(){return this.get(ts.ELEMENT)},e.prototype.getId=function(){return this.id},e.prototype.getMap=function(){return this.get(ts.MAP)},e.prototype.getOffset=function(){return this.get(ts.OFFSET)},e.prototype.getPosition=function(){return this.get(ts.POSITION)},e.prototype.getPositioning=function(){return this.get(ts.POSITIONING)},e.prototype.handleElementChanged=function(){di(this.element);var t=this.getElement();t&&this.element.appendChild(t)},e.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(fi(this.element),v(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=g(t,dn,this.render,this);this.updatePixelPosition();var e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element)}},e.prototype.render=function(){this.updatePixelPosition()},e.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},e.prototype.handlePositionChanged=function(){this.updatePixelPosition();this.get(ts.POSITION)&&this.autoPan&&this.panIntoView()},e.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},e.prototype.setElement=function(t){this.set(ts.ELEMENT,t)},e.prototype.setMap=function(t){this.set(ts.MAP,t)},e.prototype.setOffset=function(t){this.set(ts.OFFSET,t)},e.prototype.setPosition=function(t){this.set(ts.POSITION,t)},e.prototype.panIntoView=function(){var t=this.getMap();if(t&&t.getTargetElement()){var e=this.getRect(t.getTargetElement(),t.getSize()),r=this.getElement(),n=this.getRect(r,[hi(r),ci(r)]),i=this.autoPanMargin;if(!it(e,n)){var o=n[0]-e[0],a=e[2]-n[2],s=n[1]-e[1],u=e[3]-n[3],l=[0,0];if(o<0?l[0]=o-i:a<0&&(l[0]=Math.abs(a)+i),s<0?l[1]=s-i:u<0&&(l[1]=Math.abs(u)+i),0!==l[0]||0!==l[1]){var h=t.getView().getCenterInternal(),c=t.getPixelFromCoordinateInternal(h),p=[c[0]+l[0],c[1]+l[1]];t.getView().animateInternal({center:t.getCoordinateFromPixelInternal(p),duration:this.autoPanAnimation.duration,easing:this.autoPanAnimation.easing})}}}},e.prototype.getRect=function(t,e){var r=t.getBoundingClientRect(),n=r.left+window.pageXOffset,i=r.top+window.pageYOffset;return[n,i,n+e[0],i+e[1]]},e.prototype.setPositioning=function(t){this.set(ts.POSITIONING,t)},e.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},e.prototype.updatePixelPosition=function(){var t=this.getMap(),e=this.getPosition();if(t&&t.isRendered()&&e){var r=t.getPixelFromCoordinate(e),n=t.getSize();this.updateRenderedPosition(r,n)}else this.setVisible(!1)},e.prototype.updateRenderedPosition=function(t,e){var r=this.element.style,n=this.getOffset(),i=this.getPositioning();this.setVisible(!0);var o=n[0],a=n[1];if(i==Qa.BOTTOM_RIGHT||i==Qa.CENTER_RIGHT||i==Qa.TOP_RIGHT){""!==this.rendered.left_&&(this.rendered.left_="",r.left="");var s=Math.round(e[0]-t[0]-o)+"px";this.rendered.right_!=s&&(this.rendered.right_=s,r.right=s)}else{""!==this.rendered.right_&&(this.rendered.right_="",r.right="");i!=Qa.BOTTOM_CENTER&&i!=Qa.CENTER_CENTER&&i!=Qa.TOP_CENTER||(o-=this.element.offsetWidth/2);var u=Math.round(t[0]+o)+"px";this.rendered.left_!=u&&(this.rendered.left_=u,r.left=u)}if(i==Qa.BOTTOM_LEFT||i==Qa.BOTTOM_CENTER||i==Qa.BOTTOM_RIGHT){""!==this.rendered.top_&&(this.rendered.top_="",r.top="");var l=Math.round(e[1]-t[1]-a)+"px";this.rendered.bottom_!=l&&(this.rendered.bottom_=l,r.bottom=l)}else{""!==this.rendered.bottom_&&(this.rendered.bottom_="",r.bottom="");i!=Qa.CENTER_LEFT&&i!=Qa.CENTER_CENTER&&i!=Qa.CENTER_RIGHT||(a-=this.element.offsetHeight/2);var h=Math.round(t[1]+a)+"px";this.rendered.top_!=h&&(this.rendered.top_="top",r.top=h)}},e.prototype.getOptions=function(){return this.options},e}(z),rs={ARRAY_BUFFER:"arraybuffer",JSON:"json",TEXT:"text",XML:"xml"},ns=!1;function is(t,e,r,n){return function(i,o,a){var s=new XMLHttpRequest;s.open("GET","function"==typeof t?t(i,o,a):t,!0);e.getType()==rs.ARRAY_BUFFER&&(s.responseType="arraybuffer");s.withCredentials=ns;s.onload=function(){if(!s.status||s.status>=200&&s.status<300){var o=e.getType(),u=void 0;o==rs.JSON||o==rs.TEXT?u=s.responseText:o==rs.XML?(u=s.responseXML)||(u=(new DOMParser).parseFromString(s.responseText,"application/xml")):o==rs.ARRAY_BUFFER&&(u=s.response);u?r.call(this,e.readFeatures(u,{extent:i,featureProjection:a}),e.readProjection(u)):n.call(this)}else n.call(this)}.bind(this);s.onerror=function(){n.call(this)}.bind(this);s.send()}}function os(t,e){return is(t,e,function(t){"function"==typeof this.addFeatures&&this.addFeatures(t)},b)}function as(){return[[-1/0,-1/0,1/0,1/0]]}function ss(t){return[t]}var us=function(){function t(t,e,r,n){this.minX=t;this.maxX=e;this.minY=r;this.maxY=n}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minX<this.minX&&(this.minX=t.minX);t.maxX>this.maxX&&(this.maxX=t.maxX);t.minY<this.minY&&(this.minY=t.minY);t.maxY>this.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function ls(t,e,r,n,i){return void 0!==i?(i.minX=t,i.maxX=e,i.minY=r,i.maxY=n,i):new us(t,e,r,n)}var hs=us;function cs(t,e,r,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=r,n):[t,e,r]}function ps(t,e,r){return t+"/"+e+"/"+r}function fs(t){return ps(t[0],t[1],t[2])}function ds(t){return(t[1]<<t[0])+t[2]}var _s=[0,0,0],gs=function(){function t(t){var e,r,n,i;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,K((e=this.resolutions_,r=!0,n=function(t,e){return e-t}||E,e.every(function(t,i){if(0===i)return!0;var o=n(e[i-1],t);return!(o>0||r&&0===o)})),17),!t.origins)for(var o=0,a=this.resolutions_.length-1;o<a;++o)if(i){if(this.resolutions_[o]/this.resolutions_[o+1]!==i){i=void 0;break}}else i=this.resolutions_[o]/this.resolutions_[o+1];this.zoomFactor_=i;this.maxZoom=this.resolutions_.length-1;this.origin_=void 0!==t.origin?t.origin:null;this.origins_=null;void 0!==t.origins&&(this.origins_=t.origins,K(this.origins_.length==this.resolutions_.length,20));var s=t.extent;void 0===s||this.origin_||this.origins_||(this.origin_=Ct(s));K(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18);this.tileSizes_=null;void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,K(this.tileSizes_.length==this.resolutions_.length,19));this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:Pn;K(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22);this.extent_=void 0!==s?s:null;this.fullTileRanges_=null;this.tmpSize_=[0,0];void 0!==t.sizes?this.fullTileRanges_=t.sizes.map(function(t){return new hs(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1))},this):s&&this.calculateTileRanges_(s)}return t.prototype.forEachTileCoord=function(t,e,r){for(var n=this.getTileRangeForExtentAndZ(t,e),i=n.minX,o=n.maxX;i<=o;++i)for(var a=n.minY,s=n.maxY;a<=s;++a)r([e,i,a])},t.prototype.forEachTileCoordParentTileRange=function(t,e,r,n){var i,o,a=null,s=t[0]-1;for(2===this.zoomFactor_?(i=t[1],o=t[2]):a=this.getTileCoordExtent(t,n);s>=this.minZoom;){if(e(s,2===this.zoomFactor_?ls(i=Math.floor(i/2),i,o=Math.floor(o/2),o,r):this.getTileRangeForExtentAndZ(a,s,r)))return!0;--s}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,r){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var n=2*t[1],i=2*t[2];return ls(n,n+1,i,i+1,e)}var o=this.getTileCoordExtent(t,r);return this.getTileRangeForExtentAndZ(o,t[0]+1,e)}return null},t.prototype.getTileRangeExtent=function(t,e,r){var n=this.getOrigin(t),i=this.getResolution(t),o=xi(this.getTileSize(t),this.tmpSize_),a=n[0]+e.minX*o[0]*i,s=n[0]+(e.maxX+1)*o[0]*i;return ut(a,n[1]+e.minY*o[1]*i,s,n[1]+(e.maxY+1)*o[1]*i,r)},t.prototype.getTileRangeForExtentAndZ=function(t,e,r){var n=_s;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,n);var i=n[1],o=n[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,n),ls(i,n[1],o,n[2],r)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),r=this.getResolution(t[0]),n=xi(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*n[0]*r,e[1]-(t[2]+.5)*n[1]*r]},t.prototype.getTileCoordExtent=function(t,e){var r=this.getOrigin(t[0]),n=this.getResolution(t[0]),i=xi(this.getTileSize(t[0]),this.tmpSize_),o=r[0]+t[1]*i[0]*n,a=r[1]-(t[2]+1)*i[1]*n;return ut(o,a,o+i[0]*n,a+i[1]*n,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,r){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,r)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,r,n,i){var o=this.getZForResolution(r),a=r/this.getResolution(o),s=this.getOrigin(o),u=xi(this.getTileSize(o),this.tmpSize_),l=n?.5:0,h=n?.5:0,c=Math.floor((t-s[0])/r+l),p=Math.floor((s[1]-e)/r+h),f=a*c/u[0],d=a*p/u[1];return n?(f=Math.ceil(f)-1,d=Math.ceil(d)-1):(f=Math.floor(f),d=Math.floor(d)),cs(o,f,d,i)},t.prototype.getTileCoordForXYAndZ_=function(t,e,r,n,i){var o=this.getOrigin(r),a=this.getResolution(r),s=xi(this.getTileSize(r),this.tmpSize_),u=n?.5:0,l=n?.5:0,h=Math.floor((t-o[0])/a+u),c=Math.floor((o[1]-e)/a+l),p=h/s[0],f=c/s[1];return n?(p=Math.ceil(p)-1,f=Math.ceil(f)-1):(p=Math.floor(p),f=Math.floor(f)),cs(r,p,f,i)},t.prototype.getTileCoordForCoordAndZ=function(t,e,r){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,r)},t.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},t.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},t.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:null},t.prototype.getZForResolution=function(t,e){return kt(S(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,r=new Array(e),n=this.minZoom;n<e;++n)r[n]=this.getTileRangeForExtentAndZ(t,n);this.fullTileRanges_=r},t}();function ys(t){var e=t.getDefaultTileGrid();return e||(e=Es(t),t.setDefaultTileGrid(e)),e}function vs(t){var e=t||{},r=e.extent||we("EPSG:3857").getExtent(),n={extent:r,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:ms(r,e.maxZoom,e.tileSize)};return new gs(n)}function ms(t,e,r){for(var n=void 0!==e?e:Cn,i=Ot(t),o=It(t),a=xi(void 0!==r?r:Pn),s=Math.max(o/a[0],i/a[1]),u=n+1,l=new Array(u),h=0;h<u;++h)l[h]=s/Math.pow(2,h);return l}function Es(t,e,r,n){return function(t,e,r,n){var i=void 0!==n?n:J.TOP_LEFT,o=ms(t,e,r);return new gs({extent:t,origin:wt(t,i),resolutions:o,tileSize:r})}(Ts(t),e,r,n)}function Ts(t){var e=(t=we(t)).getExtent();if(!e){var r=180*$t[te.DEGREES]/t.getMetersPerUnit();e=ut(-r,-r,r,r)}return e}var Ss,ws=34962,xs=34963,Os=35048,Rs=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function Cs(t,e){for(var r=Rs.length,n=0;n<r;++n)try{var i=t.getContext(Rs[n],e);if(i)return i}catch(t){}return null}var Ps=document.implementation.createDocument("","",null),Is="http://www.w3.org/2001/XMLSchema-instance";function bs(t,e){return Ps.createElementNS(t,e)}function Ls(t,e){return function t(e,r,n){if(e.nodeType==Node.CDATA_SECTION_NODE||e.nodeType==Node.TEXT_NODE)r?n.push(String(e.nodeValue).replace(/(\r\n|\r|\n)/g,"")):n.push(e.nodeValue);else for(var i=void 0,i=e.firstChild;i;i=i.nextSibling)t(i,r,n);return n}(t,e,[]).join("")}function Ms(t){return"documentElement"in t}function Fs(t){return(new DOMParser).parseFromString(t,"application/xml")}function As(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&x(n[n.length-1],i)}}function Ns(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&n[n.length-1].push(i)}}function Ds(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&(n[n.length-1]=i)}}function Gs(t,e,r){return function(n,i){var o=t.call(void 0!==r?r:this,n,i);if(void 0!==o){var a=i[i.length-1],s=void 0!==e?e:n.localName,u=void 0;s in a?u=a[s]:(u=[],a[s]=u);u.push(o)}}}function js(t,e,r){return function(n,i){var o=t.call(void 0!==r?r:this,n,i);void 0!==o&&(i[i.length-1][void 0!==e?e:n.localName]=o)}}function ks(t,e){return function(r,n,i){t.call(void 0!==e?e:this,r,n,i);i[i.length-1].node.appendChild(r)}}function Us(t){var r,n;return function(e,i,o){if(void 0===r){r={};var a={};a[e.localName]=t;r[e.namespaceURI]=a;n=Bs(e.localName)}Zs(r,n,i,o)}}function Bs(t,e){var r=t;return function(t,n,i){var o=n[n.length-1].node,a=r;return void 0===a&&(a=i),bs(void 0!==e?e:o.namespaceURI,a)}}var Ys=Bs();function zs(t,e){for(var r=e.length,n=new Array(r),i=0;i<r;++i)n[i]=t[e[i]];return n}function Xs(t,e,r){for(var o=void 0!==r?r:{},n=0,i=t.length;n<i;++n)o[t[n]]=e;return o}function Vs(t,e,r,n){for(var i=e.firstElementChild;i;i=i.nextElementSibling){var o=t[i.namespaceURI];if(void 0!==o){var a=o[i.localName];void 0!==a&&a.call(n,i,r)}}}function Ws(t,e,r,n,i){return n.push(t),Vs(e,r,n,i),n.pop()}function Zs(t,e,r,n,i,o){for(var a,s,u=(void 0!==i?i:r).length,l=0;l<u;++l)void 0!==(a=r[l])&&void 0!==(s=e.call(void 0!==o?o:this,a,n,void 0!==i?i[l]:void 0))&&t[s.namespaceURI][s.localName].call(o,s,a,n)}function Ks(t,e,r,n,i,o,a){return i.push(t),Zs(e,r,n,i,o,a),i.pop()}var Hs={STATIC_DRAW:35044,STREAM_DRAW:35040,DYNAMIC_DRAW:Os};function qs(t){switch(t){case ws:return Float32Array;case xs:return Uint32Array;default:return Float32Array}}var Js=function(){function t(t,e){this.array=null;this.type=t;K(t===ws||t===xs,62);this.usage=void 0!==e?e:Hs.STATIC_DRAW}return t.prototype.ofSize=function(t){this.array=new(qs(this.type))(t)},t.prototype.fromArray=function(t){this.array=qs(this.type).from(t)},t.prototype.fromArrayBuffer=function(t){this.array=new(qs(this.type))(t)},t.prototype.getType=function(){return this.type},t.prototype.getArray=function(){return this.array},t.prototype.getUsage=function(){return this.usage},t.prototype.getSize=function(){return this.array?this.array.length:0},t}(),Qs={LOST:"webglcontextlost",RESTORED:"webglcontextrestored"};function $s(t,e){return t[0]=e[0],t[1]=e[1],t[4]=e[2],t[5]=e[3],t[12]=e[4],t[13]=e[5],t}var tu="\n  precision mediump float;\n  \n  attribute vec2 a_position;\n  varying vec2 v_texCoord;\n  varying vec2 v_screenCoord;\n  \n  uniform vec2 u_screenSize;\n   \n  void main() {\n    v_texCoord = a_position * 0.5 + 0.5;\n    v_screenCoord = v_texCoord * u_screenSize;\n    gl_Position = vec4(a_position, 0.0, 1.0);\n  }\n",eu="\n  precision mediump float;\n   \n  uniform sampler2D u_image;\n   \n  varying vec2 v_texCoord;\n  varying vec2 v_screenCoord;\n   \n  void main() {\n    gl_FragColor = texture2D(u_image, v_texCoord);\n  }\n",ru=function(){function t(t){this.gl_=t.webGlContext;var e=this.gl_;this.scaleRatio_=t.scaleRatio||1;this.renderTargetTexture_=e.createTexture();this.renderTargetTextureSize_=null;this.frameBuffer_=e.createFramebuffer();var r=e.createShader(e.VERTEX_SHADER);e.shaderSource(r,t.vertexShader||tu);e.compileShader(r);var n=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(n,t.fragmentShader||eu);e.compileShader(n);this.renderTargetProgram_=e.createProgram();e.attachShader(this.renderTargetProgram_,r);e.attachShader(this.renderTargetProgram_,n);e.linkProgram(this.renderTargetProgram_);this.renderTargetVerticesBuffer_=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,this.renderTargetVerticesBuffer_);e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,-1,1,1,-1,1]),e.STATIC_DRAW);this.renderTargetAttribLocation_=e.getAttribLocation(this.renderTargetProgram_,"a_position");this.renderTargetUniformLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_screenSize");this.renderTargetTextureLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_image");this.uniforms_=[];t.uniforms&&Object.keys(t.uniforms).forEach(function(r){this.uniforms_.push({value:t.uniforms[r],location:e.getUniformLocation(this.renderTargetProgram_,r)})}.bind(this))}return t.prototype.getGL=function(){return this.gl_},t.prototype.init=function(t){var e=this.getGL(),r=e.canvas,n=t.size;if(e.bindFramebuffer(e.FRAMEBUFFER,this.getFrameBuffer()),e.viewport(0,0,r.width*this.scaleRatio_,r.height*this.scaleRatio_),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==n[0]||this.renderTargetTextureSize_[1]!==n[1]){this.renderTargetTextureSize_=n;var i=e.RGBA,o=e.RGBA,a=e.UNSIGNED_BYTE;e.bindTexture(e.TEXTURE_2D,this.renderTargetTexture_);e.texImage2D(e.TEXTURE_2D,0,i,r.width*this.scaleRatio_,r.height*this.scaleRatio_,0,o,a,null);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.renderTargetTexture_,0)}},t.prototype.apply=function(t,e){var r=this.getGL(),n=r.canvas;r.bindFramebuffer(r.FRAMEBUFFER,e?e.getFrameBuffer():null);r.activeTexture(r.TEXTURE0);r.bindTexture(r.TEXTURE_2D,this.renderTargetTexture_);r.clearColor(0,0,0,0);r.clear(r.COLOR_BUFFER_BIT);r.enable(r.BLEND);r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA);r.viewport(0,0,n.width,n.height);r.bindBuffer(r.ARRAY_BUFFER,this.renderTargetVerticesBuffer_);r.useProgram(this.renderTargetProgram_);r.enableVertexAttribArray(this.renderTargetAttribLocation_);r.vertexAttribPointer(this.renderTargetAttribLocation_,2,r.FLOAT,!1,0,0);r.uniform2f(this.renderTargetUniformLocation_,n.width,n.height);r.uniform1i(this.renderTargetTextureLocation_,0);this.applyUniforms(t);r.drawArrays(r.TRIANGLES,0,6)},t.prototype.getFrameBuffer=function(){return this.frameBuffer_},t.prototype.applyUniforms=function(t){var e,r=this.getGL(),n=1;this.uniforms_.forEach(function(i){if((e="function"==typeof i.value?i.value(t):i.value)instanceof HTMLCanvasElement||e instanceof ImageData)i.texture||(i.texture=r.createTexture()),r.activeTexture(r["TEXTURE"+n]),r.bindTexture(r.TEXTURE_2D,i.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),e instanceof ImageData?r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,e.width,e.height,0,r.UNSIGNED_BYTE,new Uint8Array(e.data)):r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e),r.uniform1i(i.location,n++);else if(Array.isArray(e))switch(e.length){case 2:return void r.uniform2f(i.location,e[0],e[1]);case 3:return void r.uniform3f(i.location,e[0],e[1],e[2]);case 4:return void r.uniform4f(i.location,e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&r.uniform1f(i.location,e)})},t}(),nu=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),iu={PROJECTION_MATRIX:"u_projectionMatrix",OFFSET_SCALE_MATRIX:"u_offsetScaleMatrix",OFFSET_ROTATION_MATRIX:"u_offsetRotateMatrix",TIME:"u_time",ZOOM:"u_zoom",RESOLUTION:"u_resolution"},ou={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126};function au(t){for(var e=0,r=0;r<t.length;r++){var n=t[r];e+=n.size*su(n.type)}return e}function su(t){switch(t){case ou.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case ou.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case ou.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case ou.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}var uu=function(t){function e(e){var r=t.call(this)||this,n=e||{};r.boundHandleWebGLContextLost_=r.handleWebGLContextLost.bind(r);r.boundHandleWebGLContextRestored_=r.handleWebGLContextRestored.bind(r);r.canvas_=document.createElement("canvas");r.canvas_.style.position="absolute";r.canvas_.style.left="0";r.gl_=Cs(r.canvas_);var i=r.getGL();if(r.bufferCache_={},r.currentProgram_=null,K(T(function(){if(!Ss){var t=Cs(document.createElement("canvas"));t&&(Ss=t.getSupportedExtensions())}return Ss}(),"OES_element_index_uint"),63),i.getExtension("OES_element_index_uint"),r.canvas_.addEventListener(Qs.LOST,r.boundHandleWebGLContextLost_),r.canvas_.addEventListener(Qs.RESTORED,r.boundHandleWebGLContextRestored_),r.offsetRotateMatrix_=[1,0,0,1,0,0],r.offsetScaleMatrix_=[1,0,0,1,0,0],r.tmpMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],r.uniformLocations_={},r.attribLocations_={},r.uniforms_=[],n.uniforms)for(var o in n.uniforms)r.uniforms_.push({name:o,value:n.uniforms[o]});return r.postProcessPasses_=n.postProcesses?n.postProcesses.map(function(t){return new ru({webGlContext:i,scaleRatio:t.scaleRatio,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms})}):[new ru({webGlContext:i})],r.shaderCompileErrors_=null,r.startTime_=Date.now(),r}return nu(e,t),e.prototype.bindBuffer=function(t){var e=this.getGL(),r=o(t),n=this.bufferCache_[r];n||(n={buffer:t,webGlBuffer:e.createBuffer()},this.bufferCache_[r]=n);e.bindBuffer(t.getType(),n.webGlBuffer)},e.prototype.flushBufferData=function(t){var e=this.getGL();this.bindBuffer(t);e.bufferData(t.getType(),t.getArray(),t.getUsage())},e.prototype.deleteBuffer=function(t){var e=this.getGL(),r=o(t),n=this.bufferCache_[r];e.isContextLost()||e.deleteBuffer(n.buffer);delete this.bufferCache_[r]},e.prototype.disposeInternal=function(){this.canvas_.removeEventListener(Qs.LOST,this.boundHandleWebGLContextLost_);this.canvas_.removeEventListener(Qs.RESTORED,this.boundHandleWebGLContextRestored_)},e.prototype.prepareDraw=function(t){var e=this.getGL(),r=this.getCanvas(),n=t.size,i=t.pixelRatio;r.width=n[0]*i;r.height=n[1]*i;r.style.width=n[0]+"px";r.style.height=n[1]+"px";e.useProgram(this.currentProgram_);for(var o=this.postProcessPasses_.length-1;o>=0;o--)this.postProcessPasses_[o].init(t);e.bindTexture(e.TEXTURE_2D,null);e.clearColor(0,0,0,0);e.clear(e.COLOR_BUFFER_BIT);e.enable(e.BLEND);e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA);e.useProgram(this.currentProgram_);this.applyFrameState(t);this.applyUniforms(t)},e.prototype.prepareDrawToRenderTarget=function(t,e,r){var n=this.getGL(),i=e.getSize();n.bindFramebuffer(n.FRAMEBUFFER,e.getFramebuffer());n.viewport(0,0,i[0],i[1]);n.bindTexture(n.TEXTURE_2D,e.getTexture());n.clearColor(0,0,0,0);n.clear(n.COLOR_BUFFER_BIT);n.enable(n.BLEND);n.blendFunc(n.ONE,r?n.ZERO:n.ONE_MINUS_SRC_ALPHA);n.useProgram(this.currentProgram_);this.applyFrameState(t);this.applyUniforms(t)},e.prototype.drawElements=function(t,e){var r=this.getGL(),n=r.UNSIGNED_INT,i=e-t,o=4*t;r.drawElements(r.TRIANGLES,i,n,o)},e.prototype.finalizeDraw=function(t){for(var e=0;e<this.postProcessPasses_.length;e++)this.postProcessPasses_[e].apply(t,this.postProcessPasses_[e+1]||null)},e.prototype.getCanvas=function(){return this.canvas_},e.prototype.getGL=function(){return this.gl_},e.prototype.applyFrameState=function(t){var e=t.size,r=t.viewState.rotation,n=Xe(this.offsetScaleMatrix_);Ke(n,2/e[0],2/e[1]);var i,o,a,s,u=Xe(this.offsetRotateMatrix_);0!==r&&(i=u,o=-r,a=Math.cos(o),s=Math.sin(o),Ve(i,We(ze,a,s,-s,a,0,0)));this.setUniformMatrixValue(iu.OFFSET_SCALE_MATRIX,$s(this.tmpMat4_,n));this.setUniformMatrixValue(iu.OFFSET_ROTATION_MATRIX,$s(this.tmpMat4_,u));this.setUniformFloatValue(iu.TIME,.001*(Date.now()-this.startTime_));this.setUniformFloatValue(iu.ZOOM,t.viewState.zoom);this.setUniformFloatValue(iu.RESOLUTION,t.viewState.resolution)},e.prototype.applyUniforms=function(t){var e,r=this.getGL(),n=0;this.uniforms_.forEach(function(i){if((e="function"==typeof i.value?i.value(t):i.value)instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageData)i.texture||(i.texture=r.createTexture()),r.activeTexture(r["TEXTURE"+n]),r.bindTexture(r.TEXTURE_2D,i.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),(!(e instanceof HTMLImageElement)||e.complete)&&r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e),r.uniform1i(this.getUniformLocation(i.name),n++);else if(Array.isArray(e)&&6===e.length)this.setUniformMatrixValue(i.name,$s(this.tmpMat4_,e));else if(Array.isArray(e)&&e.length<=4)switch(e.length){case 2:return void r.uniform2f(this.getUniformLocation(i.name),e[0],e[1]);case 3:return void r.uniform3f(this.getUniformLocation(i.name),e[0],e[1],e[2]);case 4:return void r.uniform4f(this.getUniformLocation(i.name),e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&r.uniform1f(this.getUniformLocation(i.name),e)}.bind(this))},e.prototype.useProgram=function(t){return t!=this.currentProgram_&&(this.getGL().useProgram(t),this.currentProgram_=t,this.uniformLocations_={},this.attribLocations_={},!0)},e.prototype.compileShader=function(t,e){var r=this.getGL(),n=r.createShader(e);return r.shaderSource(n,t),r.compileShader(n),n},e.prototype.getProgram=function(t,e){var r=this.getGL(),n=this.compileShader(t,r.FRAGMENT_SHADER),i=this.compileShader(e,r.VERTEX_SHADER);this.shaderCompileErrors_=null;r.getShaderInfoLog(n)&&(this.shaderCompileErrors_="Fragment shader compilation failed:\n"+r.getShaderInfoLog(n));r.getShaderInfoLog(i)&&(this.shaderCompileErrors_=(this.shaderCompileErrors_||"")+"Vertex shader compilation failed:\n"+r.getShaderInfoLog(i));var o=r.createProgram();return r.attachShader(o,n),r.attachShader(o,i),r.linkProgram(o),o},e.prototype.getShaderCompileErrors=function(){return this.shaderCompileErrors_},e.prototype.getUniformLocation=function(t){return void 0===this.uniformLocations_[t]&&(this.uniformLocations_[t]=this.getGL().getUniformLocation(this.currentProgram_,t)),this.uniformLocations_[t]},e.prototype.getAttributeLocation=function(t){return void 0===this.attribLocations_[t]&&(this.attribLocations_[t]=this.getGL().getAttribLocation(this.currentProgram_,t)),this.attribLocations_[t]},e.prototype.makeProjectionTransform=function(t,e){var r=t.size,n=t.viewState.rotation,i=t.viewState.resolution,o=t.viewState.center;return Xe(e),He(e,0,0,2/(i*r[0]),2/(i*r[1]),-n,-o[0],-o[1]),e},e.prototype.setUniformFloatValue=function(t,e){this.getGL().uniform1f(this.getUniformLocation(t),e)},e.prototype.setUniformMatrixValue=function(t,e){this.getGL().uniformMatrix4fv(this.getUniformLocation(t),!1,e)},e.prototype.enableAttributeArray_=function(t,e,r,n,i){var o=this.getAttributeLocation(t);o<0||(this.getGL().enableVertexAttribArray(o),this.getGL().vertexAttribPointer(o,e,r,!1,n,i))},e.prototype.enableAttributes=function(t){for(var e=au(t),r=0,n=0;n<t.length;n++){var i=t[n];this.enableAttributeArray_(i.name,i.size,i.type||5126,e,r);r+=i.size*su(i.type)}},e.prototype.handleWebGLContextLost=function(){f(this.bufferCache_);this.currentProgram_=null},e.prototype.handleWebGLContextRestored=function(){},e.prototype.createTexture=function(t,e,r){var n=this.getGL(),i=r||n.createTexture(),o=n.RGBA,a=n.RGBA,s=n.UNSIGNED_BYTE;return n.bindTexture(n.TEXTURE_2D,i),e?n.texImage2D(n.TEXTURE_2D,0,o,a,s,e):n.texImage2D(n.TEXTURE_2D,0,o,t[0],t[1],0,a,s,null),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),i},e}(m),lu=new Uint8Array(4),hu=function(){function t(t,e){this.helper_=t;var r=t.getGL();this.texture_=r.createTexture();this.framebuffer_=r.createFramebuffer();this.size_=e||[1,1];this.data_=new Uint8Array(0);this.dataCacheDirty_=!0;this.updateSize_()}return t.prototype.setSize=function(t){R(t,this.size_)||(this.size_[0]=t[0],this.size_[1]=t[1],this.updateSize_())},t.prototype.getSize=function(){return this.size_},t.prototype.clearCachedData=function(){this.dataCacheDirty_=!0},t.prototype.readAll=function(){if(this.dataCacheDirty_){var t=this.size_,e=this.helper_.getGL();e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_);e.readPixels(0,0,t[0],t[1],e.RGBA,e.UNSIGNED_BYTE,this.data_);this.dataCacheDirty_=!1}return this.data_},t.prototype.readPixel=function(t,e){if(t<0||e<0||t>this.size_[0]||e>=this.size_[1])return lu[0]=0,lu[1]=0,lu[2]=0,lu[3]=0,lu;this.readAll();var r=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return lu[0]=this.data_[4*r],lu[1]=this.data_[4*r+1],lu[2]=this.data_[4*r+2],lu[3]=this.data_[4*r+3],lu},t.prototype.getTexture=function(){return this.texture_},t.prototype.getFramebuffer=function(){return this.framebuffer_},t.prototype.updateSize_=function(){var t=this.size_,e=this.helper_.getGL();this.texture_=this.helper_.createTexture(t,null,this.texture_);e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_);e.viewport(0,0,t[0],t[1]);e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture_,0);this.data_=new Uint8Array(t[0]*t[1]*4)},t}(),cu=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),pu=function(t){function e(e){var r=t.call(this,{extent:e.extent,origin:e.origin,origins:e.origins,resolutions:e.resolutions,tileSize:e.tileSize,tileSizes:e.tileSizes,sizes:e.sizes})||this;return r.matrixIds_=e.matrixIds,r}return cu(e,t),e.prototype.getMatrixId=function(t){return this.matrixIds_[t]},e.prototype.getMatrixIds=function(){return this.matrixIds_},e}(gs),fu=pu;function du(t,e,r){var n=[],i=[],o=[],a=[],s=[],u=void 0!==r?r:[],l=t.SupportedCRS,h=we(l.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||we(l),c=h.getMetersPerUnit(),p="ne"==h.getAxisOrientation().substr(0,2);return t.TileMatrix.sort(function(t,e){return e.ScaleDenominator-t.ScaleDenominator}),t.TileMatrix.forEach(function(e){if(!(u.length>0)||O(u,function(r){return e.Identifier==r.TileMatrix||-1===e.Identifier.indexOf(":")&&t.Identifier+":"+e.Identifier===r.TileMatrix})){i.push(e.Identifier);var r=.00028*e.ScaleDenominator/c,l=e.TileWidth,h=e.TileHeight;p?o.push([e.TopLeftCorner[1],e.TopLeftCorner[0]]):o.push(e.TopLeftCorner);n.push(r);a.push(l==h?l:[l,h]);s.push([e.MatrixWidth,e.MatrixHeight])}}),new pu({extent:e,origins:o,resolutions:n,matrixIds:i,tileSizes:a,sizes:s})}var _u=function(){function t(t){this.opacity_=t.opacity;this.rotateWithView_=t.rotateWithView;this.rotation_=t.rotation;this.scale_=t.scale}return t.prototype.clone=function(){return new t({opacity:this.getOpacity(),scale:this.getScale(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getAnchor=function(){return n()},t.prototype.getImage=function(){return n()},t.prototype.getHitDetectionImage=function(){return n()},t.prototype.getImageState=function(){return n()},t.prototype.getImageSize=function(){return n()},t.prototype.getHitDetectionImageSize=function(){return n()},t.prototype.getOrigin=function(){return n()},t.prototype.getSize=function(){return n()},t.prototype.setOpacity=function(t){this.opacity_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t},t.prototype.listenImageChange=function(){n()},t.prototype.load=function(){n()},t.prototype.unlistenImageChange=function(){n()},t}(),gu=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),yu=function(t){function e(e){var r=this,n=void 0!==e.rotateWithView&&e.rotateWithView;return(r=t.call(this,{opacity:1,rotateWithView:n,rotation:void 0!==e.rotation?e.rotation:0,scale:1})||this).canvas_=null,r.hitDetectionCanvas_=null,r.fill_=void 0!==e.fill?e.fill:null,r.origin_=[0,0],r.points_=e.points,r.radius_=void 0!==e.radius?e.radius:e.radius1,r.radius2_=e.radius2,r.angle_=void 0!==e.angle?e.angle:0,r.stroke_=void 0!==e.stroke?e.stroke:null,r.anchor_=null,r.size_=null,r.imageSize_=null,r.hitDetectionImageSize_=null,r.render(),r}return gu(e,t),e.prototype.clone=function(){var t=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView()});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},e.prototype.getAnchor=function(){return this.anchor_},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_},e.prototype.getImage=function(){return this.canvas_},e.prototype.getImageSize=function(){return this.imageSize_},e.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_},e.prototype.getImageState=function(){return Da.LOADED},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.listenImageChange=function(){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(){},e.prototype.render=function(){var t,e="round",r="round",n=0,i=null,o=0,a=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t="#000"),t=ca(t),void 0===(a=this.stroke_.getWidth())&&(a=1),i=this.stroke_.getLineDash(),o=this.stroke_.getLineDashOffset(),void 0===(r=this.stroke_.getLineJoin())&&(r="round"),void 0===(e=this.stroke_.getLineCap())&&(e="round"),void 0===(n=this.stroke_.getMiterLimit())&&(n=10));var s=2*(this.radius_+a)+1,u={strokeStyle:t,strokeWidth:a,size:s,lineCap:e,lineDash:i,lineDashOffset:o,lineJoin:r,miterLimit:n},l=li(s,s);this.canvas_=l.canvas;var h=s=this.canvas_.width;this.draw_(u,l,0,0);this.createHitDetectionCanvas_(u);this.anchor_=[s/2,s/2];this.size_=[s,s];this.imageSize_=[h,h]},e.prototype.draw_=function(t,e,r,n){var i,o,a;e.setTransform(1,0,0,1,0,0);e.translate(r,n);e.beginPath();var s=this.points_;if(s===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var u=void 0!==this.radius2_?this.radius2_:this.radius_;for(u!==this.radius_&&(s*=2),i=0;i<=s;i++)o=2*i*Math.PI/s-Math.PI/2+this.angle_,a=i%2==0?this.radius_:u,e.lineTo(t.size/2+a*Math.cos(o),t.size/2+a*Math.sin(o))}if(this.fill_){var l=this.fill_.getColor();null===l&&(l="#000");e.fillStyle=ca(l);e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,e.setLineDash&&t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineCap=t.lineCap,e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke());e.closePath()},e.prototype.createHitDetectionCanvas_=function(t){if(this.hitDetectionImageSize_=[t.size,t.size],this.hitDetectionCanvas_=this.canvas_,this.fill_){var e=this.fill_.getColor(),r=0;if("string"==typeof e&&(e=oa(e)),null===e?r=1:Array.isArray(e)&&(r=4===e.length?e[3]:1),0===r){var n=li(t.size,t.size);this.hitDetectionCanvas_=n.canvas;this.drawHitDetectionCanvas_(t,n,0,0)}}},e.prototype.drawHitDetectionCanvas_=function(t,e,r,n){e.setTransform(1,0,0,1,0,0);e.translate(r,n);e.beginPath();var i=this.points_;if(i===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var o=void 0!==this.radius2_?this.radius2_:this.radius_;o!==this.radius_&&(i*=2);for(var a=void 0,s=void 0,u=void 0,a=0;a<=i;a++)u=2*a*Math.PI/i-Math.PI/2+this.angle_,s=a%2==0?this.radius_:o,e.lineTo(t.size/2+s*Math.cos(u),t.size/2+s*Math.sin(u))}e.fillStyle="#000";e.fill();this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.stroke());e.closePath()},e}(_u),vu=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),mu=function(t){function e(e){var r=e||{};return t.call(this,{points:1/0,fill:r.fill,radius:r.radius,stroke:r.stroke})||this}return vu(e,t),e.prototype.clone=function(){var t=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius()});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},e.prototype.setRadius=function(t){this.radius_=t;this.render()},e}(yu),Eu=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0})},t.prototype.getColor=function(){return this.color_},t.prototype.setColor=function(t){this.color_=t},t}(),Tu={FRACTION:"fraction",PIXELS:"pixels"},Su=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wu=function(t){function e(e,r,n,i){var o=t.call(this)||this;return o.extent=e,o.pixelRatio_=n,o.resolution=r,o.state=i,o}return Su(e,t),e.prototype.changed=function(){this.dispatchEvent(N.CHANGE)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return n()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){n()},e}(A),xu=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Ou(t,e,r){var n=t;if(n.src&&sn){var i=n.decode(),o=!0;return i.then(function(){o&&e()}).catch(function(t){o&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():r())}),function(){o=!1}}var a=[y(n,N.LOAD,e),y(n,N.ERROR,r)];return function(){a.forEach(v)}}var Ru=function(t){function e(e,r,n,i,o,a){var s=t.call(this,e,r,n,Da.IDLE)||this;return s.src_=i,s.image_=new Image,null!==o&&(s.image_.crossOrigin=o),s.unlisten_=null,s.state=Da.IDLE,s.imageLoadFunction_=a,s}return xu(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=Da.ERROR;this.unlistenImage_();this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=Ot(this.extent)/this.image_.height);this.state=Da.LOADED;this.unlistenImage_();this.changed()},e.prototype.load=function(){this.state!=Da.IDLE&&this.state!=Da.ERROR||(this.state=Da.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Ou(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(wu),Cu=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Pu=function(t){function e(e,r,n,i,o,a){var s=t.call(this)||this;return s.hitDetectionImage_=null,s.image_=e||new Image,null!==i&&(s.image_.crossOrigin=i),s.canvas_=a?document.createElement("canvas"):null,s.color_=a,s.unlisten_=null,s.imageState_=o,s.size_=n,s.src_=r,s.tainted_,s}return Cu(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===Da.LOADED){this.tainted_=!1;var t=li(1,1);try{t.drawImage(this.image_,0,0);t.getImageData(0,0,1,1)}catch(t){this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(N.CHANGE)},e.prototype.handleImageError_=function(){this.imageState_=Da.ERROR;this.unlistenImage_();this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Da.LOADED;this.size_&&(this.image_.width=this.size_[0],this.image_.height=this.size_[1]);this.size_=[this.image_.width,this.image_.height];this.unlistenImage_();this.replaceColor_();this.dispatchChangeEvent_()},e.prototype.getImage=function(){return this.canvas_?this.canvas_:this.image_},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var e=this.size_[0],r=this.size_[1],n=li(e,r);n.fillRect(0,0,e,r);this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==Da.IDLE){this.imageState_=Da.LOADING;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=Ou(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(){if(this.color_&&!this.isTainted_()){this.canvas_.width=this.image_.width;this.canvas_.height=this.image_.height;var t=this.canvas_.getContext("2d");t.drawImage(this.image_,0,0);for(var e=t.getImageData(0,0,this.image_.width,this.image_.height),r=e.data,n=this.color_[0]/255,i=this.color_[1]/255,o=this.color_[2]/255,a=0,s=r.length;a<s;a+=4)r[a]*=n,r[a+1]*=i,r[a+2]*=o;t.putImageData(e,0,0)}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(A),Iu={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},bu=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Lu=function(t){function e(e){var r=this,n=e||{},i=void 0!==n.opacity?n.opacity:1,a=void 0!==n.rotation?n.rotation:0,s=void 0!==n.scale?n.scale:1,u=void 0!==n.rotateWithView&&n.rotateWithView;(r=t.call(this,{opacity:i,rotation:a,scale:s,rotateWithView:u})||this).anchor_=void 0!==n.anchor?n.anchor:[.5,.5];r.normalizedAnchor_=null;r.anchorOrigin_=void 0!==n.anchorOrigin?n.anchorOrigin:Iu.TOP_LEFT;r.anchorXUnits_=void 0!==n.anchorXUnits?n.anchorXUnits:Tu.FRACTION;r.anchorYUnits_=void 0!==n.anchorYUnits?n.anchorYUnits:Tu.FRACTION;r.crossOrigin_=void 0!==n.crossOrigin?n.crossOrigin:null;var l=void 0!==n.img?n.img:null,h=void 0!==n.imgSize?n.imgSize:null,c=n.src;K(!(void 0!==c&&l),4);K(!l||l&&h,5);void 0!==c&&0!==c.length||!l||(c=l.src||o(l));K(void 0!==c&&c.length>0,6);var p=void 0!==n.src?Da.IDLE:Da.LOADED;return r.color_=void 0!==n.color?oa(n.color):null,r.iconImage_=function(t,e,r,n,i,o){var a=ha.get(e,n,o);return a||(a=new Pu(t,e,r,n,i,o),ha.set(e,n,o,a)),a}(l,c,h,r.crossOrigin_,p,r.color_),r.offset_=void 0!==n.offset?n.offset:[0,0],r.offsetOrigin_=void 0!==n.offsetOrigin?n.offsetOrigin:Iu.TOP_LEFT,r.origin_=null,r.size_=void 0!==n.size?n.size:null,r}return bu(e,t),e.prototype.clone=function(){return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:this.getScale(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},e.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,e=this.getSize();if(this.anchorXUnits_==Tu.FRACTION||this.anchorYUnits_==Tu.FRACTION){if(!e)return null;t=this.anchor_.slice();this.anchorXUnits_==Tu.FRACTION&&(t[0]*=e[0]);this.anchorYUnits_==Tu.FRACTION&&(t[1]*=e[1])}if(this.anchorOrigin_!=Iu.TOP_LEFT){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice());this.anchorOrigin_!=Iu.TOP_RIGHT&&this.anchorOrigin_!=Iu.BOTTOM_RIGHT||(t[0]=-t[0]+e[0]);this.anchorOrigin_!=Iu.BOTTOM_LEFT&&this.anchorOrigin_!=Iu.BOTTOM_RIGHT||(t[1]=-t[1]+e[1])}return this.normalizedAnchor_=t,this.normalizedAnchor_},e.prototype.setAnchor=function(t){this.anchor_=t;this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(t){return this.iconImage_.getHitDetectionImage(t)},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=Iu.TOP_LEFT){var e=this.getSize(),r=this.iconImage_.getSize();if(!e||!r)return null;t=t.slice();this.offsetOrigin_!=Iu.TOP_RIGHT&&this.offsetOrigin_!=Iu.BOTTOM_RIGHT||(t[0]=r[0]-e[0]-t[0]);this.offsetOrigin_!=Iu.BOTTOM_LEFT&&this.offsetOrigin_!=Iu.BOTTOM_RIGHT||(t[1]=r[1]-e[1]-t[1])}return this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(N.CHANGE,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(N.CHANGE,t)},e}(_u),Mu=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null;this.lineCap_=e.lineCap;this.lineDash_=void 0!==e.lineDash?e.lineDash:null;this.lineDashOffset_=e.lineDashOffset;this.lineJoin_=e.lineJoin;this.miterLimit_=e.miterLimit;this.width_=e.width}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(t){this.color_=t},t.prototype.setLineCap=function(t){this.lineCap_=t},t.prototype.setLineDash=function(t){this.lineDash_=t},t.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t},t.prototype.setLineJoin=function(t){this.lineJoin_=t},t.prototype.setMiterLimit=function(t){this.miterLimit_=t},t.prototype.setWidth=function(t){this.width_=t},t}(),Fu=function(){function t(t){var e=t||{};this.geometry_=null;this.geometryFunction_=Gu;void 0!==e.geometry&&this.setGeometry(e.geometry);this.fill_=void 0!==e.fill?e.fill:null;this.image_=void 0!==e.image?e.image:null;this.renderer_=void 0!==e.renderer?e.renderer:null;this.stroke_=void 0!==e.stroke?e.stroke:null;this.text_=void 0!==e.text?e.text:null;this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new t({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=Gu;this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}(),Au=null;function Nu(){if(!Au){var r=new Eu({color:"rgba(255,255,255,0.4)"}),n=new Mu({color:"#3399CC",width:1.25});Au=[new Fu({image:new mu({fill:r,stroke:n,radius:5}),fill:r,stroke:n})]}return Au}function Du(){var t={},e=[255,255,255,1],r=[0,153,255,1];return t[Nt.POLYGON]=[new Fu({fill:new Eu({color:[255,255,255,.5]})})],t[Nt.MULTI_POLYGON]=t[Nt.POLYGON],t[Nt.LINE_STRING]=[new Fu({stroke:new Mu({color:e,width:5})}),new Fu({stroke:new Mu({color:r,width:3})})],t[Nt.MULTI_LINE_STRING]=t[Nt.LINE_STRING],t[Nt.CIRCLE]=t[Nt.POLYGON].concat(t[Nt.LINE_STRING]),t[Nt.POINT]=[new Fu({image:new mu({radius:6,fill:new Eu({color:r}),stroke:new Mu({color:e,width:1.5})}),zIndex:1/0})],t[Nt.MULTI_POINT]=t[Nt.POINT],t[Nt.GEOMETRY_COLLECTION]=t[Nt.POLYGON].concat(t[Nt.LINE_STRING],t[Nt.POINT]),t}function Gu(t){return t.getGeometry()}var ju=Fu,ku={POINT:"point",LINE:"line"},Uu="#333",Bu=function(){function t(t){var e=t||{};this.font_=e.font;this.rotation_=e.rotation;this.rotateWithView_=e.rotateWithView;this.scale_=e.scale;this.text_=e.text;this.textAlign_=e.textAlign;this.textBaseline_=e.textBaseline;this.fill_=void 0!==e.fill?e.fill:new Eu({color:Uu});this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4;this.placement_=void 0!==e.placement?e.placement:ku.POINT;this.overflow_=!!e.overflow;this.stroke_=void 0!==e.stroke?e.stroke:null;this.offsetX_=void 0!==e.offsetX?e.offsetX:0;this.offsetY_=void 0!==e.offsetY?e.offsetY:0;this.backgroundFill_=e.backgroundFill?e.backgroundFill:null;this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null;this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:this.getScale(),text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()})},t.prototype.getOverflow=function(){return this.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}();function Yu(t,e){var r=/\{z\}/g,n=/\{x\}/g,i=/\{y\}/g,o=/\{-y\}/g;return function(a){if(a)return t.replace(r,a[0].toString()).replace(n,a[1].toString()).replace(i,a[2].toString()).replace(o,function(){var t=a[0],r=e.getFullTileRange(t);return K(r,55),(r.getHeight()-a[2]-1).toString()})}}function zu(t,e){for(var r=t.length,n=new Array(r),i=0;i<r;++i)n[i]=Yu(t[i],e);return Xu(n)}function Xu(t){return 1===t.length?t[0]:function(e,r,n){if(e){var i=Vt(ds(e),t.length);return t[i](e,r,n)}}}function Vu(){}function Wu(t){var e=[],r=/\{([a-z])-([a-z])\}/.exec(t);if(r){for(var n=r[1].charCodeAt(0),i=r[2].charCodeAt(0),o=void 0,o=n;o<=i;++o)e.push(t.replace(r[0],String.fromCharCode(o)));return e}if(r=/\{(\d+)-(\d+)\}/.exec(t)){for(var a=parseInt(r[2],10),s=parseInt(r[1],10);s<=a;s++)e.push(t.replace(r[0],s.toString()));return e}return e.push(t),e}function Zu(t,e,r,n){var i=document.createElement("script"),a="olc_"+o(e);function s(){delete window[a];i.parentNode.removeChild(i)}i.async=!0;i.src=t+(-1==t.indexOf("?")?"?":"&")+(n||"callback")+"="+a;var u=setTimeout(function(){s();r&&r()},1e4);window[a]=function(t){clearTimeout(u);s();e(t)};document.getElementsByTagName("head")[0].appendChild(i)}var Ku=.5,Hu=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),qu=function(t){function e(e,r,n){var i=t.call(this)||this,o=n||{};return i.tileCoord=e,i.state=r,i.interimTile=null,i.hifi=!0,i.key="",i.transition_=void 0===o.transition?250:o.transition,i.transitionStarts_={},i}return Hu(e,t),e.prototype.changed=function(){this.dispatchEvent(N.CHANGE)},e.prototype.disposeInternal=function(){this.setState(wn.ABORT)},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==wn.LOADED)return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==wn.LOADED){t.interimTile=null;break}t.getState()==wn.LOADING?e=t:t.getState()==wn.IDLE?e.interimTile=t.interimTile:e=t;t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(this.state!==wn.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t;this.changed()},e.prototype.load=function(){n()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var r=this.transitionStarts_[t];if(r){if(-1===r)return 1}else r=e,this.transitionStarts_[t]=r;var n=e-r+1e3/60;return n>=this.transition_?1:ti(n/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(A),Ju=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Qu(){var t=li(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}var $u=function(t){function e(e,r,n,i,o,a){var s=t.call(this,e,r,a)||this;return s.crossOrigin_=i,s.src_=n,s.image_=new Image,null!==i&&(s.image_.crossOrigin=i),s.unlisten_=null,s.tileLoadFunction_=o,s}return Ju(e,t),e.prototype.disposeInternal=function(){this.state==wn.LOADING&&(this.unlistenImage_(),this.image_=Qu());this.interimTile&&this.interimTile.dispose();t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.image_},e.prototype.getKey=function(){return this.src_},e.prototype.handleImageError_=function(){this.state=wn.ERROR;this.unlistenImage_();this.image_=Qu();this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;this.state=t.naturalWidth&&t.naturalHeight?wn.LOADED:wn.EMPTY;this.unlistenImage_();this.changed()},e.prototype.load=function(){this.state==wn.ERROR&&(this.state=wn.IDLE,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_));this.state==wn.IDLE&&(this.state=wn.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Ou(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(qu),tl=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),el=function(t){function e(e){return t.call(this,e)||this}return tl(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().dispose()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=function(t){return t.split("/").map(Number)}(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(fs(e.tileCoord)),e.dispose())}.bind(this))}},e}(_a);function rl(t,e,r,n){var i=Me(r,e,t),o=xe(e,n,r),a=e.getMetersPerUnit();void 0!==a&&(o*=a);var s=t.getMetersPerUnit();void 0!==s&&(o/=s);var u=t.getExtent();if(!u||nt(u,i)){var l=xe(t,o,i)/o;isFinite(l)&&l>0&&(o/=l)}return o}function nl(t,e,r,n){var i=r-t,o=n-e,a=Math.sqrt(i*i+o*o);return[Math.round(r+i/a),Math.round(n+o/a)]}function il(t,e,r,n,i,o,a,s,u,l,h){var c=li(Math.round(r*t),Math.round(r*e));if(0===u.length)return c.canvas;c.scale(r,r);var p=[1/0,1/0,-1/0,-1/0];u.forEach(function(t){ft(p,t.extent)});var f=It(p),d=Ot(p),_=li(Math.round(r*f/n),Math.round(r*d/n)),g=r/n;u.forEach(function(t){var n=t.extent[0]-p[0],i=-(t.extent[3]-p[3]),o=It(t.extent),a=Ot(t.extent);_.drawImage(t.image,l,l,t.image.width-2*l,t.image.height-2*l,n*g,i*g,o*g,a*g)});var y=Ct(a);return s.getTriangles().forEach(function(t){var a=t.source,s=t.target,u=a[0][0],l=a[0][1],h=a[1][0],f=a[1][1],d=a[2][0],g=a[2][1],v=(s[0][0]-y[0])/o,m=-(s[0][1]-y[1])/o,E=(s[1][0]-y[0])/o,T=-(s[1][1]-y[1])/o,S=(s[2][0]-y[0])/o,w=-(s[2][1]-y[1])/o,x=u,O=l;u=0;l=0;var R=function(t){for(var e=t.length,r=0;r<e;r++){for(var n=r,i=Math.abs(t[r][r]),o=r+1;o<e;o++){var a=Math.abs(t[o][r]);a>i&&(i=a,n=o)}if(0===i)return null;var s=t[n];t[n]=t[r];t[r]=s;for(var u=r+1;u<e;u++)for(var l=-t[u][r]/t[r][r],h=r;h<e+1;h++)r==h?t[u][h]=0:t[u][h]+=l*t[r][h]}for(var c=new Array(e),p=e-1;p>=0;p--){c[p]=t[p][e]/t[p][p];for(var f=p-1;f>=0;f--)t[f][e]-=t[f][p]*c[p]}return c}([[h-=x,f-=O,0,0,E-v],[d-=x,g-=O,0,0,S-v],[0,0,h,f,T-m],[0,0,d,g,w-m]]);if(R){c.save();c.beginPath();var C=(v+E+S)/3,P=(m+T+w)/3,I=nl(C,P,v,m),b=nl(C,P,E,T),L=nl(C,P,S,w);c.moveTo(b[0],b[1]);c.lineTo(I[0],I[1]);c.lineTo(L[0],L[1]);c.clip();c.transform(R[0],R[2],R[1],R[3],v,m);c.translate(p[0]-x,p[3]-O);c.scale(n/r,-n/r);c.drawImage(_.canvas,0,0);c.restore()}}),h&&(c.save(),c.strokeStyle="black",c.lineWidth=1,s.getTriangles().forEach(function(t){var n=t.target,i=(n[0][0]-y[0])/o,a=-(n[0][1]-y[1])/o,s=(n[1][0]-y[0])/o,u=-(n[1][1]-y[1])/o,l=(n[2][0]-y[0])/o,h=-(n[2][1]-y[1])/o;c.beginPath();c.moveTo(s,u);c.lineTo(i,a);c.lineTo(l,h);c.closePath();c.stroke()}),c.restore()),c.canvas}var ol=10,al=function(){function t(t,e,r,n,i){this.sourceProj_=t;this.targetProj_=e;var o={},a=Le(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return o[e]||(o[e]=a(t)),o[e]};this.maxSourceExtent_=n;this.errorThresholdSquared_=i*i;this.triangles_=[];this.wrapsXInSource_=!1;this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&It(n)==It(this.sourceProj_.getExtent());this.sourceWorldWidth_=this.sourceProj_.getExtent()?It(this.sourceProj_.getExtent()):null;this.targetWorldWidth_=this.targetProj_.getExtent()?It(this.targetProj_.getExtent()):null;var s=Ct(r),u=Pt(r),l=Tt(r),h=Et(r),c=this.transformInv_(s),p=this.transformInv_(u),f=this.transformInv_(l),d=this.transformInv_(h);if(this.addQuad_(s,u,l,h,c,p,f,d,ol),this.wrapsXInSource_){var _=1/0;this.triangles_.forEach(function(t){_=Math.min(_,t.source[0][0],t.source[1][0],t.source[2][0])});this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-_>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-_>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_);e[1][0]-_>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_);e[2][0]-_>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var r=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-r<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}o={}}return t.prototype.addTriangle_=function(t,e,r,n,i,o){this.triangles_.push({source:[n,i,o],target:[t,e,r]})},t.prototype.addQuad_=function(t,e,r,n,i,o,a,s,u){var l=$([i,o,a,s]),h=this.sourceWorldWidth_?It(l)/this.sourceWorldWidth_:null,c=this.sourceWorldWidth_,p=this.sourceProj_.canWrapX()&&h>.5&&h<1,f=!1;if(u>0&&(this.targetProj_.isGlobal()&&this.targetWorldWidth_&&(f=It($([t,e,r,n]))/this.targetWorldWidth_>.25||f),!p&&this.sourceProj_.isGlobal()&&h&&(f=h>.25||f)),f||!this.maxSourceExtent_||bt(l,this.maxSourceExtent_)){if(!(f||isFinite(i[0])&&isFinite(i[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(a[0])&&isFinite(a[1])&&isFinite(s[0])&&isFinite(s[1]))){if(!(u>0))return;f=!0}if(u>0){if(!f){var d=[(t[0]+r[0])/2,(t[1]+r[1])/2],_=this.transformInv_(d),g=p?(Vt(i[0],c)+Vt(a[0],c))/2-Vt(_[0],c):(i[0]+a[0])/2-_[0];var y=(i[1]+a[1])/2-_[1];f=g*g+y*y>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-r[0])<=Math.abs(t[1]-r[1])){var v=[(e[0]+r[0])/2,(e[1]+r[1])/2],m=this.transformInv_(v),E=[(n[0]+t[0])/2,(n[1]+t[1])/2],T=this.transformInv_(E);this.addQuad_(t,e,v,E,i,o,m,T,u-1);this.addQuad_(E,v,r,n,T,m,a,s,u-1)}else{var S=[(t[0]+e[0])/2,(t[1]+e[1])/2],w=this.transformInv_(S),x=[(r[0]+n[0])/2,(r[1]+n[1])/2],O=this.transformInv_(x);this.addQuad_(t,S,x,n,i,w,O,s,u-1);this.addQuad_(S,e,r,x,w,o,a,O,u-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}this.addTriangle_(t,r,n,i,a,s);this.addTriangle_(t,e,r,i,o,a)}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach(function(e){var i=e.source;dt(t,i[0]);dt(t,i[1]);dt(t,i[2])}),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),sl=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ul=function(t){function e(e,r,n,i,o,a,s,u,l,h,c){var p=t.call(this,o,wn.IDLE)||this;p.renderEdges_=void 0!==c&&c;p.pixelRatio_=s;p.gutter_=u;p.canvas_=null;p.sourceTileGrid_=r;p.targetTileGrid_=i;p.wrappedTileCoord_=a||o;p.sourceTiles_=[];p.sourcesListenerKeys_=null;p.sourceZ_=0;var f=i.getTileCoordExtent(p.wrappedTileCoord_),d=p.targetTileGrid_.getExtent(),_=p.sourceTileGrid_.getExtent(),g=d?Rt(f,d):f;if(0===mt(g))return p.state=wn.EMPTY,p;var y=e.getExtent();y&&(_=_?Rt(_,y):y);var v=i.getResolution(p.wrappedTileCoord_[0]),m=rl(e,n,St(g),v);if(!isFinite(m)||m<=0)return p.state=wn.EMPTY,p;var E=void 0!==h?h:Ku;if(p.triangulation_=new al(e,n,g,_,m*E),0===p.triangulation_.getTriangles().length)return p.state=wn.EMPTY,p;p.sourceZ_=r.getZForResolution(m);var T=p.triangulation_.calculateSourceExtent();if(_&&(e.canWrapX()?(T[1]=kt(T[1],_[1],_[3]),T[3]=kt(T[3],_[1],_[3])):T=Rt(T,_)),mt(T)){for(var S=r.getTileRangeForExtentAndZ(T,p.sourceZ_),w=S.minX;w<=S.maxX;w++)for(var x=S.minY;x<=S.maxY;x++){var O=l(p.sourceZ_,w,x,s);O&&p.sourceTiles_.push(O)}0===p.sourceTiles_.length&&(p.state=wn.EMPTY)}else p.state=wn.EMPTY;return p}return sl(e,t),e.prototype.disposeInternal=function(){this.state==wn.LOADING&&this.unlistenSources_();t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e){e&&e.getState()==wn.LOADED&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=wn.ERROR;else{var e=this.wrappedTileCoord_[0],r=this.targetTileGrid_.getTileSize(e),n="number"==typeof r?r:r[0],i="number"==typeof r?r:r[1],o=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=il(n,i,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,s,this.triangulation_,t,this.gutter_,this.renderEdges_);this.state=wn.LOADED}this.changed()},e.prototype.load=function(){if(this.state==wn.IDLE){this.state=wn.LOADING;this.changed();var t=0;this.sourcesListenerKeys_=[];this.sourceTiles_.forEach(function(e){var i=e.getState();if(i==wn.IDLE||i==wn.LOADING){t++;var o=g(e,N.CHANGE,function(){var n=e.getState();n!=wn.LOADED&&n!=wn.ERROR&&n!=wn.EMPTY||(v(o),0==--t&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(o)}}.bind(this));this.sourceTiles_.forEach(function(t){t.getState()==wn.IDLE&&t.load()});0===t&&setTimeout(this.reproject_.bind(this),0)}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(v);this.sourcesListenerKeys_=null},e}(qu),ll=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function hl(t){return t?Array.isArray(t)?function(){return t}:"function"==typeof t?t:function(){return[t]}:null}var cl=function(t){function e(e){var r=t.call(this)||this;return r.projection_=we(e.projection),r.attributions_=hl(e.attributions),r.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,r.loading=!1,r.state_=void 0!==e.state?e.state:vi.READY,r.wrapX_=void 0!==e.wrapX&&e.wrapX,r}return ll(e,t),e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolutions=function(){return n()},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=hl(t);this.changed()},e.prototype.setState=function(t){this.state_=t;this.changed()},e}(z),pl=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),fl=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX})||this;r.opaque_=void 0!==e.opaque&&e.opaque;r.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1;r.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;var n=e.cacheSize;if(void 0===n){var i=[256,256],o=e.tileGrid;o&&xi(o.getTileSize(o.getMinZoom()),i);var a="undefined"!=typeof screen,s=a?screen.availWidth||screen.width:1920,u=a?screen.availHeight||screen.height:1080;n=4*Math.ceil(s/i[0])*Math.ceil(u/i[1])}return r.tileCache=new el(n),r.tmpSize=[0,0],r.key_=e.key||"",r.tileOptions={transition:e.transition},r.zDirection=e.zDirection?e.zDirection:0,r}return pl(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var r=this.getTileCacheForProjection(t);r&&r.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,r,n){var i=this.getTileCacheForProjection(t);if(!i)return!1;for(var o,a,s,u=!0,l=r.minX;l<=r.maxX;++l)for(var h=r.minY;h<=r.maxY;++h)a=ps(e,l,h),s=!1,i.containsKey(a)&&(s=(o=i.get(a)).getState()===wn.LOADED)&&(s=!1!==n(o)),s||(u=!1);return u},e.prototype.getGutterForProjection=function(){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},e.prototype.getTile=function(){return n()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:ys(t)},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();return e&&!Ie(e,t)?null:this.tileCache},e.prototype.getTilePixelRatio=function(){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,r){var n=this.getTileGridForProjection(r),i=this.getTilePixelRatio(e),o=xi(n.getTileSize(t),this.tmpSize);return 1==i?o:wi(o,i,this.tmpSize)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var r=void 0!==e?e:this.getProjection(),n=this.getTileGridForProjection(r);return this.getWrapX()&&r.isGlobal()&&(t=function(t,e,r){var n=e[0],i=t.getTileCoordCenter(e),o=Ts(r);if(nt(o,i))return e;var a=It(o),s=Math.ceil((o[0]-i[0])/a);return i[0]+=a*s,t.getTileCoordForCoordAndZ(i,n)}(n,t,r)),function(t,e){var r=t[0],n=t[1],i=t[2];if(e.getMinZoom()>r||r>e.getMaxZoom())return!1;var o,a=e.getExtent();return!(o=a?e.getTileRangeForExtentAndZ(a,r):e.getFullTileRange(r))||o.containsXY(n,i)}(t,n)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear();t.prototype.refresh.call(this)},e.prototype.useTile=function(){},e}(cl),dl=function(t){function e(e,r){var n=t.call(this,e)||this;return n.tile=r,n}return pl(e,t),e}(M),_l=fl,gl="tileloadstart",yl="tileloadend",vl="tileloaderror",ml=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),El=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this;return r.generateTileUrlFunction_=!e.tileUrlFunction,r.tileLoadFunction=e.tileLoadFunction,r.tileUrlFunction=e.tileUrlFunction?e.tileUrlFunction.bind(r):Vu,r.urls=null,e.urls?r.setUrls(e.urls):e.url&&r.setUrl(e.url),r.tileLoadingKeys_={},r}return ml(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,r=t.target,n=o(r),i=r.getState();i==wn.LOADING?(this.tileLoadingKeys_[n]=!0,e=gl):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],e=i==wn.ERROR?vl:i==wn.LOADED||i==wn.ABORT?yl:void 0);null!=e&&this.dispatchEvent(new dl(e,r))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear();this.tileLoadFunction=t;this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t;this.tileCache.pruneExceptNewestZ();void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=Wu(t);this.urls=e;this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(zu(t,this.tileGrid),e):this.setKey(e)},e.prototype.useTile=function(t,e,r){var n=ps(t,e,r);this.tileCache.containsKey(n)&&this.tileCache.get(n)},e}(_l),Tl=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Sl(t,e){t.getImage().src=e}var wl=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Sl,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this;return r.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,r.tileClass=void 0!==e.tileClass?e.tileClass:$u,r.tileCacheForProjection={},r.tileGridForProjection={},r.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,r.renderReprojectionEdges_=!1,r}return Tl(e,t),e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var r=this.getTileCacheForProjection(t);for(var n in this.tileCache.expireCache(this.tileCache==r?e:{}),this.tileCacheForProjection){var i=this.tileCacheForProjection[n];i.expireCache(i==r?e:{})}},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!Ie(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!Ie(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!Ie(e,t)){var r=o(t);return r in this.tileGridForProjection||(this.tileGridForProjection[r]=ys(t)),this.tileGridForProjection[r]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||Ie(e,t))return this.tileCache;var r=o(t);return r in this.tileCacheForProjection||(this.tileCacheForProjection[r]=new el(this.tileCache.highWaterMark)),this.tileCacheForProjection[r]},e.prototype.createTile_=function(t,e,r,n,i,o){var a=[t,e,r],s=this.getTileCoordForTileUrlFunction(a,i),u=s?this.tileUrlFunction(s,n,i):void 0,l=new this.tileClass(a,void 0!==u?wn.IDLE:wn.EMPTY,void 0!==u?u:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return l.key=o,l.addEventListener(N.CHANGE,this.handleTileChange.bind(this)),l},e.prototype.getTile=function(t,e,r,n,i){var o=this.getProjection();if(o&&i&&!Ie(o,i)){var a=this.getTileCacheForProjection(i),s=[t,e,r],u=void 0,l=fs(s);a.containsKey(l)&&(u=a.get(l));var h=this.getKey();if(u&&u.key==h)return u;var c=this.getTileGridForProjection(o),p=this.getTileGridForProjection(i),f=this.getTileCoordForTileUrlFunction(s,i),d=new ul(o,c,i,p,s,f,this.getTilePixelRatio(n),this.getGutter(),function(t,e,r,n){return this.getTileInternal(t,e,r,n,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_);return d.key=h,u?(d.interimTile=u,d.refreshInterimChain(),a.replace(l,d)):a.set(l,d),d}return this.getTileInternal(t,e,r,n,o||i)},e.prototype.getTileInternal=function(t,e,r,n,i){var o=null,a=ps(t,e,r),s=this.getKey();if(this.tileCache.containsKey(a)){if((o=this.tileCache.get(a)).key!=s){var u=o;o=this.createTile_(t,e,r,n,i,s);o.interimTile=u.getState()==wn.IDLE?u.interimTile:u;o.refreshInterimChain();this.tileCache.replace(a,o)}}else o=this.createTile_(t,e,r,n,i,s),this.tileCache.set(a,o);return o},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var r=we(t);if(r){var n=o(r);n in this.tileGridForProjection||(this.tileGridForProjection[n]=e)}},e}(El),xl=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ol=function(t){function e(e){var r=this,n=void 0!==e.hidpi&&e.hidpi;return(r=t.call(this,{cacheSize:e.cacheSize,crossOrigin:"anonymous",opaque:!0,projection:we("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:vi.LOADING,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:n?2:1,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition})||this).hidpi_=n,r.culture_=void 0!==e.culture?e.culture:"en-us",r.maxZoom_=void 0!==e.maxZoom?e.maxZoom:-1,r.apiKey_=e.key,r.imagerySet_=e.imagerySet,Zu("https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+r.imagerySet_+"?uriScheme=https&include=ImageryProviders&key="+r.apiKey_+"&c="+r.culture_,r.handleImageryMetadataResponse.bind(r),void 0,"jsonp"),r}return xl(e,t),e.prototype.getApiKey=function(){return this.apiKey_},e.prototype.getImagerySet=function(){return this.imagerySet_},e.prototype.handleImageryMetadataResponse=function(t){if(200==t.statusCode&&"OK"==t.statusDescription&&"ValidCredentials"==t.authenticationResultCode&&1==t.resourceSets.length&&1==t.resourceSets[0].resources.length){var e=t.resourceSets[0].resources[0],r=-1==this.maxZoom_?e.zoomMax:this.maxZoom_,n=Ts(this.getProjection()),i=this.hidpi_?2:1,o=e.imageWidth==e.imageHeight?e.imageWidth/i:[e.imageWidth/i,e.imageHeight/i],a=vs({extent:n,minZoom:e.zoomMin,maxZoom:r,tileSize:o});this.tileGrid=a;var s=this.culture_,u=this.hidpi_;if(this.tileUrlFunction=Xu(e.imageUrlSubdomains.map(function(t){var r=[0,0,0],n=e.imageUrl.replace("{subdomain}",t).replace("{culture}",s);return function(t){if(t){cs(t[0],t[1],t[2],r);var o=n;return u&&(o+="&dpi=d1&device=mobile"),o.replace("{quadkey}",function(t){for(var r,n=t[0],i=new Array(n),o=1<<n-1,e=0;e<n;++e)r=48,t[1]&o&&(r+=1),t[2]&o&&(r+=2),i[e]=String.fromCharCode(r),o>>=1;return i.join("")}(r))}}})),e.imageryProviders){var l=be(we("EPSG:4326"),this.getProjection());this.setAttributions(function(t){var r=[],n=t.viewState,i=this.getTileGrid(),o=i.getZForResolution(n.resolution,this.zDirection),a=i.getTileCoordForCoordAndZ(n.center,o)[0];return e.imageryProviders.map(function(e){for(var n=!1,i=e.coverageAreas,o=0,s=i.length;o<s;++o){var u=i[o];if(a>=u.zoomMin&&a<=u.zoomMax){var h=u.bbox;if(bt(Ft([h[1],h[0],h[3],h[2]],l),t.extent)){n=!0;break}}}n&&r.push(e.attribution)}),r.push('<a class="ol-attribution-bing-tos" href="https://www.microsoft.com/maps/product/terms.html" target="_blank">Terms of Use<\/a>'),r}.bind(this))}this.setState(vi.READY)}else this.setState(vi.ERROR)},e}(wl),Rl=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Cl=function(t){function e(e){var r=e||{},n=void 0!==r.projection?r.projection:"EPSG:3857",i=void 0!==r.tileGrid?r.tileGrid:vs({extent:Ts(n),maxZoom:r.maxZoom,minZoom:r.minZoom,tileSize:r.tileSize});return t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,opaque:r.opaque,projection:n,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:r.tileLoadFunction,tilePixelRatio:r.tilePixelRatio,tileUrlFunction:r.tileUrlFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,attributionsCollapsible:r.attributionsCollapsible,zDirection:r.zDirection})||this}return Rl(e,t),e}(wl),Pl=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Il=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,maxZoom:void 0!==e.maxZoom?e.maxZoom:18,minZoom:e.minZoom,projection:e.projection,wrapX:e.wrapX})||this;return r.account_=e.account,r.mapId_=e.map||"",r.config_=e.config||{},r.templateCache_={},r.initializeMap_(),r}return Pl(e,t),e.prototype.getConfig=function(){return this.config_},e.prototype.updateConfig=function(t){p(this.config_,t);this.initializeMap_()},e.prototype.setConfig=function(t){this.config_=t||{};this.initializeMap_()},e.prototype.initializeMap_=function(){var t=JSON.stringify(this.config_);if(this.templateCache_[t])this.applyTemplate_(this.templateCache_[t]);else{var e="https://"+this.account_+".carto.com/api/v1/map";this.mapId_&&(e+="/named/"+this.mapId_);var r=new XMLHttpRequest;r.addEventListener("load",this.handleInitResponse_.bind(this,t));r.addEventListener("error",this.handleInitError_.bind(this));r.open("POST",e);r.setRequestHeader("Content-type","application/json");r.send(JSON.stringify(this.config_))}},e.prototype.handleInitResponse_=function(t,e){var r=e.target;if(!r.status||r.status>=200&&r.status<300){var n=void 0;try{n=JSON.parse(r.responseText)}catch(t){return void this.setState(vi.ERROR)}this.applyTemplate_(n);this.templateCache_[t]=n;this.setState(vi.READY)}else this.setState(vi.ERROR)},e.prototype.handleInitError_=function(){this.setState(vi.ERROR)},e.prototype.applyTemplate_=function(t){var e="https://"+t.cdn_url.https+"/"+this.account_+"/api/v1/map/"+t.layergroupid+"/{z}/{x}/{y}.png";this.setUrl(e)},e}(Cl),bl={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature"},Ll=r(0),Ml=r.n(Ll),Fl=function(){function t(t){this.rbush_=new Ml.a(t);this.items_={}}return t.prototype.insert=function(t,e){var r={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(r);this.items_[o(e)]=r},t.prototype.load=function(t,e){for(var r=new Array(e.length),n=0,i=e.length;n<i;n++){var a=t[n],s=e[n],u={minX:a[0],minY:a[1],maxX:a[2],maxY:a[3],value:s};r[n]=u;this.items_[o(s)]=u}this.rbush_.load(r)},t.prototype.remove=function(t){var e=o(t),r=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(r)},t.prototype.update=function(t,e){var r=this.items_[o(e)];pt([r.minX,r.minY,r.maxX,r.maxY],t)||(this.remove(e),this.insert(t,e))},t.prototype.getAll=function(){return this.rbush_.all().map(function(t){return t.value})},t.prototype.getInExtent=function(t){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map(function(t){return t.value})},t.prototype.forEach=function(t){return this.forEach_(this.getAll(),t)},t.prototype.forEachInExtent=function(t,e){return this.forEach_(this.getInExtent(t),e)},t.prototype.forEach_=function(t,e){for(var r,n=0,i=t.length;n<i;n++)if(r=e(t[n]))return r;return r},t.prototype.isEmpty=function(){return _(this.items_)},t.prototype.clear=function(){this.rbush_.clear();this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return ut(e.minX,e.minY,e.maxX,e.maxY,t)},t.prototype.concat=function(t){for(var e in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[e]=t.items_[e]},t}(),Al=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Nl=function(t){function e(e,r){var n=t.call(this,e)||this;return n.feature=r,n}return Al(e,t),e}(M),Dl=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{attributions:n.attributions,projection:void 0,state:vi.READY,wrapX:void 0===n.wrapX||n.wrapX})||this).loader_=b;r.format_=n.format;r.overlaps_=null==n.overlaps||n.overlaps;r.url_=n.url;void 0!==n.loader?r.loader_=n.loader:void 0!==r.url_&&(K(r.format_,7),r.loader_=os(r.url_,r.format_));r.strategy_=void 0!==n.strategy?n.strategy:as;var i,o,a=void 0===n.useSpatialIndex||n.useSpatialIndex;return r.featuresRtree_=a?new Fl:null,r.loadedExtentsRtree_=new Fl,r.nullGeometryFeatures_={},r.idIndex_={},r.uidIndex_={},r.featureChangeKeys_={},r.featuresCollection_=null,Array.isArray(n.features)?o=n.features:n.features&&(o=(i=n.features).getArray()),a||void 0!==i||(i=new Z(o)),void 0!==o&&r.addFeaturesInternal(o),void 0!==i&&r.bindFeaturesCollection_(i),r}return Al(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t);this.changed()},e.prototype.addFeatureInternal=function(t){var e=o(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var r=t.getGeometry();if(r){var n=r.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(n,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Nl(bl.ADDFEATURE,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[g(e,N.CHANGE,this.handleFeatureChange_,this),g(e,c,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var r=!0,n=e.getId();return void 0!==n&&(n.toString()in this.idIndex_?r=!1:this.idIndex_[n.toString()]=e),r&&(K(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),r},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t);this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],r=[],n=[],i=0,a=t.length;i<a;i++){var s=o(l=t[i]);this.addToIndex_(s,l)&&r.push(l)}i=0;for(var u=r.length;i<u;i++){var l;s=o(l=r[i]);this.setupChangeEvents_(s,l);var h=l.getGeometry();if(h){var c=h.getExtent();e.push(c);n.push(l)}else this.nullGeometryFeatures_[s]=l}this.featuresRtree_&&this.featuresRtree_.load(e,n);i=0;for(var p=r.length;i<p;i++)this.dispatchEvent(new Nl(bl.ADDFEATURE,r[i]))},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(bl.ADDFEATURE,function(r){e||(e=!0,t.push(r.feature),e=!1)});this.addEventListener(bl.REMOVEFEATURE,function(r){e||(e=!0,t.remove(r.feature),e=!1)});t.addEventListener(h.ADD,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this));t.addEventListener(h.REMOVE,function(t){e||(e=!0,this.removeFeature(t.element),e=!1)}.bind(this));this.featuresCollection_=t},e.prototype.clear=function(t){if(t){for(var e in this.featureChangeKeys_)this.featureChangeKeys_[e].forEach(v);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_)for(var r in this.featuresRtree_.forEach(this.removeFeatureInternal.bind(this)),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[r]);this.featuresCollection_&&this.featuresCollection_.clear();this.featuresRtree_&&this.featuresRtree_.clear();this.nullGeometryFeatures_={};var n=new Nl(bl.CLEAR);this.dispatchEvent(n);this.changed()},e.prototype.forEachFeature=function(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},e.prototype.forEachFeatureAtCoordinateDirect=function(t,e){var r=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(r,function(r){if(r.getGeometry().intersectsCoordinate(t))return e(r)})},e.prototype.forEachFeatureInExtent=function(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},e.prototype.forEachFeatureIntersectingExtent=function(t,e){return this.forEachFeatureInExtent(t,function(r){if(r.getGeometry().intersectsExtent(t)){var n=e(r);if(n)return n}})},e.prototype.getFeaturesCollection=function(){return this.featuresCollection_},e.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray():this.featuresRtree_&&(t=this.featuresRtree_.getAll(),_(this.nullGeometryFeatures_)||x(t,d(this.nullGeometryFeatures_))),t},e.prototype.getFeaturesAtCoordinate=function(t){var e=[];return this.forEachFeatureAtCoordinateDirect(t,function(t){e.push(t)}),e},e.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_?this.featuresRtree_.getInExtent(t):this.featuresCollection_?this.featuresCollection_.getArray():[]},e.prototype.getClosestFeatureToCoordinate=function(t,e){var r=t[0],n=t[1],i=null,o=[NaN,NaN],a=1/0,s=[-1/0,-1/0,1/0,1/0],u=e||P;return this.featuresRtree_.forEachInExtent(s,function(t){if(u(t)){var e=t.getGeometry(),l=a;if((a=e.closestPointXY(r,n,o,a))<l){i=t;var h=Math.sqrt(a);s[0]=r-h;s[1]=n-h;s[2]=r+h;s[3]=n+h}}}),i},e.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},e.prototype.getFeatureById=function(t){var e=this.idIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getFeatureByUid=function(t){var e=this.uidIndex_[t];return void 0!==e?e:null},e.prototype.getFormat=function(){return this.format_},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.getUrl=function(){return this.url_},e.prototype.handleFeatureChange_=function(t){var e=t.target,r=o(e),n=e.getGeometry();if(n){var i=n.getExtent();r in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[r],this.featuresRtree_&&this.featuresRtree_.insert(i,e)):this.featuresRtree_&&this.featuresRtree_.update(i,e)}else r in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[r]=e);var a=e.getId();if(void 0!==a){var s=a.toString();this.idIndex_[s]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[s]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[r]=e;this.changed();this.dispatchEvent(new Nl(bl.CHANGEFEATURE,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:o(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&_(this.nullGeometryFeatures_)},e.prototype.loadFeatures=function(t,e,r){var n=this.loadedExtentsRtree_,i=this.strategy_(t,e);this.loading=!1;for(var o=function(t){var s=i[t];n.forEachInExtent(s,function(t){return it(t.extent,s)})||(a.loader_.call(a,s,e,r),n.insert(s,{extent:s.slice()}),a.loading=a.loader_!==b)},a=this,s=0,u=i.length;s<u;++s)o(s)},e.prototype.refresh=function(){this.clear(!0);this.loadedExtentsRtree_.clear();t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,r=this.loadedExtentsRtree_;r.forEachInExtent(t,function(r){if(pt(r.extent,t))return e=r,!0});e&&r.remove(e)},e.prototype.removeFeature=function(t){var e=o(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t);this.removeFeatureInternal(t);this.changed()},e.prototype.removeFeatureInternal=function(t){var e=o(t);this.featureChangeKeys_[e].forEach(v);delete this.featureChangeKeys_[e];var r=t.getId();void 0!==r&&delete this.idIndex_[r.toString()];delete this.uidIndex_[e];this.dispatchEvent(new Nl(bl.REMOVEFEATURE,t))},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var r in this.idIndex_)if(this.idIndex_[r]===t){delete this.idIndex_[r];e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){K(this.format_,7);this.setLoader(os(t,this.format_))},e}(cl),Gl=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),jl=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,wrapX:e.wrapX})||this;return r.resolution=void 0,r.distance=void 0!==e.distance?e.distance:20,r.features=[],r.geometryFunction=e.geometryFunction||function(t){var e=t.getGeometry();return K(e.getType()==Nt.POINT,10),e},r.source=e.source,r.source.addEventListener(N.CHANGE,r.refresh.bind(r)),r}return Gl(e,t),e.prototype.getDistance=function(){return this.distance},e.prototype.getSource=function(){return this.source},e.prototype.loadFeatures=function(t,e,r){this.source.loadFeatures(t,e,r);e!==this.resolution&&(this.clear(),this.resolution=e,this.cluster(),this.addFeatures(this.features))},e.prototype.setDistance=function(t){this.distance=t;this.refresh()},e.prototype.refresh=function(){this.clear();this.cluster();this.addFeatures(this.features)},e.prototype.cluster=function(){if(void 0!==this.resolution){this.features.length=0;for(var t=[1/0,1/0,-1/0,-1/0],e=this.distance*this.resolution,r=this.source.getFeatures(),n={},i=0,a=r.length;i<a;i++){var s=r[i];if(!(o(s)in n)){var u=this.geometryFunction(s);if(u){ht(u.getCoordinates(),t);tt(t,e,t);var l=this.source.getFeaturesInExtent(t);l=l.filter(function(t){var e=o(t);return!(e in n)&&(n[e]=!0,!0)});this.features.push(this.createCluster(l))}}}}},e.prototype.createCluster=function(t){for(var e=[0,0],r=t.length-1;r>=0;--r){var n=this.geometryFunction(t[r]);n?zn(e,n.getCoordinates()):t.splice(r,1)}Hn(e,1/t.length);var i=new q(new Or(e));return i.set("features",t),i},e}(Dl),kl=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ul={DEFAULT:"default",TRUNCATED:"truncated"},Bl=function(t){function e(e,r,n,i,o,a,s,u){var l=t.call(this,n,i,o,a,s,u)||this;return l.zoomifyImage_=null,l.tileSize_=xi(r.getTileSize(n[0])).map(function(t){return t*e}),l}return kl(e,t),e.prototype.getImage=function(){if(this.zoomifyImage_)return this.zoomifyImage_;var e=t.prototype.getImage.call(this);if(this.state==wn.LOADED){var r=this.tileSize_;if(e.width==r[0]&&e.height==r[1])return this.zoomifyImage_=e,e;var n=li(r[0],r[1]);return n.drawImage(e,0,0),this.zoomifyImage_=n.canvas,n.canvas}return e},e}($u),Yl=function(t){function e(e){var r=this,n=e||{},i=n.size,o=void 0!==n.tierSizeCalculation?n.tierSizeCalculation:Ul.DEFAULT,a=i[0],s=i[1],u=n.extent||[0,-i[1],i[0],0],l=[],h=n.tileSize||Pn,c=n.tilePixelRatio||1,p=h;switch(o){case Ul.DEFAULT:for(;a>p||s>p;)l.push([Math.ceil(a/p),Math.ceil(s/p)]),p+=p;break;case Ul.TRUNCATED:for(var f=a,d=s;f>p||d>p;)l.push([Math.ceil(f/p),Math.ceil(d/p)]),f>>=1,d>>=1;break;default:K(!1,53)}l.push([1,1]);l.reverse();for(var _=[1],g=[0],y=1,v=l.length;y<v;y++)_.push(1<<y),g.push(l[y-1][0]*l[y-1][1]+g[y-1]);_.reverse();var m=new gs({tileSize:h,extent:u,origin:Ct(u),resolutions:_}),E=n.url;E&&-1==E.indexOf("{TileGroup}")&&-1==E.indexOf("{tileIndex}")&&(E+="{TileGroup}/{z}-{x}-{y}.jpg");var T=Xu(Wu(E).map(function(t){return function(e){if(e){var i=e[0],o=e[1],a=e[2],s=o+a*l[i][0],u=m.getTileSize(i),h=Array.isArray(u)?u[0]:u,c={z:i,x:o,y:a,tileIndex:s,TileGroup:"TileGroup"+((s+g[i])/h|0)};return t.replace(/\{(\w+?)\}/g,function(t,e){return c[e]})}}})),S=Bl.bind(null,c,m);return(r=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,projection:n.projection,tilePixelRatio:c,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileClass:S,tileGrid:m,tileUrlFunction:T,transition:n.transition})||this).zDirection=n.zDirection,r}return kl(e,t),e}(wl),zl={VERSION1:"version1",VERSION2:"version2",VERSION3:"version3"},Xl={};Xl[zl.VERSION1]={level0:{supports:[],formats:[],qualities:["native"]},level1:{supports:["regionByPx","sizeByW","sizeByH","sizeByPct"],formats:["jpg"],qualities:["native"]},level2:{supports:["regionByPx","regionByPct","sizeByW","sizeByH","sizeByPct","sizeByConfinedWh","sizeByWh"],formats:["jpg","png"],qualities:["native","color","grey","bitonal"]}};Xl[zl.VERSION2]={level0:{supports:[],formats:["jpg"],qualities:["default"]},level1:{supports:["regionByPx","sizeByW","sizeByH","sizeByPct"],formats:["jpg"],qualities:["default"]},level2:{supports:["regionByPx","regionByPct","sizeByW","sizeByH","sizeByPct","sizeByConfinedWh","sizeByDistortedWh","sizeByWh"],formats:["jpg","png"],qualities:["default","bitonal"]}};Xl[zl.VERSION3]={level0:{supports:[],formats:["jpg"],qualities:["default"]},level1:{supports:["regionByPx","regionSquare","sizeByW","sizeByH","sizeByWh"],formats:["jpg"],qualities:["default"]},level2:{supports:["regionByPx","regionSquare","regionByPct","sizeByW","sizeByH","sizeByPct","sizeByConfinedWh","sizeByWh"],formats:["jpg","png"],qualities:["default"]}};Xl.none={none:{supports:[],formats:[],qualities:[]}};var Vl=new RegExp("^https?://library.stanford.edu/iiif/image-api/(1.1/)?compliance.html#level[0-2]$"),Wl=new RegExp("^https?://iiif.io/api/image/2/level[0-2](.json)?$"),Zl=new RegExp("(^https?://iiif.io/api/image/3/level[0-2](.json)?$)|(^level[0-2]$)"),Kl={};Kl[zl.VERSION1]=function(t){var e=t.getComplianceLevelSupportedFeatures();return void 0===e&&(e=Xl[zl.VERSION1].level0),{url:void 0===t.imageInfo["@id"]?void 0:t.imageInfo["@id"].replace(/\/?(info.json)?$/g,""),supports:e.supports,formats:e.formats.concat([void 0===t.imageInfo.formats?[]:t.imageInfo.formats]),qualities:e.qualities.concat([void 0===t.imageInfo.qualities?[]:t.imageInfo.qualities]),resolutions:t.imageInfo.scale_factors,tileSize:void 0!==t.imageInfo.tile_width?void 0!==t.imageInfo.tile_height?[t.imageInfo.tile_width,t.imageInfo.tile_height]:[t.imageInfo.tile_width,t.imageInfo.tile_width]:null!=t.imageInfo.tile_height?[t.imageInfo.tile_height,t.imageInfo.tile_height]:void 0}};Kl[zl.VERSION2]=function(t){var e=t.getComplianceLevelSupportedFeatures(),r=Array.isArray(t.imageInfo.profile)&&t.imageInfo.profile.length>1,n=r&&t.imageInfo.profile[1].supports?t.imageInfo.profile[1].supports:[],i=r&&t.imageInfo.profile[1].formats?t.imageInfo.profile[1].formats:[],o=r&&t.imageInfo.profile[1].qualities?t.imageInfo.profile[1].qualities:[];return{url:t.imageInfo["@id"].replace(/\/?(info.json)?$/g,""),sizes:void 0===t.imageInfo.sizes?void 0:t.imageInfo.sizes.map(function(t){return[t.width,t.height]}),tileSize:void 0===t.imageInfo.tiles?void 0:[t.imageInfo.tiles.map(function(t){return t.width})[0],t.imageInfo.tiles.map(function(t){return void 0===t.height?t.width:t.height})[0]],resolutions:void 0===t.imageInfo.tiles?void 0:t.imageInfo.tiles.map(function(t){return t.scaleFactors})[0],supports:e.supports.concat(n),formats:e.formats.concat(i),qualities:e.qualities.concat(o)}};Kl[zl.VERSION3]=function(t){var e=t.getComplianceLevelSupportedFeatures(),r=void 0===t.imageInfo.extraFormats?e.formats:e.formats.concat(t.imageInfo.extraFormats),n=void 0!==t.imageInfo.preferredFormats&&Array.isArray(t.imageInfo.preferredFormats)&&t.imageInfo.preferredFormats.length>0?t.imageInfo.preferredFormats.filter(function(t){return["jpg","png","gif"].includes(t)}).reduce(function(t,e){return void 0===t&&r.includes(e)?e:t},void 0):void 0;return{url:t.imageInfo.id,sizes:void 0===t.imageInfo.sizes?void 0:t.imageInfo.sizes.map(function(t){return[t.width,t.height]}),tileSize:void 0===t.imageInfo.tiles?void 0:[t.imageInfo.tiles.map(function(t){return t.width})[0],t.imageInfo.tiles.map(function(t){return t.height})[0]],resolutions:void 0===t.imageInfo.tiles?void 0:t.imageInfo.tiles.map(function(t){return t.scaleFactors})[0],supports:void 0===t.imageInfo.extraFeatures?e.supports:e.supports.concat(t.imageInfo.extraFeatures),formats:r,qualities:void 0===t.imageInfo.extraQualities?e.qualities:e.qualities.concat(t.imageInfo.extraQualities),preferredFormat:n}};var Hl=function(){function t(t){this.setImageInfo(t)}return t.prototype.setImageInfo=function(t){this.imageInfo="string"==typeof t?JSON.parse(t):t},t.prototype.getImageApiVersion=function(){if(void 0!==this.imageInfo){var t=this.imageInfo["@context"]||"ol-no-context";"string"==typeof t&&(t=[t]);for(var e=0;e<t.length;e++)switch(t[e]){case"http://library.stanford.edu/iiif/image-api/1.1/context.json":case"http://iiif.io/api/image/1/context.json":return zl.VERSION1;case"http://iiif.io/api/image/2/context.json":return zl.VERSION2;case"http://iiif.io/api/image/3/context.json":return zl.VERSION3;case"ol-no-context":if(this.getComplianceLevelEntryFromProfile(zl.VERSION1)&&this.imageInfo.identifier)return zl.VERSION1}K(!1,61)}},t.prototype.getComplianceLevelEntryFromProfile=function(t){if(void 0!==this.imageInfo&&void 0!==this.imageInfo.profile)switch(void 0===t&&(t=this.getImageApiVersion()),t){case zl.VERSION1:if(Vl.test(this.imageInfo.profile))return this.imageInfo.profile;break;case zl.VERSION3:if(Zl.test(this.imageInfo.profile))return this.imageInfo.profile;break;case zl.VERSION2:if("string"==typeof this.imageInfo.profile&&Wl.test(this.imageInfo.profile))return this.imageInfo.profile;if(Array.isArray(this.imageInfo.profile)&&this.imageInfo.profile.length>0&&"string"==typeof this.imageInfo.profile[0]&&Wl.test(this.imageInfo.profile[0]))return this.imageInfo.profile[0]}},t.prototype.getComplianceLevelFromProfile=function(t){var e=this.getComplianceLevelEntryFromProfile(t);if(void 0!==e){var r=e.match(/level[0-2](\.json)?$/g);return Array.isArray(r)?r[0].replace(".json",""):void 0}},t.prototype.getComplianceLevelSupportedFeatures=function(){if(void 0!==this.imageInfo){var t=this.getImageApiVersion(),e=this.getComplianceLevelFromProfile(t);return void 0===e?Xl.none.none:Xl[t][e]}},t.prototype.getTileSourceOptions=function(t){var e=t||{},r=this.getImageApiVersion();if(void 0!==r){var n=void 0===r?void 0:Kl[r](this);if(void 0!==n)return{url:n.url,version:r,size:[this.imageInfo.width,this.imageInfo.height],sizes:n.sizes,format:void 0!==e.format&&n.formats.includes(e.format)?e.format:void 0!==n.preferredFormat?n.preferredFormat:"jpg",supports:n.supports,quality:e.quality&&n.qualities.includes(e.quality)?e.quality:n.qualities.includes("native")?"native":"default",resolutions:Array.isArray(n.resolutions)?n.resolutions.sort(function(t,e){return e-t}):void 0,tileSize:n.tileSize}}},t}(),ql=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Jl(t){return t.toLocaleString("en",{maximumFractionDigits:10})}var Ql=function(t){function e(e){var r=this,n=e||{},i=n.url||"";i+=i.lastIndexOf("/")===i.length-1||""===i?"":"/";var o=n.version||zl.VERSION2,a=n.sizes||[],s=n.size;K(null!=s&&Array.isArray(s)&&2==s.length&&!isNaN(s[0])&&s[0]>0&&!isNaN(s[1])&&s[1]>0,60);var u,l,h,c=s[0],p=s[1],f=n.tileSize,d=n.tilePixelRatio||1,_=n.format||"jpg",g=n.quality||(n.version==zl.VERSION1?"native":"default"),y=n.resolutions||[],v=n.supports||[],m=n.extent||[0,-p,c,0],E=null!=a&&Array.isArray(a)&&a.length>0,T=null!=f&&("number"==typeof f&&Number.isInteger(f)&&f>0||Array.isArray(f)&&f.length>0),S=null!=v&&Array.isArray(v)&&(v.includes("regionByPx")||v.includes("regionByPct"))&&(v.includes("sizeByWh")||v.includes("sizeByH")||v.includes("sizeByW")||v.includes("sizeByPct"));if(y.sort(function(t,e){return e-t}),T||S)if(null!=f&&("number"==typeof f&&Number.isInteger(f)&&f>0?(u=f,l=f):Array.isArray(f)&&f.length>0&&((1==f.length||null==f[1]&&Number.isInteger(f[0]))&&(u=f[0],l=f[0]),2==f.length&&(Number.isInteger(f[0])&&Number.isInteger(f[1])?(u=f[0],l=f[1]):null==f[0]&&Number.isInteger(f[1])&&(u=f[1],l=f[1])))),void 0!==u&&void 0!==l||(u=Pn,l=Pn),0==y.length)for(var w=h=Math.max(Math.ceil(Math.log(c/u)/Math.LN2),Math.ceil(Math.log(p/l)/Math.LN2));w>=0;w--)y.push(Math.pow(2,w));else{var x=Math.max.apply(Math,y);h=Math.round(Math.log(x)/Math.LN2)}else if(u=c,l=p,y=[],E){a.sort(function(t,e){return t[0]-e[0]});h=-1;var O=[];for(w=0;w<a.length;w++){var R=c/a[w][0];y.length>0&&y[y.length-1]==R?O.push(w):(y.push(R),h++)}if(O.length>0)for(w=0;w<O.length;w++)a.splice(O[w]-w,1)}else y.push(1),a.push([c,p]),h=0;var C=new gs({tileSize:[u,l],extent:m,origin:Ct(m),resolutions:y}),P=Bl.bind(null,d,C);return(r=t.call(this,{attributions:n.attributions,attributionsCollapsible:n.attributionsCollapsible,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,projection:n.projection,reprojectionErrorThreshold:n.reprojectionErrorThreshold,state:n.state,tileClass:P,tileGrid:C,tilePixelRatio:n.tilePixelRatio,tileUrlFunction:function(t){var n,s,f=t[0];if(!(f>h)){var d=t[1],m=t[2],w=y[f];if(!(void 0===d||void 0===m||void 0===w||d<0||Math.ceil(c/w/u)<=d||m<0||Math.ceil(p/w/l)<=m)){if(S||T){var x=d*u*w,O=m*l*w,R=u*w,C=l*w,P=u,I=l;(x+R>c&&(R=c-x),O+C>p&&(C=p-O),x+u*w>c&&(P=Math.floor((c-x+w-1)/w)),O+l*w>p&&(I=Math.floor((p-O+w-1)/w)),0==x&&R==c&&0==O&&C==p)?n="full":!S||v.includes("regionByPx")?n=x+","+O+","+R+","+C:v.includes("regionByPct")&&(n="pct:"+Jl(x/c*100)+","+Jl(O/p*100)+","+Jl(R/c*100)+","+Jl(C/p*100));o!=zl.VERSION3||S&&!v.includes("sizeByWh")?!S||v.includes("sizeByW")?s=P+",":v.includes("sizeByH")?s=","+I:v.includes("sizeByWh")?s=P+","+I:v.includes("sizeByPct")&&(s="pct:"+Jl(100/w)):s=P+","+I}else if(n="full",E){var b=a[f][0],L=a[f][1];s=o==zl.VERSION3?b==c&&L==p?"max":b+","+L:b==c?"full":b+","}else s=o==zl.VERSION3?"max":"full";return i+n+"/"+s+"/0/"+g+"."+_}}},transition:n.transition})||this).zDirection=n.zDirection,r}return ql(e,t),e}(wl),$l=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),th=function(t){function e(e,r,n,i,o,a){var s=this,u=e.getExtent(),l=r.getExtent(),h=l?Rt(n,l):n,c=rl(e,r,St(h),i),p=new al(e,r,h,u,c*Ku),f=a(p.calculateSourceExtent(),c,o),d=f?Da.IDLE:Da.EMPTY,_=f?f.getPixelRatio():1;return(s=t.call(this,n,i,_,d)||this).targetProj_=r,s.maxSourceExtent_=u,s.triangulation_=p,s.targetResolution_=i,s.targetExtent_=n,s.sourceImage_=f,s.sourcePixelRatio_=_,s.canvas_=null,s.sourceListenerKey_=null,s}return $l(e,t),e.prototype.disposeInternal=function(){this.state==Da.LOADING&&this.unlistenSource_();t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.canvas_},e.prototype.getProjection=function(){return this.targetProj_},e.prototype.reproject_=function(){var t=this.sourceImage_.getState();if(t==Da.LOADED){var e=It(this.targetExtent_)/this.targetResolution_,r=Ot(this.targetExtent_)/this.targetResolution_;this.canvas_=il(e,r,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0)}this.state=t;this.changed()},e.prototype.load=function(){if(this.state==Da.IDLE){this.state=Da.LOADING;this.changed();var t=this.sourceImage_.getState();t==Da.LOADED||t==Da.ERROR?this.reproject_():(this.sourceListenerKey_=g(this.sourceImage_,N.CHANGE,function(){var e=this.sourceImage_.getState();e!=Da.LOADED&&e!=Da.ERROR||(this.unlistenSource_(),this.reproject_())},this),this.sourceImage_.load())}},e.prototype.unlistenSource_=function(){v(this.sourceListenerKey_);this.sourceListenerKey_=null},e}(wu),eh=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),rh="imageloadstart",nh="imageloadend",ih="imageloaderror",oh=function(t){function e(e,r){var n=t.call(this,e)||this;return n.image=r,n}return eh(e,t),e}(M);function ah(t,e){t.getImage().src=e}var sh=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,projection:e.projection,state:e.state})||this;return r.resolutions_=void 0!==e.resolutions?e.resolutions:null,r.reprojectedImage_=null,r.reprojectedRevision_=0,r}return eh(e,t),e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.findNearestResolution=function(t){if(this.resolutions_){var e=S(this.resolutions_,t,0);t=this.resolutions_[e]}return t},e.prototype.getImage=function(t,e,r,n){var i=this.getProjection();if(i&&n&&!Ie(i,n)){if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&Ie(this.reprojectedImage_.getProjection(),n)&&this.reprojectedImage_.getResolution()==e&&pt(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose();this.reprojectedImage_=null}return this.reprojectedImage_=new th(i,n,t,e,r,function(t,e,r){return this.getImageInternal(t,e,r,i)}.bind(this)),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}return i&&(n=i),this.getImageInternal(t,e,r,n)},e.prototype.getImageInternal=function(){return n()},e.prototype.handleImageChange=function(t){var e=t.target;switch(e.getState()){case Da.LOADING:this.loading=!0;this.dispatchEvent(new oh(rh,e));break;case Da.LOADED:this.loading=!1;this.dispatchEvent(new oh(nh,e));break;case Da.ERROR:this.loading=!1;this.dispatchEvent(new oh(ih,e))}},e}(cl);function uh(t,e){var r=[];Object.keys(e).forEach(function(t){null!==e[t]&&void 0!==e[t]&&r.push(t+"="+encodeURIComponent(e[t]))});var n=r.join("&");return(t=-1===(t=t.replace(/[?&]$/,"")).indexOf("?")?t+"?":t+"&")+n}var lh=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),hh=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,{attributions:n.attributions,projection:n.projection,resolutions:n.resolutions})||this).crossOrigin_=void 0!==n.crossOrigin?n.crossOrigin:null,r.hidpi_=void 0===n.hidpi||n.hidpi,r.url_=n.url,r.imageLoadFunction_=void 0!==n.imageLoadFunction?n.imageLoadFunction:ah,r.params_=n.params||{},r.image_=null,r.imageSize_=[0,0],r.renderedRevision_=0,r.ratio_=void 0!==n.ratio?n.ratio:1.5,r}return lh(e,t),e.prototype.getParams=function(){return this.params_},e.prototype.getImageInternal=function(t,e,r,n){if(void 0===this.url_)return null;e=this.findNearestResolution(e);r=this.hidpi_?r:1;var i=this.image_;if(i&&this.renderedRevision_==this.getRevision()&&i.getResolution()==e&&i.getPixelRatio()==r&&it(i.getExtent(),t))return i;var o={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};p(o,this.params_);var a=((t=t.slice())[0]+t[2])/2,s=(t[1]+t[3])/2;if(1!=this.ratio_){var u=this.ratio_*It(t)/2,l=this.ratio_*Ot(t)/2;t[0]=a-u;t[1]=s-l;t[2]=a+u;t[3]=s+l}var h=e/r,c=Math.ceil(It(t)/h),f=Math.ceil(Ot(t)/h);t[0]=a-h*c/2;t[2]=a+h*c/2;t[1]=s-h*f/2;t[3]=s+h*f/2;this.imageSize_[0]=c;this.imageSize_[1]=f;var d=this.getRequestUrl_(t,this.imageSize_,r,n,o);return this.image_=new Ru(t,e,r,d,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this.image_.addEventListener(N.CHANGE,this.handleImageChange.bind(this)),this.image_},e.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},e.prototype.getRequestUrl_=function(t,e,r,n,i){var o=n.getCode().split(":").pop();i.SIZE=e[0]+","+e[1];i.BBOX=t.join(",");i.BBOXSR=o;i.IMAGESR=o;i.DPI=Math.round(90*r);var a=this.url_,s=a.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage");return s==a&&K(!1,50),uh(s,i)},e.prototype.getUrl=function(){return this.url_},e.prototype.setImageLoadFunction=function(t){this.image_=null;this.imageLoadFunction_=t;this.changed()},e.prototype.setUrl=function(t){t!=this.url_&&(this.url_=t,this.image_=null,this.changed())},e.prototype.updateParams=function(t){p(this.params_,t);this.image_=null;this.changed()},e}(sh),ch=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ph=function(t){function e(e,r,n,i,o){var a=this,s=void 0!==o?Da.IDLE:Da.LOADED;return(a=t.call(this,e,r,n,s)||this).loader_=void 0!==o?o:null,a.canvas_=i,a.error_=null,a}return ch(e,t),e.prototype.getError=function(){return this.error_},e.prototype.handleLoad_=function(t){t?(this.error_=t,this.state=Da.ERROR):this.state=Da.LOADED;this.changed()},e.prototype.load=function(){this.state==Da.IDLE&&(this.state=Da.LOADING,this.changed(),this.loader_(this.handleLoad_.bind(this)))},e.prototype.getImage=function(){return this.canvas_},e}(wu),fh=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),dh=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,{attributions:n.attributions,projection:n.projection,resolutions:n.resolutions,state:n.state})||this).canvasFunction_=n.canvasFunction,r.canvas_=null,r.renderedRevision_=0,r.ratio_=void 0!==n.ratio?n.ratio:1.5,r}return fh(e,t),e.prototype.getImageInternal=function(t,e,r,n){e=this.findNearestResolution(e);var i=this.canvas_;if(i&&this.renderedRevision_==this.getRevision()&&i.getResolution()==e&&i.getPixelRatio()==r&&it(i.getExtent(),t))return i;Mt(t=t.slice(),this.ratio_);var o=[It(t)/e*r,Ot(t)/e*r],a=this.canvasFunction_.call(this,t,e,r,o,n);return a&&(i=new ph(t,e,r,a)),this.canvas_=i,this.renderedRevision_=this.getRevision(),i},e}(sh),_h=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),gh=function(t){function e(e){var r=t.call(this,{projection:e.projection,resolutions:e.resolutions})||this;return r.crossOrigin_=void 0!==e.crossOrigin?e.crossOrigin:null,r.displayDpi_=void 0!==e.displayDpi?e.displayDpi:96,r.params_=e.params||{},r.url_=e.url,r.imageLoadFunction_=void 0!==e.imageLoadFunction?e.imageLoadFunction:ah,r.hidpi_=void 0===e.hidpi||e.hidpi,r.metersPerUnit_=void 0!==e.metersPerUnit?e.metersPerUnit:1,r.ratio_=void 0!==e.ratio?e.ratio:1,r.useOverlay_=void 0!==e.useOverlay&&e.useOverlay,r.image_=null,r.renderedRevision_=0,r}return _h(e,t),e.prototype.getParams=function(){return this.params_},e.prototype.getImageInternal=function(t,e,r,n){e=this.findNearestResolution(e);r=this.hidpi_?r:1;var i=this.image_;if(i&&this.renderedRevision_==this.getRevision()&&i.getResolution()==e&&i.getPixelRatio()==r&&it(i.getExtent(),t))return i;1!=this.ratio_&&Mt(t=t.slice(),this.ratio_);var o=[It(t)/e*r,Ot(t)/e*r];if(void 0!==this.url_){var a=this.getUrl(this.url_,this.params_,t,o,n);(i=new Ru(t,e,r,a,this.crossOrigin_,this.imageLoadFunction_)).addEventListener(N.CHANGE,this.handleImageChange.bind(this))}else i=null;return this.image_=i,this.renderedRevision_=this.getRevision(),i},e.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},e.prototype.updateParams=function(t){p(this.params_,t);this.changed()},e.prototype.getUrl=function(t,e,r,n){var o=function(t,e,r,n){var i=It(t),o=Ot(t),a=e[0],s=e[1],u=.0254/n;return s*i>a*o?i*r/(a*u):o*r/(s*u)}(r,n,this.metersPerUnit_,this.displayDpi_),a=St(r),s={OPERATION:this.useOverlay_?"GETDYNAMICMAPOVERLAYIMAGE":"GETMAPIMAGE",VERSION:"2.0.0",LOCALE:"en",CLIENTAGENT:"ol/source/ImageMapGuide source",CLIP:"1",SETDISPLAYDPI:this.displayDpi_,SETDISPLAYWIDTH:Math.round(n[0]),SETDISPLAYHEIGHT:Math.round(n[1]),SETVIEWSCALE:o,SETVIEWCENTERX:a[0],SETVIEWCENTERY:a[1]};return p(s,e),uh(t,s)},e.prototype.setImageLoadFunction=function(t){this.image_=null;this.imageLoadFunction_=t;this.changed()},e}(sh),yh=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),vh=function(t){function e(e){var r=this,n=void 0!==e.crossOrigin?e.crossOrigin:null,i=void 0!==e.imageLoadFunction?e.imageLoadFunction:ah;return(r=t.call(this,{attributions:e.attributions,projection:we(e.projection)})||this).url_=e.url,r.imageExtent_=e.imageExtent,r.image_=new Ru(r.imageExtent_,void 0,1,r.url_,n,i),r.imageSize_=e.imageSize?e.imageSize:null,r.image_.addEventListener(N.CHANGE,r.handleImageChange.bind(r)),r}return yh(e,t),e.prototype.getImageExtent=function(){return this.imageExtent_},e.prototype.getImageInternal=function(t){return bt(t,this.image_.getExtent())?this.image_:null},e.prototype.getUrl=function(){return this.url_},e.prototype.handleImageChange=function(e){if(this.image_.getState()==Da.LOADED){var r=this.image_.getExtent(),n=this.image_.getImage(),i=void 0,o=void 0;this.imageSize_?(i=this.imageSize_[0],o=this.imageSize_[1]):(i=n.width,o=n.height);var a=Ot(r)/o,s=Math.ceil(It(r)/a);if(s!=i){var u=li(s,o),l=u.canvas;u.drawImage(n,0,0,i,o,0,0,l.width,l.height);this.image_.setImage(l)}}t.prototype.handleImageChange.call(this,e)},e}(sh),mh="1.3.0",Eh="carmentaserver",Th="geoserver",Sh="mapserver",wh="qgis",xh=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Oh=[101,101],Rh=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,{attributions:n.attributions,projection:n.projection,resolutions:n.resolutions})||this).crossOrigin_=void 0!==n.crossOrigin?n.crossOrigin:null,r.url_=n.url,r.imageLoadFunction_=void 0!==n.imageLoadFunction?n.imageLoadFunction:ah,r.params_=n.params||{},r.v13_=!0,r.updateV13_(),r.serverType_=n.serverType,r.hidpi_=void 0===n.hidpi||n.hidpi,r.image_=null,r.imageSize_=[0,0],r.renderedRevision_=0,r.ratio_=void 0!==n.ratio?n.ratio:1.5,r}return xh(e,t),e.prototype.getFeatureInfoUrl=function(t,e,r,n){if(void 0!==this.url_){var i=we(r),o=this.getProjection();o&&o!==i&&(e=rl(o,i,t,e),t=Me(t,i,o));var a=xt(t,e,0,Oh),s={SERVICE:"WMS",VERSION:mh,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};p(s,this.params_,n);var u=Math.floor((t[0]-a[0])/e),l=Math.floor((a[3]-t[1])/e);return s[this.v13_?"I":"X"]=u,s[this.v13_?"J":"Y"]=l,this.getRequestUrl_(a,Oh,1,o||i,s)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.url_){var r={SERVICE:"WMS",VERSION:mh,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){var n=this.params_.LAYERS;if(!(!Array.isArray(n)||1===n.length))return;r.LAYER=n}if(void 0!==t){var i=this.getProjection()?this.getProjection().getMetersPerUnit():1;r.SCALE=t*i*39.37*(25.4/.28)}return p(r,e),uh(this.url_,r)}},e.prototype.getParams=function(){return this.params_},e.prototype.getImageInternal=function(t,e,r,n){if(void 0===this.url_)return null;e=this.findNearestResolution(e);1==r||this.hidpi_&&void 0!==this.serverType_||(r=1);var i=e/r,o=St(t),a=xt(o,i,0,[Math.ceil(It(t)/i),Math.ceil(Ot(t)/i)]),s=xt(o,i,0,[Math.ceil(this.ratio_*It(t)/i),Math.ceil(this.ratio_*Ot(t)/i)]),u=this.image_;if(u&&this.renderedRevision_==this.getRevision()&&u.getResolution()==e&&u.getPixelRatio()==r&&it(u.getExtent(),a))return u;var l={SERVICE:"WMS",VERSION:mh,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};p(l,this.params_);this.imageSize_[0]=Math.round(It(s)/i);this.imageSize_[1]=Math.round(Ot(s)/i);var h=this.getRequestUrl_(s,this.imageSize_,r,n,l);return this.image_=new Ru(s,e,r,h,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this.image_.addEventListener(N.CHANGE,this.handleImageChange.bind(this)),this.image_},e.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},e.prototype.getRequestUrl_=function(t,e,r,n,i){if(K(void 0!==this.url_,9),i[this.v13_?"CRS":"SRS"]=n.getCode(),"STYLES"in this.params_||(i.STYLES=""),1!=r)switch(this.serverType_){case Th:var o=90*r+.5|0;"FORMAT_OPTIONS"in i?i.FORMAT_OPTIONS+=";dpi:"+o:i.FORMAT_OPTIONS="dpi:"+o;break;case Sh:i.MAP_RESOLUTION=90*r;break;case Eh:case wh:i.DPI=90*r;break;default:K(!1,8)}i.WIDTH=e[0];i.HEIGHT=e[1];var a,s=n.getAxisOrientation();return a=this.v13_&&"ne"==s.substr(0,2)?[t[1],t[0],t[3],t[2]]:t,i.BBOX=a.join(","),uh(this.url_,i)},e.prototype.getUrl=function(){return this.url_},e.prototype.setImageLoadFunction=function(t){this.image_=null;this.imageLoadFunction_=t;this.changed()},e.prototype.setUrl=function(t){t!=this.url_&&(this.url_=t,this.image_=null,this.changed())},e.prototype.updateParams=function(t){p(this.params_,t);this.updateV13_();this.image_=null;this.changed()},e.prototype.updateV13_=function(){var t=this.params_.VERSION||mh;this.v13_=Yn(t,"1.3")>=0},e}(sh),Ch=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ph='&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap<\/a> contributors.',Ih=function(t){function e(e){var r,n=e||{};r=void 0!==n.attributions?n.attributions:[Ph];var i=void 0!==n.crossOrigin?n.crossOrigin:"anonymous",o=void 0!==n.url?n.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:r,cacheSize:n.cacheSize,crossOrigin:i,opaque:void 0===n.opaque||n.opaque,maxZoom:void 0!==n.maxZoom?n.maxZoom:19,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileLoadFunction:n.tileLoadFunction,url:o,wrapX:n.wrapX,attributionsCollapsible:!1})||this}return Ch(e,t),e}(Cl),bh=r(3),Lh=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Mh=function(t){function e(e){var r=e||{};return t.call(this,r)||this}return Lh(e,t),e}(Bi),Fh=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ah=function(t){function e(e){var r=t.call(this)||this;return r.boundHandleImageChange_=r.handleImageChange_.bind(r),r.layer_=e,r}return Fh(e,t),e.prototype.getFeatures=function(){return n()},e.prototype.prepareFrame=function(){return n()},e.prototype.renderFrame=function(){return n()},e.prototype.loadedTileCallback=function(t,e,r){t[e]||(t[e]={});t[e][r.tileCoord.toString()]=r},e.prototype.createLoadedTileFinder=function(t,e,r){return function(n,i){var o=this.loadedTileCallback.bind(this,r,n);return t.forEachLoadedTile(e,n,i,o)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(){},e.prototype.getDataAtPixel=function(){return n()},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){t.target.getState()===Da.LOADED&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=Da.LOADED&&e!=Da.ERROR&&t.addEventListener(N.CHANGE,this.boundHandleImageChange_),e==Da.IDLE&&(t.load(),e=t.getState()),e==Da.LOADED},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==vi.READY&&t.changed()},e}(G),Nh=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Dh=function(t){function e(e){var r=t.call(this,e)||this;return r.container=null,r.renderedResolution,r.tempTransform_=[1,0,0,1,0,0],r.pixelTransform=[1,0,0,1,0,0],r.inversePixelTransform=[1,0,0,1,0,0],r.context=null,r.containerReused=!1,r.createTransformStringCanvas_=li(1,1).canvas,r}return Nh(e,t),e.prototype.useContainer=function(t,e){var n,i,o=this.getLayer().getClassName();if(t&&""===t.style.opacity&&t.className===o&&(s=t.firstElementChild)instanceof HTMLCanvasElement&&(i=s.getContext("2d")),i&&i.canvas.style.transform===e?(this.container=t,this.context=i,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){(n=document.createElement("div")).className=o;var a=n.style;a.position="absolute";a.width="100%";a.height="100%";var s=(i=li()).canvas;n.appendChild(s);(a=s.style).position="absolute";a.left="0";a.transformOrigin="top left";this.container=n;this.context=i}},e.prototype.clip=function(t,e,r){var n=e.pixelRatio,i=e.size[0]*n/2,o=e.size[1]*n/2,a=e.viewState.rotation,s=Ct(r),u=Pt(r),l=Tt(r),h=Et(r);Ze(e.coordinateToPixelTransform,s);Ze(e.coordinateToPixelTransform,u);Ze(e.coordinateToPixelTransform,l);Ze(e.coordinateToPixelTransform,h);t.save();La(t,-a,i,o);t.beginPath();t.moveTo(s[0]*n,s[1]*n);t.lineTo(u[0]*n,u[1]*n);t.lineTo(l[0]*n,l[1]*n);t.lineTo(h[0]*n,h[1]*n);t.clip();La(t,a,i,o)},e.prototype.clipUnrotated=function(t,e,r){var n=Ct(r),i=Pt(r),o=Tt(r),a=Et(r);Ze(e.coordinateToPixelTransform,n);Ze(e.coordinateToPixelTransform,i);Ze(e.coordinateToPixelTransform,o);Ze(e.coordinateToPixelTransform,a);var s=this.inversePixelTransform;Ze(s,n);Ze(s,i);Ze(s,o);Ze(s,a);t.save();t.beginPath();t.moveTo(Math.round(n[0]),Math.round(n[1]));t.lineTo(Math.round(i[0]),Math.round(i[1]));t.lineTo(Math.round(o[0]),Math.round(o[1]));t.lineTo(Math.round(a[0]),Math.round(a[1]));t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,r){var n=this.getLayer();if(n.hasListener(t)){var i=new $o(t,this.inversePixelTransform,r,e);n.dispatchEvent(i)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(vn,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(mn,t,e)},e.prototype.getRenderTransform=function(t,e,r,n,i,o,a){var s=i/2,u=o/2,l=n/e,h=-l,c=-t[0]+a,p=-t[1];return He(this.tempTransform_,s,u,l,h,-r,c,p)},e.prototype.getDataAtPixel=function(t){var n,i=Ze(this.inversePixelTransform,t.slice()),o=this.context;try{n=o.getImageData(Math.round(i[0]),Math.round(i[1]),1,1).data}catch(t){return"SecurityError"===t.name?new Uint8Array:n}return 0===n[3]?null:n},e.prototype.createTransformString=function(t){return this.createTransformStringCanvas_.style.transform=Je(t),this.createTransformStringCanvas_.style.transform},e}(Ah),Gh=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),jh=function(t){function e(e){var r=t.call(this,e)||this;return r.image_=null,r}return Gh(e,t),e.prototype.getImage=function(){return this.image_?this.image_.getImage():null},e.prototype.prepareFrame=function(t){var e=t.layerStatesArray[t.layerIndex],r=t.pixelRatio,n=t.viewState,i=n.resolution,o=this.getLayer().getSource(),a=t.viewHints,s=t.extent;if(void 0!==e.extent&&(s=Rt(s,Ye(e.extent,n.projection))),!a[Dn]&&!a[Gn]&&!Lt(s)){var u=n.projection,l=o.getImage(s,i,r,u);l&&this.loadImage(l)&&(this.image_=l)}return!!this.image_},e.prototype.renderFrame=function(t,e){var r=this.image_,n=r.getExtent(),i=r.getResolution(),o=r.getPixelRatio(),a=t.layerStatesArray[t.layerIndex],s=t.pixelRatio,u=t.viewState,l=u.center,h=u.resolution,c=t.size,p=s*i/(h*o),f=Math.round(c[0]*s),d=Math.round(c[1]*s),_=u.rotation;if(_){var g=Math.round(Math.sqrt(f*f+d*d));f=g;d=g}He(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/s,1/s,_,-f/2,-d/2);qe(this.inversePixelTransform,this.pixelTransform);var y=this.createTransformString(this.pixelTransform);this.useContainer(e,y,a.opacity);var v=this.context,m=v.canvas;m.width!=f||m.height!=d?(m.width=f,m.height=d):this.containerReused||v.clearRect(0,0,f,d);var E=!1;if(a.extent){var T=Ye(a.extent,u.projection);(E=!it(T,t.extent)&&bt(T,t.extent))&&this.clipUnrotated(v,t,T)}var S=r.getImage(),w=He(this.tempTransform_,f/2,d/2,p,p,0,o*(n[0]-l[0])/i,o*(l[1]-n[3])/i);this.renderedResolution=i*s/o;var x=w[4],O=w[5],R=S.width*w[0],C=S.height*w[3];if(this.preRender(v,t),R>=.5&&C>=.5){var P=a.opacity,I=void 0;1!==P&&(I=this.context.globalAlpha,this.context.globalAlpha=P);this.context.drawImage(S,0,0,+S.width,+S.height,Math.round(x),Math.round(O),Math.round(R),Math.round(C));1!==P&&(this.context.globalAlpha=I)}return this.postRender(v,t),E&&v.restore(),y!==m.style.transform&&(m.style.transform=y),this.container},e}(Dh),kh=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Uh=function(t){function e(e){return t.call(this,e)||this}return kh(e,t),e.prototype.createRenderer=function(){return new jh(this)},e}(Mh),Bh="preload",Yh="useInterimTilesOnError",zh=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Xh=function(t){function e(e){var r=this,n=e||{},i=p({},n);return delete i.preload,delete i.useInterimTilesOnError,(r=t.call(this,i)||this).setPreload(void 0!==n.preload?n.preload:0),r.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),r}return zh(e,t),e.prototype.getPreload=function(){return this.get(Bh)},e.prototype.setPreload=function(t){this.set(Bh,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Yh)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Yh,t)},e}(Bi),Vh=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Wh=function(t){function e(e){var r=t.call(this,e)||this;return r.extentChanged=!0,r.renderedExtent_=null,r.renderedPixelRatio,r.renderedProjection=null,r.renderedRevision,r.renderedTiles=[],r.newTiles_=!1,r.tmpExtent=[1/0,1/0,-1/0,-1/0],r.tmpTileRange_=new hs(0,0,0,0),r}return Vh(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),r=t.getState(),n=e.getUseInterimTilesOnError();return r==wn.LOADED||r==wn.EMPTY||r==wn.ERROR&&!n},e.prototype.getTile=function(t,e,r,n){var i=n.pixelRatio,o=n.viewState.projection,a=this.getLayer(),s=a.getSource().getTile(t,e,r,i,o);return s.getState()==wn.ERROR&&(a.getUseInterimTilesOnError()?a.getPreload()>0&&(this.newTiles_=!0):s.setState(wn.LOADED)),this.isDrawableTile(s)||(s=s.getInterimTile()),s},e.prototype.loadedTileCallback=function(e,r,n){return!!this.isDrawableTile(n)&&t.prototype.loadedTileCallback.call(this,e,r,n)},e.prototype.prepareFrame=function(){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var r=t.layerStatesArray[t.layerIndex],n=t.viewState,i=n.projection,a=n.resolution,s=n.center,u=n.rotation,l=t.pixelRatio,h=this.getLayer(),c=h.getSource(),p=c.getRevision(),f=c.getTileGridForProjection(i),d=f.getZForResolution(a,c.zDirection),_=f.getResolution(d),g=t.extent,y=r.extent&&Ye(r.extent,i);y&&(g=Rt(g,Ye(r.extent,i)));var v=c.getTilePixelRatio(l),m=Math.round(t.size[0]*v),T=Math.round(t.size[1]*v);if(u){var S=Math.round(Math.sqrt(m*m+T*T));m=S;T=S}var w=_*m/2/v,x=_*T/2/v,O=[s[0]-w,s[1]-x,s[0]+w,s[1]+x],R=f.getTileRangeForExtentAndZ(g,d),C={};C[d]={};var P=this.createLoadedTileFinder(c,i,C),I=this.tmpExtent,b=this.tmpTileRange_;this.newTiles_=!1;for(var L=R.minX;L<=R.maxX;++L)for(var M=R.minY;M<=R.maxY;++M){var F=this.getTile(d,L,M,t);if(this.isDrawableTile(F)){var A=o(this);if(F.getState()==wn.LOADED){C[d][F.tileCoord.toString()]=F;var N=F.inTransition(A);this.newTiles_||!N&&-1!==this.renderedTiles.indexOf(F)||(this.newTiles_=!0)}if(1===F.getAlpha(A,t.time))continue}var D=f.getTileCoordChildTileRange(F.tileCoord,b,I),G=!1;D&&(G=P(d+1,D));G||f.forEachTileCoordParentTileRange(F.tileCoord,P,b,I)}var j=_/a;He(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/v,1/v,u,-m/2,-T/2);var k=this.createTransformString(this.pixelTransform);this.useContainer(e,k,r.opacity);var U=this.context,B=U.canvas;qe(this.inversePixelTransform,this.pixelTransform);He(this.tempTransform_,m/2,T/2,j,j,0,-m/2,-T/2);B.width!=m||B.height!=T?(B.width=m,B.height=T):this.containerReused||U.clearRect(0,0,m,T);y&&this.clipUnrotated(U,t,y);this.preRender(U,t);this.renderedTiles.length=0;var Y,z,X,V=Object.keys(C).map(Number);V.sort(E);1!==r.opacity||this.containerReused&&!c.getOpaque(t.viewState.projection)?(Y=[],z=[]):V=V.reverse();for(var W=V.length-1;W>=0;--W){var Z=V[W],K=c.getTilePixelSize(Z,l,i),H=f.getResolution(Z)/_,q=K[0]*H*j,J=K[1]*H*j,Q=f.getTileCoordForCoordAndZ(Ct(O),Z),$=f.getTileCoordExtent(Q),tt=Ze(this.tempTransform_,[v*($[0]-O[0])/_,v*(O[3]-$[3])/_]),et=v*c.getGutterForProjection(i),rt=C[Z];for(var nt in rt){var it=(F=rt[nt]).tileCoord,ot=tt[0]-(Q[1]-it[1])*q,at=Math.round(ot+q),st=tt[1]-(Q[2]-it[2])*J,ut=Math.round(st+J),lt=at-(L=Math.round(ot)),ht=ut-(M=Math.round(st)),ct=d===Z;if(!(N=ct&&1!==F.getAlpha(o(this),t.time)))if(Y){U.save();X=[L,M,L+lt,M,L+lt,M+ht,L,M+ht];for(var ft=0,dt=Y.length;ft<dt;++ft)if(d!==Z&&Z<z[ft]){var _t=Y[ft];U.beginPath();U.moveTo(X[0],X[1]);U.lineTo(X[2],X[3]);U.lineTo(X[4],X[5]);U.lineTo(X[6],X[7]);U.moveTo(_t[6],_t[7]);U.lineTo(_t[4],_t[5]);U.lineTo(_t[2],_t[3]);U.lineTo(_t[0],_t[1]);U.clip()}Y.push(X);z.push(Z)}else U.clearRect(L,M,lt,ht);this.drawTileImage(F,t,L,M,lt,ht,et,ct,r.opacity);Y&&!N&&U.restore();this.renderedTiles.push(F);this.updateUsedTiles(t.usedTiles,c,F)}}return this.renderedRevision=p,this.renderedResolution=_,this.extentChanged=!this.renderedExtent_||!pt(this.renderedExtent_,O),this.renderedExtent_=O,this.renderedPixelRatio=l,this.renderedProjection=i,this.manageTilePyramid(t,c,f,l,i,g,d,h.getPreload()),this.updateCacheSize_(t,c),this.scheduleExpireCache(t,c),this.postRender(U,t),r.extent&&U.restore(),k!==B.style.transform&&(B.style.transform=k),this.container},e.prototype.drawTileImage=function(t,e,r,n,i,a,s,u,l){var h=this.getTileImage(t);if(h){var c=o(this),p=u?t.getAlpha(c,e.time):1,f=l*p,d=f!==this.context.globalAlpha;d&&(this.context.save(),this.context.globalAlpha=f);this.context.drawImage(h,s,s,h.width-2*s,h.height-2*s,r,n,i,a);d&&this.context.restore();1!==p?e.animate=!0:u&&t.endTransition(c)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getTileImage=function(t){return t.getImage()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var r=function(t,e,r){var n=o(t);n in r.usedTiles&&t.expireCache(r.viewState.projection,r.usedTiles[n])}.bind(null,e);t.postRenderFunctions.push(r)}},e.prototype.updateUsedTiles=function(t,e,r){var n=o(e);n in t||(t[n]={});t[n][r.getKey()]=!0},e.prototype.updateCacheSize_=function(t,e){var r=o(e),n=0;r in t.usedTiles&&(n+=Object.keys(t.usedTiles[r]).length);r in t.wantedTiles&&(n+=Object.keys(t.wantedTiles[r]).length);var i=e.tileCache;i.highWaterMark<n&&(i.highWaterMark=n)},e.prototype.manageTilePyramid=function(t,e,r,n,i,a,s,u,l){var h=o(e);h in t.wantedTiles||(t.wantedTiles[h]={});for(var c,p,f,d,_,y=t.wantedTiles[h],v=t.tileQueue,g=r.getMinZoom();g<=s;++g)for(p=r.getTileRangeForExtentAndZ(a,g,p),f=r.getResolution(g),d=p.minX;d<=p.maxX;++d)for(_=p.minY;_<=p.maxY;++_)s-g<=u?((c=e.getTile(g,d,_,n,i)).getState()==wn.IDLE&&(y[c.getKey()]=!0,v.isKeyQueued(c.getKey())||v.enqueue([c,h,r.getTileCoordCenter(c.tileCoord),f])),void 0!==l&&l(c)):e.useTile(g,d,_,i)},e}(Dh);Wh.prototype.getLayer;var Zh=Wh,Kh=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Hh=function(t){function e(e){return t.call(this,e)||this}return Kh(e,t),e.prototype.createRenderer=function(){return new Zh(this)},e}(Xh),qh=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Jh="beforeoperations",Qh="afteroperations",$h={PIXEL:"pixel",IMAGE:"image"},tc=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.extent=r.extent,i.resolution=r.viewState.resolution/r.pixelRatio,i.data=n,i}return qh(e,t),e}(M),ec=function(t){function e(e){var r=t.call(this,{projection:null})||this;r.worker_=null;r.operationType_=void 0!==e.operationType?e.operationType:$h.PIXEL;r.threads_=void 0!==e.threads?e.threads:1;r.layers_=function(t){for(var e=t.length,r=new Array(e),n=0;n<e;++n)r[n]=ic(t[n]);return r}(e.sources);for(var n,i=r.changed.bind(r),o=0,a=r.layers_.length;o<a;++o)r.layers_[o].addEventListener(N.CHANGE,i);return r.tileQueue_=new Rn(function(){return 1},r.changed.bind(r)),r.requestedFrameState_,r.renderedImageCanvas_=null,r.renderedRevision_,r.frameState_={animate:!1,coordinateToPixelTransform:[1,0,0,1,0,0],extent:null,index:0,layerIndex:0,layerStatesArray:(n=r.layers_,n.map(function(t){return t.getLayerState()})),pixelRatio:1,pixelToCoordinateTransform:[1,0,0,1,0,0],postRenderFunctions:[],size:[0,0],tileQueue:r.tileQueue_,time:Date.now(),usedTiles:{},viewState:{rotation:0},viewHints:[],wantedTiles:{},declutterItems:[]},r.setAttributions(function(t){for(var r=[],n=0,i=e.sources.length;n<i;++n){var o=e.sources[n],a=(o instanceof cl?o:o.getSource()).getAttributions();if("function"==typeof a){var s=a(t);r.push.apply(r,s)}}return 0!==r.length?r:null}),void 0!==e.operation&&r.setOperation(e.operation,e.lib),r}return qh(e,t),e.prototype.setOperation=function(t,e){this.worker_=new bh.Processor({operation:t,imageOps:this.operationType_===$h.IMAGE,queue:1,lib:e,threads:this.threads_});this.changed()},e.prototype.updateFrameState_=function(t,e,r){var n=p({},this.frameState_);n.viewState=p({},n.viewState);var i=St(t);n.extent=t.slice();n.size[0]=Math.round(It(t)/e);n.size[1]=Math.round(Ot(t)/e);n.time=1/0;var o=n.viewState;return o.center=i,o.projection=r,o.resolution=e,n},e.prototype.allSourcesReady_=function(){for(var t=!0,e=0,r=this.layers_.length;e<r;++e)if(this.layers_[e].getSource().getState()!==vi.READY){t=!1;break}return t},e.prototype.getImage=function(t,e,r,n){if(!this.allSourcesReady_())return null;var i=this.updateFrameState_(t,e,n);if(this.requestedFrameState_=i,this.renderedImageCanvas_){var o=this.renderedImageCanvas_.getResolution(),a=this.renderedImageCanvas_.getExtent();e===o&&pt(t,a)||(this.renderedImageCanvas_=null)}return this.renderedImageCanvas_&&this.getRevision()===this.renderedRevision_||this.processSources_(),i.tileQueue.loadMoreTiles(16,16),i.animate&&requestAnimationFrame(this.changed.bind(this)),this.renderedImageCanvas_},e.prototype.processSources_=function(){for(var t=this.requestedFrameState_,e=this.layers_.length,r=new Array(e),n=0;n<e;++n){t.layerIndex=n;var i=nc(this.layers_[n],t);if(!i)return;r[n]=i}var o={};this.dispatchEvent(new tc(Jh,t,o));this.worker_.process(r,o,this.onWorkerComplete_.bind(this,t))},e.prototype.onWorkerComplete_=function(t,e,r,n){if(!e&&r){var i=t.extent,o=t.viewState.resolution;if(o===this.requestedFrameState_.viewState.resolution&&pt(i,this.requestedFrameState_.extent)){var a;this.renderedImageCanvas_?a=this.renderedImageCanvas_.getImage().getContext("2d"):(a=li(Math.round(It(i)/o),Math.round(Ot(i)/o)),this.renderedImageCanvas_=new ph(i,o,1,a.canvas));a.putImageData(r,0,0);this.changed();this.renderedRevision_=this.getRevision();this.dispatchEvent(new tc(Qh,t,n))}}},e.prototype.getImageInternal=function(){return null},e}(sh),rc=null;function nc(t,e){var r=t.getRenderer();if(!r)throw new Error("Unsupported layer type: "+t);if(!r.prepareFrame(e))return null;var n,i=e.size[0],o=e.size[1],a=r.renderFrame(e,null);if(a&&(n=a.firstElementChild),!(n instanceof HTMLCanvasElement))throw new Error("Unsupported rendered element: "+n);if(n.width===i&&n.height===o)return n.getContext("2d").getImageData(0,0,i,o);if(rc){var s=rc.canvas;s.width!==i||s.height!==o?rc=li(i,o):rc.clearRect(0,0,i,o)}else rc=li(i,o);return rc.drawImage(n,0,0,i,o),rc.getImageData(0,0,i,o)}function ic(t){var e;return t instanceof cl?t instanceof _l?e=new Hh({source:t}):t instanceof sh&&(e=new Uh({source:t})):e=t,e}var oc=ec,ac=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),sc=['Map tiles by <a href="https://stamen.com/" target="_blank">Stamen Design<\/a>, under <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC BY 3.0<\/a>.',Ph],uc={terrain:{extension:"jpg",opaque:!0},"terrain-background":{extension:"jpg",opaque:!0},"terrain-labels":{extension:"png",opaque:!1},"terrain-lines":{extension:"png",opaque:!1},"toner-background":{extension:"png",opaque:!0},toner:{extension:"png",opaque:!0},"toner-hybrid":{extension:"png",opaque:!1},"toner-labels":{extension:"png",opaque:!1},"toner-lines":{extension:"png",opaque:!1},"toner-lite":{extension:"png",opaque:!0},watercolor:{extension:"jpg",opaque:!0}},lc={terrain:{minZoom:0,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:0,maxZoom:18}},hc=function(t){function e(e){var r=e.layer.indexOf("-"),n=-1==r?e.layer:e.layer.slice(0,r),i=lc[n],o=uc[e.layer],a=void 0!==e.url?e.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+e.layer+"/{z}/{x}/{y}."+o.extension;return t.call(this,{attributions:sc,cacheSize:e.cacheSize,crossOrigin:"anonymous",maxZoom:null!=e.maxZoom?e.maxZoom:i.maxZoom,minZoom:null!=e.minZoom?e.minZoom:i.minZoom,opaque:o.opaque,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:a,wrapX:e.wrapX})||this}return ac(e,t),e}(Cl),cc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function pc(t,e,r){var n=this.getTileGrid();if(n||(n=this.getTileGridForProjection(r)),!(n.getResolutions().length<=t[0])){1==e||this.hidpi_||(e=1);var i=n.getTileCoordExtent(t,this.tmpExtent_),o=xi(n.getTileSize(t[0]),this.tmpSize);1!=e&&(o=wi(o,e,this.tmpSize));var a={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};return p(a,this.params_),this.getRequestUrl_(t,o,i,e,r,a)}}var fc=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,projection:n.projection,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileGrid:n.tileGrid,tileLoadFunction:n.tileLoadFunction,tileUrlFunction:pc,url:n.url,urls:n.urls,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition})||this).params_=n.params||{},r.hidpi_=void 0===n.hidpi||n.hidpi,r.tmpExtent_=[1/0,1/0,-1/0,-1/0],r.setKey(r.getKeyForParams_()),r}return cc(e,t),e.prototype.getKeyForParams_=function(){var t=0,e=[];for(var r in this.params_)e[t++]=r+"-"+this.params_[r];return e.join("/")},e.prototype.getParams=function(){return this.params_},e.prototype.getRequestUrl_=function(t,e,r,n,i,o){var a=this.urls;if(a){var s,u=i.getCode().split(":").pop();return s=(o.SIZE=e[0]+","+e[1],o.BBOX=r.join(","),o.BBOXSR=u,o.IMAGESR=u,o.DPI=Math.round(o.DPI?o.DPI*n:90*n),1==a.length)?a[0]:a[Vt(ds(t),a.length)],uh(s.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage"),o)}},e.prototype.getTilePixelRatio=function(t){return this.hidpi_?t:1},e.prototype.updateParams=function(t){p(this.params_,t);this.setKey(this.getKeyForParams_())},e}(wl),dc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),_c=function(t){function e(e,r,n){var i=t.call(this,e,wn.LOADED)||this;return i.tileSize_=r,i.text_=n,i.canvas_=null,i}return dc(e,t),e.prototype.getImage=function(){if(this.canvas_)return this.canvas_;var t=this.tileSize_,e=li(t[0],t[1]);return e.strokeStyle="grey",e.strokeRect(.5,.5,t[0]+.5,t[1]+.5),e.fillStyle="grey",e.strokeStyle="white",e.textAlign="center",e.textBaseline="middle",e.font="24px sans-serif",e.lineWidth=4,e.strokeText(this.text_,t[0]/2,t[1]/2,t[0]),e.fillText(this.text_,t[0]/2,t[1]/2,t[0]),this.canvas_=e.canvas,e.canvas},e.prototype.load=function(){},e}(qu),gc=function(t){function e(e){var r=e||{};return t.call(this,{opaque:!1,projection:r.projection,tileGrid:r.tileGrid,wrapX:void 0===r.wrapX||r.wrapX,zDirection:r.zDirection})||this}return dc(e,t),e.prototype.getTile=function(t,e,r){var n=ps(t,e,r);if(this.tileCache.containsKey(n))return this.tileCache.get(n);var i=xi(this.tileGrid.getTileSize(t)),o=[t,e,r],a=this.getTileCoordForTileUrlFunction(o),s=a?"z:"+a[0]+" x:"+a[1]+" y:"+a[2]:"none";var u=new _c(o,i,s);return this.tileCache.set(n,u),u},e}(Cl),yc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),vc=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,projection:we("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:vi.LOADING,tileLoadFunction:e.tileLoadFunction,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition})||this;if(r.tileJSON_=null,r.tileSize_=e.tileSize,e.url)if(e.jsonp)Zu(e.url,r.handleTileJSONResponse.bind(r),r.handleTileJSONError.bind(r));else{var n=new XMLHttpRequest;n.addEventListener("load",r.onXHRLoad_.bind(r));n.addEventListener("error",r.onXHRError_.bind(r));n.open("GET",e.url);n.send()}else e.tileJSON?r.handleTileJSONResponse(e.tileJSON):K(!1,51);return r}return yc(e,t),e.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||e.status>=200&&e.status<300){var r=void 0;try{r=JSON.parse(e.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(r)}else this.handleTileJSONError()},e.prototype.onXHRError_=function(){this.handleTileJSONError()},e.prototype.getTileJSON=function(){return this.tileJSON_},e.prototype.handleTileJSONResponse=function(t){var e,r=we("EPSG:4326"),n=this.getProjection();if(void 0!==t.bounds){var i=be(r,n);e=Ft(t.bounds,i)}var o=t.minzoom||0,a=t.maxzoom||22,s=vs({extent:Ts(n),maxZoom:a,minZoom:o,tileSize:this.tileSize_});if(this.tileGrid=s,this.tileUrlFunction=zu(t.tiles,s),void 0!==t.attribution&&!this.getAttributions()){var u=void 0!==e?e:r.getExtent();this.setAttributions(function(e){return bt(u,e.extent)?[t.attribution]:null})}this.tileJSON_=t;this.setState(vi.READY)},e.prototype.handleTileJSONError=function(){this.setState(vi.ERROR)},e}(wl),mc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Ec(t,e,r){var n=this.getTileGrid();if(n||(n=this.getTileGridForProjection(r)),!(n.getResolutions().length<=t[0])){1==e||this.hidpi_&&void 0!==this.serverType_||(e=1);var i=n.getResolution(t[0]),o=n.getTileCoordExtent(t,this.tmpExtent_),a=xi(n.getTileSize(t[0]),this.tmpSize),s=this.gutter_;0!==s&&(a=Si(a,s,this.tmpSize),o=tt(o,i*s,o));1!=e&&(a=wi(a,e,this.tmpSize));var u={SERVICE:"WMS",VERSION:mh,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return p(u,this.params_),this.getRequestUrl_(t,a,o,e,r,u)}}var Tc=function(t){function e(e){var r=this,n=e||{},i=n.params||{},o=!("TRANSPARENT"in i)||i.TRANSPARENT;return(r=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,opaque:!o,projection:n.projection,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileClass:n.tileClass,tileGrid:n.tileGrid,tileLoadFunction:n.tileLoadFunction,tileUrlFunction:Ec,url:n.url,urls:n.urls,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition})||this).gutter_=void 0!==n.gutter?n.gutter:0,r.params_=i,r.v13_=!0,r.serverType_=n.serverType,r.hidpi_=void 0===n.hidpi||n.hidpi,r.tmpExtent_=[1/0,1/0,-1/0,-1/0],r.updateV13_(),r.setKey(r.getKeyForParams_()),r}return mc(e,t),e.prototype.getFeatureInfoUrl=function(t,e,r,n){var i=we(r),o=this.getProjection(),a=this.getTileGrid();a||(a=this.getTileGridForProjection(i));var s=a.getZForResolution(e,this.zDirection),u=a.getTileCoordForCoordAndZ(t,s);if(!(a.getResolutions().length<=u[0])){var l=a.getResolution(u[0]),h=a.getTileCoordExtent(u,this.tmpExtent_),c=xi(a.getTileSize(u[0]),this.tmpSize),f=this.gutter_;0!==f&&(c=Si(c,f,this.tmpSize),h=tt(h,l*f,h));o&&o!==i&&(l=rl(o,i,t,l),h=Fe(h,i,o),t=Me(t,i,o));var d={SERVICE:"WMS",VERSION:mh,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};p(d,this.params_,n);var _=Math.floor((t[0]-h[0])/l),g=Math.floor((h[3]-t[1])/l);return d[this.v13_?"I":"X"]=_,d[this.v13_?"J":"Y"]=g,this.getRequestUrl_(u,c,h,1,o||i,d)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.urls[0]){var r={SERVICE:"WMS",VERSION:mh,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){var n=this.params_.LAYERS;if(!(!Array.isArray(n)||1===n.length))return;r.LAYER=n}if(void 0!==t){var i=this.getProjection()?this.getProjection().getMetersPerUnit():1;r.SCALE=t*i*39.37*(25.4/.28)}return p(r,e),uh(this.urls[0],r)}},e.prototype.getGutter=function(){return this.gutter_},e.prototype.getParams=function(){return this.params_},e.prototype.getRequestUrl_=function(t,e,r,n,i,o){var a=this.urls;if(a){if(o.WIDTH=e[0],o.HEIGHT=e[1],o[this.v13_?"CRS":"SRS"]=i.getCode(),"STYLES"in this.params_||(o.STYLES=""),1!=n)switch(this.serverType_){case Th:var s=90*n+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+s:o.FORMAT_OPTIONS="dpi:"+s;break;case Sh:o.MAP_RESOLUTION=90*n;break;case Eh:case wh:o.DPI=90*n;break;default:K(!1,52)}var u,l=i.getAxisOrientation(),h=r;if(this.v13_&&"ne"==l.substr(0,2)){var c=void 0;c=r[0];h[0]=r[1];h[1]=c;c=r[2];h[2]=r[3];h[3]=c}return u=(o.BBOX=h.join(","),1==a.length)?a[0]:a[Vt(ds(t),a.length)],uh(u,o)}},e.prototype.getTilePixelRatio=function(t){return this.hidpi_&&void 0!==this.serverType_?t:1},e.prototype.getKeyForParams_=function(){var t=0,e=[];for(var r in this.params_)e[t++]=r+"-"+this.params_[r];return e.join("/")},e.prototype.updateParams=function(t){p(this.params_,t);this.updateV13_();this.setKey(this.getKeyForParams_())},e.prototype.updateV13_=function(){var t=this.params_.VERSION||mh;this.v13_=Yn(t,"1.3")>=0},e}(wl),Sc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wc=function(t){function e(e,r,n,i,o,a){var s=t.call(this,e,r)||this;return s.src_=n,s.extent_=i,s.preemptive_=o,s.grid_=null,s.keys_=null,s.data_=null,s.jsonp_=a,s}return Sc(e,t),e.prototype.getImage=function(){return null},e.prototype.getData=function(t){if(!this.grid_||!this.keys_)return null;var e=(t[0]-this.extent_[0])/(this.extent_[2]-this.extent_[0]),r=(t[1]-this.extent_[1])/(this.extent_[3]-this.extent_[1]),n=this.grid_[Math.floor((1-r)*this.grid_.length)];if("string"!=typeof n)return null;var i=n.charCodeAt(Math.floor(e*n.length));i>=93&&i--;i>=35&&i--;var o=null;if((i-=32)in this.keys_){var a=this.keys_[i];o=this.data_&&a in this.data_?this.data_[a]:a}return o},e.prototype.forDataAtCoordinate=function(t,e,r){this.state==wn.IDLE&&!0===r?(y(this,N.CHANGE,function(){e(this.getData(t))},this),this.loadInternal_()):!0===r?setTimeout(function(){e(this.getData(t))}.bind(this),0):e(this.getData(t))},e.prototype.getKey=function(){return this.src_},e.prototype.handleError_=function(){this.state=wn.ERROR;this.changed()},e.prototype.handleLoad_=function(t){this.grid_=t.grid;this.keys_=t.keys;this.data_=t.data;this.state=wn.EMPTY;this.changed()},e.prototype.loadInternal_=function(){if(this.state==wn.IDLE)if(this.state=wn.LOADING,this.jsonp_)Zu(this.src_,this.handleLoad_.bind(this),this.handleError_.bind(this));else{var t=new XMLHttpRequest;t.addEventListener("load",this.onXHRLoad_.bind(this));t.addEventListener("error",this.onXHRError_.bind(this));t.open("GET",this.src_);t.send()}},e.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||e.status>=200&&e.status<300){var r=void 0;try{r=JSON.parse(e.responseText)}catch(t){return void this.handleError_()}this.handleLoad_(r)}else this.handleError_()},e.prototype.onXHRError_=function(){this.handleError_()},e.prototype.load=function(){this.preemptive_&&this.loadInternal_()},e}(qu),xc=function(t){function e(e){var r=t.call(this,{projection:we("EPSG:3857"),state:vi.LOADING})||this;if(r.preemptive_=void 0===e.preemptive||e.preemptive,r.tileUrlFunction_=Vu,r.template_=void 0,r.jsonp_=e.jsonp||!1,e.url)if(r.jsonp_)Zu(e.url,r.handleTileJSONResponse.bind(r),r.handleTileJSONError.bind(r));else{var n=new XMLHttpRequest;n.addEventListener("load",r.onXHRLoad_.bind(r));n.addEventListener("error",r.onXHRError_.bind(r));n.open("GET",e.url);n.send()}else e.tileJSON?r.handleTileJSONResponse(e.tileJSON):K(!1,51);return r}return Sc(e,t),e.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||e.status>=200&&e.status<300){var r=void 0;try{r=JSON.parse(e.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(r)}else this.handleTileJSONError()},e.prototype.onXHRError_=function(){this.handleTileJSONError()},e.prototype.getTemplate=function(){return this.template_},e.prototype.forDataAtCoordinateAndResolution=function(t,e,r,n){if(this.tileGrid){var i=this.tileGrid.getZForResolution(e,this.zDirection),o=this.tileGrid.getTileCoordForCoordAndZ(t,i);this.getTile(o[0],o[1],o[2],1,this.getProjection()).forDataAtCoordinate(t,r,n)}else!0===n?setTimeout(function(){r(null)},0):r(null)},e.prototype.handleTileJSONError=function(){this.setState(vi.ERROR)},e.prototype.handleTileJSONResponse=function(t){var e,r=we("EPSG:4326"),n=this.getProjection();if(void 0!==t.bounds){var i=be(r,n);e=Ft(t.bounds,i)}var o=t.minzoom||0,a=t.maxzoom||22,s=vs({extent:Ts(n),maxZoom:a,minZoom:o});this.tileGrid=s;this.template_=t.template;var u=t.grids;if(u){if(this.tileUrlFunction_=zu(u,s),void 0!==t.attribution){var l=void 0!==e?e:r.getExtent();this.setAttributions(function(e){return bt(l,e.extent)?[t.attribution]:null})}this.setState(vi.READY)}else this.setState(vi.ERROR)},e.prototype.getTile=function(t,e,r,n,i){var o=ps(t,e,r);if(this.tileCache.containsKey(o))return this.tileCache.get(o);var a=[t,e,r],s=this.getTileCoordForTileUrlFunction(a,i),u=this.tileUrlFunction_(s,n,i),l=new wc(a,void 0!==u?wn.IDLE:wn.EMPTY,void 0!==u?u:"",this.tileGrid.getTileCoordExtent(a),this.preemptive_,this.jsonp_);return this.tileCache.set(o,l),l},e.prototype.useTile=function(t,e,r){var n=ps(t,e,r);this.tileCache.containsKey(n)&&this.tileCache.get(n)},e}(_l),Oc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Rc=function(t){function e(e,r,n,i,o,a){var s=t.call(this,e,r,{transition:0})||this;return s.context_={},s.executorGroups={},s.loadingSourceTiles=0,s.errorSourceTileKeys={},s.hitDetectionImageData=null,s.replayState_={},s.wantedResolution,s.getSourceTiles=o.bind(s,s),s.removeSourceTiles_=a,s.sourceTileGrid_=i,s.sourceTileListenerKeys=[],s.sourceZ=-1,s.hifi=!1,s.wrappedTileCoord=n,s}return Oc(e,t),e.prototype.disposeInternal=function(){for(var e in this.sourceTileListenerKeys.forEach(v),this.sourceTileListenerKeys.length=0,this.removeSourceTiles_(this),this.context_){var r=this.context_[e].canvas;r.width=0;r.height=0}for(var e in this.executorGroups)for(var n=this.executorGroups[e],i=0,o=n.length;i<o;++i)n[i].disposeInternal();t.prototype.disposeInternal.call(this)},e.prototype.getContext=function(t){var e=o(t);return e in this.context_||(this.context_[e]=li()),this.context_[e]},e.prototype.hasContext=function(t){return o(t)in this.context_},e.prototype.getImage=function(t){return this.hasContext(t)?this.getContext(t).canvas:null},e.prototype.getReplayState=function(t){var e=o(t);return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedZ:-1,renderedTileZ:-1}),this.replayState_[e]},e.prototype.load=function(){this.getSourceTiles()},e}(qu),Cc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Pc=function(t){function e(e,r,n,i,o,a){var s=t.call(this,e,r,a)||this;return s.consumers=0,s.extent=null,s.format_=i,s.features_=null,s.loader_,s.projection=null,s.resolution,s.tileLoadFunction_=o,s.url_=n,s}return Cc(e,t),e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.getKey=function(){return this.url_},e.prototype.load=function(){this.state==wn.IDLE&&(this.setState(wn.LOADING),this.tileLoadFunction_(this,this.url_),this.loader_(this.extent,this.resolution,this.projection))},e.prototype.onLoad=function(t){this.setFeatures(t)},e.prototype.onError=function(){this.setState(wn.ERROR)},e.prototype.setFeatures=function(t){this.features_=t;this.setState(wn.LOADED)},e.prototype.setLoader=function(t){this.loader_=t},e}(qu),Ic=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),bc=function(t){function e(e){var r=this,n=e.projection||"EPSG:3857",i=e.extent||Ts(n),o=e.tileGrid||vs({extent:i,maxZoom:void 0!==e.maxZoom?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});return(r=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,opaque:!1,projection:n,state:e.state,tileGrid:o,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Lc,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:void 0===e.zDirection?1:e.zDirection})||this).format_=e.format?e.format:null,r.loadingTiles_={},r.sourceTileByCoordKey_={},r.sourceTilesByTileKey_={},r.overlaps_=null==e.overlaps||e.overlaps,r.tileClass=e.tileClass?e.tileClass:Pc,r.tileGrids_={},r}return Ic(e,t),e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.clear=function(){this.tileCache.clear();this.sourceTileByCoordKey_={};this.sourceTilesByTileKey_={}},e.prototype.getSourceTiles=function(t,e,r){var n=r.wrappedTileCoord,i=this.getTileGridForProjection(e),o=i.getTileCoordExtent(n),a=n[0],s=i.getResolution(a);tt(o,-s,o);var u=this.tileGrid,l=u.getExtent();l&&Rt(o,l,o);var h,c,p,f=u.getZForResolution(s,1),d=u.getMinZoom(),_=this.sourceTilesByTileKey_[r.getKey()];if(_&&_.length>0&&_[0].tileCoord[0]===f)h=_,c=!0,p=f;else{h=[];p=f+1;do--p,c=!0,u.forEachTileCoord(o,p,function(n){var i,o=fs(n);if(o in this.sourceTileByCoordKey_){var a=(i=this.sourceTileByCoordKey_[o]).getState();if(a===wn.LOADED||a===wn.ERROR||a===wn.EMPTY)return void h.push(i)}else if(p===f){var s=this.tileUrlFunction(n,t,e);void 0!==s&&((i=new this.tileClass(n,wn.IDLE,s,this.format_,this.tileLoadFunction)).extent=u.getTileCoordExtent(n),i.projection=e,i.resolution=u.getResolution(n[0]),this.sourceTileByCoordKey_[o]=i,i.addEventListener(N.CHANGE,this.handleTileChange.bind(this)),i.load())}if(c=!1,i&&i.getState()!==wn.EMPTY&&r.getState()===wn.IDLE){r.loadingSourceTiles++;var l=g(i,N.CHANGE,function(){var t,e,n,o=i.getState(),a=i.getKey();if(o===wn.LOADED||o===wn.ERROR){o===wn.LOADED?(t=r.sourceTileListenerKeys,e=l,n=t.indexOf(e),n>-1&&t.splice(n,1),v(l),r.loadingSourceTiles--,delete r.errorSourceTileKeys[a]):o===wn.ERROR&&(r.errorSourceTileKeys[a]=!0);var s=Object.keys(r.errorSourceTileKeys).length;r.loadingSourceTiles-s==0&&(r.hifi=0===s,r.sourceZ=f,r.setState(wn.LOADED))}});r.sourceTileListenerKeys.push(l)}}.bind(this)),c||(h.length=0);while(!c&&p>d)}return r.getState()===wn.IDLE&&r.setState(wn.LOADING),c&&(r.hifi=f===p,r.sourceZ=p,r.getState()<wn.LOADED?r.setState(wn.LOADED):_&&R(h,_)||(this.removeSourceTiles(r),this.addSourceTiles(r,h))),h},e.prototype.addSourceTiles=function(t,e){this.sourceTilesByTileKey_[t.getKey()]=e;for(var r=0,n=e.length;r<n;++r)e[r].consumers++},e.prototype.removeSourceTiles=function(t){var e=t.getKey();if(e in this.sourceTilesByTileKey_)for(var r=this.sourceTilesByTileKey_[e],n=0,i=r.length;n<i;++n){var o=r[n];o.consumers--;0===o.consumers&&(o.dispose(),delete this.sourceTileByCoordKey_[fs(o.tileCoord)])}delete this.sourceTilesByTileKey_[e]},e.prototype.getTile=function(t,e,r,n,i){var o,a=ps(t,e,r),s=this.getKey();if(this.tileCache.containsKey(a)&&(o=this.tileCache.get(a)).key===s)return o;var u=[t,e,r],l=this.getTileCoordForTileUrlFunction(u,i),h=this.getTileGrid().getExtent(),c=this.getTileGridForProjection(i);if(l&&h){var p=c.getTileCoordExtent(l);tt(p,-c.getResolution(t),p);bt(h,p)||(l=null)}var f=!0;if(null!==l){var d=this.tileGrid,_=c.getResolution(t),g=d.getZForResolution(_,1),y=c.getTileCoordExtent(l);tt(y,-_,y);d.forEachTileCoord(y,g,function(t){f=f&&!this.tileUrlFunction(t,n,i)}.bind(this))}var v=new Rc(u,f?wn.EMPTY:wn.IDLE,l,this.tileGrid,this.getSourceTiles.bind(this,n,i),this.removeSourceTiles.bind(this));return v.key=s,o?(v.interimTile=o,v.refreshInterimChain(),this.tileCache.replace(a,v)):this.tileCache.set(a,v),v},e.prototype.getTileGridForProjection=function(t){var e=t.getCode(),r=this.tileGrids_[e];if(!r){var n=this.tileGrid;r=Es(t,void 0,n?n.getTileSize(n.getMinZoom()):void 0);this.tileGrids_[e]=r}return r},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.getTilePixelSize=function(t,e,r){var n=xi(this.getTileGridForProjection(r).getTileSize(t),this.tmpSize);return[Math.round(n[0]*e),Math.round(n[1]*e)]},e}(El);function Lc(t,e){var r=is(e,t.getFormat(),t.onLoad.bind(t),t.onError.bind(t));t.setLoader(r)}var Mc={KVP:"KVP",REST:"REST"},Fc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ac=function(t){function e(e){var r=this,n=void 0!==e.requestEncoding?e.requestEncoding:Mc.KVP,i=e.tileGrid,o=e.urls;return void 0===o&&void 0!==e.url&&(o=Wu(e.url)),(r=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,projection:e.projection,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileClass:e.tileClass,tileGrid:i,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:Vu,urls:o,wrapX:void 0!==e.wrapX&&e.wrapX,transition:e.transition})||this).version_=void 0!==e.version?e.version:"1.0.0",r.format_=void 0!==e.format?e.format:"image/jpeg",r.dimensions_=void 0!==e.dimensions?e.dimensions:{},r.layer_=e.layer,r.matrixSet_=e.matrixSet,r.style_=e.style,r.requestEncoding_=n,r.setKey(r.getKeyForDimensions_()),o&&o.length>0&&(r.tileUrlFunction=Xu(o.map(Nc.bind(r)))),r}return Fc(e,t),e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.setTileUrlFunction(Xu(t.map(Nc.bind(this))),e)},e.prototype.getDimensions=function(){return this.dimensions_},e.prototype.getFormat=function(){return this.format_},e.prototype.getLayer=function(){return this.layer_},e.prototype.getMatrixSet=function(){return this.matrixSet_},e.prototype.getRequestEncoding=function(){return this.requestEncoding_},e.prototype.getStyle=function(){return this.style_},e.prototype.getVersion=function(){return this.version_},e.prototype.getKeyForDimensions_=function(){var t=0,e=[];for(var r in this.dimensions_)e[t++]=r+"-"+this.dimensions_[r];return e.join("/")},e.prototype.updateDimensions=function(t){p(this.dimensions_,t);this.setKey(this.getKeyForDimensions_())},e}(wl);function Nc(t){var e=this.requestEncoding_,r={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};e==Mc.KVP&&p(r,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_});t=e==Mc.KVP?uh(t,r):t.replace(/\{(\w+?)\}/g,function(t,e){return e.toLowerCase()in r?r[e.toLowerCase()]:t});var n=this.tileGrid,i=this.dimensions_;return function(r){if(r){var s={TileMatrix:n.getMatrixId(r[0]),TileCol:r[1],TileRow:r[2]};p(s,i);var u=t;return e==Mc.KVP?uh(u,s):u.replace(/\{(\w+?)\}/g,function(t,e){return s[e]})}}}var Dc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Gc={GENERATE_BUFFERS:"GENERATE_BUFFERS"},jc=function(t){function e(e,r){var n=t.call(this,e)||this,i=r||{};return n.helper=new uu({postProcesses:i.postProcesses,uniforms:i.uniforms}),n}return Dc(e,t),e.prototype.disposeInternal=function(){this.helper.dispose();t.prototype.disposeInternal.call(this)},e.prototype.getShaderCompileErrors=function(){return this.helper.getShaderCompileErrors()},e}(Ah),kc=jc,Uc=new Blob(['var e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,o=arguments.length;r<o;++r){var i=arguments[r];if(null!=i)for(var f in i)i.hasOwnProperty(f)&&(t[f]=i[f])}return t},n="GENERATE_BUFFERS",t=[],r={vertexPosition:0,indexPosition:0};function o(e,n,t,r,o){e[n+0]=t,e[n+1]=r,e[n+2]=o}function i(e,n,i,f,s,u){var a=3+s,l=e[n+0],v=e[n+1],c=t;c.length=s;for(var g=0;g<c.length;g++)c[g]=e[n+2+g];var b=u?u.vertexPosition:0,h=u?u.indexPosition:0,d=b/a;return o(i,b,l,v,0),c.length&&i.set(c,b+3),o(i,b+=a,l,v,1),c.length&&i.set(c,b+3),o(i,b+=a,l,v,2),c.length&&i.set(c,b+3),o(i,b+=a,l,v,3),c.length&&i.set(c,b+3),b+=a,f[h++]=d,f[h++]=d+1,f[h++]=d+3,f[h++]=d+1,f[h++]=d+2,f[h++]=d+3,r.vertexPosition=b,r.indexPosition=h,r}var f=self;f.onmessage=function(t){var r=t.data;if(r.type===n){for(var o=r.customAttributesCount,s=2+o,u=new Float32Array(r.renderInstructions),a=u.length/s,l=4*a*(o+3),v=new Uint32Array(6*a),c=new Float32Array(l),g=null,b=0;b<u.length;b+=s)g=i(u,b,c,v,o,g);var h=e({vertexBuffer:c.buffer,indexBuffer:v.buffer,renderInstructions:u.buffer},r);f.postMessage(h,[c.buffer,v.buffer,u.buffer])}};'],{type:"application/javascript"}),Bc=URL.createObjectURL(Uc),Yc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),zc="renderOrder",Xc=function(t){function e(e){var r=this,n=e||{},i=p({},n);return delete i.style,delete i.renderBuffer,delete i.updateWhileAnimating,delete i.updateWhileInteracting,(r=t.call(this,i)||this).declutter_=void 0!==n.declutter&&n.declutter,r.renderBuffer_=void 0!==n.renderBuffer?n.renderBuffer:100,r.style_=null,r.styleFunction_=void 0,r.setStyle(n.style),r.updateWhileAnimating_=void 0!==n.updateWhileAnimating&&n.updateWhileAnimating,r.updateWhileInteracting_=void 0!==n.updateWhileInteracting&&n.updateWhileInteracting,r}return Yc(e,t),e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(zc)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.setRenderOrder=function(t){this.set(zc,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:Nu;this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var r;Array.isArray(t)?r=t:(K("function"==typeof t.getZIndex,41),r=[t]);e=function(){return r}}return e}(this.style_);this.changed()},e}(Bi),Vc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Wc=function(t){function e(e,r){var n=this,i=r.uniforms||{},a=[1,0,0,1,0,0];if(i[iu.PROJECTION_MATRIX]=a,(n=t.call(this,e,{uniforms:i,postProcesses:r.postProcesses})||this).sourceRevision_=-1,n.verticesBuffer_=new Js(ws,Os),n.hitVerticesBuffer_=new Js(ws,Os),n.indicesBuffer_=new Js(xs,Os),n.program_=n.helper.getProgram(r.fragmentShader,r.vertexShader),n.getShaderCompileErrors())throw new Error(n.getShaderCompileErrors());if(n.hitDetectionEnabled_=!(!r.hitFragmentShader||!r.hitVertexShader),n.hitProgram_=n.hitDetectionEnabled_&&n.helper.getProgram(r.hitFragmentShader,r.hitVertexShader),n.getShaderCompileErrors())throw new Error(n.getShaderCompileErrors());var s=r.attributes?r.attributes.map(function(t){return{name:"a_"+t.name,size:1,type:ou.FLOAT}}):[];n.attributes=[{name:"a_position",size:2,type:ou.FLOAT},{name:"a_index",size:1,type:ou.FLOAT}].concat(s);n.hitDetectionAttributes=[{name:"a_position",size:2,type:ou.FLOAT},{name:"a_index",size:1,type:ou.FLOAT},{name:"a_hitColor",size:4,type:ou.FLOAT},{name:"a_featureUid",size:1,type:ou.FLOAT}].concat(s);n.customAttributes=r.attributes?r.attributes:[];n.previousExtent_=[1/0,1/0,-1/0,-1/0];n.currentTransform_=a;n.renderTransform_=[1,0,0,1,0,0];n.invertRenderTransform_=[1,0,0,1,0,0];n.renderInstructions_=new Float32Array(0);n.hitRenderInstructions_=new Float32Array(0);n.hitRenderTarget_=n.hitDetectionEnabled_&&new hu(n.helper);n.worker_=new Worker(Bc);n.worker_.addEventListener("message",function(t){var e=t.data;if(e.type===Gc.GENERATE_BUFFERS){var r=e.projectionTransform;e.hitDetection?(this.hitVerticesBuffer_.fromArrayBuffer(e.vertexBuffer),this.helper.flushBufferData(this.hitVerticesBuffer_)):(this.verticesBuffer_.fromArrayBuffer(e.vertexBuffer),this.helper.flushBufferData(this.verticesBuffer_));this.indicesBuffer_.fromArrayBuffer(e.indexBuffer);this.helper.flushBufferData(this.indicesBuffer_);this.renderTransform_=r;qe(this.invertRenderTransform_,this.renderTransform_);e.hitDetection?this.hitRenderInstructions_=new Float32Array(t.data.renderInstructions):this.renderInstructions_=new Float32Array(t.data.renderInstructions);this.getLayer().changed()}}.bind(n));n.featureCache_={};n.featureCount_=0;var u=n.getLayer().getSource();return n.sourceListenKeys_=[g(u,bl.ADDFEATURE,n.handleSourceFeatureAdded_,n),g(u,bl.CHANGEFEATURE,n.handleSourceFeatureChanged_,n),g(u,bl.REMOVEFEATURE,n.handleSourceFeatureDelete_,n)],u.forEachFeature(function(t){this.featureCache_[o(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()};this.featureCount_++}.bind(n)),n}return Vc(e,t),e.prototype.handleSourceFeatureAdded_=function(t){var e=t.feature;this.featureCache_[o(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()};this.featureCount_++},e.prototype.handleSourceFeatureChanged_=function(t){var e=t.feature;this.featureCache_[o(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()}},e.prototype.handleSourceFeatureDelete_=function(t){var e=t.feature;delete this.featureCache_[o(e)];this.featureCount_--},e.prototype.renderFrame=function(t){var e=this.indicesBuffer_.getSize();this.helper.drawElements(0,e);this.helper.finalizeDraw(t);var r=this.helper.getCanvas(),n=t.layerStatesArray[t.layerIndex].opacity;return n!==parseFloat(r.style.opacity)&&(r.style.opacity=n),this.hitDetectionEnabled_&&(this.renderHitDetection(t),this.hitRenderTarget_.clearCachedData()),r},e.prototype.prepareFrame=function(t){var e=this.getLayer(),r=e.getSource(),n=t.viewState,i=!t.viewHints[Dn]&&!t.viewHints[Gn],o=!pt(this.previousExtent_,t.extent),a=this.sourceRevision_<r.getRevision();if(a&&(this.sourceRevision_=r.getRevision()),i&&(o||a)){var s=n.projection,u=n.resolution,l=e instanceof Xc?e.getRenderBuffer():0,h=tt(t.extent,l*u);r.loadFeatures(h,u,s);this.rebuildBuffers_(t);this.previousExtent_=t.extent.slice()}return this.helper.makeProjectionTransform(t,this.currentTransform_),Ve(this.currentTransform_,this.invertRenderTransform_),this.helper.useProgram(this.program_),this.helper.prepareDraw(t),this.helper.bindBuffer(this.verticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.attributes),!0},e.prototype.rebuildBuffers_=function(t){var e=[1,0,0,1,0,0];this.helper.makeProjectionTransform(t,e);var r,n,i=(2+this.customAttributes.length)*this.featureCount_;if(this.renderInstructions_&&this.renderInstructions_.length===i||(this.renderInstructions_=new Float32Array(i)),this.hitDetectionEnabled_){var o=(7+this.customAttributes.length)*this.featureCount_;this.hitRenderInstructions_&&this.hitRenderInstructions_.length===o||(this.hitRenderInstructions_=new Float32Array(o))}var a,s,u,l=[],h=[],c=0,p=0;for(var f in this.featureCache_)if((n=(r=this.featureCache_[f]).geometry)&&n.getType()===Nt.POINT){l[0]=n.getFlatCoordinates()[0];l[1]=n.getFlatCoordinates()[1];Ze(e,l);s=p+6;u=void 0;(u=h||[])[0]=Math.floor(s/16777216)/255;u[1]=Math.floor(s/65536)%256/255;u[2]=Math.floor(s/256)%256/255;u[3]=s%256/255;a=u;this.renderInstructions_[c++]=l[0];this.renderInstructions_[c++]=l[1];this.hitDetectionEnabled_&&(this.hitRenderInstructions_[p++]=l[0],this.hitRenderInstructions_[p++]=l[1],this.hitRenderInstructions_[p++]=a[0],this.hitRenderInstructions_[p++]=a[1],this.hitRenderInstructions_[p++]=a[2],this.hitRenderInstructions_[p++]=a[3],this.hitRenderInstructions_[p++]=Number(f));for(var d=void 0,_=0;_<this.customAttributes.length;_++)d=this.customAttributes[_].callback(r.feature,r.properties),this.renderInstructions_[c++]=d,this.hitDetectionEnabled_&&(this.hitRenderInstructions_[p++]=d)}var g={type:Gc.GENERATE_BUFFERS,renderInstructions:this.renderInstructions_.buffer,customAttributesCount:this.customAttributes.length};if(g.projectionTransform=e,this.worker_.postMessage(g,[this.renderInstructions_.buffer]),this.renderInstructions_=null,this.hitDetectionEnabled_){var y={type:Gc.GENERATE_BUFFERS,renderInstructions:this.hitRenderInstructions_.buffer,customAttributesCount:5+this.customAttributes.length};y.projectionTransform=e;y.hitDetection=!0;this.worker_.postMessage(y,[this.hitRenderInstructions_.buffer]);this.hitRenderInstructions_=null}},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n){if(K(this.hitDetectionEnabled_,66),this.hitRenderInstructions_){var o=Ze(e.coordinateToPixelTransform,t.slice()),a=this.hitRenderTarget_.readPixel(o[0]/2,o[1]/2),s=function(t){var e=0;return e+=Math.round(4278190080*t[0]),e+=Math.round(16711680*t[1]),e+=Math.round(65280*t[2]),e+Math.round(255*t[3])}([a[0]/255,a[1]/255,a[2]/255,a[3]/255]),u=this.hitRenderInstructions_[s],l=Math.floor(u).toString(),h=this.getLayer().getSource().getFeatureByUid(l);return h?n(h,this.getLayer()):void 0}},e.prototype.renderHitDetection=function(t){if(this.hitVerticesBuffer_.getSize()){this.hitRenderTarget_.setSize([Math.floor(t.size[0]/2),Math.floor(t.size[1]/2)]);this.helper.useProgram(this.hitProgram_);this.helper.prepareDrawToRenderTarget(t,this.hitRenderTarget_,!0);this.helper.bindBuffer(this.hitVerticesBuffer_);this.helper.bindBuffer(this.indicesBuffer_);this.helper.enableAttributes(this.hitDetectionAttributes);var e=this.indicesBuffer_.getSize();this.helper.drawElements(0,e)}},e.prototype.disposeInternal=function(){this.worker_.terminate();this.layer_=null;this.sourceListenKeys_.forEach(function(t){v(t)});this.sourceListenKeys_=null;t.prototype.disposeInternal.call(this)},e}(kc),Zc={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},Kc=[Zc.FILL],Hc=[Zc.STROKE],qc=[Zc.BEGIN_PATH],Jc=[Zc.CLOSE_PATH],Qc=Zc,$c=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),tp=function(t){function e(e,r,n,i){var o=t.call(this)||this;return o.tolerance=e,o.maxExtent=r,o.pixelRatio=i,o.maxLineWidth=0,o.resolution=n,o.beginGeometryInstruction1_=null,o.beginGeometryInstruction2_=null,o.bufferedMaxExtent_=null,o.instructions=[],o.coordinates=[],o.tmpCoordinate_=[],o.hitDetectionInstructions=[],o.state={},o}return $c(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map(function(t){return t*e})},e.prototype.appendFlatCoordinates=function(t,e,r,n,i,o){var a=this.coordinates.length,s=this.getBufferedMaxExtent();o&&(e+=n);for(var l,h,c=t[e],p=t[e+1],f=this.tmpCoordinate_,d=!0,u=e+n;u<r;u+=n)f[0]=t[u],f[1]=t[u+1],(h=at(s,f))!==l?(d&&(this.coordinates[a++]=c,this.coordinates[a++]=p),this.coordinates[a++]=f[0],this.coordinates[a++]=f[1],d=!1):h===Q.INTERSECTING?(this.coordinates[a++]=f[0],this.coordinates[a++]=f[1],d=!1):d=!0,c=f[0],p=f[1],l=h;return(i&&d||u===e+n)&&(this.coordinates[a++]=c,this.coordinates[a++]=p),a},e.prototype.drawCustomCoordinates_=function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o],u=this.appendFlatCoordinates(t,e,s,n,!1,!1);i.push(u);e=s}return e},e.prototype.drawCustom=function(t,e,r){this.beginGeometry(t,e);var n,i,o,a,s,u=t.getType(),l=t.getStride(),h=this.coordinates.length;if(u==Nt.MULTI_POLYGON){n=(t=t).getOrientedFlatCoordinates();a=[];var c=t.getEndss();s=0;for(var p=0,f=c.length;p<f;++p){var d=[];s=this.drawCustomCoordinates_(n,s,c[p],l,d);a.push(d)}this.instructions.push([Qc.CUSTOM,h,a,t,r,gr])}else u==Nt.POLYGON||u==Nt.MULTI_LINE_STRING?(o=[],n=u==Nt.POLYGON?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),s=this.drawCustomCoordinates_(n,0,t.getEnds(),l,o),this.instructions.push([Qc.CUSTOM,h,o,t,r,_r])):u==Nt.LINE_STRING||u==Nt.MULTI_POINT?(n=t.getFlatCoordinates(),i=this.appendFlatCoordinates(n,0,n.length,l,!1,!1),this.instructions.push([Qc.CUSTOM,h,i,t,r,dr])):u==Nt.POINT&&(n=t.getFlatCoordinates(),this.coordinates.push(n[0],n[1]),i=this.coordinates.length,this.instructions.push([Qc.CUSTOM,h,i,t,r]));this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){var r=t.getExtent();this.beginGeometryInstruction1_=[Qc.BEGIN_GEOMETRY,e,0,r];this.instructions.push(this.beginGeometryInstruction1_);this.beginGeometryInstruction2_=[Qc.BEGIN_GEOMETRY,e,0,r];this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var r,n,i=e.length,o=-1;for(t=0;t<i;++t)(n=(r=e[t])[0])==Qc.END_GEOMETRY?o=t:n==Qc.BEGIN_GEOMETRY&&(r[2]=t,w(this.hitDetectionInstructions,o,t),o=-1)},e.prototype.setFillStrokeStyle=function(t,e){var r=this.state;if(t){var n=t.getColor();r.fillStyle=ca(n||"#000")}else r.fillStyle=void 0;if(e){var i=e.getColor();r.strokeStyle=ca(i||"#000");var o=e.getLineCap();r.lineCap=void 0!==o?o:"round";var a=e.getLineDash();r.lineDash=a?a.slice():va;var s=e.getLineDashOffset();r.lineDashOffset=s||0;var u=e.getLineJoin();r.lineJoin=void 0!==u?u:"round";var l=e.getWidth();r.lineWidth=void 0!==l?l:1;var h=e.getMiterLimit();r.miterLimit=void 0!==h?h:10;r.lineWidth>this.maxLineWidth&&(this.maxLineWidth=r.lineWidth,this.bufferedMaxExtent_=null)}else r.strokeStyle=void 0,r.lineCap=void 0,r.lineDash=null,r.lineDashOffset=void 0,r.lineJoin=void 0,r.lineWidth=void 0,r.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,r=[Qc.SET_FILL_STYLE,e];return"string"!=typeof e&&r.push(!0),r},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[Qc.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var r=t.fillStyle;"string"==typeof r&&t.currentFillStyle==r||(void 0!==r&&this.instructions.push(e.call(this,t)),t.currentFillStyle=r)},e.prototype.updateStrokeStyle=function(t,e){var r=t.strokeStyle,n=t.lineCap,i=t.lineDash,o=t.lineDashOffset,a=t.lineJoin,s=t.lineWidth,u=t.miterLimit;t.currentStrokeStyle==r&&t.currentLineCap==n&&(i==t.currentLineDash||R(t.currentLineDash,i))&&t.currentLineDashOffset==o&&t.currentLineJoin==a&&t.currentLineWidth==s&&t.currentMiterLimit==u||(void 0!==r&&e.call(this,t),t.currentStrokeStyle=r,t.currentLineCap=n,t.currentLineDash=i,t.currentLineDashOffset=o,t.currentLineJoin=a,t.currentLineWidth=s,t.currentMiterLimit=u)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length;this.beginGeometryInstruction1_=null;this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length;this.beginGeometryInstruction2_=null;var e=[Qc.END_GEOMETRY,t];this.instructions.push(e);this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=et(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;tt(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(fa),ep=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),rp=function(t){function e(e,r,n,i){var o=t.call(this,e,r,n,i)||this;return o.declutterGroups_=null,o.hitDetectionImage_=null,o.image_=null,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o}return ep(e,t),e.prototype.drawCoordinates_=function(t,e,r,n){return this.appendFlatCoordinates(t,e,r,n,!1,!1)},e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var r=t.getFlatCoordinates(),n=t.getStride(),i=this.coordinates.length,o=this.drawCoordinates_(r,0,r.length,n);this.instructions.push([Qc.DRAW_IMAGE,i,o,this.image_,this.anchorX_,this.anchorY_,this.declutterGroups_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]);this.hitDetectionInstructions.push([Qc.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroups_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]);this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var r=t.getFlatCoordinates(),n=t.getStride(),i=this.coordinates.length,o=this.drawCoordinates_(r,0,r.length,n);this.instructions.push([Qc.DRAW_IMAGE,i,o,this.image_,this.anchorX_,this.anchorY_,this.declutterGroups_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]);this.hitDetectionInstructions.push([Qc.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroups_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]);this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var r=t.getAnchor(),n=t.getSize(),i=t.getHitDetectionImage(1),o=t.getImage(1),a=t.getOrigin();this.anchorX_=r[0];this.anchorY_=r[1];this.declutterGroups_=e;this.hitDetectionImage_=i;this.image_=o;this.height_=n[1];this.opacity_=t.getOpacity();this.originX_=a[0];this.originY_=a[1];this.rotateWithView_=t.getRotateWithView();this.rotation_=t.getRotation();this.scale_=t.getScale();this.width_=n[0]},e}(tp),np=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ip=function(t){function e(e,r,n,i){return t.call(this,e,r,n,i)||this}return np(e,t),e.prototype.drawFlatCoordinates_=function(t,e,r,n){var i=this.coordinates.length,o=this.appendFlatCoordinates(t,e,r,n,!1,!1),a=[Qc.MOVE_TO_LINE_TO,i,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),r},e.prototype.drawLineString=function(t,e){var r=this.state,n=r.strokeStyle,i=r.lineWidth;if(void 0!==n&&void 0!==i){this.updateStrokeStyle(r,this.applyStroke);this.beginGeometry(t,e);this.hitDetectionInstructions.push([Qc.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset],qc);var o=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(o,0,o.length,a);this.hitDetectionInstructions.push(Hc);this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var r=this.state,n=r.strokeStyle,i=r.lineWidth;if(void 0!==n&&void 0!==i){this.updateStrokeStyle(r,this.applyStroke);this.beginGeometry(t,e);this.hitDetectionInstructions.push([Qc.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset],qc);for(var o=t.getEnds(),a=t.getFlatCoordinates(),s=t.getStride(),u=0,l=0,h=o.length;l<h;++l)u=this.drawFlatCoordinates_(a,u,o[l],s);this.hitDetectionInstructions.push(Hc);this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(Hc),this.reverseHitDetectionInstructions(),this.state=null,t.prototype.finish.call(this)},e.prototype.applyStroke=function(e){null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(Hc),e.lastStroke=this.coordinates.length);e.lastStroke=0;t.prototype.applyStroke.call(this,e);this.instructions.push(qc)},e}(tp),op=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ap=function(t){function e(e,r,n,i){return t.call(this,e,r,n,i)||this}return op(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,r,n){var i=this.state,o=void 0!==i.fillStyle,a=void 0!==i.strokeStyle,s=r.length;this.instructions.push(qc);this.hitDetectionInstructions.push(qc);for(var u=0;u<s;++u){var l=r[u],h=this.coordinates.length,c=this.appendFlatCoordinates(t,e,l,n,!0,!a),p=[Qc.MOVE_TO_LINE_TO,h,c];this.instructions.push(p);this.hitDetectionInstructions.push(p);a&&(this.instructions.push(Jc),this.hitDetectionInstructions.push(Jc));e=l}return o&&(this.instructions.push(Kc),this.hitDetectionInstructions.push(Kc)),a&&(this.instructions.push(Hc),this.hitDetectionInstructions.push(Hc)),e},e.prototype.drawCircle=function(t,e){var r=this.state,n=r.fillStyle,i=r.strokeStyle;if(void 0!==n||void 0!==i){this.setFillStrokeStyles_();this.beginGeometry(t,e);void 0!==r.fillStyle&&this.hitDetectionInstructions.push([Qc.SET_FILL_STYLE,"#000"]);void 0!==r.strokeStyle&&this.hitDetectionInstructions.push([Qc.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);var o=t.getFlatCoordinates(),a=t.getStride(),s=this.coordinates.length;this.appendFlatCoordinates(o,0,o.length,a,!1,!1);var u=[Qc.CIRCLE,s];this.instructions.push(qc,u);this.hitDetectionInstructions.push(qc,u);void 0!==r.fillStyle&&(this.instructions.push(Kc),this.hitDetectionInstructions.push(Kc));void 0!==r.strokeStyle&&(this.instructions.push(Hc),this.hitDetectionInstructions.push(Hc));this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var r=this.state,n=r.fillStyle,i=r.strokeStyle;if(void 0!==n||void 0!==i){this.setFillStrokeStyles_();this.beginGeometry(t,e);void 0!==r.fillStyle&&this.hitDetectionInstructions.push([Qc.SET_FILL_STYLE,"#000"]);void 0!==r.strokeStyle&&this.hitDetectionInstructions.push([Qc.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);var o=t.getEnds(),a=t.getOrientedFlatCoordinates(),s=t.getStride();this.drawFlatCoordinatess_(a,0,o,s);this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var r=this.state,n=r.fillStyle,i=r.strokeStyle;if(void 0!==n||void 0!==i){this.setFillStrokeStyles_();this.beginGeometry(t,e);void 0!==r.fillStyle&&this.hitDetectionInstructions.push([Qc.SET_FILL_STYLE,"#000"]);void 0!==r.strokeStyle&&this.hitDetectionInstructions.push([Qc.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);for(var o=t.getEndss(),a=t.getOrientedFlatCoordinates(),s=t.getStride(),u=0,l=0,h=o.length;l<h;++l)u=this.drawFlatCoordinatess_(a,u,o[l],s);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions();this.state=null;var e=this.tolerance;if(0!==e)for(var r=this.coordinates,n=0,i=r.length;n<i;++n)r[n]=mr(r[n],e);return t.prototype.finish.call(this)},e.prototype.setFillStrokeStyles_=function(){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill);void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},e}(tp);function sp(t,e,r,n,i){for(var a,s,u,l,h,c,p,f,d=r,_=r,g=0,y=0,v=r,o=r;o<n;o+=i){var m=e[o],E=e[o+1];void 0!==u&&(p=m-u,f=E-l,s=Math.sqrt(p*p+f*f),void 0!==h&&(y+=a,Math.acos((h*p+c*f)/(a*s))>t&&(y>g&&(g=y,d=v,_=o),y=0,v=o-i)),a=s,h=p,c=f);u=m;l=E}return(y+=s)>g?[v,o]:[d,_]}var up=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),lp={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},hp={Circle:ap,Default:tp,Image:rp,LineString:ip,Polygon:ap,Text:function(t){function e(e,r,n,i){var o=t.call(this,e,r,n,i)||this;return o.declutterGroups_,o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",Ea.prune(),o}return up(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var r=this.textFillState_,n=this.textStrokeState_,i=this.textState_;if(""!==this.text_&&i&&(r||n)){var o,a,s=this.coordinates.length,u=t.getType(),l=null,h=2,c=2;if(i.placement===ku.LINE){if(!bt(this.getBufferedMaxExtent(),t.getExtent()))return;var p=void 0;if(l=t.getFlatCoordinates(),c=t.getStride(),u==Nt.LINE_STRING)p=[l.length];else if(u==Nt.MULTI_LINE_STRING)p=t.getEnds();else if(u==Nt.POLYGON)p=t.getEnds().slice(0,1);else if(u==Nt.MULTI_POLYGON){var f=t.getEndss();for(p=[],o=0,a=f.length;o<a;++o)p.push(f[o][0])}this.beginGeometry(t,e);for(var d=i.textAlign,_=0,g=void 0,y=0,v=p.length;y<v;++y){if(null==d){var m=sp(i.maxAngle,l,_,p[y],c);_=m[0];g=m[1]}else g=p[y];for(o=_;o<g;o+=c)this.coordinates.push(l[o],l[o+1]);h=this.coordinates.length;_=p[y];var E=this.declutterGroups_?0===y?this.declutterGroups_[0]:[].concat(this.declutterGroups_[0]):null;this.drawChars_(s,h,E);s=h}this.endGeometry(e)}else{var T=null;switch(i.overflow||(T=[]),u){case Nt.POINT:case Nt.MULTI_POINT:h=(l=t.getFlatCoordinates()).length;break;case Nt.LINE_STRING:l=t.getFlatMidpoint();break;case Nt.CIRCLE:l=t.getCenter();break;case Nt.MULTI_LINE_STRING:h=(l=t.getFlatMidpoints()).length;break;case Nt.POLYGON:l=t.getFlatInteriorPoint();i.overflow||T.push(l[2]/this.resolution);c=3;break;case Nt.MULTI_POLYGON:var S=t.getFlatInteriorPoints();for(l=[],o=0,a=S.length;o<a;o+=3)i.overflow||T.push(S[o+2]/this.resolution),l.push(S[o],S[o+1]);if(0==(h=l.length))return}h=this.appendFlatCoordinates(l,0,h,c,!1,!1);this.saveTextStates_();(i.backgroundFill||i.backgroundStroke)&&(this.setFillStrokeStyle(i.backgroundFill,i.backgroundStroke),i.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),i.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state))));this.beginGeometry(t,e);var w=this.pixelRatio;this.instructions.push([Qc.DRAW_IMAGE,s,h,null,NaN,NaN,this.declutterGroups_,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,1,NaN,i.padding==ma?ma:i.padding.map(function(t){return t*w}),!!i.backgroundFill,!!i.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,T]);this.hitDetectionInstructions.push([Qc.DRAW_IMAGE,s,h,null,NaN,NaN,this.declutterGroups_,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,1/this.pixelRatio,NaN,i.padding,!!i.backgroundFill,!!i.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,T]);this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,r=this.textFillState_,n=this.strokeKey_;t&&(n in this.strokeStates||(this.strokeStates[n]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var i=this.textKey_;i in this.textStates||(this.textStates[i]={font:e.font,textAlign:e.textAlign||"center",textBaseline:e.textBaseline||"middle",scale:e.scale});var o=this.fillKey_;r&&(o in this.fillStates||(this.fillStates[o]={fillStyle:r.fillStyle}))},e.prototype.drawChars_=function(t,e,r){var n=this.textStrokeState_,i=this.textState_,o=this.strokeKey_,a=this.textKey_,s=this.fillKey_;this.saveTextStates_();var u=this.pixelRatio,l=lp[i.textBaseline],h=this.textOffsetY_*u,c=this.text_,p=i.scale,f=n?n.lineWidth*p/2:0;this.instructions.push([Qc.DRAW_CHARS,t,e,l,r,i.overflow,s,i.maxAngle,u,h,o,f*u,c,a,1]);this.hitDetectionInstructions.push([Qc.DRAW_CHARS,t,e,l,r,i.overflow,s,i.maxAngle,1,h,o,f,c,a,1/u])},e.prototype.setTextStyle=function(t,e){var r,n,i;if(t){this.declutterGroups_=e;var a=t.getFill();a?((n=this.textFillState_)||(n={},this.textFillState_=n),n.fillStyle=ca(a.getColor()||"#000")):(n=null,this.textFillState_=n);var s=t.getStroke();if(s){(i=this.textStrokeState_)||(i={},this.textStrokeState_=i);var u=s.getLineDash(),l=s.getLineDashOffset(),h=s.getWidth(),c=s.getMiterLimit();i.lineCap=s.getLineCap()||"round";i.lineDash=u?u.slice():va;i.lineDashOffset=void 0===l?0:l;i.lineJoin=s.getLineJoin()||"round";i.lineWidth=void 0===h?1:h;i.miterLimit=void 0===c?10:c;i.strokeStyle=ca(s.getColor()||"#000")}else i=null,this.textStrokeState_=i;r=this.textState_;var p=t.getFont()||"10px sans-serif";xa(p);var f=t.getScale();r.overflow=t.getOverflow();r.font=p;r.maxAngle=t.getMaxAngle();r.placement=t.getPlacement();r.textAlign=t.getTextAlign();r.textBaseline=t.getTextBaseline()||"middle";r.backgroundFill=t.getBackgroundFill();r.backgroundStroke=t.getBackgroundStroke();r.padding=t.getPadding()||ma;r.scale=void 0===f?1:f;var d=t.getOffsetX(),_=t.getOffsetY(),g=t.getRotateWithView(),y=t.getRotation();this.text_=t.getText()||"";this.textOffsetX_=void 0===d?0:d;this.textOffsetY_=void 0===_?0:_;this.textRotateWithView_=void 0!==g&&g;this.textRotation_=void 0===y?0:y;this.strokeKey_=i?("string"==typeof i.strokeStyle?i.strokeStyle:o(i.strokeStyle))+i.lineCap+i.lineDashOffset+"|"+i.lineWidth+i.lineJoin+i.miterLimit+"["+i.lineDash.join()+"]":"";this.textKey_=r.font+r.scale+(r.textAlign||"?");this.fillKey_=n?"string"==typeof n.fillStyle?n.fillStyle:"|"+o(n.fillStyle):""}else this.text_=""},e}(tp)},cp=function(){function t(t,e,r,n,i){this.declutter_=i;this.declutterGroups_=null;this.tolerance_=t;this.maxExtent_=e;this.pixelRatio_=n;this.resolution_=r;this.buildersByZIndex_={}}return t.prototype.addDeclutter=function(t){var e=null;return this.declutter_&&(t?(e=this.declutterGroups_)[0][4]++:(e=[[1/0,1/0,-1/0,-1/0]],this.declutterGroups_=e,e[0].push(1))),e},t.prototype.finish=function(){var t={};for(var e in this.buildersByZIndex_){t[e]=t[e]||{};var r=this.buildersByZIndex_[e];for(var n in r){var i=r[n].finish();t[e][n]=i}}return t},t.prototype.getBuilder=function(t,e){var r=void 0!==t?t.toString():"0",n=this.buildersByZIndex_[r];void 0===n&&(n={},this.buildersByZIndex_[r]=n);var i=n[e];return void 0===i&&(i=new hp[e](this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),n[e]=i),i},t}();function pp(t,e,r,n){for(var i=t[e],o=t[e+1],a=0,s=e+n;s<r;s+=n){var u=t[s],l=t[s+1];a+=Math.sqrt((u-i)*(u-i)+(l-o)*(l-o));i=u;o=l}return a}function fp(t,e,r,n,i,o,a,s,u,l,h){for(var c,p,f=[],d=t[e]>t[r-n],_=i.length,g=t[e],y=t[e+1],v=t[e+=n],m=t[e+1],E=0,T=Math.sqrt(Math.pow(v-g,2)+Math.pow(m-y,2)),S=!1,w=0;w<_;++w){for(var x=i[c=d?_-w-1:w],O=s*u(l,x,h),R=o+O/2;e<r-n&&E+T<R;)g=v,y=m,v=t[e+=n],m=t[e+1],E+=T,T=Math.sqrt(Math.pow(v-g,2)+Math.pow(m-y,2));var C=R-E,P=Math.atan2(m-y,v-g);if(d&&(P+=P>0?-Math.PI:Math.PI),void 0!==p){var I=P-p;if(S=S||0!==I,I+=I>Math.PI?-2*Math.PI:I<-Math.PI?2*Math.PI:0,Math.abs(I)>a)return null}p=P;var b=C/T,L=Wt(g,v,b),M=Wt(y,m,b);f[c]=[L,M,O/2,P,x];o+=O}return S?f:[[f[0][0],f[0][1],f[0][2],f[0][3],i]]}var dp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),_p=[1/0,1/0,-1/0,-1/0],gp=[1,0,0,1,0,0],yp=[],vp=[],mp=[],Ep=[],Tp=function(t){function e(e,r,n,i){var o=t.call(this)||this;return o.overlaps=n,o.pixelRatio=r,o.resolution=e,o.alignFill_,o.declutterItems=[],o.instructions=i.instructions,o.coordinates=i.coordinates,o.coordinateCache_={},o.renderedTransform_=[1,0,0,1,0,0],o.hitDetectionInstructions=i.hitDetectionInstructions,o.pixelCoordinates_=null,o.viewRotation_=0,o.fillStates=i.fillStates||{},o.strokeStates=i.strokeStates||{},o.textStates=i.textStates||{},o.widths_={},o}return dp(e,t),e.prototype.disposeInternal=function(){Ea.release(this);t.prototype.disposeInternal.call(this)},e.prototype.getTextImage=function(t,e,r,n){var i,o=n+e+t+r+this.pixelRatio;if(!Ea.containsKey(o)){var a=n?this.strokeStates[n]:null,s=r?this.fillStates[r]:null,u=this.textStates[e],l=this.pixelRatio,h=u.scale*l,c=lp[u.textAlign||"center"],p=n&&a.lineWidth?a.lineWidth:0,f=t.split("\n"),d=f.length,_=[],g=function(t,e,r){for(var n=e.length,i=0,o=0;o<n;++o){var a=Ia(t,e[o]);i=Math.max(i,a);r.push(a)}return i}(u.font,f,_),y=Pa(u.font),v=y*d,m=g+p,E=li(Math.ceil((m+2)*h),Math.ceil((v+p)*h));i=E.canvas;Ea.set(o,i);1!=h&&E.scale(h,h);E.font=u.font;n&&(E.strokeStyle=a.strokeStyle,E.lineWidth=p,E.lineCap=a.lineCap,E.lineJoin=a.lineJoin,E.miterLimit=a.miterLimit,E.setLineDash&&a.lineDash.length&&(E.setLineDash(a.lineDash),E.lineDashOffset=a.lineDashOffset));r&&(E.fillStyle=s.fillStyle);E.textBaseline="middle";E.textAlign="center";var T=.5-c,S=c*m+T*p,w=void 0;if(n)for(w=0;w<d;++w)E.strokeText(f[w],S+T*_[w],.5*(p+y)+w*y);if(r)for(w=0;w<d;++w)E.fillText(f[w],S+T*_[w],.5*(p+y)+w*y)}return Ea.get(o,this)},e.prototype.replayTextBackground_=function(t,e,r,n,i,o,a){t.beginPath();t.moveTo.apply(t,e);t.lineTo.apply(t,r);t.lineTo.apply(t,n);t.lineTo.apply(t,i);t.lineTo.apply(t,e);o&&(this.alignFill_=o[2],this.fill_(t));a&&(this.setStrokeStyle_(t,a),t.stroke())},e.prototype.replayImage_=function(t,e,r,n,i,o,a,s,u,l,h,c,p,f,d,_,g,y){var v=g||y;e-=i*=p;r-=o*=p;var m=d+l>n.width?n.width-l:d,E=s+h>n.height?n.height-h:s,T=_[3]+m*p+_[1],S=_[0]+E*p+_[2],w=e-_[3],x=r-_[0];(v||0!==c)&&(yp[0]=w,Ep[0]=w,yp[1]=x,vp[1]=x,vp[0]=w+T,mp[0]=vp[0],mp[1]=x+S,Ep[1]=mp[1]);var O=null;if(0!==c){var R=e+i,C=r+o;O=He(gp,R,C,1,1,c,-R,-C);Ze(gp,yp);Ze(gp,vp);Ze(gp,mp);Ze(gp,Ep);ut(Math.min(yp[0],vp[0],mp[0],Ep[0]),Math.min(yp[1],vp[1],mp[1],Ep[1]),Math.max(yp[0],vp[0],mp[0],Ep[0]),Math.max(yp[1],vp[1],mp[1],Ep[1]),_p)}else ut(w,x,w+T,x+S,_p);var P=t.canvas,I=y?y[2]*p/2:0,b=_p[0]-I<=P.width&&_p[2]+I>=0&&_p[1]-I<=P.height&&_p[3]+I>=0;if(f&&(e=Math.round(e),r=Math.round(r)),a){if(!b&&1==a[4])return;ft(a,_p);var L=b?[t,O?O.slice(0):null,u,n,l,h,m,E,e,r,p]:null;L&&(v&&L.push(g,y,yp,vp,mp,Ep),a.push(L))}else b&&(v&&this.replayTextBackground_(t,yp,vp,mp,Ep,g,y),Fa(t,O,u,n,l,h,m,E,e,r,p))},e.prototype.fill_=function(t){if(this.alignFill_){var e=Ze(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;t.save();t.translate(e[0]%r,e[1]%r);t.rotate(this.viewRotation_)}t.fill();this.alignFill_&&t.restore()},e.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1];t.lineWidth=e[2];t.lineCap=e[3];t.lineJoin=e[4];t.miterLimit=e[5];t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},e.prototype.renderDeclutter=function(t,e,r,n){if(t&&t.length>5){var i=t[4];if(1==i||i==t.length-5){var o={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};if(n||(n=new Ml.a(9)),!n.collides(o)){n.insert(o);for(var a=5,s=t.length;a<s;++a){var u=t[a],l=u[0],h=l.globalAlpha;h!==r&&(l.globalAlpha=r);u.length>11&&this.replayTextBackground_(u[0],u[13],u[14],u[15],u[16],u[11],u[12]);Fa.apply(void 0,u);h!==r&&(l.globalAlpha=h)}}t.length=5;lt(t)}}return n},e.prototype.drawTextImageWithPointPlacement_=function(t,e,r,n){var i=this.textStates[e],o=this.getTextImage(t,e,n,r),a=this.strokeStates[r],s=this.pixelRatio,u=lp[i.textAlign||"center"],l=lp[i.textBaseline||"middle"],h=a&&a.lineWidth?a.lineWidth:0;return{label:o,anchorX:u*(o.width/s-2*i.scale)+2*(.5-u)*h,anchorY:l*o.height/s+2*(.5-l)*h}},e.prototype.execute_=function(t,e,r,n,i,o){var a,s,u;this.declutterItems.length=0;this.pixelCoordinates_&&R(e,this.renderedTransform_)?a=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),a=Dt(this.coordinates,0,this.coordinates.length,2,e,this.pixelCoordinates_),s=this.renderedTransform_,u=e,s[0]=u[0],s[1]=u[1],s[2]=u[2],s[3]=u[3],s[4]=u[4],s[5]=u[5]);for(var l,h,c,p,f,d,_,g,y,v,m,E,T,S,w,x,O,C=0,P=r.length,I=0,b=0,L=0,M=null,F=null,A=this.coordinateCache_,N=this.viewRotation_,D=Math.round(1e12*Math.atan2(-e[1],e[0]))/1e12,G={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:N},j=this.instructions!=r||this.overlaps?0:200;C<P;){var k=r[C];switch(k[0]){case Qc.BEGIN_GEOMETRY:(w=k[1]).getGeometry()?void 0===o||bt(o,k[3])?++C:C=k[2]+1:C=k[2];break;case Qc.BEGIN_PATH:b>j&&(this.fill_(t),b=0);L>j&&(t.stroke(),L=0);b||L||(t.beginPath(),p=NaN,f=NaN);++C;break;case Qc.CIRCLE:var U=a[I=k[1]],B=a[I+1],Y=a[I+2]-U,z=a[I+3]-B,X=Math.sqrt(Y*Y+z*z);t.moveTo(U+X,B);t.arc(U,B,X,0,2*Math.PI,!0);++C;break;case Qc.CLOSE_PATH:t.closePath();++C;break;case Qc.CUSTOM:I=k[1];l=k[2];var V=k[3],W=k[4],Z=6==k.length?k[5]:void 0;G.geometry=V;G.feature=w;C in A||(A[C]=[]);var K=A[C];Z?Z(a,I,l,2,K):(K[0]=a[I],K[1]=a[I+1],K.length=2);W(K,G);++C;break;case Qc.DRAW_IMAGE:I=k[1];l=k[2];v=k[3];h=k[4];c=k[5];y=i?null:k[6];var H=k[7],q=k[8],J=k[9],Q=k[10],$=k[11],tt=k[12],et=k[13],rt=k[14];if(!v&&k.length>=19){m=k[18];E=k[19];T=k[20];S=k[21];var nt=this.drawTextImageWithPointPlacement_(m,E,T,S);v=nt.label;k[3]=v;var it=k[22];h=(nt.anchorX-it)*this.pixelRatio;k[4]=h;var ot=k[23];c=(nt.anchorY-ot)*this.pixelRatio;k[5]=c;H=v.height;k[7]=H;rt=v.width;k[14]=rt}var at=void 0;k.length>24&&(at=k[24]);var st=void 0,ut=void 0,lt=void 0;k.length>16?(st=k[15],ut=k[16],lt=k[17]):(st=ma,ut=!1,lt=!1);$&&D?tt+=N:$||D||(tt-=N);for(var ht=0,ct=0;I<l;I+=2)if(!(at&&at[ht++]<rt/this.pixelRatio)){if(y){var pt=Math.floor(ct);y.length<pt+1&&((g=[1/0,1/0,-1/0,-1/0]).push(y[0][4]),y.push(g));g=y[pt]}this.replayImage_(t,a[I],a[I+1],v,h,c,g,H,q,J,Q,tt,et,n,rt,st,ut?M:null,lt?F:null);g&&(ct===Math.floor(ct)&&this.declutterItems.push(this,g,w),ct+=1/g[4])}++C;break;case Qc.DRAW_CHARS:var ft=k[1],dt=k[2],_t=k[3];g=i?null:k[4];var gt=k[5];S=k[6];var yt=k[7],vt=k[8],mt=k[9];T=k[10];var Et=k[11];m=k[12];E=k[13];var Tt=k[14],St=this.textStates[E],wt=St.font,xt=St.scale*vt,Ot=void 0;wt in this.widths_?Ot=this.widths_[wt]:(Ot={},this.widths_[wt]=Ot);var Rt=pp(a,ft,dt,2),Ct=xt*ba(wt,m,Ot);if(gt||Ct<=Rt){var Pt=this.textStates[E].textAlign,It=fp(a,ft,dt,2,m,(Rt-Ct)*lp[Pt],yt,xt,ba,wt,Ot);if(It){var Lt=void 0,Mt=void 0,Ft=void 0,At=void 0,Nt=void 0;if(T)for(Lt=0,Mt=It.length;Lt<Mt;++Lt)Ft=(Nt=It[Lt])[4],At=this.getTextImage(Ft,E,"",T),h=Nt[2]+Et,c=_t*At.height+2*(.5-_t)*Et-mt,this.replayImage_(t,Nt[0],Nt[1],At,h,c,g,At.height,1,0,0,Nt[3],Tt,!1,At.width,ma,null,null);if(S)for(Lt=0,Mt=It.length;Lt<Mt;++Lt)Ft=(Nt=It[Lt])[4],At=this.getTextImage(Ft,E,S,""),h=Nt[2],c=_t*At.height-mt,this.replayImage_(t,Nt[0],Nt[1],At,h,c,g,At.height,1,0,0,Nt[3],Tt,!1,At.width,ma,null,null)}}this.declutterItems.push(this,g,w);++C;break;case Qc.END_GEOMETRY:if(void 0!==i){var Gt=i(w=k[1]);if(Gt)return Gt}++C;break;case Qc.FILL:j?b++:this.fill_(t);++C;break;case Qc.MOVE_TO_LINE_TO:for(I=k[1],l=k[2],x=a[I],_=(O=a[I+1])+.5|0,(d=x+.5|0)===p&&_===f||(t.moveTo(x,O),p=d,f=_),I+=2;I<l;I+=2)d=(x=a[I])+.5|0,_=(O=a[I+1])+.5|0,I!=l-2&&d===p&&_===f||(t.lineTo(x,O),p=d,f=_);++C;break;case Qc.SET_FILL_STYLE:M=k;this.alignFill_=k[2];b&&(this.fill_(t),b=0,L&&(t.stroke(),L=0));t.fillStyle=k[1];++C;break;case Qc.SET_STROKE_STYLE:F=k;L&&(t.stroke(),L=0);this.setStrokeStyle_(t,k);++C;break;case Qc.STROKE:j?L++:t.stroke();++C;break;default:++C}}b&&this.fill_(t);L&&t.stroke()},e.prototype.execute=function(t,e,r,n){this.viewRotation_=r;this.execute_(t,e,this.instructions,n,void 0,void 0)},e.prototype.executeHitDetection=function(t,e,r,n,i){return this.viewRotation_=r,this.execute_(t,e,this.hitDetectionInstructions,!0,n,i)},e}(m),Sp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wp=[Ga.POLYGON,Ga.CIRCLE,Ga.LINE_STRING,Ga.IMAGE,Ga.TEXT,Ga.DEFAULT],xp=function(t){function e(e,r,n,i,o,a){var s=t.call(this)||this;return s.maxExtent_=e,s.overlaps_=i,s.pixelRatio_=n,s.resolution_=r,s.renderBuffer_=a,s.executorsByZIndex_={},s.hitDetectionContext_=null,s.hitDetectionTransform_=[1,0,0,1,0,0],s.createExecutors_(o),s}return Sp(e,t),e.prototype.clip=function(t,e){var r=this.getClipCoords(e);t.beginPath();t.moveTo(r[0],r[1]);t.lineTo(r[2],r[3]);t.lineTo(r[4],r[5]);t.lineTo(r[6],r[7]);t.clip()},e.prototype.createExecutors_=function(t){for(var e in t){var r=this.executorsByZIndex_[e];void 0===r&&(r={},this.executorsByZIndex_[e]=r);var n=t[e];for(var i in n){var o=n[i];r[i]=new Tp(this.resolution_,this.pixelRatio_,this.overlaps_,o)}}},e.prototype.disposeInternal=function(){for(var e in this.executorsByZIndex_){var r=this.executorsByZIndex_[e];for(var n in r)r[n].disposeInternal()}if(this.hitDetectionContext_){var i=this.hitDetectionContext_.canvas;i.width=0;i.height=0}t.prototype.disposeInternal.call(this)},e.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var r=this.executorsByZIndex_[e],n=0,i=t.length;n<i;++n)if(t[n]in r)return!0;return!1},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i,o){var a=2*(n=Math.round(n))+1,s=He(this.hitDetectionTransform_,n+.5,n+.5,1/e,-1/e,-r,-t[0],-t[1]);this.hitDetectionContext_||(this.hitDetectionContext_=li(a,a));var u,l=this.hitDetectionContext_;l.canvas.width!==a||l.canvas.height!==a?(l.canvas.width=a,l.canvas.height=a):l.clearRect(0,0,a,a);void 0!==this.renderBuffer_&&(dt(u=[1/0,1/0,-1/0,-1/0],t),tt(u,e*(this.renderBuffer_+n),u));var h,c=function(t){if(void 0!==Op[t])return Op[t];for(var e=2*t+1,r=new Array(e),n=0;n<e;n++)r[n]=new Array(e);for(var i=t,o=0,a=0;i>=o;)Rp(r,t+i,t+o),Rp(r,t+o,t+i),Rp(r,t-o,t+i),Rp(r,t-i,t+o),Rp(r,t-i,t-o),Rp(r,t-o,t-i),Rp(r,t+o,t-i),Rp(r,t+i,t-o),2*((a+=1+2*++o)-i)+1>0&&(a+=1-2*(i-=1));return Op[t]=r,r}(n);function p(t){for(var e=l.getImageData(0,0,a,a).data,r=0;r<a;r++)for(var n=0;n<a;n++)if(c[r][n]&&e[4*(n*a+r)+3]>0){var s=void 0;return(!o||h!=Ga.IMAGE&&h!=Ga.TEXT||-1!==o.indexOf(t))&&(s=i(t)),s||void l.clearRect(0,0,a,a)}}var f,d,_,g,y,v=Object.keys(this.executorsByZIndex_).map(Number);for(v.sort(E),f=v.length-1;f>=0;--f){var m=v[f].toString();for(_=this.executorsByZIndex_[m],d=wp.length-1;d>=0;--d)if(void 0!==(g=_[h=wp[d]])&&(y=g.executeHitDetection(l,s,r,p,u)))return y}},e.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var r=e[0],n=e[1],i=e[2],o=e[3],a=[r,n,r,o,i,o,i,n];return Dt(a,0,8,2,t,a),a},e.prototype.isEmpty=function(){return _(this.executorsByZIndex_)},e.prototype.execute=function(t,e,r,n,i,o){var a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(E);this.maxExtent_&&(t.save(),this.clip(t,e));for(var l,h,c,p,f=i||wp,s=0,u=a.length;s<u;++s){var d=a[s].toString();for(c=this.executorsByZIndex_[d],l=0,h=f.length;l<h;++l){var _=f[l];if(void 0!==(p=c[_]))if(o&&(_==Ga.IMAGE||_==Ga.TEXT)){var g=o[d];g?g.push(p,e.slice(0)):o[d]=[p,e.slice(0)]}else p.execute(t,e,r,n)}}this.maxExtent_&&t.restore()},e}(m),Op={0:[[!0]]};function Rp(t,e,r){var n,i=Math.floor(t.length/2);if(e>=i)for(n=i;n<e;n++)t[n][r]=!0;else if(e<i)for(n=e+1;n<i;n++)t[n][r]=!0}function Cp(t,e,r,n,i,o){for(var a=Object.keys(t).map(Number).sort(E),s=0,u=a.length;s<u;++s)for(var l=t[a[s].toString()],h=void 0,c=0,p=l.length;c<p;){var f=l[c++];f!==h&&(h=f,o.push({items:f.declutterItems,opacity:n}));var d=l[c++];f.execute(e,d,r,i)}}var Pp=xp;function Ip(t,e,r,n,i,o,a){var s=li(t[0]/2,t[1]/2);s.imageSmoothingEnabled=!1;for(var u=s.canvas,l=new Na(s,.5,i,null,a),h=r.length,c=Math.ceil(16777216/h),p={},f=0;f<h;++f){var d=r[f],_=d.getStyleFunction()||n;if(n){var g=_(d,o);Array.isArray(g)||(g=[g]);for(var y="#"+("000000"+(f*c).toString(16)).slice(-6),v=0,m=g.length;v<m;++v){var T=g[v],S=T.clone(),w=S.getFill();w&&w.setColor(y);var x=S.getStroke();x&&x.setColor(y);S.setText(void 0);var O=T.getImage();if(O){var R=O.getImageSize(),C=document.createElement("canvas");C.width=R[0];C.height=R[1];var P=C.getContext("2d",{alpha:!1});P.fillStyle=y;var I=P.canvas;P.fillRect(0,0,I.width,I.height);li(R?R[0]:I.width,R?R[1]:I.height).drawImage(I,0,0);S.setImage(new Lu({img:I,imgSize:R,anchor:O.getAnchor(),anchorXUnits:Tu.PIXELS,anchorYUnits:Tu.PIXELS,offset:O.getOrigin(),size:O.getSize(),opacity:O.getOpacity(),scale:O.getScale(),rotation:O.getRotation(),rotateWithView:O.getRotateWithView()}))}var b=Number(S.getZIndex());(A=p[b])||(A={},p[b]=A,A[Nt.POLYGON]=[],A[Nt.CIRCLE]=[],A[Nt.LINE_STRING]=[],A[Nt.POINT]=[]);var L=S.getGeometryFunction()(d);L&&bt(i,L.getExtent())&&A[L.getType().replace("Multi","")].push(L,S)}}}for(var M=Object.keys(p).map(Number).sort(E),F=(f=0,M.length);f<F;++f){var A=p[M[f]];for(var N in A){var D=A[N];for(v=0,m=D.length;v<m;v+=2){l.setStyle(D[v+1]);for(var G=0,j=e.length;G<j;++G)l.setTransform(e[G]),l.drawGeometry(D[v])}}}return s.getImageData(0,0,u.width,u.height)}function bp(t,e,r){var n=[];if(r){var i=4*(Math.round(t[0]/2)+Math.round(t[1]/2)*r.width),o=r.data[i],a=r.data[i+1],s=r.data[i+2]+256*(a+256*o),u=Math.ceil(16777216/e.length);s%u==0&&n.push(e[s/u])}return n}var Lp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Mp=function(t){function e(e){var r=t.call(this,e)||this;return r.boundHandleStyleImageChange_=r.handleStyleImageChange_.bind(r),r.animatingOrInteracting_,r.dirty_=!1,r.hitDetectionImageData_=null,r.renderedFeatures_=null,r.renderedRevision_=-1,r.renderedResolution_=NaN,r.renderedExtent_=[1/0,1/0,-1/0,-1/0],r.renderedRotation_,r.renderedCenter_=null,r.renderedProjection_=null,r.renderedRenderOrder_=null,r.replayGroup_=null,r.replayGroupChanged=!0,r}return Lp(e,t),e.prototype.useContainer=function(e,r,n){n<1&&(e=null);t.prototype.useContainer.call(this,e,r,n)},e.prototype.renderFrame=function(t,e){var r=t.pixelRatio,n=t.layerStatesArray[t.layerIndex];!function(t,e,r){We(t,e,0,0,r,0,0)}(this.pixelTransform,1/r,1/r);qe(this.inversePixelTransform,this.pixelTransform);var i=Je(this.pixelTransform);this.useContainer(e,i,n.opacity);var o=this.context,a=o.canvas,s=this.replayGroup_;if(!s||s.isEmpty())return!this.containerReused&&a.width>0&&(a.width=0),this.container;var u=Math.round(t.size[0]*r),l=Math.round(t.size[1]*r);a.width!=u||a.height!=l?(a.width=u,a.height=l,a.style.transform!==i&&(a.style.transform=i)):this.containerReused||o.clearRect(0,0,u,l);this.preRender(o,t);var h=t.extent,c=t.viewState,p=c.center,f=c.resolution,d=c.projection,_=c.rotation,g=d.getExtent(),y=this.getLayer().getSource(),v=!1;if(n.extent){var m=Ye(n.extent,d);(v=!it(m,t.extent)&&bt(m,t.extent))&&this.clip(o,t,m)}var E=t.viewHints,T=!(E[Dn]||E[Gn]),S=this.getRenderTransform(p,f,_,r,u,l,0),w=this.getLayer().getDeclutter()?{}:null;if(s.execute(o,S,_,T,void 0,w),y.getWrapX()&&d.canWrapX()&&!it(g,h)){for(var x=h[0],O=It(g),R=0,C=void 0;x<g[0];){C=O*--R;var P=this.getRenderTransform(p,f,_,r,u,l,C);s.execute(o,P,_,T,void 0,w);x+=O}for(R=0,x=h[2];x>g[2];){C=O*++R;var I=this.getRenderTransform(p,f,_,r,u,l,C);s.execute(o,I,_,T,void 0,w);x-=O}}if(w){var b=t.viewHints;Cp(w,o,_,1,!(b[Dn]||b[Gn]),t.declutterItems)}v&&o.restore();this.postRender(o,t);var L=n.opacity,M=this.container;return L!==parseFloat(M.style.opacity)&&(M.style.opacity=1===L?"":L),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e){this.hitDetectionImageData_||this.animatingOrInteracting_?e(bp(t,this.renderedFeatures_,this.hitDetectionImageData_)):requestAnimationFrame(function(){var r=[this.context.canvas.width,this.context.canvas.height];Ze(this.pixelTransform,r);var n=this.renderedCenter_,i=this.renderedResolution_,o=this.renderedRotation_,a=this.renderedProjection_,s=this.renderedExtent_,u=this.getLayer(),l=[],h=r[0]/2,c=r[1]/2;l.push(this.getRenderTransform(n,i,o,.5,h,c,0).slice());var p=u.getSource(),f=a.getExtent();if(p.getWrapX()&&a.canWrapX()&&!it(f,s)){for(var d=s[0],_=It(f),g=0,y=void 0;d<f[0];)y=_*--g,l.push(this.getRenderTransform(n,i,o,.5,h,c,y).slice()),d+=_;for(g=0,d=s[2];d>f[2];)y=_*++g,l.push(this.getRenderTransform(n,i,o,.5,h,c,y).slice()),d-=_}this.hitDetectionImageData_=Ip(r,l,this.renderedFeatures_,u.getStyleFunction(),s,i,o);e(bp(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i){if(this.replayGroup_){var a=e.viewState.resolution,s=e.viewState.rotation,u=this.getLayer(),l={};return this.replayGroup_.forEachFeatureAtCoordinate(t,a,s,r,function(t){var e=o(t);if(!(e in l))return l[e]=!0,n(t,u)},u.getDeclutter()?i:null)}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var e=this.getLayer(),r=e.getSource(),n=t.viewHints[Dn],i=t.viewHints[Gn],o=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(!this.dirty_&&!o&&n||!a&&i)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var s=t.extent,u=t.viewState,l=u.projection,h=u.resolution,c=t.pixelRatio,p=e.getRevision(),f=e.getRenderBuffer(),d=e.getRenderOrder();void 0===d&&(d=Ua);var _=u.center.slice(),g=tt(s,f*h),y=u.projection.getExtent();if(r.getWrapX()&&u.projection.canWrapX()&&!it(y,t.extent)){var v=It(y),m=Math.max(It(g)/2,v);g[0]=y[0]-m;g[2]=y[2]+m;var E=Math.floor((_[0]-y[0])/v);_[0]-=E*v}if(!this.dirty_&&this.renderedResolution_==h&&this.renderedRevision_==p&&this.renderedRenderOrder_==d&&it(this.renderedExtent_,g))return this.replayGroupChanged=!1,!0;this.replayGroup_&&this.replayGroup_.dispose();this.replayGroup_=null;this.dirty_=!1;var T,S=new cp(Ya(h,c),g,h,c,e.getDeclutter()),w=je();w?(r.loadFeatures(Be(g,l),h,w),T=be(w,l)):r.loadFeatures(g,h,l);var x=Ba(h,c),O=function(t){var r,n=t.getStyleFunction()||e.getStyleFunction();if(n&&(r=n(t,h)),r){var i=this.renderFeature(t,x,r,S,T);this.dirty_=this.dirty_||i}}.bind(this),R=Be(g,l),C=r.getFeaturesInExtent(R);d&&C.sort(d);for(var P=0,I=C.length;P<I;++P)O(C[P]);this.renderedFeatures_=C;var b=S.finish(),L=new Pp(g,h,c,r.getOverlaps(),b,e.getRenderBuffer());return this.renderedResolution_=h,this.renderedRevision_=p,this.renderedRenderOrder_=d,this.renderedExtent_=g,this.renderedRotation_=u.rotation,this.renderedCenter_=_,this.renderedProjection_=l,this.replayGroup_=L,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,r,n,i){if(!r)return!1;var o=!1;if(Array.isArray(r))for(var a=0,s=r.length;a<s;++a)o=za(n,t,r[a],e,this.boundHandleStyleImageChange_,i)||o;else o=za(n,t,r,e,this.boundHandleStyleImageChange_,i);return o},e}(Dh),Fp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ap=function(t){function e(e){var r=t.call(this,e)||this;return r.vectorRenderer_=new Mp(e),r.layerImageRatio_=e.getImageRatio(),r.coordinateToVectorPixelTransform_=[1,0,0,1,0,0],r.renderedPixelToCoordinateTransform_=null,r}return Fp(e,t),e.prototype.disposeInternal=function(){this.vectorRenderer_.dispose();t.prototype.disposeInternal.call(this)},e.prototype.getFeatures=function(t){if(this.vectorRenderer_){var e=Ze(this.coordinateToVectorPixelTransform_,Ze(this.renderedPixelToCoordinateTransform_,t.slice()));return this.vectorRenderer_.getFeatures(e)}return new Promise(function(t){t([])})},e.prototype.handleFontsChanged=function(){this.vectorRenderer_.handleFontsChanged()},e.prototype.prepareFrame=function(t){var e=t.pixelRatio,r=t.viewState,n=r.resolution,i=t.viewHints,o=this.vectorRenderer_,a=t.extent;1!==this.layerImageRatio_&&Mt(a=a.slice(0),this.layerImageRatio_);var s=It(a)/n,u=Ot(a)/n;if(!i[Dn]&&!i[Gn]&&!Lt(a)){o.useContainer(null,null,1);var l=o.context,h=p({},t,{declutterItems:[],size:[s,u],viewState:p({},t.viewState,{rotation:0})}),c=new ph(a,n,e,l.canvas,function(t){o.prepareFrame(h)&&o.replayGroupChanged&&(o.renderFrame(h,null),Xa(h,null),t())});c.addEventListener(N.CHANGE,function(){c.getState()===Da.LOADED&&(this.image_=c)}.bind(this));c.load()}if(this.image_){var f=this.image_,d=f.getResolution()*e/f.getPixelRatio();this.renderedResolution=d;this.renderedPixelToCoordinateTransform_=t.pixelToCoordinateTransform.slice();this.coordinateToVectorPixelTransform_=He(this.coordinateToVectorPixelTransform_,s/2,u/2,1/d,-1/d,0,-r.center[0],-r.center[1])}return!!this.image_},e.prototype.preRender=function(){},e.prototype.postRender=function(){},e.prototype.forEachFeatureAtCoordinate=function(e,r,n,i,o){return this.vectorRenderer_?this.vectorRenderer_.forEachFeatureAtCoordinate(e,r,n,i,o):t.prototype.forEachFeatureAtCoordinate.call(this,e,r,n,i,o)},e}(jh),Np={IMAGE:"image",HYBRID:"hybrid"},Dp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Gp={image:[Ga.POLYGON,Ga.CIRCLE,Ga.LINE_STRING,Ga.IMAGE,Ga.TEXT],hybrid:[Ga.POLYGON,Ga.LINE_STRING]},jp={image:[Ga.DEFAULT],hybrid:[Ga.IMAGE,Ga.TEXT,Ga.DEFAULT]},kp=function(t){function e(e){var r=t.call(this,e)||this;return r.boundHandleStyleImageChange_=r.handleStyleImageChange_.bind(r),r.dirty_=!1,r.renderedLayerRevision_,r.renderedPixelToCoordinateTransform_=null,r.renderedRotation_,r.renderTileImageQueue_={},r.tileListenerKeys_={},r.tmpTransform_=[1,0,0,1,0,0],r}return Dp(e,t),e.prototype.prepareTile=function(t,e,r,n){var i,a=o(t),s=t.getState();return(s===wn.LOADED&&t.hifi||s===wn.ERROR||s===wn.ABORT)&&a in this.tileListenerKeys_&&(v(this.tileListenerKeys_[a]),delete this.tileListenerKeys_[a]),s!==wn.LOADED&&s!==wn.ERROR||(this.updateExecutorGroup_(t,e,r),this.tileImageNeedsRender_(t,e,r)&&(i=!0,n&&(this.renderTileImageQueue_[a]=t))),i},e.prototype.getTile=function(e,r,n,i){var a=t.prototype.getTile.call(this,e,r,n,i),s=i.pixelRatio,u=i.viewState,l=u.resolution,h=u.projection;if(a.getState()<wn.LOADED){a.wantedResolution=l;var c=o(a);if(!(c in this.tileListenerKeys_)){var p=g(a,N.CHANGE,this.prepareTile.bind(this,a,s,h,!0));this.tileListenerKeys_[c]=p}}else{var f=i.viewHints;!!(f[Dn]||f[Gn])&&a.wantedResolution||(a.wantedResolution=l);this.prepareTile(a,s,h,!1)&&this.renderTileImage_(a,i)}return a},e.prototype.isDrawableTile=function(e){return t.prototype.isDrawableTile.call(this,e)&&e.hasContext(this.getLayer())},e.prototype.getTileImage=function(t){return t.getImage(this.getLayer())},e.prototype.prepareFrame=function(e){var r=this.getLayer().getRevision();return this.renderedLayerRevision_!=r&&(this.renderedTiles.length=0),this.renderedLayerRevision_=r,t.prototype.prepareFrame.call(this,e)},e.prototype.updateExecutorGroup_=function(t,e,r){var n=this.getLayer(),i=n.getRevision(),a=n.getRenderOrder()||null,s=t.wantedResolution,u=t.getReplayState(n);if(u.dirty||u.renderedResolution!==s||u.renderedRevision!=i||u.renderedRenderOrder!=a||u.renderedZ!==t.sourceZ){var l=n.getSource(),h=l.getTileGrid(),c=l.getTileGridForProjection(r).getTileCoordExtent(t.wrappedTileCoord),p=l.getSourceTiles(e,r,t),f=o(n),d=t.executorGroups[f];if(d)for(var _=0,g=d.length;_<g;++_)d[_].dispose();t.hitDetectionImageData=null;t.executorGroups[f]=[];for(var y=function(r){var o=p[r];if(o.getState()!=wn.LOADED)return"continue";var d=o.tileCoord,_=h.getTileCoordExtent(d),g=Rt(c,_),y=pt(_,g)?null:tt(g,n.getRenderBuffer()*s,v.tmpExtent);u.dirty=!1;var m=new cp(0,g,s,e,n.getDeclutter()),E=Ba(s,e),T=function(t){var e,r=t.getStyleFunction()||n.getStyleFunction();if(r&&(e=r(t,s)),e){var i=this.renderFeature(t,E,e,m);this.dirty_=this.dirty_||i;u.dirty=u.dirty||i}},S=o.getFeatures();a&&a!==u.renderedRenderOrder&&S.sort(a);for(var w=0,x=S.length;w<x;++w){var O=S[w];y&&!bt(y,O.getGeometry().getExtent())||T.call(v,O)}var R=m.finish(),C=n.getDeclutter()&&1===p.length?null:g,P=new Pp(C,s,e,l.getOverlaps(),R,n.getRenderBuffer());t.executorGroups[f].push(P)},v=this,m=0,E=p.length;m<E;++m)y(m);u.renderedRevision=i;u.renderedZ=t.sourceZ;u.renderedRenderOrder=a;u.renderedResolution=s}},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i){var a=e.viewState.resolution,s=e.viewState.rotation;r=null==r?0:r;for(var u,c=this.getLayer(),p=c.getDeclutter(),f=c.getSource().getTileGridForProjection(e.viewState.projection),d={},_=this.renderedTiles,g=function(){var e=_[l],h=nt(f.getTileCoordExtent(e.wrappedTileCoord),t);if(!p&&!h)return"continue";for(var g=e.executorGroups[o(c)],y=0,v=g.length;y<v;++y){var m=g[y];u=u||m.forEachFeatureAtCoordinate(t,a,s,r,function(t){if(h||i&&-1!==i.indexOf(t)){var e=t.getId();if(void 0===e&&(e=o(t)),!(e in d))return d[e]=!0,n(t,c)}},c.getDeclutter()?i:null)}},l=0,h=_.length;l<h;++l)g();return u},e.prototype.getFeatures=function(t){return new Promise(function(e){for(var n,i=this.getLayer(),o=i.getSource(),a=this.renderedProjection,s=a.getExtent(),u=this.renderedResolution,l=o.getTileGridForProjection(a),h=Ze(this.renderedPixelToCoordinateTransform_,t.slice()),c=l.getTileCoordForCoordAndResolution(h,u),p=0,f=this.renderedTiles.length;p<f;++p)if(c.toString()===this.renderedTiles[p].tileCoord.toString()){if((n=this.renderedTiles[p]).getState()===wn.LOADED&&n.hifi){var d=l.getTileCoordExtent(n.tileCoord);if(o.getWrapX()&&a.canWrapX()&&!it(s,d)){var _=It(s),g=Math.floor((h[0]-s[0])/_);h[0]-=g*_}break}n=void 0}if(n){var y=Ct(l.getTileCoordExtent(n.wrappedTileCoord)),v=[(h[0]-y[0])/u,(y[1]-h[1])/u],m=n.getSourceTiles().reduce(function(t,e){return t.concat(e.getFeatures())},[]);if(n.hitDetectionImageData)e(bp(v,m,n.hitDetectionImageData));else{var E=xi(l.getTileSize(l.getZForResolution(u))),T=[E[0]/2,E[1]/2],S=this.renderedRotation_,w=[this.getRenderTransform(l.getTileCoordCenter(n.wrappedTileCoord),u,0,.5,T[0],T[1],0)];requestAnimationFrame(function(){n.hitDetectionImageData=Ip(E,w,m,i.getStyleFunction(),l.getTileCoordExtent(n.wrappedTileCoord),n.getReplayState(i).renderedResolution,S);e(bp(v,m,n.hitDetectionImageData))})}}else e([])}.bind(this))},e.prototype.handleFontsChanged=function(){f(this.renderTileImageQueue_);var t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()},e.prototype.handleStyleImageChange_=function(){this.renderIfReadyAndVisible()},e.prototype.renderFrame=function(e,r){var n=e.viewHints,i=!(n[Dn]||n[Gn]);this.renderQueuedTileImages_(i,e);t.prototype.renderFrame.call(this,e,r);this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice();this.renderedRotation_=e.viewState.rotation;var a=this.getLayer(),s=a.getRenderMode();if(s===Np.IMAGE)return this.container;var u=a.getSource(),l=e.usedTiles[o(u)];for(var h in this.renderTileImageQueue_)l&&h in l||delete this.renderTileImageQueue_[h];for(var c=this.context,p=a.getDeclutter()?{}:null,f=jp[s],d=e.pixelRatio,_=e.viewState,g=_.center,y=_.resolution,v=_.rotation,m=e.size,E=Math.round(m[0]*d),T=Math.round(m[1]*d),S=this.renderedTiles,w=u.getTileGridForProjection(e.viewState.projection),x=[],O=[],R=S.length-1;R>=0;--R){var C=S[R];if(C.getState()!=wn.ABORT)for(var P=C.tileCoord,I=w.getTileCoordExtent(C.wrappedTileCoord),b=w.getTileCoordExtent(P,this.tmpExtent)[0]-I[0],L=Ve(Ke(this.inversePixelTransform.slice(),1/d,1/d),this.getRenderTransform(g,y,v,d,E,T,b)),M=C.executorGroups[o(a)],F=!1,A=0,N=M.length;A<N;++A){var D=M[A];if(D.hasExecutors(f)){var G=C.tileCoord[0],j=void 0;if(!p&&!F){j=D.getClipCoords(L);c.save();for(var k=0,U=x.length;k<U;++k){var B=x[k];G<O[k]&&(c.beginPath(),c.moveTo(j[0],j[1]),c.lineTo(j[2],j[3]),c.lineTo(j[4],j[5]),c.lineTo(j[6],j[7]),c.moveTo(B[6],B[7]),c.lineTo(B[4],B[5]),c.lineTo(B[2],B[3]),c.lineTo(B[0],B[1]),c.clip())}}D.execute(c,L,v,i,f,p);p||F||(c.restore(),x.push(j),O.push(G),F=!0)}}}return p&&Cp(p,c,v,e.layerStatesArray[e.layerIndex].opacity,i,e.declutterItems),this.container},e.prototype.renderQueuedTileImages_=function(t,e){for(var r in this.renderTileImageQueue_){if(!t&&Date.now()-e.time>8){e.animate=!0;break}var n=this.renderTileImageQueue_[r];delete this.renderTileImageQueue_[r];this.renderTileImage_(n,e)}},e.prototype.renderFeature=function(t,e,r,n){if(!r)return!1;var i=!1;if(Array.isArray(r))for(var o=0,a=r.length;o<a;++o)i=za(n,t,r[o],e,this.boundHandleStyleImageChange_)||i;else i=za(n,t,r,e,this.boundHandleStyleImageChange_);return i},e.prototype.tileImageNeedsRender_=function(t){var n=this.getLayer(),i=t.getReplayState(n),o=n.getRevision(),a=t.sourceZ,s=t.wantedResolution;return i.renderedTileResolution!==s||i.renderedTileRevision!==o||i.renderedTileZ!==a},e.prototype.renderTileImage_=function(t,e){var r=this.getLayer(),n=t.getReplayState(r),i=r.getRevision(),a=t.executorGroups[o(r)];n.renderedTileRevision=i;n.renderedTileZ=t.sourceZ;var s=t.wrappedTileCoord,u=s[0],l=r.getSource(),h=e.pixelRatio,c=e.viewState.projection,p=l.getTileGridForProjection(c),f=p.getResolution(t.tileCoord[0]),d=e.pixelRatio/t.wantedResolution*f,_=p.getResolution(u),g=t.getContext(r);h=Math.max(h,d/h);var y=l.getTilePixelSize(u,h,c);g.canvas.width=y[0];g.canvas.height=y[1];var v=h/d;if(1!==v){var m=Xe(this.tmpTransform_);Ke(m,v,v);g.setTransform.apply(g,m)}var E=p.getTileCoordExtent(s,this.tmpExtent),T=d/_,S=Xe(this.tmpTransform_);Ke(S,T,-T),function(t,e,r){Ve(t,We(ze,1,0,0,1,e,r))}(S,-E[0],-E[3]);for(var w=0,x=a.length;w<x;++w)a[w].execute(g,S,0,!0,Gp[r.getRenderMode()]);n.renderedTileResolution=t.wantedResolution},e}(Zh),Up=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Bp=function(t){function e(e){return t.call(this,e)||this}return Up(e,t),e.prototype.createRenderer=function(){return new Mp(this)},e}(Xc);function Yp(t,e,r,n,i,o){var a=NaN,s=NaN,u=(r-e)/n;if(1===u)a=t[e],s=t[e+1];else if(2==u)a=(1-i)*t[e]+i*t[e+n],s=(1-i)*t[e+1]+i*t[e+n+1];else if(0!==u){for(var l=t[e],h=t[e+1],c=0,p=[0],f=e+n;f<r;f+=n){var d=t[f],_=t[f+1];c+=Math.sqrt((d-l)*(d-l)+(_-h)*(_-h));p.push(c);l=d;h=_}var g=i*c,y=function(t,e,r){for(var n,i,o=r||E,a=0,s=t.length,u=!1;a<s;)(i=+o(t[n=a+(s-a>>1)],e))<0?a=n+1:(s=n,u=!i);return u?a:~a}(p,g);if(y<0){var v=(g-p[-y-2])/(p[-y-1]-p[-y-2]),m=e+(-y-2)*n;a=Wt(t[m],t[m+n],v);s=Wt(t[m+1],t[m+n+1],v)}else a=t[e+y*n],s=t[e+y*n+1]}return o?(o[0]=a,o[1]=s,o):[a,s]}function zp(t,e,r,n,i,o){if(r==e)return null;var a;if(i<t[e+n-1])return o?((a=t.slice(e,e+n))[n-1]=i,a):null;if(t[r-1]<i)return o?((a=t.slice(r-n,r))[n-1]=i,a):null;if(i==t[e+n-1])return t.slice(e,e+n);for(var s=e/n,u=r/n;s<u;){var l=s+u>>1;i<t[(l+1)*n-1]?u=l:s=l+1}var h=t[s*n-1];if(i==h)return t.slice((s-1)*n,(s-1)*n+n);var c=(i-h)/(t[(s+1)*n-1]-h);a=[];for(var p=0;p<n-1;++p)a.push(Wt(t[(s-1)*n+p],t[s*n+p],c));return a.push(i),a}var Xp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Vp=function(t){function e(e,r){var n=t.call(this)||this;return n.flatMidpoint_=null,n.flatMidpointRevision_=-1,n.maxDelta_=-1,n.maxDeltaRevision_=-1,void 0===r||Array.isArray(e[0])?n.setCoordinates(e,r):n.setFlatCoordinates(r,e),n}return Xp(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?x(this.flatCoordinates,t):this.flatCoordinates=t.slice();this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,r,n){return n<rt(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(sr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),lr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,r,n))},e.prototype.forEachSegment=function(t){return Lr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=At.XYM&&this.layout!=At.XYZM)return null;var r=void 0!==e&&e;return zp(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r)},e.prototype.getCoordinates=function(){return dr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return Yp(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e)},e.prototype.getLength=function(){return pp(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[];return r.length=yr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r,0),new e(r,At.XY)},e.prototype.getType=function(){return Nt.LINE_STRING},e.prototype.intersectsExtent=function(t){return Mr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1);this.flatCoordinates||(this.flatCoordinates=[]);this.flatCoordinates.length=pr(this.flatCoordinates,0,t,this.stride);this.changed()},e}(nr);function Wp(t,e,r){for(var n,i,o,a,s,u,l=[],h=t(0),c=t(1),p=e(h),f=e(c),d=[c,h],_=[f,p],g=[1,0],y={},v=1e5;--v>0&&g.length>0;)o=g.pop(),h=d.pop(),p=_.pop(),(u=o.toString())in y||(l.push(p[0],p[1]),y[u]=!0),a=g.pop(),c=d.pop(),f=_.pop(),Bt((i=e(n=t(s=(o+a)/2)))[0],i[1],p[0],p[1],f[0],f[1])<r?(l.push(f[0],f[1]),y[u=a.toString()]=!0):(g.push(a,s,s,o),_.push(f,i,i,p),d.push(c,n,n,h));return l}var Zp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Kp=new Mu({color:"rgba(0,0,0,0.2)"}),Hp=[90,45,30,20,10,5,2,1,.5,.2,.1,.05,.01,.005,.002,.001],qp=function(t){function e(e){var r=this,n=e||{},i=p({updateWhileAnimating:!0,updateWhileInteracting:!0,renderBuffer:0},n);return delete i.maxLines,delete i.strokeStyle,delete i.targetSize,delete i.showLabels,delete i.lonLabelFormatter,delete i.latLabelFormatter,delete i.lonLabelPosition,delete i.latLabelPosition,delete i.lonLabelStyle,delete i.latLabelStyle,delete i.intervals,(r=t.call(this,i)||this).projection_=null,r.maxLat_=1/0,r.maxLon_=1/0,r.minLat_=-1/0,r.minLon_=-1/0,r.maxLatP_=1/0,r.maxLonP_=1/0,r.minLatP_=-1/0,r.minLonP_=-1/0,r.targetSize_=void 0!==n.targetSize?n.targetSize:100,r.maxLines_=void 0!==n.maxLines?n.maxLines:100,r.meridians_=[],r.parallels_=[],r.strokeStyle_=void 0!==n.strokeStyle?n.strokeStyle:Kp,r.fromLonLatTransform_=void 0,r.toLonLatTransform_=void 0,r.projectionCenterLonLat_=null,r.meridiansLabels_=null,r.parallelsLabels_=null,n.showLabels&&(r.lonLabelFormatter_=null==n.lonLabelFormatter?Vn.bind(r,"EW"):n.lonLabelFormatter,r.latLabelFormatter_=null==n.latLabelFormatter?Vn.bind(r,"NS"):n.latLabelFormatter,r.lonLabelPosition_=null==n.lonLabelPosition?0:n.lonLabelPosition,r.latLabelPosition_=null==n.latLabelPosition?1:n.latLabelPosition,r.lonLabelStyleBase_=new ju({text:void 0!==n.lonLabelStyle?n.lonLabelStyle.clone():new Bu({font:"12px Calibri,sans-serif",textBaseline:"bottom",fill:new Eu({color:"rgba(0,0,0,1)"}),stroke:new Mu({color:"rgba(255,255,255,1)",width:3})})}),r.lonLabelStyle_=function(t){var e=t.get("graticule_label");return this.lonLabelStyleBase_.getText().setText(e),this.lonLabelStyleBase_}.bind(r),r.latLabelStyleBase_=new ju({text:void 0!==n.latLabelStyle?n.latLabelStyle.clone():new Bu({font:"12px Calibri,sans-serif",textAlign:"right",fill:new Eu({color:"rgba(0,0,0,1)"}),stroke:new Mu({color:"rgba(255,255,255,1)",width:3})})}),r.latLabelStyle_=function(t){var e=t.get("graticule_label");return this.latLabelStyleBase_.getText().setText(e),this.latLabelStyleBase_}.bind(r),r.meridiansLabels_=[],r.parallelsLabels_=[]),r.intervals_=void 0!==n.intervals?n.intervals:Hp,r.setSource(new Dl({loader:r.loaderFunction.bind(r),strategy:ss,features:new Z,overlaps:!1,useSpatialIndex:!1,wrapX:n.wrapX})),r.featurePool_=[],r.lineStyle_=new ju({stroke:r.strokeStyle_}),r.renderedExtent_=null,r.setRenderOrder(null),r.tmpExtent_=null,r}return Zp(e,t),e.prototype.loaderFunction=function(t,e,r){var n=this.getSource(),i=Rt(this.getExtent()||[-1/0,-1/0,1/0,1/0],t,this.tmpExtent_);if(setTimeout(function(){n.removeLoadedExtent(t)},0),!(this.renderedExtent_&&pt(this.renderedExtent_,i)||(this.renderedExtent_=i,Lt(i)))){var o=St(i),a=e*e/4;this.projection_&&Ie(this.projection_,r)||this.updateProjectionInfo_(r);this.createGraticule_(i,o,e,a);var s,u=this.meridians_.length+this.parallels_.length;for(this.meridiansLabels_&&(u+=this.meridiansLabels_.length),this.parallelsLabels_&&(u+=this.parallelsLabels_.length);u>this.featurePool_.length;)s=new q,this.featurePool_.push(s);var l=n.getFeaturesCollection();l.clear();for(var p,f=0,h=0,c=this.meridians_.length;h<c;++h)(s=this.featurePool_[f++]).setGeometry(this.meridians_[h]),s.setStyle(this.lineStyle_),l.push(s);for(h=0,c=this.parallels_.length;h<c;++h)(s=this.featurePool_[f++]).setGeometry(this.parallels_[h]),s.setStyle(this.lineStyle_),l.push(s);if(this.meridiansLabels_)for(h=0,c=this.meridiansLabels_.length;h<c;++h)p=this.meridiansLabels_[h],(s=this.featurePool_[f++]).setGeometry(p.geom),s.setStyle(this.lonLabelStyle_),s.set("graticule_label",p.text),l.push(s);if(this.parallelsLabels_)for(h=0,c=this.parallelsLabels_.length;h<c;++h)p=this.parallelsLabels_[h],(s=this.featurePool_[f++]).setGeometry(p.geom),s.setStyle(this.latLabelStyle_),s.set("graticule_label",p.text),l.push(s)}},e.prototype.addMeridian_=function(t,e,r,n,i,o){var a=this.getMeridian_(t,e,r,n,o);if(bt(a.getExtent(),i)){if(this.meridiansLabels_){var s=this.getMeridianPoint_(a,i,o);this.meridiansLabels_[o]={geom:s,text:this.lonLabelFormatter_(t)}}this.meridians_[o++]=a}return o},e.prototype.addParallel_=function(t,e,r,n,i,o){var a=this.getParallel_(t,e,r,n,o);if(bt(a.getExtent(),i)){if(this.parallelsLabels_){var s=this.getParallelPoint_(a,i,o);this.parallelsLabels_[o]={geom:s,text:this.latLabelFormatter_(t)}}this.parallels_[o++]=a}return o},e.prototype.createGraticule_=function(t,e,r,n){var i=this.getInterval_(r);if(-1==i)return this.meridians_.length=0,this.parallels_.length=0,this.meridiansLabels_&&(this.meridiansLabels_.length=0),void(this.parallelsLabels_&&(this.parallelsLabels_.length=0));var o,a,s,u,l=this.toLonLatTransform_(e),h=l[0],c=l[1],p=this.maxLines_,f=[Math.max(t[0],this.minLonP_),Math.max(t[1],this.minLatP_),Math.min(t[2],this.maxLonP_),Math.min(t[3],this.maxLatP_)],d=(f=Fe(f,this.projection_,"EPSG:4326"))[3],_=f[2],g=f[1],y=f[0];for(u=kt(h=Math.floor(h/i)*i,this.minLon_,this.maxLon_),a=this.addMeridian_(u,g,d,n,t,0),o=0;u!=this.minLon_&&o++<p;)u=Math.max(u-i,this.minLon_),a=this.addMeridian_(u,g,d,n,t,a);for(u=kt(h,this.minLon_,this.maxLon_),o=0;u!=this.maxLon_&&o++<p;)u=Math.min(u+i,this.maxLon_),a=this.addMeridian_(u,g,d,n,t,a);for(this.meridians_.length=a,this.meridiansLabels_&&(this.meridiansLabels_.length=a),s=kt(c=Math.floor(c/i)*i,this.minLat_,this.maxLat_),a=this.addParallel_(s,y,_,n,t,0),o=0;s!=this.minLat_&&o++<p;)s=Math.max(s-i,this.minLat_),a=this.addParallel_(s,y,_,n,t,a);for(s=kt(c,this.minLat_,this.maxLat_),o=0;s!=this.maxLat_&&o++<p;)s=Math.min(s+i,this.maxLat_),a=this.addParallel_(s,y,_,n,t,a);this.parallels_.length=a;this.parallelsLabels_&&(this.parallelsLabels_.length=a)},e.prototype.getInterval_=function(t){for(var e=this.projectionCenterLonLat_[0],r=this.projectionCenterLonLat_[1],n=-1,i=Math.pow(this.targetSize_*t,2),o=[],a=[],s=0,u=this.intervals_.length;s<u;++s){var l=this.intervals_[s]/2;if(o[0]=e-l,o[1]=r-l,a[0]=e+l,a[1]=r+l,this.fromLonLatTransform_(o,o),this.fromLonLatTransform_(a,a),Math.pow(a[0]-o[0],2)+Math.pow(a[1]-o[1],2)<=i)break;n=this.intervals_[s]}return n},e.prototype.getMeridian_=function(t,e,r,n,i){var o=function(t,e,r,n,i){return Wp(function(n){return[t,e+(r-e)*n]},Le(we("EPSG:4326"),n),i)}(t,e,r,this.projection_,n),a=this.meridians_[i];return a?(a.setFlatCoordinates(At.XY,o),a.changed()):(a=new Vp(o,At.XY),this.meridians_[i]=a),a},e.prototype.getMeridianPoint_=function(t,e,r){var n,i=t.getFlatCoordinates(),o=Math.max(e[1],i[1]),a=Math.min(e[3],i[i.length-1]),s=kt(e[1]+Math.abs(e[1]-e[3])*this.lonLabelPosition_,o,a),u=[i[0],s];return r in this.meridiansLabels_?(n=this.meridiansLabels_[r].geom).setCoordinates(u):n=new Or(u),n},e.prototype.getMeridians=function(){return this.meridians_},e.prototype.getParallel_=function(t,e,r,n,i){var o=function(t,e,r,n,i){return Wp(function(n){return[e+(r-e)*n,t]},Le(we("EPSG:4326"),n),i)}(t,e,r,this.projection_,n),a=this.parallels_[i];return a?(a.setFlatCoordinates(At.XY,o),a.changed()):a=new Vp(o,At.XY),a},e.prototype.getParallelPoint_=function(t,e,r){var n,i=t.getFlatCoordinates(),o=Math.max(e[0],i[0]),a=Math.min(e[2],i[i.length-2]),s=[kt(e[0]+Math.abs(e[0]-e[2])*this.latLabelPosition_,o,a),i[1]];return r in this.parallelsLabels_?(n=this.parallelsLabels_[r].geom).setCoordinates(s):n=new Or(s),n},e.prototype.getParallels=function(){return this.parallels_},e.prototype.updateProjectionInfo_=function(t){var e=we("EPSG:4326"),r=t.getWorldExtent(),n=Fe(r,e,t);this.maxLat_=r[3];this.maxLon_=r[2];this.minLat_=r[1];this.minLon_=r[0];this.maxLatP_=n[3];this.maxLonP_=n[2];this.minLatP_=n[1];this.minLonP_=n[0];this.fromLonLatTransform_=Le(e,t);this.toLonLatTransform_=Le(t,e);this.projectionCenterLonLat_=this.toLonLatTransform_(St(t.getExtent()));this.projection_=t},e}(Bp),Jp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qp={BLUR:"blur",GRADIENT:"gradient",RADIUS:"radius"},$p=["#00f","#0ff","#0f0","#ff0","#f00"],tf=function(t){function e(e){var r=this,n=e||{},i=p({},n);delete i.gradient;delete i.radius;delete i.blur;delete i.weight;(r=t.call(this,i)||this).gradient_=null;r.addEventListener(Y(Qp.GRADIENT),r.handleGradientChanged_);r.setGradient(n.gradient?n.gradient:$p);r.setBlur(void 0!==n.blur?n.blur:15);r.setRadius(void 0!==n.radius?n.radius:8);var o=n.weight?n.weight:"weight";return r.weightFunction_="string"==typeof o?function(t){return t.get(o)}:o,r.setRenderOrder(null),r}return Jp(e,t),e.prototype.getBlur=function(){return this.get(Qp.BLUR)},e.prototype.getGradient=function(){return this.get(Qp.GRADIENT)},e.prototype.getRadius=function(){return this.get(Qp.RADIUS)},e.prototype.handleGradientChanged_=function(){this.gradient_=function(t){for(var e=li(1,256),r=e.createLinearGradient(0,0,1,256),n=1/(t.length-1),i=0,o=t.length;i<o;++i)r.addColorStop(i*n,t[i]);return e.fillStyle=r,e.fillRect(0,0,1,256),e.canvas}(this.getGradient())},e.prototype.setBlur=function(t){this.set(Qp.BLUR,t)},e.prototype.setGradient=function(t){this.set(Qp.GRADIENT,t)},e.prototype.setRadius=function(t){this.set(Qp.RADIUS,t)},e.prototype.createRenderer=function(){return new Wc(this,{attributes:[{name:"weight",callback:function(t){var e=this.weightFunction_(t);return void 0!==e?kt(e,0,1):1}.bind(this)}],vertexShader:"\n        precision mediump float;\n        uniform mat4 u_projectionMatrix;\n        uniform mat4 u_offsetScaleMatrix;\n        uniform float u_size;\n        attribute vec2 a_position;\n        attribute float a_index;\n        attribute float a_weight;\n\n        varying vec2 v_texCoord;\n        varying float v_weight;\n\n        void main(void) {\n          mat4 offsetMatrix = u_offsetScaleMatrix;\n          float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n          float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n          vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n          gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n          float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n          float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n          v_texCoord = vec2(u, v);\n          v_weight = a_weight;\n        }",fragmentShader:"\n        precision mediump float;\n        uniform float u_blurSlope;\n\n        varying vec2 v_texCoord;\n        varying float v_weight;\n\n        void main(void) {\n          vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n          float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n          float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n          float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n          gl_FragColor = vec4(alpha, alpha, alpha, alpha);\n        }",hitVertexShader:"\n        precision mediump float;\n        uniform mat4 u_projectionMatrix;\n        uniform mat4 u_offsetScaleMatrix;\n        uniform float u_size;\n        attribute vec2 a_position;\n        attribute float a_index;\n        attribute float a_weight;\n        attribute vec4 a_hitColor;\n\n        varying vec2 v_texCoord;\n        varying float v_weight;\n        varying vec4 v_hitColor;\n\n        void main(void) {\n          mat4 offsetMatrix = u_offsetScaleMatrix;\n          float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n          float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n          vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n          gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n          float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n          float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n          v_texCoord = vec2(u, v);\n          v_hitColor = a_hitColor;\n          v_weight = a_weight;\n        }",hitFragmentShader:"\n        precision mediump float;\n        uniform float u_blurSlope;\n\n        varying vec2 v_texCoord;\n        varying float v_weight;\n        varying vec4 v_hitColor;\n\n        void main(void) {\n          vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n          float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n          float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n          float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n          if (alpha < 0.05) {\n            discard;\n          }\n\n          gl_FragColor = v_hitColor;\n        }",uniforms:{u_size:function(){return 2*(this.get(Qp.RADIUS)+this.get(Qp.BLUR))}.bind(this),u_blurSlope:function(){return this.get(Qp.RADIUS)/Math.max(1,this.get(Qp.BLUR))}.bind(this)},postProcesses:[{fragmentShader:"\n            precision mediump float;\n\n            uniform sampler2D u_image;\n            uniform sampler2D u_gradientTexture;\n\n            varying vec2 v_texCoord;\n\n            void main() {\n              vec4 color = texture2D(u_image, v_texCoord);\n              gl_FragColor.a = color.a;\n              gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb;\n              gl_FragColor.rgb *= gl_FragColor.a;\n            }",uniforms:{u_gradientTexture:this.gradient_}}]})},e}(Bp),ef=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),rf=function(t){function e(e){var r=this,n=e||{},i=p({},n);return delete i.imageRatio,(r=t.call(this,i)||this).imageRatio_=void 0!==n.imageRatio?n.imageRatio:1,r}return ef(e,t),e.prototype.getImageRatio=function(){return this.imageRatio_},e.prototype.createRenderer=function(){return new Ap(this)},e}(Xc),nf=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),of=function(t){function e(e){var r=this,n=e||{},i=p({},n);delete i.preload;delete i.useInterimTilesOnError;r=t.call(this,i)||this;var o=n.renderMode||Np.HYBRID;return K(null==o||o==Np.IMAGE||o==Np.HYBRID,28),r.renderMode_=o,r.setPreload(n.preload?n.preload:0),r.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),r}return nf(e,t),e.prototype.createRenderer=function(){return new kp(this)},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderMode=function(){return this.renderMode_},e.prototype.getPreload=function(){return this.get(Bh)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Yh)},e.prototype.setPreload=function(t){this.set(Bh,t)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Yh,t)},e}(Xc),af=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),sf="addfeatures",uf=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.features=n,o.file=r,o.projection=i,o}return af(e,t),e}(M);function lf(t){for(var e=t.dataTransfer.files,r=0,n=e.length;r<n;++r){var i=e.item(r),o=new FileReader;o.addEventListener(N.LOAD,this.handleResult_.bind(this,i));o.readAsText(i)}}function hf(t){t.stopPropagation();t.preventDefault();t.dataTransfer.dropEffect="copy"}var cf=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,{handleEvent:P})||this).formatConstructors_=n.formatConstructors?n.formatConstructors:[],r.projection_=n.projection?we(n.projection):null,r.dropListenKeys_=null,r.source_=n.source||null,r.target=n.target?n.target:null,r}return af(e,t),e.prototype.handleResult_=function(t,e){var r=e.target.result,n=this.getMap(),i=this.projection_;i||(i=n.getView().getProjection());for(var o=this.formatConstructors_,a=[],s=0,u=o.length;s<u;++s){var l=new o[s];if((a=this.tryReadFeatures_(l,r,{featureProjection:i}))&&a.length>0)break}this.source_&&(this.source_.clear(),this.source_.addFeatures(a));this.dispatchEvent(new uf(sf,t,a,i))},e.prototype.registerListeners_=function(){var t=this.getMap();if(t){var e=this.target?this.target:t.getViewport();this.dropListenKeys_=[g(e,N.DROP,lf,this),g(e,N.DRAGENTER,hf,this),g(e,N.DRAGOVER,hf,this),g(e,N.DROP,hf,this)]}},e.prototype.setActive=function(e){!this.getActive()&&e&&this.registerListeners_();this.getActive()&&!e&&this.unregisterListeners_();t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.unregisterListeners_();t.prototype.setMap.call(this,e);this.getActive()&&this.registerListeners_()},e.prototype.tryReadFeatures_=function(t,e,r){try{return t.readFeatures(e,r)}catch(t){return null}},e.prototype.unregisterListeners_=function(){this.dropListenKeys_&&(this.dropListenKeys_.forEach(v),this.dropListenKeys_=null)},e}(to),pf=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ff=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,n)||this).condition_=n.condition?n.condition:po,r.lastAngle_=void 0,r.lastMagnitude_=void 0,r.lastScaleDelta_=0,r.duration_=void 0!==n.duration?n.duration:400,r}return pf(e,t),e.prototype.handleDragEvent=function(t){if(_o(t)){var e=t.map,r=e.getSize(),n=t.pixel,i=n[0]-r[0]/2,o=r[1]/2-n[1],a=Math.atan2(o,i),s=Math.sqrt(i*i+o*o),u=e.getView();if(void 0!==this.lastAngle_){var l=this.lastAngle_-a;u.adjustRotationInternal(l)}this.lastAngle_=a;void 0!==this.lastMagnitude_&&u.adjustResolutionInternal(this.lastMagnitude_/s);void 0!==this.lastMagnitude_&&(this.lastScaleDelta_=this.lastMagnitude_/s);this.lastMagnitude_=s}},e.prototype.handleUpEvent=function(t){if(!_o(t))return!0;var e=t.map.getView(),r=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,r),this.lastScaleDelta_=0,!1},e.prototype.handleDownEvent=function(t){return!!_o(t)&&!!this.condition_(t)&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0)},e}(mo),df=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),_f=function(t){function e(e,r,n){var i=t.call(this)||this;if(void 0!==n&&void 0===r)i.setFlatCoordinates(n,e);else{var o=r||0;i.setCenterAndRadius(e,o,n)}return i}return df(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),void 0,this.layout)},e.prototype.closestPointXY=function(t,e,r,n){var i=this.flatCoordinates,o=t-i[0],a=e-i[1],s=o*o+a*a;if(s<n){if(0===s)for(var u=0;u<this.stride;++u)r[u]=i[u];else{var l=this.getRadius()/Math.sqrt(s);for(r[0]=i[0]+l*o,r[1]=i[1]+l*a,u=2;u<this.stride;++u)r[u]=i[u]}return r.length=this.stride,s}return n},e.prototype.containsXY=function(t,e){var r=this.flatCoordinates,n=t-r[0],i=e-r[1];return n*n+i*i<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,r=e[this.stride]-e[0];return ut(e[0]-r,e[1]-r,e[0]+r,e[1]+r,t)},e.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},e.prototype.getRadiusSquared_=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e},e.prototype.getType=function(){return Nt.CIRCLE},e.prototype.intersectsExtent=function(t){if(bt(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||t[1]<=e[1]&&t[3]>=e[1]||vt(t,this.intersectsCoordinate.bind(this))}return!1},e.prototype.setCenter=function(t){var e=this.stride,r=this.flatCoordinates[e]-this.flatCoordinates[0],n=t.slice();n[e]=n[0]+r;for(var i=1;i<e;++i)n[e+i]=t[i];this.setFlatCoordinates(this.layout,n);this.changed()},e.prototype.setCenterAndRadius=function(t,e,r){this.setLayout(r,t,0);this.flatCoordinates||(this.flatCoordinates=[]);var n=this.flatCoordinates,i=cr(n,0,t,this.stride);n[i++]=n[0]+e;for(var o=1,a=this.stride;o<a;++o)n[i++]=n[o];n.length=i;this.changed()},e.prototype.getCoordinates=function(){return null},e.prototype.setCoordinates=function(){},e.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t;this.changed()},e.prototype.rotate=function(t,e){var r=this.getCenter(),n=this.getStride();this.setCenter(Gt(r,0,r.length,n,t,e,r));this.changed()},e.prototype.translate=function(t,e){var r=this.getCenter(),n=this.getStride();this.setCenter(jt(r,0,r.length,n,t,e,r));this.changed()},e}(nr);_f.prototype.transform;var gf=_f,yf=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),vf=function(t){function e(e,r,n){var i=t.call(this)||this;if(i.ends_=[],i.maxDelta_=-1,i.maxDeltaRevision_=-1,Array.isArray(e[0]))i.setCoordinates(e,r);else if(void 0!==r&&n)i.setFlatCoordinates(r,e),i.ends_=n;else{for(var o=i.getLayout(),a=e,s=[],u=[],l=0,h=a.length;l<h;++l){var c=a[l];0===l&&(o=c.getLayout());x(s,c.getFlatCoordinates());u.push(s.length)}i.setFlatCoordinates(o,s);i.ends_=u}return i}return yf(e,t),e.prototype.appendLineString=function(t){this.flatCoordinates?x(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice();this.ends_.push(this.flatCoordinates.length);this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},e.prototype.closestPointXY=function(t,e,r,n){return n<rt(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ur(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),hr(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,r,n))},e.prototype.getCoordinateAtM=function(t,e,r){if(this.layout!=At.XYM&&this.layout!=At.XYZM||0===this.flatCoordinates.length)return null;var n=void 0!==e&&e,i=void 0!==r&&r;return function(t,e,r,n,i,o,a){if(a)return zp(t,e,r[r.length-1],n,i,o);var s;if(i<t[n-1])return o?((s=t.slice(0,n))[n-1]=i,s):null;if(t[t.length-1]<i)return o?((s=t.slice(t.length-n))[n-1]=i,s):null;for(var u=0,l=r.length;u<l;++u){var h=r[u];if(e!=h){if(i<t[e+n-1])return null;if(i<=t[h-1])return zp(t,e,h,n,i,!1);e=h}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,n,i)},e.prototype.getCoordinates=function(){return _r(this.flatCoordinates,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getLineString=function(t){return t<0||this.ends_.length<=t?null:new Vp(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,r=this.layout,n=[],i=0,o=0,a=e.length;o<a;++o){var s=e[o],u=new Vp(t.slice(i,s),r);n.push(u);i=s}return n},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,r=0,n=this.ends_,i=this.stride,o=0,a=n.length;o<a;++o){var s=n[o];x(t,Yp(e,r,s,i,.5));r=s}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],n=[];return r.length=vr(this.flatCoordinates,0,this.ends_,this.stride,t,r,0,n),new e(r,At.XY,n)},e.prototype.getType=function(){return Nt.MULTI_LINE_STRING},e.prototype.intersectsExtent=function(t){return function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){if(Mr(t,e,r[o],n,i))return!0;e=r[o]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2);this.flatCoordinates||(this.flatCoordinates=[]);var r=fr(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===r.length?0:r[r.length-1];this.changed()},e}(nr),mf=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ef=function(t){function e(e,r){var n=t.call(this)||this;return r&&!Array.isArray(e[0])?n.setFlatCoordinates(r,e):n.setCoordinates(e,r),n}return mf(e,t),e.prototype.appendPoint=function(t){this.flatCoordinates?x(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice();this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,r,n){if(n<rt(this.getExtent(),t,e))return n;for(var i=this.flatCoordinates,o=this.stride,a=0,s=i.length;a<s;a+=o){var u=Yt(t,e,i[a],i[a+1]);if(u<n){n=u;for(var l=0;l<o;++l)r[l]=i[a+l];r.length=o}}return n},e.prototype.getCoordinates=function(){return dr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getPoint=function(t){var e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new Or(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,r=this.stride,n=[],i=0,o=t.length;i<o;i+=r){var a=new Or(t.slice(i,i+r),e);n.push(a)}return n},e.prototype.getType=function(){return Nt.MULTI_POINT},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,r=this.stride,n=0,i=e.length;n<i;n+=r)if(ot(t,e[n],e[n+1]))return!0;return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1);this.flatCoordinates||(this.flatCoordinates=[]);this.flatCoordinates.length=pr(this.flatCoordinates,0,t,this.stride);this.changed()},e}(nr);function Tf(t,e,r,n){for(var i=[],o=[1/0,1/0,-1/0,-1/0],a=0,s=r.length;a<s;++a){var u=r[a];o=ct(t,e,u[0],n);i.push((o[0]+o[2])/2,(o[1]+o[3])/2);e=u[u.length-1]}return i}var Sf=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wf=function(t){function e(e,r,n){var i=t.call(this)||this;if(i.endss_=[],i.flatInteriorPointsRevision_=-1,i.flatInteriorPoints_=null,i.maxDelta_=-1,i.maxDeltaRevision_=-1,i.orientedRevision_=-1,i.orientedFlatCoordinates_=null,!n&&!Array.isArray(e[0])){for(var o=i.getLayout(),a=e,s=[],u=[],l=0,h=a.length;l<h;++l){var c=a[l];0===l&&(o=c.getLayout());for(var p=s.length,f=c.getEnds(),d=0,_=f.length;d<_;++d)f[d]+=p;x(s,c.getFlatCoordinates());u.push(f)}r=o;e=s;n=u}return void 0!==r&&n?(i.setFlatCoordinates(r,e),i.endss_=n):i.setCoordinates(e,r),i}return Sf(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var r=this.flatCoordinates.length;x(this.flatCoordinates,t.getFlatCoordinates());for(var n=0,i=(e=t.getEnds().slice()).length;n<i;++n)e[n]+=r}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e);this.changed()},e.prototype.clone=function(){for(var t=this.endss_.length,r=new Array(t),n=0;n<t;++n)r[n]=this.endss_[n].slice();return new e(this.flatCoordinates.slice(),this.layout,r)},e.prototype.closestPointXY=function(t,e,r,n){return n<rt(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o];i=ur(t,e,s,n,i);e=s[s.length-1]}return i}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,r,n,i,o,a,s,u,l,h){for(var c=h||[NaN,NaN],p=0,f=r.length;p<f;++p){var d=r[p];l=hr(t,e,d,n,i,o,a,s,u,l,c);e=d[d.length-1]}return l}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,r,n))},e.prototype.containsXY=function(t,e){return function(t,e,r,n,i,o){if(0===r.length)return!1;for(var a=0,s=r.length;a<s;++a){var u=r[a];if(Pr(t,e,u,n,i,o))return!0;e=u[u.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},e.prototype.getArea=function(){return function(t,e,r,n){for(var i=0,o=0,a=r.length;o<a;++o){var s=r[o];i+=or(t,e,s,n);e=s[s.length-1]}return i}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?jr(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,gr(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=Tf(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=br(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t);this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new Ef(this.getFlatInteriorPoints().slice(),At.XYM)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;(function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o];if(!Dr(t,e,s,n,i))return!1;s.length&&(e=s[s.length-1])}return!0})(t,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=jr(this.orientedFlatCoordinates_,0,this.endss_,this.stride));this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],n=[];return r.length=function(t,e,r,n,i,o,a,s){for(var u=0,l=r.length;u<l;++u){var h=r[u],c=[];a=Tr(t,e,h,n,i,o,a,c);s.push(c);e=h[h.length-1]}return a}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),r,0,n),new e(r,At.XY,n)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var r=this.endss_[t-1];e=r[r.length-1]}var n=this.endss_[t].slice(),i=n[n.length-1];if(0!==e)for(var o=0,a=n.length;o<a;++o)n[o]-=e;return new Br(this.flatCoordinates.slice(e,i),this.layout,n)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,r=this.endss_,n=[],i=0,o=0,a=r.length;o<a;++o){var s=r[o].slice(),u=s[s.length-1];if(0!==i)for(var l=0,h=s.length;l<h;++l)s[l]-=i;var c=new Br(e.slice(i,u),t,s);n.push(c);i=u}return n},e.prototype.getType=function(){return Nt.MULTI_POLYGON},e.prototype.intersectsExtent=function(t){return function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o];if(Fr(t,e,s,n,i))return!0;e=s[s.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,3);this.flatCoordinates||(this.flatCoordinates=[]);var r=function(t,e,r,n,i){for(var o=i||[],a=0,s=0,u=r.length;s<u;++s){var l=fr(t,e,r[s],n,o[a]);o[a++]=l;e=l[l.length-1]}return o.length=a,o}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===r.length)this.flatCoordinates.length=0;else{var n=r[r.length-1];this.flatCoordinates.length=0===n.length?0:n[n.length-1]}this.changed()},e}(nr),xf=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Of={POINT:"Point",LINE_STRING:"LineString",POLYGON:"Polygon",CIRCLE:"Circle"},Rf="drawstart",Cf="drawend",Pf=function(t){function e(e,r){var n=t.call(this,e)||this;return n.feature=r,n}return xf(e,t),e}(M),If=function(t){function e(e){var r=this,n=e;n.stopDown||(n.stopDown=I);(r=t.call(this,n)||this).shouldHandle_=!1;r.downPx_=null;r.downTimeout_;r.lastDragTime_;r.freehand_=!1;r.source_=e.source?e.source:null;r.features_=e.features?e.features:null;r.snapTolerance_=e.snapTolerance?e.snapTolerance:12;r.type_=e.type;r.mode_=function(t){var e;return t===Nt.POINT||t===Nt.MULTI_POINT?e=Of.POINT:t===Nt.LINE_STRING||t===Nt.MULTI_LINE_STRING?e=Of.LINE_STRING:t===Nt.POLYGON||t===Nt.MULTI_POLYGON?e=Of.POLYGON:t===Nt.CIRCLE&&(e=Of.CIRCLE),e}(r.type_);r.stopClick_=!!e.stopClick;r.minPoints_=e.minPoints?e.minPoints:r.mode_===Of.POLYGON?3:2;r.maxPoints_=e.maxPoints?e.maxPoints:1/0;r.finishCondition_=e.finishCondition?e.finishCondition:P;var i,o=e.geometryFunction;if(!o)if(r.type_===Nt.CIRCLE)o=function(t,e){var r=e||new gf([NaN,NaN]),n=qn(t[0],t[1]);return r.setCenterAndRadius(t[0],Math.sqrt(n)),r};else{var a,s=r.mode_;s===Of.POINT?a=Or:s===Of.LINE_STRING?a=Vp:s===Of.POLYGON&&(a=Br);o=function(t,e){var r=e;return r?s===Of.POLYGON?t[0].length?r.setCoordinates([t[0].concat([t[0][0]])]):r.setCoordinates([]):r.setCoordinates(t):r=new a(t),r}}return r.geometryFunction_=o,r.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,r.finishCoordinate_=null,r.sketchFeature_=null,r.sketchPoint_=null,r.sketchCoords_=null,r.sketchLine_=null,r.sketchLineCoords_=null,r.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,r.overlay_=new Bp({source:new Dl({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(i=Du(),function(t){return i[t.getGeometry().getType()]}),updateWhileInteracting:!0}),r.geometryName_=e.geometryName,r.condition_=e.condition?e.condition:co,r.freehandCondition_,r.freehandCondition_=e.freehand?so:e.freehandCondition?e.freehandCondition:po,r.addEventListener(Y(Ji.ACTIVE),r.updateState_),r}return xf(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e);this.updateState_()},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleEvent=function(e){e.originalEvent.type===N.CONTEXTMENU&&e.preventDefault();this.freehand_=this.mode_!==Of.POINT&&this.freehandCondition_(e);var r=e.type===un.POINTERMOVE,n=!0;return!this.freehand_&&this.lastDragTime_&&e.type===un.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,r=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)),this.freehand_&&e.type===un.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e),n=!1):this.freehand_&&e.type===un.POINTERDOWN?n=!1:r?(n=e.type===un.POINTERMOVE)&&this.freehand_?n=this.handlePointerMove_(e):("mouse"==e.pointerEvent.pointerType||e.type===un.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===un.DBLCLICK&&(n=!1),t.prototype.handleEvent.call(this,e)&&n},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new hn(un.POINTERMOVE,t.map,t.pointerEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var e=!0;this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0);this.handlePointerMove_(t);var r=this.mode_===Of.CIRCLE;return this.shouldHandle_?(this.finishCoordinate_?this.freehand_||r?this.finishDrawing():this.atFinish_(t)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t):(this.startDrawing_(t),this.mode_===Of.POINT&&this.finishDrawing()),e=!1):this.freehand_&&(this.finishCoordinate_=null,this.abortDrawing_()),!e&&this.stopClick_&&t.stopPropagation(),e},e.prototype.handlePointerMove_=function(t){if(this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,r=t.pixel,n=e[0]-r[0],i=e[1]-r[1],o=n*n+i*i;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return!0}return this.finishCoordinate_?this.modifyDrawing_(t):this.createOrUpdateSketchPoint_(t),!0},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var r=!1,n=[this.finishCoordinate_];if(this.mode_===Of.LINE_STRING)r=this.sketchCoords_.length>this.minPoints_;else if(this.mode_===Of.POLYGON){var i=this.sketchCoords_;r=i[0].length>this.minPoints_;n=[i[0][0],i[0][i[0].length-2]]}if(r)for(var o=t.map,a=0,s=n.length;a<s;a++){var u=n[a],l=o.getPixelFromCoordinate(u),h=t.pixel,c=h[0]-l[0],p=h[1]-l[1],f=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(c*c+p*p)<=f){this.finishCoordinate_=u;break}}}return e},e.prototype.createOrUpdateSketchPoint_=function(t){var e=t.coordinate.slice();this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(e):(this.sketchPoint_=new q(new Or(e)),this.updateSketchFeatures_())},e.prototype.startDrawing_=function(t){var e=t.coordinate;this.finishCoordinate_=e;this.mode_===Of.POINT?this.sketchCoords_=e.slice():this.mode_===Of.POLYGON?(this.sketchCoords_=[[e.slice(),e.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[e.slice(),e.slice()];this.sketchLineCoords_&&(this.sketchLine_=new q(new Vp(this.sketchLineCoords_)));var r=this.geometryFunction_(this.sketchCoords_);this.sketchFeature_=new q;this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_);this.sketchFeature_.setGeometry(r);this.updateSketchFeatures_();this.dispatchEvent(new Pf(Rf,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){var e,r,n,i=t.coordinate,o=this.sketchFeature_.getGeometry();if((this.mode_===Of.POINT?r=this.sketchCoords_:this.mode_===Of.POLYGON?(r=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(t)&&(i=this.finishCoordinate_.slice())):r=(e=this.sketchCoords_)[e.length-1],r[0]=i[0],r[1]=i[1],this.geometryFunction_(this.sketchCoords_,o),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(i),o.getType()==Nt.POLYGON&&this.mode_!==Of.POLYGON){this.sketchLine_||(this.sketchLine_=new q);var a=o.getLinearRing(0);(n=this.sketchLine_.getGeometry())?(n.setFlatCoordinates(a.getLayout(),a.getFlatCoordinates()),n.changed()):(n=new Vp(a.getFlatCoordinates(),a.getLayout()),this.sketchLine_.setGeometry(n))}else this.sketchLineCoords_&&(n=this.sketchLine_.getGeometry()).setCoordinates(this.sketchLineCoords_);this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,r,n=t.coordinate,i=this.sketchFeature_.getGeometry();this.mode_===Of.LINE_STRING?(this.finishCoordinate_=n.slice(),(r=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?r.pop():e=!0),r.push(n.slice()),this.geometryFunction_(r,i)):this.mode_===Of.POLYGON&&((r=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?r.pop():e=!0),r.push(n.slice()),e&&(this.finishCoordinate_=r[0]),this.geometryFunction_(this.sketchCoords_,i));this.updateSketchFeatures_();e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry();this.mode_===Of.LINE_STRING?((t=this.sketchCoords_).splice(-2,1),this.geometryFunction_(t,e),t.length>=2&&(this.finishCoordinate_=t[t.length-2].slice())):this.mode_===Of.POLYGON&&((t=this.sketchCoords_[0]).splice(-2,1),this.sketchLine_.getGeometry().setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e));0===t.length&&(this.finishCoordinate_=null);this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,r=t.getGeometry();this.mode_===Of.LINE_STRING?(e.pop(),this.geometryFunction_(e,r)):this.mode_===Of.POLYGON&&(e[0].pop(),this.geometryFunction_(e,r),e=r.getCoordinates());this.type_===Nt.MULTI_POINT?t.setGeometry(new Ef([e])):this.type_===Nt.MULTI_LINE_STRING?t.setGeometry(new vf([e])):this.type_===Nt.MULTI_POLYGON&&t.setGeometry(new wf([e]));this.dispatchEvent(new Pf(Cf,t));this.features_&&this.features_.push(t);this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return t&&(this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0)),t},e.prototype.extend=function(t){var e=t.getGeometry();this.sketchFeature_=t;this.sketchCoords_=e.getCoordinates();var r=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=r.slice();this.sketchCoords_.push(r.slice());this.updateSketchFeatures_();this.dispatchEvent(new Pf(Rf,this.sketchFeature_))},e.prototype.updateSketchFeatures_=function(){var t=[];this.sketchFeature_&&t.push(this.sketchFeature_);this.sketchLine_&&t.push(this.sketchLine_);this.sketchPoint_&&t.push(this.sketchPoint_);var e=this.overlay_.getSource();e.clear(!0);e.addFeatures(t)},e.prototype.updateState_=function(){var t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing_();this.overlay_.setMap(e?t:null)},e}(mo),bf=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Lf={EXTENTCHANGED:"extentchanged"},Mf=function(t){function e(e){var r=t.call(this,Lf.EXTENTCHANGED)||this;return r.extent=e,r}return bf(e,t),e}(M);function Ff(){var t=Du();return function(){return t[Nt.POLYGON]}}function Af(){var t=Du();return function(){return t[Nt.POINT]}}function Nf(t){return function(e){return $([t,e])}}function Df(t,e){return t[0]==e[0]?function(r){return $([t,[r[0],e[1]]])}:t[1]==e[1]?function(r){return $([t,[e[0],r[1]]])}:null}var Gf=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,n)||this).extent_=null,r.pointerHandler_=null,r.pixelTolerance_=void 0!==n.pixelTolerance?n.pixelTolerance:10,r.snappedToVertex_=!1,r.extentFeature_=null,r.vertexFeature_=null,e||(e={}),r.extentOverlay_=new Bp({source:new Dl({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.boxStyle?e.boxStyle:Ff(),updateWhileAnimating:!0,updateWhileInteracting:!0}),r.vertexOverlay_=new Bp({source:new Dl({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.pointerStyle?e.pointerStyle:Af(),updateWhileAnimating:!0,updateWhileInteracting:!0}),e.extent&&r.setExtent(e.extent),r}return bf(e,t),e.prototype.snapToVertex_=function(t,e){var r=e.getCoordinateFromPixelInternal(t),n=this.getExtentInternal();if(n){var i=function(t){return[[[t[0],t[1]],[t[0],t[3]]],[[t[0],t[3]],[t[2],t[3]]],[[t[2],t[3]],[t[2],t[1]]],[[t[2],t[1]],[t[0],t[1]]]]}(n);i.sort(function(t,e){return Qn(r,t)-Qn(r,e)});var o=i[0],a=Xn(r,o),s=e.getPixelFromCoordinateInternal(a);if(Jn(t,s)<=this.pixelTolerance_){var u=e.getPixelFromCoordinateInternal(o[0]),l=e.getPixelFromCoordinateInternal(o[1]),h=qn(s,u),c=qn(s,l),p=Math.sqrt(Math.min(h,c));return this.snappedToVertex_=p<=this.pixelTolerance_,this.snappedToVertex_&&(a=h>c?o[1]:o[0]),a}}return null},e.prototype.handlePointerMove_=function(t){var e=t.pixel,r=t.map,n=this.snapToVertex_(e,r);n||(n=r.getCoordinateFromPixelInternal(e));this.createOrUpdatePointerFeature_(n)},e.prototype.createOrUpdateExtentFeature_=function(t){var e=this.extentFeature_;return e?t?e.setGeometry(zr(t)):e.setGeometry(void 0):(e=new q(t?zr(t):{}),this.extentFeature_=e,this.extentOverlay_.getSource().addFeature(e)),e},e.prototype.createOrUpdatePointerFeature_=function(t){var e=this.vertexFeature_;return e?e.getGeometry().setCoordinates(t):(e=new q(new Or(t)),this.vertexFeature_=e,this.vertexOverlay_.getSource().addFeature(e)),e},e.prototype.handleEvent=function(e){return!e.pointerEvent||(e.type!=un.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),t.prototype.handleEvent.call(this,e),!1)},e.prototype.handleDownEvent=function(t){var e=t.pixel,r=t.map,n=this.getExtentInternal(),i=this.snapToVertex_(e,r),o=function(t){var e=null,r=null;return t[0]==n[0]?e=n[2]:t[0]==n[2]&&(e=n[0]),t[1]==n[1]?r=n[3]:t[1]==n[3]&&(r=n[1]),null!==e&&null!==r?[e,r]:null};if(i&&n){var a=i[0]==n[0]||i[0]==n[2]?i[0]:null,s=i[1]==n[1]||i[1]==n[3]?i[1]:null;null!==a&&null!==s?this.pointerHandler_=Nf(o(i)):null!==a?this.pointerHandler_=Df(o([a,n[1]]),o([a,n[3]])):null!==s&&(this.pointerHandler_=Df(o([n[0],s]),o([n[2],s])))}else i=r.getCoordinateFromPixelInternal(e),this.setExtent([i[0],i[1],i[0],i[1]]),this.pointerHandler_=Nf(i);return!0},e.prototype.handleDragEvent=function(t){if(this.pointerHandler_){var e=t.coordinate;this.setExtent(this.pointerHandler_(e));this.createOrUpdatePointerFeature_(e)}return!0},e.prototype.handleUpEvent=function(){this.pointerHandler_=null;var e=this.getExtentInternal();return e&&0!==mt(e)||this.setExtent(null),!1},e.prototype.setMap=function(e){this.extentOverlay_.setMap(e);this.vertexOverlay_.setMap(e);t.prototype.setMap.call(this,e)},e.prototype.getExtent=function(){return Be(this.getExtentInternal(),this.getMap().getView().getProjection())},e.prototype.getExtentInternal=function(){return this.extent_},e.prototype.setExtent=function(t){this.extent_=t||null;this.createOrUpdateExtentFeature_(t);this.dispatchEvent(new Mf(this.extent_))},e}(mo),jf=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),kf=1,Uf=[0,0,0,0],Bf=[],Yf="modifystart",zf="modifyend",Xf=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.features=r,i.mapBrowserEvent=n,i}return jf(e,t),e}(M);function Vf(t,e){return t.index-e.index}function Wf(t,e,r){var n=e.geometry;if(n.getType()===Nt.CIRCLE){var i=n;if(e.index===kf){var o=qn(i.getCenter(),t),a=Math.sqrt(o)-i.getRadius();return a*a}}var s=Ue(t,r);return Bf[0]=Ue(e.segment[0],r),Bf[1]=Ue(e.segment[1],r),Qn(s,Bf)}function Zf(t,e,r){var n=e.geometry;if(n.getType()===Nt.CIRCLE&&e.index===kf)return n.getClosestPoint(t);var i=Ue(t,r);return Bf[0]=Ue(e.segment[0],r),Bf[1]=Ue(e.segment[1],r),ke(Xn(i,Bf),r)}function Kf(){var t=Du();return function(){return t[Nt.POINT]}}var Hf=function(t){function e(e){var r,n=t.call(this,e)||this;if(n.boundHandleFeatureChange_=n.handleFeatureChange_.bind(n),n.condition_=e.condition?e.condition:go,n.defaultDeleteCondition_=function(t){return io(t)&&ho(t)},n.deleteCondition_=e.deleteCondition?e.deleteCondition:n.defaultDeleteCondition_,n.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:so,n.vertexFeature_=null,n.vertexSegments_=null,n.lastPixel_=[0,0],n.ignoreNextSingleClick_=!1,n.modified_=!1,n.rBush_=new Fl,n.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,n.snappedToVertex_=!1,n.changingFeature_=!1,n.dragSegments_=[],n.overlay_=new Bp({source:new Dl({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:Kf(),updateWhileAnimating:!0,updateWhileInteracting:!0}),n.SEGMENT_WRITERS_={Point:n.writePointGeometry_.bind(n),LineString:n.writeLineStringGeometry_.bind(n),LinearRing:n.writeLineStringGeometry_.bind(n),Polygon:n.writePolygonGeometry_.bind(n),MultiPoint:n.writeMultiPointGeometry_.bind(n),MultiLineString:n.writeMultiLineStringGeometry_.bind(n),MultiPolygon:n.writeMultiPolygonGeometry_.bind(n),Circle:n.writeCircleGeometry_.bind(n),GeometryCollection:n.writeGeometryCollectionGeometry_.bind(n)},n.source_=null,e.source?(n.source_=e.source,r=new Z(n.source_.getFeatures()),n.source_.addEventListener(bl.ADDFEATURE,n.handleSourceAdd_.bind(n)),n.source_.addEventListener(bl.REMOVEFEATURE,n.handleSourceRemove_.bind(n))):r=e.features,!r)throw new Error("The modify interaction requires features or a source");return n.features_=r,n.features_.forEach(n.addFeature_.bind(n)),n.features_.addEventListener(h.ADD,n.handleFeatureAdd_.bind(n)),n.features_.addEventListener(h.REMOVE,n.handleFeatureRemove_.bind(n)),n.lastPointerEvent_=null,n}return jf(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var r=this.SEGMENT_WRITERS_[e.getType()];r&&r(t,e)}var n=this.getMap();n&&n.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,n);t.addEventListener(N.CHANGE,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t){this.modified_||(this.modified_=!0,this.dispatchEvent(new Xf(Yf,this.features_,t)))},e.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t);this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null);t.removeEventListener(N.CHANGE,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,r=[];e.forEach(function(e){t===e.feature&&r.push(e)});for(var n=r.length-1;n>=0;--n){for(var i=r[n],o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===i&&this.dragSegments_.splice(o,1);e.remove(i)}},e.prototype.setActive=function(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null);t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.overlay_.setMap(e);t.prototype.setMap.call(this,e)},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},e.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},e.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},e.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e);this.addFeature_(e)}},e.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},e.prototype.writePointGeometry_=function(t,e){var r=e.getCoordinates(),n={feature:t,geometry:e,segment:[r,r]};this.rBush_.insert(e.getExtent(),n)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n){var o=r[n],a={feature:t,geometry:e,depth:[n],index:n,segment:[o,o]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length-1;n<i;++n){var o=r.slice(n,n+2),a={feature:t,geometry:e,index:n,segment:o};this.rBush_.insert($(o),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length-1;a<s;++a){var u=o.slice(a,a+2),l={feature:t,geometry:e,depth:[n],index:a,segment:u};this.rBush_.insert($(u),l)}},e.prototype.writePolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length-1;a<s;++a){var u=o.slice(a,a+2),l={feature:t,geometry:e,depth:[n],index:a,segment:u};this.rBush_.insert($(u),l)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length;a<s;++a)for(var u=o[a],l=0,h=u.length-1;l<h;++l){var c=u.slice(l,l+2),p={feature:t,geometry:e,depth:[a,n],index:l,segment:c};this.rBush_.insert($(c),p)}},e.prototype.writeCircleGeometry_=function(t,e){var r=e.getCenter(),n={feature:t,geometry:e,index:0,segment:[r,r]},i={feature:t,geometry:e,index:kf,segment:[r,r]},o=[n,i];n.featureSegments=o;i.featureSegments=o;this.rBush_.insert(ht(r),n);this.rBush_.insert(e.getExtent(),i)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var r=e.getGeometriesArray(),n=0;n<r.length;++n){var i=r[n];this.SEGMENT_WRITERS_[i.getType()](t,i)}},e.prototype.createOrUpdateVertexFeature_=function(t){var e=this.vertexFeature_;return e?e.getGeometry().setCoordinates(t):(e=new q(new Or(t)),this.vertexFeature_=e,this.overlay_.getSource().addFeature(e)),e},e.prototype.handleEvent=function(e){return!e.pointerEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=un.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(r=!(e.type!=un.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==un.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!r);var r},e.prototype.handleDragEvent=function(t){this.ignoreNextSingleClick_=!1;this.willModifyFeatures_(t);for(var e=t.coordinate,r=0,n=this.dragSegments_.length;r<n;++r){for(var i=this.dragSegments_[r],o=i[0],a=o.depth,s=o.geometry,u=void 0,l=o.segment,h=i[1];e.length<s.getStride();)e.push(l[h][e.length]);switch(s.getType()){case Nt.POINT:u=e;l[0]=e;l[1]=e;break;case Nt.MULTI_POINT:(u=s.getCoordinates())[o.index]=e;l[0]=e;l[1]=e;break;case Nt.LINE_STRING:(u=s.getCoordinates())[o.index+h]=e;l[h]=e;break;case Nt.MULTI_LINE_STRING:case Nt.POLYGON:(u=s.getCoordinates())[a[0]][o.index+h]=e;l[h]=e;break;case Nt.MULTI_POLYGON:(u=s.getCoordinates())[a[1]][a[0]][o.index+h]=e;l[h]=e;break;case Nt.CIRCLE:l[0]=e;l[1]=e;0===o.index?(this.changingFeature_=!0,s.setCenter(e),this.changingFeature_=!1):(this.changingFeature_=!0,s.setRadius(Jn(s.getCenter(),e)),this.changingFeature_=!1)}u&&this.setGeometryCoordinates_(s,u)}this.createOrUpdateVertexFeature_(e)},e.prototype.handleDownEvent=function(t){if(!this.condition_(t))return!1;this.handlePointerAtPixel_(t.pixel,t.map);var e=t.coordinate;this.dragSegments_.length=0;this.modified_=!1;var r=this.vertexFeature_;if(r){var n=t.map.getView().getProjection(),i=[],a=r.getGeometry().getCoordinates(),s=$([a]),u=this.rBush_.getInExtent(s),l={};u.sort(Vf);for(var h=0,c=u.length;h<c;++h){var p=u[h],f=p.segment,d=o(p.feature),_=p.depth;if(_&&(d+="-"+_.join("-")),l[d]||(l[d]=new Array(2)),p.geometry.getType()!==Nt.CIRCLE||p.index!==kf)if(!Zn(f[0],a)||l[d][0])if(!Zn(f[1],a)||l[d][1])o(f)in this.vertexSegments_&&!l[d][0]&&!l[d][1]&&this.insertVertexCondition_(t)&&i.push([p,a]);else{if((p.geometry.getType()===Nt.LINE_STRING||p.geometry.getType()===Nt.MULTI_LINE_STRING)&&l[d][0]&&0===l[d][0].index)continue;this.dragSegments_.push([p,1]);l[d][1]=p}else this.dragSegments_.push([p,0]),l[d][0]=p;else Zn(Zf(e,p,n),a)&&!l[d][0]&&(this.dragSegments_.push([p,0]),l[d][0]=p)}i.length&&this.willModifyFeatures_(t);for(var g=i.length-1;g>=0;--g)this.insertVertex_.apply(this,i[g])}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var r=this.dragSegments_[e][0],n=r.geometry;if(n.getType()===Nt.CIRCLE){var i=n.getCenter(),o=r.featureSegments[0],a=r.featureSegments[1];o.segment[0]=i;o.segment[1]=i;a.segment[0]=i;a.segment[1]=i;this.rBush_.update(ht(i),o);this.rBush_.update(n.getExtent(),a)}else this.rBush_.update($(r.segment),r)}return this.modified_&&(this.dispatchEvent(new Xf(zf,this.features_,t)),this.modified_=!1),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel;this.handlePointerAtPixel_(t.pixel,t.map)},e.prototype.handlePointerAtPixel_=function(t,e){var r=e.getCoordinateFromPixel(t),n=e.getView().getProjection(),i=Be(tt(Ye(ht(r,Uf),n),e.getView().getResolution()*this.pixelTolerance_,Uf),n),a=this.rBush_.getInExtent(i);if(a.length>0){a.sort(function(t,e){return Wf(r,t,n)-Wf(r,e,n)});var s=a[0],u=s.segment,l=Zf(r,s,n),h=e.getPixelFromCoordinate(l),c=Jn(t,h);if(c<=this.pixelTolerance_){var p={};if(s.geometry.getType()===Nt.CIRCLE&&s.index===kf)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(l);else{var f=e.getPixelFromCoordinate(u[0]),d=e.getPixelFromCoordinate(u[1]),_=qn(h,f),g=qn(h,d);c=Math.sqrt(Math.min(_,g));this.snappedToVertex_=c<=this.pixelTolerance_;this.snappedToVertex_&&(l=_>g?u[1]:u[0]);this.createOrUpdateVertexFeature_(l);for(var y=1,v=a.length;y<v;++y){var m=a[y].segment;if(!(Zn(u[0],m[0])&&Zn(u[1],m[1])||Zn(u[0],m[1])&&Zn(u[1],m[0])))break;p[o(m)]=!0}}return p[o(u)]=!0,void(this.vertexSegments_=p)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},e.prototype.insertVertex_=function(t,e){for(var r,n=t.segment,i=t.feature,o=t.geometry,a=t.depth,s=t.index;e.length<o.getStride();)e.push(0);switch(o.getType()){case Nt.MULTI_LINE_STRING:case Nt.POLYGON:(r=o.getCoordinates())[a[0]].splice(s+1,0,e);break;case Nt.MULTI_POLYGON:(r=o.getCoordinates())[a[1]][a[0]].splice(s+1,0,e);break;case Nt.LINE_STRING:(r=o.getCoordinates()).splice(s+1,0,e);break;default:return}this.setGeometryCoordinates_(o,r);var u=this.rBush_;u.remove(t);this.updateSegmentIndices_(o,s,a,1);var l={segment:[n[0],e],feature:i,geometry:o,depth:a,index:s};u.insert($(l.segment),l);this.dragSegments_.push([l,1]);var h={segment:[e,n[1]],feature:i,geometry:o,depth:a,index:s+1};u.insert($(h.segment),h);this.dragSegments_.push([h,0]);this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=un.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t);var e=this.removeVertex_();return this.dispatchEvent(new Xf(zf,this.features_,t)),this.modified_=!1,e}return!1},e.prototype.removeVertex_=function(){for(var t,e,r,n,a,s,u,l,h,c,p=this.dragSegments_,f={},d=!1,i=p.length-1;i>=0;--i)c=o((h=(r=p[i])[0]).feature),h.depth&&(c+="-"+h.depth.join("-")),c in f||(f[c]={}),0===r[1]?(f[c].right=h,f[c].index=h.index):1==r[1]&&(f[c].left=h,f[c].index=h.index+1);for(c in f){switch(l=f[c].right,s=f[c].left,(u=(a=f[c].index)-1)<0&&(u=0),t=e=(n=(h=void 0!==s?s:l).geometry).getCoordinates(),d=!1,n.getType()){case Nt.MULTI_LINE_STRING:e[h.depth[0]].length>2&&(e[h.depth[0]].splice(a,1),d=!0);break;case Nt.LINE_STRING:e.length>2&&(e.splice(a,1),d=!0);break;case Nt.MULTI_POLYGON:t=t[h.depth[1]];case Nt.POLYGON:(t=t[h.depth[0]]).length>4&&(a==t.length-1&&(a=0),t.splice(a,1),d=!0,0===a&&(t.pop(),t.push(t[0]),u=t.length-1))}if(d){this.setGeometryCoordinates_(n,e);var _=[];if(void 0!==s&&(this.rBush_.remove(s),_.push(s.segment[0])),void 0!==l&&(this.rBush_.remove(l),_.push(l.segment[1])),void 0!==s&&void 0!==l){var g={depth:h.depth,feature:h.feature,geometry:h.geometry,index:u,segment:_};this.rBush_.insert($(g.segment),g)}this.updateSegmentIndices_(n,a,h.depth,-1);this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null);p.length=0}}return d},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0;t.setCoordinates(e);this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,r,n){this.rBush_.forEachInExtent(t.getExtent(),function(i){i.geometry===t&&(void 0===r||void 0===i.depth||R(i.depth,r))&&i.index>e&&(i.index+=n)})},e}(mo),qf=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Jf={SELECT:"select"},Qf=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.selected=r,o.deselected=n,o.mapBrowserEvent=i,o}return qf(e,t),e}(M);function $f(t){if(!this.condition_(t))return!0;var e=this.addCondition_(t),r=this.removeCondition_(t),n=this.toggleCondition_(t),i=!e&&!r&&!n,o=t.map,a=this.getFeatures(),s=[],u=[];if(i){f(this.featureLayerAssociation_);o.forEachFeatureAtPixel(t.pixel,function(t,e){if(this.filter_(t,e))return u.push(t),this.addFeatureLayerAssociation_(t,e),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var l=a.getLength()-1;l>=0;--l){var h=a.item(l),c=u.indexOf(h);c>-1?u.splice(c,1):(a.remove(h),s.push(h))}0!==u.length&&a.extend(u)}else{o.forEachFeatureAtPixel(t.pixel,function(t,i){if(this.filter_(t,i))return!e&&!n||T(a.getArray(),t)?(r||n)&&T(a.getArray(),t)&&(s.push(t),this.removeFeatureLayerAssociation_(t)):(u.push(t),this.addFeatureLayerAssociation_(t,i)),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var p=s.length-1;p>=0;--p)a.remove(s[p]);a.extend(u)}return(u.length>0||s.length>0)&&this.dispatchEvent(new Qf(Jf.SELECT,u,s,t)),!0}var td=function(t){function e(e){var r,n,i=t.call(this,{handleEvent:$f})||this,o=e||{};if(i.condition_=o.condition?o.condition:ho,i.addCondition_=o.addCondition?o.addCondition:lo,i.removeCondition_=o.removeCondition?o.removeCondition:lo,i.toggleCondition_=o.toggleCondition?o.toggleCondition:po,i.multi_=!!o.multi&&o.multi,i.filter_=o.filter?o.filter:P,i.hitTolerance_=o.hitTolerance?o.hitTolerance:0,i.style_=void 0!==o.style?o.style:(x((r=Du())[Nt.POLYGON],r[Nt.LINE_STRING]),x(r[Nt.GEOMETRY_COLLECTION],r[Nt.LINE_STRING]),function(t){return t.getGeometry()?r[t.getGeometry().getType()]:null}),i.featureStyleAssociation_={},i.features_=o.features||new Z,o.layers)if("function"==typeof o.layers)n=o.layers;else{var a=o.layers;n=function(t){return T(a,t)}}else n=P;i.layerFilter_=n;i.featureLayerAssociation_={};var s=i.getFeatures();return s.addEventListener(h.ADD,i.addFeature_.bind(i)),s.addEventListener(h.REMOVE,i.removeFeature_.bind(i)),i}return qf(e,t),e.prototype.addFeatureLayerAssociation_=function(t,e){this.featureLayerAssociation_[o(t)]=e},e.prototype.getFeatures=function(){return this.features_},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.getLayer=function(t){return this.featureLayerAssociation_[o(t)]},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){this.getMap()&&this.style_&&this.features_.forEach(this.removeSelectedStyle_.bind(this));t.prototype.setMap.call(this,e);e&&this.style_&&this.features_.forEach(this.giveSelectedStyle_.bind(this))},e.prototype.addFeature_=function(t){var e=t.element;this.style_&&this.giveSelectedStyle_(e)},e.prototype.removeFeature_=function(t){var e=t.element;this.style_&&this.removeSelectedStyle_(e)},e.prototype.giveSelectedStyle_=function(t){var e=o(t);this.featureStyleAssociation_[e]=t.getStyle();t.setStyle(this.style_)},e.prototype.removeSelectedStyle_=function(t){var e=o(t);t.setStyle(this.featureStyleAssociation_[e]);delete this.featureStyleAssociation_[e]},e.prototype.removeFeatureLayerAssociation_=function(t){delete this.featureLayerAssociation_[o(t)]},e}(to),ed=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function rd(t){return t.feature?t.feature:t.element?t.element:void 0}var nd=[],id=function(t){function e(e){var r=this,n=e||{},i=n;return i.handleDownEvent||(i.handleDownEvent=P),i.stopDown||(i.stopDown=I),(r=t.call(this,i)||this).source_=n.source?n.source:null,r.vertex_=void 0===n.vertex||n.vertex,r.edge_=void 0===n.edge||n.edge,r.features_=n.features?n.features:null,r.featuresListenerKeys_=[],r.featureChangeListenerKeys_={},r.indexedFeaturesExtents_={},r.pendingFeatures_={},r.pixelTolerance_=void 0!==n.pixelTolerance?n.pixelTolerance:10,r.rBush_=new Fl,r.SEGMENT_WRITERS_={Point:r.writePointGeometry_.bind(r),LineString:r.writeLineStringGeometry_.bind(r),LinearRing:r.writeLineStringGeometry_.bind(r),Polygon:r.writePolygonGeometry_.bind(r),MultiPoint:r.writeMultiPointGeometry_.bind(r),MultiLineString:r.writeMultiLineStringGeometry_.bind(r),MultiPolygon:r.writeMultiPolygonGeometry_.bind(r),GeometryCollection:r.writeGeometryCollectionGeometry_.bind(r),Circle:r.writeCircleGeometry_.bind(r)},r}return ed(e,t),e.prototype.addFeature=function(t,e){var r=void 0===e||e,n=o(t),i=t.getGeometry();if(i){var a=this.SEGMENT_WRITERS_[i.getType()];a&&(this.indexedFeaturesExtents_[n]=i.getExtent([1/0,1/0,-1/0,-1/0]),a(t,i))}r&&(this.featureChangeListenerKeys_[n]=g(t,N.CHANGE,this.handleFeatureChange_,this))},e.prototype.forEachFeatureAdd_=function(t){this.addFeature(t)},e.prototype.forEachFeatureRemove_=function(t){this.removeFeature(t)},e.prototype.getFeatures_=function(){var t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t},e.prototype.handleEvent=function(e){var r=this.snapTo(e.pixel,e.coordinate,e.map);return r.snapped&&(e.coordinate=r.vertex.slice(0,2),e.pixel=r.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=rd(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=rd(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var r=o(e);r in this.pendingFeatures_||(this.pendingFeatures_[r]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(){var e=d(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var r=void 0===e||e,n=o(t),i=this.indexedFeaturesExtents_[n];if(i){var a=this.rBush_,s=[];a.forEachInExtent(i,function(e){t===e.feature&&s.push(e)});for(var u=s.length-1;u>=0;--u)a.remove(s[u])}r&&(v(this.featureChangeListenerKeys_[n]),delete this.featureChangeListenerKeys_[n])},e.prototype.setMap=function(e){var r=this.getMap(),n=this.featuresListenerKeys_,i=this.getFeatures_();r&&(n.forEach(v),n.length=0,i.forEach(this.forEachFeatureRemove_.bind(this)));t.prototype.setMap.call(this,e);e&&(this.features_?n.push(g(this.features_,h.ADD,this.handleFeatureAdd_,this),g(this.features_,h.REMOVE,this.handleFeatureRemove_,this)):this.source_&&n.push(g(this.source_,bl.ADDFEATURE,this.handleFeatureAdd_,this),g(this.source_,bl.REMOVEFEATURE,this.handleFeatureRemove_,this)),i.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,r){var n=$([r.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),r.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),i=this.rBush_.getInExtent(n);this.vertex_&&!this.edge_&&(i=i.filter(function(t){return t.feature.getGeometry().getType()!==Nt.CIRCLE}));var o=!1,a=null,s=null;if(0===i.length)return{snapped:o,vertex:a,vertexPixel:s};for(var u,l=r.getView().getProjection(),h=Ue(e,l),c=1/0,p=0;p<i.length;++p){var f=i[p];nd[0]=Ue(f.segment[0],l);nd[1]=Ue(f.segment[1],l);var d=Qn(h,nd);d<c&&(u=f,c=d)}var _=u.segment;if(this.vertex_&&!this.edge_){var g=r.getPixelFromCoordinate(_[0]),y=r.getPixelFromCoordinate(_[1]),v=qn(t,g),m=qn(t,y);Math.sqrt(Math.min(v,m))<=this.pixelTolerance_&&(o=!0,a=v>m?_[1]:_[0],s=r.getPixelFromCoordinate(a))}else if(this.edge_){var E=u.feature.getGeometry().getType()===Nt.CIRCLE;(E?a=function(t,e){var r=e.getRadius(),n=e.getCenter(),i=n[0],o=n[1],a=t[0]-i,s=t[1]-o;0===a&&0===s&&(a=1);var u=Math.sqrt(a*a+s*s);return[i+r*a/u,o+r*s/u]}(e,u.feature.getGeometry()):(nd[0]=Ue(_[0],l),nd[1]=Ue(_[1],l),a=ke(Xn(h,nd),l)),Jn(t,s=r.getPixelFromCoordinate(a))<=this.pixelTolerance_&&(o=!0,this.vertex_&&!E))&&(g=r.getPixelFromCoordinate(_[0]),y=r.getPixelFromCoordinate(_[1]),v=qn(s,g),m=qn(s,y),Math.sqrt(Math.min(v,m))<=this.pixelTolerance_&&(a=v>m?_[1]:_[0],s=r.getPixelFromCoordinate(a)))}return o&&(s=[Math.round(s[0]),Math.round(s[1])]),{snapped:o,vertex:a,vertexPixel:s}},e.prototype.updateFeature_=function(t){this.removeFeature(t,!1);this.addFeature(t,!1)},e.prototype.writeCircleGeometry_=function(t,e){for(var r=Xr(e).getCoordinates()[0],n=0,i=r.length-1;n<i;++n){var o=r.slice(n,n+2),a={feature:t,segment:o};this.rBush_.insert($(o),a)}},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var r=e.getGeometriesArray(),n=0;n<r.length;++n){var i=this.SEGMENT_WRITERS_[r[n].getType()];i&&i(t,r[n])}},e.prototype.writeLineStringGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length-1;n<i;++n){var o=r.slice(n,n+2),a={feature:t,segment:o};this.rBush_.insert($(o),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length-1;a<s;++a){var u=o.slice(a,a+2),l={feature:t,segment:u};this.rBush_.insert($(u),l)}},e.prototype.writeMultiPointGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n){var o=r[n],a={feature:t,segment:[o,o]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length;a<s;++a)for(var u=o[a],l=0,h=u.length-1;l<h;++l){var c=u.slice(l,l+2),p={feature:t,segment:c};this.rBush_.insert($(c),p)}},e.prototype.writePointGeometry_=function(t,e){var r=e.getCoordinates(),n={feature:t,segment:[r,r]};this.rBush_.insert(e.getExtent(),n)},e.prototype.writePolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length-1;a<s;++a){var u=o.slice(a,a+2),l={feature:t,segment:u};this.rBush_.insert($(u),l)}},e}(mo),od=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ad="translatestart",sd="translating",ud="translateend",ld=function(t){function e(e,r,n,i,o){var a=t.call(this,e)||this;return a.features=r,a.coordinate=n,a.startCoordinate=i,a.mapBrowserEvent=o,a}return od(e,t),e}(M),hd=function(t){function e(e){var r,n=this,i=e||{};if((n=t.call(this,i)||this).lastCoordinate_=null,n.startCoordinate_=null,n.features_=void 0!==i.features?i.features:null,i.layers)if("function"==typeof i.layers)r=i.layers;else{var o=i.layers;r=function(t){return T(o,t)}}else r=P;return n.layerFilter_=r,n.filter_=i.filter?i.filter:P,n.hitTolerance_=i.hitTolerance?i.hitTolerance:0,n.lastFeature_=null,n.addEventListener(Y(Ji.ACTIVE),n.handleActiveChanged_),n}return od(e,t),e.prototype.handleDownEvent=function(t){if(this.lastFeature_=this.featuresAtPixel_(t.pixel,t.map),!this.lastCoordinate_&&this.lastFeature_){this.startCoordinate_=t.coordinate;this.lastCoordinate_=t.coordinate;this.handleMoveEvent(t);var e=this.features_||new Z([this.lastFeature_]);return this.dispatchEvent(new ld(ad,e,t.coordinate,this.startCoordinate_,t)),!0}return!1},e.prototype.handleUpEvent=function(t){if(this.lastCoordinate_){this.lastCoordinate_=null;this.handleMoveEvent(t);var e=this.features_||new Z([this.lastFeature_]);return this.dispatchEvent(new ld(ud,e,t.coordinate,this.startCoordinate_,t)),this.startCoordinate_=null,!0}return!1},e.prototype.handleDragEvent=function(t){if(this.lastCoordinate_){var e=t.coordinate,r=e[0]-this.lastCoordinate_[0],n=e[1]-this.lastCoordinate_[1],i=this.features_||new Z([this.lastFeature_]);i.forEach(function(t){var e=t.getGeometry();e.translate(r,n);t.setGeometry(e)});this.lastCoordinate_=e;this.dispatchEvent(new ld(sd,i,e,this.startCoordinate_,t))}},e.prototype.handleMoveEvent=function(t){var e=t.map.getViewport();this.featuresAtPixel_(t.pixel,t.map)?(e.classList.remove(this.lastCoordinate_?"ol-grab":"ol-grabbing"),e.classList.add(this.lastCoordinate_?"ol-grabbing":"ol-grab")):e.classList.remove("ol-grab","ol-grabbing")},e.prototype.featuresAtPixel_=function(t,e){return e.forEachFeatureAtPixel(t,function(t,e){if(this.filter_(t,e)&&(!this.features_||T(this.features_.getArray(),t)))return t}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){var r=this.getMap();t.prototype.setMap.call(this,e);this.updateState_(r)},e.prototype.handleActiveChanged_=function(){this.updateState_(null)},e.prototype.updateState_=function(t){var e=this.getMap(),r=this.getActive();e&&r||(e=e||t)&&e.getViewport().classList.remove("ol-grab","ol-grabbing")},e}(mo),cd=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function pd(t){for(var e=[],r=0,n=t.length;r<n;++r)e.push(t[r].clone());return e}var fd=function(t){function e(e){var r=t.call(this)||this;return r.geometries_=e||null,r.changeEventsKeys_=[],r.listenGeometriesChange_(),r}return cd(e,t),e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(v);this.changeEventsKeys_.length=0},e.prototype.listenGeometriesChange_=function(){if(this.geometries_)for(var t=0,e=this.geometries_.length;t<e;++t)this.changeEventsKeys_.push(g(this.geometries_[t],N.CHANGE,this.changed,this))},e.prototype.clone=function(){var t=new e(null);return t.setGeometries(this.geometries_),t},e.prototype.closestPointXY=function(t,e,r,n){if(n<rt(this.getExtent(),t,e))return n;for(var i=this.geometries_,o=0,a=i.length;o<a;++o)n=i[o].closestPointXY(t,e,r,n);return n},e.prototype.containsXY=function(t,e){for(var r=this.geometries_,n=0,i=r.length;n<i;++n)if(r[n].containsXY(t,e))return!0;return!1},e.prototype.computeExtent=function(t){lt(t);for(var e=this.geometries_,r=0,n=e.length;r<n;++r)ft(t,e[r].getExtent());return t},e.prototype.getGeometries=function(){return pd(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;for(var r=[],n=this.geometries_,i=!1,o=0,a=n.length;o<a;++o){var s=n[o],u=s.getSimplifiedGeometry(t);r.push(u);u!==s&&(i=!0)}if(i){var l=new e(null);return l.setGeometriesArray(r),l}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return Nt.GEOMETRY_COLLECTION},e.prototype.intersectsExtent=function(t){for(var e=this.geometries_,r=0,n=e.length;r<n;++r)if(e[r].intersectsExtent(t))return!0;return!1},e.prototype.isEmpty=function(){return 0===this.geometries_.length},e.prototype.rotate=function(t,e){for(var r=this.geometries_,n=0,i=r.length;n<i;++n)r[n].rotate(t,e);this.changed()},e.prototype.scale=function(t,e,r){var n=r;n||(n=St(this.getExtent()));for(var i=this.geometries_,o=0,a=i.length;o<a;++o)i[o].scale(t,e,n);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(pd(t))},e.prototype.setGeometriesArray=function(t){this.unlistenGeometriesChange_();this.geometries_=t;this.listenGeometriesChange_();this.changed()},e.prototype.applyTransform=function(t){for(var e=this.geometries_,r=0,n=e.length;r<n;++r)e[r].applyTransform(t);this.changed()},e.prototype.translate=function(t,e){for(var r=this.geometries_,n=0,i=r.length;n<i;++n)r[n].translate(t,e);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_();t.prototype.disposeInternal.call(this)},e}(tr),dd=function(){function t(){this.dataProjection=null;this.defaultFeatureProjection=null}return t.prototype.getReadOptions=function(t,e){var r;if(e){var n=e.dataProjection?we(e.dataProjection):this.readProjection(t);e.extent&&n&&n.getUnits()===te.TILE_PIXELS&&(n=we(n)).setWorldExtent(e.extent);r={dataProjection:n,featureProjection:e.featureProjection}}return this.adaptOptions(r)},t.prototype.adaptOptions=function(t){return p({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},t.prototype.getType=function(){return n()},t.prototype.readFeature=function(){return n()},t.prototype.readFeatures=function(){return n()},t.prototype.readGeometry=function(){return n()},t.prototype.readProjection=function(){return n()},t.prototype.writeFeature=function(){return n()},t.prototype.writeFeatures=function(){return n()},t.prototype.writeGeometry=function(){return n()},t}();function _d(t,e,r){var n,i=r?we(r.featureProjection):null,o=r?we(r.dataProjection):null;if(n=i&&o&&!Ie(i,o)?(e?t.clone():t).transform(e?i:o,e?o:i):t,e&&r&&void 0!==r.decimals){var a=Math.pow(10,r.decimals);n===t&&(n=t.clone());n.applyTransform(function(t){for(var e=0,r=t.length;e<r;++e)t[e]=Math.round(t[e]*a)/a;return t})}return n}function gd(t,e){var r=e?we(e.featureProjection):null,n=e?we(e.dataProjection):null;return r&&n&&!Ie(r,n)?Fe(t,n,r):t}var yd=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function vd(t){if("string"==typeof t){var e=JSON.parse(t);return e||null}return null!==t?t:null}var md=function(t){function e(){return t.call(this)||this}return yd(e,t),e.prototype.getType=function(){return rs.JSON},e.prototype.readFeature=function(t,e){return this.readFeatureFromObject(vd(t),this.getReadOptions(t,e))},e.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(vd(t),this.getReadOptions(t,e))},e.prototype.readFeatureFromObject=function(){return n()},e.prototype.readFeaturesFromObject=function(){return n()},e.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(vd(t),this.getReadOptions(t,e))},e.prototype.readGeometryFromObject=function(){return n()},e.prototype.readProjection=function(t){return this.readProjectionFromObject(vd(t))},e.prototype.readProjectionFromObject=function(){return n()},e.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},e.prototype.writeFeatureObject=function(){return n()},e.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},e.prototype.writeFeaturesObject=function(){return n()},e.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},e.prototype.writeGeometryObject=function(){return n()},e}(dd),Ed=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Td={};Td[Nt.POINT]=function(t){return void 0!==t.m&&void 0!==t.z?new Or([t.x,t.y,t.z,t.m],At.XYZM):void 0!==t.z?new Or([t.x,t.y,t.z],At.XYZ):void 0!==t.m?new Or([t.x,t.y,t.m],At.XYM):new Or([t.x,t.y])};Td[Nt.LINE_STRING]=function(t){var e=xd(t);return new Vp(t.paths[0],e)};Td[Nt.POLYGON]=function(t){var e=xd(t);return new Br(t.rings,e)};Td[Nt.MULTI_POINT]=function(t){var e=xd(t);return new Ef(t.points,e)};Td[Nt.MULTI_LINE_STRING]=function(t){var e=xd(t);return new vf(t.paths,e)};Td[Nt.MULTI_POLYGON]=function(t){var e=xd(t);return new wf(t.rings,e)};var Sd={};function wd(t,e){var r,n,i;if(!t)return null;if("number"==typeof t.x&&"number"==typeof t.y)i=Nt.POINT;else if(t.points)i=Nt.MULTI_POINT;else if(t.paths)i=1===t.paths.length?Nt.LINE_STRING:Nt.MULTI_LINE_STRING;else if(t.rings){var o=t,a=xd(o),s=function(t,e){for(var i=[],o=[],a=[],r=0,n=t.length;r<n;++r)i.length=0,pr(i,0,t[r],e.length),Nr(i,0,i.length,e.length)?o.push([t[r]]):a.push(t[r]);for(;a.length;){var s=a.shift(),u=!1;for(r=o.length-1;r>=0;r--){var l=o[r][0];if(it(new wr(l).getExtent(),new wr(s).getExtent())){o[r].push(s);u=!0;break}}u||o.push([s.reverse()])}return o}(o.rings,a);1===s.length?(i=Nt.POLYGON,t=Object.assign({},t,((r={}).rings=s[0],r))):(i=Nt.MULTI_POLYGON,t=Object.assign({},t,((n={}).rings=s,n)))}return _d(Td[i](t),!1,e)}function xd(t){var e=At.XY;return!0===t.hasZ&&!0===t.hasM?e=At.XYZM:!0===t.hasZ?e=At.XYZ:!0===t.hasM&&(e=At.XYM),e}function Od(t){var e=t.getLayout();return{hasZ:e===At.XYZ||e===At.XYZM,hasM:e===At.XYM||e===At.XYZM}}function Rd(t,e){return Sd[t.getType()](_d(t,!0,e),e)}Sd[Nt.POINT]=function(t){var r,n=t.getCoordinates(),i=t.getLayout();return i===At.XYZ?r={x:n[0],y:n[1],z:n[2]}:i===At.XYM?r={x:n[0],y:n[1],m:n[2]}:i===At.XYZM?r={x:n[0],y:n[1],z:n[2],m:n[3]}:i===At.XY?r={x:n[0],y:n[1]}:K(!1,34),r};Sd[Nt.LINE_STRING]=function(t){var r=Od(t);return{hasZ:r.hasZ,hasM:r.hasM,paths:[t.getCoordinates()]}};Sd[Nt.POLYGON]=function(t){var r=Od(t);return{hasZ:r.hasZ,hasM:r.hasM,rings:t.getCoordinates(!1)}};Sd[Nt.MULTI_POINT]=function(t){var r=Od(t);return{hasZ:r.hasZ,hasM:r.hasM,points:t.getCoordinates()}};Sd[Nt.MULTI_LINE_STRING]=function(t){var r=Od(t);return{hasZ:r.hasZ,hasM:r.hasM,paths:t.getCoordinates()}};Sd[Nt.MULTI_POLYGON]=function(t){for(var r=Od(t),n=t.getCoordinates(!1),i=[],o=0;o<n.length;o++)for(var a=n[o].length-1;a>=0;a--)i.push(n[o][a]);return{hasZ:r.hasZ,hasM:r.hasM,rings:i}};var Cd=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this)||this).geometryName_=n.geometryName,r}return Ed(e,t),e.prototype.readFeatureFromObject=function(t,e){var r=t,n=wd(r.geometry,e),i=new q;return this.geometryName_&&i.setGeometryName(this.geometryName_),i.setGeometry(n),e&&e.idField&&r.attributes[e.idField]&&i.setId(r.attributes[e.idField]),r.attributes&&i.setProperties(r.attributes,!0),i},e.prototype.readFeaturesFromObject=function(t,e){var r=e||{};if(t.features){var n=[],i=t.features;r.idField=t.objectIdFieldName;for(var o=0,a=i.length;o<a;++o)n.push(this.readFeatureFromObject(i[o],r));return n}return[this.readFeatureFromObject(t,r)]},e.prototype.readGeometryFromObject=function(t,e){return wd(t,e)},e.prototype.readProjectionFromObject=function(t){return t.spatialReference&&void 0!==t.spatialReference.wkid?we("EPSG:"+t.spatialReference.wkid):null},e.prototype.writeGeometryObject=function(t,e){return Rd(t,this.adaptOptions(e))},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var r={},n=t.getGeometry();n&&(r.geometry=Rd(n,e),e&&e.featureProjection&&(r.geometry.spatialReference={wkid:Number(we(e.featureProjection).getCode().split(":").pop())}));var i=t.getProperties();return delete i[t.getGeometryName()],r.attributes=_(i)?{}:i,r},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var r=[],n=0,i=t.length;n<i;++n)r.push(this.writeFeatureObject(t[n],e));return{features:r}},e}(md),Pd=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Id=function(t){function e(){var e=t.call(this)||this;return e.xmlSerializer_=new XMLSerializer,e}return Pd(e,t),e.prototype.getType=function(){return rs.XML},e.prototype.readFeature=function(t,e){if(t){if("string"==typeof t){var r=Fs(t);return this.readFeatureFromDocument(r,e)}return Ms(t)?this.readFeatureFromDocument(t,e):this.readFeatureFromNode(t,e)}return null},e.prototype.readFeatureFromDocument=function(t,e){var r=this.readFeaturesFromDocument(t,e);return r.length>0?r[0]:null},e.prototype.readFeatureFromNode=function(){return null},e.prototype.readFeatures=function(t,e){if(t){if("string"==typeof t){var r=Fs(t);return this.readFeaturesFromDocument(r,e)}return Ms(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}return[]},e.prototype.readFeaturesFromDocument=function(t,e){for(var r=[],n=t.firstChild;n;n=n.nextSibling)n.nodeType==Node.ELEMENT_NODE&&x(r,this.readFeaturesFromNode(n,e));return r},e.prototype.readFeaturesFromNode=function(){return n()},e.prototype.readGeometry=function(t,e){if(t){if("string"==typeof t){var r=Fs(t);return this.readGeometryFromDocument(r,e)}return Ms(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}return null},e.prototype.readGeometryFromDocument=function(){return null},e.prototype.readGeometryFromNode=function(){return null},e.prototype.readProjection=function(t){if(t){if("string"==typeof t){var e=Fs(t);return this.readProjectionFromDocument(e)}return Ms(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},e.prototype.readProjectionFromDocument=function(){return this.dataProjection},e.prototype.readProjectionFromNode=function(){return this.dataProjection},e.prototype.writeFeature=function(t,e){var r=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeFeatureNode=function(){return null},e.prototype.writeFeatures=function(t,e){var r=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeFeaturesNode=function(){return null},e.prototype.writeGeometry=function(t,e){var r=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeGeometryNode=function(){return null},e}(dd),bd=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ld="http://www.opengis.net/gml",Md=/^[\s\xa0]*$/,Fd=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.featureType=n.featureType,r.featureNS=n.featureNS,r.srsName=n.srsName,r.schemaLocation="",r.FEATURE_COLLECTION_PARSERS={},r.FEATURE_COLLECTION_PARSERS[r.namespace]={featureMember:Ns(r.readFeaturesInternal),featureMembers:Ds(r.readFeaturesInternal)},r}return bd(e,t),e.prototype.readFeaturesInternal=function(t,e){var r=t.localName,n=null;if("FeatureCollection"==r)n=Ws([],this.FEATURE_COLLECTION_PARSERS,t,e,this);else if("featureMembers"==r||"featureMember"==r){var i=e[0],o=i.featureType,a=i.featureNS;if(!o&&t.childNodes){o=[];a={};for(var s=0,u=t.childNodes.length;s<u;++s){var l=t.childNodes[s];if(1===l.nodeType){var h=l.nodeName.split(":").pop();if(-1===o.indexOf(h)){var c="",p=0,f=l.namespaceURI;for(var d in a){if(a[d]===f){c=d;break}++p}c||(a[c="p"+p]=f);o.push(c+":"+h)}}}"featureMember"!=r&&(i.featureType=o,i.featureNS=a)}if("string"==typeof a){var _=a;(a={}).p0=_}var g={},y=Array.isArray(o)?o:[o];for(var v in a){var m={};for(s=0,u=y.length;s<u;++s)(-1===y[s].indexOf(":")?"p0":y[s].split(":")[0])===v&&(m[y[s].split(":").pop()]="featureMembers"==r?Ns(this.readFeatureElement,this):Ds(this.readFeatureElement,this));g[a[v]]=m}n=Ws("featureMember"==r?void 0:[],g,t,e)}return null===n&&(n=[]),n},e.prototype.readGeometryElement=function(t,e){var r=e[0];r.srsName=t.firstElementChild.getAttribute("srsName");r.srsDimension=t.firstElementChild.getAttribute("srsDimension");var n=Ws(null,this.GEOMETRY_PARSERS,t,e,this);if(n)return Array.isArray(n)?gd(n,r):_d(n,!1,r)},e.prototype.readFeatureElementInternal=function(t,e,r){for(var n,i={},o=t.firstElementChild;o;o=o.nextElementSibling){var a=void 0,s=o.localName;0===o.childNodes.length||1===o.childNodes.length&&(3===o.firstChild.nodeType||4===o.firstChild.nodeType)?(a=Ls(o,!1),Md.test(a)&&(a=void 0)):(r&&(a=this.readGeometryElement(o,e)),a?"boundedBy"!==s&&(n=s):a=this.readFeatureElementInternal(o,e,!1));i[s]?(i[s]instanceof Array||(i[s]=[i[s]]),i[s].push(a)):i[s]=a;var u=o.attributes.length;if(u>0){i[s]={_content_:i[s]};for(var l=0;l<u;l++){var h=o.attributes[l].name;i[s][h]=o.attributes[l].value}}}if(r){var c=new q(i);n&&c.setGeometryName(n);var p=t.getAttribute("fid")||function(t,e,r){return t.getAttributeNS(e,r)||""}(t,this.namespace,"id");return p&&c.setId(p),c}return i},e.prototype.readFeatureElement=function(t,e){return this.readFeatureElementInternal(t,e,!0)},e.prototype.readPoint=function(t,e){var r=this.readFlatCoordinatesFromNode_(t,e);if(r)return new Or(r,At.XYZ)},e.prototype.readMultiPoint=function(t,e){var r=Ws([],this.MULTIPOINT_PARSERS_,t,e,this);if(r)return new Ef(r)},e.prototype.readMultiLineString=function(t,e){var r=Ws([],this.MULTILINESTRING_PARSERS_,t,e,this);if(r)return new vf(r)},e.prototype.readMultiPolygon=function(t,e){var r=Ws([],this.MULTIPOLYGON_PARSERS_,t,e,this);if(r)return new wf(r)},e.prototype.pointMemberParser_=function(t,e){Vs(this.POINTMEMBER_PARSERS_,t,e,this)},e.prototype.lineStringMemberParser_=function(t,e){Vs(this.LINESTRINGMEMBER_PARSERS_,t,e,this)},e.prototype.polygonMemberParser_=function(t,e){Vs(this.POLYGONMEMBER_PARSERS_,t,e,this)},e.prototype.readLineString=function(t,e){var r=this.readFlatCoordinatesFromNode_(t,e);if(r)return new Vp(r,At.XYZ)},e.prototype.readFlatLinearRing_=function(t,e){var r=Ws(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,e,this);return r||void 0},e.prototype.readLinearRing=function(t,e){var r=this.readFlatCoordinatesFromNode_(t,e);if(r)return new wr(r,At.XYZ)},e.prototype.readPolygon=function(t,e){var r=Ws([null],this.FLAT_LINEAR_RINGS_PARSERS,t,e,this);if(r&&r[0]){for(var i=r[0],o=[i.length],a=void 0,a=1,n=r.length;a<n;++a)x(i,r[a]),o.push(i.length);return new Br(i,At.XYZ,o)}},e.prototype.readFlatCoordinatesFromNode_=function(t,e){return Ws(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,e,this)},e.prototype.readGeometryFromNode=function(t,e){var r=this.readGeometryElement(t,[this.getReadOptions(t,e||{})]);return r||null},e.prototype.readFeaturesFromNode=function(t,e){var r={featureType:this.featureType,featureNS:this.featureNS};return e&&p(r,this.getReadOptions(t,e)),this.readFeaturesInternal(t,[r])||[]},e.prototype.readProjectionFromNode=function(t){return we(this.srsName?this.srsName:t.firstElementChild.getAttribute("srsName"))},e}(Id);Fd.prototype.namespace=Ld;Fd.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{}};Fd.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{}};Fd.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{}};Fd.prototype.MULTIPOINT_PARSERS_={"http://www.opengis.net/gml":{pointMember:Ns(Fd.prototype.pointMemberParser_),pointMembers:Ns(Fd.prototype.pointMemberParser_)}};Fd.prototype.MULTILINESTRING_PARSERS_={"http://www.opengis.net/gml":{lineStringMember:Ns(Fd.prototype.lineStringMemberParser_),lineStringMembers:Ns(Fd.prototype.lineStringMemberParser_)}};Fd.prototype.MULTIPOLYGON_PARSERS_={"http://www.opengis.net/gml":{polygonMember:Ns(Fd.prototype.polygonMemberParser_),polygonMembers:Ns(Fd.prototype.polygonMemberParser_)}};Fd.prototype.POINTMEMBER_PARSERS_={"http://www.opengis.net/gml":{Point:Ns(Fd.prototype.readFlatCoordinatesFromNode_)}};Fd.prototype.LINESTRINGMEMBER_PARSERS_={"http://www.opengis.net/gml":{LineString:Ns(Fd.prototype.readLineString)}};Fd.prototype.POLYGONMEMBER_PARSERS_={"http://www.opengis.net/gml":{Polygon:Ns(Fd.prototype.readPolygon)}};Fd.prototype.RING_PARSERS={"http://www.opengis.net/gml":{LinearRing:Ds(Fd.prototype.readFlatLinearRing_)}};var Ad=Fd;function Nd(t){return Dd(Ls(t,!1))}function Dd(t){var e=/^\s*(true|1)|(false|0)\s*$/.exec(t);if(e)return void 0!==e[1]||!1}function Gd(t){var e=Ls(t,!1),r=Date.parse(e);if(!isNaN(r))return r/1e3}function jd(t){return kd(Ls(t,!1))}function kd(t){var e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(t);if(e)return parseFloat(e[1])}function Ud(t){return Bd(Ls(t,!1))}function Bd(t){var e=/^\s*(\d+)\s*$/.exec(t);if(e)return parseInt(e[1],10)}function Yd(t){return Ls(t,!1).trim()}function zd(t,e){Wd(t,e?"1":"0")}function Xd(t,e){var r=e.toPrecision();t.appendChild(Ps.createTextNode(r))}function Vd(t,e){var r=e.toString();t.appendChild(Ps.createTextNode(r))}function Wd(t,e){t.appendChild(Ps.createTextNode(e))}var Zd=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Kd=Ld+" http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd",Hd={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"},qd=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,n)||this).surface_=void 0!==n.surface&&n.surface,r.curve_=void 0!==n.curve&&n.curve,r.multiCurve_=void 0===n.multiCurve||n.multiCurve,r.multiSurface_=void 0===n.multiSurface||n.multiSurface,r.schemaLocation=n.schemaLocation?n.schemaLocation:Kd,r.hasZ=void 0!==n.hasZ&&n.hasZ,r}return Zd(e,t),e.prototype.readMultiCurve_=function(t,e){var r=Ws([],this.MULTICURVE_PARSERS_,t,e,this);if(r)return new vf(r)},e.prototype.readMultiSurface_=function(t,e){var r=Ws([],this.MULTISURFACE_PARSERS_,t,e,this);if(r)return new wf(r)},e.prototype.curveMemberParser_=function(t,e){Vs(this.CURVEMEMBER_PARSERS_,t,e,this)},e.prototype.surfaceMemberParser_=function(t,e){Vs(this.SURFACEMEMBER_PARSERS_,t,e,this)},e.prototype.readPatch_=function(t,e){return Ws([null],this.PATCHES_PARSERS_,t,e,this)},e.prototype.readSegment_=function(t,e){return Ws([null],this.SEGMENTS_PARSERS_,t,e,this)},e.prototype.readPolygonPatch_=function(t,e){return Ws([null],this.FLAT_LINEAR_RINGS_PARSERS,t,e,this)},e.prototype.readLineStringSegment_=function(t,e){return Ws([null],this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,e,this)},e.prototype.interiorParser_=function(t,e){var r=Ws(void 0,this.RING_PARSERS,t,e,this);r&&e[e.length-1].push(r)},e.prototype.exteriorParser_=function(t,e){var r=Ws(void 0,this.RING_PARSERS,t,e,this);r&&(e[e.length-1][0]=r)},e.prototype.readSurface_=function(t,e){var r=Ws([null],this.SURFACE_PARSERS_,t,e,this);if(r&&r[0]){for(var i=r[0],o=[i.length],a=void 0,a=1,n=r.length;a<n;++a)x(i,r[a]),o.push(i.length);return new Br(i,At.XYZ,o)}},e.prototype.readCurve_=function(t,e){var r=Ws([null],this.CURVE_PARSERS_,t,e,this);if(r)return new Vp(r,At.XYZ)},e.prototype.readEnvelope_=function(t,e){var r=Ws([null],this.ENVELOPE_PARSERS_,t,e,this);return ut(r[1][0],r[1][1],r[2][0],r[2][1])},e.prototype.readFlatPos_=function(t,e){for(var r,n=Ls(t,!1),o=[];r=/^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/.exec(n);)o.push(parseFloat(r[1])),n=n.substr(r[0].length);if(""===n){var a=e[0].srsName,s="enu";if(a&&(s=we(a).getAxisOrientation()),"neu"===s)for(var l=void 0,l=0,u=o.length;l<u;l+=3){var h=o[l],c=o[l+1];o[l]=c;o[l+1]=h}var p=o.length;if(2==p&&o.push(0),0!==p)return o}},e.prototype.readFlatPosList_=function(t,e){var r=Ls(t,!1).replace(/^\s*|\s*$/g,""),n=e[0],i=n.srsName,o=n.srsDimension,a="enu";i&&(a=we(i).getAxisOrientation());var s,u,l,h=r.split(/\s+/),c=2;t.getAttribute("srsDimension")?c=Bd(t.getAttribute("srsDimension")):t.getAttribute("dimension")?c=Bd(t.getAttribute("dimension")):t.parentNode.getAttribute("srsDimension")?c=Bd(t.parentNode.getAttribute("srsDimension")):o&&(c=Bd(o));for(var p=[],f=0,d=h.length;f<d;f+=c)s=parseFloat(h[f]),u=parseFloat(h[f+1]),l=3===c?parseFloat(h[f+2]):0,"en"===a.substr(0,2)?p.push(s,u,l):p.push(u,s,l);return p},e.prototype.writePos_=function(t,e,r){var n=r[r.length-1],i=n.hasZ,o=i?"3":"2";t.setAttribute("srsDimension",o);var a=n.srsName,s="enu";a&&(s=we(a).getAxisOrientation());var u,l=e.getCoordinates();(u="en"===s.substr(0,2)?l[0]+" "+l[1]:l[1]+" "+l[0],i)&&(u+=" "+(l[2]||0));Wd(t,u)},e.prototype.getCoords_=function(t,e,r){var n="enu";e&&(n=we(e).getAxisOrientation());var i="en"===n.substr(0,2)?t[0]+" "+t[1]:t[1]+" "+t[0];return r&&(i+=" "+(t[2]||0)),i},e.prototype.writePosList_=function(t,e,r){var n=r[r.length-1],i=n.hasZ,o=i?"3":"2";t.setAttribute("srsDimension",o);for(var a,s=n.srsName,u=e.getCoordinates(),l=u.length,h=new Array(l),c=0;c<l;++c)a=u[c],h[c]=this.getCoords_(a,s,i);Wd(t,h.join(" "))},e.prototype.writePoint_=function(t,e,r){var n=r[r.length-1].srsName;n&&t.setAttribute("srsName",n);var i=bs(t.namespaceURI,"pos");t.appendChild(i);this.writePos_(i,e,r)},e.prototype.writeEnvelope=function(t,e,r){var n=r[r.length-1].srsName;n&&t.setAttribute("srsName",n);var i=[e[0]+" "+e[1],e[2]+" "+e[3]];Ks({node:t},this.ENVELOPE_SERIALIZERS_,Ys,i,r,["lowerCorner","upperCorner"],this)},e.prototype.writeLinearRing_=function(t,e,r){var n=r[r.length-1].srsName;n&&t.setAttribute("srsName",n);var i=bs(t.namespaceURI,"posList");t.appendChild(i);this.writePosList_(i,e,r)},e.prototype.RING_NODE_FACTORY_=function(t,e){var n=e[e.length-1],i=n.node,o=n.exteriorWritten;return void 0===o&&(n.exteriorWritten=!0),bs(i.namespaceURI,void 0!==o?"interior":"exterior")},e.prototype.writeSurfaceOrPolygon_=function(t,e,r){var n=r[r.length-1],i=n.hasZ,o=n.srsName;if("PolygonPatch"!==t.nodeName&&o&&t.setAttribute("srsName",o),"Polygon"===t.nodeName||"PolygonPatch"===t.nodeName){var a=e.getLinearRings();Ks({node:t,hasZ:i,srsName:o},this.RING_SERIALIZERS_,this.RING_NODE_FACTORY_,a,r,void 0,this)}else if("Surface"===t.nodeName){var s=bs(t.namespaceURI,"patches");t.appendChild(s);this.writeSurfacePatches_(s,e,r)}},e.prototype.writeCurveOrLineString_=function(t,e,r){var n=r[r.length-1].srsName;if("LineStringSegment"!==t.nodeName&&n&&t.setAttribute("srsName",n),"LineString"===t.nodeName||"LineStringSegment"===t.nodeName){var i=bs(t.namespaceURI,"posList");t.appendChild(i);this.writePosList_(i,e,r)}else if("Curve"===t.nodeName){var o=bs(t.namespaceURI,"segments");t.appendChild(o);this.writeCurveSegments_(o,e,r)}},e.prototype.writeMultiSurfaceOrPolygon_=function(t,e,r){var n=r[r.length-1],i=n.hasZ,o=n.srsName,a=n.surface;o&&t.setAttribute("srsName",o);var s=e.getPolygons();Ks({node:t,hasZ:i,srsName:o,surface:a},this.SURFACEORPOLYGONMEMBER_SERIALIZERS_,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,s,r,void 0,this)},e.prototype.writeMultiPoint_=function(t,e,r){var n=r[r.length-1],i=n.srsName,o=n.hasZ;i&&t.setAttribute("srsName",i);var a=e.getPoints();Ks({node:t,hasZ:o,srsName:i},this.POINTMEMBER_SERIALIZERS_,Bs("pointMember"),a,r,void 0,this)},e.prototype.writeMultiCurveOrLineString_=function(t,e,r){var n=r[r.length-1],i=n.hasZ,o=n.srsName,a=n.curve;o&&t.setAttribute("srsName",o);var s=e.getLineStrings();Ks({node:t,hasZ:i,srsName:o,curve:a},this.LINESTRINGORCURVEMEMBER_SERIALIZERS_,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,s,r,void 0,this)},e.prototype.writeRing_=function(t,e,r){var n=bs(t.namespaceURI,"LinearRing");t.appendChild(n);this.writeLinearRing_(n,e,r)},e.prototype.writeSurfaceOrPolygonMember_=function(t,e,r){var n=this.GEOMETRY_NODE_FACTORY_(e,r);n&&(t.appendChild(n),this.writeSurfaceOrPolygon_(n,e,r))},e.prototype.writePointMember_=function(t,e,r){var n=bs(t.namespaceURI,"Point");t.appendChild(n);this.writePoint_(n,e,r)},e.prototype.writeLineStringOrCurveMember_=function(t,e,r){var n=this.GEOMETRY_NODE_FACTORY_(e,r);n&&(t.appendChild(n),this.writeCurveOrLineString_(n,e,r))},e.prototype.writeSurfacePatches_=function(t,e,r){var n=bs(t.namespaceURI,"PolygonPatch");t.appendChild(n);this.writeSurfaceOrPolygon_(n,e,r)},e.prototype.writeCurveSegments_=function(t,e,r){var n=bs(t.namespaceURI,"LineStringSegment");t.appendChild(n);this.writeCurveOrLineString_(n,e,r)},e.prototype.writeGeometryElement=function(t,e,r){var n,i=r[r.length-1],o=p({},i);o.node=t;n=Array.isArray(e)?gd(e,i):_d(e,!0,i);Ks(o,this.GEOMETRY_SERIALIZERS_,this.GEOMETRY_NODE_FACTORY_,[n],r,void 0,this)},e.prototype.writeFeatureElement=function(t,e,r){var n=e.getId();n&&t.setAttribute("fid",n);var i=r[r.length-1],o=i.featureNS,a=e.getGeometryName();i.serializers||(i.serializers={},i.serializers[o]={});var s=e.getProperties(),u=[],l=[];for(var h in s){var c=s[h];null!==c&&(u.push(h),l.push(c),h==a||"function"==typeof c.getSimplifiedGeometry?h in i.serializers[o]||(i.serializers[o][h]=ks(this.writeGeometryElement,this)):h in i.serializers[o]||(i.serializers[o][h]=ks(Wd)))}var f=p({},i);f.node=t;Ks(f,i.serializers,Bs(void 0,o),l,r,u)},e.prototype.writeFeatureMembers_=function(t,e,r){var n=r[r.length-1],i=n.featureType,o=n.featureNS,a={};a[o]={};a[o][i]=ks(this.writeFeatureElement,this);var s=p({},n);s.node=t;Ks(s,a,Bs(i,o),e,r)},e.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_=function(t,e){var n=e[e.length-1].node;return bs(this.namespace,Hd[n.nodeName])},e.prototype.GEOMETRY_NODE_FACTORY_=function(t,e){var n,i=e[e.length-1],o=i.multiSurface,a=i.surface,s=i.curve,u=i.multiCurve;return Array.isArray(t)?n="Envelope":"MultiPolygon"===(n=t.getType())&&!0===o?n="MultiSurface":"Polygon"===n&&!0===a?n="Surface":"LineString"===n&&!0===s?n="Curve":"MultiLineString"===n&&!0===u&&(n="MultiCurve"),bs(this.namespace,n)},e.prototype.writeGeometryNode=function(t,e){e=this.adaptOptions(e);var r=bs(this.namespace,"geom"),n={node:r,hasZ:this.hasZ,srsName:this.srsName,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_};return e&&p(n,e),this.writeGeometryElement(r,t,[n]),r},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var r=bs(this.namespace,"featureMembers");r.setAttributeNS(Is,"xsi:schemaLocation",this.schemaLocation);var n={srsName:this.srsName,hasZ:this.hasZ,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_,featureNS:this.featureNS,featureType:this.featureType};return e&&p(n,e),this.writeFeatureMembers_(r,t,[n]),r},e}(Ad);qd.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{pos:Ds(qd.prototype.readFlatPos_),posList:Ds(qd.prototype.readFlatPosList_)}};qd.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{interior:qd.prototype.interiorParser_,exterior:qd.prototype.exteriorParser_}};qd.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:Ds(Ad.prototype.readPoint),MultiPoint:Ds(Ad.prototype.readMultiPoint),LineString:Ds(Ad.prototype.readLineString),MultiLineString:Ds(Ad.prototype.readMultiLineString),LinearRing:Ds(Ad.prototype.readLinearRing),Polygon:Ds(Ad.prototype.readPolygon),MultiPolygon:Ds(Ad.prototype.readMultiPolygon),Surface:Ds(qd.prototype.readSurface_),MultiSurface:Ds(qd.prototype.readMultiSurface_),Curve:Ds(qd.prototype.readCurve_),MultiCurve:Ds(qd.prototype.readMultiCurve_),Envelope:Ds(qd.prototype.readEnvelope_)}};qd.prototype.MULTICURVE_PARSERS_={"http://www.opengis.net/gml":{curveMember:Ns(qd.prototype.curveMemberParser_),curveMembers:Ns(qd.prototype.curveMemberParser_)}};qd.prototype.MULTISURFACE_PARSERS_={"http://www.opengis.net/gml":{surfaceMember:Ns(qd.prototype.surfaceMemberParser_),surfaceMembers:Ns(qd.prototype.surfaceMemberParser_)}};qd.prototype.CURVEMEMBER_PARSERS_={"http://www.opengis.net/gml":{LineString:Ns(Ad.prototype.readLineString),Curve:Ns(qd.prototype.readCurve_)}};qd.prototype.SURFACEMEMBER_PARSERS_={"http://www.opengis.net/gml":{Polygon:Ns(Ad.prototype.readPolygon),Surface:Ns(qd.prototype.readSurface_)}};qd.prototype.SURFACE_PARSERS_={"http://www.opengis.net/gml":{patches:Ds(qd.prototype.readPatch_)}};qd.prototype.CURVE_PARSERS_={"http://www.opengis.net/gml":{segments:Ds(qd.prototype.readSegment_)}};qd.prototype.ENVELOPE_PARSERS_={"http://www.opengis.net/gml":{lowerCorner:Ns(qd.prototype.readFlatPosList_),upperCorner:Ns(qd.prototype.readFlatPosList_)}};qd.prototype.PATCHES_PARSERS_={"http://www.opengis.net/gml":{PolygonPatch:Ds(qd.prototype.readPolygonPatch_)}};qd.prototype.SEGMENTS_PARSERS_={"http://www.opengis.net/gml":{LineStringSegment:Ds(qd.prototype.readLineStringSegment_)}};qd.prototype.writeFeatures;qd.prototype.RING_SERIALIZERS_={"http://www.opengis.net/gml":{exterior:ks(qd.prototype.writeRing_),interior:ks(qd.prototype.writeRing_)}};qd.prototype.ENVELOPE_SERIALIZERS_={"http://www.opengis.net/gml":{lowerCorner:ks(Wd),upperCorner:ks(Wd)}};qd.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{surfaceMember:ks(qd.prototype.writeSurfaceOrPolygonMember_),polygonMember:ks(qd.prototype.writeSurfaceOrPolygonMember_)}};qd.prototype.POINTMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{pointMember:ks(qd.prototype.writePointMember_)}};qd.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{lineStringMember:ks(qd.prototype.writeLineStringOrCurveMember_),curveMember:ks(qd.prototype.writeLineStringOrCurveMember_)}};qd.prototype.GEOMETRY_SERIALIZERS_={"http://www.opengis.net/gml":{Curve:ks(qd.prototype.writeCurveOrLineString_),MultiCurve:ks(qd.prototype.writeMultiCurveOrLineString_),Point:ks(qd.prototype.writePoint_),MultiPoint:ks(qd.prototype.writeMultiPoint_),LineString:ks(qd.prototype.writeCurveOrLineString_),MultiLineString:ks(qd.prototype.writeMultiCurveOrLineString_),LinearRing:ks(qd.prototype.writeLinearRing_),Polygon:ks(qd.prototype.writeSurfaceOrPolygon_),MultiPolygon:ks(qd.prototype.writeMultiSurfaceOrPolygon_),Surface:ks(qd.prototype.writeSurfaceOrPolygon_),MultiSurface:ks(qd.prototype.writeMultiSurfaceOrPolygon_),Envelope:ks(qd.prototype.writeEnvelope)}};var Jd=qd,Qd=Jd;Qd.prototype.writeFeatures;Qd.prototype.writeFeaturesNode;var $d=Qd,t_=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),e_=Ld+" http://schemas.opengis.net/gml/2.1.2/feature.xsd",r_={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"},n_=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,n)||this).FEATURE_COLLECTION_PARSERS[Ld].featureMember=Ns(r.readFeaturesInternal),r.schemaLocation=n.schemaLocation?n.schemaLocation:e_,r}return t_(e,t),e.prototype.readFlatCoordinates_=function(t,e){var r=Ls(t,!1).replace(/^\s*|\s*$/g,""),n=e[0].srsName,i="enu";if(n){var o=we(n);o&&(i=o.getAxisOrientation())}for(var a=r.trim().split(/\s+/),s=[],u=0,l=a.length;u<l;u++){var h=a[u].split(/,+/),c=parseFloat(h[0]),p=parseFloat(h[1]),f=3===h.length?parseFloat(h[2]):0;"en"===i.substr(0,2)?s.push(c,p,f):s.push(p,c,f)}return s},e.prototype.readBox_=function(t,e){var r=Ws([null],this.BOX_PARSERS_,t,e,this);return ut(r[1][0],r[1][1],r[1][3],r[1][4])},e.prototype.innerBoundaryIsParser_=function(t,e){var r=Ws(void 0,this.RING_PARSERS,t,e,this);r&&e[e.length-1].push(r)},e.prototype.outerBoundaryIsParser_=function(t,e){var r=Ws(void 0,this.RING_PARSERS,t,e,this);r&&(e[e.length-1][0]=r)},e.prototype.GEOMETRY_NODE_FACTORY_=function(t,e){var n,i=e[e.length-1],o=i.multiSurface,a=i.surface,s=i.multiCurve;return Array.isArray(t)?n="Envelope":"MultiPolygon"===(n=t.getType())&&!0===o?n="MultiSurface":"Polygon"===n&&!0===a?n="Surface":"MultiLineString"===n&&!0===s&&(n="MultiCurve"),bs("http://www.opengis.net/gml",n)},e.prototype.writeFeatureElement=function(t,e,r){var n=e.getId();n&&t.setAttribute("fid",n);var i=r[r.length-1],o=i.featureNS,a=e.getGeometryName();i.serializers||(i.serializers={},i.serializers[o]={});var s=e.getProperties(),u=[],l=[];for(var h in s){var c=s[h];null!==c&&(u.push(h),l.push(c),h==a||"function"==typeof c.getSimplifiedGeometry?h in i.serializers[o]||(i.serializers[o][h]=ks(this.writeGeometryElement,this)):h in i.serializers[o]||(i.serializers[o][h]=ks(Wd)))}var f=p({},i);f.node=t;Ks(f,i.serializers,Bs(void 0,o),l,r,u)},e.prototype.writeCurveOrLineString_=function(t,e,r){var n=r[r.length-1].srsName;if("LineStringSegment"!==t.nodeName&&n&&t.setAttribute("srsName",n),"LineString"===t.nodeName||"LineStringSegment"===t.nodeName){var i=this.createCoordinatesNode_(t.namespaceURI);t.appendChild(i);this.writeCoordinates_(i,e,r)}else if("Curve"===t.nodeName){var o=bs(t.namespaceURI,"segments");t.appendChild(o);this.writeCurveSegments_(o,e,r)}},e.prototype.writeLineStringOrCurveMember_=function(t,e,r){var n=this.GEOMETRY_NODE_FACTORY_(e,r);n&&(t.appendChild(n),this.writeCurveOrLineString_(n,e,r))},e.prototype.writeMultiCurveOrLineString_=function(t,e,r){var n=r[r.length-1],i=n.hasZ,o=n.srsName,a=n.curve;o&&t.setAttribute("srsName",o);var s=e.getLineStrings();Ks({node:t,hasZ:i,srsName:o,curve:a},this.LINESTRINGORCURVEMEMBER_SERIALIZERS_,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,s,r,void 0,this)},e.prototype.writeGeometryElement=function(t,e,r){var n,i=r[r.length-1],o=p({},i);o.node=t;n=Array.isArray(e)?gd(e,i):_d(e,!0,i);Ks(o,this.GEOMETRY_SERIALIZERS_,this.GEOMETRY_NODE_FACTORY_,[n],r,void 0,this)},e.prototype.createCoordinatesNode_=function(t){var e=bs(t,"coordinates");return e.setAttribute("decimal","."),e.setAttribute("cs",","),e.setAttribute("ts"," "),e},e.prototype.writeCoordinates_=function(t,e,r){for(var n=r[r.length-1],i=n.hasZ,o=n.srsName,a=e.getCoordinates(),s=a.length,u=new Array(s),l=0;l<s;++l){var h=a[l];u[l]=this.getCoords_(h,o,i)}Wd(t,u.join(" "))},e.prototype.writeCurveSegments_=function(t,e,r){var n=bs(t.namespaceURI,"LineStringSegment");t.appendChild(n);this.writeCurveOrLineString_(n,e,r)},e.prototype.writeSurfaceOrPolygon_=function(t,e,r){var n=r[r.length-1],i=n.hasZ,o=n.srsName;if("PolygonPatch"!==t.nodeName&&o&&t.setAttribute("srsName",o),"Polygon"===t.nodeName||"PolygonPatch"===t.nodeName){var a=e.getLinearRings();Ks({node:t,hasZ:i,srsName:o},this.RING_SERIALIZERS_,this.RING_NODE_FACTORY_,a,r,void 0,this)}else if("Surface"===t.nodeName){var s=bs(t.namespaceURI,"patches");t.appendChild(s);this.writeSurfacePatches_(s,e,r)}},e.prototype.RING_NODE_FACTORY_=function(t,e){var n=e[e.length-1],i=n.node,o=n.exteriorWritten;return void 0===o&&(n.exteriorWritten=!0),bs(i.namespaceURI,void 0!==o?"innerBoundaryIs":"outerBoundaryIs")},e.prototype.writeSurfacePatches_=function(t,e,r){var n=bs(t.namespaceURI,"PolygonPatch");t.appendChild(n);this.writeSurfaceOrPolygon_(n,e,r)},e.prototype.writeRing_=function(t,e,r){var n=bs(t.namespaceURI,"LinearRing");t.appendChild(n);this.writeLinearRing_(n,e,r)},e.prototype.getCoords_=function(t,e,r){var n="enu";e&&(n=we(e).getAxisOrientation());var i="en"===n.substr(0,2)?t[0]+","+t[1]:t[1]+","+t[0];return r&&(i+=","+(t[2]||0)),i},e.prototype.writePoint_=function(t,e,r){var n=r[r.length-1],i=n.hasZ,o=n.srsName;o&&t.setAttribute("srsName",o);var a=this.createCoordinatesNode_(t.namespaceURI);t.appendChild(a);var s=e.getCoordinates();Wd(a,this.getCoords_(s,o,i))},e.prototype.writeMultiPoint_=function(t,e,r){var n=r[r.length-1],i=n.hasZ,o=n.srsName;o&&t.setAttribute("srsName",o);var a=e.getPoints();Ks({node:t,hasZ:i,srsName:o},this.POINTMEMBER_SERIALIZERS_,Bs("pointMember"),a,r,void 0,this)},e.prototype.writePointMember_=function(t,e,r){var n=bs(t.namespaceURI,"Point");t.appendChild(n);this.writePoint_(n,e,r)},e.prototype.writeLinearRing_=function(t,e,r){var n=r[r.length-1].srsName;n&&t.setAttribute("srsName",n);var i=this.createCoordinatesNode_(t.namespaceURI);t.appendChild(i);this.writeCoordinates_(i,e,r)},e.prototype.writeMultiSurfaceOrPolygon_=function(t,e,r){var n=r[r.length-1],i=n.hasZ,o=n.srsName,a=n.surface;o&&t.setAttribute("srsName",o);var s=e.getPolygons();Ks({node:t,hasZ:i,srsName:o,surface:a},this.SURFACEORPOLYGONMEMBER_SERIALIZERS_,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,s,r,void 0,this)},e.prototype.writeSurfaceOrPolygonMember_=function(t,e,r){var n=this.GEOMETRY_NODE_FACTORY_(e,r);n&&(t.appendChild(n),this.writeSurfaceOrPolygon_(n,e,r))},e.prototype.writeEnvelope=function(t,e,r){var n=r[r.length-1].srsName;n&&t.setAttribute("srsName",n);var i=[e[0]+" "+e[1],e[2]+" "+e[3]];Ks({node:t},this.ENVELOPE_SERIALIZERS_,Ys,i,r,["lowerCorner","upperCorner"],this)},e.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_=function(t,e){var n=e[e.length-1].node;return bs("http://www.opengis.net/gml",r_[n.nodeName])},e}(Ad);n_.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{coordinates:Ds(n_.prototype.readFlatCoordinates_)}};n_.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{innerBoundaryIs:n_.prototype.innerBoundaryIsParser_,outerBoundaryIs:n_.prototype.outerBoundaryIsParser_}};n_.prototype.BOX_PARSERS_={"http://www.opengis.net/gml":{coordinates:Ns(n_.prototype.readFlatCoordinates_)}};n_.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:Ds(Ad.prototype.readPoint),MultiPoint:Ds(Ad.prototype.readMultiPoint),LineString:Ds(Ad.prototype.readLineString),MultiLineString:Ds(Ad.prototype.readMultiLineString),LinearRing:Ds(Ad.prototype.readLinearRing),Polygon:Ds(Ad.prototype.readPolygon),MultiPolygon:Ds(Ad.prototype.readMultiPolygon),Box:Ds(n_.prototype.readBox_)}};n_.prototype.GEOMETRY_SERIALIZERS_={"http://www.opengis.net/gml":{Curve:ks(n_.prototype.writeCurveOrLineString_),MultiCurve:ks(n_.prototype.writeMultiCurveOrLineString_),Point:ks(n_.prototype.writePoint_),MultiPoint:ks(n_.prototype.writeMultiPoint_),LineString:ks(n_.prototype.writeCurveOrLineString_),MultiLineString:ks(n_.prototype.writeMultiCurveOrLineString_),LinearRing:ks(n_.prototype.writeLinearRing_),Polygon:ks(n_.prototype.writeSurfaceOrPolygon_),MultiPolygon:ks(n_.prototype.writeMultiSurfaceOrPolygon_),Surface:ks(n_.prototype.writeSurfaceOrPolygon_),MultiSurface:ks(n_.prototype.writeMultiSurfaceOrPolygon_),Envelope:ks(n_.prototype.writeEnvelope)}};n_.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{lineStringMember:ks(n_.prototype.writeLineStringOrCurveMember_),curveMember:ks(n_.prototype.writeLineStringOrCurveMember_)}};n_.prototype.RING_SERIALIZERS_={"http://www.opengis.net/gml":{outerBoundaryIs:ks(n_.prototype.writeRing_),innerBoundaryIs:ks(n_.prototype.writeRing_)}};n_.prototype.POINTMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{pointMember:ks(n_.prototype.writePointMember_)}};n_.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{surfaceMember:ks(n_.prototype.writeSurfaceOrPolygonMember_),polygonMember:ks(n_.prototype.writeSurfaceOrPolygonMember_)}};n_.prototype.ENVELOPE_SERIALIZERS_={"http://www.opengis.net/gml":{lowerCorner:ks(Wd),upperCorner:ks(Wd)}};var i_=n_,o_=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),a_=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,n)||this).schemaLocation=n.schemaLocation?n.schemaLocation:r.namespace+" http://schemas.opengis.net/gml/3.2.1/gml.xsd",r}return o_(e,t),e}(Jd);a_.prototype.namespace="http://www.opengis.net/gml/3.2";a_.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml/3.2":{pos:Ds(Jd.prototype.readFlatPos_),posList:Ds(Jd.prototype.readFlatPosList_)}};a_.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml/3.2":{interior:Jd.prototype.interiorParser_,exterior:Jd.prototype.exteriorParser_}};a_.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml/3.2":{Point:Ds(Ad.prototype.readPoint),MultiPoint:Ds(Ad.prototype.readMultiPoint),LineString:Ds(Ad.prototype.readLineString),MultiLineString:Ds(Ad.prototype.readMultiLineString),LinearRing:Ds(Ad.prototype.readLinearRing),Polygon:Ds(Ad.prototype.readPolygon),MultiPolygon:Ds(Ad.prototype.readMultiPolygon),Surface:Ds(a_.prototype.readSurface_),MultiSurface:Ds(Jd.prototype.readMultiSurface_),Curve:Ds(a_.prototype.readCurve_),MultiCurve:Ds(Jd.prototype.readMultiCurve_),Envelope:Ds(a_.prototype.readEnvelope_)}};a_.prototype.MULTICURVE_PARSERS_={"http://www.opengis.net/gml/3.2":{curveMember:Ns(Jd.prototype.curveMemberParser_),curveMembers:Ns(Jd.prototype.curveMemberParser_)}};a_.prototype.MULTISURFACE_PARSERS_={"http://www.opengis.net/gml/3.2":{surfaceMember:Ns(Jd.prototype.surfaceMemberParser_),surfaceMembers:Ns(Jd.prototype.surfaceMemberParser_)}};a_.prototype.CURVEMEMBER_PARSERS_={"http://www.opengis.net/gml/3.2":{LineString:Ns(Ad.prototype.readLineString),Curve:Ns(Jd.prototype.readCurve_)}};a_.prototype.SURFACEMEMBER_PARSERS_={"http://www.opengis.net/gml/3.2":{Polygon:Ns(Ad.prototype.readPolygon),Surface:Ns(Jd.prototype.readSurface_)}};a_.prototype.SURFACE_PARSERS_={"http://www.opengis.net/gml/3.2":{patches:Ds(Jd.prototype.readPatch_)}};a_.prototype.CURVE_PARSERS_={"http://www.opengis.net/gml/3.2":{segments:Ds(Jd.prototype.readSegment_)}};a_.prototype.ENVELOPE_PARSERS_={"http://www.opengis.net/gml/3.2":{lowerCorner:Ns(Jd.prototype.readFlatPosList_),upperCorner:Ns(Jd.prototype.readFlatPosList_)}};a_.prototype.PATCHES_PARSERS_={"http://www.opengis.net/gml/3.2":{PolygonPatch:Ds(Jd.prototype.readPolygonPatch_)}};a_.prototype.SEGMENTS_PARSERS_={"http://www.opengis.net/gml/3.2":{LineStringSegment:Ds(Jd.prototype.readLineStringSegment_)}};a_.prototype.MULTIPOINT_PARSERS_={"http://www.opengis.net/gml/3.2":{pointMember:Ns(Ad.prototype.pointMemberParser_),pointMembers:Ns(Ad.prototype.pointMemberParser_)}};a_.prototype.MULTILINESTRING_PARSERS_={"http://www.opengis.net/gml/3.2":{lineStringMember:Ns(Ad.prototype.lineStringMemberParser_),lineStringMembers:Ns(Ad.prototype.lineStringMemberParser_)}};a_.prototype.MULTIPOLYGON_PARSERS_={"http://www.opengis.net/gml/3.2":{polygonMember:Ns(Ad.prototype.polygonMemberParser_),polygonMembers:Ns(Ad.prototype.polygonMemberParser_)}};a_.prototype.POINTMEMBER_PARSERS_={"http://www.opengis.net/gml/3.2":{Point:Ns(Ad.prototype.readFlatCoordinatesFromNode_)}};a_.prototype.LINESTRINGMEMBER_PARSERS_={"http://www.opengis.net/gml/3.2":{LineString:Ns(Ad.prototype.readLineString)}};a_.prototype.POLYGONMEMBER_PARSERS_={"http://www.opengis.net/gml/3.2":{Polygon:Ns(Ad.prototype.readPolygon)}};a_.prototype.RING_PARSERS={"http://www.opengis.net/gml/3.2":{LinearRing:Ds(Ad.prototype.readFlatLinearRing_)}};a_.prototype.RING_SERIALIZERS_={"http://www.opengis.net/gml/3.2":{exterior:ks(Jd.prototype.writeRing_),interior:ks(Jd.prototype.writeRing_)}};a_.prototype.ENVELOPE_SERIALIZERS_={"http://www.opengis.net/gml/3.2":{lowerCorner:ks(Wd),upperCorner:ks(Wd)}};a_.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_={"http://www.opengis.net/gml/3.2":{surfaceMember:ks(Jd.prototype.writeSurfaceOrPolygonMember_),polygonMember:ks(Jd.prototype.writeSurfaceOrPolygonMember_)}};a_.prototype.POINTMEMBER_SERIALIZERS_={"http://www.opengis.net/gml/3.2":{pointMember:ks(Jd.prototype.writePointMember_)}};a_.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_={"http://www.opengis.net/gml/3.2":{lineStringMember:ks(Jd.prototype.writeLineStringOrCurveMember_),curveMember:ks(Jd.prototype.writeLineStringOrCurveMember_)}};a_.prototype.GEOMETRY_SERIALIZERS_={"http://www.opengis.net/gml/3.2":{Curve:ks(Jd.prototype.writeCurveOrLineString_),MultiCurve:ks(Jd.prototype.writeMultiCurveOrLineString_),Point:ks(a_.prototype.writePoint_),MultiPoint:ks(Jd.prototype.writeMultiPoint_),LineString:ks(Jd.prototype.writeCurveOrLineString_),MultiLineString:ks(Jd.prototype.writeMultiCurveOrLineString_),LinearRing:ks(Jd.prototype.writeLinearRing_),Polygon:ks(Jd.prototype.writeSurfaceOrPolygon_),MultiPolygon:ks(Jd.prototype.writeMultiSurfaceOrPolygon_),Surface:ks(Jd.prototype.writeSurfaceOrPolygon_),MultiSurface:ks(Jd.prototype.writeMultiSurfaceOrPolygon_),Envelope:ks(Jd.prototype.writeEnvelope)}};var s_=a_,u_=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),l_=[null,"http://www.topografix.com/GPX/1/0","http://www.topografix.com/GPX/1/1"],h_={rte:j_,trk:k_,wpt:U_},c_=Xs(l_,{rte:Ns(j_),trk:Ns(k_),wpt:Ns(U_)}),p_=Xs(l_,{text:js(Yd,"linkText"),type:js(Yd,"linkType")}),f_=Xs(l_,{rte:ks(function(t,e,r){var n=r[0],i=e.getProperties(),o={node:t};o.properties=i;var a=e.getGeometry();if(a.getType()==Nt.LINE_STRING){var s=_d(a,!0,n);o.geometryLayout=s.getLayout();i.rtept=s.getCoordinates()}var u=r[r.length-1].node,l=w_[u.namespaceURI],h=zs(i,l);Ks(o,x_,Ys,h,r,l)}),trk:ks(function(t,e,r){var n=r[0],i=e.getProperties(),o={node:t};o.properties=i;var a=e.getGeometry();if(a.getType()==Nt.MULTI_LINE_STRING){var s=_d(a,!0,n);i.trkseg=s.getLineStrings()}var u=r[r.length-1].node,l=R_[u.namespaceURI],h=zs(i,l);Ks(o,C_,Ys,h,r,l)}),wpt:ks(function(t,e,r){var n=r[0],i=r[r.length-1];i.properties=e.getProperties();var o=e.getGeometry();if(o.getType()==Nt.POINT){var a=_d(o,!0,n);i.geometryLayout=a.getLayout();Y_(t,a.getCoordinates(),r)}})}),d_=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.dataProjection=we("EPSG:4326"),r.readExtensions_=n.readExtensions,r}return u_(e,t),e.prototype.handleReadExtensions_=function(t){t||(t=[]);for(var e=0,r=t.length;e<r;++e){var n=t[e];if(this.readExtensions_){var i=n.get("extensionsNode_")||null;this.readExtensions_(n,i)}n.set("extensionsNode_",void 0)}},e.prototype.readFeatureFromNode=function(t,e){if(!T(l_,t.namespaceURI))return null;var r=h_[t.localName];if(!r)return null;var n=r(t,[this.getReadOptions(t,e)]);return n?(this.handleReadExtensions_([n]),n):null},e.prototype.readFeaturesFromNode=function(t,e){if(!T(l_,t.namespaceURI))return[];if("gpx"==t.localName){var r=Ws([],c_,t,[this.getReadOptions(t,e)]);return r?(this.handleReadExtensions_(r),r):[]}return[]},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var r=bs("http://www.topografix.com/GPX/1/1","gpx");return r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xsi",Is),r.setAttributeNS(Is,"xsi:schemaLocation","http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"),r.setAttribute("version","1.1"),r.setAttribute("creator","OpenLayers"),Ks({node:r},f_,F_,t,[e]),r},e}(Id),__=Xs(l_,{name:js(Yd),cmt:js(Yd),desc:js(Yd),src:js(Yd),link:D_,number:js(Ud),extensions:G_,type:js(Yd),rtept:function(t,e){var r=Ws({},g_,t,e);if(r){var n=e[e.length-1],i=n.flatCoordinates,o=n.layoutOptions;A_(i,o,t,r)}}}),g_=Xs(l_,{ele:js(jd),time:js(Gd)}),y_=Xs(l_,{name:js(Yd),cmt:js(Yd),desc:js(Yd),src:js(Yd),link:D_,number:js(Ud),type:js(Yd),extensions:G_,trkseg:function(t,e){var r=e[e.length-1];Vs(v_,t,e);var n=r.flatCoordinates;r.ends.push(n.length)}}),v_=Xs(l_,{trkpt:function(t,e){var r=Ws({},m_,t,e);if(r){var n=e[e.length-1],i=n.flatCoordinates,o=n.layoutOptions;A_(i,o,t,r)}}}),m_=Xs(l_,{ele:js(jd),time:js(Gd)}),E_=Xs(l_,{ele:js(jd),time:js(Gd),magvar:js(jd),geoidheight:js(jd),name:js(Yd),cmt:js(Yd),desc:js(Yd),src:js(Yd),link:D_,sym:js(Yd),type:js(Yd),fix:js(Yd),sat:js(Ud),hdop:js(jd),vdop:js(jd),pdop:js(jd),ageofdgpsdata:js(jd),dgpsid:js(Ud),extensions:G_}),T_=["text","type"],S_=Xs(l_,{text:ks(Wd),type:ks(Wd)}),w_=Xs(l_,["name","cmt","desc","src","link","number","type","rtept"]),x_=Xs(l_,{name:ks(Wd),cmt:ks(Wd),desc:ks(Wd),src:ks(Wd),link:ks(B_),number:ks(Vd),type:ks(Wd),rtept:Us(ks(Y_))}),O_=Xs(l_,["ele","time"]),R_=Xs(l_,["name","cmt","desc","src","link","number","type","trkseg"]),C_=Xs(l_,{name:ks(Wd),cmt:ks(Wd),desc:ks(Wd),src:ks(Wd),link:ks(B_),number:ks(Vd),type:ks(Wd),trkseg:Us(ks(function(t,e,r){var n={node:t};n.geometryLayout=e.getLayout();n.properties={};Ks(n,I_,P_,e.getCoordinates(),r)}))}),P_=Bs("trkpt"),I_=Xs(l_,{trkpt:ks(Y_)}),b_=Xs(l_,["ele","time","magvar","geoidheight","name","cmt","desc","src","link","sym","type","fix","sat","hdop","vdop","pdop","ageofdgpsdata","dgpsid"]),L_=Xs(l_,{ele:ks(Xd),time:ks(function(t,e){var r=new Date(1e3*e),n=r.getUTCFullYear()+"-"+Bn(r.getUTCMonth()+1,2)+"-"+Bn(r.getUTCDate(),2)+"T"+Bn(r.getUTCHours(),2)+":"+Bn(r.getUTCMinutes(),2)+":"+Bn(r.getUTCSeconds(),2)+"Z";t.appendChild(Ps.createTextNode(n))}),magvar:ks(Xd),geoidheight:ks(Xd),name:ks(Wd),cmt:ks(Wd),desc:ks(Wd),src:ks(Wd),link:ks(B_),sym:ks(Wd),type:ks(Wd),fix:ks(Wd),sat:ks(Vd),hdop:ks(Xd),vdop:ks(Xd),pdop:ks(Xd),ageofdgpsdata:ks(Xd),dgpsid:ks(Vd)}),M_={Point:"wpt",LineString:"rte",MultiLineString:"trk"};function F_(t,e){var n=t.getGeometry();if(n){var i=M_[n.getType()];if(i)return bs(e[e.length-1].node.namespaceURI,i)}}function A_(t,e,r,n){return t.push(parseFloat(r.getAttribute("lon")),parseFloat(r.getAttribute("lat"))),"ele"in n?(t.push(n.ele),delete n.ele,e.hasZ=!0):t.push(0),"time"in n?(t.push(n.time),delete n.time,e.hasM=!0):t.push(0),t}function N_(t,e,r){var n=At.XY,i=2;if(t.hasZ&&t.hasM?(n=At.XYZM,i=4):t.hasZ?(n=At.XYZ,i=3):t.hasM&&(n=At.XYM,i=3),4!==i){for(var o=0,a=e.length/4;o<a;o++)e[o*i]=e[4*o],e[o*i+1]=e[4*o+1],t.hasZ&&(e[o*i+2]=e[4*o+2]),t.hasM&&(e[o*i+2]=e[4*o+3]);if(e.length=e.length/4*i,r)for(o=0,a=r.length;o<a;o++)r[o]=r[o]/4*i}return n}function D_(t,e){var r=e[e.length-1],n=t.getAttribute("href");null!==n&&(r.link=n);Vs(p_,t,e)}function G_(t,e){e[e.length-1].extensionsNode_=t}function j_(t,e){var r=e[0],n=Ws({flatCoordinates:[],layoutOptions:{}},__,t,e);if(n){var i=n.flatCoordinates;delete n.flatCoordinates;var o=n.layoutOptions;delete n.layoutOptions;var a=N_(o,i),s=new Vp(i,a);_d(s,!1,r);var u=new q(s);return u.setProperties(n,!0),u}}function k_(t,e){var r=e[0],n=Ws({flatCoordinates:[],ends:[],layoutOptions:{}},y_,t,e);if(n){var i=n.flatCoordinates;delete n.flatCoordinates;var o=n.ends;delete n.ends;var a=n.layoutOptions;delete n.layoutOptions;var s=N_(a,i,o),u=new vf(i,s,o);_d(u,!1,r);var l=new q(u);return l.setProperties(n,!0),l}}function U_(t,e){var r=e[0],n=Ws({},E_,t,e);if(n){var i={},o=A_([],i,t,n),a=N_(i,o),s=new Or(o,a);_d(s,!1,r);var u=new q(s);return u.setProperties(n,!0),u}}function B_(t,e,r){t.setAttribute("href",e);var n=r[r.length-1].properties,i=[n.linkText,n.linkType];Ks({node:t},S_,Ys,i,r,T_)}function Y_(t,e,r){var n=r[r.length-1],i=n.node.namespaceURI,o=n.properties;switch(t.setAttributeNS(null,"lat",String(e[1])),t.setAttributeNS(null,"lon",String(e[0])),n.geometryLayout){case At.XYZM:0!==e[3]&&(o.time=e[3]);case At.XYZ:0!==e[2]&&(o.ele=e[2]);break;case At.XYM:0!==e[2]&&(o.time=e[2])}var a="rtept"==t.nodeName?O_[i]:b_[i],s=zs(o,a);Ks({node:t,properties:o},L_,Ys,s,r,a)}var z_=d_,X_=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function V_(t,e){if(!t)return null;var r;switch(t.type){case Nt.POINT:r=function(t){return new Or(t.coordinates)}(t);break;case Nt.LINE_STRING:r=function(t){return new Vp(t.coordinates)}(t);break;case Nt.POLYGON:r=function(t){return new Br(t.coordinates)}(t);break;case Nt.MULTI_POINT:r=function(t){return new Ef(t.coordinates)}(t);break;case Nt.MULTI_LINE_STRING:r=function(t){return new vf(t.coordinates)}(t);break;case Nt.MULTI_POLYGON:r=function(t){return new wf(t.coordinates)}(t);break;case Nt.GEOMETRY_COLLECTION:r=function(t,e){var r=t.geometries.map(function(t){return V_(t,e)});return new fd(r)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type);}return _d(r,!1,e)}function W_(t,e){var r,n=(t=_d(t,!0,e)).getType();switch(n){case Nt.POINT:r=function(t){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case Nt.LINE_STRING:r=function(t){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case Nt.POLYGON:r=function(t,e){var r;return e&&(r=e.rightHanded),{type:"Polygon",coordinates:t.getCoordinates(r)}}(t,e);break;case Nt.MULTI_POINT:r=function(t){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case Nt.MULTI_LINE_STRING:r=function(t){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case Nt.MULTI_POLYGON:r=function(t,e){var r;return e&&(r=e.rightHanded),{type:"MultiPolygon",coordinates:t.getCoordinates(r)}}(t,e);break;case Nt.GEOMETRY_COLLECTION:r=function(t,e){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map(function(t){var r=p({},e);return delete r.featureProjection,W_(t,r)})}}(t,e);break;case Nt.CIRCLE:r={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+n);}return r}var Z_=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this)||this).dataProjection=we(n.dataProjection?n.dataProjection:"EPSG:4326"),n.featureProjection&&(r.defaultFeatureProjection=we(n.featureProjection)),r.geometryName_=n.geometryName,r.extractGeometryName_=n.extractGeometryName,r}return X_(e,t),e.prototype.readFeatureFromObject=function(t,e){var r=null,n=V_((r="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,e),i=new q;return this.geometryName_?i.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in r!==void 0&&i.setGeometryName(r.geometry_name),i.setGeometry(n),"id"in r&&i.setId(r.id),r.properties&&i.setProperties(r.properties,!0),i},e.prototype.readFeaturesFromObject=function(t,e){var r=null;if("FeatureCollection"===t.type){r=[];for(var n=t.features,i=0,o=n.length;i<o;++i)r.push(this.readFeatureFromObject(n[i],e))}else r=[this.readFeatureFromObject(t,e)];return r},e.prototype.readGeometryFromObject=function(t,e){return V_(t,e)},e.prototype.readProjectionFromObject=function(t){var e,r=t.crs;return r?"name"==r.type?e=we(r.properties.name):K(!1,36):e=this.dataProjection,e},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var r={type:"Feature",geometry:null,properties:null},n=t.getId();void 0!==n&&(r.id=n);var i=t.getGeometry();i&&(r.geometry=W_(i,e));var o=t.getProperties();return delete o[t.getGeometryName()],_(o)||(r.properties=o),r},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var r=[],n=0,i=t.length;n<i;++n)r.push(this.writeFeatureObject(t[n],e));return{type:"FeatureCollection",features:r}},e.prototype.writeGeometryObject=function(t,e){return W_(t,this.adaptOptions(e))},e}(md),K_=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function H_(t){return"string"==typeof t?t:""}var q_,J_,Q_,$_,tg,eg,rg,ng=function(t){function e(){return t.call(this)||this}return K_(e,t),e.prototype.getType=function(){return rs.TEXT},e.prototype.readFeature=function(t,e){return this.readFeatureFromText(H_(t),this.adaptOptions(e))},e.prototype.readFeatureFromText=function(){return n()},e.prototype.readFeatures=function(t,e){return this.readFeaturesFromText(H_(t),this.adaptOptions(e))},e.prototype.readFeaturesFromText=function(){return n()},e.prototype.readGeometry=function(t,e){return this.readGeometryFromText(H_(t),this.adaptOptions(e))},e.prototype.readGeometryFromText=function(){return n()},e.prototype.readProjection=function(t){return this.readProjectionFromText(H_(t))},e.prototype.readProjectionFromText=function(){return this.dataProjection},e.prototype.writeFeature=function(t,e){return this.writeFeatureText(t,this.adaptOptions(e))},e.prototype.writeFeatureText=function(){return n()},e.prototype.writeFeatures=function(t,e){return this.writeFeaturesText(t,this.adaptOptions(e))},e.prototype.writeFeaturesText=function(){return n()},e.prototype.writeGeometry=function(t,e){return this.writeGeometryText(t,this.adaptOptions(e))},e.prototype.writeGeometryText=function(){return n()},e}(dd),ig=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),og={BAROMETRIC:"barometric",GPS:"gps",NONE:"none"},ag=/^B(\d{2})(\d{2})(\d{2})(\d{2})(\d{5})([NS])(\d{3})(\d{5})([EW])([AV])(\d{5})(\d{5})/,sg=/^H.([A-Z]{3}).*?:(.*)/,ug=/^HFDTE(\d{2})(\d{2})(\d{2})/,lg=/\r\n|\r|\n/,hg=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.dataProjection=we("EPSG:4326"),r.altitudeMode_=n.altitudeMode?n.altitudeMode:og.NONE,r}return ig(e,t),e.prototype.readFeatureFromText=function(t,e){for(var i=this.altitudeMode_,o=t.split(lg),a={},s=[],u=2e3,l=0,h=1,c=-1,r=0,n=o.length;r<n;++r){var p=o[r],f=void 0;if("B"==p.charAt(0)){if(f=ag.exec(p)){var d=parseInt(f[1],10),_=parseInt(f[2],10),g=parseInt(f[3],10),y=parseInt(f[4],10)+parseInt(f[5],10)/6e4;"S"==f[6]&&(y=-y);var v=parseInt(f[7],10)+parseInt(f[8],10)/6e4;if("W"==f[9]&&(v=-v),s.push(v,y),i!=og.NONE){var m=void 0;m=i==og.GPS?parseInt(f[11],10):i==og.BAROMETRIC?parseInt(f[12],10):0;s.push(m)}var E=Date.UTC(u,l,h,d,_,g);E<c&&(E=Date.UTC(u,l,h+1,d,_,g));s.push(E/1e3);c=E}}else"H"==p.charAt(0)&&((f=ug.exec(p))?(h=parseInt(f[1],10),l=parseInt(f[2],10)-1,u=2e3+parseInt(f[3],10)):(f=sg.exec(p))&&(a[f[1]]=f[2].trim()))}if(0===s.length)return null;var T=i==og.NONE?At.XYM:At.XYZM,S=new Vp(s,T),w=new q(_d(S,!1,e));return w.setProperties(a,!0),w},e.prototype.readFeaturesFromText=function(t,e){var r=this.readFeatureFromText(t,e);return r?[r]:[]},e}(ng),cg=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),pg=["http://www.google.com/kml/ext/2.2"],fg=[null,"http://earth.google.com/kml/2.0","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.2","http://www.opengis.net/kml/2.2"],dg={fraction:Tu.FRACTION,pixels:Tu.PIXELS,insetPixels:Tu.PIXELS},_g=Xs(fg,{ExtendedData:uy,Region:ly,MultiGeometry:js($g,"geometry"),LineString:js(qg,"geometry"),LinearRing:js(Jg,"geometry"),Point:js(ty,"geometry"),Polygon:js(ry,"geometry"),Style:js(iy),StyleMap:function(t,e){var r=Dg(t,e);if(r){var n=e[e.length-1];Array.isArray(r)?n.Style=r:"string"==typeof r?n.styleUrl=r:K(!1,38)}},address:js(Yd),description:js(Yd),name:js(Yd),open:js(Nd),phoneNumber:js(Yd),styleUrl:js(Fg),visibility:js(Nd)},Xs(pg,{MultiTrack:js(function(t,e){var r=Ws([],zg,t,e);if(r)return new vf(r)},"geometry"),Track:js(Vg,"geometry")})),gg=Xs(fg,{ExtendedData:uy,Region:ly,Link:function(t,e){Vs(yg,t,e)},address:js(Yd),description:js(Yd),name:js(Yd),open:js(Nd),phoneNumber:js(Yd),visibility:js(Nd)}),yg=Xs(fg,{href:js(Fg)}),vg=Xs(fg,{LatLonAltBox:function(t,e){var r=Ws({},py,t,e);if(r){var n=e[e.length-1],i=[parseFloat(r.west),parseFloat(r.south),parseFloat(r.east),parseFloat(r.north)];n.extent=i;n.altitudeMode=r.altitudeMode;n.minAltitude=parseFloat(r.minAltitude);n.maxAltitude=parseFloat(r.maxAltitude)}},Lod:function(t,e){var r=Ws({},fy,t,e);if(r){var n=e[e.length-1];n.minLodPixels=parseFloat(r.minLodPixels);n.maxLodPixels=parseFloat(r.maxLodPixels);n.minFadeExtent=parseFloat(r.minFadeExtent);n.maxFadeExtent=parseFloat(r.maxFadeExtent)}}}),mg=Xs(fg,["Document","Placemark"]),Eg=Xs(fg,{Document:ks(function(t,e,r){Ks({node:t},vy,my,e,r,void 0,this)}),Placemark:ks(zy)}),Tg=null,Sg,wg=null,xg,Og=null,Rg=null,Cg=null,Pg=null,Ig=function(t){function e(e){var r=t.call(this)||this,n=e||{};return Pg||(Tg=new Eu({color:q_=[255,255,255,1]}),J_=[20,2],Q_=Tu.PIXELS,$_=Tu.PIXELS,tg=[64,64],eg="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png",rg=.5,wg=new Lu({anchor:J_,anchorOrigin:Iu.BOTTOM_LEFT,anchorXUnits:Q_,anchorYUnits:$_,crossOrigin:"anonymous",rotation:0,scale:rg,size:tg,src:eg}),Sg="NO_IMAGE",Og=new Mu({color:q_,width:1}),xg=new Mu({color:[51,51,51,1],width:2}),Rg=new Bu({font:"bold 16px Helvetica",fill:Tg,stroke:xg,scale:.8}),Cg=new ju({fill:Tg,image:wg,text:Rg,stroke:Og,zIndex:0}),Pg=[Cg]),r.dataProjection=we("EPSG:4326"),r.defaultStyle_=n.defaultStyle?n.defaultStyle:Pg,r.extractStyles_=void 0===n.extractStyles||n.extractStyles,r.writeStyles_=void 0===n.writeStyles||n.writeStyles,r.sharedStyles_={},r.showPointNames_=void 0===n.showPointNames||n.showPointNames,r}return cg(e,t),e.prototype.readDocumentOrFolder_=function(t,e){var r=Ws([],Xs(fg,{Document:As(this.readDocumentOrFolder_,this),Folder:As(this.readDocumentOrFolder_,this),Placemark:Ns(this.readPlacemark_,this),Style:this.readSharedStyle_.bind(this),StyleMap:this.readSharedStyleMap_.bind(this)}),t,e,this);return r||void 0},e.prototype.readPlacemark_=function(t,e){var r=Ws({geometry:null},_g,t,e);if(r){var n=new q,i=t.getAttribute("id");null!==i&&n.setId(i);var o=e[0],a=r.geometry;if(a&&_d(a,!1,o),n.setGeometry(a),delete r.geometry,this.extractStyles_){var s=function(t,e,r,n,i){return function(o){var s,u=i,l="";if(u){var h=o.getGeometry();h&&(u=h.getType()===Nt.POINT)}if(u&&(l=o.get("name"),u=u&&!!l),t)return u?(s=bg(t[0],l),t.concat(s)):t;if(e){var c=function t(e,r,n){return Array.isArray(e)?e:"string"==typeof e?(!(e in n)&&"#"+e in n&&(e="#"+e),t(n[e],r,n)):r}(e,r,n);return u?(s=bg(c[0],l),c.concat(s)):c}return u?(s=bg(r[0],l),r.concat(s)):r}}(r.Style,r.styleUrl,this.defaultStyle_,this.sharedStyles_,this.showPointNames_);n.setStyle(s)}return delete r.Style,n.setProperties(r,!0),n}},e.prototype.readSharedStyle_=function(t,e){var r=t.getAttribute("id");if(null!==r){var n=iy(t,e);if(n){var i=void 0,o=t.baseURI;i=(o&&"about:blank"!=o||(o=window.location.href),o)?new URL("#"+r,o).href:"#"+r;this.sharedStyles_[i]=n}}},e.prototype.readSharedStyleMap_=function(t,e){var r=t.getAttribute("id");if(null!==r){var n=Dg(t,e);if(n){var i,o=t.baseURI;i=(o&&"about:blank"!=o||(o=window.location.href),o)?new URL("#"+r,o).href:"#"+r;this.sharedStyles_[i]=n}}},e.prototype.readFeatureFromNode=function(t,e){if(!T(fg,t.namespaceURI))return null;var r=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return r||null},e.prototype.readFeaturesFromNode=function(t,e){if(!T(fg,t.namespaceURI))return[];var r,n=t.localName;if("Document"==n||"Folder"==n)return(r=this.readDocumentOrFolder_(t,[this.getReadOptions(t,e)]))||[];if("Placemark"==n){var i=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return i?[i]:[]}if("kml"==n){r=[];for(var o=t.firstElementChild;o;o=o.nextElementSibling){var a=this.readFeaturesFromNode(o,e);a&&x(r,a)}return r}return[]},e.prototype.readName=function(t){if(t){if("string"==typeof t){var e=Fs(t);return this.readNameFromDocument(e)}return Ms(t)?this.readNameFromDocument(t):this.readNameFromNode(t)}},e.prototype.readNameFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE){var r=this.readNameFromNode(e);if(r)return r}},e.prototype.readNameFromNode=function(t){for(var e=t.firstElementChild;e;e=e.nextElementSibling)if(T(fg,e.namespaceURI)&&"name"==e.localName)return Yd(e);for(e=t.firstElementChild;e;e=e.nextElementSibling){var r=e.localName;if(T(fg,e.namespaceURI)&&("Document"==r||"Folder"==r||"Placemark"==r||"kml"==r)){var n=this.readNameFromNode(e);if(n)return n}}},e.prototype.readNetworkLinks=function(t){var e=[];if("string"==typeof t){var r=Fs(t);x(e,this.readNetworkLinksFromDocument(r))}else Ms(t)?x(e,this.readNetworkLinksFromDocument(t)):x(e,this.readNetworkLinksFromNode(t));return e},e.prototype.readNetworkLinksFromDocument=function(t){for(var e=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&x(e,this.readNetworkLinksFromNode(r));return e},e.prototype.readNetworkLinksFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(T(fg,r.namespaceURI)&&"NetworkLink"==r.localName){var n=Ws({},gg,r,[]);e.push(n)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var i=r.localName;T(fg,r.namespaceURI)&&("Document"==i||"Folder"==i||"kml"==i)&&x(e,this.readNetworkLinksFromNode(r))}return e},e.prototype.readRegion=function(t){var e=[];if("string"==typeof t){var r=Fs(t);x(e,this.readRegionFromDocument(r))}else Ms(t)?x(e,this.readRegionFromDocument(t)):x(e,this.readRegionFromNode(t));return e},e.prototype.readRegionFromDocument=function(t){for(var e=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&x(e,this.readRegionFromNode(r));return e},e.prototype.readRegionFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(T(fg,r.namespaceURI)&&"Region"==r.localName){var n=Ws({},vg,r,[]);e.push(n)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var i=r.localName;T(fg,r.namespaceURI)&&("Document"==i||"Folder"==i||"kml"==i)&&x(e,this.readRegionFromNode(r))}return e},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var r=bs(fg[4],"kml"),n="http://www.w3.org/2000/xmlns/";r.setAttributeNS(n,"xmlns:gx",pg[0]);r.setAttributeNS(n,"xmlns:xsi",Is);r.setAttributeNS(Is,"xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");var i={node:r},o={};t.length>1?o.Document=t:1==t.length&&(o.Placemark=t[0]);var a=mg[r.namespaceURI],s=zs(o,a);return Ks(i,Eg,Ys,s,[e],a,this),r},e}(Id);function bg(t,e){var r=null,n=[0,0],i="start";if(t.getImage()){var o=t.getImage().getImageSize();if(null===o&&(o=tg),2==o.length){var a=t.getImage().getScale();n[0]=a*o[0]/2;n[1]=-a*o[1]/2;i="left"}}if(null!==t.getText()){var s=t.getText();(r=s.clone()).setFont(s.getFont()||Rg.getFont());r.setScale(s.getScale()||Rg.getScale());r.setFill(s.getFill()||Rg.getFill());r.setStroke(s.getStroke()||xg)}else r=Rg.clone();return r.setText(e),r.setOffsetX(n[0]),r.setOffsetY(n[1]),r.setTextAlign(i),new ju({text:r})}function Lg(t){var e=Ls(t,!1),r=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(e);if(r){var n=r[1];return[parseInt(n.substr(6,2),16),parseInt(n.substr(4,2),16),parseInt(n.substr(2,2),16),parseInt(n.substr(0,2),16)/255]}}function Mg(t){for(var e,r=Ls(t,!1),n=[];e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?))?\s*/i.exec(r);){var o=parseFloat(e[1]),a=parseFloat(e[2]),s=e[3]?parseFloat(e[3]):0;n.push(o,a,s);r=r.substr(e[0].length)}if(""===r)return n}function Fg(t){var e=Ls(t,!1).trim(),r=t.baseURI;return r&&"about:blank"!=r||(r=window.location.href),r?new URL(e,r).href:e}function Ag(t){return jd(t)}var Ng=Xs(fg,{Pair:function(t,e){var r=Ws({},hy,t,e);if(r){var n=r.key;if(n&&"normal"==n){var i=r.styleUrl;i&&(e[e.length-1]=i);var o=r.Style;o&&(e[e.length-1]=o)}}}});function Dg(t,e){return Ws(void 0,Ng,t,e)}var Gg=Xs(fg,{Icon:js(function(t,e){var r=Ws({},Wg,t,e);return r||null}),heading:js(jd),hotSpot:js(function(t){var e,r=t.getAttribute("xunits"),n=t.getAttribute("yunits");return e="insetPixels"!==r?"insetPixels"!==n?Iu.BOTTOM_LEFT:Iu.TOP_LEFT:"insetPixels"!==n?Iu.BOTTOM_RIGHT:Iu.TOP_RIGHT,{x:parseFloat(t.getAttribute("x")),xunits:dg[r],y:parseFloat(t.getAttribute("y")),yunits:dg[n],origin:e}}),scale:js(Ag)}),jg=Xs(fg,{color:js(Lg),scale:js(Ag)}),kg=Xs(fg,{color:js(Lg),width:js(jd)}),Ug=Xs(fg,{color:js(Lg),fill:js(Nd),outline:js(Nd)}),Bg=Xs(fg,{coordinates:Ds(Mg)});function Yg(t,e){return Ws(null,Bg,t,e)}var zg=Xs(pg,{Track:Ns(Vg)}),Xg=Xs(fg,{when:function(t,e){var r=e[e.length-1].whens,n=Ls(t,!1),i=Date.parse(n);r.push(isNaN(i)?0:i)}},Xs(pg,{coord:function(t,e){var r=e[e.length-1].flatCoordinates,n=Ls(t,!1),i=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(n);if(i){var o=parseFloat(i[1]),a=parseFloat(i[2]),s=parseFloat(i[3]);r.push(o,a,s,0)}else r.push(0,0,0,0)}}));function Vg(t,e){var r=Ws({flatCoordinates:[],whens:[]},Xg,t,e);if(r){for(var n=r.flatCoordinates,i=r.whens,o=0,a=Math.min(n.length,i.length);o<a;++o)n[4*o+3]=i[o];return new Vp(n,At.XYZM)}}var Wg=Xs(fg,{href:js(Fg)},Xs(pg,{x:js(jd),y:js(jd),w:js(jd),h:js(jd)})),Zg=Xs(fg,{coordinates:Ds(Mg)});function Kg(t,e){return Ws(null,Zg,t,e)}var Hg=Xs(fg,{extrude:js(Nd),tessellate:js(Nd),altitudeMode:js(Yd)});function qg(t,e){var r=Ws({},Hg,t,e),n=Kg(t,e);if(n){var i=new Vp(n,At.XYZ);return i.setProperties(r,!0),i}}function Jg(t,e){var r=Ws({},Hg,t,e),n=Kg(t,e);if(n){var i=new Br(n,At.XYZ,[n.length]);return i.setProperties(r,!0),i}}var Qg=Xs(fg,{LineString:Ns(qg),LinearRing:Ns(Jg),MultiGeometry:Ns($g),Point:Ns(ty),Polygon:Ns(ry)});function $g(t,e){var r,n=Ws([],Qg,t,e);if(!n)return null;if(0===n.length)return new fd(n);for(var i=!0,o=n[0].getType(),a=1,s=n.length;a<s;++a)if(n[a].getType()!=o){i=!1;break}if(i){var u=void 0,l=void 0;if(o==Nt.POINT){var h=n[0];for(u=h.getLayout(),l=h.getFlatCoordinates(),a=1,s=n.length;a<s;++a)x(l,n[a].getFlatCoordinates());oy(r=new Ef(l,u),n)}else o==Nt.LINE_STRING?oy(r=new vf(n),n):o==Nt.POLYGON?oy(r=new wf(n),n):o==Nt.GEOMETRY_COLLECTION?r=new fd(n):K(!1,37)}else r=new fd(n);return r}function ty(t,e){var r=Ws({},Hg,t,e),n=Kg(t,e);if(n){var i=new Or(n,At.XYZ);return i.setProperties(r,!0),i}}var ey=Xs(fg,{innerBoundaryIs:function(t,e){var r=Ws(void 0,dy,t,e);r&&e[e.length-1].push(r)},outerBoundaryIs:function(t,e){var r=Ws(void 0,_y,t,e);r&&(e[e.length-1][0]=r)}});function ry(t,e){var r=Ws({},Hg,t,e),n=Ws([null],ey,t,e);if(n&&n[0]){for(var i=n[0],o=[i.length],a=1,s=n.length;a<s;++a)x(i,n[a]),o.push(i.length);var u=new Br(i,At.XYZ,o);return u.setProperties(r,!0),u}}var ny=Xs(fg,{IconStyle:function(t,e){var r=Ws({},Gg,t,e);if(r){var n,i,o,a,s=e[e.length-1],u="Icon"in r?r.Icon:{},l=!("Icon"in r)||Object.keys(u).length>0,h=u.href;h?n=h:l&&(n=eg);var c,p=Iu.BOTTOM_LEFT,f=r.hotSpot;f?(i=[f.x,f.y],o=f.xunits,a=f.yunits,p=f.origin):n===eg?(i=J_,o=Q_,a=$_):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(n)&&(i=[.5,0],o=Tu.FRACTION,a=Tu.FRACTION);var d,_=u.x,g=u.y;void 0!==_&&void 0!==g&&(c=[_,g]);var y,v=u.w,m=u.h;void 0!==v&&void 0!==m&&(d=[v,m]);var E=r.heading;void 0!==E&&(y=Xt(E));var T=r.scale;if(l){n==eg&&(d=tg,void 0===T&&(T=rg));var S=new Lu({anchor:i,anchorOrigin:p,anchorXUnits:o,anchorYUnits:a,crossOrigin:"anonymous",offset:c,offsetOrigin:Iu.BOTTOM_LEFT,rotation:y,scale:T,size:d,src:n});s.imageStyle=S}else s.imageStyle=Sg}},LabelStyle:function(t,e){var r=Ws({},jg,t,e);if(r){var n=e[e.length-1],i=new Bu({fill:new Eu({color:"color"in r?r.color:q_}),scale:r.scale});n.textStyle=i}},LineStyle:function(t,e){var r=Ws({},kg,t,e);if(r){var n=e[e.length-1],i=new Mu({color:"color"in r?r.color:q_,width:"width"in r?r.width:1});n.strokeStyle=i}},PolyStyle:function(t,e){var r=Ws({},Ug,t,e);if(r){var n=e[e.length-1],i=new Eu({color:"color"in r?r.color:q_});n.fillStyle=i;var o=r.fill;void 0!==o&&(n.fill=o);var a=r.outline;void 0!==a&&(n.outline=a)}}});function iy(t,e){var r=Ws({},ny,t,e);if(!r)return null;var n,i="fillStyle"in r?r.fillStyle:Tg,o=r.fill;void 0===o||o||(i=null);"imageStyle"in r?r.imageStyle!=Sg&&(n=r.imageStyle):n=wg;var a="textStyle"in r?r.textStyle:Rg,s="strokeStyle"in r?r.strokeStyle:Og,u=r.outline;return void 0===u||u||(s=null),[new ju({fill:i,image:n,stroke:s,text:a,zIndex:void 0})]}function oy(t,e){var r,n,i,o=e.length,a=new Array(e.length),s=new Array(e.length),u=new Array(e.length);r=!1;n=!1;i=!1;for(var l=0;l<o;++l){var h=e[l];a[l]=h.get("extrude");s[l]=h.get("tessellate");u[l]=h.get("altitudeMode");r=r||void 0!==a[l];n=n||void 0!==s[l];i=i||u[l]}r&&t.set("extrude",a);n&&t.set("tessellate",s);i&&t.set("altitudeMode",u)}var ay=Xs(fg,{displayName:js(Yd),value:js(Yd)}),sy=Xs(fg,{Data:function(t,e){var r=t.getAttribute("name");Vs(ay,t,e);var n=e[e.length-1];r&&n.displayName?n[r]={value:n.value,displayName:n.displayName,toString:function(){return n.value}}:null!==r?n[r]=n.value:null!==n.displayName&&(n[n.displayName]=n.value);delete n.value},SchemaData:function(t,e){Vs(cy,t,e)}});function uy(t,e){Vs(sy,t,e)}function ly(t,e){Vs(vg,t,e)}var hy=Xs(fg,{Style:js(iy),key:js(Yd),styleUrl:js(Fg)}),cy=Xs(fg,{SimpleData:function(t,e){var r=t.getAttribute("name");if(null!==r){var n=Yd(t);e[e.length-1][r]=n}}}),py=Xs(fg,{altitudeMode:js(Yd),minAltitude:js(jd),maxAltitude:js(jd),north:js(jd),south:js(jd),east:js(jd),west:js(jd)}),fy=Xs(fg,{minLodPixels:js(jd),maxLodPixels:js(jd),minFadeExtent:js(jd),maxFadeExtent:js(jd)}),dy=Xs(fg,{LinearRing:Ds(Yg)}),_y=Xs(fg,{LinearRing:Ds(Yg)});function gy(t,e){for(var r=oa(e),n=[255*(4==r.length?r[3]:1),r[2],r[1],r[0]],i=0;i<4;++i){var o=Math.floor(n[i]).toString(16);n[i]=1==o.length?"0"+o:o}Wd(t,n.join(""))}var yy=Xs(fg,{Data:ks(function(t,e,r){t.setAttribute("name",e.name);var n={node:t},i=e.value;"object"==typeof i?(null!==i&&i.displayName&&Ks(n,yy,Ys,[i.displayName],r,["displayName"]),null!==i&&i.value&&Ks(n,yy,Ys,[i.value],r,["value"])):Ks(n,yy,Ys,[i],r,["value"])}),value:ks(function(t,e){Wd(t,e)}),displayName:ks(function(t,e){!function(t,e){t.appendChild(Ps.createCDATASection(e))}(t,e)})}),vy=Xs(fg,{Placemark:ks(zy)}),my=function(t,e){return bs(e[e.length-1].node.namespaceURI,"Placemark")},Ey=Bs("Data"),Ty=Xs(fg,["href"],Xs(pg,["x","y","w","h"])),Sy=Xs(fg,{href:ks(Wd)},Xs(pg,{x:ks(Xd),y:ks(Xd),w:ks(Xd),h:ks(Xd)})),wy=function(t,e,r){return bs(pg[0],"gx:"+r)},xy=Xs(fg,["scale","heading","Icon","hotSpot"]),Oy=Xs(fg,{Icon:ks(function(t,e,r){var n={node:t},i=r[r.length-1].node,o=Ty[i.namespaceURI],a=zs(e,o);Ks(n,Sy,Ys,a,r,o);a=zs(e,o=Ty[pg[0]]);Ks(n,Sy,wy,a,r,o)}),heading:ks(Xd),hotSpot:ks(function(t,e){t.setAttribute("x",String(e.x));t.setAttribute("y",String(e.y));t.setAttribute("xunits",e.xunits);t.setAttribute("yunits",e.yunits)}),scale:ks($y)}),Ry=Xs(fg,["color","scale"]),Cy=Xs(fg,{color:ks(gy),scale:ks($y)}),Py=Xs(fg,["color","width"]),Iy=Xs(fg,{color:ks(gy),width:ks(Xd)}),by={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},Ly=function(t,e){if(t)return bs(e[e.length-1].node.namespaceURI,by[t.getType()])},My=Bs("Point"),Fy=Bs("LineString"),Ay=Bs("LinearRing"),Ny=Bs("Polygon"),Dy=Xs(fg,{LineString:ks(Wy),Point:ks(Wy),Polygon:ks(qy),GeometryCollection:ks(Gy)});function Gy(t,e,r){var n,i,o={node:t},a=e.getType();a==Nt.GEOMETRY_COLLECTION?(n=e.getGeometries(),i=Ly):a==Nt.MULTI_POINT?(n=e.getPoints(),i=My):a==Nt.MULTI_LINE_STRING?(n=e.getLineStrings(),i=Fy):a==Nt.MULTI_POLYGON?(n=e.getPolygons(),i=Ny):K(!1,39);Ks(o,Dy,i,n,r)}var jy=Xs(fg,{LinearRing:ks(Wy)});function ky(t,e,r){Ks({node:t},jy,Ay,[e],r)}var Uy=Xs(fg,{ExtendedData:ks(function(t,e,r){for(var n={node:t},i=e.names,o=e.values,a=i.length,s=0;s<a;s++)Ks(n,yy,Ey,[{name:i[s],value:o[s]}],r)}),MultiGeometry:ks(Gy),LineString:ks(Wy),LinearRing:ks(Wy),Point:ks(Wy),Polygon:ks(qy),Style:ks(function(t,e,r){var n={node:t},i={},o=e.getFill(),a=e.getStroke(),s=e.getImage(),u=e.getText();s&&"function"==typeof s.getSrc&&(i.IconStyle=s);u&&(i.LabelStyle=u);a&&(i.LineStyle=a);o&&(i.PolyStyle=o);var l=r[r.length-1].node,h=tv[l.namespaceURI],c=zs(i,h);Ks(n,ev,Ys,c,r,h)}),address:ks(Wd),description:ks(Wd),name:ks(Wd),open:ks(zd),phoneNumber:ks(Wd),styleUrl:ks(Wd),visibility:ks(zd)}),By=Xs(fg,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),Yy=Bs("ExtendedData");function zy(t,e,r){var n={node:t};e.getId()&&t.setAttribute("id",e.getId());var i=e.getProperties(),o={address:1,description:1,name:1,open:1,phoneNumber:1,styleUrl:1,visibility:1};o[e.getGeometryName()]=1;var a=Object.keys(i||{}).sort().filter(function(t){return!o[t]}),s=e.getStyleFunction();if(s){var u=s(e,0);if(u){var l=Array.isArray(u)?u[0]:u;this.writeStyles_&&(i.Style=l);var h=l.getText();h&&(i.name=h.getText())}}var c=r[r.length-1].node,p=By[c.namespaceURI],f=zs(i,p);if(Ks(n,Uy,Ys,f,r,p),a.length>0){var d=zs(i,a);Ks(n,Uy,Yy,[{names:a,values:d}],r)}var _=r[0],g=e.getGeometry();g&&(g=_d(g,!0,_));Ks(n,Uy,Ly,[g],r)}var Xy=Xs(fg,["extrude","tessellate","altitudeMode","coordinates"]),Vy=Xs(fg,{extrude:ks(zd),tessellate:ks(zd),altitudeMode:ks(Wd),coordinates:ks(function(t,e,r){var n,i=r[r.length-1],o=i.layout,a=i.stride;o==At.XY||o==At.XYM?n=2:o==At.XYZ||o==At.XYZM?n=3:K(!1,34);var s=e.length,u="";if(s>0){u+=e[0];for(var l=1;l<n;++l)u+=","+e[l];for(var h=a;h<s;h+=a)for(u+=" "+e[h],l=1;l<n;++l)u+=","+e[h+l]}Wd(t,u)})});function Wy(t,e,r){var n=e.getFlatCoordinates(),i={node:t};i.layout=e.getLayout();i.stride=e.getStride();var o=e.getProperties();o.coordinates=n;var a=r[r.length-1].node,s=Xy[a.namespaceURI],u=zs(o,s);Ks(i,Vy,Ys,u,r,s)}var Zy=Xs(fg,{outerBoundaryIs:ks(ky),innerBoundaryIs:ks(ky)}),Ky=Bs("innerBoundaryIs"),Hy=Bs("outerBoundaryIs");function qy(t,e,r){var n=e.getLinearRings(),i=n.shift(),o={node:t};Ks(o,Zy,Ky,n,r);Ks(o,Zy,Hy,[i],r)}var Jy=Xs(fg,{color:ks(gy)}),Qy=Bs("color");function $y(t,e){Xd(t,Math.round(1e6*e)/1e6)}var tv=Xs(fg,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),ev=Xs(fg,{IconStyle:ks(function(t,e,r){var n={node:t},i={},o=e.getSrc(),a=e.getSize(),s=e.getImageSize(),u={href:o};if(a){u.w=a[0];u.h=a[1];var l=e.getAnchor(),h=e.getOrigin();if(h&&s&&0!==h[0]&&h[1]!==a[1]&&(u.x=h[0],u.y=s[1]-(h[1]+a[1])),l&&(l[0]!==a[0]/2||l[1]!==a[1]/2)){var c={x:l[0],xunits:Tu.PIXELS,y:a[1]-l[1],yunits:Tu.PIXELS};i.hotSpot=c}}i.Icon=u;var p=e.getScale();1!==p&&(i.scale=p);var f=e.getRotation();0!==f&&(i.heading=f);var d=r[r.length-1].node,_=xy[d.namespaceURI],g=zs(i,_);Ks(n,Oy,Ys,g,r,_)}),LabelStyle:ks(function(t,e,r){var n={node:t},i={},o=e.getFill();o&&(i.color=o.getColor());var a=e.getScale();a&&1!==a&&(i.scale=a);var s=r[r.length-1].node,u=Ry[s.namespaceURI],l=zs(i,u);Ks(n,Cy,Ys,l,r,u)}),LineStyle:ks(function(t,e,r){var n={node:t},i={color:e.getColor(),width:e.getWidth()},o=r[r.length-1].node,a=Py[o.namespaceURI],s=zs(i,a);Ks(n,Iy,Ys,s,r,a)}),PolyStyle:ks(function(t,e,r){Ks({node:t},Jy,Qy,[e.getColor()],r)})}),rv=Ig,nv=r(2),iv=r.n(nv),ov=[1,0,0,1,0,0],av=function(){function t(t,e,r,n,i){this.extent_;this.id_=i;this.type_=t;this.flatCoordinates_=e;this.flatInteriorPoints_=null;this.flatMidpoints_=null;this.ends_=r;this.properties_=n}return t.prototype.get=function(t){return this.properties_[t]},t.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===Nt.POINT?ht(this.flatCoordinates_):ct(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},t.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=St(this.getExtent());this.flatInteriorPoints_=Ir(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},t.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=Tf(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=br(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},t.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=Yp(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},t.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var t=this.flatCoordinates_,e=0,r=this.ends_,n=0,i=r.length;n<i;++n){var o=r[n],a=Yp(t,e,o,2,.5);x(this.flatMidpoints_,a);e=o}}return this.flatMidpoints_},t.prototype.getId=function(){return this.id_},t.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},t.prototype.getGeometry=function(){return this},t.prototype.getSimplifiedGeometry=function(){return this},t.prototype.simplifyTransformed=function(){return this},t.prototype.getProperties=function(){return this.properties_},t.prototype.getStride=function(){return 2},t.prototype.getStyleFunction=function(){},t.prototype.getType=function(){return this.type_},t.prototype.transform=function(t){var r=(t=we(t)).getExtent(),n=t.getWorldExtent(),i=Ot(n)/Ot(r);He(ov,n[0],n[3],i,-i,0,0,0);Dt(this.flatCoordinates_,0,this.flatCoordinates_.length,2,ov,this.flatCoordinates_)},t}();av.prototype.getEnds=function(){return this.ends_};av.prototype.getEndss=av.prototype.getEnds;av.prototype.getFlatCoordinates=av.prototype.getOrientedFlatCoordinates;var sv=av,uv=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function lv(t,e,r){if(3===t){var n={keys:[],values:[],features:[]},i=r.readVarint()+r.pos;r.readFields(hv,n,i);n.length=n.features.length;n.length&&(e[n.name]=n)}}function hv(t,e,r){if(15===t)e.version=r.readVarint();else if(1===t)e.name=r.readString();else if(5===t)e.extent=r.readVarint();else if(2===t)e.features.push(r.pos);else if(3===t)e.keys.push(r.readString());else if(4===t){for(var n=null,i=r.readVarint()+r.pos;r.pos<i;)n=1==(t=r.readVarint()>>3)?r.readString():2===t?r.readFloat():3===t?r.readDouble():4===t?r.readVarint64():5===t?r.readVarint():6===t?r.readSVarint():7===t?r.readBoolean():null;e.values.push(n)}}function cv(t,e,r){if(1==t)e.id=r.readVarint();else if(2==t)for(var n=r.readVarint()+r.pos;r.pos<n;){var i=e.layer.keys[r.readVarint()],o=e.layer.values[r.readVarint()];e.properties[i]=o}else 3==t?e.type=r.readVarint():4==t&&(e.geometry=r.pos)}function pv(t,e,r){t.pos=e.features[r];var n=t.readVarint()+t.pos,i={layer:e,type:0,properties:{}};return t.readFields(cv,i,n),i}var fv=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.dataProjection=new ee({code:"",units:te.TILE_PIXELS}),r.featureClass_=n.featureClass?n.featureClass:sv,r.geometryName_=n.geometryName,r.layerName_=n.layerName?n.layerName:"layer",r.layers_=n.layers?n.layers:null,r.idProperty_=n.idProperty,r}return uv(e,t),e.prototype.readRawGeometry_=function(t,e,r,n){t.pos=e.geometry;for(var i=t.readVarint()+t.pos,o=1,a=0,s=0,u=0,l=0,h=0;t.pos<i;){if(!a){var c=t.readVarint();o=7&c;a=c>>3}a--;1===o||2===o?(s+=t.readSVarint(),u+=t.readSVarint(),1===o&&l>h&&(n.push(l),h=l),r.push(s,u),l+=2):7===o?l>h&&(r.push(r[h],r[h+1]),l+=2):K(!1,59)}l>h&&(n.push(l),h=l)},e.prototype.createFeature_=function(t,e,r){var n,i=e.type;if(0===i)return null;var o,a=e.properties;this.idProperty_?(o=a[this.idProperty_],delete a[this.idProperty_]):o=e.id;a[this.layerName_]=e.layer.name;var s=[],u=[];this.readRawGeometry_(t,e,s,u);var l=function(t,e){var r;return 1===t?r=1===e?Nt.POINT:Nt.MULTI_POINT:2===t?r=1===e?Nt.LINE_STRING:Nt.MULTI_LINE_STRING:3===t&&(r=Nt.POLYGON),r}(i,u.length);if(this.featureClass_===sv)(n=new this.featureClass_(l,s,u,a,o)).transform(r.dataProjection,r.featureProjection);else{var h=void 0;if(l==Nt.POLYGON){for(var c=[],p=0,f=0,d=0,_=u.length;d<_;++d){var g=u[d];Nr(s,p,g,2)||(c.push(u.slice(f,d)),f=d);p=g}h=c.length>1?new wf(s,At.XY,c):new Br(s,At.XY,u)}else h=l===Nt.POINT?new Or(s,At.XY):l===Nt.LINE_STRING?new Vp(s,At.XY):l===Nt.POLYGON?new Br(s,At.XY,u):l===Nt.MULTI_POINT?new Ef(s,At.XY):l===Nt.MULTI_LINE_STRING?new vf(s,At.XY,u):null;n=new this.featureClass_;this.geometryName_&&n.setGeometryName(this.geometryName_);var y=_d(h,!1,r);n.setGeometry(y);n.setId(o);n.setProperties(a,!0)}return n},e.prototype.getType=function(){return rs.ARRAY_BUFFER},e.prototype.readFeatures=function(t,e){var r=this.layers_,n=this.adaptOptions(e),i=we(n.dataProjection);i.setWorldExtent(n.extent);n.dataProjection=i;var o=new iv.a(t),a=o.readFields(lv,{}),s=[];for(var u in a)if(!r||-1!=r.indexOf(u)){var l=a[u],h=l?[0,0,l.extent,l.extent]:null;i.setExtent(h);for(var c=0,p=l.length;c<p;++c){var f=pv(o,l,c);s.push(this.createFeature_(o,f,n))}}return s},e.prototype.readProjection=function(){return this.dataProjection},e.prototype.setLayers=function(t){this.layers_=t},e}(dd),dv=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),_v=[null],gv=Xs(_v,{nd:function(t,e){e[e.length-1].ndrefs.push(t.getAttribute("ref"))},tag:Ev}),yv=Xs(_v,{node:function(t,e){var r=e[0],n=e[e.length-1],i=t.getAttribute("id"),o=[parseFloat(t.getAttribute("lon")),parseFloat(t.getAttribute("lat"))];n.nodes[i]=o;var a=Ws({tags:{}},mv,t,e);if(!_(a.tags)){var s=new Or(o);_d(s,!1,r);var u=new q(s);u.setId(i);u.setProperties(a.tags,!0);n.features.push(u)}},way:function(t,e){var r=Ws({id:t.getAttribute("id"),ndrefs:[],tags:{}},gv,t,e);e[e.length-1].ways.push(r)}}),vv=function(t){function e(){var e=t.call(this)||this;return e.dataProjection=we("EPSG:4326"),e}return dv(e,t),e.prototype.readFeaturesFromNode=function(t,e){var r=this.getReadOptions(t,e);if("osm"==t.localName){for(var n=Ws({nodes:{},ways:[],features:[]},yv,t,[r]),i=0;i<n.ways.length;i++){for(var o=n.ways[i],a=[],s=0,u=o.ndrefs.length;s<u;s++)x(a,n.nodes[o.ndrefs[s]]);var l=void 0;_d(l=o.ndrefs[0]==o.ndrefs[o.ndrefs.length-1]?new Br(a,At.XY,[a.length]):new Vp(a,At.XY),!1,r);var h=new q(l);h.setId(o.id);h.setProperties(o.tags,!0);n.features.push(h)}if(n.features)return n.features}return[]},e}(Id),mv=Xs(_v,{tag:Ev});function Ev(t,e){e[e.length-1].tags[t.getAttribute("k")]=t.getAttribute("v")}var Tv=vv;function Sv(t,e,r,n,i,o){var a,s;void 0!==i?(a=i,s=void 0!==o?o:0):(a=[],s=0);for(var u=e;u<r;){var l=t[u++];a[s++]=t[u++];a[s++]=l;for(var h=2;h<n;++h)a[s++]=t[u++]}return a.length=s,a}var wv=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function xv(t,e,r){for(var i=r||1e5,o=new Array(e),n=0;n<e;++n)o[n]=0;for(var a=0,s=t.length;a<s;)for(n=0;n<e;++n,++a){var u=t[a],l=u-o[n];o[n]=u;t[a]=l}return Rv(t,i)}function Ov(t,e,r){for(var i=r||1e5,o=new Array(e),n=0;n<e;++n)o[n]=0;for(var a=Cv(t,i),s=0,u=a.length;s<u;)for(n=0;n<e;++n,++s)o[n]+=a[s],a[s]=o[n];return a}function Rv(t,e){for(var r=e||1e5,n=0,i=t.length;n<i;++n)t[n]=Math.round(t[n]*r);return function(t){for(var e=0,r=t.length;e<r;++e){var n=t[e];t[e]=n<0?~(n<<1):n<<1}return function(t){for(var e="",r=0,n=t.length;r<n;++r)e+=Pv(t[r]);return e}(t)}(t)}function Cv(t,e){for(var r=e||1e5,n=function(t){for(var e=function(t){for(var e=[],r=0,n=0,i=0,o=t.length;i<o;++i){var a=t.charCodeAt(i)-63;r|=(31&a)<<n;a<32?(e.push(r),r=0,n=0):n+=5}return e}(t),r=0,n=e.length;r<n;++r){var i=e[r];e[r]=1&i?~(i>>1):i>>1}return e}(t),i=0,o=n.length;i<o;++i)n[i]/=r;return n}function Pv(t){for(var e,r="";t>=32;)e=63+(32|31&t),r+=String.fromCharCode(e),t>>=5;return e=t+63,r+String.fromCharCode(e)}var Iv=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.dataProjection=we("EPSG:4326"),r.factor_=n.factor?n.factor:1e5,r.geometryLayout_=n.geometryLayout?n.geometryLayout:At.XY,r}return wv(e,t),e.prototype.readFeatureFromText=function(t,e){var r=this.readGeometryFromText(t,e);return new q(r)},e.prototype.readFeaturesFromText=function(t,e){return[this.readFeatureFromText(t,e)]},e.prototype.readGeometryFromText=function(t,e){var r=rr(this.geometryLayout_),n=Ov(t,r,this.factor_);Sv(n,0,n.length,r,n);var i=dr(n,0,n.length,r);return _d(new Vp(i,this.geometryLayout_),!1,this.adaptOptions(e))},e.prototype.writeFeatureText=function(t,e){var r=t.getGeometry();return r?this.writeGeometryText(r,e):(K(!1,40),"")},e.prototype.writeFeaturesText=function(t,e){return this.writeFeatureText(t[0],e)},e.prototype.writeGeometryText=function(t,e){var r=(t=_d(t,!0,this.adaptOptions(e))).getFlatCoordinates(),n=t.getStride();return Sv(r,0,r.length,n,r),xv(r,n,this.factor_)},e}(ng),bv=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Lv=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.layerName_=n.layerName,r.layers_=n.layers?n.layers:null,r.dataProjection=we(n.dataProjection?n.dataProjection:"EPSG:4326"),r}return bv(e,t),e.prototype.readFeaturesFromObject=function(t,e){if("Topology"==t.type){var r=t,n=void 0,i=null,o=null;r.transform&&(i=(n=r.transform).scale,o=n.translate);var a=r.arcs;n&&function(t,e,r){for(var n=0,i=t.length;n<i;++n)Dv(t[n],e,r)}(a,i,o);var s=[],u=r.objects,l=this.layerName_,h=void 0;for(var c in u)this.layers_&&-1==this.layers_.indexOf(c)||("GeometryCollection"===u[c].type?(h=u[c],s.push.apply(s,Av(h,a,i,o,l,c,e))):(h=u[c],s.push(Nv(h,a,i,o,l,c,e))));return s}return[]},e.prototype.readProjectionFromObject=function(){return this.dataProjection},e}(md),Mv={Point:function(t,e,r){var n=t.coordinates;return e&&r&&Gv(n,e,r),new Or(n)},LineString:function(t,e){var r=Fv(t.arcs,e);return new Vp(r)},Polygon:function(t,e){for(var r=[],n=0,i=t.arcs.length;n<i;++n)r[n]=Fv(t.arcs[n],e);return new Br(r)},MultiPoint:function(t,e,r){var n=t.coordinates;if(e&&r)for(var i=0,o=n.length;i<o;++i)Gv(n[i],e,r);return new Ef(n)},MultiLineString:function(t,e){for(var r=[],n=0,i=t.arcs.length;n<i;++n)r[n]=Fv(t.arcs[n],e);return new vf(r)},MultiPolygon:function(t,e){for(var r=[],n=0,i=t.arcs.length;n<i;++n){for(var o=t.arcs[n],a=[],s=0,u=o.length;s<u;++s)a[s]=Fv(o[s],e);r[n]=a}return new wf(r)}};function Fv(t,e){for(var r,n,i=[],o=0,a=t.length;o<a;++o)r=t[o],o>0&&i.pop(),n=r>=0?e[r]:e[~r].slice().reverse(),i.push.apply(i,n);for(var s=0,u=i.length;s<u;++s)i[s]=i[s].slice();return i}function Av(t,e,r,n,i,o,a){for(var s=t.geometries,u=[],l=0,h=s.length;l<h;++l)u[l]=Nv(s[l],e,r,n,i,o,a);return u}function Nv(t,e,r,n,i,o,a){var s,u=t.type,l=Mv[u];s="Point"===u||"MultiPoint"===u?l(t,r,n):l(t,e);var h=new q;h.setGeometry(_d(s,!1,a));void 0!==t.id&&h.setId(t.id);var c=t.properties;return i&&(c||(c={}),c[i]=o),c&&h.setProperties(c,!0),h}function Dv(t,e,r){for(var n=0,i=0,o=0,a=t.length;o<a;++o){var s=t[o];n+=s[0];i+=s[1];s[0]=n;s[1]=i;Gv(s,e,r)}}function Gv(t,e,r){t[0]=t[0]*e[0]+r[0];t[1]=t[1]*e[1]+r[1]}var jv=Lv,kv=function(){function t(t){this.tagName_=t}return t.prototype.getTagName=function(){return this.tagName_},t}(),Uv=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Bv=function(t){function e(e,r){var n=t.call(this,e)||this;return n.conditions=r,K(n.conditions.length>=2,57),n}return Uv(e,t),e}(kv),Yv=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),zv=function(t){function e(){return t.call(this,"And",Array.prototype.slice.call(arguments))||this}return Yv(e,t),e}(Bv),Xv=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Vv=function(t){function e(e,r,n){var i=t.call(this,"BBOX")||this;if(i.geometryName=e,i.extent=r,4!==r.length)throw new Error("Expected an extent with four values ([minX, minY, maxX, maxY])");return i.srsName=n,i}return Xv(e,t),e}(kv),Wv=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Zv=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.geometryName=r||"the_geom",o.geometry=n,o.srsName=i,o}return Wv(e,t),e}(kv),Kv=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Hv=function(t){function e(e,r,n){return t.call(this,"Contains",e,r,n)||this}return Kv(e,t),e}(Zv),qv=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Jv=function(t){function e(e,r){var n=t.call(this,e)||this;return n.propertyName=r,n}return qv(e,t),e}(kv),Qv=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$v=function(t){function e(e,r,n){var i=t.call(this,"During",e)||this;return i.begin=r,i.end=n,i}return Qv(e,t),e}(Jv),tm=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),em=function(t){function e(e,r,n,i){var o=t.call(this,e,r)||this;return o.expression=n,o.matchCase=i,o}return tm(e,t),e}(Jv),rm=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),nm=function(t){function e(e,r,n){return t.call(this,"PropertyIsEqualTo",e,r,n)||this}return rm(e,t),e}(em),im=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),om=function(t){function e(e,r){return t.call(this,"PropertyIsGreaterThan",e,r)||this}return im(e,t),e}(em),am=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),sm=function(t){function e(e,r){return t.call(this,"PropertyIsGreaterThanOrEqualTo",e,r)||this}return am(e,t),e}(em),um=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),lm=function(t){function e(e,r,n){return t.call(this,"Intersects",e,r,n)||this}return um(e,t),e}(Zv),hm=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),cm=function(t){function e(e,r,n){var i=t.call(this,"PropertyIsBetween",e)||this;return i.lowerBoundary=r,i.upperBoundary=n,i}return hm(e,t),e}(Jv),pm=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),fm=function(t){function e(e,r,n,i,o,a){var s=t.call(this,"PropertyIsLike",e)||this;return s.pattern=r,s.wildCard=void 0!==n?n:"*",s.singleChar=void 0!==i?i:".",s.escapeChar=void 0!==o?o:"!",s.matchCase=a,s}return pm(e,t),e}(Jv),dm=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),_m=function(t){function e(e){return t.call(this,"PropertyIsNull",e)||this}return dm(e,t),e}(Jv),gm=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ym=function(t){function e(e,r){return t.call(this,"PropertyIsLessThan",e,r)||this}return gm(e,t),e}(em),vm=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),mm=function(t){function e(e,r){return t.call(this,"PropertyIsLessThanOrEqualTo",e,r)||this}return vm(e,t),e}(em),Em=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Tm=function(t){function e(e){var r=t.call(this,"Not")||this;return r.condition=e,r}return Em(e,t),e}(kv),Sm=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wm=function(t){function e(e,r,n){return t.call(this,"PropertyIsNotEqualTo",e,r,n)||this}return Sm(e,t),e}(em),xm=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Om=function(t){function e(){return t.call(this,"Or",Array.prototype.slice.call(arguments))||this}return xm(e,t),e}(Bv),Rm=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Cm=function(t){function e(e,r,n){return t.call(this,"Within",e,r,n)||this}return Rm(e,t),e}(Zv);function Pm(){var e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(zv,e))}function Im(t,e,r){return new Vv(t,e,r)}var bm=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Lm={"http://www.opengis.net/gml":{boundedBy:js(Ad.prototype.readGeometryElement,"bounds")}},Mm={"http://www.opengis.net/wfs":{totalInserted:js(Ud),totalUpdated:js(Ud),totalDeleted:js(Ud)}},Fm={"http://www.opengis.net/wfs":{TransactionSummary:js(function(t,e){return Ws({},Mm,t,e)},"transactionSummary"),InsertResults:js(function(t,e){return Ws([],Vm,t,e)},"insertIds")}},Am={"http://www.opengis.net/wfs":{PropertyName:ks(Wd)}},Nm={"http://www.opengis.net/wfs":{Insert:ks(function(t,e,r){var n=r[r.length-1],i=n.featureType,o=n.featureNS,a=n.gmlVersion,s=bs(o,i);t.appendChild(s);2===a?i_.prototype.writeFeatureElement(s,e,r):Jd.prototype.writeFeatureElement(s,e,r)}),Update:ks(function(t,e,r){var n=r[r.length-1];K(void 0!==e.getId(),27);var i=n.featureType,o=n.featurePrefix,a=n.featureNS,s=Zm(o,i),u=e.getGeometryName();t.setAttribute("typeName",s);t.setAttributeNS(Gm,"xmlns:"+o,a);var l=e.getId();if(void 0!==l){for(var h=e.getKeys(),c=[],p=0,f=h.length;p<f;p++){var d=e.get(h[p]);if(void 0!==d){var _=h[p];d&&"function"==typeof d.getSimplifiedGeometry&&(_=u);c.push({name:_,value:d})}}Ks({gmlVersion:n.gmlVersion,node:t,hasZ:n.hasZ,srsName:n.srsName},Nm,Bs("Property"),c,r);Wm(t,l,r)}}),Delete:ks(function(t,e,r){var n=r[r.length-1];K(void 0!==e.getId(),26);var i=n.featureType,o=n.featurePrefix,a=n.featureNS,s=Zm(o,i);t.setAttribute("typeName",s);t.setAttributeNS(Gm,"xmlns:"+o,a);var u=e.getId();void 0!==u&&Wm(t,u,r)}),Property:ks(function(t,e,r){var n=bs(km,"Name"),i=r[r.length-1].gmlVersion;if(t.appendChild(n),Wd(n,e.name),void 0!==e.value&&null!==e.value){var o=bs(km,"Value");t.appendChild(o);e.value&&"function"==typeof e.value.getSimplifiedGeometry?2===i?i_.prototype.writeGeometryElement(o,e.value,r):Jd.prototype.writeGeometryElement(o,e.value,r):Wd(o,e.value)}}),Native:ks(function(t,e){e.vendorId&&t.setAttribute("vendorId",e.vendorId);void 0!==e.safeToIgnore&&t.setAttribute("safeToIgnore",String(e.safeToIgnore));void 0!==e.value&&Wd(t,e.value)})}},Dm="feature",Gm="http://www.w3.org/2000/xmlns/",jm="http://www.opengis.net/ogc",km="http://www.opengis.net/wfs",Um="http://www.opengis.net/fes",Bm={"1.1.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd","1.0.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"},Ym="1.1.0",zm=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.featureType_=n.featureType,r.featureNS_=n.featureNS,r.gmlFormat_=n.gmlFormat?n.gmlFormat:new Jd,r.schemaLocation_=n.schemaLocation?n.schemaLocation:Bm[Ym],r}return bm(e,t),e.prototype.getFeatureType=function(){return this.featureType_},e.prototype.setFeatureType=function(t){this.featureType_=t},e.prototype.readFeaturesFromNode=function(t,e){var r={node:t};p(r,{featureType:this.featureType_,featureNS:this.featureNS_});p(r,this.getReadOptions(t,e||{}));var n=[r];this.gmlFormat_.FEATURE_COLLECTION_PARSERS[Ld].featureMember=Ns(Ad.prototype.readFeaturesInternal);var i=Ws([],this.gmlFormat_.FEATURE_COLLECTION_PARSERS,t,n,this.gmlFormat_);return i||(i=[]),i},e.prototype.readTransactionResponse=function(t){if(t){if("string"==typeof t){var e=Fs(t);return this.readTransactionResponseFromDocument(e)}return Ms(t)?this.readTransactionResponseFromDocument(t):this.readTransactionResponseFromNode(t)}},e.prototype.readFeatureCollectionMetadata=function(t){if(t){if("string"==typeof t){var e=Fs(t);return this.readFeatureCollectionMetadataFromDocument(e)}return Ms(t)?this.readFeatureCollectionMetadataFromDocument(t):this.readFeatureCollectionMetadataFromNode(t)}},e.prototype.readFeatureCollectionMetadataFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFeatureCollectionMetadataFromNode(e)},e.prototype.readFeatureCollectionMetadataFromNode=function(t){var e={},r=Bd(t.getAttribute("numberOfFeatures"));return e.numberOfFeatures=r,Ws(e,Lm,t,[],this.gmlFormat_)},e.prototype.readTransactionResponseFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readTransactionResponseFromNode(e)},e.prototype.readTransactionResponseFromNode=function(t){return Ws({},Fm,t,[])},e.prototype.writeGetFeature=function(t){var e,r=bs(km,"GetFeature");if(r.setAttribute("service","WFS"),r.setAttribute("version","1.1.0"),t&&(t.handle&&r.setAttribute("handle",t.handle),t.outputFormat&&r.setAttribute("outputFormat",t.outputFormat),void 0!==t.maxFeatures&&r.setAttribute("maxFeatures",String(t.maxFeatures)),t.resultType&&r.setAttribute("resultType",t.resultType),void 0!==t.startIndex&&r.setAttribute("startIndex",String(t.startIndex)),void 0!==t.count&&r.setAttribute("count",String(t.count)),void 0!==t.viewParams&&r.setAttribute("viewParams",t.viewParams),e=t.filter,t.bbox)){K(t.geometryName,12);var n=Im(t.geometryName,t.bbox,t.srsName);e=e?Pm(e,n):n}r.setAttributeNS(Is,"xsi:schemaLocation",this.schemaLocation_);var i={node:r};return p(i,{srsName:t.srsName,featureNS:t.featureNS?t.featureNS:this.featureNS_,featurePrefix:t.featurePrefix,geometryName:t.geometryName,filter:e,propertyNames:t.propertyNames?t.propertyNames:[]}),K(Array.isArray(t.featureTypes),11),function(t,e,r){var n=r[r.length-1],i=p({},n);i.node=t;Ks(i,Km,Bs("Query"),e,r)}(r,t.featureTypes,[i]),r},e.prototype.writeTransaction=function(t,e,r,n){var i,o,a=[],s=bs(km,"Transaction"),u=n.version?n.version:Ym,l="1.0.0"===u?2:3;s.setAttribute("service","WFS");s.setAttribute("version",u);n&&(i=n.gmlOptions?n.gmlOptions:{},n.handle&&s.setAttribute("handle",n.handle));var h=Bm[u];s.setAttributeNS(Is,"xsi:schemaLocation",h);var c=n.featurePrefix?n.featurePrefix:Dm;return t&&(o=p({node:s},{featureNS:n.featureNS,featureType:n.featureType,featurePrefix:c,gmlVersion:l,hasZ:n.hasZ,srsName:n.srsName}),p(o,i),Ks(o,Nm,Bs("Insert"),t,a)),e&&(o=p({node:s},{featureNS:n.featureNS,featureType:n.featureType,featurePrefix:c,gmlVersion:l,hasZ:n.hasZ,srsName:n.srsName}),p(o,i),Ks(o,Nm,Bs("Update"),e,a)),r&&Ks({node:s,featureNS:n.featureNS,featureType:n.featureType,featurePrefix:c,gmlVersion:l,srsName:n.srsName},Nm,Bs("Delete"),r,a),n.nativeElements&&Ks({node:s,featureNS:n.featureNS,featureType:n.featureType,featurePrefix:c,gmlVersion:l,srsName:n.srsName},Nm,Bs("Native"),n.nativeElements,a),s},e.prototype.readProjectionFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readProjectionFromNode(e);return null},e.prototype.readProjectionFromNode=function(t){if(t.firstElementChild&&t.firstElementChild.firstElementChild)for(var e=(t=t.firstElementChild.firstElementChild).firstElementChild;e;e=e.nextElementSibling)if(0!==e.childNodes.length&&(1!==e.childNodes.length||3!==e.firstChild.nodeType)){var r=[{}];return this.gmlFormat_.readGeometryElement(e,r),we(r.pop().srsName)}return null},e}(Id),Xm={"http://www.opengis.net/ogc":{FeatureId:Ns(function(t){return t.getAttribute("fid")})}},Vm={"http://www.opengis.net/wfs":{Feature:function(t,e){Vs(Xm,t,e)}}};function Wm(t,e){var n=bs(jm,"Filter"),i=bs(jm,"FeatureId");n.appendChild(i);i.setAttribute("fid",e);t.appendChild(n)}function Zm(t,e){var r=(t=t||Dm)+":";return 0===e.indexOf(r)?e:r+e}var Km={"http://www.opengis.net/wfs":{Query:ks(function(t,e,r){var n,i=r[r.length-1],o=i.featurePrefix,a=i.featureNS,s=i.propertyNames,u=i.srsName;n=o?Zm(o,e):e;t.setAttribute("typeName",n);u&&t.setAttribute("srsName",u);a&&t.setAttributeNS(Gm,"xmlns:"+o,a);var l=p({},i);l.node=t;Ks(l,Am,Bs("PropertyName"),s,r);var h=i.filter;if(h){var c=bs(jm,"Filter");t.appendChild(c);Hm(c,h,r)}})},"http://www.opengis.net/ogc":{During:ks(function(t,e){var n=bs(Um,"ValueReference");Wd(n,e.propertyName);t.appendChild(n);var i=bs(Ld,"TimePeriod");t.appendChild(i);var o=bs(Ld,"begin");i.appendChild(o);eE(o,e.begin);var a=bs(Ld,"end");i.appendChild(a);eE(a,e.end)}),And:ks(qm),Or:ks(qm),Not:ks(function(t,e,r){var n={node:t},i=e.condition;Ks(n,Km,Bs(i.getTagName()),[i],r)}),BBOX:ks(function(t,e,r){r[r.length-1].srsName=e.srsName;$m(t,e.geometryName);Jd.prototype.writeGeometryElement(t,e.extent,r)}),Contains:ks(function(t,e,r){r[r.length-1].srsName=e.srsName;$m(t,e.geometryName);Jd.prototype.writeGeometryElement(t,e.geometry,r)}),Intersects:ks(function(t,e,r){r[r.length-1].srsName=e.srsName;$m(t,e.geometryName);Jd.prototype.writeGeometryElement(t,e.geometry,r)}),Within:ks(function(t,e,r){r[r.length-1].srsName=e.srsName;$m(t,e.geometryName);Jd.prototype.writeGeometryElement(t,e.geometry,r)}),PropertyIsEqualTo:ks(Jm),PropertyIsNotEqualTo:ks(Jm),PropertyIsLessThan:ks(Jm),PropertyIsLessThanOrEqualTo:ks(Jm),PropertyIsGreaterThan:ks(Jm),PropertyIsGreaterThanOrEqualTo:ks(Jm),PropertyIsNull:ks(function(t,e){$m(t,e.propertyName)}),PropertyIsBetween:ks(function(t,e){$m(t,e.propertyName);var n=bs(jm,"LowerBoundary");t.appendChild(n);tE(n,""+e.lowerBoundary);var i=bs(jm,"UpperBoundary");t.appendChild(i);tE(i,""+e.upperBoundary)}),PropertyIsLike:ks(function(t,e){t.setAttribute("wildCard",e.wildCard);t.setAttribute("singleChar",e.singleChar);t.setAttribute("escapeChar",e.escapeChar);void 0!==e.matchCase&&t.setAttribute("matchCase",e.matchCase.toString());$m(t,e.propertyName);tE(t,""+e.pattern)})}};function Hm(t,e,r){Ks({node:t},Km,Bs(e.getTagName()),[e],r)}function qm(t,e,r){for(var n={node:t},i=e.conditions,o=0,a=i.length;o<a;++o){var s=i[o];Ks(n,Km,Bs(s.getTagName()),[s],r)}}function Jm(t,e){void 0!==e.matchCase&&t.setAttribute("matchCase",e.matchCase.toString());$m(t,e.propertyName);tE(t,""+e.expression)}function Qm(t,e,r){var n=bs(jm,t);Wd(n,r);e.appendChild(n)}function $m(t,e){Qm("PropertyName",t,e)}function tE(t,e){Qm("Literal",t,e)}function eE(t,e){var r=bs(Ld,"TimeInstant");t.appendChild(r);var n=bs(Ld,"timePosition");r.appendChild(n);Wd(n,e)}var rE=zm,nE=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),iE={POINT:Or,LINESTRING:Vp,POLYGON:Br,MULTIPOINT:Ef,MULTILINESTRING:vf,MULTIPOLYGON:wf},oE="EMPTY",aE="Z",sE="M",uE=1,lE=2,hE=3,cE=4,pE=5,fE=6,dE={};for(var _E in Nt)dE[_E]=Nt[_E].toUpperCase();var gE=function(){function t(t){this.wkt=t;this.index_=-1}return t.prototype.isAlpha_=function(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"},t.prototype.isNumeric_=function(t,e){return t>="0"&&t<="9"||"."==t&&!(void 0!==e&&e)},t.prototype.isWhiteSpace_=function(t){return" "==t||"\t"==t||"\r"==t||"\n"==t},t.prototype.nextChar_=function(){return this.wkt.charAt(++this.index_)},t.prototype.nextToken=function(){var t,e=this.nextChar_(),r=this.index_,n=e;if("("==e)t=lE;else if(","==e)t=pE;else if(")"==e)t=hE;else if(this.isNumeric_(e)||"-"==e)t=cE,n=this.readNumber_();else if(this.isAlpha_(e))t=uE,n=this.readText_();else{if(this.isWhiteSpace_(e))return this.nextToken();if(""!==e)throw new Error("Unexpected character: "+e);t=fE}return{position:r,value:n,type:t}},t.prototype.readNumber_=function(){var t,e=this.index_,r=!1,n=!1;do"."==t?r=!0:"e"!=t&&"E"!=t||(n=!0),t=this.nextChar_();while(this.isNumeric_(t,r)||!n&&("e"==t||"E"==t)||n&&("-"==t||"+"==t));return parseFloat(this.wkt.substring(e,this.index_--))},t.prototype.readText_=function(){var t,e=this.index_;do t=this.nextChar_();while(this.isAlpha_(t));return this.wkt.substring(e,this.index_--).toUpperCase()},t}(),yE=function(){function t(t){this.lexer_=t;this.token_;this.layout_=At.XY}return t.prototype.consume_=function(){this.token_=this.lexer_.nextToken()},t.prototype.isTokenType=function(t){return this.token_.type==t},t.prototype.match=function(t){var e=this.isTokenType(t);return e&&this.consume_(),e},t.prototype.parse=function(){return this.consume_(),this.parseGeometry_()},t.prototype.parseGeometryLayout_=function(){var t=At.XY,e=this.token_;if(this.isTokenType(uE)){var r=e.value;r===aE?t=At.XYZ:r===sE?t=At.XYM:"ZM"===r&&(t=At.XYZM);t!==At.XY&&this.consume_()}return t},t.prototype.parseGeometryCollectionText_=function(){if(this.match(lE)){var t=[];do t.push(this.parseGeometry_());while(this.match(pE));if(this.match(hE))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_());},t.prototype.parsePointText_=function(){if(this.match(lE)){var t=this.parsePoint_();if(this.match(hE))return t}else if(this.isEmptyGeometry_())return null;throw new Error(this.formatErrorMessage_());},t.prototype.parseLineStringText_=function(){if(this.match(lE)){var t=this.parsePointList_();if(this.match(hE))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_());},t.prototype.parsePolygonText_=function(){if(this.match(lE)){var t=this.parseLineStringTextList_();if(this.match(hE))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_());},t.prototype.parseMultiPointText_=function(){if(this.match(lE)){var t=void 0;if(t=this.token_.type==lE?this.parsePointTextList_():this.parsePointList_(),this.match(hE))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_());},t.prototype.parseMultiLineStringText_=function(){if(this.match(lE)){var t=this.parseLineStringTextList_();if(this.match(hE))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_());},t.prototype.parseMultiPolygonText_=function(){if(this.match(lE)){var t=this.parsePolygonTextList_();if(this.match(hE))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_());},t.prototype.parsePoint_=function(){for(var t=[],e=this.layout_.length,r=0;r<e;++r){var n=this.token_;if(!this.match(cE))break;t.push(n.value)}if(t.length==e)return t;throw new Error(this.formatErrorMessage_());},t.prototype.parsePointList_=function(){for(var t=[this.parsePoint_()];this.match(pE);)t.push(this.parsePoint_());return t},t.prototype.parsePointTextList_=function(){for(var t=[this.parsePointText_()];this.match(pE);)t.push(this.parsePointText_());return t},t.prototype.parseLineStringTextList_=function(){for(var t=[this.parseLineStringText_()];this.match(pE);)t.push(this.parseLineStringText_());return t},t.prototype.parsePolygonTextList_=function(){for(var t=[this.parsePolygonText_()];this.match(pE);)t.push(this.parsePolygonText_());return t},t.prototype.isEmptyGeometry_=function(){var t=this.isTokenType(uE)&&this.token_.value==oE;return t&&this.consume_(),t},t.prototype.formatErrorMessage_=function(){return"Unexpected `"+this.token_.value+"` at position "+this.token_.position+" in `"+this.lexer_.wkt+"`"},t.prototype.parseGeometry_=function(){var t=this.token_;if(this.match(uE)){var e=t.value;if(this.layout_=this.parseGeometryLayout_(),"GEOMETRYCOLLECTION"==e){var r=this.parseGeometryCollectionText_();return new fd(r)}var n=iE[e];if(!n)throw new Error("Invalid geometry type: "+e);var i=void 0;switch(e){case"POINT":i=this.parsePointText_();break;case"LINESTRING":i=this.parseLineStringText_();break;case"POLYGON":i=this.parsePolygonText_();break;case"MULTIPOINT":i=this.parseMultiPointText_();break;case"MULTILINESTRING":i=this.parseMultiLineStringText_();break;case"MULTIPOLYGON":i=this.parseMultiPolygonText_();break;default:throw new Error("Invalid geometry type: "+e);}return i||(i=n===iE.POINT?[NaN,NaN]:[]),new n(i,this.layout_)}throw new Error(this.formatErrorMessage_());},t}(),vE=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.splitCollection_=void 0!==n.splitCollection&&n.splitCollection,r}return nE(e,t),e.prototype.parse_=function(t){var e=new gE(t);return new yE(e).parse()},e.prototype.readFeatureFromText=function(t,e){var r=this.readGeometryFromText(t,e);if(r){var n=new q;return n.setGeometry(r),n}return null},e.prototype.readFeaturesFromText=function(t,e){for(var r=[],n=this.readGeometryFromText(t,e),i=[],o=0,a=(r=this.splitCollection_&&n.getType()==Nt.GEOMETRY_COLLECTION?n.getGeometriesArray():[n]).length;o<a;++o){var s=new q;s.setGeometry(r[o]);i.push(s)}return i},e.prototype.readGeometryFromText=function(t,e){var r=this.parse_(t);return r?_d(r,!1,e):null},e.prototype.writeFeatureText=function(t,e){var r=t.getGeometry();return r?this.writeGeometryText(r,e):""},e.prototype.writeFeaturesText=function(t,e){if(1==t.length)return this.writeFeatureText(t[0],e);for(var r=[],n=0,i=t.length;n<i;++n)r.push(t[n].getGeometry());var o=new fd(r);return this.writeGeometryText(o,e)},e.prototype.writeGeometryText=function(t,e){return wE(_d(t,!0,e))},e}(ng);function mE(t){var e=t.getCoordinates();return 0===e.length?"":e.join(" ")}function EE(t){for(var e=t.getCoordinates(),r=[],n=0,i=e.length;n<i;++n)r.push(e[n].join(" "));return r.join(",")}function TE(t){for(var e=[],r=t.getLinearRings(),n=0,i=r.length;n<i;++n)e.push("("+EE(r[n])+")");return e.join(",")}var SE={Point:mE,LineString:EE,Polygon:TE,MultiPoint:function(t){for(var e=[],r=t.getPoints(),n=0,i=r.length;n<i;++n)e.push("("+mE(r[n])+")");return e.join(",")},MultiLineString:function(t){for(var e=[],r=t.getLineStrings(),n=0,i=r.length;n<i;++n)e.push("("+EE(r[n])+")");return e.join(",")},MultiPolygon:function(t){for(var e=[],r=t.getPolygons(),n=0,i=r.length;n<i;++n)e.push("("+TE(r[n])+")");return e.join(",")},GeometryCollection:function(t){for(var e=[],r=t.getGeometries(),n=0,i=r.length;n<i;++n)e.push(wE(r[n]));return e.join(",")}};function wE(t){var e=t.getType(),r=SE[e](t);if(e=e.toUpperCase(),"function"==typeof t.getFlatCoordinates){var n=function(t){var e=t.getLayout(),r="";return e!==At.XYZ&&e!==At.XYZM||(r+=aE),e!==At.XYM&&e!==At.XYZM||(r+=sE),r}(t);n.length>0&&(e+=" "+n)}return 0===r.length?e+" "+oE:e+"("+r+")"}var xE=vE,OE="http://www.w3.org/1999/xlink";function RE(t){return t.getAttributeNS(OE,"href")}var CE=function(){function t(){}return t.prototype.read=function(t){if(t){if("string"==typeof t){var e=Fs(t);return this.readFromDocument(e)}return Ms(t)?this.readFromDocument(t):this.readFromNode(t)}return null},t.prototype.readFromDocument=function(){},t.prototype.readFromNode=function(){},t}(),PE=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),IE=[null,"http://www.opengis.net/wms"],bE=Xs(IE,{Service:js(function(t,e){return Ws({},FE,t,e)}),Capability:js(function(t,e){return Ws({},LE,t,e)})}),LE=Xs(IE,{Request:js(function(t,e){return Ws({},BE,t,e)}),Exception:js(function(t,e){return Ws([],GE,t,e)}),Layer:js(function(t,e){return Ws({},jE,t,e)})}),ME=function(t){function e(){var e=t.call(this)||this;return e.version=void 0,e}return PE(e,t),e.prototype.readFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFromNode(e);return null},e.prototype.readFromNode=function(t){this.version=t.getAttribute("version").trim();var e=Ws({version:this.version},bE,t,[]);return e||null},e}(CE),FE=Xs(IE,{Name:js(Yd),Title:js(Yd),Abstract:js(Yd),KeywordList:js(JE),OnlineResource:js(RE),ContactInformation:js(function(t,e){return Ws({},AE,t,e)}),Fees:js(Yd),AccessConstraints:js(Yd),LayerLimit:js(Ud),MaxWidth:js(Ud),MaxHeight:js(Ud)}),AE=Xs(IE,{ContactPersonPrimary:js(function(t,e){return Ws({},NE,t,e)}),ContactPosition:js(Yd),ContactAddress:js(function(t,e){return Ws({},DE,t,e)}),ContactVoiceTelephone:js(Yd),ContactFacsimileTelephone:js(Yd),ContactElectronicMailAddress:js(Yd)}),NE=Xs(IE,{ContactPerson:js(Yd),ContactOrganization:js(Yd)}),DE=Xs(IE,{AddressType:js(Yd),Address:js(Yd),City:js(Yd),StateOrProvince:js(Yd),PostCode:js(Yd),Country:js(Yd)}),GE=Xs(IE,{Format:Ns(Yd)}),jE=Xs(IE,{Name:js(Yd),Title:js(Yd),Abstract:js(Yd),KeywordList:js(JE),CRS:Gs(Yd),EX_GeographicBoundingBox:js(function(t,e){var r=Ws({},UE,t,e);if(r){var n=r.westBoundLongitude,i=r.southBoundLatitude,o=r.eastBoundLongitude,a=r.northBoundLatitude;if(void 0!==n&&void 0!==i&&void 0!==o&&void 0!==a)return[n,i,o,a]}}),BoundingBox:Gs(function(t){var r=[kd(t.getAttribute("minx")),kd(t.getAttribute("miny")),kd(t.getAttribute("maxx")),kd(t.getAttribute("maxy"))],n=[kd(t.getAttribute("resx")),kd(t.getAttribute("resy"))];return{crs:t.getAttribute("CRS"),extent:r,res:n}}),Dimension:Gs(function(t){return{name:t.getAttribute("name"),units:t.getAttribute("units"),unitSymbol:t.getAttribute("unitSymbol"),"default":t.getAttribute("default"),multipleValues:Dd(t.getAttribute("multipleValues")),nearestValue:Dd(t.getAttribute("nearestValue")),current:Dd(t.getAttribute("current")),values:Yd(t)}}),Attribution:js(function(t,e){return Ws({},kE,t,e)}),AuthorityURL:Gs(function(t,e){var r=KE(t,e);if(r)return r.name=t.getAttribute("name"),r}),Identifier:Gs(Yd),MetadataURL:Gs(function(t,e){var r=KE(t,e);if(r)return r.type=t.getAttribute("type"),r}),DataURL:Gs(KE),FeatureListURL:Gs(KE),Style:Gs(function(t,e){return Ws({},VE,t,e)}),MinScaleDenominator:js(jd),MaxScaleDenominator:js(jd),Layer:Gs(function(t,e){var r=e[e.length-1],n=Ws({},jE,t,e);if(n){var i=Dd(t.getAttribute("queryable"));void 0===i&&(i=r.queryable);n.queryable=void 0!==i&&i;var o=Bd(t.getAttribute("cascaded"));void 0===o&&(o=r.cascaded);n.cascaded=o;var a=Dd(t.getAttribute("opaque"));void 0===a&&(a=r.opaque);n.opaque=void 0!==a&&a;var s=Dd(t.getAttribute("noSubsets"));void 0===s&&(s=r.noSubsets);n.noSubsets=void 0!==s&&s;var u=kd(t.getAttribute("fixedWidth"));u||(u=r.fixedWidth);n.fixedWidth=u;var l=kd(t.getAttribute("fixedHeight"));return l||(l=r.fixedHeight),n.fixedHeight=l,["Style","CRS","AuthorityURL"].forEach(function(t){if(t in r){var e=n[t]||[];n[t]=e.concat(r[t])}}),["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"].forEach(function(t){if(!(t in n)){var e=r[t];n[t]=e}}),n}})}),kE=Xs(IE,{Title:js(Yd),OnlineResource:js(RE),LogoURL:js(qE)}),UE=Xs(IE,{westBoundLongitude:js(jd),eastBoundLongitude:js(jd),southBoundLatitude:js(jd),northBoundLatitude:js(jd)}),BE=Xs(IE,{GetCapabilities:js(HE),GetMap:js(HE),GetFeatureInfo:js(HE)}),YE=Xs(IE,{Format:Gs(Yd),DCPType:Gs(function(t,e){return Ws({},zE,t,e)})}),zE=Xs(IE,{HTTP:js(function(t,e){return Ws({},XE,t,e)})}),XE=Xs(IE,{Get:js(KE),Post:js(KE)}),VE=Xs(IE,{Name:js(Yd),Title:js(Yd),Abstract:js(Yd),LegendURL:Gs(qE),StyleSheetURL:js(KE),StyleURL:js(KE)}),WE=Xs(IE,{Format:js(Yd),OnlineResource:js(RE)}),ZE=Xs(IE,{Keyword:Ns(Yd)});function KE(t,e){return Ws({},WE,t,e)}function HE(t,e){return Ws({},YE,t,e)}function qE(t,e){var r=KE(t,e);if(r){var n=[Bd(t.getAttribute("width")),Bd(t.getAttribute("height"))];return r.size=n,r}}function JE(t,e){return Ws([],ZE,t,e)}var QE=ME,$E=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),tT=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.featureNS_="http://mapserver.gis.umn.edu/mapserver",r.gmlFormat_=new i_,r.layers_=n.layers?n.layers:null,r}return $E(e,t),e.prototype.getLayers=function(){return this.layers_},e.prototype.setLayers=function(t){this.layers_=t},e.prototype.readFeatures_=function(t,e){t.setAttribute("namespaceURI",this.featureNS_);var r=t.localName,n=[];if(0===t.childNodes.length)return n;if("msGMLOutput"==r)for(var i=0,o=t.childNodes.length;i<o;i++){var a=t.childNodes[i];if(a.nodeType===Node.ELEMENT_NODE){var s=a,u=e[0],l=s.localName.replace("_layer","");if(!this.layers_||T(this.layers_,l)){var h=l+"_feature";u.featureType=h;u.featureNS=this.featureNS_;var c={};c[h]=Ns(this.gmlFormat_.readFeatureElement,this.gmlFormat_);var p=Xs([u.featureNS,null],c);s.setAttribute("namespaceURI",this.featureNS_);var f=Ws([],p,s,e,this.gmlFormat_);f&&x(n,f)}}}if("FeatureCollection"==r){var d=Ws([],this.gmlFormat_.FEATURE_COLLECTION_PARSERS,t,[{}],this.gmlFormat_);d&&(n=d)}return n},e.prototype.readFeaturesFromNode=function(t,e){var r={};return e&&p(r,this.getReadOptions(t,e)),this.readFeatures_(t,[r])},e}(Id),eT=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),rT=[null,"http://www.opengis.net/ows/1.1"],nT=Xs(rT,{ServiceIdentification:js(function(t,e){return Ws({},gT,t,e)}),ServiceProvider:js(function(t,e){return Ws({},yT,t,e)}),OperationsMetadata:js(function(t,e){return Ws({},pT,t,e)})}),iT=function(t){function e(){return t.call(this)||this}return eT(e,t),e.prototype.readFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFromNode(e);return null},e.prototype.readFromNode=function(t){var e=Ws({},nT,t,[]);return e||null},e}(CE),oT=Xs(rT,{DeliveryPoint:js(Yd),City:js(Yd),AdministrativeArea:js(Yd),PostalCode:js(Yd),Country:js(Yd),ElectronicMailAddress:js(Yd)}),aT=Xs(rT,{Value:Gs(function(t){return Yd(t)})}),sT=Xs(rT,{AllowedValues:js(function(t,e){return Ws({},aT,t,e)})}),uT=Xs(rT,{Phone:js(function(t,e){return Ws({},fT,t,e)}),Address:js(function(t,e){return Ws({},oT,t,e)})}),lT=Xs(rT,{HTTP:js(function(t,e){return Ws({},hT,t,e)})}),hT=Xs(rT,{Get:Gs(function(t,e){var r=RE(t);if(r)return Ws({href:r},dT,t,e)}),Post:void 0}),cT=Xs(rT,{DCP:js(function(t,e){return Ws({},lT,t,e)})}),pT=Xs(rT,{Operation:function(t,e){var r=t.getAttribute("name"),n=Ws({},cT,t,e);n&&(e[e.length-1][r]=n)}}),fT=Xs(rT,{Voice:js(Yd),Facsimile:js(Yd)}),dT=Xs(rT,{Constraint:Gs(function(t,e){var r=t.getAttribute("name");if(r)return Ws({name:r},sT,t,e)})}),_T=Xs(rT,{IndividualName:js(Yd),PositionName:js(Yd),ContactInfo:js(function(t,e){return Ws({},uT,t,e)})}),gT=Xs(rT,{Abstract:js(Yd),AccessConstraints:js(Yd),Fees:js(Yd),Title:js(Yd),ServiceTypeVersion:js(Yd),ServiceType:js(Yd)}),yT=Xs(rT,{ProviderName:js(Yd),ProviderSite:js(RE),ServiceContact:js(function(t,e){return Ws({},_T,t,e)})}),vT=iT,mT=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ET=[null,"http://www.opengis.net/wmts/1.0"],TT=[null,"http://www.opengis.net/ows/1.1"],ST=Xs(ET,{Contents:js(function(t,e){return Ws({},xT,t,e)})}),wT=function(t){function e(){var e=t.call(this)||this;return e.owsParser_=new vT,e}return mT(e,t),e.prototype.readFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFromNode(e);return null},e.prototype.readFromNode=function(t){var e=t.getAttribute("version").trim(),r=this.owsParser_.readFromNode(t);return r?(r.version=e,(r=Ws(r,ST,t,[]))||null):null},e}(CE),xT=Xs(ET,{Layer:Gs(function(t,e){return Ws({},OT,t,e)}),TileMatrixSet:Gs(function(t,e){return Ws({},MT,t,e)})}),OT=Xs(ET,{Style:Gs(function(t,e){var r=Ws({},RT,t,e);if(r){var n="true"===t.getAttribute("isDefault");return r.isDefault=n,r}}),Format:Gs(Yd),TileMatrixSetLink:Gs(function(t,e){return Ws({},CT,t,e)}),Dimension:Gs(function(t,e){return Ws({},bT,t,e)}),ResourceURL:Gs(function(t){var r=t.getAttribute("format"),n=t.getAttribute("template"),i=t.getAttribute("resourceType"),o={};return r&&(o.format=r),n&&(o.template=n),i&&(o.resourceType=i),o})},Xs(TT,{Title:js(Yd),Abstract:js(Yd),WGS84BoundingBox:js(function(t,e){var r=Ws([],LT,t,e);if(2==r.length)return $(r)}),Identifier:js(Yd)})),RT=Xs(ET,{LegendURL:Gs(function(t){var r={};return r.format=t.getAttribute("format"),r.href=RE(t),r})},Xs(TT,{Title:js(Yd),Identifier:js(Yd)})),CT=Xs(ET,{TileMatrixSet:js(Yd),TileMatrixSetLimits:js(function(t,e){return Ws([],PT,t,e)})}),PT=Xs(ET,{TileMatrixLimits:Ns(function(t,e){return Ws({},IT,t,e)})}),IT=Xs(ET,{TileMatrix:js(Yd),MinTileRow:js(Ud),MaxTileRow:js(Ud),MinTileCol:js(Ud),MaxTileCol:js(Ud)}),bT=Xs(ET,{Default:js(Yd),Value:Gs(Yd)},Xs(TT,{Identifier:js(Yd)})),LT=Xs(TT,{LowerCorner:Ns(AT),UpperCorner:Ns(AT)}),MT=Xs(ET,{WellKnownScaleSet:js(Yd),TileMatrix:Gs(function(t,e){return Ws({},FT,t,e)})},Xs(TT,{SupportedCRS:js(Yd),Identifier:js(Yd)})),FT=Xs(ET,{TopLeftCorner:js(AT),ScaleDenominator:js(jd),TileWidth:js(Ud),TileHeight:js(Ud),MatrixWidth:js(Ud),MatrixHeight:js(Ud)},Xs(TT,{Identifier:js(Yd)}));function AT(t){var r=Yd(t).split(/\s+/);if(r&&2==r.length){var n=+r[0],i=+r[1];if(!isNaN(n)&&!isNaN(i))return[n,i]}}var NT=wT,DT=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),GT=["fullscreenchange","webkitfullscreenchange","MSFullscreenChange"];function jT(){var t=document.body;return!!(t.webkitRequestFullscreen||t.msRequestFullscreen&&document.msFullscreenEnabled||t.requestFullscreen&&document.fullscreenEnabled)}function kT(){return!!(document.webkitIsFullScreen||document.msFullscreenElement||document.fullscreenElement)}function UT(t){t.requestFullscreen?t.requestFullscreen():t.msRequestFullscreen?t.msRequestFullscreen():t.webkitRequestFullscreen&&t.webkitRequestFullscreen()}var BT=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{element:document.createElement("div"),target:n.target})||this).cssClassName_=void 0!==n.className?n.className:"ol-full-screen";var i=void 0!==n.label?n.label:"⤢";r.labelNode_="string"==typeof i?document.createTextNode(i):i;var o=void 0!==n.labelActive?n.labelActive:"×";r.labelActiveNode_="string"==typeof o?document.createTextNode(o):o;r.button_=document.createElement("button");var a=n.tipLabel?n.tipLabel:"Toggle full-screen";r.setClassName_(r.button_,kT());r.button_.setAttribute("type","button");r.button_.title=a;r.button_.appendChild(r.labelNode_);r.button_.addEventListener(N.CLICK,r.handleClick_.bind(r),!1);var s=r.cssClassName_+" "+Ai+" "+Di+" "+(jT()?"":Ni),u=r.element;return u.className=s,u.appendChild(r.button_),r.keys_=void 0!==n.keys&&n.keys,r.source_=n.source,r}return DT(e,t),e.prototype.handleClick_=function(t){t.preventDefault();this.handleFullScreen_()},e.prototype.handleFullScreen_=function(){if(jT()){var t=this.getMap();if(t)if(kT())document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.webkitExitFullscreen&&document.webkitExitFullscreen();else{var e=void 0;e=this.source_?"string"==typeof this.source_?document.getElementById(this.source_):this.source_:t.getTargetElement();this.keys_?function(t){t.webkitRequestFullscreen?t.webkitRequestFullscreen():UT(t)}(e):UT(e)}}},e.prototype.handleFullScreenChange_=function(){var t=this.getMap();kT()?(this.setClassName_(this.button_,!0),pi(this.labelActiveNode_,this.labelNode_)):(this.setClassName_(this.button_,!1),pi(this.labelNode_,this.labelActiveNode_));t&&t.updateSize()},e.prototype.setClassName_=function(t,e){var r=this.cssClassName_+"-true",n=this.cssClassName_+"-false",i=e?r:n;t.classList.remove(r);t.classList.remove(n);t.classList.add(i)},e.prototype.setMap=function(e){if(t.prototype.setMap.call(this,e),e)for(var r=0,n=GT.length;r<n;++r)this.listenerKeys.push(g(document,GT[r],this.handleFullScreenChange_,this))},e}(Li),YT=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),zT="projection";function XT(t){var e=t.frameState;e?this.mapProjection_!=e.viewState.projection&&(this.mapProjection_=e.viewState.projection,this.transform_=null):this.mapProjection_=null}var VT=function(t){function e(e){var r=this,n=e||{},i=document.createElement("div");return i.className=void 0!==n.className?n.className:"ol-mouse-position",(r=t.call(this,{element:i,render:n.render||XT,target:n.target})||this).addEventListener(Y(zT),r.handleProjectionChanged_),n.coordinateFormat&&r.setCoordinateFormat(n.coordinateFormat),n.projection&&r.setProjection(n.projection),r.undefinedHTML_=void 0!==n.undefinedHTML?n.undefinedHTML:"&#160;",r.renderOnMouseOut_=!!r.undefinedHTML_,r.renderedHTML_=i.innerHTML,r.mapProjection_=null,r.transform_=null,r}return YT(e,t),e.prototype.handleProjectionChanged_=function(){this.transform_=null},e.prototype.getCoordinateFormat=function(){return this.get("coordinateFormat")},e.prototype.getProjection=function(){return this.get(zT)},e.prototype.handleMouseMove=function(t){var e=this.getMap();this.updateHTML_(e.getEventPixel(t))},e.prototype.handleMouseOut=function(){this.updateHTML_(null)},e.prototype.setMap=function(e){if(t.prototype.setMap.call(this,e),e){var r=e.getViewport();this.listenerKeys.push(g(r,cn.POINTERMOVE,this.handleMouseMove,this));this.renderOnMouseOut_&&this.listenerKeys.push(g(r,cn.POINTEROUT,this.handleMouseOut,this))}},e.prototype.setCoordinateFormat=function(t){this.set("coordinateFormat",t)},e.prototype.setProjection=function(t){this.set(zT,we(t))},e.prototype.updateHTML_=function(t){var e=this.undefinedHTML_;if(t&&this.mapProjection_){if(!this.transform_){var r=this.getProjection();this.transform_=r?be(this.mapProjection_,r):Te}var n=this.getMap().getCoordinateFromPixelInternal(t);if(n){var i=je();i&&(this.transform_=be(this.mapProjection_,i));this.transform_(n,n);var o=this.getCoordinateFormat();e=o?o(n):n.toString()}}this.renderedHTML_&&e===this.renderedHTML_||(this.element.innerHTML=e,this.renderedHTML_=e)},e}(Li),WT=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ZT=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return WT(e,t),e.prototype.createRenderer=function(){return new Ha(this)},e}(Ii);function KT(){this.validateExtent_();this.updateBox_()}var HT=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{element:document.createElement("div"),render:n.render||KT,target:n.target})||this).boundHandleRotationChanged_=r.handleRotationChanged_.bind(r);r.collapsed_=void 0===n.collapsed||n.collapsed;r.collapsible_=void 0===n.collapsible||n.collapsible;r.collapsible_||(r.collapsed_=!1);r.rotateWithView_=void 0!==n.rotateWithView&&n.rotateWithView;r.viewExtent_=void 0;var i=void 0!==n.className?n.className:"ol-overviewmap",o=void 0!==n.tipLabel?n.tipLabel:"Overview map",a=void 0!==n.collapseLabel?n.collapseLabel:"«";"string"==typeof a?(r.collapseLabel_=document.createElement("span"),r.collapseLabel_.textContent=a):r.collapseLabel_=a;var s=void 0!==n.label?n.label:"»";"string"==typeof s?(r.label_=document.createElement("span"),r.label_.textContent=s):r.label_=s;var u=r.collapsible_&&!r.collapsed_?r.collapseLabel_:r.label_,l=document.createElement("button");l.setAttribute("type","button");l.title=o;l.appendChild(u);l.addEventListener(N.CLICK,r.handleClick_.bind(r),!1);r.ovmapDiv_=document.createElement("div");r.ovmapDiv_.className="ol-overviewmap-map";r.ovmap_=new ZT({view:n.view});var h=r.ovmap_;n.layers&&n.layers.forEach(function(t){h.addLayer(t)});var c=document.createElement("div");c.className="ol-overviewmap-box";c.style.boxSizing="border-box";r.boxOverlay_=new es({position:[0,0],positioning:Qa.CENTER_CENTER,element:c});r.ovmap_.addOverlay(r.boxOverlay_);var p=i+" "+Ai+" "+Di+(r.collapsed_&&r.collapsible_?" "+Gi:"")+(r.collapsible_?"":" ol-uncollapsible"),f=r.element;f.className=p;f.appendChild(r.ovmapDiv_);f.appendChild(l);var d=r,_=r.boxOverlay_,g=r.boxOverlay_.getElement(),y=function(t){var e,r={clientX:(e=t).clientX,clientY:e.clientY},n=h.getEventCoordinateInternal(r);_.setPosition(n)},v=function(t){var e=h.getEventCoordinateInternal(t);d.getMap().getView().setCenterInternal(e);window.removeEventListener("mousemove",y);window.removeEventListener("mouseup",v)};return g.addEventListener("mousedown",function(){window.addEventListener("mousemove",y);window.addEventListener("mouseup",v)}),r}return WT(e,t),e.prototype.setMap=function(e){var r=this.getMap();if(e!==r){if(r){var n=r.getView();n&&this.unbindView_(n);this.ovmap_.setTarget(null)}if(t.prototype.setMap.call(this,e),e){this.ovmap_.setTarget(this.ovmapDiv_);this.listenerKeys.push(g(e,c,this.handleMapPropertyChange_,this));var i=e.getView();i&&(this.bindView_(i),i.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_()))}}},e.prototype.handleMapPropertyChange_=function(t){if(t.key===yn.VIEW){var e=t.oldValue;e&&this.unbindView_(e);var r=this.getMap().getView();this.bindView_(r)}},e.prototype.bindView_=function(t){t.addEventListener(Y(Un),this.boundHandleRotationChanged_)},e.prototype.unbindView_=function(t){t.removeEventListener(Y(Un),this.boundHandleRotationChanged_)},e.prototype.handleRotationChanged_=function(){this.rotateWithView_&&this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())},e.prototype.validateExtent_=function(){var t=this.getMap(),e=this.ovmap_;if(t.isRendered()&&e.isRendered()){var r=t.getSize(),n=t.getView().calculateExtentInternal(r);if(!this.viewExtent_||!pt(n,this.viewExtent_)){this.viewExtent_=n;var i=e.getSize(),o=e.getView().calculateExtentInternal(i),a=e.getPixelFromCoordinateInternal(Ct(n)),s=e.getPixelFromCoordinateInternal(Tt(n)),u=Math.abs(a[0]-s[0]),l=Math.abs(a[1]-s[1]),h=i[0],c=i[1];u<.1*h||l<.1*c||u>.75*h||l>.75*c?this.resetExtent_():it(o,n)||this.recenter_()}}},e.prototype.resetExtent_=function(){var t=this.getMap(),e=this.ovmap_,r=t.getSize(),n=t.getView().calculateExtentInternal(r),i=e.getView(),o=Math.log(7.5)/Math.LN2;Mt(n,1/(.1*Math.pow(2,o/2)));i.fitInternal(zr(n))},e.prototype.recenter_=function(){var t=this.getMap(),e=this.ovmap_,r=t.getView();e.getView().setCenterInternal(r.getCenterInternal())},e.prototype.updateBox_=function(){var t=this.getMap(),e=this.ovmap_;if(t.isRendered()&&e.isRendered()){var r=t.getSize(),n=t.getView(),i=e.getView(),o=this.rotateWithView_?0:-n.getRotation(),a=this.boxOverlay_,s=this.boxOverlay_.getElement(),u=n.getCenterInternal(),l=n.getResolution(),h=i.getResolution(),c=r[0]*l/h,p=r[1]*l/h;if(a.setPosition(u),s){s.style.width=c+"px";s.style.height=p+"px";var f="rotate("+o+"rad)";s.style.transform=f}}},e.prototype.handleClick_=function(t){t.preventDefault();this.handleToggle_()},e.prototype.handleToggle_=function(){this.element.classList.toggle(Gi);this.collapsed_?pi(this.collapseLabel_,this.label_):pi(this.label_,this.collapseLabel_);this.collapsed_=!this.collapsed_;var t=this.ovmap_;if(!this.collapsed_){if(t.isRendered())return this.viewExtent_=void 0,void t.render();t.updateSize();this.resetExtent_();y(t,dn,function(){this.updateBox_()},this)}},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.getRotateWithView=function(){return this.rotateWithView_},e.prototype.setRotateWithView=function(t){this.rotateWithView_!==t&&(this.rotateWithView_=t,0!==this.getMap().getView().getRotation()&&(this.rotateWithView_?this.handleRotationChanged_():this.ovmap_.getView().setRotation(0),this.viewExtent_=void 0,this.validateExtent_(),this.updateBox_()))},e.prototype.getOverviewMap=function(){return this.ovmap_},e}(Li),qT=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),JT="units",QT={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"},$T=[1,2,5];function tS(t){var e=t.frameState;this.viewState_=e?e.viewState:null;this.updateElement_()}var eS=function(t){function e(e){var r=this,n=e||{},i=void 0!==n.className?n.className:n.bar?"ol-scale-bar":"ol-scale-line";return(r=t.call(this,{element:document.createElement("div"),render:n.render||tS,target:n.target})||this).innerElement_=document.createElement("div"),r.innerElement_.className=i+"-inner",r.element.className=i+" "+Ai,r.element.appendChild(r.innerElement_),r.viewState_=null,r.minWidth_=void 0!==n.minWidth?n.minWidth:64,r.renderedVisible_=!1,r.renderedWidth_=void 0,r.renderedHTML_="",r.addEventListener(Y(JT),r.handleUnitsChanged_),r.setUnits(n.units||QT.METRIC),r.scaleBar_=n.bar||!1,r.scaleBarSteps_=n.steps||4,r.scaleBarText_=n.text||!1,r}return qT(e,t),e.prototype.getUnits=function(){return this.get(JT)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set(JT,t)},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,r=t.projection,n=this.getUnits(),i=n==QT.DEGREES?te.DEGREES:te.METERS,o=xe(r,t.resolution,e,i),a=this.minWidth_*o,s="";if(n==QT.DEGREES){var u=$t[te.DEGREES];(a*=u)<u/60?(s="″",o*=3600):a<u?(s="′",o*=60):s="°"}else n==QT.IMPERIAL?a<.9144?(s="in",o/=.0254):a<1609.344?(s="ft",o/=.3048):(s="mi",o/=1609.344):n==QT.NAUTICAL?(o/=1852,s="nm"):n==QT.METRIC?a<.001?(s="μm",o*=1e6):a<1?(s="mm",o*=1e3):a<1e3?s="m":(s="km",o/=1e3):n==QT.US?a<.9144?(s="in",o*=39.37):a<1609.344?(s="ft",o/=.30480061):(s="mi",o/=1609.3472):K(!1,33);for(var l,h,c,p,f=3*Math.floor(Math.log(this.minWidth_*o)/Math.log(10));;){c=Math.floor(f/3);var d=Math.pow(10,c);if(l=$T[(f%3+3)%3]*d,h=Math.round(l/o),isNaN(h))return this.element.style.display="none",void(this.renderedVisible_=!1);if(h>=this.minWidth_)break;++f}p=this.scaleBar_?this.createScaleBar(h,l,s):l.toFixed(c<0?-c:0)+" "+s;this.renderedHTML_!=p&&(this.innerElement_.innerHTML=p,this.renderedHTML_=p);this.renderedWidth_!=h&&(this.innerElement_.style.width=h+"px",this.renderedWidth_=h);this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.createScaleBar=function(t,e,r){for(var n="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),i=[],o=t/this.scaleBarSteps_,a="#ffffff",s=0;s<this.scaleBarSteps_;s++)0===s&&i.push(this.createMarker("absolute",s)),i.push('<div><div class="ol-scale-singlebar" style="width: '+o+"px;background-color: "+a+';"><\/div>'+this.createMarker("relative",s)+(s%2==0||2===this.scaleBarSteps_?this.createStepText(s,t,!1,e,r):"")+"<\/div>"),s===this.scaleBarSteps_-1&&i.push(this.createStepText(s+1,t,!0,e,r)),a="#ffffff"===a?"#000000":"#ffffff";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+t+'px;">'+n+"<\/div>":"")+i.join("")+"<\/div>"},e.prototype.createMarker=function(t){return'<div class="ol-scale-step-marker" style="position: '+t+";top: "+("absolute"===t?3:-10)+'px;"><\/div>'},e.prototype.createStepText=function(t,e,r,n,i){var o=(0===t?0:Math.round(n/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+i);return'<div class="ol-scale-step-text" style="margin-left: '+(0===t?-3:e/this.scaleBarSteps_*-1)+"px;text-align: "+(0===t?"left":"center")+"; min-width: "+(0===t?0:e/this.scaleBarSteps_*2)+"px;left: "+(r?e+"px":"unset")+';">'+o+"<\/div>"},e.prototype.getScaleForResolution=function(){var t=this.getMap().getView().getResolution(),e=this.viewState_.projection.getMetersPerUnit();return parseFloat(t.toString())*e*39.37*(25.4/.28)},e}(Li),rS=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),nS={VERTICAL:0,HORIZONTAL:1};function iS(t){if(t.frameState){this.sliderInitialized_||this.initSlider_();var e=t.frameState.viewState.resolution;this.currentResolution_=e;this.setThumbPosition_(e)}}var oS=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{element:document.createElement("div"),render:n.render||iS})||this).dragListenerKeys_=[];r.currentResolution_=void 0;r.direction_=nS.VERTICAL;r.dragging_;r.heightLimit_=0;r.widthLimit_=0;r.startX_;r.startY_;r.thumbSize_=null;r.sliderInitialized_=!1;r.duration_=void 0!==n.duration?n.duration:200;var i=void 0!==n.className?n.className:"ol-zoomslider",o=document.createElement("button");o.setAttribute("type","button");o.className=i+"-thumb "+Ai;var a=r.element;return a.setAttribute("touch-action","none"),a.className=i+" "+Ai+" "+Di,a.appendChild(o),a.addEventListener(cn.POINTERDOWN,r.handleDraggerStart_.bind(r),!1),a.addEventListener(cn.POINTERMOVE,r.handleDraggerDrag_.bind(r),!1),a.addEventListener(cn.POINTERUP,r.handleDraggerEnd_.bind(r),!1),a.addEventListener(N.CLICK,r.handleContainerClick_.bind(r),!1),o.addEventListener(N.CLICK,L,!1),r}return rS(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e);e&&e.render()},e.prototype.initSlider_=function(){var t=this.element,e=t.offsetWidth,r=t.offsetHeight,n=t.firstElementChild,i=getComputedStyle(n),o=n.offsetWidth+parseFloat(i.marginRight)+parseFloat(i.marginLeft),a=n.offsetHeight+parseFloat(i.marginTop)+parseFloat(i.marginBottom);this.thumbSize_=[o,a];e>r?(this.direction_=nS.HORIZONTAL,this.widthLimit_=e-o):(this.direction_=nS.VERTICAL,this.heightLimit_=r-a);this.sliderInitialized_=!0},e.prototype.handleContainerClick_=function(t){var e=this.getMap().getView(),r=this.getRelativePosition_(t.offsetX-this.thumbSize_[0]/2,t.offsetY-this.thumbSize_[1]/2),n=this.getResolutionForPosition_(r),i=e.getConstrainedZoom(e.getZoomForResolution(n));e.animateInternal({zoom:i,duration:this.duration_,easing:ei})},e.prototype.handleDraggerStart_=function(t){if(!this.dragging_&&t.target===this.element.firstElementChild){var e=this.element.firstElementChild;if(this.getMap().getView().beginInteraction(),this.startX_=t.clientX-parseFloat(e.style.left),this.startY_=t.clientY-parseFloat(e.style.top),this.dragging_=!0,0===this.dragListenerKeys_.length){var r=this.handleDraggerDrag_,n=this.handleDraggerEnd_;this.dragListenerKeys_.push(g(document,cn.POINTERMOVE,r,this),g(document,cn.POINTERUP,n,this))}}},e.prototype.handleDraggerDrag_=function(t){if(this.dragging_){var e=t.clientX-this.startX_,r=t.clientY-this.startY_,n=this.getRelativePosition_(e,r);this.currentResolution_=this.getResolutionForPosition_(n);this.getMap().getView().setResolution(this.currentResolution_)}},e.prototype.handleDraggerEnd_=function(){this.dragging_&&(this.getMap().getView().endInteraction(),this.dragging_=!1,this.startX_=void 0,this.startY_=void 0,this.dragListenerKeys_.forEach(v),this.dragListenerKeys_.length=0)},e.prototype.setThumbPosition_=function(t){var e=this.getPositionForResolution_(t),r=this.element.firstElementChild;this.direction_==nS.HORIZONTAL?r.style.left=this.widthLimit_*e+"px":r.style.top=this.heightLimit_*e+"px"},e.prototype.getRelativePosition_=function(t,e){return kt(this.direction_===nS.HORIZONTAL?t/this.widthLimit_:e/this.heightLimit_,0,1)},e.prototype.getResolutionForPosition_=function(t){return this.getMap().getView().getResolutionForValueFunction()(1-t)},e.prototype.getPositionForResolution_=function(t){return kt(1-this.getMap().getView().getValueForResolutionFunction()(t),0,1)},e}(Li),aS=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r);e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),sS=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{element:document.createElement("div"),target:n.target})||this).extent=n.extent?n.extent:null;var i=void 0!==n.className?n.className:"ol-zoom-extent",o=void 0!==n.label?n.label:"E",a=void 0!==n.tipLabel?n.tipLabel:"Fit to extent",s=document.createElement("button");s.setAttribute("type","button");s.title=a;s.appendChild("string"==typeof o?document.createTextNode(o):o);s.addEventListener(N.CLICK,r.handleClick_.bind(r),!1);var u=i+" "+Ai+" "+Di,l=r.element;return l.className=u,l.appendChild(s),r}return aS(e,t),e.prototype.handleClick_=function(t){t.preventDefault();this.handleZoomToExtent()},e.prototype.handleZoomToExtent=function(){var t=this.getMap().getView(),e=this.extent?this.extent:t.getProjection().getExtent();t.fitInternal(zr(e))},e}(Li),uS={array:{},color:{},colorlike:{},control:{},coordinate:{},easing:{},events:{}};uS.events.condition={};uS.extent={};uS.featureloader={};uS.format={};uS.format.filter={};uS.geom={};uS.has={};uS.interaction={};uS.layer={};uS.loadingstrategy={};uS.proj={};uS.proj.Units={};uS.proj.proj4={};uS.render={};uS.render.canvas={};uS.renderer={};uS.renderer.canvas={};uS.renderer.webgl={};uS.size={};uS.source={};uS.sphere={};uS.style={};uS.style.IconImageCache={};uS.tilegrid={};uS.util={};uS.webgl={};uS.xml={};uS.Collection=Z;uS.Feature=q;uS.Geolocation=Hr;uS.Kinetic=qr;uS.Map=Ja;uS.Object=z;uS.Observable=G;uS.Observable.unByKey=function(t){if(Array.isArray(t))for(var e=0,r=t.length;e<r;++e)v(t[e]);else v(t)};uS.Overlay=es;uS.PluggableMap=Ii;uS.View=ui;uS.array.stableSort=function(t,e){for(var n=t.length,i=Array(t.length),r=0;r<n;r++)i[r]={index:r,value:t[r]};for(i.sort(function(t,r){return e(t.value,r.value)||t.index-r.index}),r=0;r<t.length;r++)t[r]=i[r].value};uS.color.asArray=oa;uS.color.asString=ra;uS.colorlike.asColorLike=ca;uS.control.Attribution=Xi;uS.control.Attribution.render=zi;uS.control.Control=Li;uS.control.FullScreen=BT;uS.control.MousePosition=VT;uS.control.MousePosition.render=XT;uS.control.OverviewMap=HT;uS.control.OverviewMap.render=KT;uS.control.Rotate=Zi;uS.control.Rotate.render=Wi;uS.control.ScaleLine=eS;uS.control.ScaleLine.render=tS;uS.control.Zoom=Hi;uS.control.ZoomSlider=oS;uS.control.ZoomSlider.render=iS;uS.control.ZoomToExtent=sS;uS.control.defaults=qi;uS.coordinate.add=zn;uS.coordinate.createStringXY=function(t){return function(e){return $n(e,t)}};uS.coordinate.format=Wn;uS.coordinate.rotate=Kn;uS.coordinate.toStringHDMS=function(t,e){return t?Vn("NS",t[1],e)+" "+Vn("EW",t[0],e):""};uS.coordinate.toStringXY=$n;uS.easing.easeIn=ti;uS.easing.easeOut=ei;uS.easing.inAndOut=ri;uS.easing.linear=ni;uS.easing.upAndDown=function(t){return t<.5?ri(2*t):1-ri(2*(t-.5))};uS.events.condition.altKeyOnly=io;uS.events.condition.altShiftKeysOnly=oo;uS.events.condition.always=so;uS.events.condition.click=function(t){return t.type==un.CLICK};uS.events.condition.doubleClick=function(t){return t.type==un.DBLCLICK};uS.events.condition.focus=ao;uS.events.condition.mouseOnly=_o;uS.events.condition.never=lo;uS.events.condition.noModifierKeys=co;uS.events.condition.penOnly=function(t){var e=t.pointerEvent;return K(void 0!==e,56),"pen"===e.pointerType};uS.events.condition.platformModifierKeyOnly=function(t){var e=t.originalEvent;return!e.altKey&&(on?e.metaKey:e.ctrlKey)&&!e.shiftKey};uS.events.condition.pointerMove=function(t){return"pointermove"==t.type};uS.events.condition.primaryAction=go;uS.events.condition.shiftKeyOnly=po;uS.events.condition.singleClick=ho;uS.events.condition.targetNotEditable=fo;uS.events.condition.touchOnly=function(t){var e=t.pointerEvent;return K(void 0!==e,56),"touch"===e.pointerType};uS.extent.applyTransform=Ft;uS.extent.boundingExtent=$;uS.extent.buffer=tt;uS.extent.containsCoordinate=nt;uS.extent.containsExtent=it;uS.extent.containsXY=ot;uS.extent.createEmpty=st;uS.extent.equals=pt;uS.extent.extend=ft;uS.extent.getArea=mt;uS.extent.getBottomLeft=Et;uS.extent.getBottomRight=Tt;uS.extent.getCenter=St;uS.extent.getHeight=Ot;uS.extent.getIntersection=Rt;uS.extent.getSize=function(t){return[t[2]-t[0],t[3]-t[1]]};uS.extent.getTopLeft=Ct;uS.extent.getTopRight=Pt;uS.extent.getWidth=It;uS.extent.intersects=bt;uS.extent.isEmpty=Lt;uS.featureloader.setWithCredentials=function(t){ns=t};uS.featureloader.xhr=os;uS.format.EsriJSON=Cd;uS.format.Feature=dd;uS.format.GML=$d;uS.format.GML2=i_;uS.format.GML3=Jd;uS.format.GML32=s_;uS.format.GPX=z_;uS.format.GeoJSON=Z_;uS.format.IGC=hg;uS.format.IIIFInfo=Hl;uS.format.KML=rv;uS.format.MVT=fv;uS.format.OSMXML=Tv;uS.format.Polyline=Iv;uS.format.Polyline.decodeDeltas=Ov;uS.format.Polyline.decodeFloats=Cv;uS.format.Polyline.encodeDeltas=xv;uS.format.Polyline.encodeFloats=Rv;uS.format.TopoJSON=jv;uS.format.WFS=rE;uS.format.WFS.writeFilter=function(t){var e=bs(jm,"Filter");return Hm(e,t,[]),e};uS.format.WKT=xE;uS.format.WMSCapabilities=QE;uS.format.WMSGetFeatureInfo=tT;uS.format.WMTSCapabilities=NT;uS.format.filter.Bbox=Vv;uS.format.filter.Contains=Hv;uS.format.filter.During=$v;uS.format.filter.EqualTo=nm;uS.format.filter.GreaterThan=om;uS.format.filter.GreaterThanOrEqualTo=sm;uS.format.filter.Intersects=lm;uS.format.filter.IsBetween=cm;uS.format.filter.IsLike=fm;uS.format.filter.IsNull=_m;uS.format.filter.LessThan=ym;uS.format.filter.LessThanOrEqualTo=mm;uS.format.filter.Not=Tm;uS.format.filter.NotEqualTo=wm;uS.format.filter.Or=Om;uS.format.filter.Within=Cm;uS.format.filter.and=Pm;uS.format.filter.bbox=Im;uS.format.filter.between=function(t,e,r){return new cm(t,e,r)};uS.format.filter.contains=function(t,e,r){return new Hv(t,e,r)};uS.format.filter.during=function(t,e,r){return new $v(t,e,r)};uS.format.filter.equalTo=function(t,e,r){return new nm(t,e,r)};uS.format.filter.greaterThan=function(t,e){return new om(t,e)};uS.format.filter.greaterThanOrEqualTo=function(t,e){return new sm(t,e)};uS.format.filter.intersects=function(t,e,r){return new lm(t,e,r)};uS.format.filter.isNull=function(t){return new _m(t)};uS.format.filter.lessThan=function(t,e){return new ym(t,e)};uS.format.filter.lessThanOrEqualTo=function(t,e){return new mm(t,e)};uS.format.filter.like=function(t,e,r,n,i,o){return new fm(t,e,r,n,i,o)};uS.format.filter.not=function(t){return new Tm(t)};uS.format.filter.notEqualTo=function(t,e,r){return new wm(t,e,r)};uS.format.filter.or=function(){var e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(Om,e))};uS.format.filter.within=function(t,e,r){return new Cm(t,e,r)};uS.geom.Circle=gf;uS.geom.Geometry=tr;uS.geom.GeometryCollection=fd;uS.geom.LineString=Vp;uS.geom.LinearRing=wr;uS.geom.MultiLineString=vf;uS.geom.MultiPoint=Ef;uS.geom.MultiPolygon=wf;uS.geom.Point=Or;uS.geom.Polygon=Br;uS.geom.Polygon.circular=Yr;uS.geom.Polygon.fromCircle=Xr;uS.geom.Polygon.fromExtent=zr;uS.geom.SimpleGeometry=nr;uS.has.DEVICE_PIXEL_RATIO=an;uS.interaction.DoubleClickZoom=no;uS.interaction.DragAndDrop=cf;uS.interaction.DragBox=Mo;uS.interaction.DragPan=So;uS.interaction.DragRotate=xo;uS.interaction.DragRotateAndZoom=ff;uS.interaction.DragZoom=No;uS.interaction.Draw=If;uS.interaction.Draw.createBox=function(){return function(t,e){var r=$(t),n=[[Et(r),Tt(r),Pt(r),Ct(r),Et(r)]],i=e;return i?i.setCoordinates(n):i=new Br(n),i}};uS.interaction.Draw.createRegularPolygon=function(t,e){return function(r,n){var i=r[0],o=r[1],a=Math.sqrt(qn(i,o)),s=n||Xr(new gf(i),t),u=e;if(!e){var l=o[0]-i[0],h=o[1]-i[1];u=Math.atan(h/l)-(l<0?Math.PI:0)}return Vr(s,i,a,u),s}};uS.interaction.Extent=Gf;uS.interaction.Interaction=to;uS.interaction.KeyboardPan=ko;uS.interaction.KeyboardZoom=Yo;uS.interaction.Modify=Hf;uS.interaction.MouseWheelZoom=Wo;uS.interaction.PinchRotate=Ko;uS.interaction.PinchZoom=qo;uS.interaction.Pointer=mo;uS.interaction.Select=td;uS.interaction.Snap=id;uS.interaction.Translate=hd;uS.interaction.defaults=Jo;uS.layer.Base=yi;uS.layer.BaseImage=Mh;uS.layer.BaseTile=Xh;uS.layer.BaseVector=Xc;uS.layer.Graticule=qp;uS.layer.Group=Ti;uS.layer.Heatmap=tf;uS.layer.Image=Uh;uS.layer.Layer=Bi;uS.layer.Tile=Hh;uS.layer.Vector=Bp;uS.layer.VectorImage=rf;uS.layer.VectorTile=of;uS.loadingstrategy.all=as;uS.loadingstrategy.bbox=ss;uS.loadingstrategy.tile=function(t){return function(e,r){var n=t.getZForResolution(r),i=t.getTileRangeForExtentAndZ(e,n),o=[],a=[n,0,0];for(a[1]=i.minX;a[1]<=i.maxX;++a[1])for(a[2]=i.minY;a[2]<=i.maxY;++a[2])o.push(t.getTileCoordExtent(a));return o}};uS.proj.Projection=ee;uS.proj.Units.METERS_PER_UNIT=$t;uS.proj.addCoordinateTransforms=Pe;uS.proj.addEquivalentProjections=Oe;uS.proj.addProjection=Se;uS.proj.equivalent=Ie;uS.proj.fromLonLat=function(t,e){return Me(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")};uS.proj.get=we;uS.proj.getPointResolution=xe;uS.proj.getTransform=Le;uS.proj.proj4.register=function(t){for(var r,n=Object.keys(t.defs),i=n.length,e=0;e<i;++e){var o=n[e];if(!we(o)){var a=t.defs(o);Se(new ee({code:o,axisOrientation:a.axis,metersPerUnit:a.to_meter,units:a.units}))}}for(e=0;e<i;++e){var s=n[e],u=we(s);for(r=0;r<i;++r){var l=n[r],h=we(l);if(!ve(s,l))if(t.defs[s]===t.defs[l])Oe([u,h]);else{var c=t(s,l);Pe(u,h,c.forward,c.inverse)}}}};uS.proj.toLonLat=function(t,e){var r=Me(t,void 0!==e?e:"EPSG:3857","EPSG:4326"),n=r[0];return(n<-180||n>180)&&(r[0]=Vt(n+180,360)-180),r};uS.proj.transform=Me;uS.proj.transformExtent=Fe;uS.render.VectorContext=fa;uS.render.canvas.labelCache=Ea;uS.render.getRenderPixel=function(t,e){var r=e.slice(0);return Ze(t.inversePixelTransform.slice(),r),r};uS.render.getVectorContext=function(t){var e,r=t.frameState,n=Ve(t.inversePixelTransform.slice(),r.coordinateToPixelTransform),i=Ba(r.viewState.resolution,r.pixelRatio),o=je();return o&&(e=be(o,r.viewState.projection)),new Na(t.context,r.pixelRatio,r.extent,n,r.viewState.rotation,i,e)};uS.render.toContext=function(t,e){var r=t.canvas,n=e||{},i=n.pixelRatio||an,o=n.size;o&&(r.width=o[0]*i,r.height=o[1]*i,r.style.width=o[0]+"px",r.style.height=o[1]+"px");var a=[0,0,r.width,r.height],s=Ke([1,0,0,1,0,0],i,i);return new Na(t,i,a,s,0)};uS.renderer.Composite=Ha;uS.renderer.canvas.ImageLayer=jh;uS.renderer.canvas.TileLayer=Zh;uS.renderer.canvas.VectorImageLayer=Ap;uS.renderer.canvas.VectorLayer=Mp;uS.renderer.canvas.VectorTileLayer=kp;uS.renderer.webgl.PointsLayer=Wc;uS.size.toSize=xi;uS.source.BingMaps=Ol;uS.source.CartoDB=Il;uS.source.Cluster=jl;uS.source.IIIF=Ql;uS.source.Image=sh;uS.source.ImageArcGISRest=hh;uS.source.ImageCanvas=dh;uS.source.ImageMapGuide=gh;uS.source.ImageStatic=vh;uS.source.ImageWMS=Rh;uS.source.OSM=Ih;uS.source.OSM.ATTRIBUTION=Ph;uS.source.Raster=oc;uS.source.Source=cl;uS.source.Stamen=hc;uS.source.Tile=_l;uS.source.TileArcGISRest=fc;uS.source.TileDebug=gc;uS.source.TileImage=wl;uS.source.TileJSON=vc;uS.source.TileWMS=Tc;uS.source.UTFGrid=xc;uS.source.Vector=Dl;uS.source.VectorTile=bc;uS.source.WMTS=Ac;uS.source.WMTS.optionsFromCapabilities=function(t,e){var r=O(t.Contents.Layer,function(t){return t.Identifier==e.layer});if(null===r)return null;var n,i=t.Contents.TileMatrixSet;(n=r.TileMatrixSetLink.length>1?C(r.TileMatrixSetLink,"projection"in e?function(t){var o=O(i,function(e){return e.Identifier==t.TileMatrixSet}).SupportedCRS,a=we(o.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||we(o),s=we(e.projection);return a&&s?Ie(a,s):o==e.projection}:function(t){return t.TileMatrixSet==e.matrixSet}):0)<0&&(n=0);var o=r.TileMatrixSetLink[n].TileMatrixSet,a=r.TileMatrixSetLink[n].TileMatrixSetLimits,s=r.Format[0];"format"in e&&(s=e.format);(n=C(r.Style,function(t){return"style"in e?t.Title==e.style:t.isDefault}))<0&&(n=0);var u=r.Style[n].Identifier,l={};"Dimension"in r&&r.Dimension.forEach(function(t){var n=t.Identifier,i=t.Default;void 0===i&&(i=t.Value[0]);l[n]=i});var h,c=O(t.Contents.TileMatrixSet,function(t){return t.Identifier==o}),p=c.SupportedCRS;if(p&&(h=we(p.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||we(p)),"projection"in e){var f=we(e.projection);f&&(h&&!Ie(f,h)||(h=f))}var d,_,g=r.WGS84BoundingBox;if(void 0!==g){var y=we("EPSG:4326").getExtent();_=g[0]==y[0]&&g[2]==y[2];d=Fe(g,"EPSG:4326",h);var v=h.getExtent();v&&(it(v,d)||(d=void 0))}var m=du(c,d,a),E=[],S=e.requestEncoding;if(S=void 0!==S?S:"","OperationsMetadata"in t&&"GetTile"in t.OperationsMetadata)for(var w=t.OperationsMetadata.GetTile.DCP.HTTP.Get,x=0,R=w.length;x<R;++x)if(w[x].Constraint){var P=O(w[x].Constraint,function(t){return"GetEncoding"==t.name}).AllowedValues.Value;if(""===S&&(S=P[0]),S!==Mc.KVP)break;T(P,Mc.KVP)&&E.push(w[x].href)}else w[x].href&&(S=Mc.KVP,E.push(w[x].href));return 0===E.length&&(S=Mc.REST,r.ResourceURL.forEach(function(t){"tile"===t.resourceType&&(s=t.format,E.push(t.template))})),{urls:E,layer:e.layer,matrixSet:o,format:s,projection:h,requestEncoding:S,tileGrid:m,style:u,dimensions:l,wrapX:_,crossOrigin:e.crossOrigin}};uS.source.XYZ=Cl;uS.source.Zoomify=Yl;uS.sphere.getArea=function t(e,r){var n=r||{},i=n.radius||Zt,o=n.projection||"EPSG:3857",a=e.getType();a!==Nt.GEOMETRY_COLLECTION&&(e=e.clone().transform(o,"EPSG:4326"));var s,u,l,h,c,p,f=0;switch(a){case Nt.POINT:case Nt.MULTI_POINT:case Nt.LINE_STRING:case Nt.MULTI_LINE_STRING:case Nt.LINEAR_RING:break;case Nt.POLYGON:for(s=e.getCoordinates(),f=Math.abs(qt(s[0],i)),l=1,h=s.length;l<h;++l)f-=Math.abs(qt(s[l],i));break;case Nt.MULTI_POLYGON:for(l=0,h=(s=e.getCoordinates()).length;l<h;++l)for(u=s[l],f+=Math.abs(qt(u[0],i)),c=1,p=u.length;c<p;++c)f-=Math.abs(qt(u[c],i));break;case Nt.GEOMETRY_COLLECTION:var d=e.getGeometries();for(l=0,h=d.length;l<h;++l)f+=t(d[l],r);break;default:throw new Error("Unsupported geometry type: "+a);}return f};uS.sphere.getDistance=Kt;uS.sphere.getLength=function t(e,r){var n=r||{},i=n.radius||Zt,o=n.projection||"EPSG:3857",a=e.getType();a!==Nt.GEOMETRY_COLLECTION&&(e=e.clone().transform(o,"EPSG:4326"));var s,u,l,h,c,p,f=0;switch(a){case Nt.POINT:case Nt.MULTI_POINT:break;case Nt.LINE_STRING:case Nt.LINEAR_RING:f=Ht(s=e.getCoordinates(),i);break;case Nt.MULTI_LINE_STRING:case Nt.POLYGON:for(l=0,h=(s=e.getCoordinates()).length;l<h;++l)f+=Ht(s[l],i);break;case Nt.MULTI_POLYGON:for(l=0,h=(s=e.getCoordinates()).length;l<h;++l)for(c=0,p=(u=s[l]).length;c<p;++c)f+=Ht(u[c],i);break;case Nt.GEOMETRY_COLLECTION:var d=e.getGeometries();for(l=0,h=d.length;l<h;++l)f+=t(d[l],r);break;default:throw new Error("Unsupported geometry type: "+a);}return f};uS.style.Circle=mu;uS.style.Fill=Eu;uS.style.Icon=Lu;uS.style.IconImageCache.shared=ha;uS.style.Image=_u;uS.style.RegularShape=yu;uS.style.Stroke=Mu;uS.style.Style=ju;uS.style.Text=Bu;uS.tilegrid.TileGrid=gs;uS.tilegrid.WMTS=fu;uS.tilegrid.WMTS.createFromCapabilitiesMatrixSet=du;uS.tilegrid.createXYZ=vs;uS.util.getUid=o;uS.webgl.ARRAY_BUFFER=ws;uS.webgl.Buffer=Js;uS.webgl.DYNAMIC_DRAW=Os;uS.webgl.ELEMENT_ARRAY_BUFFER=xs;uS.webgl.Helper=uu;uS.webgl.Helper.computeAttributesStride=au;uS.webgl.PostProcessingPass=ru;uS.webgl.RenderTarget=hu;uS.webgl.STATIC_DRAW=35044;uS.webgl.STREAM_DRAW=35040;uS.xml.getAllTextContent=Ls;uS.xml.parse=Fs;e.default=uS}]).default});ol.control.ScaleIndicator=function(opt_options){var options=opt_options?opt_options:{};typeof options.dpi=="undefined"&&(options.dpi=72);var elmRoot=document.createElement("DIV");elmRoot.className=options.className!==undefined?options.className:"ol-scale-indicator";var render=options.render?options.render:ol.control.ScaleIndicator.render;ol.control.Control.call(this,{element:elmRoot,render:render,target:options.target});this.dpi=options.dpi;this.undefinedHTML_=options.undefinedHTML!==undefined?options.undefinedHTML:"";this.renderedHTML_=elmRoot.innerHTML};ol.control.ScaleIndicator.prototype=Object.create(ol.control.Control.prototype);ol.control.ScaleIndicator.prototype.constructor=ol.control.ScaleIndicator;ol.control.ScaleIndicator.render=function(){this.updateHTML_()};ol.control.ScaleIndicator.prototype.setMap=function(map){ol.control.Control.prototype.setMap.call(this,map)};ol.control.ScaleIndicator.prototype.getScale=function(){var scale=0,map=ol.control.Control.prototype.getMap.call(this);if(map){var dpi=this.dpi,res=map.getView().getResolution();scale=res*ol.proj.Units.METERS_PER_UNIT.m*39.37*dpi;scale=Math.round(scale)}return scale};ol.control.ScaleIndicator.prototype.updateHTML_=function(){var html=this.undefinedHTML_,map=ol.control.Control.prototype.getMap.call(this),inchPerMeter=39.37,scale,dpi=this.dpi;if(map){var res=map.getView().getResolution();scale=res*ol.proj.Units.METERS_PER_UNIT.m*inchPerMeter*dpi;scale=Math.round(scale,0);html='<label for="inpResolution">1&nbsp;:<\/label>&nbsp;<input id="inpResolution" pattern="[0-9]" type="text" class="form-control input-xs" style="width: 60px;" />'}if(this.renderedHTML_&&html===this.renderedHTML_||(this.element.innerHTML=html,this.renderedHTML_=html),scale){var input=document.getElementById("inpResolution");if(input){var bUpdating=!0;input.value=scale;bUpdating=!1;input.onkeydown||(input.onkeydown=function(event){try{var charCode=event.which?event.which:event.keyCode;if(charCode===13){if(map){var view=map.getView();if(view.getAnimating()||bUpdating)return!1;var dScale=parseFloat(input.value),dResolution=dScale/(ol.proj.Units.METERS_PER_UNIT.m*inchPerMeter*dpi);dResolution>view.getMinResolution()&&dResolution<view.getMaxResolution()&&view.animate({resolution:dResolution,duration:250,easing:ol.easing.easeOut})}event.preventDefault()}else if(charCode>31&&(charCode<48||charCode>57)&&(e.keyCode<96||e.keyCode>105)&&charCode!==37&&charCode!==39&&charCode!==46)return!1}catch(ex){}return!0})}}},function(){for(var lastTime=0,vendors=["ms","moz","webkit","o"],x=0;x<vendors.length&&!window.requestAnimationFrame;++x)window.requestAnimationFrame=window[vendors[x]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[vendors[x]+"CancelAnimationFrame"]||window[vendors[x]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(callback){var currTime=(new Date).getTime(),timeToCall=Math.max(0,16-(currTime-lastTime)),id=window.setTimeout(function(){callback(currTime+timeToCall)},timeToCall);return lastTime=currTime+timeToCall,id});window.cancelAnimationFrame||(window.cancelAnimationFrame=function(id){clearTimeout(id)})}();window.ol&&!ol.ext&&(ol.ext={});ol.ext.inherits=function(t,e){t.prototype=Object.create(e.prototype);t.prototype.constructor=t};window.ol&&(ol.inherits||(ol.inherits=ol.ext.inherits));window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach);window.Element&&!Element.prototype.remove&&(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)});ol.ext.Ajax=function(t){t=t||{};ol.Object.call(this);this._auth=t.auth;this.set("dataType",t.dataType||"JSON")};ol.ext.inherits(ol.ext.Ajax,ol.Object);ol.ext.Ajax.get=function(t){var e=new ol.ext.Ajax(t);t.success&&e.on("success",function(e){t.success(e.response,e)});t.error&&e.on("error",function(e){t.error(e)});e.send(t.url,t.data,t.options)};ol.ext.Ajax.prototype.send=function(t,e,o){var i=this,r=!1!==(o=o||{}).encode;r&&(t=encodeURI(t));var n="";for(var s in e)e.hasOwnProperty(s)&&void 0!==e[s]&&(n+=(n?"&":"?")+s+"="+(r?encodeURIComponent(e[s]):e[s]));this._request&&!1!==o.abort&&this._request.abort();var a=this._request=new XMLHttpRequest;a.open("GET",t+n,!0);this._auth&&a.setRequestHeader("Authorization","Basic "+this._auth);this.dispatchEvent({type:"loadstart"});a.onload=function(){if(i._request=null,i.dispatchEvent({type:"loadend"}),this.status>=200&&this.status<400){var t;try{switch(i.get("dataType")){case"JSON":t=JSON.parse(this.response);break;default:t=this.response}}catch(t){return void i.dispatchEvent({type:"error",status:0,statusText:"parsererror",error:t,options:o,jqXHR:this})}i.dispatchEvent({type:"success",response:t,status:this.status,statusText:this.statusText,options:o,jqXHR:this})}else i.dispatchEvent({type:"error",status:this.status,statusText:this.statusText,options:o,jqXHR:this})};a.onerror=function(){i._request=null;i.dispatchEvent({type:"loadend"});i.dispatchEvent({type:"error",status:this.status,statusText:this.statusText,options:o,jqXHR:this})};a.send()};ol.ext.element={};ol.ext.element.create=function(t,e){var o;if(e=e||{},"TEXT"===t)o=document.createTextNode(e.html||""),e.parent&&e.parent.appendChild(o);else for(var i in o=document.createElement(t),/button/i.test(t)&&o.setAttribute("type","button"),e)switch(i){case"className":e.className&&e.className.trim&&o.setAttribute("class",e.className.trim());break;case"html":e.html instanceof Element?o.appendChild(e.html):void 0!==e.html&&(o.innerHTML=e.html);break;case"parent":e.parent.appendChild(o);break;case"style":this.setStyle(o,e.style);break;case"change":case"click":ol.ext.element.addListener(o,i,e[i]);break;case"on":for(var r in e.on)ol.ext.element.addListener(o,r,e.on[r]);break;case"checked":o.checked=!!e.checked;break;default:o.setAttribute(i,e[i])}return o};ol.ext.element.setHTML=function(t,e){e instanceof Element?t.appendChild(e):void 0!==e&&(t.innerHTML=e)};ol.ext.element.appendText=function(t,e){t.appendChild(document.createTextNode(e||""))};ol.ext.element.addListener=function(t,e,o){"string"==typeof e&&(e=e.split(" "));e.forEach(function(e){t.addEventListener(e,o)})};ol.ext.element.removeListener=function(t,e,o){"string"==typeof e&&(e=e.split(" "));e.forEach(function(e){t.removeEventListener(e,o)})};ol.ext.element.show=function(t){t.style.display=""};ol.ext.element.hide=function(t){t.style.display="none"};ol.ext.element.hidden=function(t){return"none"===ol.ext.element.getStyle(t,"display")};ol.ext.element.toggle=function(t){t.style.display="none"===t.style.display?"":"none"};ol.ext.element.setStyle=function(t,e){for(var o in e)switch(o){case"top":case"left":case"bottom":case"right":case"minWidth":case"maxWidth":case"width":case"height":t.style[o]="number"==typeof e[o]?e[o]+"px":e[o];break;default:t.style[o]=e[o]}};ol.ext.element.getStyle=function(t,e){var o,i=(t.ownerDocument||document).defaultView;if(i&&i.getComputedStyle)e=e.replace(/([A-Z])/g,"-$1").toLowerCase(),o=i.getComputedStyle(t,null).getPropertyValue(e);else if(t.currentStyle&&(e=e.replace(/-(\w)/g,function(t,e){return e.toUpperCase()}),o=t.currentStyle[e],/^\d+(em|pt|%|ex)?$/i.test(o)))return function(e){var o=t.style.left,i=t.runtimeStyle.left;return t.runtimeStyle.left=t.currentStyle.left,t.style.left=e||0,e=t.style.pixelLeft+"px",t.style.left=o,t.runtimeStyle.left=i,e}(o);return/px$/.test(o)?parseInt(o):o};ol.ext.element.outerHeight=function(t){return t.offsetHeight+ol.ext.element.getStyle(t,"marginBottom")};ol.ext.element.outerWidth=function(t){return t.offsetWidth+ol.ext.element.getStyle(t,"marginLeft")};ol.ext.element.offsetRect=function(t){var e=t.getBoundingClientRect();return{top:e.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),left:e.left+(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0),height:e.height||e.bottom-e.top,width:e.widtth||e.right-e.left}};ol.ext.element.scrollDiv=function(t,e){var o,i=!1,r=0,n=0,s="function"==typeof e.onmove?e.onmove:function(){},a=e.vertical?"pageY":"pageX",l=e.vertical?"scrollTop":"scrollLeft",c=!1;t.querySelectorAll("img").forEach(function(t){t.ondragstart=function(){return!1}});ol.ext.element.addListener(t,["mousedown"],function(e){c=!1;i=e[a];n=new Date;t.classList.add("ol-move")});ol.ext.element.addListener(window,["mousemove"],function(e){if(c=!0,!1!==i){var h=i-e[a];t[l]+=h;(o=new Date)-n&&(r=(r+h/(o-n))/2);i=e[a];n=o;h&&s(!0)}else s(!1)});ol.ext.element.addListener(window,["mouseup"],function(e){c?setTimeout(function(){t.classList.remove("ol-move")}):t.classList.remove("ol-move");c=!1;(n=new Date-n)>100?r=0:n>0&&(r=((r||0)+(i-e[a])/n)/2);t[l]+=100*r;i=!1;r=0;n=0});e.mousewheel&&!t.classList.contains("ol-touch")&&ol.ext.element.addListener(t,["mousewheel","DOMMouseScroll","onmousewheel"],function(e){var o=Math.max(-1,Math.min(1,e.wheelDelta||-e.detail));return t.classList.add("ol-move"),t[l]-=30*o,t.classList.remove("ol-move"),!1})};ol.ext.element.dispatchEvent=function(t,e){var o;try{o=new CustomEvent(t)}catch(e){(o=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,{})}e.dispatchEvent(o)};ol.ext.getMapCanvas=function(t){if(!t)return null;var e=t.getViewport().getElementsByClassName("ol-fixedoverlay")[0];return e||(t.getViewport().querySelector(".ol-layers")?((e=document.createElement("canvas")).className="ol-fixedoverlay",t.getViewport().querySelector(".ol-layers").after(e),t.on("precompose",function(o){e.width=t.getSize()[0]*o.frameState.pixelRatio;e.height=t.getSize()[1]*o.frameState.pixelRatio})):e=t.getViewport().querySelector("canvas")),e};window.ol&&!ol.sphere&&(ol.sphere={},ol.sphere.getDistance=function(t,e,o){return new ol.Sphere(o||6371008.8).haversineDistance(t,e)},ol.sphere.getArea=ol.Sphere.getArea,ol.sphere.getLength=ol.Sphere.getLength);ol.control.CanvasBase=function(t){t||(t={});this.setStyle(t.style);ol.control.Control.call(this,t)};ol.ext.inherits(ol.control.CanvasBase,ol.control.Control);ol.control.CanvasBase.prototype.setMap=function(t){this.getCanvas(t);var e=this.getMap();this._listener&&(ol.Observable.unByKey(this._listener),this._listener=null);ol.control.Control.prototype.setMap.call(this,t);e&&e.renderSync();t&&(this._listener=t.on("postcompose",this._draw.bind(this)))};ol.control.CanvasBase.prototype.getCanvas=function(t){return ol.ext.getMapCanvas(t)};ol.control.CanvasBase.prototype.getContext=function(t){var e=t.context;if(!e&&this.getMap()){var o=this.getMap().getViewport().getElementsByClassName("ol-fixedoverlay")[0];e=o?o.getContext("2d"):null}return e};ol.control.CanvasBase.prototype.setStyle=function(t){this._style=t||new ol.style.Style({})};ol.control.CanvasBase.prototype.getStyle=function(){return this._style};ol.control.CanvasBase.prototype.getStroke=function(){return this._style.getStroke()||this._style.setStroke(new ol.style.Stroke({color:"#000",width:1.25})),this._style.getStroke()};ol.control.CanvasBase.prototype.getFill=function(){return this._style.getFill()||this._style.setFill(new ol.style.Fill({color:"#fff"})),this._style.getFill()};ol.control.CanvasBase.prototype.getTextStroke=function(){var t=this._style.getText();return t||(t=new ol.style.Text({})),t.getStroke()||t.setStroke(new ol.style.Stroke({color:"#fff",width:3})),t.getStroke()};ol.control.CanvasBase.prototype.getTextFill=function(){var t=this._style.getText();return t||(t=new ol.style.Text({})),t.getFill()||t.setFill(new ol.style.Fill({color:"#fff",width:3})),t.getFill()};ol.control.CanvasBase.prototype.getTextFont=function(){var t=this._style.getText();return t||(t=new ol.style.Text({})),t.getFont()||t.setFont("12px sans-serif"),t.getFont()};ol.control.CanvasBase.prototype._draw=function(){console.warn("[CanvasBase] draw function not implemented.")};ol.control.SelectBase=function(t){var e;t||(t={});this._features=this.setFeatures(t.features);t.target?e=document.createElement("div"):((e=document.createElement("div")).className="ol-select ol-unselectable ol-control ol-collapsed",ol.ext.element.create("BUTTON",{type:"button",on:{"click touchstart":function(t){e.classList.toggle("ol-collapsed");t.preventDefault()}},parent:e}));t.className&&e.classList.add(t.className);e.appendChild(t.content);ol.ext.element.create("BUTTON",{html:t.btInfo||"OK",className:"ol-ok",on:{"click touchstart":this.doSelect.bind(this)},parent:t.content});ol.control.Control.call(this,{element:e,target:t.target});this.setSources(t.source)};ol.ext.inherits(ol.control.SelectBase,ol.control.Control);ol.control.SelectBase.prototype.setSources=function(t){t?this.set("source",t instanceof Array?t:[t]):this.unset("source")};ol.control.SelectBase.prototype.setFeatures=function(t){this._features=t instanceof ol.Collection?t:null};ol.control.SelectBase.prototype.getFeatures=function(){return this._features};ol.control.SelectBase.prototype.operationsList={"=":"=","!=":"≠","<":"<","<=":"≤",">=":"≥",">":">",contain:"⊂","!contain":"⊄",regexp:"≈"};ol.control.SelectBase.prototype._escape=function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")};ol.control.SelectBase.prototype._checkCondition=function(t,e,o){if(!e.attr)return!0;var i=t.get(e.attr);switch(e.op){case"=":return new RegExp("^"+this._escape(e.val)+"$",o?"":"i").test(i);case"!=":return!new RegExp("^"+this._escape(e.val)+"$",o?"":"i").test(i);case"<":return i<e.val;case"<=":return i<=e.val;case">":return i>e.val;case">=":return i>=e.val;case"contain":return new RegExp(this._escape(e.val),o?"":"i").test(i);case"!contain":return!new RegExp(this._escape(e.val),o?"":"i").test(i);case"regexp":return new RegExp(e.val,o?"":"i").test(i);default:return!1}};ol.control.SelectBase.prototype._selectFeatures=function(t,e,o,i,r){var n;o=o||[];for(var s=e.length-1;n=e[s];s--){for(var a,l=i,c=0;a=o[c];c++)a.attr&&(l=i?l&&this._checkCondition(n,a,r):l||this._checkCondition(n,a,r));l?t.push(n):this._features&&this._features.removeAt(s)}return t};ol.control.SelectBase.prototype.getSources=function(){if(this.get("source"))return this.get("source");var t=[];return this.getMap()&&function e(o){o.forEach(function(o){o.getLayers?e(o.getLayers()):o.getSource&&o.getSource()instanceof ol.source.Vector&&t.push(o.getSource())})}(this.getMap().getLayers()),t};ol.control.SelectBase.prototype.doSelect=function(t){var e=[];return(t=t||{}).features?this._selectFeatures(e,t.features,t.conditions,t.matchAll,t.useCase):this._features?this._selectFeatures(e,this._features.getArray(),t.conditions,t.matchAll,t.useCase):(t.sources||this.getSources()).forEach(function(o){this._selectFeatures(e,o.getFeatures(),t.conditions,t.matchAll,t.useCase)}.bind(this)),this.dispatchEvent({type:"select",features:e}),e};ol.control.Search=function(t){var e=this;t||(t={});null==t.typing&&(t.typing=300);this._classname=t.className||"search";var o=(t.className||"")+" ol-search"+(t.target?"":" ol-unselectable ol-control ol-collapsed"),i=ol.ext.element.create("DIV",{className:o+" ol-collapsed"});if(t.target||(this.button=document.createElement("BUTTON"),this.button.setAttribute("type","button"),this.button.setAttribute("title",t.label||"search"),this.button.addEventListener("click",function(){if(i.classList.toggle("ol-collapsed"),!i.classList.contains("ol-collapsed")){i.querySelector("input.search").focus();for(var t=i.querySelectorAll("li"),o=0;o<t.length;o++)t[o].classList.remove("select");a.value||e.drawList_()}}),i.appendChild(this.button)),t.inputLabel){var r=document.createElement("LABEL");r.innerText=t.inputLabel;i.appendChild(r)}var n,s="",a=this._input=document.createElement("INPUT");a.setAttribute("type","search");a.setAttribute("class","search");a.setAttribute("autocomplete","off");a.setAttribute("placeholder",t.placeholder||"Search...");a.addEventListener("change",function(t){e.dispatchEvent({type:"change:input",input:t,value:a.value})});var l=function(o){var r=i.querySelector("ul.autocomplete li.select"),l=a.value;"ArrowDown"==o.key||"ArrowUp"==o.key||"Down"==o.key||"Up"==o.key?r?(r.classList.remove("select"),(r=/Down/.test(o.key)?r.nextElementSibling:r.previousElementSibling)&&r.classList.add("select")):i.querySelector("ul.autocomplete li").classList.add("select"):"input"!=o.type||l?!r||"search"!=o.type&&"Enter"!=o.key?"search"==o.type||"Enter"==o.key||s!=l&&t.typing>=0?(s=l)?(n&&clearTimeout(n),n=setTimeout(function(){if(s.length>=e.get("minLength")){var t=e.autocomplete(s,function(t){e.drawList_(t)});t&&e.drawList_(t)}else e.drawList_()},t.typing)):e.drawList_():(r=i.querySelector("ul.autocomplete li"))&&r.classList.remove("select"):(i.classList.contains("ol-control")&&a.blur(),r.classList.remove("select"),s=l,e._handleSelect(e._list[r.getAttribute("data-search")])):setTimeout(function(){e.drawList_()},200)};if(a.addEventListener("keyup",l),a.addEventListener("search",l),a.addEventListener("cut",l),a.addEventListener("paste",l),a.addEventListener("input",l),t.noCollapse||(a.addEventListener("blur",function(){setTimeout(function(){a!==document.activeElement&&(i.classList.add("ol-collapsed"),this.set("reverse",!1),i.classList.remove("ol-revers"))}.bind(this),200)}.bind(this)),a.addEventListener("focus",function(){this.get("reverse")||(i.classList.remove("ol-collapsed"),i.classList.remove("ol-revers"))}.bind(this))),i.appendChild(a),t.reverse){var c=ol.ext.element.create("BUTTON",{tyoe:"button","class":"ol-revers",title:"click on the map",click:function(){this.get("reverse")?this.set("reverse",!1):(this.set("reverse",!this.get("reverse")),a.focus(),i.classList.add("ol-revers"))}.bind(this)});i.appendChild(c)}var h=document.createElement("UL");h.classList.add("autocomplete");i.appendChild(h);ol.control.Control.call(this,{element:i,target:t.target});"function"==typeof t.getTitle&&(this.getTitle=t.getTitle);"function"==typeof t.autocomplete&&(this.autocomplete=t.autocomplete);this.set("copy",t.copy);this.set("minLength",t.minLength||1);this.set("maxItems",t.maxItems||10);this.set("maxHistory",t.maxHistory||t.maxItems||10);this.restoreHistory();this.drawList_()};ol.ext.inherits(ol.control.Search,ol.control.Control);ol.control.Search.prototype.setMap=function(t){this._listener&&ol.Observable.unByKey(this._listener);this._listener=null;ol.control.Control.prototype.setMap.call(this,t);t&&(this._listener=t.on("click",this._handleClick.bind(this)))};ol.control.Search.prototype.getInputField=function(){return this._input};ol.control.Search.prototype.getTitle=function(t){return t.name||"No title"};ol.control.Search.prototype.search=function(){var t=this.element.querySelector("input.search");this._triggerCustomEvent("search",t)};ol.control.Search.prototype._handleClick=function(t){this.get("reverse")&&(document.activeElement.blur(),this.reverseGeocode(t.coordinate))};ol.control.Search.prototype.reverseGeocode=function(){};ol.control.Search.prototype._triggerCustomEvent=function(t,e){ol.ext.element.dispatchEvent(t,e)};ol.control.Search.prototype.setInput=function(t,e){var o=this.element.querySelector("input.search");o.value=t;e&&this._triggerCustomEvent("keyup",o)};ol.control.Search.prototype.select=function(t,e){this.dispatchEvent({type:"select",search:t,reverse:!!e})};ol.control.Search.prototype._handleSelect=function(t,e){if(t){var o,i=this.get("history");try{var r=JSON.stringify(t);for(o=i.length-1;o>=0;o--)i[o]&&JSON.stringify(i[o])!==r||i.splice(o,1)}catch(e){for(o=i.length-1;o>=0;o--)i[o]===t&&i.splice(o,1)}for(i.unshift(t);i.length>(this.get("maxHistory")||10);)i.pop();this.saveHistory();this.select(t,e)}};ol.control.Search.prototype._history={};ol.control.Search.prototype.saveHistory=function(){if(this.get("maxHistory")>=0)try{localStorage["ol@search-"+this._classname]=JSON.stringify(this.get("history"))}catch(t){}else localStorage.removeItem("ol@search-"+this._classname)};ol.control.Search.prototype.restoreHistory=function(){if(this._history[this._classname])this.set("history",this._history[this._classname]);else try{this._history[this._classname]=JSON.parse(localStorage["ol@search-"+this._classname]);this.set("history",this._history[this._classname])}catch(t){this.set("history",[])}};ol.control.Search.prototype.clearHistory=function(){this.set("history",[]);this.saveHistory();this.drawList_()};ol.control.Search.prototype.getHistory=function(){return this.get("history")};ol.control.Search.prototype.autocomplete=function(t,e){return e([]),!1};ol.control.Search.prototype.drawList_=function(t){var e=this,o=this.element.querySelector("ul.autocomplete");if(o.innerHTML="",this._list=[],t)o.setAttribute("class","autocomplete");else{if(this.element.querySelector("input.search").value)return;t=this.get("history");o.setAttribute("class","autocomplete history")}for(var i,r=Math.min(e.get("maxItems"),t.length),n=0;n<r;n++)if(t[n]&&(!n||!e.equalFeatures(t[n],t[n-1]))){(i=document.createElement("LI")).setAttribute("data-search",this._list.length);this._list.push(t[n]);i.addEventListener("click",function(t){e._handleSelect(e._list[t.currentTarget.getAttribute("data-search")])});var s=e.getTitle(t[n]);s instanceof Element?i.appendChild(s):i.innerHTML=s;o.appendChild(i)}r&&this.get("copy")&&((i=document.createElement("LI")).classList.add("copy"),i.innerHTML=this.get("copy"),o.appendChild(i))};ol.control.Search.prototype.equalFeatures=function(){return!1};ol.control.SearchJSON=function(t){(t=t||{}).className=t.className||"JSON";delete t.autocomplete;t.minLength=t.minLength||3;t.typing=t.typing||800;ol.control.Search.call(this,t);var e=t.url||"";if("https:"===window.location.protocol){var o=document.createElement("a");o.href=e;o.protocol=window.location.protocol;e=o.href}this.set("url",e);this._ajax=new ol.ext.Ajax({dataType:"JSON",auth:t.authentication});this._ajax.on("success",function(t){t.status>=200&&t.status<400?"function"==typeof this._callback&&this._callback(t.response):console.log("AJAX ERROR",arguments)}.bind(this));this._ajax.on("error",function(){console.log("AJAX ERROR",arguments)}.bind(this));this._ajax.on("loadstart",function(){this.element.classList.add("searching")}.bind(this));this._ajax.on("loadend",function(){this.element.classList.remove("searching")}.bind(this));"function"==typeof t.handleResponse&&(this.handleResponse=t.handleResponse)};ol.ext.inherits(ol.control.SearchJSON,ol.control.Search);ol.control.SearchJSON.prototype.ajax=function(t,e,o,i){i=i||{};this._callback=o;this._ajax.set("dataType",i.dataType||"JSON");this._ajax.send(t,e,i)};ol.control.SearchJSON.prototype.autocomplete=function(t,e){var o=this.requestData(t),i=encodeURI(this.get("url"));this.ajax(i,o,function(t){"function"==typeof e&&e(this.handleResponse(t))})};ol.control.SearchJSON.prototype.requestData=function(t){return{q:t}};ol.control.SearchJSON.prototype.handleResponse=function(t){return t};ol.control.SearchPhoton=function(t){(t=t||{}).className=t.className||"photon";t.url=t.url||"http://photon.komoot.de/api/";t.copy='<a href="http://www.openstreetmap.org/copyright" target="new">&copy; OpenStreetMap contributors<\/a>';ol.control.SearchJSON.call(this,t);this.set("lang",t.lang);this.set("position",t.position)};ol.ext.inherits(ol.control.SearchPhoton,ol.control.SearchJSON);ol.control.SearchPhoton.prototype.getTitle=function(t){var e=t.properties;return(e.housenumber||"")+" "+(e.street||e.name||"")+"<i> "+(e.postcode||"")+" "+(e.city||"")+" ("+e.country+")<\/i>"};ol.control.SearchPhoton.prototype.requestData=function(t){var e={q:t,lang:this.get("lang"),limit:this.get("maxItems")};if(this.get("position")){var o=this.getMap().getView(),i=new ol.geom.Point(o.getCenter());i=i.transform(o.getProjection(),"EPSG:4326").getCoordinates();e.lon=i[0];e.lat=i[1]}return e};ol.control.SearchPhoton.prototype.handleResponse=function(t){return t.features};ol.control.SearchPhoton.prototype.equalFeatures=function(t,e){return this.getTitle(t)===this.getTitle(e)&&t.geometry.coordinates[0]===e.geometry.coordinates[0]&&t.geometry.coordinates[1]===e.geometry.coordinates[1]};ol.control.SearchPhoton.prototype.select=function(t){var e=t.geometry.coordinates;try{e=ol.proj.transform(t.geometry.coordinates,"EPSG:4326",this.getMap().getView().getProjection())}catch(t){}this.dispatchEvent({type:"select",search:t,coordinate:e})};ol.control.SearchPhoton.prototype.reverseData=function(t){var e=ol.proj.transform(t,this.getMap().getView().getProjection(),"EPSG:4326");return{lon:e[0],lat:e[1]}};ol.control.SearchPhoton.prototype.reverseGeocode=function(t,e){this.ajax(this.get("url").replace("/api/","/reverse/").replace("/search/","/reverse/"),this.reverseData(t),function(t){t.features&&(t=t.features);t instanceof Array||(t=[t]);e?e.call(this,t):this._handleSelect(t[0],!0)}.bind(this))};ol.control.SearchGeoportail=function(t){(t=t||{}).className=t.className||"IGNF";t.typing=t.typing||500;t.url="https://wxs.ign.fr/"+t.apiKey+"/ols/apis/completion";t.copy='<a href="https://www.geoportail.gouv.fr/" target="new">&copy; IGN-Géoportail<\/a>';ol.control.SearchJSON.call(this,t);this.set("type",t.type||"StreetAddress,PositionOfInterest")};ol.ext.inherits(ol.control.SearchGeoportail,ol.control.SearchJSON);ol.control.SearchGeoportail.prototype.reverseGeocode=function(t,e){"Commune"===this.get("type")||this.get("type");var o=ol.proj.transform(t,this.getMap().getView().getProjection(),"EPSG:4326"),i='<?xml version="1.0" encoding="UTF-8"?><XLS xmlns:xls="http://www.opengis.net/xls" xmlns:gml="http://www.opengis.net/gml" xmlns="http://www.opengis.net/xls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="http://www.opengis.net/xls http://schemas.opengis.net/ols/1.2/olsAll.xsd"> <Request requestID="1" version="1.2" methodName="ReverseGeocodeRequest" maximumResponses="1" >  <ReverseGeocodeRequest>   <ReverseGeocodePreference>StreetAddress<\/ReverseGeocodePreference>   <Position>    <gml:Point><gml:pos>'+o[1]+" "+o[0]+"<\/gml:pos><\/gml:Point>   <\/Position>  <\/ReverseGeocodeRequest> <\/Request><\/XLS>";this.ajax(this.get("url").replace("ols/apis/completion","geoportail/ols"),{xls:i},function(t){if(t){var i=(t=t.replace(/\n|\r/g,"")).replace(/.*<gml:pos>(.*)<\/gml:pos>.*/,"$1").split(" "),r={};if(Number(i[1])||Number(i[0]))if(r.x=o[0],r.y=o[1],r.city=t.replace(/.*<Place type="Municipality">([^<]*)<\/Place>.*/,"$1"),r.insee=t.replace(/.*<Place type="INSEE">([^<]*)<\/Place>.*/,"$1"),r.zipcode=t.replace(/.*<PostalCode>([^<]*)<\/PostalCode>.*/,"$1"),/<Street>/.test(t)){r.kind="";r.country="StreetAddress";r.street=t.replace(/.*<Street>([^<]*)<\/Street>.*/,"$1");var n=t.replace(/.*<Building number="([^"]*).*/,"$1");r.fulltext=n+" "+r.street+", "+r.zipcode+" "+r.city}else r.kind=t.replace(/.*<Place type="Nature">([^<]*)<\/Place>.*/,"$1"),r.country="PositionOfInterest",r.street="",r.fulltext=r.zipcode+" "+r.city;else r={x:o[0],y:o[1],fulltext:String(o)};e?e.call(this,[r]):this._handleSelect(r,!0)}}.bind(this),{dataType:"XML"})};ol.control.SearchGeoportail.prototype.getTitle=function(t){return t.fulltext};ol.control.SearchGeoportail.prototype.requestData=function(t){return{text:t,type:"Commune"===this.get("type")?"PositionOfInterest":this.get("type")||"StreetAddress,PositionOfInterest",maximumResponses:this.get("maxItems")}};ol.control.SearchGeoportail.prototype.handleResponse=function(t){var e=t.results;if("Commune"===this.get("type"))for(var o=e.length-1;o>=0;o--)e[o].kind&&(e[o].classification>5||"Département"==e[o].kind)&&e.splice(o,1);return e};ol.control.SearchGeoportail.prototype.select=function(t){if(t.x||t.y){var e=[Number(t.x),Number(t.y)];try{e=ol.proj.transform(e,"EPSG:4326",this.getMap().getView().getProjection())}catch(t){}"Commune"===this.get("type")?this.searchCommune(t,function(){this.dispatchEvent({type:"select",search:t,coordinate:e})}):this.dispatchEvent({type:"select",search:t,coordinate:e})}else this.searchCommune(t)};ol.control.SearchGeoportail.prototype.searchCommune=function(t,e){var o='<?xml version="1.0" encoding="UTF-8"?><XLS xmlns:xls="http://www.opengis.net/xls" xmlns:gml="http://www.opengis.net/gml" xmlns="http://www.opengis.net/xls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="http://www.opengis.net/xls http://schemas.opengis.net/ols/1.2/olsAll.xsd"><RequestHeader/><Request requestID="1" version="1.2" methodName="LocationUtilityService"><GeocodeRequest returnFreeForm="false"><Address countryCode="PositionOfInterest"><freeFormAddress>'+t.zipcode+" "+t.city+"+<\/freeFormAddress><\/Address><\/GeocodeRequest><\/Request><\/XLS>";this.ajax(this.get("url").replace("ols/apis/completion","geoportail/ols"),{xls:o},function(o){if(o){var i=(new DOMParser).parseFromString(o,"text/xml").getElementsByTagName("GeocodedAddress")[0],r=i.getElementsByTagName("gml:Point")[0].textContent.trim().split(" ");t.x=Number(r[1]);t.y=Number(r[0]);for(var n=i.getElementsByTagName("Place"),s=0;s<n.length;s++)switch(n[s].attributes.type.value){case"Nature":t.kind=n[s].textContent;break;case"INSEE":t.insee=n[s].textContent}(t.x||t.y)&&(e?e.call(this,[t]):this._handleSelect(t))}}.bind(this),{dataType:"XML"})};ol.control.LayerSwitcher=function(t){t=t||{};var e,o=this;this.dcount=0;this.show_progress=t.show_progress;this.oninfo="function"==typeof t.oninfo?t.oninfo:null;this.onextent="function"==typeof t.onextent?t.onextent:null;this.hasextent=t.extent||t.onextent;this.hastrash=t.trash;this.reordering=!1!==t.reordering;this._layers=[];this._layerGroup=t.layerGroup&&t.layerGroup.getLayers?t.layerGroup:null;"function"==typeof t.displayInLayerSwitcher&&(this.displayInLayerSwitcher=t.displayInLayerSwitcher);t.target?e=ol.ext.element.create("DIV",{className:t.switcherClass||"ol-layerswitcher"}):(e=ol.ext.element.create("DIV",{className:(t.switcherClass||"ol-layerswitcher")+" ol-unselectable ol-control"}),!1!==t.collapsed?e.classList.add("ol-collapsed"):e.classList.add("ol-forceopen"),this.button=ol.ext.element.create("BUTTON",{type:"button",parent:e}),this.button.addEventListener("touchstart",function(t){e.classList.toggle("ol-collapsed");o.dispatchEvent({type:"toggle",collapsed:e.classList.contains("ol-collapsed")});t.preventDefault();o.overflow()}),this.button.addEventListener("click",function(){e.classList.toggle("ol-forceopen");e.classList.add("ol-collapsed");o.dispatchEvent({type:"toggle",collapsed:!e.classList.contains("ol-forceopen")});o.overflow()}),t.mouseover&&(e.addEventListener("mouseleave",function(){e.classList.add("ol-collapsed");o.dispatchEvent({type:"toggle",collapsed:!0})}),e.addEventListener("mouseover",function(){e.classList.remove("ol-collapsed");o.dispatchEvent({type:"toggle",collapsed:!1})})),this.topv=ol.ext.element.create("DIV",{className:"ol-switchertopdiv",parent:e,click:function(){o.overflow("+50%")}}),this.botv=ol.ext.element.create("DIV",{className:"ol-switcherbottomdiv",parent:e,click:function(){o.overflow("-50%")}}));this.panel_=ol.ext.element.create("UL",{className:"panel",parent:e});ol.ext.element.addListener(this.panel_,"mousewheel DOMMouseScroll onmousewheel",function(t){o.overflow(Math.max(-1,Math.min(1,t.wheelDelta||-t.detail)))&&(t.stopPropagation(),t.preventDefault())});this.header_=ol.ext.element.create("LI",{className:"ol-header",parent:this.panel_});ol.control.Control.call(this,{element:e,target:t.target});this.set("drawDelay",t.drawDelay||0)};ol.ext.inherits(ol.control.LayerSwitcher,ol.control.Control);ol.control.LayerSwitcher.prototype.tip={up:"up/down",down:"down",info:"informations...",extent:"zoom to extent",trash:"remove layer",plus:"expand/shrink"};ol.control.LayerSwitcher.prototype.displayInLayerSwitcher=function(t){return!1!==t.get("displayInLayerSwitcher")};ol.control.LayerSwitcher.prototype.setMap=function(t){ol.control.Control.prototype.setMap.call(this,t);this.drawPanel();this._listener&&(this._listener&&ol.Observable.unByKey(this._listener.change),this._listener&&ol.Observable.unByKey(this._listener.moveend),this._listener&&ol.Observable.unByKey(this._listener.size));this._listener=null;t&&(this._listener={moveend:t.on("moveend",this.viewChange.bind(this)),size:t.on("change:size",this.overflow.bind(this))},this._listener.change=this._layerGroup?this._layerGroup.on("change",this.drawPanel.bind(this)):t.getLayerGroup().on("change",this.drawPanel.bind(this)))};ol.control.LayerSwitcher.prototype.show=function(){this.element.classList.add("ol-forceopen");this.overflow()};ol.control.LayerSwitcher.prototype.hide=function(){this.element.classList.remove("ol-forceopen");this.overflow()};ol.control.LayerSwitcher.prototype.toggle=function(){this.element.classList.toggle("ol-forceopen");this.overflow()};ol.control.LayerSwitcher.prototype.isOpen=function(){return this.element.classList.contains("ol-forceopen")};ol.control.LayerSwitcher.prototype.setHeader=function(t){ol.ext.element.setHTML(this.header_,t)};ol.control.LayerSwitcher.prototype.overflow=function(t){if(this.button){if(ol.ext.element.hidden(this.panel_))return void ol.ext.element.setStyle(this.element,{height:"auto"});var e=ol.ext.element.outerHeight(this.element),o=ol.ext.element.outerHeight(this.panel_),i=this.button.offsetTop+ol.ext.element.outerHeight(this.button),r=this.panel_.offsetTop-i;if(o>e-i){ol.ext.element.setStyle(this.element,{height:"100%"});var n=2*ol.ext.element.getStyle(this.panel_.querySelectorAll("li.visible .li-content")[0],"height");switch(t){case 1:r+=n;break;case-1:r-=n;break;case"+50%":r+=Math.round(e/2);break;case"-50%":r-=Math.round(e/2)}return r+o<=e-3*i/2?(r=e-3*i/2-o,ol.ext.element.hide(this.botv)):ol.ext.element.show(this.botv),r>=0?(r=0,ol.ext.element.hide(this.topv)):ol.ext.element.show(this.topv),ol.ext.element.setStyle(this.panel_,{top:r+"px"}),!0}return ol.ext.element.setStyle(this.element,{height:"auto"}),ol.ext.element.setStyle(this.panel_,{top:0}),ol.ext.element.hide(this.botv),ol.ext.element.hide(this.topv),!1}return!1};ol.control.LayerSwitcher.prototype._setLayerForLI=function(t,e){this._layers.push({li:t,layer:e})};ol.control.LayerSwitcher.prototype._getLayerForLI=function(t){for(var e,o=0;e=this._layers[o];o++)if(e.li===t)return e.layer;return null};ol.control.LayerSwitcher.prototype.viewChange=function(){this.panel_.querySelectorAll("li").forEach(function(t){var e=this._getLayerForLI(t);e&&(this.testLayerVisibility(e)?t.classList.remove("ol-layer-hidden"):t.classList.add("ol-layer-hidden"))}.bind(this))};ol.control.LayerSwitcher.prototype.drawPanel=function(){if(this.getMap()){var t=this;this.dcount++;setTimeout(function(){t.drawPanel_()},this.get("drawDelay")||0)}};ol.control.LayerSwitcher.prototype.drawPanel_=function(){--this.dcount||this.dragging_||(this._layers=[],this.panel_.querySelectorAll("li").forEach(function(t){t.classList.contains("ol-header")||t.remove()}.bind(this)),this.drawList(this.panel_,this._layerGroup?this._layerGroup.getLayers():this.getMap().getLayers()))};ol.control.LayerSwitcher.prototype.switchLayerVisibility=function(t,e){t.get("baseLayer")?(t.getVisible()||t.setVisible(!0),e.forEach(function(e){t!==e&&e.get("baseLayer")&&e.getVisible()&&e.setVisible(!1)})):t.setVisible(!t.getVisible())};ol.control.LayerSwitcher.prototype.testLayerVisibility=function(t){if(!this.getMap())return!0;var e=this.getMap().getView().getResolution();if(t.getMaxResolution()<=e||t.getMinResolution()>=e)return!1;var o=t.getExtent();if(o){var i=this.getMap().getView().calculateExtent(this.getMap().getSize());return ol.extent.intersects(i,o)}return!0};ol.control.LayerSwitcher.prototype.dragOrdering_=function(t){t.stopPropagation();t.preventDefault();var e,o,i,r,n,s=this,a=t.currentTarget.parentNode.parentNode,l=!0,c=this.panel_,h=t.pageY||t.touches&&t.touches.length&&t.touches[0].pageY||t.changedTouches&&t.changedTouches.length&&t.changedTouches[0].pageY;function p(t){if(e=t.pageY||t.touches&&t.touches.length&&t.touches[0].pageY||t.changedTouches&&t.changedTouches.length&&t.changedTouches[0].pageY,l&&Math.abs(h-e)>2&&(l=!1,a.classList.add("drag"),r=s._getLayerForLI(a),o=!1,n=s._getLayerForLI(a.parentNode.parentNode),i=ol.ext.element.create("LI",{className:"ol-dragover",html:a.innerHTML,style:{position:"absolute","z-index":1e4,left:a.offsetLeft,opacity:.5,width:ol.ext.element.outerWidth(a),height:ol.ext.element.getStyle(a,"height")},parent:c}),s.element.classList.add("drag"),s.dispatchEvent({type:"reorder-start",layer:r,group:n})),!l){var p;for(t.preventDefault(),t.stopPropagation(),ol.ext.element.setStyle(i,{top:e-ol.ext.element.offsetRect(c).top+c.scrollTop+5}),(p=t.touches?document.elementFromPoint(t.touches[0].clientX,t.touches[0].clientY):t.target).classList.contains("ol-switcherbottomdiv")?s.overflow(-1):p.classList.contains("ol-switchertopdiv")&&s.overflow(1);p&&"LI"!==p.tagName;)p=p.parentNode;p&&p.classList.contains("dropover")||a.parentNode.querySelectorAll("li").forEach(function(t){t.classList.remove("dropover");t.classList.remove("dropover-after");t.classList.remove("dropover-before")});p&&p.parentNode.classList.contains("drag")&&p!==a?((o=s._getLayerForLI(p))&&!o.get("allwaysOnTop")==!r.get("allwaysOnTop")?(p.classList.add("dropover"),p.classList.add(a.offsetTop<p.offsetTop?"dropover-after":"dropover-before")):o=!1,ol.ext.element.show(i)):(o=!1,p===a?ol.ext.element.hide(i):ol.ext.element.show(i));o?i.classList.remove("forbidden"):i.classList.add("forbidden")}}a.parentNode.classList.add("drag");ol.ext.element.addListener(document,"mousemove touchmove",p);ol.ext.element.addListener(document,"mouseup touchend touchcancel",function t(){if(o){var e=r;if(e&&o){for(var l,c=(l=n?n.getLayers():s._layerGroup?s._layerGroup.getLayers():s.getMap().getLayers()).getArray(),h=0;h<c.length;h++)if(c[h]==e){l.removeAt(h);break}for(var u=0;u<c.length;u++)if(c[u]==o){h>u?l.insertAt(u,e):l.insertAt(u+1,e);break}}s.dispatchEvent({type:"reorder-end",layer:e,group:n})}a.parentNode.querySelectorAll("li").forEach(function(t){t.classList.remove("dropover");t.classList.remove("dropover-after");t.classList.remove("dropover-before")});a.classList.remove("drag");a.parentNode.classList.remove("drag");s.element.classList.remove("drag");i&&i.remove();ol.ext.element.removeListener(document,"mousemove touchmove",p);ol.ext.element.removeListener(document,"mouseup touchend touchcancel",t)})};ol.control.LayerSwitcher.prototype.dragOpacity_=function(t){t.stopPropagation();t.preventDefault();var e=this,o=t.target,i=this._getLayerForLI(o.parentNode.parentNode.parentNode);if(i){var r=t.pageX||t.touches&&t.touches.length&&t.touches[0].pageX||t.changedTouches&&t.changedTouches.length&&t.changedTouches[0].pageX,n=ol.ext.element.getStyle(o,"left")-r;e.dragging_=!0;ol.ext.element.addListener(document,"mouseup touchend touchcancel",function t(){ol.ext.element.removeListener(document,"mouseup touchend touchcancel",t);ol.ext.element.removeListener(document,"mousemove touchmove",s);e.dragging_=!1});ol.ext.element.addListener(document,"mousemove touchmove",s)}function s(t){var e=t.pageX||t.touches&&t.touches.length&&t.touches[0].pageX||t.changedTouches&&t.changedTouches.length&&t.changedTouches[0].pageX,r=(n+e)/ol.ext.element.getStyle(o.parentNode,"width"),s=Math.max(0,Math.min(1,r));ol.ext.element.setStyle(o,{left:100*s+"%"});o.parentNode.nextElementSibling.innerHTML=Math.round(100*s);i.setOpacity(s)}};ol.control.LayerSwitcher.prototype.drawList=function(t,e){var o=this,i=e.getArray(),r=function(t){t.stopPropagation();t.preventDefault();var i=o._getLayerForLI(this.parentNode.parentNode);o.switchLayerVisibility(i,e)};function n(t){t.stopPropagation();t.preventDefault();var e=o._getLayerForLI(this.parentNode.parentNode);o.oninfo(e);o.dispatchEvent({type:"info",layer:e})}function s(t){t.stopPropagation();t.preventDefault();var e=o._getLayerForLI(this.parentNode.parentNode);o.onextent?o.onextent(e):o.getMap().getView().fit(e.getExtent(),o.getMap().getSize());o.dispatchEvent({type:"extent",layer:e})}function a(t){t.stopPropagation();t.preventDefault();var e,i=this.parentNode.parentNode.parentNode.parentNode,r=o._getLayerForLI(i);r?(e=o._getLayerForLI(this.parentNode.parentNode),r.getLayers().remove(e),0!=r.getLayers().getLength()||r.get("noSwitcherDelete")||a.call(i.querySelectorAll(".layerTrash")[0],t)):(i=this.parentNode.parentNode,o.getMap().removeLayer(o._getLayerForLI(i)))}for(var l=i.length-1;l>=0;l--){var c=i[l];if(o.displayInLayerSwitcher(c)){var h=ol.ext.element.create("LI",{className:(c.getVisible()?"visible ":" ")+(c.get("baseLayer")?"baselayer":""),parent:t});this._setLayerForLI(h,c);var p=ol.ext.element.create("DIV",{className:"ol-layerswitcher-buttons",parent:h}),u=ol.ext.element.create("DIV",{className:"li-content",parent:h});if(ol.ext.element.create("INPUT",{type:c.get("baseLayer")?"radio":"checkbox",checked:c.getVisible(),click:r,parent:u}),ol.ext.element.create("LABEL",{html:c.get("title")||c.get("name"),title:c.get("title")||c.get("name"),click:r,unselectable:"on",style:{userSelect:"none"},parent:u}).addEventListener("selectstart",function(){return!1}),this.reordering&&(l<i.length-1&&(c.get("allwaysOnTop")||!i[l+1].get("allwaysOnTop"))||l>0&&(!c.get("allwaysOnTop")||i[l-1].get("allwaysOnTop")))&&ol.ext.element.create("DIV",{className:"layerup",title:this.tip.up,on:{"mousedown touchstart":function(t){o.dragOrdering_(t)}},parent:p}),c.getLayers){var g=0;c.getLayers().forEach(function(t){o.displayInLayerSwitcher(t)&&g++});g&&ol.ext.element.create("DIV",{className:c.get("openInLayerSwitcher")?"collapse-layers":"expend-layers",title:this.tip.plus,click:function(){var t=o._getLayerForLI(this.parentNode.parentNode);t.set("openInLayerSwitcher",!t.get("openInLayerSwitcher"))},parent:p})}if(this.oninfo&&ol.ext.element.create("DIV",{className:"layerInfo",title:this.tip.info,click:n,parent:p}),this.hastrash&&!c.get("noSwitcherDelete")&&ol.ext.element.create("DIV",{className:"layerTrash",title:this.tip.trash,click:a,parent:p}),this.hasextent&&i[l].getExtent()){var d=i[l].getExtent();4==d.length&&d[0]<d[2]&&d[1]<d[3]&&ol.ext.element.create("DIV",{className:"layerExtent",title:this.tip.extent,click:s,parent:p})}if(this.show_progress&&c instanceof ol.layer.Tile){var m=ol.ext.element.create("DIV",{className:"layerswitcher-progress",parent:u});this.setprogress_(c);c.layerswitcher_progress=ol.ext.element.create("DIV",{parent:m})}var f=ol.ext.element.create("DIV",{className:"layerswitcher-opacity",click:function(t){if(t.target===this){t.stopPropagation();t.preventDefault();var e=Math.max(0,Math.min(1,t.offsetX/ol.ext.element.getStyle(this,"width")));o._getLayerForLI(this.parentNode.parentNode).setOpacity(e)}},parent:u});if(ol.ext.element.create("DIV",{className:"layerswitcher-opacity-cursor",style:{left:100*c.getOpacity()+"%"},on:{"mousedown touchstart":function(t){o.dragOpacity_(t)}},parent:f}),ol.ext.element.create("DIV",{className:"layerswitcher-opacity-label",html:Math.round(100*c.getOpacity()),parent:u}),c.getLayers){if(h.classList.add("ol-layer-group"),!0===c.get("openInLayerSwitcher")){var y=ol.ext.element.create("UL",{parent:h});this.drawList(y,c.getLayers())}}else c instanceof ol.layer.Vector?h.classList.add("ol-layer-vector"):c instanceof ol.layer.VectorTile?h.classList.add("ol-layer-vector"):c instanceof ol.layer.Tile?h.classList.add("ol-layer-tile"):c instanceof ol.layer.Image?h.classList.add("ol-layer-image"):c instanceof ol.layer.Heatmap&&h.classList.add("ol-layer-heatmap");this.dispatchEvent({type:"drawlist",layer:c,li:h})}}this.viewChange();t===this.panel_&&this.overflow()};ol.control.LayerSwitcher.prototype.setprogress_=function(t){if(!t.layerswitcher_progress){var e=0,o=0,i=function(){o===e?(o=e=0,ol.ext.element.setStyle(t.layerswitcher_progress,{width:0})):ol.ext.element.setStyle(t.layerswitcher_progress,{width:(e/o*100).toFixed(1)+"%"})};t.getSource().on("tileloadstart",function(){o++;i()});t.getSource().on("tileloadend",function(){e++;i()});t.getSource().on("tileloaderror",function(){e++;i()})}};ol.control.Bar=function(t){t||(t={});var e=document.createElement("div");if(e.classList.add("ol-unselectable","ol-control","ol-bar"),t.className){var o=t.className.split(" ").filter(function(t){return t.length>0});e.classList.add.apply(e.classList,o)}if(t.group&&e.classList.add("ol-group"),ol.control.Control.call(this,{element:e,target:t.target}),this.set("toggleOne",t.toggleOne),this.set("autoDeactivate",t.autoDeactivate),this.controls_=[],t.controls instanceof Array)for(var i=0;i<t.controls.length;i++)this.addControl(t.controls[i])};ol.ext.inherits(ol.control.Bar,ol.control.Control);ol.control.Bar.prototype.setVisible=function(t){this.element.style.display=t?"":"none"};ol.control.Bar.prototype.getVisible=function(){return"none"!=this.element.style.display};ol.control.Bar.prototype.setMap=function(t){ol.control.Control.prototype.setMap.call(this,t);for(var e=0;e<this.controls_.length;e++)this.controls_[e].setMap(t)};ol.control.Bar.prototype.getControls=function(){return this.controls_};ol.control.Bar.prototype.setPosition=function(t){this.element.classList.remove("ol-left","ol-top","ol-bottom","ol-right");t=t.split("-");for(var e=0;e<t.length;e++)switch(t[e]){case"top":case"left":case"bottom":case"right":this.element.classList.add("ol-"+t[e])}};ol.control.Bar.prototype.addControl=function(t){this.controls_.push(t);t.setTarget(this.element);this.getMap()&&this.getMap().addControl(t);t.on("change:active",function(e){this.onActivateControl_(e,t)}.bind(this));t.getActive&&this.onActivateControl_({target:t,active:t.getActive()},t)};ol.control.Bar.prototype.deactivateControls=function(t){for(var e=0;e<this.controls_.length;e++)this.controls_[e]!==t&&this.controls_[e].setActive&&this.controls_[e].setActive(!1)};ol.control.Bar.prototype.getActiveControls=function(){for(var t,e=[],o=0;t=this.controls_[o];o++)t.getActive&&t.getActive()&&e.push(t);return e};ol.control.Bar.prototype.setActive=function(t){if(!t&&this.get("autoDeactivate")&&this.deactivateControls(),t)for(var e,o=this.getControls(),i=0;e=o[i];i++)e.get("autoActivate")&&e.setActive(!0)};ol.control.Bar.prototype.onActivateControl_=function(t,e){if(this.get("toggleOne"))if(t.active){for(var o=0;o<this.controls_.length&&this.controls_[o]!==e;o++);if(o==this.controls_.length)return;this.deactivateControls(this.controls_[o])}else if(!this.getActiveControls().length)for(var i,r=0;i=this.controls_[r];r++)if(i.get("autoActivate")){i.setActive(!0);break}};ol.control.Bar.prototype.getControlsByName=function(t){return this.getControls().filter(function(e){return e.get("name")===t})};ol.control.Button=function(t){t=t||{};var e=document.createElement("div");e.className=(t.className||"")+" ol-button ol-unselectable ol-control";var o=this,i=this.button_=document.createElement(/ol-text-button/.test(t.className)?"div":"button");i.type="button";t.title&&(i.title=t.title);t.html instanceof Element?i.appendChild(t.html):i.innerHTML=t.html||"";var r=function(e){e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation());t.handleClick&&t.handleClick.call(o,e)};i.addEventListener("click",r);i.addEventListener("touchstart",r);e.appendChild(i);!t.title&&i.firstElementChild&&(i.title=i.firstElementChild.title);ol.control.Control.call(this,{element:e,target:t.target});t.title&&this.set("title",t.title);t.title&&this.set("title",t.title);t.name&&this.set("name",t.name)};ol.ext.inherits(ol.control.Button,ol.control.Control);ol.control.Button.prototype.setVisible=function(t){t?ol.ext.element.show(this.element):ol.ext.element.hide(this.element)};ol.control.Button.prototype.setTitle=function(t){this.button_.setAttribute("title",t)};ol.control.Button.prototype.setHtml=function(t){ol.ext.element.setHTML(this.button_,t)};ol.control.Button.prototype.getButtonElement=function(){return this.button_};ol.control.CanvasAttribution=function(t){t||(t={});ol.control.Attribution.call(this,t);this.setCanvas(!!t.canvas);t||(t={});t.style||(t.style=new ol.style.Style);this.setStyle(t.style)};ol.ext.inherits(ol.control.CanvasAttribution,ol.control.Attribution);ol.control.CanvasAttribution.prototype.setCanvas=function(t){this.isCanvas_=t;t&&this.setCollapsed(!1);this.element.style.visibility=t?"hidden":"visible";this.map_&&this.map_.renderSync()};ol.control.CanvasAttribution.prototype.getContext=ol.control.CanvasBase.prototype.getContext;ol.control.CanvasAttribution.prototype.setStyle=function(t){var e=t.getText();this.font_=e?e.getFont():"10px sans-serif";var o=e?e.getStroke():null,i=e?e.getFill():null;this.fontStrokeStyle_=o?ol.color.asString(o.getColor()):"#fff";this.fontFillStyle_=i?ol.color.asString(i.getColor()):"#000";this.fontStrokeWidth_=o?o.getWidth():3;this.getMap()&&this.getMap().render()};ol.control.CanvasAttribution.prototype.setMap=function(t){ol.control.CanvasBase.prototype.getCanvas.call(this,t);var e=this.getMap();this._listener&&ol.Observable.unByKey(this._listener);this._listener=null;ol.control.ScaleLine.prototype.setMap.call(this,t);e&&e.renderSync();t&&(this._listener=t.on("postcompose",this.drawAttribution_.bind(this)));this.map_=t;this.setCanvas(this.isCanvas_)};ol.control.CanvasAttribution.prototype.drawAttribution_=function(t){if(this.isCanvas_){var e=this.getContext(t);if(e){var o="";Array.prototype.slice.call(this.element.querySelectorAll("li")).filter(function(t){return"none"!==t.style.display}).map(function(t){o+=(o?" - ":"")+t.textContent});var i=t.frameState.pixelRatio;e.save();e.scale(i,i);var r=this.element.getBoundingClientRect(),n=this.getMap().getViewport().getBoundingClientRect(),s=this.getMap().getSize()[0]/n.width;e.translate((r.left-n.left)*s,(r.top-n.top)*s);var a=this.element.clientHeight,l=this.element.clientWidth/2+this.element.querySelectorAll("button")[0].clientWidth;e.beginPath();e.strokeStyle=this.fontStrokeStyle_;e.fillStyle=this.fontFillStyle_;e.lineWidth=this.fontStrokeWidth_;e.textAlign="center";e.textBaseline="middle";e.font=this.font_;e.strokeText(o,l,a/2);e.fillText(o,l,a/2);e.closePath();e.restore()}}};ol.control.CanvasScaleLine=function(t){ol.control.ScaleLine.call(this,t);this.scaleHeight_=6;t||(t={});t.style||(t.style=new ol.style.Style);this.setStyle(t.style)};ol.ext.inherits(ol.control.CanvasScaleLine,ol.control.ScaleLine);ol.control.CanvasScaleLine.prototype.getContext=ol.control.CanvasBase.prototype.getContext;ol.control.CanvasScaleLine.prototype.setMap=function(t){ol.control.CanvasBase.prototype.getCanvas.call(this,t);var e=this.getMap();this._listener&&ol.Observable.unByKey(this._listener);this._listener=null;ol.control.ScaleLine.prototype.setMap.call(this,t);e&&e.renderSync();t&&(this._listener=t.on("postcompose",this.drawScale_.bind(this)));this.element.style.visibility="hidden";this.olscale=this.element.querySelector(".ol-scale-line-inner")};ol.control.CanvasScaleLine.prototype.setStyle=function(t){var e=t.getStroke();this.strokeStyle_=e?ol.color.asString(e.getColor()):"#000";this.strokeWidth_=e?e.getWidth():2;var o=t.getFill();this.fillStyle_=o?ol.color.asString(o.getColor()):"#fff";var i=t.getText();this.font_=i?i.getFont():"10px Arial";e=i?i.getStroke():null;o=i?i.getFill():null;this.fontStrokeStyle_=e?ol.color.asString(e.getColor()):this.fillStyle_;this.fontStrokeWidth_=e?e.getWidth():3;this.fontFillStyle_=o?ol.color.asString(o.getColor()):this.strokeStyle_;this.getMap()&&this.getMap().render()};ol.control.CanvasScaleLine.prototype.drawScale_=function(t){if("hidden"===this.element.style.visibility){var e=this.getContext(t);if(e){var o=parseInt(this.olscale.style.width);if(o){var i=this.olscale.textContent,r={left:this.element.offsetLeft,top:this.element.offsetTop},n=t.frameState.pixelRatio;e.save();e.scale(n,n);r.top+=this.element.clientHeight-this.scaleHeight_;e.beginPath();e.strokeStyle=this.fontStrokeStyle_;e.fillStyle=this.fontFillStyle_;e.lineWidth=this.fontStrokeWidth_;e.textAlign="center";e.textBaseline="bottom";e.font=this.font_;e.strokeText(i,r.left+o/2,r.top);e.fillText(i,r.left+o/2,r.top);e.closePath();r.top+=2;e.lineWidth=this.strokeWidth_;e.strokeStyle=this.strokeStyle_;for(var s=4,a=parseInt(i);a%10==0;)a/=10;a%5==0&&(s=5);for(var l=0;l<s;l++)e.beginPath(),e.fillStyle=l%2?this.fillStyle_:this.strokeStyle_,e.rect(r.left+l*o/s,r.top,o/s,this.scaleHeight_),e.stroke(),e.fill(),e.closePath();e.restore()}}}};ol.control.CanvasTitle=function(t){t||(t={});var e=ol.ext.element.create("DIV",{className:(t.className||"")+" ol-control-title ol-unselectable",style:{display:"block",visibility:"hidden"}});ol.control.CanvasBase.call(this,{element:e,style:t.style});this.setTitle(t.title||"Title");this.element.style.font=this.getTextFont()};ol.ext.inherits(ol.control.CanvasTitle,ol.control.CanvasBase);ol.control.CanvasTitle.prototype.setStyle=function(t){ol.control.CanvasBase.prototype.setStyle.call(this,t);this.element&&(this.element.style.font=this.getTextFont());this.getMap()&&this.getMap().render()};ol.control.CanvasTitle.prototype.setTitle=function(t){this.element.textContent=t;this.set("title",t);this.getMap()&&this.getMap().renderSync()};ol.control.CanvasTitle.prototype.getTitle=function(){return this.get("title")};ol.control.CanvasTitle.prototype.setVisible=function(t){this.element.style.display=t?"block":"none";this.getMap()&&this.getMap().renderSync()};ol.control.CanvasTitle.prototype.getVisible=function(){return"none"!==this.element.style.display};ol.control.CanvasTitle.prototype._draw=function(t){if(this.getVisible()){var e=this.getContext(t);if(e){var o=t.frameState.pixelRatio;e.save();e.scale(o,o);var i=this.element.getBoundingClientRect(),r=this.getMap().getViewport().getBoundingClientRect(),n=this.getMap().getSize()[0]/r.width;e.translate((i.left-r.left)*n,(i.top-r.top)*n);var s=this.element.clientHeight,a=this.element.clientWidth,l=a/2;e.beginPath();e.fillStyle=ol.color.asString(this.getFill().getColor());e.rect(0,0,a,s);e.fill();e.closePath();e.beginPath();e.fillStyle=ol.color.asString(this.getTextFill().getColor());e.strokeStyle=ol.color.asString(this.getTextStroke().getColor());e.lineWidth=this.getTextStroke().getWidth();e.textAlign="center";e.textBaseline="middle";e.font=this.getTextFont();e.lineWidth&&e.strokeText(this.getTitle(),l,s/2);e.fillText(this.getTitle(),l,s/2);e.closePath();e.restore()}}};ol.control.CenterPosition=function(t){t||(t={});var e=ol.ext.element.create("DIV",{className:(t.className||"")+" ol-center-position ol-unselectable",style:{display:"block",visibility:"hidden"}});ol.control.CanvasBase.call(this,{element:e,style:t.style});this.element.style.font=this.getTextFont();this.set("projection",t.projection);this.setCanvas(t.canvas);this._format="function"==typeof t.coordinateFormat?t.coordinateFormat:ol.coordinate.toStringXY};ol.ext.inherits(ol.control.CenterPosition,ol.control.CanvasBase);ol.control.CenterPosition.prototype.setStyle=function(t){ol.control.CanvasBase.prototype.setStyle.call(this,t);this.element&&(this.element.style.font=this.getTextFont());this.getMap()&&this.getMap().render()};ol.control.CenterPosition.prototype.setCanvas=function(t){this.set("canvas",t);this.element.style.visibility=t?"hidden":"visible";this.getMap()&&this.getMap().renderSync()};ol.control.CenterPosition.prototype.setVisible=function(t){this.element.style.display=t?"":"none";this.getMap()&&this.getMap().renderSync()};ol.control.CenterPosition.prototype.getVisible=function(){return"none"!==this.element.style.display};ol.control.CenterPosition.prototype._draw=function(t){if(this.getVisible()&&this.getMap()){var e=this.getMap().getView().getCenter();if(this.get("projection")&&(e=ol.proj.transform(e,this.getMap().getView().getProjection(),this.get("projection"))),e=this._format(e),this.element.textContent=e,this.get("canvas")){var o=this.getContext(t);if(o){var i=t.frameState.pixelRatio;o.save();o.scale(i,i);var r=this.element.getBoundingClientRect(),n=this.getMap().getViewport().getBoundingClientRect(),s=this.getMap().getSize()[0]/n.width;o.translate((r.left-n.left)*s,(r.top-n.top)*s);var a=this.element.clientHeight,l=this.element.clientWidth;o.beginPath();o.fillStyle=ol.color.asString(this.getTextFill().getColor());o.strokeStyle=ol.color.asString(this.getTextStroke().getColor());o.lineWidth=this.getTextStroke().getWidth();o.textAlign="center";o.textBaseline="middle";o.font=this.getTextFont();o.lineWidth&&o.strokeText(e,l/2,a/2);o.fillText(e,l/2,a/2);o.closePath();o.restore()}}}};ol.control.Compass=function(t){var e=this;t||(t={});var o=document.createElement("div");o.className="ol-compassctrl ol-unselectable ol-hidden"+(t.className?" "+t.className:"");o.style.position="absolute";o.style.visibility="hidden";var i=t.style instanceof ol.style.Stroke?new ol.style.Style({stroke:t.style}):t.style;t.style||(i=new ol.style.Style({stroke:new ol.style.Stroke({width:0})}));ol.control.CanvasBase.call(this,{element:o,style:i});this.set("rotateVithView",!1!==t.rotateWithView);t.image?this.img_=t.image:t.src?(this.img_=new Image,this.img_.onload=function(){e.getMap()&&e.getMap().renderSync()},this.img_.src=t.src):this.img_=this.defaultCompass_(this.element.clientWidth,this.getStroke().getColor());this.da_=[];for(var r=0;r<8;r++)this.da_[r]=[Math.cos(Math.PI*r/8),Math.sin(Math.PI*r/8)]};ol.ext.inherits(ol.control.Compass,ol.control.CanvasBase);ol.control.Compass.prototype.defaultCompass_=function(t,e){var o=document.createElement("canvas"),i=o.getContext("2d"),r=(t=o.width=o.height=t||150)/2,n=.22*r;function s(t,o){i.fillStyle=e||"#963";i.beginPath();i.moveTo(0,0);i.lineTo(t,0);i.lineTo(o,o);i.moveTo(0,0);i.lineTo(-t,0);i.lineTo(-o,-o);i.moveTo(0,0);i.lineTo(0,t);i.lineTo(-o,o);i.moveTo(0,0);i.lineTo(0,-t);i.lineTo(o,-o);i.moveTo(0,0);i.fill();i.stroke()}function a(t,e){i.globalCompositeOperation="destination-out";i.fillStyle="#fff";i.beginPath();i.moveTo(0,0);i.lineTo(t,0);i.lineTo(e,-e);i.moveTo(0,0);i.lineTo(-t,0);i.lineTo(-e,e);i.moveTo(0,0);i.lineTo(0,t);i.lineTo(e,e);i.moveTo(0,0);i.lineTo(0,-t);i.lineTo(-e,-e);i.moveTo(0,0);i.fill();i.globalCompositeOperation="source-over";i.beginPath();i.moveTo(0,0);i.lineTo(t,0);i.lineTo(e,-e);i.moveTo(0,0);i.lineTo(-t,0);i.lineTo(-e,e);i.moveTo(0,0);i.lineTo(0,t);i.lineTo(e,e);i.moveTo(0,0);i.lineTo(0,-t);i.lineTo(-e,-e);i.moveTo(0,0);i.stroke()}return i.translate(r,r),i.strokeStyle=e||"#963",i.lineWidth=1.5,i.beginPath(),i.arc(0,0,.41*t,0,2*Math.PI),i.arc(0,0,.44*t,0,2*Math.PI),i.stroke(),i.rotate(Math.PI/4),s(.9*r,.8*n),a(.9*r,.8*n),i.rotate(-Math.PI/4),s(r,n),a(r,n),o};ol.control.Compass.prototype._draw=function(t){var e=this.getContext(t);if(e){var o=e.canvas,i=t.frameState.pixelRatio;e.save();e.scale(i,i);var r=this.element.clientWidth,n=this.element.clientHeight,s=this.element.offsetLeft,a=this.element.offsetTop,l=this.img_,c=t.frameState.viewState.rotation;if(e.beginPath(),e.translate(s+r/2,a+n/2),this.get("rotateVithView")&&e.rotate(c),this.getStroke().getWidth()){e.beginPath();e.strokeStyle=this.getStroke().getColor();e.lineWidth=this.getStroke().getWidth();for(var h=Math.max(o.width,o.height),p=0;p<8;p++)e.moveTo(-this.da_[p][0]*h,-this.da_[p][1]*h),e.lineTo(this.da_[p][0]*h,this.da_[p][1]*h);e.stroke()}l.width&&e.drawImage(l,-r/2,-n/2,r,n);e.closePath();e.restore()}};ol.control.Dialog=function(t){t=t||{};var e=ol.ext.element.create("DIV",{className:((t.className||"")+(t.zoom?" ol-zoom":"")+" ol-ext-dialog").trim(),click:function(){this.get("hideOnClick")&&this.close()}.bind(this)}),o=ol.ext.element.create("FORM",{on:{submit:this._onButton("submit")},parent:e});ol.ext.element.create("H2",{parent:o});ol.ext.element.create("DIV",{className:"ol-closebox",click:this._onButton("cancel"),parent:o});ol.ext.element.create("DIV",{className:"ol-content",parent:o});ol.ext.element.create("DIV",{className:"ol-buttons",parent:o});ol.control.Control.call(this,{element:e,target:t.target});this.set("closeBox",t.closeBox);this.set("zoom",t.zoom);this.set("hideOnClick",t.hideOnClick);this.set("className",t.className)};ol.ext.inherits(ol.control.Dialog,ol.control.Control);ol.control.Dialog.prototype.show=function(t){(t instanceof Element||"string"==typeof t)&&(t={content:t});this.setContent(t);this.element.classList.add("ol-visible");this.dispatchEvent({type:"show"})};ol.control.Dialog.prototype.open=function(){this.show()};ol.control.Dialog.prototype.setContent=function(t){if(t){this.element.className="ol-ext-dialog"+(this.get("zoom")?" ol-zoom":"");t.className?this.element.classList.add(t.className):this.get("className")&&this.element.classList.add(this.get("className"));var e=this.element.querySelector("form");ol.ext.element.setHTML(e.querySelector(".ol-content"),t.content||"");e.querySelector("h2").innerText=t.title||"";t.title?e.classList.add("ol-title"):e.classList.remove("ol-title");t.closeBox||this.get("closeBox")&&!1!==t.closeBox?e.classList.add("ol-closebox"):e.classList.remove("ol-closebox");var o=this.element.querySelector(".ol-buttons");if(o.innerHTML="",t.buttons)for(var i in e.classList.add("ol-button"),t.buttons)ol.ext.element.create("INPUT",{type:"submit"===i?"submit":"button",value:t.buttons[i],click:this._onButton(i),parent:o});else e.classList.remove("ol-button")}};ol.control.Dialog.prototype._onButton=function(t){return function(e){e.preventDefault();this.hide();var o={};this.element.querySelectorAll("form input").forEach(function(t){t.className&&(o[t.className]=t)});this.dispatchEvent({type:"button",button:t,inputs:o})}.bind(this)};ol.control.Dialog.prototype.hide=function(){this.element.classList.remove("ol-visible");this.dispatchEvent({type:"hide"})};ol.control.Dialog.prototype.close=ol.control.Dialog.prototype.hide;ol.control.Dialog.prototype.isOpen=function(){return this.element.classList.contains("ol-visible")};ol.control.Disable=function(t){t=t||{};var e=document.createElement("div");e.className=(t.className||" ol-disable ol-unselectable ol-control").trim();var o={top:"0px",left:"0px",right:"0px",bottom:"0px",zIndex:1e4,background:"none",display:"none"};Object.keys(o).forEach(function(t){e.style[t]=o[t]});ol.control.Control.call(this,{element:e})};ol.ext.inherits(ol.control.Disable,ol.control.Control);ol.control.Disable.prototype.isOn=function(){return this.element.classList.contains("ol-disable")};ol.control.Disable.prototype.disableMap=function(t){t?this.element.classList.add("ol-enable").show():this.element.classList.remove("ol-enable").hide()};ol.control.EditBar=function(t){(t=t||{}).interactions=t.interactions||{};ol.control.Bar.call(this,{className:(t.className?t.className+" ":"")+"ol-editbar",toggleOne:!0,target:t.target});this._source=t.source;this._interactions={};this._setSelectInteraction(t);!1!==t.edition&&this._setEditInteraction(t);this._setModifyInteraction(t)};ol.ext.inherits(ol.control.EditBar,ol.control.Bar);ol.control.EditBar.prototype.setMap=function(t){this.getMap()&&(this._interactions.Delete&&this.getMap().removeInteraction(this._interactions.Delete),this._interactions.ModifySelect&&this.getMap().removeInteraction(this._interactions.ModifySelect));ol.control.Bar.prototype.setMap.call(this,t);this.getMap()&&(this._interactions.Delete&&this.getMap().addInteraction(this._interactions.Delete),this._interactions.ModifySelect&&this.getMap().addInteraction(this._interactions.ModifySelect))};ol.control.EditBar.prototype.getInteraction=function(t){return this._interactions[t]};ol.control.EditBar.prototype._getTitle=function(t){return t&&t.title?t.title:t};ol.control.EditBar.prototype._setSelectInteraction=function(t){var e,o=this,i=new ol.control.Bar;if(!1!==t.interactions.Delete){this._interactions.Delete=t.interactions.Delete instanceof ol.interaction.Delete?t.interactions.Delete:new ol.interaction.Delete;var r=this._interactions.Delete;r.setActive(!1);this.getMap()&&this.getMap().addInteraction(r);i.addControl(new ol.control.Button({className:"ol-delete",title:this._getTitle(t.interactions.Delete)||"Delete",handleClick:function(t){r.delete(e.getInteraction().getFeatures());console.log("del");var o={type:"select",selected:[],deselected:e.getInteraction().getFeatures().getArray().slice(),mapBrowserEvent:t.mapBrowserEvent};e.getInteraction().getFeatures().clear();e.getInteraction().dispatchEvent(o)}}))}if(!1!==t.interactions.Info&&i.addControl(new ol.control.Button({className:"ol-info",title:this._getTitle(t.interactions.Info)||"Show informations",handleClick:function(){o.dispatchEvent({type:"info",features:e.getInteraction().getFeatures()})}})),!1!==t.interactions.Select){this._interactions.Select=t.interactions.Select instanceof ol.interaction.Select?t.interactions.Select:new ol.interaction.Select({condition:ol.events.condition.click});var n=this._interactions.Select;e=new ol.control.Toggle({className:"ol-selection",title:this._getTitle(t.interactions.Select)||"Select",interaction:n,bar:i.getControls().length?i:void 0,autoActivate:!0,active:!0});this.addControl(e);n.on("change:active",function(){n.getFeatures().clear()})}};ol.control.EditBar.prototype._setEditInteraction=function(t){if(!1!==t.interactions.DrawPoint){this._interactions.DrawPoint=t.interactions.DrawPoint instanceof ol.interaction.Draw?t.interactions.DrawPoint:new ol.interaction.Draw({type:"Point",source:this._source});var e=new ol.control.Toggle({className:"ol-drawpoint",title:this._getTitle(t.interactions.DrawPoint)||"Point",interaction:this._interactions.DrawPoint});this.addControl(e)}if(!1!==t.interactions.DrawLine){this._interactions.DrawLine=t.interactions.DrawLine instanceof ol.interaction.Draw?t.interactions.DrawLine:new ol.interaction.Draw({type:"LineString",source:this._source,geometryFunction:function(t,e){return e?e.setCoordinates(t):e=new ol.geom.LineString(t),this.nbpts=e.getCoordinates().length,e}});var o=new ol.control.Toggle({className:"ol-drawline",title:this._getTitle(t.interactions.DrawLine)||"LineString",interaction:this._interactions.DrawLine,bar:new ol.control.Bar({controls:[new ol.control.TextButton({html:this._getTitle(t.interactions.UndoDraw)||"undo",title:this._getTitle(t.interactions.UndoDraw)||"delete last point",handleClick:function(){o.getInteraction().nbpts>1&&o.getInteraction().removeLastPoint()}}),new ol.control.TextButton({html:this._getTitle(t.interactions.FinishDraw)||"finish",title:this._getTitle(t.interactions.FinishDraw)||"finish",handleClick:function(){o.getInteraction().nbpts>2&&o.getInteraction().finishDrawing()}})]})});this.addControl(o)}if(!1!==t.interactions.DrawPolygon&&(this._interactions.DrawPolygon=t.interactions.DrawPolygon instanceof ol.interaction.Draw?t.interactions.DrawPolygon:new ol.interaction.Draw({type:"Polygon",source:this._source,geometryFunction:function(t,e){return this.nbpts=t[0].length,e?e.setCoordinates([t[0].concat([t[0][0]])]):e=new ol.geom.Polygon(t),e}}),this._setDrawPolygon("ol-drawpolygon",this._interactions.DrawPolygon,this._getTitle(t.interactions.DrawPolygon)||"Polygon",t)),!1!==t.interactions.DrawHole&&(this._interactions.DrawHole=t.interactions.DrawHole instanceof ol.interaction.DrawHole?t.interactions.DrawHole:new ol.interaction.DrawHole,this._setDrawPolygon("ol-drawhole",this._interactions.DrawHole,this._getTitle(t.interactions.DrawHole)||"Hole",t)),!1!==t.interactions.DrawRegular){this._interactions.DrawRegular=t.interactions.DrawRegular instanceof ol.interaction.DrawRegular?t.interactions.DrawRegular:new ol.interaction.DrawRegular({source:this._source,sides:4});var i=this._interactions.DrawRegular,r=document.createElement("DIV"),n=ol.ext.element.create("DIV",{parent:r});ol.ext.element.addListener(n,["click","touchstart"],function(){var t=i.getSides()-1;t<2&&(t=2);i.setSides(t);s.textContent=t>2?t+" pts":"circle"}.bind(this));var s=ol.ext.element.create("TEXT",{html:"4 pts",parent:r}),a=ol.ext.element.create("DIV",{parent:r});ol.ext.element.addListener(a,["click","touchstart"],function(){var t=i.getSides()+1;t<3&&(t=3);i.setSides(t);s.textContent=t+" pts"}.bind(this));var l=new ol.control.Toggle({className:"ol-drawregular",title:this._getTitle(t.interactions.DrawRegular)||"Regular",interaction:this._interactions.DrawRegular,bar:new ol.control.Bar({controls:[new ol.control.TextButton({html:r})]})});this.addControl(l)}};ol.control.EditBar.prototype._setDrawPolygon=function(t,e,o,i){var r=new ol.control.Toggle({className:t,title:o,interaction:e,bar:new ol.control.Bar({controls:[new ol.control.TextButton({html:this._getTitle(i.interactions.UndoDraw)||"undo",title:this._getTitle(i.interactions.UndoDraw)||"undo last point",handleClick:function(){r.getInteraction().nbpts>1&&r.getInteraction().removeLastPoint()}}),new ol.control.TextButton({html:this._getTitle(i.interactions.FinishDraw)||"finish",title:this._getTitle(i.interactions.FinishDraw)||"finish",handleClick:function(){r.getInteraction().nbpts>3&&r.getInteraction().finishDrawing()}})]})});this.addControl(r)};ol.control.EditBar.prototype._setModifyInteraction=function(t){if(!1!==t.interactions.ModifySelect&&!1!==t.interactions.Select&&(this._interactions.ModifySelect=t.interactions.ModifySelect instanceof ol.interaction.ModifyFeature?t.interactions.ModifySelect:new ol.interaction.ModifyFeature({features:this.getInteraction("Select").getFeatures()}),this.getMap()&&this.getMap().addInteraction(this._interactions.ModifySelect),this._interactions.ModifySelect.setActive(this._interactions.Select.getActive()),this._interactions.Select.on("change:active",function(){this._interactions.ModifySelect.setActive(this._interactions.Select.getActive())}.bind(this))),!1!==t.interactions.Transform){this._interactions.Transform=t.interactions.Transform instanceof ol.interaction.Transform?t.interactions.Transform:new ol.interaction.Transform({addCondition:ol.events.condition.shiftKeyOnly});var e=new ol.control.Toggle({html:"<i><\/i>",className:"ol-transform",title:this._getTitle(t.interactions.Transform)||"Transform",interaction:this._interactions.Transform});this.addControl(e)}if(!1!==t.interactions.Split){this._interactions.Split=t.interactions.Split instanceof ol.interaction.Split?t.interactions.Split:new ol.interaction.Split({sources:this._source});var o=new ol.control.Toggle({className:"ol-split",title:this._getTitle(t.interactions.Split)||"Split",interaction:this._interactions.Split});this.addControl(o)}if(!1!==t.interactions.Offset){this._interactions.Offset=t.interactions.Offset instanceof ol.interaction.Offset?t.interactions.Offset:new ol.interaction.Offset({source:this._source});var i=new ol.control.Toggle({html:"<i><\/i>",className:"ol-offset",title:this._getTitle(t.interactions.Offset)||"Offset",interaction:this._interactions.Offset});this.addControl(i)}};ol.control.Gauge=function(t){t=t||{};var e=ol.ext.element.create("DIV",{className:((t.className||"")+" ol-gauge ol-unselectable ol-control").trim()});this.title_=ol.ext.element.create("SPAN",{parent:e});var o=ol.ext.element.create("DIV",{parent:e});this.gauge_=ol.ext.element.create("BUTTON",{type:"button",style:{width:"0px"},parent:o});ol.control.Control.call(this,{element:e,target:t.target});this.setTitle(t.title);this.set("max",t.max||100);this.val(t.val)};ol.ext.inherits(ol.control.Gauge,ol.control.Control);ol.control.Gauge.prototype.setTitle=function(t){this.title_.innerHTML=t||"";this.title_.display=t?"":"none"};ol.control.Gauge.prototype.val=function(t){return void 0!==t&&(this.val_=t,this.gauge_.style.width=t/this.get("max")*100+"%"),this.val_};ol.control.GeoBookmark=function(t){t=t||{};var e=this,o=document.createElement("div");t.target?o.className=t.className||"ol-bookmark":(o.className=(t.className||"ol-bookmark")+" ol-unselectable ol-control ol-collapsed",o.addEventListener("mouseleave",function(){n!==document.activeElement&&(i.style.display="none")}),this.button=document.createElement("button"),this.button.setAttribute("type","button"),this.button.addEventListener("click",function(){i.style.display=""===i.style.display||"none"===i.style.display?"block":"none"}),o.appendChild(this.button));var i=document.createElement("div");o.appendChild(i);var r=document.createElement("ul");i.appendChild(r);var n=document.createElement("input");n.setAttribute("placeholder",t.placeholder||"Add a new geomark...");n.addEventListener("change",function(){var t=this.value;t&&(e.addBookmark(t),this.value="",e.dispatchEvent({type:"add",name:t}));i.style.display="none"});n.addEventListener("blur",function(){i.style.display="none"});i.appendChild(n);ol.control.Control.call(this,{element:o,target:t.target});this.on("propertychange",function(t){"editable"===t.key&&(o.className=o.className.replace(" ol-editable",""),this.get("editable")&&(o.className+=" ol-editable"))}.bind(this));this.set("namespace",t.namespace||"ol");this.set("editable",!1!==t.editable);this.setBookmarks(localStorage[this.get("namespace")+"@bookmark"]?null:t.marks)};ol.ext.inherits(ol.control.GeoBookmark,ol.control.Control);ol.control.GeoBookmark.prototype.setBookmarks=function(t){t||(t=JSON.parse(localStorage[this.get("namespace")+"@bookmark"]||"{}"));var e=this.get("editable"),o=this.element.querySelector("ul"),i=this.element.querySelector("div"),r=this;for(var n in o.innerHTML="",t){var s=document.createElement("li");if(s.textContent=n,s.setAttribute("data-bookmark",JSON.stringify(t[n])),s.addEventListener("click",function(){var t=JSON.parse(this.getAttribute("data-bookmark"));r.getMap().getView().setCenter(t.pos);r.getMap().getView().setZoom(t.zoom);i.style.display="none"}),o.appendChild(s),e&&!t[n].permanent){var a=document.createElement("button");a.setAttribute("data-name",n);a.setAttribute("title","Suppr.");a.addEventListener("click",function(t){r.removeBookmark(this.getAttribute("data-name"));r.dispatchEvent({type:"remove",name:this.getAttribute("data-name")});t.stopPropagation()});s.appendChild(a)}}localStorage[this.get("namespace")+"@bookmark"]=JSON.stringify(t)};ol.control.GeoBookmark.prototype.getBookmarks=function(){return JSON.parse(localStorage[this.get("namespace")+"@bookmark"]||"{}")};ol.control.GeoBookmark.prototype.removeBookmark=function(t){if(t){var e=this.getBookmarks();delete e[t];this.setBookmarks(e)}};ol.control.GeoBookmark.prototype.addBookmark=function(t,e,o,i){if(t){var r=this.getBookmarks();r[t]&&r[t].permanent||(r[t]={pos:e||this.getMap().getView().getCenter(),zoom:o||this.getMap().getView().getZoom(),permanent:!!i},this.setBookmarks(r))}};ol.control.GeolocationBar=function(t){t||(t={});t.className=t.className||"ol-geobar";ol.control.Bar.call(this,t);this.setPosition(t.position||"bottom-right");var e=this.element,o=new ol.interaction.GeolocationDraw({source:t.source,zoom:t.zoom,followTrack:t.followTrack,minAccuracy:t.minAccuracy||1e4});this._geolocBt=new ol.control.Toggle({className:"geolocBt",interaction:o,onToggle:function(){o.pause(!0);o.setFollowTrack(t.followTrack);e.classList.remove("pauseTrack")}});this.addControl(this._geolocBt);this._geolocBt.setActive(!1);var i=new ol.control.Bar;this.addControl(i);var r=new ol.control.TextButton({className:"centerBt",html:t.centerLabel||"center",handleClick:function(){o.setFollowTrack("auto")}});i.addControl(r);var n=new ol.control.Button({className:"startBt",handleClick:function(){o.pause(!1);o.setFollowTrack("auto");e.classList.add("pauseTrack")}});i.addControl(n);var s=new ol.control.Button({className:"pauseBt",handleClick:function(){o.pause(!0);o.setFollowTrack("auto");e.classList.remove("pauseTrack")}});i.addControl(s);o.on("follow",function(t){t.following?e.classList.remove("centerTrack"):e.classList.add("centerTrack")});this._geolocBt.on("change:active",function(t){t.active?e.classList.add("ol-active"):e.classList.remove("ol-active")})};ol.ext.inherits(ol.control.GeolocationBar,ol.control.Bar);ol.control.GeolocationBar.prototype.getInteraction=function(){return this._geolocBt.getInteraction()};ol.control.Globe=function(t){var e,o=t||{},i=this;o.target?(e=document.createElement("div"),this.panel_=o.target):((e=document.createElement("div")).classList.add("ol-globe","ol-unselectable","ol-control"),/top/.test(o.align)&&e.classList.add("ol-control-top"),/right/.test(o.align)&&e.classList.add("ol-control-right"),this.panel_=document.createElement("div"),this.panel_.classList.add("panel"),e.appendChild(this.panel_),this.pointer_=document.createElement("div"),this.pointer_.classList.add("ol-pointer"),e.appendChild(this.pointer_));ol.control.Control.call(this,{element:e,target:o.target});this.ovmap_=new ol.Map({controls:new ol.Collection,interactions:new ol.Collection,target:this.panel_,view:new ol.View({zoom:0,center:[0,0]}),layers:o.layers});setTimeout(function(){i.ovmap_.updateSize()},0);this.set("follow",o.follow||!1);this.extentLayer=new ol.layer.Vector({name:"Cache extent",source:new ol.source.Vector,style:o.style||[new ol.style.Style({image:new ol.style.Circle({fill:new ol.style.Fill({color:"rgba(255,0,0, 1)"}),stroke:new ol.style.Stroke({width:7,color:"rgba(255,0,0, 0.8)"}),radius:5})})]});this.ovmap_.addLayer(this.extentLayer)};ol.ext.inherits(ol.control.Globe,ol.control.Control);ol.control.Globe.prototype.setMap=function(t){this._listener&&ol.Observable.unByKey(this._listener);this._listener=null;ol.control.Control.prototype.setMap.call(this,t);t&&(this._listener=t.getView().on("propertychange",this.setView.bind(this)),this.setView())};ol.control.Globe.prototype.setView=function(){this.getMap()&&this.get("follow")&&this.setCenter(this.getMap().getView().getCenter())};ol.control.Globe.prototype.getGlobe=function(){return this.ovmap_};ol.control.Globe.prototype.show=function(t){!1!==t?this.element.classList.remove("ol-collapsed"):this.element.classList.add("ol-collapsed");this.ovmap_.updateSize()};ol.control.Globe.prototype.setPosition=function(t){/top/.test(t)?this.element.classList.add("ol-control-top"):this.element.classList.remove("ol-control-top");/right/.test(t)?this.element.classList.add("ol-control-right"):this.element.classList.remove("ol-control-right")};ol.control.Globe.prototype.setCenter=function(t,e){var o=this;if(this.pointer_.classList.add("hidden"),t){var i=this.ovmap_,r=i.getPixelFromCoordinate(t);if(r){if(!1!==e){var n=this.element.clientHeight;setTimeout(function(){o.pointer_.style.top=String(Math.min(Math.max(r[1],0),n))+"px";o.pointer_.style.left="50%";o.pointer_.classList.remove("hidden")},800)}i.getView().animate({center:[t[0],0]})}}};ol.control.Graticule=function(t){t||(t={});var e=document.createElement("div");e.className="ol-graticule ol-unselectable ol-hidden";ol.control.CanvasBase.call(this,{element:e});this.set("projection",t.projection||"EPSG:4326");var o=new ol.proj.Projection({code:this.get("projection")}).getMetersPerUnit();for(this.fac=1;o/this.fac>10;)this.fac*=10;this.fac=1e4/this.fac;this.set("maxResolution",t.maxResolution||1/0);this.set("step",t.step||.1);this.set("stepCoord",t.stepCoord||1);this.set("spacing",t.spacing||40);this.set("margin",t.margin||0);this.set("borderWidth",t.borderWidth||5);this.set("stroke",!1!==t.stroke);this.formatCoord=t.formatCoord||function(t){return t};t.style instanceof ol.style.Style?this.setStyle(t.style):this.setStyle(new ol.style.Style({stroke:new ol.style.Stroke({color:"#000",width:1}),fill:new ol.style.Fill({color:"#fff"}),text:new ol.style.Text({stroke:new ol.style.Stroke({color:"#fff",width:2}),fill:new ol.style.Fill({color:"#000"})})}))};ol.ext.inherits(ol.control.Graticule,ol.control.CanvasBase);ol.control.Graticule.prototype.setStyle=function(t){this._style=t};ol.control.Graticule.prototype._draw=function(t){if(!(this.get("maxResolution")<t.frameState.viewState.resolution)){for(var e,o=this.getContext(t),i=o.canvas,r=t.frameState.pixelRatio,n=i.width/r,s=i.height/r,a=this.get("projection"),l=this.getMap(),c=[l.getCoordinateFromPixel([0,0]),l.getCoordinateFromPixel([n,0]),l.getCoordinateFromPixel([n,s]),l.getCoordinateFromPixel([0,s])],h=-1/0,p=1/0,u=-1/0,g=1/0,d=0;e=c[d];d++)c[d]=ol.proj.transform(e,l.getView().getProjection(),a),h=Math.max(h,c[d][0]),p=Math.min(p,c[d][0]),u=Math.max(u,c[d][1]),g=Math.min(g,c[d][1]);var m=this.get("spacing"),f=this.get("step"),y=this.get("stepCoord"),v=this.get("borderWidth"),_=this.get("margin");(h-p)/f*m>n&&(f*=Math.round((h-p)/n*m/f))>this.fac&&(f=Math.round(f/this.fac)*this.fac);p=Math.floor(p/f)*f-f;g=Math.floor(g/f)*f-f;h=Math.floor(h/f)*f+2*f;u=Math.floor(u/f)*f+2*f;var x=ol.proj.get(a).getExtent();x&&(p<x[0]&&(p=x[0]),g<x[1]&&(g=x[1]),h>x[2]&&(h=x[2]+f),u>x[3]&&(u=x[3]+f));var w=this.getStyle().getStroke()&&this.get("stroke"),S=this.getStyle().getText(),b=this.getStyle().getFill();o.save();o.scale(r,r);o.beginPath();o.rect(_,_,n-2*_,s-2*_);o.clip();o.beginPath();for(var M,E,T,L,P={top:[],left:[],bottom:[],right:[]},C=p;C<h;C+=f)for(T=ol.proj.transform([C,g],a,l.getView().getProjection()),T=l.getPixelFromCoordinate(T),w&&o.moveTo(T[0],T[1]),E=T,M=g+f;M<=u;M+=f)L=ol.proj.transform([C,M],a,l.getView().getProjection()),L=l.getPixelFromCoordinate(L),w&&o.lineTo(L[0],L[1]),E[1]>0&&L[1]<0&&P.top.push([C,E]),E[1]>s&&L[1]<s&&P.bottom.push([C,E]),E=L;for(M=g;M<u;M+=f)for(T=ol.proj.transform([p,M],a,l.getView().getProjection()),T=l.getPixelFromCoordinate(T),w&&o.moveTo(T[0],T[1]),E=T,C=p+f;C<=h;C+=f)L=ol.proj.transform([C,M],a,l.getView().getProjection()),L=l.getPixelFromCoordinate(L),w&&o.lineTo(L[0],L[1]),E[0]<0&&L[0]>0&&P.left.push([M,E]),E[0]<n&&L[0]>n&&P.right.push([M,E]),E=L;if(w&&(o.strokeStyle=this.getStyle().getStroke().getColor(),o.lineWidth=this.getStyle().getStroke().getWidth(),o.stroke()),S){var k,A;o.fillStyle=this.getStyle().getText().getFill().getColor();o.strokeStyle=this.getStyle().getText().getStroke().getColor();o.lineWidth=this.getStyle().getText().getStroke().getWidth();o.textAlign="center";o.textBaseline="hanging";var F=(b?v:0)+_+2;for(d=0;k=P.top[d];d++)Math.round(k[0]/this.get("step"))%y||(A=this.formatCoord(k[0]),o.strokeText(A,k[1][0],F),o.fillText(A,k[1][0],F));for(o.textBaseline="alphabetic",d=0;k=P.bottom[d];d++)Math.round(k[0]/this.get("step"))%y||(A=this.formatCoord(k[0]),o.strokeText(A,k[1][0],s-F),o.fillText(A,k[1][0],s-F));for(o.textBaseline="middle",o.textAlign="left",d=0;k=P.left[d];d++)Math.round(k[0]/this.get("step"))%y||(A=this.formatCoord(k[0]),o.strokeText(A,F,k[1][1]),o.fillText(A,F,k[1][1]));for(o.textAlign="right",d=0;k=P.right[d];d++)Math.round(k[0]/this.get("step"))%y||(A=this.formatCoord(k[0]),o.strokeText(A,n-F,k[1][1]),o.fillText(A,n-F,k[1][1]))}if(b){var I,D,N=this.getStyle().getFill().getColor();for((D=this.getStyle().getStroke())?I=this.getStyle().getStroke().getColor():(I=N,N="#fff"),o.strokeStyle=I,o.lineWidth=D?D.getWidth():1,d=1;d<P.top.length;d++)o.beginPath(),o.rect(P.top[d-1][1][0],_,P.top[d][1][0]-P.top[d-1][1][0],v),o.fillStyle=Math.round(P.top[d][0]/f)%2?I:N,o.fill(),o.stroke();for(d=1;d<P.bottom.length;d++)o.beginPath(),o.rect(P.bottom[d-1][1][0],s-v-_,P.bottom[d][1][0]-P.bottom[d-1][1][0],v),o.fillStyle=Math.round(P.bottom[d][0]/f)%2?I:N,o.fill(),o.stroke();for(d=1;d<P.left.length;d++)o.beginPath(),o.rect(_,P.left[d-1][1][1],v,P.left[d][1][1]-P.left[d-1][1][1]),o.fillStyle=Math.round(P.left[d][0]/f)%2?I:N,o.fill(),o.stroke();for(d=1;d<P.right.length;d++)o.beginPath(),o.rect(n-v-_,P.right[d-1][1][1],v,P.right[d][1][1]-P.right[d-1][1][1]),o.fillStyle=Math.round(P.right[d][0]/f)%2?I:N,o.fill(),o.stroke();o.beginPath();o.fillStyle=I;o.rect(_,_,v,v);o.rect(_,s-v-_,v,v);o.rect(n-v-_,_,v,v);o.rect(n-v-_,s-v-_,v,v);o.fill()}o.restore()}};ol.control.GridReference=function(t){t||(t={});var e=document.createElement("div");e.className=(t.target?"":"ol-control ")+"ol-gridreference ol-unselectable "+(t.className||"");t.style=t.style||new ol.style.Style({stroke:new ol.style.Stroke({color:"#000",width:1}),text:new ol.style.Text({font:"bold 14px Arial",stroke:new ol.style.Stroke({color:"#fff",width:2}),fill:new ol.style.Fill({color:"#000"})})});ol.control.CanvasBase.call(this,{element:e,target:t.target,style:t.style});"function"==typeof t.property&&(this.getFeatureName=t.property);"function"==typeof t.sortFeatures&&(this.sortFeatures=t.sortFeatures);"function"==typeof t.indexTitle&&(this.indexTitle=t.indexTitle);this.source_=t.source;t.source&&(this.setIndex(t.source.getFeatures(),t),t.source.once("change",function(){"ready"===t.source.getState()&&this.setIndex(t.source.getFeatures(),t)}.bind(this)));this.set("maxResolution",t.maxResolution||1/0);this.set("extent",t.extent);this.set("size",t.size);this.set("margin",t.margin||0);this.set("property",t.property||"name");this.set("filterLabel",t.filterLabel||"filter")};ol.ext.inherits(ol.control.GridReference,ol.control.CanvasBase);ol.control.GridReference.prototype.getFeatureName=function(t){return t.get(this.get("property")||"name")};ol.control.GridReference.prototype.sortFeatures=function(t,e){return this.getFeatureName(t)==this.getFeatureName(e)?0:this.getFeatureName(t)<this.getFeatureName(e)?-1:1};ol.control.GridReference.prototype.indexTitle=function(t){return this.getFeatureName(t).charAt(0)};ol.control.GridReference.prototype.setIndex=function(t){if(this.getMap()){var e=this;t.getArray&&(t=t.getArray());t.sort(function(t,o){return e.sortFeatures(t,o)});this.element.innerHTML="";var o=this.element,i=document.createElement("input");i.setAttribute("type","search");i.setAttribute("placeholder",this.get("filterLabel")||"filter");var r=function(){var t=this.value.replace(/^\*/,""),e=new RegExp(t,"i");a.querySelectorAll("li").forEach(function(t){t.style.display=t.classList.contains("ol-title")?"":e.test(t.querySelector(".ol-name").textContent)?"":"none"});a.querySelectorAll("li.ol-title").forEach(function(t){var e=!1;e=[].filter.call(t.parentNode.children,function(o){return o.previousElementSibling===t?e=!0:e});console.log(e);var o=e[0];t.style.display=o.length&&!o.classList.contains("ol-title")?"":"none"})};i.addEventListener("search",r);i.addEventListener("keyup",r);o.appendChild(i);var n,s,a=document.createElement("ul");o.appendChild(a);for(var l,c=0;l=t[c];c++)!function(t){if(n=e.getReference(t.getGeometry().getFirstCoordinate())){var o=e.getFeatureName(t),i=e.indexTitle(t);if(i!=s){var r=document.createElement("li");r.classList.add("ol-title");r.textContent=i;a.appendChild(r)}s=i;var l=document.createElement("li"),c=document.createElement("span");c.classList.add("ol-name");c.textContent=o;l.appendChild(c);var h=document.createElement("span");h.classList.add("ol-ref");h.textContent=n;l.appendChild(h);var p=t;l.addEventListener("click",function(){e.dispatchEvent({type:"select",feature:p})});a.appendChild(l)}}(l)}};ol.control.GridReference.prototype.getReference=function(t){if(this.getMap()){var e=this.get("extent"),o=this.get("size"),i=Math.floor((t[0]-e[0])/(e[2]-e[0])*o[0]);if(i<0||i>=o[0])return"";var r=Math.floor((e[3]-t[1])/(e[3]-e[1])*o[1]);return r<0||r>=o[1]?"":String.fromCharCode(65+i)+r}};ol.control.GridReference.prototype._draw=function(t){if(!(this.get("maxResolution")<t.frameState.viewState.resolution)){var e=this.getContext(t),o=e.canvas,i=t.frameState.pixelRatio,r=o.width/i,n=o.height/i,s=this.get("extent"),a=this.get("size"),l=this.getMap(),c=ol.extent.boundingExtent([l.getPixelFromCoordinate([s[0],s[1]]),l.getPixelFromCoordinate([s[2],s[3]])]),h=[c[0],c[1]],p=[c[2],c[3]],u=(p[0]-h[0])/a[0],g=(p[1]-h[1])/a[1];e.save();var d,m=this.get("margin");for(e.scale(i,i),e.strokeStyle=this.getStroke().getColor(),e.lineWidth=this.getStroke().getWidth(),e.beginPath(),d=0;d<=a[0];d++)e.moveTo(h[0]+d*u,h[1]),e.lineTo(h[0]+d*u,p[1]);for(d=0;d<=a[1];d++)e.moveTo(h[0],h[1]+d*g),e.lineTo(p[0],h[1]+d*g);e.stroke();e.font=this.getTextFont();e.fillStyle=this.getTextFill().getColor();e.strokeStyle=this.getTextStroke().getColor();var f,y,v,_=m+(e.lineWidth=this.getTextStroke().getWidth());for(e.textAlign="center",d=0;d<a[0];d++)f=String.fromCharCode(65+d),y=h[0]+d*u+u/2,(v=h[1]-_)<0?(v=_,e.textBaseline="hanging"):e.textBaseline="alphabetic",e.strokeText(f,y,v),e.fillText(f,y,v),(v=p[1]+_)>n?(v=n-_,e.textBaseline="alphabetic"):e.textBaseline="hanging",e.strokeText(f,y,v),e.fillText(f,y,v);for(e.textBaseline="middle",d=0;d<a[1];d++)v=h[1]+d*g+g/2,e.textAlign="right",(y=h[0]-_)<0?(y=_,e.textAlign="left"):e.textAlign="right",e.strokeText(d,y,v),e.fillText(d,y,v),(y=p[0]+_)>r?(y=r-_,e.textAlign="right"):e.textAlign="left",e.strokeText(d,y,v),e.fillText(d,y,v);e.restore()}};ol.control.Imageline=function(t){var e=ol.ext.element.create("DIV",{className:(t.className||"")+" ol-imageline"+(t.target?"":" ol-unselectable ol-control")+(t.collapsed&&t.collapsible?"ol-collapsed":"")+("ontouchstart"in window?" ol-touch":"")});!t.target&&t.collapsible&&ol.ext.element.create("BUTTON",{type:"button",click:function(){this.toggle()}.bind(this),parent:e});this._source=t.source;ol.control.Control.call(this,{element:e,target:t.target});this._setScrolling();this._scrolldiv.addEventListener("scroll",function(){this.getMap()&&this.getMap().render()}.bind(this));"function"==typeof t.getImage&&(this._getImage=t.getImage);"function"==typeof t.getTitle&&(this._getTitle=t.getTitle);this.set("maxFeatures",t.maxFeatures||100);this.set("linkColor",t.linkColor||!1);this.set("hover",t.hover||!1);this.set("useExtent",t.useExtent||!1);this.refresh()};ol.ext.inherits(ol.control.Imageline,ol.control.Control);ol.control.Imageline.prototype.setMap=function(t){this._listener&&this._listener.forEach(function(t){ol.Observable.unByKey(t)}.bind(this));this._listener=null;ol.control.Control.prototype.setMap.call(this,t);t&&(this._listener=[t.on("postcompose",this._drawLink.bind(this)),t.on("moveend",function(){this.get("useExtent")&&this.refresh()}.bind(this))])};ol.control.Imageline.prototype.useExtent=function(t){this.set("useExtent",t);this.refresh()};ol.control.Imageline.prototype.isCollapsed=function(){return this.element.classList.contains("ol-collapsed")};ol.control.Imageline.prototype.collapse=function(t){t?this.element.classList.add("ol-collapsed"):this.element.classList.remove("ol-collapsed");this.getMap()&&setTimeout(function(){this.getMap().render()}.bind(this),this.isCollapsed()?0:250);this.dispatchEvent({type:"collapse",collapsed:this.isCollapsed()})};ol.control.Imageline.prototype.toggle=function(){this.element.classList.toggle("ol-collapsed");this.getMap()&&setTimeout(function(){this.getMap().render()}.bind(this),this.isCollapsed()?0:250);this.dispatchEvent({type:"collapse",collapsed:this.isCollapsed()})};ol.control.Imageline.prototype._getImage=function(t){return t.get("img")};ol.control.Imageline.prototype._getTitle=function(){return""};ol.control.Imageline.prototype.getFeatures=function(){var t=this.getMap();if(this.get("useExtent")&&t){var e=t.getView().calculateExtent(t.getSize());return this._source.getFeaturesInExtent(e)}return this._source.getFeatures()};ol.control.Imageline.prototype._setScrolling=function(){var t=this._scrolldiv=ol.ext.element.create("DIV",{parent:this.element});ol.ext.element.scrollDiv(t,{onmove:function(t){this._moving=t}.bind(this)})};ol.control.Imageline.prototype.refresh=function(){this._scrolldiv.innerHTML="";var t=this.getFeatures(),e=this._select?this._select.feature:null;this._select&&(this._select.elt=null);this._iline=[];this.getMap()&&this.getMap().render();for(var o,i=function(t){if(this._getImage(t)){var o=ol.ext.element.create("DIV",{className:"ol-image",parent:this._scrolldiv});ol.ext.element.create("IMG",{src:this._getImage(t),parent:o}).addEventListener("load",function(){this.classList.add("ol-loaded")});ol.ext.element.create("SPAN",{html:this._getTitle(t),parent:o});var i={elt:o,feature:t};o.addEventListener("click",function(){this._moving||(this.dispatchEvent({type:"select",feature:t}),this._scrolldiv.scrollLeft=o.offsetLeft+ol.ext.element.getStyle(o,"width")/2-ol.ext.element.getStyle(this.element,"width")/2,this._select&&this._select.elt.classList.remove("select"),this._select=i,this._select.elt.classList.add("select"))}.bind(this));o.addEventListener("mouseover",function(t){this.get("hover")&&(this._select&&this._select.elt.classList.remove("select"),this._select=i,this._select.elt.classList.add("select"),this.getMap().render(),t.stopPropagation())}.bind(this));o.addEventListener("mouseout",function(t){this.get("hover")&&(this._select&&this._select.elt.classList.remove("select"),this._select=!1,this.getMap().render(),t.stopPropagation())}.bind(this));o.ondragstart=function(){return!1};this._iline.push(i);e===t&&(this._select=i,i.elt.classList.add("select"))}}.bind(this),r=this.get("maxFeatures"),n=0;(o=t[n])&&!(r--<0);n++)i(o);this._select&&this._select.feature&&!this._select.elt&&i(this._select.feature)};ol.control.Imageline.prototype.select=function(t,e){this._select=!1;this._iline.forEach(function(o){o.feature===t?(o.elt.classList.add("select"),this._select=o,!1!==e&&(this._scrolldiv.scrollLeft=o.elt.offsetLeft+ol.ext.element.getStyle(o.elt,"width")/2-ol.ext.element.getStyle(this.element,"width")/2)):o.elt.classList.remove("select")}.bind(this))};ol.control.Imageline.prototype._drawLink=function(t){if(!(!this.get("linkColor")|this.isCollapsed())&&this.getMap()&&this._select&&this._select.elt){var e=t.context||ol.ext.getMapCanvas(this.getMap()).getContext("2d"),o=t.frameState.pixelRatio,i=[this._select.elt.offsetLeft-this._scrolldiv.scrollLeft+ol.ext.element.getStyle(this._select.elt,"width")/2,parseFloat(ol.ext.element.getStyle(this.element,"top"))||this.getMap().getSize()[1]],r=this._select.feature.getGeometry().getFirstCoordinate();r=this.getMap().getPixelFromCoordinate(r);e.save();e.fillStyle=this.get("linkColor");e.beginPath();r[0]>i[0]?(e.moveTo((i[0]-5)*o,i[1]*o),e.lineTo((i[0]+5)*o,(i[1]+5)*o)):(e.moveTo((i[0]-5)*o,(i[1]+5)*o),e.lineTo((i[0]+5)*o,i[1]*o));e.lineTo(r[0]*o,r[1]*o);e.fill();e.restore()}};ol.control.IsochroneGeoportail=function(t){var e=this;t||(t={});null==t.typing&&(t.typing=300);var o=(t.className?t.className:"")+" ol-isochrone ol-routing";t.target||(o+=" ol-unselectable ol-control");var i=ol.ext.element.create("DIV",{className:o});t.target||ol.ext.element.create("BUTTON",{parent:i}).addEventListener("click",function(){i.classList.toggle("ol-collapsed")});ol.control.Control.call(this,{element:i,target:t.target});this.set("iter",1);var r=ol.ext.element.create("DIV",{className:"content",parent:i});this._addSearchCtrl(r,t);ol.ext.element.create("BUTTON",{className:"ol-button ol-method-time selected",title:"isochrone",parent:r}).addEventListener("click",function(){this.setMethod("time")}.bind(this));ol.ext.element.create("I",{className:"ol-button ol-method-distance",title:"isodistance",parent:r}).addEventListener("click",function(){this.setMethod("distance")}.bind(this));ol.ext.element.create("I",{className:"ol-button ol-car selected",title:"by car",parent:r}).addEventListener("click",function(){this.setMode("car")}.bind(this));ol.ext.element.create("I",{className:"ol-button ol-pedestrian",title:"by foot",parent:r}).addEventListener("click",function(){this.setMode("pedestrian")}.bind(this));ol.ext.element.create("I",{className:"ol-button ol-direction-direct selected",title:"direct",parent:r}).addEventListener("click",function(){this.setDirection("direct")}.bind(this));ol.ext.element.create("I",{className:"ol-button ol-direction-reverse",title:"reverse",parent:r}).addEventListener("click",function(){this.setDirection("reverse")}.bind(this));var n=ol.ext.element.create("DIV",{className:"ol-time",parent:r});ol.ext.element.create("DIV",{html:"isochrone:",parent:n});ol.ext.element.create("INPUT",{type:"number",parent:n,min:0}).addEventListener("change",function(){e.set("hour",Number(this.value))});ol.ext.element.create("TEXT",{parent:n,html:"h"});ol.ext.element.create("INPUT",{type:"number",parent:n,min:0}).addEventListener("change",function(){e.set("minute",Number(this.value))});ol.ext.element.create("TEXT",{parent:n,html:"mn"});n=ol.ext.element.create("DIV",{className:"ol-distance",parent:r});ol.ext.element.create("DIV",{html:"isodistance:",parent:n});ol.ext.element.create("INPUT",{type:"number",step:"any",parent:n,min:0}).addEventListener("change",function(){e.set("distance",Number(this.value))});ol.ext.element.create("TEXT",{parent:n,html:"km"});n=ol.ext.element.create("DIV",{className:"ol-iter",parent:r});ol.ext.element.create("DIV",{html:"Iteration:",parent:n});ol.ext.element.create("INPUT",{type:"number",parent:n,value:1,min:1}).addEventListener("change",function(){e.set("iter",Number(this.value))});ol.ext.element.create("I",{className:"ol-ok",html:"ok",parent:r}).addEventListener("click",function(){var t=0;switch(this.get("method")){case"distance":t=1e3*this.get("distance");break;default:t=3600*(this.get("hour")||0)+60*(this.get("minute")||0)}t&&this.get("coordinate")&&this.search(this.get("coordinate"),t)}.bind(this));this.set("url","https://wxs.ign.fr/"+t.apiKey+"/isochrone/isochrone.json");this._ajax=new ol.ext.Ajax({dataType:"JSON",auth:t.auth});this._ajax.on("success",this._success.bind(this));this._ajax.on("error",this._error.bind(this));this._ajax.on("loadstart",function(){this.element.classList.add("ol-searching")}.bind(this));this._ajax.on("loadend",function(){this.element.classList.remove("ol-searching")}.bind(this));this.setMethod(t.method)};ol.ext.inherits(ol.control.IsochroneGeoportail,ol.control.Control);ol.control.IsochroneGeoportail.prototype.setMap=function(t){ol.control.Control.prototype.setMap.call(this,t);this._search.setMap(t)};ol.control.IsochroneGeoportail.prototype._addSearchCtrl=function(t,e){var o=ol.ext.element.create("DIV",{parent:t}),i=this._search=new ol.control.SearchGeoportail({className:"IGNF ol-collapsed",apiKey:e.apiKey,target:o});i.on("select",function(t){i.setInput(t.search.fulltext);this.set("coordinate",t.coordinate)}.bind(this));i.on("change:input",function(){this.set("coordinate",!1)}.bind(this))};ol.control.IsochroneGeoportail.prototype.setMethod=function(t){t=/distance/.test(t)?"distance":"time";this.element.querySelector(".ol-method-time").classList.remove("selected");this.element.querySelector(".ol-method-distance").classList.remove("selected");this.element.querySelector(".ol-method-"+t).classList.add("selected");this.element.querySelector("div.ol-time").classList.remove("selected");this.element.querySelector("div.ol-distance").classList.remove("selected");this.element.querySelector("div.ol-"+t).classList.add("selected");this.set("method",t)};ol.control.IsochroneGeoportail.prototype.setMode=function(t){this.set("mode",t);this.element.querySelector(".ol-car").classList.remove("selected");this.element.querySelector(".ol-pedestrian").classList.remove("selected");this.element.querySelector(".ol-"+t).classList.add("selected")};ol.control.IsochroneGeoportail.prototype.setDirection=function(t){this.set("direction",t);this.element.querySelector(".ol-direction-direct").classList.remove("selected");this.element.querySelector(".ol-direction-reverse").classList.remove("selected");this.element.querySelector(".ol-direction-"+t).classList.add("selected")};ol.control.IsochroneGeoportail.prototype.search=function(t,e,o){var i=this.getMap()?this.getMap().getView().getProjection():"EPSG:3857",r=/distance/.test(this.get("method"))?"distance":"time";if("string"==typeof e){var n=e.replace(/([0-9|.]*)([a-z]*)$/,"$2");switch(r="time",e=parseFloat(e),n){case"mn":e*=60;break;case"h":e*=3600;break;case"m":r="distance";break;case"km":r="distance";e*=1e3}}var s=Math.round(e*(this.get("iter")-(o||0))/this.get("iter"));if("number"==typeof e){var a={"gp-access-lib":"2.1.0",location:ol.proj.toLonLat(t,i),graphName:"pedestrian"===this.get("mode")?"Pieton":"Voiture",exclusions:this.get("exclusions")||void 0,method:r,time:"time"===r?s:void 0,distance:"distance"===r?s:void 0,reverse:"reverse"===this.get("direction"),smoothing:this.get("smoothing")||!0,holes:this.get("holes")||!1};this._ajax.send(this.get("url"),a,{coord:t,option:e,data:a,iteration:(o||0)+1})}};ol.control.IsochroneGeoportail.prototype._success=function(t){var e=this.getMap()?this.getMap().getView().getProjection():"EPSG:3857",o=new ol.format.WKT,i=t.response;i.feature=o.readFeature(i.wktGeometry,{dataProjection:"EPSG:4326",featureProjection:e});i.feature.set("iteration",t.options.iteration);i.feature.set("method",t.options.data.method);i.feature.set(t.options.data.method,t.options.data[t.options.data.method]);delete i.wktGeometry;i.type="isochrone";i.iteration=t.options.iteration-1;this.dispatchEvent(i);t.options.iteration<this.get("iter")&&this.search(t.options.coord,t.options.option,t.options.iteration)};ol.control.IsochroneGeoportail.prototype._error=function(){this.dispatchEvent({type:"error"})};ol.control.LayerPopup=function(t){(t=t||{}).switcherClass="ol-layerswitcher-popup";!1!==t.mouseover&&(t.mouseover=!0);ol.control.LayerSwitcher.call(this,t)};ol.ext.inherits(ol.control.LayerPopup,ol.control.LayerSwitcher);ol.control.LayerPopup.prototype.overflow=function(){};ol.control.LayerPopup.prototype.drawList=function(t,e){var o=this,i=function(t){t.preventDefault();var i=o._getLayerForLI(this);o.switchLayerVisibility(i,e);"touchstart"==t.type&&o.element.classList.add("ol-collapsed")};e.forEach(function(e){if(o.displayInLayerSwitcher(e)){var r=ol.ext.element.create("LI",{html:e.get("title")||e.get("name"),on:{"click touchstart":i},parent:t});o._setLayerForLI(r,e);o.testLayerVisibility(e)&&r.classList.add("ol-layer-hidden");e.getVisible()&&r.classList.add("select")}})};ol.control.LayerSwitcherImage=function(t){(t=t||{}).switcherClass="ol-layerswitcher-image";!1!==t.mouseover&&(t.mouseover=!0);ol.control.LayerSwitcher.call(this,t)};ol.ext.inherits(ol.control.LayerSwitcherImage,ol.control.LayerSwitcher);ol.control.LayerSwitcherImage.prototype.drawList=function(t,e){var o=this,i=function(t){t.preventDefault();var i=o._getLayerForLI(this);o.switchLayerVisibility(i,e);"touchstart"==t.type&&o.element.classList.add("ol-collapsed")};ol.ext.element.setStyle(t,{height:"auto"});e.forEach(function(e){if(o.displayInLayerSwitcher(e)){var r=e.getPreview?e.getPreview():["none"],n=ol.ext.element.create("LI",{className:"ol-imgcontainer"+(e.getVisible()?" select":""),on:{"touchstart click":i},parent:t});o._setLayerForLI(n,e);r.forEach(function(t){ol.ext.element.create("IMG",{src:t,parent:n})});ol.ext.element.create("p",{html:e.get("title")||e.get("name"),parent:n});o.testLayerVisibility(e)&&n.classList.add("ol-layer-hidden")}})};ol.control.LayerSwitcherImage.prototype.overflow=function(){};ol.control.Legend=function(t){t=t||{};var e=document.createElement("div");if(t.target)e.className=t.className||"ol-legend";else{e.className=(t.className||"ol-legend")+" ol-unselectable ol-control ol-collapsed"+(!1===t.collapsible?" ol-uncollapsible":"");var o=document.createElement("button");o.setAttribute("type","button");o.addEventListener("click",function(){e.classList.toggle("ol-collapsed")});e.appendChild(o);(o=document.createElement("button")).setAttribute("type","button");o.className="ol-closebox";o.addEventListener("click",function(){e.classList.toggle("ol-collapsed")});e.appendChild(o)}this._imgElement=document.createElement("div");this._imgElement.className="ol-legendImg";e.appendChild(this._imgElement);this._tableElement=document.createElement("ul");e.appendChild(this._tableElement);ol.control.Control.call(this,{element:e,target:t.target});this._rows=[];this.set("size",t.size||[40,25]);this.set("margin",0===t.margin?0:t.margin||10);this.set("title",t.title||"");this._style=t.style;!1===t.collapsed&&this.show();this.refresh()};ol.ext.inherits(ol.control.Legend,ol.control.Control);ol.control.Legend.prototype.setStyle=function(t){this._style=t;this.refresh()};ol.control.Legend.prototype.addRow=function(t){this._rows.push(t||{});this.refresh()};ol.control.Legend.prototype.removeRow=function(t){this._rows.splice(t,1);this.refresh()};ol.control.Legend.prototype.getRow=function(t){return this._rows[t]};ol.control.Legend.prototype.getLength=function(){return this._rows.length};ol.control.Legend.prototype.refresh=function(){var t=this,e=this._tableElement;e.innerHTML="";var o=this.get("size")[0]+2*this.get("margin"),i=this.get("size")[1]+2*this.get("margin");function r(r,n,s,a){var l=document.createElement("li");l.style.height=i+"px";l.addEventListener("click",function(){t.dispatchEvent({type:"select",title:r,row:s,index:a})});var c=document.createElement("div");l.appendChild(c);c.style.height=i+"px";c=document.createElement("div");n?l.className="ol-title":c.style.paddingLeft=o+"px";c.innerHTML=r||"";l.appendChild(c);e.appendChild(l)}this.get("title")&&r(this.get("title"),!0,{},-1);var n=document.createElement("canvas");n.width=5*o;n.height=(this._rows.length+1)*i*ol.has.DEVICE_PIXEL_RATIO;this._imgElement.innerHTML="";this._imgElement.append(n);this._imgElement.style.height=(this._rows.length+1)*i+"px";for(var s,a=0;s=this._rows[a];a++)r(s.title,!1,s,a),n=this.getStyleImage(s,n,a+(this.get("title")?1:0))};ol.control.Legend.prototype.show=function(){this.element.classList.remove("ol-collapsed")};ol.control.Legend.prototype.hide=function(){this.element.classList.add("ol-collapsed")};ol.control.Legend.prototype.toggle=function(){this.element.classList.toggle("ol-collapsed")};ol.control.Legend.prototype.getStyleImage=function(t,e,o){t=t||{};var i=this.get("size"),r=i[0]+2*this.get("margin"),n=i[1]+2*this.get("margin"),s=e,a=ol.has.DEVICE_PIXEL_RATIO;s||((s=document.createElement("canvas")).width=r*a,s.height=n*a);var l=s.getContext("2d");l.save();var c,h=ol.render.toContext(l),p=t.typeGeom,u=t.feature;!u&&t.properties&&p&&(u=/Point/.test(p)?new ol.Feature(new ol.geom.Point([0,0])):/LineString/.test(p)?new ol.Feature(new ol.geom.LineString([0,0])):new ol.Feature(new ol.geom.Polygon([[0,0]]))).setProperties(t.properties);u?("function"==typeof(c=u.getStyle())&&(c=c(u)),c||(c="function"==typeof this._style?this._style(u):this._style||[]),p=u.getGeometry().getType()):c=t.style;c instanceof Array||(c=[c]);var g,d,m=r/2,f=n/2,y=i[0]/2,v=i[1]/2;if("Point"===p){var _=null;for(g=0;d=c[g];g++){var x=d.getImage();if(x&&x.getAnchor){var w=x.getAnchor(),S=x.getSize(),b=w[0]-S[0],C=w[1]-S[1];_?ol.extent.extend(_,[b,C,b+S[0],C+S[1]]):_=[b,C,b+S[0],C+S[1]]}}_&&(m+=(_[2]+_[0])/2,f+=(_[3]+_[1])/2)}for(f+=e?o*n:0,g=0;d=c[g];g++)switch(h.setStyle(d),p){case ol.geom.Point:case"Point":h.drawGeometry(new ol.geom.Point([m,f]));break;case ol.geom.LineString:case"LineString":l.save();l.rect(this.get("margin")*a,0,i[0]*a,s.height);l.clip();h.drawGeometry(new ol.geom.LineString([[m-y,f],[m+y,f]]));l.restore();break;case ol.geom.Polygon:case"Polygon":h.drawGeometry(new ol.geom.Polygon([[[m-y,f-v],[m+y,f-v],[m+y,f+v],[m-y,f+v],[m-y,f-v]]]))}return l.restore(),s};ol.control.MapZone=function(t){t||(t={});var e=document.createElement("div");if(t.target)e=ol.ext.element.create("DIV",{className:t.className||"ol-mapzone"});else{e=ol.ext.element.create("DIV",{className:(t.className||"ol-mapzone")+" ol-unselectable ol-control ol-collapsed"});var o=ol.ext.element.create("BUTTON",{type:"button",on:{click:function(){e.classList.toggle("ol-collapsed");i.forEach(function(t){t.updateSize()})}.bind(this)},parent:e});ol.ext.element.create("I",{parent:o})}ol.control.Control.call(this,{element:e,target:t.target});var i=this._maps=[];t.zones.forEach(function(o){var r=new ol.View({zoom:6,center:[0,0],projection:t.projection}),n=ol.proj.transformExtent(o.extent,"EPSG:4326",r.getProjection());console.log(n,o.extent);var s=ol.ext.element.create("DIV",{className:"ol-mapzonezone",parent:e,click:function(){this.dispatchEvent({type:"select",coordinate:ol.extent.getCenter(n),extent:n});!1!==t.centerOnClick&&this.getMap().getView().fit(n);this.setVisible(!1)}.bind(this)}),a=new t.layer.constructor({source:t.layer.getSource()}),l=new ol.Map({target:s,view:r,controls:[],interactions:[],layers:[a]});i.push(l);r.fit(n);ol.ext.element.create("P",{html:o.title,parent:s})}.bind(this));setTimeout(function(){i.forEach(function(t){t.updateSize()})})};ol.ext.inherits(ol.control.MapZone,ol.control.Control);ol.control.MapZone.prototype.setVisible=function(t){t?(this.element.classList.remove("ol-collapsed"),this.getMaps().forEach(function(t){t.updateSize()})):this.element.classList.add("ol-collapsed")};ol.control.MapZone.prototype.getMaps=function(){return this._maps};ol.control.MapZone.zones={};ol.control.MapZone.zones.DOM=[{title:"Guadeloupe",extent:[-61.898594315312444,15.75623038647845,-60.957887532935324,16.575317670979473]},{title:"Guyane",extent:[-54.725259310727147,2.1603763430019,-51.528236062921344,5.7984307809552575]},{title:"Martinique",extent:[-61.257556528564756,14.387506317407514,-60.76934912110432,14.895067461729951]},{title:"Mayotte",extent:[44.959844536967815,-13.01674138212816,45.353288665106483,-12.655219422078289]},{title:"La réunion",extent:[55.170590129676562,-21.407680069231688,55.881957020017971,-20.85560221637526]}];ol.control.MapZone.zones.TOM=[{title:"Polynésie Française",extent:[206.23664226630862,-22.189040615809787,221.85920743981987,-10.835039595040698]},{title:"Nouvelle Calédonie",extent:[163.76420580160925,-22.581641092751838,167.66984709498706,-19.816411635668445]},{title:"St-Pierre et Miquelon",extent:[-56.453698765748676,46.744498581885551,-56.0980198121544,47.146698742297872]},{title:"Wallis et Futuna",extent:[181.7588623143665,-14.7341169873267,183.95612353301715,-13.134720799175085]},{title:"St-Martin St-Barthélemy",extent:[-63.1726389501678,17.806097291313506,-62.7606535945649,18.132676888379379]}];ol.control.MapZone.zones.DOMTOM=[{title:"Métropole",extent:[-5.3184217407125791,41.160822742929128,9.73284186155716,51.21957336557702]}].concat(ol.control.MapZone.zones.DOM,ol.control.MapZone.zones.TOM);ol.control.Notification=function(t){t=t||{};var e=document.createElement("DIV");this.contentElement=document.createElement("DIV");e.appendChild(this.contentElement);var o=(t.className||"")+" ol-notification";t.target||(o+=" ol-unselectable ol-control ol-collapsed");e.setAttribute("class",o);ol.control.Control.call(this,{element:e,target:t.target})};ol.ext.inherits(ol.control.Notification,ol.control.Control);ol.control.Notification.prototype.show=function(t,e){var o=this,i=this.element;t&&(t instanceof Node?(this.contentElement.innerHTML="",this.contentElement.appendChild(t)):this.contentElement.innerHTML=t);this._listener&&(clearTimeout(this._listener),this._listener=null);i.classList.add("ol-collapsed");this._listener=setTimeout(function(){i.classList.remove("ol-collapsed");o._listener=!e||e>=0?setTimeout(function(){i.classList.add("ol-collapsed");o._listener=null},e||3e3):null},100)};ol.control.Notification.prototype.hide=function(){this._listener&&(clearTimeout(this._listener),this._listener=null);this.element.classList.add("ol-collapsed")};ol.control.Notification.prototype.toggle=function(t){this.element.classList.contains("ol-collapsed")?this.show(null,t):this.hide()};ol.control.Overlay=function(t){t||(t={});var e=ol.ext.element.create("DIV",{className:"ol-unselectable ol-overlay "+(t.className||""),html:t.content});ol.control.Control.call(this,{element:e,target:t.target});var o=this;t.hideOnClick&&e.addEventListener("click",function(){o.hide()});this.set("closeBox",t.closeBox);this._timeout=!1;this.setContent(t.content)};ol.ext.inherits(ol.control.Overlay,ol.control.Control);ol.control.Overlay.prototype.setContent=function(t){var e=this;if(t){var o=this.element;if(t instanceof Element?(o.innerHTML="",o.appendChild(t)):void 0!==t&&(o.innerHTML=t),this.get("closeBox")){var i=document.createElement("div");i.classList.add("ol-closebox");i.addEventListener("click",function(){e.hide()});o.insertBefore(i,o.firstChild)}}};ol.control.Overlay.prototype.show=function(t,e){var o=this,i=this.element;i.style.display="block";e?(this.center_=this.getMap().getPixelFromCoordinate(e),i.style.top=this.center_[1]+"px",i.style.left=this.center_[0]+"px"):(this.center_=!1,i.style.top="",i.style.left="");t&&this.setContent(t);this._timeout&&clearTimeout(this._timeout);this._timeout=setTimeout(function(){i.classList.add("ol-visible");i.style.top="";i.style.left="";o.dispatchEvent({type:"change:visible",visible:!0,element:o.element})},10)};ol.control.Overlay.prototype.showImage=function(t,e){e=e||{};var o=ol.ext.element.create("DIV",{className:"ol-fullscreen-image"});ol.ext.element.create("IMG",{src:t,parent:o});e.title&&(o.classList.add("ol-has-title"),ol.ext.element.create("P",{html:e.title,parent:o}));this.show(o,e.coordinate)};ol.control.Overlay.prototype.hide=function(){var t=this.element;this.element.classList.remove("ol-visible");this.center_&&(t.style.top=this.center_[1]+"px",t.style.left=this.center_[0]+"px",this.center_=!1);this._timeout&&clearTimeout(this._timeout);this._timeout=setTimeout(function(){t.style.display="none"},500);this.dispatchEvent({type:"change:visible",visible:!1,element:this.element})};ol.control.Overlay.prototype.toggle=function(){this.getVisible()?this.hide():this.show()};ol.control.Overlay.prototype.getVisible=function(){return"none"!==ol.ext.element.getStyle(this.element,"display")};ol.control.Overlay.prototype.setClass=function(t){var e=this.element.classList.contains("ol-visible");this.element.className=("ol-unselectable ol-overlay "+(e?"ol-visible ":"")+t).trim()};ol.control.Overview=function(t){t=t||{};var e,o=this;if(this.minZoom=t.minZoom||0,this.maxZoom=t.maxZoom||18,this.rotation=t.rotation,t.target)e=document.createElement("div"),this.panel_=t.target;else{(e=document.createElement("div")).classList.add("ol-overview","ol-unselectable","ol-control","ol-collapsed");/top/.test(t.align)&&e.classList.add("ol-control-top");/right/.test(t.align)&&e.classList.add("ol-control-right");var i=document.createElement("button");i.setAttribute("type","button");i.addEventListener("touchstart",function(t){o.toggleMap();t.preventDefault()});i.addEventListener("click",function(){o.toggleMap()});e.appendChild(i);this.panel_=document.createElement("div");this.panel_.classList.add("panel");e.appendChild(this.panel_)}ol.control.Control.call(this,{element:e,target:t.target});this.ovmap_=new ol.Map({controls:new ol.Collection,interactions:new ol.Collection,target:this.panel_,view:new ol.View({zoom:2,center:[0,0],projection:t.projection}),layers:t.layers});this.oview_=this.ovmap_.getView();this.extentLayer=new ol.layer.Vector({name:"Cache extent",source:new ol.source.Vector,style:t.style||[new ol.style.Style({image:new ol.style.Circle({fill:new ol.style.Fill({color:"rgba(255,0,0, 1)"}),stroke:new ol.style.Stroke({width:7,color:"rgba(255,0,0, 0.8)"}),radius:5}),stroke:new ol.style.Stroke({width:5,color:"rgba(255,0,0,0.8)"})})]});this.ovmap_.addLayer(this.extentLayer);this.ovmap_.addInteraction(new ol.interaction.Pointer({handleDownEvent:function(e){var i,r,n,s,a;return!1!==t.panAnimation?"elastic"==t.panAnimation||t.elasticPan?o.getMap().getView().animate({center:e.coordinate,easing:(i=2,r=.3,n=3*i*Math.PI/2,s=r>0?-1/r:-100,a=Math.cos(n)*Math.pow(2,s),function(t){return t=1-Math.cos(t*Math.PI/2),1-Math.cos(n*t)*Math.pow(2,s*t)+a*t}),duration:1e3}):o.getMap().getView().animate({center:e.coordinate,duration:300}):o.getMap().getView().setCenter(e.coordinate),!1}}))};ol.ext.inherits(ol.control.Overview,ol.control.Control);ol.control.Overview.prototype.getOverviewMap=function(){return this.ovmap_};ol.control.Overview.prototype.toggleMap=function(){this.element.classList.toggle("ol-collapsed");this.ovmap_.updateSize();this.setView()};ol.control.Overview.prototype.setPosition=function(t){/top/.test(t)?this.element.classList.add("ol-control-top"):this.element.classList.remove("ol-control-top");/right/.test(t)?this.element.classList.add("ol-control-right"):this.element.classList.remove("ol-control-right")};ol.control.Overview.prototype.setMap=function(t){this._listener&&ol.Observable.unByKey(this._listener);this._listener=null;ol.control.Control.prototype.setMap.call(this,t);t&&(this._listener=t.getView().on("propertychange",this.setView.bind(this)),this.setView())};ol.control.Overview.prototype.calcExtent_=function(t){var e=this.getMap();if(e){var o=this.extentLayer.getSource();o.clear();var i=new ol.Feature,r=e.getSize(),n=e.getView().getResolution(),s=e.getView().getRotation(),a=e.getView().getCenter();if(n){var l=n*r[0]/2,c=n*r[1]/2,h=this.oview_.getResolution();if(l/h>5||c/h>5){var p,u,g,d=Math.cos(s),m=Math.sin(s);for(t=[[-l,-c],[-l,c],[l,c],[l,-c]],p=0;p<4;++p)u=t[p][0],g=t[p][1],t[p][0]=a[0]+u*d-g*m,t[p][1]=a[1]+u*m+g*d;i.setGeometry(new ol.geom.Polygon([t]))}else i.setGeometry(new ol.geom.Point(a));o.addFeature(i)}}};ol.control.Overview.prototype.setView=function(t){if(!t)return this.setView({key:"rotation"}),this.setView({key:"resolution"}),void this.setView({key:"center"});switch(t.key){case"rotation":this.rotation?this.oview_.setRotation(this.getMap().getView().getRotation()):this.oview_.getRotation()&&this.oview_.setRotation(0);break;case"center":var e=this.getMap().getView().calculateExtent(this.getMap().getSize()),o=this.oview_.calculateExtent(this.ovmap_.getSize());(e[0]<o[0]||e[1]<o[1]||e[2]>o[2]||e[3]>o[3])&&this.oview_.setCenter(this.getMap().getView().getCenter());break;case"resolution":var i=2*Math.round(this.oview_.getZoomForResolution(this.getMap().getView().getResolution())/2)-4;i=Math.min(this.maxZoom,Math.max(this.minZoom,i));this.oview_.setZoom(i)}this.calcExtent_()};ol.control.Permalink=function(t){var e=t||{},o=this,i=document.createElement("button");function r(){"function"==typeof e.onclick?e.onclick(o.getLink()):o.setUrlReplace(!o.replaceState_)}this.replaceState_=!1!==e.urlReplace;this.fixed_=e.fixed||6;this.hash_=e.anchor?"#":"?";this._localStorage=e.localStorage;this._localStorage||localStorage.removeItem("ol@parmalink");i.addEventListener("click",r,!1);i.addEventListener("touchstart",r,!1);var n=document.createElement("div");n.className=(e.className||"ol-permalink")+" ol-unselectable ol-control";n.appendChild(i);(e.hidden||!1===e.visible)&&ol.ext.element.hide(n);ol.control.Control.call(this,{element:n,target:e.target});this.on("change",this.viewChange_.bind(this));this.search_={};var s=this.replaceState_?document.location.hash||document.location.search:"";if(!s&&this._localStorage&&(s=localStorage["ol@parmalink"]),s){s=s.replace(/(^#|^\?)/,"").split("&");for(var a=0;a<s.length;a++){var l=s[a].split("=");switch(l[0]){case"lon":case"lat":case"z":case"r":case"l":break;default:this.search_[l[0]]=l[1]}}}this.setPosition()};ol.ext.inherits(ol.control.Permalink,ol.control.Control);ol.control.Permalink.prototype.setMap=function(t){this._listener&&(ol.Observable.unByKey(this._listener.change),ol.Observable.unByKey(this._listener.moveend));this._listener=null;ol.control.Control.prototype.setMap.call(this,t);t&&(this._listener={change:t.getLayerGroup().on("change",this.layerChange_.bind(this)),moveend:t.on("moveend",this.viewChange_.bind(this))},this.setPosition())};ol.control.Permalink.prototype.getLayerByLink=function(t,e){!e&&this.getMap()&&(e=this.getMap().getLayers().getArray());for(var o=0;o<e.length;o++){if(e[o].get("permalink")==t)return e[o];if(e[o].getLayers){var i=this.getLayerByLink(t,e[o].getLayers().getArray());if(i)return i}}return!1};ol.control.Permalink.prototype.setPosition=function(){var t=this.getMap();if(t){var e=this.replaceState_?document.location.hash||document.location.search:"";if(!e&&this._localStorage&&(e=localStorage["ol@parmalink"]),e){var o,i,r={};for(e=e.replace(/(^#|^\?)/,"").split("&"),o=0;o<e.length;o++)r[(i=e[o].split("="))[0]]=i[1];var n=ol.proj.transform([Number(r.lon),Number(r.lat)],"EPSG:4326",t.getView().getProjection());if(n[0]&&n[1]&&t.getView().setCenter(n),r.z&&t.getView().setZoom(Number(r.z)),r.r&&t.getView().setRotation(Number(r.r)),r.l){!function e(o){o||(o=t.getLayers().getArray());for(var i=0;i<o.length;i++)o[i].get("permalink")&&o[i].setVisible(!1),o[i].getLayers&&e(o[i].getLayers().getArray())}();var s=r.l.split("|");for(o=0;o<s.length;o++){i=s[o].split(":");var a=this.getLayerByLink(i[0]),l=Number(i[1]);a&&(a.setOpacity(l),a.setVisible(!0))}}}}};ol.control.Permalink.prototype.getUrlParams=function(){return this.search_};ol.control.Permalink.prototype.setUrlParam=function(t,e){t&&(void 0===e||""===e?delete this.search_[encodeURIComponent(t)]:this.search_[encodeURIComponent(t)]=encodeURIComponent(e));this.viewChange_()};ol.control.Permalink.prototype.getUrlParam=function(t){return decodeURIComponent(this.search_[encodeURIComponent(t)]||"")};ol.control.Permalink.prototype.hasUrlParam=function(t){return this.search_.hasOwnProperty(encodeURIComponent(t))};ol.control.Permalink.prototype.getLink=function(t){var e=this.getMap(),o=ol.proj.transform(e.getView().getCenter(),e.getView().getProjection(),"EPSG:4326"),i=e.getView().getZoom(),r=e.getView().getRotation(),n=this.layerStr_,s="lon="+o[0].toFixed(this.fixed_)+"&lat="+o[1].toFixed(this.fixed_)+"&z="+i+(r?"&r="+Math.round(1e4*r)/1e4:"")+(n?"&l="+n:"");for(var a in this.search_)s+="&"+a+"="+this.search_[a];return t?s:document.location.protocol+"//"+document.location.host+document.location.pathname+this.hash_+s};ol.control.Permalink.prototype.setUrlReplace=function(t){try{if(this.replaceState_=t,t)window.history.replaceState(null,null,this.getLink());else{var e="";for(var o in this.search_)e+=(""==e?"?":"&")+o+"="+this.search_[o];window.history.replaceState(null,null,document.location.origin+document.location.pathname+e)}}catch(t){}};ol.control.Permalink.prototype.viewChange_=function(){try{this.replaceState_&&window.history.replaceState(null,null,this.getLink())}catch(t){}this._localStorage&&(localStorage["ol@parmalink"]=this.getLink(!0))};ol.control.Permalink.prototype.layerChange_=function(){var t="";!function e(o){for(var i=0;i<o.length;i++)o[i].getVisible()&&o[i].get("permalink")&&(t&&(t+="|"),t+=o[i].get("permalink")+":"+o[i].get("opacity")),o[i].getLayers&&e(o[i].getLayers().getArray())}(this.getMap().getLayers().getArray());this.layerStr_=t;this.viewChange_()};ol.control.Print=function(t){t||(t={});var e=ol.ext.element.create("DIV",{className:t.className||"ol-print"});t.target||(e.classList.add("ol-unselectable","ol-control"),ol.ext.element.create("BUTTON",{type:"button",click:function(){this.print()}.bind(this),parent:e}));ol.control.Control.call(this,{element:e,target:t.target});this.set("imageType",t.imageType||"image/jpeg");this.set("quality",t.quality||.8);this.set("orientation",t.orientation)};ol.ext.inherits(ol.control.Print,ol.control.Control);ol.control.Print.prototype.print=function(t){var e=(t=t||{}).imageType||this.get("imageType"),o=t.quality||this.get("quality");if(this.getMap()){if("silent"!==t.immediate&&this.dispatchEvent(Object.assign({type:"printing"},t)),!t.immediate)return void setTimeout(function(){(t=Object.assign({},t)).immediate="silent";this.print(t)}.bind(this),200);this.getMap().once("rendercomplete",function(i){var r,n;i.context?r=i.context.canvas:this.getMap().getViewport().querySelectorAll(".ol-layer canvas, canvas.ol-fixedoverlay").forEach(function(t){if(t.width){if(!r){r=document.createElement("canvas");var o=this.getMap().getSize();r.width=o[0];r.height=o[1];n=r.getContext("2d");/jp.*g$/.test(e)&&(n.fillStyle=this.get("bgColor")||"white",n.fillRect(0,0,r.width,r.height))}if(n.save(),"0"===t.parentNode.style.opacity)return;n.globalAlpha=parseFloat(t.parentNode.style.opacity)||1;var i=ol.ext.element.getStyle(t,"transform")||ol.ext.element.getStyle(t,"-webkit-transform");/^matrix/.test(i)?((i=i.replace(/^matrix\(|\)$/g,"").split(",")).forEach(function(t,e){i[e]=parseFloat(t)}),n.transform(i[0],i[1],i[2],i[3],i[4],i[5]),n.drawImage(t,0,0)):n.drawImage(t,0,0,ol.ext.element.getStyle(t,"width"),ol.ext.element.getStyle(t,"height"));n.restore()}}.bind(this));var s,a,l,c,h=[210,297],p=t.orient||this.get("orientation"),u=t.margin||10;if(r){"landscape"!==p&&"portrait"!==p&&(p=r.width>r.height?"landscape":"portrait");"landscape"===p&&(h=[h[1],h[0]]);var g=Math.min((h[0]-2*u)/r.width,(h[1]-2*u)/r.height);s=g*r.width;a=g*r.height;l=[(h[0]-s)/2,(h[1]-a)/2]}try{c=r?r.toDataURL(e,o):null}catch(d){return void this.dispatchEvent({type:"error",canvas:r})}var d=Object.assign({type:"print",print:{format:"a4",orientation:p,unit:"mm",size:h,position:l,imageWidth:s,imageHeight:a},image:c,imageType:e,canvas:r},t);this.dispatchEvent(d)}.bind(this));this.getMap().render()}};ol.control.Profil=function(t){var e=t||{};this.info=e.info||ol.control.Profil.prototype.info;var o,i=this;if(e.target)(o=document.createElement("div")).classList.add(e.className||"ol-profil");else{(o=document.createElement("div")).className=((e.className||"ol-profil")+" ol-unselectable ol-control ol-collapsed").trim();this.button=document.createElement("button");this.button.setAttribute("type","button");var r=function(t){i.toggle();t.preventDefault()};this.button.addEventListener("click",r);this.button.addEventListener("touchstart",r);o.appendChild(this.button)}var n=document.createElement("div");n.classList.add("ol-inner");o.appendChild(n);var s=document.createElement("div");s.style.position="relative";n.appendChild(s);var a=this.ratio=2;this.canvas_=document.createElement("canvas");this.canvas_.width=(e.width||300)*a;this.canvas_.height=(e.height||150)*a;var l={msTransform:"scale(0.5,0.5)",msTransformOrigin:"0 0",webkitTransform:"scale(0.5,0.5)",webkitTransformOrigin:"0 0",mozTransform:"scale(0.5,0.5)",mozTransformOrigin:"0 0",transform:"scale(0.5,0.5)",transformOrigin:"0 0"};Object.keys(l).forEach(function(t){t in i.canvas_.style&&(i.canvas_.style[t]=l[t])});var c=document.createElement("div");s.appendChild(c);c.style.width=this.canvas_.width/a+"px";c.style.height=this.canvas_.height/a+"px";c.appendChild(this.canvas_);c.addEventListener("click",function(t){i.onMove(t)});c.addEventListener("mousemove",function(t){i.onMove(t)});ol.control.Control.call(this,{element:o,target:e.target});this.margin_={top:10*a,left:40*a,bottom:30*a,right:10*a};this.info.ytitle||(this.margin_.left-=20*a);this.info.xtitle||(this.margin_.bottom-=20*a);this.bar_=document.createElement("div");this.bar_.classList.add("ol-profilbar");this.bar_.style.top=this.margin_.top/a+"px";this.bar_.style.height=(this.canvas_.height-this.margin_.top-this.margin_.bottom)/a+"px";s.appendChild(this.bar_);this.cursor_=document.createElement("div");this.cursor_.classList.add("ol-profilcursor");s.appendChild(this.cursor_);this.popup_=document.createElement("div");this.popup_.classList.add("ol-profilpopup");this.cursor_.appendChild(this.popup_);var h=document.createElement("table");h.cellPadding="0";h.cellSpacing="0";h.style.clientWidth=this.canvas_.width/a+"px";s.appendChild(h);var p=document.createElement("tr");p.classList.add("track-info");h.appendChild(p);var u=document.createElement("td");u.innerHTML=(this.info.zmin||"Zmin")+': <span class="zmin">';p.appendChild(u);var g=document.createElement("td");g.innerHTML=(this.info.zmax||"Zmax")+': <span class="zmax">';p.appendChild(g);var d=document.createElement("td");d.innerHTML=(this.info.distance||"Distance")+': <span class="dist">';p.appendChild(d);var m=document.createElement("td");m.innerHTML=(this.info.time||"Time")+': <span class="time">';p.appendChild(m);var f=document.createElement("tr");f.classList.add("point-info");h.appendChild(f);var y=document.createElement("td");y.innerHTML=(this.info.altitude||"Altitude")+': <span class="z">';f.appendChild(y);var v=document.createElement("td");v.innerHTML=(this.info.distance||"Distance")+': <span class="dist">';f.appendChild(v);var _=document.createElement("td");_.innerHTML=(this.info.time||"Time")+': <span class="time">';f.appendChild(_);this.tab_=[];e.feature&&this.setGeometry(e.feature)};ol.ext.inherits(ol.control.Profil,ol.control.Control);ol.control.Profil.prototype.info={zmin:"Zmin",zmax:"Zmax",ytitle:"Altitude (m)",xtitle:"Distance (km)",time:"Time",altitude:"Altitude",distance:"Distance",altitudeUnits:"m",distanceUnitsM:"m",distanceUnitsKM:"km"};ol.control.Profil.prototype.popup=function(t){this.popup_.innerHTML=t};ol.control.Profil.prototype.onMove=function(t){if(this.tab_.length){var e=this.canvas_.getBoundingClientRect(),o=e.top+window.pageYOffset-document.documentElement.clientTop,i=e.left+window.pageXOffset-document.documentElement.clientLeft,r=t.pageX-i,n=t.pageY-o,s=this.ratio;if(r>this.margin_.left/s&&r<(this.canvas_.width-this.margin_.right)/s&&n>this.margin_.top/s&&n<(this.canvas_.height-this.margin_.bottom)/s){this.bar_.style.left=r+"px";this.bar_.style.display="block";for(var a,l=(r*s-this.margin_.left)/this.scale_[0],c=this.tab_[0],h=1;a=this.tab_[h];h++)if(a[0]>=l){l<(a[0]+c[0])/2&&(a=c);break}a?(this.cursor_.style.left=r+"px",this.cursor_.style.top=(this.canvas_.height-this.margin_.bottom+a[1]*this.scale_[1]+this.dy_)/s+"px",this.cursor_.style.display="block"):this.cursor_.style.display="none";this.bar_.parentElement.classList.add("over");this.element.querySelector(".point-info .z").textContent=a[1]+this.info.altitudeUnits;this.element.querySelector(".point-info .dist").textContent=(a[0]/1e3).toFixed(1)+this.info.distanceUnitsKM;this.element.querySelector(".point-info .time").textContent=a[2];r>this.canvas_.width/s/2?this.popup_.classList.add("ol-left"):this.popup_.classList.remove("ol-left");this.dispatchEvent({type:"over",click:"click"==t.type,coord:a[3],time:a[2],distance:a[0]})}else this.bar_.parentElement.classList.contains("over")&&(this.bar_.style.display="none",this.cursor_.style.display="none",this.bar_.parentElement.classList.remove("over"),this.dispatchEvent({type:"out"}))}};ol.control.Profil.prototype.show=function(){this.element.classList.remove("ol-collapsed");this.dispatchEvent({type:"show",show:!0})};ol.control.Profil.prototype.hide=function(){this.element.classList.add("ol-collapsed");this.dispatchEvent({type:"show",show:!1})};ol.control.Profil.prototype.toggle=function(){this.element.classList.toggle("ol-collapsed");var t=this.element.classList.contains("ol-collapsed");this.dispatchEvent({type:"show",show:!t})};ol.control.Profil.prototype.isShown=function(){return!this.element.classList.contains("ol-collapsed")};ol.control.Profil.prototype.setGeometry=function(t,e){e||(e={});t instanceof ol.Feature&&(t=t.getGeometry());var o=this.canvas_,i=o.getContext("2d"),r=o.width,n=o.height;if(i.setTransform(1,0,0,1,0,0),i.clearRect(0,0,r,n),/Z/.test(t.getLayout())){this.element.querySelector(".time").parentElement.style.display=/M/.test(t.getLayout())?"block":"none";var s=t.getCoordinates();switch(t.getType()){case"LineString":break;case"MultiLineString":s=s[0];break;default:return}var a=e.projection||this.getMap().getView().getProjection();i.setTransform(1,0,0,1,this.margin_.left,n-this.margin_.bottom);var l=this.ratio;r-=this.margin_.right+this.margin_.left;n-=this.margin_.top+this.margin_.bottom;i.strokeStyle="#000";i.lineWidth=.5*l;i.beginPath();i.moveTo(0,0);i.lineTo(0,-n);i.moveTo(0,0);i.lineTo(r,0);i.stroke();for(var h,p,u,g,d,m,f=1/0,y=-1/0,v=this.tab_=[],c=0;h=s[c];c++)(u=h[2])<f&&(f=u),u>y&&(y=u),0==c?p=0:p+=(d=s[c-1],m=h,ol.sphere.getDistance(ol.proj.transform(d,a,"EPSG:4326"),ol.proj.transform(m,a,"EPSG:4326"))),g=T(s[0][3],h[3]),v.push([p,u,g,h]);this.element.querySelector(".track-info .zmin").textContent=f.toFixed(2)+this.info.altitudeUnits;this.element.querySelector(".track-info .zmax").textContent=y.toFixed(2)+this.info.altitudeUnits;this.element.querySelector(".track-info .dist").textContent=p>1e3?(p/1e3).toFixed(1)+this.info.distanceUnitsKM:p.toFixed(1)+this.info.distanceUnitsM;this.element.querySelector(".track-info .time").textContent=g;for(var _=e.graduation||100;;){if(!(n/(((y=Math.ceil(y/_)*_)-(f=Math.floor(f/_)*_))/_)<15*l))break;_*=2}"number"==typeof e.zmin&&f>e.zmin&&(f=e.zmin);"number"==typeof e.zmax&&y<e.zmax&&(y=e.zmax);var x=e.amplitude;x&&(y=Math.max(f+x,y));var w=r/p,S=-n/(y-f),b=this.dy_=-f*S;for(this.scale_=[w,S],i.font=10*l+"px arial",i.textAlign="right",i.textBaseline="middle",i.fillStyle="#000",i.beginPath(),c=f;c<=y;c+=_)"km"!=e.zunit?i.fillText(c,-4*l,c*S+b):i.fillText((c/1e3).toFixed(1),-4*l,c*S+b),i.moveTo(-2*l,c*S+b),0!=c?i.lineTo(p*w,c*S+b):i.lineTo(0,c*S+b);i.textAlign="center";i.textBaseline="top";i.setLineDash([l,3*l]);var C,M=e.unit||"km";for(p>1e3?(C=100*Math.round(p/1e3))>1e3&&(C=1e3*Math.ceil(C/1e3)):(M="m",C=p>100?10*Math.round(p/100):p>10?Math.round(p/10):p>1?Math.round(p)/10:p),c=0;c<=p;c+=C){var E="m"==M?c:c/1e3;i.fillText(Math.round(10*E)/10,c*w,4*l);i.moveTo(c*w,2*l);i.lineTo(c*w,0)}for(i.font=12*l+"px arial",i.fillText(this.info.xtitle.replace("(km)","("+M+")"),r/2,18*l),i.save(),i.rotate(-Math.PI/2),i.fillText(this.info.ytitle,n/2,-this.margin_.left),i.restore(),i.stroke(),i.strokeStyle="#369",i.lineWidth=1,i.setLineDash([]),i.beginPath(),c=0;h=v[c];c++)0==c?i.moveTo(h[0]*w,h[1]*S+b):i.lineTo(h[0]*w,h[1]*S+b);i.stroke()}function T(t,e){if(!t||!e)return"-";var o=(e-t)/60,i=Math.trunc(o/60),r=Math.trunc(o-60*i);return i+"h"+(r<10?"0":"")+r+"mn"}};ol.control.Profil.prototype.getImage=function(t,e){return"canvas"===t?this.canvas_:this.canvas_.toDataURL(t,e)};ol.control.RoutingGeoportail=function(t){var e=this;t||(t={});null==t.typing&&(t.typing=300);this._classname=t.className||"search";var o=document.createElement("DIV"),i=(t.className||"")+" ol-routing";(t.target||(i+=" ol-unselectable ol-control"),o.setAttribute("class",i),t.target)||ol.ext.element.create("BUTTON",{parent:o}).addEventListener("click",function(){o.classList.toggle("ol-collapsed")});ol.control.Control.call(this,{element:o,target:t.target});this.set("url","https://wxs.ign.fr/"+t.apiKey+"/itineraire/rest/route.json");this._search=[];var r=ol.ext.element.create("DIV",{className:"content",parent:o}),n=ol.ext.element.create("DIV",{className:"search-input",parent:r});this._search=[];this.addSearch(n,t);this.addSearch(n,t);ol.ext.element.create("I",{className:"ol-car",title:t.carlabel||"by car",parent:r}).addEventListener("click",function(){e.setMode("car")});ol.ext.element.create("I",{className:"ol-pedestrian",title:t.pedlabel||"pedestrian",parent:r}).addEventListener("click",function(){e.setMode("pedestrian")});ol.ext.element.create("I",{className:"ol-ok",title:t.runlabel||"search",html:"OK",parent:r}).addEventListener("click",function(){e.calculate()});ol.ext.element.create("I",{className:"ol-cancel",html:"cancel",parent:r}).addEventListener("click",function(){this.resultElement.innerHTML=""}.bind(this));this.resultElement=document.createElement("DIV");this.resultElement.setAttribute("class","ol-result");o.appendChild(this.resultElement);this.setMode(t.mode||"car")};ol.ext.inherits(ol.control.RoutingGeoportail,ol.control.Control);ol.control.RoutingGeoportail.prototype.setMode=function(t){this.set("mode",t);this.element.querySelector(".ol-car").classList.remove("selected");this.element.querySelector(".ol-pedestrian").classList.remove("selected");this.element.querySelector(".ol-"+t).classList.add("selected");this.calculate()};ol.control.RoutingGeoportail.prototype.addButton=function(t,e,o){var i=document.createElement("I");return i.setAttribute("class",t),i.setAttribute("type","button"),i.setAttribute("title",e),i.innerHTML=o||"",this.element.appendChild(i),i};ol.control.RoutingGeoportail.prototype.removeSearch=function(t,e,o){t.removeChild(o);this.getMap()&&this.getMap().removeControl(o.olsearch);this._search=[];t.querySelectorAll("div").forEach(function(t){t.olsearch&&this._search.push(t.olsearch)}.bind(this))};ol.control.RoutingGeoportail.prototype.addSearch=function(t,e,o){var i=this,r=ol.ext.element.create("DIV");o?t.insertBefore(r,o.nextSibling):t.appendChild(r);ol.ext.element.create("BUTTON",{title:e.startlabel||"add/remove",parent:r}).addEventListener("click",function(o){o.ctrlKey?this._search.length>2&&this.removeSearch(t,e,r):o.shiftKey&&this.addSearch(t,e,r)}.bind(this));var n=r.olsearch=new ol.control.SearchGeoportail({className:"IGNF ol-collapsed",apiKey:e.apiKey,target:r,reverse:!0});this._search=[];t.querySelectorAll("div").forEach(function(t){t.olsearch&&this._search.push(t.olsearch)}.bind(this));n.on("select",function(t){n.setInput(t.search.fulltext);n.set("selection",t.search)});n.element.querySelector("input").addEventListener("change",function(){n.set("selection",null);i.resultElement.innerHTML=""});this.getMap()&&this.getMap().addControl(n)};ol.control.RoutingGeoportail.prototype.setMap=function(t){ol.control.Control.prototype.setMap.call(this,t);for(var e=0;e<this._search.length;e++)this._search[e].setMap(t)};ol.control.RoutingGeoportail.prototype.requestData=function(t){for(var e=t[0],o=t[t.length-1],i="",r=1;r<t.length-1;r++)i+=(i?";":"")+t[r].x+","+t[r].y;return{"gp-access-lib":"1.1.0",origin:e.x+","+e.y,destination:o.x+","+o.y,method:"time",graphName:"pedestrian"===this.get("mode")?"Pieton":"Voiture",waypoints:i,format:"STANDARDEXT"}};ol.control.RoutingGeoportail.prototype.listRouting=function(t){var e=t.duration/60;this.resultElement.innerHTML="";var o=""+(e<60?e.toFixed(0)+" min":(e/60).toFixed(0)+" h "+(e%60).toFixed(0)+" min");var i=t.distance;o+=i<1e3?" ("+i.toFixed(0)+" m)":" ("+(i/1e3).toFixed(2)+" km)";var r=document.createElement("i");r.textContent=o;this.resultElement.appendChild(r);var n=document.createElement("ul");this.resultElement.appendChild(n);for(var s,a={none:"Prendre sur ",R:"Tourner à droite sur ",FR:"Tourner légèrement à droite sur ",L:"Tourner à gauche sur ",FL:"Tourner légèrement à gauche sur ",F:"Continuer tout droit sur "},l=0;s=t.features[l];l++){var c=s.get("distance");c=c<1e3?c.toFixed(0)+" m":(c/1e3).toFixed(2)+" km";o=s.get("durationT")/60;console.log(s.get("duration"),o);o=s.get("duration")<40?"":o<60?o.toFixed(0)+" min":(o/60).toFixed(0)+" h "+(o%60).toFixed(0)+" min";var h=document.createElement("li");h.classList.add(s.get("instruction"));h.innerHTML=(a[s.get("instruction")||"none"]||"#")+" "+s.get("name")+"<i>"+c+(o?" - "+o:"")+"<\/i>";n.appendChild(h)}};ol.control.RoutingGeoportail.prototype.handleResponse=function(t,e,o){for(var i,r,n={type:"routing",features:[]},s=0,a=0,l=[],c=0;r=t.legs[c];c++)for(var h,p=0;h=r.steps[p];p++){for(var u,g=[],d=0;u=h.points[d];d++)u=u.split(","),g.push([parseFloat(u[0]),parseFloat(u[1])]),0!==c&&0===d||l.push(g[d]);var m={geometry:(g=new ol.geom.LineString(g)).transform("EPSG:4326",this.getMap().getView().getProjection()),name:h.name,instruction:h.navInstruction,distance:parseFloat(h.distanceMeters),duration:parseFloat(h.durationSeconds)};s+=m.distance;a+=m.duration;m.distanceT=s;m.durationT=a;i=new ol.Feature(m);n.features.push(i)}return n.distance=parseFloat(t.distanceMeters),n.duration=parseFloat(t.durationSeconds),l=new ol.geom.LineString(l),n.feature=new ol.Feature({geometry:l.transform("EPSG:4326",this.getMap().getView().getProjection()),start:this._search[0].getTitle(e),end:this._search[0].getTitle(o),distance:n.distance,duration:n.duration}),this.dispatchEvent(n),this.path=n,n};ol.control.RoutingGeoportail.prototype.calculate=function(){console.log("calculate");this.resultElement.innerHTML="";for(var t=[],e=0;e<this._search.length;e++)this._search[e].get("selection")&&t.push(this._search[e].get("selection"));if(!(t.length<2)){var o=t[0],i=t[t.length-1],r=this.requestData(t),n=encodeURI(this.get("url")),s="";for(var a in r)s+=s?"&":"?",r.hasOwnProperty(a)&&(s+=a+"="+r[a]);var l=this;this.ajax(n+s,function(t){t.status>=200&&t.status<400?l.listRouting(l.handleResponse(JSON.parse(t.response),o,i)):console.log(n+s,arguments)},function(){console.log(n+s,arguments)})}};ol.control.RoutingGeoportail.prototype.ajax=function(t,e,o){var i=this;this._request&&this._request.abort();var r=this._request=new XMLHttpRequest;r.open("GET",t,!0);this._auth&&r.setRequestHeader("Authorization","Basic "+this._auth);this.element.classList.add("ol-searching");r.onload=function(){i._request=null;i.element.classList.remove("ol-searching");e.call(i,this)};r.onerror=function(){i._request=null;i.element.classList.remove("ol-searching");o&&o.call(i)};r.send()};ol.control.Scale=function(t){t||(t={});null==t.typing&&(t.typing=300);var e=document.createElement("DIV"),o=(t.className||"")+" ol-scale";t.target||(o+=" ol-unselectable ol-control");this._input=document.createElement("INPUT");this._input.value="-";e.setAttribute("class",o);!1===t.editable&&(this._input.readOnly=!0);e.appendChild(this._input);ol.control.Control.call(this,{element:e,target:t.target});this._input.addEventListener("change",this.setScale.bind(this));this.set("ppi",t.ppi||96)};ol.ext.inherits(ol.control.Scale,ol.control.Control);ol.control.Scale.prototype.setMap=function(t){this._listener&&ol.Observable.unByKey(this._listener);this._listener=null;ol.control.Control.prototype.setMap.call(this,t);t&&(this._listener=t.on("moveend",this._showScale.bind(this)))};ol.control.Scale.prototype._showScale=function(){var t=this.getMap();if(t){var e=t.getView(),o=e.getProjection(),i=e.getCenter(),r=t.getPixelFromCoordinate(i);r[1]+=1;var n=t.getCoordinateFromPixel(r),s=ol.sphere.getDistance(ol.proj.transform(i,o,"EPSG:4326"),ol.proj.transform(n,o,"EPSG:4326"));s*=this.get("ppi")/.0254;this._input.value=this.formatScale(s)}};ol.control.Scale.prototype.formatScale=function(t){return"1 / "+(t=t>100?100*Math.round(t/100):Math.round(t)).toLocaleString()};ol.control.Scale.prototype.setScale=function(t){var e=this.getMap();if(e&&t){t.target&&(t=t.target.value);var o=t;"string"==typeof t&&((o=t.split("/")[1])||(o=t),o=o.replace(/[^\d]/g,""),o=parseInt(o));var i=e.getView(),r=i.getProjection(),n=i.getCenter(),s=e.getPixelFromCoordinate(n);s[1]+=1;var a=e.getCoordinateFromPixel(s),l=ol.sphere.getDistance(ol.proj.transform(n,r,"EPSG:4326"),ol.proj.transform(a,r,"EPSG:4326"));l*=this.get("ppi")/.0254;i.setResolution(i.getResolution()*o/l)}this._showScale()};ol.control.SearchBAN=function(t){(t=t||{}).typing=t.typing||500;t.url=t.url||"https://api-adresse.data.gouv.fr/search/";t.className=t.className||"BAN";t.copy='<a href="https://adresse.data.gouv.fr/" target="new">&copy; BAN-data.gouv.fr<\/a>';ol.control.SearchPhoton.call(this,t)};ol.ext.inherits(ol.control.SearchBAN,ol.control.SearchPhoton);ol.control.SearchBAN.prototype.getTitle=function(t){return t.properties.label};ol.control.SearchBAN.prototype.select=function(t){var e=t.geometry.coordinates;try{e=ol.proj.transform(t.geometry.coordinates,"EPSG:4326",this.getMap().getView().getProjection())}catch(t){}this.dispatchEvent({type:"select",search:t,coordinate:e})};ol.control.SearchDFCI=function(t){t||(t={});t.className=t.className||"dfci";t.placeholder=t.placeholder||"Code DFCI";ol.control.Search.call(this,t)};ol.ext.inherits(ol.control.SearchDFCI,ol.control.Search);ol.control.SearchDFCI.prototype.autocomplete=function(t){if((t=(t=t.toUpperCase()).replace(/[^0-9,^A-H,^K-N]/g,"")).length<2)return this.setInput(t),[];var e,o=this.getMap().getView().getProjection(),i=[],r=ol.coordinate.fromDFCI(t,o),n=Math.floor(t.length/2)-1,s=ol.coordinate.toDFCI(r,n,o);if(s=s.replace(/[^0-9,^A-H,^K-N]/g,""),!/NaN/.test(s)&&s){if(console.log("ok",s),this.setInput(s+t.substring(s.length,t.length)),i.push({coordinate:ol.coordinate.fromDFCI(s,o),name:s}),5===t.length)for(r=ol.coordinate.fromDFCI(t+0,o),s=ol.coordinate.toDFCI(r,n+1,o).substring(0,5),e=0;e<10;e++)i.push({coordinate:ol.coordinate.fromDFCI(s+e,o),name:s+e});if(2===n)for(e=0;e<6;e++)i.push({coordinate:ol.coordinate.fromDFCI(s+"."+e,o),name:s+"."+e})}return i};ol.control.SearchFeature=function(t){t||(t={});t.className=t.className||"feature";ol.control.Search.call(this,t);"function"==typeof t.getSearchString&&(this.getSearchString=t.getSearchString);this.set("property",t.property||"name");this.source_=t.source};ol.ext.inherits(ol.control.SearchFeature,ol.control.Search);ol.control.SearchFeature.prototype.restoreHistory=function(){this.set("history",[])};ol.control.SearchFeature.prototype.saveHistory=function(){localStorage.removeItem("ol@search-"+this._classname)};ol.control.SearchFeature.prototype.getTitle=function(t){return t.get(this.get("property")||"name")};ol.control.SearchFeature.prototype.getSearchString=function(t){return this.getTitle(t)};ol.control.SearchFeature.prototype.getSource=function(){return this.source_};ol.control.SearchFeature.prototype.setSource=function(t){this.source_=t};ol.control.SearchFeature.prototype.autocomplete=function(t){var e=[];if(this.source_){t=t.replace(/^\*/,"");for(var o,i=new RegExp(t,"i"),r=this.source_.getFeatures(),n=this.get("maxItems"),s=0;o=r[s];s++){var a=this.getSearchString(o);if(void 0!==a&&i.test(a)&&(e.push(o),--n<=0))break}}return e};ol.control.SearchGPS=function(t){t||(t={});t.className=(t.className||"")+" ol-searchgps";t.placeholder=t.placeholder||"lon,lat";ol.control.Search.call(this,t);this.geolocation=new ol.Geolocation({projection:"EPSG:4326",trackingOptions:{maximumAge:1e4,enableHighAccuracy:!0,timeout:6e5}});ol.ext.element.create("BUTTON",{className:"ol-geoloc",title:"Locate with GPS",parent:this.element,click:function(){this.geolocation.setTracking(!0)}.bind(this)});var e=ol.ext.element.create("LABEL",{className:"ol-switch",parent:this.element});ol.ext.element.create("TEXT",{html:"decimal",parent:e});ol.ext.element.create("INPUT",{type:"checkbox",parent:e,on:{change:function(t){t.target.checked?this.element.classList.add("ol-dms"):this.element.classList.remove("ol-dms")}.bind(this)}});ol.ext.element.create("SPAN",{parent:e});ol.ext.element.create("TEXT",{html:"DMS",parent:e});this._createForm();var o=this.element.querySelector("ul.autocomplete");this.element.appendChild(o)};ol.ext.inherits(ol.control.SearchGPS,ol.control.Search);ol.control.SearchGPS.prototype._createForm=function(){var t=function(t){if(t.target.classList.contains("ol-dms")&&(i.value=(r.value<0?-1:1)*Number(r.value)+Number(n.value)/60+Number(s.value)/3600,i.value=(r.value<0?-1:1)*Math.round(1e7*i.value)/1e7,a.value=(l.value<0?-1:1)*Number(l.value)+Number(c.value)/60+Number(h.value)/3600,a.value=(l.value<0?-1:1)*Math.round(1e7*a.value)/1e7),this._input.value=i.value||a.value?i.value+","+a.value:"",!t.target.classList.contains("ol-dms")){var e=ol.coordinate.toStringHDMS([Number(i.value),Number(a.value)]),o=e.replace(/(N|S|E|W)/g,"").split("″");o[1]=o[1].trim().split(" ");r.value=(/W/.test(e)?-1:1)*parseInt(o[1][0]);n.value=parseInt(o[1][1]);s.value=parseInt(o[1][2]);o[0]=o[0].trim().split(" ");l.value=(/W/.test(e)?-1:1)*parseInt(o[0][0]);c.value=parseInt(o[0][1]);h.value=parseInt(o[0][2])}this.search()}.bind(this);function e(e,i){var r=ol.ext.element.create("INPUT",{className:e,type:"number",step:"any",lang:"en",parent:o,on:{"change keyup":t}});return i&&ol.ext.element.create("SPAN",{className:"ol-dms",html:i,parent:o}),r}var o=ol.ext.element.create("DIV",{className:"ol-longitude",parent:this.element});ol.ext.element.create("LABEL",{html:"Longitude",parent:o});var i=e("ol-decimal"),r=e("ol-dms","°"),n=e("ol-dms","'"),s=e("ol-dms",'"');o=ol.ext.element.create("DIV",{className:"ol-latitude",parent:this.element});ol.ext.element.create("LABEL",{html:"Latitude",parent:o});var a=e("ol-decimal"),l=e("ol-dms","°"),c=e("ol-dms","'"),h=e("ol-dms",'"');this.button.addEventListener("click",function(){i.focus()});this.on("select",function(t){i.value=t.search.gps[0];a.value=t.search.gps[1]}.bind(this));this.geolocation.on("change",function(){this.geolocation.setTracking(!1);var t=this.geolocation.getPosition();i.value=t[0];a.value=t[1];this._triggerCustomEvent("keyup",i)}.bind(this))};ol.control.SearchGPS.prototype.autocomplete=function(t){var e=[],o=t.split(",");o[0]=Number(o[0]);o[1]=Number(o[1]);(t=ol.coordinate.toStringHDMS(o))&&(t=t.replace(/(°|′|″) /g,"$1"));var i=ol.proj.transform([o[0],o[1]],"EPSG:4326",this.getMap().getView().getProjection());return e.push({gps:o,coordinate:i,name:t}),e};ol.control.SearchGeoportailParcelle=function(t){var e=this;t.type="Commune";t.className=(t.className?t.className:"")+" IGNF-parcelle ol-collapsed-list ol-collapsed-num";t.inputLabel="Commune";t.noCollapse=!0;t.placeholder=t.placeholder||"Choisissez une commune...";ol.control.SearchGeoportail.call(this,t);this.set("copy",null);var o=this.element,i=document.createElement("DIV");o.appendChild(i);var r,n=document.createElement("LABEL");n.innerText="Préfixe";i.appendChild(n);(n=document.createElement("LABEL")).innerText="Section";i.appendChild(n);(n=document.createElement("LABEL")).innerText="Numéro";i.appendChild(n);i.appendChild(document.createElement("BR"));this._inputParcelle={prefix:document.createElement("INPUT"),section:document.createElement("INPUT"),numero:document.createElement("INPUT")};this._inputParcelle.prefix.setAttribute("maxlength",3);this._inputParcelle.section.setAttribute("maxlength",2);this._inputParcelle.numero.setAttribute("maxlength",4);var s=function(){r&&clearTimeout(r);r=setTimeout(function(){e.autocompleteParcelle()},t.typing||0)};for(var a in this._inputParcelle)i.appendChild(this._inputParcelle[a]),this._inputParcelle[a].addEventListener("keyup",s),this._inputParcelle[a].addEventListener("blur",function(){r=setTimeout(function(){o.classList.add("ol-collapsed-num")},200)}),this._inputParcelle[a].addEventListener("focus",function(){clearTimeout(r);o.classList.remove("ol-collapsed-num")});this.activateParcelle(!1);var l=document.createElement("DIV");l.className="autocomplete-parcelle";o.appendChild(l);var c=document.createElement("UL");c.classList.add("autocomplete-parcelle");l.appendChild(c);(c=document.createElement("UL")).classList.add("autocomplete-page");l.appendChild(c);this._input.addEventListener("blur",function(){setTimeout(function(){o.classList.add("ol-collapsed-list")},200)});this._input.addEventListener("focus",function(){o.classList.remove("ol-collapsed-list");e._listParcelle([]);e._commune&&(e._commune=null,e._input.value="",e.drawList_());e.activateParcelle(!1)});this.on("select",this.selectCommune.bind(this));this.set("pageSize",t.pageSize||5)};ol.ext.inherits(ol.control.SearchGeoportailParcelle,ol.control.SearchGeoportail);ol.control.SearchGeoportailParcelle.prototype.selectCommune=function(t){this._commune=t.search.insee;this._input.value=t.search.insee+" - "+t.search.fulltext;this.activateParcelle(!0);this._inputParcelle.numero.focus();this.autocompleteParcelle()};ol.control.SearchGeoportailParcelle.prototype.setParcelle=function(t,e){this._inputParcelle.prefix.value=(t.Commune||"")+(t.CommuneAbsorbee||"");this._inputParcelle.section.value=t.Section||"";this._inputParcelle.numero.value=t.Numero||"";e&&this._triggerCustomEvent("keyup",this._inputParcelle.prefix)};ol.control.SearchGeoportailParcelle.prototype.activateParcelle=function(t){for(var e in this._inputParcelle)this._inputParcelle[e].readOnly=!t;t?this._inputParcelle.section.parentElement.classList.add("ol-active"):this._inputParcelle.section.parentElement.classList.remove("ol-active")};ol.control.SearchGeoportailParcelle.prototype.autocompleteParcelle=function(){function t(t,e,o){if(!t)return t;for(o=o||"0";t.length<e;)t=o+t;return t.replace(/\*/g,"_")}var e=this._commune,o=t(this._inputParcelle.prefix.value,3);"000"===o&&(o="___");var i=t(this._inputParcelle.section.value,2),r=t(this._inputParcelle.numero.value,4,"0"),n=e+(o||"___")+(i||"__")+(r||(i?"____":"0001"));this.searchParcelle(n,function(t){this._listParcelle(t)}.bind(this),function(){console.log("oops")})};ol.control.SearchGeoportailParcelle.prototype.searchParcelle=function(t,e){var o='<?xml version="1.0" encoding="UTF-8"?><XLS xmlns:xls="http://www.opengis.net/xls" xmlns:gml="http://www.opengis.net/gml" xmlns="http://www.opengis.net/xls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="http://www.opengis.net/xls http://schemas.opengis.net/ols/1.2/olsAll.xsd"><RequestHeader/><Request requestID="1" version="1.2" methodName="LocationUtilityService"><GeocodeRequest returnFreeForm="false"><Address countryCode="CadastralParcel"><freeFormAddress>'+t+"+<\/freeFormAddress><\/Address><\/GeocodeRequest><\/Request><\/XLS>";this.ajax(this.get("url").replace("ols/apis/completion","geoportail/ols"),{xls:o},function(t){for(var o,i=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("GeocodedAddress"),r=[],n=0;o=i[n];n++){for(var s,a=(o.getElementsByTagName("gml:pos")[0]||o.getElementsByTagName("pos")[0]).childNodes[0].nodeValue.split(" "),l=o.getElementsByTagName("Place"),c={lon:Number(a[1]),lat:Number(a[0])},h=0;s=l[h];h++)c[s.attributes.type.value]=s.childNodes[0].nodeValue;r.push(c)}e(r)},{dataType:"XML"})};ol.control.SearchGeoportailParcelle.prototype._listParcelle=function(t){var e=this,o=this.element.querySelector("ul.autocomplete-parcelle");o.innerHTML="";var i=this.element.querySelector("ul.autocomplete-page");function r(t){for(var r=o.children,n="ol-list-"+t,e=0;e<r.length;e++)r[e].style.display=r[e].className===n?"":"none";for(r=i.children,e=0;e<r.length;e++)r[e].className=r[e].innerText==t?"selected":"";i.style.display=r.length>1?"":"none"}i.innerHTML="";this._listParc=[];t.sort(function(t,e){var o=t.INSEE+t.CommuneAbsorbee+t.Section+t.Numero,i=e.INSEE+e.CommuneAbsorbee+e.Section+e.Numero;return o===i?0:o<i?-1:1});for(var n,s=this.get("pageSize"),a=0;n=t[a];a++){var l=document.createElement("LI");l.setAttribute("data-search",a);s>0&&l.classList.add("ol-list-"+Math.floor(a/s));this._listParc.push(n);l.addEventListener("click",function(t){e._handleParcelle(e._listParc[t.currentTarget.getAttribute("data-search")])});l.innerHTML=n.INSEE+n.CommuneAbsorbee+n.Section+n.Numero;o.appendChild(l);s>0&&!(a%s)&&((l=document.createElement("LI")).innerText=Math.floor(a/s),l.addEventListener("click",function(t){r(t.currentTarget.innerText)}),i.appendChild(l))}s>0&&r(0)};ol.control.SearchGeoportailParcelle.prototype._handleParcelle=function(t){this.dispatchEvent({type:"parcelle",search:t,coordinate:ol.proj.fromLonLat([t.lon,t.lat],this.getMap().getView().getProjection())})};ol.control.SearchNominatim=function(t){(t=t||{}).className=t.className||"nominatim";t.typing=t.typing||500;t.url=t.url||"https://nominatim.openstreetmap.org/search";t.copy='<a href="http://www.openstreetmap.org/copyright" target="new">&copy; OpenStreetMap contributors<\/a>';ol.control.SearchJSON.call(this,t);this.set("polygon",t.polygon);this.set("viewbox",t.viewbox);this.set("bounded",t.bounded)};ol.ext.inherits(ol.control.SearchNominatim,ol.control.SearchJSON);ol.control.SearchNominatim.prototype.getTitle=function(t){var e=[];t.class&&e.push(t.class);t.type&&e.push(t.type);var o=t.display_name+(e.length?"<i>"+e.join(" - ")+"<\/i>":"");return t.icon&&(o="<img src='"+t.icon+"' />"+o),o};ol.control.SearchNominatim.prototype.requestData=function(t){var e={format:"json",addressdetails:1,q:t,polygon_geojson:this.get("polygon")?1:0,bounded:this.get("bounded")?1:0,limit:this.get("maxItems")};return this.get("viewbox")&&(e.viewbox=this.get("viewbox")),e};ol.control.SearchNominatim.prototype.select=function(t){var e=[Number(t.lon),Number(t.lat)];try{e=ol.proj.transform(e,"EPSG:4326",this.getMap().getView().getProjection())}catch(t){}this.dispatchEvent({type:"select",search:t,coordinate:e})};ol.control.SearchNominatim.prototype.reverseGeocode=function(t,e){var o=ol.proj.transform(t,this.getMap().getView().getProjection(),"EPSG:4326");this.ajax(this.get("url").replace("search","reverse"),{lon:o[0],lat:o[1],format:"json"},function(t){e?e.call(this,[t]):this._handleSelect(t,!0)}.bind(this))};ol.control.SearchWikipedia=function(t){(t=t||{}).lang=t.lang||"en";t.className=t.className||"ol-search-wikipedia";t.url="https://"+t.lang+".wikipedia.org/w/api.php";t.placeholder=t.placeholder||"search string, File:filename";t.copy='<a href="https://'+t.lang+'.wikipedia.org/" target="new">Wikipedia&reg; - CC-By-SA<\/a>';ol.control.SearchJSON.call(this,t);this.set("lang",t.lang)};ol.ext.inherits(ol.control.SearchWikipedia,ol.control.SearchJSON);ol.control.SearchWikipedia.prototype.getTitle=function(t){return ol.ext.element.create("DIV",{html:t.title,title:t.desc})};ol.control.SearchWikipedia.prototype.setLang=function(t){this.set("lang",t);this.set("url","https://"+t+".wikipedia.org/w/api.php")};ol.control.SearchWikipedia.prototype.requestData=function(t){return{action:"opensearch",search:t,lang:this.get("lang"),format:"json",origin:"*",limit:this.get("maxItems")}};ol.control.SearchWikipedia.prototype.handleResponse=function(t){for(var e=[],o=0;o<t[1].length;o++)e.push({title:t[1][o],desc:t[2][o],uri:t[3][o]});return e};ol.control.SearchWikipedia.prototype.select=function(t){var e=decodeURIComponent(t.uri.split("/").pop()).replace(/'/,"%27");ol.ext.Ajax.get({url:t.uri.split("wiki/")[0]+"w/api.php",data:{action:"query",prop:"pageimages|coordinates|extracts",exintro:1,explaintext:1,piprop:"original",origin:"*",format:"json",redirects:1,titles:e},options:{encode:!1},success:function(e){var o=e.query.pages[Object.keys(e.query.pages).pop()];console.log(o);var i,r={title:t.title,desc:o.extract||t.desc,url:t.uri,img:o.original?o.original.source:void 0,pageid:o.pageid};o.coordinates&&(r.lon=o.coordinates[0].lon,r.lat=o.coordinates[0].lat,i=[r.lon,r.lat],i=ol.proj.transform(i,"EPSG:4326",this.getMap().getView().getProjection()));this.dispatchEvent({type:"select",search:r,coordinate:i})}.bind(this)})};ol.control.Select=function(t){var e=this;t||(t={});var o=t.content=document.createElement("div");this._ul=ol.ext.element.create("UL",{parent:o});this._all=ol.ext.element.create("INPUT",{type:"checkbox",checked:!0});var i=ol.ext.element.create("LABEL",{html:this._all,parent:o});ol.ext.element.appendText(i,t.allLabel||"match all");this._useCase=ol.ext.element.create("INPUT",{type:"checkbox"});var r=ol.ext.element.create("LABEL",{html:this._useCase,parent:o});ol.ext.element.appendText(r,t.caseLabel||"case sensitive");ol.control.SelectBase.call(this,t);ol.ext.element.create("BUTTON",{className:"ol-append",html:t.addLabel||"add rule",click:function(){e.addCondition()},parent:o});this._conditions=[];this.set("attrPlaceHolder",t.attrPlaceHolder||"attribute");this.set("valuePlaceHolder",t.valuePlaceHolder||"value");this.addCondition()};ol.ext.inherits(ol.control.Select,ol.control.SelectBase);ol.control.Select.prototype.addCondition=function(t){t=t||{};this._conditions.push({attr:t.attr||"",op:t.op||"=",val:t.val||""});this._drawlist()};ol.control.Select.prototype.getConditions=function(){return{usecase:this._useCase.checked,all:this._all.checked,conditions:this._conditions}};ol.control.Select.prototype.setConditions=function(t){this._useCase.checked=t.usecase;this._all.checked=t.all;this._conditions=t.conditions;this._drawlist()};ol.control.Select.prototype.getConditionsString=function(t){for(var e,o="",i=0;e=t.conditions[i];i++)e.attr&&(o+=(o?t.all?" AND ":" OR ":"")+e.attr+this.operationsList[e.op]+e.val);return o};ol.control.Select.prototype._drawlist=function(){this._ul.innerHTML="";for(var t=0;t<this._conditions.length;t++)this._ul.appendChild(this._getLiCondition(t))};ol.control.Select.prototype._autocomplete=function(t,e){e.classList.remove("ol-hidden");e.innerHTML="";for(var o,i={},r=this.get("source"),n=0;o=r[n];n++)for(var s,a=o.getFeatures(),l=0;(s=a[l])&&(Object.assign(i,s.getProperties()),!(l>100));l++);var c=new RegExp(t,"i");for(var h in i)if("geometry"!==h&&c.test(h)){var p=document.createElement("li");p.textContent=h;p.addEventListener("click",function(){e.previousElementSibling.value=this.textContent;var t=document.createEvent("HTMLEvents");t.initEvent("change",!0,!1);e.previousElementSibling.dispatchEvent(t);e.classList.add("ol-hidden")});e.appendChild(p)}};ol.control.Select.prototype._getLiCondition=function(t){var e=this,o=document.createElement("li"),i=document.createElement("div");i.classList.add("ol-autocomplete");i.addEventListener("mouseleave",function(){this.querySelector("ul").classList.add("ol-hidden")});o.appendChild(i);var r=document.createElement("input");r.classList.add("ol-attr");r.setAttribute("type","text");r.setAttribute("placeholder",this.get("attrPlaceHolder"));r.addEventListener("keyup",function(){e._autocomplete(this.value,this.nextElementSibling)});r.addEventListener("click",function(){e._autocomplete(this.value,this.nextElementSibling);this.nextElementSibling.classList.remove("ol-hidden")});r.addEventListener("change",function(){e._conditions[t].attr=this.value});r.value=e._conditions[t].attr;i.appendChild(r);var n=document.createElement("ul");n.classList.add("ol-hidden");i.appendChild(n);var s=document.createElement("select");for(var a in o.appendChild(s),this.operationsList){var l=document.createElement("option");l.value=a;l.textContent=this.operationsList[a];s.appendChild(l)}s.value=e._conditions[t].op;s.addEventListener("change",function(){e._conditions[t].op=this.value});var c=document.createElement("input");if(c.setAttribute("type","text"),c.setAttribute("placeholder",this.get("valuePlaceHolder")),c.addEventListener("change",function(){e._conditions[t].val=this.value}),c.value=e._conditions[t].val,o.appendChild(c),this._conditions.length>1){var h=document.createElement("div");h.classList.add("ol-delete");h.addEventListener("click",function(){e.removeCondition(t)});o.appendChild(h)}return o};ol.control.Select.prototype.removeCondition=function(t){this._conditions.splice(t,1);this._drawlist()};ol.control.Select.prototype.doSelect=function(t){return(t=t||{}).useCase=t.useCase||this._useCase.checked,t.matchAll=t.matchAll||this._all.checked,t.conditions=t.conditions||this._conditions,ol.control.SelectBase.prototype.doSelect.call(this,t)};ol.control.SelectCheck=function(t){t||(t={});var e=t.content=ol.ext.element.create("DIV");t.label&&ol.ext.element.create("LABEL",{html:t.label,parent:e});this._input=ol.ext.element.create("DIV",{parent:e});t.className=t.className||"ol-select-check";ol.control.SelectBase.call(this,t);this.set("property",t.property||"name");this.set("max",t.max||1e4);this.set("defaultLabel",t.defaultLabel);this.set("type",t.type);this._selectAll=t.selectAll;this._onchoice=t.onchoice;this.setValues()};ol.ext.inherits(ol.control.SelectCheck,ol.control.SelectBase);ol.control.SelectCheck.prototype.setMap=function(t){ol.control.SelectBase.prototype.setMap.call(this,t);this.setValues()};ol.control.SelectCheck.prototype.doSelect=function(t){t=t||{};var e=[];return this._checks.forEach(function(t){t.checked&&t.value&&e.push({attr:this.get("property"),op:"=",val:t.value})}.bind(this)),e.length?ol.control.SelectBase.prototype.doSelect.call(this,{features:t.features,conditions:e}):ol.control.SelectBase.prototype.doSelect.call(this,{features:t.features,matchAll:this._selectAll})};ol.control.SelectCheck.prototype.setValues=function(t){var e,o;if(t=t||{},console.log(t),t.values)t.values instanceof Array?(o={},t.values.forEach(function(t){o[t]=t})):o=t.values;else{o={};var i=this.get("property");this.getSources().forEach(function(t){for(var e=t.getFeatures(),r=Math.min(e.length,this.get("max")),n=0;n<r;n++){var s=e[n].get(i);s&&(o[s]=s)}}.bind(this))}if(Object.keys(o).length){t.sort?(e={},Object.keys(o).sort().forEach(function(t){e[t]=o[t]})):e=o;ol.ext.element.setHTML(this._input,"");this._checks=[];var r="radio_"+(new Date).getTime(),n=function(t,e){var o=ol.ext.element.create("LABEL",{className:"radio"===this.get("type")?"ol-radio":"ol-checkbox",parent:this._input});this._checks.push(ol.ext.element.create("INPUT",{name:r,type:"radio"===this.get("type")?"radio":"checkbox",value:t,change:function(){this._onchoice?this._onchoice():this.doSelect()}.bind(this),parent:o}));ol.ext.element.create("DIV",{html:e,parent:o})}.bind(this);for(var s in this.get("defaultLabel")&&"radio"===this.get("type")&&n("",this.get("defaultLabel")),e)n(s,e[s])}};ol.control.SelectCondition=function(t){t||(t={});var e=t.content=ol.ext.element.create("DIV"),o=ol.ext.element.create("LABEL",{parent:e});this._check=ol.ext.element.create("INPUT",{type:"checkbox",change:function(){this._onchoice?this._onchoice():this.doSelect()}.bind(this),parent:o});ol.ext.element.create("DIV",{html:t.label||"condition",parent:o});this._input=ol.ext.element.create("DIV",{parent:e});t.className=t.className||"ol-select-condition";ol.control.SelectBase.call(this,t);this.setCondition(t.condition);this._selectAll=t.selectAll;this._onchoice=t.onchoice};ol.ext.inherits(ol.control.SelectCondition,ol.control.SelectBase);ol.control.SelectCondition.prototype.setCondition=function(t){this._conditions=t?t instanceof Array?t:[t]:[]};ol.control.SelectCondition.prototype.addCondition=function(t){this._conditions.push(t)};ol.control.SelectCondition.prototype.doSelect=function(t){t=t||{};var e=this._conditions;return this._check.checked?ol.control.SelectBase.prototype.doSelect.call(this,{features:t.features,conditions:e}):ol.control.SelectBase.prototype.doSelect.call(this,{features:t.features,matchAll:this._selectAll})};ol.control.SelectFulltext=function(t){t||(t={});var e=t.content=ol.ext.element.create("DIV");t.label&&ol.ext.element.create("LABEL",{html:t.label,parent:e});this._input=ol.ext.element.create("INPUT",{placeHolder:t.placeHolder||"search...",change:function(){this._onchoice&&this._onchoice()}.bind(this),parent:e});ol.control.SelectBase.call(this,t);this._onchoice=t.onchoice;this.set("property",t.property||"name")};ol.ext.inherits(ol.control.SelectFulltext,ol.control.SelectBase);ol.control.SelectFulltext.prototype.doSelect=function(t){return t=t||{},ol.control.SelectBase.prototype.doSelect.call(this,{features:t.features,useCase:!1,conditions:[{attr:this.get("property"),op:"contain",val:this._input.value}]})};ol.control.SelectMulti=function(t){t||(t={});t.content=ol.ext.element.create("DIV");this._container=ol.ext.element.create("UL",{parent:t.content});t.className=t.className||"ol-select-multi";ol.control.SelectBase.call(this,t);this._controls=[];t.controls.forEach(this.addControl.bind(this))};ol.ext.inherits(ol.control.SelectMulti,ol.control.SelectBase);ol.control.SelectMulti.prototype.setMap=function(t){this.getMap()&&this._controls.forEach(function(t){this.getMap().remveControl(t)}.bind(this));ol.control.SelectBase.prototype.setMap.call(this,t);this.getMap()&&this._controls.forEach(function(t){this.getMap().addControl(t)}.bind(this))};ol.control.SelectMulti.prototype.addControl=function(t){t instanceof ol.control.SelectBase&&(this._controls.push(t),t.setTarget(ol.ext.element.create("LI",{parent:this._container})),t._selectAll=!0,t._onchoice=this.doSelect.bind(this),this.getMap()&&this.getMap().addControl(t))};ol.control.SelectMulti.prototype.getControls=function(){return this._controls};ol.control.SelectMulti.prototype.doSelect=function(){var t=[];return this.getSources().forEach(function(e){t=t.concat(e.getFeatures())}),this._controls.forEach(function(e){t=e.doSelect({features:t})}),this.dispatchEvent({type:"select",features:t}),t};ol.control.SelectPopup=function(t){t||(t={});var e=t.content=ol.ext.element.create("DIV");t.label&&ol.ext.element.create("LABEL",{html:t.label,parent:e});this._input=ol.ext.element.create("SELECT",{on:{change:function(){this._onchoice?this._onchoice():this.doSelect()}.bind(this)},parent:e});t.className=t.className||"ol-select-popup";ol.control.SelectBase.call(this,t);this.set("property",t.property||"name");this.set("max",t.max||1e4);this.set("defaultLabel",t.defaultLabel);this._selectAll=t.selectAll;this._onchoice=t.onchoice;this.setValues()};ol.ext.inherits(ol.control.SelectPopup,ol.control.SelectBase);ol.control.SelectPopup.prototype.setMap=function(t){ol.control.SelectBase.prototype.setMap.call(this,t);this.setValues()};ol.control.SelectPopup.prototype.doSelect=function(t){return t=t||{},this._input.value?ol.control.SelectBase.prototype.doSelect.call(this,{features:t.features,conditions:[{attr:this.get("property"),op:"=",val:this._input.value}]}):ol.control.SelectBase.prototype.doSelect.call(this,{features:t.features,matchAll:this._selectAll})};ol.control.SelectPopup.prototype.setValues=function(t){var e,o;if((t=t||{}).values)t.values instanceof Array?(o={},t.values.forEach(function(t){o[t]=t})):o=t.values;else{o={};var i=this.get("property");this.getSources().forEach(function(t){for(var e=t.getFeatures(),r=Math.min(e.length,this.get("max")),n=0;n<r;n++){var s=e[n].get(i);s&&(o[s]=s)}}.bind(this))}for(var r in t.sort?(e={},Object.keys(o).sort().forEach(function(t){e[t]=o[t]})):e=o,ol.ext.element.setHTML(this._input,""),ol.ext.element.create("OPTION",{className:"ol-default",html:this.get("defaultLabel")||"",value:"",parent:this._input}),e)ol.ext.element.create("OPTION",{html:e[r],value:r,parent:this._input})};ol.control.Status=function(t){t=t||{};var e=ol.ext.element.create("DIV",{className:(t.className||"")+" ol-status"+(t.target?"":" ol-unselectable ol-control")});ol.control.Control.call(this,{element:e,target:t.target});t.position&&this.setPosition(t.position);this.status(t.status||"")};ol.ext.inherits(ol.control.Status,ol.control.Control);ol.control.Status.prototype.status=function(t){var e=t||"";if(e){if(ol.ext.element.show(this.element),"object"==typeof e&&!(e instanceof String))for(var o in e="",t)e+="<label>"+o+":<\/label> "+t[o]+"<br/>";ol.ext.element.setHTML(this.element,e)}else ol.ext.element.hide(this.element)};ol.control.Status.prototype.setPosition=function(t){this.element.classList.remove("ol-left");this.element.classList.remove("ol-right");this.element.classList.remove("ol-bottom");this.element.classList.remove("ol-center");/^left$|^right$|^bottom$|^center$/.test(t)&&this.element.classList.add("ol-"+t)};ol.control.Status.prototype.show=function(t){!1===t?ol.ext.element.hide(this.element):ol.ext.element.show(this.element)};ol.control.Status.prototype.hide=function(){ol.ext.element.hide(this.element)};ol.control.Status.prototype.toggle=function(){ol.ext.element.toggle(this.element)};ol.control.Status.prototype.isShown=function(){return"none"===this.element.style.display};ol.control.Storymap=function(t){t.target&&(t.html?t.html instanceof Element&&(t.html=t.html.innerHTML):t.html=t.target.innerHTML,t.target.innerHTML="");var e=ol.ext.element.create("DIV",{className:(t.className||"")+" ol-storymap"+(t.target?"":" ol-unselectable ol-control")+("ontouchstart"in window?" ol-touch":""),html:t.html});e.querySelectorAll(".chapter").forEach(function(t){t.addEventListener("click",function(e){this.element.classList.contains("ol-move")||(t.classList.contains("ol-select")?"IMG"===e.target.tagName&&e.target.dataset.title&&this.dispatchEvent({coordinate:this.getMap()?this.getMap().getCoordinateFromPixel([e.layerX,e.layerY]):null,type:"clickimage",img:e.target,title:e.target.dataset.title,element:t,name:t.getAttribute("name"),originalEvent:e}):(this.element.scrollTop=t.offsetTop-30,e.preventDefault()))}.bind(this))}.bind(this));ol.control.Control.call(this,{element:e,target:t.target});ol.ext.element.scrollDiv(this.element,{vertical:!0,mousewheel:!0});var o=this.element.querySelectorAll(".ol-scroll-next");o.forEach(function(t){t.addEventListener("click",function(e){if(t.parentElement.classList.contains("ol-select")){for(var o,i=this.element.querySelectorAll(".chapter"),r=t.offsetTop,n=0;o=i[n];n++)if(o.offsetTop>r){r=o.offsetTop;break}this.element.scrollTop=r-30;e.stopPropagation();e.preventDefault()}}.bind(this))}.bind(this));(o=this.element.querySelectorAll(".ol-scroll-top")).forEach(function(t){t.addEventListener("click",function(t){this.element.scrollTop=0;t.stopPropagation();t.preventDefault()}.bind(this))}.bind(this));var i=function(t){var e=[parseFloat(t.getAttribute("data-lon")),parseFloat(t.getAttribute("data-lat"))],o=ol.proj.fromLonLat(e,this.getMap().getView().getProjection()),i=parseFloat(t.getAttribute("data-zoom"));return{type:"scrollto",element:t,name:t.getAttribute("name"),coordinate:o,lon:e,zoom:i}}.bind(this),r=this.element.querySelectorAll(".chapter")[0];setTimeout(function(){r.classList.add("ol-select");this.dispatchEvent(i(r))}.bind(this));this.element.addEventListener("scroll",function(){var t,e=this.element.querySelectorAll(".chapter"),o=ol.ext.element.getStyle(this.element,"height");if(this.element.scrollTop)for(var n,s=0;n=e[s];s++){if(n.offsetTop-this.element.scrollTop>o/3)break;t=n}else t=e[0];if(t&&t!==r){r&&r.classList.remove("ol-select");(r=t).classList.add("ol-select");var a=i(r),l=this.getMap().getView();switch(l.cancelAnimations(),r.getAttribute("data-animation")){case"flyto":l.animate({center:a.coordinate,duration:2e3});l.animate({zoom:Math.min(l.getZoom(),a.zoom)-1,duration:1e3},{zoom:a.zoom,duration:1e3})}this.dispatchEvent(a)}}.bind(this))};ol.ext.inherits(ol.control.Storymap,ol.control.Control);ol.control.Storymap.prototype.setChapter=function(t){for(var e,o=this.element.querySelectorAll(".chapter"),i=0;e=o[i];i++)e.getAttribute("name")===t&&(this.element.scrollTop=e.offsetTop-30)};ol.control.Swipe=function(t){t=t||{};var e=document.createElement("button"),o=document.createElement("div");o.className=(t.className||"ol-swipe")+" ol-unselectable ol-control";o.appendChild(e);o.addEventListener("mousedown",this.move.bind(this));o.addEventListener("touchstart",this.move.bind(this));ol.control.Control.call(this,{element:o});this.precomposeRight_=this.precomposeRight.bind(this);this.precomposeLeft_=this.precomposeLeft.bind(this);this.postcompose_=this.postcompose.bind(this);this.layers=[];t.layers&&this.addLayer(t.layers,!1);t.rightLayers&&this.addLayer(t.rightLayers,!0);this.on("propertychange",function(){this.getMap()&&this.getMap().renderSync();"horizontal"===this.get("orientation")?(this.element.style.top=100*this.get("position")+"%",this.element.style.left=""):("vertical"!==this.get("orientation")&&this.set("orientation","vertical"),this.element.style.left=100*this.get("position")+"%",this.element.style.top="");this.element.classList.remove("horizontal","vertical");this.element.classList.add(this.get("orientation"))}.bind(this));this.set("position",t.position||.5);this.set("orientation",t.orientation||"vertical")};ol.ext.inherits(ol.control.Swipe,ol.control.Control);ol.control.Swipe.prototype.setMap=function(t){var e,o;if(this.getMap()){for(e=0;e<this.layers.length;e++)(o=this.layers[e]).right?o.layer.un(["precompose","prerender"],this.precomposeRight_):o.layer.un(["precompose","prerender"],this.precomposeLeft_),o.layer.un(["postcompose","postrender"],this.postcompose_);this.getMap().renderSync()}if(ol.control.Control.prototype.setMap.call(this,t),t){for(this._listener=[],e=0;e<this.layers.length;e++)(o=this.layers[e]).right?o.layer.on(["precompose","prerender"],this.precomposeRight_):o.layer.on(["precompose","prerender"],this.precomposeLeft_),o.layer.on(["postcompose","postrender"],this.postcompose_);t.renderSync()}};ol.control.Swipe.prototype.isLayer_=function(t){for(var e=0;e<this.layers.length;e++)if(this.layers[e].layer===t)return e;return-1};ol.control.Swipe.prototype.addLayer=function(t,e){t instanceof Array||(t=[t]);for(var o=0;o<t.length;o++){var i=t[o];this.isLayer_(i)<0&&(this.layers.push({layer:i,right:e}),this.getMap()&&(e?i.on(["precompose","prerender"],this.precomposeRight_):i.on(["precompose","prerender"],this.precomposeLeft_),i.on(["postcompose","postrender"],this.postcompose_),this.getMap().renderSync()))}};ol.control.Swipe.prototype.removeLayer=function(t){t instanceof Array||(t=[t]);for(var e=0;e<t.length;e++){var o=this.isLayer_(t[e]);o>=0&&this.getMap()&&(this.layers[o].right?t[e].un(["precompose","prerender"],this.precomposeRight_):t[e].un(["precompose","prerender"],this.precomposeLeft_),t[e].un(["postcompose","postrender"],this.postcompose_),this.layers.splice(o,1),this.getMap().renderSync())}};ol.control.Swipe.prototype.move=function(t){var e,o=this;switch(t.type){case"touchcancel":case"touchend":case"mouseup":o.isMoving=!1;["mouseup","mousemove","touchend","touchcancel","touchmove"].forEach(function(t){document.removeEventListener(t,o.move)});break;case"mousedown":case"touchstart":o.isMoving=!0;["mouseup","mousemove","touchend","touchcancel","touchmove"].forEach(function(t){document.addEventListener(t,o.move.bind(o))});case"mousemove":case"touchmove":if(o.isMoving)if("vertical"===o.get("orientation")){var i=t.pageX||t.touches&&t.touches.length&&t.touches[0].pageX||t.changedTouches&&t.changedTouches.length&&t.changedTouches[0].pageX;if(!i)break;i-=o.getMap().getTargetElement().getBoundingClientRect().left+window.pageXOffset-document.documentElement.clientLeft;e=o.getMap().getSize()[0];e=Math.min(Math.max(0,1-(e-i)/e),1);o.set("position",e)}else{var r=t.pageY||t.touches&&t.touches.length&&t.touches[0].pageY||t.changedTouches&&t.changedTouches.length&&t.changedTouches[0].pageY;if(!r)break;r-=o.getMap().getTargetElement().getBoundingClientRect().top+window.pageYOffset-document.documentElement.clientTop;e=o.getMap().getSize()[1];e=Math.min(Math.max(0,1-(e-r)/e),1);o.set("position",e)}}};ol.control.Swipe.prototype._drawRect=function(t,e){var o=t.inversePixelTransform;o?[[e[0][0],e[0][1]],[e[0][0],e[1][1]],[e[1][0],e[1][1]],[e[1][0],e[0][1]],[e[0][0],e[0][1]]].forEach(function(e,i){e=[e[0]*o[0]-e[1]*o[1]+o[4],-e[0]*o[2]+e[1]*o[3]+o[5]];i?t.context.lineTo(e[0],e[1]):t.context.moveTo(e[0],e[1])}):t.context.rect(e[0][0],e[0][1],e[1][0],e[1][1])};ol.control.Swipe.prototype.precomposeLeft=function(t){var e=t.context,o=t.frameState.size;e.save();e.beginPath();var i=[[0,0],[o[0],o[1]]];i[1]="vertical"===this.get("orientation")?[o[0]*this.get("position"),o[1]]:[o[0],o[1]*this.get("position")];this._drawRect(t,i);e.clip()};ol.control.Swipe.prototype.precomposeRight=function(t){var e=t.context,o=t.frameState.size;e.save();e.beginPath();var i=[[0,0],[o[0],o[1]]];i[0]="vertical"===this.get("orientation")?[o[0]*this.get("position"),0]:[0,o[1]*this.get("position")];this._drawRect(t,i);e.clip()};ol.control.Swipe.prototype.postcompose=function(t){t.context.restore()};ol.control.Target=function(t){t=t||{};this.style=t.style||[new ol.style.Style({image:new ol.style.RegularShape({points:4,radius:11,radius1:0,radius2:0,snapToPixel:!0,stroke:new ol.style.Stroke({color:"#fff",width:3})})}),new ol.style.Style({image:new ol.style.RegularShape({points:4,radius:11,radius1:0,radius2:0,snapToPixel:!0,stroke:new ol.style.Stroke({color:"#000",width:1})})})];this.style instanceof Array||(this.style=[this.style]);this.composite=t.composite||"";var e=document.createElement("div");e.className="ol-target ol-unselectable ol-control";ol.control.CanvasBase.call(this,{element:e,target:t.target});this.setVisible(!1!==t.visible)};ol.ext.inherits(ol.control.Target,ol.control.CanvasBase);ol.control.Target.prototype.setVisible=function(t){this.set("visible",t);this.getMap()&&this.getMap().renderSync()};ol.control.Target.prototype.getVisible=function(){return this.get("visible")};ol.control.Target.prototype._draw=function(t){var e=this.getContext(t);if(e&&this.getMap()&&this.getVisible()){var o=t.frameState.pixelRatio;e.save();e.scale(o,o);var i=e.canvas.width/(2*o),r=e.canvas.height/(2*o),n=new ol.geom.Point(this.getMap().getCoordinateFromPixel([i,r]));this.composite&&(e.globalCompositeOperation=this.composite);for(var s=0;s<this.style.length;s++){var a=this.style[s];if(a instanceof ol.style.Style){var l=t.vectorContext;if(!l){var c={inversePixelTransform:[o,0,0,o,0,0],context:e,frameState:{pixelRatio:o,extent:t.frameState.extent,coordinateToPixelTransform:t.frameState.coordinateToPixelTransform,viewState:t.frameState.viewState}};l=ol.render.getVectorContext(c)}l.setStyle(a);l.drawGeometry(n)}}e.restore()}};ol.control.TextButton=function(t){(t=t||{}).className=(t.className||"")+" ol-text-button";ol.control.Button.call(this,t)};ol.ext.inherits(ol.control.TextButton,ol.control.Button);ol.control.Timeline=function(t){var e=ol.ext.element.create("DIV",{className:(t.className||"")+" ol-timeline"+(t.target?"":" ol-unselectable ol-control")+(t.zoomButton?" ol-hasbutton":"")+("ontouchstart"in window?" ol-touch":"")});ol.control.Control.call(this,{element:e,target:t.target});this._scrollDiv=ol.ext.element.create("DIV",{className:"ol-scroll",parent:this.element});this._buttons=ol.ext.element.create("DIV",{className:"ol-buttons",parent:this.element});t.zoomButton&&(this.addButton({className:"ol-zoom-in",handleClick:function(){var t=this.get("zoom");t>=1?t++:t=Math.min(1,t+.1);t=Math.round(100*t)/100;this.refresh(t)}.bind(this)}),this.addButton({className:"ol-zoom-out",handleClick:function(){var t=this.get("zoom");t>1?t--:t-=.1;t=Math.round(100*t)/100;this.refresh(t)}.bind(this)}));this._intervalDiv=ol.ext.element.create("DIV",{className:"ol-center-date",parent:this.element});this.element.addEventListener("mouseover",function(){this._select&&this._select.elt.classList.remove("ol-select")}.bind(this));var o=null;this._scrollDiv.addEventListener("scroll",function(){this._setScrollLeft();o&&(clearTimeout(o),o=null);o=setTimeout(function(){this.dispatchEvent({type:"scroll",date:this.getDate(),dateStart:this.getDate("start"),dateEnd:this.getDate("end")})}.bind(this),t.scrollTimeout||15)}.bind(this));this._scrollDiv.addEventListener("gesturechange",function(){});ol.ext.element.scrollDiv(this._scrollDiv,{onmove:function(t){this._moving=t}.bind(this)});this._tline=[];this._scrollLeft=0;this.set("maxWidth",t.maxWidth||2e3);this.set("minDate",t.minDate||1/0);this.set("maxDate",t.maxDate||-1/0);this.set("graduation",t.graduation);this.set("minZoom",t.minZoom||.2);this.set("maxZoom",t.maxZoom||4);this.setInterval(t.interval);t.getHTML&&(this._getHTML=t.getHTML);t.getFeatureDate&&(this._getFeatureDate=t.getFeatureDate);t.endFeatureDate&&(this._endFeatureDate=t.endFeatureDate);this.setFeatures(t.features||t.source,t.zoom)};ol.ext.inherits(ol.control.Timeline,ol.control.Control);ol.control.Timeline.prototype.setMap=function(t){ol.control.Control.prototype.setMap.call(this,t);this.refresh(this.get("zoom")||1,!0)};ol.control.Timeline.prototype.addButton=function(t){this.element.classList.add("ol-hasbutton");ol.ext.element.create("BUTTON",{className:t.className||void 0,title:t.title,html:t.html,click:t.handleClick,parent:this._buttons})};ol.control.Timeline.prototype.setInterval=function(t){"string"==typeof t&&(t=/s$/.test(t)?1e3*parseFloat(t):/mn$/.test(t)?6e4*parseFloat(t):/h$/.test(t)?36e5*parseFloat(t):/d$/.test(t)?864e5*parseFloat(t):/y$/.test(t)?31536e6*parseFloat(t):0);this.set("interval",t||0);t?this.element.classList.add("ol-interval"):this.element.classList.remove("ol-interval");this.refresh(this.get("zoom"))};ol.control.Timeline.prototype._getHTML=function(t){return t.get("name")||""};ol.control.Timeline.prototype._getFeatureDate=function(t){return t&&t.get?t.get("date"):null};ol.control.Timeline.prototype._endFeatureDate=function(){};ol.control.Timeline.prototype.isCollapsed=function(){return this.element.classList.contains("ol-collapsed")};ol.control.Timeline.prototype.collapse=function(t){t?this.element.classList.add("ol-collapsed"):this.element.classList.remove("ol-collapsed");this.dispatchEvent({type:"collapse",collapsed:this.isCollapsed()})};ol.control.Timeline.prototype.toggle=function(){this.element.classList.toggle("ol-collapsed");this.dispatchEvent({type:"collapse",collapsed:this.isCollapsed()})};ol.control.Timeline.prototype.setFeatures=function(t,e){this._features=this._source=null;t instanceof ol.source.Vector?this._source=t:this._features=t instanceof Array?t:[];this.refresh(e)};ol.control.Timeline.prototype.getFeatures=function(){return this._features||this._source.getFeatures()};ol.control.Timeline.prototype.refresh=function(t,e){if(this.getMap()){t||(t=this.get("zoom"));t=Math.min(this.get("maxZoom"),Math.max(this.get("minZoom"),t||1));this.set("zoom",t);this._scrollDiv.innerHTML="";var o,i,r=this.getFeatures(),n=this._tline=[];r.forEach(function(t){(o=this._getFeatureDate(t))&&(o instanceof Date||(o=new Date(o)),this._endFeatureDate&&((i=this._endFeatureDate(t))instanceof Date||(i=new Date(i))),isNaN(o)||n.push({date:o,end:isNaN(i)?null:i,feature:t}))}.bind(this));n.sort(function(t,e){return t.date<e.date?-1:t.date===e.date?0:1});var s=ol.ext.element.create("DIV",{parent:this._scrollDiv}),a=this._minDate=Math.min(this.get("minDate"),n.length?n[0].date:1/0),l=this._maxDate=Math.max(this.get("maxDate"),n.length?n[n.length-1].date:-1/0);isFinite(a)||(this._minDate=a=new Date);isFinite(l)||(this._maxDate=l=new Date);var c=l-a,h=this.get("maxWidth"),p=this._scale=(c>h?h/c:1)*t;c=(l-(a=this._minDate=this._minDate-10/p))*p;ol.ext.element.setStyle(s,{width:c,maxWidth:"unset"});this._drawTime(s,a,l,p);this.get("interval")?ol.ext.element.setStyle(this._intervalDiv,{width:this.get("interval")*p}):ol.ext.element.setStyle(this._intervalDiv,{width:""});var u=[],g=ol.ext.element.getStyle(this._scrollDiv,"lineHeight"),d=ol.ext.element.create("DIV",{className:"ol-features",parent:s});n.forEach(function(t){for(var e=t.date,o=t.elt=ol.ext.element.create("DIV",{className:"ol-feature",style:{left:Math.round((e-a)*p)},html:this._getHTML(t.feature),parent:d}),i=o.querySelectorAll("img"),r=0;r<i.length;r++)i[r].ondragstart=function(){return!1};t.end&&ol.ext.element.setStyle(o,{minWidth:(t.end-e)*p,width:(t.end-e)*p,maxWidth:"unset"});var n,s,l=ol.ext.element.getStyle(o,"left");for(o.addEventListener("click",function(){this._moving||this.dispatchEvent({type:"select",feature:t.feature})}.bind(this)),n=0;(s=u[n])&&!(l>s);n++);u[n]=l+ol.ext.element.getStyle(o,"width");ol.ext.element.setStyle(o,{top:n*g})}.bind(this));this._nbline=u.length;e&&this.setDate(this._minDate,{anim:!1,position:"start"});this.dispatchEvent({type:"scroll",date:this.getDate(),dateStart:this.getDate("start"),dateEnd:this.getDate("end")})}};ol.control.Timeline.prototype._getOffsetFromDate=function(t){return(t-this._minDate)*this._scale};ol.control.Timeline.prototype._getDateFromOffset=function(t){return t/this._scale+this._minDate};ol.control.Timeline.prototype._setScrollLeft=function(t){this._scrollLeft=t;void 0!==t&&(this._scrollDiv.scrollLeft=t)};ol.control.Timeline.prototype._getScrollLeft=function(){return void 0===this._scrollLeft?this._scrollDiv.scrollLeft:this._scrollLeft};ol.control.Timeline.prototype._drawTime=function(t,e,o,i){var r,n,s,a,l=ol.ext.element.create("DIV",{className:"ol-times",parent:t}),c=ol.ext.element.getStyle(l,"left"),h=ol.ext.element.getStyle(l,"height"),p=new Date(this._minDate).getFullYear();n=(new Date(0).setFullYear(String(p))-new Date(0).setFullYear(String(p-1)))*i;for(var u=Math.round(2*h/n)+1;!((r=new Date(0).setFullYear(p))>this._maxDate);)ol.ext.element.create("DIV",{className:"ol-time ol-year",style:{left:this._getOffsetFromDate(r)-c},html:p,parent:l}),p+=u;if(/day|month/.test(this.get("graduation"))&&(n=(new Date(0,0,1).setFullYear(String(p))-new Date(0,0,1).setFullYear(String(p-1)))*i,(a=Math.max(1,Math.round(12/Math.round(n/h/2))))<12))for(p=new Date(this._minDate).getFullYear(),s=a+1;(r=new Date(0,0,1)).setFullYear(p),r.setMonth(s-1),!(r>this._maxDate);)ol.ext.element.create("DIV",{className:"ol-time ol-month",style:{left:this._getOffsetFromDate(r)-c},html:r.toLocaleDateString(void 0,{month:"short"}),parent:l}),(s+=a)>12&&(p++,s=a+1);if("day"===this.get("graduation")){n=(new Date(0,1,1)-new Date(0,0,1))*i;var g=Math.max(1,Math.round(31/Math.round(n/h/2)));if(g<31){p=new Date(this._minDate).getFullYear();s=0;for(var d=g;;)if((r=new Date(0,0,1)).setFullYear(p),r.setMonth(s),r.setDate(d),isNaN(r))++s>12&&(s=1,p++),d=g;else{if(r>this._maxDate)break;ol.ext.element.create("DIV",{className:"ol-time ol-day",style:{left:this._getOffsetFromDate(r)-c},html:d,parent:l});p=r.getFullYear();s=r.getMonth();(d=r.getDate()+g)+g/2>31&&(s++,d=g)}}}};ol.control.Timeline.prototype.setDate=function(t,e){var o;if(e=e||{},t instanceof Date?o=t:(this.getFeatures().indexOf(t)>=0&&(o=this._getFeatureDate(t)),!o||o instanceof Date||(o=new Date(o)),o&&!isNaN(o)||(o=new Date(String(t)))),!isNaN(o)){!1===e.anim&&this._scrollDiv.classList.add("ol-move");var i=this._getOffsetFromDate(o);if("start"===e.position?i+=ol.ext.element.outerWidth(this._scrollDiv)/2-ol.ext.element.getStyle(this._scrollDiv,"marginLeft")/2:"end"===e.position&&(i-=ol.ext.element.outerWidth(this._scrollDiv)/2-ol.ext.element.getStyle(this._scrollDiv,"marginLeft")/2),this._setScrollLeft(i),!1===e.anim&&this._scrollDiv.classList.remove("ol-move"),t)for(var r,n=0;r=this._tline[n];n++)r.feature===t?(r.elt.classList.add("ol-select"),this._select=r):r.elt.classList.remove("ol-select")}};ol.control.Timeline.prototype.roundDate=function(t,e){switch(console.log(t),e){case"mn":return new Date(this._roundTo(t,6e4));case"hour":return new Date(this._roundTo(t,36e5));case"day":return new Date(this._roundTo(t,864e5));case"month":return(t=new Date(this._roundTo(t,864e5))).getDate()>15&&(t=new Date(t.setMonth(t.getMonth()+1))),t=t.setDate(1),new Date(t);default:return new Date(t)}};ol.control.Timeline.prototype.getDate=function(t,e){var o;switch(e||(e=t),t){case"start":o=this.get("interval")?-ol.ext.element.getStyle(this._intervalDiv,"width")/2+ol.ext.element.getStyle(this._scrollDiv,"marginLeft")/2:-ol.ext.element.outerWidth(this._scrollDiv)/2+ol.ext.element.getStyle(this._scrollDiv,"marginLeft")/2;break;case"end":o=this.get("interval")?ol.ext.element.getStyle(this._intervalDiv,"width")/2-ol.ext.element.getStyle(this._scrollDiv,"marginLeft")/2:ol.ext.element.outerWidth(this._scrollDiv)/2-ol.ext.element.getStyle(this._scrollDiv,"marginLeft")/2;break;default:o=0}var i=this._getDateFromOffset(this._getScrollLeft()+o);return i=this.roundDate(i,e),new Date(i)};ol.control.Timeline.prototype._roundTo=function(t,e){return Math.round(t/e)*e};ol.control.Timeline.prototype.getStartDate=function(){return new Date(this.get("minDate"))};ol.control.Timeline.prototype.getEndDate=function(){return new Date(this.get("maxDate"))};ol.control.Toggle=function(t){t=t||{};var e=this;this.interaction_=t.interaction;this.interaction_&&(this.interaction_.setActive(t.active),this.interaction_.on("change:active",function(){e.setActive(e.interaction_.getActive())}));t.toggleFn&&(t.onToggle=t.toggleFn);t.handleClick=function(){e.toggle();t.onToggle&&t.onToggle.call(e,e.getActive())};t.className=(t.className||"")+" ol-toggle";ol.control.Button.call(this,t);this.set("title",t.title);this.set("autoActivate",t.autoActivate);t.bar&&(this.subbar_=t.bar,this.subbar_.setTarget(this.element),this.subbar_.element.classList.add("ol-option-bar"));this.setActive(t.active);this.setDisable(t.disable)};ol.ext.inherits(ol.control.Toggle,ol.control.Button);ol.control.Toggle.prototype.setMap=function(t){!t&&this.getMap()&&(this.interaction_&&this.getMap().removeInteraction(this.interaction_),this.subbar_&&this.getMap().removeControl(this.subbar_));ol.control.Control.prototype.setMap.call(this,t);t&&(this.interaction_&&t.addInteraction(this.interaction_),this.subbar_&&t.addControl(this.subbar_))};ol.control.Toggle.prototype.getSubBar=function(){return this.subbar_};ol.control.Toggle.prototype.getDisable=function(){var t=this.element.querySelector("button");return t&&t.disabled};ol.control.Toggle.prototype.setDisable=function(t){this.getDisable()!=t&&(this.element.querySelector("button").disabled=t,t&&this.getActive()&&this.setActive(!1),this.dispatchEvent({type:"change:disable",key:"disable",oldValue:!t,disable:t}))};ol.control.Toggle.prototype.getActive=function(){return this.element.classList.contains("ol-active")};ol.control.Toggle.prototype.toggle=function(){this.getActive()?this.setActive(!1):this.setActive(!0)};ol.control.Toggle.prototype.setActive=function(t){this.interaction_&&this.interaction_.setActive(t);this.subbar_&&this.subbar_.setActive(t);this.getActive()!==t&&(t?this.element.classList.add("ol-active"):this.element.classList.remove("ol-active"),this.dispatchEvent({type:"change:active",key:"active",oldValue:!t,active:t}))};ol.control.Toggle.prototype.setInteraction=function(t){this.interaction_=t};ol.control.Toggle.prototype.getInteraction=function(){return this.interaction_};ol.featureAnimation=function(t){t=t||{};this.duration_="number"==typeof t.duration?t.duration>=0?t.duration:0:1e3;this.fade_="function"==typeof t.fade?t.fade:null;this.repeat_=Number(t.repeat);var e="function"==typeof t.easing?t.easing:ol.easing.linear;this.easing_=t.revers?function(t){return 1-e(t)}:e;this.hiddenStyle=t.hiddenStyle;ol.Object.call(this)};ol.ext.inherits(ol.featureAnimation,ol.Object);ol.featureAnimation.hiddenStyle=new ol.style.Style({image:new ol.style.Circle({}),stroke:new ol.style.Stroke({color:"transparent"})});ol.featureAnimation.prototype.drawGeom_=function(t,e,o){this.fade_&&(t.context.globalAlpha=this.fade_(1-t.elapsed));for(var i=t.style,r=0;r<i.length;r++)try{var n=t.vectorContext||ol.render.getVectorContext(t);n.setStyle(i[r]);i[r].getZIndex()<0?n.drawGeometry(o||e):n.drawGeometry(e)}catch(t){}};ol.featureAnimation.prototype.animate=function(){return!1};ol.Map.prototype.animateFeature=function(t,e){!function o(i){for(var r,n=i.length-1;r=i[n];n--)if(r.getVisible()){if(!r.getLayers)return r.animateFeature(t,e),!0;if(o(r.getLayers().getArray()))return!0}return!1}(this.getLayers().getArray())};ol.layer.Base.prototype.animateFeature=function(t,e,o){var i,r=this,n=t.getStyle(),s=n||(this.getStyleFunction?this.getStyleFunction()(t):null);s||(s=[]);s instanceof Array||(s=[s]);var a={vectorContext:null,frameState:null,start:0,time:0,elapsed:0,extent:!1,feature:t,geom:t.getGeometry(),typeGeom:t.getGeometry().getType(),bbox:t.getGeometry().getExtent(),coord:ol.extent.getCenter(t.getGeometry().getExtent()),style:s};e instanceof Array||(e=[e]);for(var l=e.length-1;l>=0;l--)0===e[l].duration_&&e.splice(l,1);var c=0,h=0,p=o&&this.getFilters?this.getFilters():[];function u(o){a.type=o.type;try{a.vectorContext=o.vectorContext||ol.render.getVectorContext(o)}catch(o){}a.frameState=o.frameState;a.inversePixelTransform=o.inversePixelTransform;a.extent||(a.extent=o.frameState.extent,a.start=o.frameState.time,a.context=o.context);a.time=o.frameState.time-a.start;a.elapsed=a.time/e[h].duration_;a.elapsed>1&&(a.elapsed=1);o.context.save();p.forEach(function(t){t.get("active")&&t.precompose(o)});this.getOpacity&&(o.context.globalAlpha=this.getOpacity());e[h].animate(a)||(++c<e[h].repeat_?a.extent=!1:h<e.length-1?(e[h].dispatchEvent({type:"animationend",feature:t}),h++,c=0,a.extent=!1):g());p.forEach(function(t){t.get("active")&&t.postcompose(o)});o.context.restore();o.frameState.animate=!0}function g(o){ol.Observable.unByKey(i);i=null;t.setStyle(n);var s={type:"animationend",feature:t};if(o)for(var a in o)o.hasOwnProperty(a)&&(s[a]=o[a]);e[h].dispatchEvent(s);r.dispatchEvent(s)}function d(o){if(e.length&&!i){i=r.on(["postcompose","postrender"],u.bind(r));r.renderSync?r.renderSync():r.changed();t.setStyle(e[h].hiddenStyle||ol.featureAnimation.hiddenStyle);var n={type:"animationstart",feature:t};if(o)for(var s in o)o.hasOwnProperty(s)&&(n[s]=o[s]);e[h].dispatchEvent(n);r.dispatchEvent(n)}}return d(),{start:d,stop:g,isPlaying:function(){return!!i}}};ol.featureAnimation.Blink=function(t){ol.featureAnimation.call(this,t);this.set("nb",t.nb||10)};ol.ext.inherits(ol.featureAnimation.Blink,ol.featureAnimation);ol.featureAnimation.Blink.prototype.animate=function(t){return Math.round(this.easing_(t.elapsed)*this.get("nb"))%2||this.drawGeom_(t,t.geom),t.time<=this.duration_};ol.featureAnimation.Bounce=function(t){t=t||{};ol.featureAnimation.call(this,t);this.amplitude_=t.amplitude||40;this.bounce_=-Math.PI*(t.bounce||3)};ol.ext.inherits(ol.featureAnimation.Bounce,ol.featureAnimation);ol.featureAnimation.Bounce.prototype.animate=function(t){var e=t.geom.clone(),o=Math.abs(Math.sin(this.bounce_*t.elapsed))*this.amplitude_*(1-this.easing_(t.elapsed))*t.frameState.viewState.resolution;return e.translate(0,o),this.drawGeom_(t,e,t.geom),t.time<=this.duration_};ol.featureAnimation.Drop=function(t){t=t||{};this.speed_=t.speed||0;ol.featureAnimation.call(this,t);this.side_=t.side||"top"};ol.ext.inherits(ol.featureAnimation.Drop,ol.featureAnimation);ol.featureAnimation.Drop.prototype.animate=function(t){if(!t.time){var e=t.frameState.viewState.rotation,o=t.frameState.size[1]*t.frameState.viewState.resolution;"top"!=this.side_&&(o*=-1);this.dx=-Math.sin(e)*o;this.dy=Math.cos(e)*o;this.speed_&&(this.duration_=o/this.speed_/t.frameState.viewState.resolution)}var i=t.geom.clone();return i.translate(this.dx*(1-this.easing_(t.elapsed)),this.dy*(1-this.easing_(t.elapsed))),this.drawGeom_(t,i,t.geom),t.time<=this.duration_};ol.featureAnimation.Fade=function(t){t=t||{};this.speed_=t.speed||0;ol.featureAnimation.call(this,t)};ol.ext.inherits(ol.featureAnimation.Fade,ol.featureAnimation);ol.featureAnimation.Fade.prototype.animate=function(t){return t.context.globalAlpha=this.easing_(t.elapsed),this.drawGeom_(t,t.geom),t.time<=this.duration_};ol.featureAnimation.None=function(t){ol.featureAnimation.call(this,t)};ol.ext.inherits(ol.featureAnimation.None,ol.featureAnimation);ol.featureAnimation.None.prototype.animate=function(t){return t.time<=this.duration_};ol.featureAnimation.Null=function(){ol.featureAnimation.call(this,{duration:0})};ol.ext.inherits(ol.featureAnimation.Null,ol.featureAnimation);ol.featureAnimation.Path=function(t){switch(t=t||{},ol.featureAnimation.call(this,t),this.speed_=t.speed||0,this.path_=t.path,t.rotate){case!0:case 0:this.rotate_=0;break;default:this.rotate_=t.rotate||!1}this.path_&&this.path_.getGeometry&&(this.path_=this.path_.getGeometry());this.path_&&this.path_.getLineString&&(this.path_=this.path_.getLineString());this.path_.getLength?(this.dist_=this.path_.getLength(),this.path_&&this.path_.getCoordinates&&(this.path_=this.path_.getCoordinates())):this.dist_=0;this.speed_>0&&(this.duration_=this.dist_/this.speed_)};ol.ext.inherits(ol.featureAnimation.Path,ol.featureAnimation);ol.featureAnimation.Path.prototype.animate=function(t){if(!t.time&&!this.dist_)return!1;var e,o,i,r,n,s,a=this.dist_*this.easing_(t.elapsed),l=0;o=this.path_[0];for(var c=1;c<this.path_.length;c++){if(e=o,r=(o=this.path_[c])[0]-e[0],n=o[1]-e[1],(s=Math.sqrt(r*r+n*n))&&l+s>=a){i=(a-l)/s;o=[e[0]+(o[0]-e[0])*i,e[1]+(o[1]-e[1])*i];break}l+=s}if(!1!==this.rotate_)for(var h=this.rotate_-Math.atan2(e[1]-o[1],e[0]-o[0]),p=0;i=t.style[p];p++)i.getImage()&&i.getImage().setRotation(h);return t.geom.setCoordinates(o),this.drawGeom_(t,t.geom),t.time<=this.duration_};ol.featureAnimation.Shake=function(t){t=t||{};ol.featureAnimation.call(this,t);this.amplitude_=t.amplitude||40;this.bounce_=-Math.PI*(t.bounce||6);this.horizontal_=t.horizontal};ol.ext.inherits(ol.featureAnimation.Shake,ol.featureAnimation);ol.featureAnimation.Shake.prototype.animate=function(t){var e=t.geom.clone(),o=t.geom.clone(),i=this.easing_(t.elapsed);return i=Math.sin(this.bounce_*i)*this.amplitude_*(1-i)*t.frameState.viewState.resolution,this.horizontal_?(e.translate(i,0),o.translate(i,0)):e.translate(0,i),this.drawGeom_(t,e,o),t.time<=this.duration_};ol.featureAnimation.Show=function(t){ol.featureAnimation.call(this,t)};ol.ext.inherits(ol.featureAnimation.Show,ol.featureAnimation);ol.featureAnimation.Show.prototype.animate=function(t){return this.drawGeom_(t,t.geom),t.time<=this.duration_};ol.featureAnimation.Slide=function(t){t=t||{};this.speed_=t.speed||0;ol.featureAnimation.call(this,t);this.side_=t.side||"left"};ol.ext.inherits(ol.featureAnimation.Slide,ol.featureAnimation);ol.featureAnimation.Slide.prototype.animate=function(t){t.time||(this.dx="left"==this.side_?t.extent[0]-t.bbox[2]:t.extent[2]-t.bbox[0],this.speed_&&(this.duration_=Math.abs(this.dx)/this.speed_/t.frameState.viewState.resolution));var e=t.geom.clone();return e.translate(this.dx*(1-this.easing_(t.elapsed)),0),this.drawGeom_(t,e),t.time<=this.duration_};ol.featureAnimation.Teleport=function(t){ol.featureAnimation.call(this,t)};ol.ext.inherits(ol.featureAnimation.Teleport,ol.featureAnimation);ol.featureAnimation.Teleport.prototype.animate=function(t){var e=this.easing_(t.elapsed);if(e){t.context.save();var o=t.frameState.pixelRatio;t.context.globalAlpha=e;t.context.scale(e,1/e);var i=t.frameState.coordinateToPixelTransform,r=(1/e-1)*o*(i[0]*t.coord[0]+i[1]*t.coord[1]+i[4]),n=(e-1)*o*(i[2]*t.coord[0]+i[3]*t.coord[1]+i[5]);t.context.translate(r,n);this.drawGeom_(t,t.geom);t.context.restore()}return t.time<=this.duration_};ol.featureAnimation.Throw=function(t){t=t||{};ol.featureAnimation.call(this,t);this.speed_=t.speed||0;this.side_=t.side||"left"};ol.ext.inherits(ol.featureAnimation.Throw,ol.featureAnimation);ol.featureAnimation.Throw.prototype.animate=function(t){var e,o;!t.time&&this.speed_&&("left"==this.side_?(e=this.dx=t.extent[0]-t.bbox[2],o=this.dy=t.extent[3]-t.bbox[1]):(e=this.dx=t.extent[2]-t.bbox[0],o=this.dy=t.extent[3]-t.bbox[1]),this.duration_=Math.sqrt(e*e+o*o)/this.speed_/t.frameState.viewState.resolution);var i=t.geom.clone(),r=t.geom.clone();return i.translate(this.dx*(1-this.easing_(t.elapsed)),this.dy*Math.cos(Math.PI/2*this.easing_(t.elapsed))),r.translate(this.dx*(1-this.easing_(t.elapsed)),0),this.drawGeom_(t,i,r),t.time<=this.duration_};ol.featureAnimation.Zoom=function(t){t=t||{};ol.featureAnimation.call(this,t);this.set("zoomout",t.zoomOut)};ol.ext.inherits(ol.featureAnimation.Zoom,ol.featureAnimation);ol.featureAnimation.ZoomOut=function(t){(t=t||{}).zoomOut=!0;ol.featureAnimation.Zoom.call(this,t)};ol.ext.inherits(ol.featureAnimation.ZoomOut,ol.featureAnimation.Zoom);ol.featureAnimation.Zoom.prototype.animate=function(t){var e=this.easing_(t.elapsed);if(e){this.get("zoomout")&&(e=1/e);for(var i,r=t.style,n=[],o=0;o<r.length;o++)(i=r[o].getImage())&&(n[o]=i.getScale(),"postrender"===t.type?i.setScale(n[o]*e/t.frameState.pixelRatio):i.setScale(n[o]*e));for(this.drawGeom_(t,t.geom),o=0;o<r.length;o++)(i=r[o].getImage())&&i.setScale(n[o])}return t.time<=this.duration_};ol.filter={};ol.filter.Base=function(t){ol.Object.call(this);this._listener=[];t&&!1===t.active?this.set("active",!1):this.set("active",!0)};ol.ext.inherits(ol.filter.Base,ol.Object);ol.filter.Base.prototype.setActive=function(t){this.set("active",!0===t)};ol.filter.Base.prototype.getActive=function(){return this.get("active")},function(){function t(){this.renderSync?this.renderSync():this.changed()}function e(e){this.filters_||(this.filters_=[]);this.filters_.push(e);e.precompose&&e._listener.push({listener:this.on(["precompose","prerender"],function(t){this.get("active")&&t.context&&this.precompose(t)}.bind(e)),target:this});e.postcompose&&e._listener.push({listener:this.on(["postcompose","postrender"],function(t){this.get("active")&&t.context&&this.postcompose(t)}.bind(e)),target:this});e._listener.push({listener:e.on("propertychange",t.bind(this)),target:this});t.call(this)}function o(e){var o;for(this.filters_||(this.filters_=[]),o=this.filters_.length-1;o>=0;o--)this.filters_[o]===e&&this.filters_.splice(o,1);for(o=e._listener.length-1;o>=0;o--)e._listener[o].target===this&&(ol.Observable.unByKey(e._listener[o].listener),e._listener.splice(o,1));t.call(this)}ol.Map.prototype.addFilter=function(t){console.warn("[OL-EXT] addFilter deprecated on map.");e.call(this,t)};ol.Map.prototype.removeFilter=function(t){o.call(this,t)};ol.Map.prototype.getFilters=function(){return this.filters_||[]};ol.layer.Base.prototype.addFilter=function(t){e.call(this,t)};ol.layer.Base.prototype.removeFilter=function(t){o.call(this,t)};ol.layer.Base.prototype.getFilters=function(){return this.filters_||[]}}();ol.filter.Mask=function(t){if(t=t||{},ol.filter.Base.call(this,t),t.feature)switch(t.feature.getGeometry().getType()){case"Polygon":case"MultiPolygon":this.feature_=t.feature}this.set("inner",t.inner);this.fillColor_=t.fill&&ol.color.asString(t.fill.getColor())||"rgba(0,0,0,0.2)"};ol.ext.inherits(ol.filter.Mask,ol.filter.Base);ol.filter.Mask.prototype.drawFeaturePath_=function(t,e){var o,i=t.context,r=i.canvas,n=t.frameState.pixelRatio;if(t.frameState.coordinateToPixelTransform){var s=t.frameState.coordinateToPixelTransform;if(t.inversePixelTransform){var a=t.inversePixelTransform;o=function(t){return[(t=[t[0]*s[0]+t[1]*s[1]+s[4],t[0]*s[2]+t[1]*s[3]+s[5]])[0]*a[0]-t[1]*a[1]+a[4],-t[0]*a[2]+t[1]*a[3]+a[5]]}}else o=function(t){return[(t[0]*s[0]+t[1]*s[1]+s[4])*n,(t[0]*s[2]+t[1]*s[3]+s[5])*n]}}else s=t.frameState.coordinateToPixelMatrix,o=function(t){return[(t[0]*s[0]+t[1]*s[1]+s[12])*n,(t[0]*s[4]+t[1]*s[5]+s[13])*n]};var l=this.feature_.getGeometry().getCoordinates();"Polygon"==this.feature_.getGeometry().getType()&&(l=[l]);i.beginPath();e&&(i.moveTo(0,0),i.lineTo(r.width,0),i.lineTo(r.width,r.height),i.lineTo(0,r.height),i.lineTo(0,0));for(var c=0;c<l.length;c++)for(var h=l[c],p=0;p<h.length;p++){var u=o(h[p][0]);i.moveTo(u[0],u[1]);for(var g=1;g<h[p].length;g++)u=o(h[p][g]),i.lineTo(u[0],u[1])}};ol.filter.Mask.prototype.postcompose=function(t){if(this.feature_){var e=t.context;e.save();this.drawFeaturePath_(t,!this.get("inner"));e.fillStyle=this.fillColor_;e.fill("evenodd");e.restore()}};ol.filter.Clip=function(t){if(t=t||{},ol.filter.Base.call(this,t),this.set("coords",t.coords),this.set("units",t.units),this.set("keepAspectRatio",t.keepAspectRatio),this.set("extent",t.extent||[0,0,1,1]),this.set("color",t.color),!t.extent&&"%"!=t.units&&t.coords){for(var e,o=1/0,i=1/0,r=-1/0,n=-1/0,s=0;e=t.coords[s];s++)o>e[0]&&(o=e[0]),r<e[0]&&(r=e[0]),i>e[1]&&(i=e[1]),n<e[1]&&(n=e[1]);t.extent=[o,i,r,n]}};ol.ext.inherits(ol.filter.Clip,ol.filter.Base);ol.filter.Clip.prototype.clipPath_=function(t){var e=t.context,o=t.frameState.size,i=this.get("coords");if(i){var r=this.get("extent"),n=1,s=1;"%"==this.get("units")&&(n=o[0]/(r[2]-r[0]),s=o[1]/(r[3]-r[1]));this.get("keepAspectRatio")&&(n=s=Math.min(n,s));var a=this.get("position"),l=0,c=0;/left/.test(a)?l=-r[0]*n:/center/.test(a)?l=o[0]/2-(r[2]-r[0])*n/2:/right/.test(a)&&(l=o[0]-(r[2]-r[0])*n);var h=function(t){return t*n+l};/top/.test(a)?c=-r[1]*s:/middle/.test(a)?c=o[1]/2-(r[3]-r[1])*s/2:/bottom/.test(a)&&(c=o[1]-(r[3]-r[1])*s);var p=function(t){return t*s+c},u=[h(i[0][0]),p(i[0][1])],g=t.inversePixelTransform;g&&(u=[u[0]*g[0]-u[1]*g[1]+g[4],-u[0]*g[2]+u[1]*g[3]+g[5]]);e.moveTo(u[0],u[1]);for(var d,m=1;d=i[m];m++)u=[h(d[0]),p(d[1])],g&&(u=[u[0]*g[0]-u[1]*g[1]+g[4],-u[0]*g[2]+u[1]*g[3]+g[5]]),e.lineTo(u[0],u[1]);u=[h(i[0][0]),p(i[0][1])];g&&(u=[u[0]*g[0]-u[1]*g[1]+g[4],-u[0]*g[2]+u[1]*g[3]+g[5]]);e.moveTo(u[0],u[1])}};ol.filter.Clip.prototype.precompose=function(t){this.get("color")||(t.context.save(),t.context.beginPath(),this.clipPath_(t),t.context.clip())};ol.filter.Clip.prototype.postcompose=function(t){if(this.get("color")){var e=t.context,o=t.context.canvas;e.save();e.beginPath();e.moveTo(0,0);e.lineTo(0,o.height);e.lineTo(o.width,o.height);e.lineTo(o.width,o.height);e.lineTo(o.width,0);e.lineTo(0,0);this.clipPath_(t);e.fillStyle=this.get("color");e.fill("evenodd")}t.context.restore()};ol.filter.Colorize=function(t){ol.filter.Base.call(this,t);this.setFilter(t)};ol.ext.inherits(ol.filter.Colorize,ol.filter.Base);ol.filter.Colorize.prototype.setFilter=function(t){switch(t=t||{}){case"grayscale":t={operation:"hue",red:0,green:0,blue:0,value:1};break;case"invert":t={operation:"difference",red:255,green:255,blue:255,value:1};break;case"sepia":t={operation:"color",red:153,green:102,blue:51,value:.6}}var e,o=t.color?ol.color.asArray(t.color):[t.red,t.green,t.blue,t.value];switch(this.set("color",ol.color.asString(o)),this.set("value",o[3]||1),t.operation){case"color":case"hue":case"difference":case"color-dodge":case"enhance":this.set("operation",t.operation);break;case"saturation":e=255*(t.value||0);this.set("color",ol.color.asString([0,0,e,e||1]));this.set("operation",t.operation);break;case"luminosity":e=255*(t.value||0);this.set("color",ol.color.asString([e,e,e,255]));this.set("operation","hard-light");break;case"contrast":e=255*(t.value||0);this.set("color",ol.color.asString([e,e,e,255]));this.set("operation","soft-light");break;default:this.set("operation","color")}};ol.filter.Colorize.prototype.setValue=function(t){this.set("value",t);var e=ol.color.asArray(this.get("color"));e[3]=t;this.set("color",ol.color.asString(e))};ol.filter.Colorize.prototype.setColor=function(t){(t=ol.color.asArray(t))&&(t[3]=this.get("value"),this.set("color",ol.color.asString(t)))};ol.filter.Colorize.prototype.precompose=function(){};ol.filter.Colorize.prototype.postcompose=function(t){var e=t.context,o=e.canvas;if(e.save(),"enhance"==this.get("operation")){var i=this.get("value");if(i){var r=o.width,n=o.height;e.globalCompositeOperation="color-burn";e.globalAlpha=i;e.drawImage(o,0,0,r,n);e.drawImage(o,0,0,r,n);e.drawImage(o,0,0,r,n)}}else e.globalCompositeOperation=this.get("operation"),e.fillStyle=this.get("color"),e.fillRect(0,0,o.width,o.height);e.restore()};ol.filter.Composite=function(t){ol.filter.Base.call(this,t);this.set("operation",t.operation||"source-over")};ol.ext.inherits(ol.filter.Composite,ol.filter.Base);ol.filter.Composite.prototype.setOperation=function(t){this.set("operation",t||"source-over")};ol.filter.Composite.prototype.precompose=function(t){var e=t.context;e.save();e.globalCompositeOperation=this.get("operation")};ol.filter.Composite.prototype.postcompose=function(t){t.context.restore()};ol.filter.Crop=function(t){t=t||{};ol.filter.Mask.call(this,t)};ol.ext.inherits(ol.filter.Crop,ol.filter.Mask);ol.filter.Crop.prototype.precompose=function(t){if(this.feature_){var e=t.context;e.save();this.drawFeaturePath_(t,this.get("inner"));e.clip("evenodd")}};ol.filter.Crop.prototype.postcompose=function(t){this.feature_&&t.context.restore()};ol.filter.Fold=function(t){t=t||{};ol.filter.Base.call(this,t);this.set("fold",t.fold||[8,4]);this.set("margin",t.margin||8);this.set("padding",t.padding||8);"number"==typeof t.fsize&&(t.fsize=[t.fsize,t.fsize]);this.set("fsize",t.fsize||[8,10]);this.set("fill",t.fill);this.set("shadow",!1!==t.shadow)};ol.ext.inherits(ol.filter.Fold,ol.filter.Base);ol.filter.Fold.prototype.drawLine_=function(t,e,o){var i,r,n,s=t.canvas,a=this.get("fold"),l=s.width,c=s.height;for(t.beginPath(),t.moveTo(o,o),n=1;n<=a[0];n++)i=n*l/a[0]-(n==a[0]?o:0),r=e[1]*(n%2)+o,t.lineTo(i,r);for(n=1;n<=a[1];n++)i=l-e[0]*(n%2)-o,r=n*c/a[1]-(n==a[1]?e[0]*(a[0]%2)+o:0),t.lineTo(i,r);for(n=a[0];n>0;n--)i=n*l/a[0]-(n==a[0]?e[0]*(a[1]%2)+o:0),r=c-e[1]*(n%2)-o,t.lineTo(i,r);for(n=a[1];n>0;n--)i=e[0]*(n%2)+o,r=n*c/a[1]-(n==a[1]?o:0),t.lineTo(i,r);t.closePath()};ol.filter.Fold.prototype.precompose=function(t){var e=t.context;e.save();e.shadowColor="rgba(0,0,0,0.3)";e.shadowBlur=8;e.shadowOffsetX=2;e.shadowOffsetY=3;this.drawLine_(e,this.get("fsize"),this.get("margin"));e.fillStyle="#fff";this.get("fill")&&e.fill();e.strokeStyle="rgba(0,0,0,0.1)";e.stroke();e.restore();e.save();this.drawLine_(e,this.get("fsize"),this.get("margin")+this.get("padding"));e.clip()};ol.filter.Fold.prototype.postcompose=function(t){var e=t.context,o=e.canvas;if(e.restore(),e.save(),this.drawLine_(e,this.get("fsize"),this.get("margin")),e.clip(),this.get("shadow")){var i=this.get("fold"),r=o.width/i[0],n=o.height/i[1],s=e.createRadialGradient(5*r/8,5*r/8,r/4,r/2,r/2,r);s.addColorStop(0,"transparent");s.addColorStop(1,"rgba(0,0,0,0.2)");e.fillStyle=s;e.scale(1,n/r);for(var a=0;a<i[0];a++)for(var l=0;l<i[1];l++)e.save(),e.translate(a*r,l*r),e.fillRect(0,0,r,r),e.restore()}e.restore()};ol.filter.Lego=function(t){t||(t={});ol.filter.Base.call(this,t);var e=new Image;e.src=this.img[t.img]||this.img.ol3;e.crossOrigin=t.crossOrigin||null;this.pattern={canvas:document.createElement("canvas")};this.setBrick(t.brickSize,e);this.internal_=document.createElement("canvas")};ol.ext.inherits(ol.filter.Lego,ol.filter.Base);ol.filter.Lego.prototype.img={brick:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAQAAAAAYLlVAAAAAnNCSVQICFXsRgQAAAAJcEhZcwAAD10AAA9dAah0GUAAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb7jwaAAAGAElEQVRo3sWZy4tkVx3HP+fcc29Vd1dP17TdTcbJPDKPMGR0kVEZkuBCF0EE9Z8QXLhxMUsRF4oLwYWQTSCgSxUXroQhoiEuskgEUUQh+BhHOpkZO11dr3vvefxc3FPlNHNvPbrD1Dl016XoqvM539/znFbcZo3VjbFmxcMA3Mg2fSoAiQJDov7/B1o9+aEgkycv4PBSPU9eHeDEixNwOAFXPYvFia0+rcnQEeBr218cfLIwCqW1UWillEYphUKpCmCCIQAiCEhAJIggTiSISBAfggTvJZTifQghWO+89cOQexuOXN8Pwz/9ff9X/xF0uEA7AmTsjLp/2xZQCgXHlj0OEBEAeRwGkep3qN6pfibDB3DBixMnvdCXt8J3FZowNYFSjgv71RtPaehjD0alalVOqCtHU3qlAGrVAGbidCtUYLUAiV6dCUx8XV4BhUKjY0AJgUB4LE8sA7CkCRSalFYnE72WiBrLSCKCp6TALZNRDEDCwgAKQ/vyRidN9c32K1sbqlCP/C+P9kXJI597PA7HkGJRCLNUGCY767udF9e+9dz1S5ueoRzIEZa1OxcK9td+/fAHvYH0LY6MkgHFIuYwS0ifXe1+qXvn1vk99QfzCwokToUylPrre1/de/vMnf9+5MsSg2HMELegAsl86duvnP3e8y/f1r83v8Li1RO7k/9c2t/avHnt27xpyhRDguEIuxDA3OXXX93+8a0rz6ZvcKgadqUEL73wx+9sb5//WWKTGCOHsxEWM0H71e2ffmF3lPyEkZppVyVYefCw/9a5f3epSvsWh7MMsUgeaL20/dpLu4fJXZUvFCgi46/8i5RNFCCc4bA5JuZ7f/Kp7g9fuLSdvLnY8lEHxz8ItOPcaN7gPAB1tvPl7udupT9nvGSmLLlHSosWLdbJTgpgLna+eVv9hiO1ZIpFOGBEFmejBnrO/tc/0znXTf+sHMuPwD0MrSnETID6/SXPrH/junp3Xiw3atCjxJCRktKu10DHzrZ+pOvpc5cP/6T8CWtt4BATZ4tkBoCvTz8tbTb8TnHiYi/0pgCmPufMUkB1ss9vtU7Trgt9EgyGhIS0zgjRB6RukaSdfHpLPly2xTg2chQJmgRN2qiAa3DBtu5kYXgqAIFYEzTJDAVCnQIqaA+O0wyFjj8q1oY6AB/qd5nLw9JvcpqOOcFMT5dqlg/UAoy5exS2TgGg6DxhkHofqHVCGYf3ho/S904DcHZ6jpZ6lWMY1iogCDxsn8oDduP3BEI9QvSBWgU8YRDeGezsyEk1SNlD8HF51wjQoEAgHNkffXBw+XfJiZbXXCTBT2fZaAJfn4iEEt+z73bTk92jZTxPwOFxVCeGRif0tt4HCtxB+f0P7l//rTlBAN6gjcNicThcfU2NCnjf0NU43L59vf2XZf1A8wzX8JRTgLw+Ckx17SahIZGOyMri7dHalXf6DJdYfovPAgVlRLAzAXwI0gCQU5La8m6SXeH9pi+pWf5lUooIUFKSN6V0A1AE39RyeAYYEpvYNjf4OwP8XNuf50UycnKKKURjSTMALkjzzgpyEhI0LW7ygHvYRh00G7zARQL5dBYU9JtLWvQB52e0VX0MOl5anmOP+3yIjZldpteZijZXuIbBxZ1PAEbkc05GVspZtnX04hlHEDKucpUePYbklCgyNjjDLp9AERhjKSNAQc6IwSzPMQClt37OIeOQ7vQWxJPSZSf2OZMyK1h8jHsbNSgY0Z/tNRWA2HmuVXLIZsxnliw2mROAyR2Rjwmn8vyC0XynrUwQ3PzGs6QX06rDRgD9GIDEjF9pUFLSXyRsowLFIp2/44icDpZ02umq6S3ZxDwupp3hYs1cVMAu1noLBZaMNbJoAD3tl6prOodnTF5feBoBRmGweO8fyClISMlIowkkApRYyqbeZ5YJQrHc4UNieeGYArL8NeUkFcvgJKc/AU56ajxejod+/DT/W/IkQC4P3GoBwoGsFKAf9v2qAGIxej9MU8rTGdNjWtVsJv315aL3YwDYqG5MTDxAPMvTNkJS3ReY6AmtlTrhKsf/AHgAA6ezGE+FAAAAAElFTkSuQmCC",ol3:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAQAAAAAYLlVAAAAAnNCSVQICFXsRgQAAAAJcEhZcwAAD10AAA9dAah0GUAAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb7jwaAAAHtUlEQVRo3sWZTWxcVxXHf/d9zIztcTz+pE6cOHXiyLJJadKgKE2oCBLlQwIWSCxYI0WiGxZZIYRAArFAYoEEi0hIsGBBURd0g4iK2lJAaWlaojZVKkU0H26cxB8Zz/f7uPeweHdebDLPnqlQ5l2N5/mN7tz/+Z//OffcM4rPUKCPl0eBAqqfAEAt5Ia1LwCuAg93CyCnAzgj7TstEKMluW+/x0AsWmKBmFggTu4lIpYome2Qw0kA8I2xL9T2Bp5COY6ncJRSDkopFEolANowBEAEATGIGBEkFjEiYkQbI0ZrMaFobYwxkY51pOumpSNTiau6bm7oZX1NP4Ai+ylYADkmGqUPxwSUQsG2ZbcDsBAA2QoGkeSvSZ4kr/alDcRGSyyxbJqqvG5+pHAwbRegVMz+leTBY7qcbTee8vsmQycRmnL6CkD1G4DXFl0fGegvANfpnws8+947AwqFg2MDSjAYzJY80QuAHl2gcPDJF3PiDLiimtIQC0ETEhD3klE8AJeuASg8CgeHir7vLBVOjwypQK3plyoromRNtzSamJg6QbcgvJ7C0J0YnCweG/jek/Ozw5q6bEiFiIHz+wNWBv68+rPNmlQjYnKE1Ai6cYfXA/W5Q6Uvl84f3zel3vH+SIDYoVAeofOdqa9PvbHn/PoDHYZ4eDSpE3fJgLs79YXToz858uxJ5+/en4jQ6hHr5OPZlZHhpcM/4BUv9PFw8agQdQVg1+UHnx/75fG5Gf83lFWGVUrQsmmu/HBsbN8f3Mi1MVLeGUJ3Lig8P/a7s5MN97c01I5+VUIk91err0/fLqFwgBHKOzmimzyQPzX2q1OTZfeianUVKCLNr93EZxiFIOyhnB0Tu6vf/XTp54uzY+4r3S1veYj5CEPBjqFsA3cDoEaLXy199rj/Is0eM2XILXzy5MkzSO6TAvAOFF84qf5KRfWYYhE2aJCzI5MDbxf7B58pTpf89x8qX1yWGKXKFaUBZIF1tWo/KzJPiYi3VAgYbrFEnpiYiBzBTgx0ts99YvDcvHr7YSBJka/Q4k1u3jz5eQ/EYebkXvL241NUeZN/31gkDwibhHjk8PGzTh+OrWw7X/6g/+TB8nuJrQCc4Z/KU08rb+1f/1gCSqy9NUNoP72txtXRb40dfJ+nkgMEZTw78riZLhDRndNP3vGG9GBKnRzhrppmilfhmcWoRYkxyuxv86euUaT24h4W2WN53WQmheB1ygc7MaCKuc+N5LeW6wfOXeUorwFQZIV5RlnbNqcGjBMyaAFUcfHwcHHxOznBakA6JQq34B4dkXtt+8QjvnCQa/Z/jxpFCmdbpPSJI7NyhMVzK/j2UQuFi4OLkz57FECcIcGCU8yZeirQvdxjjuvpTKGAem2EcjpjkjnUC5cvfIm/bRG3Y4e7AwOmEwPKOJotfhvlPj61dGaBEChtAdD88Yeq9et1LqWOUTj2lYzOItSmcxi2ZDXUw+k0n0bqDoXDJBsMM8rHKeIKFbxgIV9nL3cSFlPpZQBoa6AjgCYXK2YkndbckkxmWWfu2D00ozzYNinOlagwbRct/k92zNJARxFK01yur/mX2wDWGE0jfuHyNfa+Y6hQYNsmJQ45hqwwFaPpOVo6s2zDsCMDgsBq2sBR9xj8ZvX70+LJc9w+scA1Sjz49rjMy7zMywE5IY64PMcNDlkHKCbt9xhMZwhOooGODGhMzVyqTUxIm4Pll9797ixnWFZ3WORdSqz//hI+Pv7LT5dXOcNZltUa49y3qplC0Hb5uBMAbwcGDKYS/eLu6YMfrSZCUhWY+QCfGZ7iZYRbarSdYMfd0bvXazh8ii/yF2vcAVwitB1hZirWnROREFLYjN4uLQ5QTZ/WmeA2VwDUHbBks351HRxK3OaqtTTHEQwxmpjkxJApQh111kBAvBH+9O7y/KveFsfcYyNj82qywqZdxmWBAjEREbHdkrNEqNE6o6qJiVeiC4UPHuqg20PvExxGE6YAWp2jwEvabmIyqpoGuTB4ozEwd6lKvYflRzgBBIQWQrQjAG2MZABoEeJH4UU3N8f1rC/psPyz+AQWQEhIK6s09wACk+EC0NTwcCM3KrDAf6ihd6ui2ccxcrRoEaQg6lnQPYDYSLZlAS1cXBzyLHGfW0SZPDgMscgBDK10BARUs48mVgNxtl2GKh6ObVpOM8Uy94hsZpe0nakoMMdhPGJreRtAg9YuJ6NIwp18G7OJsilVyHGIQ2yySZ0WIYocQ+xhknEUhiYRoQUQ0KJBbSfleAChjvQuh4wypbQLovEpMWHrnPY2K0RoG/eR5SCgQXVn1SQAJNpNWiFlhm0+i8jZIrMNoN0j0jbhJMoPaOwu2sQFJt69oRKyadNqTGQBOFsAiM34CQchIdVuwtYyEOgu4jumQosiEX5a6aq0S9Z2T2zTThfdkS0MRN21lISAiBwD5KwDnLReStp0MZomrc4bTyaAhql131gztAhw8cnhWxeIBRASEWbVPju5wAS9/VYgdnthGwPSe5uynYqlpun9EuCTzHt0O67r5uP8teRRAC25H/cXgNmQvgKomhXdLwB2M7pu0pTyeK70mJYUm251sLfo/T8AGEoKes8eIGZ43E5wk36BBwhO2mbqgwZa9C0CAP4LFLGzNDDzmrAAAAAASUVORK5CYII=",lego:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD8AAAA/CAQAAAD9VthUAAAAAnNCSVQICFXsRgQAAAAJcEhZcwAADzoAAA86AZc528IAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb7jwaAAAHvElEQVRYw8WZWWxcVxnHf+fec2fGu+M4qbPH2EmTLk4FApqQNrgiVYyKeClIwBsvPCAQkZAQPND2gRekCoGQEItYHhBLurCksoTKA6QNJW0CBZLWCc3qEBvHy3hsz93O+XiYMxM7nhmPGxGf++Dre2fO7/v+5/u+s4zigzSxVq3osaZNAwzkuq1nPeUrAE9p99JTAKWn5WYEwErpv9TdGbECRlKMgBEjRlIgsqlAKBBaSKUokAjgkcFz+Ce6BvM9sVbKU55WKKWUh1IeoJQCFhsgIIIgIohYEWwq1ooVK9ZasdbG1hhrjUmMsYlZsJEJzYIpmLwZs/8xZ9JpaGYHOYfPyvrChrdbpAxbjFRltCqhnQ2yxBTKf0WQUgNrwYqIFStGUkkllqIU5E/2aQBbEV8pz/ZM3Or8/95UmeUB+J63RiHoAWi1ZHTvNl6pNfXe99Taeq/W1HvuYOzvKG5c4q1afIWHj4eHBwgWwWCQ1aWvBvC8VXngE5DbmO3UxrOeqEhmTFEcPiIiadwEfVttWxmd623tyu7Mfnrjru5cM0Th+Nyp2Z/MztvJNDLkSImZJ27MhNWIr8j1tn+g9at7+/ubivaSHYkmjPF1f+sj7Uc3Xc29VPjm1JSJEzJkCZkjaVT8hvzubDvQ8cz9AwPeG/rHFD3BZkoeTqLwCuqzrQf7nw9+UJhOidEEFAhX0sCJr1fyXm/uPLr5849n/u1/j3mMWtqtYEFm5v/2pXUHdhzNjgaxzunQQzNX3wDdWIT0dT3bP3Qo8wIXSVWNDpWQys2xmW/3fbn1WpAWXUrWNaARvN+/7lu7jzysf8q4siuEh5A8fX5/+8XepLyEs8zfCd7raP/K9scf1T9iQjUUzU+JynOR3TQBgpAS1a16dVtusONTH8kc42ZjcFFKEApcJyBHjizt+O8Wr3e2P7Uv+3curyT7InhJ8nFCMmTJkqWlVlnzVsj0psc69vbrV1SyKnjJgCsEZMiQoanWINcfe39v6xfv808Suu6f5EVlQA7QAcC/1DXp42GmuazOiaJbjjDFSTUNCLOEZMiQEJAjrZYB9b0PmoPe7fpNZQAkYFb1A9CphtWwGlbNkmX/R59TpzhPAAwdf37XKWac1JZJAnc1VSfp0ufSqtK3NT/Y3DJVKZ5tYbHiwfvJAjc5dO7Pw4cZOb4vc51ccvZjh7ZfubaTC8y4evgeAjQaTYCpgZfq06TXpD++Rd6hHHTdZ8JKDs8yAsAD92/gjxSfGNvYzp7Wt3nj6sS2D5NxtXAeHNwnIFpOqSe+bg+2d6ejFXzXS8WlJUSyhBiKoAqj1yFuYQLQZCvFOMLDx8evPFuOF7HV0sqzXmsuP1mJ5tbfVirYc++VITnItvyN8rhJjqIrL7qS50KCX1mWeLXFr5Z02nqiJ2+lXOasIQHJkD75C6DjtQ8dH6Eg99FHyD+LBRclaomnqgL3lo++w4utWsBVbNYtr1htYZFBZgm2299Z5rmXl4+ZtwaPjDlt9CJ0gIeqXNXFN7WKDtMLnW1y+9e6Txc5z2le25Te0BTVic89ovf3yIXE1QeP4FbJbmCla21V723evjklncued/0mZA6AcEABfH/6rXzb2IM5fJD1zLvIB02zm3ak+iK0hK8mvmBnzA/Hoy3LJoyW4XIITn5daAbaX0w3XBnIIsCBL7zDpFNvPWoRvBY+larBZ5Gb6eX20xXxf/2QDMkgmc+sl8MyJH2cf/Seka3yGFv+kR7Ok/1riwxhvruJUYffhGCxWKS0IqqReFXFN5g583qaNokC0aSf/JUaVn95ufNrJ9SwGlapMkkUXuPMAy/E24CJbQVeVWeIXDAFbEYwWCymes3XAMZW9d5gC8k3Rn++79hJjErvvcBB0P53/sBBAOa5knmdnWwlywlQZ7mHfQivOsd6yVDEkGIwxDVrfo2yY4nJ5tMTLe9rkYKSkUtcEqXk9/DKok9d5nLlfpzxyn0Tu7Gk7jLVNx8eQFw98oUi6Vz07NiZ3c/4y+bz+i1gHxliEhJnQFKn6MbVu01ISRaSX2b8vk/4q4D77GErCTGxM2EBW1P8pLr4YJkjiKORhZ91hR1qpsG9m89O9pASOXxMXF6wrCb0ACIidBJe8ZNdjHID24DsA/RhCImInAnztQqr897UeI1lDp3ToU8TO2jiat39q0cLD7GJlNBdERFhLd8dPjamtldx98K8dhNGD91cZ6zKPl6hyNJPP5rYIcsGFGprVva+Nl4GF455lVzI0UcvU0ySX7R5aKabHnrwMRSJlhiQr7fT1QCprYPnmKHgzjQtliwZNrIZHyHBkHHLSMG4KI+JK6Lna+9wFuETUzecLAUHN6QkBARofHwCFImr6Mbld+Lw0Upwhy/acKWUMswS07YI77tllHJTqsW4t4lLtcLKBwyl0JN05YQSiqS0knW+a7eGu4W3rrgmJMwRNpCkLvRsaBoqKAkzZGgi66S/HV+Sf4GQxvor4xPbYDkVIuLS2RZ6CV4wRMQkNNpXGb9go1V8BSElJXRrWIXCupM9We2hvMPPG1bbaqxf3sWhamTzhjVpHsCc/a9dQ3xo82uJL9jRNRLfTTnnBO+u/pTkLT5c8fPNd9nt5tLmRbsVynbsXR704Bbeq775v0uht3btfyZT7OA5knjdAAAAAElFTkSuQmCC"};ol.filter.Lego.prototype.set=function(t,e){ol.filter.Base.prototype.set.call(this,t,e);"brickSize"==t&&this.pattern.canvas.width!=e&&this.setBrick(e)};ol.filter.Lego.prototype.setBrick=function(t,e,o){if(t=Number(t)||30,"string"==typeof e){var i=new Image;i.src=this.img[e]||this.img.ol3;i.crossOrigin=o||null;e=i}if(e&&(this.pattern.img=e),this.pattern.img.width)this.pattern.canvas.width=this.pattern.canvas.height=t,this.pattern.ctx=this.pattern.canvas.getContext("2d"),this.pattern.ctx.fillStyle=this.pattern.ctx.createPattern(this.pattern.img,"repeat"),this.set("brickSize",t),this.set("img",e.src);else{var r=this;this.pattern.img.onload=function(){r.setBrick(t,e)}}};ol.filter.Lego.prototype.getPattern=function(t,e){if(!this.pattern.ctx)return"transparent";var o=this.pattern.canvas,i=this.pattern.ctx,r=o.width/this.pattern.img.width;return i.save(),i.clearRect(0,0,o.width,o.height),i.scale(r,r),t/=r,e/=r,i.translate(t,e),i.beginPath(),i.clearRect(-2*o.width,-2*o.height,4*o.width,4*o.height),i.rect(-t,-e,2*o.width/r,2*o.height/r),i.fill(),i.restore(),i.createPattern(o,"repeat")};ol.filter.Lego.prototype.postcompose=function(t){var e=t.context,o=e.canvas,i=t.frameState.pixelRatio;"postrender"===t.type&&(i=1);e.save();var r=this.pattern.canvas.width*i,n=t.frameState.extent,s=t.frameState.viewState.resolution/i,a=[-Math.round(n[0]/s%r),Math.round(n[1]/s%r)],l=this.internal_.getContext("2d"),c=this.internal_.width=o.width,h=this.internal_.height=o.height;l.webkitImageSmoothingEnabled=l.mozImageSmoothingEnabled=l.msImageSmoothingEnabled=l.imageSmoothingEnabled=!1;var p=Math.floor((c-a[0])/r),u=Math.floor((h-a[1])/r);l.drawImage(o,a[0],a[1],p*r,u*r,0,0,p,u);e.webkitImageSmoothingEnabled=e.mozImageSmoothingEnabled=e.msImageSmoothingEnabled=e.imageSmoothingEnabled=!1;e.clearRect(0,0,c,h);e.drawImage(this.internal_,0,0,p,u,a[0],a[1],p*r,u*r);e.scale(i,i);e.fillStyle=this.getPattern(a[0]/i,a[1]/i);e.rect(0,0,c,h);e.fill();e.restore()};ol.filter.Texture=function(t){ol.filter.Base.call(this,t);this.setFilter(t)};ol.ext.inherits(ol.filter.Texture,ol.filter.Base);ol.filter.Texture.prototype.setFilter=function(t){var e;(t=t||{}).img?e=t.img:(e=new Image,t.src&&(ol.filter.Texture.Image&&ol.filter.Texture.Image[t.src]?e.src=ol.filter.Texture.Image[t.src]:e.src||(e.src=t.src)),e.crossOrigin=t.crossOrigin||null);this.set("rotateWithView",!1!==t.rotateWithView);this.set("opacity","number"==typeof t.opacity?t.opacity:1);this.set("ready",!1);var o=this;function i(e){o.pattern={};o.pattern.scale=t.scale||1;o.pattern.canvas=document.createElement("canvas");o.pattern.canvas.width=e.width*o.pattern.scale;o.pattern.canvas.height=e.height*o.pattern.scale;o.pattern.canvas.width=e.width;o.pattern.canvas.height=e.height;o.pattern.ctx=o.pattern.canvas.getContext("2d");o.pattern.ctx.fillStyle=o.pattern.ctx.createPattern(e,"repeat");o.set("ready",!0)}e.width?i(e):e.onload=function(){i(e)}};ol.filter.Texture.prototype.getPattern=function(t,e){var o=this.pattern.canvas,i=this.pattern.ctx;return i.save(),i.translate(-t,e),i.beginPath(),i.rect(t,-e,o.width,o.height),i.fill(),i.restore(),i.createPattern(o,"repeat")};ol.filter.Texture.prototype.postcompose=function(t){if(this.pattern){var e=t.context,o=e.canvas,i=1.5*Math.max(o.width,o.height),r=t.frameState.pixelToCoordinateTransform;r||((r=t.frameState.pixelToCoordinateMatrix)[2]=r[4],r[3]=r[5],r[4]=r[12],r[5]=r[13]);var n=t.frameState.pixelRatio,s=t.frameState.viewState.resolution,a=o.width/2,l=o.height/2;if(e.save(),e.globalCompositeOperation="multiply",e.globalAlpha=this.get("opacity"),e.scale(n*this.pattern.scale,n*this.pattern.scale),this.get("rotateWithView"))s*=this.pattern.scale,e.fillStyle=this.getPattern((a*r[0]+l*r[1]+r[4])/s,(a*r[2]+l*r[3]+r[5])/s),e.translate(a/this.pattern.scale,l/this.pattern.scale),e.rotate(t.frameState.viewState.rotation),e.beginPath(),e.rect(-a-i,-l-i,2*i,2*i),e.fill();else{var c=-(a*r[0]+l*r[1]+r[4])/s,h=(a*r[2]+l*r[3]+r[5])/s,p=Math.cos(t.frameState.viewState.rotation),u=Math.sin(t.frameState.viewState.rotation),g=(c*p-h*u)/this.pattern.scale,d=(c*u+h*p)/this.pattern.scale;e.translate(g,d);e.beginPath();e.fillStyle=this.pattern.ctx.fillStyle;e.rect(-g-i,-d-i,2*i,2*i);e.fill()}e.restore()}};ol.format.GeoRSS=function(t){t=t||{};ol.Object.call(this,t)};ol.ext.inherits(ol.format.GeoRSS,ol.Object);ol.format.GeoRSS.prototype.readFeature=function(t,e){e=e||{};for(var o,i=t.children,r=new ol.Feature,n=0;o=i[n];n++)r.set(o.tagName,o.innerHTML);var s,a,l=[];if(r.get("geo:long"))a=new ol.geom.Point([r.get("geo:long"),r.get("geo:lat")]),r.unset("geo:long"),r.unset("geo:lat");else if(r.get("georss:point"))l=r.get("georss:point").trim().split(" "),a=new ol.geom.Point([parseFloat(l[1]),parseFloat(l[0])]),r.unset("georss:point");else{if(!r.get("georss:polygon"))return r.get("georss:where")?(console.warn("[GeoRSS] GML format not implemented"),r.unset("georss:where"),null):(console.warn("[GeoRSS] unknown geometry"),null);s=r.get("georss:polygon").trim().split(" ");for(var c=0;c<s.length;c+=2)l.push([parseFloat(s[c+1]),parseFloat(s[c])]);a=new ol.geom.Polygon([l]);console.log(s,l);r.unset("georss:polygon")}return(e.featureProjection||this.get("featureProjection"))&&a.transform(e.dataProjection||this.get("dataProjection")||"EPSG:4326",e.featureProjection||this.get("featureProjection")),r.setGeometry(a),r};ol.format.GeoRSS.prototype.readFeatures=function(t,e){var o;if("string"==typeof t)o=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("item");else if(t instanceof Document)o=t.getElementsByTagName("item");else{if(!(t instanceof Node))return[];o=t}for(var i,r=[],n=0;i=o[n];n++){var s=this.readFeature(i,e);s&&r.push(s)}return r};ol.interaction.CenterTouch=function(t){t=t||{};this._listener={};var e=/^pointermove$|^pointerup$/;this.targetStyle=t.targetStyle||[new ol.style.Style({image:new ol.style.RegularShape({points:4,radius:11,radius1:0,radius2:0,snapToPixel:!0,stroke:new ol.style.Stroke({color:"#fff",width:3})})}),new ol.style.Style({image:new ol.style.RegularShape({points:4,radius:11,radius1:0,radius2:0,snapToPixel:!0,stroke:new ol.style.Stroke({color:"#000",width:1})})})];this.targetStyle instanceof Array||(this.targetStyle=[this.targetStyle]);this.composite=t.composite||"";this.ctouch=new ol.interaction.Interaction({handleEvent:function(t){return e.test(t.type)&&this.getMap()&&(t.coordinate=this.getMap().getView().getCenter(),t.pixel=this.getMap().getSize(),t.pixel=[t.pixel[0]/2,t.pixel[1]/2]),!0}});this._target=new ol.control.Target;ol.interaction.Interaction.call(this,{handleEvent:function(o){return e.test(o.type)&&(this.pos_=o.coordinate),!t.handleEvent||t.handleEvent.call(this,o)}})};ol.ext.inherits(ol.interaction.CenterTouch,ol.interaction.Interaction);ol.interaction.CenterTouch.prototype.setMap=function(t){this.getMap()&&(this.getMap().removeInteraction(this.ctouch),this.getMap().removeInteraction(this._target));ol.interaction.Interaction.prototype.setMap.call(this,t);this.getMap()&&this.getActive()&&(this.getMap().addInteraction(this.ctouch),this.getMap().addControl(this._target))};ol.interaction.CenterTouch.prototype.setActive=function(t){ol.interaction.Interaction.prototype.setActive.call(this,t);this.pos_=null;this.getMap()&&(this.getActive()?(this.getMap().addInteraction(this.ctouch),this.getMap().addControl(this._target)):(this.getMap().removeInteraction(this.ctouch),this.getMap().removeControl(this._target)))};ol.interaction.CenterTouch.prototype.getPosition=function(){if(!this.pos_){var t=this.getMap().getSize();t=[t[0]/2,t[1]/2];this.pos_=this.getMap().getCoordinateFromPixel(t)}return this.pos_};ol.interaction.Clip=function(t){this.layers_=[];ol.interaction.Pointer.call(this,{handleDownEvent:this.setPosition,handleMoveEvent:this.setPosition});this.precomposeBind_=this.precompose_.bind(this);this.postcomposeBind_=this.postcompose_.bind(this);t=t||{};this.pos=!1;this.radius=t.radius||100;t.layers&&this.addLayer(t.layers)};ol.ext.inherits(ol.interaction.Clip,ol.interaction.Pointer);ol.interaction.Clip.prototype.setMap=function(t){var e;if(this.getMap()){for(e=0;e<this.layers_.length;e++)this.layers_[e].un(["precompose","prerender"],this.precomposeBind_),this.layers_[e].un(["postcompose","postrender"],this.postcomposeBind_);this.getMap().renderSync()}if(ol.interaction.Pointer.prototype.setMap.call(this,t),t){for(e=0;e<this.layers_.length;e++)this.layers_[e].on(["precompose","prerender"],this.precomposeBind_),this.layers_[e].on(["postcompose","postrender"],this.postcomposeBind_);t.renderSync()}};ol.interaction.Clip.prototype.setRadius=function(t){this.radius=t;this.getMap()&&this.getMap().renderSync()};ol.interaction.Clip.prototype.addLayer=function(t){t instanceof Array||(t=[t]);for(var e=0;e<t.length;e++)this.getMap()&&(t[e].on(["precompose","prerender"],this.precomposeBind_),t[e].on(["postcompose","postrender"],this.postcomposeBind_),this.getMap().renderSync()),this.layers_.push(t[e])};ol.interaction.Clip.prototype.removeLayer=function(t){t instanceof Array||(t=[t]);for(var e=0;e<t.length;e++){for(var o=0;o<this.layers_.length&&this.layers_[o]!==t[e];o++);o!=this.layers_.length&&this.getMap()&&(this.layers_[o].un(["precompose","prerender"],this.precomposeBind_),this.layers_[o].un(["postcompose","postrender"],this.postcomposeBind_),this.layers_.splice(o,1),this.getMap().renderSync())}};ol.interaction.Clip.prototype.setPosition=function(t){t.pixel?this.pos=t.pixel:t&&t instanceof Array?this.pos=t:t=[-1e7,-1e7];this.getMap()&&this.getMap().renderSync()};ol.interaction.Clip.prototype.precompose_=function(t){var e=t.context,o=t.frameState.pixelRatio;e.save();e.beginPath();var i=[this.pos[0],this.pos[1]],r=this.radius,n=t.inversePixelTransform;n?i=[i[0]*n[0]-i[1]*n[1]+n[4],-i[0]*n[2]+i[1]*n[3]+n[5]]:(i[0]*=o,i[1]*=o,r*=o);e.arc(i[0],i[1],r,0,2*Math.PI);e.clip()};ol.interaction.Clip.prototype.postcompose_=function(t){t.context.restore()};ol.interaction.Clip.prototype.setActive=function(t){if(t!==this.getActive()){var e;if(ol.interaction.Pointer.prototype.setActive.call(this,t),t)for(e=0;e<this.layers_.length;e++)this.layers_[e].on(["precompose","prerender"],this.precomposeBind_),this.layers_[e].on(["postcompose","postrender"],this.postcomposeBind_);else for(e=0;e<this.layers_.length;e++)this.layers_[e].un(["precompose","prerender"],this.precomposeBind_),this.layers_[e].un(["postcompose","postrender"],this.postcomposeBind_);this.getMap()&&this.getMap().renderSync()}};ol.interaction.CopyPaste=function(t){t=t||{};this.features=[];this._cloneFeature=!0;var e=t.condition;"function"!=typeof e&&(e=function(t){if(t.originalEvent.ctrlKey){if(/^c$/i.test(t.originalEvent.key))return"copy";if(/^x$/i.test(t.originalEvent.key))return"cut";if(/^v$/i.test(t.originalEvent.key))return"paste"}return!1});this._featuresSource=t.features||new ol.Collection;this.setSources(t.sources);this.setDestination(t.destination);ol.interaction.Interaction.call(this,{handleEvent:function(t){if("keydown"===t.type&&!/INPUT|TEXTAREA|SELECT/.test(document.activeElement.tagName))switch(e(t)){case"copy":this.copy({silent:!1});break;case"cut":this.copy({cut:!0,silent:!1});break;case"paste":this.paste({silent:!1})}return!0}.bind(this)})};ol.ext.inherits(ol.interaction.CopyPaste,ol.interaction.Interaction);ol.interaction.CopyPaste.prototype.setSources=function(t){t?(this._source=[],this._source=t instanceof Array?t:[t]):this._source=null};ol.interaction.CopyPaste.prototype.getSources=function(){return this._source};ol.interaction.CopyPaste.prototype.setDestination=function(t){this._destination=t};ol.interaction.CopyPaste.prototype.getDestination=function(){return this._destination};ol.interaction.CopyPaste.prototype.getFeatures=function(){return this.features};ol.interaction.CopyPaste.prototype.copy=function(t){var e=(t=t||{}).features||this._featuresSource.getArray();if(t.cut){var o=this._source||[this._destination];e.forEach(function(t){o.forEach(function(e){try{e.removeFeature(t)}catch(t){}})})}this._cloneFeature?(this.features=[],e.forEach(function(t){this.features.push(t.clone())}.bind(this))):this.features=e;!1===t.silent&&this.dispatchEvent({type:t.cut?"cut":"copy",time:(new Date).getTime()})};ol.interaction.CopyPaste.prototype.paste=function(t){var e=(t=t||{}).features||this.features;if(e){var o=t.destination||this._destination;o&&(o.addFeatures(this.features),this._cloneFeature&&this.copy({features:this.features}))}!1===t.silent&&this.dispatchEvent({type:"paste",features:e,time:(new Date).getTime()})};ol.interaction.Delete=function(t){ol.interaction.Select.call(this,t);this.on("select",function(t){this.getFeatures().clear();this.delete(t.selected)}.bind(this))};ol.ext.inherits(ol.interaction.Delete,ol.interaction.Select);ol.interaction.Delete.prototype._getSources=function(t){if(!this.getMap())return[];t||(t=this.getMap().getLayers());var e=[];return t.forEach(function(t){t.getLayers?e=e.concat(this._getSources(t.getLayers())):t.getSource&&t.getSource()instanceof ol.source.Vector&&e.push(t.getSource())}.bind(this)),e};ol.interaction.Delete.prototype.delete=function(t){if(t&&(t.length||t.getLength())){this.dispatchEvent({type:"deletestart",features:t});var e=[];this._getSources().forEach(function(o){try{t.forEach(function(t){o.removeFeature(t);e.push(t)})}catch(t){}});this.dispatchEvent({type:"deleteend",features:e})}};ol.interaction.DragOverlay=function(t){t||(t={});ol.interaction.Pointer.call(this,{handleDownEvent:function(t){return/^(BUTTON|A)$/.test(t.originalEvent.target.tagName)?(this._dragging=!1,!0):!!this._dragging&&(this._dragging.setPosition(t.coordinate),this.dispatchEvent({type:"dragstart",overlay:this._dragging,coordinate:t.coordinate}),!0)},handleDragEvent:function(t){this._dragging&&(this._dragging.setPosition(t.coordinate),this.dispatchEvent({type:"dragging",overlay:this._dragging,coordinate:t.coordinate}))},handleUpEvent:function(t){return this._dragging&&this.dispatchEvent({type:"dragend",overlay:this._dragging,coordinate:t.coordinate}),this._dragging=!1}});this._overlays=[];t.overlays instanceof Array||(t.overlays=[t.overlays]);t.overlays.forEach(this.addOverlay.bind(this))};ol.ext.inherits(ol.interaction.DragOverlay,ol.interaction.Pointer);ol.interaction.DragOverlay.prototype.addOverlay=function(t){for(var e,o=0;e=this._overlays[o];o++)if(e===t)return;if(t.element.parentElement&&t.element.parentElement.classList.contains("ol-overlaycontainer-stopevent"))console.warn("[DragOverlay.addOverlay] overlay must be created with stopEvent set to false!");else{var i=function(){this.getMap()===t.getMap()&&(this._dragging=t)}.bind(this);this._overlays.push({overlay:t,listener:i});t.element.addEventListener("pointerdown",i)}};ol.interaction.DragOverlay.prototype.removeOverlay=function(t){for(var e,o=0;e=this._overlays[o];o++)if(e.overlay===t){var i=this._overlays.splice(o,1)[0];t.element.removeEventListener("pointerdown",i.listener);break}};ol.interaction.DrawHole=function(t){t||(t={});var e=this;this._select=new ol.interaction.Select({style:t.style});this._select.setActive(!1);var o,i=t.geometryFunction;o=i?function(t,o){return o=e._geometryFn(t,o),i(t,o)}:function(t,o){return e._geometryFn(t,o)};t.type="Polygon";t.geometryFunction=o;ol.interaction.Draw.call(this,t);t.layers&&("function"==typeof t.layers?this.layers_=t.layers:t.layers.indexOf&&(this.layers_=function(e){return t.layers.indexOf(e)>=0}));this.on("drawstart",this._startDrawing.bind(this));this.on("drawend",this._finishDrawing.bind(this))};ol.ext.inherits(ol.interaction.DrawHole,ol.interaction.Draw);ol.interaction.DrawHole.prototype.setMap=function(t){this.getMap()&&this.getMap().removeInteraction(this._select);t&&t.addInteraction(this._select);ol.interaction.Draw.prototype.setMap.call(this,t)};ol.interaction.DrawHole.prototype.setActive=function(t){this._select.getFeatures().clear();ol.interaction.Draw.prototype.setActive.call(this,t)};ol.interaction.DrawHole.prototype.removeLastPoint=function(){this._feature&&this._feature.getGeometry().getCoordinates()[0].length>2&&ol.interaction.Draw.prototype.removeLastPoint.call(this)};ol.interaction.DrawHole.prototype.getPolygon=function(){return this._polygon};ol.interaction.DrawHole.prototype._startDrawing=function(t){var e=this.getMap(),o=this.layers_;this._feature=t.feature;var i=t.feature.getGeometry().getCoordinates()[0][0],r=e.getFeaturesAtPixel(e.getPixelFromCoordinate(i),{layerFilter:o});if(this._current=null,r)for(var n=0;n<r.length;n++){var s=r[n].getGeometry();if("Polygon"===s.getType()&&s.intersectsCoordinate(i))this._polygonIndex=!1,this._polygon=s,this._current=r[n];else if("MultiPolygon"===s.getType()&&s.intersectsCoordinate(i))for(var a,l=0;a=s.getPolygon(l);l++)if(a.intersectsCoordinate(i)){this._polygonIndex=l;this._polygon=a;this._current=r[n];break}if(this._current)break}this._select.getFeatures().clear();this._current?this._select.getFeatures().push(this._current):(this.setActive(!1),this.setActive(!0))};ol.interaction.DrawHole.prototype._finishDrawing=function(t){t.hole=t.feature;t.feature=this._select.getFeatures().item(0);this.dispatchEvent({type:"modifystart",features:[this._current]});var e=t.hole.getGeometry().getCoordinates()[0];if(e.length>3)if(!1!==this._polygonIndex){for(var o,i=t.feature.getGeometry(),r=new ol.geom.MultiPolygon([]),n=0;o=i.getPolygon(n);n++)n===this._polygonIndex?(o.appendLinearRing(new ol.geom.LinearRing(e)),r.appendPolygon(o)):r.appendPolygon(o);t.feature.setGeometry(r)}else this.getPolygon().appendLinearRing(new ol.geom.LinearRing(e));this.dispatchEvent({type:"modifyend",features:[this._current]});this._feature=null;this._select.getFeatures().clear()};ol.interaction.DrawHole.prototype._geometryFn=function(t,e){var o=t[0].pop();return this.getPolygon()&&!this.getPolygon().intersectsCoordinate(o)||(this.lastOKCoord=[o[0],o[1]]),t[0].push([this.lastOKCoord[0],this.lastOKCoord[1]]),e?e.setCoordinates([t[0].concat([t[0][0]])]):e=new ol.geom.Polygon(t),e};ol.interaction.DrawRegular=function(t){t||(t={});this.squaredClickTolerance_=t.clickTolerance?t.clickTolerance*t.clickTolerance:36;this.maxCircleCoordinates_=t.maxCircleCoordinates||100;this.features_=t.features;this.source_=t.source;this.squareFn_=t.squareCondition;this.centeredFn_=t.centerCondition;this.canRotate_=!1!==t.canRotate;this.geometryName_=t.geometryName;this.setSides(t.sides);var e=[255,255,255,1],o=[0,153,255,1],i=[new ol.style.Style({stroke:new ol.style.Stroke({color:e,width:5})}),new ol.style.Style({image:new ol.style.Circle({radius:6,fill:new ol.style.Fill({color:o}),stroke:new ol.style.Stroke({color:e,width:1.5})}),stroke:new ol.style.Stroke({color:o,width:3}),fill:new ol.style.Fill({color:[255,255,255,.5]})})];this.sketch_=new ol.Collection;this.overlayLayer_=new ol.layer.Vector({source:new ol.source.Vector({features:this.sketch_,useSpatialIndex:!1}),name:"DrawRegular overlay",displayInLayerSwitcher:!1,style:t.style||i});ol.interaction.Interaction.call(this,{handleEvent:this.handleEvent_})};ol.ext.inherits(ol.interaction.DrawRegular,ol.interaction.Interaction);ol.interaction.DrawRegular.prototype.setMap=function(t){this.getMap()&&this.getMap().removeLayer(this.overlayLayer_);ol.interaction.Interaction.prototype.setMap.call(this,t);this.overlayLayer_.setMap(t)};ol.interaction.DrawRegular.prototype.setActive=function(t){this.reset();ol.interaction.Interaction.prototype.setActive.call(this,t)};ol.interaction.DrawRegular.prototype.reset=function(){this.overlayLayer_.getSource().clear();this.started_=!1};ol.interaction.DrawRegular.prototype.setSides=function(t){t=parseInt(t);this.sides_=t>2?t:0};ol.interaction.DrawRegular.prototype.canRotate=function(t){return!0!==t&&!1!==t||(this.canRotate_=t),this.canRotate_};ol.interaction.DrawRegular.prototype.getSides=function(){return this.sides_};ol.interaction.DrawRegular.prototype.startAngle={"default":Math.PI/2,3:-Math.PI/2,4:Math.PI/4};ol.interaction.DrawRegular.prototype.getGeom_=function(){if(this.overlayLayer_.getSource().clear(),!this.center_)return!1;var t;if(this.coord_){var e,o,i,r,n,s=this.center_,a=this.coord_;if(!this.sides_&&this.square_&&!this.centered_)return s=[(a[0]+s[0])/2,(a[1]+s[1])/2],e=[a[0]-s[0],a[1]-s[1]],i=Math.sqrt(e[0]*e[0]+e[1]*e[1]),r=new ol.geom.Circle(s,i,"XY"),n=this.getMap().getPixelFromCoordinate(s),o=Math.max(100,Math.abs(n[0]-this.coordPx_[0]),Math.abs(n[1]-this.coordPx_[1])),o=Math.min(this.maxCircleCoordinates_,Math.round(o/3)),ol.geom.Polygon.fromCircle(r,o,0);var l=this.canRotate_&&this.centered_&&this.square_;if(e=[a[0]-s[0],a[1]-s[1]],this.square_&&!l){var c=Math.max(Math.abs(e[0]),Math.abs(e[1]));a=[s[0]+(e[0]>0?c:-c),s[1]+(e[1]>0?c:-c)]}if((i=Math.sqrt(e[0]*e[0]+e[1]*e[1]))>0){var h;if(r=new ol.geom.Circle(s,i,"XY"),h=l?Math.atan2(e[1],e[0]):this.startAngle[this.sides_]||this.startAngle.default,this.sides_?t=ol.geom.Polygon.fromCircle(r,this.sides_,h):(n=this.getMap().getPixelFromCoordinate(this.center_),o=Math.max(100,Math.abs(n[0]-this.coordPx_[0]),Math.abs(n[1]-this.coordPx_[1])),o=Math.min(this.maxCircleCoordinates_,Math.round(o/(this.centered_?3:5))),t=ol.geom.Polygon.fromCircle(r,o,0)),l)return t;var p=t.getExtent(),u=((s=this.centered_?[2*this.center_[0]-this.coord_[0],2*this.center_[1]-this.coord_[1]]:this.center_)[0]-a[0])/(p[0]-p[2]),g=(s[1]-a[1])/(p[1]-p[3]);if(this.square_){var d=Math.min(Math.abs(u),Math.abs(g));u=Math.sign(u)*d;g=Math.sign(g)*d}var m=[s[0]-p[0]*u,s[1]-p[1]*g];return t.applyTransform(function(t,e,o){for(var i=0;i<t.length;i+=o)e[i]=t[i]*u+m[0],e[i+1]=t[i+1]*g+m[1];return e}),t}}return new ol.geom.Point(this.center_)};ol.interaction.DrawRegular.prototype.drawSketch_=function(t){if(this.overlayLayer_.getSource().clear(),t){this.square_=this.squareFn_?this.squareFn_(t):t.originalEvent.shiftKey;this.centered_=this.centeredFn_?this.centeredFn_(t):t.originalEvent.metaKey||t.originalEvent.ctrlKey;var e=this.getGeom_();if(e){var o=this.feature_;return this.geometryName_&&o.setGeometryName(this.geometryName_),"Polygon"===e.getType()&&o.getGeometry().setCoordinates(e.getCoordinates()),this.overlayLayer_.getSource().addFeature(o),this.coord_&&this.square_&&(this.canRotate_&&this.centered_&&this.coord_||!this.sides_&&!this.centered_)&&this.overlayLayer_.getSource().addFeature(new ol.Feature(new ol.geom.LineString([this.center_,this.coord_]))),o}}};ol.interaction.DrawRegular.prototype.drawPoint_=function(t,e){e||this.overlayLayer_.getSource().clear();this.overlayLayer_.getSource().addFeature(new ol.Feature(new ol.geom.Point(t)))};ol.interaction.DrawRegular.prototype.handleEvent_=function(t){var e,o;switch(this._eventTime=new Date,t.type){case"pointerdown":this.downPx_=t.pixel;this.start_(t);this._longTouch=!1;setTimeout(function(){this._longTouch=new Date-this._eventTime>450;this._longTouch&&this.handleMoveEvent_(t)}.bind(this),500);break;case"pointerup":this.started_&&this.coord_&&(e=this.downPx_[0]-t.pixel[0])*e+(o=this.downPx_[1]-t.pixel[1])*o<=this.squaredClickTolerance_&&("pointermove"==this.lastEvent||"keydown"==this.lastEvent?this.end_(t):(e=this.upPx_[0]-t.pixel[0])*e+(o=this.upPx_[1]-t.pixel[1])*o<=this.squaredClickTolerance_?this.end_(t):(this.handleMoveEvent_(t),this.drawPoint_(t.coordinate,!0)));this.upPx_=t.pixel;break;case"pointerdrag":if(this.started_){var i=this.getMap().getPixelFromCoordinate(this.center_);(e=i[0]-t.pixel[0])*e+(o=i[1]-t.pixel[1])*o<=this.squaredClickTolerance_&&this.reset()}return!this._longTouch;case"pointermove":this.started_&&(e=this.downPx_[0]-t.pixel[0])*e+(o=this.downPx_[1]-t.pixel[1])*o>this.squaredClickTolerance_&&(this.handleMoveEvent_(t),this.lastEvent=t.type);break;default:if(this.lastEvent=t.type,this.started_&&"dblclick"===t.type)return!1}return!0};ol.interaction.DrawRegular.prototype.finishDrawing=function(){this.started_&&this.coord_&&this.end_({pixel:this.upPx_,coordinate:this.coord_})};ol.interaction.DrawRegular.prototype.handleMoveEvent_=function(t){if(this.started_){this.coord_=t.coordinate;this.coordPx_=t.pixel;var e=this.drawSketch_(t);this.dispatchEvent({type:"drawing",feature:e,pixel:t.pixel,startCoordinate:this.center_,coordinate:t.coordinate,square:this.square_,centered:this.centered_})}else this.drawPoint_(t.coordinate)};ol.interaction.DrawRegular.prototype.start_=function(t){if(this.started_)this.coord_=t.coordinate;else{this.started_=!0;this.center_=t.coordinate;this.coord_=null;var e=new ol.geom.Polygon([[t.coordinate,t.coordinate,t.coordinate]]),o=this.feature_=new ol.Feature(e);this.drawSketch_(t);this.dispatchEvent({type:"drawstart",feature:o,pixel:t.pixel,coordinate:t.coordinate})}};ol.interaction.DrawRegular.prototype.end_=function(t){if(this.coord_=t.coordinate,this.started_=!1,this.coord_&&this.center_[0]!=this.coord_[0]&&this.center_[1]!=this.coord_[1]){var e=this.feature_;this.geometryName_&&e.setGeometryName(this.geometryName_);e.setGeometry(this.getGeom_());this.source_?this.source_.addFeature(e):this.features_&&this.features_.push(e);this.dispatchEvent({type:"drawend",feature:e,pixel:t.pixel,coordinate:t.coordinate,square:this.square_,centered:this.centered_})}else this.dispatchEvent({type:"drawcancel",feature:null,pixel:t.pixel,coordinate:t.coordinate,square:this.square_,centered:this.centered_});this.center_=this.coord_=null;this.drawSketch_()};ol.interaction.DrawTouch=function(t){(t=t||{}).handleEvent=function(t){if(this.get("tap"))switch(t.type){case"singleclick":this.addPoint();break;case"dblclick":return this.addPoint(),this.finishDrawing(),!1}return!0};ol.interaction.CenterTouch.call(this,t);this.typeGeom_=t.type;this.source_=t.source;this.set("tap",!1!==t.tap);var e=[255,255,255,1],o=[0,153,255,1],i=[new ol.style.Style({stroke:new ol.style.Stroke({color:e,width:5})}),new ol.style.Style({image:new ol.style.Circle({radius:6,fill:new ol.style.Fill({color:o}),stroke:new ol.style.Stroke({color:e,width:1.5})}),stroke:new ol.style.Stroke({color:o,width:3}),fill:new ol.style.Fill({color:[255,255,255,.5]})})];this.overlay_=new ol.layer.Vector({source:new ol.source.Vector({useSpatialIndex:!1}),style:i});this.geom_=[]};ol.ext.inherits(ol.interaction.DrawTouch,ol.interaction.CenterTouch);ol.interaction.DrawTouch.prototype.setMap=function(t){this._listener.drawSketch&&ol.Observable.unByKey(this._listener.drawSketch);this._listener.drawSketch=null;ol.interaction.CenterTouch.prototype.setMap.call(this,t);this.overlay_.setMap(t);this.getMap()&&(this._listener.drawSketch=this.getMap().on("postcompose",this.drawSketchLink_.bind(this)))};ol.interaction.DrawTouch.prototype.getGeometryType=function(){return this.typeGeom_};ol.interaction.DrawTouch.prototype.finishDrawing=function(){if(this.getMap()){var t=!0;if(this._feature){switch(this.typeGeom_){case"LineString":this.geom_.length>1?this._feature.setGeometry(new ol.geom.LineString(this.geom_)):t=!1;break;case"Polygon":this.geom_[this.geom_.length-1]!=this.geom_[0]&&this.geom_.push(this.geom_[0]);this.geom_.length>3?this._feature.setGeometry(new ol.geom.Polygon([this.geom_])):t=!1}this._feature&&this.source_.addFeature(this._feature);this.dispatchEvent({type:"drawend",feature:this._feature,valid:t})}this.geom_=[];this.drawSketch_();this._feature=null}};ol.interaction.DrawTouch.prototype.addPoint=function(){if(this.getMap()){this.geom_.push(this.getPosition());var t=!1;switch(this._feature||(this._feature=new ol.Feature,t=!0),this.typeGeom_){case"Point":this._feature.setGeometry(new ol.geom.Point(this.geom_.pop()));break;case"LineString":case"Polygon":this.drawSketch_()}t&&this.dispatchEvent({type:"drawstart",feature:this._feature});"Point"===this.typeGeom_&&this.finishDrawing()}};ol.interaction.DrawTouch.prototype.removeLastPoint=function(){this.getMap()&&(this.geom_.pop(),this.drawSketch_())};ol.interaction.DrawTouch.prototype.drawSketch_=function(){if(this.overlay_&&(this.overlay_.getSource().clear(),this.geom_.length)){var t=new ol.geom.LineString(this.geom_);"Polygon"==this.typeGeom_?(this._feature.getGeometry()?this._feature.getGeometry().setCoordinates([this.geom_]):this._feature.setGeometry(new ol.geom.Polygon([this.geom_])),this.overlay_.getSource().addFeature(new ol.Feature(t))):this._feature.getGeometry()?this._feature.getGeometry().setCoordinates(this.geom_):this._feature.setGeometry(new ol.geom.LineString(this.geom_));this.overlay_.getSource().addFeature(this._feature);var e=new ol.Feature(new ol.geom.Point(this.geom_.slice(-1).pop()));this.overlay_.getSource().addFeature(e)}};ol.interaction.DrawTouch.prototype.drawSketchLink_=function(t){if(this.getActive()&&this.getPosition()){var e=t.context||ol.ext.getMapCanvas(this.getMap()).getContext("2d");e.save();var o,i=this.getMap().getPixelFromCoordinate(this.getPosition()),r=t.frameState.pixelRatio||1;e.scale(r,r);e.strokeStyle="rgba(0, 153, 255, 1)";e.lineWidth=1;e.beginPath();e.arc(i[0],i[1],5,0,2*Math.PI);e.stroke();this.geom_.length&&(o=this.getMap().getPixelFromCoordinate(this.geom_[this.geom_.length-1]),e.beginPath(),e.moveTo(o[0],o[1]),e.lineTo(i[0],i[1]),"Polygon"==this.typeGeom_&&(o=this.getMap().getPixelFromCoordinate(this.geom_[0]),e.lineTo(o[0],o[1])),e.stroke());e.restore()}};ol.interaction.DrawTouch.prototype.setActive=function(t){ol.interaction.CenterTouch.prototype.setActive.call(this,t);t||(this.geom_=[]);this.drawSketch_()};ol.interaction.DropFile=function(t){t=t||{};ol.interaction.DragAndDrop.call(this,{});var e=t.zone||document;e.addEventListener("dragenter",this.onstop);e.addEventListener("dragover",this.onstop);e.addEventListener("dragleave",this.onstop);this.formatConstructors_=t.formatConstructors||[ol.format.GPX,ol.format.GeoJSON,ol.format.IGC,ol.format.KML,ol.format.TopoJSON];this.projection_=t.projection;this.accept_=t.accept||["gpx","json","geojson","igc","kml","topojson"];var o=this;e.addEventListener("drop",function(t){return o.ondrop(t)})};ol.ext.inherits(ol.interaction.DropFile,ol.interaction.DragAndDrop);ol.interaction.DropFile.prototype.setMap=function(t){ol.interaction.Interaction.prototype.setMap.call(this,t)};ol.interaction.DropFile.prototype.onstop=function(t){return t.preventDefault(),t.stopPropagation(),!1};ol.interaction.DropFile.prototype.ondrop=function(t){if(t.preventDefault(),t.dataTransfer&&t.dataTransfer.files.length)for(var e,o=this,i=t.dataTransfer.files,n=0;e=i[n];n++){var s=e.name.match(/\.([0-9a-z]+)(?=[?#])|(\.)(?:[\w]+)$/)[0];o.dispatchEvent({type:"loadstart",file:e,filesize:e.size,filetype:e.type,fileextension:s,projection:l,target:o});var a=new FileReader,l=this.projection_||this.getMap().getView().getProjection(),c=this.formatConstructors_;if(!l)return;var h=function(t,e,o){try{return t.readFeatures(e,o)}catch(t){}},p=e;a.onload=function(t){for(var r=t.target.result,n=[],e=0,i=c.length;e<i;++e){var s=new c[e];if((n=h(s,r,{featureProjection:l}))&&n.length>0)return o.dispatchEvent({type:"addfeatures",features:n,file:p,projection:l,target:o}),void o.dispatchEvent({type:"loadend",features:n,file:p,projection:l,target:o})}o.dispatchEvent({type:"loadend",file:p,target:o})};a.readAsText(e)}return!1};ol.interaction.FillAttribute=function(t,e){if((t=t||{}).condition||(t.condition=ol.events.condition.click),ol.interaction.Select.call(this,t),this.setActive(!1!==t.active),this._attributes=e,this.on("select",function(t){this.getFeatures().clear();this.fill(t.selected,this._attributes)}.bind(this)),!1!==t.cursor){var o=document.createElement("CANVAS");o.width=o.height=32;var i=o.getContext("2d");i.beginPath();i.moveTo(9,3);i.lineTo(2,9);i.lineTo(10,17);i.lineTo(17,11);i.closePath();i.fillStyle="#fff";i.fill();i.stroke();i.beginPath();i.moveTo(6,4);i.lineTo(0,8);i.lineTo(0,13);i.lineTo(3,17);i.lineTo(3,8);i.closePath();i.fillStyle="#000";i.fill();i.stroke();i.moveTo(8,8);i.lineTo(10,0);i.lineTo(11,0);i.lineTo(13,3);i.lineTo(13,7);i.stroke();this._cursor="url("+o.toDataURL()+") 0 13, auto"}};ol.ext.inherits(ol.interaction.FillAttribute,ol.interaction.Select);ol.interaction.FillAttribute.prototype.setActive=function(t){t!==this.getActive()&&(ol.interaction.Select.prototype.setActive.call(this,t),this.getMap()&&this._cursor&&(t?(this._previousCursor=this.getMap().getTargetElement().style.cursor,this.getMap().getTargetElement().style.cursor=this._cursor):(this.getMap().getTargetElement().style.cursor=this._previousCursor,this._previousCursor=void 0)))};ol.interaction.FillAttribute.prototype.setAttributes=function(t){this._attributes=t};ol.interaction.FillAttribute.prototype.setAttribute=function(t,e){this._attributes[t]=e};ol.interaction.FillAttribute.prototype.getAttributes=function(){return this._attributes};ol.interaction.FillAttribute.prototype.getAttribute=function(t){return this._attributes[t]};ol.interaction.FillAttribute.prototype.fill=function(t,e){t.length&&e&&(this.dispatchEvent({type:"setattributestart",features:t,properties:e}),t.forEach(function(t){for(var o in e)t.set(o,e[o])}),this.dispatchEvent({type:"setattributeend",features:t,properties:e}))};ol.interaction.Flashlight=function(t){ol.interaction.Pointer.call(this,{handleDownEvent:this.setPosition,handleMoveEvent:this.setPosition});t=t||{};this.pos=!1;this.radius=t.radius||100;this.setColor(t)};ol.ext.inherits(ol.interaction.Flashlight,ol.interaction.Pointer);ol.interaction.Flashlight.prototype.setMap=function(t){this.getMap()&&this.getMap().render();this._listener&&ol.Observable.unByKey(this._listener);this._listener=null;ol.interaction.Pointer.prototype.setMap.call(this,t);t&&(this._listener=t.on("postcompose",this.postcompose_.bind(this)))};ol.interaction.Flashlight.prototype.setRadius=function(t){this.radius=t;this.getMap()&&this.getMap().renderSync()};ol.interaction.Flashlight.prototype.setColor=function(t){var e=t.fill?t.fill:[0,0,0,.8],o=ol.color.asArray(e);this.startColor=ol.color.asString(o);t.color?o=this.endColor=ol.color.asString(ol.color.asArray(t.color)||t.color):(o[3]=0,this.endColor=ol.color.asString(o));o[3]=.1;this.midColor=ol.color.asString(o);this.getMap()&&this.getMap().renderSync()};ol.interaction.Flashlight.prototype.setPosition=function(t){this.pos=t.pixel?t.pixel:t;this.getMap()&&this.getMap().renderSync()};ol.interaction.Flashlight.prototype.postcompose_=function(t){var e=ol.ext.getMapCanvas(this.getMap()).getContext("2d"),o=t.frameState.pixelRatio,i=e.canvas.width,r=e.canvas.height;if(e.save(),e.scale(o,o),this.pos){var n=Math.max(i,r),s=e.createRadialGradient(this.pos[0],this.pos[1],i*this.radius/n,this.pos[0],this.pos[1],r*this.radius/n);s.addColorStop(0,this.startColor);s.addColorStop(.8,this.midColor);s.addColorStop(1,this.endColor);e.fillStyle=s;e.fillRect(this.pos[0]-n,this.pos[1]-n,2*n,2*n)}else e.fillStyle=this.startColor,e.fillRect(0,0,i,r);e.restore()};ol.interaction.FocusMap=function(){ol.interaction.Interaction.call(this,{});this.focusBt=ol.ext.element.create("BUTTON",{on:{focus:function(){this.dispatchEvent({type:"focus"})}.bind(this)},style:{position:"absolute",zIndex:-1,top:0,opacity:0}})};ol.ext.inherits(ol.interaction.FocusMap,ol.interaction.Interaction);ol.interaction.FocusMap.prototype.setMap=function(t){this._listener&&ol.Observable.unByKey(this._listener);this._listener=null;this.getMap()&&this.getMap().getViewport().removeChild(this.focusBt);ol.interaction.Interaction.prototype.setMap.call(this,t);this.getMap()&&(this._listener=this.getMap().on("pointerdown",function(){this.getActive()&&this.focusBt.focus()}.bind(this)),this.getMap().getViewport().appendChild(this.focusBt))};ol.interaction.GeolocationDraw=function(t){t||(t={});this.geolocation=new ol.Geolocation({projection:"EPSG:4326",trackingOptions:{maximumAge:1e4,enableHighAccuracy:!0,timeout:6e5}});this.geolocation.on("change",this.draw_.bind(this));this.path_=[];this.lastPosition_=!1;var e=[255,255,255,1],o=[0,153,255,1],i=new ol.style.Circle({radius:6,fill:new ol.style.Fill({color:o}),stroke:new ol.style.Stroke({color:e,width:1.5})}),r=[new ol.style.Style({stroke:new ol.style.Stroke({color:e,width:5})}),new ol.style.Style({stroke:new ol.style.Stroke({color:o,width:3}),fill:new ol.style.Fill({color:[255,255,255,.5]})})],n=new ol.style.RegularShape({radius:10.5,points:3,rotation:0,fill:new ol.style.Fill({color:o}),stroke:new ol.style.Stroke({color:e,width:1.5})}),s=n.getImage(),a=s.getContext("2d"),l=document.createElement("canvas");l.width=l.height=s.width;l.getContext("2d").drawImage(s,0,0);a.clearRect(0,0,s.width,s.height);a.drawImage(l,0,0,s.width,s.height,3,0,s.width-6,s.height);this.locStyle={error:new ol.style.Style({fill:new ol.style.Fill({color:[255,0,0,.2]})}),warn:new ol.style.Style({fill:new ol.style.Fill({color:[255,192,0,.2]})}),ok:new ol.style.Style({fill:new ol.style.Fill({color:[0,255,0,.2]})})};this.overlayLayer_=new ol.layer.Vector({source:new ol.source.Vector,name:"GeolocationDraw overlay",style:t.style||function(t){return void 0===t.get("heading")?r[1].setImage(i):(r[1].setImage(n),n.setRotation(t.get("heading")||0)),r}});this.sketch_=[new ol.Feature,new ol.Feature,new ol.Feature];this.overlayLayer_.getSource().addFeatures(this.sketch_);this.features_=t.features;this.source_=t.source;this.condition_=t.condition||function(t){return t.getAccuracy()<this.get("minAccuracy")};ol.interaction.Interaction.call(this,{handleEvent:function(){return!this.get("followTrack")||"auto"==this.get("followTrack")}});this.set("type",t.type||"LineString");this.set("attributes",t.attributes||{});this.set("minAccuracy",t.minAccuracy||20);this.set("tolerance",t.tolerance||5);this.set("zoom",t.zoom);this.setFollowTrack(void 0===t.followTrack||t.followTrack);this.setActive(!1)};ol.ext.inherits(ol.interaction.GeolocationDraw,ol.interaction.Interaction);ol.interaction.GeolocationDraw.prototype.setMap=function(t){this.getMap()&&this.getMap().removeLayer(this.overlayLayer_);ol.interaction.Pointer.prototype.setMap.call(this,t);this.overlayLayer_.setMap(t);t&&this.geolocation.setProjection(t.getView().getProjection())};ol.interaction.GeolocationDraw.prototype.setActive=function(t){if(t!==this.getActive())if(ol.interaction.Interaction.prototype.setActive.call(this,t),this.overlayLayer_.setVisible(t),this.getMap()&&(this.geolocation.setTracking(t),this.getMap().renderSync()),this.pause(!t),t)this.reset(),this.dispatchEvent({type:"drawstart",feature:this.sketch_[1]});else{var e=this.sketch_[1].clone();e.getGeometry()&&(this.features_&&this.features_.push(e),this.source_&&this.source_.addFeature(e),this.dispatchEvent({type:"drawend",feature:e}))}};ol.interaction.GeolocationDraw.prototype.reset=function(){this.sketch_[1].setGeometry();this.path_=[];this.lastPosition_=!1};ol.interaction.GeolocationDraw.prototype.start=function(){this.setActive(!0)};ol.interaction.GeolocationDraw.prototype.stop=function(){this.setActive(!1)};ol.interaction.GeolocationDraw.prototype.pause=function(t){this.pause_=!1!==t};ol.interaction.GeolocationDraw.prototype.isPaused=function(){return this.pause_};ol.interaction.GeolocationDraw.prototype.setFollowTrack=function(t){this.set("followTrack",t);var e=this.getMap();if(!1!==t&&!this.lastPosition_&&e){var o=this.path_[this.path_.length-1];o&&e.getView().animate({center:o,zoom:"position"!=t?this.get("zoom"):void 0})}this.lastPosition_=!1;this.dispatchEvent({type:"follow",following:!1!==t})};ol.interaction.GeolocationDraw.prototype.draw_=function(){var t=this.getMap();if(t){var e=this.geolocation,o=e.getAccuracy(),i=e.getPosition();i.push(Math.round(100*(e.getAltitude()||0))/100);i.push(Math.round((new Date).getTime()/1e3));var r=e.getAccuracyGeometry();switch(this.get("followTrack")){case!0:1==this.get("followTrack")&&(t.getView().setZoom(this.get("zoom")||16),ol.extent.containsExtent(t.getView().calculateExtent(t.getSize()),r.getExtent())||t.getView().fit(r.getExtent()));t.getView().setCenter(i);break;case"position":t.getView().setCenter(i);break;case"auto":if(this.lastPosition_){var n=t.getView().getCenter();n[0]!=this.lastPosition_[0]||n[1]!=this.lastPosition_[1]?this.setFollowTrack(!1):(t.getView().setCenter(i),this.lastPosition_=i)}else t.getView().setCenter(i),this.get("zoom")&&t.getView().setZoom(this.get("zoom")),this.lastPosition_=i;break;case"visible":ol.extent.containsCoordinate(t.getView().calculateExtent(t.getSize()),i)||t.getView().setCenter(i)}var s,a=this.sketch_[0];if(a.setGeometry(r),o<this.get("minAccuracy")/2?a.setStyle(this.locStyle.ok):o<this.get("minAccuracy")?a.setStyle(this.locStyle.warn):a.setStyle(this.locStyle.error),!this.pause_&&this.condition_.call(this,e)){switch(a=this.sketch_[1],this.path_.push(i),this.get("type")){case"Point":this.path_=[i];a.setGeometry(new ol.geom.Point(i,"XYZM"));var l=this.get("attributes");l.heading&&a.set("heading",e.getHeading());l.accuracy&&a.set("accuracy",e.getAccuracy());l.altitudeAccuracy&&a.set("altitudeAccuracy",e.getAltitudeAccuracy());l.speed&&a.set("speed",e.getSpeed());break;case"LineString":this.path_.length>1?((s=new ol.geom.LineString(this.path_,"XYZM")).simplify(this.get("tolerance")),a.setGeometry(s)):a.setGeometry();break;case"Polygon":this.path_.length>2?((s=new ol.geom.Polygon([this.path_],"XYZM")).simplify(this.get("tolerance")),a.setGeometry(s)):a.setGeometry()}this.dispatchEvent({type:"drawing",feature:this.sketch_[1],geolocation:e})}this.sketch_[2].setGeometry(new ol.geom.Point(i));this.sketch_[2].set("heading",e.getHeading());this.dispatchEvent({type:"tracking",feature:this.sketch_[1],geolocation:e})}};ol.interaction.Hover=function(t){t||(t={});var e=this;ol.interaction.Interaction.call(this,{handleEvent:function(o){return"pointermove"==o.type&&e.handleMove_(o),!t.handleEvent||t.handleEvent(o)}});t.layers&&t.layers.length?this.setFeatureFilter(function(e,o){return t.layers.indexOf(o)>=0}):this.setFeatureFilter(t.featureFilter);this.setLayerFilter(t.layerFilter);this.set("hitTolerance",t.hitTolerance);this.setCursor(t.cursor)};ol.ext.inherits(ol.interaction.Hover,ol.interaction.Interaction);ol.interaction.Hover.prototype.setMap=function(t){void 0!==this.previousCursor_&&this.getMap()&&(this.getMap().getTargetElement().style.cursor=this.previousCursor_,this.previousCursor_=void 0);ol.interaction.Interaction.prototype.setMap.call(this,t)};ol.interaction.Hover.prototype.setCursor=function(t){!t&&void 0!==this.previousCursor_&&this.getMap()&&(this.getMap().getTargetElement().style.cursor=this.previousCursor_,this.previousCursor_=void 0);this.cursor_=t};ol.interaction.Hover.prototype.setFeatureFilter=function(t){this.featureFilter_="function"==typeof t?t:function(){return!0}};ol.interaction.Hover.prototype.setLayerFilter=function(t){this.layerFilter_="function"==typeof t?t:function(){return!0}};ol.interaction.Hover.prototype.handleMove_=function(t){var e=this.getMap();if(e){var o,i,r=this,n=e.forEachFeatureAtPixel(t.pixel,function(t,e){return r.layerFilter_.call(null,e)&&r.featureFilter_.call(null,t,e)?(o=t,i=e,!0):(o=i=null,!1)},{hitTolerance:this.get("hitTolerance")});if(n&&this.dispatchEvent({type:"hover",feature:o,layer:i,coordinate:t.coordinate,pixel:t.pixel,map:t.map,dragging:t.dragging}),this.feature_===o&&this.layer_===i||(this.feature_=o,this.layer_=i,o?this.dispatchEvent({type:"enter",feature:o,layer:i,coordinate:t.coordinate,pixel:t.pixel,map:t.map,dragging:t.dragging}):this.dispatchEvent({type:"leave",coordinate:t.coordinate,pixel:t.pixel,map:t.map,dragging:t.dragging})),this.cursor_){var s=e.getTargetElement().style;n?s.cursor!=this.cursor_&&(this.previousCursor_=s.cursor,s.cursor=this.cursor_):void 0!==this.previousCursor_&&(s.cursor=this.previousCursor_,this.previousCursor_=void 0)}}};ol.interaction.LongTouch=function(t){t||(t={});this.delay_=t.delay||1e3;var e=t.handleLongTouchEvent||function(){},o=null;ol.interaction.Interaction.call(this,{handleEvent:function(t){if(this.getActive())switch(t.type){case"pointerdown":o&&clearTimeout(o);o=setTimeout(function(){t.type="longtouch";e(t)},this.delay_);break;case"pointerdrag":case"pointerup":o&&(clearTimeout(o),o=null)}else o&&(clearTimeout(o),o=null);return!0}})};ol.ext.inherits(ol.interaction.LongTouch,ol.interaction.Interaction);ol.interaction.Modify.prototype.getModifiedFeatures=function(){var t={};this.dragSegments_.forEach(function(e){var o=e[0].feature;window.ol&&window.ol.util?t[ol.util.getUid(o)]=o:t[ol.getUid(o)]=o});var e=[];for(var o in t)e.push(t[o]);return e};ol.interaction.ModifyFeature=function(t){var e,o;t||(t={});ol.interaction.Pointer.call(this,{handleEvent:function(t){switch(t.type){case"pointerdown":return e=this.handleDownEvent(t),o=e||this._deleteCondition(t),!e;case"pointerup":return e=!1,this.handleUpEvent(t);case"pointerdrag":return!e||this.handleDragEvent(t);case"pointermove":return!!e||this.handleMoveEvent(t);case"singleclick":case"click":return!o;default:return!0}}});this.snapDistance_=t.pixelTolerance||10;this.tolerance_=1e-10;this.cursor_=t.cursor;this.sources_=t.sources?t.sources instanceof Array?t.sources:[t.sources]:[];t.features&&this.sources_.push(new ol.source.Vector({features:t.features}));this.filterSplit_=t.filter||function(){return!0};this._condition=t.condition||ol.events.condition.primaryAction;this._deleteCondition=t.deleteCondition||ol.events.condition.altKeyOnly;this._insertVertexCondition=t.insertVertexCondition||ol.events.condition.always;var i=function(){return[new ol.style.Style({image:new ol.style.Circle({radius:6,fill:new ol.style.Fill({color:[0,153,255,1]}),stroke:new ol.style.Stroke({color:"#FFF",width:1.25})})})]};t.style&&(i="function"==typeof t.style?t.style:function(){return t.style});this.overlayLayer_=new ol.layer.Vector({source:new ol.source.Vector({useSpatialIndex:!1}),name:"Modify overlay",displayInLayerSwitcher:!1,style:i})};ol.ext.inherits(ol.interaction.ModifyFeature,ol.interaction.Pointer);ol.interaction.ModifyFeature.prototype.setMap=function(t){this.getMap()&&this.getMap().removeLayer(this.overlayLayer_);ol.interaction.Interaction.prototype.setMap.call(this,t);this.overlayLayer_.setMap(t)};ol.interaction.ModifyFeature.prototype.setActive=function(t){ol.interaction.Interaction.prototype.setActive.call(this,t);this.overlayLayer_&&this.overlayLayer_.getSource().clear()};ol.interaction.ModifyFeature.prototype.getClosestFeature=function(t){for(var e,o,i=this.snapDistance_+1,r=0;r<this.sources_.length;r++){var n=this.sources_[r];if((e=n.getClosestFeatureToCoordinate(t.coordinate))&&this.filterSplit_(e)){var s=e.getGeometry().getClosestPoint(t.coordinate),a=ol.coordinate.dist2d(t.coordinate,s)/t.frameState.viewState.resolution;a<i&&(i=a,o=s);break}}if(i>this.snapDistance_)return!1;var l=this.getNearestCoord(o,e.getGeometry());if(l){l=l.coord;var c=this.getMap().getPixelFromCoordinate(l);return ol.coordinate.dist2d(t.pixel,c)<this.snapDistance_&&(o=l),{source:n,feature:e,coord:o}}};ol.interaction.ModifyFeature.prototype.getNearestCoord=function(t,e){var o,i,r,n,s;switch(e.getType()){case"Point":return{coord:e.getCoordinates(),dist:ol.coordinate.dist2d(e.getCoordinates(),t)};case"MultiPoint":return this.getNearestCoord(t,new ol.geom.LineString(e.getCoordinates()));case"LineString":case"LinearRing":var a;s=Number.MAX_VALUE;var l=e.getCoordinates();for(o=0;o<l.length;o++)(a=ol.coordinate.dist2d(t,l[o]))<s&&(s=a,n=l[o]);return{coord:n,dist:s};case"MultiLineString":var c=e.getLineStrings();for(n=!1,s=Number.MAX_VALUE,o=0;i=c[o];o++)(r=this.getNearestCoord(t,i))&&r.dist<s&&(n=r,s=r.dist,n.ring=o);return n;case"Polygon":var h=e.getLinearRings();for(n=!1,s=Number.MAX_VALUE,o=0;i=h[o];o++)(r=this.getNearestCoord(t,i))&&r.dist<s&&(n=r,s=r.dist,n.ring=o);return n;case"MultiPolygon":var p=e.getPolygons();for(n=!1,s=Number.MAX_VALUE,o=0;i=p[o];o++)(r=this.getNearestCoord(t,i))&&r.dist<s&&(n=r,s=r.dist,n.poly=o);return n;case"GeometryCollection":var u=e.getGeometries();for(n=!1,s=Number.MAX_VALUE,o=0;i=u[o];o++)(r=this.getNearestCoord(t,i))&&r.dist<s&&(n=r,s=r.dist,n.geom=o);return n;default:return!1}};ol.interaction.ModifyFeature.prototype.getArcs=function(t,e){var o,i,r,n,s=!1;switch(t.getType()){case"Point":ol.coordinate.equal(e,t.getCoordinates())&&(s={geom:t,type:t.getType(),coord1:[],coord2:[],node:!0});break;case"MultiPoint":for(o=t.getCoordinates(),i=0;i<o.length;i++)if(ol.coordinate.equal(e,o[i])){s={geom:t,type:t.getType(),index:i,coord1:[],coord2:[],node:!0};break}break;case"LinearRing":case"LineString":var a=t.getClosestPoint(e);if(ol.coordinate.dist2d(a,e)<1.5*this.tolerance_){var l;if("LinearRing"===t.getType()){var c=new ol.geom.LineString(t.getCoordinates());l=c.splitAt(e,this.tolerance_)}else l=t.splitAt(e,this.tolerance_);if(l.length>2){for(o=l[1].getCoordinates(),i=2;r=l[i];i++){var h=r.getCoordinates();h.shift();o=o.concat(h)}l=[l[0],new ol.geom.LineString(o)]}if(2===l.length){var p=l[0].getCoordinates(),u=l[1].getCoordinates(),g=p.length+u.length-1;p.pop();u.shift();s={geom:t,type:t.getType(),coord1:p,coord2:u,node:t.getCoordinates().length===g,closed:!1}}else if(1===l.length){r=l[0].getCoordinates();var d=ol.coordinate.equal(r[0],e),m=ol.coordinate.equal(r[r.length-1],e);d?(r.shift(),m&&r.pop(),s={geom:t,type:t.getType(),coord1:[],coord2:r,node:!0,closed:m}):m&&(r.pop(),s={geom:t,type:t.getType(),coord1:r,coord2:[],node:!0,closed:!1})}}break;case"MultiLineString":var f=t.getLineStrings();for(i=0;n=f[i];i++)if(s=this.getArcs(n,e)){s.geom=t;s.type=t.getType();s.lstring=i;break}break;case"Polygon":var y=t.getLinearRings();for(i=0;n=y[i];i++)if(s=this.getArcs(n,e)){s.geom=t;s.type=t.getType();s.index=i;break}break;case"MultiPolygon":var v=t.getPolygons();for(i=0;n=v[i];i++)if(s=this.getArcs(n,e)){s.geom=t;s.type=t.getType();s.poly=i;break}break;case"GeometryCollection":for(i=0;n=c[i];i++)if(s=this.getArcs(n,e)){s.geom=t;s.g=i;s.typeg=s.type;s.type=t.getType();break}break;default:console.error("ol/interaction/ModifyFeature "+t.getType()+" not supported!")}return s};ol.interaction.ModifyFeature.prototype.handleDownEvent=function(t){if(!this.getActive())return!1;var e=this.getClosestFeature(t);if(e&&(this._condition(t)||this._deleteCondition(t))){var o=[];return this.arcs=[],this.sources_.forEach(function(t){var i=ol.extent.buffer(ol.extent.boundingExtent([e.coord]),this.tolerance_);o=o.concat(o,t.getFeaturesInExtent(i))}.bind(this)),this._modifiedFeatures=[],o.forEach(function(o){var i=this.getArcs(o.getGeometry(),e.coord);i&&(this._insertVertexCondition(t)||i.node)&&(i.feature=o,this._modifiedFeatures.push(o),this.arcs.push(i))}.bind(this)),!this._modifiedFeatures.length||(this._deleteCondition(t)?!this._removePoint(e,t):(this.dispatchEvent({type:"modifystart",coordinate:e.coord,originalEvent:t.originalEvent,features:this._modifiedFeatures}),this.handleDragEvent({coordinate:e.coord}),!0))}return!1};ol.interaction.ModifyFeature.prototype.getModifiedFeatures=function(){return this._modifiedFeatures||[]};ol.interaction.ModifyFeature.prototype.removePoint=function(){this._removePoint({},{})};ol.interaction.ModifyFeature.prototype._getModification=function(t){var e=t.coord1.concat(t.coord2);switch(t.type){case"LineString":if(t.closed&&e.push(e[0]),e.length>1&&t.geom.getCoordinates().length!=e.length)return t.coords=e,!0;break;case"MultiLineString":if(t.closed&&e.push(e[0]),e.length>1){var o=t.geom.getCoordinates();if(o[t.lstring].length!=e.length)return o[t.lstring]=e,t.coords=o,!0}break;case"Polygon":if(t.closed&&e.push(e[0]),e.length>3&&(o=t.geom.getCoordinates())[t.index].length!=e.length)return o[t.index]=e,t.coords=o,!0;break;case"MultiPolygon":if(t.closed&&e.push(e[0]),e.length>3&&(o=t.geom.getCoordinates())[t.poly][t.index].length!=e.length)return o[t.poly][t.index]=e,t.coords=o,!0;break;case"GeometryCollection":t.type=t.typeg;var i=t.geom,r=i.getGeometries();t.geom=r[t.g];var n=this._getModification(t);return i.setGeometries(r),t.geom=i,t.type="GeometryCollection",n}return!1};ol.interaction.ModifyFeature.prototype._removePoint=function(t,e){if(!this.arcs)return!1;this.overlayLayer_.getSource().clear();var o=!1;return this.arcs.forEach(function(t){o=o||this._getModification(t)}.bind(this)),o&&(this.dispatchEvent({type:"modifystart",coordinate:t.coord,originalEvent:e.originalEvent,features:this._modifiedFeatures}),this.arcs.forEach(function(t){if("GeometryCollection"===t.geom.getType()){if(t.coords){var e=t.geom.getGeometries();e[t.g].setCoordinates(t.coords);t.geom.setGeometries(e)}}else t.coords&&t.geom.setCoordinates(t.coords)}.bind(this)),this.dispatchEvent({type:"modifyend",coordinate:t.coord,originalEvent:e.originalEvent,features:this._modifiedFeatures})),this.arcs=[],o};ol.interaction.ModifyFeature.prototype.handleUpEvent=function(t){return!!this.getActive()&&(!this.arcs||!this.arcs.length||(this.overlayLayer_.getSource().clear(),this.dispatchEvent({type:"modifyend",coordinate:t.coordinate,originalEvent:t.originalEvent,features:this._modifiedFeatures}),this.arcs=[],!0))};ol.interaction.ModifyFeature.prototype.setArcCoordinates=function(t,e){var o;switch(t.type){case"Point":t.geom.setCoordinates(e[0]);break;case"MultiPoint":(o=t.geom.getCoordinates())[t.index]=e[0];t.geom.setCoordinates(o);break;case"LineString":t.geom.setCoordinates(e);break;case"MultiLineString":(o=t.geom.getCoordinates())[t.lstring]=e;t.geom.setCoordinates(o);break;case"Polygon":(o=t.geom.getCoordinates())[t.index]=e;t.geom.setCoordinates(o);break;case"MultiPolygon":(o=t.geom.getCoordinates())[t.poly][t.index]=e;t.geom.setCoordinates(o);break;case"GeometryCollection":t.type=t.typeg;var i=t.geom,r=i.getGeometries();t.geom=r[t.g];this.setArcCoordinates(t,e);i.setGeometries(r);t.geom=i;t.type="GeometryCollection"}};ol.interaction.ModifyFeature.prototype.handleDragEvent=function(t){if(!this.getActive())return!1;if(!this.arcs)return!0;this.overlayLayer_.getSource().clear();var e=new ol.Feature(new ol.geom.Point(t.coordinate));return this.overlayLayer_.getSource().addFeature(e),!this.arcs.length||(this.arcs.forEach(function(e){var o=e.coord1.concat([t.coordinate],e.coord2);e.closed&&o.push(t.coordinate);this.setArcCoordinates(e,o)}.bind(this)),this.dispatchEvent({type:"modifying",coordinate:t.coordinate,originalEvent:t.originalEvent,features:this._modifiedFeatures}),!0)};ol.interaction.ModifyFeature.prototype.handleMoveEvent=function(t){if(!this.getActive())return!1;this.overlayLayer_.getSource().clear();var e=this.getClosestFeature(t);if(e){var o=new ol.Feature(new ol.geom.Point(e.coord));this.overlayLayer_.getSource().addFeature(o)}var i=t.map.getTargetElement();this.cursor_&&(e?i.style.cursor!=this.cursor_&&(this.previousCursor_=i.style.cursor,i.style.cursor=this.cursor_):void 0!==this.previousCursor_&&(i.style.cursor=this.previousCursor_,this.previousCursor_=void 0))};ol.interaction.ModifyTouch=function(t){var e=this;t||(t={});this._popup=new ol.Overlay.Popup({popupClass:t.className||"modifytouch",positioning:"bottom-rigth",offsetBox:10});this._source=t.source;this._features=t.features;var o=document.createElement("a");o.appendChild(document.createTextNode(t.title||"remove point"));o.onclick=function(){e.removePoint()};this.setPopupContent(o);var i=(t.pixelTolerance||0)+5;t.condition=function(t){var e,o,r=this.getMap().getFeaturesAtPixel(t.pixel,{hitTolerance:i}),n=!1;if(r){var s=this._features;if(!s){e=[t.pixel[0]-i,t.pixel[1]-i];o=[t.pixel[0]+i,t.pixel[1]+i];e=this.getMap().getCoordinateFromPixel(e);o=this.getMap().getCoordinateFromPixel(o);var a=ol.extent.boundingExtent([e,o]);s=this._source.getFeaturesInExtent(a)}s.getArray&&(s=s.getArray());for(var l,c=0;(l=r[c])&&!(s.indexOf(l)>=0);c++);if(l){e=t.pixel;o=l.getGeometry().getClosestPoint(t.coordinate);o=this.getMap().getPixelFromCoordinate(o);var h=e[0]-o[0],p=e[1]-o[1];n=Math.sqrt(h*h+p*p)<i}}return this.showDeleteBt(n?{type:"show",feature:l,coordinate:t.coordinate}:{type:"hide"}),t.preventDefault(),t.stopPropagation(),!0};t.insertVertexCondition=function(){return this.showDeleteBt({type:"hide"}),!0};ol.interaction.Modify.call(this,t);this.on(["modifystart","modifyend"],function(){this.showDeleteBt({type:"hide",modifying:!0})});this.set("usePopup",!1!==t.usePopup)};ol.ext.inherits(ol.interaction.ModifyTouch,ol.interaction.Modify);ol.interaction.ModifyTouch.prototype.setMap=function(t){this.getMap()&&this.getMap().removeOverlay(this._popup);ol.interaction.Modify.prototype.setMap.call(this,t);this.getMap()&&this.getMap().addOverlay(this._popup)};ol.interaction.ModifyTouch.prototype.setActive=function(t){ol.interaction.Modify.prototype.setActive.call(this,t);this.showDeleteBt({type:"hide"})};ol.interaction.ModifyTouch.prototype.removePoint=function(){new Date-this._timeout<200||(ol.interaction.Modify.prototype.removePoint.call(this),this.showDeleteBt({type:"hide"}))};ol.interaction.ModifyTouch.prototype.showDeleteBt=function(t){this.get("usePopup")&&"show"===t.type?this._popup.show(t.coordinate,this._menu):this._popup.hide();t.type+="popup";this.dispatchEvent(t);this._timeout=new Date};ol.interaction.ModifyTouch.prototype.setPopupContent=function(t){this._menu=t};ol.interaction.ModifyTouch.prototype.getPopupContent=function(){return this._menu};ol.interaction.Offset=function(t){t||(t={});ol.interaction.Pointer.call(this,{handleDownEvent:this.handleDownEvent_,handleDragEvent:this.handleDragEvent_,handleMoveEvent:this.handleMoveEvent_,handleUpEvent:this.handleUpEvent_});this.features_=t.features;this.layers_=t.layers?t.layers instanceof Array?t.layers:[t.layers]:null;this.set("duplicate",t.duplicate);this.source_=t.source;this.previousCursor_=!1};ol.ext.inherits(ol.interaction.Offset,ol.interaction.Pointer);ol.interaction.Offset.prototype.setMap=function(t){ol.interaction.Pointer.prototype.setMap.call(this,t)};ol.interaction.Offset.prototype.getFeatureAtPixel_=function(t){var e=this;return this.getMap().forEachFeatureAtPixel(t.pixel,function(o,i){var r;if(e.layers_){for(var n=0;n<e.layers_.length;n++)if(e.layers_[n]===i){r=o;break}}else e.features_?e.features_.forEach(function(t){t===o&&(r=o)}):r=o;var s=r.getGeometry().getType();if(r&&/Polygon|LineString/.test(s)){if("Polygon"===s&&r.getGeometry().getCoordinates().length>1)return!1;var a=r.getGeometry().getClosestPoint(t.coordinate),l=a[0]-t.coordinate[0],c=a[1]-t.coordinate[1];return Math.sqrt(l*l+c*c)/t.frameState.viewState.resolution<5&&{feature:r,hit:a,coordinates:r.getGeometry().getCoordinates(),geom:r.getGeometry().clone(),geomType:s}}return!1},{hitTolerance:5})};ol.interaction.Offset.prototype.handleDownEvent_=function(t){return this.current_=this.getFeatureAtPixel_(t),this.source_&&(this.get("duplicate")||t.originalEvent.ctrlKey)?(this.current_.feature=this.current_.feature.clone(),this.source_.addFeature(this.current_.feature)):this.current_&&this.dispatchEvent({type:"modifystart",features:[this.current_.feature]}),!!this.current_&&(this.dispatchEvent({type:"offsetstart",feature:this.current_.feature,offset:0}),!0)};ol.interaction.Offset.prototype.handleDragEvent_=function(t){var e,o,i,r,n=this.current_.geom.getClosestPoint(t.coordinate),s=ol.coordinate.dist2d(n,t.coordinate);switch(this.current_.geomType){case"Polygon":if(e=ol.coordinate.findSegment(n,this.current_.coordinates[0]).segment){o=[e[1][0]-e[0][0],e[1][1]-e[0][1]];i=[t.coordinate[0]-n[0],t.coordinate[1]-n[1]];o[0]*i[1]-o[1]*i[0]>0&&(s=-s);r=[];for(var a=0;a<this.current_.coordinates.length;a++)r.push(ol.coordinate.offsetCoords(this.current_.coordinates[a],0==a?s:-s));this.current_.feature.setGeometry(new ol.geom.Polygon(r))}break;case"LineString":(e=ol.coordinate.findSegment(n,this.current_.coordinates).segment)&&(o=[e[1][0]-e[0][0],e[1][1]-e[0][1]],i=[t.coordinate[0]-n[0],t.coordinate[1]-n[1]],o[0]*i[1]-o[1]*i[0]>0&&(s=-s),r=ol.coordinate.offsetCoords(this.current_.coordinates,s),this.current_.feature.setGeometry(new ol.geom.LineString(r)))}this.dispatchEvent({type:"offsetting",feature:this.current_.feature,offset:s,segment:[n,t.coordinate],coordinate:t.coordinate})};ol.interaction.Offset.prototype.handleUpEvent_=function(t){this.dispatchEvent({type:"offsetend",feature:this.current_.feature,coordinate:t.coordinate});this.current_=!1};ol.interaction.Offset.prototype.handleMoveEvent_=function(t){this.getFeatureAtPixel_(t)?(!1===this.previousCursor_&&(this.previousCursor_=t.map.getTargetElement().style.cursor),t.map.getTargetElement().style.cursor="pointer"):(t.map.getTargetElement().style.cursor=this.previousCursor_,this.previousCursor_=!1)};ol.interaction.Ripple=function(t){ol.interaction.Pointer.call(this,{handleDownEvent:this.rainDrop,handleMoveEvent:this.rainDrop});t=t||{};this.riprad=t.radius||3;this.ripplemap=[];this.last_map=[];this.rains(this.interval);t.layer.on(["postcompose","postrender"],this.postcompose_.bind(this))};ol.ext.inherits(ol.interaction.Ripple,ol.interaction.Pointer);ol.interaction.Ripple.prototype.rains=function(t){this.onrain&&clearTimeout(this.onrain);var e=this,o=("number"==typeof t?t:1e3)/2,i=3*o/2,r=Math.random;i&&function t(){e.width&&e.rainDrop([r()*e.width,r()*e.height]);e.onrain=setTimeout(t,r()*o+i)}()};ol.interaction.Ripple.prototype.rainDrop=function(t){if(this.width){var e,o;t.pixel?(e=t.pixel[0]*this.ratio,o=t.pixel[1]*this.ratio):(e=t[0]*this.ratio,o=t[1]*this.ratio);e<<=0;for(var i=(o<<=0)-this.riprad*this.ratio;i<o+this.riprad*this.ratio;i++)for(var r=e-this.riprad*this.ratio;r<e+this.riprad*this.ratio;r++)this.ripplemap[this.oldind+i*this.width+r]+=128}};ol.interaction.Ripple.prototype.postcompose_=function(t){var e,o,i,r,n,s=t.context,a=s.canvas;if(this.width!=a.width||this.height!=a.height){this.width=a.width;this.height=a.height;this.ratio=t.frameState.pixelRatio;this.half_width=this.width>>1;this.half_height=this.height>>1;this.size=this.width*(this.height+2)*2;this.oldind=this.width;this.newind=this.width*(this.height+3);for(var l=0;l<this.size;l++)this.last_map[l]=this.ripplemap[l]=0}this.texture=s.getImageData(0,0,this.width,this.height);this.ripple=s.getImageData(0,0,this.width,this.height);var c=this.oldind;this.oldind=this.newind;this.newind=c;l=0;for(var h=this.ripple.data,p=this.texture.data,u=0;u<this.height;u++)for(var g=0;g<this.width;g++){var d=this.newind+l,m=this.oldind+l;i=this.ripplemap[m-this.width]+this.ripplemap[m+this.width]+this.ripplemap[m-1]+this.ripplemap[m+1]>>1;i-=this.ripplemap[d];i-=i>>5;this.ripplemap[d]=i;i=1024-i;this.last_map[l]!=i&&(this.last_map[l]=i,e=((g-this.half_width)*i/1024<<0)+this.half_width,o=((u-this.half_height)*i/1024<<0)+this.half_height,e>=this.width&&(e=this.width-1),e<0&&(e=0),o>=this.height&&(o=this.height-1),o<0&&(o=0),n=4*(e+o*this.width),h[r=4*l]=p[n],h[r+1]=p[n+1],h[r+2]=p[n+2]);++l}s.putImageData(this.ripple,0,0);this.getMap().render()};ol.interaction.SelectCluster=function(t){var e;t=t||{};this.pointRadius=t.pointRadius||12;this.circleMaxObjects=t.circleMaxObjects||10;this.maxObjects=t.maxObjects||60;this.spiral=!1!==t.spiral;this.animate=t.animate;this.animationDuration=t.animationDuration||500;this.selectCluster_=!1!==t.selectCluster;var o=this.overlayLayer_=new ol.layer.Vector({source:new ol.source.Vector({features:new ol.Collection,wrapX:t.wrapX,useSpatialIndex:!0}),name:"Cluster overlay",updateWhileAnimating:!0,updateWhileInteracting:!0,displayInLayerSwitcher:!1,style:t.featureStyle});t.layers&&("function"==typeof t.layers?(e=t.layers,t.layers=function(t){return t===o||e(t)}):t.layers.push&&t.layers.push(this.overlayLayer_));t.filter?(e=t.filter,t.filter=function(t,o){return!(!o&&t.get("selectclusterlink"))&&e(t,o)}):t.filter=function(t,e){return!(!e&&t.get("selectclusterlink"))};this.filter_=t.filter;ol.interaction.Select.call(this,t);this.on("select",this.selectCluster.bind(this))};ol.ext.inherits(ol.interaction.SelectCluster,ol.interaction.Select);ol.interaction.SelectCluster.prototype.setMap=function(t){this.getMap()&&this.getMap().removeLayer(this.overlayLayer_);this._listener&&ol.Observable.unByKey(this._listener);this._listener=null;ol.interaction.Select.prototype.setMap.call(this,t);this.overlayLayer_.setMap(t);t&&t.getView()&&(this._listener=t.getView().on("change:resolution",this.clear.bind(this)))};ol.interaction.SelectCluster.prototype.clear=function(){this.getFeatures().clear();this.overlayLayer_.getSource().clear()};ol.interaction.SelectCluster.prototype.getLayer=function(){return this.overlayLayer_};ol.interaction.SelectCluster.prototype.selectCluster=function(t){if(t instanceof ol.Feature&&(t={selected:[t]}),t.selected.length){var e=t.selected[0];if(!e.get("selectclusterfeature")){var o=this.overlayLayer_.getSource();o.clear();var i=e.get("features");if(i&&1!=i.length){this.selectCluster_||this.getFeatures().clear();var r,n,s,a,l,c,h=e.getGeometry().getCoordinates(),p=this.getMap().getView().getResolution(),u=p*this.pointRadius*(.5+i.length/4),g=[];if(!this.spiral||i.length<=this.circleMaxObjects)for(s=Math.min(i.length,this.circleMaxObjects),n=0;n<s;n++)r=2*Math.PI*n/s,2!=s&&4!=s||(r+=Math.PI/4),a=[h[0]+u*Math.sin(r),h[1]+u*Math.cos(r)],(l=new ol.Feature({selectclusterfeature:!0,features:[i[n]],geometry:new ol.geom.Point(a)})).setStyle(i[n].getStyle()),g.push(l),c=new ol.Feature({selectclusterlink:!0,geometry:new ol.geom.LineString([h,a])}),g.push(c);else{r=0;var d=2*this.pointRadius;for(s=Math.min(this.maxObjects,i.length),n=0;n<s;n++){r+=(d+.1)/(u=d/2+d*r/(2*Math.PI));var m=p*u*Math.sin(r),f=p*u*Math.cos(r);a=[h[0]+m,h[1]+f];(l=new ol.Feature({selectclusterfeature:!0,features:[i[n]],geometry:new ol.geom.Point(a)})).setStyle(i[n].getStyle());g.push(l);c=new ol.Feature({selectclusterlink:!0,geometry:new ol.geom.LineString([h,a])});g.push(c)}}o.clear();this.animate?this.animateCluster_(h,g):o.addFeatures(g)}}}else this.clear()};ol.interaction.SelectCluster.prototype.animateCluster_=function(t,e){if(this.listenerKey_&&ol.Observable.unByKey(this.listenerKey_),e.length){var o=this.overlayLayer_.getStyle(),i="function"==typeof o?o:o.length?function(){return o}:function(){return[o]},r=this.animationDuration||500,n=(new Date).getTime();this.listenerKey_=this.overlayLayer_.on(["postcompose","postrender"],function(o){for(var s,a=o.vectorContext||ol.render.getVectorContext(o),l=o.frameState.pixelRatio,c=this.getMap().getView().getResolution(),h=ol.easing.easeOut((o.frameState.time-n)/r),p=0;s=e[p];p++)if(s.get("features")){var u=s.getGeometry().getCoordinates();u[0]=t[0]+h*(u[0]-t[0]);u[1]=t[1]+h*(u[1]-t[1]);for(var g=new ol.geom.Point(u),d=i(s,c),m=0;m<d.length;m++){var f,y=!ol.Map.prototype.getFeaturesAtPixel&&d[m].getImage();y&&(f=y.getScale(),y.setScale(l));a.setStyle?(a.setStyle(d[m]),a.drawGeometry(g)):(a.setImageStyle(y),a.drawPointGeometry(g));y&&y.setScale(f)}}if(h>1)return ol.Observable.unByKey(this.listenerKey_),this.overlayLayer_.getSource().addFeatures(e),void this.overlayLayer_.changed();o.frameState.animate=!0}.bind(this));var s=new ol.Feature(new ol.geom.Point(this.getMap().getView().getCenter()));s.setStyle(new ol.style.Style({image:new ol.style.Circle({})}));this.overlayLayer_.getSource().addFeature(s)}};ol.interaction.SnapGuides=function(t){function e(t,e){var o=t[1][0]-t[0][0],i=t[1][1]-t[0][1],r=e[1][0]-e[0][0],n=e[1][1]-e[0][1],s=o*n-i*r;if(0!=s){var a=(o*t[0][1]-o*e[0][1]-i*t[0][0]+i*e[0][0])/s;return[e[0][0]+a*r,e[0][1]+a*n]}return!1}function o(t,e){var o=t[0]-e[0],i=t[1]-e[1];return Math.sqrt(o*o+i*i)}t||(t={});this.snapDistance_=t.pixelTolerance||10;this.enableInitialGuides_=t.enableInitialGuides||!1;var i=[new ol.style.Style({stroke:new ol.style.Stroke({color:"#ffcc33",lineDash:[8,5],width:1.25})})];t.style&&(i=t.style instanceof Array?t.style:[t.style]);this.overlaySource_=new ol.source.Vector({features:new ol.Collection,useSpatialIndex:!1});var r=t.vectorClass||ol.layer.Vector;this.overlayLayer_=new r({renderMode:"image",source:this.overlaySource_,style:function(){return i},name:"Snap overlay",displayInLayerSwitcher:!1});ol.interaction.Interaction.call(this,{handleEvent:function(t){if(this.getActive()){for(var i,r=this.overlaySource_.getFeatures(),n=null,s=null,a=t.frameState.viewState.resolution,l=0;i=r[l];l++){var c=i.getGeometry().getClosestPoint(t.coordinate);if(o(c,t.coordinate)/a<this.snapDistance_){if(n){var h=e(n.getGeometry().getCoordinates(),i.getGeometry().getCoordinates());h&&o(h,t.coordinate)/a<this.snapDistance_&&(s=h)}else s=c;n=i}}s&&(t.coordinate=s)}return!0}})};ol.ext.inherits(ol.interaction.SnapGuides,ol.interaction.Interaction);ol.interaction.SnapGuides.prototype.setMap=function(t){this.getMap()&&this.getMap().removeLayer(this.overlayLayer_);ol.interaction.Interaction.prototype.setMap.call(this,t);this.overlayLayer_.setMap(t);t&&(this.projExtent_=t.getView().getProjection().getExtent())};ol.interaction.SnapGuides.prototype.setActive=function(t){this.overlayLayer_.setVisible(t);ol.interaction.Interaction.prototype.setActive.call(this,t)};ol.interaction.SnapGuides.prototype.clearGuides=function(t){if(t)for(var e,o=0;e=t[o];o++)try{this.overlaySource_.removeFeature(e)}catch(t){}else this.overlaySource_.clear()};ol.interaction.SnapGuides.prototype.getGuides=function(){return this.overlaySource_.getFeaturesCollection()};ol.interaction.SnapGuides.prototype.addGuide=function(t,e){if(t){var o=this.getMap(),i=o.getView().calculateExtent(o.getSize()),r=Math.max(this.projExtent_[2]-this.projExtent_[0],this.projExtent_[3]-this.projExtent_[1]);(i=ol.extent.buffer(i,1.5*r))[0]<this.projExtent_[0]&&(i[0]=this.projExtent_[0]);i[1]<this.projExtent_[1]&&(i[1]=this.projExtent_[1]);i[2]>this.projExtent_[2]&&(i[2]=this.projExtent_[2]);i[3]>this.projExtent_[3]&&(i[3]=this.projExtent_[3]);var n=t[0][0]-t[1][0],s=t[0][1]-t[1][1],a=1/Math.sqrt(n*n+s*s),l=function(o){for(var l,c=[],h=r*o*2,p=0;(o>0?p<h:p>h)&&(l=e?[t[0][0]+s*a*p,t[0][1]-n*a*p]:[t[0][0]+n*a*p,t[0][1]+s*a*p],ol.extent.containsCoordinate(i,l));p+=r*o/100)c.push(l);return new ol.Feature(new ol.geom.LineString([c[0],c[c.length-1]]))},c=l(1),h=l(-1);return this.overlaySource_.addFeature(c),this.overlaySource_.addFeature(h),[c,h]}};ol.interaction.SnapGuides.prototype.addOrthoGuide=function(t){return this.addGuide(t,!0)};ol.interaction.SnapGuides.prototype.setDrawInteraction=function(t){var e=this,o=0,i=[];function r(t){var r=t.target.getCoordinates();switch(t.target.getType()){case"Point":return;case"Polygon":r=r[0].slice(0,-1)}var n=r.length;if(2===n&&e.enableInitialGuides_){var s=r[0][0],a=r[0][1];r=[[s,a],[s,a-1]]}if(n!=o&&(e.enableInitialGuides_?n>=2:n>2)){e.clearGuides(i);try{var l=r[n-2],c=r[n-3];n>2&&(l[0]!==c[0]||l[1]!==c[1])&&(i=e.addOrthoGuide([r[n-2],r[n-3]]));i=(i=i.concat(e.addGuide([r[0],r[1]]))).concat(e.addOrthoGuide([r[0],r[1]]));o=n}catch(t){}}}t.on("drawstart",function(t){t.feature.getGeometry().on("change",r)});t.on(["drawend","change:active"],function(t){e.clearGuides(i);t.feature&&t.feature.getGeometry().un("change",r);o=0;i=[]})};ol.interaction.SnapGuides.prototype.setModifyInteraction=function(t){function e(t,e){return(t%e+e)%e}var o=this,i=[];function r(t){var r=t.target.vertexFeature_;if(r){var n=t.target.getModifiedFeatures()[0].getGeometry(),s=n.getCoordinates();switch(n.getType()){case"Point":return;case"Polygon":s=s[0].slice(0,-1)}var a=r.getGeometry().getCoordinates(),l=s.findIndex(function(t){return t[0]===a[0]&&t[1]===a[1]}),c=s.length;o.clearGuides(i);i=(i=(i=(i=o.addOrthoGuide([s[e(l-1,c)],s[e(l-2,c)]])).concat(o.addGuide([s[e(l-1,c)],s[e(l-2,c)]]))).concat(o.addGuide([s[e(l+1,c)],s[e(l+2,c)]]))).concat(o.addOrthoGuide([s[e(l+1,c)],s[e(l+2,c)]]))}}t.on("modifystart",function(t){setTimeout(r,0,t)});t.on("modifyend",function(){o.clearGuides(i);i=[]})};ol.interaction.Split=function(t){t||(t={});ol.interaction.Interaction.call(this,{handleEvent:function(t){switch(t.type){case"singleclick":return this.handleDownEvent(t);case"pointermove":return this.handleMoveEvent(t);default:return!0}}});this.snapDistance_=t.snapDistance||25;this.tolerance_=t.tolerance||1e-10;this.cursor_=t.cursor;this.sources_=t.sources?t.sources instanceof Array?t.sources:[t.sources]:[];t.features&&this.sources_.push(new ol.source.Vector({features:t.features}));this.filterSplit_=t.filter||function(){return!0};var e=[255,255,255,1],o=[0,153,255,1],i=new ol.style.Fill({color:"rgba(255,255,255,0.4)"}),r=new ol.style.Stroke({color:"#3399CC",width:1.25}),n=[new ol.style.Style({image:new ol.style.Circle({fill:i,stroke:r,radius:5}),fill:i,stroke:r})],s=[new ol.style.Style({stroke:new ol.style.Stroke({color:e,width:5})}),new ol.style.Style({image:new ol.style.Circle({radius:6,fill:new ol.style.Fill({color:o}),stroke:new ol.style.Stroke({color:e,width:1.5})}),stroke:new ol.style.Stroke({color:o,width:3})})];t.sketchStyle&&(n=t.sketchStyle instanceof Array?t.sketchStyle:[t.sketchStyle]);t.featureStyle&&(s=t.featureStyle instanceof Array?t.featureStyle:[t.featureStyle]);this.overlayLayer_=new ol.layer.Vector({source:new ol.source.Vector({useSpatialIndex:!1}),name:"Split overlay",displayInLayerSwitcher:!1,style:function(t){return t._sketch_?n:s}})};ol.ext.inherits(ol.interaction.Split,ol.interaction.Interaction);ol.interaction.Split.prototype.setMap=function(t){this.getMap()&&this.getMap().removeLayer(this.overlayLayer_);ol.interaction.Interaction.prototype.setMap.call(this,t);this.overlayLayer_.setMap(t)};ol.interaction.Split.prototype.getClosestFeature=function(t){for(var e,o,i,r=this.snapDistance_+1,n=0;n<this.sources_.length;n++){var s=this.sources_[n];if((e=s.getClosestFeatureToCoordinate(t.coordinate))&&e.getGeometry().splitAt){o=e.getGeometry().getClosestPoint(t.coordinate);r=(i=new ol.geom.LineString([t.coordinate,o])).getLength()/t.frameState.viewState.resolution;break}}if(r>this.snapDistance_)return!1;var a=this.getNearestCoord(o,e.getGeometry().getCoordinates()),l=this.getMap().getPixelFromCoordinate(a);return ol.coordinate.dist2d(t.pixel,l)<this.snapDistance_&&(o=a),{source:s,feature:e,coord:o,link:i}};ol.interaction.Split.prototype.getNearestCoord=function(t,e){for(var o,i,r=Number.MAX_VALUE,n=0;n<e.length;n++)(o=ol.coordinate.dist2d(t,e[n]))<r&&(r=o,i=e[n]);return i};ol.interaction.Split.prototype.handleDownEvent=function(t){var e=this.getClosestFeature(t);if(e){this.overlayLayer_.getSource().clear();var o,i=e.feature.getGeometry().splitAt(e.coord,this.tolerance_);if(i.length>1){var r=[];for(o=0;o<i.length;o++){var n=e.feature.clone();n.setGeometry(i[o]);r.push(n)}for(this.dispatchEvent({type:"beforesplit",original:e.feature,features:r}),e.source.dispatchEvent({type:"beforesplit",original:e.feature,features:r}),e.source.removeFeature(e.feature),o=0;o<r.length;o++)e.source.addFeature(r[o]);this.dispatchEvent({type:"aftersplit",original:e.feature,features:r});e.source.dispatchEvent({type:"aftersplit",original:e.feature,features:r})}}return!1};ol.interaction.Split.prototype.handleMoveEvent=function(t){var e=t.map;this.overlayLayer_.getSource().clear();var o,i,r=this.getClosestFeature(t);r&&this.filterSplit_(r.feature)?(this.overlayLayer_.getSource().addFeature(r.feature),(o=new ol.Feature(new ol.geom.Point(r.coord)))._sketch_=!0,this.overlayLayer_.getSource().addFeature(o),(i=new ol.Feature(r.link))._sketch_=!0,this.overlayLayer_.getSource().addFeature(i),this.dispatchEvent({type:"pointermove",coordinate:t.coordinate,frameState:t.frameState,originalEvent:t.originalEvent,map:t.map,pixel:t.pixel,feature:r.feature,linkGeometry:r.link})):this.dispatchEvent(t);var n=e.getTargetElement();this.cursor_&&(r?n.style.cursor!=this.cursor_&&(this.previousCursor_=n.style.cursor,n.style.cursor=this.cursor_):void 0!==this.previousCursor_&&(n.style.cursor=this.previousCursor_,this.previousCursor_=void 0))};ol.interaction.Splitter=function(t){t||(t={});ol.interaction.Interaction.call(this,{handleEvent:function(t){return"pointermove"!=t.type&&"pointerdrag"!=t.type?(this.lastEvent_&&(this.splitSource(this.lastEvent_.feature),this.lastEvent_=null),this.moving_=!1):this.moving_=!0,!0}});this.added_=[];this.removed_=[];this.source_=t.features?new ol.source.Vector({features:t.features}):t.source?t.source:new ol.source.Vector({features:new ol.Collection});var e=this.triggerSource;t.triggerFeatures&&(e=new ol.source.Vector({features:t.triggerFeatures}));e?(e.on("addfeature",this.onAddFeature.bind(this)),e.on("changefeature",this.onChangeFeature.bind(this)),e.on("removefeature",this.onRemoveFeature.bind(this))):(this.source_.on("addfeature",this.onAddFeature.bind(this)),this.source_.on("changefeature",this.onChangeFeature.bind(this)),this.source_.on("removefeature",this.onRemoveFeature.bind(this)));this.tolerance_=t.tolerance||1e-10;this.filterSplit_=t.filter||function(){return!0}};ol.ext.inherits(ol.interaction.Splitter,ol.interaction.Interaction);ol.interaction.Splitter.prototype.intersectSegs=function(t,e){var o=this.tolerance_,i=t[0][0]-t[1][0],r=e[0][0]-e[1][0],n=t[0][1]-t[1][1],s=e[0][1]-e[1][1],a=i*s-n*r;if(Math.abs(a)<o)return!1;var l=((t[0][0]-e[1][0])*s-(t[0][1]-e[1][1])*r)/a;if(Math.abs(l)<o)return t[0];if(Math.abs(1-l)<o)return t[1];if(l<0||l>1)return!1;var c=((t[0][1]-e[1][1])*i-(t[0][0]-e[1][0])*n)/a;if(Math.abs(c)<o)return e[1];if(Math.abs(1-c)<o)return e[0];if(c<0||c>1)return!1;var h=t[0][0]*t[1][1]-t[0][1]*t[1][0],p=e[0][0]*e[1][1]-e[0][1]*e[1][0];return[(h*r-p*i)/a,(h*s-p*n)/a]};ol.interaction.Splitter.prototype.splitSource=function(t){if(!this.splitting){var e,o,i,r=this;this.source_.dispatchEvent({type:"beforesplit",feaure:t,source:this.source_});this.splitting=!0;this.added_=[];this.removed_=[];var n,s=t.getGeometry().getCoordinates(),a=[];for(e=0;e<s.length-1;e++){n=[s[e],s[e+1]];for(var l,c=ol.extent.buffer(ol.extent.boundingExtent(n),this.tolerance_);;){var h=!1;if(this.source_.forEachFeatureIntersectingExtent(c,f.bind(this)),!h)break;var p=h;for(this.source_.removeFeature(p),o=0;o<l.length;o++)(i=p.clone()).setGeometry(l[o]),this.source_.addFeature(i)}}for(e=0;e<s.length-2;e++)for(var u=e+1;u<s.length-1;u++){var g=this.intersectSegs([s[e],s[e+1]],[s[u],s[u+1]]);g&&g!=s[e+1]&&a.push(g)}var d=!1;if(a.length){var m=t.getGeometry().splitAt(a,this.tolerance_);if(m.length>1){for(o=0;o<m.length;o++)(i=t.clone()).setGeometry(m[o]),this.source_.addFeature(i);d=!0}}setTimeout(function(){d&&r.source_.removeFeature(t);r.source_.dispatchEvent({type:"aftersplit",featureAdded:r.added_,featureRemoved:r.removed_,source:this.source_});r.splitting=!1},0)}function f(e){if(e!==t)for(var o=e.getGeometry().getCoordinates(),i=0;i<o.length-1;i++){var r=this.intersectSegs(n,[o[i],o[i+1]]);if(r&&(a.push(r),(l=e.getGeometry().splitAt(r,this.tolerance_))&&l.length>1))return h=e,!0}return!1}};ol.interaction.Splitter.prototype.onAddFeature=function(t){this.splitSource(t.feature);this.splitting&&this.added_.push(t.feature)};ol.interaction.Splitter.prototype.onRemoveFeature=function(t){if(this.splitting){var e=this.added_.indexOf(t.feature);-1==e?this.removed_.push(t.feature):this.added_.splice(e,1)}};ol.interaction.Splitter.prototype.onChangeFeature=function(t){this.moving_?this.lastEvent_=t:this.splitSource(t.feature)};ol.interaction.Synchronize=function(t){t||(t={});var e=this;ol.interaction.Interaction.call(this,{handleEvent:function(t){return"pointermove"==t.type&&e.handleMove_(t),!0}});this.maps=t.maps};ol.ext.inherits(ol.interaction.Synchronize,ol.interaction.Interaction);ol.interaction.Synchronize.prototype.setMap=function(t){this._listener&&(ol.Observable.unByKey(this._listener.center),ol.Observable.unByKey(this._listener.rotation),ol.Observable.unByKey(this._listener.resolution),this.getMap().getTargetElement().removeEventListener("mouseout",this._listener.mouseout));this._listener=null;ol.interaction.Interaction.prototype.setMap.call(this,t);t&&(this._listener={},this._listener.center=this.getMap().getView().on("change:center",this.syncMaps.bind(this)),this._listener.rotation=this.getMap().getView().on("change:rotation",this.syncMaps.bind(this)),this._listener.resolution=this.getMap().getView().on("change:resolution",this.syncMaps.bind(this)),this._listener.mouseout=this.handleMouseOut_.bind(this),this.getMap().getTargetElement()&&this.getMap().getTargetElement().addEventListener("mouseout",this._listener.mouseout),this.syncMaps())};ol.interaction.Synchronize.prototype.syncMaps=function(t){var e=this.getMap();if(t||(t={type:"all"}),e)for(var o=0;o<this.maps.length;o++)switch(t.type){case"change:rotation":this.maps[o].getView().getRotation()!=e.getView().getRotation()&&this.maps[o].getView().setRotation(e.getView().getRotation());break;case"change:center":this.maps[o].getView().getCenter()!=e.getView().getCenter()&&this.maps[o].getView().setCenter(e.getView().getCenter());break;case"change:resolution":this.maps[o].getView().getResolution()!=e.getView().getResolution()&&this.maps[o].getView().setResolution(e.getView().getResolution());break;default:this.maps[o].getView().setRotation(e.getView().getRotation());this.maps[o].getView().setCenter(e.getView().getCenter());this.maps[o].getView().setResolution(e.getView().getResolution())}};ol.interaction.Synchronize.prototype.handleMove_=function(t){for(var e=0;e<this.maps.length;e++)this.maps[e].showTarget(t.coordinate);this.getMap().showTarget()};ol.interaction.Synchronize.prototype.handleMouseOut_=function(){for(var t=0;t<this.maps.length;t++)this.maps[t].targetOverlay_.setPosition(void 0)};ol.Map.prototype.showTarget=function(t){if(!this.targetOverlay_){var e=document.createElement("div");e.classList.add("ol-target");this.targetOverlay_=new ol.Overlay({element:e});this.targetOverlay_.setPositioning("center-center");this.addOverlay(this.targetOverlay_);e.parentElement.classList.add("ol-target-overlay");this.targetOverlay_.setPosition([0,0])}this.targetOverlay_.setPosition(t)};ol.Map.prototype.hideTarget=function(){this.removeOverlay(this.targetOverlay_);this.targetOverlay_=void 0};ol.interaction.TinkerBell=function(t){t=t||{};ol.interaction.Pointer.call(this,{handleDownEvent:this.onMove,handleMoveEvent:this.onMove});this.set("color",t.color?ol.color.asString(t.color):"#fff");this.sparkle=[0,0];this.sparkles=[];this.lastSparkle=this.time=new Date;var e=this;this.out_=function(){e.isout_=!0};this.isout_=!0};ol.ext.inherits(ol.interaction.TinkerBell,ol.interaction.Pointer);ol.interaction.TinkerBell.prototype.setMap=function(t){this._listener&&ol.Observable.unByKey(this._listener);this._listener=null;this.getMap()&&(t.getViewport().removeEventListener("mouseout",this.out_,!1),this.getMap().render());ol.interaction.Pointer.prototype.setMap.call(this,t);t&&(this._listener=t.on("postcompose",this.postcompose_.bind(this)),t.getViewport().addEventListener("mouseout",this.out_,!1))};ol.interaction.TinkerBell.prototype.onMove=function(t){this.sparkle=t.pixel;this.isout_=!1;this.getMap().render()};ol.interaction.TinkerBell.prototype.postcompose_=function(t){var e=t.context||ol.ext.getMapCanvas(this.getMap()).getContext("2d"),o=t.frameState.time-this.time;this.time=t.frameState.time;t.frameState.time-this.lastSparkle>30&&!this.isout_&&(this.lastSparkle=t.frameState.time,this.sparkles.push({p:[this.sparkle[0]+15*Math.random()-7.5,this.sparkle[1]+15*Math.random()],o:1}));e.save();e.scale(t.frameState.pixelRatio,t.frameState.pixelRatio);e.fillStyle=this.get("color");for(var i,r=this.sparkles.length-1;i=this.sparkles[r];r--){if(i.o<.2){this.sparkles.splice(0,r+1);break}e.globalAlpha=i.o;e.beginPath();e.arc(i.p[0],i.p[1],2.2,0,2*Math.PI,!1);e.fill();i.o*=.98;i.p[0]+=Math.random()-.5;i.p[1]+=o*(1+Math.random())/30}e.restore();this.sparkles.length&&this.getMap().render()};ol.interaction.TouchCompass=function(t){t=t||{};var e={handleDownEvent:function(t){var e=this.getCenter_(),o=t.pixel[0]-e[0],i=t.pixel[1]-e[1];return this.start=t,Math.sqrt(o*o+i*i)<this.size/2},handleDragEvent:function(t){this.pos||(this.pos=this.start,this.getMap().renderSync());this.pos=t},handleUpEvent:function(){return this.pos=!1,!0}};if(ol.interaction.Pointer.call(this,e),this.ondrag_=t.onDrag,this.size=t.size||80,this.alpha=t.alpha||.5,!ol.interaction.TouchCompass.prototype.compass){var o=ol.interaction.TouchCompass.prototype.compass=document.createElement("canvas"),i=o.getContext("2d"),r=o.width=o.height=this.size,n=r/10,s=r/2,a=.22*s;i.translate(s,s);i.fillStyle="#999";i.strokeStyle="#ccc";i.lineWidth=n;i.beginPath();i.arc(0,0,.42*r,0,2*Math.PI);i.fill();i.stroke();i.fillStyle="#99f";i.beginPath();i.moveTo(0,0);i.lineTo(s,0);i.lineTo(a,a);i.moveTo(0,0);i.lineTo(-s,0);i.lineTo(-a,-a);i.moveTo(0,0);i.lineTo(0,s);i.lineTo(-a,a);i.moveTo(0,0);i.lineTo(0,-s);i.lineTo(a,-a);i.moveTo(0,0);i.fill();i.fillStyle="#eee";i.beginPath();i.moveTo(0,0);i.lineTo(s,0);i.lineTo(a,-a);i.moveTo(0,0);i.lineTo(-s,0);i.lineTo(-a,a);i.moveTo(0,0);i.lineTo(0,s);i.lineTo(a,a);i.moveTo(0,0);i.lineTo(0,-s);i.lineTo(-a,-a);i.moveTo(0,0);i.fill()}};ol.ext.inherits(ol.interaction.TouchCompass,ol.interaction.Pointer);ol.interaction.TouchCompass.prototype.compass=null;ol.interaction.TouchCompass.prototype.setMap=function(t){this._listener&&ol.Observable.unByKey(this._listener);this._listener=null;ol.interaction.Pointer.prototype.setMap.call(this,t);t&&(this._listener=t.on("postcompose",this.drawCompass_.bind(this)),ol.ext.getMapCanvas(t))};ol.interaction.TouchCompass.prototype.setActive=function(t){ol.interaction.Pointer.prototype.setActive.call(this,t);this.getMap()&&this.getMap().renderSync()};ol.interaction.TouchCompass.prototype.getCenter_=function(){var t=this.size,e=this.getMap().getSize();return[e[0]/2,e[1]-10-t/2]};ol.interaction.TouchCompass.prototype.drawCompass_=function(t){if(this.getActive()){var e=t.context||ol.ext.getMapCanvas(this.getMap()).getContext("2d"),o=t.frameState.pixelRatio;e.save();e.scale(o,o);e.globalAlpha=this.alpha;e.strokeStyle="#fff";e.lineWidth=5;var i=this.size,r=this.getCenter_();if(e.drawImage(this.compass,0,0,this.compass.width,this.compass.height,r[0]-i/2,r[1]-i/2,i,i),this.pos)for(var n=this.pos.pixel[0]-this.start.pixel[0],s=this.pos.pixel[1]-this.start.pixel[1],a=1;a<=4;a++)e.beginPath(),e.arc(r[0]+n/4*a,r[1]+s/4*a,i/2*(.6+.4*a/4),0,2*Math.PI),e.stroke();if(e.restore(),this.pos){if(this.ondrag_){var l=this.getMap().getView().getResolution(),c={dpixel:[this.pos.pixel[0]-this.start.pixel[0],this.pos.pixel[1]-this.start.pixel[1]]};c.traction=[c.dpixel[0]*l,-c.dpixel[1]*l];this.ondrag_(c,this.pos)}t.frameState.animate=!0}}};ol.interaction.Transform=function(t){t||(t={});var e=this;this.selection_=new ol.Collection;this.handles_=new ol.Collection;this.overlayLayer_=new ol.layer.Vector({source:new ol.source.Vector({features:this.handles_,useSpatialIndex:!1,wrapX:!1}),name:"Transform overlay",displayInLayerSwitcher:!1,style:function(t){return e.style[(t.get("handle")||"default")+(t.get("constraint")||"")+(t.get("option")||"")]}});ol.interaction.Pointer.call(this,{handleDownEvent:this.handleDownEvent_,handleDragEvent:this.handleDragEvent_,handleMoveEvent:this.handleMoveEvent_,handleUpEvent:this.handleUpEvent_});this.features_=t.features;"function"==typeof t.filter&&(this._filter=t.filter);this.layers_=t.layers?t.layers instanceof Array?t.layers:[t.layers]:null;this._handleEvent=t.condition||function(){return!0};this.addFn_=t.addCondition||function(){return!1};this.set("translateFeature",!1!==t.translateFeature);this.set("translate",!1!==t.translate);this.set("translateBBox",!0===t.translateBBox);this.set("stretch",!1!==t.stretch);this.set("scale",!1!==t.scale);this.set("rotate",!1!==t.rotate);this.set("keepAspectRatio",t.keepAspectRatio||function(t){return t.originalEvent.shiftKey});this.set("modifyCenter",t.modifyCenter||function(t){return t.originalEvent.metaKey||t.originalEvent.ctrlKey});this.set("noFlip",t.noFlip||!1);this.set("selection",!1!==t.selection);this.set("hitTolerance",t.hitTolerance||0);this.set("enableRotatedTransform",t.enableRotatedTransform||!1);this.on("propertychange",function(){this.drawSketch_()});this.setDefaultStyle()};ol.ext.inherits(ol.interaction.Transform,ol.interaction.Pointer);ol.interaction.Transform.prototype.Cursors={"default":"auto",select:"pointer",translate:"move",rotate:"move",rotate0:"move",scale:"nesw-resize",scale1:"nwse-resize",scale2:"nesw-resize",scale3:"nwse-resize",scalev:"ew-resize",scaleh1:"ns-resize",scalev2:"ew-resize",scaleh3:"ns-resize"};ol.interaction.Transform.prototype.setMap=function(t){this.getMap()&&(this.getMap().removeLayer(this.overlayLayer_),this.previousCursor_&&(this.getMap().getTargetElement().style.cursor=this.previousCursor_,this.previousCursor_=void 0));ol.interaction.Pointer.prototype.setMap.call(this,t);this.overlayLayer_.setMap(t);null===t&&this.select(null);null!==t&&(this.isTouch=/touch/.test(t.getViewport().className),this.setDefaultStyle())};ol.interaction.Transform.prototype.setActive=function(t){this.select(null);this.overlayLayer_.setVisible(t);ol.interaction.Pointer.prototype.setActive.call(this,t)};ol.interaction.Transform.prototype.setDefaultStyle=function(){var t=new ol.style.Stroke({color:[255,0,0,1],width:1}),e=new ol.style.Stroke({color:[255,0,0,1],width:1,lineDash:[4,4]}),o=new ol.style.Fill({color:[255,0,0,.01]}),i=new ol.style.Fill({color:[255,255,255,.8]}),r=new ol.style.RegularShape({fill:i,stroke:t,radius:this.isTouch?12:6,points:15});r.getAnchor()[0]=this.isTouch?-10:-5;var n=new ol.style.RegularShape({fill:i,stroke:t,radius:this.isTouch?16:8,points:4,angle:Math.PI/4}),s=new ol.style.RegularShape({fill:i,stroke:t,radius:this.isTouch?12:6,points:4,angle:Math.PI/4});function a(t,e,o){return[new ol.style.Style({image:t,stroke:e,fill:o})]}this.style={"default":a(n,e,o),translate:a(n,t,i),rotate:a(r,t,i),rotate0:a(n,t,i),scale:a(n,t,i),scale1:a(n,t,i),scale2:a(n,t,i),scale3:a(n,t,i),scalev:a(s,t,i),scaleh1:a(s,t,i),scalev2:a(s,t,i),scaleh3:a(s,t,i)};this.drawSketch_()};ol.interaction.Transform.prototype.setStyle=function(t,e){if(e){this.style[t]=e instanceof Array?e:[e];for(var o=0;o<this.style[t].length;o++){var i=this.style[t][o].getImage();i&&("rotate"==t&&(i.getAnchor()[0]=-5),this.isTouch&&i.setScale(1.8));var r=this.style[t][o].getText();r&&("rotate"==t&&r.setOffsetX(this.isTouch?14:7),this.isTouch&&r.setScale(1.8))}this.drawSketch_()}};ol.interaction.Transform.prototype.getFeatureAtPixel_=function(t){var e=this;return this.getMap().forEachFeatureAtPixel(t,function(t,o){var i=!1;if(!o){if(t===e.bbox_)return!!e.get("translateBBox")&&{feature:t,handle:"translate",constraint:"",option:""};if(e.handles_.forEach(function(e){e===t&&(i=!0)}),i)return{feature:t,handle:t.get("handle"),constraint:t.get("constraint"),option:t.get("option")}}if(!e.get("selection"))return e.selection_.getArray().some(function(e){return t===e})?{feature:t}:null;if(e._filter)return e._filter(t,o)?{feature:t}:null;if(e.layers_){for(var r=0;r<e.layers_.length;r++)if(e.layers_[r]===o)return{feature:t};return null}return e.features_?(e.features_.forEach(function(e){e===t&&(i=!0)}),i?{feature:t}:null):{feature:t}},{hitTolerance:this.get("hitTolerance")})||{}};ol.interaction.Transform.prototype.getGeometryRotateToZero_=function(t,e){var o=t.getGeometry(),i=this.getMap().getView().getRotation();if(0===i||!this.get("enableRotatedTransform"))return e?o.clone():o;var r=o.clone();return r.rotate(-1*i,this.getMap().getView().getCenter()),r};ol.interaction.Transform.prototype.drawSketch_=function(t){var e,o,i;if(this.overlayLayer_.getSource().clear(),this.selection_.getLength()){var r=this.getMap().getView().getRotation(),n=this.getGeometryRotateToZero_(this.selection_.item(0)).getExtent();if(n=ol.extent.buffer(n,0),this.selection_.forEach(function(t){var e=this.getGeometryRotateToZero_(t).getExtent();ol.extent.extend(n,e)}.bind(this)),!0===t)this.ispt_||(this.overlayLayer_.getSource().addFeature(new ol.Feature({geometry:new ol.geom.Point(this.center_),handle:"rotate0"})),i=ol.geom.Polygon.fromExtent(n),this.get("enableRotatedTransform")&&0!==r&&i.rotate(r,this.getMap().getView().getCenter()),o=this.bbox_=new ol.Feature(i),this.overlayLayer_.getSource().addFeature(o));else{if(this.ispt_){var s=this.getMap().getPixelFromCoordinate([n[0],n[1]]);n=ol.extent.boundingExtent([this.getMap().getCoordinateFromPixel([s[0]-10,s[1]-10]),this.getMap().getCoordinateFromPixel([s[0]+10,s[1]+10])])}i=ol.geom.Polygon.fromExtent(n);this.get("enableRotatedTransform")&&0!==r&&i.rotate(r,this.getMap().getView().getCenter());o=this.bbox_=new ol.Feature(i);var a=[],l=i.getCoordinates()[0];if(!this.ispt_){if(a.push(o),!this.iscircle_&&this.get("stretch")&&this.get("scale"))for(e=0;e<l.length-1;e++)o=new ol.Feature({geometry:new ol.geom.Point([(l[e][0]+l[e+1][0])/2,(l[e][1]+l[e+1][1])/2]),handle:"scale",constraint:e%2?"h":"v",option:e}),a.push(o);if(this.get("scale"))for(e=0;e<l.length-1;e++)o=new ol.Feature({geometry:new ol.geom.Point(l[e]),handle:"scale",option:e}),a.push(o);this.get("translate")&&!this.get("translateFeature")&&(o=new ol.Feature({geometry:new ol.geom.Point([(l[0][0]+l[2][0])/2,(l[0][1]+l[2][1])/2]),handle:"translate"}),a.push(o))}!this.iscircle_&&this.get("rotate")&&(o=new ol.Feature({geometry:new ol.geom.Point(l[3]),handle:"rotate"}),a.push(o));this.overlayLayer_.getSource().addFeatures(a)}}};ol.interaction.Transform.prototype.select=function(t,e){if(!t)return this.selection_.clear(),void this.drawSketch_();if(t.getGeometry&&t.getGeometry()){if(e)this.selection_.push(t);else{var o=this.selection_.getArray().indexOf(t);this.selection_.removeAt(o)}this.ispt_=1===this.selection_.getLength()&&"Point"==this.selection_.item(0).getGeometry().getType();this.iscircle_=1===this.selection_.getLength()&&"Circle"==this.selection_.item(0).getGeometry().getType();this.drawSketch_();this.watchFeatures_();this.dispatchEvent({type:"select",feature:t,features:this.selection_})}};ol.interaction.Transform.prototype.setSelection=function(t){this.selection_.clear();t.forEach(function(t){this.selection_.push(t)});this.ispt_=1===this.selection_.getLength()&&"Point"==this.selection_.item(0).getGeometry().getType();this.iscircle_=1===this.selection_.getLength()&&"Circle"==this.selection_.item(0).getGeometry().getType();this.drawSketch_();this.watchFeatures_();this.dispatchEvent({type:"select",features:this.selection_})};ol.interaction.Transform.prototype.watchFeatures_=function(){this._featureListeners&&this._featureListeners.forEach(function(t){ol.Observable.unByKey(t)});this._featureListeners=[];this.selection_.forEach(function(t){this._featureListeners.push(t.on("change",function(){this.isUpdating_||this.drawSketch_()}.bind(this)))}.bind(this))};ol.interaction.Transform.prototype.handleDownEvent_=function(t){if(this._handleEvent(t,this.selection_)){var e=this.getFeatureAtPixel_(t.pixel),o=e.feature;if(this.selection_.getLength()&&this.selection_.getArray().indexOf(o)>=0&&(this.ispt_&&this.get("translate")||this.get("translateFeature"))&&(e.handle="translate"),e.handle){this.mode_=e.handle;this.opt_=e.option;this.constraint_=e.constraint;var i=this.getMap().getView().getRotation();this.coordinate_=t.coordinate;this.pixel_=t.pixel;this.geoms_=[];this.rotatedGeoms_=[];for(var r,n=ol.extent.createEmpty(),s=ol.extent.createEmpty(),a=0;r=this.selection_.item(a);a++)if(this.geoms_.push(r.getGeometry().clone()),n=ol.extent.extend(n,r.getGeometry().getExtent()),this.get("enableRotatedTransform")&&0!==i){var l=this.getGeometryRotateToZero_(r,!0);this.rotatedGeoms_.push(l);s=ol.extent.extend(s,l.getExtent())}if(this.extent_=ol.geom.Polygon.fromExtent(n).getCoordinates()[0],this.get("enableRotatedTransform")&&0!==i&&(this.rotatedExtent_=ol.geom.Polygon.fromExtent(s).getCoordinates()[0]),"rotate"===this.mode_){this.center_=this.getCenter()||ol.extent.getCenter(n);var c=t.map.getTargetElement();c.style.cursor=this.Cursors.rotate0;this.previousCursor_=c.style.cursor}else this.center_=ol.extent.getCenter(n);return this.angle_=Math.atan2(this.center_[1]-t.coordinate[1],this.center_[0]-t.coordinate[0]),this.dispatchEvent({type:this.mode_+"start",feature:this.selection_.item(0),features:this.selection_,pixel:t.pixel,coordinate:t.coordinate}),!0}if(this.get("selection")){if(o){this.addFn_(t)||this.selection_.clear();var h=this.selection_.getArray().indexOf(o);h<0?this.selection_.push(o):this.selection_.removeAt(h)}else this.selection_.clear();return this.ispt_=1===this.selection_.getLength()&&"Point"==this.selection_.item(0).getGeometry().getType(),this.iscircle_=1===this.selection_.getLength()&&"Circle"==this.selection_.item(0).getGeometry().getType(),this.drawSketch_(),this.watchFeatures_(),this.dispatchEvent({type:"select",feature:o,features:this.selection_,pixel:t.pixel,coordinate:t.coordinate}),!1}}};ol.interaction.Transform.prototype.getFeatures=function(){return this.selection_};ol.interaction.Transform.prototype.getCenter=function(){return this.get("center")};ol.interaction.Transform.prototype.setCenter=function(t){return this.set("center",t)};ol.interaction.Transform.prototype.handleDragEvent_=function(t){if(this._handleEvent(t,this.features_)){var e,o,i,r=this.getMap().getView().getRotation(),n=[this.coordinate_[0],this.coordinate_[1]],s=[t.coordinate[0],t.coordinate[1]];switch(this.isUpdating_=!0,this.mode_){case"rotate":var a=Math.atan2(this.center_[1]-s[1],this.center_[0]-s[0]);if(!this.ispt)for(e=0;o=this.selection_.item(e);e++)(i=this.geoms_[e].clone()).rotate(a-this.angle_,this.center_),"Circle"==i.getType()&&i.setCenterAndRadius(i.getCenter(),i.getRadius()),o.setGeometry(i);this.drawSketch_(!0);this.dispatchEvent({type:"rotating",feature:this.selection_.item(0),features:this.selection_,angle:a-this.angle_,pixel:t.pixel,coordinate:t.coordinate});break;case"translate":var l=s[0]-n[0],c=s[1]-n[1];for(e=0;o=this.selection_.item(e);e++)o.getGeometry().translate(l,c);this.handles_.forEach(function(t){t.getGeometry().translate(l,c)});this.coordinate_=t.coordinate;this.dispatchEvent({type:"translating",feature:this.selection_.item(0),features:this.selection_,delta:[l,c],pixel:t.pixel,coordinate:t.coordinate});break;case"scale":var h=this.center_;if(this.get("modifyCenter")(t)){var p=this.extent_;this.get("enableRotatedTransform")&&0!==r&&(p=this.rotatedExtent_);h=p[(Number(this.opt_)+2)%4]}var u=this.coordinate_,g=t.coordinate;if(this.get("enableRotatedTransform")&&0!==r){var d=new ol.geom.Point(this.coordinate_);d.rotate(-1*r,h);u=d.getCoordinates();var m=new ol.geom.Point(t.coordinate);m.rotate(-1*r,h);g=m.getCoordinates()}var f=(g[0]-h[0])/(u[0]-h[0]),y=(g[1]-h[1])/(u[1]-h[1]);if(this.get("enableRotatedTransform")&&0!==r){var v=new ol.geom.Point(h);v.rotate(-1*r,this.getMap().getView().getCenter());h=v.getCoordinates()}for(this.get("noFlip")&&(f<0&&(f=-f),y<0&&(y=-y)),this.constraint_?"h"==this.constraint_?f=1:y=1:this.get("keepAspectRatio")(t)&&(f=y=Math.min(f,y)),e=0;o=this.selection_.item(e);e++)(i=0!==r&&this.get("enableRotatedTransform")?this.rotatedGeoms_[e].clone():this.geoms_[e].clone()).applyTransform(function(t,e,o){if(o<2)return e;for(var r=0;r<t.length;r+=o)1!=f&&(e[r]=h[0]+(t[r]-h[0])*f),1!=y&&(e[r+1]=h[1]+(t[r+1]-h[1])*y);return"Circle"==i.getType()&&i.setCenterAndRadius(i.getCenter(),i.getRadius()),e}),this.get("enableRotatedTransform")&&0!==r&&i.rotate(r,this.getMap().getView().getCenter()),o.setGeometry(i);this.drawSketch_();this.dispatchEvent({type:"scaling",feature:this.selection_.item(0),features:this.selection_,scale:[f,y],pixel:t.pixel,coordinate:t.coordinate})}this.isUpdating_=!1}};ol.interaction.Transform.prototype.handleMoveEvent_=function(t){if(this._handleEvent(t,this.features_)&&!this.mode_){var e=this.getFeatureAtPixel_(t.pixel),o=t.map.getTargetElement();if(e.feature){var i=e.handle?this.Cursors[(e.handle||"default")+(e.constraint||"")+(e.option||"")]:this.Cursors.select;void 0===this.previousCursor_&&(this.previousCursor_=o.style.cursor);o.style.cursor=i}else void 0!==this.previousCursor_&&(o.style.cursor=this.previousCursor_),this.previousCursor_=void 0}};ol.interaction.Transform.prototype.handleUpEvent_=function(t){return"rotate"===this.mode_&&(t.map.getTargetElement().style.cursor=this.Cursors.default,this.previousCursor_=void 0),this.dispatchEvent({type:this.mode_+"end",feature:this.selection_.item(0),features:this.selection_,oldgeom:this.geoms_[0],oldgeoms:this.geoms_}),this.drawSketch_(),this.mode_=null,!1};ol.interaction.Transform.prototype.getFeatures=function(){return this.selection_};ol.interaction.UndoRedo=function(t){t||(t={});ol.interaction.Interaction.call(this,{handleEvent:function(){return!0}});this._undoStack=[];this._redoStack=[];this._block=0;this._record=!0;this._defs={}};ol.ext.inherits(ol.interaction.UndoRedo,ol.interaction.Interaction);ol.interaction.UndoRedo.prototype.define=function(t,e,o){this._defs["_"+t]={undo:e,redo:o}};ol.interaction.UndoRedo.prototype.push=function(t,e){return!!this._defs["_"+t]&&(this._undoStack.push({type:"_"+t,prop:e}),!0)};ol.interaction.UndoRedo.prototype.setActive=function(t){ol.interaction.Interaction.prototype.setActive.call(this,t);this._record=t};ol.interaction.UndoRedo.prototype.setMap=function(t){ol.interaction.Interaction.prototype.setMap.call(this,t);this._watchSources();this._watchInteractions()};ol.interaction.UndoRedo.prototype._watchSources=function(){var t=this.getMap();(this._sourceListener&&this._sourceListener.forEach(function(t){ol.Observable.unByKey(t)}),this._sourceListener=[],t)&&(function t(e,o){return o||(o=[]),e.forEach(function(e){e instanceof ol.layer.Vector?o.push(e):e.getLayers&&t(e.getLayers(),o)}),o}(t.getLayers()).forEach(function(t){var e=t.getSource();this._sourceListener.push(e.on(["addfeature","removefeature"],this._onAddRemove.bind(this)));this._sourceListener.push(e.on("clearstart",this.blockStart.bind(this)));this._sourceListener.push(e.on("clearend",this.blockEnd.bind(this)))}.bind(this)),this._sourceListener.push(t.getLayers().on(["add","remove"],this._watchSources.bind(this))))};ol.interaction.UndoRedo.prototype._watchInteractions=function(){var t=this.getMap();this._interactionListener&&this._interactionListener.forEach(function(t){ol.Observable.unByKey(t)});this._interactionListener=[];t&&(t.getInteractions().forEach(function(t){this._interactionListener.push(t.on(["setattributestart","modifystart","rotatestart","translatestart","scalestart","deletestart","deleteend","beforesplit","aftersplit"],this._onInteraction.bind(this)))}.bind(this)),this._interactionListener.push(t.getInteractions().on(["add","remove"],this._watchInteractions.bind(this))))};ol.interaction.UndoRedo.prototype._onAddRemove=function(t){this._record&&(this._undoStack.push({type:t.type,source:t.target,feature:t.feature}),this._redoStack=[])};ol.interaction.UndoRedo.prototype._onInteraction=function(t){var e=this._onInteraction[t.type];e&&e.call(this,t)};ol.interaction.UndoRedo.prototype._onInteraction.setattributestart=function(t){this.blockStart();var e=Object.assign({},t.properties);t.features.forEach(function(t){var o={};for(var i in e)o[i]=t.get(i);this._undoStack.push({type:"changeattribute",feature:t,newProperties:e,oldProperties:o})}.bind(this));this.blockEnd()};ol.interaction.UndoRedo.prototype._onInteraction.rotatestart=ol.interaction.UndoRedo.prototype._onInteraction.translatestart=ol.interaction.UndoRedo.prototype._onInteraction.scalestart=ol.interaction.UndoRedo.prototype._onInteraction.modifystart=function(t){this.blockStart();t.features.forEach(function(t){this._undoStack.push({type:"changefeature",feature:t,oldFeature:t.clone()})}.bind(this));this.blockEnd()};ol.interaction.UndoRedo.prototype.blockStart=function(){this._undoStack.push({type:"blockstart"});this._redoStack=[]};ol.interaction.UndoRedo.prototype._onInteraction.beforesplit=ol.interaction.UndoRedo.prototype._onInteraction.deletestart=ol.interaction.UndoRedo.prototype.blockStart;ol.interaction.UndoRedo.prototype.blockEnd=function(){this._undoStack.push({type:"blockend"})};ol.interaction.UndoRedo.prototype._onInteraction.aftersplit=ol.interaction.UndoRedo.prototype._onInteraction.deleteend=ol.interaction.UndoRedo.prototype.blockEnd;ol.interaction.UndoRedo.prototype._handleDo=function(t,e){if(this.getActive()){switch(this._record=!1,t.type){case"addfeature":e?t.source.removeFeature(t.feature):t.source.addFeature(t.feature);break;case"removefeature":e?t.source.addFeature(t.feature):t.source.removeFeature(t.feature);break;case"changefeature":var o=t.feature.getGeometry();t.feature.setGeometry(t.oldFeature.getGeometry());t.oldFeature.setGeometry(o);break;case"changeattribute":var i=t.newProperties,r=t.oldProperties;for(var n in r)void 0===r?t.feature.unset(n):t.feature.set(n,r[n]);t.oldProperties=i;t.newProperties=r;break;case"blockstart":this._block+=e?-1:1;break;case"blockend":this._block+=e?1:-1;break;default:this._defs[t.type]?e?this._defs[t.type].undo(t.prop):this._defs[t.type].redo(t.prop):console.warn('[UndoRedoInteraction]: "'+t.type.substr(1)+'" is not defined.')}this._block<0&&(this._block=0);this._block&&(e?this.undo():this.redo());this._record=!0;this.dispatchEvent({type:e?"undo":"redo",action:t})}};ol.interaction.UndoRedo.prototype.undo=function(){var t=this._undoStack.pop();t&&(this._redoStack.push(t),this._handleDo(t,!0))};ol.interaction.UndoRedo.prototype.redo=function(){var t=this._redoStack.pop();t&&(this._undoStack.push(t),this._handleDo(t,!1))};ol.interaction.UndoRedo.prototype.clear=function(){this._undoStack=[];this._redoStack=[]};ol.interaction.UndoRedo.prototype.hasUndo=function(){return this._undoStack.length};ol.interaction.UndoRedo.prototype.hasRedo=function(){return this._redoStack.length};ol.source.BinBase=function(t){t=t||{};this._bindModify=this._onModifyFeature.bind(this);this._watch=!0;ol.source.Vector.call(this,t);this._origin=t.source;this._listen=!1!==t.listenChange;this._geomFn=t.geometryFunction||ol.coordinate.getFeatureCenter||function(t){return t.getGeometry().getFirstCoordinate()};this.reset();this._origin.on("addfeature",this._onAddFeature.bind(this));this._origin.on("removefeature",this._onRemoveFeature.bind(this));this._origin.on("clearstart",this._onClearFeature.bind(this));this._origin.on("clearend",this._onClearFeature.bind(this));"function"==typeof t.flatAttributes&&(this._flatAttributes=t.flatAttributes)};ol.ext.inherits(ol.source.BinBase,ol.source.Vector);ol.source.BinBase.prototype._onAddFeature=function(t,e,o){var i=t.feature||t.target;(e=e||this.getBinAt(this._geomFn(i),!0))&&e.get("features").push(i);this._listen&&!1!==o&&i.on("change",this._bindModify)};ol.source.BinBase.prototype._onRemoveFeature=function(t,e,o){if(this._watch){var i=t.feature||t.target;if(e=e||this.getBinAt(this._geomFn(i))){for(var r,n=e.get("features"),s=0;r=n[s];s++)if(r===i){n.splice(s,1);break}n.length||this.removeFeature(e)}this._listen&&!1!==o&&i.un("change",this._bindModify)}};ol.source.BinBase.prototype._onClearFeature=function(t){"clearstart"===t.type?(this._listen&&this._origin.getFeatures().forEach(function(t){t.un("change",this._bindModify)}.bind(this)),this.clear(),this._watch=!1):this._watch=!0};ol.source.BinBase.prototype.getBin=function(t){for(var e,o=this.getFeatures(),i=0;e=o[i];i++)for(var r,n=e.get("features"),s=0;r=n[s];s++)if(r===t)return e;return null};ol.source.BinBase.prototype.getGridGeomAt=function(t){return new ol.geom.Polygon([t])};ol.source.BinBase.prototype.getBinAt=function(t,e){var o={},i=this.getGridGeomAt(t,o);if(!i)return null;var r=i.getInteriorPoint?i.getInteriorPoint().getCoordinates():i.getInteriorPoints().getCoordinates()[0],n=this.getFeaturesAtCoordinate(r)[0];return!n&&e&&(o.geometry=i,o.features=[],o.center=r,n=new ol.Feature(o),this.addFeature(n)),n||null};ol.source.BinBase.prototype._onModifyFeature=function(t){var e=this.getBin(t.target),o=this.getBinAt(this._geomFn(t.target),"create");e!==o&&(e&&this._onRemoveFeature(t,e,!1),o&&this._onAddFeature(t,o,!1));this.changed()};ol.source.BinBase.prototype.reset=function(){this.clear();for(var t,e=this._origin.getFeatures(),o=0;t=e[o];o++)this._onAddFeature({feature:t})};ol.source.BinBase.prototype.getGridFeatures=function(){var t=[];return this.getFeatures().forEach(function(e){var o=new ol.Feature(e.getGeometry().clone());for(var i in e.getProperties())"features"!==i&&"geometry"!==i&&o.set(i,e.get(i));o.set("nb",e.get("features").length);this._flatAttributes(o,e.get("features"));t.push(o)}.bind(this)),t};ol.source.BinBase.prototype._flatAttributes=function(){};ol.source.BinBase.prototype.getSource=function(){return this._origin};ol.source.DBPedia=function(t){var e=t||{};e.loader=this._loaderFn;this._url=e.url||"http://fr.dbpedia.org/sparql";this._maxResolution=e.maxResolution||100;this._lang=e.lang||"fr";this._limit=e.limit||1e3;e.attributions||(e.attributions=["&copy; <a href='http://dbpedia.org/'>DBpedia<\/a> CC-by-SA"]);e.strategy||(e.strategy=ol.loadingstrategy.bbox);ol.source.Vector.call(this,e)};ol.ext.inherits(ol.source.DBPedia,ol.source.Vector);ol.source.DBPedia.prototype.readFeature=function(t,e,o){for(var i in e)"uri"===e[i].type&&(e[i].value=encodeURI(e[i].value)),t.set(i,e[i].value);return!o||o.get("subject")!=e.subject.value||(o.set("type",o.get("type")+"\n"+e.type.value),!1)};ol.source.DBPedia.prototype.querySubject=function(){return"?subject rdfs:label ?label. OPTIONAL {?subject dbpedia-owl:thumbnail ?thumbnail}.OPTIONAL {?subject dbpedia-owl:abstract ?abstract} . OPTIONAL {?subject rdf:type ?type}"};ol.source.DBPedia.prototype.queryFilter=function(){return"lang(?label) = '"+this._lang+"' && lang(?abstract) = '"+this._lang+"'"};ol.source.DBPedia.prototype._loaderFn=function(t,e,o){if(!(e>this._maxResolution)){var i=this,r=ol.proj.transformExtent(t,o,"EPSG:4326"),n="PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> SELECT DISTINCT * WHERE { ?subject geo:lat ?lat . ?subject geo:long ?long . "+this.querySubject()+" . FILTER("+this.queryFilter()+") . FILTER(xsd:float(?lat) <= "+r[3]+" && "+r[1]+" <= xsd:float(?lat) && xsd:float(?long) <= "+r[2]+" && "+r[0]+" <= xsd:float(?long) ) . } LIMIT "+this._limit;ol.ext.Ajax.get({url:this._url,data:{query:n,format:"json"},success:function(t){var e,r,n,s=t.results.bindings,a=[],l=null;for(var c in s)e=s[c],r=[Number(s[c].long.value),Number(s[c].lat.value)],n=new ol.Feature(new ol.geom.Point(ol.proj.transform(r,"EPSG:4326",o))),i.readFeature(n,e,l)&&(a.push(n),l=n);i.addFeatures(a)}})}};ol.style.clearDBPediaStyleCache;ol.style.dbPediaStyleFunction,function(){var t={};ol.style.clearDBPediaStyleCache=function(){t={}};ol.style.dbPediaStyleFunction=function(e){var o;switch(e||(e={}),typeof e.glyph){case"function":o=e.glyph;break;case"string":o=function(){return e.glyph};break;default:o=function(t){var e=t.get("type");if(e){if(e.match("/Museum"))return"fa-camera";if(e.match("/Monument"))return"fa-building";if(e.match("/Sculpture"))return"fa-android";if(e.match("/Religious"))return"fa-institution";if(e.match("/Castle"))return"fa-key";if(e.match("Water"))return"fa-tint";if(e.match("Island"))return"fa-leaf";if(e.match("/Event"))return"fa-heart";if(e.match("/Artwork"))return"fa-asterisk";if(e.match("/Stadium"))return"fa-futbol-o";if(e.match("/Place"))return"fa-street-view"}return"fa-star"}}var i=e.radius||8,r=e.fill||new ol.style.Fill({color:"navy"}),n=e.stroke||new ol.style.Stroke({color:"#fff",width:2}),s=e.prefix?e.prefix+"_":"";return function(e){var a=o(e),l=s+a,c=t[l];return c||(t[l]=c=new ol.style.Style({image:new ol.style.FontSymbol({glyph:a,radius:i,fill:r,stroke:n})})),[c]}}}();ol.source.DFCI=function(t){(t=t||{}).loader=this._calcGrid;t.strategy=function(t,e){return this.resolution&&this.resolution!=e&&(this.clear(),this.refresh()),[t]};this._bbox=[[0,16e5],[11e5,26e5]];ol.source.Vector.call(this,t);this.set("resolutions",t.resolutions||[1e3,100,20]);proj4.defs["EPSG:27572"]||proj4.defs("EPSG:27572","+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs");ol.proj.proj4.register(proj4)};ol.ext.inherits(ol.source.DFCI,ol.source.Vector);ol.source.DFCI.prototype._calcGrid=function(t,e,o){var i,r,n=this.get("resolutions");e>(n[0]||1e3)?this.resolution!=e&&(this._features0||(r=[this._bbox[0][0],this._bbox[0][1],this._bbox[1][0],this._bbox[1][1]],this._features0=this._getFeatures(0,r,o)),this.addFeatures(this._features0)):e>(n[1]||100)?(this.clear(),r=ol.proj.transformExtent(t,o,"EPSG:27572"),i=this._getFeatures(1,r,o),this.addFeatures(i)):e>(n[2]||0)?(this.clear(),r=ol.proj.transformExtent(t,o,"EPSG:27572"),i=this._getFeatures(2,r,o),this.addFeatures(i)):(this.clear(),r=ol.proj.transformExtent(t,o,"EPSG:27572"),i=this._getFeatures(3,r,o),this.addFeatures(i));this.resolution=e};ol.source.DFCI.prototype._midPt=function(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]};ol.source.DFCI.prototype._trFeature=function(t,e,o,i){var r=new ol.geom.Polygon([t]),n=new ol.Feature(r.transform("EPSG:27572",i));return n.set("id",e),n.set("level",o),n};ol.source.DFCI.prototype._getFeatures=function(t,e,o){var i,r=[],n=1e5;t>0&&(n/=5);t>1&&(n/=10);for(var s=[Math.max(this._bbox[0][0],Math.floor(e[0]/n)*n),Math.max(this._bbox[0][1],Math.floor(e[1]/n)*n)],a=[Math.min(this._bbox[1][0]+99999,Math.floor(e[2]/n)*n),Math.min(this._bbox[1][1]+99999,Math.floor(e[3]/n)*n)],l=s[0];l<=a[0];l+=n)for(var c=s[1];c<=a[1];c+=n){var h,p=[[l,c],[l+n,c],[l+n,c+n],[l,c+n],[l,c]];if(t>2){var u=this._midPt(p[0],p[2]),g=[];for(i=0;i<p.length;i++)g.push(this._midPt(p[i],u));for(r.push(this._trFeature(g,ol.coordinate.toDFCI([l,c],2)+".5",t,o)),i=0;i<4;i++)(g=[]).push(p[i]),g.push(this._midPt(p[i],p[(i+1)%4])),g.push(this._midPt(u,g[1])),g.push(this._midPt(u,p[i])),h=this._midPt(p[i],p[(i+3)%4]),g.push(this._midPt(u,h)),g.push(h),g.push(p[i]),r.push(this._trFeature(g,ol.coordinate.toDFCI([l,c],2)+"."+(4-i),t,o))}else r.push(this._trFeature(p,ol.coordinate.toDFCI([l,c],t),t,o))}return r};ol.source.DayNight=function(t){(t=t||{}).loader=this._loader;t.strategy=ol.loadingstrategy.all;ol.source.Vector.call(this,t);this.set("time",t.time||new Date);this.set("step",t.step||1)};ol.ext.inherits(ol.source.DayNight,ol.source.Vector),function(){ol.source.DayNight.prototype._loader=function(t,e,o){var i=this.getCoordinates(this.get("time")),r=new ol.geom.Polygon([i]);r.transform("EPSG:4326",o);this.addFeature(new ol.Feature(r))};ol.source.DayNight.prototype.setTime=function(t){this.set("time",t);this.refresh()};ol.source.DayNight.prototype.getCoordinates=function(t,e){for(var o=180/Math.PI,i=Math.PI/180,r=(t?new Date(t):new Date)/864e5+2440587.5,n=(18.697374558+24.065709824419081*(r-2451545))%24,s=[],a=function(t){var e=Math.PI/180,o=t-2451545,i=280.46+.9856474*o,r=357.528+.9856003*o;return r%=360,{lambda:(i%=360)+1.915*Math.sin(r*e)+.02*Math.sin(2*r*e),R:1.00014-.01671*Math.cos(r*e)-.0014*Math.cos(2*r*e)}}(r),l=function(t){var e=(t-2451545)/36525;return 23.43929111-e*(46.836769/3600-e*(.0001831/3600+e*(5565e-10-e*(16e-11-434e-10*e/3600))))}(r),c=function(t,e){var o=180/Math.PI,i=Math.PI/180,r=Math.atan(Math.cos(e*i)*Math.tan(t*i))*o,n=Math.asin(Math.sin(e*i)*Math.sin(t*i))*o;return{alpha:r+=90*Math.floor(t/90)-90*Math.floor(r/90),delta:n}}(a.lambda,l),h=this.get("step")||1,p=-180;p<=180;p+=h){var u=p,g=15*n+u-c.alpha,d=Math.atan(-Math.cos(g*i)/Math.tan(c.delta*i))*o;s.push([u,d])}switch(e){case"line":break;case"day":c.delta*=-1;default:d=c.delta<0?90:-90;s.unshift([-180,d]);s.push([180,d]);s.push(s[0])}if("daynight"===e){var m=[];s.forEach(function(t){m.push(t.slice())});m[0][1]=-m[0][1];m[m.length-1][1]=-m[0][1];m[m.length-1][1]=-m[0][1];s=[s,m]}return s}}();ol.source.Delaunay=function(t){t=t||{};this._nodes=t.source;delete t.source;ol.source.Vector.call(this,t);this.hull=[];this._nodes.on("addfeature",this._onAddNode.bind(this));this._nodes.on("removefeature",this._onRemoveNode.bind(this));this.set("epsilon",t.epsilon||.0001)};ol.ext.inherits(ol.source.Delaunay,ol.source.Vector);ol.source.Delaunay.prototype._addTriangle=function(t){t.push(t[0]);var e=new ol.Feature(new ol.geom.Polygon([t]));return this.addFeature(e),this.flip.push(e),e};ol.source.Delaunay.prototype.getNodes=function(){return this._nodes.getFeatures()};ol.source.Delaunay.prototype.getNodeSource=function(){return this._nodes};ol.source.Delaunay.prototype._onRemoveNode=function(t){var e=t.feature.getGeometry().getCoordinates();if(e&&!this.getNodesAt(e).length){var o,i=this.getTrianglesAt(e);this.flip=[];for(var r=[];i.length;){var n=i.pop();this.removeFeature(n);n=n.getGeometry().getCoordinates()[0];var s=[];for(o=0;o<3;o++)l=n[o],ol.coordinate.equal(l,e)||s.push(l);r.push(s)}for(s=r.pop(),o=0;;){var a=r[o];if(f(a[0],a[1],0)||f(a[1],a[0],0)||f(a[0],a[1],s.length-1)||f(a[1],a[0],s.length-1)?(r.splice(o,1),o=0):o++,!r.length)break;if(o>=r.length)throw"[DELAUNAY:removePoint] No edge found";}var l,c=ol.coordinate.equal(s[0],s[s.length-1]);for(c&&s.pop();l=this.hull[o];o++)if(ol.coordinate.equal(e,l)){this.hull.splice(o,1);break}this.hull=ol.coordinate.convexHull(this.hull.concat(s));var h,p=function(t){for(var e,o=0,i=0;i<t.length;i++)o+=(t[e=(i+1)%t.length][0]-t[i][0])*(t[e][1]+t[i][1]);return o>=0?1:-1},u=s.slice();for(c?h=p(s):(u.push(e),h=p(u)),o=0;o<=s.length+1&&!(s.length<3);o++){var g=[s[o%s.length],s[(o+1)%s.length],s[(o+2)%s.length]];if(p(g)===h){for(var d=!0,m=o+3;m<o+s.length;m++)if(this.inCircle(s[m%s.length],g)){d=!1;break}d&&(this._addTriangle(g),s.splice((o+1)%s.length,1),o=-1)}}this.flipTriangles()}function f(t,e,o){return!!ol.coordinate.equal(t,s[o])&&(o?s.push(e):s.unshift(e),!0)}};ol.source.Delaunay.prototype._onAddNode=function(t){var e,o,i=t.feature;if("Point"===i.getGeometry().getType()){this.flip=[];var r=this.getNodes(),n=i.getGeometry().getCoordinates();if(this.getNodesAt(n).length>1)this._nodes.removeFeature(i);else if(r.length<=3){if(3===r.length){var s=[];for(e=0;e<3;e++)s.push(r[e].getGeometry().getCoordinates());this._addTriangle(s);this.hull=ol.coordinate.convexHull(s)}}else{var a=this.getFeaturesAtCoordinate(n)[0];if(a){this.removeFeature(a);a.set("del",!0);var l=a.getGeometry().getCoordinates()[0];for(e=0;e<3;e++)this._addTriangle([n,l[e],l[(e+1)%3]])}else{var c=this.hull.slice();for(c.push(n),c=ol.coordinate.convexHull(c),e=0;(o=c[e])&&!ol.coordinate.equal(o,n);e++);var h=c[e=0!==e?e-1:c.length-1],p=c[(e+2)%c.length];for(e=0;(o=this.hull[e])&&!ol.coordinate.equal(o,h);e++);for(;;){if(e>1e3){console.error("[DELAUNAY:addPoint] Too many iterations");break}if(e++,o=this.hull[e%this.hull.length],this._addTriangle([n,o,h]),h=o,o[0]===p[0]&&o[1]===p[1])break}this.hull=c}this.flipTriangles()}}else this._nodes.removeFeature(i)};ol.source.Delaunay.prototype.flipTriangles=function(){for(var t,e=1e3;this.flip.length;){if(e--<0){console.error("[DELAUNAY:flipTriangles] Too many iterations");break}var o=this.flip.pop();if(!o.get("del"))for(var i=o.getGeometry().getCoordinates()[0],r=0;r<3;r++){var n=[(i[(r+1)%3][0]+i[r][0])/2,(i[(r+1)%3][1]+i[r][1])/2],s=this.getTrianglesAt(n),a=null;if(s.length>1){var l=s[0].getGeometry().getCoordinates()[0],c=s[1].getGeometry().getCoordinates()[0];for(t=0;t<c.length;t++)if(!this._ptInTriangle(c[t],l)){a=c[t];break}}if(a&&this.inCircle(a,l)){var h;for(t=0;t<l.length;t++)if(!this._ptInTriangle(l[t],c)){h=l.splice(t,1)[0];break}if(this.intersectSegs([a,h],l)){for(;s.length;){var p=s.pop();p.set("del",!0);this.removeFeature(p)}this._addTriangle([a,h,l[0]]);this._addTriangle([a,h,l[1]])}}}}};ol.source.Delaunay.prototype.intersectSegs=function(t,e){var o=t[1][0]-t[0][0],i=t[1][1]-t[0][1],r=e[1][0]-e[0][0],n=o*(e[1][1]-e[0][1])-i*r;if(0!=n){var s=(o*t[0][1]-o*e[0][1]-i*t[0][0]+i*e[0][0])/n;return 0<s&&s<1}return!1};ol.source.Delaunay.prototype._ptInTriangle=function(t,e){for(var o,i=0;o=e[i];i++)if(ol.coordinate.equal(t,o))return!0;return!1};ol.source.Delaunay.prototype.listpt=function(t){for(var e,o="",i=0;e=t[i];i++){var r=this._nodes.getClosestFeatureToCoordinate(e);ol.coordinate.equal(r.getGeometry().getCoordinates(),e)||(r=null);o+=(o?", ":"")+(r?r.get("id"):"?")}return o};ol.source.Delaunay.prototype.inCircle=function(t,e){var o=this.getCircumCircle(e);return ol.coordinate.dist2d(t,o.center)<o.radius};ol.source.Delaunay.prototype.getCircumCircle=function(t){var e=t[0][0],o=t[0][1],i=t[1][0],r=t[1][1],n=t[2][0],s=t[2][1],a=(e-i)/(r-o),l=(e-n)/(s-o),c=(o+r)/2-a*(e+i)/2,h=((o+s)/2-l*(e+n)/2-c)/(a-l),p=[h,a*h+c];return{center:p,radius:ol.coordinate.dist2d(p,t[0])}};ol.source.Delaunay.prototype.getTrianglesAt=function(t){var e=ol.extent.buffer(ol.extent.boundingExtent([t]),this.get("epsilon")),o=[];return this.forEachFeatureIntersectingExtent(e,function(t){o.push(t)}),o};ol.source.Delaunay.prototype.getNodesAt=function(t){var e=ol.extent.buffer(ol.extent.boundingExtent([t]),this.get("epsilon"));return this._nodes.getFeaturesInExtent(e)};ol.source.FeatureBin=function(t){t=t||{};this._sourceFeature=new ol.source.Vector({features:t.features||[]});ol.source.BinBase.call(this,t)};ol.ext.inherits(ol.source.FeatureBin,ol.source.BinBase);ol.source.FeatureBin.prototype.setFeatures=function(t){this._sourceFeature.clear();this._sourceFeature.addFeatures(t||[]);this.reset()};ol.source.FeatureBin.prototype.getGridGeomAt=function(t,e){var o=this._sourceFeature.getFeaturesAtCoordinate(t)[0];if(!o)return null;var i=o.getProperties();for(var r in i)"geometry"!==r&&(e[r]=i[r]);return o.getGeometry()};ol.source.GeoImage=function(t){var e={attributions:t.attributions,logo:t.logo,projection:t.projection};this.center=t.imageCenter;this.scale=t.imageScale;this.rotate=t.imageRotate?t.imageRotate:0;this.crop=t.imageCrop;this.mask=t.imageMask;this._image=t.image?t.image:new Image;this._image.crossOrigin=t.crossOrigin;var o=this;this._image.onload=function(){o.setCrop(o.crop);o.changed()};t.image||(this._image.src=t.url);e.canvasFunction=function(t,e,o,i){var r=document.createElement("canvas");r.width=i[0];r.height=i[1];var n=r.getContext("2d");if(!this._imageSize)return r;function s(e){return[(e[0]-t[0])/(t[2]-t[0])*i[0],(e[1]-t[3])/(t[1]-t[3])*i[1]]}if(this.mask){n.beginPath();var a=s(this.mask[0]);n.moveTo(a[0],a[1]);for(var l=1;l<this.mask.length;l++)a=s(this.mask[l]),n.lineTo(a[0],a[1]);n.clip()}var c=s(this.center),h=(this._image.naturalWidth/2-this.crop[0])*this.scale[0]/e*o,p=(this._image.naturalHeight/2-this.crop[1])*this.scale[1]/e*o,u=this._imageSize[0]*this.scale[0]/e*o,g=this._imageSize[1]*this.scale[1]/e*o;return n.translate(c[0],c[1]),this.rotate&&n.rotate(this.rotate),n.drawImage(this._image,this.crop[0],this.crop[1],this._imageSize[0],this._imageSize[1],-h,-p,u,g),r};ol.source.ImageCanvas.call(this,e);this.setCrop(this.crop);this.on("change",function(){this.set("extent",this.calculateExtent())}.bind(this))};ol.ext.inherits(ol.source.GeoImage,ol.source.ImageCanvas);ol.source.GeoImage.prototype.getCenter=function(){return this.center};ol.source.GeoImage.prototype.setCenter=function(t){this.center=t;this.changed()};ol.source.GeoImage.prototype.getScale=function(){return this.scale};ol.source.GeoImage.prototype.setScale=function(t){switch(typeof t){case"number":t=[t,t];break;case"object":if(2!=t.length)return;break;default:return}this.scale=t;this.changed()};ol.source.GeoImage.prototype.getRotation=function(){return this.rotate};ol.source.GeoImage.prototype.setRotation=function(t){this.rotate=t;this.changed()};ol.source.GeoImage.prototype.getGeoImage=function(){return this._image};ol.source.GeoImage.prototype.getCrop=function(){return this.crop};ol.source.GeoImage.prototype.setMask=function(t){this.mask=t;this.changed()};ol.source.GeoImage.prototype.getMask=function(){return this.mask};ol.source.GeoImage.prototype.setCrop=function(t){if(this._image.naturalWidth){if(t){switch(typeof t){case"number":t=[t,t,this._image.naturalWidth-t,this._image.naturalHeight-t];break;case"object":if(4!=t.length)return;break;default:return}t=ol.extent.boundingExtent([[t[0],t[1]],[t[2],t[3]]]);this.crop=[Math.max(0,t[0]),Math.max(0,t[1]),Math.min(this._image.naturalWidth,t[2]),Math.min(this._image.naturalHeight,t[3])]}else this.crop=[0,0,this._image.naturalWidth,this._image.naturalHeight];this.crop[2]<=this.crop[0]&&(this.crop[2]=this.crop[0]+1);this.crop[3]<=this.crop[1]&&(this.crop[3]=this.crop[1]+1);this._imageSize=[this.crop[2]-this.crop[0],this.crop[3]-this.crop[1]];this.changed()}else this.crop=t};ol.source.GeoImage.prototype.getExtent=function(t){if(t){for(var e=this.get("extent"),o=0;o<t.length;o++)t[o]=e[o];return e}return this.get("extent")};ol.source.GeoImage.prototype.calculateExtent=function(t){var e;if(!1!==t&&this.getMask())e=new ol.geom.Polygon([this.getMask()]);else{var o=this.getCenter(),i=this.getScale(),r=this.getGeoImage().width*i[0],n=this.getGeoImage().height*i[1],s=ol.extent.boundingExtent([[o[0]-r/2,o[1]-n/2],[o[0]+r/2,o[1]+n/2]]);(e=ol.geom.Polygon.fromExtent(s)).rotate(-this.getRotation(),o)}return e.getExtent()};ol.source.GeoRSS=function(t){(t=t||{}).loader=this._loaderFn;ol.source.Vector.call(this,t)};ol.ext.inherits(ol.source.GeoRSS,ol.source.Vector);ol.source.GeoRSS.prototype._loaderFn=function(t,e,o){ol.ext.Ajax.get({url:this.getUrl(),dataType:"XML",error:function(){console.log("oops")},success:function(t){var e=(new ol.format.GeoRSS).readFeatures(t,{featureProjection:o});this.addFeatures(e)}.bind(this)})};ol.source.Geoportail=function(t,e){e=e||{};t.layer&&(t=(e=t).layer);for(var o=[],i=[],r=ol.extent.getWidth(ol.proj.get("EPSG:3857").getExtent())/256,n=0;n<=(e.maxZoom?e.maxZoom:20);n++)o[n]=n,i[n]=r/Math.pow(2,n);var s=new ol.tilegrid.WMTS({origin:[-20037508,20037508],resolutions:i,matrixIds:o});s.minZoom=e.minZoom?e.minZoom:0;var a=[ol.source.Geoportail.prototype.attribution];e.attributions&&(a=e.attributions);this._server=e.server||"https://wxs.ign.fr/geoportail/wmts";this._gppKey=e.gppKey||"choisirgeoportail";var l={url:this.serviceURL(),layer:t,matrixSet:"PM",format:e.format?e.format:"image/jpeg",projection:"EPSG:3857",tileGrid:s,style:e.style?e.style:"normal",attributions:a,crossOrigin:void 0===e.crossOrigin?"anonymous":e.crossOrigin,wrapX:!(!1===e.wrapX)};ol.source.WMTS.call(this,l);e.authentication&&this.setTileLoadFunction(ol.source.Geoportail.tileLoadFunctionWithAuthentication(e.authentication,this.getFormat()))};ol.ext.inherits(ol.source.Geoportail,ol.source.WMTS);ol.source.Geoportail.prototype.attribution='<a href="http://www.geoportail.gouv.fr/">Géoportail<\/a> &copy; <a href="http://www.ign.fr/">IGN-France<\/a>';ol.source.Geoportail.prototype.serviceURL=function(){return this._server?this._server.replace(/^(https?:\/\/[^\/]*)(.*)$/,"$1/"+this._gppKey+"$2"):(window.geoportailConfig?window.geoportailConfig.url:"https://wxs.ign.fr/")+this._gppKey+"/geoportail/wmts"};ol.source.Geoportail.prototype.getGPPKey=function(){return this._gppKey};ol.source.Geoportail.prototype.setGPPKey=function(t,e){this._gppKey=t;var o=this.serviceURL();this.setTileUrlFunction(function(){var t=ol.source.Geoportail.prototype.getTileUrlFunction().apply(this,arguments);if(t){var e=t.split("?");return o+"?"+e[1]}return t});e&&this.setTileLoadFunction(ol.source.Geoportail.tileLoadFunctionWithAuthentication(e,this.getFormat()))};ol.source.Geoportail.prototype.getFeatureInfoUrl=function(t,e,o,i){i=i||{};o||(o=this.getProjection());var r=this.tileGrid.getTileCoordForCoordAndResolution(t,e),n=this.getTileUrlFunction()(r,1,o);if(!n)return n;var s=this.tileGrid.getResolution(r[0]),a=this.tileGrid.getTileCoordExtent(r),l=Math.floor((t[0]-a[0])/(s/1)),c=Math.floor((a[3]-t[1])/(s/1));return n.replace(/Request=GetTile/i,"Request=getFeatureInfo")+"&INFOFORMAT="+(i.INFO_FORMAT||"text/plain")+"&I="+l+"&J="+c};ol.source.Geoportail.prototype.getFeatureInfo=function(t,e,o){var i=this.getFeatureInfoUrl(t,e,null,o);ol.ext.Ajax.get({url:i,dataType:o.format||"text/plain",options:{encode:!1},success:function(t){o.callback&&o.callback(t)},error:o.error||function(){}})};ol.source.Geoportail.tileLoadFunctionWithAuthentication=function(t,e){if(t)return function(o,i){var r=new XMLHttpRequest;r.open("GET",i);r.setRequestHeader("Authorization","Basic "+t);r.responseType="arraybuffer";r.onload=function(){var t=new Uint8Array(this.response),i=new Blob([t],{type:e}),r=(window.URL||window.webkitURL).createObjectURL(i);o.getImage().src=r};r.onerror=function(){o.getImage().src=""};r.send()}};ol.source.GridBin=function(t){t=t||{};ol.source.BinBase.call(this,t);this.set("gridProjection",t.gridProjection||"EPSG:4326");this.set("size",t.size||1)};ol.ext.inherits(ol.source.GridBin,ol.source.BinBase);ol.source.GridBin.prototype.setGridProjection=function(t){this.set("gridProjection",t);this.reset()};ol.source.GridBin.prototype.setSize=function(t){this.set("size",t);this.reset()};ol.source.GridBin.prototype.getGridGeomAt=function(t){t=ol.proj.transform(t,this.getProjection()||"EPSG:3857",this.get("gridProjection"));var e=this.get("size"),o=e*Math.floor(t[0]/e),i=e*Math.floor(t[1]/e);return new ol.geom.Polygon([[[o,i],[o+e,i],[o+e,i+e],[o,i+e],[o,i]]]).transform(this.get("gridProjection"),this.getProjection()||"EPSG:3857")};ol.source.HexBin=function(t){t=t||{};this._hexgrid=new ol.HexGrid(t);ol.source.BinBase.call(this,t)};ol.ext.inherits(ol.source.HexBin,ol.source.BinBase);ol.source.HexBin.prototype.getGridGeomAt=function(t){var e=this._hexgrid.coord2hex(t);return new ol.geom.Polygon([this._hexgrid.getHexagon(e)])};ol.source.HexBin.prototype.setSize=function(t,e){this._hexgrid.setSize(t);e||this.reset()};ol.source.HexBin.prototype.getSize=function(){return this._hexgrid.getSize()};ol.source.HexBin.prototype.setLayout=function(t,e){this._hexgrid.setLayout(t);e||this.reset()};ol.source.HexBin.prototype.getLayout=function(){return this._hexgrid.getLayout()};ol.source.HexBin.prototype.setOrigin=function(t,e){this._hexgrid.setOrigin(t);e||this.reset()};ol.source.HexBin.prototype.getOrigin=function(){return this._hexgrid.getOrigin()};ol.source.HexBin.prototype.getHexFeatures=function(){return ol.source.BinBase.prototype.getGridFeatures.call(this)};ol.source.InseeBin=function(t){t=t||{};this._grid=new ol.InseeGrid({size:t.size});ol.source.BinBase.call(this,t)};ol.ext.inherits(ol.source.InseeBin,ol.source.BinBase);ol.source.InseeBin.prototype.setSize=function(t){this.getSize()!==t&&(this._grid.set("size",t),this.reset())};ol.source.InseeBin.prototype.getSize=function(){return this._grid.get("size")};ol.source.InseeBin.prototype.getGridGeomAt=function(t){return this._grid.getGridAtCoordinate(t,this.getProjection())};ol.source.InseeBin.prototype.getGridExtent=function(t){return this._grid.getExtent(t)};ol.source.Mapillary=function(t){var e=t||{};e.loader=this._loaderFn;this._maxResolution=e.maxResolution||100;this._limit=e.limit||100;e.attributions||(e.attributions=["&copy; <a href='https://www.mapillary.com/'>Mapillary<\/a>"]);e.strategy||(e.strategy=ol.loadingstrategy.bbox);ol.source.Vector.call(this,e)};ol.ext.inherits(ol.source.Mapillary,ol.source.Vector);ol.source.Mapillary.prototype.readFeature=function(){return!0};ol.source.Mapillary.prototype._loaderFn=function(t,e,o){if(!(e>this._maxResolution)){var i=ol.proj.transformExtent(t,o,"EPSG:4326"),r=Date.now()-15552e6,n="https://a.mapillary.com/v2/search/im?client_id="+this.get("clientId")+"&max_lat="+i[3]+"&max_lon="+i[2]+"&min_lat="+i[1]+"&min_lon="+i[0]+"&limit="+(this._limit-1)+"&start_time="+r;ol.ext.Ajax.get({url:n,dataType:"jsonp",success:function(t){console.log(t)}})}};ol.source.Overpass=function(t){(t=t||{}).loader=this._loaderFn;this._url=t.url||"https://overpass-api.de/api/interpreter";this._maxResolution=t.maxResolution||100;t.attributions||(t.attributions=ol.source.OSM.ATTRIBUTION);t.strategy||(t.strategy=ol.loadingstrategy.bbox);ol.source.Vector.call(this,t);this._types={node:!1!==t.node,way:!1!==t.way,rel:!0===t.rel};this._filter=t.filter};ol.ext.inherits(ol.source.Overpass,ol.source.Vector);ol.source.Overpass.prototype._loaderFn=function(t,e,o){if(!(e>this._maxResolution)){var i=this,r=ol.proj.transformExtent(t,o,"EPSG:4326"),n="[bbox:"+(r=r[1]+","+r[0]+","+r[3]+","+r[2])+"][out:xml][timeout:25];";for(var s in n+="(",this._types)if(this._types[s]){n+=s;for(var a,l=0;a=this._filter[l];l++)n+="["+a+"]";n+=";"}n+=");out;>;out skel qt;";var c=new XMLHttpRequest;c.open("POST",this._url,!0);c.onload=function(){for(var t,e=(new ol.format.OSMXML).readFeatures(this.responseText,{featureProjection:o}),r=[],n=0;t=e[n];n++)i.hasFeature(t)||r.push(t);i.addFeatures(r)};c.onerror=function(){console.log(arguments)};c.send("data="+n)}};ol.source.Overpass.prototype.hasFeature=function(t){for(var e,o=t.getGeometry().getFirstCoordinate(),i=t.getId(),r=this.getFeaturesInExtent([o[0]-.1,o[1]-.1,o[0]+.1,o[1]+.1]),n=0;e=r[n];n++)if(i===e.getId())return!0;return!1},function(){var t=ol.source.Vector.prototype.clear;ol.source.Vector.prototype.clear=function(e){this.dispatchEvent({type:"clearstart"});t.call(this,e);this.dispatchEvent({type:"clearend"})}}();ol.layer.Vector3D=function(t){t=t||{};this._source=t.source;this.height_=this.getHfn(t.height);var e=document.createElement("canvas");ol.layer.Image.call(this,{source:new ol.source.ImageCanvas({canvasFunction:function(t,o,i,r){return e.width=r[0],e.height=r[1],e}}),center:t.center||[.5,1],defaultHeight:t.defaultHeight||0,maxResolution:t.maxResolution||1/0});this.setStyle(t.style);this.on(["postcompose","postrender"],this.onPostcompose_.bind(this))};ol.ext.inherits(ol.layer.Vector3D,ol.layer.Image);ol.layer.Vector3D.prototype.setHeight=function(t){this.height_=this.getHfn(t);this.changed()};ol.layer.Vector3D.prototype.setStyle=function(t){if(this._style=t instanceof ol.style.Style?t:new ol.style.Style,this._style.getStroke()||this._style.setStroke(new ol.style.Stroke({width:1,color:"red"})),this._style.getFill()||this._style.setFill(new ol.style.Fill({color:"rgba(0,0,255,0.5)"})),this._style.getText()||this._style.setText(new ol.style.Fill({color:"red"})),t&&t.getGeometry()){var e=t.getGeometry();"function"==typeof e?this.set("geometry",e):this.set("geometry",function(){return e})}else this.set("geometry",function(t){return t.getGeometry()})};ol.layer.Vector3D.prototype.getStyle=function(){return this._style};ol.layer.Vector3D.prototype.onPostcompose_=function(t){var e=t.frameState.viewState.resolution;if(!(e>this.get("maxResolution"))){if(this.res_=400*e,this.animate_){var o=t.frameState.time-this.animate_;o<this.animateDuration_?(this.elapsedRatio_=this.easing_(o/this.animateDuration_),t.frameState.animate=!0):(this.animate_=!1,this.height_=this.toHeight_)}var i=t.frameState.pixelRatio,r=t.context,n=this.matrix_=t.frameState.coordinateToPixelTransform;n||((n=t.frameState.coordinateToPixelMatrix)[2]=n[4],n[3]=n[5],n[4]=n[12],n[5]=n[13]);this.center_=[r.canvas.width*this.get("center")[0]/i,r.canvas.height*this.get("center")[1]/i];var s=this._source.getFeaturesInExtent(t.frameState.extent);r.save();r.scale(i,i);var a=this.getStyle();r.lineWidth=a.getStroke().getWidth();r.lineCap=a.getStroke().getLineCap();r.strokeStyle=ol.color.asString(a.getStroke().getColor());r.fillStyle=ol.color.asString(a.getFill().getColor());for(var l=[],c=0;c<s.length;c++)l.push(this.getFeature3D_(s[c],this._getFeatureHeight(s[c])));this.drawFeature3D_(r,l);r.restore()}};ol.layer.Vector3D.prototype.getHfn=function(t){switch(typeof t){case"function":return t;case"string":var e=this.get("defaultHeight");return function(o){return Number(o.get(t))||e};case"number":return function(){return t};default:return function(){return 10}}};ol.layer.Vector3D.prototype.animate=function(t){t=t||{};this.toHeight_=this.getHfn(t.height);this.animate_=(new Date).getTime();this.animateDuration_=t.duration||1e3;this.easing_=t.easing||ol.easing.easeOut;this.changed()};ol.layer.Vector3D.prototype.animating=function(){return this.animate_&&(new Date).getTime()-this.animate_>this.animateDuration_&&(this.animate_=!1),!!this.animate_};ol.layer.Vector3D.prototype._getFeatureHeight=function(t){if(this.animate_){var e=this.height_(t),o=this.toHeight_(t);return e*(1-this.elapsedRatio_)+this.elapsedRatio_*o}return this.height_(t)};ol.layer.Vector3D.prototype.hvector_=function(t,e){var o=[t[0]*this.matrix_[0]+t[1]*this.matrix_[1]+this.matrix_[4],t[0]*this.matrix_[2]+t[1]*this.matrix_[3]+this.matrix_[5]];return{p0:o,p1:[o[0]+e/this.res_*(o[0]-this.center_[0]),o[1]+e/this.res_*(o[1]-this.center_[1])]}};ol.layer.Vector3D.prototype.getFeature3D_=function(t,e){var o=this.get("geometry")(t),i=o.getCoordinates();switch(o.getType()){case"Polygon":i=[i];case"MultiPolygon":for(var r=[],n=0;n<i.length;n++)for(var s=0;s<i[n].length;s++){for(var a=[],l=0;l<i[n][s].length;l++)a.push(this.hvector_(i[n][s][l],e));r.push(a)}return{type:"MultiPolygon",feature:t,geom:r};case"Point":return{type:"Point",feature:t,geom:this.hvector_(i,e)};default:return{}}};ol.layer.Vector3D.prototype.drawFeature3D_=function(t,e){for(var i,r,n,o=0;o<e.length;o++)switch(e[o].type){case"MultiPolygon":for(i=0;i<e[o].geom.length;i++)for(r=e[o].geom[i],n=0;n<r.length;n++)t.beginPath(),t.moveTo(r[n].p0[0],r[n].p0[1]),t.lineTo(r[n].p1[0],r[n].p1[1]),t.stroke();break;case"Point":var s=e[o].geom;t.beginPath();t.moveTo(s.p0[0],s.p0[1]);t.lineTo(s.p1[0],s.p1[1]);t.stroke()}for(o=0;o<e.length;o++)switch(e[o].type){case"MultiPolygon":for(t.beginPath(),i=0;i<e[o].geom.length;i++){if(r=e[o].geom[i],0==i)for(t.moveTo(r[0].p1[0],r[0].p1[1]),n=1;n<r.length;n++)t.lineTo(r[n].p1[0],r[n].p1[1]);else for(t.moveTo(r[0].p1[0],r[0].p1[1]),n=r.length-2;n>=0;n--)t.lineTo(r[n].p1[0],r[n].p1[1]);t.closePath()}t.fill("evenodd");t.stroke();break;case"Point":var a=(r=e[o]).feature.get("label");if(a){var l=r.geom.p1,c=t.measureText(a),h=Number(t.font.match(/\d+(\.\d+)?/g).join([]));t.fillRect(l[0]-c.width/2-5,l[1]-h-5,c.width+10,h+10);t.strokeRect(l[0]-c.width/2-5,l[1]-h-5,c.width+10,h+10);t.save();t.fillStyle=ol.color.asString(this._style.getText().getFill().getColor());t.textAlign="center";t.textBaseline="bottom";t.fillText(a,l[0],l[1]);t.restore()}}};ol.source.WikiCommons=function(t){var e=t||{};e.loader=this._loaderFn;this._maxResolution=e.maxResolution||100;this._lang=e.lang||"fr";this._limit=e.limit||100;e.attributions||(e.attributions=["&copy; <a href='https://commons.wikimedia.org/'>Wikimedia Commons<\/a>"]);e.strategy||(e.strategy=ol.loadingstrategy.bbox);ol.source.Vector.call(this,e)};ol.ext.inherits(ol.source.WikiCommons,ol.source.Vector);ol.source.WikiCommons.prototype.readFeature=function(t,e){return t.set("descriptionurl",e.descriptionurl),t.set("url",e.url),t.set("title",e.title.replace(/^file:|.jpg$/gi,"")),t.set("thumbnail",e.url.replace(/^(.+wikipedia\/commons)\/([a-zA-Z0-9]\/[a-zA-Z0-9]{2})\/(.+)$/,"$1/thumb/$2/$3/200px-$3")),t.set("user",e.user),e.extmetadata&&e.extmetadata.LicenseShortName&&t.set("copy",e.extmetadata.LicenseShortName.value),!0};ol.source.WikiCommons.prototype._loaderFn=function(t,e,o){if(!(e>this._maxResolution)){var i=this,r=ol.proj.transformExtent(t,o,"EPSG:4326"),n="https://commons.wikimedia.org/w/api.php?action=query&format=json&origin=*&prop=coordinates|imageinfo&generator=geosearch&iiprop=timestamp|user|url|extmetadata|metadata|size&iiextmetadatafilter=LicenseShortName&ggsbbox="+r[3]+"|"+r[0]+"|"+r[1]+"|"+r[2]+"&ggslimit="+this._limit+"&iilimit="+(this._limit-1)+"&ggsnamespace=6";ol.ext.Ajax.get({url:n,success:function(t){var e,r,n,s=[];if(t.query&&t.query.pages){for(var a in t.query.pages){if((e=t.query.pages[a]).coordinates&&e.coordinates.length)r=[e.coordinates[0].lon,e.coordinates[0].lat];else{var l=e.imageinfo[0].metadata;if(!l)continue;r=[];for(var c=0,h=0;h<l.length;h++)"GPSLongitude"==l[h].name&&(r[0]=l[h].value,c++),"GPSLatitude"==l[h].name&&(r[1]=l[h].value,c++);if(2!=c)continue}n=new ol.Feature(new ol.geom.Point(ol.proj.transform(r,"EPSG:4326",o)));e.imageinfo[0].title=e.title;i.readFeature(n,e.imageinfo[0])&&s.push(n)}i.addFeatures(s)}}})}};ol.layer.AnimatedCluster=function(t){var e=t||{};ol.layer.Vector.call(this,e);this.oldcluster=new ol.source.Vector;this.clusters=[];this.animation={start:!1};this.set("animationDuration","number"==typeof e.animationDuration?e.animationDuration:700);this.set("animationMethod",e.animationMethod||ol.easing.easeOut);this.getSource().on("change",this.saveCluster.bind(this));this.on(["precompose","prerender"],this.animate.bind(this));this.on(["postcompose","postrender"],this.postanimate.bind(this))};ol.ext.inherits(ol.layer.AnimatedCluster,ol.layer.Vector);ol.layer.AnimatedCluster.prototype.saveCluster=function(){if(this.oldcluster){if(this.oldcluster.clear(),!this.get("animationDuration"))return;var t=this.getSource().getFeatures();t.length&&t[0].get("features")&&(this.oldcluster.addFeatures(this.clusters),this.clusters=t.slice(0),this.sourceChanged=!0)}};ol.layer.AnimatedCluster.prototype.getClusterForFeature=function(t,e){for(var o,i=0;o=e[i];i++){var r=o.get("features");if(r&&r.length)for(var n,s=0;n=r[s];s++)if(t===n)return o}return!1};ol.layer.AnimatedCluster.prototype.stopAnimation=function(){this.animation.start=!1;this.animation.cA=[];this.animation.cB=[]};ol.layer.AnimatedCluster.prototype.animate=function(t){var e=this.get("animationDuration");if(e){var o,i,r=t.frameState.viewState.resolution,n=this.animation,s=t.frameState.time;if(n.resolution!=r&&this.sourceChanged){var a=t.frameState.extent;for(n.resolution<r?(a=ol.extent.buffer(a,100*r),n.cA=this.oldcluster.getFeaturesInExtent(a),n.cB=this.getSource().getFeaturesInExtent(a),n.revers=!1):(a=ol.extent.buffer(a,100*r),n.cA=this.getSource().getFeaturesInExtent(a),n.cB=this.oldcluster.getFeaturesInExtent(a),n.revers=!0),n.clusters=[],o=0;i=n.cA[o];o++){var l=i.get("features");if(l&&l.length){var c=this.getClusterForFeature(l[0],n.cB);c&&n.clusters.push({f:i,pt:c.getGeometry().getCoordinates()})}}if(n.resolution=r,this.sourceChanged=!1,!n.clusters.length||n.clusters.length>1e3)return void this.stopAnimation();s=n.start=(new Date).getTime()}if(n.start){var h=t.vectorContext||ol.render.getVectorContext(t),p=(s-n.start)/e;p>1&&(this.stopAnimation(),p=1);p=this.get("animationMethod")(p);var u=this.getStyle(),g="function"==typeof u?u:u.length?function(){return u}:function(){return[u]};for(t.context.save(),t.context.globalAlpha=this.getOpacity(),o=0;c=n.clusters[o];o++){var d=c.f.getGeometry().getCoordinates(),m=d[0]-c.pt[0],f=d[1]-c.pt[1];n.revers?(d[0]=c.pt[0]+p*m,d[1]=c.pt[1]+p*f):(d[0]=d[0]-p*m,d[1]=d[1]-p*f);var y=g(c.f,r,!0);if(y.length||(y=[y]),1!==c.f.get("features").length||m||f){var v=new ol.geom.Point(d);l=new ol.Feature(v)}else l=c.f.get("features")[0];for(var _,x=0;_=y[x];x++)if(_.getText()&&/\n/.test(_.getText().getText())){var w,S=_.getText().getOffsetX(),b=_.getText().getOffsetY(),C=_.getText().getRotation()||0,M=1.2*Number((_.getText().getFont()||"10px").match(/\d+/)),E=_.getText().getText().split("\n"),T=E.length-1,L=_.clone();E.forEach(function(t,e){switch(1==e&&(L.setImage(),L.setFill(),L.setStroke()),_.getText().getTextBaseline()){case"alphabetic":case"ideographic":case"bottom":w=T;break;case"hanging":case"top":w=0;break;default:w=T/2}L.getText().setOffsetX(S-Math.sin(C)*M*(e-w));L.getText().setOffsetY(b+Math.cos(C)*M*(e-w));L.getText().setText(t);h.drawFeature(l,L)})}else h.drawFeature(l,_)}t.context.restore();t.frameState.animate=!0;t.context.save();t.context.beginPath();t.context.rect(0,0,0,0);t.context.clip();this.clip_=!0}}};ol.layer.AnimatedCluster.prototype.postanimate=function(t){this.clip_&&(t.context.restore(),this.clip_=!1)};ol.layer.GeoImage=function(t){ol.layer.Image.call(this,t)};ol.ext.inherits(ol.layer.GeoImage,ol.layer.Image);ol.layer.GeoImage.prototype.getExtent=function(){return this.getSource().getExtent()};ol.layer.Geoportail=function(t,e,o){e=e||{};o=o||{};t.layer&&(o=e=t,t=e.layer);var i=e.maxZoom,r=window.geoportailConfig&&(window.geoportailConfig.capabilities[e.gppKey||e.key]||window.geoportailConfig.capabilities.default)||ol.layer.Geoportail.capabilities;for(var n in(r=r[t])||(r={title:t,originators:[]},console.error('ol.layer.Geoportail: no layer definition for "'+t+'"\nTry to use ol/layer/Geoportail~loadCapabilities() to get it.')),r)void 0===o[n]&&(o[n]=r[n]);this._originators=r.originators;o.gppKey||(o.gppKey=e.gppKey||e.key);e.source=new ol.source.Geoportail(t,o);e.title||(e.title=r.title);e.name||(e.name=t);e.layer=t;e.queryable||(e.queryable=r.queryable);e.desc||(e.desc=r.desc);!e.extent&&r.bbox&&r.bbox[0]>-170&&r.bbox[2]<170&&(e.extent=ol.proj.transformExtent(r.bbox,"EPSG:4326","EPSG:3857"));e.maxZoom=i;!e.maxResolution&&o.minZoom&&(e.source.getTileGrid().minZoom-=o.minZoom>1?2:1,e.maxResolution=e.source.getTileGrid().getResolution(e.source.getTileGrid().minZoom),e.source.getTileGrid().minZoom=o.minZoom);ol.layer.Tile.call(this,e)};ol.ext.inherits(ol.layer.Geoportail,ol.layer.Tile);ol.layer.Geoportail.capabilities={"GEOGRAPHICALGRIDSYSTEMS.MAPS.SCAN-EXPRESS.STANDARD":{server:"https://wxs.ign.fr/geoportail/wmts",layer:"GEOGRAPHICALGRIDSYSTEMS.MAPS.SCAN-EXPRESS.STANDARD",title:"Carte IGN",format:"image/jpeg",style:"normal",queryable:!1,tilematrix:"PM",minZoom:0,maxZoom:18,bbox:[-179.62723,-84.5047,179.74588,85.47958],desc:"Cartographie topographique multi-échelles du territoire français issue des bases de données vecteur de l’IGN - emprise nationale, visible du 1/200 au 1/130000000",originators:{IGN:{href:"http://www.ign.fr",attribution:"Institut national de l'information géographique et forestière",logo:"https://wxs.ign.fr/static/logos/IGN/IGN.gif",minZoom:0,maxZoom:18,constraint:[{minZoom:13,maxZoom:13,bbox:[-63.37252,13.428586,11.429714,51.44377]},{minZoom:11,maxZoom:12,bbox:[-63.37252,13.428586,11.496459,51.444122]},{minZoom:9,maxZoom:9,bbox:[-64.81273,13.428586,11.496459,51.444016]},{minZoom:10,maxZoom:10,bbox:[-63.37252,13.428586,11.496459,51.444016]},{minZoom:0,maxZoom:2,bbox:[-175.99709,-84.42859,175.99709,84.2865]},{minZoom:4,maxZoom:4,bbox:[-179.62723,-84.0159,-179.21112,85.47958]},{minZoom:18,maxZoom:18,bbox:[-63.189068,-21.428364,55.846638,51.175068]},{minZoom:15,maxZoom:17,bbox:[-63.189117,-21.428364,55.84698,51.175068]},{minZoom:14,maxZoom:14,bbox:[-63.283817,-21.7006,56.039127,51.44377]},{minZoom:6,maxZoom:8,bbox:[-179.49689,-84.02368,179.74588,85.30035]},{minZoom:3,maxZoom:3,bbox:[-176.23093,-84.5047,179.08267,84.89126]},{minZoom:5,maxZoom:5,bbox:[-179.57285,-83.84196,178.4975,85.36646]}]}}},"ELEVATION.SLOPES":{server:"https://wxs.ign.fr/geoportail/wmts",layer:"ELEVATION.SLOPES",title:"Altitude",format:"image/jpeg",style:"normal",queryable:!0,tilematrix:"PM",minZoom:6,maxZoom:14,bbox:[-178.20589,-22.595179,167.43176,50.93085],desc:"La couche altitude se compose d'un MNT (Modèle Numérique de Terrain) affiché en teintes hypsométriques et issu de la BD ALTI®.",originators:{IGN:{href:"http://www.ign.fr",attribution:"Institut national de l'information géographique et forestière",logo:"https://wxs.ign.fr/static/logos/IGN/IGN.gif",minZoom:6,maxZoom:14,constraint:[{minZoom:6,maxZoom:14,bbox:[55.205746,-21.392344,55.846554,-20.86271]}]}}},"GEOGRAPHICALGRIDSYSTEMS.MAPS.BDUNI.J1":{server:"https://wxs.ign.fr/geoportail/wmts",layer:"GEOGRAPHICALGRIDSYSTEMS.MAPS.BDUNI.J1",title:"Plan IGN j+1",format:"image/png",style:"normal",queryable:!1,tilematrix:"PM",minZoom:0,maxZoom:18,bbox:[-179.5,-75,179.5,75],desc:"Plan IGN j+1",originators:{IGN:{href:"http://www.ign.fr",attribution:"Institut national de l'information géographique et forestière",logo:"https://wxs.ign.fr/static/logos/IGN/IGN.gif",minZoom:0,maxZoom:18,constraint:[{minZoom:0,maxZoom:18,bbox:[-179,-80,179,80]}]}}},"CADASTRALPARCELS.PARCELS":{server:"https://wxs.ign.fr/geoportail/wmts",layer:"CADASTRALPARCELS.PARCELS",title:"Parcelles cadastrales",format:"image/png",style:"bdparcellaire",queryable:!1,tilematrix:"PM",minZoom:0,maxZoom:20,bbox:[-63.160706,-21.39223,55.84643,51.090965],desc:"Limites des parcelles cadastrales issues de plans scannés et de plans numériques.",originators:{IGN:{href:"http://www.ign.fr",attribution:"Institut national de l'information géographique et forestière",logo:"https://wxs.ign.fr/static/logos/IGN/IGN.gif",minZoom:0,maxZoom:20,constraint:[{minZoom:0,maxZoom:20,bbox:[-63.160706,-21.39223,55.84643,51.090965]}]}}},"ORTHOIMAGERY.ORTHOPHOTOS":{server:"https://wxs.ign.fr/geoportail/wmts",layer:"ORTHOIMAGERY.ORTHOPHOTOS",title:"Photographies aériennes",format:"image/jpeg",style:"normal",queryable:!0,tilematrix:"PM",minZoom:0,bbox:[-180,-86,180,84],desc:"Photographies aériennes",originators:{PLANETOBSERVER:{href:"http://www.planetobserver.com/",attribution:"PlanetObserver (images satellites)",logo:"https://wxs.ign.fr/static/logos/PLANETOBSERVER/PLANETOBSERVER.gif",minZoom:0,maxZoom:12,constraint:[{minZoom:0,maxZoom:12,bbox:[-180,-86,180,84]}]},MPM:{href:"http://www.marseille-provence.com/",attribution:"Marseille Provence Métropole",logo:"https://wxs.ign.fr/static/logos/MPM/MPM.gif",minZoom:20,maxZoom:20,constraint:[{minZoom:20,maxZoom:20,bbox:[5.076959,43.153347,5.7168245,43.454994]}]},IGN:{href:"http://www.ign.fr",attribution:"Institut national de l'information géographique et forestière",logo:"https://wxs.ign.fr/static/logos/IGN/IGN.gif",minZoom:13,maxZoom:20,constraint:[{bbox:[.035491213,43.221077,6.0235267,49.696926]},{minZoom:20,maxZoom:20,bbox:[.035491213,43.221077,6.0235267,49.696926]},{minZoom:13,maxZoom:19,bbox:[-179.5,-75,179.5,75]}]},CRAIG:{href:"http://www.craig.fr",attribution:"Centre Régional Auvergnat de l'Information Géographique (CRAIG)",logo:"https://wxs.ign.fr/static/logos/CRAIG/CRAIG.gif",minZoom:13,maxZoom:20,constraint:[{minZoom:20,maxZoom:20,bbox:[2.2243388,44.76621,2.7314367,45.11295]},{minZoom:13,maxZoom:19,bbox:[-179.5,-75,179.5,75]}]},CNES:{href:"http://www.cnes.fr/",attribution:"Centre national d'études spatiales (CNES)",logo:"https://wxs.ign.fr/static/logos/CNES/CNES.gif",minZoom:13,maxZoom:19,constraint:[{minZoom:13,maxZoom:19,bbox:[-179.5,-75,179.5,75]}]},CG06:{href:"http://www.cg06.fr",attribution:"Département Alpes Maritimes (06) en partenariat avec : Groupement Orthophoto 06 (NCA, Ville de Cannes, CARF, CASA,CG06, CA de Grasse) ",logo:"https://wxs.ign.fr/static/logos/CG06/CG06.gif",minZoom:13,maxZoom:19,constraint:[{minZoom:13,maxZoom:19,bbox:[-179.5,-75,179.5,75]}]},CG45:{href:"http://www.loiret.com",attribution:"Le conseil général du Loiret",logo:"https://wxs.ign.fr/static/logos/CG45/CG45.gif",minZoom:13,maxZoom:19,constraint:[{minZoom:13,maxZoom:19,bbox:[-179.5,-75,179.5,75]}]},RGD_SAVOIE:{href:"http://www.rgd.fr",attribution:"Régie de Gestion de Données des Pays de Savoie (RGD 73-74)",logo:"https://wxs.ign.fr/static/logos/RGD_SAVOIE/RGD_SAVOIE.gif",minZoom:13,maxZoom:19,constraint:[{minZoom:13,maxZoom:19,bbox:[-179.5,-75,179.5,75]}]},"e-Megalis":{href:"http://www.e-megalisbretagne.org//",attribution:"Syndicat mixte de coopération territoriale (e-Megalis)",logo:"https://wxs.ign.fr/static/logos/e-Megalis/e-Megalis.gif",minZoom:13,maxZoom:19,constraint:[{minZoom:13,maxZoom:19,bbox:[-179.5,-75,179.5,75]}]},SIGLR:{href:"http://www.siglr.org//",attribution:"SIGLR",logo:"https://wxs.ign.fr/static/logos/SIGLR/SIGLR.gif",minZoom:13,maxZoom:19,constraint:[{minZoom:13,maxZoom:19,bbox:[-179.5,-75,179.5,75]}]},PPIGE:{href:"http://www.ppige-npdc.fr/",attribution:"PPIGE",logo:"https://wxs.ign.fr/static/logos/PPIGE/PPIGE.gif",minZoom:13,maxZoom:19,constraint:[{minZoom:13,maxZoom:19,bbox:[-179.5,-75,179.5,75]}]},FEDER2:{href:"http://www.europe-en-france.gouv.fr/",attribution:"Fonds européen de développement économique et régional",logo:"https://wxs.ign.fr/static/logos/FEDER2/FEDER2.gif",minZoom:13,maxZoom:19,constraint:[{minZoom:13,maxZoom:19,bbox:[-179.5,-75,179.5,75]}]},FEDER:{href:"http://www.europe-en-france.gouv.fr/",attribution:"Fonds européen de développement économique et régional",logo:"https://wxs.ign.fr/static/logos/FEDER/FEDER.gif",minZoom:13,maxZoom:19,constraint:[{minZoom:13,maxZoom:19,bbox:[-179.5,-75,179.5,75]}]},CRCORSE:{href:"http://www.corse.fr//",attribution:"CRCORSE",logo:"https://wxs.ign.fr/static/logos/CRCORSE/CRCORSE.gif",minZoom:13,maxZoom:19,constraint:[{minZoom:13,maxZoom:19,bbox:[-179.5,-75,179.5,75]}]},CNES_AUVERGNE:{href:"http://www.cnes.fr/",attribution:"Centre national d'études spatiales (CNES)",logo:"https://wxs.ign.fr/static/logos/CNES_AUVERGNE/CNES_AUVERGNE.gif",minZoom:13,maxZoom:19,constraint:[{minZoom:13,maxZoom:19,bbox:[-179.5,-75,179.5,75]}]},FEDER_PAYSDELALOIRE:{href:"http://www.europe-en-paysdelaloire.eu/",attribution:"Pays-de-la-Loire",logo:"https://wxs.ign.fr/static/logos/FEDER_PAYSDELALOIRE/FEDER_PAYSDELALOIRE.gif",minZoom:13,maxZoom:19,constraint:[{minZoom:13,maxZoom:19,bbox:[-179.5,-75,179.5,75]}]},FEDER_AUVERGNE:{href:"http://www.europe-en-auvergne.eu/",attribution:"Auvergne",logo:"https://wxs.ign.fr/static/logos/FEDER_AUVERGNE/FEDER_AUVERGNE.gif",minZoom:13,maxZoom:19,constraint:[{minZoom:13,maxZoom:19,bbox:[-179.5,-75,179.5,75]}]},PREFECTURE_GUADELOUPE:{href:"www.guadeloupe.pref.gouv.fr/",attribution:"guadeloupe",logo:"https://wxs.ign.fr/static/logos/PREFECTURE_GUADELOUPE/PREFECTURE_GUADELOUPE.gif",minZoom:13,maxZoom:19,constraint:[{minZoom:13,maxZoom:19,bbox:[-179.5,-75,179.5,75]}]},"BOURGOGNE-FRANCHE-COMTE":{href:"https://www.bourgognefranchecomte.fr/",attribution:"Auvergne",logo:"https://wxs.ign.fr/static/logos/BOURGOGNE-FRANCHE-COMTE/BOURGOGNE-FRANCHE-COMTE.gif",minZoom:13,maxZoom:19,constraint:[{minZoom:13,maxZoom:19,bbox:[-179.5,-75,179.5,75]}]},ASTRIUM:{href:"http://www.geo-airbusds.com/",attribution:"Airbus Defence and Space",logo:"https://wxs.ign.fr/static/logos/ASTRIUM/ASTRIUM.gif",minZoom:13,maxZoom:16,constraint:[{minZoom:13,maxZoom:16,bbox:[-55.01953,1.845384,-50.88867,6.053161]}]},DITTT:{href:"http://www.dittt.gouv.nc/portal/page/portal/dittt/",attribution:"Direction des Infrastructures, de la Topographie et des Transports Terrestres",logo:"https://wxs.ign.fr/static/logos/DITTT/DITTT.gif",minZoom:13,maxZoom:18,constraint:[{minZoom:13,maxZoom:18,bbox:[163.47784,-22.767689,167.94624,-19.434975]}]},CNES_ALSACE:{href:"http://www.cnes.fr/",attribution:"Centre national d'études spatiales (CNES)",logo:"https://wxs.ign.fr/static/logos/CNES_ALSACE/CNES_ALSACE.gif",minZoom:13,maxZoom:18,constraint:[{minZoom:13,maxZoom:18,bbox:[-179.5,-75,179.5,75]}]},CNES_971:{href:"http://www.cnes.fr/",attribution:"Centre national d'études spatiales (CNES)",logo:"https://wxs.ign.fr/static/logos/CNES_971/CNES_971.gif",minZoom:13,maxZoom:18,constraint:[{minZoom:13,maxZoom:18,bbox:[-179.5,-75,179.5,75]}]},CNES_972:{href:"http://www.cnes.fr/",attribution:"Centre national d'études spatiales (CNES)",logo:"https://wxs.ign.fr/static/logos/CNES_972/CNES_972.gif",minZoom:13,maxZoom:18,constraint:[{minZoom:13,maxZoom:18,bbox:[-179.5,-75,179.5,75]}]},CNES_974:{href:"http://www.cnes.fr/",attribution:"Centre national d'études spatiales (CNES)",logo:"https://wxs.ign.fr/static/logos/CNES_974/CNES_974.gif",minZoom:13,maxZoom:18,constraint:[{minZoom:13,maxZoom:18,bbox:[-179.5,-75,179.5,75]}]},CNES_975:{href:"http://www.cnes.fr/",attribution:"Centre national d'études spatiales (CNES)",logo:"https://wxs.ign.fr/static/logos/CNES_975/CNES_975.gif",minZoom:13,maxZoom:18,constraint:[{minZoom:13,maxZoom:18,bbox:[-179.5,-75,179.5,75]}]},CNES_976:{href:"http://www.cnes.fr/",attribution:"Centre national d'études spatiales (CNES)",logo:"https://wxs.ign.fr/static/logos/CNES_976/CNES_976.gif",minZoom:13,maxZoom:18,constraint:[{minZoom:13,maxZoom:18,bbox:[-179.5,-75,179.5,75]}]},CNES_977:{href:"http://www.cnes.fr/",attribution:"Centre national d'études spatiales (CNES)",logo:"https://wxs.ign.fr/static/logos/CNES_977/CNES_977.gif",minZoom:13,maxZoom:18,constraint:[{minZoom:13,maxZoom:18,bbox:[-179.5,-75,179.5,75]}]},CNES_978:{href:"http://www.cnes.fr/",attribution:"Centre national d'études spatiales (CNES)",logo:"https://wxs.ign.fr/static/logos/CNES_978/CNES_978.gif",minZoom:13,maxZoom:18,constraint:[{minZoom:13,maxZoom:18,bbox:[-179.5,-75,179.5,75]}]}}},"GEOGRAPHICALGRIDSYSTEMS.PLANIGN":{server:"https://wxs.ign.fr/geoportail/wmts",layer:"GEOGRAPHICALGRIDSYSTEMS.PLANIGN",title:"Plan IGN",format:"image/jpeg",style:"normal",queryable:!1,tilematrix:"PM",minZoom:0,maxZoom:18,bbox:[-179.5,-75,179.5,75],desc:"Représentation graphique des bases de données IGN.",originators:{IGN:{href:"http://www.ign.fr",attribution:"Institut national de l'information géographique et forestière",logo:"https://wxs.ign.fr/static/logos/IGN/IGN.gif",minZoom:0,maxZoom:18,constraint:[{minZoom:10,maxZoom:18,bbox:[-63.37252,-21.475586,55.925865,51.31212]},{minZoom:0,maxZoom:9,bbox:[-179.5,-75,179.5,75]}]}}},"GEOGRAPHICALGRIDSYSTEMS.MAPS":{server:"https://wxs.ign.fr/geoportail/wmts",layer:"GEOGRAPHICALGRIDSYSTEMS.MAPS",title:"Cartes IGN",format:"image/jpeg",style:"normal",queryable:!0,tilematrix:"PM",minZoom:0,maxZoom:18,bbox:[-180,-68.138855,180,80],desc:"Cartes IGN",originators:{IGN:{href:"http://www.ign.fr",attribution:"Institut national de l'information géographique et forestière",logo:"https://wxs.ign.fr/static/logos/IGN/IGN.gif",minZoom:0,maxZoom:18,constraint:[{minZoom:17,maxZoom:17,bbox:[-63.189117,-21.428364,55.84698,51.175068]},{minZoom:18,maxZoom:18,bbox:[-63.189068,-21.428364,55.846638,51.175068]},{minZoom:7,maxZoom:8,bbox:[-178.20573,-68.138855,144.84375,51.909786]},{minZoom:13,maxZoom:14,bbox:[-178.20573,-67.101425,142.03836,51.44377]},{minZoom:11,maxZoom:12,bbox:[-178.20573,-67.101425,142.03836,51.444122]},{minZoom:9,maxZoom:10,bbox:[-178.20573,-68.138855,144.84375,51.444016]},{minZoom:15,maxZoom:16,bbox:[-178.20573,-46.502903,77.60037,51.175068]},{minZoom:0,maxZoom:6,bbox:[-180,-60,180,80]}]},"NCL-DITTT":{href:"http://www.dittt.gouv.nc/portal/page/portal/dittt",attribution:"Direction des Infrastructures, de la Topographie et des Transports Terrestres du gouvernement de la Nouvelle-Calédonie",logo:"https://wxs.ign.fr/static/logos/NCL-DITTT/NCL-DITTT.gif",minZoom:8,maxZoom:16,constraint:[{minZoom:8,maxZoom:10,bbox:[163.47784,-22.854631,168.24048,-19.402704]},{minZoom:11,maxZoom:13,bbox:[163.47784,-22.972307,168.24327,-19.494438]},{minZoom:14,maxZoom:15,bbox:[164.53125,-22.75592,168.22266,-20.303417]},{minZoom:16,maxZoom:16,bbox:[163.47784,-22.79525,168.19109,-19.494438]}]}}},"TRANSPORTNETWORKS.ROADS":{server:"https://wxs.ign.fr/geoportail/wmts",layer:"TRANSPORTNETWORKS.ROADS",title:"Routes",format:"image/png",style:"normal",queryable:!1,tilematrix:"PM",minZoom:6,maxZoom:18,bbox:[-63.969162,-21.49687,55.964417,71.584076],desc:"Affichage du réseau routier français et européen.",originators:{IGN:{href:"http://www.ign.fr",attribution:"Institut national de l'information géographique et forestière",logo:"https://wxs.ign.fr/static/logos/IGN/IGN.gif",minZoom:6,maxZoom:18,constraint:[{minZoom:15,maxZoom:18,bbox:[-63.37252,-21.475586,55.925865,51.31212]},{minZoom:6,maxZoom:14,bbox:[-63.969162,-21.49687,55.964417,71.584076]}]}}}};ol.layer.Geoportail.loadCapabilities=function(t,e){var o=function(){},i=function(){},r=function(){};this.getCapabilities(t,e).then(function(t){ol.layer.Geoportail.capabilities=t;o(t)}).catch(function(t){i(t)}).finally(function(t){r(t)});var n={then:function(t){return"function"==typeof t&&(o=t),n},"catch":function(t){return"function"==typeof t&&(i=t),n},"finally":function(t){return"function"==typeof t&&(r=t),n}};return n};ol.layer.Geoportail.getCapabilities=function(t){var e={},o=function(){},i=function(){},r=function(){},n=[156543.03390625,78271.516953125,39135.7584765625,19567.87923828125,9783.9396191406249,4891.9698095703125,2445.9849047851562,1222.9924523925781,611.49622619628906,305.74811309814453,152.87405654907226,76.437028274536132,38.218514137268066,19.109257068634033,9.5546285343170165,4.7773142671585083,2.3886571335792541,1.1943285667896271,.59716428339481353,.29858214169740677,.14929107084870338];function s(t){t=.000281*Number(t);for(var e=0;e<n.length;e++)if(t>n[e])return e}function a(t){for(var e=t.constraint.length-1;e>0;e--)for(var o=0;o<e;o++){for(var i=!0,r=0;r<4;r++)if(t.constraint[e].bbox[r]!=t.constraint[o].bbox[r]){i=!1;break}if(i&&(t.constraint[e].maxZoom==t.constraint[o].minZoom||t.constraint[o].maxZoom==t.constraint[e].minZoom||t.constraint[e].maxZoom+1==t.constraint[o].minZoom||t.constraint[o].maxZoom+1==t.constraint[e].minZoom||t.constraint[e].minZoom-1==t.constraint[o].maxZoom||t.constraint[o].minZoom-1==t.constraint[e].maxZoom)){t.constraint[o].maxZoom=Math.max(t.constraint[e].maxZoom,t.constraint[o].maxZoom);t.constraint[o].minZoom=Math.min(t.constraint[e].minZoom,t.constraint[o].minZoom);t.constraint.splice(e,1);break}}}ol.ext.Ajax.get({url:"https://wxs.ign.fr/"+t+"/autoconf/",dataType:"TEXT",error:function(t){i(t);r({})},success:function(i){for(var n,l=(new DOMParser).parseFromString(i,"text/xml").getElementsByTagName("Layer"),c=0;n=l[c];c++)if(/WMTS/.test(n.getElementsByTagName("Server")[0].attributes.service.value)){for(var h,p={server:n.getElementsByTagName("gpp:Key")[0].innerHTML.replace(t+"/",""),layer:n.getElementsByTagName("Name")[0].innerHTML,title:n.getElementsByTagName("Title")[0].innerHTML,format:n.getElementsByTagName("Format")[0].innerHTML,style:n.getElementsByTagName("Style")[0].getElementsByTagName("Name")[0].innerHTML,queryable:"1"===n.attributes.queryable.value,tilematrix:"PM",minZoom:s(n.getElementsByTagName("sld:MaxScaleDenominator")[0].innerHTML),maxZoom:s(n.getElementsByTagName("sld:MinScaleDenominator")[0].innerHTML),bbox:JSON.parse("["+n.getElementsByTagName("gpp:BoundingBox")[0].innerHTML+"]"),desc:n.getElementsByTagName("Abstract")[0].innerHTML.replace(/^<!\[CDATA\[(.*)\]\]>$/,"$1"),originators:{}},u=n.getElementsByTagName("gpp:Originator"),g=0;h=u[g];g++){for(var d,m=p.originators[h.attributes.name.value]={href:h.getElementsByTagName("gpp:URL")[0].innerHTML,attribution:h.getElementsByTagName("gpp:Attribution")[0].innerHTML,logo:h.getElementsByTagName("gpp:Logo")[0].innerHTML,minZoom:20,maxZoom:0,constraint:[]},f=h.getElementsByTagName("gpp:Constraint"),y=0;d=f[y];y++){var v=s(d.getElementsByTagName("sld:MinScaleDenominator")[0].innerHTML),_=s(d.getElementsByTagName("sld:MaxScaleDenominator")[0].innerHTML);_>m.maxZoom&&(m.maxZoom=_);_<m.minZoom&&(m.minZoom=_);v>m.maxZoom&&(m.maxZoom=v);v<m.minZoom&&(m.minZoom=v);m.constraint.push({minZoom:_,maxZoom:v,bbox:JSON.parse("["+d.getElementsByTagName("gpp:BoundingBox")[0].innerHTML+"]")})}a(m)}e[p.layer]=p}o(e);r(e)}});var l={then:function(t){return"function"==typeof t&&(o=t),l},"catch":function(t){return"function"==typeof t&&(i=t),l},"finally":function(t){return"function"==typeof t&&(r=t),l}};return l};ol.source.Source.prototype.getPreview=function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAk6QAAJOkBUCTn+AAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAANeSURBVHic7ZpPiE1RHMc/780MBhkik79JSUlIUbOxI+wkI2yRhYSUlJLNpJF/xcpiJBmZGBZsNM1CkmhKITGkGbH0/BuPmXnP4rxbb/TOn3fvOffeec6nfqvb/b7f93fveeec37ng8Xg8Ho/nf6Uu4d+fDswFssCvhHOJhaXAMeApMAQUyyIPPAdOAiuTStAVy4EHjDWsix5gdRLJ2mY34ulWYz6IEeA4kIk9awtkgTOEM/5vdAKT4k0/Ou3YMR/ELcbRm9AKFLBbgCJwNE4TYZkJfMG++SIwDCyLz0o4bI17WdyJz0r1TAZ+oDcxCBwAFgIzEIuhvcBbg3sLwOK4DFXLFvQGniCGSSUagS4DjUPOHESkA3XiOWCORqMR6Nfo9DjI3QqPUSd+ylBnv0Zn0GrWFvmIOvGNhjqrNDp/EAutyFgRKUM2tgO+Gur81FxvAKYZaimxXYBvmuuLDHWWaK4X0RfJCNsF6NdcbzXU2a65PohYFKWOc+jn8PUajbWIXaBKp9NB7lZYh34OzwFbFfd/NtDYYSth27urLGIm0M31AL3APWAAmIooymaDnPIl/Vz4NN1yHrd7gcvxWQnHAuA3bsyPop8hUsE13BSgK04TUViBeFo2zedJ8S6wElexW4D2eNOPTjNi6WvD/DtEr8E6tk6GGoAmxFY2iFHE9NZiQf8gogiB9gTEH23izAZuE77vHyU+ANucO1QwD3hD/MbLowAcdm20EmkwXx4n3NodS9rMB2HabYpEWs0HcRqHp0fNwAvJD+eBTZr7p6BvmQVxUaEzEbiruNfJekH15L8jtrEm7JJolEcOmKXRqQOuKDQuY7HZY8s8iNfzkSLxIuI43FTrkkLnOlBfRW4VsWk+oAX5weknxFAxJQNckGgVgZuIRVoomoGXEmGTMa+iQ6K7M4SW7k24QYgiuDQPYinbhugiF4H3RGtzZYCzyIvQXfpNI1ybLyeLpf5+iTbkRbiP2EcocTHm4+YI8iI8RFHwWjAfsA95Q+YZFU6wasl8wB7kReijtNbIILa0vcg/PRlGfPQwHmlCviDqAzaA+OREtzqr1ejOIDorxlNEjTGUBV4nnUWCvAJxGDlA8q9j3DEArAn2zvXAfOwfl6eVAmJrPpJ0Ih6Px+PxeJLjLwPul3vj5d0eAAAAAElFTkSuQmCC"};ol.source.Tile.prototype.getPreview=function(t,e){t||(t=[21020,6355964]);e||(e=150);var o=this.getTileGrid().getTileCoordForCoordAndResolution(t,e);return this.getTileUrlFunction().call(this,o,this.getProjection())};ol.source.TileWMS.prototype.getPreview=function(t,e){t||(t=[21020,6355964]);e||(e=150);var o=this.getGetFeatureInfoUrl?this.getGetFeatureInfoUrl(t,e,this.getProjection()||"EPSG:3857",{}):this.getFeatureInfoUrl(t,e,this.getProjection()||"EPSG:3857",{});return o.replace(/getfeatureinfo/i,"GetMap")};ol.layer.Base.prototype.getPreview=function(t,e){if(this.get("preview"))return[this.get("preview")];if(e||(e=150),e<this.getMinResolution()||e>this.getMaxResolution()){var o=this.getMinResolution(),i=this.getMaxResolution();for(i>1e5&&(i=156543),o<.15&&(o=.15),e=i;i>o;)i/=2,e=o*=2}var r=this.getExtent();return t||(t=[21020,6355964]),r&&!ol.extent.containsCoordinate(r,t)&&(t=[(r[0]+r[2])/2,(r[1]+r[3])/2]),this.getSource?[this.getSource().getPreview(t,e)]:[]};ol.layer.Group.prototype.getPreview=function(t,e){if(this.get("preview"))return[this.get("preview")];var o=[];if(this.getLayers)for(var i=this.getLayers().getArray(),r=0;r<i.length;r++)o=o.concat(i[r].getPreview(t,e));return o};ol.layer.Vector.prototype.setRender3D=function(t){t.setLayer(this)};ol.render3D=function(t){(t=t||{}).maxResolution=t.maxResolution||100;t.defaultHeight=t.defaultHeight||0;ol.Object.call(this,t);this.setStyle(t.style);this.height_=t.height=this.getHfn(t.height);t.layer&&this.setLayer(t.layer)};ol.ext.inherits(ol.render3D,ol.Object);ol.render3D.prototype.setStyle=function(t){if(this._style=t instanceof ol.style.Style?t:new ol.style.Style,this._style.getStroke()||this._style.setStroke(new ol.style.Stroke({width:1,color:"red"})),this._style.getFill()||this._style.setFill(new ol.style.Fill({color:"rgba(0,0,255,0.5)"})),t&&t.getGeometry()){var e=t.getGeometry();"function"==typeof e?this.set("geometry",e):this.set("geometry",function(){return e})}else this.set("geometry",function(t){return t.getGeometry()})};ol.render3D.prototype.getStyle=function(){return this._style};ol.render3D.prototype.onPostcompose_=function(t){var e=t.frameState.viewState.resolution;if(!(e>this.get("maxResolution"))){if(this.res_=400*e,this.animate_){var o=t.frameState.time-this.animate_;o<this.animateDuration_?(this.elapsedRatio_=this.easing_(o/this.animateDuration_),t.frameState.animate=!0):(this.animate_=!1,this.height_=this.toHeight_)}var i=t.frameState.pixelRatio,r=t.context,n=this.matrix_=t.frameState.coordinateToPixelTransform;n||((n=t.frameState.coordinateToPixelMatrix)[2]=n[4],n[3]=n[5],n[4]=n[12],n[5]=n[13]);this.center_=[r.canvas.width/2/i,r.canvas.height/i];var s=this.layer_.getSource().getFeaturesInExtent(t.frameState.extent);r.save();r.scale(i,i);var a=this.getStyle();r.lineWidth=a.getStroke().getWidth();r.strokeStyle=ol.color.asString(a.getStroke().getColor());r.fillStyle=ol.color.asString(a.getFill().getColor());for(var l=[],c=0;c<s.length;c++)l.push(this.getFeature3D_(s[c],this.getFeatureHeight(s[c])));this.drawFeature3D_(r,l);r.restore()}};ol.render3D.prototype.setLayer=function(t){this._listener&&this._listener.forEach(function(t){ol.Observable.unByKey(t)});this.layer_=t;this._listener=t.on(["postcompose","postrender"],this.onPostcompose_.bind(this))};ol.render3D.prototype.getHfn=function(t){switch(typeof t){case"function":return t;case"string":var e=this.get("defaultHeight");return function(o){return Number(o.get(t))||e};case"number":return function(){return t};default:return function(){return 10}}};ol.render3D.prototype.animate=function(t){t=t||{};this.toHeight_=this.getHfn(t.height);this.animate_=(new Date).getTime();this.animateDuration_=t.duration||1e3;this.easing_=t.easing||ol.easing.easeOut;this.layer_.changed()};ol.render3D.prototype.animating=function(){return this.animate_&&(new Date).getTime()-this.animate_>this.animateDuration_&&(this.animate_=!1),!!this.animate_};ol.render3D.prototype.getFeatureHeight=function(t){if(this.animate_){var e=this.height_(t),o=this.toHeight_(t);return e*(1-this.elapsedRatio_)+this.elapsedRatio_*o}return this.height_(t)};ol.render3D.prototype.hvector_=function(t,e){var o=[t[0]*this.matrix_[0]+t[1]*this.matrix_[1]+this.matrix_[4],t[0]*this.matrix_[2]+t[1]*this.matrix_[3]+this.matrix_[5]];return{p0:o,p1:[o[0]+e/this.res_*(o[0]-this.center_[0]),o[1]+e/this.res_*(o[1]-this.center_[1])]}};ol.render3D.prototype.getFeature3D_=function(t,e){var o=this.get("geometry")(t),i=o.getCoordinates();switch(o.getType()){case"Polygon":i=[i];case"MultiPolygon":for(var r=[],n=0;n<i.length;n++)for(var s=0;s<i[n].length;s++){for(var a=[],l=0;l<i[n][s].length;l++)a.push(this.hvector_(i[n][s][l],e));r.push(a)}return{type:"MultiPolygon",feature:t,geom:r};case"Point":return{type:"Point",feature:t,geom:this.hvector_(i,e)};default:return{}}};ol.render3D.prototype.drawFeature3D_=function(t,e){for(var i,r,n,o=0;o<e.length;o++)switch(e[o].type){case"MultiPolygon":for(i=0;i<e[o].geom.length;i++)for(r=e[o].geom[i],n=0;n<r.length;n++)t.beginPath(),t.moveTo(r[n].p0[0],r[n].p0[1]),t.lineTo(r[n].p1[0],r[n].p1[1]),t.stroke();break;case"Point":var s=e[o].geom;t.beginPath();t.moveTo(s.p0[0],s.p0[1]);t.lineTo(s.p1[0],s.p1[1]);t.stroke()}for(o=0;o<e.length;o++)switch(e[o].type){case"MultiPolygon":for(t.beginPath(),i=0;i<e[o].geom.length;i++){if(r=e[o].geom[i],0==i)for(t.moveTo(r[0].p1[0],r[0].p1[1]),n=1;n<r.length;n++)t.lineTo(r[n].p1[0],r[n].p1[1]);else for(t.moveTo(r[0].p1[0],r[0].p1[1]),n=r.length-2;n>=0;n--)t.lineTo(r[n].p1[0],r[n].p1[1]);t.closePath()}t.fill("evenodd");t.stroke();break;case"Point":var a=(r=e[o]).feature.get("label");if(a){var l=r.geom.p1,c=t.fillStyle;t.fillStyle=t.strokeStyle;t.textAlign="center";t.textBaseline="bottom";t.fillText(a,l[0],l[1]);var h=t.measureText(a),p=Number(t.font.match(/\d+(\.\d+)?/g).join([]));t.fillStyle="rgba(255,255,255,0.5)";t.fillRect(l[0]-h.width/2-5,l[1]-p-5,h.width+10,p+10);t.strokeRect(l[0]-h.width/2-5,l[1]-p-5,h.width+10,p+10);t.fillStyle=c}}};window.ol&&!ol.particule&&(ol.particule={});ol.particule.Base=function(t){t||(t={});ol.Object.call(this);this.setOverlay(t.overlay);this.coordinate=t.coordinate||[0,0]};ol.ext.inherits(ol.particule.Base,ol.Object);ol.particule.Base.prototype.setOverlay=function(t){this._overlay=t};ol.particule.Base.prototype.getOverlay=function(){return this._overlay};ol.particule.Base.prototype.draw=function(){};ol.particule.Base.prototype.update=function(){};ol.particule.Base.prototype.getRandomCoord=function(t){return this.getOverlay().randomCoord?this.getOverlay().randomCoord():[t,0]};ol.particule.Bird=function(t){t||(t={});ol.particule.Base.call(this,t);this.bird=new Image;this.bird.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAABDCAQAAAD+S8VaAAAAAnNCSVQICFXsRgQAAAAJcEhZcwAAAvMAAALzAdLpCioAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb7jwaAAAG90lEQVR42uWaaVRTRxTHJ4AUUIoIiqISOArIDiIhBBfccCMoR0vVUpXjTqun4Fr1tO5i3YuodaFqRMECKm4VUHEhUvWgBYuilgpiRVZpCARI3r8fWA4hYY9AXu77+ObNzO/O8u787xDSyeYSTzSICpu+DjV0ogrze84PBneByuJv3JpbBlx6MEBbJfG/8S2RAACFXXtU0gERN1BjCc9UEN/e7I2w1gFPinv3UDkHbFiGOqOwJVjlHMALRT3LLJ7trGIOuHwFUsY7q2IOuJ0u7YB//pswWFn6/vnUcbOCAn7ctfnUrsijl85dv5pw786fd9OTsvg5/JykN3fTb6ZcTDgVvefIkqXmVvKr0NN/IUQDO7C1qwJrOwyftIZ7cmIiN21eZlB+SOUtFKNl9kF0hb9ujmyVM73FMmWv3m+2J4zxw74NDN5/5vT1qzeT7j3n5/Bz7mcmPk24cy32Ai8i9Pj2nwIX+jo4kc8UMMqeXr5bfC6N/2tUHrdsCQ4gAR/QNhNRJ8+6GklXH7xStlxW+ViLxrpjqBswJ/z4rYyCFrQnwJPCxGe/x53i+fO+XOth2xpsvQm+PkfGP3YuYIo1oInTyIJiLDFtoZfUP+AXeaW2rZHXKZ8xJ35NeU+1odVSbIIBbEQeb70Tffd6ckmj0QbDy9/zOufdILE6SN0TBkVafnn0ka/NatrrditDXpmYKw36pREwPyr+Y0V72n0CsxoedTDFrMJJyRMDZJYIx8+yYICQKbDJtcjtL9IGAcEMKN7efIy+snnTYv/tR8Ry3+eWRUYFzavRB9SWL7icXKWAVrPRr96wEqjBTjg5bop03GGi77XF85FdqVZNIQ1konOsEvx35yOCN1xMFimszjNSDqh+ektGfVG3xjyTzaqkX3uDTiaCdh0ZA/qSgWXWWfb7CYMQQsiUUANK1j8hoJf1lSFUg0u+z1xCiFuMUYWsAy7QCj9ZzhIgIDCkpi4nhBCGsafNGx2peXCQRvhlcGrEAQSOhYQQQtyTG74YCglN8CswrVF8goEVhBBCrMzdozi33OOHJmvUvQqghQtKMEUu+GDB0Cj2Q/vsUdJn0JH8+oXG4rWS46djSD0ePcr2lUuafbZlIbN0UAnngpyA0I3FumeZxxQYVlZ/ooWleKm0+FHQbTDuWnAp5F6cbNfskcDtcg9J9aMGNUxDIiglgy+CPxhypj4Ddu/cfFpxOrIqrv7QAsH4V2nwYxoEvwQEOpRlAeeG07hWnopH7FMHgTr6VmhAA1xEQNjF4bMxQwpcj2I9duVZLiVtTb7YT7T2I30JccyqrrA7ZuESRF0SvhQ/QKfByDu/VZAs5O6rXS9U6onZ+A2CLgQvwWn0l5n4TAFnjOKksR5En6i73q6/q3IRhvwugB8LBylwi6IhixxX9Wd/CoWQwTrJTuaEOSwzENcKDR7Yj4xOg4+Hq3SEXzX8fIfcObAZPizV+bGxqLZhMyxBWgdP+xi4ScGbCNnhhrodqxnrso65pLidNxMQENihqoPgS3AY5rU7krh35eCPbon2c4hap2nnxob2GQQE+zpAM4qFb53EoUWxE3t93jXyBwyXcG1KD+8/IXwBAmFYg26Vx37oHjnIlnQlGzbJvMCX+lQrPgT6dat9yAcT/S6aSOIs2rjjxLaQ9SsX83gv8uShiNuAn4mR9fZ5dizpphRpREvj1YvOhiU84OdmoghFyKH47y/GHohtLf45ITvVuLyfyKLI5RlntyJSXx2+P+gaejt5O7FNCSEkcFHTuAmPom6/qqxJqFRee33wHGc6rVLjXtym8C8nTTcnDNMh/n5BfnN8mFY18jWdbPlceeBViEsPi16xxFSL7ncjukVelTvxUzsxjOlAUzsULv8/GfdEJa7G7D7YWLCcUzbNkfb42zaXNaG2h4XTHH/n9x+bjIHKqeAdNMZf55fbrKBYLNq+lqb433lkFrUk5hNKdu6mIf5XA1KetzibR+09TLcfonrMtVYlNKk9h2gV//FCW3tCFmMXT0nOe83bxpklbdDJqrD+BC1mwUzTtOw2Sl/UFjpsh8ci2pHirFgxV8nxV/oJxO2RwR6+HNFbmfkZ15PaqwQe/VmJ+R18Aql37XTAsQ9EefUBW6NeEk34IaWN8HkIQk+Jva0SzwGXP6p1XDeEoqB1qx/L0B3dKY+VSr0JDurDFNaK2ZoYg5142sx1m3LEYxUsq+Vv8ejVSv8bdJ/UXySds9eDB4JwEnFIRS6KUIi/8RJxCEEARte74GBR6DycFpGgtZNFPkHrHgOx61miSaPDEOtEn8qWwvepZMc5Mel3ItZmHbbM12wSXV/snMHZQ6eRlzEzI9d9rnftskwERhXVNxF7ik1Krd87pbLCbWYR9Y7v0f/htaJHbsoDhwAAAABJRU5ErkJggg==";this.set("size",[this.bird.width||50,this.bird.height||50])};ol.ext.inherits(ol.particule.Bird,ol.particule.Base);ol.particule.Bird.prototype.draw=function(t){var e=this.getOverlay().get("angle");t.save();t.translate(this.coordinate[0],this.coordinate[1]);t.rotate(e+Math.PI/2);t.scale(.5,.5);t.drawImage(this.bird,-this.bird.width/2,-this.bird.height/2);t.restore()};ol.particule.Bird.prototype.update=function(t){var e=this.getOverlay().get("speed")*t/this.getOverlay()._fps,o=this.getOverlay().get("angle");this.coordinate[0]+=e*Math.cos(o);this.coordinate[1]+=e*Math.sin(o)};ol.particule.Cloud=function(t){t||(t={});ol.particule.Base.call(this,t);this.set("size",[100,100]);var e=document.createElement("CANVAS");e.width=200;e.height=200;var o=e.getContext("2d"),i=this.gradient=o.createRadialGradient(50,50,0,50,50,50);i.addColorStop(0,"rgba(255,255,255,.2");i.addColorStop(1,"rgba(255,255,255,0");this.image=e;for(var r=0;r<7;r++){o.save();var n=100*Math.random(),s=100*Math.random();o.translate(n,s);o.fillStyle=i;o.fillRect(0,0,e.width,e.height);o.restore()}};ol.ext.inherits(ol.particule.Cloud,ol.particule.Base);ol.particule.Cloud.prototype.draw=function(t){t.save();t.translate(this.coordinate[0],this.coordinate[1]);t.drawImage(this.image,-this.image.width/2,-this.image.width/2);t.restore()};ol.particule.Cloud.prototype.update=function(t){var e=this.getOverlay().get("speed")*t/this.getOverlay()._fps,o=this.getOverlay().get("angle");this.coordinate[0]+=e*Math.cos(o);this.coordinate[1]+=e*Math.sin(o)};ol.particule.Rain=function(t){t||(t={});ol.particule.Base.call(this,t);this.z=Math.floor(5*Math.random())+1;var e=document.createElement("CANVAS");e.width=50;e.height=50;var o=e.getContext("2d");this.gradient=o.createRadialGradient(0,0,0,0,0,25);this.gradient.addColorStop(0,"rgba(0,0,80,0)");this.gradient.addColorStop(1,"rgba(0,0,80,.3)")};ol.ext.inherits(ol.particule.Rain,ol.particule.Base);ol.particule.Rain.prototype.draw=function(t){t.save();var e=this.getOverlay().get("angle");t.beginPath();var o=10*Math.cos(e)*(1+this.z/2),i=10*Math.sin(e)*(1+this.z/2);t.lineWidth=Math.round(this.z/2);t.strokeStyle=this.gradient;t.translate(this.coordinate[0],this.coordinate[1]);t.moveTo(0,0);t.lineTo(o,i);t.stroke();t.restore()};ol.particule.Rain.prototype.update=function(t){var e=this.getOverlay().get("speed")*t/this.getOverlay()._fps*this.z,o=this.getOverlay().get("angle");this.coordinate[0]+=e*Math.cos(o);this.coordinate[1]+=e*Math.sin(o)};ol.particule.RainDrop=function(t){t||(t={});ol.particule.Base.call(this,t);this.size=0;var e=document.createElement("CANVAS");e.width=100;e.height=100;var o=e.getContext("2d"),i=o.createRadialGradient(50,50,0,50,50,50);i.addColorStop(0,"rgba(128,128,192,.8");i.addColorStop(1,"rgba(128,128,192,0");this.image=e;o.fillStyle=i;o.fillRect(0,0,e.width,e.height)};ol.ext.inherits(ol.particule.RainDrop,ol.particule.Base);ol.particule.RainDrop.prototype.draw=function(t){this.size>0&&(t.save(),t.translate(this.coordinate[0],this.coordinate[1]),t.globalAlpha=this.size/50,t.scale(1-this.size/50,1-this.size/50),t.drawImage(this.image,-50,-50),t.restore())};ol.particule.RainDrop.prototype.update=function(t){(this.size>0||Math.random()<.01)&&(this.size<=0&&(this.size=50,this.coordinates=this.getRandomCoord()),this.size=this.size-Math.round(t/20))};ol.particule.Snow=function(t){t||(t={});ol.particule.Base.call(this,t);this.z=(Math.floor(5*Math.random())+1)/5;this.angle=Math.random()*Math.PI;var e=document.createElement("CANVAS");e.width=20;e.height=20;var o=e.getContext("2d"),i=o.createRadialGradient(10,10,0,10,10,10);i.addColorStop(0,"rgba(255, 255, 255,1)");i.addColorStop(.8,"rgba(210, 236, 242,.8)");i.addColorStop(1,"rgba(237, 247, 249,0)");this.image=e;o.fillStyle=i;o.fillRect(0,0,e.width,e.height)};ol.ext.inherits(ol.particule.Snow,ol.particule.Base);ol.particule.Snow.prototype.draw=function(t){t.save();t.translate(this.coordinate[0],this.coordinate[1]);t.globalAlpha=.4+this.z/2;t.scale(this.z,this.z);t.drawImage(this.image,-10,-10);t.restore()};ol.particule.Snow.prototype.update=function(t){var e=this.getOverlay().get("speed")*t/this.getOverlay()._fps*this.z*5,o=this.getOverlay().get("angle");this.angle=this.angle+t/this.getOverlay()._fps/100;this.coordinate[0]+=2*Math.sin(this.angle+this.z)+e*Math.cos(o);this.coordinate[1]+=Math.cos(this.angle)+e*Math.sin(o)};ol.Overlay.Popup=function(t){var e=this;this.offsetBox="number"==typeof(t=t||{}).offsetBox?[t.offsetBox,t.offsetBox,t.offsetBox,t.offsetBox]:t.offsetBox;var o=document.createElement("div");t.element=o;var i=document.createElement("div");i.classList.add("anchor");o.appendChild(i);this.content=ol.ext.element.create("div",{html:t.html||"",className:"ol-popup-content",parent:o});this.closeBox=t.closeBox;this.onclose=t.onclose;this.onshow=t.onshow;var r=document.createElement("button");r.classList.add("closeBox");t.closeBox&&r.classList.add("hasclosebox");r.setAttribute("type","button");o.insertBefore(r,i);r.addEventListener("click",function(){e.hide()});t.stopEvent&&(o.addEventListener("mousedown",function(t){t.stopPropagation()}),o.addEventListener("touchstart",function(t){t.stopPropagation()}));ol.Overlay.call(this,t);this._elt=this.element;this.setPositioning(t.positioning||"auto");this.setPopupClass(t.popupClass||t.className||"default");t.position&&setTimeout(function(){this.show(t.position)}.bind(this))};ol.ext.inherits(ol.Overlay.Popup,ol.Overlay);ol.Overlay.Popup.prototype.getClassPositioning=function(){var t="",e=this.getPositioning();return/bottom/.test(e)&&(t+="ol-popup-bottom "),/top/.test(e)&&(t+="ol-popup-top "),/left/.test(e)&&(t+="ol-popup-left "),/right/.test(e)&&(t+="ol-popup-right "),/^center/.test(e)&&(t+="ol-popup-middle "),/center$/.test(e)&&(t+="ol-popup-center "),t};ol.Overlay.Popup.prototype.setClosebox=function(t){this.closeBox=t;t?this._elt.classList.add("hasclosebox"):this._elt.classList.remove("hasclosebox")};ol.Overlay.Popup.prototype.setPopupClass=function(t){this._elt.className="";var e=this.getClassPositioning().split(" ").filter(function(t){return t.length>0}),o=["ol-popup"];t?t.split(" ").filter(function(t){return t.length>0}).forEach(function(t){o.push(t)}):o.push("default");e.forEach(function(t){o.push(t)});this.closeBox&&o.push("hasclosebox");this._elt.classList.add.apply(this._elt.classList,o)};ol.Overlay.Popup.prototype.addPopupClass=function(t){this._elt.classList.add(t)};ol.Overlay.Popup.prototype.removePopupClass=function(t){this._elt.classList.remove(t)};ol.Overlay.Popup.prototype.setPositioning=function(t){void 0!==t&&(/auto/.test(t)?(this.autoPositioning=t.split("-"),1==this.autoPositioning.length&&(this.autoPositioning[1]="auto")):this.autoPositioning=!1,"center"==(t=t.replace(/auto/g,"center"))&&(t="bottom-center"),this.setPositioning_(t))};ol.Overlay.Popup.prototype.setPositioning_=function(t){if(this._elt){ol.Overlay.prototype.setPositioning.call(this,t);this._elt.classList.remove("ol-popup-top","ol-popup-bottom","ol-popup-left","ol-popup-right","ol-popup-center","ol-popup-middle");var e=this.getClassPositioning().split(" ").filter(function(t){return t.length>0});this._elt.classList.add.apply(this._elt.classList,e)}};ol.Overlay.Popup.prototype.getVisible=function(){return this._elt.classList.contains("visible")};ol.Overlay.Popup.prototype.show=function(t,e){e||"string"!=typeof t||(e=t,t=null);!0===t&&(t=this.getPosition());var o=this,i=this.getMap();if(i&&(e&&e!==this.prevHTML&&(this.prevHTML=e,this.content.innerHTML="",e instanceof Element?this.content.appendChild(e):this.content.insertAdjacentHTML("beforeend",e),Array.prototype.slice.call(this.content.querySelectorAll("img")).forEach(function(t){t.addEventListener("load",function(){i.renderSync()})})),t)){if(this.autoPositioning){var r=i.getPixelFromCoordinate(t),n=i.getSize(),s=[];s[0]="auto"==this.autoPositioning[0]?r[1]<n[1]/3?"top":"bottom":this.autoPositioning[0];s[1]=r[0]<2*n[0]/3?"left":"right";this.setPositioning_(s[0]+"-"+s[1]);this.offsetBox&&this.setOffset([this.offsetBox["left"==s[1]?2:0],this.offsetBox["top"==s[0]?3:1]])}else this.offsetBox&&this.setOffset(this.offsetBox);this.setPosition(t);this._elt.parentElement.style.display="";"function"==typeof this.onshow&&this.onshow();this._tout=setTimeout(function(){o._elt.classList.add("visible")},0)}};ol.Overlay.Popup.prototype.hide=function(){null!=this.getPosition()&&("function"==typeof this.onclose&&this.onclose(),this.setPosition(void 0),this._tout&&clearTimeout(this._tout),this._elt.classList.remove("visible"))};ol.Overlay.AnimatedCanvas=function(t){t||(t={});this._canvas=ol.ext.element.create("CANVAS",{className:((t.className||"")+" ol-animated-overlay").trim()});this._ctx=this._canvas.getContext("2d");ol.Overlay.call(this,{element:this._canvas,stopEvent:!1});this._listener=[];this._time=0;this._particuleClass=t.particule||ol.particule.Base;t.createParticule&&(this._createParticule=t.createParticule);this._fps=1e3/(t.fps||25);var e=this._createParticule();this._psize=e.get("size")||[50,50];this.set("density",t.density||.5);this.set("speed",t.speed||4);this.set("angle","number"==typeof t.angle?t.angle:Math.PI/4);!1!==t.animate&&this.setAnimation(!0);document.addEventListener("visibilitychange",function(){this._pause=!0}.bind(this))};ol.ext.inherits(ol.Overlay.AnimatedCanvas,ol.Overlay);ol.Overlay.AnimatedCanvas.prototype.setVisible=function(t){this.element.style.display=t?"block":"none";t&&this.setAnimation(this.get("animation"))};ol.Overlay.AnimatedCanvas.prototype.getVisible=function(){return"none"!=this.element.style.display};ol.Overlay.AnimatedCanvas.prototype.updatePixelPosition=function(){};ol.Overlay.AnimatedCanvas.prototype.setMap=function(t){if(this.getMap()&&this.getMap().getViewport().querySelector(".ol-overlaycontainer").removeChild(this._canvas),this._listener.forEach(function(t){ol.Observable.unByKey(t)}),this._listener=[],ol.Overlay.prototype.setMap.call(this,t),t){var e=t.getSize();this._canvas.width=e[0];this._canvas.height=e[1];this.draw();this._listener.push(t.on("change:size",function(){var e=t.getSize();this._canvas.width===e[0]&&this._canvas.height===e[1]||(this._canvas.width=e[0],this._canvas.height=e[1],this.draw())}.bind(this)))}};ol.Overlay.AnimatedCanvas.prototype.getParticules=function(){var t=this._psize[0],e=this._psize[1],o=this.get("density")*this._canvas.width*this._canvas.height/t/e<<0;if(this._particules||(this._particules=[]),o>this._particules.length)for(var i=this._particules.length;i<o;i++)this._particules.push(this._createParticule(this,this.randomCoord()));else this._particules.length=o;return this._particules};ol.Overlay.AnimatedCanvas.prototype._createParticule=function(t,e){return new this._particuleClass({overlay:t,coordinate:e})};ol.Overlay.AnimatedCanvas.prototype.randomCoord=function(){return[Math.random()*(this._canvas.width+this._psize[0])-this._psize[0]/2,Math.random()*(this._canvas.height+this._psize[1])-this._psize[1]/2]};ol.Overlay.AnimatedCanvas.prototype.draw=function(t){var e=this._ctx;this.clear();e.beginPath();this.getParticules().forEach(function(e){t&&(e.update(t),this.testExit(e));e.draw(this._ctx)}.bind(this))};ol.Overlay.AnimatedCanvas.prototype.testExit=function(t){var e=this._psize;t.coordinate[0]<-e[0]?(t.coordinate[0]=this._canvas.width+e[0],t.coordinate[1]=Math.random()*(this._canvas.height+e[1])-e[1]/2):t.coordinate[0]>this._canvas.width+e[0]?(t.coordinate[0]=-e[0],t.coordinate[1]=Math.random()*(this._canvas.height+e[1])-e[1]/2):t.coordinate[1]<-e[1]?(t.coordinate[0]=Math.random()*(this._canvas.width+e[0])-e[0]/2,t.coordinate[1]=this._canvas.height+e[1]):t.coordinate[1]>this._canvas.height+e[1]&&(t.coordinate[0]=Math.random()*(this._canvas.width+e[0])-e[0]/2,t.coordinate[1]=-e[1])};ol.Overlay.AnimatedCanvas.prototype.clear=function(){this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height)};ol.Overlay.AnimatedCanvas.prototype.getCanvas=function(){return this._canvas};ol.Overlay.AnimatedCanvas.prototype.setAnimation=function(t){t=!1!==t;this.set("animation",t);t?(this._pause=!0,requestAnimationFrame(this._animate.bind(this))):this.dispatchEvent({type:"animation:stop",time:this._time})};ol.Overlay.AnimatedCanvas.prototype._animate=function(t){this.getVisible()&&this.get("animation")&&(this._pause?requestAnimationFrame(function(t){this._time=t;requestAnimationFrame(this._animate.bind(this))}.bind(this)):(t-this._time>this._fps&&(this.draw(t-this._time),this._time=t),requestAnimationFrame(this._animate.bind(this))));this._pause=!1};ol.Overlay.Magnify=function(t){var e=document.createElement("div");e.className="ol-magnify";this._elt=e;ol.Overlay.call(this,{positioning:t.positioning||"center-center",element:this._elt,stopEvent:!1});this.mgmap_=new ol.Map({controls:new ol.Collection,interactions:new ol.Collection,target:t.target||this._elt,view:new ol.View({projection:t.projection}),layers:t.layers});this.mgview_=this.mgmap_.getView();this.external_=!!t.target;this.set("zoomOffset",t.zoomOffset||1);this.set("active",!0);this.on("propertychange",this.setView_.bind(this))};ol.ext.inherits(ol.Overlay.Magnify,ol.Overlay);ol.Overlay.Magnify.prototype.setMap=function(t){this.getMap()&&this.getMap().getViewport().removeEventListener("mousemove",this.onMouseMove_);this._listener&&ol.Observable.unByKey(this._listener);this._listener=null;ol.Overlay.prototype.setMap.call(this,t);typeof t!="undefined"&&t!==null&&(t.getViewport().addEventListener("mousemove",this.onMouseMove_.bind(this)),this._listener=t.getView().on("propertychange",this.setView_.bind(this)));this.setView_()};ol.Overlay.Magnify.prototype.getMagMap=function(){return this.mgmap_};ol.Overlay.Magnify.prototype.getActive=function(){return this.get("active")};ol.Overlay.Magnify.prototype.setActive=function(t){return this.set("active",t)};ol.Overlay.Magnify.prototype.onMouseMove_=function(t){if(this.get("active")){var e=this.getMap().getEventCoordinate(t);this.external_||this.setPosition(e);this.mgview_.setCenter(e);var canvas=ol.ext.getMapCanvas(this.mgmap_);canvas&&"none"==canvas.style.display&&this.mgmap_.updateSize()}else this.setPosition()};ol.Overlay.Magnify.prototype.setView_=function(t){if(this.get("active")){if(!t)return this.setView_({key:"rotation"}),void this.setView_({key:"resolution"});switch(t.key){case"rotation":this.mgview_.setRotation(this.getMap().getView().getRotation());break;case"zoomOffset":case"resolution":var e=Math.max(0,this.getMap().getView().getZoom()+Number(this.get("zoomOffset")));this.mgview_.setZoom(e)}}else this.setPosition()};ol.Overlay.Placemark=function(t){(t=t||{}).popupClass=(t.popupClass||"")+" placemark anim";t.positioning="bottom-center";ol.Overlay.Popup.call(this,t);this.setPositioning=function(){};t.color&&(this.element.style.color=t.color);t.backgroundColor&&(this.element.style.backgroundColor=t.backgroundColor);t.contentColor&&this.setContentColor(t.contentColor);t.size&&this.setRadius(t.size)};ol.ext.inherits(ol.Overlay.Placemark,ol.Overlay.Popup);ol.Overlay.Placemark.prototype.show=function(t,e){!0===t&&(t=this.getPosition());this.hide();ol.Overlay.Popup.prototype.show.apply(this,[t,e])};ol.Overlay.Placemark.prototype.setColor=function(t){this.element.style.color=t};ol.Overlay.Placemark.prototype.setBackgroundColor=function(t){this.element.style.backgroundColor=t};ol.Overlay.Placemark.prototype.setContentColor=function(t){var e=this.element.getElementsByClassName("ol-popup-content")[0];e&&(e.style.color=t)};ol.Overlay.Placemark.prototype.setClassName=function(t){var e=this.element.className;this.element.className="ol-popup placemark ol-popup-bottom ol-popup-center "+(/visible/.test(e)?"visible ":"")+(/anim/.test(e)?"anim ":"")+t};ol.Overlay.Placemark.prototype.setRadius=function(t){this.element.style.fontSize=t+"px"};ol.Overlay.PopupFeature=function(t){t=t||{};ol.Overlay.Popup.call(this,t);this.setTemplate(t.template);this.set("canFix",t.canFix);this.set("showImage",t.showImage);this.set("maxChar",t.maxChar||200);t.select&&"function"==typeof t.select.on&&(this._select=t.select,t.select.on("select",function(e){this._noselect||this.show(e.mapBrowserEvent.coordinate,t.select.getFeatures().getArray())}.bind(this)))};ol.ext.inherits(ol.Overlay.PopupFeature,ol.Overlay.Popup);ol.Overlay.PopupFeature.prototype.setTemplate=function(t){if(this._template=t,this._template&&this._template.attributes instanceof Array){var e={};this._template.attributes.forEach(function(t){e[t]=!0});this._template.attributes=e}};ol.Overlay.PopupFeature.prototype.show=function(t,e){(t instanceof ol.Feature||t instanceof Array&&t[0]instanceof ol.Feature)&&(e=t,t=null);e instanceof Array||(e=[e]);this._features=e.slice();this._count||(this._count=1);this._count=1;var o=this._getHtml(e[0]);this.hide();o&&(t&&"Point"!==e[0].getGeometry().getType()||(t=e[0].getGeometry().getFirstCoordinate()),ol.Overlay.Popup.prototype.show.call(this,t,o))};ol.Overlay.PopupFeature.prototype._getHtml=function(t){if(!t)return"";var e=ol.ext.element.create("DIV",{className:"ol-popupfeature"});this.get("canFix")&&ol.ext.element.create("I",{className:"ol-fix",parent:e}).addEventListener("click",function(){this.element.classList.toggle("ol-fixed")}.bind(this));var o,i=this._template;if(!i||!i.attributes)for(var r in(i=i||{}).attributes={},t.getProperties())"geometry"!=r&&(i.attributes[r]=r);if(i.title&&(o="function"==typeof i.title?i.title(t):t.get(i.title),ol.ext.element.create("H1",{html:o,parent:e})),i.attributes){var n,s=ol.ext.element.create("TABLE",{parent:e}),a=i.attributes;for(var l in a){var c,h=a[l],p=t.get(l);"function"==typeof h.format&&(p=h.format(p,t));var u=!0;if("boolean"==typeof h.visible?u=h.visible:"function"==typeof h.visible&&(u=h.visible(t,p)),u){if(n=ol.ext.element.create("TR",{parent:s}),ol.ext.element.create("TD",{html:h.title||l,parent:n}),this.get("showImage")&&/(http(s?):)([\/|.|\w|\s|-])*\.(?:jpg|gif|png)/.test(p))c=ol.ext.element.create("IMG",{src:p});else{c=(h.before||"")+p+(h.after||"");var g=this.get("maxChar")||200;"string"==typeof c&&c.length>g&&(c=c.substr(0,g)+"[...]")}ol.ext.element.create("TD",{html:c,parent:n})}}}if(ol.ext.element.create("BUTTON",{className:"ol-zoombt",parent:e}).addEventListener("click",function(){if("Point"===t.getGeometry().getType())this.getMap().getView().animate({center:t.getGeometry().getFirstCoordinate(),zoom:Math.max(this.getMap().getView().getZoom(),18)});else{var e=t.getGeometry().getExtent();this.getMap().getView().fit(e,{duration:1e3})}}.bind(this)),this._features.length>1){var d=ol.ext.element.create("DIV",{className:"ol-count",parent:e});ol.ext.element.create("DIV",{className:"ol-prev",parent:d,click:function(){this._count--;this._count<1&&(this._count=this._features.length);e=this._getHtml(this._features[this._count-1]);setTimeout(function(){ol.Overlay.Popup.prototype.show.call(this,this.getPosition(),e)}.bind(this),350)}.bind(this)});ol.ext.element.create("TEXT",{html:this._count+"/"+this._features.length,parent:d});ol.ext.element.create("DIV",{className:"ol-next",parent:d,click:function(){this._count++;this._count>this._features.length&&(this._count=1);e=this._getHtml(this._features[this._count-1]);setTimeout(function(){ol.Overlay.Popup.prototype.show.call(this,this.getPosition(),e)}.bind(this),350)}.bind(this)})}return this._select&&(this._noselect=!0,this._select.getFeatures().clear(),this._select.getFeatures().push(t),this._noselect=!1),e};ol.Overlay.PopupFeature.prototype.setFix=function(t){t?this.element.classList.add("ol-fixed"):this.element.classList.remove("ol-fixed")};ol.Overlay.PopupFeature.prototype.getFix=function(){return this.element.classList.contains("ol-fixed")};ol.Overlay.PopupFeature.localString=function(t,e){return function(o){if(o&&o.toLocaleString)return o.toLocaleString(t,e);var i=new Date(o);return isNaN(i)?o:i.toLocaleString(t,e)}};ol.Overlay.Tooltip=function(t){(t=t||{}).popupClass=t.popupClass||t.className||"tooltips black";t.positioning=t.positioning||"center-left";t.stopEvent=!!t.stopEvent;ol.Overlay.Popup.call(this,t);this.set("maximumFractionDigits",t.maximumFractionDigits||2);"function"==typeof t.formatLength&&(this.formatLength=t.formatLength);"function"==typeof t.formatArea&&(this.formatArea=t.formatArea);"function"==typeof t.getHTML&&(this.getHTML=t.getHTML);this._interaction=new ol.interaction.Interaction({handleEvent:function(t){if("pointermove"===t.type||"click"===t.type){var e=this.getHTML(this._feature,this.get("info"));e?this.show(t.coordinate,e):this.hide();this._coord=t.coordinate}return!0}.bind(this)})};ol.ext.inherits(ol.Overlay.Tooltip,ol.Overlay.Popup);ol.Overlay.Tooltip.prototype.setMap=function(t){this.getMap()&&this.getMap().removeInteraction(this._interaction);ol.Overlay.Popup.prototype.setMap.call(this,t);this.getMap()&&this.getMap().addInteraction(this._interaction)};ol.Overlay.Tooltip.prototype.getHTML=function(t,e){return this.get("measure")?this.get("measure")+(e?"<br/>"+e:""):e||""};ol.Overlay.Tooltip.prototype.setInfo=function(t){t?setTimeout(function(){this.set("info",t);this.show(this._coord,this.get("info"))}.bind(this)):(this.set("info",""),this.hide())};ol.Overlay.Tooltip.prototype.removeFeature=function(){this.setFeature()};ol.Overlay.Tooltip.prototype.formatArea=function(t){return t>Math.pow(10,-1*this.get("maximumFractionDigits"))?t>1e4?(t/1e6).toLocaleString(void 0,{maximumFractionDigits:this.get("maximumFractionDigits)")})+" km²":t.toLocaleString(void 0,{maximumFractionDigits:this.get("maximumFractionDigits")})+" m²":""};ol.Overlay.Tooltip.prototype.formatLength=function(t){return t>Math.pow(10,-1*this.get("maximumFractionDigits"))?t>100?(t/1e3).toLocaleString(void 0,{maximumFractionDigits:this.get("maximumFractionDigits")})+" km":t.toLocaleString(void 0,{maximumFractionDigits:this.get("maximumFractionDigits")})+" m":""};ol.Overlay.Tooltip.prototype.setFeature=function(t){t&&t.feature&&(t=t.feature);this._feature=t;this._listener&&this._listener.forEach(function(t){ol.Observable.unByKey(t)});this._listener=[];this.set("measure","");t&&this._listener.push(t.getGeometry().on("change",function(t){var e,o=t.target;o.getArea?e=this.formatArea(ol.sphere.getArea(o,{projection:this.getMap().getView().getProjection()})):o.getLength&&(e=this.formatLength(ol.sphere.getLength(o,{projection:this.getMap().getView().getProjection()})));this.set("measure",e)}.bind(this)))};ol.coordinate.convexHull,function(){var t=function(t,e,o){return(t[0]-o[0])*(e[1]-o[1])-(t[1]-o[1])*(e[0]-o[0])<=0};ol.coordinate.convexHull=function(e){var o;e.sort(function(t,e){return t[0]==e[0]?t[1]-e[1]:t[0]-e[0]});var i=[];for(o=0;o<e.length;o++){for(;i.length>=2&&t(i[i.length-2],i[i.length-1],e[o]);)i.pop();i.push(e[o])}var r=[];for(o=e.length-1;o>=0;o--){for(;r.length>=2&&t(r[r.length-2],r[r.length-1],e[o]);)r.pop();r.push(e[o])}return r.pop(),i.pop(),i.concat(r)};var e=function(t){var o,i,r=[];switch(t.getType()){case"Point":r.push(t.getCoordinates());break;case"LineString":case"LinearRing":case"MultiPoint":r=t.getCoordinates();break;case"MultiLineString":for(i=t.getLineStrings(),o=0;o<i.length;o++)r.concat(e(i[o]));break;case"Polygon":r=e(t.getLinearRing(0));break;case"MultiPolygon":for(i=t.getPolygons(),o=0;o<i.length;o++)r.concat(e(i[o]));break;case"GeometryCollection":for(i=t.getGeometries(),o=0;o<i.length;o++)r.concat(e(i[o]))}return r};ol.geom.Geometry.prototype.convexHull=function(){return ol.coordinate.convexHull(e(this))}}();ol.coordinate.toDFCI=function(t,e,o){e||0===e||(e=3);o&&(ol.proj.get("EPSG:27572")||(proj4.defs["EPSG:27572"]||proj4.defs("EPSG:27572","+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs"),ol.proj.proj4.register(proj4)),t=ol.proj.transform(t,o,"EPSG:27572"));var i=t[0],r=t[1],n="";if((n+=String.fromCharCode(65+Math.floor((i<8e5?i:i+2e5)/1e5))+String.fromCharCode(65+Math.floor((r<23e5?r:r+2e5)/1e5)-15),0===e)||(n+=2*Math.floor(i%1e5/2e4),n+=2*Math.floor(r%1e5/2e4),1===e))return n;var s=Math.floor(i%2e4/2e3);if(n+=String.fromCharCode(65+(s<8?s:s+2)),n+=Math.floor(r%2e4/2e3),2===e)return n;var a=Math.floor(i%2e3/500),l=Math.floor(r%2e3/500);return n+(a<1?l>1?".1":".4":a>2?l>1?".2":".3":l>2?a<2?".1":".2":l<1?a<2?".4":".3":".5")};ol.coordinate.fromDFCI=function(t,e){var o,i=1e5,r=t.charCodeAt(0)-65;r=(r<8?r:r-2)*i;var n=t.charCodeAt(1)-65;if(n=(n<8?n:n-2)*i+15e5,2===t.length)o=[r+i/2,n+i/2];else if(i/=5,r+=Number(t.charAt(2))/2*i,n+=Number(t.charAt(3))/2*i,4===t.length)o=[r+i/2,n+i/2];else{i/=10;var s=t.charCodeAt(4)-65;if(r+=(s<8?s:s-2)*i,n+=Number(t.charAt(5))*i,6===t.length)o=[r+i/2,n+i/2];else switch(t.charAt(7)){case"1":o=[r+i/4,n+3*i/4];break;case"2":o=[r+3*i/4,n+3*i/4];break;case"3":o=[r+3*i/4,n+i/4];break;case"4":o=[r+i/4,n+i/4];break;default:o=[r+i/2,n+i/2]}}return e&&(ol.proj.get("EPSG:27572")||(proj4.defs["EPSG:27572"]||proj4.defs("EPSG:27572","+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs"),ol.proj.proj4.register(proj4)),o=ol.proj.transform(o,"EPSG:27572",e)),o};ol.coordinate.validDFCI=function(t){return t.length<2||t.length>8?!1:/[^A-H|^K-N]/.test(t.substr(0,1))?!1:/[^B-H|^K-N]/.test(t.substr(1,1))?!1:t.length>2&&(t.length<4||/[^0,^2,^4,^6,^8]/.test(t.substr(2,1))||/[^0,^2,^4,^6,^8]/.test(t.substr(3,1)))?!1:t.length>4&&(t.length<6||/[^A-H|^K-L]/.test(t.substr(4,1))||/[^0-9]/.test(t.substr(5,1)))?!1:t.length>6&&(t.length<8||"."!==t.substr(6,1)||/[^1-5]/.test(t.substr(7,1)))?!1:!0};ol.coordinate.validDFCICoord=function(t,e){return e&&(ol.proj.get("EPSG:27572")||(proj4.defs["EPSG:27572"]||proj4.defs("EPSG:27572","+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs"),ol.proj.proj4.register(proj4)),t=ol.proj.transform(t,e,"EPSG:27572")),!(0>t[0]||t[0]>12e5)&&!(16e5>t[1]||t[1]>27e5)};ol.graph={};ol.graph.Dijskra=function(t){t=t||{};this.source=t.source;this.nodes=new ol.source.Vector;this.maxIteration=t.maxIteration||2e4;this.stepIteration=t.stepIteration||2e3;this.astar=!0;this.candidat=[];ol.Object.call(this);this.set("epsilon",t.epsilon||1e-6)};ol.ext.inherits(ol.graph.Dijskra,ol.Object);ol.graph.Dijskra.prototype.weight=function(){return 1};ol.graph.Dijskra.prototype.direction=function(){return 2};ol.graph.Dijskra.prototype.getLength=function(t){return t.getGeometry&&(t=t.getGeometry()),t.getLength()};ol.graph.Dijskra.prototype.getNodeSource=function(){return this.nodes};ol.graph.Dijskra.prototype.getEdges=function(t){var e=ol.extent.buffer(ol.extent.boundingExtent([t]),this.get("epsilon")),o=[];return this.source.forEachFeatureIntersectingExtent(e,function(t){o.push(t)}),o};ol.graph.Dijskra.prototype.getNode=function(t){var e=ol.extent.buffer(ol.extent.boundingExtent([t]),this.get("epsilon")),o=[];return this.nodes.forEachFeatureIntersectingExtent(e,function(t){o.push(t)}),o[0]};ol.graph.Dijskra.prototype.addNode=function(t,e,o,i,r){if(this.wdist&&e>this.wdist)return!1;var n=this.getNode(t),s=e+this.getLength(new ol.geom.LineString([this.end,t]))*this.weight();if(this.astar&&this.wdist&&s>this.wdist)return!1;if(n){if(n!==this.arrival&&n.get("wdist")<=e)return n;n.set("dist",o);n.set("wdist",e);n.set("dtotal",s);n.set("from",i);n.set("prev",r);n===this.arrival&&(this.wdist=e);this.candidat.push(n)}else n=new ol.Feature({geometry:new ol.geom.Point(t),from:i,prev:r,dist:o||0,wdist:e,dtotal:s}),e<0?n.set("wdist",!1):this.candidat.push(n),this.nodes.addFeature(n);return n};ol.graph.Dijskra.prototype.closestCoordinate=function(t){var e=this.source.getClosestFeatureToCoordinate(t),o=e.getGeometry().getFirstCoordinate(),i=e.getGeometry().getLastCoordinate();return ol.coordinate.dist2d(t,o)<ol.coordinate.dist2d(t,i)?o:i};ol.graph.Dijskra.prototype.path=function(t,e){if(this.running)return!1;if(t=this.closestCoordinate(t),this.end=this.closestCoordinate(e),t[0]===this.end[0]&&t[1]===this.end[1])return this.dispatchEvent({type:"finish",route:[],wDistance:-1,distance:this.wdist}),!1;var o=this;return this.nodes.clear(),this.candidat=[],this.wdist=0,this.running=!0,this.addNode(t,0),this.arrival=this.addNode(this.end,-1),this.nb=0,this.dispatchEvent({type:"start"}),setTimeout(function(){o._resume()}),[t,this.end]};ol.graph.Dijskra.prototype.resume=function(){this.running||this.candidat.length&&(this.running=!0,this.nb=0,this._resume())};ol.graph.Dijskra.prototype.pause=function(){this.running&&(this.nb=-1)};ol.graph.Dijskra.prototype.getBestWay=function(){for(var t,e,o=-1,i=0;e=this.candidat[i];i++)e.get("wdist")>o&&(t=e,o=e.get("wdist"));return this.getRoute(t)};ol.graph.Dijskra.prototype._resume=function(){if(this.running){for(;this.candidat.length;){this.candidat.sort(function(t,e){return t.get("dtotal")<e.get("dtotal")?1:t.get("dtotal")===e.get("dtotal")?0:-1});for(var t,e=this.candidat.pop(),o=e.getGeometry().getCoordinates(),i=this.getEdges(o),r=0;t=i[r];r++){if(e.get("from")!==t){var n=this.getLength(t);n<0&&console.log("distance < 0!");var s=e.get("wdist")+n*this.weight(t);n=e.get("dist")+n;var a=t.getGeometry().getFirstCoordinate(),l=t.getGeometry().getLastCoordinate(),c=this.direction(t);0!==c&&(o[0]===a[0]&&o[1]===a[1]&&-1!==c&&this.addNode(l,s,n,t,e),o[0]===l[0]&&o[0]===l[0]&&1!==c&&this.addNode(a,s,n,t,e))}if(-1===this.nb||this.nb++>this.maxIteration)return this.running=!1,void this.dispatchEvent({type:"pause",overflow:-1!==this.nb});if(!(this.nb%this.stepIteration)){var h=this;return window.setTimeout(function(){h._resume()},5),void this.dispatchEvent({type:"calculating"})}}}this.nodes.clear();this.running=!1;this.dispatchEvent({type:"finish",route:this.getRoute(this.arrival),wDistance:this.wdist,distance:this.arrival.get("dist")})}};ol.graph.Dijskra.prototype.getRoute=function(t){for(var e=[];t;)e.unshift(t.get("from")),t=t.get("prev");return e.shift(),e};ol.coordinate.dist2d=function(t,e){var o=t[0]-e[0],i=t[1]-e[1];return Math.sqrt(o*o+i*i)};ol.coordinate.equal=function(t,e){return t[0]==e[0]&&t[1]==e[1]};ol.coordinate.getFeatureCenter=function(t){return ol.coordinate.getGeomCenter(t.getGeometry())};ol.coordinate.getGeomCenter=function(t){switch(t.getType()){case"Point":return t.getCoordinates();case"MultiPolygon":t=t.getPolygon(0);case"Polygon":return t.getInteriorPoint().getCoordinates();default:return t.getClosestPoint(ol.extent.getCenter(t.getExtent()))}};ol.coordinate.offsetCoords=function(t,e){var o,i,r,n,s,a,l,c,h,p,u,g,d,m=[],f=t.length-1,y=f,v=ol.coordinate.equal(t[0],t[f]);v||(u=t[0],g=t[1],d=[u[0]+(g[1]-u[1])/ol.coordinate.dist2d(u,g)*e,u[1]-(g[0]-u[0])/ol.coordinate.dist2d(u,g)*e],m.push(d),t.push(t[f]),f++,y--);for(var _=0;_<y;_++)u=t[_],g=t[(_+1)%f],d=t[(_+2)%f],o=(g[1]-u[1])/(g[0]-u[0]),i=(d[1]-g[1])/(d[0]-g[0]),Math.abs(o-i)>1e-10&&(r=Math.sqrt((g[0]-u[0])*(g[0]-u[0])+(g[1]-u[1])*(g[1]-u[1])),n=Math.sqrt((d[0]-g[0])*(d[0]-g[0])+(d[1]-g[1])*(d[1]-g[1])),s=u[0]+e*(g[1]-u[1])/r,h=(i*(a=g[0]+e*(d[1]-g[1])/n)-o*s+(l=u[1]-e*(g[0]-u[0])/r)-(c=g[1]-e*(d[0]-g[0])/n))/(i-o),p=(o*i*(a-s)+i*l-o*c)/(i-o),g[0]-u[0]==0&&(p=i*(h=g[0]+e*(g[1]-u[1])/Math.abs(g[1]-u[1]))-i*a+c),d[0]-g[0]==0&&(p=o*(h=d[0]+e*(d[1]-g[1])/Math.abs(d[1]-g[1]))-o*s+l),m.push([h,p]));return v?m.push(m[0]):(t.pop(),u=t[t.length-1],g=t[t.length-2],d=[u[0]-(g[1]-u[1])/ol.coordinate.dist2d(u,g)*e,u[1]+(g[0]-u[0])/ol.coordinate.dist2d(u,g)*e],m.push(d)),m};ol.coordinate.findSegment=function(t,e){for(var o=0;o<e.length-1;o++){var i=e[o],r=e[o+1];if(ol.coordinate.equal(t,i)||ol.coordinate.equal(t,r))return{index:1,segment:[i,r]};var n=ol.coordinate.dist2d(i,r),s=[(r[0]-i[0])/n,(r[1]-i[1])/n],a=ol.coordinate.dist2d(i,t),l=[(t[0]-i[0])/a,(t[1]-i[1])/a];if(Math.abs(s[0]*l[1]-s[1]*l[0])<1e-10)return{index:1,segment:[i,r]}}return{index:-1}};ol.coordinate.splitH=function(t,e,o){for(var i,r,n=[],s=0;s<t.length-1;s++)t[s].length&&t[s+1].length&&(t[s][1]<=e&&t[s+1][1]>e||t[s][1]>=e&&t[s+1][1]<e)&&(i=(r=(e-t[s][1])/(t[s+1][1]-t[s][1]))*(t[s+1][0]-t[s][0])+t[s][0],n.push({contour:o,index:s,pt:[i,e],abs:r}));n.sort(function(t,e){return t.pt[0]-e.pt[0]});for(var a=[],l=0;l<n.length-1;l+=2)a.push([n[l],n[l+1]]);return a};ol.geom.createFromType=function(t,e){switch(t){case"LineString":return new ol.geom.LineString(e);case"LinearRing":return new ol.geom.LinearRing(e);case"MultiLineString":return new ol.geom.MultiLineString(e);case"MultiPoint":return new ol.geom.MultiPoint(e);case"MultiPolygon":return new ol.geom.MultiPolygon(e);case"Point":return new ol.geom.Point(e);case"Polygon":return new ol.geom.Polygon(e);default:return console.error("[createFromType] Unsupported type: "+t),null}};ol.geom.LineString.prototype.splitAt=function(t,e){var o;if(!t)return[this];if(e||(e=1e-10),t.length&&t[0].length){var i=[this];for(o=0;o<t.length;o++){for(var r=[],n=0;n<i.length;n++){var s=i[n].splitAt(t[o],e);r=r.concat(s)}i=r}return i}if(ol.coordinate.equal(t,this.getFirstCoordinate())||ol.coordinate.equal(t,this.getLastCoordinate()))return[this];var a=this.getCoordinates(),l=[a[0]],c=[];for(o=0;o<a.length-1;o++)if(!ol.coordinate.equal(a[o],a[o+1])){if(ol.coordinate.equal(t,a[o+1]))l.push(a[o+1]),c.push(new ol.geom.LineString(l)),l=[];else if(!ol.coordinate.equal(t,a[o])){var h,p,u=!1;a[o][0]==a[o+1][0]?(h=(a[o][1]-t[1])/(a[o][1]-a[o+1][1]),u=a[o][0]==t[0]&&0<h&&h<=1):a[o][1]==a[o+1][1]?(h=(a[o][0]-t[0])/(a[o][0]-a[o+1][0]),u=a[o][1]==t[1]&&0<h&&h<=1):(h=(a[o][0]-t[0])/(a[o][0]-a[o+1][0]),p=(a[o][1]-t[1])/(a[o][1]-a[o+1][1]),u=Math.abs(h-p)<=e&&0<h&&h<=1);u&&(l.push(t),c.push(new ol.geom.LineString(l)),l=[t])}l.push(a[o+1])}return l.length>1&&c.push(new ol.geom.LineString(l)),c.length?c:[this]};ol.geom.MultiPolygon.prototype.scribbleFill=function(t){for(var o,i,r=[],n=this.getPolygons(),e=0;o=n[e];e++){var s=o.scribbleFill(t);s&&r.push(s)}if(!r.length)return null;var a,l=r[0];for(e=0;i=r[e];e++){a=i.getLineStrings();for(var c=0;c<a.length;c++)l.appendLineString(a[c])}return l};ol.geom.Polygon.prototype.scribbleFill=function(t){var e,o,i,r=t.interval,n=t.angle||Math.PI/2,s=this.clone();s.rotate(n,[0,0]);var a=s.getCoordinates(),l=a[0];for(e=1;e<a.length;e++)l.push([]),l=l.concat(a[e]);for(var c=s.getExtent(),h=[],p=(Math.floor(c[1]/r)+1)*r;p<c[3];p+=r)i=ol.coordinate.splitH(l,p,e),h=h.concat(i);if(!h.length)return null;var u=l.length-1,g=h[0][0].index;for(o=0;i=h[o];o++)h[o][0].index=(h[o][0].index-g+u)%u,h[o][1].index=(h[o][1].index-g+u)%u;for(var d=[];;){for(o=0;(i=h[o])&&i[0].done;o++);if(!i)break;for(var m=[];i;){i[0].done=!0;m.push(i[0].pt);m.push(i[1].pt);for(var f=i[0].pt[1]+r,y=1/0,v=null;h[o]&&!(h[o][0].pt[1]>f);){if(h[o][0].pt[1]===f){var _=Math.min((h[o][0].index-i[0].index+u)%u,(i[0].index-h[o][0].index+u)%u),x=Math.min((i[1].index-i[0].index+u)%u,(i[0].index-i[1].index+u)%u);_<y&&_<x&&(y=_,v=h[o][0].done?null:h[o])}o++}i=v}m.length&&d.push(m)}if(!d.length)return null;var w=new ol.geom.MultiLineString(d);return w.rotate(-n,[0,0]),w.cspline({pointsPerSeg:8,tension:.9})};ol.sphere.greatCircleBearing=function(t,e){var o=Math.PI/180,i=[t[0]*o,t[1]*o],r=[e[0]*o,e[1]*o];return Math.atan2(Math.sin(r[0]-i[0])*Math.cos(r[1]),Math.cos(i[1])*Math.sin(r[1])-Math.sin(i[1])*Math.cos(r[1])*Math.cos(r[0]-i[0]))};ol.sphere.computeDestinationPoint=function(t,e,o,i){i=i||{};var r=Math.PI/180,n=i.radius||6371008.8,s=t[1]*r,a=t[0]*r,l=e/n,c=Math.asin(Math.sin(s)*Math.cos(l)+Math.cos(s)*Math.sin(l)*Math.cos(o)),h=(a+Math.atan2(Math.sin(o)*Math.sin(l)*Math.cos(s),Math.cos(l)-Math.sin(s)*Math.sin(c)))/r;return!1!==i.normalize&&(h<-180||h>180)&&(h=540*h%360-180),[h,c/r]};ol.sphere.greatCircleTrack=function(t,e,o){o=o||{};for(var i=ol.sphere.greatCircleBearing(t,e),r=ol.sphere.getDistance(t,e,o.radius),n=o.distance||1e3,s=n,a=[t];s<r;)a.push(ol.sphere.computeDestinationPoint(t,s,i,{radius:o.radius,normalize:!1})),s+=n;var l=ol.sphere.computeDestinationPoint(t,r,i,{radius:o.radius,normalize:!1});return Math.abs(l[0]-e[0])>1&&(l[0]>e[0]?e[0]+=360:e[0]-=360),a.push(e),a};ol.Map.prototype.animExtent=function(t,e){var o;(e=e||{}).projection&&(t=ol.proj.transformExtent(t,e.projection,this.getView().getProjection()));var i=(new Date).getTime(),r=e.duration||1e3,n=e.easing||ol.easing.upAndDown,s=e.style&&e.style.getWidth()||2,a=e.style&&e.style.getColr()||"red";o=this.on("postcompose",function(e){var l=e.frameState,c=l.pixelRatio,h=l.time-i;if(h>r)ol.Observable.unByKey(o);else{var p=h/r,u=this.getPixelFromCoordinate([t[0],t[1]]),g=this.getPixelFromCoordinate([t[2],t[3]]),d=e.context;d.save();d.scale(c,c);d.beginPath();d.globalAlpha=n(1-p);d.lineWidth=s;d.strokeStyle=a;d.rect(u[0],u[1],g[0]-u[0],g[1]-u[1]);d.stroke();d.restore();l.animate=!0}}.bind(this));this.renderSync()};ol.geom.Geometry.prototype.cspline=function(t){return this.calcCSpline_?(this.csplineGeometryRevision==this.getRevision()&&this.csplineOption==JSON.stringify(t)||(this.csplineGeometry_=this.calcCSpline_(t),this.csplineGeometryRevision=this.getRevision(),this.csplineOption=JSON.stringify(t)),this.csplineGeometry_):this};ol.geom.GeometryCollection.prototype.calcCSpline_=function(t){for(var e=[],o=this.getGeometries(),i=0;i<o.length;i++)e.push(o[i].cspline(t));return new ol.geom.GeometryCollection(e)};ol.geom.MultiLineString.prototype.calcCSpline_=function(t){for(var e=[],o=this.getLineStrings(),i=0;i<o.length;i++)e.push(o[i].cspline(t).getCoordinates());return new ol.geom.MultiLineString(e)};ol.geom.Polygon.prototype.calcCSpline_=function(t){for(var e=[],o=this.getCoordinates(),i=0;i<o.length;i++)e.push(new ol.geom.LineString(o[i]).cspline(t).getCoordinates());return new ol.geom.Polygon(e)};ol.geom.MultiPolygon.prototype.calcCSpline_=function(t){for(var e=[],o=this.getPolygons(),i=0;i<o.length;i++)e.push(o[i].cspline(t).getCoordinates());return new ol.geom.MultiPolygon(e)};ol.geom.LineString.prototype.calcCSpline_=function(t){t||(t={});var e,o,i,r,n,s,a,l,c,h,p,u,g,d,m=this.getCoordinates(),f="number"==typeof t.tension?t.tension:.5,y=t.resolution||this.getLength()/m.length/(t.pointsPerSeg||10),v=[];function _(t,e,o,i){var r=o-t,n=i-e;return Math.sqrt(r*r+n*n)}for(e=m.slice(0),m.length>2&&m[0][0]==m[m.length-1][0]&&m[0][1]==m[m.length-1][1]?(e.unshift(m[m.length-2]),e.push(m[1])):(e.unshift(m[0]),e.push(m[m.length-1])),d=1;d<e.length-2;d++){var x=_(e[d][0],e[d][1],e[d+1][0],e[d+1][1]),w=Math.round(x/y),S=1;if(t.normalize){x=_(e[d+1][0],e[d+1][1],e[d-1][0],e[d-1][1]);var b=_(e[d+2][0],e[d+2][1],e[d][0],e[d][1]);S=x<b?x/b:b/x}for(r=(e[d+1][0]-e[d-1][0])*f*S,n=(e[d+2][0]-e[d][0])*f*S,s=(e[d+1][1]-e[d-1][1])*f*S,a=(e[d+2][1]-e[d][1])*f*S,g=0;g<=w;g++)u=g/w,l=2*Math.pow(u,3)-3*Math.pow(u,2)+1,c=-2*Math.pow(u,3)+3*Math.pow(u,2),h=Math.pow(u,3)-2*Math.pow(u,2)+u,p=Math.pow(u,3)-Math.pow(u,2),o=l*e[d][0]+c*e[d+1][0]+h*r+p*n,i=l*e[d][1]+c*e[d+1][1]+h*s+p*a,o&&i&&v.push([o,i])}return new ol.geom.LineString(v)};ol.HexGrid=function(t){t=t||{};ol.Object.call(this,t);this.size_=t.size||8e4;this.origin_=t.origin||[0,0];this.layout_=this.layout[t.layout]||this.layout.pointy};ol.ext.inherits(ol.HexGrid,ol.Object);ol.HexGrid.prototype.layout={pointy:[Math.sqrt(3),Math.sqrt(3)/2,0,1.5,Math.sqrt(3)/3,-1/3,0,2/3,Math.cos(Math.PI/6),Math.sin(Math.PI/6),Math.cos(Math.PI/2),Math.sin(Math.PI/2),Math.cos(Math.PI/180*150),Math.sin(Math.PI/180*150),Math.cos(Math.PI/180*210),Math.sin(Math.PI/180*210),Math.cos(Math.PI/180*270),Math.sin(Math.PI/180*270),Math.cos(Math.PI/180*330),Math.sin(Math.PI/180*330)],flat:[1.5,0,Math.sqrt(3)/2,Math.sqrt(3),2/3,0,-1/3,Math.sqrt(3)/3,Math.cos(Math.PI*0),Math.sin(Math.PI*0),Math.cos(Math.PI/3),Math.sin(Math.PI/3),Math.cos(Math.PI/180*120),Math.sin(Math.PI/180*120),Math.cos(Math.PI*1),Math.sin(Math.PI*1),Math.cos(Math.PI/180*240),Math.sin(Math.PI/180*240),Math.cos(Math.PI/180*300),Math.sin(Math.PI/180*300)]};ol.HexGrid.prototype.setLayout=function(t){this.layout_=this.layout[t]||this.layout.pointy;this.changed()};ol.HexGrid.prototype.getLayout=function(){return 0!=this.layout_[9]?"pointy":"flat"};ol.HexGrid.prototype.setOrigin=function(t){this.origin_=t;this.changed()};ol.HexGrid.prototype.getOrigin=function(){return this.origin_};ol.HexGrid.prototype.setSize=function(t){this.size_=t||8e4;this.changed()};ol.HexGrid.prototype.getSize=function(){return this.size_};ol.HexGrid.prototype.cube2hex=function(t){return[t[0],t[2]]};ol.HexGrid.prototype.hex2cube=function(t){return[t[0],-t[0]-t[1],t[1]]};ol.HexGrid.prototype.hex2offset=function(t){return this.layout_[9]?[t[0]+(t[1]-(1&t[1]))/2,t[1]]:[t[0],t[1]+(t[0]+(1&t[0]))/2]};ol.HexGrid.prototype.offset2hex=function(t){return this.layout_[9]?[t[0]-(t[1]-(1&t[1]))/2,t[1]]:[t[0],t[1]-(t[0]+(1&t[0]))/2]};ol.HexGrid.prototype.cube_round=function(t){var e=Math.round(t[0]),o=Math.round(t[1]),i=Math.round(t[2]),r=Math.abs(e-t[0]),n=Math.abs(o-t[1]),s=Math.abs(i-t[2]);return r>n&&r>s?e=-o-i:n>s?o=-e-i:i=-e-o,[e,o,i]};ol.HexGrid.prototype.hex_round=function(t){return this.cube2hex(this.cube_round(this.hex2cube(t)))};ol.HexGrid.prototype.hex_corner=function(t,e,o){return[t[0]+e*this.layout_[8+o%6*2],t[1]+e*this.layout_[9+o%6*2]]};ol.HexGrid.prototype.getHexagonAtCoord=function(t){return this.getHexagon(this.coord2hex(t))};ol.HexGrid.prototype.getHexagon=function(t){for(var e=[],o=this.hex2coord(t),i=0;i<=7;i++)e.push(this.hex_corner(o,this.size_,i,this.layout_[8]));return e};ol.HexGrid.prototype.hex2coord=function(t){return[this.origin_[0]+this.size_*(this.layout_[0]*t[0]+this.layout_[1]*t[1]),this.origin_[1]+this.size_*(this.layout_[2]*t[0]+this.layout_[3]*t[1])]};ol.HexGrid.prototype.coord2hex=function(t){var e=[(t[0]-this.origin_[0])/this.size_,(t[1]-this.origin_[1])/this.size_],o=this.layout_[4]*e[0]+this.layout_[5]*e[1],i=this.layout_[6]*e[0]+this.layout_[7]*e[1];return this.hex_round([o,i])};ol.HexGrid.prototype.cube_distance=function(t,e){return Math.max(Math.abs(t[0]-e[0]),Math.abs(t[1]-e[1]),Math.abs(t[2]-e[2]))},function(){function t(t,e,o){return t+(e-t)*o}function e(e,o,i){return[t(e[0]+1e-6,o[0],i),t(e[1]+1e-6,o[1],i),t(e[2]+1e-6,o[2],i)]}ol.HexGrid.prototype.cube_line=function(t,o){var i=this.cube_distance(t,o);if(!i)return[t];for(var r=[],n=0;n<=i;n++)r.push(this.cube_round(e(t,o,n/i)));return r}}();ol.HexGrid.prototype.neighbors={cube:[[1,-1,0],[1,0,-1],[0,1,-1],[-1,1,0],[-1,0,1],[0,-1,1]],hex:[[1,0],[1,-1],[0,-1],[-1,0],[-1,1],[0,1]]};ol.HexGrid.prototype.hex_neighbors=function(t,e){if(void 0!==e)return[t[0]+this.neighbors.hex[e%6][0],t[1]+this.neighbors.hex[e%6][1]];var o=[];for(e=0;e<6;e++)o.push([t[0]+this.neighbors.hex[e][0],t[1]+this.neighbors.hex[e][1]]);return o};ol.HexGrid.prototype.cube_neighbors=function(t,e){if(void 0!==e)return[t[0]+this.neighbors.cube[e%6][0],t[1]+this.neighbors.cube[e%6][1],t[2]+this.neighbors.cube[e%6][2]];var o=[];for(e=0;e<6;e++)o.push([t[0]+this.neighbors.cube[e][0],t[1]+this.neighbors.cube[e][1],t[2]+this.neighbors.cube[e][2]]);for(e=0;e<6;e++)o[e]=this.cube2hex(o[e]);return o};ol.InseeGrid=function(t){t=t||{};proj4.defs["EPSG:3035"]||(proj4.defs("EPSG:3035","+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs"),ol.proj.proj4.register(proj4));ol.Object.call(this,t);var e=Math.max(200,200*Math.round((t.size||0)/200));this.set("size",e)};ol.ext.inherits(ol.InseeGrid,ol.Object);ol.InseeGrid.extent=[32e5,2e6,43e5,314e4];ol.InseeGrid.prototype.getExtent=function(t){return ol.proj.transformExtent(ol.InseeGrid.extent,t||"EPSG:3035","EPSG:3857")};ol.InseeGrid.prototype.getGridAtCoordinate=function(t,e){var o=ol.proj.transform(t,e||"EPSG:3857","EPSG:3035"),i=this.get("size"),r=Math.floor(o[0]/i)*i,n=Math.floor(o[1]/i)*i,s=new ol.geom.Polygon([[[r,n],[r+i,n],[r+i,n+i],[r,n+i],[r,n]]]);return s.transform("EPSG:3035",e||"EPSG:3857"),s};ol.Map.prototype.markup=function(t,e){var o,i=this;(e=e||{}).projection&&(t=ol.proj.transform(t,e.projection,this.getView().getProjection()));var r=(new Date).getTime(),n=e.delay||3e3,s=1e3,a=e.maxZoom||100,l=ol.easing.easeOut,c=e.style;return c||(c=new ol.style.Circle({radius:10,stroke:new ol.style.Stroke({color:"red",width:2})})),c instanceof ol.style.Image&&(c=new ol.style.Style({image:c})),c instanceof Array||(c=[c]),setTimeout(function(){o&&i.renderSync()},n),o=this.on("postcompose",function(e){var i=e.frameState,h=i.time-r;if(h>n+s)ol.Observable.unByKey(o),o=null;else{n>h&&this.getView().getZoom()>a&&(n=h);var p=i.pixelRatio,u=0;h>n&&(u=(h-n)/s);var g=e.context;g.save();g.beginPath();g.globalAlpha=l(1-u);for(var d=0;d<c.length;d++){var m=c[d].getImage(),f=m.getScale();m.setScale(f*p);e.vectorContext.setStyle(c[d]);e.vectorContext.drawGeometry(new ol.geom.Point(t));m.setScale(f)}g.restore();h>=n&&(i.animate=!0)}}.bind(this)),this.renderSync(),o.stop=function(){n=s=0;this.target.renderSync()},o};ol.ordering={};ol.ordering.yOrdering=function(){return function(t,e){return e.getGeometry().getExtent()[1]-t.getGeometry().getExtent()[1]}};ol.ordering.zIndex=function(t){t||(t={});var e=t.attribute||"zIndex";return t.equalFn?function(o,i){return o.get(e)==i.get(e)?t.equalFn(o,i):o.get(e)<i.get(e)?1:-1}:function(t,o){return t.get(e)==o.get(e)?0:t.get(e)<o.get(e)?1:-1}};ol.Map.prototype.pulse=function(t,e){var o;(e=e||{}).projection&&(t=ol.proj.transform(t,e.projection,this.getView().getProjection()));var i=(new Date).getTime(),r=e.duration||3e3,n=e.easing||ol.easing.easeOut,s=e.style;s||(s=new ol.style.Circle({radius:30,stroke:new ol.style.Stroke({color:"red",width:2})}));s instanceof ol.style.Image&&(s=new ol.style.Style({image:s}));s instanceof Array||(s=[s]);var a=e.amplitude||1;a<0&&(a=0);var l=e.radius||15;l<0&&(l=5);o=this.on("postcompose",function(e){var l=e.frameState,c=l.pixelRatio,h=l.time-i;if(h>r)ol.Observable.unByKey(o);else{var p=h/r,u=e.context;u.save();u.beginPath();var g=n(p);u.globalAlpha=n(1-p);console.log("anim");for(var d=0;d<s.length;d++){var m=s[d].getImage(),f=m.getScale();m.setScale(c*f*(1+a*(g-1)));e.vectorContext.setStyle(s[d]);e.vectorContext.drawGeometry(new ol.geom.Point(t));m.setScale(f)}u.restore();l.animate=!0}}.bind(this));this.renderSync()};ol.style.Chart=function(t){var e=t||{},o=0;t.stroke&&(o=t.stroke.getWidth());ol.style.RegularShape.call(this,{radius:e.radius+o,fill:new ol.style.Fill({color:[0,0,0]}),rotation:e.rotation,snapToPixel:e.snapToPixel});e.scale&&this.setScale(e.scale);this.stroke_=e.stroke;this.radius_=e.radius||20;this.donutratio_=e.donutRatio||.5;this.type_=e.type;this.offset_=[e.offsetX?e.offsetX:0,e.offsetY?e.offsetY:0];this.animation_="number"==typeof e.animation?{animate:!0,step:e.animation}:this.animation_={animate:!1,step:1};this.max_=e.max;this.data_=e.data;e.colors instanceof Array?this.colors_=e.colors:(this.colors_=ol.style.Chart.colors[e.colors],this.colors_||(this.colors_=ol.style.Chart.colors.classic));this.renderChart_()};ol.ext.inherits(ol.style.Chart,ol.style.RegularShape);ol.style.Chart.colors={classic:["#ffa500","blue","red","green","cyan","magenta","yellow","#0f0"],dark:["#960","#003","#900","#060","#099","#909","#990","#090"],pale:["#fd0","#369","#f64","#3b7","#880","#b5d","#666"],pastel:["#fb4","#79c","#f66","#7d7","#acc","#fdd","#ff9","#b9b"],neon:["#ff0","#0ff","#0f0","#f0f","#f00","#00f"]};ol.style.Chart.prototype.clone=function(){var t=new ol.style.Chart({type:this.type_,radius:this.radius_,rotation:this.getRotation(),scale:this.getScale(),data:this.getData(),snapToPixel:!!this.getSnapToPixel&&this.getSnapToPixel(),stroke:this.stroke_,colors:this.colors_,offsetX:this.offset_[0],offsetY:this.offset_[1],animation:this.animation_});return t.setScale(this.getScale()),t.setOpacity(this.getOpacity()),t};ol.style.Chart.prototype.getData=function(){return this.data_};ol.style.Chart.prototype.setData=function(t){this.data_=t;this.renderChart_()};ol.style.Chart.prototype.getRadius=function(){return this.radius_};ol.style.Chart.prototype.setRadius=function(t,e){this.radius_=t;this.donuratio_=e||this.donuratio_;this.renderChart_()};ol.style.Chart.prototype.setAnimation=function(t){if(!1===t){if(0==this.animation_.animate)return;this.animation_.animate=!1}else{if(this.animation_.step==t)return;this.animation_.animate=!0;this.animation_.step=t}this.renderChart_()};ol.style.Chart.prototype.renderChart_=function(){var t,e=0;this.stroke_&&(t=ol.color.asString(this.stroke_.getColor()),e=this.stroke_.getWidth());var o=this.getImage(),i=o.getContext("2d");i.clearRect(0,0,o.width,o.height);i.lineJoin="round";for(var n,s=0,r=0;r<this.data_.length;r++)s+=this.data_[r];i.setTransform(1,0,0,1,0,0);i.translate(0,0);var a=this.animation_.animate?this.animation_.step:1;switch(this.type_){case"donut":case"pie3D":case"pie":var l,c=Math.PI*(a-1.5);for(n=o.width/2,i.strokeStyle=t,i.lineWidth=e,i.save(),"pie3D"==this.type_&&(i.translate(0,.3*n),i.scale(1,.7),i.beginPath(),i.fillStyle="#369",i.arc(n,1.4*n,this.radius_*a,0,2*Math.PI),i.fill(),i.stroke()),"donut"==this.type_&&(i.save(),i.beginPath(),i.rect(0,0,2*n,2*n),i.arc(n,n,this.radius_*a*this.donutratio_,0,2*Math.PI),i.clip("evenodd")),r=0;r<this.data_.length;r++)i.beginPath(),i.moveTo(n,n),i.fillStyle=this.colors_[r%this.colors_.length],l=c+2*Math.PI*this.data_[r]/s*a,i.arc(n,n,this.radius_*a,c,l),i.closePath(),i.fill(),i.stroke(),c=l;"donut"==this.type_&&(i.restore(),i.beginPath(),i.strokeStyle=t,i.lineWidth=e,i.arc(n,n,this.radius_*a*this.donutratio_,Math.PI*(a-1.5),c),i.stroke());i.restore();break;case"bar":default:var h=0;if(this.max_)h=this.max_;else for(r=0;r<this.data_.length;r++)h<this.data_[r]&&(h=this.data_[r]);var p=Math.min(5,2*this.radius_/this.data_.length);n=o.width/2;var u,g=o.width-e,d=n-this.data_.length*p/2;for(i.strokeStyle=t,i.lineWidth=e,r=0;r<this.data_.length;r++){i.beginPath();i.fillStyle=this.colors_[r%this.colors_.length];u=d+p;var m=this.data_[r]/h*2*this.radius_*a;i.rect(d,g-m,p,m);i.closePath();i.fill();i.stroke();d=u}}var f=this.getAnchor();f[0]=n-this.offset_[0];f[1]=n-this.offset_[1]};ol.style.Chart.prototype.getChecksum=function(){var t=null!==this.stroke_?this.stroke_.getChecksum():"-";if(null===this.checksums_||t!=this.checksums_[1]||null!=this.checksums_[2]||this.radius_!=this.checksums_[3]||this.data_.join("|")!=this.checksums_[4]){var e="c"+t+void 0+(void 0!==this.radius_?this.radius_.toString():"-")+this.data_.join("|");this.checksums_=[e,t,void 0,this.radius_,this.data_.join("|")]}return this.checksums_[0]};ol.style.FillPattern=function(t){var e;t||(t={});var o=this.canvas_=document.createElement("canvas"),i=(Number(t.scale)>0?Number(t.scale):1)*ol.has.DEVICE_PIXEL_RATIO||ol.has.DEVICE_PIXEL_RATIO,r=o.getContext("2d");if(t.image){var n;t.image.load();var s=t.image.getImage();if(s.width)o.width=Math.round(s.width*i),o.height=Math.round(s.height*i),r.globalAlpha="number"==typeof t.opacity?t.opacity:1,r.drawImage(s,0,0,s.width,s.height,0,0,o.width,o.height),e=r.createPattern(o,"repeat");else{var a=this;e=[0,0,0,0];s.onload=function(){o.width=Math.round(s.width*i);o.height=Math.round(s.height*i);r.globalAlpha="number"==typeof t.opacity?t.opacity:1;r.drawImage(s,0,0,s.width,s.height,0,0,o.width,o.height);e=r.createPattern(o,"repeat");a.setColor(e)}}}else{var l=this.getPattern_(t);if(o.width=Math.round(l.width*i),o.height=Math.round(l.height*i),r.beginPath(),t.fill&&(r.fillStyle=ol.color.asString(t.fill.getColor()),r.fillRect(0,0,o.width,o.height)),r.scale(i,i),r.lineCap="round",r.lineWidth=l.stroke||1,r.fillStyle=ol.color.asString(t.color||"#000"),r.strokeStyle=ol.color.asString(t.color||"#000"),l.circles)for(n=0;n<l.circles.length;n++){var c=l.circles[n];r.beginPath();r.arc(c[0],c[1],c[2],0,2*Math.PI);l.fill&&r.fill();l.stroke&&r.stroke()}if(l.repeat||(l.repeat=[[0,0]]),l.char&&(r.font=l.font||l.width+"px Arial",r.textAlign="center",r.textBaseline="middle",l.angle?(r.fillText(l.char,l.width/4,l.height/4),r.fillText(l.char,5*l.width/4,5*l.height/4),r.fillText(l.char,l.width/4,5*l.height/4),r.fillText(l.char,5*l.width/4,l.height/4),r.fillText(l.char,3*l.width/4,3*l.height/4),r.fillText(l.char,-l.width/4,-l.height/4),r.fillText(l.char,3*l.width/4,-l.height/4),r.fillText(l.char,-l.width/4,3*l.height/4)):r.fillText(l.char,l.width/2,l.height/2)),l.lines)for(n=0;n<l.lines.length;n++)for(var h=0;h<l.repeat.length;h++){var p=l.lines[n];r.beginPath();r.moveTo(p[0]+l.repeat[h][0],p[1]+l.repeat[h][1]);for(var u=2;u<p.length;u+=2)r.lineTo(p[u]+l.repeat[h][0],p[u+1]+l.repeat[h][1]);l.fill&&r.fill();l.stroke&&r.stroke();r.save();r.strokeStyle="red";r.strokeWidth=.1;r.restore()}if(e=r.createPattern(o,"repeat"),t.offset){var g=t.offset;if("number"==typeof g&&(g=[g,g]),g instanceof Array){var d=Math.round(g[0]*i),m=Math.round(g[1]*i);r.scale(1/i,1/i);r.clearRect(0,0,o.width,o.height);r.translate(d,m);r.fillStyle=e;r.fillRect(-d,-m,o.width,o.height);e=r.createPattern(o,"repeat")}}}ol.style.Fill.call(this,{color:e})};ol.ext.inherits(ol.style.FillPattern,ol.style.Fill);ol.style.FillPattern.prototype.clone=function(){var t=ol.style.Fill.prototype.clone.call(this);return t.canvas_=this.canvas_,t};ol.style.FillPattern.prototype.getImage=function(){return this.canvas_};ol.style.FillPattern.prototype.getPattern_=function(t){var e,o=ol.style.FillPattern.prototype.patterns[t.pattern]||ol.style.FillPattern.prototype.patterns.dot,i=Math.round(t.spacing)||10;switch(t.pattern){case"dot":case"circle":e=0===t.size?0:t.size/2||2;t.angle?(i=o.width=o.height=Math.round(1.4*i),o.circles=[[i/4,i/4,e],[3*i/4,3*i/4,e]],"circle"==t.pattern&&(o.circles=o.circles.concat([[i/4+i,i/4,e],[i/4,i/4+i,e],[3*i/4-i,3*i/4,e],[3*i/4,3*i/4-i,e],[i/4+i,i/4+i,e],[3*i/4-i,3*i/4-i,e]]))):(o.width=o.height=i,o.circles=[[i/2,i/2,e]],"circle"==t.pattern&&(o.circles=o.circles.concat([[i/2+i,i/2,e],[i/2-i,i/2,e],[i/2,i/2+i,e],[i/2,i/2-i,e],[i/2+i,i/2+i,e],[i/2+i,i/2-i,e],[i/2-i,i/2+i,e],[i/2-i,i/2-i,e]])));break;case"tile":case"square":e=0===t.size?0:t.size/2||2;t.angle?(o.width=o.height=i,o.lines=[[i/2-e,i/2,i/2,i/2-e,i/2+e,i/2,i/2,i/2+e,i/2-e,i/2]]):(o.width=o.height=i,o.lines=[[i/2-e,i/2-e,i/2+e,i/2-e,i/2+e,i/2+e,i/2-e,i/2+e,i/2-e,i/2-e]]);"square"==t.pattern&&(o.repeat=[[0,0],[0,i],[i,0],[0,-i],[-i,0],[-i,-i],[i,i],[-i,i],[i,-i]]);break;case"cross":t.angle&&(t.angle=45);case"hatch":var r=Math.round(((t.angle||0)-90)%360);r>180&&(r-=360);r*=Math.PI/180;var n=Math.cos(r),s=Math.sin(r);if(Math.abs(s)<.0001)o.width=o.height=i,o.lines=[[0,.5,i,.5]],o.repeat=[[0,0],[0,i]];else if(Math.abs(n)<.0001)o.width=o.height=i,o.lines=[[.5,0,.5,i]],o.repeat=[[0,0],[i,0]],"cross"==t.pattern&&(o.lines.push([0,.5,i,.5]),o.repeat.push([0,i]));else{var a=o.width=Math.round(Math.abs(i/s))||1,l=o.height=Math.round(Math.abs(i/n))||1;"cross"==t.pattern?(o.lines=[[-a,-l,2*a,2*l],[2*a,-l,-a,2*l]],o.repeat=[[0,0]]):n*s>0?(o.lines=[[-a,-l,2*a,2*l]],o.repeat=[[0,0],[a,0],[0,l]]):(o.lines=[[2*a,-l,-a,2*l]],o.repeat=[[0,0],[-a,0],[0,l]])}o.stroke=0===t.size?0:t.size||4}return o};ol.style.FillPattern.addPattern=function(t,e){e||(e={});ol.style.FillPattern.prototype.patterns[t||e.char]={width:e.width||e.size||10,height:e.height||e.size||10,font:e.font,char:e.char,circles:e.circles,lines:e.lines,repeat:e.repeat,stroke:e.stroke,angle:e.angle,fill:e.fill}};ol.style.FillPattern.prototype.patterns={hatch:{width:5,height:5,lines:[[0,2.5,5,2.5]],stroke:1},cross:{width:7,height:7,lines:[[0,3,10,3],[3,0,3,10]],stroke:1},dot:{width:8,height:8,circles:[[5,5,2]],stroke:!1,fill:!0},circle:{width:10,height:10,circles:[[5,5,2]],stroke:1,fill:!1},square:{width:10,height:10,lines:[[3,3,3,8,8,8,8,3,3,3]],stroke:1,fill:!1},tile:{width:10,height:10,lines:[[3,3,3,8,8,8,8,3,3,3]],fill:!0},woven:{width:12,height:12,lines:[[3,3,9,9],[0,12,3,9],[9,3,12,0],[-1,1,1,-1],[13,11,11,13]],stroke:1},crosses:{width:8,height:8,lines:[[2,2,6,6],[2,6,6,2]],stroke:1},caps:{width:8,height:8,lines:[[2,6,4,2,6,6]],stroke:1},nylon:{width:20,height:20,lines:[[1,6,1,1,6,1],[6,11,11,11,11,6],[11,16,11,21,16,21],[16,11,21,11,21,16]],repeat:[[0,0],[-20,0],[0,-20]],stroke:1},hexagon:{width:20,height:12,lines:[[0,10,4,4,10,4,14,10,10,16,4,16,0,10]],stroke:1,repeat:[[0,0],[10,6],[10,-6],[-10,-6]]},cemetry:{width:15,height:19,lines:[[0,3.5,7,3.5],[3.5,0,3.5,10]],stroke:1,repeat:[[0,0],[7,9]]},sand:{width:20,height:20,circles:[[1,2,1],[9,3,1],[2,16,1],[7,8,1],[6,14,1],[4,19,1],[14,2,1],[12,10,1],[14,18,1],[18,8,1],[18,14,1]],fill:1},conglomerate:{width:30,height:20,circles:[[2,4,1],[17,3,1],[26,18,1],[12,17,1],[5,17,2],[28,11,2]],lines:[[7,5,6,7,9,9,11,8,11,6,9,5,7,5],[16,10,15,13,16,14,19,15,21,13,22,9,20,8,19,8,16,10],[24,6,26,7,27,5,26,4,24,4,24,6]],stroke:1},gravel:{width:15,height:10,circles:[[4,2,1],[5,9,1],[1,7,1]],lines:[[7,5,6,6,7,7,8,7,9,7,10,5,9,4,7,5],[11,2,14,4,14,1,12,1,11,2]],stroke:1},brick:{width:18,height:16,lines:[[0,1,18,1],[0,10,18,10],[6,1,6,10],[12,10,12,18],[12,0,12,1]],stroke:1},dolomite:{width:20,height:16,lines:[[0,1,20,1],[0,9,20,9],[1,9,6,1],[11,9,14,16],[14,0,14.4,1]],stroke:1},coal:{width:20,height:16,lines:[[1,5,7,1,7,7],[11,10,12,5,18,9],[5,10,2,15,9,15],[15,16,15,13,20,16],[15,0,15,2,20,0]],fill:1},breccia:{width:20,height:16,lines:[[1,5,7,1,7,7,1,5],[11,10,12,5,18,9,11,10],[5,10,2,15,9,15,5,10],[15,16,15,13,22,18],[15,0,15,2,20,0]],stroke:1},clay:{width:20,height:20,lines:[[0,0,3,11,0,20],[11,0,10,3,13,13,11,20],[0,0,10,3,20,0],[0,12,3,11,13,13,20,12]],stroke:1},flooded:{width:15,height:10,lines:[[0,1,10,1],[0,6,5,6],[10,6,15,6]],stroke:1},chaos:{width:40,height:40,lines:[[40,2,40,0,38,0,40,2],[4,0,3,2,2,5,0,0,0,3,2,7,5,6,7,7,8,10,9,12,9,13,9,14,8,14,6,15,2,15,0,20,0,22,2,20,5,19,8,15,10,14,11,12.25,10,12,10,10,12,9,13,7,12,6,13,4,16,7,17,4,20,0,18,0,15,3,14,2,14,0,12,1,11,0,10,1,11,4,10,7,9,8,8,5,6,4,5,3,5,1,5,0,4,0],[7,1,7,3,8,3,8,2,7,1],[4,3,5,5,4,5,4,3],[34,5,33,7,38,10,38,8,36,5,34,5],[27,0,23,2,21,8,30,0,27,0],[25,8,26,12,26,16,22.71875,15.375,20,13,18,15,17,18,13,22,17,21,19,22,21,20,19,18,22,17,30,25,26,26,24,28,21.75,33.34375,20,36,18,40,20,40,24,37,25,32,27,31,26,38,27,37,30,32,32,35,36,37,38,40,38,39,40,40,37,36,34,32,37,31,36,29,33,27,34,24,39,21,40,21,40,16,37,20,31,22,32,25,27,20,29,15,30,20,32,20,34,18,33,12,31,11,29,14,26,9,25,8],[39,24,37,26,40,28,39,24],[13,15,9,19,14,18,13,15],[18,23,14,27,16,27,17,25,20,26,18,23],[6,24,2,26,1,28,2,30,5,28,12,30,16,32,18,30,15,30,12,28,9,25,7,27,6,24],[29,27,32,28,33,31,30,29,27,28,29,27],[5,35,1,33,3,36,13,38,15,35,10,36,5,35]],fill:1},grass:{width:27,height:22,lines:[[0,10.5,13,10.5],[2.5,10,1.5,7],[4.5,10,4.5,5,3.5,4],[7,10,7.5,6,8.5,3],[10,10,11,6]],repeat:[[0,0],[14,10]],stroke:1},swamp:{width:24,height:23,lines:[[0,10.5,9.5,10.5],[2.5,10,2.5,7],[4.5,10,4.5,4],[6.5,10,6.5,6],[3,12.5,7,12.5]],repeat:[[0,0],[14,10]],stroke:1},wave:{width:10,height:8,lines:[[0,0,5,4,10,0]],stroke:1},vine:{width:13,height:13,lines:[[3,0,3,6],[9,7,9,13]],stroke:1},forest:{width:55,height:30,circles:[[7,7,3.5],[20,20,1.5],[42,22,3.5],[35,5,1.5]],stroke:1},scrub:{width:26,height:20,lines:[[1,4,4,8,6,4]],circles:[[20,13,1.5]],stroke:1},tree:{width:30,height:30,lines:[[7.78,10.61,4.95,10.61,4.95,7.78,3.54,7.78,2.12,6.36,.71,6.36,0,4.24,.71,2.12,4.24,0,7.78,.71,9.19,3.54,7.78,4.95,7.07,7.07,4.95,7.78]],repeat:[[3,1],[18,16]],stroke:1},pine:{width:30,height:30,lines:[[5.66,11.31,2.83,11.31,2.83,8.49,0,8.49,2.83,0,5.66,8.49,2.83,8.49]],repeat:[[3,1],[18,16]],stroke:1},pines:{width:22,height:20,lines:[[1,4,3.5,1,6,4],[1,8,3.5,5,6,8],[3.5,1,3.5,11],[12,14.5,14.5,14,17,14.5],[12,18,17,18],[14.5,12,14.5,18]],repeat:[[2,1]],stroke:1},rock:{width:20,height:20,lines:[[1,0,1,9],[4,0,4,9],[7,0,7,9],[10,1,19,1],[10,4,19,4],[10,7,19,7],[0,11,9,11],[0,14,9,14],[0,17,9,17],[12,10,12,19],[15,10,15,19],[18,10,18,19]],repeat:[[.5,.5]],stroke:1},rocks:{width:20,height:20,lines:[[5,0,3,0,5,4,4,6,0,3,0,5,3,6,5,9,3.75,10,2.5,10,0,9,0,10,4,11,5,14,4,15,0,13,0,13,0,13,0,14,0,14,5,16,5,18,3,19,0,19,-.25,19.9375,5,20,10,19,10,20,11,20,12,19,14,20,15,20,17,19,20,20,20,19,19,16,20,15,20,11,20,10,19,8,20,5,20,0,19,0,20,2,19,4,17,4,16,3,15,0,14,0,15,4,11,5,10,4,11,0,10,0,9,4,6,5,5,0],[18,5,19,6,18,10,16,10,14,9,16,5,18,5],[5,6,9,5,10,6,10,9,6,10,5,6],[14,5,14,8,13,9,12,9,11,7,12,5,14,5],[5,11,8,10,9,11,10,14,6,15,6,15,5,11],[13,10,14,11,15,14,15,14,15,14,11,15,10,11,11,10,13,10],[15,12,16,11,19,11,19,15,16,14,16,14,15,12],[6,16,9,15,10,18,5,19,6,16],[10,16,14,16,14,18,13,19,11,18,10,16],[15,15,18,16,18,18,16,19,15,18,15,15]],stroke:1}};ol.style.FlowLine=function(t){t||(t={});ol.style.Style.call(this,{renderer:this._render.bind(this),geometry:t.geometry});this._visible=!1!==t.visible;"function"==typeof t.width?this._widthFn=t.width:this.setWidth(t.width);this.setWidth2(t.width2);"function"==typeof t.color?this._colorFn=t.color:this.setColor(t.color);this.setColor2(t.color2);this.setLineCap(t.lineCap)};ol.ext.inherits(ol.style.FlowLine,ol.style.Style);ol.style.FlowLine.prototype.setWidth=function(t){this._width=t||0};ol.style.FlowLine.prototype.setWidth2=function(t){this._width2=t};ol.style.FlowLine.prototype.setLineCap=function(t){this._lineCap="round"===t?"round":"mitter"};ol.style.FlowLine.prototype.getWidth=function(t,e){if(this._widthFn)return this._widthFn(t,e);var o="number"==typeof this._width2?this._width2:this._width;return this._width+(o-this._width)*e};ol.style.FlowLine.prototype.setColor=function(t){try{this._color=ol.color.asArray(t)}catch(t){this._color=[0,0,0,1]}};ol.style.FlowLine.prototype.setColor2=function(t){try{this._color2=ol.color.asArray(t)}catch(t){this._color2=null}};ol.style.FlowLine.prototype.getColor=function(t,e){if(this._colorFn)return ol.color.asString(this._colorFn(t,e));var o=this._color,i=this._color2||this._color;return"rgba("+ +Math.round(o[0]+(i[0]-o[0])*e)+","+Math.round(o[1]+(i[1]-o[1])*e)+","+Math.round(o[2]+(i[2]-o[2])*e)+","+(o[3]+(i[3]-o[3])*e)+")"};ol.style.FlowLine.prototype._render=function(t,e){if("LineString"===e.geometry.getType()){var o,i,r=e.context;if(!this._visible){var n=e.pixelRatio/e.resolution,s=e.geometry.getCoordinates(),a=t[0][0]-s[0][0]*n,l=t[0][1]+s[0][1]*n;for(t=[],o=0;i=s[o];o++)t[o]=[a+i[0]*n,l-i[1]*n]}var c=this._splitInto(t,255,2),h=0,p=c.length;r.save();r.lineJoin="round";r.lineCap=this._lineCap||"mitter";c.forEach(function(t){var n=h++/p;for(r.lineWidth=this.getWidth(e.feature,n)*e.pixelRatio,r.strokeStyle=this.getColor(e.feature,n),r.beginPath(),r.moveTo(t[0][0],t[0][1]),o=1;i=t[o];o++)r.lineTo(i[0],i[1]),r.stroke()}.bind(this));r.restore()}};ol.style.FlowLine.prototype._splitInto=function(t,e,o){for(var r,n,s=[],a=0,i=1;r=t[i];i++)a+=ol.coordinate.dist2d(t[i-1],r);var l=Math.max(o||2,a/(e||255)),c=t[0];a=0;var h=[c];for(i=1,r=t[1];i<t.length;){var p=r[0]-c[0],u=r[1]-c[1];if(a+(n=Math.sqrt(p*p+u*u))>l){var g=(l-a)/n;h.push([c[0]+p*g,c[1]+u*g]);s.push(h);h=[c=[c[0]+p*g*.9,c[1]+u*g*.9]];a=0}else a+=n,c=r,h.push(c),r=t[++i]}return s.push(h),s};ol.style.FontSymbol=function(t){var e=0;(t=t||{}).stroke&&(e=t.stroke.getWidth());ol.style.RegularShape.call(this,{radius:t.radius,fill:t.fill,rotation:t.rotation,rotateWithView:t.rotateWithView});"number"==typeof t.opacity&&this.setOpacity(t.opacity);this.color_=t.color;this.fontSize_=t.fontSize||1;this.fontStyle_=t.fontStyle||"";this.stroke_=t.stroke;this.fill_=t.fill;this.radius_=t.radius-e;this.form_=t.form||"none";this.gradient_=t.gradient;this.offset_=[t.offsetX?t.offsetX:0,t.offsetY?t.offsetY:0];this.glyph_=this.getGlyph(t.glyph)||"";this.renderMarker_()};ol.ext.inherits(ol.style.FontSymbol,ol.style.RegularShape);ol.style.Image.prototype.getImagePNG=function(){var t=this.getImage();if(!t)return!1;try{return t.toDataURL("image/png")}catch(t){return!1}};ol.style.FontSymbol.prototype.defs={fonts:{},glyphs:{}};ol.style.FontSymbol.addDefs=function(t,e){var o=t;if("string"==typeof t&&(o={font:t,name:t,copyright:""}),o.font&&"string"==typeof o.font){var i=o.font;for(var r in ol.style.FontSymbol.prototype.defs.fonts[i]=o,e){var n=e[r];"string"==typeof n&&1==n.length&&(n={char:n});ol.style.FontSymbol.prototype.defs.glyphs[r]={font:o.font,char:n.char||""+String.fromCharCode(n.code)||"",theme:n.theme||o.name,name:n.name||r,search:n.search||""}}}else console.log("bad font def")};ol.style.FontSymbol.prototype.clone=function(){var t=new ol.style.FontSymbol({glyph:"",color:this.color_,fontSize:this.fontSize_,fontStyle:this.fontStyle_,stroke:this.stroke_,fill:this.fill_,radius:this.radius_+(this.stroke_?this.stroke_.getWidth():0),form:this.form_,gradient:this.gradient_,offsetX:this.offset_[0],offsetY:this.offset_[1],opacity:this.getOpacity(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()});return t.setScale(this.getScale()),t.glyph_=this.glyph_,t.renderMarker_(),t};ol.style.FontSymbol.prototype.getFill=function(){return this.fill_};ol.style.FontSymbol.prototype.getStroke=function(){return this.stroke_};ol.style.FontSymbol.prototype.getGlyph=function(t){return t?ol.style.FontSymbol.prototype.defs.glyphs[t]||{font:"none",char:t.charAt(0),theme:"none",name:"none",search:""}:this.glyph_};ol.style.FontSymbol.prototype.getGlyphName=function(){for(var t in ol.style.FontSymbol.prototype.defs.glyphs)if(ol.style.FontSymbol.prototype.defs.glyphs[t]===this.glyph_)return t;return""};ol.style.FontSymbol.prototype.getFontInfo=function(t){return ol.style.FontSymbol.prototype.defs.fonts[t.font]};ol.style.FontSymbol.prototype.renderMarker_=function(){var t,e=0;this.stroke_&&(t=ol.color.asString(this.stroke_.getColor()),e=this.stroke_.getWidth());var o=this.getImage(),i={strokeStyle:t,strokeWidth:e,size:o.width},r=o.getContext("2d");r.clearRect(0,0,o.width,o.height);this.drawMarker_(i,r,0,0);var n=this.getAnchor();n[0]=o.width/2-this.offset_[0];n[1]=o.width/2-this.offset_[1]};ol.style.FontSymbol.prototype.drawPath_=function(t,e){var o=2*this.radius_+t.strokeWidth+1,i=t.strokeWidth/2,r=t.size/2,n={fac:1,posX:t.size/2,posY:t.size/2};switch(e.lineJoin="round",e.beginPath(),this.form_){case"none":n.fac=1;break;case"circle":case"ban":e.arc(r,r,o/2,0,2*Math.PI,!0);break;case"poi":e.arc(r,r-.4*this.radius_,.6*this.radius_,.15*Math.PI,.85*Math.PI,!0);e.lineTo(r-.89*.05*o,(.95+.45*.05)*o+i);e.arc(r,.95*o+i,.05*o,.85*Math.PI,.15*Math.PI,!0);n={fac:.45,posX:r,posY:r-.35*this.radius_};break;case"bubble":e.arc(r,r-.2*this.radius_,.8*this.radius_,.4*Math.PI,.6*Math.PI,!0);e.lineTo(.5*o+i,o+i);n={fac:.7,posX:r,posY:r-.2*this.radius_};break;case"marker":e.arc(r,r-.2*this.radius_,.8*this.radius_,.25*Math.PI,.75*Math.PI,!0);e.lineTo(.5*o+i,o+i);n={fac:.7,posX:r,posY:r-.2*this.radius_};break;case"coma":e.moveTo(r+.8*this.radius_,r-.2*this.radius_);e.quadraticCurveTo(.95*o+i,.75*o+i,.5*o+i,o+i);e.arc(r,r-.2*this.radius_,.8*this.radius_,.45*Math.PI,0,!1);n={fac:.7,posX:r,posY:r-.2*this.radius_};break;default:var s;switch(this.form_){case"shield":s=[.05,0,.95,0,.95,.8,.5,1,.05,.8,.05,0];n.posY=.45*o+i;break;case"blazon":s=[.1,0,.9,0,.9,.8,.6,.8,.5,1,.4,.8,.1,.8,.1,0];n.fac=.8;n.posY=.4*o+i;break;case"bookmark":s=[.05,0,.95,0,.95,1,.5,.8,.05,1,.05,0];n.fac=.9;n.posY=.4*o+i;break;case"hexagon":s=[.05,.2,.5,0,.95,.2,.95,.8,.5,1,.05,.8,.05,.2];n.fac=.9;n.posY=.5*o+i;break;case"diamond":s=[.25,0,.75,0,1,.2,1,.4,.5,1,0,.4,0,.2,.25,0];n.fac=.75;n.posY=.35*o+i;break;case"triangle":s=[0,0,1,0,.5,1,0,0];n.fac=.6;n.posY=.3*o+i;break;case"sign":s=[.5,.05,1,.95,0,.95,.5,.05];n.fac=.7;n.posY=.65*o+i;break;case"lozenge":s=[.5,0,1,.5,.5,1,0,.5,.5,0];n.fac=.7;break;case"square":default:s=[0,0,1,0,1,1,0,1,0,0]}for(var a=0;a<s.length;a+=2)e.lineTo(s[a]*o+i,s[a+1]*o+i)}return e.closePath(),n};ol.style.FontSymbol.prototype.drawMarker_=function(t,e,o,i){var r=this.fill_?this.fill_.getColor():"#000",n=this.stroke_?this.stroke_.getColor():"#000";"none"==this.form_&&this.stroke_&&this.fill_&&(n=this.fill_.getColor(),r=this.stroke_.getColor());e.setTransform(1,0,0,1,0,0);e.translate(o,i);var s=this.drawPath_(t,e);if(this.fill_){if(this.gradient_&&"none"!=this.form_){var a=e.createLinearGradient(0,0,t.size/2,t.size);a.addColorStop(1,ol.color.asString(r));a.addColorStop(0,ol.color.asString(n));e.fillStyle=a}else e.fillStyle=ol.color.asString(r);e.fill()}if(this.stroke_&&t.strokeWidth&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,e.stroke()),this.glyph_.char){e.font=this.fontStyle_+" "+2*s.fac*this.radius_*this.fontSize_+"px "+this.glyph_.font;e.strokeStyle=e.fillStyle;e.lineWidth=t.strokeWidth*("none"==this.form_?2:1);e.fillStyle=ol.color.asString(this.color_||n);e.textAlign="center";e.textBaseline="middle";var l=this.glyph_.char;t.strokeWidth&&"transparent"!=n&&e.strokeText(l,s.posX,s.posY);e.fillText(l,s.posX,s.posY)}if("ban"==this.form_&&this.stroke_&&t.strokeWidth){e.strokeStyle=t.strokeStyle;e.lineWidth=t.strokeWidth;var c=this.radius_+t.strokeWidth,h=this.radius_*Math.cos(Math.PI/4);e.moveTo(c+h,c-h);e.lineTo(c-h,c+h);e.stroke()}};ol.style.FontSymbol.prototype.getChecksum=function(){var t=null!==this.stroke_?this.stroke_.getChecksum():"-",e=null!==this.fill_?this.fill_.getChecksum():"-";if(null===this.checksums_||t!=this.checksums_[1]||e!=this.checksums_[2]||this.radius_!=this.checksums_[3]||this.form_+"-"+this.glyphs_!=this.checksums_[4]){var o="c"+t+e+(void 0!==this.radius_?this.radius_.toString():"-")+this.form_+"-"+this.glyphs_;this.checksums_=[o,t,e,this.radius_,this.form_+"-"+this.glyphs_]}return this.checksums_[0]};ol.style.Photo=function(t){t=t||{};this.sanchor_="anchored"==t.kind?8:0;this.shadow_=Number(t.shadow)||0;t.stroke||(t.stroke=new ol.style.Stroke({width:0,color:"#000"}));var e=t.stroke.getWidth();if(e<0&&(e=0),"folio"==t.kind&&(e+=6),t.stroke.setWidth(e),ol.style.RegularShape.call(this,{radius:t.radius+e+this.sanchor_/2+this.shadow_/2,points:0}),!this.hitDetectionCanvas_){var o=this.getImage();for(var i in this)if(this[i]&&this[i].getContext&&this[i]!==o){this.hitDetectionCanvas_=this[i];break}}this.hitDetectionCanvas_=document.createElement("canvas");this.hitDetectionCanvas_.width=this.getImage().width;this.hitDetectionCanvas_.height=this.getImage().height;this.stroke_=t.stroke;this.fill_=t.fill;this.crop_=t.crop;this.crossOrigin_=t.crossOrigin;this.kind_=t.kind||"default";this.radius_=t.radius;this.src_=t.src;this.offset_=[t.offsetX?t.offsetX:0,t.offsetY?t.offsetY:0];this.onload_=t.onload;"number"==typeof t.opacity&&this.setOpacity(t.opacity);"number"==typeof t.rotation&&this.setRotation(t.rotation);this.renderPhoto_()};ol.ext.inherits(ol.style.Photo,ol.style.RegularShape);ol.style.Photo.prototype.clone=function(){return new ol.style.Photo({stroke:this.stroke_,fill:this.fill_,shadow:this.shadow_,crop:this.crop_,crossOrigin:this.crossOrigin_,kind:this.kind_,radius:this.radius_,src:this.src_,offsetX:this.offset_[0],offsetY:this.offset_[1],opacity:this.getOpacity(),rotation:this.getRotation()})};CanvasRenderingContext2D.prototype.roundRect=function(t,e,o,i,r){return r?(o<2*r&&(r=o/2),i<2*r&&(r=i/2),this.beginPath(),this.moveTo(t+r,e),this.arcTo(t+o,e,t+o,e+i,r),this.arcTo(t+o,e+i,t,e+i,r),this.arcTo(t,e+i,t,e,r),this.arcTo(t,e,t+o,e,r),this.closePath()):this.rect(t,e,o,i),this};ol.style.Photo.prototype.drawBack_=function(t,e,o){var i=t.canvas;switch(t.beginPath(),t.fillStyle=e,t.clearRect(0,0,i.width,i.height),this.kind_){case"square":t.rect(0,0,i.width-this.shadow_,i.height-this.shadow_);break;case"circle":t.arc(this.radius_+o,this.radius_+o,this.radius_+o,0,2*Math.PI,!1);break;case"folio":o-=6;t.strokeStyle="rgba(0,0,0,0.5)";var r=i.width-this.shadow_-12,n=Math.atan(6/r);t.save();t.rotate(-n);t.translate(-6,2);t.beginPath();t.rect(6,6,r,r);t.stroke();t.fill();t.restore();t.save();t.translate(6,-1);t.rotate(n);t.beginPath();t.rect(6,6,r,r);t.stroke();t.fill();t.restore();t.beginPath();t.rect(6,6,r,r);t.stroke();break;case"anchored":t.roundRect(this.sanchor_/2,0,i.width-this.sanchor_-this.shadow_,i.height-this.sanchor_-this.shadow_,o);t.moveTo(i.width/2-this.sanchor_-this.shadow_/2,i.height-this.sanchor_-this.shadow_);t.lineTo(i.width/2+this.sanchor_-this.shadow_/2,i.height-this.sanchor_-this.shadow_);t.lineTo(i.width/2-this.shadow_/2,i.height-this.shadow_);break;default:t.roundRect(0,0,i.width-this.shadow_,i.height-this.shadow_,o)}t.closePath()};ol.style.Photo.prototype.renderPhoto_=function(){var t,e=0;this.stroke_&&(t=ol.color.asString(this.stroke_.getColor()),e=this.stroke_.getWidth());var o=this.getImage(),i=this.hitDetectionCanvas_.getContext("2d");this.drawBack_(i,"#000",e);i.fill();i=o.getContext("2d");this.drawBack_(i,t,e);this.shadow_&&(i.shadowColor="rgba(0,0,0,0.5)",i.shadowBlur=this.shadow_/2,i.shadowOffsetX=this.shadow_/2,i.shadowOffsetY=this.shadow_/2);i.fill();i.shadowColor="transparent";var r=this,n=this.img_=new Image;this.crossOrigin_&&(n.crossOrigin=this.crossOrigin_);n.src=this.src_;n.width?r.drawImage_(n):n.onload=function(){r.drawImage_(n);r.onload_&&r.onload_()};var s=this.getAnchor();s[0]=(o.width-this.shadow_)/2;s[1]=(o.height-this.shadow_)/2;this.sanchor_&&(s[1]=o.height-this.shadow_)};ol.style.Photo.prototype.drawImage_=function(t){var e=this.getImage().getContext("2d"),o=0;this.stroke_&&(o=this.stroke_.getWidth());var i,r,n,s,a,l,c,h,p,u=2*this.radius_;e.save();"circle"==this.kind_&&(e.beginPath(),e.arc(this.radius_+o,this.radius_+o,this.radius_,0,2*Math.PI,!1),e.clip());this.crop_?(h=p=(i=Math.min(t.width/u,t.height/u))*u,l=(t.width-h)/2,c=(t.height-p)/2,r=n=0,s=a=u+1):(l=c=0,r=(u-(s=(i=Math.min(u/t.width,u/t.height))*(h=t.width)))/2,n=(u-(a=i*(p=t.height)))/2);r+=o+this.sanchor_/2;n+=o;e.drawImage(t,l,c,h,p,r,n,s,a);e.restore();"circle"==this.kind_&&o&&(e.beginPath(),e.strokeStyle=ol.color.asString(this.stroke_.getColor()),e.lineWidth=o/4,e.arc(this.radius_+o,this.radius_+o,this.radius_,0,2*Math.PI,!1),e.stroke())},function(){ol.layer.Vector.prototype.setTextPathStyle=function(t,e){if(null===t)return this.textPath_&&this.unByKey(this.textPath_),this.textPath_=null,void this.changed();this.textPath_||(this.textPath_=this.on(["postcompose","postrender"],function(t){if(!(t.frameState.viewState.resolution>this.textPathMaxResolution_)){var e,o=t.frameState.extent,i=t.frameState.coordinateToPixelTransform,r=t.context;r.save();r.scale(t.frameState.pixelRatio,t.frameState.pixelRatio);for(var n,s=this.getSource().getFeaturesInExtent(o),a=0;n=s[a];a++)for(var l,c=this.textPathStyle_(n,t.frameState.viewState.resolution),h=0;l=c[h];h++){var p,u=l.getGeometry()||n.getGeometry();switch(u.getType()){case"LineString":p=u.getCoordinates();break;case"MultiLineString":p=u.getLineString(0).getCoordinates();break;default:continue}var g=l.getText(),d=m(p,g.getRotateWithView());r.font=g.getFont();r.textBaseline=g.getTextBaseline();r.textAlign=g.getTextAlign();r.lineWidth=g.getStroke()&&g.getStroke().getWidth()||0;r.strokeStyle=g.getStroke()&&g.getStroke().getColor()||"#fff";r.fillStyle=g.getFill()&&g.getFill().getColor()||"#000";r.textJustify="justify"==g.getTextAlign();r.textOverflow=g.getTextOverflow?g.getTextOverflow():"";r.minWidth=g.getMinWidth?g.getMinWidth():0;r.textPath(g.getText()||n.get("name"),d)}r.restore()}function m(t,o){var r=[];for(e=0;e<t.length;e++)r.push(i[0]*t[e][0]+i[1]*t[e][1]+i[4]),r.push(i[2]*t[e][0]+i[3]*t[e][1]+i[5]);if(o&&r[0]>r[r.length-2]){var n=[];for(e=r.length-2;e>=0;e-=2)n.push(r[e]),n.push(r[e+1]);return n}return r}}.bind(this)));void 0===t&&(t=[new ol.style.Style({text:new ol.style.Text})]);this.textPathStyle_="function"==typeof t?t:function(){return t};this.textPathMaxResolution_=Number(e)||Number.MAX_VALUE;this.changed()};ol.style.TextPath=function(t){t||(t={});ol.style.Text.call(this,t);this.textOverflow_=void 0!==t.textOverflow?t.textOverflow:"visible";this.minWidth_=t.minWidth||0};ol.ext.inherits(ol.style.TextPath,ol.style.Text);ol.style.TextPath.prototype.getTextOverflow=function(){return this.textOverflow_};ol.style.TextPath.prototype.getMinWidth=function(){return this.minWidth_}}();CanvasRenderingContext2D.prototype.textPath=function(t,e){var o=this;function i(t,e,o,i){var r=o-t,n=i-e;return Math.sqrt(r*r+n*n)}var r,n=0,s=2;function a(t,e){if(!r||n+r<e)for(;s<t.length&&(r=i(t[s-2],t[s-1],t[s],t[s+1]),!(n+r>e))&&!((s+=2)>=t.length);)n+=r;var o,a,l,c=e-n;return s>=t.length&&(s=t.length-2),c?(o=t[s-2]+(t[s]-t[s-2])*c/r,a=t[s-1]+(t[s+1]-t[s-1])*c/r,l=Math.atan2(t[s+1]-t[s-1],t[s]-t[s-2])):(o=t[s-2],a=t[s-1],l=Math.atan2(t[s+1]-t[s-1],t[s]-t[s-2])),[o,a,l]}for(var l=.25*o.measureText(" ").width,c=0,h=0,p=2;p<e.length;p+=2)h+=i(e[p-2],e[p-1],e[p],e[p+1]);if(!(h<o.minWidth)){var u=t.split(" ").length-1;if("visible"!=o.textOverflow&&h<o.measureText(t).width+(t.length-1+u)*l){var g="ellipsis"==o.textOverflow?"…":o.textOverflow;do u=t.split(" ").length-1,t=t.slice(0,t.length-1);while(t&&h<o.measureText(t+g).width+(t.length+g.length-1+u)*l);t+=g}switch(o.textJustify||o.textAlign){case!0:case"center":case"end":case"right":o.textJustify?(c=0,l=(h-o.measureText(t).width)/(t.length-1+u)):(c=h-o.measureText(t).width-(t.length+u)*l,"center"==o.textAlign&&(c/=2))}for(var d=0;d<t.length;d++){var m=t[d],f=o.measureText(m).width,y=a(e,c+f/2);o.save();o.textAlign="center";o.translate(y[0],y[1]);o.rotate(y[2]);o.lineWidth&&o.strokeText(m,0,0);o.fillText(m,0,0);o.restore();c+=f+l*(" "==m?2:1)}}};ol.style.Shadow=function(t){(t=t||{}).fill||(t.fill=new ol.style.Fill({color:"rgba(0,0,0,0.5)"}));ol.style.RegularShape.call(this,{radius:t.radius,fill:t.fill});this.fill_=t.fill;this.radius_=t.radius;this.blur_=0===t.blur?0:t.blur||t.radius/3;this.offset_=[t.offsetX?t.offsetX:0,t.offsetY?t.offsetY:0];this.renderShadow_()};ol.ext.inherits(ol.style.Shadow,ol.style.RegularShape);ol.style.Shadow.prototype.clone=function(){var t=new ol.style.Shadow({fill:this.fill_,radius:this.radius_,blur:this.blur_,offsetX:this.offset_[0],offsetY:this.offset_[1]});return t.setScale(this.getScale()),t.setOpacity(this.getOpacity()),t};ol.style.Shadow.prototype.renderShadow_=function(){var t=this.radius_,e=this.getImage();[e.width,e.height][1]=t;var o=e.getContext("2d");o.beginPath();o.clearRect(0,0,e.width,e.height);o.scale(1,.5);o.arc(t,-t,t-this.blur_,0,2*Math.PI,!1);o.fillStyle="#000";o.shadowColor=this.fill_.getColor();o.shadowBlur=.7*this.blur_;o.shadowOffsetX=0;o.shadowOffsetY=1.5*t;o.closePath();o.fill();o.shadowColor="transparent";var i=this.getAnchor();i[0]=e.width/2-this.offset_[0];i[1]=e.height/2-this.offset_[1]};ol.style.Shadow.prototype.getChecksum=function(){var t=null!==this.stroke_?this.stroke_.getChecksum():"-",e=null!==this.fill_?this.fill_.getChecksum():"-";if(null===this.checksums_||t!=this.checksums_[1]||e!=this.checksums_[2]||this.radius_!=this.checksums_[3]||this.form_+"-"+this.glyphs_!=this.checksums_[4]){var o="c"+t+e+(void 0!==this.radius_?this.radius_.toString():"-")+this.form_+"-"+this.glyphs_;this.checksums_=[o,t,e,this.radius_,this.form_+"-"+this.glyphs_]}return this.checksums_[0]};ol.style.StrokePattern=function(t){var e,o;t||(t={});var i=this.canvas_=document.createElement("canvas"),r=(Number(t.scale)>0?Number(t.scale):1)*ol.has.DEVICE_PIXEL_RATIO||ol.has.DEVICE_PIXEL_RATIO,n=i.getContext("2d");if(t.image){t.image.load();var s=t.image.getImage();if(s.width)i.width=Math.round(s.width*r),i.height=Math.round(s.height*r),n.globalAlpha="number"==typeof t.opacity?t.opacity:1,n.drawImage(s,0,0,s.width,s.height,0,0,i.width,i.height),e=n.createPattern(i,"repeat");else{var a=this;e=[0,0,0,0];s.onload=function(){i.width=Math.round(s.width*r);i.height=Math.round(s.height*r);n.globalAlpha="number"==typeof t.opacity?t.opacity:1;n.drawImage(s,0,0,s.width,s.height,0,0,i.width,i.height);e=n.createPattern(i,"repeat");a.setColor(e)}}}else{var l=this.getPattern_(t);if(i.width=Math.round(l.width*r),i.height=Math.round(l.height*r),n.beginPath(),t.fill&&(n.fillStyle=ol.color.asString(t.fill.getColor()),n.fillRect(0,0,i.width,i.height)),n.scale(r,r),n.lineCap="round",n.lineWidth=l.stroke||1,n.fillStyle=ol.color.asString(t.color||"#000"),n.strokeStyle=ol.color.asString(t.color||"#000"),l.circles)for(o=0;o<l.circles.length;o++){var c=l.circles[o];n.beginPath();n.arc(c[0],c[1],c[2],0,2*Math.PI);l.fill&&n.fill();l.stroke&&n.stroke()}if(l.repeat||(l.repeat=[[0,0]]),l.char&&(n.font=l.font||l.width+"px Arial",n.textAlign="center",n.textBaseline="middle",l.angle?(n.fillText(l.char,l.width/4,l.height/4),n.fillText(l.char,5*l.width/4,5*l.height/4),n.fillText(l.char,l.width/4,5*l.height/4),n.fillText(l.char,5*l.width/4,l.height/4),n.fillText(l.char,3*l.width/4,3*l.height/4),n.fillText(l.char,-l.width/4,-l.height/4),n.fillText(l.char,3*l.width/4,-l.height/4),n.fillText(l.char,-l.width/4,3*l.height/4)):n.fillText(l.char,l.width/2,l.height/2)),l.lines)for(o=0;o<l.lines.length;o++)for(var h=0;h<l.repeat.length;h++){var p=l.lines[o];n.beginPath();n.moveTo(p[0]+l.repeat[h][0],p[1]+l.repeat[h][1]);for(var u=2;u<p.length;u+=2)n.lineTo(p[u]+l.repeat[h][0],p[u+1]+l.repeat[h][1]);l.fill&&n.fill();l.stroke&&n.stroke();n.save();n.strokeStyle="red";n.strokeWidth=.1;n.restore()}if(e=n.createPattern(i,"repeat"),t.offset){var g=t.offset;if("number"==typeof g&&(g=[g,g]),g instanceof Array){var d=Math.round(g[0]*r),m=Math.round(g[1]*r);n.scale(1/r,1/r);n.clearRect(0,0,i.width,i.height);n.translate(d,m);n.fillStyle=e;n.fillRect(-d,-m,i.width,i.height);e=n.createPattern(i,"repeat")}}}t.color=e;ol.style.Stroke.call(this,t)};ol.ext.inherits(ol.style.StrokePattern,ol.style.Stroke);ol.style.StrokePattern.prototype.clone=function(){var t=ol.style.Fill.prototype.clone.call(this);return t.canvas_=this.canvas_,t};ol.style.StrokePattern.prototype.getImage=function(){return this.canvas_};ol.style.StrokePattern.prototype.getPattern_=function(t){var e,o=ol.style.FillPattern.prototype.patterns[t.pattern]||ol.style.FillPattern.prototype.patterns.dot,i=Math.round(t.spacing)||10;switch(t.pattern){case"dot":case"circle":e=0===t.size?0:t.size/2||2;t.angle?(i=o.width=o.height=Math.round(1.4*i),o.circles=[[i/4,i/4,e],[3*i/4,3*i/4,e]],"circle"==t.pattern&&(o.circles=o.circles.concat([[i/4+i,i/4,e],[i/4,i/4+i,e],[3*i/4-i,3*i/4,e],[3*i/4,3*i/4-i,e],[i/4+i,i/4+i,e],[3*i/4-i,3*i/4-i,e]]))):(o.width=o.height=i,o.circles=[[i/2,i/2,e]],"circle"==t.pattern&&(o.circles=o.circles.concat([[i/2+i,i/2,e],[i/2-i,i/2,e],[i/2,i/2+i,e],[i/2,i/2-i,e],[i/2+i,i/2+i,e],[i/2+i,i/2-i,e],[i/2-i,i/2+i,e],[i/2-i,i/2-i,e]])));break;case"tile":case"square":e=0===t.size?0:t.size/2||2;t.angle?(o.width=o.height=i,o.lines=[[i/2-e,i/2,i/2,i/2-e,i/2+e,i/2,i/2,i/2+e,i/2-e,i/2]]):(o.width=o.height=i,o.lines=[[i/2-e,i/2-e,i/2+e,i/2-e,i/2+e,i/2+e,i/2-e,i/2+e,i/2-e,i/2-e]]);"square"==t.pattern&&(o.repeat=[[0,0],[0,i],[i,0],[0,-i],[-i,0],[-i,-i],[i,i],[-i,i],[i,-i]]);break;case"cross":t.angle&&(t.angle=45);case"hatch":var r=Math.round(((t.angle||0)-90)%360);r>180&&(r-=360);r*=Math.PI/180;var n=Math.cos(r),s=Math.sin(r);if(Math.abs(s)<.0001)o.width=o.height=i,o.lines=[[0,.5,i,.5]],o.repeat=[[0,0],[0,i]];else if(Math.abs(n)<.0001)o.width=o.height=i,o.lines=[[.5,0,.5,i]],o.repeat=[[0,0],[i,0]],"cross"==t.pattern&&(o.lines.push([0,.5,i,.5]),o.repeat.push([0,i]));else{var a=o.width=Math.round(Math.abs(i/s))||1,l=o.height=Math.round(Math.abs(i/n))||1;"cross"==t.pattern?(o.lines=[[-a,-l,2*a,2*l],[2*a,-l,-a,2*l]],o.repeat=[[0,0]]):n*s>0?(o.lines=[[-a,-l,2*a,2*l]],o.repeat=[[0,0],[a,0],[0,l]]):(o.lines=[[2*a,-l,-a,2*l]],o.repeat=[[0,0],[-a,0],[0,l]])}o.stroke=0===t.size?0:t.size||4}return o};!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.proj4=b()}(this,function(){"use strict";function a(a,b){if(a[b])return a[b];for(var c,d,e=Object.keys(a),f=b.toLowerCase().replace(Ob,""),g=-1;++g<e.length;)if(c=e[g],d=c.toLowerCase().replace(Ob,""),d===f)return a[c]}function b(a){if("string"!=typeof a)throw new Error("not a string");this.text=a.trim();this.level=0;this.place=0;this.root=null;this.stack=[];this.currentObject=null;this.state=Qb}function c(a){var c=new b(a);return c.output()}function d(a,b,c){Array.isArray(b)&&(c.unshift(b),b=null);var d=b?{}:a,f=c.reduce(function(a,b){return e(b,a),a},d);b&&(a[b]=f)}function e(a,b){if(!Array.isArray(a))return void(b[a]=!0);var c=a.shift();if("PARAMETER"===c&&(c=a.shift()),1===a.length)return Array.isArray(a[0])?(b[c]={},void e(a[0],b[c])):void(b[c]=a[0]);if(!a.length)return void(b[c]=!0);if("TOWGS84"===c)return void(b[c]=a);Array.isArray(c)||(b[c]={});var f;switch(c){case"UNIT":case"PRIMEM":case"VERT_DATUM":return b[c]={name:a[0].toLowerCase(),convert:a[1]},void(3===a.length&&e(a[2],b[c]));case"SPHEROID":case"ELLIPSOID":return b[c]={name:a[0],a:a[1],rf:a[2]},void(4===a.length&&e(a[3],b[c]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return a[0]=["name",a[0]],void d(b,c,a);default:for(f=-1;++f<a.length;)if(!Array.isArray(a[f]))return e(a,b[c]);return d(b,c,a)}}function f(a,b){var c=b[0],d=b[1];!(c in a)&&d in a&&(a[c]=a[d],3===b.length&&(a[c]=b[2](a[c])))}function g(a){return a*_b}function h(a){function b(b){var c=a.to_meter||1;return b*c}"GEOGCS"===a.type?a.projName="longlat":"LOCAL_CS"===a.type?(a.projName="identity",a.local=!0):a.projName="object"==typeof a.PROJECTION?Object.keys(a.PROJECTION)[0]:a.PROJECTION;a.UNIT&&(a.units=a.UNIT.name.toLowerCase(),"metre"===a.units&&(a.units="meter"),a.UNIT.convert&&("GEOGCS"===a.type?a.DATUM&&a.DATUM.SPHEROID&&(a.to_meter=a.UNIT.convert*a.DATUM.SPHEROID.a):(a.to_meter=a.UNIT.convert,10)));var c=a.GEOGCS;"GEOGCS"===a.type&&(c=a);c&&(a.datumCode=c.DATUM?c.DATUM.name.toLowerCase():c.name.toLowerCase(),"d_"===a.datumCode.slice(0,2)&&(a.datumCode=a.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==a.datumCode&&"new_zealand_1949"!==a.datumCode||(a.datumCode="nzgd49"),"wgs_1984"===a.datumCode&&("Mercator_Auxiliary_Sphere"===a.PROJECTION&&(a.sphere=!0),a.datumCode="wgs84"),"_ferro"===a.datumCode.slice(-6)&&(a.datumCode=a.datumCode.slice(0,-6)),"_jakarta"===a.datumCode.slice(-8)&&(a.datumCode=a.datumCode.slice(0,-8)),~a.datumCode.indexOf("belge")&&(a.datumCode="rnb72"),c.DATUM&&c.DATUM.SPHEROID&&(a.ellps=c.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===a.ellps.toLowerCase().slice(0,13)&&(a.ellps="intl"),a.a=c.DATUM.SPHEROID.a,a.rf=parseFloat(c.DATUM.SPHEROID.rf,10)),~a.datumCode.indexOf("osgb_1936")&&(a.datumCode="osgb36"));a.b&&!isFinite(a.b)&&(a.b=a.a);var d=function(b){return f(a,b)},e=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_2","Standard_Parallel_2"],["false_easting","False_Easting"],["false_northing","False_Northing"],["central_meridian","Central_Meridian"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",g],["longitude_of_center","Longitude_Of_Center"],["longc","longitude_of_center",g],["x0","false_easting",b],["y0","false_northing",b],["long0","central_meridian",g],["lat0","latitude_of_origin",g],["lat0","standard_parallel_1",g],["lat1","standard_parallel_1",g],["lat2","standard_parallel_2",g],["alpha","azimuth",g],["srsCode","name"]];e.forEach(d);a.long0||!a.longc||"Albers_Conic_Equal_Area"!==a.projName&&"Lambert_Azimuthal_Equal_Area"!==a.projName||(a.long0=a.longc);a.lat_ts||!a.lat1||"Stereographic_South_Pole"!==a.projName&&"Polar Stereographic (variant B)"!==a.projName||(a.lat0=g(a.lat1>0?90:-90),a.lat_ts=a.lat1)}function i(a){var b=this;if(2===arguments.length){var c=arguments[1];i[a]="string"==typeof c?"+"===c.charAt(0)?Pb(arguments[1]):ac(arguments[1]):c}else if(1===arguments.length){if(Array.isArray(a))return a.map(function(a){Array.isArray(a)?i.apply(b,a):i(a)});if("string"==typeof a){if(a in i)return i[a]}else"EPSG"in a?i["EPSG:"+a.EPSG]=a:"ESRI"in a?i["ESRI:"+a.ESRI]=a:"IAU2000"in a?i["IAU2000:"+a.IAU2000]=a:console.log(a);return}}function j(a){return"string"==typeof a}function k(a){return a in i}function l(a){return bc.some(function(b){return a.indexOf(b)>-1})}function m(a){return"+"===a[0]}function n(a){return j(a)?k(a)?i[a]:l(a)?ac(a):m(a)?Pb(a):void 0:a}function o(){var a=this.b/this.a;this.es=1-a*a;"x0"in this||(this.x0=0);"y0"in this||(this.y0=0);this.e=Math.sqrt(this.es);this.lat_ts?this.k0=this.sphere?Math.cos(this.lat_ts):dc(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k0=this.k?this.k:1)}function p(a){var b=a.x,c=a.y;if(c*Ib>90&&c*Ib<-90&&b*Ib>180&&b*Ib<-180)return null;var d,e;if(Math.abs(Math.abs(c)-Cb)<=Gb)return null;if(this.sphere)d=this.x0+this.a*this.k0*fc(b-this.long0),e=this.y0+this.a*this.k0*Math.log(Math.tan(Jb+.5*c));else{var f=Math.sin(c),g=gc(this.e,c,f);d=this.x0+this.a*this.k0*fc(b-this.long0);e=this.y0-this.a*this.k0*Math.log(g)}return a.x=d,a.y=e,a}function q(a){var b,c,d=a.x-this.x0,e=a.y-this.y0;if(this.sphere)c=Cb-2*Math.atan(Math.exp(-e/(this.a*this.k0)));else{var f=Math.exp(-e/(this.a*this.k0));if(c=hc(this.e,f),c===-9999)return null}return b=fc(this.long0+d/(this.a*this.k0)),a.x=b,a.y=c,a}function r(){}function s(a){return a}function t(a,b){var c=oc.length;return a.names?(oc[c]=a,a.names.forEach(function(a){nc[a.toLowerCase()]=c}),this):(console.log(b),!0)}function u(a){if(!a)return!1;var b=a.toLowerCase();if("undefined"!=typeof nc[b]&&oc[nc[b]])return oc[nc[b]]}function v(){mc.forEach(t)}function w(a,b,c,d){var e=a*a,f=b*b,g=(e-f)/e,h=0;d?(a*=1-g*(Db+g*(Eb+g*Fb)),e=a*a,g=0):h=Math.sqrt(g);var i=(e-f)/f;return{es:g,e:h,ep2:i}}function x(b,c,d,e,f){if(!b){var g=a(qc,e);g||(g=rc);b=g.a;c=g.b;d=g.rf}return d&&!c&&(c=(1-1/d)*b),(0===d||Math.abs(b-c)<Gb)&&(f=!0,c=b),{a:b,b:c,rf:d,sphere:f}}function y(a,b,c,d,e,f){var g={};return g.datum_type=void 0===a||"none"===a?Ab:zb,b&&(g.datum_params=b.map(parseFloat),0===g.datum_params[0]&&0===g.datum_params[1]&&0===g.datum_params[2]||(g.datum_type=xb),g.datum_params.length>3&&(0===g.datum_params[3]&&0===g.datum_params[4]&&0===g.datum_params[5]&&0===g.datum_params[6]||(g.datum_type=yb,g.datum_params[3]*=Bb,g.datum_params[4]*=Bb,g.datum_params[5]*=Bb,g.datum_params[6]=g.datum_params[6]/1e6+1))),g.a=c,g.b=d,g.es=e,g.ep2=f,g}function z(b,c){if(!(this instanceof z))return new z(b);c=c||function(a){if(a)throw a;};var d=n(b);if("object"!=typeof d)return void c(b);var e=z.projections.get(d.projName);if(!e)return void c(b);if(d.datumCode&&"none"!==d.datumCode){var f=a(sc,d.datumCode);f&&(d.datum_params=f.towgs84?f.towgs84.split(","):null,d.ellps=f.ellipse,d.datumName=f.datumName?f.datumName:d.datumCode)}d.k0=d.k0||1;d.axis=d.axis||"enu";d.ellps=d.ellps||"wgs84";var g=x(d.a,d.b,d.rf,d.ellps,d.sphere),h=w(g.a,g.b,g.rf,d.R_A),i=d.datum||y(d.datumCode,d.datum_params,g.a,g.b,h.es,h.ep2);cc(this,d);cc(this,e);this.a=g.a;this.b=g.b;this.rf=g.rf;this.sphere=g.sphere;this.es=h.es;this.e=h.e;this.ep2=h.ep2;this.datum=i;this.init();c(null,this)}function A(a,b){return a.datum_type===b.datum_type&&!(a.a!==b.a||Math.abs(a.es-b.es)>5e-11)&&(a.datum_type===xb?a.datum_params[0]===b.datum_params[0]&&a.datum_params[1]===b.datum_params[1]&&a.datum_params[2]===b.datum_params[2]:a.datum_type!==yb||a.datum_params[0]===b.datum_params[0]&&a.datum_params[1]===b.datum_params[1]&&a.datum_params[2]===b.datum_params[2]&&a.datum_params[3]===b.datum_params[3]&&a.datum_params[4]===b.datum_params[4]&&a.datum_params[5]===b.datum_params[5]&&a.datum_params[6]===b.datum_params[6])}function B(a,b,c){var d,e,f,g,h=a.x,i=a.y,j=a.z?a.z:0;if(i<-Cb&&i>-1.001*Cb)i=-Cb;else if(i>Cb&&i<1.001*Cb)i=Cb;else if(i<-Cb||i>Cb)return null;return h>Math.PI&&(h-=2*Math.PI),e=Math.sin(i),g=Math.cos(i),f=e*e,d=c/Math.sqrt(1-b*f),{x:(d+j)*g*Math.cos(h),y:(d+j)*g*Math.sin(h),z:(d*(1-b)+j)*e}}function C(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u=1e-12,v=u*u,x=a.x,y=a.y,z=a.z?a.z:0;if(e=Math.sqrt(x*x+y*y),f=Math.sqrt(x*x+y*y+z*z),e/c<u){if(r=0,f/c<u)return s=Cb,t=-d,{x:a.x,y:a.y,z:a.z}}else r=Math.atan2(y,x);g=z/f;h=e/f;i=1/Math.sqrt(1-b*(2-b)*h*h);l=h*(1-b)*i;m=g*i;q=0;do q++,k=c/Math.sqrt(1-b*m*m),t=e*l+z*m-k*(1-b*m*m),j=b*k/(k+t),i=1/Math.sqrt(1-j*(2-j)*h*h),n=h*(1-j)*i,o=g*i,p=o*l-n*m,l=n,m=o;while(p*p>v&&q<30);return s=Math.atan(o/Math.abs(n)),{x:r,y:s,z:t}}function D(a,b,c){if(b===xb)return{x:a.x+c[0],y:a.y+c[1],z:a.z+c[2]};if(b===yb){var d=c[0],e=c[1],f=c[2],g=c[3],h=c[4],i=c[5],j=c[6];return{x:j*(a.x-i*a.y+h*a.z)+d,y:j*(i*a.x+a.y-g*a.z)+e,z:j*(-h*a.x+g*a.y+a.z)+f}}}function E(a,b,c){if(b===xb)return{x:a.x-c[0],y:a.y-c[1],z:a.z-c[2]};if(b===yb){var d=c[0],e=c[1],f=c[2],g=c[3],h=c[4],i=c[5],j=c[6],k=(a.x-d)/j,l=(a.y-e)/j,m=(a.z-f)/j;return{x:k+i*l-h*m,y:-i*k+l+g*m,z:h*k-g*l+m}}}function F(a){return a===xb||a===yb}function G(a,b){return(a.datum.datum_type===xb||a.datum.datum_type===yb)&&"WGS84"!==b.datumCode||(b.datum.datum_type===xb||b.datum.datum_type===yb)&&"WGS84"!==a.datumCode}function H(a,b,c){var d;return Array.isArray(c)&&(c=vc(c)),a.datum&&b.datum&&G(a,b)&&(d=new z("WGS84"),c=H(a,d,c),a=d),"enu"!==a.axis&&(c=uc(a,!1,c)),"longlat"===a.projName?c={x:c.x*Hb,y:c.y*Hb}:(a.to_meter&&(c={x:c.x*a.to_meter,y:c.y*a.to_meter}),c=a.inverse(c)),a.from_greenwich&&(c.x+=a.from_greenwich),c=tc(a.datum,b.datum,c),b.from_greenwich&&(c={x:c.x-b.from_greenwich,y:c.y}),"longlat"===b.projName?c={x:c.x*Ib,y:c.y*Ib}:(c=b.forward(c),b.to_meter&&(c={x:c.x/b.to_meter,y:c.y/b.to_meter})),"enu"!==b.axis?uc(b,!0,c):c}function I(a,b,c){var d;return Array.isArray(c)?(d=H(a,b,c),3===c.length?[d.x,d.y,d.z]:[d.x,d.y]):H(a,b,c)}function J(a){return a instanceof z?a:a.oProj?a.oProj:z(a)}function K(a,b,c){a=J(a);var d,e=!1;return"undefined"==typeof b?(b=a,a=wc,e=!0):("undefined"!=typeof b.x||Array.isArray(b))&&(c=b,b=a,a=wc,e=!0),b=J(b),c?I(a,b,c):(d={forward:function(c){return I(a,b,c)},inverse:function(c){return I(b,a,c)}},e&&(d.oProj=b),d)}function L(a,b){return b=b||5,T(Q({lat:a[1],lon:a[0]}),b)}function M(a){var b=R(X(a.toUpperCase()));return b.lat&&b.lon?[b.lon,b.lat,b.lon,b.lat]:[b.left,b.bottom,b.right,b.top]}function N(a){var b=R(X(a.toUpperCase()));return b.lat&&b.lon?[b.lon,b.lat]:[(b.left+b.right)/2,(b.top+b.bottom)/2]}function O(a){return a*(Math.PI/180)}function P(a){return 180*(a/Math.PI)}function Q(a){var b,c,d,e,f,g,h,i,j,k=a.lat,l=a.lon,m=6378137,n=.00669438,o=.9996,p=O(k),q=O(l);j=Math.floor((l+180)/6)+1;180===l&&(j=60);k>=56&&k<64&&l>=3&&l<12&&(j=32);k>=72&&k<84&&(l>=0&&l<9?j=31:l>=9&&l<21?j=33:l>=21&&l<33?j=35:l>=33&&l<42&&(j=37));b=6*(j-1)-177;i=O(b);c=n/(1-n);d=m/Math.sqrt(1-n*Math.sin(p)*Math.sin(p));e=Math.tan(p)*Math.tan(p);f=c*Math.cos(p)*Math.cos(p);g=Math.cos(p)*(q-i);h=m*((1-n/4-3*n*n/64-5*n*n*n/256)*p-(3*n/8+3*n*n/32+45*n*n*n/1024)*Math.sin(2*p)+(15*n*n/256+45*n*n*n/1024)*Math.sin(4*p)-35*n*n*n/3072*Math.sin(6*p));var r=o*d*(g+(1-e+f)*g*g*g/6+(5-18*e+e*e+72*f-58*c)*g*g*g*g*g/120)+5e5,s=o*(h+d*Math.tan(p)*(g*g/2+(5-e+9*f+4*f*f)*g*g*g*g/24+(61-58*e+e*e+600*f-330*c)*g*g*g*g*g*g/720));return k<0&&(s+=1e7),{northing:Math.round(s),easting:Math.round(r),zoneNumber:j,zoneLetter:S(k)}}function R(a){var b=a.northing,c=a.easting,d=a.zoneLetter,e=a.zoneNumber;if(e<0||e>60)return null;var f,g,h,i,j,k,l,m,n,o,p=.9996,q=6378137,r=.00669438,s=(1-Math.sqrt(1-r))/(1+Math.sqrt(1-r)),t=c-5e5,u=b;d<"N"&&(u-=1e7);m=6*(e-1)-177;f=r/(1-r);l=u/p;n=l/(q*(1-r/4-3*r*r/64-5*r*r*r/256));o=n+(3*s/2-27*s*s*s/32)*Math.sin(2*n)+(21*s*s/16-55*s*s*s*s/32)*Math.sin(4*n)+151*s*s*s/96*Math.sin(6*n);g=q/Math.sqrt(1-r*Math.sin(o)*Math.sin(o));h=Math.tan(o)*Math.tan(o);i=f*Math.cos(o)*Math.cos(o);j=q*(1-r)/Math.pow(1-r*Math.sin(o)*Math.sin(o),1.5);k=t/(g*p);var v=o-g*Math.tan(o)/j*(k*k/2-(5+3*h+10*i-4*i*i-9*f)*k*k*k*k/24+(61+90*h+298*i+45*h*h-252*f-3*i*i)*k*k*k*k*k*k/720);v=P(v);var w=(k-(1+2*h+i)*k*k*k/6+(5-2*i+28*h-3*i*i+8*f+24*h*h)*k*k*k*k*k/120)/Math.cos(o);w=m+P(w);var x;if(a.accuracy){var y=R({northing:a.northing+a.accuracy,easting:a.easting+a.accuracy,zoneLetter:a.zoneLetter,zoneNumber:a.zoneNumber});x={top:y.lat,right:y.lon,bottom:v,left:w}}else x={lat:v,lon:w};return x}function S(a){var b="Z";return 84>=a&&a>=72?b="X":72>a&&a>=64?b="W":64>a&&a>=56?b="V":56>a&&a>=48?b="U":48>a&&a>=40?b="T":40>a&&a>=32?b="S":32>a&&a>=24?b="R":24>a&&a>=16?b="Q":16>a&&a>=8?b="P":8>a&&a>=0?b="N":0>a&&a>=-8?b="M":-8>a&&a>=-16?b="L":-16>a&&a>=-24?b="K":-24>a&&a>=-32?b="J":-32>a&&a>=-40?b="H":-40>a&&a>=-48?b="G":-48>a&&a>=-56?b="F":-56>a&&a>=-64?b="E":-64>a&&a>=-72?b="D":-72>a&&a>=-80&&(b="C"),b}function T(a,b){var c="00000"+a.easting,d="00000"+a.northing;return a.zoneNumber+a.zoneLetter+U(a.easting,a.northing,a.zoneNumber)+c.substr(c.length-5,b)+d.substr(d.length-5,b)}function U(a,b,c){var d=V(c),e=Math.floor(a/1e5),f=Math.floor(b/1e5)%20;return W(e,f,d)}function V(a){var b=a%xc;return 0===b&&(b=xc),b}function W(a,b,c){var d=c-1,e=yc.charCodeAt(d),f=zc.charCodeAt(d),g=e+a-1,h=f+b,i=!1;g>Ec&&(g=g-Ec+Ac-1,i=!0);(g===Bc||e<Bc&&g>Bc||(g>Bc||e<Bc)&&i)&&g++;(g===Cc||e<Cc&&g>Cc||(g>Cc||e<Cc)&&i)&&(g++,g===Bc&&g++);g>Ec&&(g=g-Ec+Ac-1);h>Dc?(h=h-Dc+Ac-1,i=!0):i=!1;(h===Bc||f<Bc&&h>Bc||(h>Bc||f<Bc)&&i)&&h++;(h===Cc||f<Cc&&h>Cc||(h>Cc||f<Cc)&&i)&&(h++,h===Bc&&h++);h>Dc&&(h=h-Dc+Ac-1);return String.fromCharCode(g)+String.fromCharCode(h)}function X(a){if(a&&0===a.length)throw"MGRSPoint coverting from nothing";for(var b,c=a.length,d=null,e="",f=0;!/[A-Z]/.test(b=a.charAt(f));){if(f>=2)throw"MGRSPoint bad conversion from: "+a;e+=b;f++}var g=parseInt(e,10);if(0===f||f+3>c)throw"MGRSPoint bad conversion from: "+a;var h=a.charAt(f++);if(h<="A"||"B"===h||"Y"===h||h>="Z"||"I"===h||"O"===h)throw"MGRSPoint zone letter "+h+" not handled: "+a;d=a.substring(f,f+=2);for(var i=V(g),j=Y(d.charAt(0),i),k=Z(d.charAt(1),i);k<$(h);)k+=2e6;var l=c-f;if(l%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+a;var m,n,o,p,q,r=l/2,s=0,t=0;return r>0&&(m=1e5/Math.pow(10,r),n=a.substring(f,f+r),s=parseFloat(n)*m,o=a.substring(f+r),t=parseFloat(o)*m),p=s+j,q=t+k,{easting:p,northing:q,zoneLetter:h,zoneNumber:g,accuracy:m}}function Y(a,b){for(var c=yc.charCodeAt(b-1),d=1e5,e=!1;c!==a.charCodeAt(0);){if(c++,c===Bc&&c++,c===Cc&&c++,c>Ec){if(e)throw"Bad character: "+a;c=Ac;e=!0}d+=1e5}return d}function Z(a,b){if(a>"V")throw"MGRSPoint given invalid Northing "+a;for(var c=zc.charCodeAt(b-1),d=0,e=!1;c!==a.charCodeAt(0);){if(c++,c===Bc&&c++,c===Cc&&c++,c>Dc){if(e)throw"Bad character: "+a;c=Ac;e=!0}d+=1e5}return d}function $(a){var b;switch(a){case"C":b=11e5;break;case"D":b=2e6;break;case"E":b=28e5;break;case"F":b=37e5;break;case"G":b=46e5;break;case"H":b=55e5;break;case"J":b=64e5;break;case"K":b=73e5;break;case"L":b=82e5;break;case"M":b=91e5;break;case"N":b=0;break;case"P":b=8e5;break;case"Q":b=17e5;break;case"R":b=26e5;break;case"S":b=35e5;break;case"T":b=44e5;break;case"U":b=53e5;break;case"V":b=62e5;break;case"W":b=7e6;break;case"X":b=79e5;break;default:b=-1}if(b>=0)return b;throw"Invalid zone letter: "+a;}function Point(a,b,c){if(!(this instanceof Point))return new Point(a,b,c);if(Array.isArray(a))this.x=a[0],this.y=a[1],this.z=a[2]||0;else if("object"==typeof a)this.x=a.x,this.y=a.y,this.z=a.z||0;else if("string"==typeof a&&"undefined"==typeof b){var d=a.split(",");this.x=parseFloat(d[0],10);this.y=parseFloat(d[1],10);this.z=parseFloat(d[2],10)||0}else this.x=a,this.y=b,this.z=c||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}function _(){this.x0=void 0!==this.x0?this.x0:0;this.y0=void 0!==this.y0?this.y0:0;this.long0=void 0!==this.long0?this.long0:0;this.lat0=void 0!==this.lat0?this.lat0:0;this.es&&(this.en=Tc(this.es),this.ml0=Uc(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function aa(a){var b,c,d,e=a.x,f=a.y,g=fc(e-this.long0),h=Math.sin(f),i=Math.cos(f);if(this.es){var j=i*g,k=Math.pow(j,2),l=this.ep2*Math.pow(i,2),m=Math.pow(l,2),n=Math.abs(i)>Gb?Math.tan(f):0,o=Math.pow(n,2),p=Math.pow(o,2);b=1-this.es*Math.pow(h,2);j/=Math.sqrt(b);var q=Uc(f,h,i,this.en);c=this.a*this.k0*j*(1+k/6*(1-o+l+k/20*(5-18*o+p+14*l-58*o*l+k/42*(61+179*p-p*o-479*o))))+this.x0;d=this.a*this.k0*(q-this.ml0+h*g*j/2*(1+k/12*(5-o+9*l+4*m+k/30*(61+p-58*o+270*l-330*o*l+k/56*(1385+543*p-p*o-3111*o)))))+this.y0}else{var r=i*Math.sin(g);if(Math.abs(Math.abs(r)-1)<Gb)return 93;if(c=.5*this.a*this.k0*Math.log((1+r)/(1-r))+this.x0,d=i*Math.cos(g)/Math.sqrt(1-Math.pow(r,2)),r=Math.abs(d),r>=1){if(r-1>Gb)return 93;d=0}else d=Math.acos(d);f<0&&(d=-d);d=this.a*this.k0*(d-this.lat0)+this.y0}return a.x=c,a.y=d,a}function ba(a){var b,c,d,e,f=(a.x-this.x0)*(1/this.a),g=(a.y-this.y0)*(1/this.a);if(this.es)if(b=this.ml0+g/this.k0,c=Wc(b,this.es,this.en),Math.abs(c)<Cb){var h=Math.sin(c),i=Math.cos(c),j=Math.abs(i)>Gb?Math.tan(c):0,k=this.ep2*Math.pow(i,2),l=Math.pow(k,2),m=Math.pow(j,2),n=Math.pow(m,2);b=1-this.es*Math.pow(h,2);var o=f*Math.sqrt(b)/this.k0,p=Math.pow(o,2);b*=j;d=c-b*p/(1-this.es)*.5*(1-p/12*(5+3*m-9*k*m+k-4*l-p/30*(61+90*m-252*k*m+45*n+46*k-p/56*(1385+3633*m+4095*n+1574*n*m))));e=fc(this.long0+o*(1-p/6*(1+2*m+k-p/20*(5+28*m+24*n+8*k*m+6*k-p/42*(61+662*m+1320*n+720*n*m))))/i)}else d=Cb*ec(g),e=0;else{var q=Math.exp(f/this.k0),r=.5*(q-1/q),s=this.lat0+g/this.k0,t=Math.cos(s);b=Math.sqrt((1-Math.pow(t,2))/(1+Math.pow(r,2)));d=Math.asin(b);g<0&&(d=-d);e=0===r&&0===t?0:fc(Math.atan2(r,t)+this.long0)}return a.x=e,a.y=d,a}function ca(){if(void 0===this.es||this.es<=0)throw new Error("incorrect elliptical usage");this.x0=void 0!==this.x0?this.x0:0;this.y0=void 0!==this.y0?this.y0:0;this.long0=void 0!==this.long0?this.long0:0;this.lat0=void 0!==this.lat0?this.lat0:0;this.cgb=[];this.cbg=[];this.utg=[];this.gtu=[];var a=this.es/(1+Math.sqrt(1-this.es)),b=a/(2-a),c=b;this.cgb[0]=b*(2+b*(-2/3+b*(-2+b*(116/45+b*(26/45+b*(-2854/675))))));this.cbg[0]=b*(-2+b*(2/3+b*(4/3+b*(-82/45+b*(32/45+b*(4642/4725))))));c*=b;this.cgb[1]=c*(7/3+b*(-1.6+b*(-227/45+b*(2704/315+b*(2323/945)))));this.cbg[1]=c*(5/3+b*(-16/15+b*(-13/9+b*(904/315+b*(-1522/945)))));c*=b;this.cgb[2]=c*(56/15+b*(-136/35+b*(-1262/105+b*(73814/2835))));this.cbg[2]=c*(-26/15+b*(34/21+b*(1.6+b*(-12686/2835))));c*=b;this.cgb[3]=c*(4279/630+b*(-332/35+b*(-399572/14175)));this.cbg[3]=c*(1237/630+b*(-2.4+b*(-24832/14175)));c*=b;this.cgb[4]=c*(4174/315+b*(-144838/6237));this.cbg[4]=c*(-734/315+b*(109598/31185));c*=b;this.cgb[5]=c*(601676/22275);this.cbg[5]=c*(444337/155925);c=Math.pow(b,2);this.Qn=this.k0/(1+b)*(1+c*(.25+c*(1/64+c/256)));this.utg[0]=b*(-.5+b*(2/3+b*(-37/96+b*(1/360+b*(81/512+b*(-96199/604800))))));this.gtu[0]=b*(.5+b*(-2/3+b*(5/16+b*(41/180+b*(-127/288+b*(7891/37800))))));this.utg[1]=c*(-1/48+b*(-1/15+b*(437/1440+b*(-46/105+b*(1118711/3870720)))));this.gtu[1]=c*(13/48+b*(-.6+b*(557/1440+b*(281/630+b*(-1983433/1935360)))));c*=b;this.utg[2]=c*(-17/480+b*(37/840+b*(209/4480+b*(-5569/90720))));this.gtu[2]=c*(61/240+b*(-103/140+b*(15061/26880+b*(167603/181440))));c*=b;this.utg[3]=c*(-4397/161280+b*(11/504+b*(830251/7257600)));this.gtu[3]=c*(49561/161280+b*(-179/168+b*(6601661/7257600)));c*=b;this.utg[4]=c*(-4583/161280+b*(108847/3991680));this.gtu[4]=c*(34729/80640+b*(-3418889/1995840));c*=b;this.utg[5]=c*-.032330830940856981;this.gtu[5]=.66506753108966654*c;var d=bd(this.cbg,this.lat0);this.Zb=-this.Qn*(d+cd(this.gtu,2*d))}function da(a){var b=fc(a.x-this.long0),c=a.y;c=bd(this.cbg,c);var d=Math.sin(c),e=Math.cos(c),f=Math.sin(b),g=Math.cos(b);c=Math.atan2(d,g*e);b=Math.atan2(f*e,$c(d,e*g));b=ad(Math.tan(b));var h=ed(this.gtu,2*c,2*b);c+=h[0];b+=h[1];var i,j;return Math.abs(b)<=2.623395162778?(i=this.a*this.Qn*b+this.x0,j=this.a*(this.Qn*c+this.Zb)+this.y0):(i=1/0,j=1/0),a.x=i,a.y=j,a}function ea(a){var b=(a.x-this.x0)*(1/this.a),c=(a.y-this.y0)*(1/this.a);c=(c-this.Zb)/this.Qn;b/=this.Qn;var d,e;if(Math.abs(b)<=2.623395162778){var f=ed(this.utg,2*c,2*b);c+=f[0];b+=f[1];b=Math.atan(Zc(b));var g=Math.sin(c),h=Math.cos(c),i=Math.sin(b),j=Math.cos(b);c=Math.atan2(g*j,$c(i,j*h));b=Math.atan2(i,j*h);d=fc(b+this.long0);e=bd(this.cgb,c)}else d=1/0,e=1/0;return a.x=d,a.y=e,a}function fa(){var a=hd(this.zone,this.long0);if(void 0===a)throw new Error("unknown utm zone");this.lat0=0;this.long0=(6*Math.abs(a)-183)*Hb;this.x0=5e5;this.y0=this.utmSouth?1e7:0;this.k0=.9996;gd.init.apply(this);this.forward=gd.forward;this.inverse=gd.inverse}function ga(){var a=Math.sin(this.lat0),b=Math.cos(this.lat0);b*=b;this.rc=Math.sqrt(1-this.es)/(1-this.es*a*a);this.C=Math.sqrt(1+this.es*b*b/(1-this.es));this.phic0=Math.asin(a/this.C);this.ratexp=.5*this.C*this.e;this.K=Math.tan(.5*this.phic0+Jb)/(Math.pow(Math.tan(.5*this.lat0+Jb),this.C)*ld(this.e*a,this.ratexp))}function ha(a){var b=a.x,c=a.y;return a.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*c+Jb),this.C)*ld(this.e*Math.sin(c),this.ratexp))-Cb,a.x=this.C*b,a}function ia(a){for(var c=a.x/this.C,d=a.y,e=Math.pow(Math.tan(.5*d+Jb)/this.K,1/this.C),f=md;f>0&&(d=2*Math.atan(e*ld(this.e*Math.sin(a.y),-.5*this.e))-Cb,!(Math.abs(d-a.y)<1e-14));--f)a.y=d;return f?(a.x=c,a.y=d,a):null}function ja(){od.init.apply(this);this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function ka(a){var b,c,d,e;return a.x=fc(a.x-this.long0),od.forward.apply(this,[a]),b=Math.sin(a.y),c=Math.cos(a.y),d=Math.cos(a.x),e=this.k0*this.R2/(1+this.sinc0*b+this.cosc0*c*d),a.x=e*c*Math.sin(a.x),a.y=e*(this.cosc0*b-this.sinc0*c*d),a.x=this.a*a.x+this.x0,a.y=this.a*a.y+this.y0,a}function la(a){var b,c,d,e,f;if(a.x=(a.x-this.x0)/this.a,a.y=(a.y-this.y0)/this.a,a.x/=this.k0,a.y/=this.k0,f=Math.sqrt(a.x*a.x+a.y*a.y)){var g=2*Math.atan2(f,this.R2);b=Math.sin(g);c=Math.cos(g);e=Math.asin(c*this.sinc0+a.y*b*this.cosc0/f);d=Math.atan2(a.x*b,f*this.cosc0*c-a.y*this.sinc0*b)}else e=this.phic0,d=0;return a.x=d,a.y=e,od.inverse.apply(this,[a]),a.x=fc(a.x+this.long0),a}function ma(a,b,c){return b*=c,Math.tan(.5*(Cb+a))*Math.pow((1-b)/(1+b),.5*c)}function na(){this.coslat0=Math.cos(this.lat0);this.sinlat0=Math.sin(this.lat0);this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Gb&&(this.k0=.5*(1+ec(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=Gb&&(this.con=this.lat0>0?1:-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Gb&&(this.k0=.5*this.cons*dc(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/gc(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=dc(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-Cb,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function oa(a){var b,c,d,e,f,g,h=a.x,i=a.y,j=Math.sin(i),k=Math.cos(i),l=fc(h-this.long0);return Math.abs(Math.abs(h-this.long0)-Math.PI)<=Gb&&Math.abs(i+this.lat0)<=Gb?(a.x=NaN,a.y=NaN,a):this.sphere?(b=2*this.k0/(1+this.sinlat0*j+this.coslat0*k*Math.cos(l)),a.x=this.a*b*k*Math.sin(l)+this.x0,a.y=this.a*b*(this.coslat0*j-this.sinlat0*k*Math.cos(l))+this.y0,a):(c=2*Math.atan(this.ssfn_(i,j,this.e))-Cb,e=Math.cos(c),d=Math.sin(c),Math.abs(this.coslat0)<=Gb?(f=gc(this.e,i*this.con,this.con*j),g=2*this.a*this.k0*f/this.cons,a.x=this.x0+g*Math.sin(h-this.long0),a.y=this.y0-this.con*g*Math.cos(h-this.long0),a):(Math.abs(this.sinlat0)<Gb?(b=2*this.a*this.k0/(1+e*Math.cos(l)),a.y=b*d):(b=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*d+this.cosX0*e*Math.cos(l))),a.y=b*(this.cosX0*d-this.sinX0*e*Math.cos(l))+this.y0),a.x=b*e*Math.sin(l)+this.x0,a))}function pa(a){a.x-=this.x0;a.y-=this.y0;var b,c,d,e,f,g=Math.sqrt(a.x*a.x+a.y*a.y);if(this.sphere){var h=2*Math.atan(g/(.5*this.a*this.k0));return b=this.long0,c=this.lat0,g<=Gb?(a.x=b,a.y=c,a):(c=Math.asin(Math.cos(h)*this.sinlat0+a.y*Math.sin(h)*this.coslat0/g),b=fc(Math.abs(this.coslat0)<Gb?this.lat0>0?this.long0+Math.atan2(a.x,-1*a.y):this.long0+Math.atan2(a.x,a.y):this.long0+Math.atan2(a.x*Math.sin(h),g*this.coslat0*Math.cos(h)-a.y*this.sinlat0*Math.sin(h))),a.x=b,a.y=c,a)}if(Math.abs(this.coslat0)<=Gb){if(g<=Gb)return c=this.lat0,b=this.long0,a.x=b,a.y=c,a;a.x*=this.con;a.y*=this.con;d=g*this.cons/(2*this.a*this.k0);c=this.con*hc(this.e,d);b=this.con*fc(this.con*this.long0+Math.atan2(a.x,-1*a.y))}else e=2*Math.atan(g*this.cosX0/(2*this.a*this.k0*this.ms1)),b=this.long0,g<=Gb?f=this.X0:(f=Math.asin(Math.cos(e)*this.sinX0+a.y*Math.sin(e)*this.cosX0/g),b=fc(this.long0+Math.atan2(a.x*Math.sin(e),g*this.cosX0*Math.cos(e)-a.y*this.sinX0*Math.sin(e)))),c=-1*hc(this.e,Math.tan(.5*(Cb+f)));return a.x=b,a.y=c,a}function qa(){var a=this.lat0;this.lambda0=this.long0;var b=Math.sin(a),c=this.a,d=this.rf,e=1/d,f=2*e-Math.pow(e,2),g=this.e=Math.sqrt(f);this.R=this.k0*c*Math.sqrt(1-f)/(1-f*Math.pow(b,2));this.alpha=Math.sqrt(1+f/(1-f)*Math.pow(Math.cos(a),4));this.b0=Math.asin(b/this.alpha);var h=Math.log(Math.tan(Math.PI/4+this.b0/2)),i=Math.log(Math.tan(Math.PI/4+a/2)),j=Math.log((1+g*b)/(1-g*b));this.K=h-this.alpha*i+this.alpha*g/2*j}function ra(a){var b=Math.log(Math.tan(Math.PI/4-a.y/2)),c=this.e/2*Math.log((1+this.e*Math.sin(a.y))/(1-this.e*Math.sin(a.y))),d=-this.alpha*(b+c)+this.K,e=2*(Math.atan(Math.exp(d))-Math.PI/4),f=this.alpha*(a.x-this.lambda0),g=Math.atan(Math.sin(f)/(Math.sin(this.b0)*Math.tan(e)+Math.cos(this.b0)*Math.cos(f))),h=Math.asin(Math.cos(this.b0)*Math.sin(e)-Math.sin(this.b0)*Math.cos(e)*Math.cos(f));return a.y=this.R/2*Math.log((1+Math.sin(h))/(1-Math.sin(h)))+this.y0,a.x=this.R*g+this.x0,a}function sa(a){for(var b=a.x-this.x0,c=a.y-this.y0,d=b/this.R,e=2*(Math.atan(Math.exp(c/this.R))-Math.PI/4),f=Math.asin(Math.cos(this.b0)*Math.sin(e)+Math.sin(this.b0)*Math.cos(e)*Math.cos(d)),g=Math.atan(Math.sin(d)/(Math.cos(this.b0)*Math.cos(d)-Math.sin(this.b0)*Math.tan(e))),h=this.lambda0+g/this.alpha,i=0,j=f,k=-1e3,l=0;Math.abs(j-k)>1e-7;){if(++l>20)return;i=1/this.alpha*(Math.log(Math.tan(Math.PI/4+f/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(j))/2));k=j;j=2*Math.atan(Math.exp(i))-Math.PI/2}return a.x=h,a.y=j,a}function ta(){this.no_off=this.no_off||!1;this.no_rot=this.no_rot||!1;isNaN(this.k0)&&(this.k0=1);var a=Math.sin(this.lat0),b=Math.cos(this.lat0),c=this.e*a;this.bl=Math.sqrt(1+this.es/(1-this.es)*Math.pow(b,4));this.al=this.a*this.bl*this.k0*Math.sqrt(1-this.es)/(1-c*c);var d=gc(this.e,this.lat0,a),e=this.bl/b*Math.sqrt((1-this.es)/(1-c*c));e*e<1&&(e=1);var f,g;if(isNaN(this.longc)){var h=gc(this.e,this.lat1,Math.sin(this.lat1)),i=gc(this.e,this.lat2,Math.sin(this.lat2));this.el=this.lat0>=0?(e+Math.sqrt(e*e-1))*Math.pow(d,this.bl):(e-Math.sqrt(e*e-1))*Math.pow(d,this.bl);var j=Math.pow(h,this.bl),k=Math.pow(i,this.bl);f=this.el/j;g=.5*(f-1/f);var l=(this.el*this.el-k*j)/(this.el*this.el+k*j),m=(k-j)/(k+j),n=fc(this.long1-this.long2);this.long0=.5*(this.long1+this.long2)-Math.atan(l*Math.tan(.5*this.bl*n)/m)/this.bl;this.long0=fc(this.long0);var o=fc(this.long1-this.long0);this.gamma0=Math.atan(Math.sin(this.bl*o)/g);this.alpha=Math.asin(e*Math.sin(this.gamma0))}else f=this.lat0>=0?e+Math.sqrt(e*e-1):e-Math.sqrt(e*e-1),this.el=f*Math.pow(d,this.bl),g=.5*(f-1/f),this.gamma0=Math.asin(Math.sin(this.alpha)/e),this.long0=this.longc-Math.asin(g*Math.tan(this.gamma0))/this.bl;this.uc=this.no_off?0:this.lat0>=0?this.al/this.bl*Math.atan2(Math.sqrt(e*e-1),Math.cos(this.alpha)):-1*this.al/this.bl*Math.atan2(Math.sqrt(e*e-1),Math.cos(this.alpha))}function ua(a){var b,c,d,e=a.x,f=a.y,g=fc(e-this.long0);if(Math.abs(Math.abs(f)-Cb)<=Gb)d=f>0?-1:1,c=this.al/this.bl*Math.log(Math.tan(Jb+d*this.gamma0*.5)),b=-1*d*Cb*this.al/this.bl;else{var h=gc(this.e,f,Math.sin(f)),i=this.el/Math.pow(h,this.bl),j=.5*(i-1/i),k=.5*(i+1/i),l=Math.sin(this.bl*g),m=(j*Math.sin(this.gamma0)-l*Math.cos(this.gamma0))/k;c=Math.abs(Math.abs(m)-1)<=Gb?Number.POSITIVE_INFINITY:.5*this.al*Math.log((1-m)/(1+m))/this.bl;b=Math.abs(Math.cos(this.bl*g))<=Gb?this.al*this.bl*g:this.al*Math.atan2(j*Math.cos(this.gamma0)+l*Math.sin(this.gamma0),Math.cos(this.bl*g))/this.bl}return this.no_rot?(a.x=this.x0+b,a.y=this.y0+c):(b-=this.uc,a.x=this.x0+c*Math.cos(this.alpha)+b*Math.sin(this.alpha),a.y=this.y0+b*Math.cos(this.alpha)-c*Math.sin(this.alpha)),a}function va(a){var b,c;this.no_rot?(c=a.y-this.y0,b=a.x-this.x0):(c=(a.x-this.x0)*Math.cos(this.alpha)-(a.y-this.y0)*Math.sin(this.alpha),b=(a.y-this.y0)*Math.cos(this.alpha)+(a.x-this.x0)*Math.sin(this.alpha),b+=this.uc);var d=Math.exp(-1*this.bl*c/this.al),e=.5*(d-1/d),f=.5*(d+1/d),g=Math.sin(this.bl*b/this.al),h=(g*Math.cos(this.gamma0)+e*Math.sin(this.gamma0))/f,i=Math.pow(this.el/Math.sqrt((1+h)/(1-h)),1/this.bl);return Math.abs(h-1)<Gb?(a.x=this.long0,a.y=Cb):Math.abs(h+1)<Gb?(a.x=this.long0,a.y=-1*Cb):(a.y=hc(this.e,i),a.x=fc(this.long0-Math.atan2(e*Math.cos(this.gamma0)-g*Math.sin(this.gamma0),Math.cos(this.bl*b/this.al))/this.bl)),a}function wa(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<Gb)){var a=this.b/this.a;this.e=Math.sqrt(1-a*a);var b=Math.sin(this.lat1),c=Math.cos(this.lat1),d=dc(this.e,b,c),e=gc(this.e,this.lat1,b),f=Math.sin(this.lat2),g=Math.cos(this.lat2),h=dc(this.e,f,g),i=gc(this.e,this.lat2,f),j=gc(this.e,this.lat0,Math.sin(this.lat0));this.ns=Math.abs(this.lat1-this.lat2)>Gb?Math.log(d/h)/Math.log(e/i):b;isNaN(this.ns)&&(this.ns=b);this.f0=d/(this.ns*Math.pow(e,this.ns));this.rh=this.a*this.f0*Math.pow(j,this.ns);this.title||(this.title="Lambert Conformal Conic")}}function xa(a){var b=a.x,c=a.y;Math.abs(2*Math.abs(c)-Math.PI)<=Gb&&(c=ec(c)*(Cb-2*Gb));var d,e,f=Math.abs(Math.abs(c)-Cb);if(f>Gb)d=gc(this.e,c,Math.sin(c)),e=this.a*this.f0*Math.pow(d,this.ns);else{if(f=c*this.ns,f<=0)return null;e=0}var g=this.ns*fc(b-this.long0);return a.x=this.k0*e*Math.sin(g)+this.x0,a.y=this.k0*(this.rh-e*Math.cos(g))+this.y0,a}function ya(a){var b,c,d,e,f,g=(a.x-this.x0)/this.k0,h=this.rh-(a.y-this.y0)/this.k0;this.ns>0?(b=Math.sqrt(g*g+h*h),c=1):(b=-Math.sqrt(g*g+h*h),c=-1);var i=0;if(0!==b&&(i=Math.atan2(c*g,c*h)),0!==b||this.ns>0){if(c=1/this.ns,d=Math.pow(b/(this.a*this.f0),c),e=hc(this.e,d),e===-9999)return null}else e=-Cb;return f=fc(i/this.ns+this.long0),a.x=f,a.y=e,a}function za(){this.a=6377397.155;this.es=.006674372230614;this.e=Math.sqrt(this.es);this.lat0||(this.lat0=.863937979737193);this.long0||(this.long0=.43342343091192509);this.k0||(this.k0=.9999);this.s45=.785398163397448;this.s90=2*this.s45;this.fi0=this.lat0;this.e2=this.es;this.e=Math.sqrt(this.e2);this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2));this.uq=1.04216856380474;this.u0=Math.asin(Math.sin(this.fi0)/this.alfa);this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2);this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g;this.k1=this.k0;this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2));this.s0=1.37008346281555;this.n=Math.sin(this.s0);this.ro0=this.k1*this.n0/Math.tan(this.s0);this.ad=this.s90-this.uq}function Aa(a){var b,c,d,e,f,g,h,i=a.x,j=a.y,k=fc(i-this.long0);return b=Math.pow((1+this.e*Math.sin(j))/(1-this.e*Math.sin(j)),this.alfa*this.e/2),c=2*(Math.atan(this.k*Math.pow(Math.tan(j/2+this.s45),this.alfa)/b)-this.s45),d=-k*this.alfa,e=Math.asin(Math.cos(this.ad)*Math.sin(c)+Math.sin(this.ad)*Math.cos(c)*Math.cos(d)),f=Math.asin(Math.cos(c)*Math.sin(d)/Math.cos(e)),g=this.n*f,h=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(e/2+this.s45),this.n),a.y=h*Math.cos(g)/1,a.x=h*Math.sin(g)/1,this.czech||(a.y*=-1,a.x*=-1),a}function Ba(a){var b,c,d,e,f,g,h,i,j=a.x;a.x=a.y;a.y=j;this.czech||(a.y*=-1,a.x*=-1);g=Math.sqrt(a.x*a.x+a.y*a.y);f=Math.atan2(a.y,a.x);e=f/Math.sin(this.s0);d=2*(Math.atan(Math.pow(this.ro0/g,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45);b=Math.asin(Math.cos(this.ad)*Math.sin(d)-Math.sin(this.ad)*Math.cos(d)*Math.cos(e));c=Math.asin(Math.cos(d)*Math.sin(e)/Math.cos(b));a.x=this.long0-c/this.alfa;h=b;i=0;var k=0;do a.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(b/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(h))/(1-this.e*Math.sin(h)),this.e/2))-this.s45),Math.abs(h-a.y)<1e-10&&(i=1),h=a.y,k+=1;while(0===i&&k<15);return k>=15?null:a}function Ca(){this.sphere||(this.e0=Cd(this.es),this.e1=Dd(this.es),this.e2=Ed(this.es),this.e3=Fd(this.es),this.ml0=this.a*Bd(this.e0,this.e1,this.e2,this.e3,this.lat0))}function Da(a){var b,c,d=a.x,e=a.y;if(d=fc(d-this.long0),this.sphere)b=this.a*Math.asin(Math.cos(e)*Math.sin(d)),c=this.a*(Math.atan2(Math.tan(e),Math.cos(d))-this.lat0);else{var f=Math.sin(e),g=Math.cos(e),h=Gd(this.a,this.e,f),i=Math.tan(e)*Math.tan(e),j=d*Math.cos(e),k=j*j,l=this.es*g*g/(1-this.es),m=this.a*Bd(this.e0,this.e1,this.e2,this.e3,e);b=h*j*(1-k*i*(1/6-(8-i+8*l)*k/120));c=m-this.ml0+h*f/g*k*(.5+(5-i+6*l)*k/24)}return a.x=b+this.x0,a.y=c+this.y0,a}function Ea(a){a.x-=this.x0;a.y-=this.y0;var b,c,d=a.x/this.a,e=a.y/this.a;if(this.sphere){var f=e+this.lat0;b=Math.asin(Math.sin(f)*Math.cos(d));c=Math.atan2(Math.tan(d),Math.cos(f))}else{var g=this.ml0/this.a+e,h=Id(g,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(h)-Cb)<=Gb)return a.x=this.long0,a.y=Cb,e<0&&(a.y*=-1),a;var i=Gd(this.a,this.e,Math.sin(h)),j=i*i*i/this.a/this.a*(1-this.es),k=Math.pow(Math.tan(h),2),l=d*this.a/i,m=l*l;b=h-i*Math.tan(h)/j*l*l*(.5-(1+3*k)*l*l/24);c=l*(1-m*(k/3+(1+3*k)*k*m/15))/Math.cos(h)}return a.x=fc(c+this.long0),a.y=Hd(b),a}function Fa(){var a=Math.abs(this.lat0);if(this.mode=Math.abs(a-Cb)<Gb?this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(a)<Gb?this.EQUIT:this.OBLIQ,this.es>0){var b;switch(this.qp=Ld(this.e,1),this.mmf=.5/(1-this.es),this.apa=Ia(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp);this.dd=1/this.rq;this.xmf=1;this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp);b=Math.sin(this.lat0);this.sinb1=Ld(this.e,b)/this.qp;this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1);this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*b*b)*this.rq*this.cosb1);this.ymf=(this.xmf=this.rq)/this.dd;this.xmf*=this.dd}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function Ga(a){var b,c,d,e,f,g,h,i,j,k,l=a.x,m=a.y;if(l=fc(l-this.long0),this.sphere){if(f=Math.sin(m),k=Math.cos(m),d=Math.cos(l),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(c=this.mode===this.EQUIT?1+k*d:1+this.sinph0*f+this.cosph0*k*d,c<=Gb)return null;c=Math.sqrt(2/c);b=c*k*Math.sin(l);c*=this.mode===this.EQUIT?f:this.cosph0*f-this.sinph0*k*d}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(d=-d),Math.abs(m+this.phi0)<Gb)return null;c=Jb-.5*m;c=2*(this.mode===this.S_POLE?Math.cos(c):Math.sin(c));b=c*Math.sin(l);c*=d}}else{switch(h=0,i=0,j=0,d=Math.cos(l),e=Math.sin(l),f=Math.sin(m),g=Ld(this.e,f),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(h=g/this.qp,i=Math.sqrt(1-h*h)),this.mode){case this.OBLIQ:j=1+this.sinb1*h+this.cosb1*i*d;break;case this.EQUIT:j=1+i*d;break;case this.N_POLE:j=Cb+m;g=this.qp-g;break;case this.S_POLE:j=m-Cb;g=this.qp+g}if(Math.abs(j)<Gb)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:j=Math.sqrt(2/j);c=this.mode===this.OBLIQ?this.ymf*j*(this.cosb1*h-this.sinb1*i*d):(j=Math.sqrt(2/(1+i*d)))*h*this.ymf;b=this.xmf*j*i*e;break;case this.N_POLE:case this.S_POLE:g>=0?(b=(j=Math.sqrt(g))*e,c=d*(this.mode===this.S_POLE?j:-j)):b=c=0}}return a.x=this.a*b+this.x0,a.y=this.a*c+this.y0,a}function Ha(a){a.x-=this.x0;a.y-=this.y0;var b,c,d,e,f,g,h,i=a.x/this.a,j=a.y/this.a;if(this.sphere){var k,l=0,m=0;if(k=Math.sqrt(i*i+j*j),c=.5*k,c>1)return null;switch(c=2*Math.asin(c),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(m=Math.sin(c),l=Math.cos(c)),this.mode){case this.EQUIT:c=Math.abs(k)<=Gb?0:Math.asin(j*m/k);i*=m;j=l*k;break;case this.OBLIQ:c=Math.abs(k)<=Gb?this.phi0:Math.asin(l*this.sinph0+j*m*this.cosph0/k);i*=m*this.cosph0;j=(l-Math.sin(c)*this.sinph0)*k;break;case this.N_POLE:j=-j;c=Cb-c;break;case this.S_POLE:c-=Cb}b=0!==j||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(i,j):0}else{if(h=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(i/=this.dd,j*=this.dd,g=Math.sqrt(i*i+j*j),g<Gb)return a.x=0,a.y=this.phi0,a;e=2*Math.asin(.5*g/this.rq);d=Math.cos(e);i*=e=Math.sin(e);this.mode===this.OBLIQ?(h=d*this.sinb1+j*e*this.cosb1/g,f=this.qp*h,j=g*this.cosb1*d-j*this.sinb1*e):(h=j*e/g,f=this.qp*h,j=g*d)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(j=-j),f=i*i+j*j,!f)return a.x=0,a.y=this.phi0,a;h=1-f/this.qp;this.mode===this.S_POLE&&(h=-h)}b=Math.atan2(i,j);c=Ja(Math.asin(h),this.apa)}return a.x=fc(this.long0+b),a.y=c,a}function Ia(a){var b,c=[];return c[0]=a*Qd,b=a*a,c[0]+=b*Rd,c[1]=b*Td,b*=a,c[0]+=b*Sd,c[1]+=b*Ud,c[2]=b*Vd,c}function Ja(a,b){var c=a+a;return a+b[0]*Math.sin(c)+b[1]*Math.sin(c+c)+b[2]*Math.sin(c+c+c)}function Ka(){Math.abs(this.lat1+this.lat2)<Gb||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=dc(this.e3,this.sin_po,this.cos_po),this.qs1=Ld(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=dc(this.e3,this.sin_po,this.cos_po),this.qs2=Ld(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Ld(this.e3,this.sin_po,this.cos_po),this.ns0=Math.abs(this.lat1-this.lat2)>Gb?(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function La(a){var b=a.x,c=a.y;this.sin_phi=Math.sin(c);this.cos_phi=Math.cos(c);var d=Ld(this.e3,this.sin_phi,this.cos_phi),e=this.a*Math.sqrt(this.c-this.ns0*d)/this.ns0,f=this.ns0*fc(b-this.long0),g=e*Math.sin(f)+this.x0,h=this.rh-e*Math.cos(f)+this.y0;return a.x=g,a.y=h,a}function Ma(a){var b,c,d,e,f,g;return a.x-=this.x0,a.y=this.rh-a.y+this.y0,this.ns0>=0?(b=Math.sqrt(a.x*a.x+a.y*a.y),d=1):(b=-Math.sqrt(a.x*a.x+a.y*a.y),d=-1),e=0,0!==b&&(e=Math.atan2(d*a.x,d*a.y)),d=b*this.ns0/this.a,this.sphere?g=Math.asin((this.c-d*d)/(2*this.ns0)):(c=(this.c-d*d)/this.ns0,g=this.phi1z(this.e3,c)),f=fc(e/this.ns0+this.long0),a.x=f,a.y=g,a}function Na(a,b){var c,d,e,f,g,h=Yd(.5*b);if(a<Gb)return h;for(var i=a*a,j=1;j<=25;j++)if(c=Math.sin(h),d=Math.cos(h),e=a*c,f=1-e*e,g=.5*f*f/d*(b/(1-i)-c/f+.5/a*Math.log((1-e)/(1+e))),h+=g,Math.abs(g)<=1e-7)return h;return null}function Oa(){this.sin_p14=Math.sin(this.lat0);this.cos_p14=Math.cos(this.lat0);this.infinity_dist=1e3*this.a;this.rc=1}function Pa(a){var b,c,d,e,f,g,h,i,j=a.x,k=a.y;return d=fc(j-this.long0),b=Math.sin(k),c=Math.cos(k),e=Math.cos(d),g=this.sin_p14*b+this.cos_p14*c*e,f=1,g>0||Math.abs(g)<=Gb?(h=this.x0+this.a*f*c*Math.sin(d)/g,i=this.y0+this.a*f*(this.cos_p14*b-this.sin_p14*c*e)/g):(h=this.x0+this.infinity_dist*c*Math.sin(d),i=this.y0+this.infinity_dist*(this.cos_p14*b-this.sin_p14*c*e)),a.x=h,a.y=i,a}function Qa(a){var b,c,d,e,f,g;return a.x=(a.x-this.x0)/this.a,a.y=(a.y-this.y0)/this.a,a.x/=this.k0,a.y/=this.k0,(b=Math.sqrt(a.x*a.x+a.y*a.y))?(e=Math.atan2(b,this.rc),c=Math.sin(e),d=Math.cos(e),g=Yd(d*this.sin_p14+a.y*c*this.cos_p14/b),f=Math.atan2(a.x*c,b*this.cos_p14*d-a.y*this.sin_p14*c),f=fc(this.long0+f)):(g=this.phic0,f=0),a.x=f,a.y=g,a}function Ra(){this.sphere||(this.k0=dc(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function Sa(a){var b,c,d=a.x,e=a.y,f=fc(d-this.long0);if(this.sphere)b=this.x0+this.a*f*Math.cos(this.lat_ts),c=this.y0+this.a*Math.sin(e)/Math.cos(this.lat_ts);else{var g=Ld(this.e,Math.sin(e));b=this.x0+this.a*this.k0*f;c=this.y0+this.a*g*.5/this.k0}return a.x=b,a.y=c,a}function Ta(a){a.x-=this.x0;a.y-=this.y0;var b,c;return this.sphere?(b=fc(this.long0+a.x/this.a/Math.cos(this.lat_ts)),c=Math.asin(a.y/this.a*Math.cos(this.lat_ts))):(c=be(this.e,2*a.y*this.k0/this.a),b=fc(this.long0+a.x/(this.a*this.k0))),a.x=b,a.y=c,a}function Ua(){this.x0=this.x0||0;this.y0=this.y0||0;this.lat0=this.lat0||0;this.long0=this.long0||0;this.lat_ts=this.lat_ts||0;this.title=this.title||"Equidistant Cylindrical (Plate Carre)";this.rc=Math.cos(this.lat_ts)}function Va(a){var b=a.x,c=a.y,d=fc(b-this.long0),e=Hd(c-this.lat0);return a.x=this.x0+this.a*d*this.rc,a.y=this.y0+this.a*e,a}function Wa(a){var b=a.x,c=a.y;return a.x=fc(this.long0+(b-this.x0)/(this.a*this.rc)),a.y=Hd(this.lat0+(c-this.y0)/this.a),a}function Xa(){this.temp=this.b/this.a;this.es=1-Math.pow(this.temp,2);this.e=Math.sqrt(this.es);this.e0=Cd(this.es);this.e1=Dd(this.es);this.e2=Ed(this.es);this.e3=Fd(this.es);this.ml0=this.a*Bd(this.e0,this.e1,this.e2,this.e3,this.lat0)}function Ya(a){var b,c,d,e=a.x,f=a.y,g=fc(e-this.long0);if(d=g*Math.sin(f),this.sphere)Math.abs(f)<=Gb?(b=this.a*g,c=-1*this.a*this.lat0):(b=this.a*Math.sin(d)/Math.tan(f),c=this.a*(Hd(f-this.lat0)+(1-Math.cos(d))/Math.tan(f)));else if(Math.abs(f)<=Gb)b=this.a*g,c=-1*this.ml0;else{var h=Gd(this.a,this.e,Math.sin(f))/Math.tan(f);b=h*Math.sin(d);c=this.a*Bd(this.e0,this.e1,this.e2,this.e3,f)-this.ml0+h*(1-Math.cos(d))}return a.x=b+this.x0,a.y=c+this.y0,a}function Za(a){var b,c,d,e,f,g,h,i,j;if(d=a.x-this.x0,e=a.y-this.y0,this.sphere)if(Math.abs(e+this.a*this.lat0)<=Gb)b=fc(d/this.a+this.long0),c=0;else{g=this.lat0+e/this.a;h=d*d/this.a/this.a+g*g;i=g;var k;for(f=ge;f;--f)if(k=Math.tan(i),j=-1*(g*(i*k+1)-i-.5*(i*i+h)*k)/((i-g)/k-1),i+=j,Math.abs(j)<=Gb){c=i;break}b=fc(this.long0+Math.asin(d*Math.tan(i)/this.a)/Math.sin(c))}else if(Math.abs(e+this.ml0)<=Gb)c=0,b=fc(this.long0+d/this.a);else{g=(this.ml0+e)/this.a;h=d*d/this.a/this.a+g*g;i=g;var l,m,n,o,p;for(f=ge;f;--f)if(p=this.e*Math.sin(i),l=Math.sqrt(1-p*p)*Math.tan(i),m=this.a*Bd(this.e0,this.e1,this.e2,this.e3,i),n=this.e0-2*this.e1*Math.cos(2*i)+4*this.e2*Math.cos(4*i)-6*this.e3*Math.cos(6*i),o=m/this.a,j=(g*(l*o+1)-o-.5*l*(o*o+h))/(this.es*Math.sin(2*i)*(o*o+h-2*g*o)/(4*l)+(g-o)*(l*n-2/Math.sin(2*i))-n),i-=j,Math.abs(j)<=Gb){c=i;break}l=Math.sqrt(1-this.es*Math.pow(Math.sin(c),2))*Math.tan(c);b=fc(this.long0+Math.asin(d*l/this.a)/Math.sin(c))}return a.x=b,a.y=c,a}function $a(){this.A=[];this.A[1]=.6399175073;this.A[2]=-.1358797613;this.A[3]=.063294409;this.A[4]=-.02526853;this.A[5]=.0117879;this.A[6]=-.0055161;this.A[7]=.0026906;this.A[8]=-.001333;this.A[9]=.00067;this.A[10]=-.00034;this.B_re=[];this.B_im=[];this.B_re[1]=.7557853228;this.B_im[1]=0;this.B_re[2]=.249204646;this.B_im[2]=.003371507;this.B_re[3]=-.001541739;this.B_im[3]=.04105856;this.B_re[4]=-.10162907;this.B_im[4]=.01727609;this.B_re[5]=-.26623489;this.B_im[5]=-.36249218;this.B_re[6]=-.6870983;this.B_im[6]=-1.1651967;this.C_re=[];this.C_im=[];this.C_re[1]=1.3231270439;this.C_im[1]=0;this.C_re[2]=-.577245789;this.C_im[2]=-.007809598;this.C_re[3]=.508307513;this.C_im[3]=-.112208952;this.C_re[4]=-.15094762;this.C_im[4]=.18200602;this.C_re[5]=1.01418179;this.C_im[5]=1.64497696;this.C_re[6]=1.9660549;this.C_im[6]=2.5127645;this.D=[];this.D[1]=1.5627014243;this.D[2]=.5185406398;this.D[3]=-.03333098;this.D[4]=-.1052906;this.D[5]=-.0368594;this.D[6]=.007317;this.D[7]=.0122;this.D[8]=.00394;this.D[9]=-.0013}function _a(a){for(var c=a.x,d=a.y,e=d-this.lat0,f=c-this.long0,g=e/Bb*1e-5,h=f,i=1,j=0,b=1;b<=10;b++)i*=g,j+=this.A[b]*i;var k,l,m=j,n=h,o=1,p=0,q=0,r=0;for(b=1;b<=6;b++)k=o*m-p*n,l=p*m+o*n,o=k,p=l,q=q+this.B_re[b]*o-this.B_im[b]*p,r=r+this.B_im[b]*o+this.B_re[b]*p;return a.x=r*this.a+this.x0,a.y=q*this.a+this.y0,a}function ab(a){for(var c,d,e=a.x,f=a.y,g=e-this.x0,h=f-this.y0,i=h/this.a,j=g/this.a,k=1,l=0,m=0,n=0,b=1;b<=6;b++)c=k*i-l*j,d=l*i+k*j,k=c,l=d,m=m+this.C_re[b]*k-this.C_im[b]*l,n=n+this.C_im[b]*k+this.C_re[b]*l;for(var o=0;o<this.iterations;o++){var p,q,r=m,s=n,t=i,u=j;for(b=2;b<=6;b++)p=r*m-s*n,q=s*m+r*n,r=p,s=q,t+=(b-1)*(this.B_re[b]*r-this.B_im[b]*s),u+=(b-1)*(this.B_im[b]*r+this.B_re[b]*s);r=1;s=0;var v=this.B_re[1],w=this.B_im[1];for(b=2;b<=6;b++)p=r*m-s*n,q=s*m+r*n,r=p,s=q,v+=b*(this.B_re[b]*r-this.B_im[b]*s),w+=b*(this.B_im[b]*r+this.B_re[b]*s);var x=v*v+w*w;m=(t*v+u*w)/x;n=(u*v-t*w)/x}var y=m,z=n,A=1,B=0;for(b=1;b<=9;b++)A*=y,B+=this.D[b]*A;var C=this.lat0+B*Bb*1e5,D=this.long0+z;return a.x=D,a.y=C,a}function bb(){}function cb(a){var b=a.x,c=a.y,d=fc(b-this.long0),e=this.x0+this.a*d,f=this.y0+this.a*Math.log(Math.tan(Math.PI/4+c/2.5))*1.25;return a.x=e,a.y=f,a}function db(a){a.x-=this.x0;a.y-=this.y0;var b=fc(this.long0+a.x/this.a),c=2.5*(Math.atan(Math.exp(.8*a.y/this.a))-Math.PI/4);return a.x=b,a.y=c,a}function eb(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Tc(this.es)}function fb(a){var b,c,d=a.x,e=a.y;if(d=fc(d-this.long0),this.sphere){if(this.m)for(var f=this.n*Math.sin(e),g=ne;g;--g){var h=(this.m*e+Math.sin(e)-f)/(this.m+Math.cos(e));if(e-=h,Math.abs(h)<Gb)break}else e=1!==this.n?Math.asin(this.n*Math.sin(e)):e;b=this.a*this.C_x*d*(this.m+Math.cos(e));c=this.a*this.C_y*e}else{var i=Math.sin(e),j=Math.cos(e);c=this.a*Uc(e,i,j,this.en);b=this.a*d*j/Math.sqrt(1-this.es*i*i)}return a.x=b,a.y=c,a}function gb(a){var b,c,d,e;return a.x-=this.x0,d=a.x/this.a,a.y-=this.y0,b=a.y/this.a,this.sphere?(b/=this.C_y,d/=this.C_x*(this.m+Math.cos(b)),this.m?b=Yd((this.m*b+Math.sin(b))/this.n):1!==this.n&&(b=Yd(Math.sin(b)/this.n)),d=fc(d+this.long0),b=Hd(b)):(b=Wc(a.y/this.a,this.es,this.en),e=Math.abs(b),e<Cb?(e=Math.sin(b),c=this.long0+a.x*Math.sqrt(1-this.es*e*e)/(this.a*Math.cos(b)),d=fc(c)):e-Gb<Cb&&(d=this.long0)),a.x=d,a.y=b,a}function hb(){}function ib(a){for(var b=a.x,c=a.y,d=fc(b-this.long0),e=c,f=Math.PI*Math.sin(c),g=0;;g++){var h=-(e+Math.sin(e)-f)/(1+Math.cos(e));if(e+=h,Math.abs(h)<Gb)break}e/=2;Math.PI/2-Math.abs(c)<Gb&&(d=0);var i=.900316316158*this.a*d*Math.cos(e)+this.x0,j=1.4142135623731*this.a*Math.sin(e)+this.y0;return a.x=i,a.y=j,a}function jb(a){var b,c;a.x-=this.x0;a.y-=this.y0;c=a.y/(1.4142135623731*this.a);Math.abs(c)>.999999999999&&(c=.999999999999);b=Math.asin(c);var d=fc(this.long0+a.x/(.900316316158*this.a*Math.cos(b)));d<-Math.PI&&(d=-Math.PI);d>Math.PI&&(d=Math.PI);c=(2*b+Math.sin(2*b))/Math.PI;Math.abs(c)>1&&(c=1);var e=Math.asin(c);return a.x=d,a.y=e,a}function kb(){Math.abs(this.lat1+this.lat2)<Gb||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Cd(this.es),this.e1=Dd(this.es),this.e2=Ed(this.es),this.e3=Fd(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=dc(this.e,this.sinphi,this.cosphi),this.ml1=Bd(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<Gb?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=dc(this.e,this.sinphi,this.cosphi),this.ml2=Bd(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=Bd(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function lb(a){var b,c=a.x,d=a.y;if(this.sphere)b=this.a*(this.g-d);else{var e=Bd(this.e0,this.e1,this.e2,this.e3,d);b=this.a*(this.g-e)}var f=this.ns*fc(c-this.long0),g=this.x0+b*Math.sin(f),h=this.y0+this.rh-b*Math.cos(f);return a.x=g,a.y=h,a}function mb(a){a.x-=this.x0;a.y=this.rh-a.y+this.y0;var b,c,d,e;this.ns>=0?(c=Math.sqrt(a.x*a.x+a.y*a.y),b=1):(c=-Math.sqrt(a.x*a.x+a.y*a.y),b=-1);var f=0;if(0!==c&&(f=Math.atan2(b*a.x,b*a.y)),this.sphere)return e=fc(this.long0+f/this.ns),d=Hd(this.g-c/this.a),a.x=e,a.y=d,a;var g=this.g-c/this.a;return d=Id(g,this.e0,this.e1,this.e2,this.e3),e=fc(this.long0+f/this.ns),a.x=e,a.y=d,a}function nb(){this.R=this.a}function ob(a){var b,c,d=a.x,e=a.y,f=fc(d-this.long0);Math.abs(e)<=Gb&&(b=this.x0+this.R*f,c=this.y0);var g=Yd(2*Math.abs(e/Math.PI));(Math.abs(f)<=Gb||Math.abs(Math.abs(e)-Cb)<=Gb)&&(b=this.x0,c=e>=0?this.y0+Math.PI*this.R*Math.tan(.5*g):this.y0+Math.PI*this.R*-Math.tan(.5*g));var h=.5*Math.abs(Math.PI/f-f/Math.PI),i=h*h,j=Math.sin(g),k=Math.cos(g),l=k/(j+k-1),m=l*l,n=l*(2/j-1),o=n*n,p=Math.PI*this.R*(h*(l-o)+Math.sqrt(i*(l-o)*(l-o)-(o+i)*(m-o)))/(o+i);f<0&&(p=-p);b=this.x0+p;var q=i+l;return p=Math.PI*this.R*(n*q-h*Math.sqrt((o+i)*(i+1)-q*q))/(o+i),c=e>=0?this.y0+p:this.y0-p,a.x=b,a.y=c,a}function pb(a){var b,c,d,e,f,g,h,i,j,k,l,m,n;return a.x-=this.x0,a.y-=this.y0,l=Math.PI*this.R,d=a.x/l,e=a.y/l,f=d*d+e*e,g=-Math.abs(e)*(1+f),h=g-2*e*e+d*d,i=-2*g+1+2*e*e+f*f,n=e*e/i+(2*h*h*h/i/i/i-9*g*h/i/i)/27,j=(g-h*h/3/i)/i,k=2*Math.sqrt(-j/3),l=3*n/j/k,Math.abs(l)>1&&(l=l>=0?1:-1),m=Math.acos(l)/3,c=a.y>=0?(-k*Math.cos(m+Math.PI/3)-h/3/i)*Math.PI:-(-k*Math.cos(m+Math.PI/3)-h/3/i)*Math.PI,b=Math.abs(d)<Gb?this.long0:fc(this.long0+Math.PI*(f-1+Math.sqrt(1+2*(d*d-e*e)+f*f))/2/d),a.x=b,a.y=c,a}function qb(){this.sin_p12=Math.sin(this.lat0);this.cos_p12=Math.cos(this.lat0)}function rb(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y=a.x,z=a.y,A=Math.sin(a.y),B=Math.cos(a.y),C=fc(y-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=Gb?(a.x=this.x0+this.a*(Cb-z)*Math.sin(C),a.y=this.y0-this.a*(Cb-z)*Math.cos(C),a):Math.abs(this.sin_p12+1)<=Gb?(a.x=this.x0+this.a*(Cb+z)*Math.sin(C),a.y=this.y0+this.a*(Cb+z)*Math.cos(C),a):(s=this.sin_p12*A+this.cos_p12*B*Math.cos(C),q=Math.acos(s),r=q/Math.sin(q),a.x=this.x0+this.a*r*B*Math.sin(C),a.y=this.y0+this.a*r*(this.cos_p12*A-this.sin_p12*B*Math.cos(C)),a):(b=Cd(this.es),c=Dd(this.es),d=Ed(this.es),e=Fd(this.es),Math.abs(this.sin_p12-1)<=Gb?(f=this.a*Bd(b,c,d,e,Cb),g=this.a*Bd(b,c,d,e,z),a.x=this.x0+(f-g)*Math.sin(C),a.y=this.y0-(f-g)*Math.cos(C),a):Math.abs(this.sin_p12+1)<=Gb?(f=this.a*Bd(b,c,d,e,Cb),g=this.a*Bd(b,c,d,e,z),a.x=this.x0+(f+g)*Math.sin(C),a.y=this.y0+(f+g)*Math.cos(C),a):(h=A/B,i=Gd(this.a,this.e,this.sin_p12),j=Gd(this.a,this.e,A),k=Math.atan((1-this.es)*h+this.es*i*this.sin_p12/(j*B)),l=Math.atan2(Math.sin(C),this.cos_p12*Math.tan(k)-this.sin_p12*Math.cos(C)),t=0===l?Math.asin(this.cos_p12*Math.sin(k)-this.sin_p12*Math.cos(k)):Math.abs(Math.abs(l)-Math.PI)<=Gb?-Math.asin(this.cos_p12*Math.sin(k)-this.sin_p12*Math.cos(k)):Math.asin(Math.sin(C)*Math.cos(k)/Math.sin(l)),m=this.e*this.sin_p12/Math.sqrt(1-this.es),n=this.e*this.cos_p12*Math.cos(l)/Math.sqrt(1-this.es),o=m*n,p=n*n,u=t*t,v=u*t,w=v*t,x=w*t,q=i*t*(1-u*p*(1-p)/6+v/8*o*(1-2*p)+w/120*(p*(4-7*p)-3*m*m*(1-7*p))-x/48*o),a.x=this.x0+q*Math.sin(l),a.y=this.y0+q*Math.cos(l),a))}function sb(a){a.x-=this.x0;a.y-=this.y0;var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x;return this.sphere?(b=Math.sqrt(a.x*a.x+a.y*a.y),b>2*Cb*this.a)?void 0:(c=b/this.a,d=Math.sin(c),e=Math.cos(c),f=this.long0,Math.abs(b)<=Gb?g=this.lat0:(g=Yd(e*this.sin_p12+a.y*d*this.cos_p12/b),h=Math.abs(this.lat0)-Cb,f=fc(Math.abs(h)<=Gb?this.lat0>=0?this.long0+Math.atan2(a.x,-a.y):this.long0-Math.atan2(-a.x,a.y):this.long0+Math.atan2(a.x*d,b*this.cos_p12*e-a.y*this.sin_p12*d))),a.x=f,a.y=g,a):(i=Cd(this.es),j=Dd(this.es),k=Ed(this.es),l=Fd(this.es),Math.abs(this.sin_p12-1)<=Gb?(m=this.a*Bd(i,j,k,l,Cb),b=Math.sqrt(a.x*a.x+a.y*a.y),n=m-b,g=Id(n/this.a,i,j,k,l),f=fc(this.long0+Math.atan2(a.x,-1*a.y)),a.x=f,a.y=g,a):Math.abs(this.sin_p12+1)<=Gb?(m=this.a*Bd(i,j,k,l,Cb),b=Math.sqrt(a.x*a.x+a.y*a.y),n=b-m,g=Id(n/this.a,i,j,k,l),f=fc(this.long0+Math.atan2(a.x,a.y)),a.x=f,a.y=g,a):(b=Math.sqrt(a.x*a.x+a.y*a.y),q=Math.atan2(a.x,a.y),o=Gd(this.a,this.e,this.sin_p12),r=Math.cos(q),s=this.e*this.cos_p12*r,t=-s*s/(1-this.es),u=3*this.es*(1-t)*this.sin_p12*this.cos_p12*r/(1-this.es),v=b/o,w=v-t*(1+t)*Math.pow(v,3)/6-u*(1+3*t)*Math.pow(v,4)/24,x=1-t*w*w/2-v*w*w*w/6,p=Math.asin(this.sin_p12*Math.cos(w)+this.cos_p12*Math.sin(w)*r),f=fc(this.long0+Math.asin(Math.sin(q)*Math.sin(w)/Math.cos(p))),g=Math.atan((1-this.es*x*this.sin_p12/Math.sin(p))*Math.tan(p)/(1-this.es)),a.x=f,a.y=g,a))}function tb(){this.sin_p14=Math.sin(this.lat0);this.cos_p14=Math.cos(this.lat0)}function ub(a){var b,c,d,e,f,g,h,i,j=a.x,k=a.y;return d=fc(j-this.long0),b=Math.sin(k),c=Math.cos(k),e=Math.cos(d),g=this.sin_p14*b+this.cos_p14*c*e,f=1,(g>0||Math.abs(g)<=Gb)&&(h=this.a*f*c*Math.sin(d),i=this.y0+this.a*f*(this.cos_p14*b-this.sin_p14*c*e)),a.x=h,a.y=i,a}function vb(a){var b,c,d,e,f,g,h;return a.x-=this.x0,a.y-=this.y0,b=Math.sqrt(a.x*a.x+a.y*a.y),c=Yd(b/this.a),d=Math.sin(c),e=Math.cos(c),g=this.long0,Math.abs(b)<=Gb?(h=this.lat0,a.x=g,a.y=h,a):(h=Yd(e*this.sin_p14+a.y*d*this.cos_p14/b),f=Math.abs(this.lat0)-Cb,Math.abs(f)<=Gb?(g=fc(this.lat0>=0?this.long0+Math.atan2(a.x,-a.y):this.long0-Math.atan2(-a.x,a.y)),a.x=g,a.y=h,a):(g=fc(this.long0+Math.atan2(a.x*d,b*this.cos_p14*e-a.y*this.sin_p14*d)),a.x=g,a.y=h,a))}var wb=function(a){a("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees");a("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees");a("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");a.WGS84=a["EPSG:4326"];a["EPSG:3785"]=a["EPSG:3857"];a.GOOGLE=a["EPSG:3857"];a["EPSG:900913"]=a["EPSG:3857"];a["EPSG:102113"]=a["EPSG:3857"]},xb=1,yb=2,zb=4,Ab=5,Bb=484813681109536e-20,Cb=Math.PI/2,Db=.16666666666666666,Eb=.047222222222222221,Fb=.022156084656084655,Gb="undefined"==typeof Number.EPSILON?1e-10:Number.EPSILON,Hb=.017453292519943295,Ib=57.295779513082323,Jb=Math.PI/4,Kb=2*Math.PI,Lb=3.14159265359,Mb={};Mb.greenwich=0;Mb.lisbon=-9.131906111111;Mb.paris=2.337229166667;Mb.bogota=-74.080916666667;Mb.madrid=-3.687938888889;Mb.rome=12.452333333333;Mb.bern=7.439583333333;Mb.jakarta=106.807719444444;Mb.ferro=-17.666666666667;Mb.brussels=4.367975;Mb.stockholm=18.058277777778;Mb.athens=23.7163375;Mb.oslo=10.722916666667;var Nb={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},Ob=/[\s_\-\/\(\)]/g,Pb=function(b){var c,d,e,f={},g=b.split("+").map(function(a){return a.trim()}).filter(function(a){return a}).reduce(function(a,b){var c=b.split("=");return c.push(!0),a[c[0].toLowerCase()]=c[1],a},{}),h={proj:"projName",datum:"datumCode",rf:function(a){f.rf=parseFloat(a)},lat_0:function(a){f.lat0=a*Hb},lat_1:function(a){f.lat1=a*Hb},lat_2:function(a){f.lat2=a*Hb},lat_ts:function(a){f.lat_ts=a*Hb},lon_0:function(a){f.long0=a*Hb},lon_1:function(a){f.long1=a*Hb},lon_2:function(a){f.long2=a*Hb},alpha:function(a){f.alpha=parseFloat(a)*Hb},lonc:function(a){f.longc=a*Hb},x_0:function(a){f.x0=parseFloat(a)},y_0:function(a){f.y0=parseFloat(a)},k_0:function(a){f.k0=parseFloat(a)},k:function(a){f.k0=parseFloat(a)},a:function(a){f.a=parseFloat(a)},b:function(a){f.b=parseFloat(a)},r_a:function(){f.R_A=!0},zone:function(a){f.zone=parseInt(a,10)},south:function(){f.utmSouth=!0},towgs84:function(a){f.datum_params=a.split(",").map(function(a){return parseFloat(a)})},to_meter:function(a){f.to_meter=parseFloat(a)},units:function(b){f.units=b;var c=a(Nb,b);c&&(f.to_meter=c.to_meter)},from_greenwich:function(a){f.from_greenwich=a*Hb},pm:function(b){var c=a(Mb,b);f.from_greenwich=(c?c:parseFloat(b))*Hb},nadgrids:function(a){"@null"===a?f.datumCode="none":f.nadgrids=a},axis:function(a){var b="ewnsud";3===a.length&&b.indexOf(a.substr(0,1))!==-1&&b.indexOf(a.substr(1,1))!==-1&&b.indexOf(a.substr(2,1))!==-1&&(f.axis=a)}};for(c in g)d=g[c],c in h?(e=h[c],"function"==typeof e?e(d):f[e]=d):f[c]=d;return"string"==typeof f.datumCode&&"WGS84"!==f.datumCode&&(f.datumCode=f.datumCode.toLowerCase()),f},Qb=1,Rb=2,Sb=3,Tb=4,Ub=5,Vb=-1,Wb=/\s/,Xb=/[A-Za-z]/,Yb=/[A-Za-z84]/,Zb=/[,\]]/,$b=/[\d\.E\-\+]/;b.prototype.readCharicter=function(){var a=this.text[this.place++];if(this.state!==Tb)for(;Wb.test(a);){if(this.place>=this.text.length)return;a=this.text[this.place++]}switch(this.state){case Qb:return this.neutral(a);case Rb:return this.keyword(a);case Tb:return this.quoted(a);case Ub:return this.afterquote(a);case Sb:return this.number(a);case Vb:return}};b.prototype.afterquote=function(a){if('"'===a)return this.word+='"',void(this.state=Tb);if(Zb.test(a))return this.word=this.word.trim(),void this.afterItem(a);throw new Error("havn't handled \""+a+'" in afterquote yet, index '+this.place);};b.prototype.afterItem=function(a){return","===a?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=Qb)):"]"===a?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=Qb,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=Vb))):void 0};b.prototype.number=function(a){if($b.test(a))return void(this.word+=a);if(Zb.test(a))return this.word=parseFloat(this.word),void this.afterItem(a);throw new Error("havn't handled \""+a+'" in number yet, index '+this.place);};b.prototype.quoted=function(a){return'"'===a?void(this.state=Ub):void(this.word+=a)};b.prototype.keyword=function(a){if(Yb.test(a))return void(this.word+=a);if("["===a){var b=[];return b.push(this.word),this.level++,null===this.root?this.root=b:this.currentObject.push(b),this.stack.push(this.currentObject),this.currentObject=b,void(this.state=Qb)}if(Zb.test(a))return void this.afterItem(a);throw new Error("havn't handled \""+a+'" in keyword yet, index '+this.place);};b.prototype.neutral=function(a){if(Xb.test(a))return this.word=a,void(this.state=Rb);if('"'===a)return this.word="",void(this.state=Tb);if($b.test(a))return this.word=a,void(this.state=Sb);if(Zb.test(a))return void this.afterItem(a);throw new Error("havn't handled \""+a+'" in neutral yet, index '+this.place);};b.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===Vb)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state);};var _b=.017453292519943295,ac=function(a){var b=c(a),d=b.shift(),f=b.shift();b.unshift(["name",f]);b.unshift(["type",d]);var g={};return e(b,g),h(g),g};wb(i);var bc=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],cc=function(a,b){a=a||{};var c,d;if(!b)return a;for(d in b)c=b[d],void 0!==c&&(a[d]=c);return a},dc=function(a,b,c){var d=a*b;return c/Math.sqrt(1-d*d)},ec=function(a){return a<0?-1:1},fc=function(a){return Math.abs(a)<=Lb?a:a-ec(a)*Kb},gc=function(a,b,c){var d=a*c,e=.5*a;return d=Math.pow((1-d)/(1+d),e),Math.tan(.5*(Cb-b))/d},hc=function(a,b){for(var c,d,e=.5*a,f=Cb-2*Math.atan(b),g=0;g<=15;g++)if(c=a*Math.sin(f),d=Cb-2*Math.atan(b*Math.pow((1-c)/(1+c),e))-f,f+=d,Math.abs(d)<=1e-10)return f;return-9999},jc={init:o,forward:p,inverse:q,names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},lc={init:r,forward:s,inverse:s,names:["longlat","identity"]},mc=[jc,lc],nc={},oc=[],pc={start:v,add:t,get:u},qc={};qc.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"};qc.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"};qc.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"};qc.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"};qc.airy={a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"};qc.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"};qc.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"};qc.mod_airy={a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"};qc.andrae={a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"};qc.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"};qc.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"};qc.bessel={a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"};qc.bess_nam={a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"};qc.clrk66={a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"};qc.clrk80={a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."};qc.clrk58={a:6378293.6452087592,rf:294.26067636926541,ellipseName:"Clarke 1858"};qc.CPM={a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"};qc.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"};qc.engelis={a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"};qc.evrst30={a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"};qc.evrst48={a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"};qc.evrst56={a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"};qc.evrst69={a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"};qc.evrstSS={a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"};qc.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"};qc.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"};qc.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"};qc.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"};qc.hough={a:6378270,rf:297,ellipseName:"Hough"};qc.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"};qc.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"};qc.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"};qc.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"};qc.new_intl={a:6378157.5,b:6356772.2,ellipseName:"New International 1967"};qc.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"};qc.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"};qc.SEasia={a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"};qc.walbeck={a:6376896,b:6355834.8467,ellipseName:"Walbeck"};qc.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"};qc.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"};qc.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var rc=qc.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};qc.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var sc={};sc.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"};sc.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"};sc.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"};sc.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"};sc.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"};sc.potsdam={towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"};sc.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"};sc.hermannskogel={towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"};sc.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"};sc.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"};sc.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"};sc.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"};sc.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"};sc.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"};sc.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"};sc.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};z.projections=pc;z.projections.start();var tc=function(a,b,c){return A(a,b)?c:a.datum_type===Ab||b.datum_type===Ab?c:a.es!==b.es||a.a!==b.a||F(a.datum_type)||F(b.datum_type)?(c=B(c,a.es,a.a),F(a.datum_type)&&(c=D(c,a.datum_type,a.datum_params)),F(b.datum_type)&&(c=E(c,b.datum_type,b.datum_params)),C(c,b.es,b.a,b.b)):c},uc=function(a,b,c){for(var d,e,g=c.x,h=c.y,i=c.z||0,j={},f=0;f<3;f++)if(!b||2!==f||void 0!==c.z)switch(0===f?(d=g,e="x"):1===f?(d=h,e="y"):(d=i,e="z"),a.axis[f]){case"e":j[e]=d;break;case"w":j[e]=-d;break;case"n":j[e]=d;break;case"s":j[e]=-d;break;case"u":void 0!==c[e]&&(j.z=d);break;case"d":void 0!==c[e]&&(j.z=-d);break;default:return null}return j},vc=function(a){var b={x:a[0],y:a[1]};return a.length>2&&(b.z=a[2]),a.length>3&&(b.m=a[3]),b},wc=z("WGS84"),xc=6,yc="AJSAJS",zc="AFAFAF",Ac=65,Bc=73,Cc=79,Dc=86,Ec=90,Fc={forward:L,inverse:M,toPoint:N};Point.fromMGRS=function(a){return new Point(N(a))};Point.prototype.toMGRS=function(a){return L([this.x,this.y],a)};var Hc=1,Ic=.25,Jc=.046875,Kc=.01953125,Lc=.01068115234375,Mc=.75,Nc=.46875,Oc=.013020833333333334,Pc=.007120768229166667,Qc=.36458333333333331,Rc=.005696614583333333,Sc=.3076171875,Tc=function(a){var b=[];b[0]=Hc-a*(Ic+a*(Jc+a*(Kc+a*Lc)));b[1]=a*(Mc-a*(Jc+a*(Kc+a*Lc)));var c=a*a;return b[2]=c*(Nc-a*(Oc+a*Pc)),c*=a,b[3]=c*(Qc-a*Rc),b[4]=c*a*Sc,b},Uc=function(a,b,c,d){return c*=b,b*=b,d[0]*a-c*(d[1]+b*(d[2]+b*(d[3]+b*d[4])))},Vc=20,Wc=function(a,b,c){for(var d=1/(1-b),e=a,f=Vc;f;--f){var g=Math.sin(e),h=1-b*g*g;if(h=(Uc(e,g,Math.cos(e),c)-a)*h*Math.sqrt(h)*d,e-=h,Math.abs(h)<Gb)return e}return e},Yc={init:_,forward:aa,inverse:ba,names:["Transverse_Mercator","Transverse Mercator","tmerc"]},Zc=function(a){var b=Math.exp(a);return(b-1/b)/2},$c=function(a,b){a=Math.abs(a);b=Math.abs(b);var c=Math.max(a,b),d=Math.min(a,b)/(c?c:1);return c*Math.sqrt(1+Math.pow(d,2))},_c=function(a){var b=1+a,c=b-1;return 0===c?a:a*Math.log(b)/c},ad=function(a){var b=Math.abs(a);return b=_c(b*(1+b/($c(1,b)+1))),a<0?-b:b},bd=function(a,b){for(var c,d=2*Math.cos(2*b),e=a.length-1,f=a[e],g=0;--e>=0;)c=-g+d*f+a[e],g=f,f=c;return b+c*Math.sin(2*b)},cd=function(a,b){for(var c,d=2*Math.cos(b),e=a.length-1,f=a[e],g=0;--e>=0;)c=-g+d*f+a[e],g=f,f=c;return Math.sin(b)*c},dd=function(a){var b=Math.exp(a);return(b+1/b)/2},ed=function(a,b,c){for(var d,e,f=Math.sin(b),g=Math.cos(b),h=Zc(c),i=dd(c),j=2*g*i,k=-2*f*h,l=a.length-1,m=a[l],n=0,o=0,p=0;--l>=0;)d=o,e=n,o=m,n=p,m=-d+j*o-k*n+a[l],p=-e+k*o+j*n;return j=f*i,k=g*h,[j*m-k*p,j*p+k*m]},gd={init:ca,forward:da,inverse:ea,names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc"]},hd=function(a,b){if(void 0===a){if(a=Math.floor(30*(fc(b)+Math.PI)/Math.PI)+1,a<0)return 0;if(a>60)return 60}return a},kd={init:fa,names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},ld=function(a,b){return Math.pow((1-a)/(1+a),b)},md=20,od={init:ga,forward:ha,inverse:ia,names:["gauss"]},qd={init:ja,forward:ka,inverse:la,names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative"]},sd={init:na,forward:oa,inverse:pa,names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:ma},ud={init:qa,forward:ra,inverse:sa,names:["somerc"]},wd={init:ta,forward:ua,inverse:va,names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","omerc"]},yd={init:wa,forward:xa,inverse:ya,names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_2SP","lcc"]},Ad={init:za,forward:Aa,inverse:Ba,names:["Krovak","krovak"]},Bd=function(a,b,c,d,e){return a*e-b*Math.sin(2*e)+c*Math.sin(4*e)-d*Math.sin(6*e)},Cd=function(a){return 1-.25*a*(1+a/16*(3+1.25*a))},Dd=function(a){return.375*a*(1+.25*a*(1+.46875*a))},Ed=function(a){return.05859375*a*a*(1+.75*a)},Fd=function(a){return a*a*a*(35/3072)},Gd=function(a,b,c){var d=b*c;return a/Math.sqrt(1-d*d)},Hd=function(a){return Math.abs(a)<Cb?a:a-ec(a)*Math.PI},Id=function(a,b,c,d,e){var f,g;f=a/b;for(var h=0;h<15;h++)if(g=(a-(b*f-c*Math.sin(2*f)+d*Math.sin(4*f)-e*Math.sin(6*f)))/(b-2*c*Math.cos(2*f)+4*d*Math.cos(4*f)-6*e*Math.cos(6*f)),f+=g,Math.abs(g)<=1e-10)return f;return NaN},Kd={init:Ca,forward:Da,inverse:Ea,names:["Cassini","Cassini_Soldner","cass"]},Ld=function(a,b){var c;return a>1e-7?(c=a*b,(1-a*a)*(b/(1-c*c)-.5/a*Math.log((1-c)/(1+c)))):2*b},Qd=.33333333333333331,Rd=.17222222222222222,Sd=.10257936507936508,Td=.063888888888888884,Ud=.0664021164021164,Vd=.016415012942191543,Xd={init:Fa,forward:Ga,inverse:Ha,names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4},Yd=function(a){return Math.abs(a)>1&&(a=a>1?1:-1),Math.asin(a)},$d={init:Ka,forward:La,inverse:Ma,names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:Na},ae={init:Oa,forward:Pa,inverse:Qa,names:["gnom"]},be=function(a,b){var c=1-(1-a*a)/(2*a)*Math.log((1-a)/(1+a));if(Math.abs(Math.abs(b)-c)<1e-6)return b<0?-1*Cb:Cb;for(var d,e,f,g,h=Math.asin(.5*b),i=0;i<30;i++)if(e=Math.sin(h),f=Math.cos(h),g=a*e,d=Math.pow(1-g*g,2)/(2*f)*(b/(1-a*a)-e/(1-g*g)+.5/a*Math.log((1-g)/(1+g))),h+=d,Math.abs(d)<=1e-10)return h;return NaN},de={init:Ra,forward:Sa,inverse:Ta,names:["cea"]},fe={init:Ua,forward:Va,inverse:Wa,names:["Equirectangular","Equidistant_Cylindrical","eqc"]},ge=20,ie={init:Xa,forward:Ya,inverse:Za,names:["Polyconic","poly"]},ke={init:$a,forward:_a,inverse:ab,names:["New_Zealand_Map_Grid","nzmg"]},me={init:bb,forward:cb,inverse:db,names:["Miller_Cylindrical","mill"]},ne=20,pe={init:eb,forward:fb,inverse:gb,names:["Sinusoidal","sinu"]},re={init:hb,forward:ib,inverse:jb,names:["Mollweide","moll"]},te={init:kb,forward:lb,inverse:mb,names:["Equidistant_Conic","eqdc"]},ve={init:nb,forward:ob,inverse:pb,names:["Van_der_Grinten_I","VanDerGrinten","vandg"]},xe={init:qb,forward:rb,inverse:sb,names:["Azimuthal_Equidistant","aeqd"]},ze={init:tb,forward:ub,inverse:vb,names:["ortho"]},Ae=function(proj4){proj4.Proj.projections.add(Yc);proj4.Proj.projections.add(gd);proj4.Proj.projections.add(kd);proj4.Proj.projections.add(qd);proj4.Proj.projections.add(sd);proj4.Proj.projections.add(ud);proj4.Proj.projections.add(wd);proj4.Proj.projections.add(yd);proj4.Proj.projections.add(Ad);proj4.Proj.projections.add(Kd);proj4.Proj.projections.add(Xd);proj4.Proj.projections.add($d);proj4.Proj.projections.add(ae);proj4.Proj.projections.add(de);proj4.Proj.projections.add(fe);proj4.Proj.projections.add(ie);proj4.Proj.projections.add(ke);proj4.Proj.projections.add(me);proj4.Proj.projections.add(pe);proj4.Proj.projections.add(re);proj4.Proj.projections.add(te);proj4.Proj.projections.add(ve);proj4.Proj.projections.add(xe);proj4.Proj.projections.add(ze)};return K.defaultDatum="WGS84",K.Proj=z,K.WGS84=new K.Proj("WGS84"),K.Point=Point,K.toPoint=vc,K.defs=i,K.transform=H,K.mgrs=Fc,K.version="2.4.3",Ae(K),K});proj4.defs([["EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"],["EPSG:32632","+proj=utm +zone=32 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"],["EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"],["EPSG:3857","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"],["EPSG:25831","+proj=utm +zone=31 +ellps=GRS80 +units=m +no_defs"],["EPSG:3043","+proj=utm +zone=31 +ellps=GRS80 +units=m +no_defs"],["EPSG:25832","+proj=utm +zone=32 +ellps=GRS80 +units=m +no_defs"],["EPSG:3044","+proj=utm +zone=32 +ellps=GRS80 +units=m +no_defs"],["EPSG:25833","+proj=utm +zone=33 +ellps=GRS80 +units=m +no_defs"],["EPSG:3045","+proj=utm +zone=33 +ellps=GRS80 +units=m +no_defs"],["EPSG:31465","+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=5500000 +y_0=0 +ellps=bessel +datum=potsdam +units=m +no_defs"],["EPSG:31466","+proj=tmerc +lat_0=0 +lon_0=6 +k=1 +x_0=2500000 +y_0=0 +ellps=bessel +datum=potsdam +units=m +no_defs"],["EPSG:31467","+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +ellps=bessel +datum=potsdam +units=m +no_defs"],["EPSG:31468","+proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 +ellps=bessel +datum=potsdam +units=m +no_defs"],["EPSG:3068","+proj=cass +lat_0=52.41864827777778 +lon_0=13.62720366666667 +x_0=40000 +y_0=10000 +ellps=bessel +towgs84=598.1,73.7,418.2,0.202,0.045,-2.455,6.7 +units=m +no_defs"]]);ol.proj.proj4.register(proj4),function(){function n(n){function t(t,r,e,u,i,o){for(;i>=0&&o>i;i+=n){var a=u?u[i]:i;e=r(e,t[a],a,t)}return e}return function(r,e,u,i){e=b(e,i,4);var o=!k(r)&&m.keys(r),a=(o||r).length,c=n>0?0:a-1;return arguments.length<3&&(u=r[o?o[c]:c],c+=n),t(r,e,u,o,c,a)}}function t(n){return function(t,r,e){r=x(r,e);for(var u=O(t),i=n>0?0:u-1;i>=0&&u>i;i+=n)if(r(t[i],i,t))return i;return-1}}function r(n,t,r){return function(e,u,i){var o=0,a=O(e);if("number"==typeof i)n>0?o=i>=0?i:Math.max(i+a,o):a=i>=0?Math.min(i+1,a):i+a+1;else if(r&&i&&a)return i=r(e,u),e[i]===u?i:-1;if(u!==u)return i=t(l.call(e,o,a),m.isNaN),i>=0?i+o:-1;for(i=n>0?o:a-1;i>=0&&a>i;i+=n)if(e[i]===u)return i;return-1}}function e(n,t){var r=I.length,e=n.constructor,u=m.isFunction(e)&&e.prototype||a,i="constructor";for(m.has(n,i)&&!m.contains(t,i)&&t.push(i);r--;)i=I[r],i in n&&n[i]!==u[i]&&!m.contains(t,i)&&t.push(i)}var u=this,i=u._,o=Array.prototype,a=Object.prototype,c=Function.prototype,f=o.push,l=o.slice,s=a.toString,p=a.hasOwnProperty,h=Array.isArray,v=Object.keys,g=c.bind,y=Object.create,d=function(){},m=function(n){return n instanceof m?n:this instanceof m?void(this._wrapped=n):new m(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=m),exports._=m):u._=m;m.VERSION="1.8.3";var b=function(n,t,r){if(t===void 0)return n;switch(null==r?3:r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,i){return n.call(t,r,e,u,i)}}return function(){return n.apply(t,arguments)}},x=function(n,t,r){return null==n?m.identity:m.isFunction(n)?b(n,t,r):m.isObject(n)?m.matcher(n):m.property(n)};m.iteratee=function(n,t){return x(n,t,1/0)};var _=function(n,t){return function(r){var e=arguments.length;if(2>e||null==r)return r;for(var u=1;e>u;u++)for(var i=arguments[u],o=n(i),a=o.length,c=0;a>c;c++){var f=o[c];t&&r[f]!==void 0||(r[f]=i[f])}return r}},j=function(n){if(!m.isObject(n))return{};if(y)return y(n);d.prototype=n;var t=new d;return d.prototype=null,t},w=function(n){return function(t){if(null!=t)return t[n]}},A=Math.pow(2,53)-1,O=w("length"),k=function(n){var t=O(n);return"number"==typeof t&&t>=0&&A>=t};m.each=m.forEach=function(n,t,r){t=b(t,r);var e,u;if(k(n))for(e=0,u=n.length;u>e;e++)t(n[e],e,n);else{var i=m.keys(n);for(e=0,u=i.length;u>e;e++)t(n[i[e]],i[e],n)}return n};m.map=m.collect=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=Array(u),o=0;u>o;o++){var a=e?e[o]:o;i[o]=t(n[a],a,n)}return i};m.reduce=m.foldl=m.inject=n(1);m.reduceRight=m.foldr=n(-1);m.find=m.detect=function(n,t,r){var e;return e=k(n)?m.findIndex(n,t,r):m.findKey(n,t,r),e!==void 0&&e!==-1?n[e]:void 0};m.filter=m.select=function(n,t,r){var e=[];return t=x(t,r),m.each(n,function(n,r,u){t(n,r,u)&&e.push(n)}),e};m.reject=function(n,t,r){return m.filter(n,m.negate(x(t)),r)};m.every=m.all=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(!t(n[o],o,n))return!1}return!0};m.some=m.any=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(t(n[o],o,n))return!0}return!1};m.contains=m.includes=m.include=function(n,t,r,e){return k(n)||(n=m.values(n)),("number"!=typeof r||e)&&(r=0),m.indexOf(n,t,r)>=0};m.invoke=function(n,t){var r=l.call(arguments,2),e=m.isFunction(t);return m.map(n,function(n){var u=e?t:n[t];return null==u?u:u.apply(n,r)})};m.pluck=function(n,t){return m.map(n,m.property(t))};m.where=function(n,t){return m.filter(n,m.matcher(t))};m.findWhere=function(n,t){return m.find(n,m.matcher(t))};m.max=function(n,t,r){var e,u,i=-1/0,o=-1/0;if(null==t&&null!=n){n=k(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],e>i&&(i=e)}else t=x(t,r),m.each(n,function(n,r,e){u=t(n,r,e);(u>o||u===-1/0&&i===-1/0)&&(i=n,o=u)});return i};m.min=function(n,t,r){var e,u,i=1/0,o=1/0;if(null==t&&null!=n){n=k(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],i>e&&(i=e)}else t=x(t,r),m.each(n,function(n,r,e){u=t(n,r,e);(o>u||1/0===u&&1/0===i)&&(i=n,o=u)});return i};m.shuffle=function(n){for(var t,r=k(n)?n:m.values(n),e=r.length,u=Array(e),i=0;e>i;i++)t=m.random(0,i),t!==i&&(u[i]=u[t]),u[t]=r[i];return u};m.sample=function(n,t,r){return null==t||r?(k(n)||(n=m.values(n)),n[m.random(n.length-1)]):m.shuffle(n).slice(0,Math.max(0,t))};m.sortBy=function(n,t,r){return t=x(t,r),m.pluck(m.map(n,function(n,r,e){return{value:n,index:r,criteria:t(n,r,e)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={};return r=x(r,e),m.each(t,function(e,i){var o=r(e,i,t);n(u,e,o)}),u}};m.groupBy=F(function(n,t,r){m.has(n,r)?n[r].push(t):n[r]=[t]});m.indexBy=F(function(n,t,r){n[r]=t});m.countBy=F(function(n,t,r){m.has(n,r)?n[r]++:n[r]=1});m.toArray=function(n){return n?m.isArray(n)?l.call(n):k(n)?m.map(n,m.identity):m.values(n):[]};m.size=function(n){return null==n?0:k(n)?n.length:m.keys(n).length};m.partition=function(n,t,r){t=x(t,r);var e=[],u=[];return m.each(n,function(n,r,i){(t(n,r,i)?e:u).push(n)}),[e,u]};m.first=m.head=m.take=function(n,t,r){if(null!=n)return null==t||r?n[0]:m.initial(n,n.length-t)};m.initial=function(n,t,r){return l.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))};m.last=function(n,t,r){if(null!=n)return null==t||r?n[n.length-1]:m.rest(n,Math.max(0,n.length-t))};m.rest=m.tail=m.drop=function(n,t,r){return l.call(n,null==t||r?1:t)};m.compact=function(n){return m.filter(n,m.identity)};var S=function(n,t,r,e){for(var u=[],i=0,o=e||0,a=O(n);a>o;o++){var c=n[o];if(k(c)&&(m.isArray(c)||m.isArguments(c))){t||(c=S(c,t,r));var f=0,l=c.length;for(u.length+=l;l>f;)u[i++]=c[f++]}else r||(u[i++]=c)}return u};m.flatten=function(n,t){return S(n,t,!1)};m.without=function(n){return m.difference(n,l.call(arguments,1))};m.uniq=m.unique=function(n,t,r,e){m.isBoolean(t)||(e=r,r=t,t=!1);null!=r&&(r=x(r,e));for(var u=[],i=[],o=0,a=O(n);a>o;o++){var c=n[o],f=r?r(c,o,n):c;t?(o&&i===f||u.push(c),i=f):r?m.contains(i,f)||(i.push(f),u.push(c)):m.contains(u,c)||u.push(c)}return u};m.union=function(){return m.uniq(S(arguments,!0,!0))};m.intersection=function(n){for(var t=[],r=arguments.length,e=0,u=O(n);u>e;e++){var i=n[e];if(!m.contains(t,i)){for(var o=1;r>o&&m.contains(arguments[o],i);o++);o===r&&t.push(i)}}return t};m.difference=function(n){var t=S(arguments,!0,!0,1);return m.filter(n,function(n){return!m.contains(t,n)})};m.zip=function(){return m.unzip(arguments)};m.unzip=function(n){for(var t=n&&m.max(n,O).length||0,r=Array(t),e=0;t>e;e++)r[e]=m.pluck(n,e);return r};m.object=function(n,t){for(var r={},e=0,u=O(n);u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r};m.findIndex=t(1);m.findLastIndex=t(-1);m.sortedIndex=function(n,t,r,e){r=x(r,e,1);for(var u=r(t),i=0,o=O(n);o>i;){var a=Math.floor((i+o)/2);r(n[a])<u?i=a+1:o=a}return i};m.indexOf=r(1,m.findIndex,m.sortedIndex);m.lastIndexOf=r(-1,m.findLastIndex);m.range=function(n,t,r){null==t&&(t=n||0,n=0);r=r||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=Array(e),i=0;e>i;i++,n+=r)u[i]=n;return u};var E=function(n,t,r,e,u){if(!(e instanceof t))return n.apply(r,u);var i=j(n.prototype),o=n.apply(i,u);return m.isObject(o)?o:i};m.bind=function(n,t){if(g&&n.bind===g)return g.apply(n,l.call(arguments,1));if(!m.isFunction(n))throw new TypeError("Bind must be called on a function");var r=l.call(arguments,2),e=function(){return E(n,e,t,this,r.concat(l.call(arguments)))};return e};m.partial=function(n){var t=l.call(arguments,1),r=function(){for(var e=0,u=t.length,i=Array(u),o=0;u>o;o++)i[o]=t[o]===m?arguments[e++]:t[o];for(;e<arguments.length;)i.push(arguments[e++]);return E(n,r,this,this,i)};return r};m.bindAll=function(n){var t,r,e=arguments.length;if(1>=e)throw new Error("bindAll must be passed function names");for(t=1;e>t;t++)r=arguments[t],n[r]=m.bind(n[r],n);return n};m.memoize=function(n,t){var r=function(e){var u=r.cache,i=""+(t?t.apply(this,arguments):e);return m.has(u,i)||(u[i]=n.apply(this,arguments)),u[i]};return r.cache={},r};m.delay=function(n,t){var r=l.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)};m.defer=m.partial(m.delay,m,1);m.throttle=function(n,t,r){var e,u,i,o=null,a=0;r||(r={});var c=function(){a=r.leading===!1?0:m.now();o=null;i=n.apply(e,u);o||(e=u=null)};return function(){var f=m.now();a||r.leading!==!1||(a=f);var l=t-(f-a);return e=this,u=arguments,0>=l||l>t?(o&&(clearTimeout(o),o=null),a=f,i=n.apply(e,u),o||(e=u=null)):o||r.trailing===!1||(o=setTimeout(c,l)),i}};m.debounce=function(n,t,r){var e,u,i,o,a,c=function(){var f=m.now()-o;t>f&&f>=0?e=setTimeout(c,t-f):(e=null,r||(a=n.apply(i,u),e||(i=u=null)))};return function(){i=this;u=arguments;o=m.now();var f=r&&!e;return e||(e=setTimeout(c,t)),f&&(a=n.apply(i,u),i=u=null),a}};m.wrap=function(n,t){return m.partial(t,n)};m.negate=function(n){return function(){return!n.apply(this,arguments)}};m.compose=function(){var n=arguments,t=n.length-1;return function(){for(var r=t,e=n[t].apply(this,arguments);r--;)e=n[r].call(this,e);return e}};m.after=function(n,t){return function(){if(--n<1)return t.apply(this,arguments)}};m.before=function(n,t){var r;return function(){return--n>0&&(r=t.apply(this,arguments)),1>=n&&(t=null),r}};m.once=m.partial(m.before,2);var M=!{toString:null}.propertyIsEnumerable("toString"),I=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];m.keys=function(n){if(!m.isObject(n))return[];if(v)return v(n);var t=[];for(var r in n)m.has(n,r)&&t.push(r);return M&&e(n,t),t};m.allKeys=function(n){if(!m.isObject(n))return[];var t=[];for(var r in n)t.push(r);return M&&e(n,t),t};m.values=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e};m.mapObject=function(n,t,r){t=x(t,r);for(var e,u=m.keys(n),i=u.length,o={},a=0;i>a;a++)e=u[a],o[e]=t(n[e],e,n);return o};m.pairs=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e};m.invert=function(n){for(var t={},r=m.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t};m.functions=m.methods=function(n){var t=[];for(var r in n)m.isFunction(n[r])&&t.push(r);return t.sort()};m.extend=_(m.allKeys);m.extendOwn=m.assign=_(m.keys);m.findKey=function(n,t,r){t=x(t,r);for(var e,u=m.keys(n),i=0,o=u.length;o>i;i++)if(e=u[i],t(n[e],e,n))return e};m.pick=function(n,t,r){var e,u,i={},o=n;if(null==o)return i;m.isFunction(t)?(u=m.allKeys(o),e=b(t,r)):(u=S(arguments,!1,!1,1),e=function(n,t,r){return t in r},o=Object(o));for(var a=0,c=u.length;c>a;a++){var f=u[a],l=o[f];e(l,f,o)&&(i[f]=l)}return i};m.omit=function(n,t,r){if(m.isFunction(t))t=m.negate(t);else{var e=m.map(S(arguments,!1,!1,1),String);t=function(n,t){return!m.contains(e,t)}}return m.pick(n,t,r)};m.defaults=_(m.allKeys,!0);m.create=function(n,t){var r=j(n);return t&&m.extendOwn(r,t),r};m.clone=function(n){return m.isObject(n)?m.isArray(n)?n.slice():m.extend({},n):n};m.tap=function(n,t){return t(n),n};m.isMatch=function(n,t){var r=m.keys(t),e=r.length;if(null==n)return!e;for(var u=Object(n),i=0;e>i;i++){var o=r[i];if(t[o]!==u[o]||!(o in u))return!1}return!0};var N=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof m&&(n=n._wrapped);t instanceof m&&(t=t._wrapped);var u=s.call(n);if(u!==s.call(t))return!1;switch(u){case"[object RegExp]":case"[object String]":return""+n==""+t;case"[object Number]":return+n!=+n?+t!=+t:0==+n?1/+n==1/t:+n==+t;case"[object Date]":case"[object Boolean]":return+n==+t}var i="[object Array]"===u;if(!i){if("object"!=typeof n||"object"!=typeof t)return!1;var o=n.constructor,a=t.constructor;if(o!==a&&!(m.isFunction(o)&&o instanceof o&&m.isFunction(a)&&a instanceof a)&&"constructor"in n&&"constructor"in t)return!1}r=r||[];e=e||[];for(var c=r.length;c--;)if(r[c]===n)return e[c]===t;if(r.push(n),e.push(t),i){if(c=n.length,c!==t.length)return!1;for(;c--;)if(!N(n[c],t[c],r,e))return!1}else{var f,l=m.keys(n);if(c=l.length,m.keys(t).length!==c)return!1;for(;c--;)if(f=l[c],!m.has(t,f)||!N(n[f],t[f],r,e))return!1}return r.pop(),e.pop(),!0};m.isEqual=function(n,t){return N(n,t)};m.isEmpty=function(n){return null==n?!0:k(n)&&(m.isArray(n)||m.isString(n)||m.isArguments(n))?0===n.length:0===m.keys(n).length};m.isElement=function(n){return!(!n||1!==n.nodeType)};m.isArray=h||function(n){return"[object Array]"===s.call(n)};m.isObject=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n};m.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(n){m["is"+n]=function(t){return s.call(t)==="[object "+n+"]"}});m.isArguments(arguments)||(m.isArguments=function(n){return m.has(n,"callee")});"function"!=typeof/./&&"object"!=typeof Int8Array&&(m.isFunction=function(n){return"function"==typeof n||!1});m.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))};m.isNaN=function(n){return m.isNumber(n)&&n!==+n};m.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"===s.call(n)};m.isNull=function(n){return null===n};m.isUndefined=function(n){return n===void 0};m.has=function(n,t){return null!=n&&p.call(n,t)};m.noConflict=function(){return u._=i,this};m.identity=function(n){return n};m.constant=function(n){return function(){return n}};m.noop=function(){};m.property=w;m.propertyOf=function(n){return null==n?function(){}:function(t){return n[t]}};m.matcher=m.matches=function(n){return n=m.extendOwn({},n),function(t){return m.isMatch(t,n)}};m.times=function(n,t,r){var e=Array(Math.max(0,n));t=b(t,r,1);for(var u=0;n>u;u++)e[u]=t(u);return e};m.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};m.now=Date.now||function(){return(new Date).getTime()};var B={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},T=m.invert(B),R=function(n){var t=function(t){return n[t]},r="(?:"+m.keys(n).join("|")+")",e=RegExp(r),u=RegExp(r,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,t):n}};m.escape=R(B);m.unescape=R(T);m.result=function(n,t,r){var e=null==n?void 0:n[t];return e===void 0&&(e=r),m.isFunction(e)?e.call(n):e};var q=0;m.uniqueId=function(n){var t=++q+"";return n?n+t:t};m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,z={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\u2028|\u2029/g,L=function(n){return"\\"+z[n]};m.template=function(n,t,r){!t&&r&&(t=r);t=m.defaults({},t,m.templateSettings);var e=RegExp([(t.escape||K).source,(t.interpolate||K).source,(t.evaluate||K).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(t,r,e,o,a){return i+=n.slice(u,a).replace(D,L),u=a+t.length,r?i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":o&&(i+="';\n"+o+"\n__p+='"),t});i+="';\n";t.variable||(i="with(obj||{}){\n"+i+"}\n");i="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var o=new Function(t.variable||"obj","_",i)}catch(a){throw a.source=i,a;}var c=function(n){return o.call(this,n,m)},f=t.variable||"obj";return c.source="function("+f+"){\n"+i+"}",c};m.chain=function(n){var t=m(n);return t._chain=!0,t};var P=function(n,t){return n._chain?m(t).chain():t};m.mixin=function(n){m.each(m.functions(n),function(t){var r=m[t]=n[t];m.prototype[t]=function(){var n=[this._wrapped];return f.apply(n,arguments),P(this,r.apply(m,n))}})};m.mixin(m);m.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=o[n];m.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==n&&"splice"!==n||0!==r.length||delete r[0],P(this,r)}});m.each(["concat","join","slice"],function(n){var t=o[n];m.prototype[n]=function(){return P(this,t.apply(this._wrapped,arguments))}});m.prototype.value=function(){return this._wrapped};m.prototype.valueOf=m.prototype.toJSON=m.prototype.value;m.prototype.toString=function(){return""+this._wrapped};"function"==typeof define&&define.amd&&define("underscore",[],function(){return m})}.call(this),function(){var global=typeof window=="object"?window:typeof self=="object"?self:this,BlobBuilder=global.BlobBuilder||global.WebKitBlobBuilder||global.MSBlobBuilder||global.MozBlobBuilder;global.URL=global.URL||global.webkitURL||function(href,a){return a=document.createElement("a"),a.href=href,a};var origBlob=global.Blob,createObjectURL=URL.createObjectURL,revokeObjectURL=URL.revokeObjectURL,strTag=global.Symbol&&global.Symbol.toStringTag,blobSupported=!1,blobSupportsArrayBufferView=!1,arrayBufferSupported=!!global.ArrayBuffer,blobBuilderSupported=BlobBuilder&&BlobBuilder.prototype.append&&BlobBuilder.prototype.getBlob;try{blobSupported=new Blob(["ä"]).size===2;blobSupportsArrayBufferView=new Blob([new Uint8Array([1,2])]).size===2}catch(e){}function mapArrayBufferViews(ary){return ary.map(function(chunk){if(chunk.buffer instanceof ArrayBuffer){var buf=chunk.buffer;if(chunk.byteLength!==buf.byteLength){var copy=new Uint8Array(chunk.byteLength);copy.set(new Uint8Array(buf,chunk.byteOffset,chunk.byteLength));buf=copy.buffer}return buf}return chunk})}function BlobBuilderConstructor(ary,options){options=options||{};var bb=new BlobBuilder;return mapArrayBufferViews(ary).forEach(function(part){bb.append(part)}),options.type?bb.getBlob(options.type):bb.getBlob()}function BlobConstructor(ary,options){return new origBlob(mapArrayBufferViews(ary),options||{})}global.Blob&&(BlobBuilderConstructor.prototype=Blob.prototype,BlobConstructor.prototype=Blob.prototype);function stringEncode(string){for(var pos=0,len=string.length,Arr=global.Uint8Array||Array,at=0,tlen=Math.max(32,len+(len>>1)+7),target=new Arr(tlen>>3<<3);pos<len;){var value=string.charCodeAt(pos++);if(value>=55296&&value<=56319){if(pos<len){var extra=string.charCodeAt(pos);(extra&64512)==56320&&(++pos,value=((value&1023)<<10)+(extra&1023)+65536)}if(value>=55296&&value<=56319)continue}if(at+4>target.length){tlen+=8;tlen*=1+pos/string.length*2;tlen=tlen>>3<<3;const update=new Uint8Array(tlen);update.set(target);target=update}if((value&4294967168)==0){target[at++]=value;continue}else if((value&4294965248)==0)target[at++]=value>>6&31|192;else if((value&4294901760)==0)target[at++]=value>>12&15|224,target[at++]=value>>6&63|128;else if((value&4292870144)==0)target[at++]=value>>18&7|240,target[at++]=value>>12&63|128,target[at++]=value>>6&63|128;else continue;target[at++]=value&63|128}return target.slice(0,at)}function stringDecode(buf){for(var end=buf.length,res=[],i=0;i<end;){var firstByte=buf[i],codePoint=null,bytesPerSequence=firstByte>239?4:firstByte>223?3:firstByte>191?2:1;if(i+bytesPerSequence<=end){var secondByte,thirdByte,fourthByte,tempCodePoint;switch(bytesPerSequence){case 1:firstByte<128&&(codePoint=firstByte);break;case 2:secondByte=buf[i+1];(secondByte&192)==128&&(tempCodePoint=(firstByte&31)<<6|secondByte&63,tempCodePoint>127&&(codePoint=tempCodePoint));break;case 3:secondByte=buf[i+1];thirdByte=buf[i+2];(secondByte&192)==128&&(thirdByte&192)==128&&(tempCodePoint=(firstByte&15)<<12|(secondByte&63)<<6|thirdByte&63,tempCodePoint>2047&&(tempCodePoint<55296||tempCodePoint>57343)&&(codePoint=tempCodePoint));break;case 4:secondByte=buf[i+1];thirdByte=buf[i+2];fourthByte=buf[i+3];(secondByte&192)==128&&(thirdByte&192)==128&&(fourthByte&192)==128&&(tempCodePoint=(firstByte&15)<<18|(secondByte&63)<<12|(thirdByte&63)<<6|fourthByte&63,tempCodePoint>65535&&tempCodePoint<1114112&&(codePoint=tempCodePoint))}}codePoint===null?(codePoint=65533,bytesPerSequence=1):codePoint>65535&&(codePoint-=65536,res.push(codePoint>>>10&1023|55296),codePoint=56320|codePoint&1023);res.push(codePoint);i+=bytesPerSequence}for(var len=res.length,str="",i=0;i<len;)str+=String.fromCharCode.apply(String,res.slice(i,i+=4096));return str}var textEncode=typeof TextEncoder=="function"?TextEncoder.prototype.encode.bind(new TextEncoder):stringEncode,textDecode=typeof TextDecoder=="function"?TextDecoder.prototype.decode.bind(new TextDecoder):stringDecode;function FakeBlobBuilder(){function isDataView(obj){return obj&&DataView.prototype.isPrototypeOf(obj)}function bufferClone(buf){for(var view=new Array(buf.byteLength),array=new Uint8Array(buf),i=view.length;i--;)view[i]=array[i];return view}function array2base64(input){for(var byteToCharMap="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",output=[],i=0;i<input.length;i+=3){var byte1=input[i],haveByte2=i+1<input.length,byte2=haveByte2?input[i+1]:0,haveByte3=i+2<input.length,byte3=haveByte3?input[i+2]:0,outByte1=byte1>>2,outByte2=(byte1&3)<<4|byte2>>4,outByte3=(byte2&15)<<2|byte3>>6,outByte4=byte3&63;haveByte3||(outByte4=64,haveByte2||(outByte3=64));output.push(byteToCharMap[outByte1],byteToCharMap[outByte2],byteToCharMap[outByte3],byteToCharMap[outByte4])}return output.join("")}var create=Object.create||function(a){function c(){}return c.prototype=a,new c};if(arrayBufferSupported)var viewClasses=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],isArrayBufferView=ArrayBuffer.isView||function(obj){return obj&&viewClasses.indexOf(Object.prototype.toString.call(obj))>-1};function concatTypedarrays(chunks){for(var size=0,i=chunks.length;i--;)size+=chunks[i].length;var b=new Uint8Array(size),offset=0;for(i=0,l=chunks.length;i<l;i++){var chunk=chunks[i];b.set(chunk,offset);offset+=chunk.byteLength||chunk.length}return b}function Blob(chunks,opts){chunks=chunks||[];opts=opts==null?{}:opts;for(var i=0,len=chunks.length;i<len;i++){var chunk=chunks[i];chunks[i]=chunk instanceof Blob?chunk._buffer:typeof chunk=="string"?textEncode(chunk):arrayBufferSupported&&(ArrayBuffer.prototype.isPrototypeOf(chunk)||isArrayBufferView(chunk))?bufferClone(chunk):arrayBufferSupported&&isDataView(chunk)?bufferClone(chunk.buffer):textEncode(String(chunk))}this._buffer=global.Uint8Array?concatTypedarrays(chunks):[].concat.apply([],chunks);this.size=this._buffer.length;this.type=opts.type||"";this.type=/[^\u0020-\u007E]/.test(this.type)?"":this.type.toLowerCase()}Blob.prototype.arrayBuffer=function(){return Promise.resolve(this._buffer)};Blob.prototype.text=function(){return Promise.resolve(textDecode(this._buffer))};Blob.prototype.slice=function(start,end,type){var slice=this._buffer.slice(start||0,end||this._buffer.length);return new Blob([slice],{type:type})};Blob.prototype.toString=function(){return"[object Blob]"};function File(chunks,name,opts){opts=opts||{};var a=Blob.call(this,chunks,opts)||this;return a.name=name.replace(/\//g,":"),a.lastModifiedDate=opts.lastModified?new Date(opts.lastModified):new Date,a.lastModified=+a.lastModifiedDate,a}if(File.prototype=create(Blob.prototype),File.prototype.constructor=File,Object.setPrototypeOf)Object.setPrototypeOf(File,Blob);else try{File.__proto__=Blob}catch(e){}File.prototype.toString=function(){return"[object File]"};function FileReader(){if(!(this instanceof FileReader))throw new TypeError("Failed to construct 'FileReader': Please use the 'new' operator, this DOM object constructor cannot be called as a function.");var delegate=document.createDocumentFragment();this.addEventListener=delegate.addEventListener;this.dispatchEvent=function(evt){var local=this["on"+evt.type];typeof local=="function"&&local(evt);delegate.dispatchEvent(evt)};this.removeEventListener=delegate.removeEventListener}function _read(fr,blob,kind){if(!(blob instanceof Blob))throw new TypeError("Failed to execute '"+kind+"' on 'FileReader': parameter 1 is not of type 'Blob'.");fr.result="";setTimeout(function(){this.readyState=FileReader.LOADING;fr.dispatchEvent(new Event("load"));fr.dispatchEvent(new Event("loadend"))})}FileReader.EMPTY=0;FileReader.LOADING=1;FileReader.DONE=2;FileReader.prototype.error=null;FileReader.prototype.onabort=null;FileReader.prototype.onerror=null;FileReader.prototype.onload=null;FileReader.prototype.onloadend=null;FileReader.prototype.onloadstart=null;FileReader.prototype.onprogress=null;FileReader.prototype.readAsDataURL=function(blob){_read(this,blob,"readAsDataURL");this.result="data:"+blob.type+";base64,"+array2base64(blob._buffer)};FileReader.prototype.readAsText=function(blob){_read(this,blob,"readAsText");this.result=textDecode(blob._buffer)};FileReader.prototype.readAsArrayBuffer=function(blob){_read(this,blob,"readAsText");this.result=(blob._buffer.buffer||blob._buffer).slice()};FileReader.prototype.abort=function(){};URL.createObjectURL=function(blob){return blob instanceof Blob?"data:"+blob.type+";base64,"+array2base64(blob._buffer):createObjectURL.call(URL,blob)};URL.revokeObjectURL=function(url){revokeObjectURL&&revokeObjectURL.call(URL,url)};var _send=global.XMLHttpRequest&&global.XMLHttpRequest.prototype.send;_send&&(XMLHttpRequest.prototype.send=function(data){data instanceof Blob?(this.setRequestHeader("Content-Type",data.type),_send.call(this,textDecode(data._buffer))):_send.call(this,data)});global.FileReader=FileReader;global.File=File;global.Blob=Blob}function fixFileAndXHR(){var isIE=!!global.ActiveXObject||"-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style,_send=global.XMLHttpRequest&&global.XMLHttpRequest.prototype.send;isIE&&_send&&(XMLHttpRequest.prototype.send=function(data){data instanceof Blob?(this.setRequestHeader("Content-Type",data.type),_send.call(this,data)):_send.call(this,data)});try{new File([],"")}catch(e){try{var klass=new Function('class File extends Blob {constructor(chunks, name, opts) {opts = opts || {};super(chunks, opts || {});this.name = name.replace(///g, ":");this.lastModifiedDate = opts.lastModified ? new Date(opts.lastModified) : new Date();this.lastModified = +this.lastModifiedDate;}};return new File([], ""), File')();global.File=klass}catch(e){var klass=function(b,d,c){var blob=new Blob(b,c),t=c&&void 0!==c.lastModified?new Date(c.lastModified):new Date;return blob.name=d.replace(/\//g,":"),blob.lastModifiedDate=t,blob.lastModified=+t,blob.toString=function(){return"[object File]"},strTag&&(blob[strTag]="File"),blob};global.File=klass}}}blobSupported?(fixFileAndXHR(),global.Blob=blobSupportsArrayBufferView?global.Blob:BlobConstructor):blobBuilderSupported?(fixFileAndXHR(),global.Blob=BlobBuilderConstructor):FakeBlobBuilder();strTag&&(File.prototype[strTag]="File",Blob.prototype[strTag]="Blob",FileReader.prototype[strTag]="FileReader");var blob=global.Blob.prototype,stream;function promisify(obj){return new Promise(function(resolve,reject){obj.onload=obj.onerror=function(evt){obj.onload=obj.onerror=null;evt.type==="load"?resolve(obj.result||obj):reject(new Error("Failed to read the blob/file"))}})}try{new ReadableStream({type:"bytes"});stream=function(){var position=0,blob=this;return new ReadableStream({type:"bytes",autoAllocateChunkSize:524288,pull:function(controller){var v=controller.byobRequest.view,chunk=blob.slice(position,position+v.byteLength);return chunk.arrayBuffer().then(function(buffer){var uint8array=new Uint8Array(buffer),bytesRead=uint8array.byteLength;position+=bytesRead;v.set(uint8array);controller.byobRequest.respond(bytesRead);position>=blob.size&&controller.close()})}})}}catch(e){try{new ReadableStream({});stream=function(blob){var position=0,blob=this;return new ReadableStream({pull:function(controller){var chunk=blob.slice(position,position+524288);return chunk.arrayBuffer().then(function(buffer){position+=buffer.byteLength;var uint8array=new Uint8Array(buffer);controller.enqueue(uint8array);position==blob.size&&controller.close()})}})}}catch(e){try{new Response("").body.getReader().read();stream=function(){return new Response(this).body}}catch(e){stream=function(){throw new Error("Include https://github.com/MattiasBuelens/web-streams-polyfill");}}}}blob.arrayBuffer||(blob.arrayBuffer=function(){var fr=new FileReader;return fr.readAsArrayBuffer(this),promisify(fr)});blob.text||(blob.text=function(){var fr=new FileReader;return fr.readAsText(this),promisify(fr)});blob.stream||(blob.stream=stream)}(),function(view){"use strict";var Uint8Array=view.Uint8Array,HTMLCanvasElement=view.HTMLCanvasElement,canvas_proto=HTMLCanvasElement&&HTMLCanvasElement.prototype,is_base64_regex=/\s*;\s*base64\s*(?:;|$)/i,to_data_url="toDataURL",base64_ranks,decode_base64=function(base64){for(var len=base64.length,buffer=new Uint8Array(len/4*3|0),i=0,outptr=0,last=[0,0],state=0,save=0,rank,code,undef;len--;)code=base64.charCodeAt(i++),rank=base64_ranks[code-43],rank!==255&&rank!==undef&&(last[1]=last[0],last[0]=code,save=save<<6|rank,state++,state===4&&(buffer[outptr++]=save>>>16,last[1]!==61&&(buffer[outptr++]=save>>>8),last[0]!==61&&(buffer[outptr++]=save),state=0));return buffer};Uint8Array&&(base64_ranks=new Uint8Array([62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,0,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51]));!HTMLCanvasElement||canvas_proto.toBlob&&canvas_proto.toBlobHD||(canvas_proto.toBlob||(canvas_proto.toBlob=function(callback,type){if(type||(type="image/png"),this.mozGetAsFile){callback(this.mozGetAsFile("canvas",type));return}if(this.msToBlob&&/^\s*image\/png\s*(?:$|;)/i.test(type)){callback(this.msToBlob());return}var args=Array.prototype.slice.call(arguments,1),dataURI=this[to_data_url].apply(this,args),header_end=dataURI.indexOf(","),data=dataURI.substring(header_end+1),is_base64=is_base64_regex.test(dataURI.substring(0,header_end)),blob;Blob.fake?(blob=new Blob,blob.encoding=is_base64?"base64":"URI",blob.data=data,blob.size=data.length):Uint8Array&&(blob=is_base64?new Blob([decode_base64(data)],{type:type}):new Blob([decodeURIComponent(data)],{type:type}));callback(blob)}),canvas_proto.toBlobHD=!canvas_proto.toBlobHD&&canvas_proto.toDataURLHD?function(){to_data_url="toDataURLHD";var blob=this.toBlob();return to_data_url="toDataURL",blob}:canvas_proto.toBlob)}(typeof self!="undefined"&&self||typeof window!="undefined"&&window||this.content||this),function(a,b){"function"==typeof define&&define.amd?define([],b):"undefined"!=typeof exports?b():(b(),a.FileSaver={exports:{}}.exports)}(this,function(){"use strict";function b(a,b){return"undefined"==typeof b?b={autoBom:!1}:"object"!=typeof b&&(console.warn("Deprecated: Expected third argument to be a object"),b={autoBom:!b}),b.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["﻿",a],{type:a.type}):a}function c(b,c,d){var e=new XMLHttpRequest;e.open("GET",b);e.responseType="blob";e.onload=function(){a(e.response,c,d)};e.onerror=function(){console.error("could not download file")};e.send()}function d(a){var b=new XMLHttpRequest;b.open("HEAD",a,!1);try{b.send()}catch(a){}return 200<=b.status&&299>=b.status}function e(a){try{a.dispatchEvent(new MouseEvent("click"))}catch(c){var b=document.createEvent("MouseEvents");b.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null);a.dispatchEvent(b)}}var f="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,a=f.saveAs||("object"!=typeof window||window!==f?function(){}:"download"in HTMLAnchorElement.prototype?function(b,g,h){var i=f.URL||f.webkitURL,j=document.createElement("a");g=g||b.name||"download";j.download=g;j.rel="noopener";"string"==typeof b?(j.href=b,j.origin===location.origin?e(j):d(j.href)?c(b,g,h):e(j,j.target="_blank")):(j.href=i.createObjectURL(b),setTimeout(function(){i.revokeObjectURL(j.href)},4e4),setTimeout(function(){e(j)},0))}:"msSaveOrOpenBlob"in navigator?function(f,g,h){if(g=g||f.name||"download","string"!=typeof f)navigator.msSaveOrOpenBlob(b(f,h),g);else if(d(f))c(f,g,h);else{var i=document.createElement("a");i.href=f;i.target="_blank";setTimeout(function(){e(i)})}}:function(a,b,d,e){if(e=e||open("","_blank"),e&&(e.document.title=e.document.body.innerText="downloading..."),"string"==typeof a)return c(a,b,d);var g="application/octet-stream"===a.type,h=/constructor/i.test(f.HTMLElement)||f.safari,i=/CriOS\/[\d]+/.test(navigator.userAgent);if((i||g&&h)&&"object"==typeof FileReader){var j=new FileReader;j.onloadend=function(){var a=j.result;a=i?a:a.replace(/^data:[^;]*;/,"data:attachment/file;");e?e.location.href=a:location=a;e=null};j.readAsDataURL(a)}else{var k=f.URL||f.webkitURL,l=k.createObjectURL(a);e?e.location=l:location.href=l;e=null;setTimeout(function(){k.revokeObjectURL(l)},4e4)}});f.saveAs=a.saveAs=a;"undefined"!=typeof module&&(module.exports=a)});
/*!
 * typeahead.js 0.11.1
 * https://github.com/twitter/typeahead.js
 * Copyright 2013-2015 Twitter, Inc. and other contributors; Licensed MIT
 */
!function(a,b){"function"==typeof define&&define.amd?define("bloodhound",["jquery"],function(c){return a.Bloodhound=b(c)}):"object"==typeof exports?module.exports=b(require("jquery")):a.Bloodhound=b(jQuery)}(this,function(a){var b=function(){"use strict";return{isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},isBlankString:function(a){return!a||/^\s*$/.test(a)},escapeRegExChars:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(a){return"string"==typeof a},isNumber:function(a){return"number"==typeof a},isArray:a.isArray,isFunction:a.isFunction,isObject:a.isPlainObject,isUndefined:function(a){return"undefined"==typeof a},isElement:function(a){return!(!a||1!==a.nodeType)},isJQuery:function(b){return b instanceof a},toStr:function(a){return b.isUndefined(a)||null===a?"":a+""},bind:a.proxy,each:function(b,c){function d(a,b){return c(b,a)}a.each(b,d)},map:a.map,filter:a.grep,every:function(b,c){var d=!0;return b?(a.each(b,function(a,e){if(!(d=c.call(null,e,a,b)))return!1}),!!d):d},some:function(b,c){var d=!1;return b?(a.each(b,function(a,e){if((d=c.call(null,e,a,b)))return!1}),!!d):d},mixin:a.extend,identity:function(a){return a},clone:function(b){return a.extend(!0,{},b)},getIdGenerator:function(){var a=0;return function(){return a++}},templatify:function(b){function c(){return String(b)}return a.isFunction(b)?b:c},defer:function(a){setTimeout(a,0)},debounce:function(a,b,c){var d,e;return function(){var f,g,h=this,i=arguments;return f=function(){d=null;c||(e=a.apply(h,i))},g=c&&!d,clearTimeout(d),d=setTimeout(f,b),g&&(e=a.apply(h,i)),e}},throttle:function(a,b){var c,d,e,f,g,h;return g=0,h=function(){g=new Date;e=null;f=a.apply(c,d)},function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,0>=j?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},stringify:function(a){return b.isString(a)?a:JSON.stringify(a)},noop:function(){}}}(),c="0.11.1",d=function(){"use strict";function a(a){return a=b.toStr(a),a?a.split(/\s+/):[]}function c(a){return a=b.toStr(a),a?a.split(/\W+/):[]}function d(a){return function(c){return c=b.isArray(c)?c:[].slice.call(arguments,0),function(d){var e=[];return b.each(c,function(c){e=e.concat(a(b.toStr(d[c])))}),e}}}return{nonword:c,whitespace:a,obj:{nonword:d(c),whitespace:d(a)}}}(),e=function(){"use strict";function c(c){this.maxSize=b.isNumber(c)?c:100;this.reset();this.maxSize<=0&&(this.set=this.get=a.noop)}function d(){this.head=this.tail=null}function e(a,b){this.key=a;this.val=b;this.prev=this.next=null}return b.mixin(c.prototype,{set:function(a,b){var c,d=this.list.tail;this.size>=this.maxSize&&(this.list.remove(d),delete this.hash[d.key],this.size--);(c=this.hash[a])?(c.val=b,this.list.moveToFront(c)):(c=new e(a,b),this.list.add(c),this.hash[a]=c,this.size++)},get:function(a){var b=this.hash[a];if(b)return(this.list.moveToFront(b),b.val)},reset:function(){this.size=0;this.hash={};this.list=new d}}),b.mixin(d.prototype,{add:function(a){this.head&&(a.next=this.head,this.head.prev=a);this.head=a;this.tail=this.tail||a},remove:function(a){a.prev?a.prev.next=a.next:this.head=a.next;a.next?a.next.prev=a.prev:this.tail=a.prev},moveToFront:function(a){this.remove(a);this.add(a)}}),c}(),f=function(){"use strict";function c(a,c){this.prefix=["__",a,"__"].join("");this.ttlKey="__ttl__";this.keyMatcher=new RegExp("^"+b.escapeRegExChars(this.prefix));this.ls=c||h;!this.ls&&this._noop()}function d(){return(new Date).getTime()}function e(a){return JSON.stringify(b.isUndefined(a)?null:a)}function f(b){return a.parseJSON(b)}function g(a){for(var c,d=[],e=h.length,b=0;e>b;b++)(c=h.key(b)).match(a)&&d.push(c.replace(a,""));return d}var h;try{h=window.localStorage;h.setItem("~~~","!");h.removeItem("~~~")}catch(i){h=null}return b.mixin(c.prototype,{_prefix:function(a){return this.prefix+a},_ttlKey:function(a){return this._prefix(a)+this.ttlKey},_noop:function(){this.get=this.set=this.remove=this.clear=this.isExpired=b.noop},_safeSet:function(a,b){try{this.ls.setItem(a,b)}catch(c){"QuotaExceededError"===c.name&&(this.clear(),this._noop())}},get:function(a){return this.isExpired(a)&&this.remove(a),f(this.ls.getItem(this._prefix(a)))},set:function(a,c,f){return b.isNumber(f)?this._safeSet(this._ttlKey(a),e(d()+f)):this.ls.removeItem(this._ttlKey(a)),this._safeSet(this._prefix(a),e(c))},remove:function(a){return this.ls.removeItem(this._ttlKey(a)),this.ls.removeItem(this._prefix(a)),this},clear:function(){for(var b=g(this.keyMatcher),a=b.length;a--;)this.remove(b[a]);return this},isExpired:function(a){var c=f(this.ls.getItem(this._ttlKey(a)));return b.isNumber(c)&&d()>c?!0:!1}}),c}(),g=function(){"use strict";function c(a){a=a||{};this.cancelled=!1;this.lastReq=null;this._send=a.transport;this._get=a.limiter?a.limiter(this._get):this._get;this._cache=a.cache===!1?new e(0):h}var d=0,f={},g=6,h=new e(10);return c.setMaxPendingRequests=function(a){g=a},c.resetCache=function(){h.reset()},b.mixin(c.prototype,{_fingerprint:function(b){return b=b||{},b.url+b.type+a.param(b.data||{})},_get:function(a,b){function c(a){b(null,a);k._cache.set(i,a)}function e(){b(!0)}function h(){d--;delete f[i];k.onDeckRequestArgs&&(k._get.apply(k,k.onDeckRequestArgs),k.onDeckRequestArgs=null)}var i,j,k=this;i=this._fingerprint(a);this.cancelled||i!==this.lastReq||((j=f[i])?j.done(c).fail(e):g>d?(d++,f[i]=this._send(a).done(c).fail(e).always(h)):this.onDeckRequestArgs=[].slice.call(arguments,0))},get:function(c,d){var e,f;d=d||a.noop;c=b.isString(c)?{url:c}:c||{};f=this._fingerprint(c);this.cancelled=!1;this.lastReq=f;(e=this._cache.get(f))?d(null,e):this._get(c,d)},cancel:function(){this.cancelled=!0}}),c}(),h=window.SearchIndex=function(){"use strict";function c(c){c=c||{};c.datumTokenizer&&c.queryTokenizer||a.error("datumTokenizer and queryTokenizer are both required");this.identify=c.identify||b.stringify;this.datumTokenizer=c.datumTokenizer;this.queryTokenizer=c.queryTokenizer;this.reset()}function d(a){return a=b.filter(a,function(a){return!!a}),a=b.map(a,function(a){return a.toLowerCase()})}function e(){var a={};return a[i]=[],a[h]={},a}function f(a){for(var b={},c=[],d=0,e=a.length;e>d;d++)b[a[d]]||(b[a[d]]=!0,c.push(a[d]));return c}function g(a,b){var c=0,d=0,e=[];a=a.sort();b=b.sort();for(var f=a.length,g=b.length;f>c&&g>d;)a[c]<b[d]?c++:a[c]>b[d]?d++:(e.push(a[c]),c++,d++);return e}var h="c",i="i";return b.mixin(c.prototype,{bootstrap:function(a){this.datums=a.datums;this.trie=a.trie},add:function(a){var c=this;a=b.isArray(a)?a:[a];b.each(a,function(a){var f,g;c.datums[f=c.identify(a)]=a;g=d(c.datumTokenizer(a));b.each(g,function(a){for(var g,b=c.trie,d=a.split("");g=d.shift();)b=b[h][g]||(b[h][g]=e()),b[i].push(f)})})},get:function(a){var c=this;return b.map(a,function(a){return c.datums[a]})},search:function(a){var c,e,j=this;return c=d(this.queryTokenizer(a)),b.each(c,function(a){var b,c,d,f;if(e&&0===e.length)return!1;for(b=j.trie,c=a.split("");b&&(d=c.shift());)b=b[h][d];return b&&0===c.length?(f=b[i].slice(0),void(e=e?g(e,f):f)):(e=[],!1)}),e?b.map(f(e),function(a){return j.datums[a]}):[]},all:function(){var a=[];for(var b in this.datums)a.push(this.datums[b]);return a},reset:function(){this.datums={};this.trie=e()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),c}(),i=function(){"use strict";function a(a){this.url=a.url;this.ttl=a.ttl;this.cache=a.cache;this.prepare=a.prepare;this.transform=a.transform;this.transport=a.transport;this.thumbprint=a.thumbprint;this.storage=new f(a.cacheKey)}var c;return c={data:"data",protocol:"protocol",thumbprint:"thumbprint"},b.mixin(a.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},store:function(a){this.cache&&(this.storage.set(c.data,a,this.ttl),this.storage.set(c.protocol,location.protocol,this.ttl),this.storage.set(c.thumbprint,this.thumbprint,this.ttl))},fromCache:function(){var a,b={};return this.cache?(b.data=this.storage.get(c.data),b.protocol=this.storage.get(c.protocol),b.thumbprint=this.storage.get(c.thumbprint),a=b.thumbprint!==this.thumbprint||b.protocol!==location.protocol,b.data&&!a?b.data:null):null},fromNetwork:function(a){function b(){a(!0)}function c(b){a(null,e.transform(b))}var d,e=this;a&&(d=this.prepare(this._settings()),this.transport(d).fail(b).done(c))},clear:function(){return this.storage.clear(),this}}),a}(),j=function(){"use strict";function a(a){this.url=a.url;this.prepare=a.prepare;this.transform=a.transform;this.transport=new g({cache:a.cache,limiter:a.limiter,transport:a.transport})}return b.mixin(a.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},get:function(a,b){function c(a,c){b(a?[]:e.transform(c))}var d,e=this;if(b)return a=a||"",d=this.prepare(a,this._settings()),this.transport.get(d,c)},cancelLastRequest:function(){this.transport.cancel()}}),a}(),k=function(){"use strict";function d(d){var e;return d?(e={url:null,ttl:864e5,cache:!0,cacheKey:null,thumbprint:"",prepare:b.identity,transform:b.identity,transport:null},d=b.isString(d)?{url:d}:d,d=b.mixin(e,d),!d.url&&a.error("prefetch requires url to be set"),d.transform=d.filter||d.transform,d.cacheKey=d.cacheKey||d.url,d.thumbprint=c+d.thumbprint,d.transport=d.transport?h(d.transport):a.ajax,d):null}function e(c){var d;if(c)return d={url:null,cache:!0,prepare:null,replace:null,wildcard:null,limiter:null,rateLimitBy:"debounce",rateLimitWait:300,transform:b.identity,transport:null},c=b.isString(c)?{url:c}:c,c=b.mixin(d,c),!c.url&&a.error("remote requires url to be set"),c.transform=c.filter||c.transform,c.prepare=f(c),c.limiter=g(c),c.transport=c.transport?h(c.transport):a.ajax,delete c.replace,delete c.wildcard,delete c.rateLimitBy,delete c.rateLimitWait,c}function f(a){function b(a,b){return b.url=f(b.url,a),b}function c(a,b){return b.url=b.url.replace(g,encodeURIComponent(a)),b}function d(a,b){return b}var e,f,g;return e=a.prepare,f=a.replace,g=a.wildcard,e?e:e=f?b:a.wildcard?c:d}function g(a){function c(a){return function(c){return b.debounce(c,a)}}function d(a){return function(c){return b.throttle(c,a)}}var e,f,g;return e=a.limiter,f=a.rateLimitBy,g=a.rateLimitWait,e||(e=/^throttle$/i.test(f)?d(g):c(g)),e}function h(c){return function(d){function e(a){b.defer(function(){g.resolve(a)})}function f(a){b.defer(function(){g.reject(a)})}var g=a.Deferred();return c(d,e,f),g}}return function(c){var f,g;return f={initialize:!0,identify:b.stringify,datumTokenizer:null,queryTokenizer:null,sufficient:5,sorter:null,local:[],prefetch:null,remote:null},c=b.mixin(f,c||{}),!c.datumTokenizer&&a.error("datumTokenizer is required"),!c.queryTokenizer&&a.error("queryTokenizer is required"),g=c.sorter,c.sorter=g?function(a){return a.sort(g)}:b.identity,c.local=b.isFunction(c.local)?c.local():c.local,c.prefetch=d(c.prefetch),c.remote=e(c.remote),c}}();return function(){"use strict";function c(a){a=k(a);this.sorter=a.sorter;this.identify=a.identify;this.sufficient=a.sufficient;this.local=a.local;this.remote=a.remote?new j(a.remote):null;this.prefetch=a.prefetch?new i(a.prefetch):null;this.index=new h({identify:this.identify,datumTokenizer:a.datumTokenizer,queryTokenizer:a.queryTokenizer});a.initialize!==!1&&this.initialize()}var e;return e=window&&window.Bloodhound,c.noConflict=function(){return window&&(window.Bloodhound=e),c},c.tokenizers=d,b.mixin(c.prototype,{__ttAdapter:function(){function a(a,b,d){return c.search(a,b,d)}function b(a,b){return c.search(a,b)}var c=this;return this.remote?a:b},_loadPrefetch:function(){function b(a,b){return a?c.reject():(e.add(b),e.prefetch.store(e.index.serialize()),void c.resolve())}var c,d,e=this;return c=a.Deferred(),this.prefetch?(d=this.prefetch.fromCache())?(this.index.bootstrap(d),c.resolve()):this.prefetch.fromNetwork(b):c.resolve(),c.promise()},_initialize:function(){function a(){b.add(b.local)}var b=this;return this.clear(),(this.initPromise=this._loadPrefetch()).done(a),this.initPromise},initialize:function(a){return!this.initPromise||a?this._initialize():this.initPromise},add:function(a){return this.index.add(a),this},get:function(a){return a=b.isArray(a)?a:[].slice.call(arguments),this.index.get(a)},search:function(a,c,d){function e(a){var c=[];b.each(a,function(a){b.some(f,function(b){return g.identify(a)===g.identify(b)})||c.push(a)});d&&d(c)}var f,g=this;return f=this.sorter(this.index.search(a)),c(this.remote?f.slice():f),this.remote&&f.length<this.sufficient?this.remote.get(a,e):this.remote&&this.remote.cancelLastRequest(),this},all:function(){return this.index.all()},clear:function(){return this.index.reset(),this},clearPrefetchCache:function(){return this.prefetch&&this.prefetch.clear(),this},clearRemoteCache:function(){return g.resetCache(),this},ttAdapter:function(){return this.__ttAdapter()}}),c}()}),function(a,b){"function"==typeof define&&define.amd?define("typeahead.js",["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){var b=function(){"use strict";return{isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},isBlankString:function(a){return!a||/^\s*$/.test(a)},escapeRegExChars:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(a){return"string"==typeof a},isNumber:function(a){return"number"==typeof a},isArray:a.isArray,isFunction:a.isFunction,isObject:a.isPlainObject,isUndefined:function(a){return"undefined"==typeof a},isElement:function(a){return!(!a||1!==a.nodeType)},isJQuery:function(b){return b instanceof a},toStr:function(a){return b.isUndefined(a)||null===a?"":a+""},bind:a.proxy,each:function(b,c){function d(a,b){return c(b,a)}a.each(b,d)},map:a.map,filter:a.grep,every:function(b,c){var d=!0;return b?(a.each(b,function(a,e){if(!(d=c.call(null,e,a,b)))return!1}),!!d):d},some:function(b,c){var d=!1;return b?(a.each(b,function(a,e){if((d=c.call(null,e,a,b)))return!1}),!!d):d},mixin:a.extend,identity:function(a){return a},clone:function(b){return a.extend(!0,{},b)},getIdGenerator:function(){var a=0;return function(){return a++}},templatify:function(b){function c(){return String(b)}return a.isFunction(b)?b:c},defer:function(a){setTimeout(a,0)},debounce:function(a,b,c){var d,e;return function(){var f,g,h=this,i=arguments;return f=function(){d=null;c||(e=a.apply(h,i))},g=c&&!d,clearTimeout(d),d=setTimeout(f,b),g&&(e=a.apply(h,i)),e}},throttle:function(a,b){var c,d,e,f,g,h;return g=0,h=function(){g=new Date;e=null;f=a.apply(c,d)},function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,0>=j?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},stringify:function(a){return b.isString(a)?a:JSON.stringify(a)},noop:function(){}}}(),c=function(){"use strict";function a(a){var g,h;return h=b.mixin({},f,a),g={css:e(),classes:h,html:c(h),selectors:d(h)},{css:g.css,html:g.html,classes:g.classes,selectors:g.selectors,mixin:function(a){b.mixin(a,g)}}}function c(a){return{wrapper:'<span class="'+a.wrapper+'"><\/span>',menu:'<div class="'+a.menu+'"><\/div>'}}function d(a){var c={};return b.each(a,function(a,b){c[b]="."+a}),c}function e(){var a={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},menu:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return b.isMsie()&&b.mixin(a.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),a}var f={wrapper:"twitter-typeahead",input:"tt-input",hint:"tt-hint",menu:"tt-menu",dataset:"tt-dataset",suggestion:"tt-suggestion",selectable:"tt-selectable",empty:"tt-empty",open:"tt-open",cursor:"tt-cursor",highlight:"tt-highlight"};return a}(),d=function(){"use strict";function c(b){b&&b.el||a.error("EventBus initialized without el");this.$el=a(b.el)}var d,e;return d="typeahead:",e={render:"rendered",cursorchange:"cursorchanged",select:"selected",autocomplete:"autocompleted"},b.mixin(c.prototype,{_trigger:function(b,c){var e;return e=a.Event(d+b),(c=c||[]).unshift(e),this.$el.trigger.apply(this.$el,c),e},before:function(a){var b,c;return b=[].slice.call(arguments,1),c=this._trigger("before"+a,b),c.isDefaultPrevented()},trigger:function(a){var b;this._trigger(a,[].slice.call(arguments,1));(b=e[a])&&this._trigger(b,[].slice.call(arguments,1))}}),c}(),e=function(){"use strict";function a(a,b,c,d){var e;if(!c)return this;for(b=b.split(i),c=d?h(c,d):c,this._callbacks=this._callbacks||{};e=b.shift();)this._callbacks[e]=this._callbacks[e]||{sync:[],"async":[]},this._callbacks[e][a].push(c);return this}function b(b,c,d){return a.call(this,"async",b,c,d)}function c(b,c,d){return a.call(this,"sync",b,c,d)}function d(a){var b;if(!this._callbacks)return this;for(a=a.split(i);b=a.shift();)delete this._callbacks[b];return this}function e(a){var b,c,d,e,g;if(!this._callbacks)return this;for(a=a.split(i),d=[].slice.call(arguments,1);(b=a.shift())&&(c=this._callbacks[b]);)e=f(c.sync,this,[b].concat(d)),g=f(c.async,this,[b].concat(d)),e()&&j(g);return this}function f(a,b,c){function d(){for(var d,e=0,f=a.length;!d&&f>e;e+=1)d=a[e].apply(b,c)===!1;return!d}return d}function g(){return window.setImmediate?function(a){setImmediate(function(){a()})}:function(a){setTimeout(function(){a()},0)}}function h(a,b){return a.bind?a.bind(b):function(){a.apply(b,[].slice.call(arguments,0))}}var i=/\s+/,j=g();return{onSync:c,onAsync:b,off:d,trigger:e}}(),f=function(a){"use strict";function c(a,c,d){for(var e,f=[],g=0,h=a.length;h>g;g++)f.push(b.escapeRegExChars(a[g]));return e=d?"\\b("+f.join("|")+")\\b":"("+f.join("|")+")",c?new RegExp(e):new RegExp(e,"i")}var d={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function(e){function f(b){var c,d,f;return(c=h.exec(b.data))&&(f=a.createElement(e.tagName),e.className&&(f.className=e.className),d=b.splitText(c.index),d.splitText(c[0].length),f.appendChild(d.cloneNode(!0)),b.parentNode.replaceChild(f,d)),!!c}function g(a,b){for(var c,e=0;e<a.childNodes.length;e++)c=a.childNodes[e],c.nodeType===3?e+=b(c)?1:0:g(c,b)}var h;e=b.mixin({},d,e);e.node&&e.pattern&&(e.pattern=b.isArray(e.pattern)?e.pattern:[e.pattern],h=c(e.pattern,e.caseSensitive,e.wordsOnly),g(e.node,f))}}(window.document),g=function(){"use strict";function c(c,e){c=c||{};c.input||a.error("input is missing");e.mixin(this);this.$hint=a(c.hint);this.$input=a(c.input);this.query=this.$input.val();this.queryWhenFocused=this.hasFocus()?this.query:null;this.$overflowHelper=d(this.$input);this._checkLanguageDirection();0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=b.noop)}function d(b){return a('<pre aria-hidden="true"><\/pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:b.css("font-family"),fontSize:b.css("font-size"),fontStyle:b.css("font-style"),fontVariant:b.css("font-variant"),fontWeight:b.css("font-weight"),wordSpacing:b.css("word-spacing"),letterSpacing:b.css("letter-spacing"),textIndent:b.css("text-indent"),textRendering:b.css("text-rendering"),textTransform:b.css("text-transform")}).insertAfter(b)}function f(a,b){return c.normalizeQuery(a)===c.normalizeQuery(b)}function g(a){return a.altKey||a.ctrlKey||a.metaKey||a.shiftKey}var h;return h={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},c.normalizeQuery=function(a){return b.toStr(a).replace(/^\s*/g,"").replace(/\s{2,}/g," ")},b.mixin(c.prototype,e,{_onBlur:function(){this.resetInputValue();this.trigger("blurred")},_onFocus:function(){this.queryWhenFocused=this.query;this.trigger("focused")},_onKeydown:function(a){var b=h[a.which||a.keyCode];this._managePreventDefault(b,a);b&&this._shouldTrigger(b,a)&&this.trigger(b+"Keyed",a)},_onInput:function(){this._setQuery(this.getInputValue());this.clearHintIfInvalid();this._checkLanguageDirection()},_managePreventDefault:function(a,b){var c;switch(a){case"up":case"down":c=!g(b);break;default:c=!1}c&&b.preventDefault()},_shouldTrigger:function(a,b){var c;switch(a){case"tab":c=!g(b);break;default:c=!0}return c},_checkLanguageDirection:function(){var a=(this.$input.css("direction")||"ltr").toLowerCase();this.dir!==a&&(this.dir=a,this.$hint.attr("dir",a),this.trigger("langDirChanged",a))},_setQuery:function(a,b){var c,d;c=f(a,this.query);d=c?this.query.length!==a.length:!1;this.query=a;b||c?!b&&d&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},bind:function(){var a,c,d,e,f=this;return a=b.bind(this._onBlur,this),c=b.bind(this._onFocus,this),d=b.bind(this._onKeydown,this),e=b.bind(this._onInput,this),this.$input.on("blur.tt",a).on("focus.tt",c).on("keydown.tt",d),!b.isMsie()||b.isMsie()>9?this.$input.on("input.tt",e):this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(a){h[a.which||a.keyCode]||b.defer(b.bind(f._onInput,f,a))}),this},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getLangDir:function(){return this.dir},getQuery:function(){return this.query||""},setQuery:function(a,b){this.setInputValue(a);this._setQuery(a,b)},hasQueryChangedSinceLastFocus:function(){return this.query!==this.queryWhenFocused},getInputValue:function(){return this.$input.val()},setInputValue:function(a){this.$input.val(a);this.clearHintIfInvalid();this._checkLanguageDirection()},resetInputValue:function(){this.setInputValue(this.query)},getHint:function(){return this.$hint.val()},setHint:function(a){this.$hint.val(a)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var a,b,c,d;a=this.getInputValue();b=this.getHint();c=a!==b&&0===b.indexOf(a);d=""!==a&&c&&!this.hasOverflow();!d&&this.clearHint()},hasFocus:function(){return this.$input.is(":focus")},hasOverflow:function(){var a=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=a},isCursorAtEnd:function(){var a,c,d;return a=this.$input.val().length,c=this.$input[0].selectionStart,b.isNumber(c)?c===a:document.selection?(d=document.selection.createRange(),d.moveStart("character",-a),a===d.text.length):!0},destroy:function(){this.$hint.off(".tt");this.$input.off(".tt");this.$overflowHelper.remove();this.$hint=this.$input=this.$overflowHelper=a("<div>")}}),c}(),h=function(){"use strict";function c(c,e){c=c||{};c.templates=c.templates||{};c.templates.notFound=c.templates.notFound||c.templates.empty;c.source||a.error("missing source");c.node||a.error("missing node");c.name&&!h(c.name)&&a.error("invalid dataset name: "+c.name);e.mixin(this);this.highlight=!!c.highlight;this.name=c.name||j();this.limit=c.limit||5;this.displayFn=d(c.display||c.displayKey);this.templates=g(c.templates,this.displayFn);this.source=c.source.__ttAdapter?c.source.__ttAdapter():c.source;this.async=b.isUndefined(c.async)?this.source.length>2:!!c.async;this._resetLastSuggestion();this.$el=a(c.node).addClass(this.classes.dataset).addClass(this.classes.dataset+"-"+this.name)}function d(a){function c(b){return b[a]}return a=a||b.stringify,b.isFunction(a)?a:c}function g(c,d){function e(b){return a("<div>").text(d(b))}return{notFound:c.notFound&&b.templatify(c.notFound),pending:c.pending&&b.templatify(c.pending),header:c.header&&b.templatify(c.header),footer:c.footer&&b.templatify(c.footer),suggestion:c.suggestion||e}}function h(a){return/^[_a-zA-Z0-9-]+$/.test(a)}var i,j;return i={val:"tt-selectable-display",obj:"tt-selectable-object"},j=b.getIdGenerator(),c.extractData=function(b){var c=a(b);return c.data(i.obj)?{val:c.data(i.val)||"",obj:c.data(i.obj)||null}:null},b.mixin(c.prototype,e,{_overwrite:function(a,b){b=b||[];b.length?this._renderSuggestions(a,b):this.async&&this.templates.pending?this._renderPending(a):!this.async&&this.templates.notFound?this._renderNotFound(a):this._empty();this.trigger("rendered",this.name,b,!1)},_append:function(a,b){b=b||[];b.length&&this.$lastSuggestion.length?this._appendSuggestions(a,b):b.length?this._renderSuggestions(a,b):!this.$lastSuggestion.length&&this.templates.notFound&&this._renderNotFound(a);this.trigger("rendered",this.name,b,!0)},_renderSuggestions:function(a,b){var c;c=this._getSuggestionsFragment(a,b);this.$lastSuggestion=c.children().last();this.$el.html(c).prepend(this._getHeader(a,b)).append(this._getFooter(a,b))},_appendSuggestions:function(a,b){var c,d;c=this._getSuggestionsFragment(a,b);d=c.children().last();this.$lastSuggestion.after(c);this.$lastSuggestion=d},_renderPending:function(a){var b=this.templates.pending;this._resetLastSuggestion();b&&this.$el.html(b({query:a,dataset:this.name}))},_renderNotFound:function(a){var b=this.templates.notFound;this._resetLastSuggestion();b&&this.$el.html(b({query:a,dataset:this.name}))},_empty:function(){this.$el.empty();this._resetLastSuggestion()},_getSuggestionsFragment:function(c,d){var e,g=this;return e=document.createDocumentFragment(),b.each(d,function(b){var d,f;f=g._injectQuery(c,b);d=a(g.templates.suggestion(f)).data(i.obj,b).data(i.val,g.displayFn(b)).addClass(g.classes.suggestion+" "+g.classes.selectable);e.appendChild(d[0])}),this.highlight&&f({className:this.classes.highlight,node:e,pattern:c}),a(e)},_getFooter:function(a,b){return this.templates.footer?this.templates.footer({query:a,suggestions:b,dataset:this.name}):null},_getHeader:function(a,b){return this.templates.header?this.templates.header({query:a,suggestions:b,dataset:this.name}):null},_resetLastSuggestion:function(){this.$lastSuggestion=a()},_injectQuery:function(a,c){return b.isObject(c)?b.mixin({_query:a},c):c},update:function(b){function c(a){g||(g=!0,a=(a||[]).slice(0,e.limit),h=a.length,e._overwrite(b,a),h<e.limit&&e.async&&e.trigger("asyncRequested",b))}function d(c){c=c||[];!f&&h<e.limit&&(e.cancel=a.noop,h+=c.length,e._append(b,c.slice(0,e.limit-h)),e.async&&e.trigger("asyncReceived",b))}var e=this,f=!1,g=!1,h=0;this.cancel();this.cancel=function(){f=!0;e.cancel=a.noop;e.async&&e.trigger("asyncCanceled",b)};this.source(b,c,d);!g&&c([])},cancel:a.noop,clear:function(){this._empty();this.cancel();this.trigger("cleared")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=a("<div>")}}),c}(),i=function(){"use strict";function c(c,d){function e(b){var c=f.$node.find(b.node).first();return b.node=c.length?c:a("<div>").appendTo(f.$node),new h(b,d)}var f=this;c=c||{};c.node||a.error("node is required");d.mixin(this);this.$node=a(c.node);this.query=null;this.datasets=b.map(c.datasets,e)}return b.mixin(c.prototype,e,{_onSelectableClick:function(b){this.trigger("selectableClicked",a(b.currentTarget))},_onRendered:function(a,b,c,d){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty());this.trigger("datasetRendered",b,c,d)},_onCleared:function(){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty());this.trigger("datasetCleared")},_propagate:function(){this.trigger.apply(this,arguments)},_allDatasetsEmpty:function(){function a(a){return a.isEmpty()}return b.every(this.datasets,a)},_getSelectables:function(){return this.$node.find(this.selectors.selectable)},_removeCursor:function(){var a=this.getActiveSelectable();a&&a.removeClass(this.classes.cursor)},_ensureVisible:function(a){var b,c,d,e;b=a.position().top;c=b+a.outerHeight(!0);d=this.$node.scrollTop();e=this.$node.height()+parseInt(this.$node.css("paddingTop"),10)+parseInt(this.$node.css("paddingBottom"),10);0>b?this.$node.scrollTop(d+b):c>e&&this.$node.scrollTop(d+(c-e))},bind:function(){var a,c=this;return a=b.bind(this._onSelectableClick,this),this.$node.on("click.tt",this.selectors.selectable,a),b.each(this.datasets,function(a){a.onSync("asyncRequested",c._propagate,c).onSync("asyncCanceled",c._propagate,c).onSync("asyncReceived",c._propagate,c).onSync("rendered",c._onRendered,c).onSync("cleared",c._onCleared,c)}),this},isOpen:function(){return this.$node.hasClass(this.classes.open)},open:function(){this.$node.addClass(this.classes.open)},close:function(){this.$node.removeClass(this.classes.open);this._removeCursor()},setLanguageDirection:function(a){this.$node.attr("dir",a)},selectableRelativeToCursor:function(a){var b,c,d,e;return c=this.getActiveSelectable(),b=this._getSelectables(),d=c?b.index(c):-1,e=d+a,e=(e+1)%(b.length+1)-1,e=-1>e?b.length-1:e,-1===e?null:b.eq(e)},setCursor:function(a){this._removeCursor();(a=a&&a.first())&&(a.addClass(this.classes.cursor),this._ensureVisible(a))},getSelectableData:function(a){return a&&a.length?h.extractData(a):null},getActiveSelectable:function(){var a=this._getSelectables().filter(this.selectors.cursor).first();return a.length?a:null},getTopSelectable:function(){var a=this._getSelectables().first();return a.length?a:null},update:function(a){function c(b){b.update(a)}var d=a!==this.query;return d&&(this.query=a,b.each(this.datasets,c)),d},empty:function(){function a(a){a.clear()}b.each(this.datasets,a);this.query=null;this.$node.addClass(this.classes.empty)},destroy:function(){function c(a){a.destroy()}this.$node.off(".tt");this.$node=a("<div>");b.each(this.datasets,c)}}),c}(),j=function(){"use strict";function a(){i.apply(this,[].slice.call(arguments,0))}var c=i.prototype;return b.mixin(a.prototype,i.prototype,{open:function(){return!this._allDatasetsEmpty()&&this._show(),c.open.apply(this,[].slice.call(arguments,0))},close:function(){return this._hide(),c.close.apply(this,[].slice.call(arguments,0))},_onRendered:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),c._onRendered.apply(this,[].slice.call(arguments,0))},_onCleared:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),c._onCleared.apply(this,[].slice.call(arguments,0))},setLanguageDirection:function(a){return this.$node.css("ltr"===a?this.css.ltr:this.css.rtl),c.setLanguageDirection.apply(this,[].slice.call(arguments,0))},_hide:function(){this.$node.hide()},_show:function(){this.$node.css("display","block")}}),a}(),k=function(){"use strict";function c(c,e){var f,g,h,i,j,k,l,m,n,o,p;c=c||{};c.input||a.error("missing input");c.menu||a.error("missing menu");c.eventBus||a.error("missing event bus");e.mixin(this);this.eventBus=c.eventBus;this.minLength=b.isNumber(c.minLength)?c.minLength:1;this.input=c.input;this.menu=c.menu;this.enabled=!0;this.active=!1;this.input.hasFocus()&&this.activate();this.dir=this.input.getLangDir();this._hacks();this.menu.bind().onSync("selectableClicked",this._onSelectableClicked,this).onSync("asyncRequested",this._onAsyncRequested,this).onSync("asyncCanceled",this._onAsyncCanceled,this).onSync("asyncReceived",this._onAsyncReceived,this).onSync("datasetRendered",this._onDatasetRendered,this).onSync("datasetCleared",this._onDatasetCleared,this);f=d(this,"activate","open","_onFocused");g=d(this,"deactivate","_onBlurred");h=d(this,"isActive","isOpen","_onEnterKeyed");i=d(this,"isActive","isOpen","_onTabKeyed");j=d(this,"isActive","_onEscKeyed");k=d(this,"isActive","open","_onUpKeyed");l=d(this,"isActive","open","_onDownKeyed");m=d(this,"isActive","isOpen","_onLeftKeyed");n=d(this,"isActive","isOpen","_onRightKeyed");o=d(this,"_openIfActive","_onQueryChanged");p=d(this,"_openIfActive","_onWhitespaceChanged");this.input.bind().onSync("focused",f,this).onSync("blurred",g,this).onSync("enterKeyed",h,this).onSync("tabKeyed",i,this).onSync("escKeyed",j,this).onSync("upKeyed",k,this).onSync("downKeyed",l,this).onSync("leftKeyed",m,this).onSync("rightKeyed",n,this).onSync("queryChanged",o,this).onSync("whitespaceChanged",p,this).onSync("langDirChanged",this._onLangDirChanged,this)}function d(a){var c=[].slice.call(arguments,1);return function(){var d=[].slice.call(arguments);b.each(c,function(b){return a[b].apply(a,d)})}}return b.mixin(c.prototype,{_hacks:function(){var c,d;c=this.input.$input||a("<div>");d=this.menu.$node||a("<div>");c.on("blur.tt",function(a){var e,f,g;e=document.activeElement;f=d.is(e);g=d.has(e).length>0;b.isMsie()&&(f||g)&&(a.preventDefault(),a.stopImmediatePropagation(),b.defer(function(){c.focus()}))});d.on("mousedown.tt",function(a){a.preventDefault()})},_onSelectableClicked:function(a,b){this.select(b)},_onDatasetCleared:function(){this._updateHint()},_onDatasetRendered:function(a,b,c,d){this._updateHint();this.eventBus.trigger("render",c,d,b)},_onAsyncRequested:function(a,b,c){this.eventBus.trigger("asyncrequest",c,b)},_onAsyncCanceled:function(a,b,c){this.eventBus.trigger("asynccancel",c,b)},_onAsyncReceived:function(a,b,c){this.eventBus.trigger("asyncreceive",c,b)},_onFocused:function(){this._minLengthMet()&&this.menu.update(this.input.getQuery())},_onBlurred:function(){this.input.hasQueryChangedSinceLastFocus()&&this.eventBus.trigger("change",this.input.getQuery())},_onEnterKeyed:function(a,b){var c;(c=this.menu.getActiveSelectable())&&this.select(c)&&b.preventDefault()},_onTabKeyed:function(a,b){var c;(c=this.menu.getActiveSelectable())?this.select(c)&&b.preventDefault():(c=this.menu.getTopSelectable())&&this.autocomplete(c)&&b.preventDefault()},_onEscKeyed:function(){this.close()},_onUpKeyed:function(){this.moveCursor(-1)},_onDownKeyed:function(){this.moveCursor(1)},_onLeftKeyed:function(){"rtl"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onRightKeyed:function(){"ltr"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onQueryChanged:function(a,b){this._minLengthMet(b)?this.menu.update(b):this.menu.empty()},_onWhitespaceChanged:function(){this._updateHint()},_onLangDirChanged:function(a,b){this.dir!==b&&(this.dir=b,this.menu.setLanguageDirection(b))},_openIfActive:function(){this.isActive()&&this.open()},_minLengthMet:function(a){return a=b.isString(a)?a:this.input.getQuery()||"",a.length>=this.minLength},_updateHint:function(){var a,c,d,e,f,h,i;a=this.menu.getTopSelectable();c=this.menu.getSelectableData(a);d=this.input.getInputValue();!c||b.isBlankString(d)||this.input.hasOverflow()?this.input.clearHint():(e=g.normalizeQuery(d),f=b.escapeRegExChars(e),h=new RegExp("^(?:"+f+")(.+$)","i"),i=h.exec(c.val),i&&this.input.setHint(d+i[1]))},isEnabled:function(){return this.enabled},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},isActive:function(){return this.active},activate:function(){return this.isActive()?!0:!this.isEnabled()||this.eventBus.before("active")?!1:(this.active=!0,this.eventBus.trigger("active"),!0)},deactivate:function(){return this.isActive()?this.eventBus.before("idle")?!1:(this.active=!1,this.close(),this.eventBus.trigger("idle"),!0):!0},isOpen:function(){return this.menu.isOpen()},open:function(){return this.isOpen()||this.eventBus.before("open")||(this.menu.open(),this._updateHint(),this.eventBus.trigger("open")),this.isOpen()},close:function(){var bBefore=!this.eventBus.before("close");return this.isOpen()&&bBefore&&(this.menu.close(),this.input.clearHint(),this.input.resetInputValue(),this.eventBus.trigger("close")),!this.isOpen()},setVal:function(a){this.input.setQuery(b.toStr(a))},getVal:function(){return this.input.getQuery()},select:function(a){var b=this.menu.getSelectableData(a);return b&&!this.eventBus.before("select",b.obj)?(this.input.setQuery(b.val,!0),this.eventBus.trigger("select",b.obj),this.close(),!0):!1},autocomplete:function(a){var b,c,d;return b=this.input.getQuery(),c=this.menu.getSelectableData(a),d=c&&b!==c.val,d&&!this.eventBus.before("autocomplete",c.obj)?(this.input.setQuery(c.val),this.eventBus.trigger("autocomplete",c.obj),!0):!1},moveCursor:function(a){var b,c,d,e,f;return b=this.input.getQuery(),c=this.menu.selectableRelativeToCursor(a),d=this.menu.getSelectableData(c),e=d?d.obj:null,f=this._minLengthMet()&&this.menu.update(b),f||this.eventBus.before("cursorchange",e)?!1:(this.menu.setCursor(c),d?this.input.setInputValue(d.val):(this.input.resetInputValue(),this._updateHint()),this.eventBus.trigger("cursorchange",e),!0)},destroy:function(){this.input.destroy();this.menu.destroy()}}),c}();!function(){"use strict";function e(b,c){b.each(function(){var b,d=a(this);(b=d.data(p.typeahead))&&c(b,d)})}function f(a,b){return a.clone().addClass(b.classes.hint).removeData().css(b.css.hint).css(l(a)).prop("readonly",!0).removeAttr("id name placeholder required").attr({autocomplete:"off",spellcheck:"false",tabindex:-1})}function h(a,b){a.data(p.attrs,{dir:a.attr("dir"),autocomplete:a.attr("autocomplete"),spellcheck:a.attr("spellcheck"),style:a.attr("style")});a.addClass(b.classes.input).attr({autocomplete:"off",spellcheck:!1});try{a.attr("dir")||a.attr("dir","auto")}catch(c){}return a}function l(a){return{backgroundAttachment:a.css("background-attachment"),backgroundClip:a.css("background-clip"),backgroundColor:a.css("background-color"),backgroundImage:a.css("background-image"),backgroundOrigin:a.css("background-origin"),backgroundPosition:a.css("background-position"),backgroundRepeat:a.css("background-repeat"),backgroundSize:a.css("background-size")}}function m(a){var c,d;c=a.data(p.www);d=a.parent().filter(c.selectors.wrapper);b.each(a.data(p.attrs),function(c,d){b.isUndefined(c)?a.removeAttr(d):a.attr(d,c)});a.removeData(p.typeahead).removeData(p.www).removeData(p.attr).removeClass(c.classes.input);d.length&&(a.detach().insertAfter(d),d.remove())}function n(c){var d,e;return d=b.isJQuery(c)||b.isElement(c),e=d?a(c).first():[],e.length?e:null}var o,p,q;o=a.fn.typeahead;p={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"};q={initialize:function(e,l){function m(){var c,m,q,r,s,t,u,v,w,x,y;b.each(l,function(a){a.highlight=!!e.highlight});c=a(this);m=a(o.html.wrapper);q=n(e.hint);r=n(e.menu);s=e.hint!==!1&&!q;t=e.menu!==!1&&!r;s&&(q=f(c,o));t&&(r=a(o.html.menu).css(o.css.menu));q&&q.val("");c=h(c,o);(s||t)&&(m.css(o.css.wrapper),c.css(s?o.css.input:o.css.inputWithNoHint),c.wrap(m).parent().prepend(s?q:null).append(t?r:null));y=t?j:i;u=new d({el:c});v=new g({hint:q,input:c},o);w=new y({node:r,datasets:l},o);x=new k({input:v,menu:w,eventBus:u,minLength:e.minLength},o);c.data(p.www,o);c.data(p.typeahead,x)}var o;return l=b.isArray(l)?l:[].slice.call(arguments,1),e=e||{},o=c(e.classNames),this.each(m)},isEnabled:function(){var a;return e(this.first(),function(b){a=b.isEnabled()}),a},enable:function(){return e(this,function(a){a.enable()}),this},disable:function(){return e(this,function(a){a.disable()}),this},isActive:function(){var a;return e(this.first(),function(b){a=b.isActive()}),a},activate:function(){return e(this,function(a){a.activate()}),this},deactivate:function(){return e(this,function(a){a.deactivate()}),this},isOpen:function(){var a;return e(this.first(),function(b){a=b.isOpen()}),a},open:function(){return e(this,function(a){a.open()}),this},close:function(){return e(this,function(a){a.close()}),this},select:function(b){var c=!1,d=a(b);return e(this.first(),function(a){c=a.select(d)}),c},autocomplete:function(b){var c=!1,d=a(b);return e(this.first(),function(a){c=a.autocomplete(d)}),c},moveCursor:function(a){var b=!1;return e(this.first(),function(c){b=c.moveCursor(a)}),b},val:function(a){var b;return arguments.length?(e(this,function(b){b.setVal(a)}),this):(e(this.first(),function(a){b=a.getVal()}),b)},destroy:function(){return e(this,function(a,b){m(b);a.destroy()}),this}};a.fn.typeahead=function(a){return q[a]?q[a].apply(this,[].slice.call(arguments,1)):q.initialize.apply(this,arguments)};a.fn.typeahead.noConflict=function(){return a.fn.typeahead=o,this}}()});
/*!
 * clipboard.js v2.0.4
 * https://zenorocha.github.io/clipboard.js
 * 
 * Licensed MIT © Zeno Rocha
 */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return function(n){var o={};function r(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}return r.m=n,r.c=o,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(e,t){if((1&t&&(e=r(e)),8&t)||4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function o(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}return function(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}}(),a=o(n(1)),c=o(n(3)),u=o(n(4));function o(t){return t&&t.__esModule?t:{"default":t}}var l=function(){function o(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}(this,o);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this));return n.resolveOptions(e),n.listenClick(t),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}});e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,c.default),i(o,[{key:"resolveOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction;this.target="function"==typeof t.target?t.target:this.defaultTarget;this.text="function"==typeof t.text?t.text:this.defaultText;this.container="object"===r(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=u.default(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null);this.clipboardAction=new a.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return s("action",t)}},{key:"defaultTarget",value:function(t){var e=s("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return s("text",t)}},{key:"destroy",value:function(){this.listener.destroy();this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach(function(t){n=n&&!!document.queryCommandSupported(t)}),n}}]),o}();function s(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}t.exports=l},function(t,e,n){"use strict";var o,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function o(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}return function(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}}(),a=n(2),c=(o=a)&&o.__esModule?o:{"default":o},u=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}(this,e);this.resolveOptions(t);this.initSelection()}return i(e,[{key:"resolveOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action;this.container=t.container;this.emitter=t.emitter;this.target=t.target;this.text=t.text;this.trigger=t.trigger;this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake();this.fakeHandlerCallback=function(){return t.removeFake()};this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0;this.fakeElem=document.createElement("textarea");this.fakeElem.style.fontSize="12pt";this.fakeElem.style.border="0";this.fakeElem.style.padding="0";this.fakeElem.style.margin="0";this.fakeElem.style.position="absolute";this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px";this.fakeElem.setAttribute("readonly","");this.fakeElem.value=this.text;this.container.appendChild(this.fakeElem);this.selectedText=c.default(this.fakeElem);this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null);this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=c.default(this.target);this.copyText()}},{key:"copyText",value:function(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus();window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"');},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":r(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),e}();t.exports=u},function(t){t.exports=function(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly","");t.select();t.setSelectionRange(0,t.value.length);n||t.removeAttribute("readonly");e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var o=window.getSelection(),r=document.createRange();r.selectNodeContents(t);o.removeAllRanges();o.addRange(r);e=o.toString()}return e}},function(t){function n(){}n.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var o=this;function r(){o.off(t,r);e.apply(n,arguments)}return r._=e,this.on(t,r,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;o<r;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],r=[];if(o&&e)for(var i=0,a=o.length;i<a;i++)o[i].fn!==e&&o[i].fn._!==e&&r.push(o[i]);return r.length?n[t]=r:delete n[t],this}};t.exports=n},function(t,e,n){var d=n(5),h=n(6);t.exports=function(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!d.string(e))throw new TypeError("Second argument must be a String");if(!d.fn(n))throw new TypeError("Third argument must be a Function");if(d.node(t))return s=e,f=n,(l=t).addEventListener(s,f),{destroy:function(){l.removeEventListener(s,f)}};if(d.nodeList(t))return a=t,c=e,u=n,Array.prototype.forEach.call(a,function(t){t.addEventListener(c,u)}),{destroy:function(){Array.prototype.forEach.call(a,function(t){t.removeEventListener(c,u)})}};if(d.string(t))return o=t,r=e,i=n,h(document.body,o,r,i);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var o,r,i,a,c,u,l,s,f}},function(t,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType};n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))};n.string=function(t){return"string"==typeof t||t instanceof String};n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},function(t,e,n){var a=n(7);function i(t,e,n,o,r){var i=function(e,n,t,o){return function(t){t.delegateTarget=a(t.target,n);t.delegateTarget&&o.call(e,t)}}.apply(this,arguments);return t.addEventListener(n,i,r),{destroy:function(){t.removeEventListener(n,i,r)}}}t.exports=function(t,e,n,o,r){return"function"==typeof t.addEventListener?i.apply(null,arguments):"function"==typeof n?i.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return i(t,e,n,o,r)}))}},function(t){if("undefined"!=typeof Element&&!Element.prototype.matches){var n=Element.prototype;n.matches=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}}])});var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"unknown version";this.OS=this.searchString(this.dataOS)||"unknown OS";this.CPU="x86";this.CPU=navigator.cpuClass!=null&&navigator.cpuClass.toLowerCase()=="x64"?"x64":navigator.cpuClass!=null&&navigator.cpuClass.toLowerCase()=="x86"?"x86":navigator.platform!=null&&navigator.platform.toLowerCase()=="win64"?"x64":navigator.platform!=null&&navigator.platform.toLowerCase()=="win32"?"x86":"unknown CPU";try{var a=new ActiveXObject("");this.SupportsActiveX=!0}catch(e){this.SupportsActiveX=e.name==="TypeError"||e.name==="Error"?!0:!1}this.SupportsActiveX&&this.browser==="Mozilla"&&navigator.product==="Gecko"&&(this.browser="IE")},searchString:function(data){for(var i=0;i<data.length;i++){var dataString=data[i].string,dataProp=data[i].prop;if(this.versionSearchString=data[i].versionSearch||data[i].identity,dataString){if(dataString.indexOf(data[i].subString)!==-1)return data[i].identity}else if(dataProp)return data[i].identity}return null},searchVersion:function(dataString){var index=dataString.indexOf(this.versionSearchString);return index===-1?null:parseFloat(dataString.substring(index+this.versionSearchString.length+1))},dataBrowser:[{string:navigator.userAgent,subString:"Edge",identity:"Edge"},{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari",versionSearch:"Version"},{prop:window.opera,identity:"Opera",versionSearch:"Version"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"IE",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.userAgent,subString:"iPhone",identity:"iPhone/iPod"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};BrowserDetect.init();"bind"in Function.prototype||(Function.prototype.bind=function(owner){var that=this;if(arguments.length<=1)return function(){return that.apply(owner,arguments)};var args=Array.prototype.slice.call(arguments,1);return function(){return that.apply(owner,arguments.length===0?args:args.concat(Array.prototype.slice.call(arguments)))}});"trim"in String.prototype||(String.prototype.trim=function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")});String.prototype.startsWith||(String.prototype.startsWith=function(searchString,position){return position=position||0,this.indexOf(searchString,position)===position});"indexOf"in Array.prototype||(Array.prototype.indexOf=function(find,i){i===undefined&&(i=0);i<0&&(i+=this.length);i<0&&(i=0);for(var n=this.length;i<n;i++)if(i in this&&this[i]===find)return i;return-1});"lastIndexOf"in Array.prototype||(Array.prototype.lastIndexOf=function(find,i){for(i===undefined&&(i=this.length-1),i<0&&(i+=this.length),i>this.length-1&&(i=this.length-1),i++;i-->0;)if(i in this&&this[i]===find)return i;return-1});"forEach"in Array.prototype||(Array.prototype.forEach=function(action,that){for(var i=0,n=this.length;i<n;i++)i in this&&action.call(that,this[i],i,this)});"map"in Array.prototype||(Array.prototype.map=function(mapper,that){for(var other=new Array(this.length),i=0,n=this.length;i<n;i++)i in this&&(other[i]=mapper.call(that,this[i],i,this));return other});"filter"in Array.prototype||(Array.prototype.filter=function(filter,that){for(var other=[],v,i=0,n=this.length;i<n;i++)i in this&&filter.call(that,v=this[i],i,this)&&other.push(v);return other});"every"in Array.prototype||(Array.prototype.every=function(tester,that){for(var i=0,n=this.length;i<n;i++)if(i in this&&!tester.call(that,this[i],i,this))return!1;return!0});"some"in Array.prototype||(Array.prototype.some=function(tester,that){for(var i=0,n=this.length;i<n;i++)if(i in this&&tester.call(that,this[i],i,this))return!0;return!1});Array.prototype.includes||(Array.prototype.includes=function(valueToFind,fromIndex){"use strict";if(this===null)throw new TypeError('"this" is null or not defined');var o=Object(this),len=o.length>>>0;if(len===0)return!1;var n=fromIndex|0,k=Math.max(n>=0?n:len-Math.abs(n),0);function sameValueZero(x,y){return x===y||typeof x=="number"&&typeof y=="number"&&isNaN(x)&&isNaN(y)}while(k<len){if(sameValueZero(o[k],valueToFind))return!0;k++}return!1});Array.prototype.find||(Array.prototype.find=function(predicate){if(this===null)throw new TypeError('"this" is null or not defined');var o=Object(this),len=o.length>>>0;if(typeof predicate!="function")throw new TypeError("predicate must be a function");for(var thisArg=arguments[1],k=0;k<len;){var kValue=o[k];if(predicate.call(thisArg,kValue,k,o))return kValue;k++}return undefined});String.prototype.format||(String.prototype.format=function(){var a=this,args=arguments;return a.replace(/{(\d+)}/g,function(match,number){return typeof args[number]!="undefined"?args[number]:match})});function applyMethod(fnMethod,arrParams){if(fnMethod){var fn=window[fnMethod];typeof fn=="function"&&fn.apply(null,arrParams)}}function parseLonLat(strString){var dLat,dLon,arrParts,arrCoords,strTest=strString.replace(/\s\s+/g," "),rxCoords=new RegExp(/^([-+]?)([\d]{1,2})(((\.)(\d+)(,)))(\s*)(([-+]?)([\d]{1,3})((\.)(\d+))?)$/g);return(rxCoords.test(strTest)?(arrParts=strTest.split(","),arrCoords=[parseFloat(arrParts[0].trim()),parseFloat(arrParts[1].trim())]):(rxCoords=new RegExp(/^([-+]?)([\d]{1,2})(((\.)(\d+)(\s)))(\s*)(([-+]?)([\d]{1,3})((\.)(\d+))?)$/g),rxCoords.test(strTest)?(arrParts=strTest.split(" "),arrCoords=[parseFloat(arrParts[0].trim()),parseFloat(arrParts[1].trim())]):(rxCoords=new RegExp(/^([-+]?)([\d]{1,2})(((,)(\d+)(\s)))(\s*)(([-+]?)([\d]{1,3})((,)(\d+))?)$/g),rxCoords.test(strTest)&&(strTest=strTest.replace(/,/g,"."),arrParts=strTest.split(" "),arrCoords=[parseFloat(arrParts[0].trim()),parseFloat(arrParts[1].trim())]))),arrCoords&&(arrCoords[0]>50.3226989435&&arrCoords[0]<52.5310351488&&arrCoords[1]>5.8659988131&&arrCoords[1]<9.4476584861?(dLat=arrCoords[0],dLon=arrCoords[1]):arrCoords[1]>50.3226989435&&arrCoords[1]<52.5310351488&&arrCoords[0]>5.8659988131&&arrCoords[0]<9.4476584861&&(dLat=arrCoords[1],dLon=arrCoords[0])),typeof dLat!="undefined"&&typeof dLon!="undefined")?[dLon,dLat]:undefined}Math.radians||(Math.radians=function(degrees){return degrees*Math.PI/180});Math.degrees||(Math.degrees=function(radians){return radians*180/Math.PI});function getCurrentLocation(){var url;return window!==parent?(url=document.createElement("a"),url.href=document.referrer):url=window.location,url}function getUrlParameter(sParam){for(var sPageURL=decodeURIComponent(getCurrentLocation().search.substring(1)),sURLVariables=sPageURL.split("&"),sParameterName,i=0;i<sURLVariables.length;i++)if(sParameterName=sURLVariables[i].split("="),sParameterName[0]===sParam)return sParameterName[1]===undefined?!0:sParameterName[1];return null}$.fn.exists=function(){return this.length!==0};function postLogMessage(strMessage,strStack,strLevel){var objMessage={message:strMessage,stack:strStack,level:strLevel};try{$.ajax({type:"POST",url:"../Services/LoggingService.ashx",data:JSON.stringify(objMessage),contentType:"application/json; charset=utf-8",dataType:"json",success:function(){},error:function(jqXhr,strStatus,strErrorThrown){console.error(strStatus+" in postLogMessage: "+strErrorThrown+" "+jqXhr)},timeout:3e4})}catch(err){console.error(err)}}function getJson(strUrl,funcSuccess,funcError,funcComplete){$.ajax({url:strUrl,type:"GET",crossDomain:!0,dataType:"jsonp",success:funcSuccess,error:funcError,complete:funcComplete})}var getAbsoluteUrl=function(url){var a=document.createElement("a");return getAbsoluteUrl=function(url){return a.href=url,a.href},getAbsoluteUrl(url)};(function($){var Longclick=function(el,options){var that=this;this.el=el;this.timer=null;this.held=!1;this.fired=!1;this.options=options;this.originalText=el.innerText?el.innerText:el.value;window.PointerEvent&&el.addEventListener("pointerdown",function(e){that.el.arrCancelledEvents.push(e)});$(el).on("mousedown",function(evt){var $this=$(this);return that.reset(options.holdText),that.timer=window.setTimeout(function(){options.heldText?that.reset(options.heldText):that.reset();that.held=!0;$this.trigger("longclick",[evt.pageX,evt.pageY,evt.screenX,evt.screenY,evt.offsetX,evt.offsetY,evt.clientX,evt.clientY])},options.duration),!1}).on("mouseup mouseleave",function(evtUp){return that.held&&options.sticky||that.reset(),clearTimeout(that.timer),that.held&&(evtUp.stopPropagation(),evtUp.preventDefault(),that.fired=!0),that.held=!1,!1}).on("click",function(evtClick){that.fired&&(evtClick.stopPropagation(),evtClick.preventDefault(),that.fired=!1)})};Longclick.prototype={constructor:Longclick,reset:function(){return}};Longclick.DEFAULTS={duration:1e3,holdText:"Hold...",heldText:null,sticky:!0};function Plugin(option){return this.each(function(){var $this=$(this),data=$this.data("longclick"),options=$.extend({},Longclick.DEFAULTS,typeof option=="object"&&option);data||$this.data("longclick",data=new Longclick(this,options));typeof option=="string"&&data[option].call(data)})}$.fn.longclick=Plugin})(jQuery),function(a){(jQuery.browser=jQuery.browser||{}).mobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))}(navigator.userAgent||navigator.vendor||window.opera);
/*! Copyright (c) 2011 Piotr Rochala (http://rocha.la), Lanre Adebambo
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Version: 1.3.7
 *
 */
(function($){"use strict";$.fn.extend({slimScroll:function(options){var o=$.extend({axis:"y",width:"auto",height:"250px",size:"7px",color:"#000",positionX:"bottom",positionY:"right",distance:"1px",startX:"left",startY:"top",opacity:.4,alwaysVisible:!1,disableFadeOut:!1,railVisible:!1,railColor:"#333",railOpacity:.2,railDraggable:!0,railClassX:"slimScrollRailX",barClassX:"slimScrollBarX",railClassY:"slimScrollRailY",barClassY:"slimScrollBarY",wrapperClass:"slimScrollDiv",allowPageScroll:!1,applyVerticalWheelToHorizontal:!1,wheelStep:20,touchScrollStep:200,borderRadius:"7px",railBorderRadius:"7px"},options);return o.axis=o.axis.toLowerCase(),this.each(function(){var hasHorizontalScrollbar,hasVerticalScrollbar,t,pageX,pageY,isOverPanel,isOverBarX,isOverBarY,isDragg,queueHideX,queueHideY,touchDifX,touchDifY,barHeight,barWidth,percentScrollX,lastScrollX,percentScrollY,lastScrollY,divS="<div><\/div>",minBarHeight=30,minBarWidth=30,releaseScroll=!1,me=$(this),$doc=$(document);function attachWheel(target){if(window.addEventListener){try{target.addEventListener("wheel",_onWheel,!1)}catch(e){}typeof onmousewheel!="undefined"&&target.addEventListener("mousewheel",_onWheel,!1);target.addEventListener("DOMMouseScroll",_onWheel,!1)}else document.attachEvent("onmousewheel",_onWheel)}function needShowBarX(){return barX?(barWidth=Math.max(me.outerWidth()/me[0].scrollWidth*me.outerWidth(),minBarWidth),hasHorizontalScrollbar&&me[0].scrollWidth>me[0].clientWidth):!1}function getBarXWidth(initial){if(typeof initial!="undefined"&&barX&&(barWidth=Math.max(me.outerWidth()/me[0].scrollWidth*me.outerWidth(),minBarWidth),barX.css({width:barWidth+"px"}),initial!==!0)){var display=hasHorizontalScrollbar&&me[0].scrollWidth>me[0].clientWidth?"block":"none";barX.css({display:display})}}function needShowBarY(){if(!barY)return!1;barHeight=Math.max(me.outerHeight()/me[0].scrollHeight*me.outerHeight(),minBarHeight);return hasVerticalScrollbar&&me[0].scrollHeight>me[0].clientHeight}function getBarYHeight(){if(barY){barHeight=Math.max(me.outerHeight()/me[0].scrollHeight*me.outerHeight(),minBarHeight);barY.css({height:barHeight+"px"});var display=hasVerticalScrollbar&&me[0].scrollHeight>me[0].clientHeight?"block":"none";barY.css({display:display})}}function showBarX(){if(barX){if(getBarXWidth(),clearTimeout(queueHideX),percentScrollX===~~percentScrollX){if(releaseScroll=o.allowPageScroll,lastScrollX!==percentScrollX){var msg=~~percentScrollX==0?"left":"right";me.trigger("slimscrollX",msg)}}else releaseScroll=!1;if(lastScrollX=percentScrollX,Math.floor(barWidth)>=Math.floor(me.outerWidth())){releaseScroll=!0;return}barX.stop(!0,!0).fadeIn("fast");o.railVisible&&railX.stop(!0,!0).fadeIn("fast")}}function hideBarX(){barX&&(o.alwaysVisible||(queueHideX=setTimeout(function(){o.disableFadeOut&&isOverPanel||isOverBarX||isDragg||(barX.fadeOut("slow"),railX.fadeOut("slow"))},1e3)))}function showBarY(){if(barY){if(getBarYHeight(),clearTimeout(queueHideY),percentScrollY===~~percentScrollY){if(releaseScroll=o.allowPageScroll,lastScrollY!==percentScrollY){var msg=~~percentScrollY==0?"top":"bottom";me.trigger("slimscrollY",msg)}}else releaseScroll=!1;if(lastScrollY=percentScrollY,Math.floor(barHeight)>=Math.floor(me.outerHeight())){releaseScroll=!0;return}barY.stop(!0,!0).fadeIn("fast");o.railVisible&&railY.stop(!0,!0).fadeIn("fast")}}function hideBarY(){barY&&(o.alwaysVisible||(queueHideY=setTimeout(function(){o.disableFadeOut&&isOverPanel||isOverBarY||isDragg||(barY.fadeOut("slow"),railY.fadeOut("slow"))},1e3)))}function _getDeltaFromEvent(e){var deltaX=0,deltaY=0;return"detail"in e&&(deltaY=e.detail),"wheelDelta"in e&&(deltaY=e.wheelDelta/-6),"wheelDeltaY"in e&&(deltaY=e.wheelDeltaY/-6),"wheelDeltaX"in e&&(deltaX=e.wheelDeltaX/6),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(deltaX=deltaY*-1,deltaY=0),deltaX!==deltaX&&deltaY!==deltaY&&(deltaX=0,deltaY=e.wheelDelta),"deltaY"in e&&(deltaY=e.deltaY),"deltaX"in e&&(deltaX=e.deltaX),[deltaX,deltaY]}function _onWheel(e){if(isOverPanel){e=e||window.event;var delta=_getDeltaFromEvent(e),deltaX=delta[0],deltaY=delta[1],target=e.target||e.srcTarget||e.srcElement;$(target).closest("."+o.wrapperClass).is(me.parent())&&scrollContent(deltaX,deltaY,!0);e.preventDefault&&!releaseScroll&&(e.preventDefault(),e.stopPropagation());releaseScroll||(e.returnValue=!1)}}function scrollContent(x,y,isWheel,isJump){releaseScroll=!1;var dWheelFactor=navigator.userAgent.toLowerCase().indexOf("firefox")>-1?10:1;if(hasHorizontalScrollbar){var deltaX=x;!o.applyVerticalWheelToHorizontal||o.axis!=="x"||deltaX||!y||(deltaX=y);var moveFactor=deltaX,maxLeft=me.outerWidth()-barX.outerWidth();if(isWheel&&(deltaX=parseInt(barX.css("left"))+moveFactor*parseInt(o.wheelStep*dWheelFactor)/100,deltaX=Math.min(Math.max(deltaX,0),maxLeft),deltaX=moveFactor>0?Math.ceil(deltaX):Math.floor(deltaX),barX.css({left:deltaX+"px"})),percentScrollX=parseInt(barX.css("left"))/(me.outerWidth()-barX.outerWidth()),deltaX=percentScrollX*(me[0].scrollWidth-me.outerWidth()),isJump){deltaX=x;var offsetLeft=deltaX/me[0].scrollWidth*me.outerWidth();offsetLeft=Math.min(Math.max(offsetLeft,0),maxLeft);barX.css({left:offsetLeft+"px"})}me.scrollLeft(deltaX);me.trigger("slimscrollingX",~~deltaX);showBarX();hideBarX()}if(hasVerticalScrollbar){var deltaY=y,maxTop=me.outerHeight()-barY.outerHeight();if(isWheel&&(deltaY=parseInt(barY.css("top"))+y*parseInt(o.wheelStep*dWheelFactor)/100,deltaY=Math.min(Math.max(deltaY,0),maxTop),deltaY=y>0?Math.ceil(deltaY):Math.floor(deltaY),barY.css({top:deltaY+"px"})),percentScrollY=parseInt(barY.css("top"))/(me.outerHeight()-barY.outerHeight()),deltaY=percentScrollY*(me[0].scrollHeight-me.outerHeight()),isJump){deltaY=y;var offsetTop=deltaY/me[0].scrollHeight*me.outerHeight();offsetTop=Math.min(Math.max(offsetTop,0),maxTop);barY.css({top:offsetTop+"px"})}me.scrollTop(deltaY);me.trigger("slimscrollingY",~~deltaY);showBarY();hideBarY()}}if(me.parent().hasClass(o.wrapperClass)){o.overwriteExisting!==!0&&$.extend(o,me.data("slimScrollConfig")||{});var offset_horizontal=me.scrollLeft(),offset_vertical=me.scrollTop();if(barX=me.siblings("."+o.barClassX),railX=me.siblings("."+o.railClassX),barY=me.siblings("."+o.barClassY),railY=me.siblings("."+o.railClassY),hasHorizontalScrollbar=o.axis==="both"||o.axis==="x",hasVerticalScrollbar=o.axis==="both"||o.axis==="y",getBarXWidth(!0),getBarYHeight(),$.isPlainObject(options)&&("width"in options&&hasHorizontalScrollbar&&(options.width==="auto"?(me.parent().css("width","auto"),me.css("width","auto"),o.width=me.parent().parent().width()):(o.width=options.width,me.css({"white-space":"nowrap"}))),"height"in options&&hasVerticalScrollbar&&(options.height==="auto"?(me.parent().css("height","auto"),me.css("height","auto"),o.height=me.parent().parent().height()):o.height=options.height),me.parent().css({position:"relative",overflow:"hidden",width:o.width,height:o.height}),me.css({overflow:"hidden",width:o.width,height:o.height}),"scrollToX"in options?offset_horizontal=parseInt(o.scrollToX):"scrollByX"in options&&(offset_horizontal+=parseInt(o.scrollByX)),"scrollToY"in options?offset_vertical=parseInt(o.scrollToY):"scrollByY"in options&&(offset_vertical+=parseInt(o.scrollByY)),"destroy"in options)){barX.remove();railX.remove();barY.remove();railY.remove();me.unwrap();return}scrollContent(offset_horizontal,offset_vertical,!1,!0);return}if(!$.isPlainObject(options)||!("destroy"in options)){hasHorizontalScrollbar=o.axis==="both"||o.axis==="x";hasVerticalScrollbar=o.axis==="both"||o.axis==="y";o.height=o.height==="auto"?me.parent().height():o.height;o.width=o.width==="auto"?me.parent().width():o.width;me.data("slimScrollConfig",o);var wrapper=$(divS).addClass(o.wrapperClass).css({position:"relative",overflow:"hidden",width:o.width,height:o.height});if(me.css({overflow:"hidden",width:o.width,height:o.height}),me.wrap(wrapper),hasHorizontalScrollbar){o.width!=="auto"&&hasHorizontalScrollbar&&me.css({"white-space":"nowrap"});var railX=$(divS).addClass(o.railClassX).css({width:"100%",height:o.size,position:"absolute",left:0,display:o.alwaysVisible&&o.railVisible?"block":"none","border-radius":o.railBorderRadius,background:o.railColor,opacity:o.railOpacity,zIndex:90}),barX=$(divS).addClass(o.barClassX).css({background:o.color,height:o.size,position:"absolute",left:0,opacity:o.opacity,display:o.alwaysVisible?"block":"none","border-radius":o.borderRadius,BorderRadius:o.borderRadius,MozBorderRadius:o.borderRadius,WebkitBorderRadius:o.borderRadius,zIndex:99}),xPosCss=o.positionX==="top"?{top:o.distance}:{bottom:o.distance};if(railX.css(xPosCss),barX.css(xPosCss),me.parent().append(barX),me.parent().append(railX),o.railDraggable){barX.on("mousedown",function(e){isDragg=!0;t=parseFloat(barX.css("left"));pageX=e.pageX;$doc.on("mousemove.slimscrollX",function(e){var currLeft=t+e.pageX-pageX;barX.css("left",currLeft);scrollContent(0,0,barX.position().left)});$doc.on("mouseup.slimscrollX",function(){isDragg=!1;hideBarX();$doc.unbind(".slimscrollX")});return!1}).on("selectstart.slimscrollX",function(e){return e.stopPropagation(),e.preventDefault(),!1});railX.on("mousedown",function(e){var deltaX=(e.offsetX-barWidth/2)*me[0].scrollWidth/me.outerWidth();scrollContent(deltaX,0,!1,!0);t=parseFloat(barX.css("left"));pageX=e.pageX;$doc.on("mousemove.slimscrollX",function(e){var currLeft=t+e.pageX-pageX;barX.css("left",currLeft);scrollContent(0,0,barX.position().left)});$doc.on("mouseup.slimscrollX",function(){isDragg=!1;hideBarX();$doc.unbind(".slimscrollX")});return!1})}railX.hover(function(){needShowBarX()&&showBarX()},function(){hideBarX()});barX.hover(function(){isOverBarX=!0},function(){isOverBarX=!1});getBarXWidth(!0);o.startX==="right"?(barX.css({left:me.outerWidth()-barX.outerWidth()}),scrollContent(0,0,!0)):o.startX!=="left"&&(scrollContent($(o.startX).position().left,null,null,!0),o.alwaysVisible||barX.hide())}if(hasVerticalScrollbar){var railY=$(divS).addClass(o.railClassY).css({width:o.size,height:"100%",position:"absolute",top:0,display:o.alwaysVisible&&o.railVisible?"block":"none","border-radius":o.railBorderRadius,background:o.railColor,opacity:o.railOpacity,zIndex:90}),barY=$(divS).addClass(o.barClassY).css({background:o.color,width:o.size,position:"absolute",top:0,opacity:o.opacity,display:o.alwaysVisible?"block":"none","border-radius":o.borderRadius,BorderRadius:o.borderRadius,MozBorderRadius:o.borderRadius,WebkitBorderRadius:o.borderRadius,zIndex:99}),yPosCss=o.positionY==="right"?{right:o.distance}:{left:o.distance};if(railY.css(yPosCss),barY.css(yPosCss),me.parent().append(barY),me.parent().append(railY),o.railDraggable){barY.on("mousedown",function(e){isDragg=!0;t=parseFloat(barY.css("top"));pageY=e.pageY;$doc.on("mousemove.slimscrollY",function(e){var currTop=t+e.pageY-pageY;barY.css("top",currTop);scrollContent(0,0,barY.position().top)});$doc.on("mouseup.slimscrollY",function(){isDragg=!1;hideBarY();$doc.unbind(".slimscrollY")});return!1}).on("selectstart.slimscrollY",function(e){return e.stopPropagation(),e.preventDefault(),!1});railY.on("mousedown",function(e){var deltaY=(e.offsetY-barHeight/2)*me[0].scrollHeight/me.outerHeight();scrollContent(0,deltaY,!1,!0);t=parseFloat(barY.css("top"));pageY=e.pageY;$doc.on("mousemove.slimscrollY",function(e){var currTop=t+e.pageY-pageY;barY.css("top",currTop);scrollContent(0,0,barY.position().top)});$doc.on("mouseup.slimscrollY",function(){isDragg=!1;hideBarY();$doc.unbind(".slimscrollY")});return!1})}railY.hover(function(){needShowBarY()&&showBarY()},function(){hideBarY()});barY.hover(function(){isOverBarY=!0},function(){isOverBarY=!1});getBarYHeight();o.startY==="bottom"?(barY.css({top:me.outerHeight()-barY.outerHeight()}),scrollContent(0,0,!0)):o.startY!=="top"&&(scrollContent(null,$(o.startY).position().top,null,!0),o.alwaysVisible||barY.hide())}me.hover(function(){isOverPanel=!0;needShowBarX()&&(showBarX(),hideBarX());needShowBarY()&&(showBarY(),hideBarY())},function(){isOverPanel=!1;hideBarX();hideBarY()});me.on("touchstart",function(e){e.originalEvent.touches.length&&(touchDifX=e.originalEvent.touches[0].pageX,touchDifY=e.originalEvent.touches[0].pageY)});me.on("touchmove",function(e){if(releaseScroll||e.originalEvent.preventDefault(),e.originalEvent.touches.length){var diffX=(touchDifX-e.originalEvent.touches[0].pageX)/o.touchScrollStep,diffY=(touchDifY-e.originalEvent.touches[0].pageY)/o.touchScrollStep;scrollContent(diffX,diffY,!0);touchDifX=e.originalEvent.touches[0].pageX;touchDifY=e.originalEvent.touches[0].pageY}});attachWheel(this)}}),this.trigger("initialized"),this}});$.fn.extend({slimscroll:$.fn.slimScroll})})(jQuery);!function(e){e(["jquery"],function(e){return function(){function t(e,t,n){return g({type:O.error,iconClass:m().iconClasses.error,message:e,optionsOverride:n,title:t})}function n(t,n){return t||(t=m()),v=e("#"+t.containerId),v.length?v:(n&&(v=d(t)),v)}function o(e,t,n){return g({type:O.info,iconClass:m().iconClasses.info,message:e,optionsOverride:n,title:t})}function s(e){C=e}function i(e,t,n){return g({type:O.success,iconClass:m().iconClasses.success,message:e,optionsOverride:n,title:t})}function a(e,t,n){return g({type:O.warning,iconClass:m().iconClasses.warning,message:e,optionsOverride:n,title:t})}function r(e,t){var o=m();v||n(o);u(e,o,t)||l(o)}function c(t){var o=m();return v||n(o),t&&0===e(":focus",t).length?void h(t):void(v.children().length&&v.remove())}function l(t){for(var n=v.children(),o=n.length-1;o>=0;o--)u(e(n[o]),t)}function u(t,n,o){var s=!(!o||!o.force)&&o.force;return!(!t||!s&&0!==e(":focus",t).length)&&(t[n.hideMethod]({duration:n.hideDuration,easing:n.hideEasing,complete:function(){h(t)}}),!0)}function d(t){return v=e("<div/>").attr("id",t.containerId).addClass(t.positionClass),v.appendTo(e(t.target)),v}function p(){return{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,closeMethod:!1,closeDuration:!1,closeEasing:!1,closeOnHover:!0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",escapeHtml:!1,target:"body",closeHtml:'<button type="button">&times;<\/button>',closeClass:"toast-close-button",newestOnTop:!0,preventDuplicates:!1,progressBar:!1,progressClass:"toast-progress",rtl:!1}}function f(e){C&&C(e)}function g(t){function o(e){return null==e&&(e=""),e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function s(){c();u();d();p();g();C();l();i()}function i(){var e="";switch(t.iconClass){case"toast-success":case"toast-info":e="polite";break;default:e="assertive"}I.attr("aria-live",e)}function a(){E.closeOnHover&&I.hover(H,D);!E.onclick&&E.tapToDismiss&&I.click(b);E.closeButton&&j&&j.click(function(e){e.stopPropagation?e.stopPropagation():void 0!==e.cancelBubble&&e.cancelBubble!==!0&&(e.cancelBubble=!0);E.onCloseClick&&E.onCloseClick(e);b(!0)});E.onclick&&I.click(function(e){E.onclick(e);b()})}function r(){I.hide();I[E.showMethod]({duration:E.showDuration,easing:E.showEasing,complete:E.onShown});E.timeOut>0&&(k=setTimeout(b,E.timeOut),F.maxHideTime=parseFloat(E.timeOut),F.hideEta=(new Date).getTime()+F.maxHideTime,E.progressBar&&(F.intervalId=setInterval(x,10)))}function c(){t.iconClass&&I.addClass(E.toastClass).addClass(y)}function l(){E.newestOnTop?v.prepend(I):v.append(I)}function u(){if(t.title){var e=t.title;E.escapeHtml&&(e=o(t.title));M.append(e).addClass(E.titleClass);I.append(M)}}function d(){if(t.message){var e=t.message;E.escapeHtml&&(e=o(t.message));B.append(e).addClass(E.messageClass);I.append(B)}}function p(){E.closeButton&&(j.addClass(E.closeClass).attr("role","button"),I.prepend(j))}function g(){E.progressBar&&(q.addClass(E.progressClass),I.prepend(q))}function C(){E.rtl&&I.addClass("rtl")}function O(e,t){if(e.preventDuplicates){if(t.message===w)return!0;w=t.message}return!1}function b(t){var n=t&&E.closeMethod!==!1?E.closeMethod:E.hideMethod,o=t&&E.closeDuration!==!1?E.closeDuration:E.hideDuration,s=t&&E.closeEasing!==!1?E.closeEasing:E.hideEasing;if(!e(":focus",I).length||t)return clearTimeout(F.intervalId),I[n]({duration:o,easing:s,complete:function(){h(I);clearTimeout(k);E.onHidden&&"hidden"!==P.state&&E.onHidden();P.state="hidden";P.endTime=new Date;f(P)}})}function D(){(E.timeOut>0||E.extendedTimeOut>0)&&(k=setTimeout(b,E.extendedTimeOut),F.maxHideTime=parseFloat(E.extendedTimeOut),F.hideEta=(new Date).getTime()+F.maxHideTime)}function H(){clearTimeout(k);F.hideEta=0;I.stop(!0,!0)[E.showMethod]({duration:E.showDuration,easing:E.showEasing})}function x(){var e=(F.hideEta-(new Date).getTime())/F.maxHideTime*100;q.width(e+"%")}var E=m(),y=t.iconClass||E.iconClass;if("undefined"!=typeof t.optionsOverride&&(E=e.extend(E,t.optionsOverride),y=t.optionsOverride.iconClass||y),!O(E,t)){T++;v=n(E,!0);var k=null,I=e("<div/>"),M=e("<div/>"),B=e("<div/>"),q=e("<div/>"),j=e(E.closeHtml),F={intervalId:null,hideEta:null,maxHideTime:null},P={toastId:T,state:"visible",startTime:new Date,options:E,map:t};return s(),r(),a(),f(P),E.debug&&console&&console.log(P),I}}function m(){return e.extend({},p(),b.options)}function h(e){v||(v=n());e.is(":visible")||(e.remove(),e=null,0===v.children().length&&(v.remove(),w=void 0))}var v,C,w,T=0,O={error:"error",info:"info",success:"success",warning:"warning"},b={clear:r,remove:c,error:t,getContainer:n,info:o,options:{},subscribe:s,success:i,version:"2.1.4",warning:a};return b}()})}("function"==typeof define&&define.amd?define:function(e,t){"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):window.toastr=t(window.jQuery)}),function(){"use strict";function removeFromTo(array,from,to){return array.splice(from,!to||1+to-from+(!(to<0^from>=0)&&(to<0||-1)*array.length)),array.length}var UndoManager=function(){var commands=[],index=-1,limit=0,isExecuting=!1,callback,execute;return execute=function(command,action){return!command||typeof command[action]!="function"?this:(isExecuting=!0,command[action](),isExecuting=!1,this)},{add:function(command){return isExecuting?this:(commands.splice(index+1,commands.length-index),commands.push(command),limit&&commands.length>limit&&removeFromTo(commands,0,-(limit+1)),index=commands.length-1,callback&&callback(),this)},setCallback:function(callbackFunc){callback=callbackFunc},undo:function(){var command=commands[index];return command?(execute(command,"undo"),index-=1,callback&&callback(),this):this},redo:function(){var command=commands[index+1];return command?(execute(command,"redo"),index+=1,callback&&callback(),this):this},clear:function(){var prev_size=commands.length;commands=[];index=-1;callback&&prev_size>0&&callback()},hasUndo:function(){return index!==-1},hasRedo:function(){return index<commands.length-1},getCommands:function(){return commands},getIndex:function(){return index},setLimit:function(l){limit=l}}};typeof define=="function"&&typeof define.amd=="object"&&define.amd?define(function(){return UndoManager}):window.UndoManager=UndoManager}();!function(o){"function"==typeof define&&define.amd?define(["jquery"],o):"object"==typeof module&&module.exports?module.exports=function(t,n){return void 0===n&&(n="undefined"!=typeof window?require("jquery"):require("jquery")(t)),o(n),n}:o(jQuery)}(function(j){"use strict";var D=0;j.fn.TouchSpin=function(y){var k={min:0,max:100,initval:"",replacementval:"",step:1,decimals:0,stepinterval:100,forcestepdivisibility:"round",stepintervaldelay:500,verticalbuttons:!1,verticalup:"+",verticaldown:"-",verticalupclass:"",verticaldownclass:"",prefix:"",postfix:"",prefix_extraclass:"",postfix_extraclass:"",booster:!0,boostat:10,maxboostedstep:!1,mousewheel:!0,buttondown_class:"btn btn-primary",buttonup_class:"btn btn-primary",buttondown_txt:"-",buttonup_txt:"+",callback_before_calculation:function(t){return t},callback_after_calculation:function(t){return t}},C={min:"min",max:"max",initval:"init-val",replacementval:"replacement-val",step:"step",decimals:"decimals",stepinterval:"step-interval",verticalbuttons:"vertical-buttons",verticalupclass:"vertical-up-class",verticaldownclass:"vertical-down-class",forcestepdivisibility:"force-step-divisibility",stepintervaldelay:"step-interval-delay",prefix:"prefix",postfix:"postfix",prefix_extraclass:"prefix-extra-class",postfix_extraclass:"postfix-extra-class",booster:"booster",boostat:"boostat",maxboostedstep:"max-boosted-step",mousewheel:"mouse-wheel",buttondown_class:"button-down-class",buttonup_class:"button-up-class",buttondown_txt:"button-down-txt",buttonup_txt:"button-up-txt"};return this.each(function(){var i,p,a,u,o,s,t,n,e,r,c=j(this),l=c.data(),d=0,f=!1;function b(){""===i.prefix&&(p=o.prefix.detach());""===i.postfix&&(a=o.postfix.detach())}function h(){var t,n,o;""!==(t=i.callback_before_calculation(c.val()))?0<i.decimals&&"."===t||(n=parseFloat(t),isNaN(n)&&(n=""!==i.replacementval?i.replacementval:0),(o=n).toString()!==t&&(o=n),null!==i.min&&n<i.min&&(o=i.min),null!==i.max&&n>i.max&&(o=i.max),o=function(t){switch(i.forcestepdivisibility){case"round":return(Math.round(t/i.step)*i.step).toFixed(i.decimals);case"floor":return(Math.floor(t/i.step)*i.step).toFixed(i.decimals);case"ceil":return(Math.ceil(t/i.step)*i.step).toFixed(i.decimals);default:return t}}(o),Number(t).toString()!==o.toString()&&(c.val(o),c.trigger("change"))):""!==i.replacementval&&(c.val(i.replacementval),c.trigger("change"))}function v(){if(i.booster){var t=Math.pow(2,Math.floor(d/i.boostat))*i.step;return i.maxboostedstep&&t>i.maxboostedstep&&(t=i.maxboostedstep,s=Math.round(s/t)*t),Math.max(i.step,t)}return i.step}function x(){h();s=parseFloat(i.callback_before_calculation(o.input.val()));isNaN(s)&&(s=0);var t=s,n=v();s+=n;null!==i.max&&s>i.max&&(s=i.max,c.trigger("touchspin.on.max"),_());o.input.val(i.callback_after_calculation(Number(s).toFixed(i.decimals)));t!==s&&c.trigger("change")}function g(){h();s=parseFloat(i.callback_before_calculation(o.input.val()));isNaN(s)&&(s=0);var t=s,n=v();s-=n;null!==i.min&&s<i.min&&(s=i.min,c.trigger("touchspin.on.min"),_());o.input.val(i.callback_after_calculation(Number(s).toFixed(i.decimals)));t!==s&&c.trigger("change")}function m(){_();d=0;f="down";c.trigger("touchspin.on.startspin");c.trigger("touchspin.on.startdownspin");e=setTimeout(function(){t=setInterval(function(){d++;g()},i.stepinterval)},i.stepintervaldelay)}function w(){_();d=0;f="up";c.trigger("touchspin.on.startspin");c.trigger("touchspin.on.startupspin");r=setTimeout(function(){n=setInterval(function(){d++;x()},i.stepinterval)},i.stepintervaldelay)}function _(){switch(clearTimeout(e),clearTimeout(r),clearInterval(t),clearInterval(n),f){case"up":c.trigger("touchspin.on.stopupspin");c.trigger("touchspin.on.stopspin");break;case"down":c.trigger("touchspin.on.stopdownspin");c.trigger("touchspin.on.stopspin")}d=0;f=!1}!function(){if(!c.data("alreadyinitialized")){if(c.data("alreadyinitialized",!0),D+=1,c.data("spinnerid",D),!c.is("input"))return console.log("Must be an input.");i=j.extend({},k,l,(s={},j.each(C,function(t,n){var o="bts-"+n;c.is("[data-"+o+"]")&&(s[t]=c.data(o))}),s),y);""!==i.initval&&""===c.val()&&c.val(i.initval);h(),function(){var t=c.val(),n=c.parent();""!==t&&(t=i.callback_after_calculation(Number(t).toFixed(i.decimals)));c.data("initvalue",t).val(t);c.addClass("form-control");n.hasClass("input-group")?function(t){t.addClass("bootstrap-touchspin");var n,o,s=c.prev(),p=c.next(),a='<span class="input-group-addon input-group-prepend bootstrap-touchspin-prefix input-group-prepend bootstrap-touchspin-injected"><span class="input-group-text">'+i.prefix+"<\/span><\/span>",e='<span class="input-group-addon input-group-append bootstrap-touchspin-postfix input-group-append bootstrap-touchspin-injected"><span class="input-group-text">'+i.postfix+"<\/span><\/span>";s.hasClass("input-group-btn")||s.hasClass("input-group-prepend")?(n='<button class="'+i.buttondown_class+' bootstrap-touchspin-down bootstrap-touchspin-injected" type="button">'+i.buttondown_txt+"<\/button>",s.append(n)):(n='<span class="input-group-btn input-group-prepend bootstrap-touchspin-injected"><button class="'+i.buttondown_class+' bootstrap-touchspin-down" type="button">'+i.buttondown_txt+"<\/button><\/span>",j(n).insertBefore(c));p.hasClass("input-group-btn")||p.hasClass("input-group-append")?(o='<button class="'+i.buttonup_class+' bootstrap-touchspin-up bootstrap-touchspin-injected" type="button">'+i.buttonup_txt+"<\/button>",p.prepend(o)):(o='<span class="input-group-btn input-group-append bootstrap-touchspin-injected"><button class="'+i.buttonup_class+' bootstrap-touchspin-up" type="button">'+i.buttonup_txt+"<\/button><\/span>",j(o).insertAfter(c));j(a).insertBefore(c);j(e).insertAfter(c);u=t}(n):function(){var t,n="";c.hasClass("input-sm")&&(n="input-group-sm");c.hasClass("input-lg")&&(n="input-group-lg");t=i.verticalbuttons?'<div class="input-group '+n+' bootstrap-touchspin bootstrap-touchspin-injected"><span class="input-group-addon input-group-prepend bootstrap-touchspin-prefix"><span class="input-group-text">'+i.prefix+'<\/span><\/span><span class="input-group-addon bootstrap-touchspin-postfix input-group-append"><span class="input-group-text">'+i.postfix+'<\/span><\/span><span class="input-group-btn-vertical"><button class="'+i.buttondown_class+" bootstrap-touchspin-up "+i.verticalupclass+'" type="button">'+i.verticalup+'<\/button><button class="'+i.buttonup_class+" bootstrap-touchspin-down "+i.verticaldownclass+'" type="button">'+i.verticaldown+"<\/button><\/span><\/div>":'<div class="input-group bootstrap-touchspin bootstrap-touchspin-injected"><span class="input-group-btn input-group-prepend"><button class="'+i.buttondown_class+' bootstrap-touchspin-down" type="button">'+i.buttondown_txt+'<\/button><\/span><span class="input-group-addon bootstrap-touchspin-prefix input-group-prepend"><span class="input-group-text">'+i.prefix+'<\/span><\/span><span class="input-group-addon bootstrap-touchspin-postfix input-group-append"><span class="input-group-text">'+i.postfix+'<\/span><\/span><span class="input-group-btn input-group-append"><button class="'+i.buttonup_class+' bootstrap-touchspin-up" type="button">'+i.buttonup_txt+"<\/button><\/span><\/div>";u=j(t).insertBefore(c);j(".bootstrap-touchspin-prefix",u).after(c);c.hasClass("input-sm")?u.addClass("input-group-sm"):c.hasClass("input-lg")&&u.addClass("input-group-lg")}()}();o={down:j(".bootstrap-touchspin-down",u),up:j(".bootstrap-touchspin-up",u),input:j("input",u),prefix:j(".bootstrap-touchspin-prefix",u).addClass(i.prefix_extraclass),postfix:j(".bootstrap-touchspin-postfix",u).addClass(i.postfix_extraclass)};b();c.on("keydown.touchspin",function(t){var n=t.keyCode||t.which;38===n?("up"!==f&&(x(),w()),t.preventDefault()):40===n&&("down"!==f&&(g(),m()),t.preventDefault())});c.on("keyup.touchspin",function(t){var n=t.keyCode||t.which;38===n?_():40===n&&_()});c.on("blur.touchspin",function(){h();c.val(i.callback_after_calculation(c.val()))});o.down.on("keydown",function(t){var n=t.keyCode||t.which;32!==n&&13!==n||("down"!==f&&(g(),m()),t.preventDefault())});o.down.on("keyup.touchspin",function(t){var n=t.keyCode||t.which;32!==n&&13!==n||_()});o.up.on("keydown.touchspin",function(t){var n=t.keyCode||t.which;32!==n&&13!==n||("up"!==f&&(x(),w()),t.preventDefault())});o.up.on("keyup.touchspin",function(t){var n=t.keyCode||t.which;32!==n&&13!==n||_()});o.down.on("mousedown.touchspin",function(t){o.down.off("touchstart.touchspin");c.is(":disabled")||(g(),m(),t.preventDefault(),t.stopPropagation())});o.down.on("touchstart.touchspin",function(t){o.down.off("mousedown.touchspin");c.is(":disabled")||(g(),m(),t.preventDefault(),t.stopPropagation())});o.up.on("mousedown.touchspin",function(t){o.up.off("touchstart.touchspin");c.is(":disabled")||(x(),w(),t.preventDefault(),t.stopPropagation())});o.up.on("touchstart.touchspin",function(t){o.up.off("mousedown.touchspin");c.is(":disabled")||(x(),w(),t.preventDefault(),t.stopPropagation())});o.up.on("mouseup.touchspin mouseout.touchspin touchleave.touchspin touchend.touchspin touchcancel.touchspin",function(t){f&&(t.stopPropagation(),_())});o.down.on("mouseup.touchspin mouseout.touchspin touchleave.touchspin touchend.touchspin touchcancel.touchspin",function(t){f&&(t.stopPropagation(),_())});o.down.on("mousemove.touchspin touchmove.touchspin",function(t){f&&(t.stopPropagation(),t.preventDefault())});o.up.on("mousemove.touchspin touchmove.touchspin",function(t){f&&(t.stopPropagation(),t.preventDefault())});c.on("mousewheel.touchspin DOMMouseScroll.touchspin",function(t){if(i.mousewheel&&c.is(":focus")){var n=t.originalEvent.wheelDelta||-t.originalEvent.deltaY||-t.originalEvent.detail;t.stopPropagation();t.preventDefault();n<0?g():x()}});c.on("touchspin.destroy",function(){var t;t=c.parent();_();c.off(".touchspin");t.hasClass("bootstrap-touchspin-injected")?(c.siblings().remove(),c.unwrap()):(j(".bootstrap-touchspin-injected",t).remove(),t.removeClass("bootstrap-touchspin"));c.data("alreadyinitialized",!1)});c.on("touchspin.uponce",function(){_();x()});c.on("touchspin.downonce",function(){_();g()});c.on("touchspin.startupspin",function(){w()});c.on("touchspin.startdownspin",function(){m()});c.on("touchspin.stopspin",function(){_()});c.on("touchspin.updatesettings",function(t,n){!function(t){(function(t){if(i=j.extend({},i,t),t.postfix){var n=c.parent().find(".bootstrap-touchspin-postfix");0===n.length&&a.insertAfter(c);c.parent().find(".bootstrap-touchspin-postfix .input-group-text").text(t.postfix)}if(t.prefix){var o=c.parent().find(".bootstrap-touchspin-prefix");0===o.length&&p.insertBefore(c);c.parent().find(".bootstrap-touchspin-prefix .input-group-text").text(t.prefix)}b()})(t);h();var n=o.input.val();""!==n&&(n=Number(i.callback_before_calculation(o.input.val())),o.input.val(i.callback_after_calculation(Number(n).toFixed(i.decimals))))}(n)});var s}}()})}}),function($){"use strict";String.prototype.includes||function(){var toString={}.toString,defineProperty=function(){try{var object={},$defineProperty=Object.defineProperty,result=$defineProperty(object,object,object)&&$defineProperty}catch(error){}return result}(),indexOf="".indexOf,includes=function(search){if(this==null)throw TypeError();var string=String(this);if(search&&toString.call(search)=="[object RegExp]")throw TypeError();var stringLength=string.length,searchString=String(search),searchLength=searchString.length,position=arguments.length>1?arguments[1]:undefined,pos=position?Number(position):0;pos!=pos&&(pos=0);var start=Math.min(Math.max(pos,0),stringLength);return searchLength+start>stringLength?!1:indexOf.call(string,searchString,pos)!=-1};defineProperty?defineProperty(String.prototype,"includes",{value:includes,configurable:!0,writable:!0}):String.prototype.includes=includes}();String.prototype.startsWith||function(){var defineProperty=function(){try{var object={},$defineProperty=Object.defineProperty,result=$defineProperty(object,object,object)&&$defineProperty}catch(error){}return result}(),toString={}.toString,startsWith=function(search){if(this==null)throw TypeError();var string=String(this);if(search&&toString.call(search)=="[object RegExp]")throw TypeError();var stringLength=string.length,searchString=String(search),searchLength=searchString.length,position=arguments.length>1?arguments[1]:undefined,pos=position?Number(position):0;pos!=pos&&(pos=0);var start=Math.min(Math.max(pos,0),stringLength);if(searchLength+start>stringLength)return!1;for(var index=-1;++index<searchLength;)if(string.charCodeAt(start+index)!=searchString.charCodeAt(index))return!1;return!0};defineProperty?defineProperty(String.prototype,"startsWith",{value:startsWith,configurable:!0,writable:!0}):String.prototype.startsWith=startsWith}();Object.keys||(Object.keys=function(o,k,r){r=[];for(k in o)r.hasOwnProperty.call(o,k)&&r.push(k);return r});$.expr[":"].icontains=function(obj,index,meta){var $obj=$(obj),haystack=($obj.data("tokens")||$obj.text()).toUpperCase();return haystack.includes(meta[3].toUpperCase())};$.expr[":"].ibegins=function(obj,index,meta){var $obj=$(obj),haystack=($obj.data("tokens")||$obj.text()).toUpperCase();return haystack.startsWith(meta[3].toUpperCase())};$.expr[":"].aicontains=function(obj,index,meta){var $obj=$(obj),haystack=($obj.data("tokens")||$obj.data("normalizedText")||$obj.text()).toUpperCase();return haystack.includes(meta[3].toUpperCase())};$.expr[":"].aibegins=function(obj,index,meta){var $obj=$(obj),haystack=($obj.data("tokens")||$obj.data("normalizedText")||$obj.text()).toUpperCase();return haystack.startsWith(meta[3].toUpperCase())};function normalizeToBase(text){return $.each([{re:/[\xC0-\xC6]/g,ch:"A"},{re:/[\xE0-\xE6]/g,ch:"a"},{re:/[\xC8-\xCB]/g,ch:"E"},{re:/[\xE8-\xEB]/g,ch:"e"},{re:/[\xCC-\xCF]/g,ch:"I"},{re:/[\xEC-\xEF]/g,ch:"i"},{re:/[\xD2-\xD6]/g,ch:"O"},{re:/[\xF2-\xF6]/g,ch:"o"},{re:/[\xD9-\xDC]/g,ch:"U"},{re:/[\xF9-\xFC]/g,ch:"u"},{re:/[\xC7-\xE7]/g,ch:"c"},{re:/[\xD1]/g,ch:"N"},{re:/[\xF1]/g,ch:"n"}],function(){text=text.replace(this.re,this.ch)}),text}function htmlEscape(html){var escapeMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},source="(?:"+Object.keys(escapeMap).join("|")+")",testRegexp=new RegExp(source),replaceRegexp=new RegExp(source,"g"),string=html==null?"":""+html;return testRegexp.test(string)?string.replace(replaceRegexp,function(match){return escapeMap[match]}):string}var Selectpicker=function(element,options,e){e&&(e.stopPropagation(),e.preventDefault());this.$element=$(element);this.$newElement=null;this.$button=null;this.$menu=null;this.$lis=null;this.options=options;this.options.title===null&&(this.options.title=this.$element.attr("title"));this.val=Selectpicker.prototype.val;this.render=Selectpicker.prototype.render;this.refresh=Selectpicker.prototype.refresh;this.setStyle=Selectpicker.prototype.setStyle;this.selectAll=Selectpicker.prototype.selectAll;this.deselectAll=Selectpicker.prototype.deselectAll;this.destroy=Selectpicker.prototype.remove;this.remove=Selectpicker.prototype.remove;this.show=Selectpicker.prototype.show;this.hide=Selectpicker.prototype.hide;this.init()};Selectpicker.VERSION="1.7.2";Selectpicker.DEFAULTS={noneSelectedText:"Nothing selected",noneResultsText:"No results matched {0}",countSelectedText:function(numSelected){return numSelected==1?"{0} item selected":"{0} items selected"},maxOptionsText:function(numAll,numGroup){return[numAll==1?"Limit reached ({n} item max)":"Limit reached ({n} items max)",numGroup==1?"Group limit reached ({n} item max)":"Group limit reached ({n} items max)"]},selectAllText:"Select All",deselectAllText:"Deselect All",doneButton:!1,doneButtonText:"Close",multipleSeparator:", ",styleBase:"btn",style:"btn-default",size:"auto",title:null,selectedTextFormat:"values",width:!1,container:!1,hideDisabled:!1,showSubtext:!1,showIcon:!0,showContent:!0,dropupAuto:!0,header:!1,liveSearch:!1,liveSearchPlaceholder:null,liveSearchNormalize:!1,liveSearchStyle:"contains",actionsBox:!1,iconBase:"glyphicon",tickIcon:"glyphicon-ok",maxOptions:!1,mobile:!1,selectOnTab:!1,dropdownAlignRight:!1};Selectpicker.prototype={constructor:Selectpicker,init:function(){var that=this,id=this.$element.attr("id");this.$element.addClass("bs-select-hidden");this.liObj={};this.multiple=this.$element.prop("multiple");this.autofocus=this.$element.prop("autofocus");this.$newElement=this.createView();this.$element.after(this.$newElement);this.$button=this.$newElement.children("button");this.$menu=this.$newElement.children(".dropdown-menu");this.$menuInner=this.$menu.children(".inner");this.$searchbox=this.$menu.find("input");this.options.dropdownAlignRight&&this.$menu.addClass("dropdown-menu-right");typeof id!="undefined"&&(this.$button.attr("data-id",id),$('label[for="'+id+'"]').click(function(e){e.preventDefault();that.$button.focus()}));this.checkDisabled();this.clickListener();this.options.liveSearch&&this.liveSearchListener();this.render();this.setStyle();this.setWidth();this.options.container&&this.selectPosition();this.$menu.data("this",this);this.$newElement.data("this",this);this.options.mobile&&this.mobile();this.$newElement.on("hide.bs.dropdown",function(e){that.$element.trigger("hide.bs.select",e)});this.$newElement.on("hidden.bs.dropdown",function(e){that.$element.trigger("hidden.bs.select",e)});this.$newElement.on("show.bs.dropdown",function(e){that.$element.trigger("show.bs.select",e)});this.$newElement.on("shown.bs.dropdown",function(e){that.$element.trigger("shown.bs.select",e)});setTimeout(function(){that.$element.trigger("loaded.bs.select")})},createDropdown:function(){var multiple=this.multiple?" show-tick":"",inputGroup=this.$element.parent().hasClass("input-group")?" input-group-btn":"",autofocus=this.autofocus?" autofocus":"",header=this.options.header?'<div class="popover-title"><button type="button" class="close" aria-hidden="true">&times;<\/button>'+this.options.header+"<\/div>":"",searchbox=this.options.liveSearch?'<div class="bs-searchbox"><input type="text" class="form-control" autocomplete="off"'+(null===this.options.liveSearchPlaceholder?"":' placeholder="'+htmlEscape(this.options.liveSearchPlaceholder)+'"')+"><\/div>":"",actionsbox=this.multiple&&this.options.actionsBox?'<div class="bs-actionsbox"><div class="btn-group btn-group-sm btn-block"><button type="button" class="actions-btn bs-select-all btn btn-default">'+this.options.selectAllText+'<\/button><button type="button" class="actions-btn bs-deselect-all btn btn-default">'+this.options.deselectAllText+"<\/button><\/div><\/div>":"",donebutton=this.multiple&&this.options.doneButton?'<div class="bs-donebutton"><div class="btn-group btn-block"><button type="button" class="btn btn-sm btn-default">'+this.options.doneButtonText+"<\/button><\/div><\/div>":"",drop='<div class="btn-group bootstrap-select'+multiple+inputGroup+'"><button type="button" class="'+this.options.styleBase+' dropdown-toggle" data-toggle="dropdown"'+autofocus+'><span class="filter-option pull-left"><\/span>&nbsp;<span class="caret"><\/span><\/button><div class="dropdown-menu open">'+header+searchbox+actionsbox+'<ul class="dropdown-menu inner" role="menu"><\/ul>'+donebutton+"<\/div><\/div>";return $(drop)},createView:function(){var $drop=this.createDropdown(),li=this.createLi();return $drop.find("ul")[0].innerHTML=li,$drop},reloadLi:function(){this.destroyLi();var li=this.createLi();this.$menuInner[0].innerHTML=li},destroyLi:function(){this.$menu.find("li").remove()},createLi:function(){var that=this,_li=[],optID=0,titleOption=document.createElement("option"),liIndex=-1,generateLI=function(content,index,classes,optgroup){return"<li"+(typeof classes!="undefined"&""!==classes?' class="'+classes+'"':"")+(typeof index!="undefined"&null!==index?' data-original-index="'+index+'"':"")+(typeof optgroup!="undefined"&null!==optgroup?'data-optgroup="'+optgroup+'"':"")+">"+content+"<\/li>"},generateA=function(text,classes,inline,tokens){return'<a tabindex="0"'+(typeof classes!="undefined"?' class="'+classes+'"':"")+(typeof inline!="undefined"?' style="'+inline+'"':"")+(that.options.liveSearchNormalize?' data-normalized-text="'+normalizeToBase(htmlEscape(text))+'"':"")+(typeof tokens!="undefined"||tokens!==null?' data-tokens="'+tokens+'"':"")+">"+text+'<span class="'+that.options.iconBase+" "+that.options.tickIcon+' check-mark"><\/span><\/a>'};if(this.options.title&&!this.multiple&&(liIndex--,!this.$element.find(".bs-title-option").length)){var element=this.$element[0];titleOption.className="bs-title-option";titleOption.appendChild(document.createTextNode(this.options.title));titleOption.value="";element.insertBefore(titleOption,element.firstChild);element.options[element.selectedIndex].getAttribute("selected")===null&&(titleOption.selected=!0)}return this.$element.find("option").each(function(index){var $this=$(this);if(liIndex++,!$this.hasClass("bs-title-option")){var optionClass=this.className||"",inline=this.style.cssText,text=$this.data("content")?$this.data("content"):$this.html(),tokens=$this.data("tokens")?$this.data("tokens"):null,subtext=typeof $this.data("subtext")!="undefined"?'<small class="text-muted">'+$this.data("subtext")+"<\/small>":"",icon=typeof $this.data("icon")!="undefined"?'<span class="'+that.options.iconBase+" "+$this.data("icon")+'"><\/span> ':"",isDisabled=this.disabled||this.parentElement.tagName==="OPTGROUP"&&this.parentElement.disabled;if(icon!==""&&isDisabled&&(icon="<span>"+icon+"<\/span>"),that.options.hideDisabled&&isDisabled){liIndex--;return}if($this.data("content")||(text=icon+'<span class="text">'+text+subtext+"<\/span>"),this.parentElement.tagName==="OPTGROUP"&&$this.data("divider")!==!0){if($this.index()===0){optID+=1;var label=this.parentElement.label,labelSubtext=typeof $this.parent().data("subtext")!="undefined"?'<small class="text-muted">'+$this.parent().data("subtext")+"<\/small>":"",labelIcon=$this.parent().data("icon")?'<span class="'+that.options.iconBase+" "+$this.parent().data("icon")+'"><\/span> ':"",optGroupClass=" "+this.parentElement.className||"";label=labelIcon+'<span class="text">'+label+labelSubtext+"<\/span>";index!==0&&_li.length>0&&(liIndex++,_li.push(generateLI("",null,"divider",optID+"div")));liIndex++;_li.push(generateLI(label,null,"dropdown-header"+optGroupClass,optID))}_li.push(generateLI(generateA(text,"opt "+optionClass+optGroupClass,inline,tokens),index,"",optID))}else $this.data("divider")===!0?_li.push(generateLI("",index,"divider")):$this.data("hidden")===!0?_li.push(generateLI(generateA(text,optionClass,inline,tokens),index,"hidden is-hidden")):(this.previousElementSibling&&this.previousElementSibling.tagName==="OPTGROUP"&&(liIndex++,_li.push(generateLI("",null,"divider",optID+"div"))),_li.push(generateLI(generateA(text,optionClass,inline,tokens),index)));that.liObj[index]=liIndex}}),this.multiple||this.$element.find("option:selected").length!==0||this.options.title||this.$element.find("option").eq(0).prop("selected",!0).attr("selected","selected"),_li.join("")},findLis:function(){return this.$lis==null&&(this.$lis=this.$menu.find("li")),this.$lis},render:function(updateLi){var that=this,notDisabled;updateLi!==!1&&this.$element.find("option").each(function(index){var $lis=that.findLis().eq(that.liObj[index]);that.setDisabled(index,this.disabled||this.parentElement.tagName==="OPTGROUP"&&this.parentElement.disabled,$lis);that.setSelected(index,this.selected,$lis)});this.tabIndex();var selectedItems=this.$element.find("option").map(function(){if(this.selected){if(that.options.hideDisabled&&(this.disabled||this.parentElement.tagName==="OPTGROUP"&&this.parentElement.disabled))return!1;var $this=$(this),icon=$this.data("icon")&&that.options.showIcon?'<i class="'+that.options.iconBase+" "+$this.data("icon")+'"><\/i> ':"",subtext;return subtext=that.options.showSubtext&&$this.data("subtext")&&!that.multiple?' <small class="text-muted">'+$this.data("subtext")+"<\/small>":"",typeof $this.attr("title")!="undefined"?$this.attr("title"):$this.data("content")&&that.options.showContent?$this.data("content"):icon+$this.html()+subtext}}).toArray(),title=this.multiple?selectedItems.join(this.options.multipleSeparator):selectedItems[0];if(this.multiple&&this.options.selectedTextFormat.indexOf("count")>-1){var max=this.options.selectedTextFormat.split(">");if(max.length>1&&selectedItems.length>max[1]||max.length==1&&selectedItems.length>=2){notDisabled=this.options.hideDisabled?", [disabled]":"";var totalCount=this.$element.find("option").not('[data-divider="true"], [data-hidden="true"]'+notDisabled).length,tr8nText=typeof this.options.countSelectedText=="function"?this.options.countSelectedText(selectedItems.length,totalCount):this.options.countSelectedText;title=tr8nText.replace("{0}",selectedItems.length.toString()).replace("{1}",totalCount.toString())}}this.options.title==undefined&&(this.options.title=this.$element.attr("title"));this.options.selectedTextFormat=="static"&&(title=this.options.title);title||(title=typeof this.options.title!="undefined"?this.options.title:this.options.noneSelectedText);this.$button.attr("title",$.trim(title.replace(/<[^>]*>?/g,"")));this.$button.children(".filter-option").html(title);this.$element.trigger("rendered.bs.select")},setStyle:function(style,status){this.$element.attr("class")&&this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi,""));var buttonClass=style?style:this.options.style;status=="add"?this.$button.addClass(buttonClass):status=="remove"?this.$button.removeClass(buttonClass):(this.$button.removeClass(this.options.style),this.$button.addClass(buttonClass))},liHeight:function(refresh){if(refresh||this.options.size!==!1&&!this.sizeInfo){var newElement=document.createElement("div"),menu=document.createElement("div"),menuInner=document.createElement("ul"),divider=document.createElement("li"),li=document.createElement("li"),a=document.createElement("a"),text=document.createElement("span"),header=this.options.header?this.$menu.find(".popover-title")[0].cloneNode(!0):null,search=this.options.liveSearch?document.createElement("div"):null,actions=this.options.actionsBox&&this.multiple?this.$menu.find(".bs-actionsbox")[0].cloneNode(!0):null,doneButton=this.options.doneButton&&this.multiple?this.$menu.find(".bs-donebutton")[0].cloneNode(!0):null;if(text.className="text",newElement.className=this.$menu[0].parentNode.className+" open",menu.className="dropdown-menu open",menuInner.className="dropdown-menu inner",divider.className="divider",text.appendChild(document.createTextNode("Inner text")),a.appendChild(text),li.appendChild(a),menuInner.appendChild(li),menuInner.appendChild(divider),header&&menu.appendChild(header),search){var input=document.createElement("span");search.className="bs-searchbox";input.className="form-control";search.appendChild(input);menu.appendChild(search)}actions&&menu.appendChild(actions);menu.appendChild(menuInner);doneButton&&menu.appendChild(doneButton);newElement.appendChild(menu);document.body.appendChild(newElement);var liHeight=a.offsetHeight,headerHeight=header?header.offsetHeight:0,searchHeight=search?search.offsetHeight:0,actionsHeight=actions?actions.offsetHeight:0,doneButtonHeight=doneButton?doneButton.offsetHeight:0,dividerHeight=$(divider).outerHeight(!0),menuStyle=getComputedStyle?getComputedStyle(menu):!1,$menu=menuStyle?$(menu):null,menuPadding=parseInt(menuStyle?menuStyle.paddingTop:$menu.css("paddingTop"))+parseInt(menuStyle?menuStyle.paddingBottom:$menu.css("paddingBottom"))+parseInt(menuStyle?menuStyle.borderTopWidth:$menu.css("borderTopWidth"))+parseInt(menuStyle?menuStyle.borderBottomWidth:$menu.css("borderBottomWidth")),menuExtras=menuPadding+parseInt(menuStyle?menuStyle.marginTop:$menu.css("marginTop"))+parseInt(menuStyle?menuStyle.marginBottom:$menu.css("marginBottom"))+2;document.body.removeChild(newElement);this.sizeInfo={liHeight:liHeight,headerHeight:headerHeight,searchHeight:searchHeight,actionsHeight:actionsHeight,doneButtonHeight:doneButtonHeight,dividerHeight:dividerHeight,menuPadding:menuPadding,menuExtras:menuExtras}}},setSize:function(){this.findLis();this.liHeight();var that=this,$menu=this.$menu,$menuInner=this.$menuInner,$window=$(window),selectHeight=this.$newElement[0].offsetHeight,liHeight=this.sizeInfo.liHeight,headerHeight=this.sizeInfo.headerHeight,searchHeight=this.sizeInfo.searchHeight,actionsHeight=this.sizeInfo.actionsHeight,doneButtonHeight=this.sizeInfo.doneButtonHeight,divHeight=this.sizeInfo.dividerHeight,menuPadding=this.sizeInfo.menuPadding,menuExtras=this.sizeInfo.menuExtras,notDisabled=this.options.hideDisabled?".disabled":"",menuHeight,getHeight,selectOffsetTop,selectOffsetBot,posVert=function(){selectOffsetTop=that.$newElement.offset().top-$window.scrollTop();selectOffsetBot=$window.height()-selectOffsetTop-selectHeight};if(posVert(),this.options.header&&$menu.css("padding-top",0),this.options.size==="auto"){var getSize=function(){var minHeight,hasClass=function(className,include){return function(element){return include?element.classList?element.classList.contains(className):$(element).hasClass(className):!(element.classList?element.classList.contains(className):$(element).hasClass(className))}},lis=that.$menuInner[0].getElementsByTagName("li"),lisVisible=Array.prototype.filter?Array.prototype.filter.call(lis,hasClass("hidden",!1)):that.$lis.not(".hidden"),optGroup=Array.prototype.filter?Array.prototype.filter.call(lisVisible,hasClass("dropdown-header",!0)):lisVisible.filter(".dropdown-header");posVert();menuHeight=selectOffsetBot-menuExtras;that.options.container?($menu.data("height")||$menu.data("height",$menu.height()),getHeight=$menu.data("height")):getHeight=$menu.height();that.options.dropupAuto&&that.$newElement.toggleClass("dropup",selectOffsetTop>selectOffsetBot&&menuHeight-menuExtras<getHeight);that.$newElement.hasClass("dropup")&&(menuHeight=selectOffsetTop-menuExtras);minHeight=lisVisible.length+optGroup.length>3?liHeight*3+menuExtras-2:0;$menu.css({"max-height":menuHeight+"px",overflow:"hidden","min-height":minHeight+headerHeight+searchHeight+actionsHeight+doneButtonHeight+"px"});$menuInner.css({"max-height":menuHeight-headerHeight-searchHeight-actionsHeight-doneButtonHeight-menuPadding+"px","overflow-y":"auto","min-height":Math.max(minHeight-menuPadding,0)+"px"})};getSize();this.$searchbox.off("input.getSize propertychange.getSize").on("input.getSize propertychange.getSize",getSize);$window.off("resize.getSize scroll.getSize").on("resize.getSize scroll.getSize",getSize)}else if(this.options.size&&this.options.size!="auto"&&this.$lis.not(notDisabled).length>this.options.size){var optIndex=this.$lis.not(".divider").not(notDisabled).children().slice(0,this.options.size).last().parent().index(),divLength=this.$lis.slice(0,optIndex+1).filter(".divider").length;menuHeight=liHeight*this.options.size+divLength*divHeight+menuPadding;that.options.container?($menu.data("height")||$menu.data("height",$menu.height()),getHeight=$menu.data("height")):getHeight=$menu.height();that.options.dropupAuto&&this.$newElement.toggleClass("dropup",selectOffsetTop>selectOffsetBot&&menuHeight-menuExtras<getHeight);$menu.css({"max-height":menuHeight+headerHeight+searchHeight+actionsHeight+doneButtonHeight+"px",overflow:"hidden","min-height":""});$menuInner.css({"max-height":menuHeight-menuPadding+"px","overflow-y":"auto","min-height":""})}},setWidth:function(){if(this.options.width==="auto"){this.$menu.css("min-width","0");var $selectClone=this.$menu.parent().clone().appendTo("body"),$selectClone2=this.options.container?this.$newElement.clone().appendTo("body"):$selectClone,ulWidth=$selectClone.children(".dropdown-menu").outerWidth(),btnWidth=$selectClone2.css("width","auto").children("button").outerWidth();$selectClone.remove();$selectClone2.remove();this.$newElement.css("width",Math.max(ulWidth,btnWidth)+"px")}else this.options.width==="fit"?(this.$menu.css("min-width",""),this.$newElement.css("width","").addClass("fit-width")):this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width",this.options.width)):(this.$menu.css("min-width",""),this.$newElement.css("width",""));this.$newElement.hasClass("fit-width")&&this.options.width!=="fit"&&this.$newElement.removeClass("fit-width")},selectPosition:function(){var that=this,$drop=$("<div />"),pos,actualHeight,getPlacement=function($element){$drop.addClass($element.attr("class").replace(/form-control|fit-width/gi,"")).toggleClass("dropup",$element.hasClass("dropup"));pos=$element.offset();actualHeight=$element.hasClass("dropup")?0:$element[0].offsetHeight;$drop.css({top:pos.top+actualHeight,left:pos.left,width:$element[0].offsetWidth,position:"absolute"})};this.$newElement.on("click",function(){that.isDisabled()||(getPlacement($(this)),$drop.appendTo(that.options.container),$drop.toggleClass("open",!$(this).hasClass("open")),$drop.append(that.$menu))});$(window).on("resize scroll",function(){getPlacement(that.$newElement)});this.$element.on("hide.bs.select",function(){that.$menu.data("height",that.$menu.height());$drop.detach()})},setSelected:function(index,selected,$lis){if(!$lis)var $lis=this.findLis().eq(this.liObj[index]);$lis.toggleClass("selected",selected)},setDisabled:function(index,disabled,$lis){if(!$lis)var $lis=this.findLis().eq(this.liObj[index]);disabled?$lis.addClass("disabled").children("a").attr("href","#").attr("tabindex",-1):$lis.removeClass("disabled").children("a").removeAttr("href").attr("tabindex",0)},isDisabled:function(){return this.$element[0].disabled},checkDisabled:function(){var that=this;this.isDisabled()?(this.$newElement.addClass("disabled"),this.$button.addClass("disabled").attr("tabindex",-1)):(this.$button.hasClass("disabled")&&(this.$newElement.removeClass("disabled"),this.$button.removeClass("disabled")),this.$button.attr("tabindex")!=-1||this.$element.data("tabindex")||this.$button.removeAttr("tabindex"));this.$button.click(function(){return!that.isDisabled()})},tabIndex:function(){this.$element.is("[tabindex]")&&(this.$element.data("tabindex",this.$element.attr("tabindex")),this.$button.attr("tabindex",this.$element.data("tabindex")))},clickListener:function(){var that=this,$document=$(document);this.$newElement.on("touchstart.dropdown",".dropdown-menu",function(e){e.stopPropagation()});$document.data("spaceSelect",!1);this.$button.on("keyup",function(e){/(32)/.test(e.keyCode.toString(10))&&$document.data("spaceSelect")&&(e.preventDefault(),$document.data("spaceSelect",!1))});this.$newElement.on("click",function(){that.setSize();that.$element.on("shown.bs.select",function(){if(that.options.liveSearch||that.multiple){if(!that.multiple){var selectedIndex=that.liObj[that.$element[0].selectedIndex];if(typeof selectedIndex!="number")return;var offset=that.$lis.eq(selectedIndex)[0].offsetTop-that.$menuInner[0].offsetTop;offset=offset-that.$menuInner[0].offsetHeight/2+that.sizeInfo.liHeight/2;that.$menuInner[0].scrollTop=offset}}else that.$menu.find(".selected a").focus()})});this.$menu.on("click","li a",function(e){var $this=$(this),clickedIndex=$this.parent().data("originalIndex"),prevValue=that.$element.val(),prevIndex=that.$element.prop("selectedIndex");if(that.multiple&&e.stopPropagation(),e.preventDefault(),!that.isDisabled()&&!$this.parent().hasClass("disabled")){var $options=that.$element.find("option"),$option=$options.eq(clickedIndex),state=$option.prop("selected"),$optgroup=$option.parent("optgroup"),maxOptions=that.options.maxOptions,maxOptionsGrp=$optgroup.data("maxOptions")||!1;if(that.multiple){if($option.prop("selected",!state),that.setSelected(clickedIndex,!state),$this.blur(),maxOptions!==!1||maxOptionsGrp!==!1){var maxReached=maxOptions<$options.filter(":selected").length,maxReachedGrp=maxOptionsGrp<$optgroup.find("option:selected").length;if(maxOptions&&maxReached||maxOptionsGrp&&maxReachedGrp)if(maxOptions&&maxOptions==1)$options.prop("selected",!1),$option.prop("selected",!0),that.$menu.find(".selected").removeClass("selected"),that.setSelected(clickedIndex,!0);else if(maxOptionsGrp&&maxOptionsGrp==1){$optgroup.find("option:selected").prop("selected",!1);$option.prop("selected",!0);var optgroupID=$this.parent().data("optgroup");that.$menu.find('[data-optgroup="'+optgroupID+'"]').removeClass("selected");that.setSelected(clickedIndex,!0)}else{var maxOptionsArr=typeof that.options.maxOptionsText=="function"?that.options.maxOptionsText(maxOptions,maxOptionsGrp):that.options.maxOptionsText,maxTxt=maxOptionsArr[0].replace("{n}",maxOptions),maxTxtGrp=maxOptionsArr[1].replace("{n}",maxOptionsGrp),$notify=$('<div class="notify"><\/div>');maxOptionsArr[2]&&(maxTxt=maxTxt.replace("{var}",maxOptionsArr[2][maxOptions>1?0:1]),maxTxtGrp=maxTxtGrp.replace("{var}",maxOptionsArr[2][maxOptionsGrp>1?0:1]));$option.prop("selected",!1);that.$menu.append($notify);maxOptions&&maxReached&&($notify.append($("<div>"+maxTxt+"<\/div>")),that.$element.trigger("maxReached.bs.select"));maxOptionsGrp&&maxReachedGrp&&($notify.append($("<div>"+maxTxtGrp+"<\/div>")),that.$element.trigger("maxReachedGrp.bs.select"));setTimeout(function(){that.setSelected(clickedIndex,!1)},10);$notify.delay(750).fadeOut(300,function(){$(this).remove()})}}}else $options.prop("selected",!1),$option.prop("selected",!0),that.$menu.find(".selected").removeClass("selected"),that.setSelected(clickedIndex,!0);that.multiple?that.options.liveSearch&&that.$searchbox.focus():that.$button.focus();(prevValue!=that.$element.val()&&that.multiple||prevIndex!=that.$element.prop("selectedIndex")&&!that.multiple)&&(that.$element.change(),that.$element.trigger("changed.bs.select",[clickedIndex,$option.prop("selected"),state]))}});this.$menu.on("click","li.disabled a, .popover-title, .popover-title :not(.close)",function(e){e.currentTarget==this&&(e.preventDefault(),e.stopPropagation(),that.options.liveSearch&&!$(e.target).hasClass("close")?that.$searchbox.focus():that.$button.focus())});this.$menu.on("click","li.divider, li.dropdown-header",function(e){e.preventDefault();e.stopPropagation();that.options.liveSearch?that.$searchbox.focus():that.$button.focus()});this.$menu.on("click",".popover-title .close",function(){that.$button.click()});this.$searchbox.on("click",function(e){e.stopPropagation()});this.$menu.on("click",".actions-btn",function(e){that.options.liveSearch?that.$searchbox.focus():that.$button.focus();e.preventDefault();e.stopPropagation();$(this).hasClass("bs-select-all")?that.selectAll():that.deselectAll();that.$element.change()});this.$element.change(function(){that.render(!1)})},liveSearchListener:function(){var that=this,$no_results=$('<li class="no-results"><\/li>');this.$newElement.on("click.dropdown.data-api touchstart.dropdown.data-api",function(){that.$menuInner.find(".active").removeClass("active");!that.$searchbox.val()||(that.$searchbox.val(""),that.$lis.not(".is-hidden").removeClass("hidden"),!$no_results.parent().length||$no_results.remove());that.multiple||that.$menuInner.find(".selected").addClass("active");setTimeout(function(){that.$searchbox.focus()},10)});this.$searchbox.on("click.dropdown.data-api focus.dropdown.data-api touchend.dropdown.data-api",function(e){e.stopPropagation()});this.$searchbox.on("input propertychange",function(){if(that.$searchbox.val()){var $searchBase=that.$lis.not(".is-hidden").removeClass("hidden").children("a");$searchBase=that.options.liveSearchNormalize?$searchBase.not(":a"+that._searchStyle()+"("+normalizeToBase(that.$searchbox.val())+")"):$searchBase.not(":"+that._searchStyle()+"("+that.$searchbox.val()+")");$searchBase.parent().addClass("hidden");that.$lis.filter(".dropdown-header").each(function(){var $this=$(this),optgroup=$this.data("optgroup");that.$lis.filter("[data-optgroup="+optgroup+"]").not($this).not(".hidden").length===0&&($this.addClass("hidden"),that.$lis.filter("[data-optgroup="+optgroup+"div]").addClass("hidden"))});var $lisVisible=that.$lis.not(".hidden");$lisVisible.each(function(index){var $this=$(this);$this.hasClass("divider")&&($this.index()===$lisVisible.eq(0).index()||$this.index()===$lisVisible.last().index()||$lisVisible.eq(index+1).hasClass("divider"))&&$this.addClass("hidden")});that.$lis.not(".hidden, .no-results").length?!$no_results.parent().length||$no_results.remove():(!$no_results.parent().length||$no_results.remove(),$no_results.html(that.options.noneResultsText.replace("{0}",'"'+htmlEscape(that.$searchbox.val())+'"')).show(),that.$menuInner.append($no_results))}else that.$lis.not(".is-hidden").removeClass("hidden"),!$no_results.parent().length||$no_results.remove();that.$lis.filter(".active").removeClass("active");that.$lis.not(".hidden, .divider, .dropdown-header").eq(0).addClass("active").children("a").focus();$(this).focus()})},_searchStyle:function(){var style="icontains";switch(this.options.liveSearchStyle){case"begins":case"startsWith":style="ibegins"}return style},val:function(value){return typeof value!="undefined"?(this.$element.val(value),this.render(),this.$element):this.$element.val()},selectAll:function(){this.findLis();this.$element.find("option:enabled").not("[data-divider], [data-hidden]").prop("selected",!0);this.$lis.not(".divider, .dropdown-header, .disabled, .hidden").addClass("selected");this.render(!1)},deselectAll:function(){this.findLis();this.$element.find("option:enabled").not("[data-divider], [data-hidden]").prop("selected",!1);this.$lis.not(".divider, .dropdown-header, .disabled, .hidden").removeClass("selected");this.render(!1)},keydown:function(e){var $this=$(this),$parent=$this.is("input")?$this.parent().parent():$this.parent(),$items,that=$parent.data("this"),index,next,first,last,prev,nextPrev,prevIndex,isActive,selector=":not(.disabled, .hidden, .dropdown-header, .divider)",keyCodeMap={32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"};if(that.options.liveSearch&&($parent=$this.parent().parent()),that.options.container&&($parent=that.$menu),$items=$("[role=menu] li a",$parent),isActive=that.$menu.parent().hasClass("open"),!isActive&&(e.keyCode>=48&&e.keyCode<=57||event.keyCode>=65&&event.keyCode<=90)&&(that.options.container?that.$newElement.trigger("click"):(that.setSize(),that.$menu.parent().addClass("open"),isActive=!0),that.$searchbox.focus()),that.options.liveSearch&&(/(^9$|27)/.test(e.keyCode.toString(10))&&isActive&&that.$menu.find(".active").length===0&&(e.preventDefault(),that.$menu.parent().removeClass("open"),that.options.container&&that.$newElement.removeClass("open"),that.$button.focus()),$items=$("[role=menu] li:not(.disabled, .hidden, .dropdown-header, .divider)",$parent),$this.val()||/(38|40)/.test(e.keyCode.toString(10))||$items.filter(".active").length===0&&($items=that.$newElement.find("li"),$items=that.options.liveSearchNormalize?$items.filter(":a"+that._searchStyle()+"("+normalizeToBase(keyCodeMap[e.keyCode])+")"):$items.filter(":"+that._searchStyle()+"("+keyCodeMap[e.keyCode]+")"))),$items.length){if(/(38|40)/.test(e.keyCode.toString(10)))index=$items.index($items.filter(":focus")),first=$items.parent(selector).first().data("originalIndex"),last=$items.parent(selector).last().data("originalIndex"),next=$items.eq(index).parent().nextAll(selector).eq(0).data("originalIndex"),prev=$items.eq(index).parent().prevAll(selector).eq(0).data("originalIndex"),nextPrev=$items.eq(next).parent().prevAll(selector).eq(0).data("originalIndex"),that.options.liveSearch&&($items.each(function(i){$(this).hasClass("disabled")||$(this).data("index",i)}),index=$items.index($items.filter(".active")),first=$items.first().data("index"),last=$items.last().data("index"),next=$items.eq(index).nextAll().eq(0).data("index"),prev=$items.eq(index).prevAll().eq(0).data("index"),nextPrev=$items.eq(next).prevAll().eq(0).data("index")),prevIndex=$this.data("prevIndex"),e.keyCode==38?(that.options.liveSearch&&(index-=1),index!=nextPrev&&index>prev&&(index=prev),index<first&&(index=first),index==prevIndex&&(index=last)):e.keyCode==40&&(that.options.liveSearch&&(index+=1),index==-1&&(index=0),index!=nextPrev&&index<next&&(index=next),index>last&&(index=last),index==prevIndex&&(index=first)),$this.data("prevIndex",index),that.options.liveSearch?(e.preventDefault(),$this.hasClass("dropdown-toggle")||($items.removeClass("active").eq(index).addClass("active").children("a").focus(),$this.focus())):$items.eq(index).focus();else if(!$this.is("input")){var keyIndex=[],count,prevKey;$items.each(function(){$(this).parent().hasClass("disabled")||$.trim($(this).text().toLowerCase()).substring(0,1)==keyCodeMap[e.keyCode]&&keyIndex.push($(this).parent().index())});count=$(document).data("keycount");count++;$(document).data("keycount",count);prevKey=$.trim($(":focus").text().toLowerCase()).substring(0,1);prevKey!=keyCodeMap[e.keyCode]?(count=1,$(document).data("keycount",count)):count>=keyIndex.length&&($(document).data("keycount",0),count>keyIndex.length&&(count=1));$items.eq(keyIndex[count-1]).focus()}if((/(13|32)/.test(e.keyCode.toString(10))||/(^9$)/.test(e.keyCode.toString(10))&&that.options.selectOnTab)&&isActive){if(/(32)/.test(e.keyCode.toString(10))||e.preventDefault(),that.options.liveSearch)/(32)/.test(e.keyCode.toString(10))||(that.$menu.find(".active a").click(),$this.focus());else{var elem=$(":focus");elem.click();elem.focus();e.preventDefault();$(document).data("spaceSelect",!0)}$(document).data("keycount",0)}(/(^9$|27)/.test(e.keyCode.toString(10))&&isActive&&(that.multiple||that.options.liveSearch)||/(27)/.test(e.keyCode.toString(10))&&!isActive)&&(that.$menu.parent().removeClass("open"),that.options.container&&that.$newElement.removeClass("open"),that.$button.focus())}},mobile:function(){this.$element.addClass("mobile-device").appendTo(this.$newElement);this.options.container&&this.$menu.hide()},refresh:function(){this.$lis=null;this.reloadLi();this.render();this.checkDisabled();this.liHeight(!0);this.setStyle();this.setWidth();this.$lis&&this.$searchbox.trigger("propertychange");this.$element.trigger("refreshed.bs.select")},hide:function(){this.$newElement.hide()},show:function(){this.$newElement.show()},remove:function(){this.$newElement.remove();this.$element.remove()}};function Plugin(option,event){var args=arguments,_option=option,_event=event;[].shift.apply(args);var value,chain=this.each(function(){var $this=$(this);if($this.is("select")){var data=$this.data("selectpicker"),options=typeof _option=="object"&&_option;if(data){if(options)for(var i in options)options.hasOwnProperty(i)&&(data.options[i]=options[i])}else{var config=$.extend({},Selectpicker.DEFAULTS,$.fn.selectpicker.defaults||{},$this.data(),options);$this.data("selectpicker",data=new Selectpicker(this,config,_event))}typeof _option=="string"&&(value=data[_option]instanceof Function?data[_option].apply(data,args):data.options[_option])}});return typeof value!="undefined"?value:chain}var old=$.fn.selectpicker;$.fn.selectpicker=Plugin;$.fn.selectpicker.Constructor=Selectpicker;$.fn.selectpicker.noConflict=function(){return $.fn.selectpicker=old,this};$(document).data("keycount",0).on("keydown",'.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="menu"], .bs-searchbox input',Selectpicker.prototype.keydown).on("focusin.modal",'.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="menu"], .bs-searchbox input',function(e){e.stopPropagation()});$(window).on("load.bs.select.data-api",function(){$(".selectpicker").each(function(){var $selectpicker=$(this);Plugin.call($selectpicker,$selectpicker.data())})})}(jQuery);;
