map-core-func 0.1.102 → 0.1.103

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 KP(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ZP(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 $P(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 tD={markerType:"ellipse",markerFill: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)"]]}}([135,196,240]),markerFillOpacity:.8,markerLineWidth:0,markerWidth:16,markerHeight:16},eD=function(e){function r(){return KP(this,r),ZP(this,e.apply(this,arguments))}return $P(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);eD.mergeOptions({animation:"scale,fade",randomAnimation:!0,animationDuration:3e3}),eD.registerJSONType("AnimateMarkerLayer"),eD.registerRenderer("canvas",function(e){function r(){return KP(this,r),ZP(this,e.apply(this,arguments))}return $P(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,d=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-d*l/2,p*l,d*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?tD: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 rD=function(){return p((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 eD(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)}),[{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}}])}();const nD=Object.prototype.hasOwnProperty,iD="undefined"!=typeof Symbol?Symbol.toStringTag:void 0;function oD(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(!iD||!(iD in Object(t)))return toString.call(t);const e=nD.call(t,iD),r=t[iD];let n=!1;try{t[iD]=void 0,n=!0}catch(t){}const i=Object.prototype.toString.call(t);return n&&(e?t[iD]=r:delete t[iD]),i}(t);return"[object Function]"===e||"[object AsyncFunction]"===e||"[object GeneratorFunction]"===e||"[object Proxy]"===e}function sD(t){return"[object Number]"===Object.prototype.toString.call(t)&&!isNaN(t)}function aD(t,...e){return Object.assign(t,...e)}const uD={};function lD(t,e){uD[e]||(!function(t,e){console.warn(`${e||"wind-layer"}: ${t}`)}(e,t),uD[e]=!0)}function cD(t){return null!=t&&!isNaN(t)}class hD{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 fD{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&&lD("[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 hD(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 hD(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 pD={globalAlpha:.9,lineWidth:1,colorScale:"#fff",velocityScale:.04,maxAge:90,paths:800,frameRate:20,useCoordsDraw:!0,gpet:!0};function dD(t,e,r,n){return Math.max(0,Math.min(n.length-1,Math.round((t-e)/(r-e)*(n.length-1))))}class gD{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={...pD,...t};const{width:e,height:r}=this.ctx.canvas;"particleAge"in t&&!("maxAge"in t)&&sD(this.options.particleAge)&&(this.options.maxAge=this.options.particleAge),"particleMultiplier"in t&&!("paths"in t)&&sD(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=oD(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=sD(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(cD(this.options.minVelocity)&&cD(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&&cD(i[0])&&cD(i[1])&&cD(n[0])&&cD(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]),oD(this.options.colorScale))this.ctx.strokeStyle=this.options.colorScale(t.m);else if(Array.isArray(this.options.colorScale)){const n=dD(t.m,e,r,this.options.colorScale);this.ctx.strokeStyle=this.options.colorScale[n]}oD(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&&cD(i[0])&&cD(i[1])&&cD(n[0])&&cD(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,oD(this.options.colorScale))this.ctx.strokeStyle=this.options.colorScale(t.m);else if(Array.isArray(this.options.colorScale)){const n=dD(t.m,e,r,this.options.colorScale);this.ctx.strokeStyle=this.options.colorScale[n]}oD(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)}}gD.Field=fD;var AD=null;try{var yD="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");AD=yD.Worker}catch(t){}function vD(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 AD(s,Object.assign({},t,{eval:!0}))}}function mD(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 _D="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);var xD,ED,ID,wD=(xD="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICd1c2Ugc3RyaWN0JzsKCiAgZnVuY3Rpb24gY2FsY01pbk1heChhcnJheSkgewogICAgbGV0IG1pbiA9IEluZmluaXR5OwogICAgbGV0IG1heCA9IEluZmluaXR5OwogICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcnJheS5sZW5ndGg7IGkrKykgewogICAgICBjb25zdCB2YWwgPSBhcnJheVtpXTsKICAgICAgaWYgKG1pbiA9PT0gSW5maW5pdHkpIHsKICAgICAgICBtaW4gPSB2YWw7CiAgICAgIH0gZWxzZSBpZiAobWF4ID09PSBJbmZpbml0eSkgewogICAgICAgIG1heCA9IHZhbDsKICAgICAgICBtaW4gPSBNYXRoLm1pbihtaW4sIG1heCk7CiAgICAgICAgbWF4ID0gTWF0aC5tYXgobWluLCBtYXgpOwogICAgICB9IGVsc2UgewogICAgICAgIG1pbiA9IE1hdGgubWluKHZhbCwgbWluKTsKICAgICAgICBtYXggPSBNYXRoLm1heCh2YWwsIG1heCk7CiAgICAgIH0KICAgIH0KICAgIHJldHVybiBbbWluLCBtYXhdOwogIH0KCiAgY29uc3QgY3R4ID0gc2VsZjsKICBjdHguYWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsIGFzeW5jICh7IGRhdGE6IHBheWxvYWQgfSkgPT4gewogICAgY29uc3QgcmVuZGVyRm9ybSA9IHBheWxvYWRbMF07CiAgICBpZiAocmVuZGVyRm9ybSA9PT0gInJnIikgewogICAgICBjb25zdCB1RGF0YSA9IHBheWxvYWRbMV07CiAgICAgIGNvbnN0IHZEYXRhID0gcGF5bG9hZFsyXTsKICAgICAgY29uc3QgW3VNaW4sIHVNYXhdID0gY2FsY01pbk1heCh1RGF0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R5RGF0YS5idWZmZXJdKTsKICAgIH0KICB9KTsKCn0pKCk7Ci8vIyBzb3VyY2VNYXBwaW5nVVJMPURhdGFQcm9jZXNzZS5qcy5tYXAKCg==",ED="data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRGF0YVByb2Nlc3NlLmpzIiwic291cmNlcyI6WyJ3b3JrZXI6Ly93ZWItd29ya2VyL3V0aWxzL2NvbW1vbi50cyIsIndvcmtlcjovL3dlYi13b3JrZXIvd29ya2Vycy9EYXRhUHJvY2Vzc2UudHMiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGZ1bmN0aW9uIGNhbGNNaW5NYXgoYXJyYXk6IG51bWJlcltdKTogW251bWJlciwgbnVtYmVyXSB7XG4gIGxldCBtaW4gPSBJbmZpbml0eTtcbiAgbGV0IG1heCA9IEluZmluaXR5O1xuICAvLyBAZnJvbTogaHR0cHM6Ly9zdGFja292ZXJmbG93LmNvbS9xdWVzdGlvbnMvMTM1NDQ0NzYvaG93LXRvLWZpbmQtbWF4LWFuZC1taW4taW4tYXJyYXktdXNpbmctbWluaW11bS1jb21wYXJpc29uc1xuICBmb3IgKGxldCBpID0gMDsgaSA8IGFycmF5Lmxlbmd0aDsgaSsrKSB7XG4gICAgY29uc3QgdmFsID0gYXJyYXlbaV07XG5cbiAgICBpZiAobWluID09PSBJbmZpbml0eSkge1xuICAgICAgbWluID0gdmFsO1xuICAgIH0gZWxzZSBpZiAobWF4ID09PSBJbmZpbml0eSkge1xuICAgICAgbWF4ID0gdmFsO1xuICAgICAgLy8gdXBkYXRlIG1pbiBtYXhcbiAgICAgIC8vIDEuIFBpY2sgMiBlbGVtZW50cyhhLCBiKSwgY29tcGFyZSB0aGVtLiAoc2F5IGEgPiBiKVxuICAgICAgbWluID0gTWF0aC5taW4obWluLCBtYXgpO1xuICAgICAgbWF4ID0gTWF0aC5tYXgobWluLCBtYXgpO1xuICAgIH0gZWxzZSB7XG4gICAgICAvLyAyL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ZQUFBLENBQUEsR0FBQSxDQUFJLENBQUMsQ0FBRyxFQUFBLENBQUEsRUFBRyxHQUFHLEdBQUcsQ0FBQSxFQUFHLElBQUksQ0FBQyxDQUFBLENBQUE7RUFBQSxLQUN4QztFQUVBLElBQUksR0FBQSxDQUFBLFdBQUEsQ0FBWSxDQUFDLFlBQUEsQ0FBYSxNQUFRLEVBQUEsR0FBQSxFQUFLLEdBQUcsQ0FBRyxFQUFBLENBQUMsWUFBYSxDQUFBLE1BQU0sQ0FBQyxDQUFBLENBQUE7RUFBQSxHQUN4RTtFQUNGLENBQUMsQ0FBQTs7Ozs7OyJ9",ID=!1,_D?vD(xD,ED,ID):function(t,e,r){var n;return function(i){return n=n||mD(t,e,r),new Worker(n,i)}}(xD,ED,ID));function bD(t){return"number"==typeof t&&!isNaN(t)}function CD(t){return t-Math.fround(t)}function SD(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 BD(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 MD(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 TD(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 LD(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 RD{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=BD(t,t.VERTEX_SHADER,e),i=BD(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 LD(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?(SD(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 PD="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);}}",DD="#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 kD extends RD{constructor(t,e,r,n){super(t,e||DD,r||PD,n||{}),this.vertShader=DD,this.fragShader=PD}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 ND(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 FD(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 QD={};function OD(t,e,r,n,i){const o=`${t}_${r}`,s=n[r];if(bD(s))return QD[o]&&delete QD[o],s;if(s&&Array.isArray(s)&&(!QD[o]||i)&&(QD[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)),QD[o]){const{input:t,interpolation:r}=QD[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=FD(e,t.base,r,n):"linear"===t.name?i=FD(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 UD="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);}}",GD="#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 zD extends RD{constructor(t,e,r,n){super(t,e||GD,r||UD,n||{}),this.vertShader=GD,this.fragShader=UD}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 VD={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,d=s/c,g=a/h,A=[],y=[],v=[],m=[],_=[];for(let e=0;e<p;e++){const n=e*g;for(let i=0;i<f;i++){const o=t+i*d/u/2*s,f=r+n/l/2*a;v.push(o,f,0),m.push(CD(o),CD(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 jD=0;class HD{constructor(t,e){if(this.gl=t,this.uid=`ScalarFill_${jD}`,jD++,!this.gl)throw new Error("initialize error");e||(e={}),this.options={...VD,...e},this.opacity=this.options.opacity||1}updateOptions(t){this.options={...this.options,...t},this.buildColorRamp(),"function"==typeof this.options.getZoom&&this.setOpacity(OD(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(OD(this.uid,this.options.getZoom(),"opacity",this.options.styleSpec))}buildColorRamp(){var t;const{data:e,colorRange:r}=ND([],null==(t=this.options.styleSpec)?void 0:t["fill-color"]);r&&(this.colorRange=r),e&&(this.colorRampTexture=MD(this.gl,this.gl.NEAREST,e,16,16))}initialize(t){this.drawCommand||("rg"===this.options.renderForm?this.drawCommand=new zD(t,void 0,void 0,this.options.injectShaderModules):"r"===this.options.renderForm?this.drawCommand=new kD(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(OD(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||VD.createPlaneBuffer)(n,this.options.widthSegments||1,this.options.heightSegments||1);return{indexes:i.elements.data,wireframeIndexes:i.wireframeElements.data,quadBuffer:TD(this.gl,new Float32Array(i.position.data)),quad64LowBuffer:TD(this.gl,new Float32Array(i.positionLow.data)),texCoordBuffer:TD(this.gl,new Float32Array(i.uvs.data))}}getTextureData(t){return new Promise(((e,r)=>{if("image"===t.type&&t.url)(n=t.url,new Promise(((t,e)=>{n||e(new Event("url is null"));const r=new Image;r.crossOrigin="anonymous",r.onload=()=>t(r),r.onerror=e,r.src=n,r.complete&&t(r)}))).then((r=>{const n={width:r.width,height:r.height,texture:MD(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 wD,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=MD(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=MD(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")}var n}))}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:bD(n)?n:1,u_image_res:[this.data.width,this.data.height],u_matrix:t,u_offset:bD(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 qD(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 YD(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 WD(t){return t.getGLRes?t.getGLRes():t.getGLZoom()}function XD(t,e,r,n){return t.coordToPointAtRes?t.coordToPointAtRes(e,r,n):t.coordinateToPoint(e,r,n)}const JD={renderer:"gl",doubleBuffer:!1,animation:!1,glOptions:{antialias:!0,depth:!0,stencil:!0,alpha:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0}};class KD 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&&LD(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 HD(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=XD(e,new t.Coordinate(r,n),WD(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=>CD(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(XD(e,e.getProjection().unprojectCoords(new t.Coordinate([n[0],n[1]])),WD(e)).x-XD(e,e.getProjection().unprojectCoords(new t.Coordinate([n[2],n[3]])),WD(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 ZD extends t.CanvasLayer{constructor(t,e,r){super(t,{...JD,...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()}}ZD.registerRenderer("gl",KD);const $D={renderer:"canvas",doubleBuffer:!1,animation:!1,windOptions:{}};class tk 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 gD(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 YD(t,qD,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 ek extends t.CanvasLayer{constructor(t,e,r={}){super(t,aD({},$D,r)),this._map=null,this.pickWindOptions(),e&&this.setData(e,r.fieldOptions)}pickWindOptions(){Object.keys(pD).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 fD({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=aD(this.options,{windOptions:aD(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()}}ek.registerRenderer("canvas",tk);const rk=ek;var nk={exports:{}};!function(t,e){var r="__lodash_hash_undefined__",n=1/0,i=9007199254740991,o=17976931348623157e292,s=NaN,a="[object Arguments]",u="[object Array]",l="[object Boolean]",c="[object Date]",h="[object Error]",f="[object Function]",p="[object Map]",d="[object Number]",g="[object Object]",A="[object Promise]",y="[object RegExp]",v="[object Set]",m="[object String]",_="[object Symbol]",x="[object WeakMap]",E="[object ArrayBuffer]",I="[object DataView]",w=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,b=/^\w*$/,C=/^\./,S=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,B=/^\s+|\s+$/g,M=/\\(\\)?/g,T=/^[-+]0x[0-9a-f]+$/i,L=/^0b[01]+$/i,R=/^\[object .+?Constructor\]$/,P=/^0o[0-7]+$/i,D=/^(?:0|[1-9]\d*)$/,k={};k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k[a]=k[u]=k[E]=k[l]=k[I]=k[c]=k[h]=k[f]=k[p]=k[d]=k[g]=k[y]=k[v]=k[m]=k[x]=!1;var N=parseInt,F="object"==typeof Qt&&Qt&&Qt.Object===Object&&Qt,Q="object"==typeof self&&self&&self.Object===Object&&self,O=F||Q||Function("return this")(),U=e&&!e.nodeType&&e,G=U&&t&&!t.nodeType&&t,z=G&&G.exports===U&&F.process,V=function(){try{return z&&z.binding("util")}catch(t){}}(),j=V&&V.isTypedArray;function H(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function q(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function Y(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function W(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var X,J=Array.prototype,K=Function.prototype,Z=Object.prototype,$=O["__core-js_shared__"],tt=(X=/[^.]+$/.exec($&&$.keys&&$.keys.IE_PROTO||""))?"Symbol(src)_1."+X:"",et=K.toString,rt=Z.hasOwnProperty,nt=Z.toString,it=RegExp("^"+et.call(rt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ot=O.Symbol,st=O.Uint8Array,at=Z.propertyIsEnumerable,ut=J.splice,lt=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),ct=Math.max,ht=zt(O,"DataView"),ft=zt(O,"Map"),pt=zt(O,"Promise"),dt=zt(O,"Set"),gt=zt(O,"WeakMap"),At=zt(Object,"create"),yt=Jt(ht),vt=Jt(ft),mt=Jt(pt),_t=Jt(dt),xt=Jt(gt),Et=ot?ot.prototype:void 0,It=Et?Et.valueOf:void 0,wt=Et?Et.toString:void 0;function bt(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 Ct(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 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 Bt(t){var e=-1,r=t?t.length:0;for(this.__data__=new St;++e<r;)this.add(t[e])}function Mt(t){this.__data__=new Ct(t)}function Tt(t,e){var r=re(t)||ee(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&&!rt.call(t,o)||i&&("length"==o||jt(o,n))||r.push(o);return r}function Lt(t,e){for(var r=t.length;r--;)if(te(t[r][0],e))return r;return-1}function Rt(t,e){for(var r=0,n=(e=Ht(e,t)?[e]:Ot(e)).length;null!=t&&r<n;)t=t[Xt(e[r++])];return r&&r==n?t:void 0}function Pt(t,e){return null!=t&&e in Object(t)}function Dt(t,e,r,n,i){return t===e||(null==t||null==e||!se(t)&&!ae(e)?t!=t&&e!=e:function(t,e,r,n,i,o){var s=re(t),f=re(e),A=u,x=u;s||(A=(A=Vt(t))==a?g:A);f||(x=(x=Vt(e))==a?g:x);var w=A==g&&!q(t),b=x==g&&!q(e),C=A==x;if(C&&!w)return o||(o=new Mt),s||ce(t)?Ut(t,e,r,n,i,o):function(t,e,r,n,i,o,s){switch(r){case I:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case E:return!(t.byteLength!=e.byteLength||!n(new st(t),new st(e)));case l:case c:case d:return te(+t,+e);case h:return t.name==e.name&&t.message==e.message;case y:case m:return t==e+"";case p:var a=Y;case v:var u=2&o;if(a||(a=W),t.size!=e.size&&!u)return!1;var f=s.get(t);if(f)return f==e;o|=1,s.set(t,e);var g=Ut(a(t),a(e),n,i,o,s);return s.delete(t),g;case _:if(It)return It.call(t)==It.call(e)}return!1}(t,e,A,r,n,i,o);if(!(2&i)){var S=w&&rt.call(t,"__wrapped__"),B=b&&rt.call(e,"__wrapped__");if(S||B){var M=S?t.value():t,T=B?e.value():e;return o||(o=new Mt),r(M,T,n,i,o)}}if(!C)return!1;return o||(o=new Mt),function(t,e,r,n,i,o){var s=2&i,a=he(t),u=a.length,l=he(e),c=l.length;if(u!=c&&!s)return!1;var h=u;for(;h--;){var f=a[h];if(!(s?f in e:rt.call(e,f)))return!1}var p=o.get(t);if(p&&o.get(e))return p==e;var d=!0;o.set(t,e),o.set(e,t);var g=s;for(;++h<u;){var A=t[f=a[h]],y=e[f];if(n)var v=s?n(y,A,f,e,t,o):n(A,y,f,t,e,o);if(!(void 0===v?A===y||r(A,y,n,i,o):v)){d=!1;break}g||(g="constructor"==f)}if(d&&!g){var m=t.constructor,_=e.constructor;m==_||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof _&&_ instanceof _||(d=!1)}return o.delete(t),o.delete(e),d}(t,e,r,n,i,o)}(t,e,Dt,r,n,i))}function kt(t){return!(!se(t)||(e=t,tt&&tt in e))&&(ie(t)||q(t)?it:R).test(Jt(t));var e}function Nt(t){return"function"==typeof t?t:null==t?fe:"object"==typeof t?re(t)?function(t,e){if(Ht(t)&&qt(e))return Yt(Xt(t),e);return function(r){var n=function(t,e,r){var n=null==t?void 0:Rt(t,e);return void 0===n?r:n}(r,t);return void 0===n&&n===e?function(t,e){return null!=t&&function(t,e,r){e=Ht(e,t)?[e]:Ot(e);var n,i=-1,o=e.length;for(;++i<o;){var s=Xt(e[i]);if(!(n=null!=t&&r(t,s)))break;t=t[s]}if(n)return n;o=t?t.length:0;return!!o&&oe(o)&&jt(s,o)&&(re(t)||ee(t))}(t,e,Pt)}(r,t):Dt(e,n,void 0,3)}}(t[0],t[1]):function(t){var e=function(t){var e=he(t),r=e.length;for(;r--;){var n=e[r],i=t[n];e[r]=[n,i,qt(i)]}return e}(t);if(1==e.length&&e[0][2])return Yt(e[0][0],e[0][1]);return function(r){return r===t||function(t,e,r,n){var i=r.length,o=i,s=!n;if(null==t)return!o;for(t=Object(t);i--;){var a=r[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){var u=(a=r[i])[0],l=t[u],c=a[1];if(s&&a[2]){if(void 0===l&&!(u in t))return!1}else{var h=new Mt;if(n)var f=n(l,c,u,t,e,h);if(!(void 0===f?Dt(c,l,n,3,h):f))return!1}}return!0}(r,t,e)}}(t):Ht(e=t)?(r=Xt(e),function(t){return null==t?void 0:t[r]}):function(t){return function(e){return Rt(e,t)}}(e);var e,r}function Ft(t){if(r=(e=t)&&e.constructor,n="function"==typeof r&&r.prototype||Z,e!==n)return lt(t);var e,r,n,i=[];for(var o in Object(t))rt.call(t,o)&&"constructor"!=o&&i.push(o);return i}function Ot(t){return re(t)?t:Wt(t)}function Ut(t,e,r,n,i,o){var s=2&i,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var l=o.get(t);if(l&&o.get(e))return l==e;var c=-1,h=!0,f=1&i?new Bt:void 0;for(o.set(t,e),o.set(e,t);++c<a;){var p=t[c],d=e[c];if(n)var g=s?n(d,p,c,e,t,o):n(p,d,c,t,e,o);if(void 0!==g){if(g)continue;h=!1;break}if(f){if(!H(e,(function(t,e){if(!f.has(e)&&(p===t||r(p,t,n,i,o)))return f.add(e)}))){h=!1;break}}else if(p!==d&&!r(p,d,n,i,o)){h=!1;break}}return o.delete(t),o.delete(e),h}function Gt(t,e){var r=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?r["string"==typeof e?"string":"hash"]:r.map}function zt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return kt(r)?r:void 0}bt.prototype.clear=function(){this.__data__=At?At(null):{}},bt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},bt.prototype.get=function(t){var e=this.__data__;if(At){var n=e[t];return n===r?void 0:n}return rt.call(e,t)?e[t]:void 0},bt.prototype.has=function(t){var e=this.__data__;return At?void 0!==e[t]:rt.call(e,t)},bt.prototype.set=function(t,e){return this.__data__[t]=At&&void 0===e?r:e,this},Ct.prototype.clear=function(){this.__data__=[]},Ct.prototype.delete=function(t){var e=this.__data__,r=Lt(e,t);return!(r<0)&&(r==e.length-1?e.pop():ut.call(e,r,1),!0)},Ct.prototype.get=function(t){var e=this.__data__,r=Lt(e,t);return r<0?void 0:e[r][1]},Ct.prototype.has=function(t){return Lt(this.__data__,t)>-1},Ct.prototype.set=function(t,e){var r=this.__data__,n=Lt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},St.prototype.clear=function(){this.__data__={hash:new bt,map:new(ft||Ct),string:new bt}},St.prototype.delete=function(t){return Gt(this,t).delete(t)},St.prototype.get=function(t){return Gt(this,t).get(t)},St.prototype.has=function(t){return Gt(this,t).has(t)},St.prototype.set=function(t,e){return Gt(this,t).set(t,e),this},Bt.prototype.add=Bt.prototype.push=function(t){return this.__data__.set(t,r),this},Bt.prototype.has=function(t){return this.__data__.has(t)},Mt.prototype.clear=function(){this.__data__=new Ct},Mt.prototype.delete=function(t){return this.__data__.delete(t)},Mt.prototype.get=function(t){return this.__data__.get(t)},Mt.prototype.has=function(t){return this.__data__.has(t)},Mt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Ct){var n=r.__data__;if(!ft||n.length<199)return n.push([t,e]),this;r=this.__data__=new St(n)}return r.set(t,e),this};var Vt=function(t){return nt.call(t)};function jt(t,e){return!!(e=null==e?i:e)&&("number"==typeof t||D.test(t))&&t>-1&&t%1==0&&t<e}function Ht(t,e){if(re(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!ue(t))||(b.test(t)||!w.test(t)||null!=e&&t in Object(e))}function qt(t){return t==t&&!se(t)}function Yt(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}(ht&&Vt(new ht(new ArrayBuffer(1)))!=I||ft&&Vt(new ft)!=p||pt&&Vt(pt.resolve())!=A||dt&&Vt(new dt)!=v||gt&&Vt(new gt)!=x)&&(Vt=function(t){var e=nt.call(t),r=e==g?t.constructor:void 0,n=r?Jt(r):void 0;if(n)switch(n){case yt:return I;case vt:return p;case mt:return A;case _t:return v;case xt:return x}return e});var Wt=$t((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(ue(t))return wt?wt.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(e);var r=[];return C.test(t)&&r.push(""),t.replace(S,(function(t,e,n,i){r.push(n?i.replace(M,"$1"):e||t)})),r}));function Xt(t){if("string"==typeof t||ue(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Jt(t){if(null!=t){try{return et.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var Kt,Zt=(Kt=function(t,e,r){var i=t?t.length:0;if(!i)return-1;var a,u,l=null==r?0:(a=function(t){return t?(t=function(t){if("number"==typeof t)return t;if(ue(t))return s;if(se(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=se(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(B,"");var r=L.test(t);return r||P.test(t)?N(t.slice(2),r?2:8):T.test(t)?s:+t}(t))===n||t===-1/0?(t<0?-1:1)*o:t==t?t:0:0===t?t:0}(r),u=a%1,a==a?u?a-u:a:0);return l<0&&(l=ct(i+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,Nt(e),l)},function(t,e,r){var n=Object(t);if(!ne(t)){var i=Nt(e);t=he(t),e=function(t){return i(n[t],t,n)}}var o=Kt(t,e,r);return o>-1?n[i?t[o]:o]:void 0});function $t(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($t.Cache||St),r}function te(t,e){return t===e||t!=t&&e!=e}function ee(t){return function(t){return ae(t)&&ne(t)}(t)&&rt.call(t,"callee")&&(!at.call(t,"callee")||nt.call(t)==a)}$t.Cache=St;var re=Array.isArray;function ne(t){return null!=t&&oe(t.length)&&!ie(t)}function ie(t){var e=se(t)?nt.call(t):"";return e==f||"[object GeneratorFunction]"==e}function oe(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=i}function se(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function ae(t){return!!t&&"object"==typeof t}function ue(t){return"symbol"==typeof t||ae(t)&&nt.call(t)==_}var le,ce=j?(le=j,function(t){return le(t)}):function(t){return ae(t)&&oe(t.length)&&!!k[nt.call(t)]};function he(t){return ne(t)?Tt(t):Ft(t)}function fe(t){return t}t.exports=Zt}(nk,nk.exports);var ik=nk.exports,ok={exports:{}};!function(t,e){var r="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",o="[object Array]",s="[object Boolean]",a="[object Date]",u="[object Error]",l="[object Function]",c="[object Map]",h="[object Number]",f="[object Object]",p="[object Promise]",d="[object RegExp]",g="[object Set]",A="[object String]",y="[object Symbol]",v="[object WeakMap]",m="[object ArrayBuffer]",_="[object DataView]",x=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,E=/^\w*$/,I=/^\./,w=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,b=/\\(\\)?/g,C=/^\[object .+?Constructor\]$/,S=/^(?:0|[1-9]\d*)$/,B={};B["[object Float32Array]"]=B["[object Float64Array]"]=B["[object Int8Array]"]=B["[object Int16Array]"]=B["[object Int32Array]"]=B["[object Uint8Array]"]=B["[object Uint8ClampedArray]"]=B["[object Uint16Array]"]=B["[object Uint32Array]"]=!0,B[i]=B[o]=B[m]=B[s]=B[_]=B[a]=B[u]=B[l]=B[c]=B[h]=B[f]=B[d]=B[g]=B[A]=B[v]=!1;var M="object"==typeof Qt&&Qt&&Qt.Object===Object&&Qt,T="object"==typeof self&&self&&self.Object===Object&&self,L=M||T||Function("return this")(),R=e&&!e.nodeType&&e,P=R&&t&&!t.nodeType&&t,D=P&&P.exports===R&&M.process,k=function(){try{return D&&D.binding("util")}catch(t){}}(),N=k&&k.isTypedArray;function F(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 Q(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function O(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function U(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function G(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var z,V=Array.prototype,j=Function.prototype,H=Object.prototype,q=L["__core-js_shared__"],Y=(z=/[^.]+$/.exec(q&&q.keys&&q.keys.IE_PROTO||""))?"Symbol(src)_1."+z:"",W=j.toString,X=H.hasOwnProperty,J=H.toString,K=RegExp("^"+W.call(X).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Z=L.Symbol,$=L.Uint8Array,tt=H.propertyIsEnumerable,et=V.splice,rt=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),nt=Ot(L,"DataView"),it=Ot(L,"Map"),ot=Ot(L,"Promise"),st=Ot(L,"Set"),at=Ot(L,"WeakMap"),ut=Ot(Object,"create"),lt=Yt(nt),ct=Yt(it),ht=Yt(ot),ft=Yt(st),pt=Yt(at),dt=Z?Z.prototype:void 0,gt=dt?dt.valueOf:void 0,At=dt?dt.toString:void 0;function yt(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 vt(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 _t(t){var e=-1,r=t?t.length:0;for(this.__data__=new mt;++e<r;)this.add(t[e])}function xt(t){this.__data__=new vt(t)}function Et(t,e){var r=Kt(t)||Jt(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&&!X.call(t,o)||i&&("length"==o||Gt(o,n))||r.push(o);return r}function It(t,e){for(var r=t.length;r--;)if(Xt(t[r][0],e))return r;return-1}yt.prototype.clear=function(){this.__data__=ut?ut(null):{}},yt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},yt.prototype.get=function(t){var e=this.__data__;if(ut){var n=e[t];return n===r?void 0:n}return X.call(e,t)?e[t]:void 0},yt.prototype.has=function(t){var e=this.__data__;return ut?void 0!==e[t]:X.call(e,t)},yt.prototype.set=function(t,e){return this.__data__[t]=ut&&void 0===e?r:e,this},vt.prototype.clear=function(){this.__data__=[]},vt.prototype.delete=function(t){var e=this.__data__,r=It(e,t);return!(r<0)&&(r==e.length-1?e.pop():et.call(e,r,1),!0)},vt.prototype.get=function(t){var e=this.__data__,r=It(e,t);return r<0?void 0:e[r][1]},vt.prototype.has=function(t){return It(this.__data__,t)>-1},vt.prototype.set=function(t,e){var r=this.__data__,n=It(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},mt.prototype.clear=function(){this.__data__={hash:new yt,map:new(it||vt),string:new yt}},mt.prototype.delete=function(t){return Ft(this,t).delete(t)},mt.prototype.get=function(t){return Ft(this,t).get(t)},mt.prototype.has=function(t){return Ft(this,t).has(t)},mt.prototype.set=function(t,e){return Ft(this,t).set(t,e),this},_t.prototype.add=_t.prototype.push=function(t){return this.__data__.set(t,r),this},_t.prototype.has=function(t){return this.__data__.has(t)},xt.prototype.clear=function(){this.__data__=new vt},xt.prototype.delete=function(t){return this.__data__.delete(t)},xt.prototype.get=function(t){return this.__data__.get(t)},xt.prototype.has=function(t){return this.__data__.has(t)},xt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof vt){var n=r.__data__;if(!it||n.length<199)return n.push([t,e]),this;r=this.__data__=new mt(n)}return r.set(t,e),this};var wt,bt,Ct=(wt=function(t,e){return t&&St(t,e,se)},function(t,e){if(null==t)return t;if(!Zt(t))return wt(t,e);for(var r=t.length,n=bt?r:-1,i=Object(t);(bt?n--:++n<r)&&!1!==e(i[n],n,i););return t}),St=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 Bt(t,e){for(var r=0,n=(e=zt(e,t)?[e]:kt(e)).length;null!=t&&r<n;)t=t[qt(e[r++])];return r&&r==n?t:void 0}function Mt(t,e){return null!=t&&e in Object(t)}function Tt(t,e,r,n,l){return t===e||(null==t||null==e||!ee(t)&&!re(e)?t!=t&&e!=e:function(t,e,r,n,l,p){var v=Kt(t),x=Kt(e),E=o,I=o;v||(E=(E=Ut(t))==i?f:E);x||(I=(I=Ut(e))==i?f:I);var w=E==f&&!O(t),b=I==f&&!O(e),C=E==I;if(C&&!w)return p||(p=new xt),v||oe(t)?Nt(t,e,r,n,l,p):function(t,e,r,n,i,o,l){switch(r){case _:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case m:return!(t.byteLength!=e.byteLength||!n(new $(t),new $(e)));case s:case a:case h:return Xt(+t,+e);case u:return t.name==e.name&&t.message==e.message;case d:case A:return t==e+"";case c:var f=U;case g:var p=2&o;if(f||(f=G),t.size!=e.size&&!p)return!1;var v=l.get(t);if(v)return v==e;o|=1,l.set(t,e);var x=Nt(f(t),f(e),n,i,o,l);return l.delete(t),x;case y:if(gt)return gt.call(t)==gt.call(e)}return!1}(t,e,E,r,n,l,p);if(!(2&l)){var S=w&&X.call(t,"__wrapped__"),B=b&&X.call(e,"__wrapped__");if(S||B){var M=S?t.value():t,T=B?e.value():e;return p||(p=new xt),r(M,T,n,l,p)}}if(!C)return!1;return p||(p=new xt),function(t,e,r,n,i,o){var s=2&i,a=se(t),u=a.length,l=se(e),c=l.length;if(u!=c&&!s)return!1;var h=u;for(;h--;){var f=a[h];if(!(s?f in e:X.call(e,f)))return!1}var p=o.get(t);if(p&&o.get(e))return p==e;var d=!0;o.set(t,e),o.set(e,t);var g=s;for(;++h<u;){var A=t[f=a[h]],y=e[f];if(n)var v=s?n(y,A,f,e,t,o):n(A,y,f,t,e,o);if(!(void 0===v?A===y||r(A,y,n,i,o):v)){d=!1;break}g||(g="constructor"==f)}if(d&&!g){var m=t.constructor,_=e.constructor;m==_||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof _&&_ instanceof _||(d=!1)}return o.delete(t),o.delete(e),d}(t,e,r,n,l,p)}(t,e,Tt,r,n,l))}function Lt(t){return!(!ee(t)||(e=t,Y&&Y in e))&&($t(t)||O(t)?K:C).test(Yt(t));var e}function Rt(t){return"function"==typeof t?t:null==t?ae:"object"==typeof t?Kt(t)?function(t,e){if(zt(t)&&Vt(e))return jt(qt(t),e);return function(r){var n=function(t,e,r){var n=null==t?void 0:Bt(t,e);return void 0===n?r:n}(r,t);return void 0===n&&n===e?function(t,e){return null!=t&&function(t,e,r){e=zt(e,t)?[e]:kt(e);var n,i=-1,o=e.length;for(;++i<o;){var s=qt(e[i]);if(!(n=null!=t&&r(t,s)))break;t=t[s]}if(n)return n;o=t?t.length:0;return!!o&&te(o)&&Gt(s,o)&&(Kt(t)||Jt(t))}(t,e,Mt)}(r,t):Tt(e,n,void 0,3)}}(t[0],t[1]):function(t){var e=function(t){var e=se(t),r=e.length;for(;r--;){var n=e[r],i=t[n];e[r]=[n,i,Vt(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,n){var i=r.length,o=i,s=!n;if(null==t)return!o;for(t=Object(t);i--;){var a=r[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){var u=(a=r[i])[0],l=t[u],c=a[1];if(s&&a[2]){if(void 0===l&&!(u in t))return!1}else{var h=new xt;if(n)var f=n(l,c,u,t,e,h);if(!(void 0===f?Tt(c,l,n,3,h):f))return!1}}return!0}(r,t,e)}}(t):zt(e=t)?(r=qt(e),function(t){return null==t?void 0:t[r]}):function(t){return function(e){return Bt(e,t)}}(e);var e,r}function Pt(t){if(r=(e=t)&&e.constructor,n="function"==typeof r&&r.prototype||H,e!==n)return rt(t);var e,r,n,i=[];for(var o in Object(t))X.call(t,o)&&"constructor"!=o&&i.push(o);return i}function Dt(t,e){var r=-1,n=Zt(t)?Array(t.length):[];return Ct(t,(function(t,i,o){n[++r]=e(t,i,o)})),n}function kt(t){return Kt(t)?t:Ht(t)}function Nt(t,e,r,n,i,o){var s=2&i,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var l=o.get(t);if(l&&o.get(e))return l==e;var c=-1,h=!0,f=1&i?new _t:void 0;for(o.set(t,e),o.set(e,t);++c<a;){var p=t[c],d=e[c];if(n)var g=s?n(d,p,c,e,t,o):n(p,d,c,t,e,o);if(void 0!==g){if(g)continue;h=!1;break}if(f){if(!Q(e,(function(t,e){if(!f.has(e)&&(p===t||r(p,t,n,i,o)))return f.add(e)}))){h=!1;break}}else if(p!==d&&!r(p,d,n,i,o)){h=!1;break}}return o.delete(t),o.delete(e),h}function Ft(t,e){var r=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?r["string"==typeof e?"string":"hash"]:r.map}function Ot(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return Lt(r)?r:void 0}var Ut=function(t){return J.call(t)};function Gt(t,e){return!!(e=null==e?n:e)&&("number"==typeof t||S.test(t))&&t>-1&&t%1==0&&t<e}function zt(t,e){if(Kt(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!ne(t))||(E.test(t)||!x.test(t)||null!=e&&t in Object(e))}function Vt(t){return t==t&&!ee(t)}function jt(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}(nt&&Ut(new nt(new ArrayBuffer(1)))!=_||it&&Ut(new it)!=c||ot&&Ut(ot.resolve())!=p||st&&Ut(new st)!=g||at&&Ut(new at)!=v)&&(Ut=function(t){var e=J.call(t),r=e==f?t.constructor:void 0,n=r?Yt(r):void 0;if(n)switch(n){case lt:return _;case ct:return c;case ht:return p;case ft:return g;case pt:return v}return e});var Ht=Wt((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(ne(t))return At?At.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(e);var r=[];return I.test(t)&&r.push(""),t.replace(w,(function(t,e,n,i){r.push(n?i.replace(b,"$1"):e||t)})),r}));function qt(t){if("string"==typeof t||ne(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Yt(t){if(null!=t){try{return W.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Wt(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(Wt.Cache||mt),r}function Xt(t,e){return t===e||t!=t&&e!=e}function Jt(t){return function(t){return re(t)&&Zt(t)}(t)&&X.call(t,"callee")&&(!tt.call(t,"callee")||J.call(t)==i)}Wt.Cache=mt;var Kt=Array.isArray;function Zt(t){return null!=t&&te(t.length)&&!$t(t)}function $t(t){var e=ee(t)?J.call(t):"";return e==l||"[object GeneratorFunction]"==e}function te(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function ee(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function re(t){return!!t&&"object"==typeof t}function ne(t){return"symbol"==typeof t||re(t)&&J.call(t)==y}var ie,oe=N?(ie=N,function(t){return ie(t)}):function(t){return re(t)&&te(t.length)&&!!B[J.call(t)]};function se(t){return Zt(t)?Et(t):Pt(t)}function ae(t){return t}t.exports=function(t,e){return(Kt(t)?F:Dt)(t,Rt(e))}}(ok,ok.exports);var sk={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},ak=(0,ok.exports)(["南","东南偏南","东南","东南偏东","东","东北偏东","东北","东北偏北","北","西北偏北","西北","西北偏西","西","西南偏西","西南","西南偏南"],(function(t,e){var r=22.5,n=r*e;return{bearing:n,range:[n-11.25,n+11.25],label:t}})),uk=function(t,e,r){return t>=e&&t<r},lk=function(t){return ik(ak,(function(e){return uk(t,e.range[0],e.range[1])||uk(t-360,e.range[0],e.range[1])}))},ck=function(){return p((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 rk("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 sk[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()}),[{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=lk(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:lk(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}}])}();exports.Arrow3D=pR,exports.B3DMLoader=Mw,exports.B3DMLoaderBase=RI,exports.CMPTLoader=Vw,exports.CMPTLoaderBase=zw,exports.CUSTOM_COLOR=9,exports.CesiumIonTilesRenderer=JB,exports.CoordinateTransform=XP,exports.DEPTH=4,exports.DISTANCE=3,exports.DebugCesiumIonTilesRenderer=KB,exports.DebugGoogleTilesRenderer=WB,exports.DebugTilesRenderer=GS,exports.Ellipsoid=Sb,exports.EllipsoidRegion=Qb,exports.EllipsoidRegionHelper=DS,exports.EllipsoidRegionLineHelper=PS,exports.EnvironmentControls=bM,exports.FAILED=4,exports.GEOMETRIC_ERROR=2,exports.GLTFCesiumRTCExtension=jw,exports.GLTFExtensionLoader=Hw,exports.GLTFMeshFeaturesExtension=UB,exports.GLTFStructuralMetadataExtension=RB,exports.GeoUtils=db,exports.GlobeControls=VM,exports.GoogleTilesRenderer=YB,exports.I3DMLoader=Gw,exports.I3DMLoaderBase=Pw,exports.IS_LEAF=6,exports.LOADED=3,exports.LOADING=1,exports.LOAD_ORDER=10,exports.LRUCache=uI,exports.LineGeometry=$L,exports.LineMaterial=LL,exports.LoaderBase=TI,exports.NONE=0,exports.PARSING=2,exports.PNTSLoader=Rw,exports.PNTSLoaderBase=Tw,exports.PriorityQueue=lI,exports.RANDOM_COLOR=7,exports.RANDOM_NODE_COLOR=8,exports.RELATIVE_DEPTH=5,exports.SCREEN_ERROR=1,exports.SphereHelper=CS,exports.TextureAnimator=NE,exports.TilesRenderer=IS,exports.TilesRendererBase=bI,exports.UNLOADED=0,exports.WGS84_ELLIPSOID=GB,exports.WGS84_FLATTENING=hI,exports.WGS84_HEIGHT=fI,exports.WGS84_RADIUS=cI,exports.bloomClass=LP,exports.bloomLine=SR,exports.calIntersection=dE,exports.calPointColor=vE,exports.drawTool=WP,exports.extrudePolygon=IR,exports.getCenterOfPoints=oE,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 d=(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}),g=hE(p,f,h),A=l.pointAtResToCoord(g,l.getGLRes());u.push({coord:[A.x,A.y],rotation:d.rotation}),p+=n}return u},exports.getVPointGeojson=pE,exports.gisCommon=zE,exports.gltfLoadClass=IT,exports.imgClass=wE,exports.layerClass=qP,exports.layerClassNoOverride=YP,exports.line2Object=hR,exports.line2Polygon=function(t,e){for(var r=[],n=[],o=0;o<t.length-1;o++){var s=[],a=o+1,u=pE(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=pE(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 d=n[p],g=n[p+1],A=r[p],y=r[p+1],v=dE(d,g);if(gE(v,0===p?A[2]:y[1])){var m=yE(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 x=n[_],E=n[_-1],I=r[_],w=r[_-1],b=dE(x,E);if(gE(b,I[4])){var C=yE(b,I,w,t);f.push(C)}else f.push(I[4]),f.push(w[3])}return f.push(r[0][0]),f},exports.lineLength=cE,exports.outlineBloomClass=RP,exports.overLayer=JP,exports.planeGifClass=sR,exports.planeHeightClass=NP,exports.planeMark=iI,exports.planeSectorClass=FE,exports.polygonClass=_R,exports.polylineClass=RL,exports.radarClass=SE,exports.rippleWallClass=CL,exports.sectorClass=PE,exports.shockClass=UE,exports.shockMarkerClass=rD,exports.sleep=rE,exports.tileClass=_T,exports.tripHeight=dR,exports.tripHeight1=gR,exports.tripLineClass=AR,exports.tubeClass=lR,exports.turf=yx,exports.verticalFatLineClass=nR,exports.windClass=ck;
161
+ */function KP(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ZP(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 $P(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 tD={markerType:"ellipse",markerFill: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)"]]}}([135,196,240]),markerFillOpacity:.8,markerLineWidth:0,markerWidth:16,markerHeight:16},eD=function(e){function r(){return KP(this,r),ZP(this,e.apply(this,arguments))}return $P(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);eD.mergeOptions({animation:"scale,fade",randomAnimation:!0,animationDuration:3e3}),eD.registerJSONType("AnimateMarkerLayer"),eD.registerRenderer("canvas",function(e){function r(){return KP(this,r),ZP(this,e.apply(this,arguments))}return $P(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,d=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-d*l/2,p*l,d*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?tD: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 rD=function(){return p((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 eD(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)}),[{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}}])}();const nD=Object.prototype.hasOwnProperty,iD="undefined"!=typeof Symbol?Symbol.toStringTag:void 0;function oD(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(!iD||!(iD in Object(t)))return toString.call(t);const e=nD.call(t,iD),r=t[iD];let n=!1;try{t[iD]=void 0,n=!0}catch(t){}const i=Object.prototype.toString.call(t);return n&&(e?t[iD]=r:delete t[iD]),i}(t);return"[object Function]"===e||"[object AsyncFunction]"===e||"[object GeneratorFunction]"===e||"[object Proxy]"===e}function sD(t){return"[object Number]"===Object.prototype.toString.call(t)&&!isNaN(t)}function aD(t,...e){return Object.assign(t,...e)}const uD={};function lD(t,e){uD[e]||(!function(t,e){console.warn(`${e||"wind-layer"}: ${t}`)}(e,t),uD[e]=!0)}function cD(t){return null!=t&&!isNaN(t)}class hD{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 fD{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&&lD("[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 hD(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 hD(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 pD={globalAlpha:.9,lineWidth:1,colorScale:"#fff",velocityScale:.04,maxAge:90,paths:800,frameRate:20,useCoordsDraw:!0,gpet:!0};function dD(t,e,r,n){return Math.max(0,Math.min(n.length-1,Math.round((t-e)/(r-e)*(n.length-1))))}class gD{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={...pD,...t};const{width:e,height:r}=this.ctx.canvas;"particleAge"in t&&!("maxAge"in t)&&sD(this.options.particleAge)&&(this.options.maxAge=this.options.particleAge),"particleMultiplier"in t&&!("paths"in t)&&sD(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=oD(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=sD(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(cD(this.options.minVelocity)&&cD(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&&cD(i[0])&&cD(i[1])&&cD(n[0])&&cD(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]),oD(this.options.colorScale))this.ctx.strokeStyle=this.options.colorScale(t.m);else if(Array.isArray(this.options.colorScale)){const n=dD(t.m,e,r,this.options.colorScale);this.ctx.strokeStyle=this.options.colorScale[n]}oD(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&&cD(i[0])&&cD(i[1])&&cD(n[0])&&cD(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,oD(this.options.colorScale))this.ctx.strokeStyle=this.options.colorScale(t.m);else if(Array.isArray(this.options.colorScale)){const n=dD(t.m,e,r,this.options.colorScale);this.ctx.strokeStyle=this.options.colorScale[n]}oD(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)}}gD.Field=fD;var AD=null;try{var yD="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");AD=yD.Worker}catch(t){}function vD(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 AD(s,Object.assign({},t,{eval:!0}))}}function mD(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 _D="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);var xD,ED,ID,wD=(xD="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICd1c2Ugc3RyaWN0JzsKCiAgZnVuY3Rpb24gY2FsY01pbk1heChhcnJheSkgewogICAgbGV0IG1pbiA9IEluZmluaXR5OwogICAgbGV0IG1heCA9IEluZmluaXR5OwogICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcnJheS5sZW5ndGg7IGkrKykgewogICAgICBjb25zdCB2YWwgPSBhcnJheVtpXTsKICAgICAgaWYgKG1pbiA9PT0gSW5maW5pdHkpIHsKICAgICAgICBtaW4gPSB2YWw7CiAgICAgIH0gZWxzZSBpZiAobWF4ID09PSBJbmZpbml0eSkgewogICAgICAgIG1heCA9IHZhbDsKICAgICAgICBtaW4gPSBNYXRoLm1pbihtaW4sIG1heCk7CiAgICAgICAgbWF4ID0gTWF0aC5tYXgobWluLCBtYXgpOwogICAgICB9IGVsc2UgewogICAgICAgIG1pbiA9IE1hdGgubWluKHZhbCwgbWluKTsKICAgICAgICBtYXggPSBNYXRoLm1heCh2YWwsIG1heCk7CiAgICAgIH0KICAgIH0KICAgIHJldHVybiBbbWluLCBtYXhdOwogIH0KCiAgY29uc3QgY3R4ID0gc2VsZjsKICBjdHguYWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsIGFzeW5jICh7IGRhdGE6IHBheWxv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UFBUyxDQUFJLEdBQUEsQ0FBQSxFQUFHLENBQUksR0FBQSxVQUFBLENBQVcsUUFBUSxDQUFLLEVBQUEsRUFBQTtFQUMxQyxNQUFBLE1BQU0sQ0FBSSxHQUFBLEdBQUEsSUFBTyxVQUFXLENBQUEsQ0FBQSxDQUFBLEdBQUssUUFBUSxHQUFNLEdBQUEsR0FBQSxDQUFBLENBQUE7RUFDL0MsTUFBYSxZQUFBLENBQUEsR0FBQSxDQUFJLENBQUMsQ0FBRyxFQUFBLENBQUEsRUFBRyxHQUFHLEdBQUcsQ0FBQSxFQUFHLElBQUksQ0FBQyxDQUFBLENBQUE7RUFBQSxLQUN4QztFQUVBLElBQUksR0FBQSxDQUFBLFdBQUEsQ0FBWSxDQUFDLFlBQUEsQ0FBYSxNQUFRLEVBQUEsR0FBQSxFQUFLLEdBQUcsQ0FBRyxFQUFBLENBQUMsWUFBYSxDQUFBLE1BQU0sQ0FBQyxDQUFBLENBQUE7RUFBQSxHQUN4RTtFQUNGLENBQUMsQ0FBQTs7Ozs7OyJ9",ID=!1,_D?vD(xD,ED,ID):function(t,e,r){var n;return function(i){return n=n||mD(t,e,r),new Worker(n,i)}}(xD,ED,ID));function bD(t){return"number"==typeof t&&!isNaN(t)}function CD(t){return t-Math.fround(t)}function SD(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 BD(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 MD(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 TD(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 LD(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 RD{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=BD(t,t.VERTEX_SHADER,e),i=BD(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 LD(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?(SD(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 PD="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);}}",DD="#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 kD extends RD{constructor(t,e,r,n){super(t,e||DD,r||PD,n||{}),this.vertShader=DD,this.fragShader=PD}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 ND(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 FD(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 QD={};function OD(t,e,r,n,i){const o=`${t}_${r}`,s=n[r];if(bD(s))return QD[o]&&delete QD[o],s;if(s&&Array.isArray(s)&&(!QD[o]||i)&&(QD[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)),QD[o]){const{input:t,interpolation:r}=QD[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=FD(e,t.base,r,n):"linear"===t.name?i=FD(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 UD="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);}}",GD="#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 zD extends RD{constructor(t,e,r,n){super(t,e||GD,r||UD,n||{}),this.vertShader=GD,this.fragShader=UD}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 VD={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,d=s/c,g=a/h,A=[],y=[],v=[],m=[],_=[];for(let e=0;e<p;e++){const n=e*g;for(let i=0;i<f;i++){const o=t+i*d/u/2*s,f=r+n/l/2*a;v.push(o,f,0),m.push(CD(o),CD(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 jD=0;class HD{constructor(t,e){if(this.gl=t,this.uid=`ScalarFill_${jD}`,jD++,!this.gl)throw new Error("initialize error");e||(e={}),this.options={...VD,...e},this.opacity=this.options.opacity||1}updateOptions(t){this.options={...this.options,...t},this.buildColorRamp(),"function"==typeof this.options.getZoom&&this.setOpacity(OD(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(OD(this.uid,this.options.getZoom(),"opacity",this.options.styleSpec))}buildColorRamp(){var t;const{data:e,colorRange:r}=ND([],null==(t=this.options.styleSpec)?void 0:t["fill-color"]);r&&(this.colorRange=r),e&&(this.colorRampTexture=MD(this.gl,this.gl.NEAREST,e,16,16))}initialize(t){this.drawCommand||("rg"===this.options.renderForm?this.drawCommand=new zD(t,void 0,void 0,this.options.injectShaderModules):"r"===this.options.renderForm?this.drawCommand=new kD(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(OD(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||VD.createPlaneBuffer)(n,this.options.widthSegments||1,this.options.heightSegments||1);return{indexes:i.elements.data,wireframeIndexes:i.wireframeElements.data,quadBuffer:TD(this.gl,new Float32Array(i.position.data)),quad64LowBuffer:TD(this.gl,new Float32Array(i.positionLow.data)),texCoordBuffer:TD(this.gl,new Float32Array(i.uvs.data))}}getTextureData(t){return new Promise(((e,r)=>{if("image"===t.type&&t.url)(n=t.url,new Promise(((t,e)=>{n||e(new Event("url is null"));const r=new Image;r.crossOrigin="anonymous",r.onload=()=>t(r),r.onerror=e,r.src=n,r.complete&&t(r)}))).then((r=>{const n={width:r.width,height:r.height,texture:MD(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 wD,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=MD(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=MD(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")}var n}))}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:bD(n)?n:1,u_image_res:[this.data.width,this.data.height],u_matrix:t,u_offset:bD(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 qD(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 YD(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 WD(t){return t.getGLRes?t.getGLRes():t.getGLZoom()}function XD(t,e,r,n){return t.coordToPointAtRes?t.coordToPointAtRes(e,r,n):t.coordinateToPoint(e,r,n)}const JD={renderer:"gl",doubleBuffer:!1,animation:!1,glOptions:{antialias:!0,depth:!0,stencil:!0,alpha:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0}};class KD 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&&LD(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 HD(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=XD(e,new t.Coordinate(r,n),WD(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=>CD(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(XD(e,e.getProjection().unprojectCoords(new t.Coordinate([n[0],n[1]])),WD(e)).x-XD(e,e.getProjection().unprojectCoords(new t.Coordinate([n[2],n[3]])),WD(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 ZD extends t.CanvasLayer{constructor(t,e,r){super(t,{...JD,...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()}}ZD.registerRenderer("gl",KD);const $D={renderer:"canvas",doubleBuffer:!1,animation:!1,windOptions:{}};class tk 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 gD(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 YD(t,qD,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 ek extends t.CanvasLayer{constructor(t,e,r={}){super(t,aD({},$D,r)),this._map=null,this.pickWindOptions(),e&&this.setData(e,r.fieldOptions)}pickWindOptions(){Object.keys(pD).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 fD({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=aD(this.options,{windOptions:aD(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()}}ek.registerRenderer("canvas",tk);const rk=ek;var nk={exports:{}};!function(t,e){var r="__lodash_hash_undefined__",n=1/0,i=9007199254740991,o=17976931348623157e292,s=NaN,a="[object Arguments]",u="[object Array]",l="[object Boolean]",c="[object Date]",h="[object Error]",f="[object Function]",p="[object Map]",d="[object Number]",g="[object Object]",A="[object Promise]",y="[object RegExp]",v="[object Set]",m="[object String]",_="[object Symbol]",x="[object WeakMap]",E="[object ArrayBuffer]",I="[object DataView]",w=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,b=/^\w*$/,C=/^\./,S=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,B=/^\s+|\s+$/g,M=/\\(\\)?/g,T=/^[-+]0x[0-9a-f]+$/i,L=/^0b[01]+$/i,R=/^\[object .+?Constructor\]$/,P=/^0o[0-7]+$/i,D=/^(?:0|[1-9]\d*)$/,k={};k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k[a]=k[u]=k[E]=k[l]=k[I]=k[c]=k[h]=k[f]=k[p]=k[d]=k[g]=k[y]=k[v]=k[m]=k[x]=!1;var N=parseInt,F="object"==typeof Qt&&Qt&&Qt.Object===Object&&Qt,Q="object"==typeof self&&self&&self.Object===Object&&self,O=F||Q||Function("return this")(),U=e&&!e.nodeType&&e,G=U&&t&&!t.nodeType&&t,z=G&&G.exports===U&&F.process,V=function(){try{return z&&z.binding("util")}catch(t){}}(),j=V&&V.isTypedArray;function H(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function q(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function Y(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function W(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var X,J=Array.prototype,K=Function.prototype,Z=Object.prototype,$=O["__core-js_shared__"],tt=(X=/[^.]+$/.exec($&&$.keys&&$.keys.IE_PROTO||""))?"Symbol(src)_1."+X:"",et=K.toString,rt=Z.hasOwnProperty,nt=Z.toString,it=RegExp("^"+et.call(rt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ot=O.Symbol,st=O.Uint8Array,at=Z.propertyIsEnumerable,ut=J.splice,lt=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),ct=Math.max,ht=zt(O,"DataView"),ft=zt(O,"Map"),pt=zt(O,"Promise"),dt=zt(O,"Set"),gt=zt(O,"WeakMap"),At=zt(Object,"create"),yt=Jt(ht),vt=Jt(ft),mt=Jt(pt),_t=Jt(dt),xt=Jt(gt),Et=ot?ot.prototype:void 0,It=Et?Et.valueOf:void 0,wt=Et?Et.toString:void 0;function bt(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 Ct(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 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 Bt(t){var e=-1,r=t?t.length:0;for(this.__data__=new St;++e<r;)this.add(t[e])}function Mt(t){this.__data__=new Ct(t)}function Tt(t,e){var r=re(t)||ee(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&&!rt.call(t,o)||i&&("length"==o||jt(o,n))||r.push(o);return r}function Lt(t,e){for(var r=t.length;r--;)if(te(t[r][0],e))return r;return-1}function Rt(t,e){for(var r=0,n=(e=Ht(e,t)?[e]:Ot(e)).length;null!=t&&r<n;)t=t[Xt(e[r++])];return r&&r==n?t:void 0}function Pt(t,e){return null!=t&&e in Object(t)}function Dt(t,e,r,n,i){return t===e||(null==t||null==e||!se(t)&&!ae(e)?t!=t&&e!=e:function(t,e,r,n,i,o){var s=re(t),f=re(e),A=u,x=u;s||(A=(A=Vt(t))==a?g:A);f||(x=(x=Vt(e))==a?g:x);var w=A==g&&!q(t),b=x==g&&!q(e),C=A==x;if(C&&!w)return o||(o=new Mt),s||ce(t)?Ut(t,e,r,n,i,o):function(t,e,r,n,i,o,s){switch(r){case I:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case E:return!(t.byteLength!=e.byteLength||!n(new st(t),new st(e)));case l:case c:case d:return te(+t,+e);case h:return t.name==e.name&&t.message==e.message;case y:case m:return t==e+"";case p:var a=Y;case v:var u=2&o;if(a||(a=W),t.size!=e.size&&!u)return!1;var f=s.get(t);if(f)return f==e;o|=1,s.set(t,e);var g=Ut(a(t),a(e),n,i,o,s);return s.delete(t),g;case _:if(It)return It.call(t)==It.call(e)}return!1}(t,e,A,r,n,i,o);if(!(2&i)){var S=w&&rt.call(t,"__wrapped__"),B=b&&rt.call(e,"__wrapped__");if(S||B){var M=S?t.value():t,T=B?e.value():e;return o||(o=new Mt),r(M,T,n,i,o)}}if(!C)return!1;return o||(o=new Mt),function(t,e,r,n,i,o){var s=2&i,a=he(t),u=a.length,l=he(e),c=l.length;if(u!=c&&!s)return!1;var h=u;for(;h--;){var f=a[h];if(!(s?f in e:rt.call(e,f)))return!1}var p=o.get(t);if(p&&o.get(e))return p==e;var d=!0;o.set(t,e),o.set(e,t);var g=s;for(;++h<u;){var A=t[f=a[h]],y=e[f];if(n)var v=s?n(y,A,f,e,t,o):n(A,y,f,t,e,o);if(!(void 0===v?A===y||r(A,y,n,i,o):v)){d=!1;break}g||(g="constructor"==f)}if(d&&!g){var m=t.constructor,_=e.constructor;m==_||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof _&&_ instanceof _||(d=!1)}return o.delete(t),o.delete(e),d}(t,e,r,n,i,o)}(t,e,Dt,r,n,i))}function kt(t){return!(!se(t)||(e=t,tt&&tt in e))&&(ie(t)||q(t)?it:R).test(Jt(t));var e}function Nt(t){return"function"==typeof t?t:null==t?fe:"object"==typeof t?re(t)?function(t,e){if(Ht(t)&&qt(e))return Yt(Xt(t),e);return function(r){var n=function(t,e,r){var n=null==t?void 0:Rt(t,e);return void 0===n?r:n}(r,t);return void 0===n&&n===e?function(t,e){return null!=t&&function(t,e,r){e=Ht(e,t)?[e]:Ot(e);var n,i=-1,o=e.length;for(;++i<o;){var s=Xt(e[i]);if(!(n=null!=t&&r(t,s)))break;t=t[s]}if(n)return n;o=t?t.length:0;return!!o&&oe(o)&&jt(s,o)&&(re(t)||ee(t))}(t,e,Pt)}(r,t):Dt(e,n,void 0,3)}}(t[0],t[1]):function(t){var e=function(t){var e=he(t),r=e.length;for(;r--;){var n=e[r],i=t[n];e[r]=[n,i,qt(i)]}return e}(t);if(1==e.length&&e[0][2])return Yt(e[0][0],e[0][1]);return function(r){return r===t||function(t,e,r,n){var i=r.length,o=i,s=!n;if(null==t)return!o;for(t=Object(t);i--;){var a=r[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){var u=(a=r[i])[0],l=t[u],c=a[1];if(s&&a[2]){if(void 0===l&&!(u in t))return!1}else{var h=new Mt;if(n)var f=n(l,c,u,t,e,h);if(!(void 0===f?Dt(c,l,n,3,h):f))return!1}}return!0}(r,t,e)}}(t):Ht(e=t)?(r=Xt(e),function(t){return null==t?void 0:t[r]}):function(t){return function(e){return Rt(e,t)}}(e);var e,r}function Ft(t){if(r=(e=t)&&e.constructor,n="function"==typeof r&&r.prototype||Z,e!==n)return lt(t);var e,r,n,i=[];for(var o in Object(t))rt.call(t,o)&&"constructor"!=o&&i.push(o);return i}function Ot(t){return re(t)?t:Wt(t)}function Ut(t,e,r,n,i,o){var s=2&i,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var l=o.get(t);if(l&&o.get(e))return l==e;var c=-1,h=!0,f=1&i?new Bt:void 0;for(o.set(t,e),o.set(e,t);++c<a;){var p=t[c],d=e[c];if(n)var g=s?n(d,p,c,e,t,o):n(p,d,c,t,e,o);if(void 0!==g){if(g)continue;h=!1;break}if(f){if(!H(e,(function(t,e){if(!f.has(e)&&(p===t||r(p,t,n,i,o)))return f.add(e)}))){h=!1;break}}else if(p!==d&&!r(p,d,n,i,o)){h=!1;break}}return o.delete(t),o.delete(e),h}function Gt(t,e){var r=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?r["string"==typeof e?"string":"hash"]:r.map}function zt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return kt(r)?r:void 0}bt.prototype.clear=function(){this.__data__=At?At(null):{}},bt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},bt.prototype.get=function(t){var e=this.__data__;if(At){var n=e[t];return n===r?void 0:n}return rt.call(e,t)?e[t]:void 0},bt.prototype.has=function(t){var e=this.__data__;return At?void 0!==e[t]:rt.call(e,t)},bt.prototype.set=function(t,e){return this.__data__[t]=At&&void 0===e?r:e,this},Ct.prototype.clear=function(){this.__data__=[]},Ct.prototype.delete=function(t){var e=this.__data__,r=Lt(e,t);return!(r<0)&&(r==e.length-1?e.pop():ut.call(e,r,1),!0)},Ct.prototype.get=function(t){var e=this.__data__,r=Lt(e,t);return r<0?void 0:e[r][1]},Ct.prototype.has=function(t){return Lt(this.__data__,t)>-1},Ct.prototype.set=function(t,e){var r=this.__data__,n=Lt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},St.prototype.clear=function(){this.__data__={hash:new bt,map:new(ft||Ct),string:new bt}},St.prototype.delete=function(t){return Gt(this,t).delete(t)},St.prototype.get=function(t){return Gt(this,t).get(t)},St.prototype.has=function(t){return Gt(this,t).has(t)},St.prototype.set=function(t,e){return Gt(this,t).set(t,e),this},Bt.prototype.add=Bt.prototype.push=function(t){return this.__data__.set(t,r),this},Bt.prototype.has=function(t){return this.__data__.has(t)},Mt.prototype.clear=function(){this.__data__=new Ct},Mt.prototype.delete=function(t){return this.__data__.delete(t)},Mt.prototype.get=function(t){return this.__data__.get(t)},Mt.prototype.has=function(t){return this.__data__.has(t)},Mt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Ct){var n=r.__data__;if(!ft||n.length<199)return n.push([t,e]),this;r=this.__data__=new St(n)}return r.set(t,e),this};var Vt=function(t){return nt.call(t)};function jt(t,e){return!!(e=null==e?i:e)&&("number"==typeof t||D.test(t))&&t>-1&&t%1==0&&t<e}function Ht(t,e){if(re(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!ue(t))||(b.test(t)||!w.test(t)||null!=e&&t in Object(e))}function qt(t){return t==t&&!se(t)}function Yt(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}(ht&&Vt(new ht(new ArrayBuffer(1)))!=I||ft&&Vt(new ft)!=p||pt&&Vt(pt.resolve())!=A||dt&&Vt(new dt)!=v||gt&&Vt(new gt)!=x)&&(Vt=function(t){var e=nt.call(t),r=e==g?t.constructor:void 0,n=r?Jt(r):void 0;if(n)switch(n){case yt:return I;case vt:return p;case mt:return A;case _t:return v;case xt:return x}return e});var Wt=$t((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(ue(t))return wt?wt.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(e);var r=[];return C.test(t)&&r.push(""),t.replace(S,(function(t,e,n,i){r.push(n?i.replace(M,"$1"):e||t)})),r}));function Xt(t){if("string"==typeof t||ue(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Jt(t){if(null!=t){try{return et.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var Kt,Zt=(Kt=function(t,e,r){var i=t?t.length:0;if(!i)return-1;var a,u,l=null==r?0:(a=function(t){return t?(t=function(t){if("number"==typeof t)return t;if(ue(t))return s;if(se(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=se(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(B,"");var r=L.test(t);return r||P.test(t)?N(t.slice(2),r?2:8):T.test(t)?s:+t}(t))===n||t===-1/0?(t<0?-1:1)*o:t==t?t:0:0===t?t:0}(r),u=a%1,a==a?u?a-u:a:0);return l<0&&(l=ct(i+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,Nt(e),l)},function(t,e,r){var n=Object(t);if(!ne(t)){var i=Nt(e);t=he(t),e=function(t){return i(n[t],t,n)}}var o=Kt(t,e,r);return o>-1?n[i?t[o]:o]:void 0});function $t(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($t.Cache||St),r}function te(t,e){return t===e||t!=t&&e!=e}function ee(t){return function(t){return ae(t)&&ne(t)}(t)&&rt.call(t,"callee")&&(!at.call(t,"callee")||nt.call(t)==a)}$t.Cache=St;var re=Array.isArray;function ne(t){return null!=t&&oe(t.length)&&!ie(t)}function ie(t){var e=se(t)?nt.call(t):"";return e==f||"[object GeneratorFunction]"==e}function oe(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=i}function se(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function ae(t){return!!t&&"object"==typeof t}function ue(t){return"symbol"==typeof t||ae(t)&&nt.call(t)==_}var le,ce=j?(le=j,function(t){return le(t)}):function(t){return ae(t)&&oe(t.length)&&!!k[nt.call(t)]};function he(t){return ne(t)?Tt(t):Ft(t)}function fe(t){return t}t.exports=Zt}(nk,nk.exports);var ik=nk.exports,ok={exports:{}};!function(t,e){var r="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",o="[object Array]",s="[object Boolean]",a="[object Date]",u="[object Error]",l="[object Function]",c="[object Map]",h="[object Number]",f="[object Object]",p="[object Promise]",d="[object RegExp]",g="[object Set]",A="[object String]",y="[object Symbol]",v="[object WeakMap]",m="[object ArrayBuffer]",_="[object DataView]",x=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,E=/^\w*$/,I=/^\./,w=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,b=/\\(\\)?/g,C=/^\[object .+?Constructor\]$/,S=/^(?:0|[1-9]\d*)$/,B={};B["[object Float32Array]"]=B["[object Float64Array]"]=B["[object Int8Array]"]=B["[object Int16Array]"]=B["[object Int32Array]"]=B["[object Uint8Array]"]=B["[object Uint8ClampedArray]"]=B["[object Uint16Array]"]=B["[object Uint32Array]"]=!0,B[i]=B[o]=B[m]=B[s]=B[_]=B[a]=B[u]=B[l]=B[c]=B[h]=B[f]=B[d]=B[g]=B[A]=B[v]=!1;var M="object"==typeof Qt&&Qt&&Qt.Object===Object&&Qt,T="object"==typeof self&&self&&self.Object===Object&&self,L=M||T||Function("return this")(),R=e&&!e.nodeType&&e,P=R&&t&&!t.nodeType&&t,D=P&&P.exports===R&&M.process,k=function(){try{return D&&D.binding("util")}catch(t){}}(),N=k&&k.isTypedArray;function F(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 Q(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function O(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function U(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function G(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var z,V=Array.prototype,j=Function.prototype,H=Object.prototype,q=L["__core-js_shared__"],Y=(z=/[^.]+$/.exec(q&&q.keys&&q.keys.IE_PROTO||""))?"Symbol(src)_1."+z:"",W=j.toString,X=H.hasOwnProperty,J=H.toString,K=RegExp("^"+W.call(X).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Z=L.Symbol,$=L.Uint8Array,tt=H.propertyIsEnumerable,et=V.splice,rt=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),nt=Ot(L,"DataView"),it=Ot(L,"Map"),ot=Ot(L,"Promise"),st=Ot(L,"Set"),at=Ot(L,"WeakMap"),ut=Ot(Object,"create"),lt=Yt(nt),ct=Yt(it),ht=Yt(ot),ft=Yt(st),pt=Yt(at),dt=Z?Z.prototype:void 0,gt=dt?dt.valueOf:void 0,At=dt?dt.toString:void 0;function yt(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 vt(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 _t(t){var e=-1,r=t?t.length:0;for(this.__data__=new mt;++e<r;)this.add(t[e])}function xt(t){this.__data__=new vt(t)}function Et(t,e){var r=Kt(t)||Jt(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&&!X.call(t,o)||i&&("length"==o||Gt(o,n))||r.push(o);return r}function It(t,e){for(var r=t.length;r--;)if(Xt(t[r][0],e))return r;return-1}yt.prototype.clear=function(){this.__data__=ut?ut(null):{}},yt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},yt.prototype.get=function(t){var e=this.__data__;if(ut){var n=e[t];return n===r?void 0:n}return X.call(e,t)?e[t]:void 0},yt.prototype.has=function(t){var e=this.__data__;return ut?void 0!==e[t]:X.call(e,t)},yt.prototype.set=function(t,e){return this.__data__[t]=ut&&void 0===e?r:e,this},vt.prototype.clear=function(){this.__data__=[]},vt.prototype.delete=function(t){var e=this.__data__,r=It(e,t);return!(r<0)&&(r==e.length-1?e.pop():et.call(e,r,1),!0)},vt.prototype.get=function(t){var e=this.__data__,r=It(e,t);return r<0?void 0:e[r][1]},vt.prototype.has=function(t){return It(this.__data__,t)>-1},vt.prototype.set=function(t,e){var r=this.__data__,n=It(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},mt.prototype.clear=function(){this.__data__={hash:new yt,map:new(it||vt),string:new yt}},mt.prototype.delete=function(t){return Ft(this,t).delete(t)},mt.prototype.get=function(t){return Ft(this,t).get(t)},mt.prototype.has=function(t){return Ft(this,t).has(t)},mt.prototype.set=function(t,e){return Ft(this,t).set(t,e),this},_t.prototype.add=_t.prototype.push=function(t){return this.__data__.set(t,r),this},_t.prototype.has=function(t){return this.__data__.has(t)},xt.prototype.clear=function(){this.__data__=new vt},xt.prototype.delete=function(t){return this.__data__.delete(t)},xt.prototype.get=function(t){return this.__data__.get(t)},xt.prototype.has=function(t){return this.__data__.has(t)},xt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof vt){var n=r.__data__;if(!it||n.length<199)return n.push([t,e]),this;r=this.__data__=new mt(n)}return r.set(t,e),this};var wt,bt,Ct=(wt=function(t,e){return t&&St(t,e,se)},function(t,e){if(null==t)return t;if(!Zt(t))return wt(t,e);for(var r=t.length,n=bt?r:-1,i=Object(t);(bt?n--:++n<r)&&!1!==e(i[n],n,i););return t}),St=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 Bt(t,e){for(var r=0,n=(e=zt(e,t)?[e]:kt(e)).length;null!=t&&r<n;)t=t[qt(e[r++])];return r&&r==n?t:void 0}function Mt(t,e){return null!=t&&e in Object(t)}function Tt(t,e,r,n,l){return t===e||(null==t||null==e||!ee(t)&&!re(e)?t!=t&&e!=e:function(t,e,r,n,l,p){var v=Kt(t),x=Kt(e),E=o,I=o;v||(E=(E=Ut(t))==i?f:E);x||(I=(I=Ut(e))==i?f:I);var w=E==f&&!O(t),b=I==f&&!O(e),C=E==I;if(C&&!w)return p||(p=new xt),v||oe(t)?Nt(t,e,r,n,l,p):function(t,e,r,n,i,o,l){switch(r){case _:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case m:return!(t.byteLength!=e.byteLength||!n(new $(t),new $(e)));case s:case a:case h:return Xt(+t,+e);case u:return t.name==e.name&&t.message==e.message;case d:case A:return t==e+"";case c:var f=U;case g:var p=2&o;if(f||(f=G),t.size!=e.size&&!p)return!1;var v=l.get(t);if(v)return v==e;o|=1,l.set(t,e);var x=Nt(f(t),f(e),n,i,o,l);return l.delete(t),x;case y:if(gt)return gt.call(t)==gt.call(e)}return!1}(t,e,E,r,n,l,p);if(!(2&l)){var S=w&&X.call(t,"__wrapped__"),B=b&&X.call(e,"__wrapped__");if(S||B){var M=S?t.value():t,T=B?e.value():e;return p||(p=new xt),r(M,T,n,l,p)}}if(!C)return!1;return p||(p=new xt),function(t,e,r,n,i,o){var s=2&i,a=se(t),u=a.length,l=se(e),c=l.length;if(u!=c&&!s)return!1;var h=u;for(;h--;){var f=a[h];if(!(s?f in e:X.call(e,f)))return!1}var p=o.get(t);if(p&&o.get(e))return p==e;var d=!0;o.set(t,e),o.set(e,t);var g=s;for(;++h<u;){var A=t[f=a[h]],y=e[f];if(n)var v=s?n(y,A,f,e,t,o):n(A,y,f,t,e,o);if(!(void 0===v?A===y||r(A,y,n,i,o):v)){d=!1;break}g||(g="constructor"==f)}if(d&&!g){var m=t.constructor,_=e.constructor;m==_||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof _&&_ instanceof _||(d=!1)}return o.delete(t),o.delete(e),d}(t,e,r,n,l,p)}(t,e,Tt,r,n,l))}function Lt(t){return!(!ee(t)||(e=t,Y&&Y in e))&&($t(t)||O(t)?K:C).test(Yt(t));var e}function Rt(t){return"function"==typeof t?t:null==t?ae:"object"==typeof t?Kt(t)?function(t,e){if(zt(t)&&Vt(e))return jt(qt(t),e);return function(r){var n=function(t,e,r){var n=null==t?void 0:Bt(t,e);return void 0===n?r:n}(r,t);return void 0===n&&n===e?function(t,e){return null!=t&&function(t,e,r){e=zt(e,t)?[e]:kt(e);var n,i=-1,o=e.length;for(;++i<o;){var s=qt(e[i]);if(!(n=null!=t&&r(t,s)))break;t=t[s]}if(n)return n;o=t?t.length:0;return!!o&&te(o)&&Gt(s,o)&&(Kt(t)||Jt(t))}(t,e,Mt)}(r,t):Tt(e,n,void 0,3)}}(t[0],t[1]):function(t){var e=function(t){var e=se(t),r=e.length;for(;r--;){var n=e[r],i=t[n];e[r]=[n,i,Vt(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,n){var i=r.length,o=i,s=!n;if(null==t)return!o;for(t=Object(t);i--;){var a=r[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){var u=(a=r[i])[0],l=t[u],c=a[1];if(s&&a[2]){if(void 0===l&&!(u in t))return!1}else{var h=new xt;if(n)var f=n(l,c,u,t,e,h);if(!(void 0===f?Tt(c,l,n,3,h):f))return!1}}return!0}(r,t,e)}}(t):zt(e=t)?(r=qt(e),function(t){return null==t?void 0:t[r]}):function(t){return function(e){return Bt(e,t)}}(e);var e,r}function Pt(t){if(r=(e=t)&&e.constructor,n="function"==typeof r&&r.prototype||H,e!==n)return rt(t);var e,r,n,i=[];for(var o in Object(t))X.call(t,o)&&"constructor"!=o&&i.push(o);return i}function Dt(t,e){var r=-1,n=Zt(t)?Array(t.length):[];return Ct(t,(function(t,i,o){n[++r]=e(t,i,o)})),n}function kt(t){return Kt(t)?t:Ht(t)}function Nt(t,e,r,n,i,o){var s=2&i,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var l=o.get(t);if(l&&o.get(e))return l==e;var c=-1,h=!0,f=1&i?new _t:void 0;for(o.set(t,e),o.set(e,t);++c<a;){var p=t[c],d=e[c];if(n)var g=s?n(d,p,c,e,t,o):n(p,d,c,t,e,o);if(void 0!==g){if(g)continue;h=!1;break}if(f){if(!Q(e,(function(t,e){if(!f.has(e)&&(p===t||r(p,t,n,i,o)))return f.add(e)}))){h=!1;break}}else if(p!==d&&!r(p,d,n,i,o)){h=!1;break}}return o.delete(t),o.delete(e),h}function Ft(t,e){var r=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?r["string"==typeof e?"string":"hash"]:r.map}function Ot(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return Lt(r)?r:void 0}var Ut=function(t){return J.call(t)};function Gt(t,e){return!!(e=null==e?n:e)&&("number"==typeof t||S.test(t))&&t>-1&&t%1==0&&t<e}function zt(t,e){if(Kt(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!ne(t))||(E.test(t)||!x.test(t)||null!=e&&t in Object(e))}function Vt(t){return t==t&&!ee(t)}function jt(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}(nt&&Ut(new nt(new ArrayBuffer(1)))!=_||it&&Ut(new it)!=c||ot&&Ut(ot.resolve())!=p||st&&Ut(new st)!=g||at&&Ut(new at)!=v)&&(Ut=function(t){var e=J.call(t),r=e==f?t.constructor:void 0,n=r?Yt(r):void 0;if(n)switch(n){case lt:return _;case ct:return c;case ht:return p;case ft:return g;case pt:return v}return e});var Ht=Wt((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(ne(t))return At?At.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(e);var r=[];return I.test(t)&&r.push(""),t.replace(w,(function(t,e,n,i){r.push(n?i.replace(b,"$1"):e||t)})),r}));function qt(t){if("string"==typeof t||ne(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Yt(t){if(null!=t){try{return W.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Wt(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(Wt.Cache||mt),r}function Xt(t,e){return t===e||t!=t&&e!=e}function Jt(t){return function(t){return re(t)&&Zt(t)}(t)&&X.call(t,"callee")&&(!tt.call(t,"callee")||J.call(t)==i)}Wt.Cache=mt;var Kt=Array.isArray;function Zt(t){return null!=t&&te(t.length)&&!$t(t)}function $t(t){var e=ee(t)?J.call(t):"";return e==l||"[object GeneratorFunction]"==e}function te(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function ee(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function re(t){return!!t&&"object"==typeof t}function ne(t){return"symbol"==typeof t||re(t)&&J.call(t)==y}var ie,oe=N?(ie=N,function(t){return ie(t)}):function(t){return re(t)&&te(t.length)&&!!B[J.call(t)]};function se(t){return Zt(t)?Et(t):Pt(t)}function ae(t){return t}t.exports=function(t,e){return(Kt(t)?F:Dt)(t,Rt(e))}}(ok,ok.exports);var sk={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},ak=(0,ok.exports)(["南","东南偏南","东南","东南偏东","东","东北偏东","东北","东北偏北","北","西北偏北","西北","西北偏西","西","西南偏西","西南","西南偏南"],(function(t,e){var r=22.5,n=r*e;return{bearing:n,range:[n-11.25,n+11.25],label:t}})),uk=function(t,e,r){return t>=e&&t<r},lk=function(t){return ik(ak,(function(e){return uk(t,e.range[0],e.range[1])||uk(t-360,e.range[0],e.range[1])}))},ck=function(){return p((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 rk("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 sk[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()}),[{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=lk(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:lk(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}}])}();exports.Arrow3D=pR,exports.B3DMLoader=Mw,exports.B3DMLoaderBase=RI,exports.CMPTLoader=Vw,exports.CMPTLoaderBase=zw,exports.CUSTOM_COLOR=9,exports.CesiumIonTilesRenderer=JB,exports.CoordinateTransform=XP,exports.DEPTH=4,exports.DISTANCE=3,exports.DebugCesiumIonTilesRenderer=KB,exports.DebugGoogleTilesRenderer=WB,exports.DebugTilesRenderer=GS,exports.EffectComposer=OR,exports.Ellipsoid=Sb,exports.EllipsoidRegion=Qb,exports.EllipsoidRegionHelper=DS,exports.EllipsoidRegionLineHelper=PS,exports.EnvironmentControls=bM,exports.FAILED=4,exports.GEOMETRIC_ERROR=2,exports.GLTFCesiumRTCExtension=jw,exports.GLTFExtensionLoader=Hw,exports.GLTFMeshFeaturesExtension=UB,exports.GLTFStructuralMetadataExtension=RB,exports.GeoUtils=db,exports.GlobeControls=VM,exports.GoogleTilesRenderer=YB,exports.I3DMLoader=Gw,exports.I3DMLoaderBase=Pw,exports.IS_LEAF=6,exports.LOADED=3,exports.LOADING=1,exports.LOAD_ORDER=10,exports.LRUCache=uI,exports.LineGeometry=$L,exports.LineMaterial=LL,exports.LoaderBase=TI,exports.NONE=0,exports.PARSING=2,exports.PNTSLoader=Rw,exports.PNTSLoaderBase=Tw,exports.PriorityQueue=lI,exports.RANDOM_COLOR=7,exports.RANDOM_NODE_COLOR=8,exports.RELATIVE_DEPTH=5,exports.RenderPass=xP,exports.SCREEN_ERROR=1,exports.SphereHelper=CS,exports.TextureAnimator=NE,exports.TilesRenderer=IS,exports.TilesRendererBase=bI,exports.UNLOADED=0,exports.WGS84_ELLIPSOID=GB,exports.WGS84_FLATTENING=hI,exports.WGS84_HEIGHT=fI,exports.WGS84_RADIUS=cI,exports.bloomClass=LP,exports.bloomLine=SR,exports.calIntersection=dE,exports.calPointColor=vE,exports.drawTool=WP,exports.extrudePolygon=IR,exports.getCenterOfPoints=oE,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 d=(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}),g=hE(p,f,h),A=l.pointAtResToCoord(g,l.getGLRes());u.push({coord:[A.x,A.y],rotation:d.rotation}),p+=n}return u},exports.getUUid=eE,exports.getVPointGeojson=pE,exports.gisCommon=zE,exports.gltfLoadClass=IT,exports.groupClass=wT,exports.imgClass=wE,exports.layerClass=qP,exports.layerClassNoOverride=YP,exports.line2Object=hR,exports.line2Polygon=function(t,e){for(var r=[],n=[],o=0;o<t.length-1;o++){var s=[],a=o+1,u=pE(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=pE(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 d=n[p],g=n[p+1],A=r[p],y=r[p+1],v=dE(d,g);if(gE(v,0===p?A[2]:y[1])){var m=yE(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 x=n[_],E=n[_-1],I=r[_],w=r[_-1],b=dE(x,E);if(gE(b,I[4])){var C=yE(b,I,w,t);f.push(C)}else f.push(I[4]),f.push(w[3])}return f.push(r[0][0]),f},exports.lineLength=cE,exports.outlineBloomClass=RP,exports.overLayer=JP,exports.planeGifClass=sR,exports.planeHeightClass=NP,exports.planeMark=iI,exports.planeSectorClass=FE,exports.polygonClass=_R,exports.polylineClass=RL,exports.radarClass=SE,exports.rippleWallClass=CL,exports.sectorClass=PE,exports.shockClass=UE,exports.shockMarkerClass=rD,exports.sleep=rE,exports.tileClass=_T,exports.tripHeight=dR,exports.tripHeight1=gR,exports.tripLineClass=AR,exports.tubeClass=lR,exports.turf=yx,exports.verticalFatLineClass=nR,exports.wallClass=SL,exports.windClass=ck;