map-core-func 0.1.82 → 0.1.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -158,4 +158,4 @@ and limitations under the License.
|
|
|
158
158
|
* maptalks.animatemarker v0.4.1
|
|
159
159
|
* LICENSE : MIT
|
|
160
160
|
* (c) 2016-2017 maptalks.org
|
|
161
|
-
*/function UM(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function GM(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}function zM(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):function(t,e){for(var r=Object.getOwnPropertyNames(e),n=0;n<r.length;n++){var i=r[n],o=Object.getOwnPropertyDescriptor(e,i);o&&o.configurable&&void 0===t[i]&&Object.defineProperty(t,i,o)}}(t,e))}var VM,jM={markerType:"ellipse",markerFill:(VM=[135,196,240],{type:"radial",colorStops:[[.7,"rgba("+VM.join()+", 0.5)"],[.3,"rgba("+VM.join()+", 1)"],[.2,"rgba("+VM.join()+", 1)"],[0,"rgba("+VM.join()+", 0)"]]}),markerFillOpacity:.8,markerLineWidth:0,markerWidth:16,markerHeight:16},HM=function(e){function r(){return UM(this,r),GM(this,e.apply(this,arguments))}return zM(r,e),r.prototype.addGeometry=function(r){return r instanceof t.Geometry&&(r=[r]),r.forEach((function(e,r){if(!(e instanceof t.Marker))throw new Error("The geometry at "+r+" to add is not a maptalks.Marker")})),e.prototype.addGeometry.apply(this,arguments)},r.fromJSON=function(e){if(!e||"AnimateMarkerLayer"!==e.type)return null;for(var n=new r(e.id,e.options),i=e.geometries,o=[],s=0;s<i.length;s++){var a=t.Geometry.fromJSON(i[s]);a&&o.push(a)}return n.addGeometry(o),e.style&&n.setStyle(e.style),n},r}(t.VectorLayer);HM.mergeOptions({animation:"scale,fade",randomAnimation:!0,animationDuration:3e3}),HM.registerJSONType("AnimateMarkerLayer"),HM.registerRenderer("canvas",function(e){function r(){return UM(this,r),GM(this,e.apply(this,arguments))}return zM(r,e),r.prototype.draw=function(){this._needUpdate&&(this._prepare(),this._needUpdate=!1),this.prepareCanvas();var t=this.getMap(),e=this._currentMarkers;this._drawnExtent&&t.getExtent().equals(this._drawnExtent)&&(e=this._drawnMarkers),this._drawAllMarkers(e),this._drawnExtent=t.getExtent(),this.layer.isLoaded()||this.completeRender()},r.prototype.drawOnInteracting=function(){this._drawnMarkers&&0!==this._drawnMarkers.length&&this._drawAllMarkers(this._drawnMarkers)},r.prototype.needToRedraw=function(){return!!this.layer.options.animation||e.prototype.needToRedraw.call(this)},r.prototype.onCanvasCreate=function(){this._prepare()},r.prototype.onGeometryAdd=function(){this._redraw()},r.prototype.onGeometryRemove=function(){this._redraw()},r.prototype.onGeometrySymbolChange=function(){this._redraw()},r.prototype.onGeometryPositionChange=function(){this._redraw()},r.prototype.onGeometryShow=function(){this._redraw()},r.prototype.onGeometryHide=function(){this._redraw()},r.prototype.onGeometryPropertiesChange=function(t){if(t&&this.layer.getStyle())for(var e=0;e<t.length;e++)this.layer._styleGeometry(t[e])},r.prototype._redraw=function(){delete this._drawnMarkers,delete this._drawnExtent,this._needUpdate=!0},r.prototype._drawAllMarkers=function(t){var e=this,r=this.getMap(),n=r.getContainerExtent(),i=this._drawnTime=Date.now(),o=this._drawnAnim=this._getAnimation(),s=t!==this._drawnMarkers;s&&(this._drawnMarkers=[]),t.forEach((function(t){if(s){if(t.g.isVisible()){var a=r._prjToContainerPoint(t.coordinates);n.contains(a)&&(e._drawMarker(t,a,o,i),e._drawnMarkers.push(t))}}else{var u=r._prjToContainerPoint(t.coordinates);e._drawMarker(t,u,o,i)}}),this)},r.prototype._drawMarker=function(t,e,r,n){var i=this.layer.options.animationDuration,o=this.context,s=o.globalAlpha,a=(n-t.start)%i/i,u=r.fade&&a>=.5?2-2*a:1,l=r.scale?a:1,c=t.cacheKey,h=this._spriteCache[c],f=h.offset,p=h.canvas.width,g=h.canvas.height;h&&u>0&&(o.globalAlpha=s*u,o.drawImage(h.canvas,e.x+f.x-p*l/2,e.y+f.y-g*l/2,p*l,g*l),o.globalAlpha=s)},r.prototype._prepare=function(){var t=this,e=[],r={},n=this.getMap().getProjection();this.layer.forEach((function(i){t._currentGeo=i;var o=i._getInternalSymbol()===i.options.symbol?jM:i._getInternalSymbol(),s=JSON.stringify(o);r[s]||(r[s]=o),e.push({coordinates:n.project(i.getCoordinates()),cacheKey:s,start:t.layer.options.randomAnimation?Math.random()*t.layer.options.animationDuration:0,g:i})})),this._prepareSprites(r),this._currentMarkers=e},r.prototype._prepareSprites=function(e){for(var r in this._spriteCache={},e){var n=e[r],i=new t.Marker([0,0],{symbol:n})._getSprite(this.resources);this._spriteCache[r]=i}},r.prototype.onRemove=function(){delete this._spriteCache,delete this._currentMarkers,delete this._drawnMarkers,delete this._drawnExtent},r.prototype._getAnimation=function(){for(var t,e={fade:!1,scale:!1},r=this.layer.options.animation?this.layer.options.animation.split(","):[],n=0;n<r.length;n++){var i=(t=r[n]).trim?t.trim():t.replace(/^\s+|\s+$/g,"");"fade"===i?e.fade=!0:"scale"===i&&(e.scale=!0)}return e},r}(t.renderer.OverlayLayerCanvasRenderer)),"undefined"!=typeof console&&console.log("maptalks.animatemarker v0.4.1, requires maptalks@>=0.25.0.");var qM=function(){function t(e,r,n){c(this,t),this.map=n;var o=r.color||[255,0,0],s=r.opacity||.8,a=r.width||20,u=r.height||20,l=r.animationDuration||3e3,h=r.markerDx||0,f=r.markerDy||0,p=i.GeoJSON.toGeometry(e);this.layer=new HM(i.Util.GUID(),p,{animation:"scale,fade",animationDuration:l,randomAnimation:!0,geometryEvents:!1,hitDetect:!1}).setStyle([{symbol:{markerType:"ellipse",markerLineWidth:0,markerFill:this.getGradient(o),markerFillOpacity:s,markerWidth:a,markerHeight:u,markerDx:h,markerDy:f}}]).addTo(n)}return f(t,[{key:"getGradient",value:function(t){return{type:"radial",colorStops:[[.7,"rgba("+t.join()+", 0.5)"],[.3,"rgba("+t.join()+", 1)"],[.2,"rgba("+t.join()+", 1)"],[0,"rgba("+t.join()+", 0)"]]}}},{key:"hide",value:function(){var t;null===(t=this.layer)||void 0===t||t.hide()}},{key:"show",value:function(){this.layer.show()}},{key:"setZIndex",value:function(t){this.layer.setZIndex(t)}},{key:"dispose",value:function(){this.map.removeLayer(this.layer),delete this.layer}}]),t}();const YM=Object.prototype.hasOwnProperty,XM="undefined"!=typeof Symbol?Symbol.toStringTag:void 0;function WM(t){if(!function(t){const e=typeof t;return null!==t&&("object"===e||"function"===e)}(t))return!1;const e=function(t){if(null===t)return void 0===t?"[object Undefined]":"[object Null]";if(!XM||!(XM in Object(t)))return toString.call(t);const e=YM.call(t,XM),r=t[XM];let n=!1;try{t[XM]=void 0,n=!0}catch(t){}const i=Object.prototype.toString.call(t);return n&&(e?t[XM]=r:delete t[XM]),i}(t);return"[object Function]"===e||"[object AsyncFunction]"===e||"[object GeneratorFunction]"===e||"[object Proxy]"===e}function JM(t){return"[object Number]"===Object.prototype.toString.call(t)&&!isNaN(t)}function KM(t,...e){return Object.assign(t,...e)}const ZM={};function $M(t,e){ZM[e]||(!function(t,e){console.warn(`${e||"wind-layer"}: ${t}`)}(e,t),ZM[e]=!0)}function tT(t){return null!=t&&!isNaN(t)}class eT{constructor(t,e){this.u=t,this.v=e,this.m=this.magnitude()}magnitude(){return Math.sqrt(this.u**2+this.v**2)}directionTo(){let t=Math.atan2(this.u,this.v)*(180/Math.PI);return t<0&&(t+=360),t}directionFrom(){return(this.directionTo()+180)%360}}class rT{constructor(t){this.grid=[],this.xmin=t.xmin,this.xmax=t.xmax,this.ymin=t.ymin,this.ymax=t.ymax,this.cols=t.cols,this.rows=t.rows,this.us=t.us,this.vs=t.vs,this.deltaX=t.deltaX,this.deltaY=t.deltaY,this.flipY=Boolean(t.flipY),this.ymin=Math.min(t.ymax,t.ymin),this.ymax=Math.max(t.ymax,t.ymin),this.deltaY<0&&this.ymin<this.ymax||(void 0===t.flipY&&(this.flipY=!0),console.warn("[wind-core]: The data is flipY")),this.isFields=!0;const e=Math.ceil((this.xmax-this.xmin)/t.deltaX),r=Math.ceil((this.ymax-this.ymin)/t.deltaY);e===this.cols&&r===this.rows||console.warn("[wind-core]: The data grid not equal"),this.isContinuous=Math.floor(this.cols*t.deltaX)>=360,this.translateX="translateX"in t?t.translateX:this.xmax>180,"wrappedX"in t&&$M("[wind-core]: ","`wrappedX` namespace will deprecated please use `translateX` instead!"),this.wrapX=Boolean(t.wrapX),this.grid=this.buildGrid(),this.range=this.calculateRange()}buildGrid(){let t=[],e=0;const{rows:r,cols:n,us:i,vs:o}=this;for(let s=0;s<r;s++){const r=[];for(let t=0;t<n;t++,e++){let n=i[e],s=o[e],a=this.isValid(n)&&this.isValid(s);r[t]=a?new eT(n,s):null}this.isContinuous&&r.push(r[0]),t[s]=r}return t}release(){this.grid=[]}extent(){return[this.xmin,this.ymin,this.xmax,this.ymax]}bilinearInterpolateVector(t,e,r,n,i,o){const s=1-t,a=1-e,u=s*a,l=t*a,c=s*e,h=t*e,f=r.u*u+n.u*l+i.u*c+o.u*h,p=r.v*u+n.v*l+i.v*c+o.v*h;return new eT(f,p)}calculateRange(){if(!this.grid||!this.grid[0])return;const t=this.grid.length,e=this.grid[0].length;let r,n;for(let i=0;i<t;i++)for(let t=0;t<e;t++){const e=this.grid[i][t];if(null!==e){const t=e.m||e.magnitude();void 0===r?r=t:void 0===n?(n=t,r=Math.min(r,n),n=Math.max(r,n)):(r=Math.min(t,r),n=Math.max(t,n))}}return[r,n]}isValid(t){return null!=t}getWrappedLongitudes(){let t=this.xmin,e=this.xmax;return this.translateX&&(this.isContinuous?(t=-180,e=180):(e=this.xmax-360,t=this.xmin-360)),[t,e]}contains(t,e){const[r,n]=this.getWrappedLongitudes();let i,o=t>=r&&t<=n;return i=this.deltaY>=0?e>=this.ymin&&e<=this.ymax:e>=this.ymax&&e<=this.ymin,o&&i}getDecimalIndexes(t,e){const r=function(t,e){return t-e*Math.floor(t/e)}(t-this.xmin,360)/this.deltaX;if(this.flipY){return[r,(this.ymax-e)/this.deltaY]}return[r,(this.ymin+e)/this.deltaY]}valueAt(t,e){let r=!1;if((this.wrapX||this.contains(t,e))&&(r=!0),!r)return null;const n=this.getDecimalIndexes(t,e);let i=Math.floor(n[0]),o=Math.floor(n[1]);const s=this.clampColumnIndex(i),a=this.clampRowIndex(o);return this.valueAtIndexes(s,a)}interpolatedValueAt(t,e){let r=!1;if((this.wrapX||this.contains(t,e))&&(r=!0),!r)return null;let[n,i]=this.getDecimalIndexes(t,e);return this.interpolatePoint(n,i)}hasValueAt(t,e){return null!==this.valueAt(t,e)}interpolatePoint(t,e){const r=this.getFourSurroundingIndexes(t,e),[n,i,o,s]=r;let a=this.getFourSurroundingValues(n,i,o,s);if(a){const[r,i,s,u]=a;return this.bilinearInterpolateVector(t-n,e-o,r,i,s,u)}return null}clampColumnIndex(t){let e=t;t<0&&(e=0);let r=this.cols-1;return t>r&&(e=r),e}clampRowIndex(t){let e=t;t<0&&(e=0);let r=this.rows-1;return t>r&&(e=r),e}getFourSurroundingIndexes(t,e){let r=Math.floor(t),n=r+1;this.isContinuous&&n>=this.cols&&(n=0),n=this.clampColumnIndex(n);let i=this.clampRowIndex(Math.floor(e));return[r,n,i,this.clampRowIndex(i+1)]}getFourSurroundingValues(t,e,r,n){let i;if(i=this.grid[r]){const r=i[t],o=i[e];if(this.isValid(r)&&this.isValid(o)&&(i=this.grid[n])){const n=i[t],s=i[e];if(this.isValid(n)&&this.isValid(s))return[r,o,n,s]}}return null}valueAtIndexes(t,e){return this.grid[e][t]}lonLatAtIndexes(t,e){return[this.longitudeAtX(t),this.latitudeAtY(e)]}longitudeAtX(t){let e=this.deltaX/2,r=this.xmin+e+t*this.deltaX;return this.translateX&&(r=r>180?r-360:r),r}latitudeAtY(t){let e=this.deltaY/2;return this.ymax-e-t*this.deltaY}randomize(t={},e,r,n){let i=Math.random()*(e||this.cols)|0,o=Math.random()*(r||this.rows)|0;const s=n([i,o]);return null!==s?(t.x=s[0],t.y=s[1]):(t.x=this.longitudeAtX(i),t.y=this.latitudeAtY(o)),t}checkFields(){return this.isFields}}const nT={globalAlpha:.9,lineWidth:1,colorScale:"#fff",velocityScale:.04,maxAge:90,paths:800,frameRate:20,useCoordsDraw:!0,gpet:!0};function iT(t,e,r,n){return Math.max(0,Math.min(n.length-1,Math.round((t-e)/(r-e)*(n.length-1))))}class oT{constructor(t,e,r){if(this.particles=[],this.generated=!1,this.ctx=t,!this.ctx)throw new Error("ctx error");this.animate=this.animate.bind(this),this.setOptions(e),r&&this.updateData(r)}setOptions(t){this.options={...nT,...t};const{width:e,height:r}=this.ctx.canvas;"particleAge"in t&&!("maxAge"in t)&&JM(this.options.particleAge)&&(this.options.maxAge=this.options.particleAge),"particleMultiplier"in t&&!("paths"in t)&&JM(this.options.particleMultiplier)&&(this.options.paths=Math.round(e*r*this.options.particleMultiplier)),this.prerender()}getOptions(){return this.options}updateData(t){this.field=t,this.generated&&(this.particles=this.prepareParticlePaths())}project(...t){throw new Error("project must be overriden")}unproject(...t){throw new Error("unproject must be overriden")}intersectsCoordinate(t){throw new Error("must be overriden")}clearCanvas(){this.stop(),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.forceStop=!1}start(){this.starting=!0,this.forceStop=!1,this.then=Date.now(),this.animate()}stop(){cancelAnimationFrame(this.animationLoop),this.starting=!1,this.forceStop=!0}animate(){this.animationLoop&&cancelAnimationFrame(this.animationLoop),this.animationLoop=requestAnimationFrame(this.animate);const t=Date.now(),e=t-this.then;e>this.options.frameRate&&(this.then=t-e%this.options.frameRate,this.render())}prerender(){this.generated=!1,this.field&&(this.particles=this.prepareParticlePaths(),this.generated=!0,this.starting||this.forceStop||(this.starting=!0,this.then=Date.now(),this.animate()))}render(){this.moveParticles(),this.drawParticles(),this.postrender()}postrender(){}moveParticles(){const{width:t,height:e}=this.ctx.canvas,r=this.particles,n=this.options.maxAge,i=WM(this.options.velocityScale)?this.options.velocityScale():this.options.velocityScale;let o=0;const s=r.length;for(;o<s;o++){const s=r[o];s.age>n&&(s.age=0,this.field.randomize(s,t,e,this.unproject));const a=s.x,u=s.y,l=this.field.interpolatedValueAt(a,u);if(null===l)s.age=n;else{const t=a+l.u*i,e=u+l.v*i;this.field.hasValueAt(t,e)?(s.xt=t,s.yt=e,s.m=l.m):(s.x=t,s.y=e,s.age=n)}s.age++}}fadeIn(){const t=this.ctx.globalCompositeOperation;this.ctx.globalCompositeOperation="destination-in",this.ctx.fillRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.globalCompositeOperation=t}drawParticles(){const t=this.particles;var e;this.fadeIn(),this.ctx.globalAlpha=this.options.globalAlpha,this.ctx.fillStyle=`rgba(0, 0, 0, ${this.options.globalAlpha})`,this.ctx.lineWidth=JM(this.options.lineWidth)?this.options.lineWidth:1,this.ctx.strokeStyle=null!=(e=this.options.colorScale)&&("string"==typeof e||null!==e.constructor&&e.constructor===String)?this.options.colorScale:"#fff";let r=0;const n=t.length;if(this.field&&n>0){let e,i;for(tT(this.options.minVelocity)&&tT(this.options.maxVelocity)?(e=this.options.minVelocity,i=this.options.maxVelocity):[e,i]=this.field.range;r<n;r++)this[this.options.useCoordsDraw?"drawCoordsParticle":"drawPixelParticle"](t[r],e,i)}}drawPixelParticle(t,e,r){const n=[t.x,t.y],i=[t.xt,t.yt];if(i&&n&&tT(i[0])&&tT(i[1])&&tT(n[0])&&tT(n[1])&&t.age<=this.options.maxAge){if(this.ctx.beginPath(),this.ctx.moveTo(n[0],n[1]),this.ctx.lineTo(i[0],i[1]),WM(this.options.colorScale))this.ctx.strokeStyle=this.options.colorScale(t.m);else if(Array.isArray(this.options.colorScale)){const n=iT(t.m,e,r,this.options.colorScale);this.ctx.strokeStyle=this.options.colorScale[n]}WM(this.options.lineWidth)&&(this.ctx.lineWidth=this.options.lineWidth(t.m)),t.x=t.xt,t.y=t.yt,this.ctx.stroke()}}drawCoordsParticle(t,e,r){const n=[t.x,t.y],i=[t.xt,t.yt];if(i&&n&&tT(i[0])&&tT(i[1])&&tT(n[0])&&tT(n[1])&&this.intersectsCoordinate(i)&&t.age<=this.options.maxAge){const o=this.project(n),s=this.project(i);if(o&&s){if(this.ctx.beginPath(),this.ctx.moveTo(o[0],o[1]),this.ctx.lineTo(s[0],s[1]),t.x=t.xt,t.y=t.yt,WM(this.options.colorScale))this.ctx.strokeStyle=this.options.colorScale(t.m);else if(Array.isArray(this.options.colorScale)){const n=iT(t.m,e,r,this.options.colorScale);this.ctx.strokeStyle=this.options.colorScale[n]}WM(this.options.lineWidth)&&(this.ctx.lineWidth=this.options.lineWidth(t.m)),this.ctx.stroke()}}}prepareParticlePaths(){const{width:t,height:e}=this.ctx.canvas,r="function"==typeof this.options.paths?this.options.paths(this):this.options.paths,n=[];if(!this.field)return[];let i=0;for(;i<r;i++)n.push(this.field.randomize({age:this.randomize()},t,e,this.unproject));return n}randomize(){return Math.floor(Math.random()*this.options.maxAge)}}oT.Field=rT;var sT=null;try{var aT="undefined"!=typeof module&&"function"==typeof module.require&&module.require("worker_threads")||"function"==typeof __non_webpack_require__&&__non_webpack_require__("worker_threads")||"function"==typeof require&&require("worker_threads");sT=aT.Worker}catch(t){}function uT(t,e,r){var n=void 0===e?null:e,i=function(t,e){return Buffer.from(t,"base64").toString(e?"utf16":"utf8")}(t,void 0!==r&&r),o=i.indexOf("\n",10)+1,s=i.substring(o)+(n?"//# sourceMappingURL="+n:"");return function(t){return new sT(s,Object.assign({},t,{eval:!0}))}}function lT(t,e,r){var n=void 0===e?null:e,i=function(t,e){var r=atob(t);if(e){for(var n=new Uint8Array(r.length),i=0,o=r.length;i<o;++i)n[i]=r.charCodeAt(i);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}(t,void 0!==r&&r),o=i.indexOf("\n",10)+1,s=i.substring(o)+(n?"//# sourceMappingURL="+n:""),a=new Blob([s],{type:"application/javascript"});return URL.createObjectURL(a)}var cT="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);var hT,fT,pT,gT=(hT="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICd1c2Ugc3RyaWN0JzsKCiAgZnVuY3Rpb24gY2FsY01pbk1heChhcnJheSkgewogICAgbGV0IG1pbiA9IEluZmluaXR5OwogICAgbGV0IG1heCA9IEluZmluaXR5OwogICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcnJheS5sZW5ndGg7IGkrKykgewogICAgICBjb25zdCB2YWwgPSBhcnJheVtpXTsKICAgICAgaWYgKG1pbiA9PT0gSW5maW5pdHkpIHsKICAgICAgICBtaW4gPSB2YWw7CiAgICAgIH0gZWxzZSBpZiAobWF4ID09PSBJbmZpbml0eSkgewogICAgICAgIG1heCA9IHZhbDsKICAgICAgICBtaW4gPSBNYXRoLm1pbihtaW4sIG1heCk7CiAgICAgICAgbWF4ID0gTWF0aC5tYXgobWluLCBtYXgpOwogICAgICB9IGVsc2UgewogICAgICAgIG1pbiA9IE1hdGgubWluKHZhbCwgbWluKTsKICAgICAgICBtYXggPSBNYXRoLm1heCh2YWwsIG1heCk7CiAgICAgIH0KICAgIH0KICAgIHJldHVybiBbbWluLCBtYXhdOwogIH0KCiAgY29uc3QgY3R4ID0gc2VsZjsKICBjdHguYWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsIGFzeW5jICh7IGRhdGE6IHBheWxvYWQgfSkgPT4gewogICAgY29uc3QgcmVuZGVyRm9ybSA9IHBheWxvYWRbMF07CiAgICBpZiAocmVuZGVyRm9ybSA9PT0gInJnIikgewogICAgICBjb25zdCB1RGF0YSA9IHBheWxvYWRbMV07CiAgICAgIGNvbnN0IHZEYXRhID0gcGF5bG9hZFsyXTsKICAgICAgY29uc3QgW3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idWZmZXIsIG1pbiwgbWF4XSwgW3ZlbG9jaXR5RGF0YS5idWZmZXJdKTsKICAgIH0KICB9KTsKCn0pKCk7Ci8vIyBzb3VyY2VNYXBwaW5nVVJMPURhdGFQcm9jZXNzZS5qcy5tYXAKCg==",fT="data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRGF0YVByb2Nlc3NlLmpzIiwic291cmNlcyI6WyJ3b3JrZXI6Ly93ZWItd29ya2VyL3V0aWxzL2NvbW1vbi50cyIsIndvcmtlcjovL3dlYi13b3JrZXIvd29ya2Vycy9EYXRhUHJvY2Vzc2UudHMiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGZ1bmN0aW9uIGNhbGNNaW5NYXgoYXJyYXk6IG51bWJlcltdKTogW251bWJlciwgbnVtYmVyXSB7XG4gIGxldCBtaW4gPSBJbmZpbml0eTtcbiAgbGV0IG1heCA9IEluZmluaXR5O1xuICAvLyBAZnJvbTogaHR0cHM6Ly9zdGFja292ZXJmbG93LmNvbS9xdWVzdGlvbnMvMTM1NDQ0NzYvaG93LXRvLWZpbmQtbWF4LWFuZC1taW4taW4tYXJyYXktdXNpbmctbWluaW11bS1jb21wYXJpc29uc1xuICBmb3IgKGxldCBpID0gMDsgaSA8IGFycmF5Lmxlbmd0aDsgaSsrKSB7XG4gICAgY29uc3QgdmFsID0gYXJyYXlbaV07XG5cbiAgICBpZiAobWluID09PSBJbmZpbml0eSkge1xuICAgICAgbWluID0gdmFsO1xuICAgIH0gZWxzZSBpZiAobWF4ID09PSBJbmZpbml0eSkge1xuICAgICAgbWF4ID0gdmFsO1xuICAgICAgLy8gdXBkYXRlIG1pbiBtYXhcbiAgICAgIC8vIDEuIFBpY2sgMiBlbGVtZW50cyhhLCBiKSwgY29tcGFyZSB0aGVtLiAoc2F5IGEgPiBiKVxuICAgICAgbWluID0gTWF0aC5taW4obWluLCBtYXgpO1xuICAgICAgbWF4ID0gTWF0aC5tYXgobWluLCBtYXg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sR0FBQSxDQUFBLENBQUE7RUFDL0MsTUFBYSxZQUFBLENBQUEsR0FBQSxDQUFJLENBQUMsQ0FBRyxFQUFBLENBQUEsRUFBRyxHQUFHLEdBQUcsQ0FBQSxFQUFHLElBQUksQ0FBQyxDQUFBLENBQUE7RUFBQSxLQUN4QztFQUVBLElBQUksR0FBQSxDQUFBLFdBQUEsQ0FBWSxDQUFDLFlBQUEsQ0FBYSxNQUFRLEVBQUEsR0FBQSxFQUFLLEdBQUcsQ0FBRyxFQUFBLENBQUMsWUFBYSxDQUFBLE1BQU0sQ0FBQyxDQUFBLENBQUE7RUFBQSxHQUN4RTtFQUNGLENBQUMsQ0FBQTs7Ozs7OyJ9",pT=!1,cT?uT(hT,fT,pT):function(t,e,r){var n;return function(i){return n=n||lT(t,e,r),new Worker(n,i)}}(hT,fT,pT));function dT(t){return"number"==typeof t&&!isNaN(t)}function AT(t){return t-Math.fround(t)}function yT(t,e){if(!t)return!1;if(e=e||devicePixelRatio||1,t instanceof HTMLCanvasElement){const r=t.clientWidth*e,n=t.clientHeight*e;if(r<=0||n<=0)return!1;if(t.width!==r||t.height!==n)return t.width=r,t.height=n,!0}return!1}function vT(t,e,r){const n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS)){const e=t.getShaderInfoLog(n)||"";throw t.deleteShader(n),new Error(e)}return n}function mT(t,e,r,n,i){const o=t.createTexture();return t.bindTexture(t.TEXTURE_2D,o),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,e),r instanceof Uint8Array?t.texImage2D(t.TEXTURE_2D,0,t.RGBA,n,i,0,t.RGBA,t.UNSIGNED_BYTE,r):t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,r),t.bindTexture(t.TEXTURE_2D,null),o}function _T(t,e){const r=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,r),e&&t.bufferData(t.ARRAY_BUFFER,e,t.STATIC_DRAW),r}function IT(t,e,r=1,n=0,i){const[o,s,a,u]=e;let l=0;t.clearColor(o,s,a,u),l|=t.COLOR_BUFFER_BIT,void 0!==r&&(t.clearDepth(r),l|=t.DEPTH_BUFFER_BIT),void 0!==n&&(t.clearStencil(0|n),l|=t.STENCIL_BUFFER_BIT),t.clear(l)}class ET{constructor(t,e,r,n){this.vertShader="",this.fragShader="",e&&(this.vertShader=e),r&&(this.fragShader=r),this.program=function(t,e,r){const n=vT(t,t.VERTEX_SHADER,e),i=vT(t,t.FRAGMENT_SHADER,r),o=t.createProgram();if(null!==o&&(t.attachShader(o,n),t.attachShader(o,i),t.linkProgram(o),!t.getProgramParameter(o,t.LINK_STATUS)))throw new Error(t.getProgramInfoLog(o)||"");return o}(t,function(t,e={}){return Object.keys(e).map((r=>{e[r]&&(t=t.replace(new RegExp(r,"g"),`${e[r]} \n`))})),t}(this.vertShader,n),this.fragShader),this.gl=t,this.textureUnit=0,this.uniformSetters=this.createUniformSetters(),this.attribSetters=this.createAttributeSetters(),this.transfromStack=[]}active(){return this.gl.useProgram(this.program),this}deactive(){return this.gl.deleteProgram(this.program),this}getBindPointForSamplerType(t,e){return e===t.SAMPLER_2D?t.TEXTURE_2D:e===t.SAMPLER_CUBE?t.TEXTURE_CUBE_MAP:void 0}createUniformSetter(t,e){const{gl:r}=this,n=r.getUniformLocation(t,e.name),i=e.type,o=e.size>1&&"[0]"===e.name.substr(-3);if(i===r.FLOAT&&o)return function(t){r.uniform1fv(n,t)};if(i===r.FLOAT)return function(t){r.uniform1f(n,t)};if(i===r.FLOAT_VEC2)return function(t){r.uniform2fv(n,t)};if(i===r.FLOAT_VEC3)return function(t){r.uniform3fv(n,t)};if(i===r.FLOAT_VEC4)return function(t){r.uniform4fv(n,t)};if(i===r.INT&&o)return function(t){r.uniform1iv(n,t)};if(i===r.INT)return function(t){r.uniform1i(n,t)};if(i===r.INT_VEC2)return function(t){r.uniform2iv(n,t)};if(i===r.INT_VEC3)return function(t){r.uniform3iv(n,t)};if(i===r.INT_VEC4)return function(t){r.uniform4iv(n,t)};if(i===r.BOOL)return function(t){r.uniform1iv(n,t)};if(i===r.BOOL_VEC2)return function(t){r.uniform2iv(n,t)};if(i===r.BOOL_VEC3)return function(t){r.uniform3iv(n,t)};if(i===r.BOOL_VEC4)return function(t){r.uniform4iv(n,t)};if(i===r.FLOAT_MAT2)return function(t){r.uniformMatrix2fv(n,!1,t)};if(i===r.FLOAT_MAT3)return function(t){r.uniformMatrix3fv(n,!1,t)};if(i===r.FLOAT_MAT4)return function(t){r.uniformMatrix4fv(n,!1,t)};if((i===r.SAMPLER_2D||i===r.SAMPLER_CUBE)&&o){const t=[];for(let r=0;r<e.size;++r)t.push(this.textureUnit++);return s=this.getBindPointForSamplerType(r,i),a=t,function(t){r.uniform1iv(n,a),t.forEach((function(t,e){r.activeTexture(r.TEXTURE0+a[e]),void 0!==s&&r.bindTexture(s,t)}))}}var s,a;if(i===r.SAMPLER_2D||i===r.SAMPLER_CUBE)return function(t,e){return function(i){r.uniform1i(n,e),r.activeTexture(r.TEXTURE0+e),void 0!==t&&r.bindTexture(t,i)}}(this.getBindPointForSamplerType(r,i),this.textureUnit++);throw new Error("unknown type: 0x"+i.toString(16))}createUniformSetters(){const{gl:t}=this;this.textureUnit=0;const e={};if(null!==this.program){const r=t.getProgramParameter(this.program,t.ACTIVE_UNIFORMS);for(let n=0;n<r;++n){const r=t.getActiveUniform(this.program,n);if(!r)break;let i=r.name;"[0]"===i.substr(-3)&&(i=i.substr(0,i.length-3));const o=this.createUniformSetter(this.program,r);e[i]=o}}return e}createAttribSetter(t){const{gl:e}=this;return function(r){e.bindBuffer(e.ARRAY_BUFFER,r.buffer),e.enableVertexAttribArray(t),void 0===r.numComponents&&void 0===r.size||e.vertexAttribPointer(t,r.numComponents||r.size,r.type||e.FLOAT,r.normalize||!1,r.stride||0,r.offset||0)}}createAttributeSetters(){const{gl:t}=this,e={};if(null!==this.program){const r=t.getProgramParameter(this.program,t.ACTIVE_ATTRIBUTES);for(let n=0;n<r;++n){const r=t.getActiveAttrib(this.program,n);if(!r)break;const i=t.getAttribLocation(this.program,r.name);e[r.name]=this.createAttribSetter(i)}}return e}setAttributes(t,e){return e=e?e.attribSetters||e:this.attribSetters,Object.keys(t).forEach((function(r){const n=e[r];n&&n(t[r])})),this}setUniforms(t,e){return e=e?e.uniformSetters||e:this.uniformSetters,Object.keys(t).forEach((function(r){const n=e[r];n&&n(t[r])})),this}elements(t){return this.elementsBuffer||(this.elementsBuffer=this.gl.createBuffer()),this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this.elementsBuffer),t.data&&this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER,t.data,t.usage||this.gl.STATIC_DRAW),void 0!==t.count&&this.runTimes(t.count),t.primitive&&this.setPrimitive(t.primitive),this}clear(t){return IT(this.gl,t),this.transfromStack=[],this}runTimes(t){return this.count=t||0,this}setPrimitive(t){return this.primitive=t||this.gl.TRIANGLES,this}resize(t,e){return void 0===t||void 0===e?(yT(this.gl.canvas),this.gl.viewport(0,0,this.gl.canvas.width,this.gl.canvas.height)):this.gl.viewport(0,0,t,e),this}draw(){throw new Error("should override")}translate(){throw new Error("should override")}rotate(){throw new Error("should override")}scale(){throw new Error("should override")}destroyed(){throw new Error("should override")}}var xT="precision highp float;\n#define GLSLIFY 1\nuniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform vec2 u_image_res;uniform vec2 u_range;uniform vec2 u_color_range;uniform vec2 u_display_range;uniform float u_opacity;varying vec2 v_tex_pos;float calcTexture(const vec2 uv){return texture2D(u_image,uv).r;}float bilinear(const vec2 uv){vec2 px=1.0/u_image_res;vec2 vc=(floor(uv*u_image_res))*px;vec2 f=fract(uv*u_image_res);float tl=calcTexture(vc);float tr=calcTexture(vc+vec2(px.x,0));float bl=calcTexture(vc+vec2(0,px.y));float br=calcTexture(vc+px);return mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);}float getValue(const vec2 uv){float min=u_range.x;float max=u_range.y;float r=bilinear(uv);return r*(max-min)+min;}const float PI=3.14159265359;vec2 mercatorToWGS84(vec2 xy){float y=radians(180.0-xy.y*360.0);y=360.0/PI*atan(exp(y))-90.0;y=y/-180.0+0.5;return vec2(xy.x,y);}void main(){vec2 globalWGS84=mercatorToWGS84(v_tex_pos);float value=getValue(globalWGS84);float value_t=(value-u_color_range.x)/(u_color_range.y-u_color_range.x);vec2 ramp_pos=vec2(fract(16.0*value_t),floor(16.0*value_t)/16.0);vec4 color=texture2D(u_color_ramp,ramp_pos);bool display=value<u_display_range.y&&value>u_display_range.x;if(display){gl_FragColor=vec4(floor(255.0*color*u_opacity)/255.0);}else{gl_FragColor=vec4(0.0,0.0,0.0,0.0);}}",wT="#define GLSLIFY 1\nattribute vec3 instancePositions;attribute vec3 instancePositions64Low;attribute vec2 a_texCoord;uniform mat4 u_matrix;uniform vec4 u_cameraEye;uniform vec4 u_cameraEye64Low;uniform float u_offset;uniform sampler2D u_image;uniform vec2 u_image_res;uniform vec2 u_range;uniform vec2 u_mapping_range;varying vec2 v_tex_pos;varying float v_value;float calcTexture(const vec2 uv){return texture2D(u_image,uv).r;}float bilinear(const vec2 uv){vec2 px=1.0/u_image_res;vec2 vc=(floor(uv*u_image_res))*px;vec2 f=fract(uv*u_image_res);float tl=calcTexture(vc);float tr=calcTexture(vc+vec2(px.x,0));float bl=calcTexture(vc+vec2(0,px.y));float br=calcTexture(vc+px);return mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);}float getValue(const vec2 uv){float min=u_mapping_range.x;float max=u_mapping_range.y;float r=bilinear(uv);return r*(max-min)+min;}const float PI=3.14159265359;vec2 mercatorToWGS84(vec2 xy){float y=radians(180.0-xy.y*360.0);y=360.0/PI*atan(exp(y))-90.0;y=y/-180.0+0.5;return vec2(xy.x,y);}\n#modules-transformZ\nvoid main(){v_tex_pos=a_texCoord;vec2 globalWGS84=mercatorToWGS84(v_tex_pos);float value=getValue(globalWGS84);float z=transformZ(value,instancePositions);vec4 pos=vec4(instancePositions-u_cameraEye.xyz,0.0);pos+=vec4(instancePositions64Low-u_cameraEye64Low.xyz,0.0);\n#modules-project\n}";class CT extends ET{constructor(t,e,r,n){super(t,e||wT,r||xT,n||{}),this.vertShader=wT,this.fragShader=xT}draw(){if(void 0!==this.checkExt){const t=this.primitive||this.gl.TRIANGLES;this.checkExt?this.gl.drawElements(t,this.count,this.gl.UNSIGNED_INT,0):this.gl.drawElements(t,this.count,this.gl.UNSIGNED_SHORT,0)}else this.checkExt=this.gl.getExtension("OES_element_index_uint");return this}translate(){return this}rotate(){return this}scale(){return this}}function bT(t,e){const r=document.createElement("canvas"),n=r.getContext("2d");r.width=256,r.height=1;const{input:i}=function(t){if(Array.isArray(t)&&t.length>3){const e=t[0],r=t[1],n=[];for(let e=3;e<t.length;e+=2){const r=t[e],i=t[e+1];n.push({key:r,value:i})}return{operator:e,interpolation:{name:r[0],base:r[1]},input:n}}return console.warn("[wind-core]: style-parser style config invalid"),{}}(e);if(n&&i&&Array.isArray(i)){const e=i.map((t=>parseFloat(t.key))),r=[Math.min(...e),Math.max(...e)],[o,s]=[t[0]||r[0],t[1]||r[1]],a=n.createLinearGradient(0,0,256,0);for(let t=0;t<i.length;t+=1){const e=i[t].key,r=i[t].value;a.addColorStop((e-o)/(s-o),r)}return n.fillStyle=a,n.fillRect(0,0,256,1),{data:new Uint8Array(n.getImageData(0,0,256,1).data),colorRange:r}}return{}}function BT(t,e,r,n){const i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}const ST={};function MT(t,e,r,n,i){const o=`${t}_${r}`,s=n[r];if(dT(s))return ST[o]&&delete ST[o],s;if(s&&Array.isArray(s)&&(!ST[o]||i)&&(ST[o]=function(t){if(Array.isArray(t)&&t.length>3){const e=t[0],r=t[1],n=[];for(let e=3;e<t.length;e+=2){const r=t[e],i=t[e+1];n.push({key:r,value:i})}return{operator:e,interpolation:{name:r[0],base:r[1]},input:n}}return console.warn("[wind-core]: style-parser style config invalid"),{}}(s)),ST[o]){const{input:t,interpolation:r}=ST[o]||{};if(t&&Array.isArray(t)){const n=t.map((t=>t.key)),i=t.map((t=>t.value));if(e<=n[0])return i[0];const o=n.length;if(e>=n[o-1])return i[o-1];const s=function(t,e){const r=t.length-1;let n,i,o=0,s=r,a=0;for(;o<=s;)if(a=Math.floor((o+s)/2),n=t[a],i=t[a+1],n<=e){if(a===r||e<i)return a;o=a+1}else{if(!(n>e))throw new Error("Input is not a number.");s=a-1}return 0}(n,e),a=n.length-1,u=function(t,e,r,n){let i=0;return"exponential"===t.name?i=BT(e,t.base,r,n):"linear"===t.name?i=BT(e,1,r,n):"cubic-bezier"===t.name&&console.warn("interpolationFactor"),i}(r,e,n[s],n[s>=a?a:s+1]);return function(t,e,r){return t*(1-r)+e*r}(i[s],i[s>=a?a:s+1],u)}return 1}return 1}var TT="precision highp float;\n#define GLSLIFY 1\nuniform sampler2D u_wind;uniform sampler2D u_color_ramp;uniform vec2 u_image_res;uniform vec2 u_wind_min;uniform vec2 u_wind_max;uniform vec2 u_color_range;uniform vec2 u_display_range;uniform float u_opacity;varying vec2 v_tex_pos;vec2 windTexture(const vec2 uv){return texture2D(u_wind,uv).rg;}float bilinearU(const vec2 uv){vec2 px=1.0/u_image_res;vec2 vc=(floor(uv*u_image_res))*px;vec2 f=fract(uv*u_image_res);float tl=windTexture(vc).r;float tr=windTexture(vc+vec2(px.x,0)).r;float bl=windTexture(vc+vec2(0,px.y)).r;float br=windTexture(vc+px).r;return mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);}float bilinearV(const vec2 uv){vec2 px=1.0/u_image_res;vec2 vc=(floor(uv*u_image_res))*px;vec2 f=fract(uv*u_image_res);float tl=windTexture(vc).g;float tr=windTexture(vc+vec2(px.x,0.0)).g;float bl=windTexture(vc+vec2(0.0,px.y)).g;float br=windTexture(vc+px).g;return mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);}float getV(const vec2 uv){float min=u_wind_min.y;float max=u_wind_max.y;float r=bilinearV(uv);return r*(max-min)+min;}float getU(const vec2 uv){float min=u_wind_min.x;float max=u_wind_max.x;float r=bilinearU(uv);return r*(max-min)+min;}float windSpeed(const vec2 uv){float u=getU(uv);float v=getV(uv);return length(vec2(u,v));}const float PI=3.14159265359;vec2 mercatorToWGS84(vec2 xy){float y=radians(180.0-xy.y*360.0);y=360.0/PI*atan(exp(y))-90.0;y=y/-180.0+0.5;return vec2(xy.x,y);}void main(){vec2 globalWGS84=mercatorToWGS84(v_tex_pos);float value=windSpeed(globalWGS84);float value_t=(value-u_color_range.x)/(u_color_range.y-u_color_range.x);vec2 ramp_pos=vec2(fract(16.0*value_t),floor(16.0*value_t)/16.0);vec4 color=texture2D(u_color_ramp,ramp_pos);bool display=value<u_display_range.y&&value>u_display_range.x;if(display){gl_FragColor=vec4(floor(255.0*color*u_opacity)/255.0);}else{gl_FragColor=vec4(0.0,0.0,0.0,0.0);}}",LT="#define GLSLIFY 1\nattribute vec3 instancePositions;attribute vec3 instancePositions64Low;attribute vec2 a_texCoord;uniform mat4 u_matrix;uniform vec4 u_cameraEye;uniform vec4 u_cameraEye64Low;uniform float u_offset;uniform sampler2D u_wind;uniform vec2 u_image_res;uniform vec2 u_wind_min;uniform vec2 u_wind_max;uniform vec2 u_mapping_range;varying vec2 v_tex_pos;varying float v_value;vec2 windTexture(const vec2 uv){return texture2D(u_wind,uv).rg;}float bilinearU(const vec2 uv){vec2 px=1.0/u_image_res;vec2 vc=(floor(uv*u_image_res))*px;vec2 f=fract(uv*u_image_res);float tl=windTexture(vc).r;float tr=windTexture(vc+vec2(px.x,0)).r;float bl=windTexture(vc+vec2(0,px.y)).r;float br=windTexture(vc+px).r;return mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);}float bilinearV(const vec2 uv){vec2 px=1.0/u_image_res;vec2 vc=(floor(uv*u_image_res))*px;vec2 f=fract(uv*u_image_res);float tl=windTexture(vc).g;float tr=windTexture(vc+vec2(px.x,0.0)).g;float bl=windTexture(vc+vec2(0.0,px.y)).g;float br=windTexture(vc+px).g;return mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);}float getV(const vec2 uv){float min=u_wind_min.y;float max=u_wind_max.y;float r=bilinearV(uv);return r*(max-min)+min;}float getU(const vec2 uv){float min=u_wind_min.x;float max=u_wind_max.x;float r=bilinearU(uv);return r*(max-min)+min;}float windSpeed(const vec2 uv){float u=getU(uv);float v=getV(uv);float min=u_mapping_range.x;float max=u_mapping_range.y;float val=length(vec2(u,v));return val*(max-min)+min;}const float PI=3.14159265359;vec2 mercatorToWGS84(vec2 xy){float y=radians(180.0-xy.y*360.0);y=360.0/PI*atan(exp(y))-90.0;y=y/-180.0+0.5;return vec2(xy.x,y);}\n#modules-transformZ\nvoid main(){v_tex_pos=a_texCoord;vec2 globalWGS84=mercatorToWGS84(v_tex_pos);float value=windSpeed(globalWGS84);float z=transformZ(value,instancePositions);vec4 pos=vec4(instancePositions-u_cameraEye.xyz,0.0);pos+=vec4(instancePositions64Low-u_cameraEye64Low.xyz,0.0);\n#modules-project\n}";class RT extends ET{constructor(t,e,r,n){super(t,e||LT,r||TT,n||{}),this.vertShader=LT,this.fragShader=TT}draw(){if(void 0!==this.checkExt){const t=this.primitive||this.gl.TRIANGLES;this.checkExt?this.gl.drawElements(t,this.count,this.gl.UNSIGNED_INT,0):this.gl.drawElements(t,this.count,this.gl.UNSIGNED_SHORT,0)}else this.checkExt=this.gl.getExtension("OES_element_index_uint");return this}translate(){return this}rotate(){return this}scale(){return this}destroyed(){}}const NT={renderForm:"r",styleSpec:{"fill-color":["interpolate",["linear"],["get","value"],0,"#3288bd",10,"#66c2a5",20,"#abdda4",30,"#e6f598",40,"#fee08b",50,"#fdae61",60,"#f46d43",100,"#d53e4f"],opacity:1},displayRange:[1/0,1/0],mappingRange:[0,0],widthSegments:1,heightSegments:1,wireframe:!1,createPlaneBuffer:(t,e,r)=>{const[n,i,o,s]=[t[0][0],t[2][0],t[0][1],t[1][1]];return function(t,e,r,n,i,o){const s=e-t,a=n-r,u=s/2,l=a/2,c=Math.floor(i),h=Math.floor(o),f=c+1,p=h+1,g=s/c,d=a/h,A=[],y=[],v=[],m=[],_=[];for(let e=0;e<p;e++){const n=e*d;for(let i=0;i<f;i++){const o=t+i*g/u/2*s,f=r+n/l/2*a;v.push(o,f,0),m.push(AT(o),AT(f),0),_.push(i/c,e/h)}}for(let t=0;t<h;t++)for(let e=0;e<c;e++){const r=e+f*t,n=e+f*(t+1),i=e+1+f*(t+1),o=e+1+f*t;A.push(r,n,o),A.push(n,i,o)}for(let t=0,e=A.length;t<e;t+=3){const e=A[t],r=A[t+1],n=A[t+2];y.push(e,r,r,n,n,e)}return{uvs:{data:_,size:2},elements:{data:A,count:A.length},wireframeElements:{data:y,count:y.length},position:{data:v,size:3},positionLow:{data:m,size:3}}}(n,i,o,s,e,r)},injectShaderModules:{"#modules-transformZ":"\nfloat transformZ(float value, vec3 pos) {\n return 0.0;\n}\n ","#modules-project":"\ngl_Position = u_matrix * vec4(pos.xy + vec2(u_offset, 0.0), pos.z + z, 1.0);\n "}};let PT=0;class DT{constructor(t,e){if(this.gl=t,this.uid=`ScalarFill_${PT}`,PT++,!this.gl)throw new Error("initialize error");e||(e={}),this.options={...NT,...e},this.opacity=this.options.opacity||1}updateOptions(t){this.options={...this.options,...t},this.buildColorRamp(),"function"==typeof this.options.getZoom&&this.setOpacity(MT(this.uid,this.options.getZoom(),"opacity",this.options.styleSpec,!0))}setFillColor(){this.buildColorRamp()}setOpacity(t){this.opacity=t}handleZoom(){"function"==typeof this.options.getZoom&&this.setOpacity(MT(this.uid,this.options.getZoom(),"opacity",this.options.styleSpec))}buildColorRamp(){var t;const{data:e,colorRange:r}=bT([],null==(t=this.options.styleSpec)?void 0:t["fill-color"]);r&&(this.colorRange=r),e&&(this.colorRampTexture=mT(this.gl,this.gl.NEAREST,e,16,16))}initialize(t){this.drawCommand||("rg"===this.options.renderForm?this.drawCommand=new RT(t,void 0,void 0,this.options.injectShaderModules):"r"===this.options.renderForm?this.drawCommand=new CT(t,void 0,void 0,this.options.injectShaderModules):console.warn("This type is not supported temporarily")),this.buildColorRamp(),"function"==typeof this.options.getZoom&&this.setOpacity(MT(this.uid,this.options.getZoom(),"opacity",this.options.styleSpec))}initializeVertex(t){let e=0;const r=t.length,n=[];for(;e<r;e++){const r=t[e],i=this.getMercatorCoordinate(r);n.push([i[0],i[1]])}const i=(this.options.createPlaneBuffer||NT.createPlaneBuffer)(n,this.options.widthSegments||1,this.options.heightSegments||1);return{indexes:i.elements.data,wireframeIndexes:i.wireframeElements.data,quadBuffer:_T(this.gl,new Float32Array(i.position.data)),quad64LowBuffer:_T(this.gl,new Float32Array(i.positionLow.data)),texCoordBuffer:_T(this.gl,new Float32Array(i.uvs.data))}}getTextureData(t){return new Promise(((e,r)=>{if("image"===t.type&&t.url)(function(t){return new Promise(((e,r)=>{t||r(new Event("url is null"));const n=new Image;n.crossOrigin="anonymous",n.onload=()=>e(n),n.onerror=r,n.src=t,n.complete&&e(n)}))})(t.url).then((r=>{const n={width:r.width,height:r.height,texture:mT(this.gl,this.gl.LINEAR,r,r.width,r.height),...this.initializeVertex(t.extent)};"rg"===this.options.renderForm?(n.uMin=t.uMin,n.uMax=t.uMax,n.vMin=t.vMin,n.vMax=t.vMax):"r"===this.options.renderForm?(n.min=t.min,n.max=t.max):console.warn("This type is not supported temporarily"),e(n)})).catch((t=>r(t)));else if("jsonArray"===t.type&&t.data){const r=t.data;let n;n=t.extent?t.extent:[[r[0].header.lo1,r[0].header.la1],[r[0].header.lo1,r[0].header.la2],[r[0].header.lo2,r[0].header.la1],[r[0].header.lo2,r[0].header.la2]];const i={width:r[0].header.nx,height:r[0].header.ny,...this.initializeVertex(n)};if(this.worker||(this.worker=new gT,this.worker.addEventListener("message",(({data:t})=>{"rg"===this.options.renderForm?(i.uMin=t[1],i.uMax=t[2],i.vMin=t[3],i.vMax=t[4],i.texture=mT(this.gl,this.gl.LINEAR,new Uint8Array(t[0]),i.width,i.height)):"r"===this.options.renderForm?(i.min=t[1],i.max=t[2],i.texture=mT(this.gl,this.gl.LINEAR,new Uint8Array(t[0]),i.width,i.height)):console.warn("This type is not supported temporarily"),e(i)}))),"rg"===this.options.renderForm){let t,e;r.forEach((r=>{switch(r.header.parameterCategory+","+r.header.parameterNumber){case"1,2":case"2,2":t=r;break;case"1,3":case"2,3":e=r}}));const n=new Float32Array(t.data),i=new Float32Array(e.data);this.worker.postMessage(["rg",n,i])}else if("r"===this.options.renderForm){const t=new Float32Array(r[0].data);this.worker.postMessage(["r",t])}else console.warn("This type is not supported temporarily")}}))}setData(t,e){this.gl&&t&&this.getTextureData(t).then((t=>{this.data=t,e&&e(!0),this.data&&this.initialize(this.gl),this.options.triggerRepaint&&(this.handleZoom(),this.options.triggerRepaint())})).catch((t=>{e&&e(!1),console.error(t)}))}getData(){return this.data}getMercatorCoordinate([t,e]){return[t,e]}prerender(){}render(t,e,r){if(this.data&&this.drawCommand&&this.data.texture&&this.colorRampTexture){const n=this.opacity,i={u_opacity:dT(n)?n:1,u_image_res:[this.data.width,this.data.height],u_matrix:t,u_offset:dT(e)?e:0,u_color_ramp:this.colorRampTexture,u_color_range:this.colorRange,u_mapping_range:this.options.mappingRange||[0,0]};if(r&&(i.u_cameraEye=r.cameraEye,i.u_cameraEye64Low=r.cameraEye64Low),"rg"===this.options.renderForm){i.u_wind_min=[this.data.uMin,this.data.vMin],i.u_wind_max=[this.data.uMax,this.data.vMax],i.u_wind=this.data.texture;const t=[Math.sqrt(this.data.uMin*this.data.uMin+this.data.vMin*this.data.vMin),Math.sqrt(this.data.uMin*this.data.uMin+this.data.vMax*this.data.vMax),Math.sqrt(this.data.uMax*this.data.uMax+this.data.vMax*this.data.vMax),Math.sqrt(this.data.uMax*this.data.uMax+this.data.vMin*this.data.vMin)],e=0,r=Math.max(...t);i.u_display_range=this.options.displayRange||[e,r]}else"r"===this.options.renderForm?(i.u_range=[this.data.min,this.data.max],i.u_image=this.data.texture,i.u_display_range=this.options.displayRange||[i.u_range[0]-1,i.u_range[1]+1]):console.warn("This type is not supported temporarily");const o=this.gl.isEnabled(this.gl.DEPTH_TEST);this.gl.enable(this.gl.DEPTH_TEST),this.gl.depthMask(!0),this.gl.depthFunc(this.gl.LEQUAL);const s=this.options.wireframe?this.data.wireframeIndexes:this.data.indexes;this.drawCommand.active().setUniforms(i).setAttributes({instancePositions:{buffer:this.data.quadBuffer,numComponents:3},instancePositions64Low:{buffer:this.data.quad64LowBuffer,numComponents:3},a_texCoord:{buffer:this.data.texCoordBuffer,numComponents:2}}).elements({data:new Uint32Array(s),primitive:this.options.wireframe?this.gl.LINES:this.gl.TRIANGLES,count:null==s?void 0:s.length,usage:this.gl.STATIC_DRAW}).draw(),o||this.gl.disable(this.gl.DEPTH_TEST)}}postrender(){}destroyData(){this.data}destroyed(){this.destroyData(),this.worker&&this.worker.terminate()}}function FT(t,e,r){const n=t.length,i=r>1?r:2;let o=e;void 0===o&&(o=i>2?t.slice():new Array(n));for(let e=0;e<n;e+=i)o[e]=180*t[e]/20037508.342789244,o[e+1]=360*Math.atan(Math.exp(t[e+1]/6378137))/Math.PI-90;return o}function kT(t,e,r,n){let i=[];if(n>1){const e=t[2]-t[0],r=t[3]-t[1];for(let o=0;o<n;++o)i.push(t[0]+e*o/n,t[1],t[2],t[1]+r*o/n,t[2]-e*o/n,t[3],t[0],t[3]-r*o/n)}else i=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(i,i,2);const o=[],s=[];for(let t=0,e=i.length;t<e;t+=2)o.push(i[t]),s.push(i[t+1]);return function(t,e,r){return function(t,e,r,n,i){return i?(i[0]=t,i[1]=e,i[2]=r,i[3]=n,i):[t,e,r,n]}(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),r)}(o,s,r)}function QT(t){return t.getGLRes?t.getGLRes():t.getGLZoom()}function OT(t,e,r,n){return t.coordToPointAtRes?t.coordToPointAtRes(e,r,n):t.coordinateToPoint(e,r,n)}const UT={renderer:"gl",doubleBuffer:!1,animation:!1,glOptions:{antialias:!0,depth:!0,stencil:!0,alpha:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0}};class GT extends t.renderer.CanvasLayerRenderer{checkResources(){return[]}getDrawParams(){return[]}hitDetect(){return!1}draw(){this.prepareCanvas(),this.prepareDrawContext(),this.drawWind()}_redraw(){this.prepareRender(),this.draw()}clearCanvas(){this.gl&&IT(this.gl,[0,0,0,0])}createContext(){this.gl&&this.gl.canvas===this.canvas||(this.gl=function(t,e={}){const r=["webgl","experimental-webgl"];let n=null;function i(t){console.error(t.statusMessage)}t.addEventListener("webglcontextcreationerror",i,!1);for(let i=0;i<r.length;++i){try{n=t.getContext(r[i],e)}catch(t){}if(n)break}return t.removeEventListener("webglcontextcreationerror",i,!1),n&&n.getExtension("OES_texture_float")?n:null}(this.canvas,this.layer.options.glOptions))}resizeCanvas(t){if(this.canvas&&this.gl){const e=this.getMap(),r=e.getDevicePixelRatio(),n=t||e.getSize();this.canvas.height=r*n.height,this.canvas.width=r*n.width,this.gl&&this.gl.viewport(0,0,this.canvas.width,this.canvas.height)}}getMatrix(){return this.getMap().projViewMatrix}handleZoom(){this.scalarRender&&this.scalarRender.handleZoom()}drawWind(){const e=this.getMap();if(null!==this.gl){const r=this.layer,n=r.getOptions(),i=r.getData();if(!this.scalarRender&&e&&(this.scalarRender=new DT(this.gl,{opacity:n.opacity,renderForm:n.renderForm,styleSpec:n.styleSpec,displayRange:n.displayRange,mappingRange:n.mappingRange,widthSegments:n.widthSegments,heightSegments:n.heightSegments,createPlaneBuffer:n.createPlaneBuffer,wireframe:n.wireframe,getZoom:()=>this.getMap().getZoom(),triggerRepaint:()=>{this._redraw()},injectShaderModules:{"#modules-transformZ":"\nfloat transformZ(float value, vec3 pos) {\n return value;\n}\n ","#modules-project":"\ngl_Position = u_matrix * vec4(pos.xy + vec2(u_offset, 0.0), pos.z + z, 1.0);\n "}}),this.scalarRender.getMercatorCoordinate=([r,n])=>{const i=OT(e,new t.Coordinate(r,n),QT(e));return[i.x,i.y]},this.getMap().on("zoom",this.handleZoom,this),this.scalarRender.setData(i)),this.scalarRender){const t=this.getMatrix(),e=[0,0,0,1],r=e.map((t=>AT(t))),n=this.getWrappedWorlds();for(let i=0;i<n.length;i++)this.scalarRender.render(t,n[i],{cameraEye:e,cameraEye64Low:r})}}this.completeRender()}getWrappedWorlds(){const e=this.getMap(),r=e.getProjection().fullExtent,n=[r.left,r.bottom,r.right,r.top],i=e.getProjExtent(),o=[i.xmin,i.ymin,i.xmax,i.ymax];let s=o[0];const a=function(t){return t[2]-t[0]}(n),u=Math.abs(OT(e,e.getProjection().unprojectCoords(new t.Coordinate([n[0],n[1]])),QT(e)).x-OT(e,e.getProjection().unprojectCoords(new t.Coordinate([n[2],n[3]])),QT(e)).x);let l=0;const c=[];if(this.layer.getOptions().wrapX){for(;s<n[0];)--l,c.push(l*u),s+=a;for(l=0,s=o[2];s>n[2];)++l,c.push(l*u),s-=a}return c.push(0),c}drawOnInteracting(){this.draw()}onZoomStart(...t){super.onZoomStart.apply(this,t)}onZoomEnd(...t){super.onZoomEnd.apply(this,t)}onDragRotateStart(...t){super.onDragRotateStart.apply(this,t)}onDragRotateEnd(...t){super.onDragRotateEnd.apply(this,t)}onMoveStart(...t){super.onMoveStart.apply(this,t)}onMoveEnd(...t){super.onMoveEnd.apply(this,t)}remove(){delete this._drawContext,super.remove()}getMap(){return super.getMap()}completeRender(){return super.completeRender()}prepareCanvas(){return super.prepareCanvas()}prepareDrawContext(){super.prepareDrawContext()}prepareRender(){return super.prepareRender()}}class zT extends t.CanvasLayer{constructor(t,e,r){super(t,{...UT,...r}),this.data=null,this._map=null,e&&this.setData(e)}getData(){return this.data}setData(t){return new Promise(((e,r)=>{this.data=t;const n=this._getRenderer();this.data&&n&&n.scalarFill?n.scalarFill.setData(this.data,(t=>{t?e(!0):r(!1)})):e(!1)}))}setOptions(t){this.options={...this.options,...t||{}};const e=this._getRenderer();e&&e.scalarRender&&(e.scalarRender.updateOptions(this.options),e.setToRedraw())}getOptions(){return this.options||{}}draw(){return this._getRenderer()&&this._getRenderer()._redraw(),this}prepareToDraw(){return[]}drawOnInteracting(){this.draw()}_getRenderer(){return super._getRenderer()}}zT.registerRenderer("gl",GT);const VT={renderer:"canvas",doubleBuffer:!1,animation:!1,windOptions:{}};class jT extends t.renderer.CanvasLayerRenderer{checkResources(){return[]}getDrawParams(){return[]}hitDetect(){return!1}draw(){this.prepareCanvas(),this.prepareDrawContext(),this.drawWind()}_redraw(){this.prepareRender(),this.draw()}drawWind(){const t=this.getMap();if(this.context){const e=this.layer,r=e.getWindOptions();if(!this.wind&&t){const t=e.getData();this.wind=new oT(this.context,r,t),this.wind.project=this.project.bind(this),this.wind.unproject=this.unproject.bind(this),this.wind.intersectsCoordinate=this.intersectsCoordinate.bind(this),this.wind.postrender=()=>{this.setCanvasUpdated()},this.wind.prerender()}this.wind&&(this.wind.prerender(),this.wind.render())}this.completeRender()}project(e){const r=this.getMap().coordinateToContainerPoint(new t.Coordinate(e[0],e[1]));return[r.x,r.y]}unproject(e){return this.getMap().containerPointToCoordinate(new t.Point(e[0],e[1])).toArray()}intersectsCoordinate(t){var e;if(!this.layer)return!1;const r=null==(e=this.layer)?void 0:e.getProjection();if(r&&"EPSG:3857"!==r.code)return!0;const n=this.getMap().getProjExtent(),i=function(t,e){return kT(t,FT,void 0,e)}([n.xmin,n.ymin,n.xmax,n.ymax],0);return function(t,e){const r=e[0],n=e[1];return t[0]<=r&&r<=t[2]&&t[1]<=n&&n<=t[3]}(i,[t[0],t[1]])}drawOnInteracting(){}onZoomStart(...t){this.wind&&this.wind.stop(),super.onZoomStart.apply(this,t)}onZoomEnd(...t){this.wind&&this.wind.start(),super.onZoomEnd.apply(this,t)}onDragRotateStart(...t){this.wind&&this.wind.stop(),super.onDragRotateStart.apply(this,t)}onDragRotateEnd(...t){this.wind&&this.wind.start(),super.onDragRotateEnd.apply(this,t)}onMoveStart(...t){this.wind&&this.wind.stop(),super.onMoveStart.apply(this,t)}onMoveEnd(...t){this.wind&&this.wind.start(),super.onMoveEnd.apply(this,t)}remove(){this.wind&&this.wind.stop(),delete this._drawContext,super.remove()}getMap(){return super.getMap()}prepareCanvas(){return super.prepareCanvas()}prepareDrawContext(){super.prepareDrawContext()}prepareRender(){return super.prepareRender()}completeRender(){return super.completeRender()}}class HT extends t.CanvasLayer{constructor(t,e,r={}){super(t,KM({},VT,r)),this._map=null,this.pickWindOptions(),e&&this.setData(e,r.fieldOptions)}pickWindOptions(){Object.keys(nT).forEach((t=>{this.options&&t in this.options&&(void 0===this.options.windOptions&&(this.options.windOptions={}),this.options.windOptions[t]=this.options[t])}))}getData(){return this.field}setData(t,e={}){var r;t&&t.checkFields&&t.checkFields()?this.field=t:(r=t,Array.isArray(r)?this.field=function(t,e={}){let r,n;if(t.forEach((function(t){switch(t.header.parameterCategory+","+t.header.parameterNumber){case"1,2":case"2,2":r=t;break;case"1,3":case"2,3":n=t}})),!n||!r)return;const i=r.header;return new rT({xmin:i.lo1,ymin:i.la1,xmax:i.lo2,ymax:i.la2,deltaX:i.dx,deltaY:i.dy,cols:i.nx,rows:i.ny,us:r.data,vs:n.data,...e})}(t,e):console.error("Illegal data"));const n=this._getRenderer();return n&&n.wind&&this.field&&n.wind.updateData(this.field),this}setWindOptions(t){const e=this.options.windOptions||{};this.options=KM(this.options,{windOptions:KM(e,t||{})});const r=this._getRenderer();if(r&&r.wind){const t=this.options.windOptions;r.wind.setOptions(t)}}getWindOptions(){return this.options.windOptions||{}}draw(){return this._getRenderer()&&this._getRenderer()._redraw(),this}prepareToDraw(){return[]}drawOnInteracting(){this.draw()}_getRenderer(){return super._getRenderer()}}HT.registerRenderer("canvas",jT);const qT=HT;var YT={exports:{}};!function(t,e){var r="__lodash_hash_undefined__",n=1,i=2,o=1/0,s=9007199254740991,a=17976931348623157e292,u=NaN,l="[object Arguments]",c="[object Array]",h="[object Boolean]",f="[object Date]",p="[object Error]",g="[object Function]",d="[object GeneratorFunction]",A="[object Map]",y="[object Number]",v="[object Object]",m="[object Promise]",_="[object RegExp]",I="[object Set]",E="[object String]",x="[object Symbol]",w="[object WeakMap]",C="[object ArrayBuffer]",b="[object DataView]",B=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,S=/^\w*$/,M=/^\./,T=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,L=/^\s+|\s+$/g,R=/\\(\\)?/g,N=/^[-+]0x[0-9a-f]+$/i,P=/^0b[01]+$/i,D=/^\[object .+?Constructor\]$/,F=/^0o[0-7]+$/i,k=/^(?:0|[1-9]\d*)$/,Q={};Q["[object Float32Array]"]=Q["[object Float64Array]"]=Q["[object Int8Array]"]=Q["[object Int16Array]"]=Q["[object Int32Array]"]=Q["[object Uint8Array]"]=Q["[object Uint8ClampedArray]"]=Q["[object Uint16Array]"]=Q["[object Uint32Array]"]=!0,Q[l]=Q[c]=Q[C]=Q[h]=Q[b]=Q[f]=Q[p]=Q[g]=Q[A]=Q[y]=Q[v]=Q[_]=Q[I]=Q[E]=Q[w]=!1;var O=parseInt,U="object"==typeof Pt&&Pt&&Pt.Object===Object&&Pt,G="object"==typeof self&&self&&self.Object===Object&&self,z=U||G||Function("return this")(),V=e&&!e.nodeType&&e,j=V&&t&&!t.nodeType&&t,H=j&&j.exports===V&&U.process,q=function(){try{return H&&H.binding("util")}catch(t){}}(),Y=q&&q.isTypedArray;function X(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function W(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function J(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function K(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var Z,$=Array.prototype,tt=Function.prototype,et=Object.prototype,rt=z["__core-js_shared__"],nt=(Z=/[^.]+$/.exec(rt&&rt.keys&&rt.keys.IE_PROTO||""))?"Symbol(src)_1."+Z:"",it=tt.toString,ot=et.hasOwnProperty,st=et.toString,at=RegExp("^"+it.call(ot).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ut=z.Symbol,lt=z.Uint8Array,ct=et.propertyIsEnumerable,ht=$.splice,ft=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),pt=Math.max,gt=Ht(z,"DataView"),dt=Ht(z,"Map"),At=Ht(z,"Promise"),yt=Ht(z,"Set"),vt=Ht(z,"WeakMap"),mt=Ht(Object,"create"),_t=$t(gt),It=$t(dt),Et=$t(At),xt=$t(yt),wt=$t(vt),Ct=ut?ut.prototype:void 0,bt=Ct?Ct.valueOf:void 0,Bt=Ct?Ct.toString:void 0;function St(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Mt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Tt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Lt(t){var e=-1,r=t?t.length:0;for(this.__data__=new Tt;++e<r;)this.add(t[e])}function Rt(t){this.__data__=new Mt(t)}function Nt(t,e){var r=oe(t)||ie(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,i=!!n;for(var o in t)!e&&!ot.call(t,o)||i&&("length"==o||Yt(o,n))||r.push(o);return r}function Dt(t,e){for(var r=t.length;r--;)if(ne(t[r][0],e))return r;return-1}function Ft(t,e){for(var r=0,n=(e=Xt(e,t)?[e]:zt(e)).length;null!=t&&r<n;)t=t[Zt(e[r++])];return r&&r==n?t:void 0}function kt(t,e){return null!=t&&e in Object(t)}function Qt(t,e,r,o,s){return t===e||(null==t||null==e||!le(t)&&!ce(e)?t!=t&&e!=e:function(t,e,r,o,s,a){var u=oe(t),g=oe(e),d=c,m=c;u||(d=(d=qt(t))==l?v:d);g||(m=(m=qt(e))==l?v:m);var w=d==v&&!W(t),B=m==v&&!W(e),S=d==m;if(S&&!w)return a||(a=new Rt),u||pe(t)?Vt(t,e,r,o,s,a):function(t,e,r,o,s,a,u){switch(r){case b:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case C:return!(t.byteLength!=e.byteLength||!o(new lt(t),new lt(e)));case h:case f:case y:return ne(+t,+e);case p:return t.name==e.name&&t.message==e.message;case _:case E:return t==e+"";case A:var l=J;case I:var c=a&i;if(l||(l=K),t.size!=e.size&&!c)return!1;var g=u.get(t);if(g)return g==e;a|=n,u.set(t,e);var d=Vt(l(t),l(e),o,s,a,u);return u.delete(t),d;case x:if(bt)return bt.call(t)==bt.call(e)}return!1}(t,e,d,r,o,s,a);if(!(s&i)){var M=w&&ot.call(t,"__wrapped__"),T=B&&ot.call(e,"__wrapped__");if(M||T){var L=M?t.value():t,R=T?e.value():e;return a||(a=new Rt),r(L,R,o,s,a)}}if(!S)return!1;return a||(a=new Rt),function(t,e,r,n,o,s){var a=o&i,u=ge(t),l=u.length,c=ge(e),h=c.length;if(l!=h&&!a)return!1;var f=l;for(;f--;){var p=u[f];if(!(a?p in e:ot.call(e,p)))return!1}var g=s.get(t);if(g&&s.get(e))return g==e;var d=!0;s.set(t,e),s.set(e,t);var A=a;for(;++f<l;){var y=t[p=u[f]],v=e[p];if(n)var m=a?n(v,y,p,e,t,s):n(y,v,p,t,e,s);if(!(void 0===m?y===v||r(y,v,n,o,s):m)){d=!1;break}A||(A="constructor"==p)}if(d&&!A){var _=t.constructor,I=e.constructor;_==I||!("constructor"in t)||!("constructor"in e)||"function"==typeof _&&_ instanceof _&&"function"==typeof I&&I instanceof I||(d=!1)}return s.delete(t),s.delete(e),d}(t,e,r,o,s,a)}(t,e,Qt,r,o,s))}function Ot(t){return!(!le(t)||(e=t,nt&&nt in e))&&(ae(t)||W(t)?at:D).test($t(t));var e}function Ut(t){return"function"==typeof t?t:null==t?de:"object"==typeof t?oe(t)?function(t,e){if(Xt(t)&&Wt(e))return Jt(Zt(t),e);return function(r){var o=function(t,e,r){var n=null==t?void 0:Ft(t,e);return void 0===n?r:n}(r,t);return void 0===o&&o===e?function(t,e){return null!=t&&function(t,e,r){e=Xt(e,t)?[e]:zt(e);var n,i=-1,o=e.length;for(;++i<o;){var s=Zt(e[i]);if(!(n=null!=t&&r(t,s)))break;t=t[s]}if(n)return n;o=t?t.length:0;return!!o&&ue(o)&&Yt(s,o)&&(oe(t)||ie(t))}(t,e,kt)}(r,t):Qt(e,o,void 0,n|i)}}(t[0],t[1]):function(t){var e=function(t){var e=ge(t),r=e.length;for(;r--;){var n=e[r],i=t[n];e[r]=[n,i,Wt(i)]}return e}(t);if(1==e.length&&e[0][2])return Jt(e[0][0],e[0][1]);return function(r){return r===t||function(t,e,r,o){var s=r.length,a=s,u=!o;if(null==t)return!a;for(t=Object(t);s--;){var l=r[s];if(u&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++s<a;){var c=(l=r[s])[0],h=t[c],f=l[1];if(u&&l[2]){if(void 0===h&&!(c in t))return!1}else{var p=new Rt;if(o)var g=o(h,f,c,t,e,p);if(!(void 0===g?Qt(f,h,o,n|i,p):g))return!1}}return!0}(r,t,e)}}(t):Xt(e=t)?(r=Zt(e),function(t){return null==t?void 0:t[r]}):function(t){return function(e){return Ft(e,t)}}(e);var e,r}function Gt(t){if(r=(e=t)&&e.constructor,n="function"==typeof r&&r.prototype||et,e!==n)return ft(t);var e,r,n,i=[];for(var o in Object(t))ot.call(t,o)&&"constructor"!=o&&i.push(o);return i}function zt(t){return oe(t)?t:Kt(t)}function Vt(t,e,r,o,s,a){var u=s&i,l=t.length,c=e.length;if(l!=c&&!(u&&c>l))return!1;var h=a.get(t);if(h&&a.get(e))return h==e;var f=-1,p=!0,g=s&n?new Lt:void 0;for(a.set(t,e),a.set(e,t);++f<l;){var d=t[f],A=e[f];if(o)var y=u?o(A,d,f,e,t,a):o(d,A,f,t,e,a);if(void 0!==y){if(y)continue;p=!1;break}if(g){if(!X(e,(function(t,e){if(!g.has(e)&&(d===t||r(d,t,o,s,a)))return g.add(e)}))){p=!1;break}}else if(d!==A&&!r(d,A,o,s,a)){p=!1;break}}return a.delete(t),a.delete(e),p}function jt(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function Ht(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return Ot(r)?r:void 0}St.prototype.clear=function(){this.__data__=mt?mt(null):{}},St.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},St.prototype.get=function(t){var e=this.__data__;if(mt){var n=e[t];return n===r?void 0:n}return ot.call(e,t)?e[t]:void 0},St.prototype.has=function(t){var e=this.__data__;return mt?void 0!==e[t]:ot.call(e,t)},St.prototype.set=function(t,e){return this.__data__[t]=mt&&void 0===e?r:e,this},Mt.prototype.clear=function(){this.__data__=[]},Mt.prototype.delete=function(t){var e=this.__data__,r=Dt(e,t);return!(r<0)&&(r==e.length-1?e.pop():ht.call(e,r,1),!0)},Mt.prototype.get=function(t){var e=this.__data__,r=Dt(e,t);return r<0?void 0:e[r][1]},Mt.prototype.has=function(t){return Dt(this.__data__,t)>-1},Mt.prototype.set=function(t,e){var r=this.__data__,n=Dt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},Tt.prototype.clear=function(){this.__data__={hash:new St,map:new(dt||Mt),string:new St}},Tt.prototype.delete=function(t){return jt(this,t).delete(t)},Tt.prototype.get=function(t){return jt(this,t).get(t)},Tt.prototype.has=function(t){return jt(this,t).has(t)},Tt.prototype.set=function(t,e){return jt(this,t).set(t,e),this},Lt.prototype.add=Lt.prototype.push=function(t){return this.__data__.set(t,r),this},Lt.prototype.has=function(t){return this.__data__.has(t)},Rt.prototype.clear=function(){this.__data__=new Mt},Rt.prototype.delete=function(t){return this.__data__.delete(t)},Rt.prototype.get=function(t){return this.__data__.get(t)},Rt.prototype.has=function(t){return this.__data__.has(t)},Rt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Mt){var n=r.__data__;if(!dt||n.length<199)return n.push([t,e]),this;r=this.__data__=new Tt(n)}return r.set(t,e),this};var qt=function(t){return st.call(t)};function Yt(t,e){return!!(e=null==e?s:e)&&("number"==typeof t||k.test(t))&&t>-1&&t%1==0&&t<e}function Xt(t,e){if(oe(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!he(t))||(S.test(t)||!B.test(t)||null!=e&&t in Object(e))}function Wt(t){return t==t&&!le(t)}function Jt(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}(gt&&qt(new gt(new ArrayBuffer(1)))!=b||dt&&qt(new dt)!=A||At&&qt(At.resolve())!=m||yt&&qt(new yt)!=I||vt&&qt(new vt)!=w)&&(qt=function(t){var e=st.call(t),r=e==v?t.constructor:void 0,n=r?$t(r):void 0;if(n)switch(n){case _t:return b;case It:return A;case Et:return m;case xt:return I;case wt:return w}return e});var Kt=re((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(he(t))return Bt?Bt.call(t):"";var e=t+"";return"0"==e&&1/t==-o?"-0":e}(e);var r=[];return M.test(t)&&r.push(""),t.replace(T,(function(t,e,n,i){r.push(n?i.replace(R,"$1"):e||t)})),r}));function Zt(t){if("string"==typeof t||he(t))return t;var e=t+"";return"0"==e&&1/t==-o?"-0":e}function $t(t){if(null!=t){try{return it.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var te,ee=(te=function(t,e,r){var n=t?t.length:0;if(!n)return-1;var i,s,l=null==r?0:(i=function(t){return t?(t=function(t){if("number"==typeof t)return t;if(he(t))return u;if(le(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=le(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(L,"");var r=P.test(t);return r||F.test(t)?O(t.slice(2),r?2:8):N.test(t)?u:+t}(t))===o||t===-o?(t<0?-1:1)*a:t==t?t:0:0===t?t:0}(r),s=i%1,i==i?s?i-s:i:0);return l<0&&(l=pt(n+l,0)),function(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}(t,Ut(e),l)},function(t,e,r){var n=Object(t);if(!se(t)){var i=Ut(e);t=ge(t),e=function(t){return i(n[t],t,n)}}var o=te(t,e,r);return o>-1?n[i?t[o]:o]:void 0});function re(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s),s};return r.cache=new(re.Cache||Tt),r}function ne(t,e){return t===e||t!=t&&e!=e}function ie(t){return function(t){return ce(t)&&se(t)}(t)&&ot.call(t,"callee")&&(!ct.call(t,"callee")||st.call(t)==l)}re.Cache=Tt;var oe=Array.isArray;function se(t){return null!=t&&ue(t.length)&&!ae(t)}function ae(t){var e=le(t)?st.call(t):"";return e==g||e==d}function ue(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=s}function le(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function ce(t){return!!t&&"object"==typeof t}function he(t){return"symbol"==typeof t||ce(t)&&st.call(t)==x}var fe,pe=Y?(fe=Y,function(t){return fe(t)}):function(t){return ce(t)&&ue(t.length)&&!!Q[st.call(t)]};function ge(t){return se(t)?Nt(t):Gt(t)}function de(t){return t}t.exports=ee}(YT,YT.exports);var XT=YT.exports,WT={exports:{}};!function(t,e){var r="__lodash_hash_undefined__",n=1,i=2,o=1/0,s=9007199254740991,a="[object Arguments]",u="[object Array]",l="[object Boolean]",c="[object Date]",h="[object Error]",f="[object Function]",p="[object GeneratorFunction]",g="[object Map]",d="[object Number]",A="[object Object]",y="[object Promise]",v="[object RegExp]",m="[object Set]",_="[object String]",I="[object Symbol]",E="[object WeakMap]",x="[object ArrayBuffer]",w="[object DataView]",C=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,b=/^\w*$/,B=/^\./,S=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,M=/\\(\\)?/g,T=/^\[object .+?Constructor\]$/,L=/^(?:0|[1-9]\d*)$/,R={};R["[object Float32Array]"]=R["[object Float64Array]"]=R["[object Int8Array]"]=R["[object Int16Array]"]=R["[object Int32Array]"]=R["[object Uint8Array]"]=R["[object Uint8ClampedArray]"]=R["[object Uint16Array]"]=R["[object Uint32Array]"]=!0,R[a]=R[u]=R[x]=R[l]=R[w]=R[c]=R[h]=R[f]=R[g]=R[d]=R[A]=R[v]=R[m]=R[_]=R[E]=!1;var N="object"==typeof Pt&&Pt&&Pt.Object===Object&&Pt,P="object"==typeof self&&self&&self.Object===Object&&self,D=N||P||Function("return this")(),F=e&&!e.nodeType&&e,k=F&&t&&!t.nodeType&&t,Q=k&&k.exports===F&&N.process,O=function(){try{return Q&&Q.binding("util")}catch(t){}}(),U=O&&O.isTypedArray;function G(t,e){for(var r=-1,n=t?t.length:0,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function z(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function V(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function j(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function H(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var q,Y=Array.prototype,X=Function.prototype,W=Object.prototype,J=D["__core-js_shared__"],K=(q=/[^.]+$/.exec(J&&J.keys&&J.keys.IE_PROTO||""))?"Symbol(src)_1."+q:"",Z=X.toString,$=W.hasOwnProperty,tt=W.toString,et=RegExp("^"+Z.call($).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rt=D.Symbol,nt=D.Uint8Array,it=W.propertyIsEnumerable,ot=Y.splice,st=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),at=Vt(D,"DataView"),ut=Vt(D,"Map"),lt=Vt(D,"Promise"),ct=Vt(D,"Set"),ht=Vt(D,"WeakMap"),ft=Vt(Object,"create"),pt=Kt(at),gt=Kt(ut),dt=Kt(lt),At=Kt(ct),yt=Kt(ht),vt=rt?rt.prototype:void 0,mt=vt?vt.valueOf:void 0,_t=vt?vt.toString:void 0;function It(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Et(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function xt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function wt(t){var e=-1,r=t?t.length:0;for(this.__data__=new xt;++e<r;)this.add(t[e])}function Ct(t){this.__data__=new Et(t)}function bt(t,e){var r=ee(t)||te(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,i=!!n;for(var o in t)!e&&!$.call(t,o)||i&&("length"==o||Ht(o,n))||r.push(o);return r}function Bt(t,e){for(var r=t.length;r--;)if($t(t[r][0],e))return r;return-1}It.prototype.clear=function(){this.__data__=ft?ft(null):{}},It.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},It.prototype.get=function(t){var e=this.__data__;if(ft){var n=e[t];return n===r?void 0:n}return $.call(e,t)?e[t]:void 0},It.prototype.has=function(t){var e=this.__data__;return ft?void 0!==e[t]:$.call(e,t)},It.prototype.set=function(t,e){return this.__data__[t]=ft&&void 0===e?r:e,this},Et.prototype.clear=function(){this.__data__=[]},Et.prototype.delete=function(t){var e=this.__data__,r=Bt(e,t);return!(r<0)&&(r==e.length-1?e.pop():ot.call(e,r,1),!0)},Et.prototype.get=function(t){var e=this.__data__,r=Bt(e,t);return r<0?void 0:e[r][1]},Et.prototype.has=function(t){return Bt(this.__data__,t)>-1},Et.prototype.set=function(t,e){var r=this.__data__,n=Bt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},xt.prototype.clear=function(){this.__data__={hash:new It,map:new(ut||Et),string:new It}},xt.prototype.delete=function(t){return zt(this,t).delete(t)},xt.prototype.get=function(t){return zt(this,t).get(t)},xt.prototype.has=function(t){return zt(this,t).has(t)},xt.prototype.set=function(t,e){return zt(this,t).set(t,e),this},wt.prototype.add=wt.prototype.push=function(t){return this.__data__.set(t,r),this},wt.prototype.has=function(t){return this.__data__.has(t)},Ct.prototype.clear=function(){this.__data__=new Et},Ct.prototype.delete=function(t){return this.__data__.delete(t)},Ct.prototype.get=function(t){return this.__data__.get(t)},Ct.prototype.has=function(t){return this.__data__.has(t)},Ct.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Et){var n=r.__data__;if(!ut||n.length<199)return n.push([t,e]),this;r=this.__data__=new xt(n)}return r.set(t,e),this};var St,Mt,Tt=(St=function(t,e){return t&&Lt(t,e,ce)},function(t,e){if(null==t)return t;if(!re(t))return St(t,e);for(var r=t.length,n=Mt?r:-1,i=Object(t);(Mt?n--:++n<r)&&!1!==e(i[n],n,i););return t}),Lt=function(t){return function(e,r,n){for(var i=-1,o=Object(e),s=n(e),a=s.length;a--;){var u=s[t?a:++i];if(!1===r(o[u],u,o))break}return e}}();function Rt(t,e){for(var r=0,n=(e=qt(e,t)?[e]:Ut(e)).length;null!=t&&r<n;)t=t[Jt(e[r++])];return r&&r==n?t:void 0}function Nt(t,e){return null!=t&&e in Object(t)}function Dt(t,e,r,o,s){return t===e||(null==t||null==e||!oe(t)&&!se(e)?t!=t&&e!=e:function(t,e,r,o,s,f){var p=ee(t),y=ee(e),E=u,C=u;p||(E=(E=jt(t))==a?A:E);y||(C=(C=jt(e))==a?A:C);var b=E==A&&!V(t),B=C==A&&!V(e),S=E==C;if(S&&!b)return f||(f=new Ct),p||le(t)?Gt(t,e,r,o,s,f):function(t,e,r,o,s,a,u){switch(r){case w:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case x:return!(t.byteLength!=e.byteLength||!o(new nt(t),new nt(e)));case l:case c:case d:return $t(+t,+e);case h:return t.name==e.name&&t.message==e.message;case v:case _:return t==e+"";case g:var f=j;case m:var p=a&i;if(f||(f=H),t.size!=e.size&&!p)return!1;var A=u.get(t);if(A)return A==e;a|=n,u.set(t,e);var y=Gt(f(t),f(e),o,s,a,u);return u.delete(t),y;case I:if(mt)return mt.call(t)==mt.call(e)}return!1}(t,e,E,r,o,s,f);if(!(s&i)){var M=b&&$.call(t,"__wrapped__"),T=B&&$.call(e,"__wrapped__");if(M||T){var L=M?t.value():t,R=T?e.value():e;return f||(f=new Ct),r(L,R,o,s,f)}}if(!S)return!1;return f||(f=new Ct),function(t,e,r,n,o,s){var a=o&i,u=ce(t),l=u.length,c=ce(e),h=c.length;if(l!=h&&!a)return!1;var f=l;for(;f--;){var p=u[f];if(!(a?p in e:$.call(e,p)))return!1}var g=s.get(t);if(g&&s.get(e))return g==e;var d=!0;s.set(t,e),s.set(e,t);var A=a;for(;++f<l;){var y=t[p=u[f]],v=e[p];if(n)var m=a?n(v,y,p,e,t,s):n(y,v,p,t,e,s);if(!(void 0===m?y===v||r(y,v,n,o,s):m)){d=!1;break}A||(A="constructor"==p)}if(d&&!A){var _=t.constructor,I=e.constructor;_==I||!("constructor"in t)||!("constructor"in e)||"function"==typeof _&&_ instanceof _&&"function"==typeof I&&I instanceof I||(d=!1)}return s.delete(t),s.delete(e),d}(t,e,r,o,s,f)}(t,e,Dt,r,o,s))}function Ft(t){return!(!oe(t)||(e=t,K&&K in e))&&(ne(t)||V(t)?et:T).test(Kt(t));var e}function kt(t){return"function"==typeof t?t:null==t?he:"object"==typeof t?ee(t)?function(t,e){if(qt(t)&&Yt(e))return Xt(Jt(t),e);return function(r){var o=function(t,e,r){var n=null==t?void 0:Rt(t,e);return void 0===n?r:n}(r,t);return void 0===o&&o===e?function(t,e){return null!=t&&function(t,e,r){e=qt(e,t)?[e]:Ut(e);var n,i=-1,o=e.length;for(;++i<o;){var s=Jt(e[i]);if(!(n=null!=t&&r(t,s)))break;t=t[s]}if(n)return n;o=t?t.length:0;return!!o&&ie(o)&&Ht(s,o)&&(ee(t)||te(t))}(t,e,Nt)}(r,t):Dt(e,o,void 0,n|i)}}(t[0],t[1]):function(t){var e=function(t){var e=ce(t),r=e.length;for(;r--;){var n=e[r],i=t[n];e[r]=[n,i,Yt(i)]}return e}(t);if(1==e.length&&e[0][2])return Xt(e[0][0],e[0][1]);return function(r){return r===t||function(t,e,r,o){var s=r.length,a=s,u=!o;if(null==t)return!a;for(t=Object(t);s--;){var l=r[s];if(u&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++s<a;){var c=(l=r[s])[0],h=t[c],f=l[1];if(u&&l[2]){if(void 0===h&&!(c in t))return!1}else{var p=new Ct;if(o)var g=o(h,f,c,t,e,p);if(!(void 0===g?Dt(f,h,o,n|i,p):g))return!1}}return!0}(r,t,e)}}(t):qt(e=t)?(r=Jt(e),function(t){return null==t?void 0:t[r]}):function(t){return function(e){return Rt(e,t)}}(e);var e,r}function Qt(t){if(r=(e=t)&&e.constructor,n="function"==typeof r&&r.prototype||W,e!==n)return st(t);var e,r,n,i=[];for(var o in Object(t))$.call(t,o)&&"constructor"!=o&&i.push(o);return i}function Ot(t,e){var r=-1,n=re(t)?Array(t.length):[];return Tt(t,(function(t,i,o){n[++r]=e(t,i,o)})),n}function Ut(t){return ee(t)?t:Wt(t)}function Gt(t,e,r,o,s,a){var u=s&i,l=t.length,c=e.length;if(l!=c&&!(u&&c>l))return!1;var h=a.get(t);if(h&&a.get(e))return h==e;var f=-1,p=!0,g=s&n?new wt:void 0;for(a.set(t,e),a.set(e,t);++f<l;){var d=t[f],A=e[f];if(o)var y=u?o(A,d,f,e,t,a):o(d,A,f,t,e,a);if(void 0!==y){if(y)continue;p=!1;break}if(g){if(!z(e,(function(t,e){if(!g.has(e)&&(d===t||r(d,t,o,s,a)))return g.add(e)}))){p=!1;break}}else if(d!==A&&!r(d,A,o,s,a)){p=!1;break}}return a.delete(t),a.delete(e),p}function zt(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function Vt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return Ft(r)?r:void 0}var jt=function(t){return tt.call(t)};function Ht(t,e){return!!(e=null==e?s:e)&&("number"==typeof t||L.test(t))&&t>-1&&t%1==0&&t<e}function qt(t,e){if(ee(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!ae(t))||(b.test(t)||!C.test(t)||null!=e&&t in Object(e))}function Yt(t){return t==t&&!oe(t)}function Xt(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}(at&&jt(new at(new ArrayBuffer(1)))!=w||ut&&jt(new ut)!=g||lt&&jt(lt.resolve())!=y||ct&&jt(new ct)!=m||ht&&jt(new ht)!=E)&&(jt=function(t){var e=tt.call(t),r=e==A?t.constructor:void 0,n=r?Kt(r):void 0;if(n)switch(n){case pt:return w;case gt:return g;case dt:return y;case At:return m;case yt:return E}return e});var Wt=Zt((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(ae(t))return _t?_t.call(t):"";var e=t+"";return"0"==e&&1/t==-o?"-0":e}(e);var r=[];return B.test(t)&&r.push(""),t.replace(S,(function(t,e,n,i){r.push(n?i.replace(M,"$1"):e||t)})),r}));function Jt(t){if("string"==typeof t||ae(t))return t;var e=t+"";return"0"==e&&1/t==-o?"-0":e}function Kt(t){if(null!=t){try{return Z.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Zt(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s),s};return r.cache=new(Zt.Cache||xt),r}function $t(t,e){return t===e||t!=t&&e!=e}function te(t){return function(t){return se(t)&&re(t)}(t)&&$.call(t,"callee")&&(!it.call(t,"callee")||tt.call(t)==a)}Zt.Cache=xt;var ee=Array.isArray;function re(t){return null!=t&&ie(t.length)&&!ne(t)}function ne(t){var e=oe(t)?tt.call(t):"";return e==f||e==p}function ie(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=s}function oe(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function se(t){return!!t&&"object"==typeof t}function ae(t){return"symbol"==typeof t||se(t)&&tt.call(t)==I}var ue,le=U?(ue=U,function(t){return ue(t)}):function(t){return se(t)&&ie(t.length)&&!!R[tt.call(t)]};function ce(t){return re(t)?bt(t):Qt(t)}function he(t){return t}t.exports=function(t,e){return(ee(t)?G:Ot)(t,kt(e))}}(WT,WT.exports);var JT={0:.05,1:.05,2:.05,3:.03,4:.02,5:.01,6:.006,7:.003,8:.002,9:.001,10:5e-4,11:3e-4,12:15e-5,13:1e-4,14:5e-5,15:25e-6,16:1e-5,16.99:1e-5,17:5e-6,18:2e-6,19:1e-6,20:5e-7,21:2e-7,22:1e-7},KT=(0,WT.exports)(["南","东南偏南","东南","东南偏东","东","东北偏东","东北","东北偏北","北","西北偏北","西北","西北偏西","西","西南偏西","西南","西南偏南"],(function(t,e){var r=22.5,n=r*e;return{bearing:n,range:[n-11.25,n+11.25],label:t}})),ZT=function(t,e,r){return t>=e&&t<r},$T=function(t){return XT(KT,(function(e){return ZT(t,e.range[0],e.range[1])||ZT(t-360,e.range[0],e.range[1])}))},tL=function(){function t(e,r,n){var i=this;c(this,t),console.log(n.options.devicePixelRatio),this.map=n,this._zIndex=r.zIndex;var o=2===n.options.devicePixelRatio?4:1;r.mulnum&&(o=r.mulnum),this.windLayer=this.map.getLayer("windLayer"),this.windLayer?this.windLayer.setData(e):(this.windLayer=new qT("windLayer",e,{windOptions:{colorScale:["rgb(36,104, 180)","rgb(60,157, 194)","rgb(128,205,193 )","rgb(151,218,168 )","rgb(198,231,181)","rgb(238,247,217)","rgb(255,238,159)","rgb(252,217,125)","rgb(255,182,100)","rgb(252,150,75)","rgb(250,112,52)","rgb(245,64,32)","rgb(237,45,28)","rgb(220,24,32)","rgb(180,0,35)"],lineWidth:2,velocityScale:function(){var t=i.map.getZoom();return JT[parseInt(t)]||1/40},frameRate:16,maxAge:60,globalAlpha:.9,paths:3782*o}}),this.map.addLayer(this.windLayer)),r.zIndex&&this.windLayer.setZIndex(r.zIndex),this.setToolTip("hello",{showTimeout:0,eventsPropagation:!0,dx:10}),this._bindMapEvents()}return f(t,[{key:"getZIndex",value:function(){this.windLayer&&this.windLayer.getZIndex()}},{key:"setZIndex",value:function(t){this.windLayer&&this.windLayer.setZIndex(t)}},{key:"_bindMapEvents",value:function(){this.map.on("mousemove",this._onWind,this)}},{key:"_closeEvent",value:function(){this.map.off("mousemove",this._onWind,this)}},{key:"_onWind",value:function(t){var e,r=this.windLayer.field.interpolatedValueAt(t.coordinate.x,t.coordinate.y);if(r){var n=this.vectorToDegrees(r.u,r.v,"bearingCCW"),i=this.vectorToSpeed(r.u,r.v,"m/s");this.toolTip._content="".concat(null===(e=$T(n))||void 0===e?void 0:e.label).concat(this.windLevel(i),"级;速度").concat(i.toFixed(2),"m/s;高度10米")}}},{key:"getWindValue",value:function(t,e){var r=this.windLayer.field.interpolatedValueAt(t,e);if(r){var n=this.vectorToDegrees(r.u,r.v,"bearingCCW"),i=this.vectorToSpeed(r.u,r.v,"m/s");return{direction:$T(n),speed:this.windLevel(i)}}}},{key:"windLevel",value:function(t){return t>=0&&t<.3?0:t>=.3&&t<1.6?1:t>=1.6&&t<3.4?2:t>=3.4&&t<5.5?3:t>=5.5&&t<8?4:t>=8&&t<10.8?5:t>=10.8&&t<13.9?6:t>=13.9&&t<17.2?7:t>=17.2&&t<20.8?8:t>=20.8&&t<24.5?9:t>=24.5&&t<28.5?10:t>=28.5&&t<32.7?11:12}},{key:"hide",value:function(){var t;null===(t=this.windLayer)||void 0===t||t.hide(),this.removeToolTip(),this._closeEvent()}},{key:"show",value:function(){var t;null===(t=this.windLayer)||void 0===t||t.show(),this.setToolTip("hello",{showTimeout:0,eventsPropagation:!0,dx:10}),this._bindMapEvents()}},{key:"setToolTip",value:function(t,e){this.removeToolTip(),this.toolTip=new i.ui.ToolTip(t,e),this.toolTip.addTo(this.map)}},{key:"removeToolTip",value:function(){var t;this.toolTip&&(null===(t=this.toolTip)||void 0===t||t.remove(),this.toolTip=null)}},{key:"vectorToDegrees",value:function(t,e,r){r.endsWith("CCW")&&(e=e>0?e=-e:Math.abs(e));var n=Math.sqrt(Math.pow(t,2)+Math.pow(e,2)),i=180*Math.atan2(t/n,e/n)/Math.PI+180;return"bearingCW"!==r&&"meteoCCW"!==r||(i+=180)>=360&&(i-=360),i}},{key:"vectorToSpeed",value:function(t,e,r){var n=Math.sqrt(Math.pow(t,2)+Math.pow(e,2));return"k/h"===r?3.6*n:"kt"===r?n/.514:n}},{key:"closeWind",value:function(){this._closeEvent(),this.removeToolTip(),this.map.removeLayer(this.windLayer),delete this.windLayer,this.windLayer=null}}]),t}();exports.Arrow3D=NB,exports.CoordinateTransform=QM,exports.LineGeometry=mB,exports.LineMaterial=Kb,exports.TextureAnimator=O_,exports.bloomClass=SM,exports.bloomLine=VB,exports.calIntersection=__,exports.calPointColor=w_,exports.drawTool=kM,exports.getCirGeojson=function(t,e,r,n,i){for(var s=i.map,a=i.coordinateToVector3([t,e],0),u=(new o.Matrix4).makeTranslation(a.x,a.y,0),l=i.distanceToVector3(r,r).x,c=[],h=0;h<=360;h++){var f=new o.Vector3(Math.sin(h*(Math.PI/180))*l,Math.cos(h*(Math.PI/180))*l,0);f=f.applyMatrix4(u);var p=s.pointAtResToCoord(f,s.getGLRes());c.push([p.x,p.y])}return{type:"FeatureCollection",name:"net",crs:{type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}},features:[{type:"Feature",properties:{Id:0,color:n.color||"#fff"},geometry:{type:"MultiPolygon",coordinates:[[c]]}}]}},exports.getPsByCircle=function(t,e,r,n,i){for(var s,a,u=[],l=i.map,c=i.coordinateToVector3([t,e],0),h=(new o.Matrix4).makeTranslation(c.x,c.y,0),f=i.distanceToVector3(r,r).x,p=0;p<=360;){var g=(a=void 0,a=0,(s=p)<=90?a=-s:s>90&&s<=180||s>180&&s<=270?a=180-s:s>270&&s<360&&(a=360-s),{rotation:a}),d=y_(p,f,h),A=l.pointAtResToCoord(d,l.getGLRes());u.push({coord:[A.x,A.y],rotation:g.rotation}),p+=n}return u},exports.getVPointGeojson=m_,exports.gisCommon=H_,exports.gltfLoadClass=VC,exports.imgClass=B_,exports.layerClass=DM,exports.layerClassNoOverride=FM,exports.line2Object=LB,exports.line2Polygon=function(t,e){for(var r=[],n=[],o=0;o<t.length-1;o++){var s=[],a=o+1,u=m_(t[o][0],t[o][1],t[a][0],t[a][1],50,0,e);s.push(u.features[0].geometry.coordinates[0][0][0]),s.push(u.features[0].geometry.coordinates[0][0][1]);var l=m_(t[a][0],t[a][1],t[o][0],t[o][1],50,0,e);s.push(l.features[0].geometry.coordinates[0][0][0]),s.push(l.features[0].geometry.coordinates[0][0][1]),s.push(u.features[0].geometry.coordinates[0][0][0]);var c={type:"FeatureCollection",features:[{type:"Feature",properties:{_draw_type:"line"},geometry:{type:"MultiPolygon",coordinates:[[s]]}}]};r.push(s);var h=new i.MultiPolygon(c.features[0].geometry.coordinates);n.push(h)}var f=[];f.push(r[0][0]),f.push(r[0][1]);for(var p=0;p<r.length-1;p++){var g=n[p],d=n[p+1],A=r[p],y=r[p+1],v=__(g,d);if(I_(v,0===p?A[2]:y[1])){var m=x_(v,A,y,t);f.push(m)}else f.push(A[2]),f.push(y[1])}f.push(r[r.length-1][2]),f.push(r[r.length-1][3]);for(var _=r.length-1;_>0;_--){var I=n[_],E=n[_-1],x=r[_],w=r[_-1],C=__(I,E);if(I_(C,x[4])){var b=x_(C,x,w,t);f.push(b)}else f.push(x[4]),f.push(w[3])}return f.push(r[0][0]),f},exports.lineLength=A_,exports.outlineBloomClass=MM,exports.overLayer=OM,exports.planeGifClass=bB,exports.planeMark=aI,exports.planeSectorClass=U_,exports.polygonClass=OB,exports.polylineClass=Zb,exports.radarClass=T_,exports.rippleWallClass=Yb,exports.sectorClass=F_,exports.shockClass=V_,exports.shockMarkerClass=qM,exports.sleep=u_,exports.tileClass=UC,exports.tripHeight=PB,exports.tripHeight1=DB,exports.tripLineClass=FB,exports.tubeClass=MB,exports.turf=r_,exports.verticalFatLineClass=xB,exports.windClass=tL;
|
|
161
|
+
*/function UM(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function GM(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}function zM(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):function(t,e){for(var r=Object.getOwnPropertyNames(e),n=0;n<r.length;n++){var i=r[n],o=Object.getOwnPropertyDescriptor(e,i);o&&o.configurable&&void 0===t[i]&&Object.defineProperty(t,i,o)}}(t,e))}var VM,jM={markerType:"ellipse",markerFill:(VM=[135,196,240],{type:"radial",colorStops:[[.7,"rgba("+VM.join()+", 0.5)"],[.3,"rgba("+VM.join()+", 1)"],[.2,"rgba("+VM.join()+", 1)"],[0,"rgba("+VM.join()+", 0)"]]}),markerFillOpacity:.8,markerLineWidth:0,markerWidth:16,markerHeight:16},HM=function(e){function r(){return UM(this,r),GM(this,e.apply(this,arguments))}return zM(r,e),r.prototype.addGeometry=function(r){return r instanceof t.Geometry&&(r=[r]),r.forEach((function(e,r){if(!(e instanceof t.Marker))throw new Error("The geometry at "+r+" to add is not a maptalks.Marker")})),e.prototype.addGeometry.apply(this,arguments)},r.fromJSON=function(e){if(!e||"AnimateMarkerLayer"!==e.type)return null;for(var n=new r(e.id,e.options),i=e.geometries,o=[],s=0;s<i.length;s++){var a=t.Geometry.fromJSON(i[s]);a&&o.push(a)}return n.addGeometry(o),e.style&&n.setStyle(e.style),n},r}(t.VectorLayer);HM.mergeOptions({animation:"scale,fade",randomAnimation:!0,animationDuration:3e3}),HM.registerJSONType("AnimateMarkerLayer"),HM.registerRenderer("canvas",function(e){function r(){return UM(this,r),GM(this,e.apply(this,arguments))}return zM(r,e),r.prototype.draw=function(){this._needUpdate&&(this._prepare(),this._needUpdate=!1),this.prepareCanvas();var t=this.getMap(),e=this._currentMarkers;this._drawnExtent&&t.getExtent().equals(this._drawnExtent)&&(e=this._drawnMarkers),this._drawAllMarkers(e),this._drawnExtent=t.getExtent(),this.layer.isLoaded()||this.completeRender()},r.prototype.drawOnInteracting=function(){this._drawnMarkers&&0!==this._drawnMarkers.length&&this._drawAllMarkers(this._drawnMarkers)},r.prototype.needToRedraw=function(){return!!this.layer.options.animation||e.prototype.needToRedraw.call(this)},r.prototype.onCanvasCreate=function(){this._prepare()},r.prototype.onGeometryAdd=function(){this._redraw()},r.prototype.onGeometryRemove=function(){this._redraw()},r.prototype.onGeometrySymbolChange=function(){this._redraw()},r.prototype.onGeometryPositionChange=function(){this._redraw()},r.prototype.onGeometryShow=function(){this._redraw()},r.prototype.onGeometryHide=function(){this._redraw()},r.prototype.onGeometryPropertiesChange=function(t){if(t&&this.layer.getStyle())for(var e=0;e<t.length;e++)this.layer._styleGeometry(t[e])},r.prototype._redraw=function(){delete this._drawnMarkers,delete this._drawnExtent,this._needUpdate=!0},r.prototype._drawAllMarkers=function(t){var e=this,r=this.getMap(),n=r.getContainerExtent(),i=this._drawnTime=Date.now(),o=this._drawnAnim=this._getAnimation(),s=t!==this._drawnMarkers;s&&(this._drawnMarkers=[]),t.forEach((function(t){if(s){if(t.g.isVisible()){var a=r._prjToContainerPoint(t.coordinates);n.contains(a)&&(e._drawMarker(t,a,o,i),e._drawnMarkers.push(t))}}else{var u=r._prjToContainerPoint(t.coordinates);e._drawMarker(t,u,o,i)}}),this)},r.prototype._drawMarker=function(t,e,r,n){var i=this.layer.options.animationDuration,o=this.context,s=o.globalAlpha,a=(n-t.start)%i/i,u=r.fade&&a>=.5?2-2*a:1,l=r.scale?a:1,c=t.cacheKey,h=this._spriteCache[c],f=h.offset,p=h.canvas.width,g=h.canvas.height;h&&u>0&&(o.globalAlpha=s*u,o.drawImage(h.canvas,e.x+f.x-p*l/2,e.y+f.y-g*l/2,p*l,g*l),o.globalAlpha=s)},r.prototype._prepare=function(){var t=this,e=[],r={},n=this.getMap().getProjection();this.layer.forEach((function(i){t._currentGeo=i;var o=i._getInternalSymbol()===i.options.symbol?jM:i._getInternalSymbol(),s=JSON.stringify(o);r[s]||(r[s]=o),e.push({coordinates:n.project(i.getCoordinates()),cacheKey:s,start:t.layer.options.randomAnimation?Math.random()*t.layer.options.animationDuration:0,g:i})})),this._prepareSprites(r),this._currentMarkers=e},r.prototype._prepareSprites=function(e){for(var r in this._spriteCache={},e){var n=e[r],i=new t.Marker([0,0],{symbol:n})._getSprite(this.resources);this._spriteCache[r]=i}},r.prototype.onRemove=function(){delete this._spriteCache,delete this._currentMarkers,delete this._drawnMarkers,delete this._drawnExtent},r.prototype._getAnimation=function(){for(var t,e={fade:!1,scale:!1},r=this.layer.options.animation?this.layer.options.animation.split(","):[],n=0;n<r.length;n++){var i=(t=r[n]).trim?t.trim():t.replace(/^\s+|\s+$/g,"");"fade"===i?e.fade=!0:"scale"===i&&(e.scale=!0)}return e},r}(t.renderer.OverlayLayerCanvasRenderer)),"undefined"!=typeof console&&console.log("maptalks.animatemarker v0.4.1, requires maptalks@>=0.25.0.");var qM=function(){function t(e,r,n){c(this,t),this.map=n;var o=r.color||[255,0,0],s=r.opacity||.8,a=r.width||20,u=r.height||20,l=r.animationDuration||3e3,h=r.markerDx||0,f=r.markerDy||0,p=i.GeoJSON.toGeometry(e);this.layer=new HM(i.Util.GUID(),p,{animation:"scale,fade",animationDuration:l,randomAnimation:!0,geometryEvents:!1,hitDetect:!1}).setStyle([{symbol:{markerType:"ellipse",markerLineWidth:0,markerFill:this.getGradient(o),markerFillOpacity:s,markerWidth:a,markerHeight:u,markerDx:h,markerDy:f}}]).addTo(n)}return f(t,[{key:"getGradient",value:function(t){return{type:"radial",colorStops:[[.7,"rgba("+t.join()+", 0.5)"],[.3,"rgba("+t.join()+", 1)"],[.2,"rgba("+t.join()+", 1)"],[0,"rgba("+t.join()+", 0)"]]}}},{key:"hide",value:function(){var t;null===(t=this.layer)||void 0===t||t.hide()}},{key:"show",value:function(){this.layer.show()}},{key:"setZIndex",value:function(t){this.layer.setZIndex(t)}},{key:"dispose",value:function(){this.map.removeLayer(this.layer),delete this.layer}}]),t}();const YM=Object.prototype.hasOwnProperty,XM="undefined"!=typeof Symbol?Symbol.toStringTag:void 0;function WM(t){if(!function(t){const e=typeof t;return null!==t&&("object"===e||"function"===e)}(t))return!1;const e=function(t){if(null===t)return void 0===t?"[object Undefined]":"[object Null]";if(!XM||!(XM in Object(t)))return toString.call(t);const e=YM.call(t,XM),r=t[XM];let n=!1;try{t[XM]=void 0,n=!0}catch(t){}const i=Object.prototype.toString.call(t);return n&&(e?t[XM]=r:delete t[XM]),i}(t);return"[object Function]"===e||"[object AsyncFunction]"===e||"[object GeneratorFunction]"===e||"[object Proxy]"===e}function JM(t){return"[object Number]"===Object.prototype.toString.call(t)&&!isNaN(t)}function KM(t,...e){return Object.assign(t,...e)}const ZM={};function $M(t,e){ZM[e]||(!function(t,e){console.warn(`${e||"wind-layer"}: ${t}`)}(e,t),ZM[e]=!0)}function tT(t){return null!=t&&!isNaN(t)}class eT{constructor(t,e){this.u=t,this.v=e,this.m=this.magnitude()}magnitude(){return Math.sqrt(this.u**2+this.v**2)}directionTo(){let t=Math.atan2(this.u,this.v)*(180/Math.PI);return t<0&&(t+=360),t}directionFrom(){return(this.directionTo()+180)%360}}class rT{constructor(t){this.grid=[],this.xmin=t.xmin,this.xmax=t.xmax,this.ymin=t.ymin,this.ymax=t.ymax,this.cols=t.cols,this.rows=t.rows,this.us=t.us,this.vs=t.vs,this.deltaX=t.deltaX,this.deltaY=t.deltaY,this.flipY=Boolean(t.flipY),this.ymin=Math.min(t.ymax,t.ymin),this.ymax=Math.max(t.ymax,t.ymin),this.deltaY<0&&this.ymin<this.ymax||(void 0===t.flipY&&(this.flipY=!0),console.warn("[wind-core]: The data is flipY")),this.isFields=!0;const e=Math.ceil((this.xmax-this.xmin)/t.deltaX),r=Math.ceil((this.ymax-this.ymin)/t.deltaY);e===this.cols&&r===this.rows||console.warn("[wind-core]: The data grid not equal"),this.isContinuous=Math.floor(this.cols*t.deltaX)>=360,this.translateX="translateX"in t?t.translateX:this.xmax>180,"wrappedX"in t&&$M("[wind-core]: ","`wrappedX` namespace will deprecated please use `translateX` instead!"),this.wrapX=Boolean(t.wrapX),this.grid=this.buildGrid(),this.range=this.calculateRange()}buildGrid(){let t=[],e=0;const{rows:r,cols:n,us:i,vs:o}=this;for(let s=0;s<r;s++){const r=[];for(let t=0;t<n;t++,e++){let n=i[e],s=o[e],a=this.isValid(n)&&this.isValid(s);r[t]=a?new eT(n,s):null}this.isContinuous&&r.push(r[0]),t[s]=r}return t}release(){this.grid=[]}extent(){return[this.xmin,this.ymin,this.xmax,this.ymax]}bilinearInterpolateVector(t,e,r,n,i,o){const s=1-t,a=1-e,u=s*a,l=t*a,c=s*e,h=t*e,f=r.u*u+n.u*l+i.u*c+o.u*h,p=r.v*u+n.v*l+i.v*c+o.v*h;return new eT(f,p)}calculateRange(){if(!this.grid||!this.grid[0])return;const t=this.grid.length,e=this.grid[0].length;let r,n;for(let i=0;i<t;i++)for(let t=0;t<e;t++){const e=this.grid[i][t];if(null!==e){const t=e.m||e.magnitude();void 0===r?r=t:void 0===n?(n=t,r=Math.min(r,n),n=Math.max(r,n)):(r=Math.min(t,r),n=Math.max(t,n))}}return[r,n]}isValid(t){return null!=t}getWrappedLongitudes(){let t=this.xmin,e=this.xmax;return this.translateX&&(this.isContinuous?(t=-180,e=180):(e=this.xmax-360,t=this.xmin-360)),[t,e]}contains(t,e){const[r,n]=this.getWrappedLongitudes();let i,o=t>=r&&t<=n;return i=this.deltaY>=0?e>=this.ymin&&e<=this.ymax:e>=this.ymax&&e<=this.ymin,o&&i}getDecimalIndexes(t,e){const r=function(t,e){return t-e*Math.floor(t/e)}(t-this.xmin,360)/this.deltaX;if(this.flipY){return[r,(this.ymax-e)/this.deltaY]}return[r,(this.ymin+e)/this.deltaY]}valueAt(t,e){let r=!1;if((this.wrapX||this.contains(t,e))&&(r=!0),!r)return null;const n=this.getDecimalIndexes(t,e);let i=Math.floor(n[0]),o=Math.floor(n[1]);const s=this.clampColumnIndex(i),a=this.clampRowIndex(o);return this.valueAtIndexes(s,a)}interpolatedValueAt(t,e){let r=!1;if((this.wrapX||this.contains(t,e))&&(r=!0),!r)return null;let[n,i]=this.getDecimalIndexes(t,e);return this.interpolatePoint(n,i)}hasValueAt(t,e){return null!==this.valueAt(t,e)}interpolatePoint(t,e){const r=this.getFourSurroundingIndexes(t,e),[n,i,o,s]=r;let a=this.getFourSurroundingValues(n,i,o,s);if(a){const[r,i,s,u]=a;return this.bilinearInterpolateVector(t-n,e-o,r,i,s,u)}return null}clampColumnIndex(t){let e=t;t<0&&(e=0);let r=this.cols-1;return t>r&&(e=r),e}clampRowIndex(t){let e=t;t<0&&(e=0);let r=this.rows-1;return t>r&&(e=r),e}getFourSurroundingIndexes(t,e){let r=Math.floor(t),n=r+1;this.isContinuous&&n>=this.cols&&(n=0),n=this.clampColumnIndex(n);let i=this.clampRowIndex(Math.floor(e));return[r,n,i,this.clampRowIndex(i+1)]}getFourSurroundingValues(t,e,r,n){let i;if(i=this.grid[r]){const r=i[t],o=i[e];if(this.isValid(r)&&this.isValid(o)&&(i=this.grid[n])){const n=i[t],s=i[e];if(this.isValid(n)&&this.isValid(s))return[r,o,n,s]}}return null}valueAtIndexes(t,e){return this.grid[e][t]}lonLatAtIndexes(t,e){return[this.longitudeAtX(t),this.latitudeAtY(e)]}longitudeAtX(t){let e=this.deltaX/2,r=this.xmin+e+t*this.deltaX;return this.translateX&&(r=r>180?r-360:r),r}latitudeAtY(t){let e=this.deltaY/2;return this.ymax-e-t*this.deltaY}randomize(t={},e,r,n){let i=Math.random()*(e||this.cols)|0,o=Math.random()*(r||this.rows)|0;const s=n([i,o]);return null!==s?(t.x=s[0],t.y=s[1]):(t.x=this.longitudeAtX(i),t.y=this.latitudeAtY(o)),t}checkFields(){return this.isFields}}const nT={globalAlpha:.9,lineWidth:1,colorScale:"#fff",velocityScale:.04,maxAge:90,paths:800,frameRate:20,useCoordsDraw:!0,gpet:!0};function iT(t,e,r,n){return Math.max(0,Math.min(n.length-1,Math.round((t-e)/(r-e)*(n.length-1))))}class oT{constructor(t,e,r){if(this.particles=[],this.generated=!1,this.ctx=t,!this.ctx)throw new Error("ctx error");this.animate=this.animate.bind(this),this.setOptions(e),r&&this.updateData(r)}setOptions(t){this.options={...nT,...t};const{width:e,height:r}=this.ctx.canvas;"particleAge"in t&&!("maxAge"in t)&&JM(this.options.particleAge)&&(this.options.maxAge=this.options.particleAge),"particleMultiplier"in t&&!("paths"in t)&&JM(this.options.particleMultiplier)&&(this.options.paths=Math.round(e*r*this.options.particleMultiplier)),this.prerender()}getOptions(){return this.options}updateData(t){this.field=t,this.generated&&(this.particles=this.prepareParticlePaths())}project(...t){throw new Error("project must be overriden")}unproject(...t){throw new Error("unproject must be overriden")}intersectsCoordinate(t){throw new Error("must be overriden")}clearCanvas(){this.stop(),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.forceStop=!1}start(){this.starting=!0,this.forceStop=!1,this.then=Date.now(),this.animate()}stop(){cancelAnimationFrame(this.animationLoop),this.starting=!1,this.forceStop=!0}animate(){this.animationLoop&&cancelAnimationFrame(this.animationLoop),this.animationLoop=requestAnimationFrame(this.animate);const t=Date.now(),e=t-this.then;e>this.options.frameRate&&(this.then=t-e%this.options.frameRate,this.render())}prerender(){this.generated=!1,this.field&&(this.particles=this.prepareParticlePaths(),this.generated=!0,this.starting||this.forceStop||(this.starting=!0,this.then=Date.now(),this.animate()))}render(){this.moveParticles(),this.drawParticles(),this.postrender()}postrender(){}moveParticles(){const{width:t,height:e}=this.ctx.canvas,r=this.particles,n=this.options.maxAge,i=WM(this.options.velocityScale)?this.options.velocityScale():this.options.velocityScale;let o=0;const s=r.length;for(;o<s;o++){const s=r[o];s.age>n&&(s.age=0,this.field.randomize(s,t,e,this.unproject));const a=s.x,u=s.y,l=this.field.interpolatedValueAt(a,u);if(null===l)s.age=n;else{const t=a+l.u*i,e=u+l.v*i;this.field.hasValueAt(t,e)?(s.xt=t,s.yt=e,s.m=l.m):(s.x=t,s.y=e,s.age=n)}s.age++}}fadeIn(){const t=this.ctx.globalCompositeOperation;this.ctx.globalCompositeOperation="destination-in",this.ctx.fillRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.globalCompositeOperation=t}drawParticles(){const t=this.particles;var e;this.fadeIn(),this.ctx.globalAlpha=this.options.globalAlpha,this.ctx.fillStyle=`rgba(0, 0, 0, ${this.options.globalAlpha})`,this.ctx.lineWidth=JM(this.options.lineWidth)?this.options.lineWidth:1,this.ctx.strokeStyle=null!=(e=this.options.colorScale)&&("string"==typeof e||null!==e.constructor&&e.constructor===String)?this.options.colorScale:"#fff";let r=0;const n=t.length;if(this.field&&n>0){let e,i;for(tT(this.options.minVelocity)&&tT(this.options.maxVelocity)?(e=this.options.minVelocity,i=this.options.maxVelocity):[e,i]=this.field.range;r<n;r++)this[this.options.useCoordsDraw?"drawCoordsParticle":"drawPixelParticle"](t[r],e,i)}}drawPixelParticle(t,e,r){const n=[t.x,t.y],i=[t.xt,t.yt];if(i&&n&&tT(i[0])&&tT(i[1])&&tT(n[0])&&tT(n[1])&&t.age<=this.options.maxAge){if(this.ctx.beginPath(),this.ctx.moveTo(n[0],n[1]),this.ctx.lineTo(i[0],i[1]),WM(this.options.colorScale))this.ctx.strokeStyle=this.options.colorScale(t.m);else if(Array.isArray(this.options.colorScale)){const n=iT(t.m,e,r,this.options.colorScale);this.ctx.strokeStyle=this.options.colorScale[n]}WM(this.options.lineWidth)&&(this.ctx.lineWidth=this.options.lineWidth(t.m)),t.x=t.xt,t.y=t.yt,this.ctx.stroke()}}drawCoordsParticle(t,e,r){const n=[t.x,t.y],i=[t.xt,t.yt];if(i&&n&&tT(i[0])&&tT(i[1])&&tT(n[0])&&tT(n[1])&&this.intersectsCoordinate(i)&&t.age<=this.options.maxAge){const o=this.project(n),s=this.project(i);if(o&&s){if(this.ctx.beginPath(),this.ctx.moveTo(o[0],o[1]),this.ctx.lineTo(s[0],s[1]),t.x=t.xt,t.y=t.yt,WM(this.options.colorScale))this.ctx.strokeStyle=this.options.colorScale(t.m);else if(Array.isArray(this.options.colorScale)){const n=iT(t.m,e,r,this.options.colorScale);this.ctx.strokeStyle=this.options.colorScale[n]}WM(this.options.lineWidth)&&(this.ctx.lineWidth=this.options.lineWidth(t.m)),this.ctx.stroke()}}}prepareParticlePaths(){const{width:t,height:e}=this.ctx.canvas,r="function"==typeof this.options.paths?this.options.paths(this):this.options.paths,n=[];if(!this.field)return[];let i=0;for(;i<r;i++)n.push(this.field.randomize({age:this.randomize()},t,e,this.unproject));return n}randomize(){return Math.floor(Math.random()*this.options.maxAge)}}oT.Field=rT;var sT=null;try{var aT="undefined"!=typeof module&&"function"==typeof module.require&&module.require("worker_threads")||"function"==typeof __non_webpack_require__&&__non_webpack_require__("worker_threads")||"function"==typeof require&&require("worker_threads");sT=aT.Worker}catch(t){}function uT(t,e,r){var n=void 0===e?null:e,i=function(t,e){return Buffer.from(t,"base64").toString(e?"utf16":"utf8")}(t,void 0!==r&&r),o=i.indexOf("\n",10)+1,s=i.substring(o)+(n?"//# sourceMappingURL="+n:"");return function(t){return new sT(s,Object.assign({},t,{eval:!0}))}}function lT(t,e,r){var n=void 0===e?null:e,i=function(t,e){var r=atob(t);if(e){for(var n=new Uint8Array(r.length),i=0,o=r.length;i<o;++i)n[i]=r.charCodeAt(i);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}(t,void 0!==r&&r),o=i.indexOf("\n",10)+1,s=i.substring(o)+(n?"//# sourceMappingURL="+n:""),a=new Blob([s],{type:"application/javascript"});return URL.createObjectURL(a)}var cT="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);var hT,fT,pT,gT=(hT="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICd1c2Ugc3RyaWN0JzsKCiAgZnVuY3Rpb24gY2FsY01pbk1heChhcnJheSkgewogICAgbGV0IG1pbiA9IEluZmluaXR5OwogICAgbGV0IG1heCA9IEluZmluaXR5OwogICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcnJheS5sZW5ndGg7IGkrKykgewogICAgICBjb25zdCB2YWwgPSBhcnJheVtpXTsKICAgICAgaWYgKG1pbiA9PT0gSW5maW5pdHkpIHsKICAgICAgICBtaW4gPSB2YWw7CiAgICAgIH0gZWxzZSBpZiAobWF4ID09PSBJbmZpbml0eSkgewogICAgICAgIG1heCA9IHZhbDsKICAgICAgICBtaW4gP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DQUFDLENBQUEsQ0FBQTtFQUFBLEdBQy9FLE1BQUE7RUFDTCxJQUFBLE1BQU0sYUFBYSxPQUFRLENBQUEsQ0FBQSxDQUFBLENBQUE7RUFDM0IsSUFBQSxNQUFNLENBQUMsR0FBQSxFQUFLLEdBQUcsQ0FBQSxHQUFJLFdBQVcsVUFBVSxDQUFBLENBQUE7RUFDeEMsSUFBQSxNQUFNLFlBQWUsR0FBQSxJQUFJLFVBQVcsQ0FBQSxVQUFBLENBQVcsU0FBUyxDQUFDLENBQUEsQ0FBQTtFQUN6RCxJQUFBLEtBQUEsSUFBUyxDQUFJLEdBQUEsQ0FBQSxFQUFHLENBQUksR0FBQSxVQUFBLENBQVcsUUFBUSxDQUFLLEVBQUEsRUFBQTtFQUMxQyxNQUFBLE1BQU0sQ0FBSSxHQUFBLEdBQUEsSUFBTyxVQUFXLENBQUEsQ0FBQSxDQUFBLEdBQUssUUFBUSxHQUFNLEdBQUEsR0FBQSxDQUFBLENBQUE7RUFDL0MsTUFBYSxZQUFBLENBQUEsR0FBQSxDQUFJLENBQUMsQ0FBRyxFQUFBLENBQUEsRUFBRyxHQUFHLEdBQUcsQ0FBQSxFQUFHLElBQUksQ0FBQyxDQUFBLENBQUE7RUFBQSxLQUN4QztFQUVBLElBQUksR0FBQSxDQUFBLFdBQUEsQ0FBWSxDQUFDLFlBQUEsQ0FBYSxNQUFRLEVBQUEsR0FBQSxFQUFLLEdBQUcsQ0FBRyxFQUFBLENBQUMsWUFBYSxDQUFBLE1BQU0sQ0FBQyxDQUFBLENBQUE7RUFBQSxHQUN4RTtFQUNGLENBQUMsQ0FBQTs7Ozs7OyJ9",pT=!1,cT?uT(hT,fT,pT):function(t,e,r){var n;return function(i){return n=n||lT(t,e,r),new Worker(n,i)}}(hT,fT,pT));function dT(t){return"number"==typeof t&&!isNaN(t)}function AT(t){return t-Math.fround(t)}function yT(t,e){if(!t)return!1;if(e=e||devicePixelRatio||1,t instanceof HTMLCanvasElement){const r=t.clientWidth*e,n=t.clientHeight*e;if(r<=0||n<=0)return!1;if(t.width!==r||t.height!==n)return t.width=r,t.height=n,!0}return!1}function vT(t,e,r){const n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS)){const e=t.getShaderInfoLog(n)||"";throw t.deleteShader(n),new Error(e)}return n}function mT(t,e,r,n,i){const o=t.createTexture();return t.bindTexture(t.TEXTURE_2D,o),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,e),r instanceof Uint8Array?t.texImage2D(t.TEXTURE_2D,0,t.RGBA,n,i,0,t.RGBA,t.UNSIGNED_BYTE,r):t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,r),t.bindTexture(t.TEXTURE_2D,null),o}function _T(t,e){const r=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,r),e&&t.bufferData(t.ARRAY_BUFFER,e,t.STATIC_DRAW),r}function IT(t,e,r=1,n=0,i){const[o,s,a,u]=e;let l=0;t.clearColor(o,s,a,u),l|=t.COLOR_BUFFER_BIT,void 0!==r&&(t.clearDepth(r),l|=t.DEPTH_BUFFER_BIT),void 0!==n&&(t.clearStencil(0|n),l|=t.STENCIL_BUFFER_BIT),t.clear(l)}class ET{constructor(t,e,r,n){this.vertShader="",this.fragShader="",e&&(this.vertShader=e),r&&(this.fragShader=r),this.program=function(t,e,r){const n=vT(t,t.VERTEX_SHADER,e),i=vT(t,t.FRAGMENT_SHADER,r),o=t.createProgram();if(null!==o&&(t.attachShader(o,n),t.attachShader(o,i),t.linkProgram(o),!t.getProgramParameter(o,t.LINK_STATUS)))throw new Error(t.getProgramInfoLog(o)||"");return o}(t,function(t,e={}){return Object.keys(e).map((r=>{e[r]&&(t=t.replace(new RegExp(r,"g"),`${e[r]} \n`))})),t}(this.vertShader,n),this.fragShader),this.gl=t,this.textureUnit=0,this.uniformSetters=this.createUniformSetters(),this.attribSetters=this.createAttributeSetters(),this.transfromStack=[]}active(){return this.gl.useProgram(this.program),this}deactive(){return this.gl.deleteProgram(this.program),this}getBindPointForSamplerType(t,e){return e===t.SAMPLER_2D?t.TEXTURE_2D:e===t.SAMPLER_CUBE?t.TEXTURE_CUBE_MAP:void 0}createUniformSetter(t,e){const{gl:r}=this,n=r.getUniformLocation(t,e.name),i=e.type,o=e.size>1&&"[0]"===e.name.substr(-3);if(i===r.FLOAT&&o)return function(t){r.uniform1fv(n,t)};if(i===r.FLOAT)return function(t){r.uniform1f(n,t)};if(i===r.FLOAT_VEC2)return function(t){r.uniform2fv(n,t)};if(i===r.FLOAT_VEC3)return function(t){r.uniform3fv(n,t)};if(i===r.FLOAT_VEC4)return function(t){r.uniform4fv(n,t)};if(i===r.INT&&o)return function(t){r.uniform1iv(n,t)};if(i===r.INT)return function(t){r.uniform1i(n,t)};if(i===r.INT_VEC2)return function(t){r.uniform2iv(n,t)};if(i===r.INT_VEC3)return function(t){r.uniform3iv(n,t)};if(i===r.INT_VEC4)return function(t){r.uniform4iv(n,t)};if(i===r.BOOL)return function(t){r.uniform1iv(n,t)};if(i===r.BOOL_VEC2)return function(t){r.uniform2iv(n,t)};if(i===r.BOOL_VEC3)return function(t){r.uniform3iv(n,t)};if(i===r.BOOL_VEC4)return function(t){r.uniform4iv(n,t)};if(i===r.FLOAT_MAT2)return function(t){r.uniformMatrix2fv(n,!1,t)};if(i===r.FLOAT_MAT3)return function(t){r.uniformMatrix3fv(n,!1,t)};if(i===r.FLOAT_MAT4)return function(t){r.uniformMatrix4fv(n,!1,t)};if((i===r.SAMPLER_2D||i===r.SAMPLER_CUBE)&&o){const t=[];for(let r=0;r<e.size;++r)t.push(this.textureUnit++);return s=this.getBindPointForSamplerType(r,i),a=t,function(t){r.uniform1iv(n,a),t.forEach((function(t,e){r.activeTexture(r.TEXTURE0+a[e]),void 0!==s&&r.bindTexture(s,t)}))}}var s,a;if(i===r.SAMPLER_2D||i===r.SAMPLER_CUBE)return function(t,e){return function(i){r.uniform1i(n,e),r.activeTexture(r.TEXTURE0+e),void 0!==t&&r.bindTexture(t,i)}}(this.getBindPointForSamplerType(r,i),this.textureUnit++);throw new Error("unknown type: 0x"+i.toString(16))}createUniformSetters(){const{gl:t}=this;this.textureUnit=0;const e={};if(null!==this.program){const r=t.getProgramParameter(this.program,t.ACTIVE_UNIFORMS);for(let n=0;n<r;++n){const r=t.getActiveUniform(this.program,n);if(!r)break;let i=r.name;"[0]"===i.substr(-3)&&(i=i.substr(0,i.length-3));const o=this.createUniformSetter(this.program,r);e[i]=o}}return e}createAttribSetter(t){const{gl:e}=this;return function(r){e.bindBuffer(e.ARRAY_BUFFER,r.buffer),e.enableVertexAttribArray(t),void 0===r.numComponents&&void 0===r.size||e.vertexAttribPointer(t,r.numComponents||r.size,r.type||e.FLOAT,r.normalize||!1,r.stride||0,r.offset||0)}}createAttributeSetters(){const{gl:t}=this,e={};if(null!==this.program){const r=t.getProgramParameter(this.program,t.ACTIVE_ATTRIBUTES);for(let n=0;n<r;++n){const r=t.getActiveAttrib(this.program,n);if(!r)break;const i=t.getAttribLocation(this.program,r.name);e[r.name]=this.createAttribSetter(i)}}return e}setAttributes(t,e){return e=e?e.attribSetters||e:this.attribSetters,Object.keys(t).forEach((function(r){const n=e[r];n&&n(t[r])})),this}setUniforms(t,e){return e=e?e.uniformSetters||e:this.uniformSetters,Object.keys(t).forEach((function(r){const n=e[r];n&&n(t[r])})),this}elements(t){return this.elementsBuffer||(this.elementsBuffer=this.gl.createBuffer()),this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this.elementsBuffer),t.data&&this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER,t.data,t.usage||this.gl.STATIC_DRAW),void 0!==t.count&&this.runTimes(t.count),t.primitive&&this.setPrimitive(t.primitive),this}clear(t){return IT(this.gl,t),this.transfromStack=[],this}runTimes(t){return this.count=t||0,this}setPrimitive(t){return this.primitive=t||this.gl.TRIANGLES,this}resize(t,e){return void 0===t||void 0===e?(yT(this.gl.canvas),this.gl.viewport(0,0,this.gl.canvas.width,this.gl.canvas.height)):this.gl.viewport(0,0,t,e),this}draw(){throw new Error("should override")}translate(){throw new Error("should override")}rotate(){throw new Error("should override")}scale(){throw new Error("should override")}destroyed(){throw new Error("should override")}}var xT="precision highp float;\n#define GLSLIFY 1\nuniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform vec2 u_image_res;uniform vec2 u_range;uniform vec2 u_color_range;uniform vec2 u_display_range;uniform float u_opacity;varying vec2 v_tex_pos;float calcTexture(const vec2 uv){return texture2D(u_image,uv).r;}float bilinear(const vec2 uv){vec2 px=1.0/u_image_res;vec2 vc=(floor(uv*u_image_res))*px;vec2 f=fract(uv*u_image_res);float tl=calcTexture(vc);float tr=calcTexture(vc+vec2(px.x,0));float bl=calcTexture(vc+vec2(0,px.y));float br=calcTexture(vc+px);return mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);}float getValue(const vec2 uv){float min=u_range.x;float max=u_range.y;float r=bilinear(uv);return r*(max-min)+min;}const float PI=3.14159265359;vec2 mercatorToWGS84(vec2 xy){float y=radians(180.0-xy.y*360.0);y=360.0/PI*atan(exp(y))-90.0;y=y/-180.0+0.5;return vec2(xy.x,y);}void main(){vec2 globalWGS84=mercatorToWGS84(v_tex_pos);float value=getValue(globalWGS84);float value_t=(value-u_color_range.x)/(u_color_range.y-u_color_range.x);vec2 ramp_pos=vec2(fract(16.0*value_t),floor(16.0*value_t)/16.0);vec4 color=texture2D(u_color_ramp,ramp_pos);bool display=value<u_display_range.y&&value>u_display_range.x;if(display){gl_FragColor=vec4(floor(255.0*color*u_opacity)/255.0);}else{gl_FragColor=vec4(0.0,0.0,0.0,0.0);}}",wT="#define GLSLIFY 1\nattribute vec3 instancePositions;attribute vec3 instancePositions64Low;attribute vec2 a_texCoord;uniform mat4 u_matrix;uniform vec4 u_cameraEye;uniform vec4 u_cameraEye64Low;uniform float u_offset;uniform sampler2D u_image;uniform vec2 u_image_res;uniform vec2 u_range;uniform vec2 u_mapping_range;varying vec2 v_tex_pos;varying float v_value;float calcTexture(const vec2 uv){return texture2D(u_image,uv).r;}float bilinear(const vec2 uv){vec2 px=1.0/u_image_res;vec2 vc=(floor(uv*u_image_res))*px;vec2 f=fract(uv*u_image_res);float tl=calcTexture(vc);float tr=calcTexture(vc+vec2(px.x,0));float bl=calcTexture(vc+vec2(0,px.y));float br=calcTexture(vc+px);return mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);}float getValue(const vec2 uv){float min=u_mapping_range.x;float max=u_mapping_range.y;float r=bilinear(uv);return r*(max-min)+min;}const float PI=3.14159265359;vec2 mercatorToWGS84(vec2 xy){float y=radians(180.0-xy.y*360.0);y=360.0/PI*atan(exp(y))-90.0;y=y/-180.0+0.5;return vec2(xy.x,y);}\n#modules-transformZ\nvoid main(){v_tex_pos=a_texCoord;vec2 globalWGS84=mercatorToWGS84(v_tex_pos);float value=getValue(globalWGS84);float z=transformZ(value,instancePositions);vec4 pos=vec4(instancePositions-u_cameraEye.xyz,0.0);pos+=vec4(instancePositions64Low-u_cameraEye64Low.xyz,0.0);\n#modules-project\n}";class CT extends ET{constructor(t,e,r,n){super(t,e||wT,r||xT,n||{}),this.vertShader=wT,this.fragShader=xT}draw(){if(void 0!==this.checkExt){const t=this.primitive||this.gl.TRIANGLES;this.checkExt?this.gl.drawElements(t,this.count,this.gl.UNSIGNED_INT,0):this.gl.drawElements(t,this.count,this.gl.UNSIGNED_SHORT,0)}else this.checkExt=this.gl.getExtension("OES_element_index_uint");return this}translate(){return this}rotate(){return this}scale(){return this}}function bT(t,e){const r=document.createElement("canvas"),n=r.getContext("2d");r.width=256,r.height=1;const{input:i}=function(t){if(Array.isArray(t)&&t.length>3){const e=t[0],r=t[1],n=[];for(let e=3;e<t.length;e+=2){const r=t[e],i=t[e+1];n.push({key:r,value:i})}return{operator:e,interpolation:{name:r[0],base:r[1]},input:n}}return console.warn("[wind-core]: style-parser style config invalid"),{}}(e);if(n&&i&&Array.isArray(i)){const e=i.map((t=>parseFloat(t.key))),r=[Math.min(...e),Math.max(...e)],[o,s]=[t[0]||r[0],t[1]||r[1]],a=n.createLinearGradient(0,0,256,0);for(let t=0;t<i.length;t+=1){const e=i[t].key,r=i[t].value;a.addColorStop((e-o)/(s-o),r)}return n.fillStyle=a,n.fillRect(0,0,256,1),{data:new Uint8Array(n.getImageData(0,0,256,1).data),colorRange:r}}return{}}function BT(t,e,r,n){const i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}const ST={};function MT(t,e,r,n,i){const o=`${t}_${r}`,s=n[r];if(dT(s))return ST[o]&&delete ST[o],s;if(s&&Array.isArray(s)&&(!ST[o]||i)&&(ST[o]=function(t){if(Array.isArray(t)&&t.length>3){const e=t[0],r=t[1],n=[];for(let e=3;e<t.length;e+=2){const r=t[e],i=t[e+1];n.push({key:r,value:i})}return{operator:e,interpolation:{name:r[0],base:r[1]},input:n}}return console.warn("[wind-core]: style-parser style config invalid"),{}}(s)),ST[o]){const{input:t,interpolation:r}=ST[o]||{};if(t&&Array.isArray(t)){const n=t.map((t=>t.key)),i=t.map((t=>t.value));if(e<=n[0])return i[0];const o=n.length;if(e>=n[o-1])return i[o-1];const s=function(t,e){const r=t.length-1;let n,i,o=0,s=r,a=0;for(;o<=s;)if(a=Math.floor((o+s)/2),n=t[a],i=t[a+1],n<=e){if(a===r||e<i)return a;o=a+1}else{if(!(n>e))throw new Error("Input is not a number.");s=a-1}return 0}(n,e),a=n.length-1,u=function(t,e,r,n){let i=0;return"exponential"===t.name?i=BT(e,t.base,r,n):"linear"===t.name?i=BT(e,1,r,n):"cubic-bezier"===t.name&&console.warn("interpolationFactor"),i}(r,e,n[s],n[s>=a?a:s+1]);return function(t,e,r){return t*(1-r)+e*r}(i[s],i[s>=a?a:s+1],u)}return 1}return 1}var TT="precision highp float;\n#define GLSLIFY 1\nuniform sampler2D u_wind;uniform sampler2D u_color_ramp;uniform vec2 u_image_res;uniform vec2 u_wind_min;uniform vec2 u_wind_max;uniform vec2 u_color_range;uniform vec2 u_display_range;uniform float u_opacity;varying vec2 v_tex_pos;vec2 windTexture(const vec2 uv){return texture2D(u_wind,uv).rg;}float bilinearU(const vec2 uv){vec2 px=1.0/u_image_res;vec2 vc=(floor(uv*u_image_res))*px;vec2 f=fract(uv*u_image_res);float tl=windTexture(vc).r;float tr=windTexture(vc+vec2(px.x,0)).r;float bl=windTexture(vc+vec2(0,px.y)).r;float br=windTexture(vc+px).r;return mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);}float bilinearV(const vec2 uv){vec2 px=1.0/u_image_res;vec2 vc=(floor(uv*u_image_res))*px;vec2 f=fract(uv*u_image_res);float tl=windTexture(vc).g;float tr=windTexture(vc+vec2(px.x,0.0)).g;float bl=windTexture(vc+vec2(0.0,px.y)).g;float br=windTexture(vc+px).g;return mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);}float getV(const vec2 uv){float min=u_wind_min.y;float max=u_wind_max.y;float r=bilinearV(uv);return r*(max-min)+min;}float getU(const vec2 uv){float min=u_wind_min.x;float max=u_wind_max.x;float r=bilinearU(uv);return r*(max-min)+min;}float windSpeed(const vec2 uv){float u=getU(uv);float v=getV(uv);return length(vec2(u,v));}const float PI=3.14159265359;vec2 mercatorToWGS84(vec2 xy){float y=radians(180.0-xy.y*360.0);y=360.0/PI*atan(exp(y))-90.0;y=y/-180.0+0.5;return vec2(xy.x,y);}void main(){vec2 globalWGS84=mercatorToWGS84(v_tex_pos);float value=windSpeed(globalWGS84);float value_t=(value-u_color_range.x)/(u_color_range.y-u_color_range.x);vec2 ramp_pos=vec2(fract(16.0*value_t),floor(16.0*value_t)/16.0);vec4 color=texture2D(u_color_ramp,ramp_pos);bool display=value<u_display_range.y&&value>u_display_range.x;if(display){gl_FragColor=vec4(floor(255.0*color*u_opacity)/255.0);}else{gl_FragColor=vec4(0.0,0.0,0.0,0.0);}}",LT="#define GLSLIFY 1\nattribute vec3 instancePositions;attribute vec3 instancePositions64Low;attribute vec2 a_texCoord;uniform mat4 u_matrix;uniform vec4 u_cameraEye;uniform vec4 u_cameraEye64Low;uniform float u_offset;uniform sampler2D u_wind;uniform vec2 u_image_res;uniform vec2 u_wind_min;uniform vec2 u_wind_max;uniform vec2 u_mapping_range;varying vec2 v_tex_pos;varying float v_value;vec2 windTexture(const vec2 uv){return texture2D(u_wind,uv).rg;}float bilinearU(const vec2 uv){vec2 px=1.0/u_image_res;vec2 vc=(floor(uv*u_image_res))*px;vec2 f=fract(uv*u_image_res);float tl=windTexture(vc).r;float tr=windTexture(vc+vec2(px.x,0)).r;float bl=windTexture(vc+vec2(0,px.y)).r;float br=windTexture(vc+px).r;return mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);}float bilinearV(const vec2 uv){vec2 px=1.0/u_image_res;vec2 vc=(floor(uv*u_image_res))*px;vec2 f=fract(uv*u_image_res);float tl=windTexture(vc).g;float tr=windTexture(vc+vec2(px.x,0.0)).g;float bl=windTexture(vc+vec2(0.0,px.y)).g;float br=windTexture(vc+px).g;return mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);}float getV(const vec2 uv){float min=u_wind_min.y;float max=u_wind_max.y;float r=bilinearV(uv);return r*(max-min)+min;}float getU(const vec2 uv){float min=u_wind_min.x;float max=u_wind_max.x;float r=bilinearU(uv);return r*(max-min)+min;}float windSpeed(const vec2 uv){float u=getU(uv);float v=getV(uv);float min=u_mapping_range.x;float max=u_mapping_range.y;float val=length(vec2(u,v));return val*(max-min)+min;}const float PI=3.14159265359;vec2 mercatorToWGS84(vec2 xy){float y=radians(180.0-xy.y*360.0);y=360.0/PI*atan(exp(y))-90.0;y=y/-180.0+0.5;return vec2(xy.x,y);}\n#modules-transformZ\nvoid main(){v_tex_pos=a_texCoord;vec2 globalWGS84=mercatorToWGS84(v_tex_pos);float value=windSpeed(globalWGS84);float z=transformZ(value,instancePositions);vec4 pos=vec4(instancePositions-u_cameraEye.xyz,0.0);pos+=vec4(instancePositions64Low-u_cameraEye64Low.xyz,0.0);\n#modules-project\n}";class RT extends ET{constructor(t,e,r,n){super(t,e||LT,r||TT,n||{}),this.vertShader=LT,this.fragShader=TT}draw(){if(void 0!==this.checkExt){const t=this.primitive||this.gl.TRIANGLES;this.checkExt?this.gl.drawElements(t,this.count,this.gl.UNSIGNED_INT,0):this.gl.drawElements(t,this.count,this.gl.UNSIGNED_SHORT,0)}else this.checkExt=this.gl.getExtension("OES_element_index_uint");return this}translate(){return this}rotate(){return this}scale(){return this}destroyed(){}}const NT={renderForm:"r",styleSpec:{"fill-color":["interpolate",["linear"],["get","value"],0,"#3288bd",10,"#66c2a5",20,"#abdda4",30,"#e6f598",40,"#fee08b",50,"#fdae61",60,"#f46d43",100,"#d53e4f"],opacity:1},displayRange:[1/0,1/0],mappingRange:[0,0],widthSegments:1,heightSegments:1,wireframe:!1,createPlaneBuffer:(t,e,r)=>{const[n,i,o,s]=[t[0][0],t[2][0],t[0][1],t[1][1]];return function(t,e,r,n,i,o){const s=e-t,a=n-r,u=s/2,l=a/2,c=Math.floor(i),h=Math.floor(o),f=c+1,p=h+1,g=s/c,d=a/h,A=[],y=[],v=[],m=[],_=[];for(let e=0;e<p;e++){const n=e*d;for(let i=0;i<f;i++){const o=t+i*g/u/2*s,f=r+n/l/2*a;v.push(o,f,0),m.push(AT(o),AT(f),0),_.push(i/c,e/h)}}for(let t=0;t<h;t++)for(let e=0;e<c;e++){const r=e+f*t,n=e+f*(t+1),i=e+1+f*(t+1),o=e+1+f*t;A.push(r,n,o),A.push(n,i,o)}for(let t=0,e=A.length;t<e;t+=3){const e=A[t],r=A[t+1],n=A[t+2];y.push(e,r,r,n,n,e)}return{uvs:{data:_,size:2},elements:{data:A,count:A.length},wireframeElements:{data:y,count:y.length},position:{data:v,size:3},positionLow:{data:m,size:3}}}(n,i,o,s,e,r)},injectShaderModules:{"#modules-transformZ":"\nfloat transformZ(float value, vec3 pos) {\n return 0.0;\n}\n ","#modules-project":"\ngl_Position = u_matrix * vec4(pos.xy + vec2(u_offset, 0.0), pos.z + z, 1.0);\n "}};let PT=0;class DT{constructor(t,e){if(this.gl=t,this.uid=`ScalarFill_${PT}`,PT++,!this.gl)throw new Error("initialize error");e||(e={}),this.options={...NT,...e},this.opacity=this.options.opacity||1}updateOptions(t){this.options={...this.options,...t},this.buildColorRamp(),"function"==typeof this.options.getZoom&&this.setOpacity(MT(this.uid,this.options.getZoom(),"opacity",this.options.styleSpec,!0))}setFillColor(){this.buildColorRamp()}setOpacity(t){this.opacity=t}handleZoom(){"function"==typeof this.options.getZoom&&this.setOpacity(MT(this.uid,this.options.getZoom(),"opacity",this.options.styleSpec))}buildColorRamp(){var t;const{data:e,colorRange:r}=bT([],null==(t=this.options.styleSpec)?void 0:t["fill-color"]);r&&(this.colorRange=r),e&&(this.colorRampTexture=mT(this.gl,this.gl.NEAREST,e,16,16))}initialize(t){this.drawCommand||("rg"===this.options.renderForm?this.drawCommand=new RT(t,void 0,void 0,this.options.injectShaderModules):"r"===this.options.renderForm?this.drawCommand=new CT(t,void 0,void 0,this.options.injectShaderModules):console.warn("This type is not supported temporarily")),this.buildColorRamp(),"function"==typeof this.options.getZoom&&this.setOpacity(MT(this.uid,this.options.getZoom(),"opacity",this.options.styleSpec))}initializeVertex(t){let e=0;const r=t.length,n=[];for(;e<r;e++){const r=t[e],i=this.getMercatorCoordinate(r);n.push([i[0],i[1]])}const i=(this.options.createPlaneBuffer||NT.createPlaneBuffer)(n,this.options.widthSegments||1,this.options.heightSegments||1);return{indexes:i.elements.data,wireframeIndexes:i.wireframeElements.data,quadBuffer:_T(this.gl,new Float32Array(i.position.data)),quad64LowBuffer:_T(this.gl,new Float32Array(i.positionLow.data)),texCoordBuffer:_T(this.gl,new Float32Array(i.uvs.data))}}getTextureData(t){return new Promise(((e,r)=>{if("image"===t.type&&t.url)(function(t){return new Promise(((e,r)=>{t||r(new Event("url is null"));const n=new Image;n.crossOrigin="anonymous",n.onload=()=>e(n),n.onerror=r,n.src=t,n.complete&&e(n)}))})(t.url).then((r=>{const n={width:r.width,height:r.height,texture:mT(this.gl,this.gl.LINEAR,r,r.width,r.height),...this.initializeVertex(t.extent)};"rg"===this.options.renderForm?(n.uMin=t.uMin,n.uMax=t.uMax,n.vMin=t.vMin,n.vMax=t.vMax):"r"===this.options.renderForm?(n.min=t.min,n.max=t.max):console.warn("This type is not supported temporarily"),e(n)})).catch((t=>r(t)));else if("jsonArray"===t.type&&t.data){const r=t.data;let n;n=t.extent?t.extent:[[r[0].header.lo1,r[0].header.la1],[r[0].header.lo1,r[0].header.la2],[r[0].header.lo2,r[0].header.la1],[r[0].header.lo2,r[0].header.la2]];const i={width:r[0].header.nx,height:r[0].header.ny,...this.initializeVertex(n)};if(this.worker||(this.worker=new gT,this.worker.addEventListener("message",(({data:t})=>{"rg"===this.options.renderForm?(i.uMin=t[1],i.uMax=t[2],i.vMin=t[3],i.vMax=t[4],i.texture=mT(this.gl,this.gl.LINEAR,new Uint8Array(t[0]),i.width,i.height)):"r"===this.options.renderForm?(i.min=t[1],i.max=t[2],i.texture=mT(this.gl,this.gl.LINEAR,new Uint8Array(t[0]),i.width,i.height)):console.warn("This type is not supported temporarily"),e(i)}))),"rg"===this.options.renderForm){let t,e;r.forEach((r=>{switch(r.header.parameterCategory+","+r.header.parameterNumber){case"1,2":case"2,2":t=r;break;case"1,3":case"2,3":e=r}}));const n=new Float32Array(t.data),i=new Float32Array(e.data);this.worker.postMessage(["rg",n,i])}else if("r"===this.options.renderForm){const t=new Float32Array(r[0].data);this.worker.postMessage(["r",t])}else console.warn("This type is not supported temporarily")}}))}setData(t,e){this.gl&&t&&this.getTextureData(t).then((t=>{this.data=t,e&&e(!0),this.data&&this.initialize(this.gl),this.options.triggerRepaint&&(this.handleZoom(),this.options.triggerRepaint())})).catch((t=>{e&&e(!1),console.error(t)}))}getData(){return this.data}getMercatorCoordinate([t,e]){return[t,e]}prerender(){}render(t,e,r){if(this.data&&this.drawCommand&&this.data.texture&&this.colorRampTexture){const n=this.opacity,i={u_opacity:dT(n)?n:1,u_image_res:[this.data.width,this.data.height],u_matrix:t,u_offset:dT(e)?e:0,u_color_ramp:this.colorRampTexture,u_color_range:this.colorRange,u_mapping_range:this.options.mappingRange||[0,0]};if(r&&(i.u_cameraEye=r.cameraEye,i.u_cameraEye64Low=r.cameraEye64Low),"rg"===this.options.renderForm){i.u_wind_min=[this.data.uMin,this.data.vMin],i.u_wind_max=[this.data.uMax,this.data.vMax],i.u_wind=this.data.texture;const t=[Math.sqrt(this.data.uMin*this.data.uMin+this.data.vMin*this.data.vMin),Math.sqrt(this.data.uMin*this.data.uMin+this.data.vMax*this.data.vMax),Math.sqrt(this.data.uMax*this.data.uMax+this.data.vMax*this.data.vMax),Math.sqrt(this.data.uMax*this.data.uMax+this.data.vMin*this.data.vMin)],e=0,r=Math.max(...t);i.u_display_range=this.options.displayRange||[e,r]}else"r"===this.options.renderForm?(i.u_range=[this.data.min,this.data.max],i.u_image=this.data.texture,i.u_display_range=this.options.displayRange||[i.u_range[0]-1,i.u_range[1]+1]):console.warn("This type is not supported temporarily");const o=this.gl.isEnabled(this.gl.DEPTH_TEST);this.gl.enable(this.gl.DEPTH_TEST),this.gl.depthMask(!0),this.gl.depthFunc(this.gl.LEQUAL);const s=this.options.wireframe?this.data.wireframeIndexes:this.data.indexes;this.drawCommand.active().setUniforms(i).setAttributes({instancePositions:{buffer:this.data.quadBuffer,numComponents:3},instancePositions64Low:{buffer:this.data.quad64LowBuffer,numComponents:3},a_texCoord:{buffer:this.data.texCoordBuffer,numComponents:2}}).elements({data:new Uint32Array(s),primitive:this.options.wireframe?this.gl.LINES:this.gl.TRIANGLES,count:null==s?void 0:s.length,usage:this.gl.STATIC_DRAW}).draw(),o||this.gl.disable(this.gl.DEPTH_TEST)}}postrender(){}destroyData(){this.data}destroyed(){this.destroyData(),this.worker&&this.worker.terminate()}}function FT(t,e,r){const n=t.length,i=r>1?r:2;let o=e;void 0===o&&(o=i>2?t.slice():new Array(n));for(let e=0;e<n;e+=i)o[e]=180*t[e]/20037508.342789244,o[e+1]=360*Math.atan(Math.exp(t[e+1]/6378137))/Math.PI-90;return o}function kT(t,e,r,n){let i=[];if(n>1){const e=t[2]-t[0],r=t[3]-t[1];for(let o=0;o<n;++o)i.push(t[0]+e*o/n,t[1],t[2],t[1]+r*o/n,t[2]-e*o/n,t[3],t[0],t[3]-r*o/n)}else i=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(i,i,2);const o=[],s=[];for(let t=0,e=i.length;t<e;t+=2)o.push(i[t]),s.push(i[t+1]);return function(t,e,r){return function(t,e,r,n,i){return i?(i[0]=t,i[1]=e,i[2]=r,i[3]=n,i):[t,e,r,n]}(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),r)}(o,s,r)}function QT(t){return t.getGLRes?t.getGLRes():t.getGLZoom()}function OT(t,e,r,n){return t.coordToPointAtRes?t.coordToPointAtRes(e,r,n):t.coordinateToPoint(e,r,n)}const UT={renderer:"gl",doubleBuffer:!1,animation:!1,glOptions:{antialias:!0,depth:!0,stencil:!0,alpha:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0}};class GT extends t.renderer.CanvasLayerRenderer{checkResources(){return[]}getDrawParams(){return[]}hitDetect(){return!1}draw(){this.prepareCanvas(),this.prepareDrawContext(),this.drawWind()}_redraw(){this.prepareRender(),this.draw()}clearCanvas(){this.gl&&IT(this.gl,[0,0,0,0])}createContext(){this.gl&&this.gl.canvas===this.canvas||(this.gl=function(t,e={}){const r=["webgl","experimental-webgl"];let n=null;function i(t){console.error(t.statusMessage)}t.addEventListener("webglcontextcreationerror",i,!1);for(let i=0;i<r.length;++i){try{n=t.getContext(r[i],e)}catch(t){}if(n)break}return t.removeEventListener("webglcontextcreationerror",i,!1),n&&n.getExtension("OES_texture_float")?n:null}(this.canvas,this.layer.options.glOptions))}resizeCanvas(t){if(this.canvas&&this.gl){const e=this.getMap(),r=e.getDevicePixelRatio(),n=t||e.getSize();this.canvas.height=r*n.height,this.canvas.width=r*n.width,this.gl&&this.gl.viewport(0,0,this.canvas.width,this.canvas.height)}}getMatrix(){return this.getMap().projViewMatrix}handleZoom(){this.scalarRender&&this.scalarRender.handleZoom()}drawWind(){const e=this.getMap();if(null!==this.gl){const r=this.layer,n=r.getOptions(),i=r.getData();if(!this.scalarRender&&e&&(this.scalarRender=new DT(this.gl,{opacity:n.opacity,renderForm:n.renderForm,styleSpec:n.styleSpec,displayRange:n.displayRange,mappingRange:n.mappingRange,widthSegments:n.widthSegments,heightSegments:n.heightSegments,createPlaneBuffer:n.createPlaneBuffer,wireframe:n.wireframe,getZoom:()=>this.getMap().getZoom(),triggerRepaint:()=>{this._redraw()},injectShaderModules:{"#modules-transformZ":"\nfloat transformZ(float value, vec3 pos) {\n return value;\n}\n ","#modules-project":"\ngl_Position = u_matrix * vec4(pos.xy + vec2(u_offset, 0.0), pos.z + z, 1.0);\n "}}),this.scalarRender.getMercatorCoordinate=([r,n])=>{const i=OT(e,new t.Coordinate(r,n),QT(e));return[i.x,i.y]},this.getMap().on("zoom",this.handleZoom,this),this.scalarRender.setData(i)),this.scalarRender){const t=this.getMatrix(),e=[0,0,0,1],r=e.map((t=>AT(t))),n=this.getWrappedWorlds();for(let i=0;i<n.length;i++)this.scalarRender.render(t,n[i],{cameraEye:e,cameraEye64Low:r})}}this.completeRender()}getWrappedWorlds(){const e=this.getMap(),r=e.getProjection().fullExtent,n=[r.left,r.bottom,r.right,r.top],i=e.getProjExtent(),o=[i.xmin,i.ymin,i.xmax,i.ymax];let s=o[0];const a=function(t){return t[2]-t[0]}(n),u=Math.abs(OT(e,e.getProjection().unprojectCoords(new t.Coordinate([n[0],n[1]])),QT(e)).x-OT(e,e.getProjection().unprojectCoords(new t.Coordinate([n[2],n[3]])),QT(e)).x);let l=0;const c=[];if(this.layer.getOptions().wrapX){for(;s<n[0];)--l,c.push(l*u),s+=a;for(l=0,s=o[2];s>n[2];)++l,c.push(l*u),s-=a}return c.push(0),c}drawOnInteracting(){this.draw()}onZoomStart(...t){super.onZoomStart.apply(this,t)}onZoomEnd(...t){super.onZoomEnd.apply(this,t)}onDragRotateStart(...t){super.onDragRotateStart.apply(this,t)}onDragRotateEnd(...t){super.onDragRotateEnd.apply(this,t)}onMoveStart(...t){super.onMoveStart.apply(this,t)}onMoveEnd(...t){super.onMoveEnd.apply(this,t)}remove(){delete this._drawContext,super.remove()}getMap(){return super.getMap()}completeRender(){return super.completeRender()}prepareCanvas(){return super.prepareCanvas()}prepareDrawContext(){super.prepareDrawContext()}prepareRender(){return super.prepareRender()}}class zT extends t.CanvasLayer{constructor(t,e,r){super(t,{...UT,...r}),this.data=null,this._map=null,e&&this.setData(e)}getData(){return this.data}setData(t){return new Promise(((e,r)=>{this.data=t;const n=this._getRenderer();this.data&&n&&n.scalarFill?n.scalarFill.setData(this.data,(t=>{t?e(!0):r(!1)})):e(!1)}))}setOptions(t){this.options={...this.options,...t||{}};const e=this._getRenderer();e&&e.scalarRender&&(e.scalarRender.updateOptions(this.options),e.setToRedraw())}getOptions(){return this.options||{}}draw(){return this._getRenderer()&&this._getRenderer()._redraw(),this}prepareToDraw(){return[]}drawOnInteracting(){this.draw()}_getRenderer(){return super._getRenderer()}}zT.registerRenderer("gl",GT);const VT={renderer:"canvas",doubleBuffer:!1,animation:!1,windOptions:{}};class jT extends t.renderer.CanvasLayerRenderer{checkResources(){return[]}getDrawParams(){return[]}hitDetect(){return!1}draw(){this.prepareCanvas(),this.prepareDrawContext(),this.drawWind()}_redraw(){this.prepareRender(),this.draw()}drawWind(){const t=this.getMap();if(this.context){const e=this.layer,r=e.getWindOptions();if(!this.wind&&t){const t=e.getData();this.wind=new oT(this.context,r,t),this.wind.project=this.project.bind(this),this.wind.unproject=this.unproject.bind(this),this.wind.intersectsCoordinate=this.intersectsCoordinate.bind(this),this.wind.postrender=()=>{this.setCanvasUpdated()},this.wind.prerender()}this.wind&&(this.wind.prerender(),this.wind.render())}this.completeRender()}project(e){const r=this.getMap().coordinateToContainerPoint(new t.Coordinate(e[0],e[1]));return[r.x,r.y]}unproject(e){return this.getMap().containerPointToCoordinate(new t.Point(e[0],e[1])).toArray()}intersectsCoordinate(t){var e;if(!this.layer)return!1;const r=null==(e=this.layer)?void 0:e.getProjection();if(r&&"EPSG:3857"!==r.code)return!0;const n=this.getMap().getProjExtent(),i=function(t,e){return kT(t,FT,void 0,e)}([n.xmin,n.ymin,n.xmax,n.ymax],0);return function(t,e){const r=e[0],n=e[1];return t[0]<=r&&r<=t[2]&&t[1]<=n&&n<=t[3]}(i,[t[0],t[1]])}drawOnInteracting(){}onZoomStart(...t){this.wind&&this.wind.stop(),super.onZoomStart.apply(this,t)}onZoomEnd(...t){this.wind&&this.wind.start(),super.onZoomEnd.apply(this,t)}onDragRotateStart(...t){this.wind&&this.wind.stop(),super.onDragRotateStart.apply(this,t)}onDragRotateEnd(...t){this.wind&&this.wind.start(),super.onDragRotateEnd.apply(this,t)}onMoveStart(...t){this.wind&&this.wind.stop(),super.onMoveStart.apply(this,t)}onMoveEnd(...t){this.wind&&this.wind.start(),super.onMoveEnd.apply(this,t)}remove(){this.wind&&this.wind.stop(),delete this._drawContext,super.remove()}getMap(){return super.getMap()}prepareCanvas(){return super.prepareCanvas()}prepareDrawContext(){super.prepareDrawContext()}prepareRender(){return super.prepareRender()}completeRender(){return super.completeRender()}}class HT extends t.CanvasLayer{constructor(t,e,r={}){super(t,KM({},VT,r)),this._map=null,this.pickWindOptions(),e&&this.setData(e,r.fieldOptions)}pickWindOptions(){Object.keys(nT).forEach((t=>{this.options&&t in this.options&&(void 0===this.options.windOptions&&(this.options.windOptions={}),this.options.windOptions[t]=this.options[t])}))}getData(){return this.field}setData(t,e={}){var r;t&&t.checkFields&&t.checkFields()?this.field=t:(r=t,Array.isArray(r)?this.field=function(t,e={}){let r,n;if(t.forEach((function(t){switch(t.header.parameterCategory+","+t.header.parameterNumber){case"1,2":case"2,2":r=t;break;case"1,3":case"2,3":n=t}})),!n||!r)return;const i=r.header;return new rT({xmin:i.lo1,ymin:i.la1,xmax:i.lo2,ymax:i.la2,deltaX:i.dx,deltaY:i.dy,cols:i.nx,rows:i.ny,us:r.data,vs:n.data,...e})}(t,e):console.error("Illegal data"));const n=this._getRenderer();return n&&n.wind&&this.field&&n.wind.updateData(this.field),this}setWindOptions(t){const e=this.options.windOptions||{};this.options=KM(this.options,{windOptions:KM(e,t||{})});const r=this._getRenderer();if(r&&r.wind){const t=this.options.windOptions;r.wind.setOptions(t)}}getWindOptions(){return this.options.windOptions||{}}draw(){return this._getRenderer()&&this._getRenderer()._redraw(),this}prepareToDraw(){return[]}drawOnInteracting(){this.draw()}_getRenderer(){return super._getRenderer()}}HT.registerRenderer("canvas",jT);const qT=HT;var YT={exports:{}};!function(t,e){var r="__lodash_hash_undefined__",n=1,i=2,o=1/0,s=9007199254740991,a=17976931348623157e292,u=NaN,l="[object Arguments]",c="[object Array]",h="[object Boolean]",f="[object Date]",p="[object Error]",g="[object Function]",d="[object GeneratorFunction]",A="[object Map]",y="[object Number]",v="[object Object]",m="[object Promise]",_="[object RegExp]",I="[object Set]",E="[object String]",x="[object Symbol]",w="[object WeakMap]",C="[object ArrayBuffer]",b="[object DataView]",B=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,S=/^\w*$/,M=/^\./,T=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,L=/^\s+|\s+$/g,R=/\\(\\)?/g,N=/^[-+]0x[0-9a-f]+$/i,P=/^0b[01]+$/i,D=/^\[object .+?Constructor\]$/,F=/^0o[0-7]+$/i,k=/^(?:0|[1-9]\d*)$/,Q={};Q["[object Float32Array]"]=Q["[object Float64Array]"]=Q["[object Int8Array]"]=Q["[object Int16Array]"]=Q["[object Int32Array]"]=Q["[object Uint8Array]"]=Q["[object Uint8ClampedArray]"]=Q["[object Uint16Array]"]=Q["[object Uint32Array]"]=!0,Q[l]=Q[c]=Q[C]=Q[h]=Q[b]=Q[f]=Q[p]=Q[g]=Q[A]=Q[y]=Q[v]=Q[_]=Q[I]=Q[E]=Q[w]=!1;var O=parseInt,U="object"==typeof Pt&&Pt&&Pt.Object===Object&&Pt,G="object"==typeof self&&self&&self.Object===Object&&self,z=U||G||Function("return this")(),V=e&&!e.nodeType&&e,j=V&&t&&!t.nodeType&&t,H=j&&j.exports===V&&U.process,q=function(){try{return H&&H.binding("util")}catch(t){}}(),Y=q&&q.isTypedArray;function X(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function W(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function J(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function K(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var Z,$=Array.prototype,tt=Function.prototype,et=Object.prototype,rt=z["__core-js_shared__"],nt=(Z=/[^.]+$/.exec(rt&&rt.keys&&rt.keys.IE_PROTO||""))?"Symbol(src)_1."+Z:"",it=tt.toString,ot=et.hasOwnProperty,st=et.toString,at=RegExp("^"+it.call(ot).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ut=z.Symbol,lt=z.Uint8Array,ct=et.propertyIsEnumerable,ht=$.splice,ft=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),pt=Math.max,gt=Ht(z,"DataView"),dt=Ht(z,"Map"),At=Ht(z,"Promise"),yt=Ht(z,"Set"),vt=Ht(z,"WeakMap"),mt=Ht(Object,"create"),_t=$t(gt),It=$t(dt),Et=$t(At),xt=$t(yt),wt=$t(vt),Ct=ut?ut.prototype:void 0,bt=Ct?Ct.valueOf:void 0,Bt=Ct?Ct.toString:void 0;function St(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Mt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Tt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Lt(t){var e=-1,r=t?t.length:0;for(this.__data__=new Tt;++e<r;)this.add(t[e])}function Rt(t){this.__data__=new Mt(t)}function Nt(t,e){var r=oe(t)||ie(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,i=!!n;for(var o in t)!e&&!ot.call(t,o)||i&&("length"==o||Yt(o,n))||r.push(o);return r}function Dt(t,e){for(var r=t.length;r--;)if(ne(t[r][0],e))return r;return-1}function Ft(t,e){for(var r=0,n=(e=Xt(e,t)?[e]:zt(e)).length;null!=t&&r<n;)t=t[Zt(e[r++])];return r&&r==n?t:void 0}function kt(t,e){return null!=t&&e in Object(t)}function Qt(t,e,r,o,s){return t===e||(null==t||null==e||!le(t)&&!ce(e)?t!=t&&e!=e:function(t,e,r,o,s,a){var u=oe(t),g=oe(e),d=c,m=c;u||(d=(d=qt(t))==l?v:d);g||(m=(m=qt(e))==l?v:m);var w=d==v&&!W(t),B=m==v&&!W(e),S=d==m;if(S&&!w)return a||(a=new Rt),u||pe(t)?Vt(t,e,r,o,s,a):function(t,e,r,o,s,a,u){switch(r){case b:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case C:return!(t.byteLength!=e.byteLength||!o(new lt(t),new lt(e)));case h:case f:case y:return ne(+t,+e);case p:return t.name==e.name&&t.message==e.message;case _:case E:return t==e+"";case A:var l=J;case I:var c=a&i;if(l||(l=K),t.size!=e.size&&!c)return!1;var g=u.get(t);if(g)return g==e;a|=n,u.set(t,e);var d=Vt(l(t),l(e),o,s,a,u);return u.delete(t),d;case x:if(bt)return bt.call(t)==bt.call(e)}return!1}(t,e,d,r,o,s,a);if(!(s&i)){var M=w&&ot.call(t,"__wrapped__"),T=B&&ot.call(e,"__wrapped__");if(M||T){var L=M?t.value():t,R=T?e.value():e;return a||(a=new Rt),r(L,R,o,s,a)}}if(!S)return!1;return a||(a=new Rt),function(t,e,r,n,o,s){var a=o&i,u=ge(t),l=u.length,c=ge(e),h=c.length;if(l!=h&&!a)return!1;var f=l;for(;f--;){var p=u[f];if(!(a?p in e:ot.call(e,p)))return!1}var g=s.get(t);if(g&&s.get(e))return g==e;var d=!0;s.set(t,e),s.set(e,t);var A=a;for(;++f<l;){var y=t[p=u[f]],v=e[p];if(n)var m=a?n(v,y,p,e,t,s):n(y,v,p,t,e,s);if(!(void 0===m?y===v||r(y,v,n,o,s):m)){d=!1;break}A||(A="constructor"==p)}if(d&&!A){var _=t.constructor,I=e.constructor;_==I||!("constructor"in t)||!("constructor"in e)||"function"==typeof _&&_ instanceof _&&"function"==typeof I&&I instanceof I||(d=!1)}return s.delete(t),s.delete(e),d}(t,e,r,o,s,a)}(t,e,Qt,r,o,s))}function Ot(t){return!(!le(t)||(e=t,nt&&nt in e))&&(ae(t)||W(t)?at:D).test($t(t));var e}function Ut(t){return"function"==typeof t?t:null==t?de:"object"==typeof t?oe(t)?function(t,e){if(Xt(t)&&Wt(e))return Jt(Zt(t),e);return function(r){var o=function(t,e,r){var n=null==t?void 0:Ft(t,e);return void 0===n?r:n}(r,t);return void 0===o&&o===e?function(t,e){return null!=t&&function(t,e,r){e=Xt(e,t)?[e]:zt(e);var n,i=-1,o=e.length;for(;++i<o;){var s=Zt(e[i]);if(!(n=null!=t&&r(t,s)))break;t=t[s]}if(n)return n;o=t?t.length:0;return!!o&&ue(o)&&Yt(s,o)&&(oe(t)||ie(t))}(t,e,kt)}(r,t):Qt(e,o,void 0,n|i)}}(t[0],t[1]):function(t){var e=function(t){var e=ge(t),r=e.length;for(;r--;){var n=e[r],i=t[n];e[r]=[n,i,Wt(i)]}return e}(t);if(1==e.length&&e[0][2])return Jt(e[0][0],e[0][1]);return function(r){return r===t||function(t,e,r,o){var s=r.length,a=s,u=!o;if(null==t)return!a;for(t=Object(t);s--;){var l=r[s];if(u&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++s<a;){var c=(l=r[s])[0],h=t[c],f=l[1];if(u&&l[2]){if(void 0===h&&!(c in t))return!1}else{var p=new Rt;if(o)var g=o(h,f,c,t,e,p);if(!(void 0===g?Qt(f,h,o,n|i,p):g))return!1}}return!0}(r,t,e)}}(t):Xt(e=t)?(r=Zt(e),function(t){return null==t?void 0:t[r]}):function(t){return function(e){return Ft(e,t)}}(e);var e,r}function Gt(t){if(r=(e=t)&&e.constructor,n="function"==typeof r&&r.prototype||et,e!==n)return ft(t);var e,r,n,i=[];for(var o in Object(t))ot.call(t,o)&&"constructor"!=o&&i.push(o);return i}function zt(t){return oe(t)?t:Kt(t)}function Vt(t,e,r,o,s,a){var u=s&i,l=t.length,c=e.length;if(l!=c&&!(u&&c>l))return!1;var h=a.get(t);if(h&&a.get(e))return h==e;var f=-1,p=!0,g=s&n?new Lt:void 0;for(a.set(t,e),a.set(e,t);++f<l;){var d=t[f],A=e[f];if(o)var y=u?o(A,d,f,e,t,a):o(d,A,f,t,e,a);if(void 0!==y){if(y)continue;p=!1;break}if(g){if(!X(e,(function(t,e){if(!g.has(e)&&(d===t||r(d,t,o,s,a)))return g.add(e)}))){p=!1;break}}else if(d!==A&&!r(d,A,o,s,a)){p=!1;break}}return a.delete(t),a.delete(e),p}function jt(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function Ht(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return Ot(r)?r:void 0}St.prototype.clear=function(){this.__data__=mt?mt(null):{}},St.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},St.prototype.get=function(t){var e=this.__data__;if(mt){var n=e[t];return n===r?void 0:n}return ot.call(e,t)?e[t]:void 0},St.prototype.has=function(t){var e=this.__data__;return mt?void 0!==e[t]:ot.call(e,t)},St.prototype.set=function(t,e){return this.__data__[t]=mt&&void 0===e?r:e,this},Mt.prototype.clear=function(){this.__data__=[]},Mt.prototype.delete=function(t){var e=this.__data__,r=Dt(e,t);return!(r<0)&&(r==e.length-1?e.pop():ht.call(e,r,1),!0)},Mt.prototype.get=function(t){var e=this.__data__,r=Dt(e,t);return r<0?void 0:e[r][1]},Mt.prototype.has=function(t){return Dt(this.__data__,t)>-1},Mt.prototype.set=function(t,e){var r=this.__data__,n=Dt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},Tt.prototype.clear=function(){this.__data__={hash:new St,map:new(dt||Mt),string:new St}},Tt.prototype.delete=function(t){return jt(this,t).delete(t)},Tt.prototype.get=function(t){return jt(this,t).get(t)},Tt.prototype.has=function(t){return jt(this,t).has(t)},Tt.prototype.set=function(t,e){return jt(this,t).set(t,e),this},Lt.prototype.add=Lt.prototype.push=function(t){return this.__data__.set(t,r),this},Lt.prototype.has=function(t){return this.__data__.has(t)},Rt.prototype.clear=function(){this.__data__=new Mt},Rt.prototype.delete=function(t){return this.__data__.delete(t)},Rt.prototype.get=function(t){return this.__data__.get(t)},Rt.prototype.has=function(t){return this.__data__.has(t)},Rt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Mt){var n=r.__data__;if(!dt||n.length<199)return n.push([t,e]),this;r=this.__data__=new Tt(n)}return r.set(t,e),this};var qt=function(t){return st.call(t)};function Yt(t,e){return!!(e=null==e?s:e)&&("number"==typeof t||k.test(t))&&t>-1&&t%1==0&&t<e}function Xt(t,e){if(oe(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!he(t))||(S.test(t)||!B.test(t)||null!=e&&t in Object(e))}function Wt(t){return t==t&&!le(t)}function Jt(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}(gt&&qt(new gt(new ArrayBuffer(1)))!=b||dt&&qt(new dt)!=A||At&&qt(At.resolve())!=m||yt&&qt(new yt)!=I||vt&&qt(new vt)!=w)&&(qt=function(t){var e=st.call(t),r=e==v?t.constructor:void 0,n=r?$t(r):void 0;if(n)switch(n){case _t:return b;case It:return A;case Et:return m;case xt:return I;case wt:return w}return e});var Kt=re((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(he(t))return Bt?Bt.call(t):"";var e=t+"";return"0"==e&&1/t==-o?"-0":e}(e);var r=[];return M.test(t)&&r.push(""),t.replace(T,(function(t,e,n,i){r.push(n?i.replace(R,"$1"):e||t)})),r}));function Zt(t){if("string"==typeof t||he(t))return t;var e=t+"";return"0"==e&&1/t==-o?"-0":e}function $t(t){if(null!=t){try{return it.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var te,ee=(te=function(t,e,r){var n=t?t.length:0;if(!n)return-1;var i,s,l=null==r?0:(i=function(t){return t?(t=function(t){if("number"==typeof t)return t;if(he(t))return u;if(le(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=le(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(L,"");var r=P.test(t);return r||F.test(t)?O(t.slice(2),r?2:8):N.test(t)?u:+t}(t))===o||t===-o?(t<0?-1:1)*a:t==t?t:0:0===t?t:0}(r),s=i%1,i==i?s?i-s:i:0);return l<0&&(l=pt(n+l,0)),function(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}(t,Ut(e),l)},function(t,e,r){var n=Object(t);if(!se(t)){var i=Ut(e);t=ge(t),e=function(t){return i(n[t],t,n)}}var o=te(t,e,r);return o>-1?n[i?t[o]:o]:void 0});function re(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s),s};return r.cache=new(re.Cache||Tt),r}function ne(t,e){return t===e||t!=t&&e!=e}function ie(t){return function(t){return ce(t)&&se(t)}(t)&&ot.call(t,"callee")&&(!ct.call(t,"callee")||st.call(t)==l)}re.Cache=Tt;var oe=Array.isArray;function se(t){return null!=t&&ue(t.length)&&!ae(t)}function ae(t){var e=le(t)?st.call(t):"";return e==g||e==d}function ue(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=s}function le(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function ce(t){return!!t&&"object"==typeof t}function he(t){return"symbol"==typeof t||ce(t)&&st.call(t)==x}var fe,pe=Y?(fe=Y,function(t){return fe(t)}):function(t){return ce(t)&&ue(t.length)&&!!Q[st.call(t)]};function ge(t){return se(t)?Nt(t):Gt(t)}function de(t){return t}t.exports=ee}(YT,YT.exports);var XT=YT.exports,WT={exports:{}};!function(t,e){var r="__lodash_hash_undefined__",n=1,i=2,o=1/0,s=9007199254740991,a="[object Arguments]",u="[object Array]",l="[object Boolean]",c="[object Date]",h="[object Error]",f="[object Function]",p="[object GeneratorFunction]",g="[object Map]",d="[object Number]",A="[object Object]",y="[object Promise]",v="[object RegExp]",m="[object Set]",_="[object String]",I="[object Symbol]",E="[object WeakMap]",x="[object ArrayBuffer]",w="[object DataView]",C=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,b=/^\w*$/,B=/^\./,S=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,M=/\\(\\)?/g,T=/^\[object .+?Constructor\]$/,L=/^(?:0|[1-9]\d*)$/,R={};R["[object Float32Array]"]=R["[object Float64Array]"]=R["[object Int8Array]"]=R["[object Int16Array]"]=R["[object Int32Array]"]=R["[object Uint8Array]"]=R["[object Uint8ClampedArray]"]=R["[object Uint16Array]"]=R["[object Uint32Array]"]=!0,R[a]=R[u]=R[x]=R[l]=R[w]=R[c]=R[h]=R[f]=R[g]=R[d]=R[A]=R[v]=R[m]=R[_]=R[E]=!1;var N="object"==typeof Pt&&Pt&&Pt.Object===Object&&Pt,P="object"==typeof self&&self&&self.Object===Object&&self,D=N||P||Function("return this")(),F=e&&!e.nodeType&&e,k=F&&t&&!t.nodeType&&t,Q=k&&k.exports===F&&N.process,O=function(){try{return Q&&Q.binding("util")}catch(t){}}(),U=O&&O.isTypedArray;function G(t,e){for(var r=-1,n=t?t.length:0,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function z(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function V(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function j(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function H(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var q,Y=Array.prototype,X=Function.prototype,W=Object.prototype,J=D["__core-js_shared__"],K=(q=/[^.]+$/.exec(J&&J.keys&&J.keys.IE_PROTO||""))?"Symbol(src)_1."+q:"",Z=X.toString,$=W.hasOwnProperty,tt=W.toString,et=RegExp("^"+Z.call($).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rt=D.Symbol,nt=D.Uint8Array,it=W.propertyIsEnumerable,ot=Y.splice,st=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),at=Vt(D,"DataView"),ut=Vt(D,"Map"),lt=Vt(D,"Promise"),ct=Vt(D,"Set"),ht=Vt(D,"WeakMap"),ft=Vt(Object,"create"),pt=Kt(at),gt=Kt(ut),dt=Kt(lt),At=Kt(ct),yt=Kt(ht),vt=rt?rt.prototype:void 0,mt=vt?vt.valueOf:void 0,_t=vt?vt.toString:void 0;function It(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Et(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function xt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function wt(t){var e=-1,r=t?t.length:0;for(this.__data__=new xt;++e<r;)this.add(t[e])}function Ct(t){this.__data__=new Et(t)}function bt(t,e){var r=ee(t)||te(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,i=!!n;for(var o in t)!e&&!$.call(t,o)||i&&("length"==o||Ht(o,n))||r.push(o);return r}function Bt(t,e){for(var r=t.length;r--;)if($t(t[r][0],e))return r;return-1}It.prototype.clear=function(){this.__data__=ft?ft(null):{}},It.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},It.prototype.get=function(t){var e=this.__data__;if(ft){var n=e[t];return n===r?void 0:n}return $.call(e,t)?e[t]:void 0},It.prototype.has=function(t){var e=this.__data__;return ft?void 0!==e[t]:$.call(e,t)},It.prototype.set=function(t,e){return this.__data__[t]=ft&&void 0===e?r:e,this},Et.prototype.clear=function(){this.__data__=[]},Et.prototype.delete=function(t){var e=this.__data__,r=Bt(e,t);return!(r<0)&&(r==e.length-1?e.pop():ot.call(e,r,1),!0)},Et.prototype.get=function(t){var e=this.__data__,r=Bt(e,t);return r<0?void 0:e[r][1]},Et.prototype.has=function(t){return Bt(this.__data__,t)>-1},Et.prototype.set=function(t,e){var r=this.__data__,n=Bt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},xt.prototype.clear=function(){this.__data__={hash:new It,map:new(ut||Et),string:new It}},xt.prototype.delete=function(t){return zt(this,t).delete(t)},xt.prototype.get=function(t){return zt(this,t).get(t)},xt.prototype.has=function(t){return zt(this,t).has(t)},xt.prototype.set=function(t,e){return zt(this,t).set(t,e),this},wt.prototype.add=wt.prototype.push=function(t){return this.__data__.set(t,r),this},wt.prototype.has=function(t){return this.__data__.has(t)},Ct.prototype.clear=function(){this.__data__=new Et},Ct.prototype.delete=function(t){return this.__data__.delete(t)},Ct.prototype.get=function(t){return this.__data__.get(t)},Ct.prototype.has=function(t){return this.__data__.has(t)},Ct.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Et){var n=r.__data__;if(!ut||n.length<199)return n.push([t,e]),this;r=this.__data__=new xt(n)}return r.set(t,e),this};var St,Mt,Tt=(St=function(t,e){return t&&Lt(t,e,ce)},function(t,e){if(null==t)return t;if(!re(t))return St(t,e);for(var r=t.length,n=Mt?r:-1,i=Object(t);(Mt?n--:++n<r)&&!1!==e(i[n],n,i););return t}),Lt=function(t){return function(e,r,n){for(var i=-1,o=Object(e),s=n(e),a=s.length;a--;){var u=s[t?a:++i];if(!1===r(o[u],u,o))break}return e}}();function Rt(t,e){for(var r=0,n=(e=qt(e,t)?[e]:Ut(e)).length;null!=t&&r<n;)t=t[Jt(e[r++])];return r&&r==n?t:void 0}function Nt(t,e){return null!=t&&e in Object(t)}function Dt(t,e,r,o,s){return t===e||(null==t||null==e||!oe(t)&&!se(e)?t!=t&&e!=e:function(t,e,r,o,s,f){var p=ee(t),y=ee(e),E=u,C=u;p||(E=(E=jt(t))==a?A:E);y||(C=(C=jt(e))==a?A:C);var b=E==A&&!V(t),B=C==A&&!V(e),S=E==C;if(S&&!b)return f||(f=new Ct),p||le(t)?Gt(t,e,r,o,s,f):function(t,e,r,o,s,a,u){switch(r){case w:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case x:return!(t.byteLength!=e.byteLength||!o(new nt(t),new nt(e)));case l:case c:case d:return $t(+t,+e);case h:return t.name==e.name&&t.message==e.message;case v:case _:return t==e+"";case g:var f=j;case m:var p=a&i;if(f||(f=H),t.size!=e.size&&!p)return!1;var A=u.get(t);if(A)return A==e;a|=n,u.set(t,e);var y=Gt(f(t),f(e),o,s,a,u);return u.delete(t),y;case I:if(mt)return mt.call(t)==mt.call(e)}return!1}(t,e,E,r,o,s,f);if(!(s&i)){var M=b&&$.call(t,"__wrapped__"),T=B&&$.call(e,"__wrapped__");if(M||T){var L=M?t.value():t,R=T?e.value():e;return f||(f=new Ct),r(L,R,o,s,f)}}if(!S)return!1;return f||(f=new Ct),function(t,e,r,n,o,s){var a=o&i,u=ce(t),l=u.length,c=ce(e),h=c.length;if(l!=h&&!a)return!1;var f=l;for(;f--;){var p=u[f];if(!(a?p in e:$.call(e,p)))return!1}var g=s.get(t);if(g&&s.get(e))return g==e;var d=!0;s.set(t,e),s.set(e,t);var A=a;for(;++f<l;){var y=t[p=u[f]],v=e[p];if(n)var m=a?n(v,y,p,e,t,s):n(y,v,p,t,e,s);if(!(void 0===m?y===v||r(y,v,n,o,s):m)){d=!1;break}A||(A="constructor"==p)}if(d&&!A){var _=t.constructor,I=e.constructor;_==I||!("constructor"in t)||!("constructor"in e)||"function"==typeof _&&_ instanceof _&&"function"==typeof I&&I instanceof I||(d=!1)}return s.delete(t),s.delete(e),d}(t,e,r,o,s,f)}(t,e,Dt,r,o,s))}function Ft(t){return!(!oe(t)||(e=t,K&&K in e))&&(ne(t)||V(t)?et:T).test(Kt(t));var e}function kt(t){return"function"==typeof t?t:null==t?he:"object"==typeof t?ee(t)?function(t,e){if(qt(t)&&Yt(e))return Xt(Jt(t),e);return function(r){var o=function(t,e,r){var n=null==t?void 0:Rt(t,e);return void 0===n?r:n}(r,t);return void 0===o&&o===e?function(t,e){return null!=t&&function(t,e,r){e=qt(e,t)?[e]:Ut(e);var n,i=-1,o=e.length;for(;++i<o;){var s=Jt(e[i]);if(!(n=null!=t&&r(t,s)))break;t=t[s]}if(n)return n;o=t?t.length:0;return!!o&&ie(o)&&Ht(s,o)&&(ee(t)||te(t))}(t,e,Nt)}(r,t):Dt(e,o,void 0,n|i)}}(t[0],t[1]):function(t){var e=function(t){var e=ce(t),r=e.length;for(;r--;){var n=e[r],i=t[n];e[r]=[n,i,Yt(i)]}return e}(t);if(1==e.length&&e[0][2])return Xt(e[0][0],e[0][1]);return function(r){return r===t||function(t,e,r,o){var s=r.length,a=s,u=!o;if(null==t)return!a;for(t=Object(t);s--;){var l=r[s];if(u&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++s<a;){var c=(l=r[s])[0],h=t[c],f=l[1];if(u&&l[2]){if(void 0===h&&!(c in t))return!1}else{var p=new Ct;if(o)var g=o(h,f,c,t,e,p);if(!(void 0===g?Dt(f,h,o,n|i,p):g))return!1}}return!0}(r,t,e)}}(t):qt(e=t)?(r=Jt(e),function(t){return null==t?void 0:t[r]}):function(t){return function(e){return Rt(e,t)}}(e);var e,r}function Qt(t){if(r=(e=t)&&e.constructor,n="function"==typeof r&&r.prototype||W,e!==n)return st(t);var e,r,n,i=[];for(var o in Object(t))$.call(t,o)&&"constructor"!=o&&i.push(o);return i}function Ot(t,e){var r=-1,n=re(t)?Array(t.length):[];return Tt(t,(function(t,i,o){n[++r]=e(t,i,o)})),n}function Ut(t){return ee(t)?t:Wt(t)}function Gt(t,e,r,o,s,a){var u=s&i,l=t.length,c=e.length;if(l!=c&&!(u&&c>l))return!1;var h=a.get(t);if(h&&a.get(e))return h==e;var f=-1,p=!0,g=s&n?new wt:void 0;for(a.set(t,e),a.set(e,t);++f<l;){var d=t[f],A=e[f];if(o)var y=u?o(A,d,f,e,t,a):o(d,A,f,t,e,a);if(void 0!==y){if(y)continue;p=!1;break}if(g){if(!z(e,(function(t,e){if(!g.has(e)&&(d===t||r(d,t,o,s,a)))return g.add(e)}))){p=!1;break}}else if(d!==A&&!r(d,A,o,s,a)){p=!1;break}}return a.delete(t),a.delete(e),p}function zt(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function Vt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return Ft(r)?r:void 0}var jt=function(t){return tt.call(t)};function Ht(t,e){return!!(e=null==e?s:e)&&("number"==typeof t||L.test(t))&&t>-1&&t%1==0&&t<e}function qt(t,e){if(ee(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!ae(t))||(b.test(t)||!C.test(t)||null!=e&&t in Object(e))}function Yt(t){return t==t&&!oe(t)}function Xt(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}(at&&jt(new at(new ArrayBuffer(1)))!=w||ut&&jt(new ut)!=g||lt&&jt(lt.resolve())!=y||ct&&jt(new ct)!=m||ht&&jt(new ht)!=E)&&(jt=function(t){var e=tt.call(t),r=e==A?t.constructor:void 0,n=r?Kt(r):void 0;if(n)switch(n){case pt:return w;case gt:return g;case dt:return y;case At:return m;case yt:return E}return e});var Wt=Zt((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(ae(t))return _t?_t.call(t):"";var e=t+"";return"0"==e&&1/t==-o?"-0":e}(e);var r=[];return B.test(t)&&r.push(""),t.replace(S,(function(t,e,n,i){r.push(n?i.replace(M,"$1"):e||t)})),r}));function Jt(t){if("string"==typeof t||ae(t))return t;var e=t+"";return"0"==e&&1/t==-o?"-0":e}function Kt(t){if(null!=t){try{return Z.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Zt(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s),s};return r.cache=new(Zt.Cache||xt),r}function $t(t,e){return t===e||t!=t&&e!=e}function te(t){return function(t){return se(t)&&re(t)}(t)&&$.call(t,"callee")&&(!it.call(t,"callee")||tt.call(t)==a)}Zt.Cache=xt;var ee=Array.isArray;function re(t){return null!=t&&ie(t.length)&&!ne(t)}function ne(t){var e=oe(t)?tt.call(t):"";return e==f||e==p}function ie(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=s}function oe(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function se(t){return!!t&&"object"==typeof t}function ae(t){return"symbol"==typeof t||se(t)&&tt.call(t)==I}var ue,le=U?(ue=U,function(t){return ue(t)}):function(t){return se(t)&&ie(t.length)&&!!R[tt.call(t)]};function ce(t){return re(t)?bt(t):Qt(t)}function he(t){return t}t.exports=function(t,e){return(ee(t)?G:Ot)(t,kt(e))}}(WT,WT.exports);var JT={0:.05,1:.05,2:.05,3:.03,4:.02,5:.01,6:.006,7:.003,8:.002,9:.001,10:5e-4,11:3e-4,12:15e-5,13:1e-4,14:5e-5,15:25e-6,16:1e-5,16.99:1e-5,17:5e-6,18:2e-6,19:1e-6,20:5e-7,21:2e-7,22:1e-7},KT=(0,WT.exports)(["南","东南偏南","东南","东南偏东","东","东北偏东","东北","东北偏北","北","西北偏北","西北","西北偏西","西","西南偏西","西南","西南偏南"],(function(t,e){var r=22.5,n=r*e;return{bearing:n,range:[n-11.25,n+11.25],label:t}})),ZT=function(t,e,r){return t>=e&&t<r},$T=function(t){return XT(KT,(function(e){return ZT(t,e.range[0],e.range[1])||ZT(t-360,e.range[0],e.range[1])}))},tL=function(){function t(e,r,n){var i=this;c(this,t),console.log(n.options.devicePixelRatio),this.map=n,this._zIndex=r.zIndex;var o=2===n.options.devicePixelRatio?4:1;r.mulnum&&(o=r.mulnum),this.windLayer=this.map.getLayer("windLayer"),this.windLayer?this.windLayer.setData(e):(this.windLayer=new qT("windLayer",e,{windOptions:{colorScale:["rgb(36,104, 180)","rgb(60,157, 194)","rgb(128,205,193 )","rgb(151,218,168 )","rgb(198,231,181)","rgb(238,247,217)","rgb(255,238,159)","rgb(252,217,125)","rgb(255,182,100)","rgb(252,150,75)","rgb(250,112,52)","rgb(245,64,32)","rgb(237,45,28)","rgb(220,24,32)","rgb(180,0,35)"],lineWidth:2,velocityScale:function(){var t=i.map.getZoom();return JT[parseInt(t)]||1/40},frameRate:16,maxAge:60,globalAlpha:.9,paths:3782*o}}),this.map.addLayer(this.windLayer)),r.zIndex&&this.windLayer.setZIndex(r.zIndex),this.setToolTip("hello",{showTimeout:0,eventsPropagation:!0,dx:10}),this._bindMapEvents()}return f(t,[{key:"getZIndex",value:function(){this.windLayer&&this.windLayer.getZIndex()}},{key:"setZIndex",value:function(t){this.windLayer&&this.windLayer.setZIndex(t)}},{key:"_bindMapEvents",value:function(){this.map.on("mousemove",this._onWind,this)}},{key:"_closeEvent",value:function(){this.map.off("mousemove",this._onWind,this)}},{key:"_onWind",value:function(t){var e,r=this.windLayer.field.interpolatedValueAt(t.coordinate.x,t.coordinate.y);if(r){var n=this.vectorToDegrees(r.u,r.v,"bearingCCW"),i=this.vectorToSpeed(r.u,r.v,"m/s");this.toolTip._content="".concat(null===(e=$T(n))||void 0===e?void 0:e.label).concat(this.windLevel(i),"级;速度").concat(i.toFixed(2),"m/s;高度10米")}}},{key:"getWindValue",value:function(t,e){var r=this.windLayer.field.interpolatedValueAt(t,e);if(r){var n=this.vectorToDegrees(r.u,r.v,"bearingCCW"),i=this.vectorToSpeed(r.u,r.v,"m/s");return{direction:$T(n),speed:this.windLevel(i)}}}},{key:"windLevel",value:function(t){return t>=0&&t<.3?0:t>=.3&&t<1.6?1:t>=1.6&&t<3.4?2:t>=3.4&&t<5.5?3:t>=5.5&&t<8?4:t>=8&&t<10.8?5:t>=10.8&&t<13.9?6:t>=13.9&&t<17.2?7:t>=17.2&&t<20.8?8:t>=20.8&&t<24.5?9:t>=24.5&&t<28.5?10:t>=28.5&&t<32.7?11:12}},{key:"hide",value:function(){var t;null===(t=this.windLayer)||void 0===t||t.hide(),this.removeToolTip(),this._closeEvent()}},{key:"show",value:function(){var t;null===(t=this.windLayer)||void 0===t||t.show(),this.setToolTip("hello",{showTimeout:0,eventsPropagation:!0,dx:10}),this._bindMapEvents()}},{key:"setToolTip",value:function(t,e){this.removeToolTip(),this.toolTip=new i.ui.ToolTip(t,e),this.toolTip.addTo(this.map)}},{key:"removeToolTip",value:function(){var t;this.toolTip&&(null===(t=this.toolTip)||void 0===t||t.remove(),this.toolTip=null)}},{key:"vectorToDegrees",value:function(t,e,r){r.endsWith("CCW")&&(e=e>0?e=-e:Math.abs(e));var n=Math.sqrt(Math.pow(t,2)+Math.pow(e,2)),i=180*Math.atan2(t/n,e/n)/Math.PI+180;return"bearingCW"!==r&&"meteoCCW"!==r||(i+=180)>=360&&(i-=360),i}},{key:"vectorToSpeed",value:function(t,e,r){var n=Math.sqrt(Math.pow(t,2)+Math.pow(e,2));return"k/h"===r?3.6*n:"kt"===r?n/.514:n}},{key:"closeWind",value:function(){this._closeEvent(),this.removeToolTip(),this.map.removeLayer(this.windLayer),delete this.windLayer,this.windLayer=null}}]),t}();exports.Arrow3D=NB,exports.CoordinateTransform=QM,exports.LineGeometry=mB,exports.LineMaterial=Kb,exports.TextureAnimator=O_,exports.bloomClass=SM,exports.bloomLine=VB,exports.calIntersection=__,exports.calPointColor=w_,exports.drawTool=kM,exports.getCenterOfPoints=h_,exports.getCirGeojson=function(t,e,r,n,i){for(var s=i.map,a=i.coordinateToVector3([t,e],0),u=(new o.Matrix4).makeTranslation(a.x,a.y,0),l=i.distanceToVector3(r,r).x,c=[],h=0;h<=360;h++){var f=new o.Vector3(Math.sin(h*(Math.PI/180))*l,Math.cos(h*(Math.PI/180))*l,0);f=f.applyMatrix4(u);var p=s.pointAtResToCoord(f,s.getGLRes());c.push([p.x,p.y])}return{type:"FeatureCollection",name:"net",crs:{type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}},features:[{type:"Feature",properties:{Id:0,color:n.color||"#fff"},geometry:{type:"MultiPolygon",coordinates:[[c]]}}]}},exports.getPsByCircle=function(t,e,r,n,i){for(var s,a,u=[],l=i.map,c=i.coordinateToVector3([t,e],0),h=(new o.Matrix4).makeTranslation(c.x,c.y,0),f=i.distanceToVector3(r,r).x,p=0;p<=360;){var g=(a=void 0,a=0,(s=p)<=90?a=-s:s>90&&s<=180||s>180&&s<=270?a=180-s:s>270&&s<360&&(a=360-s),{rotation:a}),d=y_(p,f,h),A=l.pointAtResToCoord(d,l.getGLRes());u.push({coord:[A.x,A.y],rotation:g.rotation}),p+=n}return u},exports.getVPointGeojson=m_,exports.gisCommon=H_,exports.gltfLoadClass=VC,exports.imgClass=B_,exports.layerClass=DM,exports.layerClassNoOverride=FM,exports.line2Object=LB,exports.line2Polygon=function(t,e){for(var r=[],n=[],o=0;o<t.length-1;o++){var s=[],a=o+1,u=m_(t[o][0],t[o][1],t[a][0],t[a][1],50,0,e);s.push(u.features[0].geometry.coordinates[0][0][0]),s.push(u.features[0].geometry.coordinates[0][0][1]);var l=m_(t[a][0],t[a][1],t[o][0],t[o][1],50,0,e);s.push(l.features[0].geometry.coordinates[0][0][0]),s.push(l.features[0].geometry.coordinates[0][0][1]),s.push(u.features[0].geometry.coordinates[0][0][0]);var c={type:"FeatureCollection",features:[{type:"Feature",properties:{_draw_type:"line"},geometry:{type:"MultiPolygon",coordinates:[[s]]}}]};r.push(s);var h=new i.MultiPolygon(c.features[0].geometry.coordinates);n.push(h)}var f=[];f.push(r[0][0]),f.push(r[0][1]);for(var p=0;p<r.length-1;p++){var g=n[p],d=n[p+1],A=r[p],y=r[p+1],v=__(g,d);if(I_(v,0===p?A[2]:y[1])){var m=x_(v,A,y,t);f.push(m)}else f.push(A[2]),f.push(y[1])}f.push(r[r.length-1][2]),f.push(r[r.length-1][3]);for(var _=r.length-1;_>0;_--){var I=n[_],E=n[_-1],x=r[_],w=r[_-1],C=__(I,E);if(I_(C,x[4])){var b=x_(C,x,w,t);f.push(b)}else f.push(x[4]),f.push(w[3])}return f.push(r[0][0]),f},exports.lineLength=A_,exports.outlineBloomClass=MM,exports.overLayer=OM,exports.planeGifClass=bB,exports.planeMark=aI,exports.planeSectorClass=U_,exports.polygonClass=OB,exports.polylineClass=Zb,exports.radarClass=T_,exports.rippleWallClass=Yb,exports.sectorClass=F_,exports.shockClass=V_,exports.shockMarkerClass=qM,exports.sleep=u_,exports.tileClass=UC,exports.tripHeight=PB,exports.tripHeight1=DB,exports.tripLineClass=FB,exports.tubeClass=MB,exports.turf=r_,exports.verticalFatLineClass=xB,exports.windClass=tL;
|