autumnplot-gl 4.0.0-beta → 4.1.0
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.
- package/README.md +13 -207
- package/dist/812.autumnplot-gl.js +2 -0
- package/dist/812.autumnplot-gl.js.map +1 -0
- package/dist/983.autumnplot-gl.js +2 -0
- package/dist/983.autumnplot-gl.js.map +1 -0
- package/dist/autumnplot-gl.js +1 -1
- package/dist/autumnplot-gl.js.map +1 -1
- package/dist/marchingsquares.wasm +0 -0
- package/lib/AutumnTypes.d.ts +38 -5
- package/lib/AutumnTypes.js +7 -1
- package/lib/Barbs.d.ts +12 -2
- package/lib/Barbs.js +9 -0
- package/lib/BillboardCollection.d.ts +2 -2
- package/lib/BillboardCollection.js +14 -14
- package/lib/Color.d.ts +1 -0
- package/lib/Color.js +1 -0
- package/lib/ColorBar.d.ts +14 -0
- package/lib/ColorBar.js +15 -8
- package/lib/Colormap.d.ts +9 -1
- package/lib/Colormap.js +24 -1
- package/lib/Contour.d.ts +26 -1
- package/lib/Contour.js +24 -2
- package/lib/ContourCreator.worker.d.ts +25 -0
- package/lib/{ContourCreator.js → ContourCreator.worker.js} +15 -14
- package/lib/Fill.d.ts +31 -11
- package/lib/Fill.js +38 -18
- package/lib/Hodographs.d.ts +19 -3
- package/lib/Hodographs.js +45 -20
- package/lib/Map.d.ts +13 -1
- package/lib/Map.js +62 -8
- package/lib/Paintball.d.ts +14 -5
- package/lib/Paintball.js +96 -46
- package/lib/PlotComponent.d.ts +9 -3
- package/lib/PlotComponent.js +36 -1
- package/lib/PlotLayer.d.ts +2 -2
- package/lib/PlotLayer.js +2 -2
- package/lib/PlotLayer.worker.js +9 -3
- package/lib/RawField.d.ts +223 -27
- package/lib/RawField.js +413 -59
- package/lib/StationPlot.d.ts +78 -11
- package/lib/StationPlot.js +113 -30
- package/lib/TextCollection.d.ts +5 -0
- package/lib/TextCollection.js +82 -9
- package/lib/WasmInterface.d.ts +7 -0
- package/lib/WasmInterface.js +11 -0
- package/lib/WorkerPool.d.ts +8 -0
- package/lib/WorkerPool.js +77 -0
- package/lib/cpp/marchingsquares.js +127 -13
- package/lib/cpp/marchingsquares.wasm +0 -0
- package/lib/cpp/marchingsquares_embind.d.ts +16 -3
- package/lib/grids/AutoZoom.d.ts +21 -0
- package/lib/grids/AutoZoom.js +63 -0
- package/lib/grids/DomainBuffer.d.ts +14 -0
- package/lib/grids/DomainBuffer.js +16 -0
- package/lib/grids/Geostationary.d.ts +35 -0
- package/lib/grids/Geostationary.js +47 -0
- package/lib/grids/Grid.d.ts +36 -0
- package/lib/grids/Grid.js +12 -0
- package/lib/grids/GridCoordinates.d.ts +10 -0
- package/lib/grids/GridCoordinates.js +64 -0
- package/lib/grids/LambertGrid.d.ts +73 -0
- package/lib/grids/LambertGrid.js +92 -0
- package/lib/grids/PlateCarreeGrid.d.ts +46 -0
- package/lib/grids/PlateCarreeGrid.js +55 -0
- package/lib/grids/PlateCarreeRotatedGrid.d.ts +53 -0
- package/lib/grids/PlateCarreeRotatedGrid.js +65 -0
- package/lib/grids/RadarSweepGrid.d.ts +46 -0
- package/lib/grids/RadarSweepGrid.js +74 -0
- package/lib/grids/StructuredGrid.d.ts +49 -0
- package/lib/grids/StructuredGrid.js +103 -0
- package/lib/grids/UnstructuredGrid.d.ts +56 -0
- package/lib/grids/UnstructuredGrid.js +102 -0
- package/lib/index.d.ts +23 -6
- package/lib/index.js +18 -8
- package/lib/utils.d.ts +11 -2
- package/lib/utils.js +63 -1
- package/package.json +4 -3
- package/dist/110.autumnplot-gl.js +0 -2
- package/dist/110.autumnplot-gl.js.map +0 -1
- package/lib/ContourCreator.d.ts +0 -22
- package/lib/Grid.d.ts +0 -263
- package/lib/Grid.js +0 -547
- package/lib/ParticleTracer.d.ts +0 -19
- package/lib/ParticleTracer.js +0 -37
package/dist/autumnplot-gl.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see autumnplot-gl.js.LICENSE.txt */
|
|
2
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.apgl=e():t.apgl=e()}(this,(()=>(()=>{var t={645:(t,e)=>{e.read=function(t,e,n,r,o){var i,a,s=8*o-r-1,l=(1<<s)-1,c=l>>1,u=-7,f=n?o-1:0,h=n?-1:1,d=t[e+f];for(f+=h,i=d&(1<<-u)-1,d>>=-u,u+=s;u>0;i=256*i+t[e+f],f+=h,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=256*a+t[e+f],f+=h,u-=8);if(0===i)i=1-c;else{if(i===l)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),i-=c}return(d?-1:1)*a*Math.pow(2,i-r)},e.write=function(t,e,n,r,o,i){var a,s,l,c=8*i-o-1,u=(1<<c)-1,f=u>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,p=r?1:-1,_=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(a++,l/=2),a+f>=u?(s=0,a=u):a+f>=1?(s=(e*l-1)*Math.pow(2,o),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[n+d]=255&s,d+=p,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;t[n+d]=255&a,d+=p,a/=256,c-=8);t[n+d-p]|=128*_}},526:function(t,e){var n,r;void 0===(r="function"==typeof(n=function(t){function e(t,e,n){this.obj=t,this.left=null,this.right=null,this.parent=n,this.dimension=e}function n(t){this.content=[],this.scoreFunction=t}n.prototype={push:function(t){this.content.push(t),this.bubbleUp(this.content.length-1)},pop:function(){var t=this.content[0],e=this.content.pop();return this.content.length>0&&(this.content[0]=e,this.sinkDown(0)),t},peek:function(){return this.content[0]},remove:function(t){for(var e=this.content.length,n=0;n<e;n++)if(this.content[n]==t){var r=this.content.pop();return void(n!=e-1&&(this.content[n]=r,this.scoreFunction(r)<this.scoreFunction(t)?this.bubbleUp(n):this.sinkDown(n)))}throw new Error("Node not found.")},size:function(){return this.content.length},bubbleUp:function(t){for(var e=this.content[t];t>0;){var n=Math.floor((t+1)/2)-1,r=this.content[n];if(!(this.scoreFunction(e)<this.scoreFunction(r)))break;this.content[n]=e,this.content[t]=r,t=n}},sinkDown:function(t){for(var e=this.content.length,n=this.content[t],r=this.scoreFunction(n);;){var o=2*(t+1),i=o-1,a=null;if(i<e){var s=this.content[i],l=this.scoreFunction(s);l<r&&(a=i)}if(o<e){var c=this.content[o];this.scoreFunction(c)<(null==a?r:l)&&(a=o)}if(null==a)break;this.content[t]=this.content[a],this.content[a]=n,t=a}}},t.kdTree=function(t,r,o){var i=this;Array.isArray(t)?this.root=function t(n,r,i){var a,s,l=r%o.length;return 0===n.length?null:1===n.length?new e(n[0],l,i):(n.sort((function(t,e){return t[o[l]]-e[o[l]]})),(s=new e(n[a=Math.floor(n.length/2)],l,i)).left=t(n.slice(0,a),r+1,s),s.right=t(n.slice(a+1),r+1,s),s)}(t,0,null):function(t){i.root=t,function t(e){e.left&&(e.left.parent=e,t(e.left)),e.right&&(e.right.parent=e,t(e.right))}(i.root)}(t),this.toJSON=function(t){t||(t=this.root);var n=new e(t.obj,t.dimension,null);return t.left&&(n.left=i.toJSON(t.left)),t.right&&(n.right=i.toJSON(t.right)),n},this.insert=function(t){var n,r,i=function e(n,r){if(null===n)return r;var i=o[n.dimension];return t[i]<n.obj[i]?e(n.left,n):e(n.right,n)}(this.root,null);null!==i?(n=new e(t,(i.dimension+1)%o.length,i),r=o[i.dimension],t[r]<i.obj[r]?i.left=n:i.right=n):this.root=new e(t,0,null)},this.remove=function(t){var e;null!==(e=function e(n){if(null===n)return null;if(n.obj===t)return n;var r=o[n.dimension];return t[r]<n.obj[r]?e(n.left):e(n.right)}(i.root))&&function t(e){function n(t,e){var r,i,a,s,l;return null===t?null:(r=o[e],t.dimension===e?null!==t.left?n(t.left,e):t:(i=t.obj[r],a=n(t.left,e),s=n(t.right,e),l=t,null!==a&&a.obj[r]<i&&(l=a),null!==s&&s.obj[r]<l.obj[r]&&(l=s),l))}var r,a,s;if(null===e.left&&null===e.right)return null===e.parent?void(i.root=null):(s=o[e.parent.dimension],void(e.obj[s]<e.parent.obj[s]?e.parent.left=null:e.parent.right=null));null!==e.right?(a=(r=n(e.right,e.dimension)).obj,t(r),e.obj=a):(a=(r=n(e.left,e.dimension)).obj,t(r),e.right=e.left,e.left=null,e.obj=a)}(e)},this.nearest=function(t,e,a){var s,l,c;if(c=new n((function(t){return-t[1]})),a)for(s=0;s<e;s+=1)c.push([null,a]);for(i.root&&function n(i){function a(t,n){c.push([t,n]),c.size()>e&&c.pop()}var s,l,u,f,h=o[i.dimension],d=r(t,i.obj),p={};for(f=0;f<o.length;f+=1)f===i.dimension?p[o[f]]=t[o[f]]:p[o[f]]=i.obj[o[f]];l=r(p,i.obj),null!==i.right||null!==i.left?(n(s=null===i.right?i.left:null===i.left?i.right:t[h]<i.obj[h]?i.left:i.right),(c.size()<e||d<c.peek()[1])&&a(i,d),(c.size()<e||Math.abs(l)<c.peek()[1])&&null!==(u=s===i.left?i.right:i.left)&&n(u)):(c.size()<e||d<c.peek()[1])&&a(i,d)}(i.root),l=[],s=0;s<Math.min(e,c.content.length);s+=1)c.content[s][0]&&l.push([c.content[s][0].obj,c.content[s][1]]);return l},this.balanceFactor=function(){return function t(e){return null===e?0:Math.max(t(e.left),t(e.right))+1}(i.root)/(Math.log(function t(e){return null===e?0:t(e.left)+t(e.right)+1}(i.root))/Math.log(2))}},t.BinaryHeap=n})?n.apply(e,[e]):n)||(t.exports=r)},614:(t,e,n)=>{"use strict";t.exports=o;var r=n(645);function o(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}o.Varint=0,o.Fixed64=1,o.Bytes=2,o.Fixed32=5;var i=4294967296,a=1/i,s="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function l(t){return t.type===o.Bytes?t.readVarint()+t.pos:t.pos+1}function c(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function u(t,e,n){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));n.realloc(r);for(var o=n.pos-1;o>=t;o--)n.buf[o+r]=n.buf[o]}function f(t,e){for(var n=0;n<t.length;n++)e.writeVarint(t[n])}function h(t,e){for(var n=0;n<t.length;n++)e.writeSVarint(t[n])}function d(t,e){for(var n=0;n<t.length;n++)e.writeFloat(t[n])}function p(t,e){for(var n=0;n<t.length;n++)e.writeDouble(t[n])}function _(t,e){for(var n=0;n<t.length;n++)e.writeBoolean(t[n])}function m(t,e){for(var n=0;n<t.length;n++)e.writeFixed32(t[n])}function g(t,e){for(var n=0;n<t.length;n++)e.writeSFixed32(t[n])}function v(t,e){for(var n=0;n<t.length;n++)e.writeFixed64(t[n])}function b(t,e){for(var n=0;n<t.length;n++)e.writeSFixed64(t[n])}function y(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function w(t,e,n){t[n]=e,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function x(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}o.prototype={destroy:function(){this.buf=null},readFields:function(t,e,n){for(n=n||this.length;this.pos<n;){var r=this.readVarint(),o=r>>3,i=this.pos;this.type=7&r,t(o,e,this),this.pos===i&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=y(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=x(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=y(this.buf,this.pos)+y(this.buf,this.pos+4)*i;return this.pos+=8,t},readSFixed64:function(){var t=y(this.buf,this.pos)+x(this.buf,this.pos+4)*i;return this.pos+=8,t},readFloat:function(){var t=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,n,r=this.buf;return e=127&(n=r[this.pos++]),n<128?e:(e|=(127&(n=r[this.pos++]))<<7,n<128?e:(e|=(127&(n=r[this.pos++]))<<14,n<128?e:(e|=(127&(n=r[this.pos++]))<<21,n<128?e:function(t,e,n){var r,o,i=n.buf;if(r=(112&(o=i[n.pos++]))>>4,o<128)return c(t,r,e);if(r|=(127&(o=i[n.pos++]))<<3,o<128)return c(t,r,e);if(r|=(127&(o=i[n.pos++]))<<10,o<128)return c(t,r,e);if(r|=(127&(o=i[n.pos++]))<<17,o<128)return c(t,r,e);if(r|=(127&(o=i[n.pos++]))<<24,o<128)return c(t,r,e);if(r|=(1&(o=i[n.pos++]))<<31,o<128)return c(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(n=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&s?function(t,e,n){return s.decode(t.subarray(e,n))}(this.buf,e,t):function(t,e,n){for(var r="",o=e;o<n;){var i,a,s,l=t[o],c=null,u=l>239?4:l>223?3:l>191?2:1;if(o+u>n)break;1===u?l<128&&(c=l):2===u?128==(192&(i=t[o+1]))&&(c=(31&l)<<6|63&i)<=127&&(c=null):3===u?(i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&((c=(15&l)<<12|(63&i)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(i=t[o+1],a=t[o+2],s=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&((c=(15&l)<<18|(63&i)<<12|(63&a)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,r+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),r+=String.fromCharCode(c),o+=u}return r}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==o.Bytes)return t.push(this.readVarint(e));var n=l(this);for(t=t||[];this.pos<n;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==o.Bytes)return t.push(this.readSVarint());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==o.Bytes)return t.push(this.readBoolean());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==o.Bytes)return t.push(this.readFloat());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==o.Bytes)return t.push(this.readDouble());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==o.Bytes)return t.push(this.readFixed32());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==o.Bytes)return t.push(this.readSFixed32());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==o.Bytes)return t.push(this.readFixed64());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==o.Bytes)return t.push(this.readSFixed64());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===o.Varint)for(;this.buf[this.pos++]>127;);else if(e===o.Bytes)this.pos=this.readVarint()+this.pos;else if(e===o.Fixed32)this.pos+=4;else{if(e!==o.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var n=new Uint8Array(e);n.set(this.buf),this.buf=n,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),w(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),w(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),w(this.buf,-1&t,this.pos),w(this.buf,Math.floor(t*a),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),w(this.buf,-1&t,this.pos),w(this.buf,Math.floor(t*a),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var n,r;if(t>=0?(n=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:(n=0,r=r+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,n){n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos]=127&t}(n,0,e),function(t,e){var n=(7&t)<<4;e.buf[e.pos++]|=n|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(r,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,n){for(var r,o,i=0;i<e.length;i++){if((r=e.charCodeAt(i))>55295&&r<57344){if(!o){r>56319||i+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):o=r;continue}if(r<56320){t[n++]=239,t[n++]=191,t[n++]=189,o=r;continue}r=o-55296<<10|r-56320|65536,o=null}else o&&(t[n++]=239,t[n++]=191,t[n++]=189,o=null);r<128?t[n++]=r:(r<2048?t[n++]=r>>6|192:(r<65536?t[n++]=r>>12|224:(t[n++]=r>>18|240,t[n++]=r>>12&63|128),t[n++]=r>>6&63|128),t[n++]=63&r|128)}return n}(this.buf,t,this.pos);var n=this.pos-e;n>=128&&u(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),r.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),r.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var n=0;n<e;n++)this.buf[this.pos++]=t[n]},writeRawMessage:function(t,e){this.pos++;var n=this.pos;t(e,this);var r=this.pos-n;r>=128&&u(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,n){this.writeTag(t,o.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,h,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,_,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,m,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,g,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,v,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,b,e)},writeBytesField:function(t,e){this.writeTag(t,o.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,o.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,o.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,o.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,o.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,o.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,o.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,o.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,o.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,o.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},49:t=>{t.exports="varying highp vec2 v_tex_coord;\n\n#ifdef COLORMAP\nvarying highp float v_mag;\n#else\nuniform lowp vec4 u_bb_color;\n#endif\n\nuniform sampler2D u_sampler;\n\nvoid main() {\n lowp vec4 tex_color = texture2D(u_sampler, v_tex_coord);\n\n lowp vec4 color;\n#ifdef COLORMAP\n color = apply_colormap(v_mag);\n#else\n color = u_bb_color;\n#endif\n\n color.a *= tex_color.a;\n gl_FragColor = color; // mix(vec4(1.0, 0.0, 0.0, 0.5), color, tex_color.a);\n}"},955:t=>{t.exports="uniform mat4 u_matrix;\nuniform int u_offset;\n\nattribute vec3 a_pos; // Has position, zoom, and corner info\nattribute vec2 a_tex_coord;\nuniform lowp float u_bb_size;\nuniform lowp float u_map_aspect;\nuniform lowp float u_zoom;\nuniform highp float u_map_bearing;\nuniform lowp float u_bb_width; // Normalized by texture width\nuniform lowp float u_bb_height; // Normalized by texture height\nuniform highp float u_bb_mag_bin_size;\n//uniform highp float u_bb_max_mag;\nuniform highp float u_bb_mag_wrap;\n\nuniform sampler2D u_u_sampler;\nuniform sampler2D u_v_sampler;\nuniform sampler2D u_rot_sampler;\n\nvarying highp vec2 v_tex_coord;\n#ifdef COLORMAP\nvarying highp float v_mag;\n#endif\n\nmat4 scalingMatrix(float x_scale, float y_scale, float z_scale) {\n return mat4(x_scale, 0.0, 0.0, 0.0,\n 0.0, y_scale, 0.0, 0.0,\n 0.0, 0.0, z_scale, 0.0,\n 0.0, 0.0, 0.0, 1.0);\n}\n\nmat4 rotationZMatrix(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n\n return mat4( c, s, 0., 0.,\n -s, c, 0., 0.,\n 0., 0., 1., 0.,\n 0., 0., 0., 1.);\n}\n\nmat4 rotationXMatrix(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n\n return mat4( 1., 0., 0., 0.,\n 0., c, s, 0.,\n 0., -s, c, 0.,\n 0., 0., 0., 1.);\n}\n\nvoid main() {\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n vec4 pivot_pos = u_matrix * vec4(a_pos.xy + globe_offset, 0.0, 1.0);\n highp float zoom_corner = a_pos.z;\n lowp float min_zoom = floor(zoom_corner / 4.0);\n lowp float corner = mod(zoom_corner, 4.0);\n\n highp float u = texture2D(u_u_sampler, a_tex_coord).r;\n highp float v = texture2D(u_v_sampler, a_tex_coord).r;\n highp float rot = texture2D(u_rot_sampler, a_tex_coord).r;\n\n lowp float bb_aspect = u_bb_width / u_bb_height;\n lowp float ang = (abs(u) < 1e-6 && abs(v) < 1e-6) ? 0. : atan(v, u) - 3.141592654 / 2.0;\n highp float mag = length(vec2(u, v));\n#ifdef COLORMAP\n v_mag = mag;\n#endif\n mag = floor(mag / u_bb_mag_bin_size + 0.5) * u_bb_mag_bin_size;\n\n vec4 offset = vec4(0.0, 0.0, 0.0, 0.0);\n vec2 texcoord = vec2(0.0, 0.0);\n \n if (u_zoom >= min_zoom) {\n // Subtracting a small number off of u_bb_mag_wrap fixes (I think) a precision issue on some GPUs\n vec2 tex_loc = vec2(mod(mag, u_bb_mag_wrap - 1e-5) / u_bb_mag_bin_size * u_bb_width, floor(mag / (u_bb_mag_wrap - 1e-5)) * u_bb_height);\n\n if (corner < 0.5) {\n offset = vec4(-u_bb_size, u_bb_size, 0., 0.);\n texcoord = tex_loc;\n }\n else if (corner < 1.5) {\n offset = vec4(u_bb_size, u_bb_size, 0., 0.);\n texcoord = tex_loc + vec2(u_bb_width, 0.0);\n }\n else if (corner < 2.5) {\n offset = vec4(-u_bb_size, -u_bb_size * (2. / bb_aspect - 1.), 0., 0.);\n texcoord = tex_loc + vec2(0.0, u_bb_height);\n }\n else if (corner < 3.5) {\n offset = vec4(u_bb_size, -u_bb_size * (2. / bb_aspect - 1.), 0., 0.);\n texcoord = tex_loc + vec2(u_bb_width, u_bb_height);\n }\n\n mat4 barb_rotation = rotationZMatrix(ang + radians(u_map_bearing) - rot);\n mat4 map_stretch_matrix = scalingMatrix(1.0, 1. / u_map_aspect, 1.0);\n offset = map_stretch_matrix * barb_rotation * offset;\n }\n\n gl_Position = pivot_pos + offset;\n v_tex_coord = texcoord;\n}"},351:t=>{t.exports="\nuniform sampler2D u_cmap_sampler;\nuniform sampler2D u_cmap_nonlin_sampler;\nuniform highp float u_cmap_min;\nuniform highp float u_cmap_max;\nuniform highp vec4 u_underflow_color;\nuniform highp vec4 u_overflow_color;\nuniform int u_n_index;\n\nlowp vec4 apply_colormap(highp float value) {\n lowp float normed_val = (value - u_cmap_min) / (u_cmap_max - u_cmap_min);\n \n lowp vec4 color;\n if (normed_val < 0.0) {\n color = u_underflow_color;\n }\n else if (normed_val > 1.0) {\n color = u_overflow_color;\n }\n else {\n lowp float index_buffer = 1. / (2. * float(u_n_index));\n normed_val = index_buffer + normed_val * (1. - 2. * index_buffer); // Chop off the half pixels on either end of the texture\n highp float nonlin_val = texture2D(u_cmap_nonlin_sampler, vec2(normed_val, 0.5)).r;\n color = texture2D(u_cmap_sampler, vec2(nonlin_val, 0.5));\n }\n\n return color;\n}"},824:t=>{t.exports="varying highp vec2 v_tex_coord;\n\nuniform sampler2D u_fill_sampler;\nuniform highp float u_opacity;\n\nbool isnan(highp float val) {\n return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true;\n}\n\nvoid main() {\n highp float fill_val = texture2D(u_fill_sampler, v_tex_coord).r;\n\n if (isnan(fill_val)) {\n discard;\n }\n\n lowp vec4 color = apply_colormap(fill_val);\n color.a = color.a * u_opacity;\n gl_FragColor = color;\n}"},370:t=>{t.exports="uniform mat4 u_matrix;\nuniform int u_offset;\n\nattribute vec2 a_pos;\nattribute vec2 a_tex_coord;\n\nvarying highp vec2 v_tex_coord;\n\nvoid main() {\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n gl_Position = u_matrix * vec4(a_pos + globe_offset, 0.0, 1.0);\n v_tex_coord = a_tex_coord;\n}"},714:t=>{t.exports="#define MAX_N_COLORS 24\n\nvarying highp vec2 v_tex_coord;\n\nuniform sampler2D u_fill_sampler;\nuniform lowp vec4 u_colors[MAX_N_COLORS];\nuniform int u_num_colors;\nuniform highp float u_opacity;\n\nvoid main() {\n highp float fill_val = texture2D(u_fill_sampler, v_tex_coord).r;\n \n if (fill_val < 0.5) {\n discard;\n }\n\n lowp vec4 color = vec4(0., 0., 0., 0.);\n\n for (int nclr = 0; nclr < MAX_N_COLORS ; nclr++) {\n if (nclr >= u_num_colors || fill_val < 0.99) { break; }\n\n lowp float mem_active = mod(fill_val, 2.);\n color = mix(color, u_colors[nclr], mem_active);\n fill_val = floor(fill_val / 2.);\n }\n\n color.a = color.a * u_opacity;\n gl_FragColor = color;\n}"},431:t=>{t.exports="uniform mat4 u_matrix;\nuniform int u_offset;\n\nattribute vec2 a_pos;\nattribute vec2 a_tex_coord;\n\nvarying highp vec2 v_tex_coord;\n\nvoid main() {\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n gl_Position = u_matrix * vec4(a_pos + globe_offset, 0.0, 1.0);\n v_tex_coord = a_tex_coord;\n}"},559:t=>{t.exports="\nuniform sampler2D u_dash_sampler;\n\n#ifndef DATA\nuniform lowp vec4 u_color;\n#endif\n\nuniform lowp float u_line_width;\nuniform lowp float u_zoom;\nuniform int u_dash_pattern_length;\n\n#ifdef DATA\nvarying highp float v_data;\n#endif\n\nvarying highp float v_dist;\nvarying lowp float v_cross;\n\nvoid main() {\n lowp float dash_x = fract(v_dist * 2e2 * pow(2., floor(u_zoom)) / float(u_dash_pattern_length));\n lowp float dash = texture2D(u_dash_sampler, vec2(dash_x, 0.5)).r;\n\n lowp vec4 color;\n#ifdef DATA\n color = apply_colormap(v_data);\n#else\n color = u_color;\n#endif\n\n lowp float feather = clamp((1. - abs(v_cross)) * u_line_width, 0., 1.);\n color.a *= (dash >= 1. ? 1. : 0.) * feather;\n\n gl_FragColor = color;\n}"},319:t=>{t.exports="uniform mat4 u_matrix;\nuniform int u_offset;\n\nattribute vec3 a_pos;\nattribute vec2 a_extrusion;\nattribute float a_data;\n\n#ifdef ZOOM\nattribute float a_min_zoom;\n#endif\n\n#ifdef OFFSET\nattribute vec2 a_offset;\n#endif\n\nuniform lowp float u_line_width;\nuniform lowp float u_map_width;\nuniform lowp float u_map_height;\nuniform highp float u_map_bearing;\n\n#ifdef ZOOM\nuniform lowp float u_zoom;\n#endif\n\n#ifdef OFFSET\nuniform lowp float u_offset_scale;\n#endif\n\n#ifdef DATA\nvarying highp float v_data;\n#endif\n\nvarying highp float v_dist;\nvarying lowp float v_cross;\n\nmat4 scalingMatrix(float x_scale, float y_scale, float z_scale) {\n return mat4(x_scale, 0.0, 0.0, 0.0,\n 0.0, y_scale, 0.0, 0.0,\n 0.0, 0.0, z_scale, 0.0,\n 0.0, 0.0, 0.0, 1.0);\n}\n\nmat4 rotationZMatrix(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n\n return mat4( c, s, 0., 0.,\n -s, c, 0., 0.,\n 0., 0., 1., 0.,\n 0., 0., 0., 1.);\n}\n\nmat4 rotationXMatrix(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n\n return mat4( 1., 0., 0., 0.,\n 0., c, s, 0.,\n 0., -s, c, 0.,\n 0., 0., 0., 1.);\n}\n\nvoid main() {\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n v_dist = abs(a_pos.z);\n v_cross = sign(a_pos.z);\n vec4 center_pos = u_matrix * vec4(a_pos.xy + globe_offset, 0.0, 1.0);\n vec4 offset = vec4(0.0, 0.0, 0.0, 0.0);\n\n#ifdef ZOOM\n if (u_zoom >= a_min_zoom) {\n#endif\n\n vec2 offset_ext = u_line_width * 2. * a_extrusion;\n\n mat4 map_stretch_matrix = scalingMatrix(u_map_height / u_map_width, 1., 1.);\n mat4 rotation_matrix = rotationZMatrix(radians(u_map_bearing)); \n offset = map_stretch_matrix * rotation_matrix * vec4(offset_ext, 0., 0.);\n\n#ifdef OFFSET\n map_stretch_matrix = scalingMatrix(1., u_map_width / u_map_height, 1.);\n vec2 offset_offset = u_offset_scale * a_offset;\n offset += map_stretch_matrix * rotation_matrix * vec4(offset_offset, 0., 0.);\n#endif\n\n#ifdef ZOOM\n }\n#endif\n\n gl_Position = center_pos + offset;\n\n#ifdef DATA\n v_data = a_data;\n#endif\n}"},286:t=>{t.exports="\nvarying highp vec2 v_tex_coord;\nuniform sampler2D u_sdf_sampler;\nuniform int u_is_halo;\n\nuniform lowp vec4 u_text_color;\nuniform lowp vec4 u_halo_color;\n\n#define SDF_FILL 0.75\n#define SDF_HALO 0.45\n\nvoid main() {\n highp float sdf_val = texture2D(u_sdf_sampler, v_tex_coord).r;\n\n lowp float step_width = 0.08;\n lowp float alpha = smoothstep(SDF_FILL - step_width, SDF_FILL + step_width, sdf_val);\n\n lowp vec4 color = u_is_halo == 1 ? u_halo_color : u_text_color;\n\n if (u_is_halo == 1) {\n alpha = min(smoothstep(SDF_HALO - step_width, SDF_HALO + step_width, sdf_val), 1.0 - alpha);\n }\n\n color.a *= alpha;\n gl_FragColor = color;\n}"},207:t=>{t.exports="\nuniform mat4 u_matrix;\nuniform int u_offset;\nuniform highp float u_map_width;\nuniform highp float u_map_height;\nuniform highp float u_map_zoom;\nuniform highp float u_font_size;\n\nattribute vec3 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_tex_coord;\n\nvarying highp vec2 v_tex_coord;\n\nmat4 scalingMatrix(float x_scale, float y_scale, float z_scale) {\n return mat4(x_scale, 0.0, 0.0, 0.0,\n 0.0, y_scale, 0.0, 0.0,\n 0.0, 0.0, z_scale, 0.0,\n 0.0, 0.0, 0.0, 1.0);\n}\n\nvoid main() {\n float min_zoom = a_pos.z;\n\n vec2 offset = a_offset;\n if (u_map_zoom < min_zoom)\n offset = vec2(0., 0.);\n\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n mat4 map_stretch_matrix = scalingMatrix(u_map_height / u_map_width, 1., 1.);\n\n gl_Position = u_matrix * vec4(a_pos.xy + globe_offset, 0.0, 1.0) + u_font_size / 12. * 1.5 * map_stretch_matrix * vec4(offset, 0., 0.);\n v_tex_coord = a_tex_coord;\n}"},176:t=>{var e,n=(e="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(t={}){var n,r,o=t;o.ready=new Promise(((t,e)=>{n=t,r=e})),["_main","getExceptionMessage","___get_exception_message","_free","_memory","___indirect_function_table","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(o.ready,t)||Object.defineProperty(o.ready,t,{get:()=>C("You are getting "+t+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js"),set:()=>C("You are setting "+t+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")})}));var i=Object.assign({},o);if(o.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");var a,s="";if("undefined"!=typeof document&&document.currentScript&&(s=document.currentScript.src),e&&(s=e),s=0!==s.indexOf("blob:")?s.substr(0,s.replace(/[?#].*/,"").lastIndexOf("/")+1):"","object"!=typeof window&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");var l,c,u,f=o.print||console.log.bind(console),h=o.printErr||console.error.bind(console);Object.assign(o,i),i=null,u="fetchSettings",Object.getOwnPropertyDescriptor(o,u)&&C(`\`Module.${u}\` was supplied but \`${u}\` not included in INCOMING_MODULE_JS_API`),o.arguments&&o.arguments,z("arguments","arguments_"),o.thisProgram&&o.thisProgram,z("thisProgram","thisProgram"),o.quit&&o.quit,z("quit","quit_"),x(void 0===o.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),x(void 0===o.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),x(void 0===o.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),x(void 0===o.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),x(void 0===o.read,"Module.read option was removed (modify read_ in JS)"),x(void 0===o.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),x(void 0===o.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),x(void 0===o.setWindowTitle,"Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"),x(void 0===o.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),z("asm","wasmExports"),z("read","read_"),z("readAsync","readAsync"),z("readBinary","readBinary"),z("setWindowTitle","setWindowTitle"),x(!0,"worker environment detected but not enabled at build time. Add 'worker' to `-sENVIRONMENT` to enable."),x(!0,"node environment detected but not enabled at build time. Add 'node' to `-sENVIRONMENT` to enable."),x(!0,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),o.wasmBinary&&(l=o.wasmBinary),z("wasmBinary","wasmBinary"),"object"!=typeof WebAssembly&&C("no native wasm support detected");var d,p,_,m,g,v,b,y,w=!1;function x(t,e){t||C("Assertion failed"+(e?": "+e:""))}function T(){var t=c.buffer;o.HEAP8=d=new Int8Array(t),o.HEAP16=_=new Int16Array(t),o.HEAPU8=p=new Uint8Array(t),o.HEAPU16=m=new Uint16Array(t),o.HEAP32=g=new Int32Array(t),o.HEAPU32=v=new Uint32Array(t),o.HEAPF32=b=new Float32Array(t),o.HEAPF64=y=new Float64Array(t)}function E(){if(!w){var t=fe();0==t&&(t+=4);var e=v[t>>2],n=v[t+4>>2];34821223==e&&2310721022==n||C(`Stack overflow! Stack cookie has been overwritten at ${Q(t)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${Q(n)} ${Q(e)}`),1668509029!=v[0]&&C("Runtime error: The application has corrupted its heap memory area (address zero)!")}}x(!o.STACK_SIZE,"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"),x("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support"),x(!o.wasmMemory,"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"),x(!o.INITIAL_MEMORY,"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically"),function(){var t=new Int16Array(1),e=new Int8Array(t.buffer);if(t[0]=25459,115!==e[0]||99!==e[1])throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"}();var A=[],S=[],R=[],F=!1;x(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),x(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),x(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),x(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var M=0,P=null,I=null,O={};function C(t){o.onAbort&&o.onAbort(t),h(t="Aborted("+t+")"),w=!0;var e=new WebAssembly.RuntimeError(t);throw r(e),e}var N={error(){C("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM")},init(){N.error()},createDataFile(){N.error()},createPreloadedFile(){N.error()},createLazyFile(){N.error()},open(){N.error()},mkdev(){N.error()},registerDevice(){N.error()},analyzePath(){N.error()},ErrnoError(){N.error()}};o.FS_createDataFile=N.createDataFile,o.FS_createPreloadedFile=N.createPreloadedFile;var B,k,G=t=>t.startsWith("data:application/octet-stream;base64,");function L(t){return function(){x(F,`native function \`${t}\` called before runtime initialization`);var e=oe[t];return x(e,`exported native function \`${t}\` not found`),e.apply(null,arguments)}}class D extends Error{}class U extends D{constructor(t){super(t),this.excPtr=t;const e=K(t);this.name=e[0],this.message=e[1]}}function j(t){if(t==B&&l)return new Uint8Array(l);if(a)return a(t);throw"both async and sync fetching of the wasm failed"}function H(t,e,n){return function(t){return l||"function"!=typeof fetch?Promise.resolve().then((()=>j(t))):fetch(t,{credentials:"same-origin"}).then((e=>{if(!e.ok)throw"failed to load wasm binary file at '"+t+"'";return e.arrayBuffer()})).catch((()=>j(t)))}(t).then((t=>WebAssembly.instantiate(t,e))).then((t=>t)).then(n,(t=>{h(`failed to asynchronously prepare wasm: ${t}`),B.startsWith("file://")&&h(`warning: Loading from a file URI (${B}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`),C(t)}))}function z(t,e,n=!0){Object.getOwnPropertyDescriptor(o,t)||Object.defineProperty(o,t,{configurable:!0,get(){C(`\`Module.${t}\` has been replaced by \`${e}\``+(n?" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)":""))}})}function W(t){return"FS_createPath"===t||"FS_createDataFile"===t||"FS_createPreloadedFile"===t||"FS_unlink"===t||"addRunDependency"===t||"FS_createLazyFile"===t||"FS_createDevice"===t||"removeRunDependency"===t}function V(t,e){"undefined"!=typeof globalThis&&Object.defineProperty(globalThis,t,{configurable:!0,get(){tt(`\`${t}\` is not longer defined by emscripten. ${e}`)}})}function $(t){Object.getOwnPropertyDescriptor(o,t)||Object.defineProperty(o,t,{configurable:!0,get(){var e=`'${t}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`;W(t)&&(e+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),C(e)}})}G(B="marchingsquares.wasm")||(k=B,B=o.locateFile?o.locateFile(k,s):s+k),V("buffer","Please use HEAP8.buffer or wasmMemory.buffer"),V("asm","Please use wasmExports instead");var Y=t=>{for(;t.length>0;)t.shift()(o)},X="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,J=(t,e,n)=>{for(var r=e+n,o=e;t[o]&&!(o>=r);)++o;if(o-e>16&&t.buffer&&X)return X.decode(t.subarray(e,o));for(var i="";e<o;){var a=t[e++];if(128&a){var s=63&t[e++];if(192!=(224&a)){var l=63&t[e++];if(224==(240&a)?a=(15&a)<<12|s<<6|l:(240!=(248&a)&&tt("Invalid UTF-8 leading byte "+Q(a)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),a=(7&a)<<18|s<<12|l<<6|63&t[e++]),a<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i},Z=(t,e)=>(x("number"==typeof t,`UTF8ToString expects a number (got ${typeof t})`),t?J(p,t,e):""),q=t=>{return e=()=>{var e=pe(4),n=pe(4);me(t,e,n);var r,o=v[e>>2],i=v[n>>2],a=Z(o);return se(o),i&&(r=Z(i),se(i)),[a,r]},n=he(),r=e(),de(n),r;var e,n,r},K=t=>q(t);o.getExceptionMessage=K,o.noExitRuntime;var Q=t=>(x("number"==typeof t),"0x"+(t>>>=0).toString(16).padStart(8,"0")),tt=t=>{tt.shown||(tt.shown={}),tt.shown[t]||(tt.shown[t]=1,h(t))},et=[],nt=0;function rt(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(t){v[this.ptr+4>>2]=t},this.get_type=function(){return v[this.ptr+4>>2]},this.set_destructor=function(t){v[this.ptr+8>>2]=t},this.get_destructor=function(){return v[this.ptr+8>>2]},this.set_caught=function(t){t=t?1:0,d[this.ptr+12>>0]=t},this.get_caught=function(){return 0!=d[this.ptr+12>>0]},this.set_rethrown=function(t){t=t?1:0,d[this.ptr+13>>0]=t},this.get_rethrown=function(){return 0!=d[this.ptr+13>>0]},this.init=function(t,e){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(e)},this.set_adjusted_ptr=function(t){v[this.ptr+16>>2]=t},this.get_adjusted_ptr=function(){return v[this.ptr+16>>2]},this.get_exception_ptr=function(){if(ve(this.get_type()))return v[this.excPtr>>2];var t=this.get_adjusted_ptr();return 0!==t?t:this.excPtr}}var ot,it,at,st=t=>{var e=nt&&nt.excPtr;if(!e)return ce(0),0;var n=new rt(e);n.set_adjusted_ptr(e);var r=n.get_type();if(!r)return ce(0),e;for(var o in t){var i=t[o];if(0===i||i===r)break;var a=n.ptr+16;if(ge(i,r,a))return ce(i),e}return ce(r),e},lt=t=>{for(var e="",n=t;p[n];)e+=ot[p[n++]];return e},ct={},ut={},ft={},ht=t=>{throw new it(t)},dt=t=>{throw new at(t)};function pt(t,e,n={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(t,e,n={}){var r=e.name;if(t||ht(`type "${r}" must have a positive integer typeid pointer`),ut.hasOwnProperty(t)){if(n.ignoreDuplicateRegistrations)return;ht(`Cannot register type '${r}' twice`)}if(ut[t]=e,delete ft[t],ct.hasOwnProperty(t)){var o=ct[t];delete ct[t],o.forEach((t=>t()))}}(t,e,n)}function _t(){this.allocated=[void 0],this.freelist=[]}var mt=new _t,gt=t=>{t>=mt.reserved&&0==--mt.get(t).refcount&&mt.free(t)},vt=()=>{for(var t=0,e=mt.reserved;e<mt.allocated.length;++e)void 0!==mt.allocated[e]&&++t;return t},bt=t=>(t||ht("Cannot use deleted val. handle = "+t),mt.get(t).value),yt=t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return mt.allocate({refcount:1,value:t})}};function wt(t){return this.fromWireType(g[t>>2])}var xt=t=>{if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t},Tt=(t,e)=>{switch(e){case 4:return function(t){return this.fromWireType(b[t>>2])};case 8:return function(t){return this.fromWireType(y[t>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},Et=(t,e)=>Object.defineProperty(e,"name",{value:t}),At=t=>{for(;t.length;){var e=t.pop();t.pop()(e)}};function St(t,e){if(!(t instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof t} which is not a function`);var n=Et(t.name||"unknownFunctionName",(function(){}));n.prototype=t.prototype;var r=new n,o=t.apply(r,e);return o instanceof Object?o:r}var Rt,Ft,Mt=(t,e,n)=>{if(void 0===t[e].overloadTable){var r=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||ht(`Function '${n}' called with an invalid number of arguments (${arguments.length}) - expects one of (${t[e].overloadTable})!`),t[e].overloadTable[arguments.length].apply(this,arguments)},t[e].overloadTable=[],t[e].overloadTable[r.argCount]=r}},Pt=[],It=t=>{var e=Pt[t];return e||(t>=Pt.length&&(Pt.length=t+1),Pt[t]=e=Rt.get(t)),x(Rt.get(t)==e,"JavaScript-side Wasm function table mirror is out of date!"),e},Ot=(t,e,n)=>t.includes("j")?((t,e,n)=>{x("dynCall_"+t in o,`bad function pointer type - dynCall function not found for sig '${t}'`),n&&n.length?x(n.length===t.substring(1).replace(/j/g,"--").length):x(1==t.length);var r=o["dynCall_"+t];return n&&n.length?r.apply(null,[e].concat(n)):r.call(null,e)})(t,e,n):(x(It(e),`missing table entry in dynCall: ${e}`),It(e).apply(null,n)),Ct=(t,e)=>{var n=(t=lt(t)).includes("j")?((t,e)=>{x(t.includes("j")||t.includes("p"),"getDynCaller should only be called with i64 sigs");var n=[];return function(){return n.length=0,Object.assign(n,arguments),Ot(t,e,n)}})(t,e):It(e);return"function"!=typeof n&&ht(`unknown function pointer with signature ${t}: ${e}`),n},Nt=t=>{var e=ie(t),n=lt(e);return se(e),n},Bt=(t,e,n)=>{switch(e){case 1:return n?t=>d[t>>0]:t=>p[t>>0];case 2:return n?t=>_[t>>1]:t=>m[t>>1];case 4:return n?t=>g[t>>2]:t=>v[t>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}};function kt(t){return this.fromWireType(v[t>>2])}var Gt,Lt=(t,e,n)=>(x("number"==typeof n,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),((t,e,n,r)=>{if(x("string"==typeof t,`stringToUTF8Array expects a string (got ${typeof t})`),!(r>0))return 0;for(var o=n,i=n+r-1,a=0;a<t.length;++a){var s=t.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++a)),s<=127){if(n>=i)break;e[n++]=s}else if(s<=2047){if(n+1>=i)break;e[n++]=192|s>>6,e[n++]=128|63&s}else if(s<=65535){if(n+2>=i)break;e[n++]=224|s>>12,e[n++]=128|s>>6&63,e[n++]=128|63&s}else{if(n+3>=i)break;s>1114111&&tt("Invalid Unicode code point "+Q(s)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),e[n++]=240|s>>18,e[n++]=128|s>>12&63,e[n++]=128|s>>6&63,e[n++]=128|63&s}}return e[n]=0,n-o})(t,p,e,n)),Dt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Ut=(t,e)=>{x(t%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var n=t,r=n>>1,o=r+e/2;!(r>=o)&&m[r];)++r;if((n=r<<1)-t>32&&Dt)return Dt.decode(p.subarray(t,n));for(var i="",a=0;!(a>=e/2);++a){var s=_[t+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i},jt=(t,e,n)=>{if(x(e%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),x("number"==typeof n,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===n&&(n=2147483647),n<2)return 0;for(var r=e,o=(n-=2)<2*t.length?n/2:t.length,i=0;i<o;++i){var a=t.charCodeAt(i);_[e>>1]=a,e+=2}return _[e>>1]=0,e-r},Ht=t=>2*t.length,zt=(t,e)=>{x(t%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var n=0,r="";!(n>=e/4);){var o=g[t+4*n>>2];if(0==o)break;if(++n,o>=65536){var i=o-65536;r+=String.fromCharCode(55296|i>>10,56320|1023&i)}else r+=String.fromCharCode(o)}return r},Wt=(t,e,n)=>{if(x(e%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),x("number"==typeof n,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===n&&(n=2147483647),n<4)return 0;for(var r=e,o=r+n-4,i=0;i<t.length;++i){var a=t.charCodeAt(i);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++i)),g[e>>2]=a,(e+=4)+4>o)break}return g[e>>2]=0,e-r},Vt=t=>{for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);r>=55296&&r<=57343&&++n,e+=4}return e},$t=(t,e)=>{var n=ut[t];return void 0===n&&ht(e+" has unknown type "+Nt(t)),n},Yt=(t,e,n)=>{var r=[],o=t.toWireType(r,n);return r.length&&(v[e>>2]=yt(r)),o},Xt=[],Jt={},Zt=t=>{var e=Jt[t];return void 0===e?lt(t):e},qt=(Reflect.construct,(t,e,n)=>{var r=((t,e)=>{for(var n=new Array(t),r=0;r<t;++r)n[r]=$t(v[e+4*r>>2],"parameter "+r);return n})(t,e),o=r.shift();t--;var i="return function (obj, func, destructorsRef, args) {\n",a=0,s=[];0===n&&s.push("obj");for(var l=["retType"],c=[o],u=0;u<t;++u)s.push("arg"+u),l.push("argType"+u),c.push(r[u]),i+=` var arg${u} = argType${u}.readValueFromPointer(args${a?"+"+a:""});\n`,a+=r[u].argPackAdvance;for(i+=` var rv = ${1===n?"new func":"func.call"}(${s.join(", ")});\n`,u=0;u<t;++u)r[u].deleteObject&&(i+=` argType${u}.deleteObject(arg${u});\n`);o.isVoid||(l.push("emval_returnValue"),c.push(Yt),i+=" return emval_returnValue(retType, destructorsRef, rv);\n"),i+="};\n",l.push(i);var f,h,d=St(Function,l).apply(null,c),p=`methodCaller<(${r.map((t=>t.name)).join(", ")}) => ${o.name}>`;return f=Et(p,d),h=Xt.length,Xt.push(f),h});Gt=()=>performance.now();var Kt=t=>{var e=c.buffer,n=(t-e.byteLength+65535)/65536;try{return c.grow(n),T(),1}catch(n){h(`growMemory: Attempted to grow heap from ${e.byteLength} bytes to ${t} bytes, but got error: ${n}`)}};var Qt,te,ee,ne=[null,[],[]];(()=>{for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);ot=t})(),it=o.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},at=o.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},Object.assign(_t.prototype,{get(t){return x(void 0!==this.allocated[t],`invalid handle: ${t}`),this.allocated[t]},has(t){return void 0!==this.allocated[t]},allocate(t){var e=this.freelist.pop()||this.allocated.length;return this.allocated[e]=t,e},free(t){x(void 0!==this.allocated[t]),this.allocated[t]=void 0,this.freelist.push(t)}}),mt.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),mt.reserved=mt.allocated.length,o.count_emval_handles=vt,Ft=o.UnboundTypeError=(Qt=Error,(ee=Et(te="UnboundTypeError",(function(t){this.name=te,this.message=t;var e=new Error(t).stack;void 0!==e&&(this.stack=this.toString()+"\n"+e.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(Qt.prototype),ee.prototype.constructor=ee,ee.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},ee);var re={__assert_fail:(t,e,n,r)=>{C(`Assertion failed: ${Z(t)}, at: `+[e?Z(e):"unknown filename",n,r?Z(r):"unknown function"])},__cxa_begin_catch:t=>{var e=new rt(t);return e.get_caught()||e.set_caught(!0),e.set_rethrown(!1),et.push(e),_e(e.excPtr),e.get_exception_ptr()},__cxa_find_matching_catch_2:()=>st([]),__cxa_find_matching_catch_3:t=>st([t]),__cxa_throw:(t,e,n)=>{throw new rt(t).init(e,n),nt=new U(t)},__resumeException:t=>{throw nt||(nt=new U(t)),nt},_embind_register_bigint:(t,e,n,r,o)=>{},_embind_register_bool:(t,e,n,r)=>{pt(t,{name:e=lt(e),fromWireType:function(t){return!!t},toWireType:function(t,e){return e?n:r},argPackAdvance:8,readValueFromPointer:function(t){return this.fromWireType(p[t])},destructorFunction:null})},_embind_register_emval:(t,e)=>{pt(t,{name:e=lt(e),fromWireType:t=>{var e=bt(t);return gt(t),e},toWireType:(t,e)=>yt(e),argPackAdvance:8,readValueFromPointer:wt,destructorFunction:null})},_embind_register_float:(t,e,n)=>{pt(t,{name:e=lt(e),fromWireType:t=>t,toWireType:(t,e)=>{if("number"!=typeof e&&"boolean"!=typeof e)throw new TypeError(`Cannot convert ${xt(e)} to ${this.name}`);return e},argPackAdvance:8,readValueFromPointer:Tt(e,n),destructorFunction:null})},_embind_register_function:(t,e,n,r,i,a,s)=>{var l=((t,e)=>{for(var n=[],r=0;r<t;r++)n.push(v[e+4*r>>2]);return n})(e,n);t=(t=>{const e=(t=t.trim()).indexOf("(");return-1!==e?(x(")"==t[t.length-1],"Parentheses for argument names should match."),t.substr(0,e)):t})(t=lt(t)),i=Ct(r,i),((t,e,n)=>{o.hasOwnProperty(t)?((void 0===n||void 0!==o[t].overloadTable&&void 0!==o[t].overloadTable[n])&&ht(`Cannot register public name '${t}' twice`),Mt(o,t,t),o.hasOwnProperty(n)&&ht(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`),o[t].overloadTable[n]=e):(o[t]=e,void 0!==n&&(o[t].numArguments=n))})(t,(function(){((t,e)=>{var n=[],r={};throw e.forEach((function t(e){r[e]||ut[e]||(ft[e]?ft[e].forEach(t):(n.push(e),r[e]=!0))})),new Ft(`${t}: `+n.map(Nt).join([", "]))})(`Cannot call ${t} due to unbound types`,l)}),e-1),((t,e,n)=>{function r(e){var r=n(e);r.length!==t.length&&dt("Mismatched type converter count");for(var o=0;o<t.length;++o)pt(t[o],r[o])}t.forEach((function(t){ft[t]=e}));var o=new Array(e.length),i=[],a=0;e.forEach(((t,e)=>{ut.hasOwnProperty(t)?o[e]=ut[t]:(i.push(t),ct.hasOwnProperty(t)||(ct[t]=[]),ct[t].push((()=>{o[e]=ut[t],++a===i.length&&r(o)})))})),0===i.length&&r(o)})([],l,(function(n){var r=[n[0],null].concat(n.slice(1));return((t,e,n)=>{o.hasOwnProperty(t)||dt("Replacing nonexistant public symbol"),void 0!==o[t].overloadTable&&void 0!==n?o[t].overloadTable[n]=e:(o[t]=e,o[t].argCount=n)})(t,function(t,e,n,r,o,i){var a=e.length;a<2&&ht("argTypes array size mismatch! Must at least get return value and 'this' types!"),x(!i,"Async bindings are only supported with JSPI.");for(var s=null!==e[1]&&null!==n,l=!1,c=1;c<e.length;++c)if(null!==e[c]&&void 0===e[c].destructorFunction){l=!0;break}var u="void"!==e[0].name,f="",h="";for(c=0;c<a-2;++c)f+=(0!==c?", ":"")+"arg"+c,h+=(0!==c?", ":"")+"arg"+c+"Wired";var d=`\n return function (${f}) {\n if (arguments.length !== ${a-2}) {\n throwBindingError('function ${t} called with ' + arguments.length + ' arguments, expected ${a-2}');\n }`;l&&(d+="var destructors = [];\n");var p=l?"destructors":"null",_=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],m=[ht,r,o,At,e[0],e[1]];for(s&&(d+="var thisWired = classParam.toWireType("+p+", this);\n"),c=0;c<a-2;++c)d+="var arg"+c+"Wired = argType"+c+".toWireType("+p+", arg"+c+"); // "+e[c+2].name+"\n",_.push("argType"+c),m.push(e[c+2]);if(s&&(h="thisWired"+(h.length>0?", ":"")+h),d+=(u||i?"var rv = ":"")+"invoker(fn"+(h.length>0?", ":"")+h+");\n",l)d+="runDestructors(destructors);\n";else for(c=s?1:2;c<e.length;++c){var g=1===c?"thisWired":"arg"+(c-2)+"Wired";null!==e[c].destructorFunction&&(d+=g+"_dtor("+g+"); // "+e[c].name+"\n",_.push(g+"_dtor"),m.push(e[c].destructorFunction))}u&&(d+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),d+="}\n",_.push(d);var v=St(Function,_).apply(null,m);return Et(t,v)}(t,r,null,i,a,s),e-1),[]}))},_embind_register_integer:(t,e,n,r,o)=>{e=lt(e),-1===o&&(o=4294967295);var i=t=>t;if(0===r){var a=32-8*n;i=t=>t<<a>>>a}var s=e.includes("unsigned"),l=(t,n)=>{if("number"!=typeof t&&"boolean"!=typeof t)throw new TypeError(`Cannot convert "${xt(t)}" to ${n}`);if(t<r||t>o)throw new TypeError(`Passing a number "${xt(t)}" from JS side to C/C++ side to an argument of type "${e}", which is outside the valid range [${r}, ${o}]!`)};pt(t,{name:e,fromWireType:i,toWireType:s?function(t,e){return l(e,this.name),e>>>0}:function(t,e){return l(e,this.name),e},argPackAdvance:8,readValueFromPointer:Bt(e,n,0!==r),destructorFunction:null})},_embind_register_memory_view:(t,e,n)=>{var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];function o(t){var e=v[t>>2],n=v[t+4>>2];return new r(d.buffer,n,e)}pt(t,{name:n=lt(n),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},_embind_register_std_string:(t,e)=>{var n="std::string"===(e=lt(e));pt(t,{name:e,fromWireType(t){var e,r=v[t>>2],o=t+4;if(n)for(var i=o,a=0;a<=r;++a){var s=o+a;if(a==r||0==p[s]){var l=Z(i,s-i);void 0===e?e=l:(e+=String.fromCharCode(0),e+=l),i=s+1}}else{var c=new Array(r);for(a=0;a<r;++a)c[a]=String.fromCharCode(p[o+a]);e=c.join("")}return se(t),e},toWireType(t,e){var r;e instanceof ArrayBuffer&&(e=new Uint8Array(e));var o="string"==typeof e;o||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||ht("Cannot pass non-string to std::string"),r=n&&o?(t=>{for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);r<=127?e++:r<=2047?e+=2:r>=55296&&r<=57343?(e+=4,++n):e+=3}return e})(e):e.length;var i=ae(4+r+1),a=i+4;if(v[i>>2]=r,n&&o)Lt(e,a,r+1);else if(o)for(var s=0;s<r;++s){var l=e.charCodeAt(s);l>255&&(se(a),ht("String has UTF-16 code units that do not fit in 8 bits")),p[a+s]=l}else for(s=0;s<r;++s)p[a+s]=e[s];return null!==t&&t.push(se,i),i},argPackAdvance:8,readValueFromPointer:kt,destructorFunction(t){se(t)}})},_embind_register_std_wstring:(t,e,n)=>{var r,o,i,a,s;n=lt(n),2===e?(r=Ut,o=jt,a=Ht,i=()=>m,s=1):4===e&&(r=zt,o=Wt,a=Vt,i=()=>v,s=2),pt(t,{name:n,fromWireType:t=>{for(var n,o=v[t>>2],a=i(),l=t+4,c=0;c<=o;++c){var u=t+4+c*e;if(c==o||0==a[u>>s]){var f=r(l,u-l);void 0===n?n=f:(n+=String.fromCharCode(0),n+=f),l=u+e}}return se(t),n},toWireType:(t,r)=>{"string"!=typeof r&&ht(`Cannot pass non-string to C++ string type ${n}`);var i=a(r),l=ae(4+i+e);return v[l>>2]=i>>s,o(r,l+4,i+e),null!==t&&t.push(se,l),l},argPackAdvance:8,readValueFromPointer:wt,destructorFunction(t){se(t)}})},_embind_register_void:(t,e)=>{pt(t,{isVoid:!0,name:e=lt(e),argPackAdvance:0,fromWireType:()=>{},toWireType:(t,e)=>{}})},_emscripten_get_now_is_monotonic:()=>1,_emval_as:(t,e,n)=>(t=bt(t),e=$t(e,"emval::as"),Yt(e,n,t)),_emval_call:(t,e,n,r)=>(t=Xt[t])(null,e=bt(e),n,r),_emval_call_method:(t,e,n,r,o)=>(t=Xt[t])(e=bt(e),e[n=Zt(n)],r,o),_emval_decref:gt,_emval_get_method_caller:qt,_emval_get_module_property:t=>(t=Zt(t),yt(o[t])),_emval_get_property:(t,e)=>(t=bt(t),e=bt(e),yt(t[e])),_emval_incref:t=>{t>4&&(mt.get(t).refcount+=1)},_emval_new_array:()=>yt([]),_emval_new_cstring:t=>yt(Zt(t)),_emval_new_object:()=>yt({}),_emval_run_destructors:t=>{var e=bt(t);At(e),gt(t)},_emval_set_property:(t,e,n)=>{t=bt(t),e=bt(e),n=bt(n),t[e]=n},_emval_take_value:(t,e)=>{var n=(t=$t(t,"_emval_take_value")).readValueFromPointer(e);return yt(n)},abort:()=>{C("native code called abort()")},emscripten_date_now:()=>Date.now(),emscripten_get_now:Gt,emscripten_memcpy_js:(t,e,n)=>p.copyWithin(t,e,e+n),emscripten_resize_heap:t=>{var e=p.length;x((t>>>=0)>e);var n=2147483648;if(t>n)return h(`Cannot enlarge memory, requested ${t} bytes, but the limit is 2147483648 bytes!`),!1;for(var r,o=1;o<=4;o*=2){var i=e*(1+.2/o);i=Math.min(i,t+100663296);var a=Math.min(n,(r=Math.max(t,i))+(65536-r%65536)%65536);if(Kt(a))return!0}return h(`Failed to grow the heap from ${e} bytes to ${a} bytes, not enough memory!`),!1},fd_close:t=>{C("fd_close called without SYSCALLS_REQUIRE_FILESYSTEM")},fd_seek:function(t,e,n,r,o){return a=n,x((i=e)==i>>>0||i==(0|i)),x(a===(0|a)),70;var i,a},fd_write:(t,e,n,r)=>{for(var o=0,i=0;i<n;i++){var a=v[e>>2],s=v[e+4>>2];e+=8;for(var l=0;l<s;l++)c=t,u=p[a+l],d=void 0,x(d=ne[c]),0===u||10===u?((1===c?f:h)(J(d,0)),d.length=0):d.push(u);o+=s}var c,u,d;return v[r>>2]=o,0},invoke_ii:function(t,e){var n=he();try{return It(t)(e)}catch(t){if(de(n),!(t instanceof D))throw t;le(1,0)}},invoke_iii:function(t,e,n){var r=he();try{return It(t)(e,n)}catch(t){if(de(r),!(t instanceof D))throw t;le(1,0)}},invoke_iiii:function(t,e,n,r){var o=he();try{return It(t)(e,n,r)}catch(t){if(de(o),!(t instanceof D))throw t;le(1,0)}},invoke_j:function(t){var e=he();try{return be(t)}catch(t){if(de(e),!(t instanceof D))throw t;le(1,0)}},invoke_v:function(t){var e=he();try{It(t)()}catch(t){if(de(e),!(t instanceof D))throw t;le(1,0)}},invoke_vi:function(t,e){var n=he();try{It(t)(e)}catch(t){if(de(n),!(t instanceof D))throw t;le(1,0)}},invoke_vii:function(t,e,n){var r=he();try{It(t)(e,n)}catch(t){if(de(r),!(t instanceof D))throw t;le(1,0)}},invoke_viii:function(t,e,n,r){var o=he();try{It(t)(e,n,r)}catch(t){if(de(o),!(t instanceof D))throw t;le(1,0)}},invoke_viiii:function(t,e,n,r,o){var i=he();try{It(t)(e,n,r,o)}catch(t){if(de(i),!(t instanceof D))throw t;le(1,0)}}},oe=function(){var t,e={env:re,wasi_snapshot_preview1:re};function n(t,e){return oe=t.exports,x(c=oe.memory,"memory not found in wasm exports"),T(),x(Rt=oe.__indirect_function_table,"table not found in wasm exports"),n=oe.__wasm_call_ctors,S.unshift(n),function(t){if(M--,o.monitorRunDependencies&&o.monitorRunDependencies(M),t?(x(O[t]),delete O[t]):h("warning: run dependency removed without ID"),0==M&&(null!==P&&(clearInterval(P),P=null),I)){var e=I;I=null,e()}}("wasm-instantiate"),oe;var n}t="wasm-instantiate",M++,o.monitorRunDependencies&&o.monitorRunDependencies(M),t?(x(!O[t]),O[t]=1,null===P&&"undefined"!=typeof setInterval&&(P=setInterval((()=>{if(w)return clearInterval(P),void(P=null);var t=!1;for(var e in O)t||(t=!0,h("still waiting on run dependencies:")),h(`dependency: ${e}`);t&&h("(end of list)")}),1e4))):h("warning: run dependency added without ID");var i,a,s,u,f=o;if(o.instantiateWasm)try{return o.instantiateWasm(e,n)}catch(t){h(`Module.instantiateWasm callback failed with error: ${t}`),r(t)}return(i=l,a=B,s=e,u=function(t){x(o===f,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),f=null,n(t.instance)},i||"function"!=typeof WebAssembly.instantiateStreaming||G(a)||"function"!=typeof fetch?H(a,s,u):fetch(a,{credentials:"same-origin"}).then((t=>WebAssembly.instantiateStreaming(t,s).then(u,(function(t){return h(`wasm streaming compile failed: ${t}`),h("falling back to ArrayBuffer instantiation"),H(a,s,u)}))))).catch(r),{}}(),ie=(L("__wasm_call_ctors"),L("__getTypeName")),ae=(L("__errno_location"),o._fflush=L("fflush"),L("malloc")),se=o._free=L("free"),le=L("setThrew"),ce=L("setTempRet0"),ue=()=>(ue=oe.emscripten_stack_init)(),fe=()=>(fe=oe.emscripten_stack_get_end)(),he=L("stackSave"),de=L("stackRestore"),pe=L("stackAlloc"),_e=(L("__cxa_free_exception"),L("__cxa_increment_exception_refcount")),me=(L("__cxa_decrement_exception_refcount"),o.___get_exception_message=L("__get_exception_message")),ge=L("__cxa_can_catch"),ve=L("__cxa_is_pointer_type"),be=o.dynCall_j=L("dynCall_j");o.dynCall_jiji=L("dynCall_jiji");["writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertU32PairToI53","zeroMemory","exitJS","isLeapYear","ydayFromDate","arraySum","addDays","setErrNo","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","getHostByName","initRandomFill","randomFill","getCallstack","emscriptenLog","convertPCtoSourceLocation","readEmAsmArgs","jstoi_q","jstoi_s","getExecutableName","listenOnce","autoResumeAudioContext","handleException","keepRuntimeAlive","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","asmjsMangle","asyncLoad","alignMemory","mmapAlloc","getNativeTypeSize","STACK_SIZE","STACK_ALIGN","POINTER_SIZE","ASSERTIONS","getCFunc","ccall","cwrap","uleb128Encode","sigToWasmTypes","generateFuncType","convertJsFunctionToWasm","getEmptyTableSlot","updateTableMap","getFunctionAddress","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","intArrayFromString","intArrayToString","AsciiToString","stringToAscii","stringToNewUTF8","stringToUTF8OnStack","writeArrayToMemory","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","findCanvasEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","demangle","demangleAll","jsStackTrace","stackTrace","getEnvStrings","checkWasiClock","wasiRightsToMuslOFlags","wasiOFlagsToMuslOFlags","createDyncallWrapper","safeSetTimeout","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","getPromise","makePromise","idsToPromises","makePromiseCallback","setMainLoop","getSocketFromFD","getSocketAddress","FS_createPreloadedFile","FS_modeStringToFlags","FS_getMode","FS_stdin_getChar","FS_createDataFile","FS_unlink","FS_mkdirTree","_setNetworkCallback","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","webgl_enable_ANGLE_instanced_arrays","webgl_enable_OES_vertex_array_object","webgl_enable_WEBGL_draw_buffers","webgl_enable_WEBGL_multi_draw","emscriptenWebGLGet","computeUnpackAlignedImageSize","colorChannelsInGlTextureFormat","emscriptenWebGLGetTexPixelData","__glGenObject","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","__glGetActiveAttribOrUniform","writeGLArray","registerWebGlEventCallback","runAndAbortIfError","SDL_unicode","SDL_ttfContext","SDL_audio","ALLOC_NORMAL","ALLOC_STACK","allocate","writeStringToMemory","writeAsciiToMemory","getFunctionArgsName","init_embind","getBasestPointer","registerInheritedInstance","unregisterInheritedInstance","getInheritedInstance","getInheritedInstanceCount","getLiveInheritedInstances","enumReadValueFromPointer","genericPointerToWireType","constNoSmartPtrRawPointerToWireType","nonConstNoSmartPtrRawPointerToWireType","init_RegisteredPointer","RegisteredPointer","RegisteredPointer_fromWireType","runDestructor","releaseClassHandle","detachFinalizer","attachFinalizer","makeClassHandle","init_ClassHandle","ClassHandle","throwInstanceAlreadyDeleted","flushPendingDeletes","setDelayFunction","RegisteredClass","shallowCopyInternalPointer","downcastPointer","upcastPointer","validateThis","char_0","char_9","makeLegalFunctionName","emval_get_global"].forEach((function(t){"undefined"==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get(){var e=`\`${t}\` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line`,n=t;n.startsWith("_")||(n="$"+t),e+=` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${n}')`,W(t)&&(e+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),tt(e)}}),$(t)}));var ye;function we(){var t;ue(),x(0==(3&(t=fe()))),0==t&&(t+=4),v[t>>2]=34821223,v[t+4>>2]=2310721022,v[0]=1668509029}function xe(){function t(){ye||(ye=!0,o.calledRun=!0,w||(x(!F),F=!0,E(),Y(S),n(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),x(!o._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(E(),o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)t=o.postRun.shift(),R.unshift(t);var t;Y(R)}()))}M>0||(we(),function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)t=o.preRun.shift(),A.unshift(t);var t;Y(A)}(),M>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),t()}),1)):t(),E()))}if(["run","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","addRunDependency","removeRunDependency","FS_createFolder","FS_createPath","FS_createLazyFile","FS_createLink","FS_createDevice","FS_readFile","out","err","callMain","abort","wasmMemory","wasmExports","stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0","writeStackCookie","checkStackCookie","convertI32PairToI53Checked","ptrToString","getHeapMax","growMemory","ENV","MONTH_DAYS_REGULAR","MONTH_DAYS_LEAP","MONTH_DAYS_REGULAR_CUMULATIVE","MONTH_DAYS_LEAP_CUMULATIVE","ERRNO_CODES","ERRNO_MESSAGES","DNS","Protocols","Sockets","timers","warnOnce","UNWIND_CACHE","readEmAsmArgsArray","dynCallLegacy","getDynCaller","dynCall","handleAllocatorInit","HandleAllocator","wasmTable","noExitRuntime","freeTableIndexes","functionsInTableMap","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","UTF16Decoder","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","JSEvents","specialHTMLTargets","currentFullscreenStrategy","restoreOldWindowedStyle","ExitStatus","flush_NO_FILESYSTEM","promiseMap","uncaughtExceptionCount","exceptionLast","exceptionCaught","ExceptionInfo","findMatchingCatch","getExceptionMessageCommon","incrementExceptionRefcount","decrementExceptionRefcount","getExceptionMessage","Browser","wget","SYSCALLS","preloadPlugins","FS_stdin_getChar_buffer","FS","MEMFS","TTY","PIPEFS","SOCKFS","tempFixedLengthArray","miniTempWebGLFloatBuffers","miniTempWebGLIntBuffers","GL","emscripten_webgl_power_preferences","AL","GLUT","EGL","GLEW","IDBStore","SDL","SDL_gfx","allocateUTF8","allocateUTF8OnStack","InternalError","BindingError","throwInternalError","throwBindingError","registeredTypes","awaitingDependencies","typeDependencies","tupleRegistrations","structRegistrations","sharedRegisterType","whenDependentTypesAreResolved","embind_charCodes","embind_init_charCodes","readLatin1String","getTypeName","getFunctionName","heap32VectorToArray","requireRegisteredType","UnboundTypeError","PureVirtualError","GenericWireTypeSize","throwUnboundTypeError","ensureOverloadTable","exposePublicSymbol","replacePublicSymbol","extendError","createNamedFunction","embindRepr","registeredInstances","registeredPointers","registerType","integerReadValueFromPointer","floatReadValueFromPointer","simpleReadValueFromPointer","readPointer","runDestructors","newFunc","craftInvokerFunction","embind__requireFunction","finalizationRegistry","detachFinalizer_deps","deletionQueue","delayFunction","emval_handles","emval_symbols","init_emval","count_emval_handles","getStringOrSymbol","Emval","emval_returnValue","emval_lookupTypes","emval_methodCallers","emval_addMethodCaller","reflectConstruct"].forEach($),I=function t(){ye||xe(),ye||(I=t)},o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();return xe(),t.ready});t.exports=n}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.m=t,n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.u=t=>t+".autumnplot-gl.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;n.g.importScripts&&(t=n.g.location+"");var e=n.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");r.length&&(t=r[r.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=t})(),n.b=document.baseURI||self.location.href;var r={};return(()=>{"use strict";n.r(r),n.d(r,{Barbs:()=>Er,Color:()=>yn,ColorMap:()=>Tn,Contour:()=>ir,ContourFill:()=>pr,ContourLabels:()=>or,Grid:()=>_o,Hodographs:()=>jr,LambertGrid:()=>vo,MultiPlotLayer:()=>Vr,Paintball:()=>Cr,PlateCarreeGrid:()=>mo,PlateCarreeRotatedGrid:()=>go,PlotComponent:()=>F,PlotLayer:()=>Wr,Raster:()=>dr,RawProfileField:()=>co,RawScalarField:()=>so,RawVectorField:()=>lo,colormaps:()=>bo,initAutumnPlot:()=>yo,makeColorBar:()=>Xr,makePaintballKey:()=>Jr});const t=Symbol("Comlink.proxy"),e=Symbol("Comlink.endpoint"),o=Symbol("Comlink.releaseProxy"),i=Symbol("Comlink.thrown"),a=t=>"object"==typeof t&&null!==t||"function"==typeof t,s=new Map([["proxy",{canHandle:e=>a(e)&&e[t],serialize(t){const{port1:e,port2:n}=new MessageChannel;return l(t,e),[n,[n]]},deserialize:t=>(t.start(),u(t))}],["throw",{canHandle:t=>a(t)&&i in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function l(e,n=self){n.addEventListener("message",(function r(o){if(!o||!o.data)return;const{id:a,type:s,path:u}=Object.assign({path:[]},o.data),f=(o.data.argumentList||[]).map(m);let h;try{const n=u.slice(0,-1).reduce(((t,e)=>t[e]),e),r=u.reduce(((t,e)=>t[e]),e);switch(s){case"GET":h=r;break;case"SET":n[u.slice(-1)[0]]=m(o.data.value),h=!0;break;case"APPLY":h=r.apply(n,f);break;case"CONSTRUCT":h=function(e){return Object.assign(e,{[t]:!0})}(new r(...f));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;l(e,n),h=function(t,e){return p.set(t,e),t}(t,[t])}break;case"RELEASE":h=void 0;break;default:return}}catch(t){h={value:t,[i]:0}}Promise.resolve(h).catch((t=>({value:t,[i]:0}))).then((t=>{const[e,o]=_(t);n.postMessage(Object.assign(Object.assign({},e),{id:a}),o),"RELEASE"===s&&(n.removeEventListener("message",r),c(n))}))})),n.start&&n.start()}function c(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function u(t,e){return h(t,[],e)}function f(t){if(t)throw new Error("Proxy has been released and is not useable")}function h(t,n=[],r=function(){}){let i=!1;const a=new Proxy(r,{get(e,r){if(f(i),r===o)return()=>g(t,{type:"RELEASE",path:n.map((t=>t.toString()))}).then((()=>{c(t),i=!0}));if("then"===r){if(0===n.length)return{then:()=>a};const e=g(t,{type:"GET",path:n.map((t=>t.toString()))}).then(m);return e.then.bind(e)}return h(t,[...n,r])},set(e,r,o){f(i);const[a,s]=_(o);return g(t,{type:"SET",path:[...n,r].map((t=>t.toString())),value:a},s).then(m)},apply(r,o,a){f(i);const s=n[n.length-1];if(s===e)return g(t,{type:"ENDPOINT"}).then(m);if("bind"===s)return h(t,n.slice(0,-1));const[l,c]=d(a);return g(t,{type:"APPLY",path:n.map((t=>t.toString())),argumentList:l},c).then(m)},construct(e,r){f(i);const[o,a]=d(r);return g(t,{type:"CONSTRUCT",path:n.map((t=>t.toString())),argumentList:o},a).then(m)}});return a}function d(t){const e=t.map(_);return[e.map((t=>t[0])),(n=e.map((t=>t[1])),Array.prototype.concat.apply([],n))];var n}const p=new WeakMap;function _(t){for(const[e,n]of s)if(n.canHandle(t)){const[r,o]=n.serialize(t);return[{type:"HANDLER",name:e,value:r},o]}return[{type:"RAW",value:t},p.get(t)||[]]}function m(t){switch(t.type){case"HANDLER":return s.get(t.name).deserialize(t.value);case"RAW":return t.value}}function g(t,e,n){return new Promise((r=>{const o=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");t.addEventListener("message",(function e(n){n.data&&n.data.id&&n.data.id===o&&(t.removeEventListener("message",e),r(n.data))})),t.start&&t.start(),t.postMessage(Object.assign({id:o},e),n)}))}var v=function(){return v=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},v.apply(this,arguments)},b=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},y=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},w=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))};function x(t,e,n){for(var r=1,o=n;t%o!=0||e%o!=0;)r+=1,o/=2;return r}function T(){var t,e,n,r=[];for(t=0;t<arguments.length;t++)r[t]=arguments[t];return b(this,(function(t){switch(t.label){case 0:e=r.map((function(t){return t[Symbol.iterator]()})),t.label=1;case 1:return(n=e.map((function(t){return t.next()}))).some((function(t){return t.done}))?[3,3]:[4,n.map((function(t){return t.value}))];case 2:return t.sent(),[3,1];case 3:return[2]}}))}var E=function(){function t(t,e){this.cached_values={},this.compute_value=t,this.make_key=void 0===e?function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return JSON.stringify(t)}:e}return t.prototype.getValue=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.make_key.apply(this,w([],y(t),!1));return n in this.cached_values||(this.cached_values[n]=this.compute_value.apply(this,w([],y(t),!1))),this.cached_values[n]},t}();function A(t,e){var n=v({},e);return void 0!==t&&Object.entries(t).forEach((function(t){var e=y(t,2),r=e[0],o=e[1];n[r]=o})),n}function S(t){return t.getParameter(t.VERSION).includes("WebGL 2.0")}var R=u(new Worker(new URL(n.p+n.u(110),n.b))),F=function(){};function M(t,e){var n,r,o,i,a,s,l,c=S(t);if(e){var u=t.getExtension("OES_texture_half_float"),f=t.getExtension("OES_texture_half_float_linear");if(c)n=t.R16F,r=t.HALF_FLOAT;else{if(null===u||null===f)throw"Float16 data are not supported on this hardware. Try Float32 data instead.";n=t.LUMINANCE,r=u.HALF_FLOAT_OES}o=2}else{if(u=t.getExtension("OES_texture_float"),f=t.getExtension("OES_texture_float_linear"),!c&&null===u||!c&&null===f||"iOS"===(i=window.navigator.userAgent,a=window.navigator.platform,l=null,-1!==(s=["Macintosh","MacIntel","MacPPC","Mac68K"]).indexOf(a)&&navigator.maxTouchPoints<=1?l="Mac OS":-1!==["iPhone","iPad","iPod"].indexOf(a)||-1!==s.indexOf(a)&&navigator.maxTouchPoints>1?l="iOS":-1!==["Win32","Win64","Windows","WinCE"].indexOf(a)?l="Windows":/Android/.test(i)?l="Android":/Linux/.test(a)&&(l="Linux"),l))throw"Float32 data are not supported on this hardware. Try Float16 data instead.";n=c?t.R32F:t.LUMINANCE,r=t.FLOAT,o=4}return{format:n,type:r,row_alignment:o}}function P(t){var e,n,r=function(t){var e=Math.sin(t);return Math.tan(Math.PI/4-t/2)*Math.pow((1+a*e)/(1-a*e),a/2)},o=function(t){var e=Math.sin(t);return Math.cos(t)/Math.sqrt(1-a*a*e*e)},i=6378137,a=Math.sqrt(.006694379990197619),s=Math.PI/180,l=t.lon_0,c=t.lat_0,u=t.lat_std;u=Array.isArray(u)&&u[0]==u[1]?u[0]:u,l*=s;var f=r(c*=s);if(Array.isArray(u)){var h=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}(u,2),d=h[0],p=h[1];p*=s;var _=r(d*=s),m=r(p),g=o(d),v=o(p);n=Math.log(g/v)/Math.log(_/m),e=g/(n*Math.pow(_,n))}else d=u,_=r(d*=s),g=o(d),n=Math.sin(d),e=g/(n*Math.pow(_,n));var b=i*e*Math.pow(f,n),y=a*a,w=y*y,x=w*y,T=x*y,E=y/2+5*w/24+3*x/120-73*T/2016,A=7*w/24+29*x/120+233*T/6720,S=7*x/30+81*T/280,R=4729*T/20160;return function(t,o,a){return(a=void 0===a?{inverse:!1}:a).inverse?(c=t,u=o,f=Math.atan2(c,b-u)/n+l,h=Math.hypot(c,b-u)*Math.sign(n),d=Math.pow(h/(i*e),1/n),p=Math.PI/2-2*Math.atan(d),_=Math.sin(2*p),m=Math.cos(2*p),[f/s,(p+_*(E+m*(A+m*(S+R*m))))/s]):function(t,o){t*=s;var a=r(o*=s),c=i*e*Math.pow(a,n),u=n*(t-l);return[c*Math.sin(u),b-c*Math.cos(u)]}(t,o);var c,u,f,h,d,p,_,m}}var I=function(){function t(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: (".concat(t,", ").concat(e,")"));if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}return t.prototype.toMercatorCoord=function(){return{x:(r=this.lng,(180+r)/360),y:(t=this.lat,e=Math.sin(t*Math.PI/180),n=(180-90/Math.PI*Math.log((1+e)/(1-e)))/360,Math.min(2,Math.max(-2,n)))};var t,e,n,r},t.fromMercatorCoord=function(e,n){return new t(function(t){return 360*t-180}(e),function(t){return 180*Math.atan(Math.sinh((180-360*t)*Math.PI/180))/Math.PI}(n))},t}();class O{constructor(t,e,n,r,o){this.gl=t,this.n_coords_per_vert=n,this.dtype=((t,e)=>({Float32Array:t.FLOAT,Uint8Array:t.UNSIGNED_BYTE,Uint16Array:t.UNSIGNED_SHORT,Uint32Array:t.UNSIGNED_INT}[e.constructor.name]))(t,e),this.n_verts=e.length/n,this.draw_mode=r;const i=t.createBuffer();if(null===i)throw"Could not create WebGL buffer";this.buffer=i,t.bindBuffer(o,this.buffer),t.bufferData(o,e,t.STATIC_DRAW)}}class C extends O{constructor(t,e,n,r){super(t,e,n,r,t.ARRAY_BUFFER)}bindToProgram(t){this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.buffer),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(t,this.n_coords_per_vert,this.dtype,!1,0,0)}}function N(t){return t.getParameter(t.VERSION).includes("WebGL 2.0")}class B{constructor(t,e){this.gl=t;const n=t.createTexture();if(null===n)throw"Could not create WebGL texture";this.texture=n,this.tex_num=null,this.setImageData(e);const r=void 0===e.mag_filter?t.LINEAR:e.mag_filter;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,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,r)}setImageData(t){const e=this.gl;e.bindTexture(e.TEXTURE_2D,this.texture);const n=N(e)?function(t,e,n){switch(n){case t.UNSIGNED_BYTE:switch(e){case t.RGBA8:case t.RGB5_A1:case t.RGBA4:case t.SRGB8_ALPHA8:return t.RGBA;case t.RGBA8UI:return t.RGBA_INTEGER;case t.RGB8:case t.RGB565:case t.SRGB8:return t.RGB;case t.RGB8UI:return t.RGB_INTEGER;case t.RG8:return t.RG;case t.RG8UI:return t.RG_INTEGER;case t.R8:return t.RED;case t.R8UI:return t.RED_INTEGER;case t.RGBA:return t.RGBA;case t.RGB:return t.RGB;case t.LUMINANCE_ALPHA:return t.LUMINANCE_ALPHA;case t.LUMINANCE:return t.LUMINANCE;case t.ALPHA:return t.ALPHA}break;case t.BYTE:switch(e){case t.RGBA8_SNORM:return t.RGBA;case t.RGBA8I:return t.RGBA_INTEGER;case t.RGB8_SNORM:return t.RGB;case t.RGB8I:return t.RGB_INTEGER;case t.RG8_SNORM:return t.RG;case t.RG8I:return t.RG_INTEGER;case t.R8_SNORM:return t.RED;case t.R8I:return t.RED_INTEGER}break;case t.UNSIGNED_SHORT_4_4_4_4:switch(e){case t.RGBA4:case t.RGBA:return t.RGBA}break;case t.UNSIGNED_SHORT_5_5_5_1:switch(e){case t.RGB5_A1:case t.RGBA:return t.RGBA}break;case t.UNSIGNED_INT_2_10_10_10_REV:switch(e){case t.RGB10_A2:case t.RGB5_A1:return t.RGBA;case t.RGB10_A2UI:return t.RGBA_INTEGER}break;case t.HALF_FLOAT:switch(e){case t.RGBA16F:return t.RGBA;case t.RGB16F:case t.R11F_G11F_B10F:case t.RGB9_E5:return t.RGB;case t.RG16F:return t.RG;case t.R16F:return t.RED}break;case t.FLOAT:switch(e){case t.RGBA32F:case t.RGBA16F:return t.RGBA;case t.RGB32F:case t.RGB16F:case t.R11F_G11F_B10F:case t.RGB9_E5:return t.RGB;case t.RG32F:case t.RG16F:return t.RG;case t.R32F:case t.R16F:return t.RED;case t.DEPTH_COMPONENT32F:return t.DEPTH_COMPONENT}break;case t.UNSIGNED_SHORT:switch(e){case t.RGBA16UI:return t.RGBA_INTEGER;case t.RGB16UI:return t.RGB_INTEGER;case t.RG16UI:return t.RG_INTEGER;case t.R16UI:return t.RED_INTEGER;case t.DEPTH_COMPONENT16:return t.DEPTH_COMPONENT}break;case t.SHORT:switch(e){case t.RGBA16I:return t.RGBA_INTEGER;case t.RGB16I:return t.RGB_INTEGER;case t.RG16I:return t.RG_INTEGER;case t.R16I:return t.RED_INTEGER}break;case t.UNSIGNED_INT:switch(e){case t.RGBA32UI:return t.RGBA_INTEGER;case t.RGB32UI:return t.RGB_INTEGER;case t.RG32UI:return t.RG_INTEGER;case t.R32UI:return t.RED_INTEGER;case t.DEPTH_COMPONENT24:case t.DEPTH_COMPONENT16:return t.DEPTH_COMPONENT}break;case t.INT:switch(e){case t.RGBA32I:return t.RGBA_INTEGER;case t.RGB32I:return t.RGB_INTEGER;case t.RG32I:return t.RG_INTEGER;case t.R32I:return t.RED_INTEGER}break;case t.UNSIGNED_SHORT_5_6_5:switch(e){case t.RGB565:case t.RGB:return t.RGB}break;case t.UNSIGNED_INT_10F_11F_11F_REV:if(e===t.R11F_G11F_B10F)return t.RGB;break;case t.UNSIGNED_INT_5_9_9_9_REV:if(e===t.RGB9_E5)return t.RGB;break;case t.UNSIGNED_INT_24_8:if(e===t.DEPTH24_STENCIL8)return t.DEPTH_STENCIL;break;case t.FLOAT_32_UNSIGNED_INT_24_8_REV:if(e===t.DEPTH32F_STENCIL8)return t.DEPTH_STENCIL;break;default:throw"Unknown format in getWebGL2InternalFormat"}throw"Invalid combination of internal format and data type"}(e,t.format,t.type):t.format,r=void 0===t.row_alignment?4:t.row_alignment;e.pixelStorei(e.UNPACK_ALIGNMENT,r),void 0!==t.width&&void 0!==t.height?e.texImage2D(e.TEXTURE_2D,0,t.format,t.width,t.height,0,n,t.type,t.image):e.texImage2D(e.TEXTURE_2D,0,t.format,n,t.type,t.image)}bindToProgram(t,e){this.activate(e),this.gl.uniform1i(t,e)}activate(t){this.tex_num=t,this.gl.activeTexture(this.gl.TEXTURE0+this.tex_num),this.gl.bindTexture(this.gl.TEXTURE_2D,this.texture)}deactivate(){null!==this.tex_num&&(this.gl.activeTexture(this.gl.TEXTURE0+this.tex_num),this.gl.bindTexture(this.gl.TEXTURE_2D,null),this.tex_num=null)}delete(){this.gl.deleteTexture(this.texture),this.tex_num=null}}function k(t,e){const n=void 0===(e=void 0===e?{}:e).define?[]:[...e.define],r=[],o={},i=t.split("\n").map((t=>{const e=t.match(/#define\s+([\w\d_]+)/i);null!==e&&n.push(e[1]);const i=t.match(/#ifdef\s+([\w\d_]+)/i);if(null!==i)return r.push(i[1]),o[i[1]]=!0,"";const a=t.match(/#ifndef\s+([\w\d_]+)/i);if(null!==a)return r.push(a[1]),o[a[1]]=!1,"";if(null!==t.match(/#else/i)){const t=r[r.length-1];return o[t]=!o[t],""}if(null!==t.match(/#endif/i)){const t=r.pop();return o[t]=void 0,""}return r.map((t=>n.includes(t)==o[t])).reduce(((t,e)=>t&&e),!0)?t:""})).join("\n");if(r.length>0)throw"Unterminated #ifdef/#ifndef block in shader";return i}class G{constructor(t,e,n,r){e=k(e,r),n=k(n,r),this.gl=t,this.prog=((t,e,n)=>{const r=t.createShader(t.VERTEX_SHADER);if(null===r)throw"Could not create vertex shader";if(t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){const e=t.getShaderInfoLog(r);console.log("Vertex shader compiler log: "+e)}const o=t.createShader(t.FRAGMENT_SHADER);if(null===o)throw"Could not create fragment shader";if(t.shaderSource(o,n),t.compileShader(o),!t.getShaderParameter(o,t.COMPILE_STATUS)){const e=t.getShaderInfoLog(o);console.log("Fragment shader compiler log: "+e)}const i=t.createProgram();if(null===i)throw"Could not create shader program";if(t.attachShader(i,r),t.attachShader(i,o),t.linkProgram(i),!t.getProgramParameter(i,t.LINK_STATUS)){const e=t.getProgramInfoLog(i);console.log("Linker log: "+e)}return i})(t,e,n),this.attributes={},this.uniforms={},this.n_verts=null,this.draw_mode=null,this.index_buffer=null,this.sampler_names=[];const o=t=>{const e=t.indexOf("//");return e>=0&&(t=t.slice(0,e)),t};e=e.split("\n").map(o).join("\n"),n=n.split("\n").map(o).join("\n");const i=N(this.gl);if(!i&&(e.includes("#version 300 es")||n.includes("#version 300 es")))throw"WebGL2 context required for shader source containing '#version 300 es'";let a=i?/\b(?:in|attribute)+([\w ]+?) +([\w_]+);[\s]*$/gm:/attribute +([\w ]+?) +([\w_]+);[\s]*$/gm;for(const n of e.matchAll(a)){const[e,r,o]=n;this.attributes[o]={type:r,location:t.getAttribLocation(this.prog,o)}}for(const n of e.matchAll(/uniform +([\w ]+?) +([\w_]+)(?:[\s]*\[.*\])?;[\s]*$/gm)){const[e,r,o]=n,i=r.split(" "),a=t.getUniformLocation(this.prog,o);if(null===a)throw`Could not get vertex shader uniform location for '${o}'`;this.uniforms[o]={type:i[i.length-1],location:a}}for(const e of n.matchAll(/uniform +([\w ]+?) +([\w_]+)(?:[\s]*\[.*\])?;[\s]*$/gm)){const[n,r,o]=e,i=r.split(" "),a=t.getUniformLocation(this.prog,o);if(null===a)throw`Could not get fragment shader uniform location for '${o}'`;this.uniforms[o]={type:i[i.length-1],location:a}}Object.entries(this.uniforms).forEach((([t,e])=>{"sampler2d"==e.type.toLowerCase()&&this.sampler_names.push(t)}))}use(t,e,n,r){this.gl.useProgram(this.prog),void 0!==r?(r.bind(),this.index_buffer=r):this.index_buffer=null,this.draw_mode=null,this.n_verts=null,void 0!==t&&this.bindAttributes(t),void 0!==e&&this.setUniforms(e),void 0!==n&&this.bindTextures(n)}bindAttributes(t){Object.entries(t).forEach((([t,e])=>{if(void 0===this.attributes[t])return void console.warn(`Skipping attribute buffer provided for '${t}' because the attribute was not found in the program.`);if(this.n_verts=null===this.n_verts?e.n_verts:this.n_verts,this.draw_mode=null===this.draw_mode?e.draw_mode:this.draw_mode,this.draw_mode!=e.draw_mode)throw`Unexpected draw mode for attribute buffer ${t} (expected ${this.draw_mode}, got ${e.draw_mode}).`;if(this.n_verts!=e.n_verts)throw`Unexpected number of vertices for attribute buffer ${t} (expected ${this.n_verts}, got ${e.n_verts}).`;const{type:n,location:r}=this.attributes[t];e.bindToProgram(r)}))}setUniforms(t){Object.entries(t).forEach((([t,e])=>{if(void 0===this.uniforms[t])return void console.warn(`Skipping uniform value provided for '${t}' because the uniform was not found in the program.`);const{type:n,location:r}=this.uniforms[t];if("int"===n&&"number"==typeof e)this.gl.uniform1i(r,e);else if("float"===n&&"number"==typeof e)this.gl.uniform1f(r,e);else if("float"===n&&e instanceof Array)this.gl.uniform1fv(r,e);else if("vec2"===n&&e instanceof Array)this.gl.uniform2fv(r,e);else if("vec3"===n&&e instanceof Array)this.gl.uniform3fv(r,e);else if("vec4"===n&&e instanceof Array)this.gl.uniform4fv(r,e);else{if(!("mat4"===n&&e instanceof Array))throw`Could not figure out uniform function for type '${n}' and value '${String(e)}'`;this.gl.uniformMatrix4fv(r,!1,e)}}))}bindTextures(t){Object.entries(t).forEach((([t,e])=>{if(void 0===this.uniforms[t])return void console.warn(`Skipping texture provided for sampler '${t}' because the sampler was not found in the program.`);const n=this.sampler_names.indexOf(t),{type:r,location:o}=this.uniforms[t];e.bindToProgram(o,n)}))}draw(){if(null===this.draw_mode||null===this.n_verts)throw"Cannot draw without binding attribute buffers";null===this.index_buffer?this.gl.drawArrays(this.draw_mode,0,this.n_verts):this.gl.drawElements(this.draw_mode,this.index_buffer.n_verts,this.index_buffer.dtype,0)}}class L{constructor(t,e){this.gl=t,this.framebuffer=e}clear(t){const e=this.gl;if(null===e)throw"Register WebGL drawing context using registerGLContext() first";e.clearColor(...t),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer),e.clear(e.COLOR_BUFFER_BIT)}renderTo(t,e,n,r){const o=this.gl;if(null===o)throw"Register WebGL drawing context using registerGLContext() first";o.bindFramebuffer(o.FRAMEBUFFER,this.framebuffer),o.viewport(t,e,n,r)}copyToTexture(t,e,n,r,o){const i=this.gl;if(null===i)throw"Register WebGL drawing context using registerGLContext() first";i.bindFramebuffer(i.FRAMEBUFFER,this.framebuffer),t.activate(0),i.copyTexImage2D(i.TEXTURE_2D,0,i.RGBA,e,n,r,o,0)}}new class extends L{constructor(){super(null,null)}registerGLContext(t){this.gl=t}};const D=JSON.parse('{"levels":[20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140],"colors":["#e6f4ff","#dbf0fe","#d1ebfe","#c6e7fd","#bce3fd","#b1dffc","#a7dbfc","#9cd6fb","#92d2fb","#87cefa","#84c2f6","#81b7f1","#7eabed","#7ba0e8","#7994e4","#7688df","#737ddb","#7071d6","#6d66d2","#6a5acd","#7660cf","#8366d0","#8f6cd2","#9c72d3","#a878d5","#b47ed6","#c184d8","#cd8ad9","#da90db","#e696dc","#e390d9","#e08ad6","#dd84d3","#da7ed0","#d778cd","#d472ca","#d16cc7","#ce66c4","#cb60c1","#c85abe","#c453ba","#c04cb6","#bc45b2","#b83eae","#b437aa","#b030a6","#ac29a2","#a8229e","#a41b9a","#a01496","#a41080","#a80e75","#ac0e75","#b00c6a","#b4085f","#b80649","#bc043e","#c00233","#c80028","#c80028","#ca042a","#cc082c","#d00c2c","#d21432","#d41834","#d41834","#d61c36","#da243a","#dc283c","#de2c3e","#e03040","#e23442","#e43844","#e63c46","#e84048","#ea444a","#ec484c","#ee4c4e","#f05050","#f16052","#f27054","#f38056","#f49058","#f5a05a","#f6b05c","#f7c05e","#f8d060","#f9e062","#faf064","#f7eb61","#f4e65e","#f1e15b","#eedc58","#ebd755","#e8d252","#e5cd4f","#e2c84c","#dfc349","#dcbe46","#d9b943","#d6b440","#d3af3d","#d0aa3a","#cda537","#caa034","#c79b31","#c4962e","#c1912b","#be8c28","#bb8725","#b88222","#b57d1f","#b2781c","#af7319","#ac6e16","#a96913","#a66410","#a35f0d","#a05a0a","#a05a0a"]}'),U=JSON.parse('{"levels":[20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80],"colors":["#f0f8ff","#dbf0fe","#c6e7fd","#b1dffc","#9cd6fb","#87cefa","#81b7f1","#7ba0e8","#7688df","#7071d6","#6a5acd","#8366d0","#9c72d3","#b47ed6","#cd8ad9","#e696dc","#e08ad6","#da7ed0","#d472ca","#ce66c4","#c85abe","#c04cb6","#b83eae","#b030a6","#a8229e","#a01496","#a81080","#b00c6a","#b8043e","#c80028","#c80028","#d01030","#d41834","#d82038","#dc283c","#e03040","#e43844","#e84048","#ec484c","#f05050","#f27054","#f49058","#f6b05c","#f8d060","#faf064","#f4e65e","#eedc58","#e8d252","#e2c84c","#dcbe46","#d6b440","#d0aa3a","#caa034","#c4962e","#be8c28","#b88222","#b2781c","#ac6e16","#a66410","#a05a0a"]}'),j=JSON.parse('{"levels":[0,100,200,300,400,500,600,700,800,900,1000,1100,1200,1300,1400,1500,1600,1700,1800,1900,2000,2100,2200,2300,2400,2500,2600,2700,2800,2900,3000,3100,3200,3300,3400,3500,3600,3700,3800,3900,4000,4100,4200,4300,4400,4500,4600,4700,4800,4900,5000,5100,5200,5300,5400,5500,5600,5700,5800,5900,6000,6500,7000,7500,8000,8500,9000,9500,10000],"colors":["#ffffff","#f0f0f0","#e1e1e1","#d2d2d2","#c3c3c3","#a5a5a5","#969696","#878787","#787878","#696969","#37536a","#436075","#506d80","#5c7a8b","#698796","#7594a2","#82a1ad","#8eaeb8","#9bbbc3","#a7c8ce","#e9dd96","#e8d186","#e7c575","#e6b865","#e5ac54","#e5a044","#e49433","#e38723","#e27b12","#e16f02","#dc4110","#d33b17","#ca351e","#c12e25","#b8282c","#af2234","#a61c3b","#9d1542","#940f49","#8b0950","#73088a","#7e1894","#8a289f","#9538a9","#a148b3","#ac59be","#b869c8","#c379d2","#cf89dd","#da99e7","#e9bec3","#e3b0b7","#dda3ac","#d795a0","#d18894","#ca7a89","#c46d7d","#be5f71","#b85266","#b2445a","#893d48","#8f4752","#96525b","#9c5c65","#a2676f","#a97178","#af7c82","#b6868b"]}'),H=JSON.parse('{"levels":[-60,-59,-58,-57,-56,-55,-54,-53,-52,-51,-50,-49,-48,-47,-46,-45,-44,-43,-42,-41,-40,-39,-38,-37,-36,-35,-34,-33,-32,-31,-30,-29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120],"colors":["#235877","#2a5f7c","#316782","#396e87","#40768c","#477d91","#4e8497","#558c9c","#5d93a1","#649ba6","#6ba2ac","#72a9b1","#79b1b6","#81b8bb","#88c0c1","#8fc7c6","#96cecb","#9dd6d0","#a5ddd6","#ace5db","#b3ece0","#b3ece0","#b1e7df","#b0e1dd","#aedcdc","#add7da","#abd2d9","#aaccd8","#a8c7d6","#a7c2d5","#a5bcd4","#a4b7d2","#a2b2d1","#9fa7ce","#9ea2cd","#9c9dcb","#9c9dcb","#9b97ca","#9992c8","#988dc7","#9688c6","#9582c4","#9278c2","#9073c0","#8f6dbf","#8d68bd","#8c63bc","#8a5dbb","#8958b9","#8753b8","#864eb6","#8448b5","#8343b4","#813eb2","#8038b1","#7e33b0","#7d33ae","#7b29ad","#7a23ab","#781eaa","#a037af","#a443b3","#a74fb7","#ab5cbb","#af68bf","#b374c3","#b680c7","#ba8dcc","#be99d0","#c1a5d4","#c5b1d8","#c9bddc","#cdcae0","#d0d6e4","#d4e2e8","#deecf2","#d1e2ee","#c5d9ea","#b8cfe6","#acc5e3","#9fbbdf","#92b2db","#86a8d7","#799ed3","#6c94cf","#608bcb","#5381c7","#4777c4","#3a6dc0","#2d64bc","#215ab8","#1450b4","#0f4455","#1c4e5a","#2a585f","#376363","#456d68","#52776d","#5f8172","#6d8c77","#7a967c","#88a080","#95aa85","#a3b58a","#b0bf8f","#bdc994","#cbd399","#d8de9d","#e6e8a2","#f3f2a7","#f8eea2","#f0e199","#e8d591","#e1c888","#d9bc80","#d1af77","#c9a36f","#c19666","#ba8a5e","#b27d55","#aa714d","#a26444","#9b583c","#8b3f2b","#833222","#7b261a","#7b261a","#741911","#6c0d09","#640000","#5f0000","#630507","#670a0e","#6c0f15","#70141c","#741824","#781d2b","#7d2232","#812739","#852c40","#73372d","#7a4036","#80493f","#875349","#8e5c52","#94655b","#9b6e64","#a88177","#af8a80","#b69389","#bd9c92","#c3a69c","#caafa5","#d1b8ae","#d7c1b7","#decac0","#e5d4ca","#ebddd3","#f2e6dc","#e8dfd6","#e0d7cf","#d8d0c8","#d0c8c0","#c8c0b9","#c0b9b2","#b7b1ab","#afa9a4","#a7a29c","#9f9a95","#97938e","#8f8b87","#878380","#7f7c78","#777471","#6f6c6a","#666563","#5e5d5c","#565554","#4e4e4d","#464646"]}'),z=JSON.parse('{"levels":[-40,-39,-38,-37,-36,-35,-34,-33,-32,-31,-30,-29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90],"colors":["#986d4d","#966c4c","#946b4c","#926a4b","#90694b","#8e684a","#8c664a","#8a6549","#886448","#866348","#846247","#826147","#806046","#7e5f46","#7c5e45","#7a5d44","#785b44","#765a43","#745943","#725842","#715742","#6f5641","#6d5540","#6b5440","#69533f","#67523f","#65503e","#634f3d","#614e3d","#5f4d3c","#5d4c3c","#5b4b3b","#594a3b","#57493a","#554839","#534739","#514538","#4f4438","#4d4337","#4b4237","#494136","#4d4334","#514738","#564c3c","#5a5041","#5e5545","#625949","#675e4d","#6b6251","#6f6755","#746b5a","#78705e","#7c7462","#807966","#857d6a","#89826f","#8d8673","#928b77","#968f7b","#9a947f","#9e9883","#a39d88","#a7a18c","#aba690","#afaa94","#b8b39c","#b8b39c","#bcb8a1","#c1bca5","#c9c5ad","#c9cab1","#d2ceb6","#d2ceb6","#d6d3ba","#dfdcc2","#e3e0c6","#e7e5ca","#ebe9cf","#f0eed3","#f4f2d7","#e6f5e6","#d7f0d7","#c8eac8","#b9e5b9","#aadfaa","#9bda9b","#8cd48c","#7dcf7d","#6ec96e","#5fc45f","#30ae30","#2ca32c","#279927","#238e23","#1e831e","#1a791a","#156e15","#116311","#0c590c","#084e08","#61a3af","#5896a0","#508992","#477b83","#3e6e74","#366166","#2d5457","#244648","#1c393a","#132c2b","#66669a","#605e94","#59568e","#534e88","#4d4682","#463e7c","#403676","#3a2e70","#33266a","#2d1e64","#724071","#784573","#7d4b75","#835076","#885678","#8e5b7a","#93617c","#99667d","#9e6c7f","#a47181"]}'),W=JSON.parse('{"levels":[-15,-14.53608247,-14.07216495,-13.60824742,-13.1443299,-12.68041237,-12.21649485,-11.75257732,-11.28865979,-10.82474227,-10.36082474,-9.89690722,-9.43298969,-8.96907216,-8.50515464,-8.04123711,-7.57731959,-7.11340206,-6.64948454,-6.18556701,-5.72164948,-5.25773196,-4.79381443,-4.32989691,-3.86597938,-3.40206186,-2.93814433,-2.4742268,-2.01030928,-1.54639175,-1.08247423,-0.6185567,-0.15463918,0.30927835,0.77319588,1.2371134,1.70103093,2.16494845,2.62886598,3.09278351,3.55670103,4.02061856,4.48453608,4.94845361,5.41237113,5.87628866,6.34020619,6.80412371,7.26804124,7.73195876,8.19587629,8.65979381,9.12371134,9.58762887,10.05154639,10.51546392,10.97938144,11.44329897,11.90721649,12.37113402,12.83505155,13.29896907,13.7628866,14.22680412,14.69072165,15.15463918,15.6185567,16.08247423,16.54639175,17.01030928,17.4742268,17.93814433,18.40206186,18.86597938,19.32989691,19.79381443,20.25773196,20.72164948,21.18556701,21.64948454,22.11340206,22.57731959,23.04123711,23.50515464,23.96907216,24.43298969,24.89690722,25.36082474,25.82474227,26.28865979,26.75257732,27.21649485,27.68041237,28.1443299,28.60824742,29.07216495,29.53608247,30,30.46391753,30.92783505,31.39175258,31.8556701,32.31958763,32.78350515,33.24742268,33.71134021,34.17525773,34.63917526,35.10309278,35.56701031,36.03092784,36.49484536,36.95876289,37.42268041,37.88659794,38.35051546,38.81443299,39.27835052,39.74226804,40.20618557,40.67010309,41.13402062,41.59793814,42.06185567,42.5257732,42.98969072,43.45360825,43.91752577,44.3814433,44.84536082,45.30927835,45.77319588,46.2371134,46.70103093,47.16494845,47.62886598,48.09278351,48.55670103,49.02061856,49.48453608,49.94845361,50.41237113,50.87628866,51.34020619,51.80412371,52.26804124,52.73195876,53.19587629,53.65979381,54.12371134,54.58762887,55.05154639,55.51546392,55.97938144,56.44329897,56.90721649,57.37113402,57.83505155,58.29896907,58.7628866,59.22680412,59.69072165,60.15463918,60.6185567,61.08247423,61.54639175,62.01030928,62.4742268,62.93814433,63.40206186,63.86597938,64.32989691,64.79381443,65.25773196,65.72164948,66.18556701,66.64948454,67.11340206,67.57731959,68.04123711,68.50515464,68.96907216,69.43298969,69.89690722,70.36082474,70.82474227,71.28865979,71.75257732,72.21649485,72.68041237,73.1443299,73.60824742,74.07216495,74.53608247,75],"colors":["#959052","#979356","#9c9a60","#a09c64","#a3a067","#a8a570","#aaa875","#acac79","#b1b182","#b5b587","#b6b88c","#bcbd93","#bfc199","#c1c39c","#c1c39c","#c6caa5","#cacdaa","#cccfaf","#cfd1b3","#cccfb3","#c8ccb3","#c6c8b3","#bfc3b3","#bfc3b3","#bcc1b3","#b8bdb3","#b5bab3","#afb5b3","#acb3b3","#aaafb3","#a7aeb3","#a3aab3","#a0a8b3","#9ca5b3","#9aa1b3","#97a0b3","#939cb3","#909ab3","#939ab5","#8c95b3","#8791b1","#838eb1","#808caf","#7c89af","#7785ae","#7482ac","#7080aa","#6b7caa","#6275a8","#5e72a7","#5e72a7","#5b70a5","#566da3","#5269a3","#4f67a1","#4b64a1","#4660a0","#425d9e","#4260a1","#4467a5","#486eaa","#4975ae","#4d7cb1","#4f83b5","#508aba","#5491bf","#5699c3","#599ec6","#5ba5ca","#5daccf","#60b3d4","#62bad8","#64c1db","#67c8df","#69cfe4","#6ed6e8","#67d6d6","#60d6c4","#59d6b3","#52d6a1","#4bd690","#42d67e","#3bd66d","#34d65b","#11d418","#11d116","#0fcd16","#0fc816","#0fc316","#0fbf15","#0fbc15","#0fb613","#0eb313","#0eaf13","#0eaa13","#0ca511","#0ca111","#0c9e11","#0c9911","#0c950f","#0c900f","#0a8c0f","#0a870f","#0a830e","#0a800e","#0a7c0c","#0a770c","#08720c","#086e0c","#086b0a","#08660a","#08620a","#085d08","#1c6708","#317208","#467c08","#5b8707","#6e9107","#839c05","#97a805","#acb105","#c1bc05","#d6c603","#e9d103","#ffe200","#ffd800","#ffd300","#ffc800","#ffc300","#ffba00","#ffb500","#ffb000","#ffac00","#ffa700","#ff9e00","#ff9900","#ff9300","#ff8900","#ff8500","#ff7f00","#ff0000","#f70000","#f00000","#e90000","#e20000","#db0000","#d40000","#cd0000","#c60000","#bf0000","#b80000","#b10000","#aa0000","#a30000","#9a0000","#930000","#8c0000","#850000","#7e0000","#770000","#700000","#ffffff","#fff4ff","#ffe9ff","#ffdfff","#ffd4ff","#ffc8ff","#ffbdff","#ffb3ff","#ffa8ff","#ff9cff","#ff91ff","#ff75ff","#fb6bfd","#f960f9","#f656f6","#f24bf4","#ef3ff0","#ed36ef","#e92aeb","#e61fe8","#e416e6","#e10ae2","#b100ff","#ac00fb","#a300f6","#9a00f4","#9300ef","#8700e9","#8200e8","#7900e2","#7200dd","#6900db","#6200d6"]}'),V="This constructor is not a subclass of Float16Array",$="The constructor property value is not an object",Y="Attempting to access detached ArrayBuffer",X="Cannot convert undefined or null to object",J="Cannot mix BigInt and other types, use explicit conversions",Z="@@iterator property is not callable",q="Reduce of empty array with no initial value",K="Offset is out of bounds";function Q(t){return(e,...n)=>et(t,e,n)}function tt(t,e){return Q(it(t,e).get)}const{apply:et,construct:nt,defineProperty:rt,get:ot,getOwnPropertyDescriptor:it,getPrototypeOf:at,has:st,ownKeys:lt,set:ct,setPrototypeOf:ut}=Reflect,ft=Proxy,{EPSILON:ht,MAX_SAFE_INTEGER:dt,isFinite:pt,isNaN:_t}=Number,{iterator:mt,species:gt,toStringTag:vt,for:bt}=Symbol,yt=Object,{create:wt,defineProperty:xt,freeze:Tt,is:Et}=yt,At=yt.prototype,St=At.__lookupGetter__?Q(At.__lookupGetter__):(t,e)=>{if(null==t)throw be(X);let n=yt(t);do{const t=it(n,e);if(void 0!==t)return Rt(t,"get")?t.get:void 0}while(null!==(n=at(n)))},Rt=yt.hasOwn||Q(At.hasOwnProperty),Ft=Array,Mt=Ft.isArray,Pt=Ft.prototype,It=Q(Pt.join),Ot=Q(Pt.push),Ct=Q(Pt.toLocaleString),Nt=Pt[mt],Bt=Q(Nt),{abs:kt,trunc:Gt}=Math,Lt=ArrayBuffer,Dt=Lt.isView,Ut=Lt.prototype,jt=Q(Ut.slice),Ht=tt(Ut,"byteLength"),zt="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:null,Wt=zt&&tt(zt.prototype,"byteLength"),Vt=at(Uint8Array),$t=Vt.from,Yt=Vt.prototype,Xt=Yt[mt],Jt=Q(Yt.keys),Zt=Q(Yt.values),qt=Q(Yt.entries),Kt=Q(Yt.set),Qt=Q(Yt.reverse),te=Q(Yt.fill),ee=Q(Yt.copyWithin),ne=Q(Yt.sort),re=Q(Yt.slice),oe=Q(Yt.subarray),ie=tt(Yt,"buffer"),ae=tt(Yt,"byteOffset"),se=tt(Yt,"length"),le=tt(Yt,vt),ce=Uint8Array,ue=Uint16Array,fe=(...t)=>et($t,ue,t),he=Uint32Array,de=Float32Array,pe=at([][mt]()),_e=Q(pe.next),me=Q(function*(){}().next),ge=at(pe),ve=DataView.prototype,be=(Q(ve.getUint16),Q(ve.setUint16),TypeError),ye=RangeError,we=WeakSet,xe=we.prototype,Te=Q(xe.add),Ee=Q(xe.has),Ae=WeakMap,Se=Ae.prototype,Re=Q(Se.get),Fe=Q(Se.has),Me=Q(Se.set),Pe=new Ae,Ie=wt(null,{next:{value:function(){const t=Re(Pe,this);return _e(t)}},[mt]:{value:function(){return this}}});function Oe(t){if(t[mt]===Nt&&pe.next===_e)return t;const e=wt(Ie);return Me(Pe,e,Bt(t)),e}const Ce=new Ae,Ne=wt(ge,{next:{value:function(){const t=Re(Ce,this);return me(t)},writable:!0,configurable:!0}});for(const t of lt(pe))"next"!==t&&xt(Ne,t,it(pe,t));function Be(t){const e=wt(Ne);return Me(Ce,e,t),e}function ke(t){return null!==t&&"object"==typeof t||"function"==typeof t}function Ge(t){return null!==t&&"object"==typeof t}function Le(t){return void 0!==le(t)}function De(t){const e=le(t);return"BigInt64Array"===e||"BigUint64Array"===e}function Ue(t){if(null===zt)return!1;try{return Wt(t),!0}catch(t){return!1}}function je(t){return!!Mt(t)&&t[mt]===Nt&&pe.next===_e}function He(t){if("string"!=typeof t)return!1;const e=+t;return t===e+""&&!!pt(e)&&e===Gt(e)}const ze=bt("__Float16Array__"),We=1/ht,Ve=5.960464477539063e-8,$e=.0009765625*We;const Ye=new Lt(4),Xe=new de(Ye),Je=new he(Ye),Ze=new ue(512),qe=new ce(512);for(let t=0;t<256;++t){const e=t-127;e<-27?(Ze[t]=0,Ze[256|t]=32768,qe[t]=24,qe[256|t]=24):e<-14?(Ze[t]=1024>>-e-14,Ze[256|t]=1024>>-e-14|32768,qe[t]=-e-1,qe[256|t]=-e-1):e<=15?(Ze[t]=e+15<<10,Ze[256|t]=e+15<<10|32768,qe[t]=13,qe[256|t]=13):e<128?(Ze[t]=31744,Ze[256|t]=64512,qe[t]=24,qe[256|t]=24):(Ze[t]=31744,Ze[256|t]=64512,qe[t]=13,qe[256|t]=13)}function Ke(t){Xe[0]=function(t){const e=+t;if(!pt(e)||0===e)return e;const n=e>0?1:-1,r=kt(e);if(r<6103515625e-14)return n*function(t){return t+We-We}(r/Ve)*Ve;const o=(1+$e)*r,i=o-(o-r);return i>65504||_t(i)?n*(1/0):n*i}(t);const e=Je[0],n=e>>23&511;return Ze[n]+((8388607&e)>>qe[n])}const Qe=new he(2048);for(let t=1;t<1024;++t){let e=t<<13,n=0;for(;0==(8388608&e);)e<<=1,n-=8388608;e&=-8388609,n+=947912704,Qe[t]=e|n}for(let t=1024;t<2048;++t)Qe[t]=939524096+(t-1024<<13);const tn=new he(64);for(let t=1;t<31;++t)tn[t]=t<<23;tn[31]=1199570944,tn[32]=2147483648;for(let t=33;t<63;++t)tn[t]=2147483648+(t-32<<23);tn[63]=3347054592;const en=new ue(64);for(let t=1;t<64;++t)32!==t&&(en[t]=1024);function nn(t){const e=t>>10;return Je[0]=Qe[en[e]+(1023&t)]+tn[e],Xe[0]}function rn(t){const e=+t;return _t(e)||0===e?0:Gt(e)}function on(t){const e=rn(t);return e<0?0:e<dt?e:dt}function an(t,e){if(!ke(t))throw be("This is not an object");const n=t.constructor;if(void 0===n)return e;if(!ke(n))throw be($);const r=n[gt];return null==r?e:r}function sn(t){if(Ue(t))return!1;try{return jt(t,0,0),!1}catch(t){}return!0}function ln(t,e){const n=_t(t),r=_t(e);if(n&&r)return 0;if(n)return 1;if(r)return-1;if(t<e)return-1;if(t>e)return 1;if(0===t&&0===e){const n=Et(t,0),r=Et(e,0);if(!n&&r)return-1;if(n&&!r)return 1}return 0}const cn=new Ae;function un(t){return Fe(cn,t)||!Dt(t)&&function(t){if(!Ge(t))return!1;const e=at(t);if(!Ge(e))return!1;const n=e.constructor;if(void 0===n)return!1;if(!ke(n))throw be($);return st(n,ze)}(t)}function fn(t){if(!un(t))throw be("This is not a Float16Array object")}function hn(t,e){const n=un(t),r=Le(t);if(!n&&!r)throw be("Species constructor didn't return TypedArray object");if("number"==typeof e){let r;if(n){const e=dn(t);r=se(e)}else r=se(t);if(r<e)throw be("Derived constructor created TypedArray object which was too small length")}if(De(t))throw be(J)}function dn(t){const e=Re(cn,t);if(void 0!==e){if(sn(ie(e)))throw be(Y);return e}const n=t.buffer;if(sn(n))throw be(Y);const r=nt(gn,[n,t.byteOffset,t.length],t.constructor);return Re(cn,r)}function pn(t){const e=se(t),n=[];for(let r=0;r<e;++r)n[r]=nn(t[r]);return n}const _n=new we;for(const t of lt(Yt)){if(t===vt)continue;const e=it(Yt,t);Rt(e,"get")&&"function"==typeof e.get&&Te(_n,e.get)}const mn=Tt({get:(t,e,n)=>He(e)&&Rt(t,e)?nn(ot(t,e)):Ee(_n,St(t,e))?ot(t,e):ot(t,e,n),set:(t,e,n,r)=>He(e)&&Rt(t,e)?ct(t,e,Ke(n)):ct(t,e,n,r),getOwnPropertyDescriptor(t,e){if(He(e)&&Rt(t,e)){const n=it(t,e);return n.value=nn(n.value),n}return it(t,e)},defineProperty:(t,e,n)=>He(e)&&Rt(t,e)&&Rt(n,"value")?(n.value=Ke(n.value),rt(t,e,n)):rt(t,e,n)});class gn{constructor(t,e,n){let r;if(un(t))r=nt(ue,[dn(t)],new.target);else if(!ke(t)||(function(t){try{return Ht(t),!0}catch(t){return!1}}(o=t)||Ue(o)))r=nt(ue,arguments,new.target);else{let e,n;if(Le(t)){if(e=t,n=se(t),sn(ie(t)))throw be(Y);if(De(t))throw be(J);const o=new Lt(2*n);r=nt(ue,[o],new.target)}else{const o=t[mt];if(null!=o&&"function"!=typeof o)throw be(Z);null!=o?je(t)?(e=t,n=t.length):(e=[...t],n=e.length):(e=t,n=on(e.length)),r=nt(ue,[n],new.target)}for(let t=0;t<n;++t)r[t]=Ke(e[t])}var o;const i=new ft(r,mn);return Me(cn,i,r),i}static from(t,...e){const n=this;if(!st(n,ze))throw be(V);if(n===gn){if(un(t)&&0===e.length){const e=dn(t),n=new ue(ie(e),ae(e),se(e));return new gn(ie(re(n)))}if(0===e.length)return new gn(ie(fe(t,Ke)));const n=e[0],r=e[1];return new gn(ie(fe(t,(function(t,...e){return Ke(et(n,this,[t,...Oe(e)]))}),r)))}let r,o;const i=t[mt];if(null!=i&&"function"!=typeof i)throw be(Z);if(null!=i)je(t)?(r=t,o=t.length):Le(a=t)&&a[mt]===Xt&&pe.next===_e?(r=t,o=se(t)):(r=[...t],o=r.length);else{if(null==t)throw be(X);r=yt(t),o=on(r.length)}var a;const s=new n(o);if(0===e.length)for(let t=0;t<o;++t)s[t]=r[t];else{const t=e[0],n=e[1];for(let e=0;e<o;++e)s[e]=et(t,n,[r[e],e])}return s}static of(...t){const e=this;if(!st(e,ze))throw be(V);const n=t.length;if(e===gn){const e=new gn(n),r=dn(e);for(let e=0;e<n;++e)r[e]=Ke(t[e]);return e}const r=new e(n);for(let e=0;e<n;++e)r[e]=t[e];return r}keys(){fn(this);const t=dn(this);return Jt(t)}values(){fn(this);const t=dn(this);return Be(function*(){for(const e of Zt(t))yield nn(e)}())}entries(){fn(this);const t=dn(this);return Be(function*(){for(const[e,n]of qt(t))yield[e,nn(n)]}())}at(t){fn(this);const e=dn(this),n=se(e),r=rn(t),o=r>=0?r:n+r;if(!(o<0||o>=n))return nn(e[o])}with(t,e){fn(this);const n=dn(this),r=se(n),o=rn(t),i=o>=0?o:r+o,a=+e;if(i<0||i>=r)throw ye(K);const s=new ue(ie(n),ae(n),se(n)),l=new gn(ie(re(s)));return dn(l)[i]=Ke(a),l}map(t,...e){fn(this);const n=dn(this),r=se(n),o=e[0],i=an(n,gn);if(i===gn){const e=new gn(r),i=dn(e);for(let e=0;e<r;++e){const r=nn(n[e]);i[e]=Ke(et(t,o,[r,e,this]))}return e}const a=new i(r);hn(a,r);for(let e=0;e<r;++e){const r=nn(n[e]);a[e]=et(t,o,[r,e,this])}return a}filter(t,...e){fn(this);const n=dn(this),r=se(n),o=e[0],i=[];for(let e=0;e<r;++e){const r=nn(n[e]);et(t,o,[r,e,this])&&Ot(i,r)}const a=new(an(n,gn))(i);return hn(a),a}reduce(t,...e){fn(this);const n=dn(this),r=se(n);if(0===r&&0===e.length)throw be(q);let o,i;0===e.length?(o=nn(n[0]),i=1):(o=e[0],i=0);for(let e=i;e<r;++e)o=t(o,nn(n[e]),e,this);return o}reduceRight(t,...e){fn(this);const n=dn(this),r=se(n);if(0===r&&0===e.length)throw be(q);let o,i;0===e.length?(o=nn(n[r-1]),i=r-2):(o=e[0],i=r-1);for(let e=i;e>=0;--e)o=t(o,nn(n[e]),e,this);return o}forEach(t,...e){fn(this);const n=dn(this),r=se(n),o=e[0];for(let e=0;e<r;++e)et(t,o,[nn(n[e]),e,this])}find(t,...e){fn(this);const n=dn(this),r=se(n),o=e[0];for(let e=0;e<r;++e){const r=nn(n[e]);if(et(t,o,[r,e,this]))return r}}findIndex(t,...e){fn(this);const n=dn(this),r=se(n),o=e[0];for(let e=0;e<r;++e){const r=nn(n[e]);if(et(t,o,[r,e,this]))return e}return-1}findLast(t,...e){fn(this);const n=dn(this),r=se(n),o=e[0];for(let e=r-1;e>=0;--e){const r=nn(n[e]);if(et(t,o,[r,e,this]))return r}}findLastIndex(t,...e){fn(this);const n=dn(this),r=se(n),o=e[0];for(let e=r-1;e>=0;--e){const r=nn(n[e]);if(et(t,o,[r,e,this]))return e}return-1}every(t,...e){fn(this);const n=dn(this),r=se(n),o=e[0];for(let e=0;e<r;++e)if(!et(t,o,[nn(n[e]),e,this]))return!1;return!0}some(t,...e){fn(this);const n=dn(this),r=se(n),o=e[0];for(let e=0;e<r;++e)if(et(t,o,[nn(n[e]),e,this]))return!0;return!1}set(t,...e){fn(this);const n=dn(this),r=rn(e[0]);if(r<0)throw ye(K);if(null==t)throw be(X);if(De(t))throw be(J);if(un(t))return Kt(dn(this),dn(t),r);if(Le(t)&&sn(ie(t)))throw be(Y);const o=se(n),i=yt(t),a=on(i.length);if(r===1/0||a+r>o)throw ye(K);for(let t=0;t<a;++t)n[t+r]=Ke(i[t])}reverse(){fn(this);const t=dn(this);return Qt(t),this}toReversed(){fn(this);const t=dn(this),e=new ue(ie(t),ae(t),se(t)),n=new gn(ie(re(e))),r=dn(n);return Qt(r),n}fill(t,...e){fn(this);const n=dn(this);return te(n,Ke(t),...Oe(e)),this}copyWithin(t,e,...n){fn(this);const r=dn(this);return ee(r,t,e,...Oe(n)),this}sort(t){fn(this);const e=dn(this),n=void 0!==t?t:ln;return ne(e,((t,e)=>n(nn(t),nn(e)))),this}toSorted(t){fn(this);const e=dn(this);if(void 0!==t&&"function"!=typeof t)throw new be("The comparison function must be either a function or undefined");const n=void 0!==t?t:ln,r=new ue(ie(e),ae(e),se(e)),o=new gn(ie(re(r))),i=dn(o);return ne(i,((t,e)=>n(nn(t),nn(e)))),o}slice(t,e){fn(this);const n=dn(this),r=an(n,gn);if(r===gn){const r=new ue(ie(n),ae(n),se(n));return new gn(ie(re(r,t,e)))}const o=se(n),i=rn(t),a=void 0===e?o:rn(e);let s,l;s=i===-1/0?0:i<0?o+i>0?o+i:0:o<i?o:i,l=a===-1/0?0:a<0?o+a>0?o+a:0:o<a?o:a;const c=l-s>0?l-s:0,u=new r(c);if(hn(u,c),0===c)return u;if(sn(ie(n)))throw be(Y);let f=0;for(;s<l;)u[f]=nn(n[s]),++s,++f;return u}subarray(t,e){fn(this);const n=dn(this),r=an(n,gn),o=new ue(ie(n),ae(n),se(n)),i=oe(o,t,e),a=new r(ie(i),ae(i),se(i));return hn(a),a}indexOf(t,...e){fn(this);const n=dn(this),r=se(n);let o=rn(e[0]);if(o===1/0)return-1;o<0&&(o+=r,o<0&&(o=0));for(let e=o;e<r;++e)if(Rt(n,e)&&nn(n[e])===t)return e;return-1}lastIndexOf(t,...e){fn(this);const n=dn(this),r=se(n);let o=e.length>=1?rn(e[0]):r-1;if(o===-1/0)return-1;o>=0?o=o<r-1?o:r-1:o+=r;for(let e=o;e>=0;--e)if(Rt(n,e)&&nn(n[e])===t)return e;return-1}includes(t,...e){fn(this);const n=dn(this),r=se(n);let o=rn(e[0]);if(o===1/0)return!1;o<0&&(o+=r,o<0&&(o=0));const i=_t(t);for(let e=o;e<r;++e){const r=nn(n[e]);if(i&&_t(r))return!0;if(r===t)return!0}return!1}join(t){fn(this);const e=pn(dn(this));return It(e,t)}toLocaleString(...t){fn(this);const e=pn(dn(this));return Ct(e,...Oe(t))}get[vt](){if(un(this))return"Float16Array"}}xt(gn,"BYTES_PER_ELEMENT",{value:2}),xt(gn,ze,{}),ut(gn,Vt);const vn=gn.prototype;xt(vn,"BYTES_PER_ELEMENT",{value:2}),xt(vn,mt,{value:vn.values,writable:!0,configurable:!0}),ut(vn,Yt);var bn=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},yn=function(){function t(t){this.rgba=t}return Object.defineProperty(t.prototype,"r",{get:function(){return this.rgba[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"g",{get:function(){return this.rgba[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this.rgba[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"a",{get:function(){return this.rgba[3]},enumerable:!1,configurable:!0}),t.prototype.withOpacity=function(e){return new t([this.r,this.g,this.b,e])},t.prototype.toRGBHex=function(){return this.toRGBAHex().slice(0,-2)},t.prototype.toRGBAHex=function(){return e=this.rgba,"float"==(t=void 0===t?"float":t)&&(e=e.map((function(t){return Math.round(255*t)}))),"#"+e.map((function(t){return t.toString(16).padStart(2,"0").toUpperCase()})).join("");var t,e},t.prototype.toRGBATuple=function(){return this.rgba},t.prototype.toHSVTuple=function(){return function(t){var e,n=bn(t,3),r=n[0],o=n[1],i=n[2],a=Math.max(r,o,i),s=a-Math.min(r,o,i);if(0==s)e=0;else if(a==r)e=(o-i)/s*60%6;else if(a==o)e=60*((i-r)/s+2);else{if(a!=i)throw"You've messed something up in rgb2hsv()";e=60*((r-o)/s+4)}return[e,0==a?0:s/a,a]}([this.r,this.g,this.b])},t.fromHex=function(e){return new t(function(t,e){e=void 0===e?"float":e;var n=t.match(/#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?/i);if(null===n)throw"Got '".concat(t,"' in hex2rgba, which does not look like a hex color");var r=n.slice(1).filter((function(t){return void 0!==t})).map((function(t){return parseInt(t,16)}));return"float"==e&&(r=r.map((function(t){return t/255}))),void 0===r[3]?[r[0],r[1],r[2],1]:[r[0],r[1],r[2],r[3]]}(e))},t.fromHSVTuple=function(e){var n=function(t){var e,n,r,o=bn(t,3),i=o[0],a=o[1],s=o[2],l=s*a,c=l*(1-Math.abs(i/60%2-1)),u=s-l;if(0<=i&&i<60)e=l,n=c,r=0;else if(60<=i&&i<120)e=c,n=l,r=0;else if(120<=i&&i<180)e=0,n=l,r=c;else if(180<=i&&i<240)e=0,n=c,r=l;else if(240<=i&&i<300)e=c,n=0,r=l;else{if(!(300<=i&&i<360))throw"H is out of bounds in hsv2rgb";e=l,n=0,r=c}return[e+u,n+u,r+u]}(e);return new t([n[0],n[1],n[2],1])},t}(),wn=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},xn=n(351),Tn=function(){function t(t,e,n){if(t.length!=e.length+1)throw"Mismatch between number of levels (".concat(t.length,") and number of colors (").concat(e.length,"; expected ").concat(t.length-1,")");var r=function(t){return t instanceof yn?t:yn.fromHex(t)};this.levels=t,this.colors=e.map((function(t){return r(t)})),n=void 0===n?{}:n,this.overflow_color=void 0===n.overflow_color?null:r(n.overflow_color),this.underflow_color=void 0===n.underflow_color?null:r(n.underflow_color)}return t.prototype.getColors=function(){return this.colors.map((function(t){return t.toRGBHex()}))},t.prototype.getOpacities=function(){return this.colors.map((function(t){return t.a}))},t.prototype.withOpacity=function(e){for(var n=[],r=[],o={},i=0;i<this.colors.length;i++){var a=this.colors[i],s=this.levels[i],l=this.levels[i+1],c=e(s,l),u=a.withOpacity(c);c>0&&(r[r.length-1]!=s&&r.push(s),r.push(l),n.push(u))}if(null!==this.underflow_color){var f=e(this.levels[0],this.levels[0]);f>0&&(o.underflow_color=this.underflow_color.withOpacity(f))}if(null!==this.overflow_color){var h=e(this.levels[this.levels.length-1],this.levels[this.levels.length-1]);h>0&&(o.overflow_color=this.overflow_color.withOpacity(h))}return new t(r,n,o)},t.diverging=function(e,n,r,o,i){for(var a,s,l=[],c=[],u=(o-r)/(i-1),f=(o+r)/2,h=[0,0,.9],d=yn.fromHex(e).toHSVTuple(),p=yn.fromHex(n).toHSVTuple(),_=0;_<i;_++){var m=r+_*u,g=void 0,v=void 0,b=void 0,y=void 0;m<f?(y=Math.pow((f-m)/(f-r),1.5),g=(a=wn([d[0],h[1]+(d[1]-h[1])*y,h[2]+(d[2]-h[2])*y],3))[0],v=a[1],b=a[2]):(y=Math.pow((m-f)/(o-f),1.5),g=(s=wn([p[0],h[1]+(p[1]-h[1])*y,h[2]+(p[2]-h[2])*y],3))[0],v=s[1],b=s[2]),l.push(yn.fromHSVTuple([g,v,b]).withOpacity(Math.min(2*y,1)))}for(var w=0;w<=i;w++){var x=(o-r)/i;c.push(r+w*x)}return new t(c,l)},t}();function En(t,e){var n=t.colors.length,r={};return"over"!=e&&"both"!=e||(r.overflow_color=t.colors[n-1]),"under"!=e&&"both"!=e||(r.underflow_color=t.colors[0]),new Tn(t.levels,t.colors,r)}var An=En(D,"over").withOpacity((function(t,e){return Math.min((e-20)/10,1)})),Sn=En(U,"over").withOpacity((function(t,e){return Math.min((e-20)/10,1)})),Rn=En(j,"over").withOpacity((function(t,e){return Math.min(e/1e3,1)})),Fn=En(H,"both"),Mn=En(z,"both"),Pn=En(W,"over"),In=function(){function t(t){this.colormap=t,this.gl_elems=null}return t.applyShader=function(t){return xn+"\n"+t},t.prototype.setupShaderVariables=function(t,e){var n=function(t){for(var e=[],n=0;n<101;n++)e.push(n/100);var r=t.levels,o=r.length-1,i=r.map((function(t,e){return e/o})),a=r.map((function(t){return(t-r[0])/(r[o]-r[0])})),s=e.map((function(t){var e;for(e=0;!(a[e]<=t&&t<=a[e+1]);e++);var n=(t-a[e])/(a[e+1]-a[e]);return i[e]*(1-n)+i[e+1]*n}));return new gn(s)}(this.colormap),r=function(t){var e=document.createElement("canvas");e.width=t.colors.length,e.height=1;var n=e.getContext("2d");return t.colors.forEach((function(t,e){if(null===n)throw"Could not get rendering context for colormap image canvas";n.fillStyle=t.toRGBAHex(),n.fillRect(e,0,1,1)})),e}(this.colormap),o=M(t,!0),i=o.format,a=o.type,s=o.row_alignment,l={format:t.RGBA,type:t.UNSIGNED_BYTE,image:r,mag_filter:e},c=new B(t,l),u={format:i,type:a,width:n.length,height:1,image:new Uint16Array(n.buffer),mag_filter:t.LINEAR,row_alignment:s},f=new B(t,u);this.gl_elems={cmap_texture:c,cmap_nonlin_texture:f}},t.prototype.bindShaderVariables=function(t){if(null!==this.gl_elems){var e=this.colormap,n=null===e.underflow_color?[0,0,0,0]:e.underflow_color.toRGBATuple(),r=null===e.overflow_color?[0,0,0,0]:e.overflow_color.toRGBATuple();t.setUniforms({u_cmap_min:e.levels[0],u_cmap_max:e.levels[e.levels.length-1],u_n_index:101,u_underflow_color:n,u_overflow_color:r}),t.bindTextures({u_cmap_sampler:this.gl_elems.cmap_texture,u_cmap_nonlin_sampler:this.gl_elems.cmap_nonlin_texture})}},t}(),On=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Cn=n(319),Nn=n(559),Bn={"-":[1],"--":[1,1,1,1,0,0],":":[1,0],"-.":[1,1,1,0,1,0]},kn=function(){function t(t,e,n){var r,o=void 0===(n=void 0===n?{}:n).color?"#000000":n.color;this.color=yn.fromHex(o);var i=void 0===n.line_width?1:n.line_width,a=void 0===n.line_style?"-":n.line_style;this.width=i;var s=[];this.vertices=new C(t,e.vertices,3,t.TRIANGLE_STRIP),this.extrusion=new C(t,e.extrusion,2,t.TRIANGLE_STRIP),void 0!==e.offsets?(this.offset=new C(t,e.offsets,2,t.TRIANGLE_STRIP),this.scale=void 0===n.offset_scale?1:n.offset_scale,s.push("OFFSET")):(this.offset=null,this.scale=null),void 0!==e.zoom?(this.min_zoom=new C(t,e.zoom,1,t.TRIANGLE_STRIP),s.push("ZOOM")):this.min_zoom=null;var l=Nn;if(void 0!==e.data){s.push("DATA"),this.line_data=new C(t,e.data,1,t.TRIANGLE_STRIP);var c=void 0===n.cmap?new Tn([0,1],[o],{overflow_color:o,underflow_color:o}):n.cmap;this.cmap_gpu=new In(c),this.cmap_gpu.setupShaderVariables(t,t.NEAREST),l=In.applyShader(l)}else this.line_data=null,this.cmap_gpu=null;r=On(function(t,e){var n=Array.isArray(e)?e:Bn[e],r={format:S(t)?t.R8:t.LUMINANCE,type:t.UNSIGNED_BYTE,width:n.length,height:1,image:new Uint8Array(n.map((function(t){return t>0?255:0}))),mag_filter:t.NEAREST,row_alignment:1};return[n.length,new B(t,r)]}(t,a),2),this.n_dash=r[0],this.dash_texture=r[1],this.program=new G(t,Cn,l,{define:s})}return t.make=function(e,n,r){return o=this,i=void 0,s=function(){var o;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(i){switch(i.label){case 0:return[4,R.makePolyLines(n)];case 1:return o=i.sent(),[2,new t(e,o,r)]}}))},new((a=void 0)||(a=Promise))((function(t,e){function n(t){try{l(s.next(t))}catch(t){e(t)}}function r(t){try{l(s.throw(t))}catch(t){e(t)}}function l(e){var o;e.done?t(e.value):(o=e.value,o instanceof a?o:new a((function(t){t(o)}))).then(n,r)}l((s=s.apply(o,i||[])).next())}));var o,i,a,s},t.prototype.render=function(t,e,n,r,o,i){var a=On(n,2),s=a[0],l=a[1];e instanceof Float32Array&&(e=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],On(e),!1));var c={a_pos:this.vertices,a_extrusion:this.extrusion},u={u_matrix:e,u_line_width:this.width,u_map_width:s,u_map_height:l,u_map_bearing:o,u_offset:0,u_zoom:r,u_dash_pattern_length:this.n_dash},f={u_dash_sampler:this.dash_texture};null!==this.offset&&null!==this.scale&&(c.a_offset=this.offset,u.u_offset_scale=this.scale*(l/s)),null!==this.min_zoom&&(c.a_min_zoom=this.min_zoom),null!==this.line_data?c.a_data=this.line_data:u.u_color=this.color.toRGBATuple(),this.program.use(c,u,f),null!==this.cmap_gpu&&this.cmap_gpu.bindShaderVariables(this.program),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),this.program.draw(),this.program.setUniforms({u_offset:-2}),this.program.draw(),this.program.setUniforms({u_offset:-1}),this.program.draw(),this.program.setUniforms({u_offset:1}),this.program.draw()},t}(),Gn=n(614),Ln=n.n(Gn),Dn=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},Un=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},jn=n(207),Hn=n(286),zn=new E((function(t){return new G(t,jn,Hn)}));function Wn(t){var e=t.filter((function(t){return void 0!==t.data})),n=[],r=function(t){let e=0,n=0;for(const r of t)e+=r.w*r.h,n=Math.max(n,r.w);t.sort(((t,e)=>e.h-t.h));const r=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),n),h:1/0}];let o=0,i=0;for(const e of t)for(let t=r.length-1;t>=0;t--){const n=r[t];if(!(e.w>n.w||e.h>n.h)){if(e.x=n.x,e.y=n.y,i=Math.max(i,e.y+e.h),o=Math.max(o,e.x+e.w),e.w===n.w&&e.h===n.h){const e=r.pop();t<r.length&&(r[t]=e)}else e.h===n.h?(n.x+=e.w,n.w-=e.w):e.w===n.w?(n.y+=e.h,n.h-=e.h):(r.push({x:n.x+e.w,y:n.y,w:n.w-e.w,h:e.h}),n.y+=e.h,n.h-=e.h);break}}return{w:o,h:i,fill:e/(o*i)||0}}(e.map((function(t){var e={x:0,y:0,w:t.width,h:t.height};return n.push({glyph:t,bin:e}),e}))),o=r.w,i=r.h,a=new Uint8Array(o*i),s={};n.forEach((function(t){var e=t.bin,n=t.glyph;if(void 0===e.x||void 0===e.y)throw"Potpack couldn't pack this pot, I guess?";s[n.id]={id:n.id,width:n.width,height:n.height,left:n.left,top:n.top,atlas_i:e.x,atlas_j:e.y,advance:n.advance};for(var r=0;r<n.width;r++)for(var i=0;i<n.height;i++){var l=r+n.width*i,c=r+e.x+o*(i+e.y);a[c]=n.data[l]}}));var l=s["M".charCodeAt(0)],c=l.height-l.top,u=-l.top;return{atlas:a,atlas_width:o,atlas_height:i,baseline:c,top:u,glyph_info:s}}function Vn(t){return Dn(this,void 0,void 0,(function(){var e,n;return Un(this,(function(r){switch(r.label){case 0:return[4,fetch(t)];case 1:return[4,r.sent().blob()];case 2:return[4,r.sent().arrayBuffer()];case 3:return e=r.sent(),o=new Uint8Array(e),i=function(t,e,n){if(void 0!==n)switch(t){case 1:e.id=n.readVarint();break;case 2:e.data=n.readBytes();break;case 3:e.width=n.readVarint()+6;break;case 4:e.height=n.readVarint()+6;break;case 5:e.left=n.readSVarint();break;case 6:e.top=n.readSVarint();break;case 7:e.advance=n.readVarint()}},a=function(t,e,n){if(void 0!==e&&void 0!==n&&3==t){var r=n.readMessage(i,{});e.push(r)}},n=new(Ln())(o).readFields((function(t,e,n){void 0!==n&&1==t&&n.readMessage(a,e)}),[]),[2,Wn(n)]}var o,i,a}))}))}var $n,Yn={horizontal_align:"left",vertical_align:"baseline",font_size:12,text_color:new yn([0,0,0,1]),halo_color:new yn([0,0,0,1]),halo:!1},Xn=function(){function t(t,e,n,r){var o=this;this.program=zn.getValue(t),this.opts=A(r,Yn);var i={format:S(t)?t.R8:t.LUMINANCE,type:t.UNSIGNED_BYTE,width:n.atlas_width,height:n.atlas_height,image:n.atlas,row_alignment:1,mag_filter:t.LINEAR};this.texture=new B(t,i);var a=6*e.map((function(t){return t.text.length})).reduce((function(t,e){return t+e}),0),s=new Float32Array(3*a),l=new Float32Array(2*a),c=new Float32Array(2*a),u=0,f=0,h=0;e.forEach((function(t){for(var e=t.lat,r=t.lon,i=t.text,a=void 0===t.min_zoom?0:t.min_zoom,d=new I(r,e).toMercatorCoord(),p=d.x,_=d.y,m=0,g=f,v=0;v<i.length;v++){var b=i.charCodeAt(v),y=n.glyph_info[b];void 0!==y?(m+=y.left,s[u++]=p,s[u++]=_,s[u++]=a,s[u++]=p,s[u++]=_,s[u++]=a,s[u++]=p,s[u++]=_,s[u++]=a,s[u++]=p,s[u++]=_,s[u++]=a,s[u++]=p,s[u++]=_,s[u++]=a,s[u++]=p,s[u++]=_,s[u++]=a,l[f++]=m,l[f++]=n.baseline+y.top-y.height,l[f++]=m,l[f++]=n.baseline+y.top-y.height,l[f++]=m+y.width,l[f++]=n.baseline+y.top-y.height,l[f++]=m,l[f++]=n.baseline+y.top,l[f++]=m+y.width,l[f++]=n.baseline+y.top,l[f++]=m+y.width,l[f++]=n.baseline+y.top,c[h++]=y.atlas_i/n.atlas_width,c[h++]=(y.atlas_j+y.height)/n.atlas_height,c[h++]=y.atlas_i/n.atlas_width,c[h++]=(y.atlas_j+y.height)/n.atlas_height,c[h++]=(y.atlas_i+y.width)/n.atlas_width,c[h++]=(y.atlas_j+y.height)/n.atlas_height,c[h++]=y.atlas_i/n.atlas_width,c[h++]=y.atlas_j/n.atlas_height,c[h++]=(y.atlas_i+y.width)/n.atlas_width,c[h++]=y.atlas_j/n.atlas_height,c[h++]=(y.atlas_i+y.width)/n.atlas_width,c[h++]=y.atlas_j/n.atlas_height,m+=y.advance-y.left):m+=7}if("center"==o.opts.horizontal_align)for(v=g;v<g+12*i.length;v+=2)l[v]-=m/2;else if("right"==o.opts.horizontal_align)for(v=g;v<g+12*i.length;v+=2)l[v]-=m;if("top"==o.opts.vertical_align)for(v=g+1;v<g+12*i.length;v+=2)l[v]-=n.baseline-n.top;else if("middle"==o.opts.vertical_align)for(v=g+1;v<g+12*i.length;v+=2)l[v]-=(n.baseline-n.top)/2})),this.anchors=new C(t,s,3,t.TRIANGLE_STRIP),this.offsets=new C(t,l,2,t.TRIANGLE_STRIP),this.texcoords=new C(t,c,2,t.TRIANGLE_STRIP)}return t.make=function(e,n,r,o){return Dn(this,void 0,void 0,(function(){var i;return Un(this,(function(a){switch(a.label){case 0:return[4,Vn(r)];case 1:return i=a.sent(),[2,new t(e,n,i,o)]}}))}))},t.prototype.render=function(t,e,n,r){var o=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}(n,2),i={u_matrix:e,u_map_width:o[0],u_map_height:o[1],u_map_zoom:r,u_font_size:this.opts.font_size,u_text_color:this.opts.text_color.toRGBATuple(),u_halo_color:this.opts.halo_color.toRGBATuple(),u_offset:0};i.u_is_halo=this.opts.halo?1:0,this.program.use({a_pos:this.anchors,a_offset:this.offsets,a_tex_coord:this.texcoords},i,{u_sdf_sampler:this.texture}),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),this.program.draw(),this.opts.halo&&(this.program.setUniforms({u_is_halo:0}),this.program.draw()),this.program.setUniforms({u_offset:-2,u_is_halo:this.opts.halo?1:0}),this.program.draw(),this.opts.halo&&(this.program.setUniforms({u_is_halo:0}),this.program.draw()),this.program.setUniforms({u_offset:-1,u_is_halo:this.opts.halo?1:0}),this.program.draw(),this.opts.halo&&(this.program.setUniforms({u_is_halo:0}),this.program.draw()),this.program.setUniforms({u_offset:1,u_is_halo:this.opts.halo?1:0}),this.program.draw(),this.opts.halo&&(this.program.setUniforms({u_is_halo:0}),this.program.draw())},t}(),Jn=n(526),Zn=($n=function(t,e){return $n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},$n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}$n(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),qn=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},Kn=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},Qn=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},tr=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},er={color:"#000000",cmap:null,interval:1,levels:null,line_width:2,line_style:"-"},nr=function(t){function e(e,n){var r=t.call(this)||this;return r.field=e,r.opts=A(n,er),r.gl_elems=null,r.contours=null,r}return Zn(e,t),e.prototype.updateField=function(t){return qn(this,void 0,void 0,(function(){var e,n,r,o,i=this;return Kn(this,(function(a){switch(a.label){case 0:return this.field=t,null===this.gl_elems?[2]:(e=this.gl_elems.gl,[4,this.getContours()]);case 1:return n=a.sent(),r=[],Object.entries(n).forEach((function(t){var e,n,o=Qn(t,2),a=o[0],s=o[1],l=parseFloat(a),c=(e=i.opts.line_style)in Bn||Array.isArray(e)&&e.length>0&&e.map((function(t){return"number"==typeof t})).reduce((function(t,e){return t&&e}),!0)?i.opts.line_style:i.opts.line_style(l),u="number"==typeof i.opts.line_width?i.opts.line_width:i.opts.line_width(l),f=s.map((function(t){var e={vertices:t};return null!==i.opts.cmap&&(e.data=t.map((function(){return l}))),e})),h=r.filter((function(t){return t.line_style==c&&t.line_width==u}));0==h.length?(n={data:[],line_width:u,line_style:c},r.push(n)):n=h[0],n.data=n.data.concat(f)})),o=r.map((function(t){return qn(i,void 0,void 0,(function(){var n;return Kn(this,(function(r){switch(r.label){case 0:return n={line_width:t.line_width,line_style:t.line_style},null!==this.opts.cmap?n.cmap=this.opts.cmap:n.color=this.opts.color,[4,kn.make(e,t.data,n)];case 1:return[2,r.sent()]}}))}))})),Promise.all(o).then((function(t){null!==i.gl_elems&&(i.contours=t,i.gl_elems.map.triggerRepaint())})),[2]}}))}))},e.prototype.getContours=function(){return qn(this,void 0,void 0,(function(){var t;return Kn(this,(function(e){switch(e.label){case 0:return t=null===this.opts.levels?void 0:this.opts.levels,[4,this.field.getContours({interval:this.opts.interval,levels:t})];case 1:return[2,e.sent()]}}))}))},e.prototype.onAdd=function(t,e){return qn(this,void 0,void 0,(function(){return Kn(this,(function(n){switch(n.label){case 0:return this.gl_elems={gl:e,map:t},[4,this.updateField(this.field)];case 1:return n.sent(),[2]}}))}))},e.prototype.render=function(t,e){if(null!==this.gl_elems&&null!==this.contours){var n=this.gl_elems;e instanceof Float32Array&&(e=tr([],Qn(e),!1));var r=n.map.getZoom(),o=n.map.getCanvas().width,i=n.map.getCanvas().height,a=n.map.getBearing(),s=n.map.getPitch();this.contours.forEach((function(n){return n.render(t,e,[o,i],r,a,s)}))}},e}(F),rr={n_decimal_places:0,font_face:"Trebuchet MS",font_size:12,font_url_template:"",text_color:"#000000",halo_color:"#000000",halo:!1},or=function(t){function e(e,n){var r=t.call(this)||this;return r.opts=A(n,rr),r.contours=e,r.text_collection=null,r.gl_elems=null,r}return Zn(e,t),e.prototype.updateField=function(){return qn(this,void 0,void 0,(function(){var t,e,n,r,o,i,a,s,l,c,u,f,h,d,p,_,m,g,v,b,y,w,x,T,E,A,S,R,F,M,P,O,C,N,B,k,G,L;return Kn(this,(function(D){switch(D.label){case 0:if(null===this.gl_elems)return[2];if(t=this.gl_elems.map,e=this.gl_elems.gl,n=t.getStyle(),void 0===(r=""==this.opts.font_url_template?n.glyphs:this.opts.font_url_template))throw"The map style doesn't have any glyph information. Please pass the font_url_template option to ContourLabels";return o=r.replace("{range}","0-255").replace("{fontstack}",this.opts.font_face),i=[],[4,this.contours.getContours()];case 1:if(a=D.sent(),(s=Object.keys(a).map(parseFloat)).sort((function(t,e){return t-e})),l=t.getMaxZoom(),c=.01*Math.pow(2,7-l),u=null,f=null,h=null,d=null,Object.entries(a).forEach((function(t){var e=Qn(t,2),n=e[0],r=e[1],o=parseFloat(n)-s[0],a=n.toString();r.forEach((function(t){var e=t.map((function(t){var e=(new(I.bind.apply(I,tr([void 0],Qn(t),!1)))).toMercatorCoord();return[e.x,e.y]})),n=[];e.forEach((function(t,r){if(0==r)n.push(0);else{var o=e[r-1],i=Math.hypot(o[0]-t[0],o[1]-t[1]);n.push(n[r-1]+i)}}));for(var r=0,s=1;s<n.length;s++){var p=c*(r+o/2%1);if(n[s-1]<=p&&p<n[s]){var _=t[s-1],m=t[s],g=(p-n[s-1])/(n[s]-n[s-1]),v=(1-g)*_[0]+g*m[0],b=(1-g)*_[1]+g*m[1];(null===h||v<h)&&(h=v),(null===d||v>d)&&(d=v),(null===u||b<u)&&(u=b),(null===f||b>f)&&(f=b),i.push({lon:v,lat:b,min_zoom:l,text:a}),r++}}}))})),p=new Jn.kdTree(i,(function(t,e){return Math.hypot(t.lon-e.lon,t.lat-e.lat)}),["lon","lat"]),null===h||null===u||null===d||null===f)return[2];for(_=new I(h,u).toMercatorCoord(),m=_.x,g=_.y,v=new I(d,f).toMercatorCoord(),b=v.x,y=v.y,w=b-m,x=g-y,T=Math.round(4*w/c),E=Math.round(4*x/c),A=[],S=[],M=0;M<T;M++)A.push(m+M/T*w);for(P=0;P<E;P++)S.push(y+P/E*x);for(R=1,F=l-1;F>=0;F--){for(M=0;M<T;M+=R)for(P=0;P<E;P+=R)O=A[M],C=S[P],N=I.fromMercatorCoord(O,C),B=Qn(p.nearest({lon:N.lng,lat:N.lat,min_zoom:0,text:""},1)[0],2),k=B[0],B[1],k.min_zoom=F;R*=2}return G={horizontal_align:"center",vertical_align:"middle",font_size:this.opts.font_size,halo:this.opts.halo,text_color:yn.fromHex(this.opts.text_color),halo_color:yn.fromHex(this.opts.halo_color)},L=this,[4,Xn.make(e,i,o,G)];case 2:return L.text_collection=D.sent(),t.triggerRepaint(),[2]}}))}))},e.prototype.onAdd=function(t,e){return qn(this,void 0,void 0,(function(){return Kn(this,(function(n){return this.gl_elems={gl:e,map:t},this.updateField(),[2]}))}))},e.prototype.render=function(t,e){if(null!==this.gl_elems&&null!==this.text_collection){var n=this.gl_elems,r=n.map.getCanvas().width,o=n.map.getCanvas().height,i=n.map.getZoom();this.text_collection.render(t,e,[r,o],i)}},e}(F);const ir=nr;var ar=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),sr=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},lr=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},cr=n(370),ur=n(824),fr={cmap:new Tn([0,1],["#000000"],{overflow_color:"#000000",underflow_color:"#000000"}),opacity:1},hr=function(t){function e(e,n){var r=t.call(this)||this;return r.field=e,r.opts=A(n,fr),r.cmap_gpu=new In(r.opts.cmap),r.gl_elems=null,r.fill_texture=null,r.image_mag_filter=null,r.cmap_mag_filter=null,r}return ar(e,t),e.prototype.updateField=function(t){return sr(this,void 0,void 0,(function(){var e,n,r,o,i,a,s,l;return lr(this,(function(c){if(this.field=t,null===this.image_mag_filter||null===this.cmap_mag_filter)throw"Implement magnification filtes in a subclass";return null===this.gl_elems||(e=this.gl_elems.gl,n=this.gl_elems.map,r=this.field.getTextureData(),o=M(e,!(r instanceof Float32Array)),i=o.format,a=o.type,s=o.row_alignment,l={format:i,type:a,width:this.field.grid.ni,height:this.field.grid.nj,image:r,mag_filter:this.image_mag_filter,row_alignment:s},null===this.fill_texture?this.fill_texture=new B(e,l):this.fill_texture.setImageData(l),n.triggerRepaint()),[2]}))}))},e.prototype.onAdd=function(t,e){return sr(this,void 0,void 0,(function(){var n,r,o,i;return lr(this,(function(a){switch(a.label){case 0:if(null===this.image_mag_filter||null===this.cmap_mag_filter)throw"Implement magnification filtes in a subclass";return n=new G(e,cr,In.applyShader(ur)),[4,this.field.grid.getWGLBuffers(e)];case 1:return r=a.sent(),o=r.vertices,i=r.texcoords,this.cmap_gpu.setupShaderVariables(e,this.cmap_mag_filter),this.gl_elems={gl:e,map:t,program:n,vertices:o,texcoords:i},this.updateField(this.field),[2]}}))}))},e.prototype.render=function(t,e){if(null!==this.gl_elems&&null!==this.fill_texture){var n=this.gl_elems;e instanceof Float32Array&&(e=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}(e),!1)),n.program.use({a_pos:n.vertices,a_tex_coord:n.texcoords},{u_matrix:e,u_opacity:this.opts.opacity,u_offset:0},{u_fill_sampler:this.fill_texture}),this.cmap_gpu.bindShaderVariables(n.program),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),n.program.draw(),n.program.setUniforms({u_offset:-2}),n.program.draw(),n.program.setUniforms({u_offset:-1}),n.program.draw(),n.program.setUniforms({u_offset:1}),n.program.draw()}},e}(F),dr=function(t){function e(e,n){return t.call(this,e,n)||this}return ar(e,t),e.prototype.updateField=function(e){return sr(this,void 0,void 0,(function(){return lr(this,(function(n){switch(n.label){case 0:return[4,t.prototype.updateField.call(this,e)];case 1:return n.sent(),[2]}}))}))},e.prototype.onAdd=function(e,n){return sr(this,void 0,void 0,(function(){return lr(this,(function(r){switch(r.label){case 0:return this.image_mag_filter=n.NEAREST,this.cmap_mag_filter=n.LINEAR,[4,t.prototype.onAdd.call(this,e,n)];case 1:return r.sent(),[2]}}))}))},e.prototype.render=function(e,n){t.prototype.render.call(this,e,n)},e}(hr),pr=function(t){function e(e,n){return t.call(this,e,n)||this}return ar(e,t),e.prototype.updateField=function(e){return sr(this,void 0,void 0,(function(){return lr(this,(function(n){switch(n.label){case 0:return[4,t.prototype.updateField.call(this,e)];case 1:return n.sent(),[2]}}))}))},e.prototype.onAdd=function(e,n){return sr(this,void 0,void 0,(function(){return lr(this,(function(r){switch(r.label){case 0:return this.image_mag_filter=n.LINEAR,this.cmap_mag_filter=n.NEAREST,[4,t.prototype.onAdd.call(this,e,n)];case 1:return r.sent(),[2]}}))}))},e.prototype.render=function(e,n){t.prototype.render.call(this,e,n)},e}(hr),_r=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},mr=n(955),gr=n(49),vr=function(){function t(t,e,n,r,o,i,a){a=void 0===a?{}:a,this.color=void 0===a.color?new yn([0,0,0,1]):a.color,this.cmap=void 0===a.cmap?null:a.cmap,this.field=t,this.spec=o,this.size_multiplier=i,this.thin_fac=e,this.max_zoom=n,this.billboard_image=r,this.gl_elems=null,this.wind_textures=null;var s=Math.log2(e),l=Math.max(s+1-n,0);this.trim_inaccessible=Math.pow(2,l),this.show_field=!0}return t.prototype.updateField=function(t){if(this.field=t,null!==this.gl_elems){var e=this.gl_elems.gl,n=this.field.getThinnedField(this.trim_inaccessible,this.trim_inaccessible),r=n.getTextureData(),o=r.u,i=r.v;this.show_field=null!==o;var a=M(e,!(o instanceof Float32Array)),s=a.format,l=a.type,c=a.row_alignment,u={format:s,type:l,width:n.grid.ni,height:n.grid.nj,image:o,mag_filter:e.NEAREST,row_alignment:c},f={format:s,type:l,width:n.grid.ni,height:n.grid.nj,image:i,mag_filter:e.NEAREST,row_alignment:c};null===this.wind_textures?this.wind_textures={u:new B(e,u),v:new B(e,f)}:(this.wind_textures.u.setImageData(u),this.wind_textures.v.setImageData(f))}},t.prototype.setup=function(t){return e=this,n=void 0,o=function(){var e,n,r,o,i,a,s,l,c,u;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(f){switch(f.label){case 0:return[4,(e=this.field.getThinnedField(this.trim_inaccessible,this.trim_inaccessible)).grid.getWGLBillboardBuffers(t,this.thin_fac/this.trim_inaccessible,this.max_zoom)];case 1:return n=f.sent(),r=n.vertices,o=n.texcoords,i=e.grid.getVectorRotationTexture(t).rotation,a=new B(t,this.billboard_image),s=[],l=gr,c=null,null!==this.cmap&&(l=In.applyShader(l),(c=new In(this.cmap)).setupShaderVariables(t,t.NEAREST),s.push("COLORMAP")),u=new G(t,mr,l,{define:s}),this.gl_elems={gl:t,program:u,vertices:r,texcoords:o,texture:a,proj_rot_texture:i,cmap_gpu:c},[2]}}))},new((r=void 0)||(r=Promise))((function(t,i){function a(t){try{l(o.next(t))}catch(t){i(t)}}function s(t){try{l(o.throw(t))}catch(t){i(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(a,s)}l((o=o.apply(e,n||[])).next())}));var e,n,r,o},t.prototype.render=function(t,e,n,r,o,i){var a=_r(n,2),s=a[0],l=a[1];if(null!==this.gl_elems&&null!==this.wind_textures&&this.show_field){e instanceof Float32Array&&(e=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],_r(e),!1));var c=this.gl_elems,u=this.spec.BB_HEIGHT*(l/s)*this.size_multiplier,f=this.spec.BB_WIDTH/this.spec.BB_TEX_WIDTH,h=this.spec.BB_HEIGHT/this.spec.BB_TEX_HEIGHT;c.program.use({a_pos:c.vertices,a_tex_coord:c.texcoords},{u_bb_size:u,u_bb_width:f,u_bb_height:h,u_bb_mag_bin_size:this.spec.BB_MAG_BIN_SIZE,u_bb_mag_wrap:this.spec.BB_MAG_WRAP,u_offset:0,u_matrix:e,u_map_aspect:l/s,u_zoom:r,u_map_bearing:o},{u_sampler:c.texture,u_u_sampler:this.wind_textures.u,u_v_sampler:this.wind_textures.v,u_rot_sampler:c.proj_rot_texture}),null!==c.cmap_gpu?c.cmap_gpu.bindShaderVariables(c.program):c.program.setUniforms({u_bb_color:this.color.toRGBATuple()}),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),c.program.draw(),c.program.setUniforms({u_offset:-2}),c.program.draw(),c.program.setUniforms({u_offset:-1}),c.program.draw(),c.program.setUniforms({u_offset:1}),c.program.draw()}},t}(),br=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yr=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},wr=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},xr={BB_WIDTH:85,BB_HEIGHT:256,BB_TEX_WIDTH:1024,BB_TEX_HEIGHT:1024,BB_MAG_MAX:235,BB_MAG_WRAP:60,BB_MAG_BIN_SIZE:5},Tr={color:"#000000",cmap:null,line_width:2,barb_size_multiplier:1,thin_fac:1};const Er=function(t){function e(e,n){var r=t.call(this)||this;return r.fields=e,r.opts=A(n,Tr),r.color=yn.fromHex(r.opts.color),r.barb_texture=function(t,e){var n=document.createElement("canvas");function r(e,n,r,o){var i=t.BB_WIDTH/2-4,a=i/2;if(o<2.5)e.beginPath(),e.arc(n,r,i/2,0,2*Math.PI),e.stroke();else{var s=0,l=o,c=0,u=Math.floor((l+2.5)/50);c+=u*i/2+a+(u-1)*a/2,l-=50*u;var f=Math.floor((l+2.5)/10);c+=f*a,l-=10*f,c+=Math.floor((l+2.5)/5)*a,o<7.5&&(c+=a),c=Math.max(120,c),e.beginPath(),e.moveTo(n,r),e.lineTo(n,r+c),l=o,s=r+c;for(var h=!1,d=!0;l>47.5;)h&&(s+=a/2),d||e.moveTo(n,s),e.lineTo(n-i,s),e.lineTo(n,s-i/2),s-=i/2+a,l-=50,h=!0,d=!1;for(;l>7.5;)d||e.moveTo(n,s),e.lineTo(n-i,s+i/2),s-=a,l-=10,d=!1;for(o<7.5&&(s-=a);l>2.5;)e.moveTo(n,s),e.lineTo(n-i/2,s+i/4),l-=5;e.stroke()}}n.width=t.BB_TEX_WIDTH,n.height=t.BB_TEX_HEIGHT;var o=n.getContext("2d");if(null===o)throw"Could not get rendering context for the wind barb canvas";o.lineWidth=e,o.miterLimit=4;for(var i=0;i<=t.BB_MAG_MAX;i+=t.BB_MAG_BIN_SIZE)r(o,i%t.BB_MAG_WRAP/t.BB_MAG_BIN_SIZE*t.BB_WIDTH+t.BB_WIDTH/2,Math.floor(i/t.BB_MAG_WRAP)*t.BB_HEIGHT+t.BB_WIDTH/2,i);return n}(xr,r.opts.line_width/r.opts.barb_size_multiplier*4),r.gl_elems=null,r}return br(e,t),e.prototype.updateField=function(t){return yr(this,void 0,void 0,(function(){return wr(this,(function(e){return this.fields=t,null===this.gl_elems||(this.gl_elems.barb_billboards.updateField(t),this.gl_elems.map.triggerRepaint()),[2]}))}))},e.prototype.onAdd=function(t,e){return yr(this,void 0,void 0,(function(){var n,r,o,i;return wr(this,(function(a){switch(a.label){case 0:return e.getExtension("OES_texture_float"),e.getExtension("OES_texture_float_linear"),n=t.getMaxZoom(),r={format:e.RGBA,type:e.UNSIGNED_BYTE,image:this.barb_texture,mag_filter:e.NEAREST},o=null===this.opts.cmap?void 0:this.opts.cmap,[4,(i=new vr(this.fields,this.opts.thin_fac,n,r,xr,.1*this.opts.barb_size_multiplier,{color:this.color,cmap:o})).setup(e)];case 1:return a.sent(),this.gl_elems={map:t,barb_billboards:i},this.updateField(this.fields),[2]}}))}))},e.prototype.render=function(t,e){if(null!==this.gl_elems){var n=this.gl_elems,r=n.map.getZoom(),o=n.map.getCanvas().width,i=n.map.getCanvas().height,a=n.map.getBearing(),s=n.map.getPitch();n.barb_billboards.render(t,e,[o,i],r,a,s)}},e}(F);var Ar=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Sr=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},Rr=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},Fr=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Mr=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},Pr=n(431),Ir=n(714),Or={colors:["#000000"],opacity:1};const Cr=function(t){function e(e,n){var r=t.call(this)||this;return r.field=e,r.opts=A(n,Or),r.color_components=Mr([],Fr(r.opts.colors),!1).reverse().map((function(t){return yn.fromHex(t).toRGBATuple()})).flat(),r.gl_elems=null,r.fill_texture=null,r}return Ar(e,t),e.prototype.updateField=function(t){return Sr(this,void 0,void 0,(function(){var e,n,r,o,i,a,s;return Rr(this,(function(l){return this.field=t,null===this.gl_elems||((e=this.gl_elems.gl).pixelStorei(e.UNPACK_ALIGNMENT,2),n=this.field.getTextureData(),r=M(e,!(n instanceof Float32Array)),o=r.format,i=r.type,a=r.row_alignment,s={format:o,type:i,width:this.field.grid.ni,height:this.field.grid.nj,image:n,mag_filter:e.NEAREST,row_alignment:a},null===this.fill_texture?this.fill_texture=new B(e,s):this.fill_texture.setImageData(s)),[2]}))}))},e.prototype.onAdd=function(t,e){return Sr(this,void 0,void 0,(function(){var t,n,r,o,i,a;return Rr(this,(function(s){switch(s.label){case 0:return e.getExtension("OES_texture_float"),t=new G(e,Pr,Ir),[4,this.field.grid.getWGLBuffers(e)];case 1:return n=s.sent(),r=n.vertices,o=n.texcoords,i=r,a=o,this.gl_elems={gl:e,program:t,vertices:i,texcoords:a},this.updateField(this.field),[2]}}))}))},e.prototype.render=function(t,e){if(null!==this.gl_elems&&null!==this.fill_texture){var n=this.gl_elems;e instanceof Float32Array&&(e=Mr([],Fr(e),!1)),n.program.use({a_pos:n.vertices,a_tex_coord:n.texcoords},{u_matrix:e,u_opacity:this.opts.opacity,u_colors:this.color_components,u_num_colors:this.opts.colors.length,u_offset:0},{u_fill_sampler:this.fill_texture}),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),n.program.draw(),n.program.setUniforms({u_offset:-2}),n.program.draw(),n.program.setUniforms({u_offset:-1}),n.program.draw(),n.program.setUniforms({u_offset:1}),n.program.draw()}},e}(F);var Nr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Br=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},kr=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},Gr=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Lr=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},Dr={BB_WIDTH:256,BB_HEIGHT:256,BB_TEX_WIDTH:256,BB_TEX_HEIGHT:256,BB_MAG_MAX:1e3,BB_MAG_WRAP:1e3,BB_MAG_BIN_SIZE:1e3},Ur={bgcolor:"#000000",thin_fac:1,hodo_line_width:2.5,background_line_width:1.5,height_cmap:new Tn([0,1,3,6,9],["#ffffcc","#a1dab4","#41b6c4","#225ea8"])};const jr=function(t){function e(e,n){var r=t.call(this)||this;return r.profile_field=e,r.opts=A(n,Ur),r.hodo_bg_texture=function(t){var e=document.createElement("canvas");e.width=Dr.BB_TEX_WIDTH,e.height=Dr.BB_TEX_HEIGHT;var n=e.getContext("2d");if(null===n)throw"Could not get rendering context for the hodograph background canvas";n.lineWidth=t;for(var r=Dr.BB_TEX_WIDTH/4;r<=Dr.BB_TEX_WIDTH/2;r+=Dr.BB_TEX_WIDTH/4)n.beginPath(),n.arc(Dr.BB_TEX_WIDTH/2,Dr.BB_TEX_WIDTH/2,r-t/2,0,2*Math.PI),n.stroke();var o=Dr.BB_TEX_WIDTH/2,i=Dr.BB_TEX_WIDTH/2;return n.beginPath(),n.moveTo(o,i),n.lineTo(o+10,i+20),n.lineTo(o-10,i+20),n.lineTo(o,i),n.fill(),e}(2.5*r.opts.background_line_width),r.hodo_scale=(Dr.BB_TEX_WIDTH-r.opts.background_line_width/2)/(40*Dr.BB_TEX_WIDTH),r.bg_size=140,r.gl_elems=null,r.line_elems=null,r}return Nr(e,t),e.prototype.updateField=function(t){return Br(this,void 0,void 0,(function(){var e,n,r,o,i,a,s=this;return kr(this,(function(l){switch(l.label){case 0:return this.profile_field=t,null===this.gl_elems?[2]:(e=this.gl_elems.gl,this.gl_elems.bg_billboard.updateField(t.getStormMotionGrid()),n=this.profile_field.profiles,r=n.map((function(t){var e=x(t.jlat,t.ilon,s.opts.thin_fac);return{offsets:Lr([],Gr(t.u),!1).map((function(e,n){return[e-t.smu,t.v[n]-t.smv]})),vertices:Lr([],Gr(t.u),!1).map((function(e){return[t.lon,t.lat]})),zoom:e,data:Lr([],Gr(t.z),!1)}})),[4,kn.make(e,r,{line_width:this.opts.hodo_line_width,cmap:this.opts.height_cmap,offset_scale:this.hodo_scale*this.bg_size})]);case 1:return o=l.sent(),i=n.map((function(t){var e=x(t.jlat,t.ilon,s.opts.thin_fac),n=Math.hypot(t.smu,t.smv),r=Math.PI/2-Math.atan2(-t.smv,-t.smu);return{offsets:[[2*Math.sin(r),2*Math.cos(r)],[n*Math.sin(r),n*Math.cos(r)]],vertices:[[t.lon,t.lat],[t.lon,t.lat]],zoom:e}})),[4,kn.make(e,i,{line_width:this.opts.background_line_width,color:this.opts.bgcolor,offset_scale:this.hodo_scale*this.bg_size})];case 2:return a=l.sent(),this.line_elems={hodo_line:o,sm_line:a},[2]}}))}))},e.prototype.onAdd=function(t,e){return Br(this,void 0,void 0,(function(){var n,r,o;return kr(this,(function(i){switch(i.label){case 0:return n={format:e.RGBA,type:e.UNSIGNED_BYTE,image:this.hodo_bg_texture,mag_filter:e.NEAREST},r=t.getMaxZoom(),[4,(o=new vr(this.profile_field.getStormMotionGrid(),this.opts.thin_fac,r,n,Dr,.004*this.bg_size,{color:yn.fromHex(this.opts.bgcolor)})).setup(e)];case 1:return i.sent(),this.gl_elems={gl:e,map:t,bg_billboard:o},this.updateField(this.profile_field),[2]}}))}))},e.prototype.render=function(t,e){if(null!==this.gl_elems&&null!==this.line_elems){var n=this.gl_elems,r=this.line_elems,o=n.map.getZoom(),i=n.map.getCanvas().width,a=n.map.getCanvas().height,s=n.map.getBearing(),l=n.map.getPitch();r.hodo_line.render(t,e,[i,a],o,s,l),r.sm_line.render(t,e,[i,a],o,s,s),n.bg_billboard.render(t,e,[i,a],o,s,l)}},e}(F);var Hr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),zr=function(){function t(t){this.type="custom",this.id=t,this.map=null}return t.prototype.repaint=function(){null!==this.map&&this.map.triggerRepaint()},t}(),Wr=function(t){function e(e,n){var r=t.call(this,e)||this;return r.field=n,r}return Hr(e,t),e.prototype.onAdd=function(t,e){return n=this,r=void 0,i=function(){return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(n){switch(n.label){case 0:return this.map=t,[4,this.field.onAdd(t,e)];case 1:return n.sent(),[2]}}))},new((o=void 0)||(o=Promise))((function(t,e){function a(t){try{l(i.next(t))}catch(t){e(t)}}function s(t){try{l(i.throw(t))}catch(t){e(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(a,s)}l((i=i.apply(n,r||[])).next())}));var n,r,o,i},e.prototype.render=function(t,e){this.field.render(t,e)},e}(zr),Vr=function(t){function e(e){var n=t.call(this,e)||this;return n.fields={},n.field_key=null,n.map=null,n.gl=null,n}return Hr(e,t),e.prototype.onAdd=function(t,e){var n=this;this.map=t,this.gl=e,Object.values(this.fields).forEach((function(r){r.onAdd(t,e).then((function(t){n.repaint()}))})),this.repaint()},e.prototype.render=function(t,e){null!==this.map&&null!==this.gl&&null!==this.field_key&&this.fields.hasOwnProperty(this.field_key)&&null!==this.fields[this.field_key]&&this.fields[this.field_key].render(t,e)},e.prototype.setActiveKey=function(t){this.field_key,this.field_key=t,this.repaint()},e.prototype.getKeys=function(){return Object.keys(this.fields)},e.prototype.addField=function(t,e){var n=this;this.field_key,null!==this.map&&null!==this.gl&&null!==t&&t.onAdd(this.map,this.gl).then((function(t){n.repaint()})),this.fields[e]=t,null===this.field_key&&(this.field_key=e)},e}(zr),$r=function(){return $r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},$r.apply(this,arguments)},Yr=function(t,e,n){var r=document.createElementNS("http://www.w3.org/2000/svg",t);return void 0!==e&&Object.entries(e).forEach((function(t){var e=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}(t,2),n=e[0],o=e[1];r.setAttribute(n,o.toString())})),void 0!==n&&n.appendChild(r),r};function Xr(t,e){var n=e.label||"",r=e.ticks||t.levels,o=e.orientation||"vertical",i=e.fontface||"sans-serif",a=e.ticklabelsize||12,s=e.tick_direction||("vertical"==o?"left":"bottom");if("vertical"==o&&("top"==s||"bottom"==s)||"horizontal"==o&&("left"==s||"right"==s))throw"tick_direction of '".concat(s," doesn't match an orientation of ").concat(o);var l,c,u,f,h,d,p,_,m,g,v,b=function(t){return t.toString().length},y=b(r[0]),w=b(r[r.length-1]),x=null!==t.underflow_color||null!==t.overflow_color,T=600,E=T/9,A=Math.max("horizontal"==o?6*Math.max(y,w):8,x?E/(2*Math.sqrt(3)):0);"vertical"==o?(l=T,c=E,p=(u="left"==s?53.66666666666667:3)+(h=10),m=u+h/2,_=(f=A)+(d=T-2*A),g=null===t.underflow_color?_:_+E/(2*Math.sqrt(3)),v=null===t.overflow_color?f:f-E/(2*Math.sqrt(3))):(c=T,l=E-6,p=(u=A)+(h=T-2*A),m=(f="bottom"==s?3:47.66666666666667)+(d=10)/2,_=f+d,g=null===t.underflow_color?u:u-E/(2*Math.sqrt(3)),v=null===t.overflow_color?p:p+E/(2*Math.sqrt(3)));var S,R=t.colors.length,F=Yr("svg",{width:c,height:l}),M=Yr("g",{},F);S="vertical"==o?"left"==s?{"text-anchor":"end",transform:"translate(".concat(u,", ").concat(f,")")}:{transform:"translate(".concat(u+h,", ").concat(f,")")}:"bottom"==s?{"text-anchor":"middle",transform:"translate(".concat(u,", ").concat(f+d,")")}:{"text-anchor":"middle",transform:"translate(".concat(u,", ").concat(f,")")};var P=Yr("g",S,F);if(t.colors.forEach((function(t,e){Yr("rect",$r($r({},"vertical"==o?{x:u,y:f+d*(1-(e+1)/R),width:h,height:d/R}:{x:u+h*e/R,y:f,width:h/R,height:d}),{fill:t.toRGBHex(),opacity:t.a}),M)})),null!==t.underflow_color){var I={points:"vertical"==o?"".concat(p," ").concat(_,", ").concat(m," ").concat(g,", ").concat(u," ").concat(_,", ").concat(p," ").concat(_):"".concat(u," ").concat(_,", ").concat(g," ").concat(m,", ").concat(u," ").concat(f,", ").concat(u," ").concat(_),fill:t.underflow_color.toRGBHex(),opacity:t.underflow_color.a};Yr("polygon",I,M)}if(null!==t.overflow_color){var O={points:"vertical"==o?"".concat(u," ").concat(f,", ").concat(m," ").concat(v,", ").concat(p," ").concat(f,", ").concat(u," ").concat(f):"".concat(p," ").concat(f,", ").concat(v," ").concat(m,", ").concat(p," ").concat(_,", ").concat(p," ").concat(f),fill:t.overflow_color.toRGBHex(),opacity:t.overflow_color.a};Yr("polygon",O,M)}var C,N,B=t.levels[0],k=t.levels[t.levels.length-1];return r.filter((function(t){return B<=t&&t<=k})).forEach((function(e){var n=t.levels.map((function(t){return Math.abs(t-e)})),r=n.indexOf(n.reduce((function(t,e){return Math.min(t,e)})));e<=t.levels[r]&&r>0&&(r-=1),r+=(e-t.levels[r])/(t.levels[r+1]-t.levels[r]);var l="vertical"==o?{transform:"translate(0, ".concat(d*(1-r/R),")")}:{transform:"translate(".concat(h*r/R,", 0)")},c=Yr("g",l,P);Yr("line",$r($r({},"vertical"==o?"left"==s?{x2:-6}:{x2:6}:"bottom"==s?{y2:6}:{y2:-6}),{stroke:"#000000","stroke-width":1.5}),c),Yr("text",$r($r({},"vertical"==o?"left"==s?{x:-9,dy:"0.32em"}:{x:9,dy:"0.32em"}:"bottom"==s?{y:9,dy:"0.8em"}:{y:-9,dy:"0em"}),{fill:"#000000",style:"font-family: ".concat(i,"; font-size: ").concat(a,"pt")}),c).textContent=e.toString()})),C="vertical"==o?"".concat(u," ").concat(f,", ").concat(m," ").concat(v,", ").concat(p," ").concat(f,", ").concat(p," ").concat(_,", ")+"".concat(m," ").concat(g,", ").concat(u," ").concat(_,", ").concat(u," ").concat(f):"".concat(u," ").concat(f,", ").concat(p," ").concat(f,", ").concat(v," ").concat(m,", ").concat(p," ").concat(_,", ")+"".concat(u," ").concat(_,", ").concat(g," ").concat(m,", ").concat(u," ").concat(f),Yr("polygon",{points:C,stroke:"#000000","stroke-width":1.5,fill:"none"},F),N="vertical"==o?"left"==s?{transform:"translate(15, ".concat(l/2,") rotate(-90)")}:{transform:"translate(".concat(c-6,", ").concat(l/2,") rotate(-90)")}:"bottom"==s?{transform:"translate(".concat(c/2,", ").concat(l-5,")")}:{transform:"translate(".concat(c/2,", 15)")},Yr("text",$r($r({},N),{fill:"#000000","text-anchor":"middle",style:"font-family: ".concat(i,";")}),F).textContent=n,F}function Jr(t,e,n){if(t.length!=e.length)throw"Mismatch between the number of colors (".concat(t.length,") and the number of labels (").concat(e.length,")");var r=void 0===(n=void 0===n?{}:n).n_cols?1:n.n_cols,o=void 0===n.fontface?"sans-serif":n.fontface,i=Math.ceil(t.length/r),a=Yr("svg",{width:123*r+5*(r+1),height:20*i+5*(i+1)}),s=Yr("g",{},a);return t.forEach((function(t,n){var r=e[n],a=n%i,l=Math.floor(n/i),c=1;"string"!=typeof t&&(c=t.a,t=t.toRGBHex());var u=5+128*l,f=5+25*a;Yr("rect",{x:u,y:f,fill:t,opacity:c,width:20,height:20},s),Yr("text",$r($r({},{x:u+20+3,y:f+10,dy:"0.32em"}),{fill:"#000000",style:"font-size: 0.8em; font-family: ".concat(o,";")}),s).textContent=r})),a}var Zr=n(176),qr=n.n(Zr);n.p;var Kr=null;function Qr(){return null===Kr&&(Kr=qr()()),Kr}function to(t,e,n){return r=this,o=void 0,a=function(){var r,o,i,a,s,l;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(c){switch(c.label){case 0:if(void 0===n.interval&&void 0===n.levels)throw"Must supply either an interval or levels to contourCreator()";return r=void 0===n.interval?0:n.interval,[4,Qr()];case 1:return o=c.sent(),i=e.getGridCoords(),a=t instanceof Float32Array?o.getContourLevelsFloat32:o.getContourLevelsFloat16,s=t instanceof Float32Array?o.makeContoursFloat32:o.makeContoursFloat16,l=void 0===n.levels?a(t,e.ni,e.nj,r):n.levels,[2,s(t,i.x,i.y,l,(function(t,n){return e.transform(t,n,{inverse:!0})}))]}}))},new((i=void 0)||(i=Promise))((function(t,e){function n(t){try{l(a.next(t))}catch(t){e(t)}}function s(t){try{l(a.throw(t))}catch(t){e(t)}}function l(e){var r;e.done?t(e.value):(r=e.value,r instanceof i?r:new i((function(t){t(r)}))).then(n,s)}l((a=a.apply(r,o||[])).next())}));var r,o,i,a}var eo=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},no=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},ro=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},oo=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},io=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))};function ao(t){return t.constructor}var so=function(){function t(t,e){var n=this;if(this.grid=t,this.data=e,t.ni*t.nj!=e.length)throw"Data size (".concat(e.length,") doesn't match the grid dimensions (").concat(t.ni," x ").concat(t.nj,"; expected ").concat(t.ni*t.nj," points)");this.contour_cache=new E((function(t){return eo(n,void 0,void 0,(function(){return no(this,(function(e){switch(e.label){case 0:return[4,to(this.data,this.grid,t)];case 1:return[2,e.sent()]}}))}))}))}return t.prototype.getTextureData=function(){var t=this.data;return t instanceof Float32Array?t:new Uint16Array(t.buffer)},t.prototype.getContours=function(t){return eo(this,void 0,void 0,(function(){return no(this,(function(e){switch(e.label){case 0:return[4,this.contour_cache.getValue(t)];case 1:return[2,e.sent()]}}))}))},t.aggregateFields=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];function o(t,e){var n,r,o,i,a,s;return no(this,(function(l){switch(l.label){case 0:l.trys.push([0,5,6,7]),n=ro(t),r=n.next(),l.label=1;case 1:return r.done?[3,4]:(o=r.value,[4,e(o)]);case 2:l.sent(),l.label=3;case 3:return r=n.next(),[3,1];case 4:return[3,7];case 5:return i=l.sent(),a={error:i},[3,7];case 6:try{r&&!r.done&&(s=n.return)&&s.call(n)}finally{if(a)throw a.error}return[7];case 7:return[2]}}))}var i=ao(n[0].data),a=T.apply(void 0,io([],oo(n.map((function(t){return t.data}))),!1)),s=new i(o(a,(function(t){return e.apply(void 0,io([],oo(t),!1))})));return new t(n[0].grid,s)},t}(),lo=function(){function t(t,e,n,r){r=void 0===r?{}:r,this.u=new so(t,e),this.v=new so(t,n),this.relative_to=void 0===r.relative_to?"grid":r.relative_to}return t.prototype.getTextureData=function(){var t=this.u.data,e=this.v.data;return{u:t instanceof Float32Array?t:new Uint16Array(t.buffer),v:e instanceof Float32Array?e:new Uint16Array(e.buffer)}},t.prototype.getThinnedField=function(e,n){var r=this,o=this.grid.getThinnedGrid(e,n),i=function(t){for(var i=new(ao(t))(o.ni*o.nj),a=0;a<o.ni;a++)for(var s=0;s<o.nj;s++){var l=a*e+r.grid.ni*s*n;i[a+o.ni*s]=t[l]}return i},a=i(this.u.data),s=i(this.v.data);return new t(o,a,s,{relative_to:this.relative_to})},Object.defineProperty(t.prototype,"grid",{get:function(){return this.u.grid},enumerable:!1,configurable:!0}),t}(),co=function(){function t(t,e){this.profiles=e,this.grid=t}return t.prototype.getStormMotionGrid=function(){var t=this,e=this.profiles,n=new gn(this.grid.ni*this.grid.nj).fill(parseFloat("nan")),r=new gn(this.grid.ni*this.grid.nj).fill(parseFloat("nan"));return e.forEach((function(e){var o=e.ilon+t.grid.ni*e.jlat;n[o]=e.smu,r[o]=e.smv})),new lo(this.grid,n,r,{relative_to:"grid"})},t}(),uo=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),fo=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},ho=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},po=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},_o=function(){function t(t,e,n,r){var o=this;this.type=t,this.is_conformal=e,this.ni=n,this.nj=r,this.buffer_cache=new E((function(t){var e=Math.max(Math.floor(o.ni/50),20),n=Math.max(Math.floor(o.nj/50),20);return function(t,e,n){return fo(this,void 0,void 0,(function(){var r,o,i,a,s,l,c,u,f,h,d;return ho(this,(function(p){switch(p.label){case 0:return r=1/(2*(n=void 0!==n?n:e).ni),o=1/(2*n.nj),i=e.ni*e.nj/(n.ni*n.nj),a=e.getEarthCoords(),s=a.lats,l=a.lons,[4,R.makeDomainVerticesAndTexCoords(s,l,e.ni,e.nj,r,o)];case 1:for(c=p.sent(),u=0;u<c.grid_cell_size.length;u++)c.grid_cell_size[u]*=i;return f=new C(t,c.vertices,2,t.TRIANGLE_STRIP),h=new C(t,c.tex_coords,2,t.TRIANGLE_STRIP),d=new C(t,c.grid_cell_size,1,t.TRIANGLE_STRIP),[2,{vertices:f,texcoords:h,cellsize:d}]}}))}))}(t,o.copy({ni:e,nj:n}),o)})),this.billboard_buffer_cache=new E((function(t,e,n){return function(t,e,n,r){return fo(this,void 0,void 0,(function(){var o,i,a,s,l,c;return ho(this,(function(u){switch(u.label){case 0:return o=e.getEarthCoords(),i=o.lats,a=o.lons,[4,R.makeBBElements(i,a,e.ni,e.nj,n,r)];case 1:return s=u.sent(),l=new C(t,s.pts,3,t.TRIANGLE_STRIP),c=new C(t,s.tex_coords,2,t.TRIANGLE_STRIP),[2,{vertices:l,texcoords:c}]}}))}))}(t,o,e,n)})),this.vector_rotation_cache=new E((function(t){return function(t,e){var n=e.getEarthCoords();e.is_conformal||console.warn("Vector rotations for non-conformal projections are not supported. The output may look incorrect.");for(var r=new gn(n.lats.length),o=0;o<n.lats.length;o++){var i=n.lons[o],a=n.lats[o],s=po(e.transform(i,a),2),l=s[0],c=s[1],u=po(e.transform(i+.01,a),2),f=u[0],h=u[1];r[o]=Math.atan2(h-c,f-l)}var d=M(t,!0),p={format:d.format,type:d.type,row_alignment:d.row_alignment,image:new Uint16Array(r.buffer),width:e.ni,height:e.nj,mag_filter:t.LINEAR};return{rotation:new B(t,p)}}(t,o)}))}return t.prototype.getWGLBuffers=function(t){return fo(this,void 0,void 0,(function(){return ho(this,(function(e){switch(e.label){case 0:return[4,this.buffer_cache.getValue(t)];case 1:return[2,e.sent()]}}))}))},t.prototype.getWGLBillboardBuffers=function(t,e,n){return fo(this,void 0,void 0,(function(){return ho(this,(function(r){switch(r.label){case 0:return[4,this.billboard_buffer_cache.getValue(t,e,n)];case 1:return[2,r.sent()]}}))}))},t.prototype.getVectorRotationTexture=function(t){return this.vector_rotation_cache.getValue(t)},t}(),mo=function(t){function e(e,n,r,o,i,a){var s=t.call(this,"latlon",!0,e,n)||this;s.ll_lon=r,s.ll_lat=o,s.ur_lon=i,s.ur_lat=a;var l=(s.ur_lon-s.ll_lon)/(s.ni-1),c=(s.ur_lat-s.ll_lat)/(s.nj-1);return s.ll_cache=new E((function(){for(var t=new Float32Array(s.ni*s.nj),e=new Float32Array(s.ni*s.nj),n=0;n<s.ni;n++)for(var r=0;r<s.nj;r++){var o=n+r*s.ni;t[o]=s.ll_lon+n*l,e[o]=s.ll_lat+r*c}return{lons:t,lats:e}})),s.gc_cache=new E((function(){for(var t=new Float32Array(s.ni),e=new Float32Array(s.nj),n=0;n<s.ni;n++)t[n]=s.ll_lon+n*l;for(var r=0;r<s.nj;r++)e[r]=s.ll_lat+r*c;return{x:t,y:e}})),s}return uo(e,t),e.prototype.copy=function(t){return new e(void 0!==(t=void 0!==t?t:{}).ni?t.ni:this.ni,void 0!==t.nj?t.nj:this.nj,void 0!==t.ll_lon?t.ll_lon:this.ll_lon,void 0!==t.ll_lat?t.ll_lat:this.ll_lat,void 0!==t.ur_lon?t.ur_lon:this.ur_lon,void 0!==t.ur_lat?t.ur_lat:this.ur_lat)},e.prototype.getEarthCoords=function(){return this.ll_cache.getValue()},e.prototype.getGridCoords=function(){return this.gc_cache.getValue()},e.prototype.transform=function(t,e,n){return[t,e]},e.prototype.getThinnedGrid=function(t,n){var r=(this.ur_lon-this.ll_lon)/this.ni,o=(this.ur_lat-this.ll_lat)/this.nj,i=Math.ceil(this.ni/t),a=Math.ceil(this.nj/n),s=(this.ni-1)%t,l=(this.nj-1)%n;return new e(i,a,this.ll_lon,this.ll_lat,this.ur_lon-s*r,this.ur_lat-l*o)},e}(_o),go=function(t){function e(e,n,r,o,i,a,s,l,c){var u=t.call(this,"latlonrot",!0,e,n)||this;u.np_lon=r,u.np_lat=o,u.lon_shift=i,u.ll_lon=a,u.ll_lat=s,u.ur_lon=l,u.ur_lat=c,u.llrot=function(t){var e=Math.PI/180,n=t.np_lat*e,r=t.np_lon*e,o=t.lon_shift*e,i=Math.sin(n),a=Math.cos(n);return function(t,n,s){return(s=void 0===s?{inverse:!1}:s).inverse?function(t,n){t*=e,n*=e;var s=Math.sin(n),l=Math.cos(n),c=Math.sin(t-r),u=Math.cos(t-r),f=Math.asin(i*s+a*l*u),h=o+Math.atan2(l*c,i*l*u-a*s);return t>Math.PI&&(t-=2*Math.PI),[h/e,f/e]}(t,n):function(t,n){t*=e,n*=e;var s=Math.sin(n),l=Math.cos(n),c=Math.sin(t-o),u=Math.cos(t-o),f=Math.asin(i*s-a*l*u),h=r+Math.atan2(l*c,i*l*u+a*s);return h>Math.PI&&(h-=2*Math.PI),[h/e,f/e]}(t,n)}}({np_lon:r,np_lat:o,lon_shift:i});var f=(u.ur_lon-u.ll_lon)/(u.ni-1),h=(u.ur_lat-u.ll_lat)/(u.nj-1);return u.ll_cache=new E((function(){for(var t=new Float32Array(u.ni*u.nj),e=new Float32Array(u.ni*u.nj),n=0;n<u.ni;n++)for(var r=u.ll_lon+n*f,o=0;o<u.nj;o++){var i=u.ll_lat+o*h,a=po(u.llrot(r,i),2),s=a[0],l=a[1],c=n+o*u.ni;t[c]=s,e[c]=l}return{lons:t,lats:e}})),u.gc_cache=new E((function(){for(var t=new Float32Array(u.ni),e=new Float32Array(u.nj),n=0;n<u.ni;n++)t[n]=u.ll_lon+n*f;for(var r=0;r<u.nj;r++)e[r]=u.ll_lat+r*h;return{x:t,y:e}})),u}return uo(e,t),e.prototype.copy=function(t){var n=void 0!==(t=void 0!==t?t:{}).ni?t.ni:this.ni,r=void 0!==t.nj?t.nj:this.nj,o=void 0!==t.ll_lon?t.ll_lon:this.ll_lon,i=void 0!==t.ll_lat?t.ll_lat:this.ll_lat,a=void 0!==t.ur_lon?t.ur_lon:this.ur_lon,s=void 0!==t.ur_lat?t.ur_lat:this.ur_lat;return new e(n,r,this.np_lon,this.np_lat,this.lon_shift,o,i,a,s)},e.prototype.getEarthCoords=function(){return this.ll_cache.getValue()},e.prototype.getGridCoords=function(){return this.gc_cache.getValue()},e.prototype.transform=function(t,e,n){var r="inverse"in(n=void 0===n?{}:n)&&n.inverse;return this.llrot(t,e,{inverse:!r})},e.prototype.getThinnedGrid=function(t,n){var r=(this.ur_lon-this.ll_lon)/this.ni,o=(this.ur_lat-this.ll_lat)/this.nj,i=Math.ceil(this.ni/t),a=Math.ceil(this.nj/n),s=(this.ni-1)%t,l=(this.nj-1)%n,c=this.ll_lon,u=this.ll_lat,f=this.ur_lon-s*r,h=this.ur_lat-l*o;return new e(i,a,this.np_lon,this.np_lat,this.lon_shift,c,u,f,h)},e}(_o),vo=function(t){function e(e,n,r,o,i,a,s,l,c){var u=t.call(this,"lcc",!0,e,n)||this;u.lon_0=r,u.lat_0=o,u.lat_std=i,u.ll_x=a,u.ll_y=s,u.ur_x=l,u.ur_y=c,u.lcc=P({lon_0:r,lat_0:o,lat_std:i});var f=(u.ur_x-u.ll_x)/(u.ni-1),h=(u.ur_y-u.ll_y)/(u.nj-1);return u.ll_cache=new E((function(){for(var t=new Float32Array(u.ni*u.nj),e=new Float32Array(u.ni*u.nj),n=0;n<u.ni;n++)for(var r=u.ll_x+n*f,o=0;o<u.nj;o++){var i=u.ll_y+o*h,a=po(u.lcc(r,i,{inverse:!0}),2),s=a[0],l=a[1],c=n+o*u.ni;t[c]=s,e[c]=l}return{lons:t,lats:e}})),u.gc_cache=new E((function(){for(var t=new Float32Array(u.ni),e=new Float32Array(u.nj),n=0;n<u.ni;n++)t[n]=u.ll_x+n*f;for(var r=0;r<u.nj;r++)e[r]=u.ll_y+r*h;return{x:t,y:e}})),u}return uo(e,t),e.fromLLCornerLonLat=function(t,n,r,o,i,a,s,l,c){var u=P({lon_0:r,lat_0:o,lat_std:i}),f=po(u(a,s),2),h=f[0],d=f[1];return new e(t,n,r,o,i,h,d,h+t*l,d+n*c)},e.prototype.copy=function(t){var n=void 0!==(t=void 0!==t?t:{}).ni?t.ni:this.ni,r=void 0!==t.nj?t.nj:this.nj,o=void 0!==t.ll_x?t.ll_x:this.ll_x,i=void 0!==t.ll_y?t.ll_y:this.ll_y,a=void 0!==t.ur_x?t.ur_x:this.ur_x,s=void 0!==t.ur_y?t.ur_y:this.ur_y;return new e(n,r,this.lon_0,this.lat_0,this.lat_std,o,i,a,s)},e.prototype.getEarthCoords=function(){return this.ll_cache.getValue()},e.prototype.getGridCoords=function(){return this.gc_cache.getValue()},e.prototype.transform=function(t,e,n){var r=void 0!==(n=void 0===n?{}:n).inverse&&n.inverse;return this.lcc(t,e,{inverse:r})},e.prototype.getThinnedGrid=function(t,n){var r=(this.ur_x-this.ll_x)/this.ni,o=(this.ur_y-this.ll_y)/this.nj,i=Math.ceil(this.ni/t),a=Math.ceil(this.nj/n),s=(this.ni-1)%t,l=(this.nj-1)%n,c=this.ll_x,u=this.ll_y,f=this.ur_x-s*r,h=this.ur_y-l*o;return new e(i,a,this.lon_0,this.lat_0,this.lat_std,c,u,f,h)},e}(_o),bo={bluered:function(t,e,n){return Tn.diverging("#0000ff","#ff0000",t,e,n)},redblue:function(t,e,n){return Tn.diverging("#ff0000","#0000ff",t,e,n)},pw_speed500mb:An,pw_speed850mb:Sn,pw_cape:Rn,pw_t2m:Fn,pw_td2m:Mn,nws_storm_clear_refl:Pn};function yo(){Qr()}})(),r})()));
|
|
2
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.apgl=e():t.apgl=e()}(this,()=>(()=>{var t={187:t=>{t.exports="#version 300 es\n\nin vec2 a_pos;\n\nout highp vec2 v_tex_coord;\n\nvoid main() {\n gl_Position = vec4(a_pos.xy, 0., 1.);\n v_tex_coord = 0.5 * a_pos.xy + vec2(0.5, 0.5);\n}"},251:(t,e)=>{e.read=function(t,e,i,s,n){var r,o,a=8*n-s-1,l=(1<<a)-1,h=l>>1,c=-7,f=i?n-1:0,u=i?-1:1,_=t[e+f];for(f+=u,r=_&(1<<-c)-1,_>>=-c,c+=a;c>0;r=256*r+t[e+f],f+=u,c-=8);for(o=r&(1<<-c)-1,r>>=-c,c+=s;c>0;o=256*o+t[e+f],f+=u,c-=8);if(0===r)r=1-h;else{if(r===l)return o?NaN:1/0*(_?-1:1);o+=Math.pow(2,s),r-=h}return(_?-1:1)*o*Math.pow(2,r-s)},e.write=function(t,e,i,s,n,r){var o,a,l,h=8*r-n-1,c=(1<<h)-1,f=c>>1,u=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,_=s?0:r-1,d=s?1:-1,p=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+f>=1?u/l:u*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(a=0,o=c):o+f>=1?(a=(e*l-1)*Math.pow(2,n),o+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,n),o=0));n>=8;t[i+_]=255&a,_+=d,a/=256,n-=8);for(o=o<<n|a,h+=n;h>0;t[i+_]=255&o,_+=d,o/=256,h-=8);t[i+_-d]|=128*p}},254:t=>{t.exports="#version 300 es\n\nin highp vec2 v_tex_coord;\n\n#ifdef COLORMAP\nin highp float v_mag;\n#else\nuniform lowp vec4 u_bb_color;\n#endif\n\nuniform sampler2D u_sampler;\n\nout highp vec4 fragColor;\n\nvoid main() {\n lowp vec4 tex_color = texture(u_sampler, v_tex_coord);\n\n lowp vec4 color;\n#ifdef COLORMAP\n color = apply_colormap(v_mag);\n#else\n color = u_bb_color;\n#endif\n\n color.a *= tex_color.a;\n fragColor = color; // mix(vec4(1.0, 0.0, 0.0, 0.5), color, tex_color.a);\n}"},303:t=>{t.exports="#version 300 es\n\nuniform int u_offset;\n\nin vec2 a_pos;\nin vec2 a_tex_coord;\n\nout highp vec2 v_tex_coord;\n\nvoid main() {\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n gl_Position = projectTile(a_pos.xy + globe_offset);\n v_tex_coord = a_tex_coord;\n}"},314:t=>{t.exports="#version 300 es\n\nin highp vec2 v_tex_coord;\n\nuniform sampler2D u_fill_sampler;\nuniform lowp vec4 u_color;\nuniform highp float u_opacity;\n\nout highp vec4 fragColor;\n\nvoid main() {\n highp float fill_val = texture(u_fill_sampler, v_tex_coord).r;\n \n if (fill_val < 0.4) {\n discard;\n }\n\n lowp vec4 color = u_color;\n\n color.a = color.a * u_opacity;\n fragColor = color;\n}"},317:function(t,e){var i,s;void 0===(s="function"==typeof(i=function(t){function e(t,e,i){this.obj=t,this.left=null,this.right=null,this.parent=i,this.dimension=e}function i(t){this.content=[],this.scoreFunction=t}i.prototype={push:function(t){this.content.push(t),this.bubbleUp(this.content.length-1)},pop:function(){var t=this.content[0],e=this.content.pop();return this.content.length>0&&(this.content[0]=e,this.sinkDown(0)),t},peek:function(){return this.content[0]},remove:function(t){for(var e=this.content.length,i=0;i<e;i++)if(this.content[i]==t){var s=this.content.pop();return void(i!=e-1&&(this.content[i]=s,this.scoreFunction(s)<this.scoreFunction(t)?this.bubbleUp(i):this.sinkDown(i)))}throw new Error("Node not found.")},size:function(){return this.content.length},bubbleUp:function(t){for(var e=this.content[t];t>0;){var i=Math.floor((t+1)/2)-1,s=this.content[i];if(!(this.scoreFunction(e)<this.scoreFunction(s)))break;this.content[i]=e,this.content[t]=s,t=i}},sinkDown:function(t){for(var e=this.content.length,i=this.content[t],s=this.scoreFunction(i);;){var n=2*(t+1),r=n-1,o=null;if(r<e){var a=this.content[r],l=this.scoreFunction(a);l<s&&(o=r)}if(n<e){var h=this.content[n];this.scoreFunction(h)<(null==o?s:l)&&(o=n)}if(null==o)break;this.content[t]=this.content[o],this.content[o]=i,t=o}}},t.kdTree=function(t,s,n){var r=this;Array.isArray(t)?this.root=function t(i,s,r){var o,a,l=s%n.length;return 0===i.length?null:1===i.length?new e(i[0],l,r):(i.sort(function(t,e){return t[n[l]]-e[n[l]]}),(a=new e(i[o=Math.floor(i.length/2)],l,r)).left=t(i.slice(0,o),s+1,a),a.right=t(i.slice(o+1),s+1,a),a)}(t,0,null):function(t){r.root=t,function t(e){e.left&&(e.left.parent=e,t(e.left)),e.right&&(e.right.parent=e,t(e.right))}(r.root)}(t),this.toJSON=function(t){t||(t=this.root);var i=new e(t.obj,t.dimension,null);return t.left&&(i.left=r.toJSON(t.left)),t.right&&(i.right=r.toJSON(t.right)),i},this.insert=function(t){var i,s,r=function e(i,s){if(null===i)return s;var r=n[i.dimension];return t[r]<i.obj[r]?e(i.left,i):e(i.right,i)}(this.root,null);null!==r?(i=new e(t,(r.dimension+1)%n.length,r),s=n[r.dimension],t[s]<r.obj[s]?r.left=i:r.right=i):this.root=new e(t,0,null)},this.remove=function(t){var e;null!==(e=function e(i){if(null===i)return null;if(i.obj===t)return i;var s=n[i.dimension];return t[s]<i.obj[s]?e(i.left):e(i.right)}(r.root))&&function t(e){function i(t,e){var s,r,o,a,l;return null===t?null:(s=n[e],t.dimension===e?null!==t.left?i(t.left,e):t:(r=t.obj[s],o=i(t.left,e),a=i(t.right,e),l=t,null!==o&&o.obj[s]<r&&(l=o),null!==a&&a.obj[s]<l.obj[s]&&(l=a),l))}var s,o,a;if(null===e.left&&null===e.right)return null===e.parent?void(r.root=null):(a=n[e.parent.dimension],void(e.obj[a]<e.parent.obj[a]?e.parent.left=null:e.parent.right=null));null!==e.right?(o=(s=i(e.right,e.dimension)).obj,t(s),e.obj=o):(o=(s=i(e.left,e.dimension)).obj,t(s),e.right=e.left,e.left=null,e.obj=o)}(e)},this.nearest=function(t,e,o){var a,l,h;if(h=new i(function(t){return-t[1]}),o)for(a=0;a<e;a+=1)h.push([null,o]);for(r.root&&function i(r){function o(t,i){h.push([t,i]),h.size()>e&&h.pop()}var a,l,c,f,u=n[r.dimension],_=s(t,r.obj),d={};for(f=0;f<n.length;f+=1)f===r.dimension?d[n[f]]=t[n[f]]:d[n[f]]=r.obj[n[f]];l=s(d,r.obj),null!==r.right||null!==r.left?(i(a=null===r.right?r.left:null===r.left?r.right:t[u]<r.obj[u]?r.left:r.right),(h.size()<e||_<h.peek()[1])&&o(r,_),(h.size()<e||Math.abs(l)<h.peek()[1])&&null!==(c=a===r.left?r.right:r.left)&&i(c)):(h.size()<e||_<h.peek()[1])&&o(r,_)}(r.root),l=[],a=0;a<Math.min(e,h.content.length);a+=1)h.content[a][0]&&l.push([h.content[a][0].obj,h.content[a][1]]);return l},this.balanceFactor=function(){return function t(e){return null===e?0:Math.max(t(e.left),t(e.right))+1}(r.root)/(Math.log(function t(e){return null===e?0:t(e.left)+t(e.right)+1}(r.root))/Math.log(2))}},t.BinaryHeap=i})?i.apply(e,[e]):i)||(t.exports=s)},325:t=>{t.exports="#version 300 es\n\nin highp vec2 v_tex_coord;\n\nuniform int u_imem;\n\nout highp vec4 fragColor;\n\nvoid main() {\n uint fill_val = uint(get_field_value(v_tex_coord));\n \n if (fill_val < uint(1)) {\n discard;\n }\n\n lowp vec4 off_color = vec4(0., 0., 0., 1.);\n lowp vec4 on_color = vec4(1., 1., 1., 1.);\n\n uint mask = uint(1) << u_imem;\n lowp float mem_active = float((fill_val & mask) > uint(0));\n fragColor = mix(off_color, on_color, mem_active);\n}"},335:(t,e,i)=>{"use strict";t.exports=n;var s=i(251);function n(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}n.Varint=0,n.Fixed64=1,n.Bytes=2,n.Fixed32=5;var r=4294967296,o=1/r,a="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function l(t){return t.type===n.Bytes?t.readVarint()+t.pos:t.pos+1}function h(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function c(t,e,i){var s=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(s);for(var n=i.pos-1;n>=t;n--)i.buf[n+s]=i.buf[n]}function f(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function u(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function _(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function d(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function p(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function m(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function g(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function b(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function v(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function w(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function y(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function x(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}n.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var s=this.readVarint(),n=s>>3,r=this.pos;this.type=7&s,t(n,e,this),this.pos===r&&this.skip(s)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=w(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=x(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=w(this.buf,this.pos)+w(this.buf,this.pos+4)*r;return this.pos+=8,t},readSFixed64:function(){var t=w(this.buf,this.pos)+x(this.buf,this.pos+4)*r;return this.pos+=8,t},readFloat:function(){var t=s.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=s.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,s=this.buf;return e=127&(i=s[this.pos++]),i<128?e:(e|=(127&(i=s[this.pos++]))<<7,i<128?e:(e|=(127&(i=s[this.pos++]))<<14,i<128?e:(e|=(127&(i=s[this.pos++]))<<21,i<128?e:function(t,e,i){var s,n,r=i.buf;if(s=(112&(n=r[i.pos++]))>>4,n<128)return h(t,s,e);if(s|=(127&(n=r[i.pos++]))<<3,n<128)return h(t,s,e);if(s|=(127&(n=r[i.pos++]))<<10,n<128)return h(t,s,e);if(s|=(127&(n=r[i.pos++]))<<17,n<128)return h(t,s,e);if(s|=(127&(n=r[i.pos++]))<<24,n<128)return h(t,s,e);if(s|=(1&(n=r[i.pos++]))<<31,n<128)return h(t,s,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=s[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&a?function(t,e,i){return a.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){for(var s="",n=e;n<i;){var r,o,a,l=t[n],h=null,c=l>239?4:l>223?3:l>191?2:1;if(n+c>i)break;1===c?l<128&&(h=l):2===c?128==(192&(r=t[n+1]))&&(h=(31&l)<<6|63&r)<=127&&(h=null):3===c?(r=t[n+1],o=t[n+2],128==(192&r)&&128==(192&o)&&((h=(15&l)<<12|(63&r)<<6|63&o)<=2047||h>=55296&&h<=57343)&&(h=null)):4===c&&(r=t[n+1],o=t[n+2],a=t[n+3],128==(192&r)&&128==(192&o)&&128==(192&a)&&((h=(15&l)<<18|(63&r)<<12|(63&o)<<6|63&a)<=65535||h>=1114112)&&(h=null)),null===h?(h=65533,c=1):h>65535&&(h-=65536,s+=String.fromCharCode(h>>>10&1023|55296),h=56320|1023&h),s+=String.fromCharCode(h),n+=c}return s}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==n.Bytes)return t.push(this.readVarint(e));var i=l(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==n.Bytes)return t.push(this.readSVarint());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==n.Bytes)return t.push(this.readBoolean());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==n.Bytes)return t.push(this.readFloat());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==n.Bytes)return t.push(this.readDouble());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==n.Bytes)return t.push(this.readFixed32());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==n.Bytes)return t.push(this.readSFixed32());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==n.Bytes)return t.push(this.readFixed64());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==n.Bytes)return t.push(this.readSFixed64());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===n.Varint)for(;this.buf[this.pos++]>127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),y(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),y(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),y(this.buf,-1&t,this.pos),y(this.buf,Math.floor(t*o),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),y(this.buf,-1&t,this.pos),y(this.buf,Math.floor(t*o),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,s;if(t>=0?(i=t%4294967296|0,s=t/4294967296|0):(s=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,s=s+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos]=127&t}(i,0,e),function(t,e){var i=(7&t)<<4;e.buf[e.pos++]|=i|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(s,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,i){for(var s,n,r=0;r<e.length;r++){if((s=e.charCodeAt(r))>55295&&s<57344){if(!n){s>56319||r+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):n=s;continue}if(s<56320){t[i++]=239,t[i++]=191,t[i++]=189,n=s;continue}s=n-55296<<10|s-56320|65536,n=null}else n&&(t[i++]=239,t[i++]=191,t[i++]=189,n=null);s<128?t[i++]=s:(s<2048?t[i++]=s>>6|192:(s<65536?t[i++]=s>>12|224:(t[i++]=s>>18|240,t[i++]=s>>12&63|128),t[i++]=s>>6&63|128),t[i++]=63&s|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&c(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),s.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),s.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var s=this.pos-i;s>=128&&c(i,s,this),this.pos=i-1,this.writeVarint(s),this.pos+=s},writeMessage:function(t,e,i){this.writeTag(t,n.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,u,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,_,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,m,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,g,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,b,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,v,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},374:t=>{t.exports="\nuniform sampler2D u_cmap_sampler;\nuniform sampler2D u_cmap_nonlin_sampler;\nuniform highp float u_cmap_min;\nuniform highp float u_cmap_max;\nuniform highp vec4 u_underflow_color;\nuniform highp vec4 u_overflow_color;\nuniform int u_n_index;\n\nlowp vec4 apply_colormap(highp float value) {\n lowp float normed_val = (value - u_cmap_min) / (u_cmap_max - u_cmap_min);\n \n lowp vec4 color;\n if (normed_val < 0.0) {\n color = u_underflow_color;\n }\n else if (normed_val > 1.0) {\n color = u_overflow_color;\n }\n else {\n lowp float index_buffer = 1. / (2. * float(u_n_index));\n normed_val = index_buffer + normed_val * (1. - 2. * index_buffer); // Chop off the half pixels on either end of the texture\n highp float nonlin_val = texture(u_cmap_nonlin_sampler, vec2(normed_val, 0.5)).r;\n color = texture(u_cmap_sampler, vec2(nonlin_val, 0.5));\n }\n\n return color;\n}"},387:(t,e)=>{var i,s,n;(n={}).Constants={},n.Math={},n.Accumulator={},function(t){"use strict";t.WGS84={a:6378137,f:1/298.257223563},t.version={major:2,minor:2,patch:0},t.version_string="2.2.0"}(n.Constants),function(t){"use strict";t.digits=53,t.epsilon=Math.pow(.5,t.digits-1),t.degree=Math.PI/180,t.sq=function(t){return t*t},t.hypot=function(t,e){return Math.sqrt(t*t+e*e)},t.cbrt=Math.cbrt||function(t){var e=Math.pow(Math.abs(t),1/3);return t>0?e:t<0?-e:t},t.log1p=Math.log1p||function(t){var e=1+t,i=e-1;return 0===i?t:t*Math.log(e)/i},t.atanh=Math.atanh||function(e){var i=Math.abs(e);return i=t.log1p(2*i/(1-i))/2,e>0?i:e<0?-i:e},t.copysign=function(t,e){return Math.abs(t)*(e<0||0===e&&1/e<0?-1:1)},t.sum=function(t,e){var i=t+e,s=i-e,n=i-s;return s-=t,{s:i,t:i?0-(s+(n-=e)):i}},t.polyval=function(t,e,i,s){for(var n=t<0?0:e[i++];--t>=0;)n=n*s+e[i++];return n},t.AngRound=function(e){var i=1/16,s=Math.abs(e);return s=s<i?i-(i-s):s,t.copysign(s,e)},t.remainder=function(t,e){return(t%=e)<-e/2?t+e:t<e/2?t:t-e},t.AngNormalize=function(e){var i=t.remainder(e,360);return 180===Math.abs(i)?t.copysign(180,e):i},t.LatFix=function(t){return Math.abs(t)>90?NaN:t},t.AngDiff=function(e,i){var s,n,r=t.sum(t.remainder(-e,360),t.remainder(i,360));return s=(r=t.sum(t.remainder(r.s,360),r.t)).s,n=r.t,0!==s&&180!==Math.abs(s)||(s=t.copysign(s,0===n?i-e:-n)),{d:s,e:n}},t.sincosd=function(e){var i,s,n,r,o,a,l;switch(i=e%360,s=(i-=90*(n=Math.round(i/90)))*this.degree,r=Math.sin(s),o=Math.cos(s),45===Math.abs(i)?(o=Math.sqrt(.5),r=t.copysign(o,s)):30===Math.abs(i)&&(o=Math.sqrt(.75),r=t.copysign(.5,s)),3&n){case 0:a=r,l=o;break;case 1:a=o,l=-r;break;case 2:a=-r,l=-o;break;default:a=-o,l=r}return l+=0,0===a&&(a=t.copysign(a,e)),{s:a,c:l}},t.sincosde=function(e,i){var s,n,r,o,a,l,h;switch(s=e%360,r=Math.round(s/90),n=(s=t.AngRound(s-90*r+i))*this.degree,o=Math.sin(n),a=Math.cos(n),45===Math.abs(s)?(a=Math.sqrt(.5),o=t.copysign(a,n)):30===Math.abs(s)&&(a=Math.sqrt(.75),o=t.copysign(.5,n)),3&r){case 0:l=o,h=a;break;case 1:l=a,h=-o;break;case 2:l=-o,h=-a;break;default:l=-a,h=o}return h+=0,0===l&&(l=t.copysign(l,e+i)),{s:l,c:h}},t.atan2d=function(e,i){var s,n=0;switch(Math.abs(e)>Math.abs(i)&&([e,i]=[i,e],n=2),t.copysign(1,i)<0&&(i=-i,++n),s=Math.atan2(e,i)/this.degree,n){case 1:s=t.copysign(180,e)-s;break;case 2:s=90-s;break;case 3:s=-90+s}return s}}(n.Math),function(t,e){"use strict";t.Accumulator=function(t){this.Set(t)},t.Accumulator.prototype.Set=function(e){e||(e=0),e.constructor===t.Accumulator?(this._s=e._s,this._t=e._t):(this._s=e,this._t=0)},t.Accumulator.prototype.Add=function(t){var i=e.sum(t,this._t),s=e.sum(i.s,this._s);i=i.t,this._s=s.s,this._t=s.t,0===this._s?this._s=i:this._t+=i},t.Accumulator.prototype.Sum=function(e){var i;return e?((i=new t.Accumulator(this)).Add(e),i._s):this._s},t.Accumulator.prototype.Negate=function(){this._s*=-1,this._t*=-1},t.Accumulator.prototype.Remainder=function(t){this._s=e.remainder(this._s,t),this.Add(0)}}(n.Accumulator,n.Math),n.Geodesic={},n.GeodesicLine={},n.PolygonArea={},function(t,e,i,s,n){"use strict";var r,o,a,l,h,c,f,u,_,d,p,m=20+s.digits+10,g=s.epsilon,b=200*g,v=Math.sqrt(g),w=g,y=1e3*v;t.tiny_=Math.sqrt(Number.MIN_VALUE/Number.EPSILON),t.nC1_=6,t.nC1p_=6,t.nC2_=6,t.nC3_=6,t.nC4_=6,r=t.nC3_*(t.nC3_-1)/2,o=t.nC4_*(t.nC4_+1)/2,t.CAP_C1=1,t.CAP_C1p=2,t.CAP_C2=4,t.CAP_C3=8,t.CAP_C4=16,t.NONE=0,t.ARC=64,t.LATITUDE=128,t.LONGITUDE=256|t.CAP_C3,t.AZIMUTH=512,t.DISTANCE=1024|t.CAP_C1,t.STANDARD=t.LATITUDE|t.LONGITUDE|t.AZIMUTH|t.DISTANCE,t.DISTANCE_IN=2048|t.CAP_C1|t.CAP_C1p,t.REDUCEDLENGTH=4096|t.CAP_C1|t.CAP_C2,t.GEODESICSCALE=8192|t.CAP_C1|t.CAP_C2,t.AREA=16384|t.CAP_C4,t.ALL=32671,t.LONG_UNROLL=32768,t.OUT_MASK=32640|t.LONG_UNROLL,t.SinCosSeries=function(t,e,i,s){var n=s.length,r=n-(t?1:0),o=2*(i-e)*(i+e),a=1&r?s[--n]:0,l=0;for(r=Math.floor(r/2);r--;)a=o*(l=o*a-l+s[--n])-a+s[--n];return t?2*e*i*a:i*(a-l)},a=function(t,e){var i,n,r,o,a,l,h,c,f,u,_,d,p=s.sq(t),m=s.sq(e),g=(p+m-1)/6;return 0===m&&g<=0?i=0:(l=g,(a=(n=p*m/4)*(n+2*(o=g*(r=s.sq(g)))))>=0?(h=n+o,h+=h<0?-Math.sqrt(a):Math.sqrt(a),l+=(c=s.cbrt(h))+(0!==c?r/c:0)):(f=Math.atan2(Math.sqrt(-a),-(n+o)),l+=2*g*Math.cos(f/3)),u=Math.sqrt(s.sq(l)+m),d=((_=l<0?m/(u-l):l+u)-m)/(2*u),i=_/(Math.sqrt(_+s.sq(d))+d)),i},l=[1,4,64,0,256],t.A1m1f=function(t){var e=Math.floor(3);return(s.polyval(e,l,0,s.sq(t))/l[e+1]+t)/(1-t)},h=[-1,6,-16,32,-9,64,-128,2048,9,-16,768,3,-5,512,-7,1280,-7,2048],t.C1f=function(e,i){var n,r,o=s.sq(e),a=e,l=0;for(n=1;n<=t.nC1_;++n)r=Math.floor((t.nC1_-n)/2),i[n]=a*s.polyval(r,h,l,o)/h[l+r+1],l+=r+2,a*=e},c=[205,-432,768,1536,4005,-4736,3840,12288,-225,116,384,-7173,2695,7680,3467,7680,38081,61440],t.C1pf=function(e,i){var n,r,o=s.sq(e),a=e,l=0;for(n=1;n<=t.nC1p_;++n)r=Math.floor((t.nC1p_-n)/2),i[n]=a*s.polyval(r,c,l,o)/c[l+r+1],l+=r+2,a*=e},f=[-11,-28,-192,0,256],t.A2m1f=function(t){var e=Math.floor(3);return(s.polyval(e,f,0,s.sq(t))/f[e+1]-t)/(1+t)},u=[1,2,16,32,35,64,384,2048,15,80,768,7,35,512,63,1280,77,2048],t.C2f=function(e,i){var n,r,o=s.sq(e),a=e,l=0;for(n=1;n<=t.nC2_;++n)r=Math.floor((t.nC2_-n)/2),i[n]=a*s.polyval(r,u,l,o)/u[l+r+1],l+=r+2,a*=e},t.Geodesic=function(t,e){if(this.a=t,this.f=e,this._f1=1-this.f,this._e2=this.f*(2-this.f),this._ep2=this._e2/s.sq(this._f1),this._n=this.f/(2-this.f),this._b=this.a*this._f1,this._c2=(s.sq(this.a)+s.sq(this._b)*(0===this._e2?1:(this._e2>0?s.atanh(Math.sqrt(this._e2)):Math.atan(Math.sqrt(-this._e2)))/Math.sqrt(Math.abs(this._e2))))/2,this._etol2=.1*v/Math.sqrt(Math.max(.001,Math.abs(this.f))*Math.min(1,1-this.f/2)/2),!(isFinite(this.a)&&this.a>0))throw new Error("Equatorial radius is not positive");if(!(isFinite(this._b)&&this._b>0))throw new Error("Polar semi-axis is not positive");this._A3x=new Array(6),this._C3x=new Array(r),this._C4x=new Array(o),this.A3coeff(),this.C3coeff(),this.C4coeff()},_=[-3,128,-2,-3,64,-1,-3,-1,16,3,-1,-2,8,1,-1,2,1,1],t.Geodesic.prototype.A3coeff=function(){var t,e,i=0,n=0;for(t=5;t>=0;--t)e=Math.min(6-t-1,t),this._A3x[n++]=s.polyval(e,_,i,this._n)/_[i+e+1],i+=e+2},d=[3,128,2,5,128,-1,3,3,64,-1,0,1,8,-1,1,4,5,256,1,3,128,-3,-2,3,64,1,-3,2,32,7,512,-10,9,384,5,-9,5,192,7,512,-14,7,512,21,2560],t.Geodesic.prototype.C3coeff=function(){var e,i,n,r=0,o=0;for(e=1;e<t.nC3_;++e)for(i=t.nC3_-1;i>=e;--i)n=Math.min(t.nC3_-i-1,i),this._C3x[o++]=s.polyval(n,d,r,this._n)/d[r+n+1],r+=n+2},p=[97,15015,1088,156,45045,-224,-4784,1573,45045,-10656,14144,-4576,-858,45045,64,624,-4576,6864,-3003,15015,100,208,572,3432,-12012,30030,45045,1,9009,-2944,468,135135,5792,1040,-1287,135135,5952,-11648,9152,-2574,135135,-64,-624,4576,-6864,3003,135135,8,10725,1856,-936,225225,-8448,4992,-1144,225225,-1440,4160,-4576,1716,225225,-136,63063,1024,-208,105105,3584,-3328,1144,315315,-128,135135,-2560,832,405405,128,99099],t.Geodesic.prototype.C4coeff=function(){var e,i,n,r=0,o=0;for(e=0;e<t.nC4_;++e)for(i=t.nC4_-1;i>=e;--i)n=t.nC4_-i-1,this._C4x[o++]=s.polyval(n,p,r,this._n)/p[r+n+1],r+=n+2},t.Geodesic.prototype.A3f=function(t){return s.polyval(5,this._A3x,0,t)},t.Geodesic.prototype.C3f=function(e,i){var n,r,o=1,a=0;for(n=1;n<t.nC3_;++n)r=t.nC3_-n-1,o*=e,i[n]=o*s.polyval(r,this._C3x,a,e),a+=r+1},t.Geodesic.prototype.C4f=function(e,i){var n,r,o=1,a=0;for(n=0;n<t.nC4_;++n)r=t.nC4_-n-1,i[n]=o*s.polyval(r,this._C4x,a,e),a+=r+1,o*=e},t.Geodesic.prototype.Lengths=function(e,i,s,n,r,o,a,l,h,c,f,u,_){var d,p,m,g,b={},v=0,w=0,y=0,x=0;if((f&=t.OUT_MASK)&(t.DISTANCE|t.REDUCEDLENGTH|t.GEODESICSCALE)&&(y=t.A1m1f(e),t.C1f(e,u),f&(t.REDUCEDLENGTH|t.GEODESICSCALE)&&(x=t.A2m1f(e),t.C2f(e,_),v=y-x,x=1+x),y=1+y),f&t.DISTANCE)d=t.SinCosSeries(!0,o,a,u)-t.SinCosSeries(!0,s,n,u),b.s12b=y*(i+d),f&(t.REDUCEDLENGTH|t.GEODESICSCALE)&&(w=v*i+(y*d-x*(t.SinCosSeries(!0,o,a,_)-t.SinCosSeries(!0,s,n,_))));else if(f&(t.REDUCEDLENGTH|t.GEODESICSCALE)){for(p=1;p<=t.nC2_;++p)_[p]=y*u[p]-x*_[p];w=v*i+(t.SinCosSeries(!0,o,a,_)-t.SinCosSeries(!0,s,n,_))}return f&t.REDUCEDLENGTH?(b.m0=v,b.m12b=l*(n*o)-r*(s*a)-n*a*w):b.m12b=NaN,f&t.GEODESICSCALE&&(m=n*a+s*o,g=this._ep2*(h-c)*(h+c)/(r+l),b.M12=m+(g*o-a*w)*s/r,b.M21=m-(g*s-n*w)*o/l),b},t.Geodesic.prototype.InverseStart=function(e,i,n,r,o,l,h,c,f,u,_){var d,p,m,g,v,w,x,A,E,M,S,T,C,N,R,G,I,D,B,P,F={},L=r*i-o*e,z=o*i+r*e;return F.sig12=-1,d=r*i,d+=o*e,(p=z>=0&&L<.5&&o*h<.5)?(g=s.sq(e+r),g/=g+s.sq(i+o),F.dnm=Math.sqrt(1+this._ep2*g),m=h/(this._f1*F.dnm),v=Math.sin(m),w=Math.cos(m)):(v=c,w=f),F.salp1=o*v,F.calp1=w>=0?L+o*e*s.sq(v)/(1+w):d-o*e*s.sq(v)/(1-w),A=s.hypot(F.salp1,F.calp1),E=e*r+i*o*w,p&&A<this._etol2?(F.salp2=i*v,F.calp2=L-i*r*(w>=0?s.sq(v)/(1+w):1-w),x=s.hypot(F.salp2,F.calp2),F.salp2/=x,F.calp2/=x,F.sig12=Math.atan2(A,E)):Math.abs(this._n)>.1||E>=0||A>=6*Math.abs(this._n)*Math.PI*s.sq(i)||(P=Math.atan2(-c,-f),this.f>=0?(N=(C=s.sq(e)*this._ep2)/(2*(1+Math.sqrt(1+C))+C),M=P/(T=this.f*i*this.A3f(N)*Math.PI),S=d/(T*i)):(R=o*i-r*e,G=Math.atan2(d,R),S=h/(T=((M=(I=this.Lengths(this._n,Math.PI+G,e,-i,n,r,o,l,i,o,t.REDUCEDLENGTH,u,_)).m12b/(i*o*I.m0*Math.PI)-1)<-.01?d/M:-this.f*s.sq(i)*Math.PI)/i)),S>-b&&M>-1-y?this.f>=0?(F.salp1=Math.min(1,-M),F.calp1=-Math.sqrt(1-s.sq(F.salp1))):(F.calp1=Math.max(M>-b?0:-1,M),F.salp1=Math.sqrt(1-s.sq(F.calp1))):(D=a(M,S),B=T*(this.f>=0?-M*D/(1+D):-S*(1+D)/D),v=Math.sin(B),w=-Math.cos(B),F.salp1=o*v,F.calp1=d-o*e*s.sq(v)/(1-w))),F.salp1<=0?(F.salp1=1,F.calp1=0):(x=s.hypot(F.salp1,F.calp1),F.salp1/=x,F.calp1/=x),F},t.Geodesic.prototype.Lambda12=function(e,i,n,r,o,a,l,h,c,f,u,_,d,p){var m,g,b,v,w,y,x,A,E,M,S,T,C,N={};return 0===e&&0===h&&(h=-t.tiny_),g=l*i,b=s.hypot(h,l*e),N.ssig1=e,v=g*e,N.csig1=w=h*i,m=s.hypot(N.ssig1,N.csig1),N.ssig1/=m,N.csig1/=m,N.salp2=o!==i?g/o:l,N.calp2=o!==i||Math.abs(r)!==-e?Math.sqrt(s.sq(h*i)+(i<-e?(o-i)*(i+o):(e-r)*(e+r)))/o:Math.abs(h),N.ssig2=r,y=g*r,N.csig2=x=N.calp2*o,m=s.hypot(N.ssig2,N.csig2),N.ssig2/=m,N.csig2/=m,N.sig12=Math.atan2(Math.max(0,N.csig1*N.ssig2-N.ssig1*N.csig2),N.csig1*N.csig2+N.ssig1*N.ssig2),A=Math.max(0,w*y-v*x),E=w*x+v*y,S=Math.atan2(A*f-E*c,E*f+A*c),T=s.sq(b)*this._ep2,N.eps=T/(2*(1+Math.sqrt(1+T))+T),this.C3f(N.eps,p),M=t.SinCosSeries(!0,N.ssig2,N.csig2,p)-t.SinCosSeries(!0,N.ssig1,N.csig1,p),N.domg12=-this.f*this.A3f(N.eps)*g*(N.sig12+M),N.lam12=S+N.domg12,u&&(0===N.calp2?N.dlam12=-2*this._f1*n/e:(C=this.Lengths(N.eps,N.sig12,N.ssig1,N.csig1,n,N.ssig2,N.csig2,a,i,o,t.REDUCEDLENGTH,_,d),N.dlam12=C.m12b,N.dlam12*=this._f1/(N.calp2*o))),N},t.Geodesic.prototype.Inverse=function(e,i,n,r,o){var a,l;return o||(o=t.STANDARD),o===t.LONG_UNROLL&&(o|=t.STANDARD),o&=t.OUT_MASK,l=(a=this.InverseInt(e,i,n,r,o)).vals,o&t.AZIMUTH&&(l.azi1=s.atan2d(a.salp1,a.calp1),l.azi2=s.atan2d(a.salp2,a.calp2)),l},t.Geodesic.prototype.InverseInt=function(e,i,n,r,o){var a,l,h,c,f,u,_,d,p,b,y,x,A,E,M,S,T,C,N,R,G,I,D,B,P,F,L,z,O,U,k,j,$,H,V,q,W,X,Z,K,Y,J,Q,tt,et,it,st,nt,rt,ot,at,lt,ht,ct,ft,ut,_t,dt,pt,mt,gt,bt,vt,wt,yt,xt={};if(xt.lat1=e=s.LatFix(e),xt.lat2=n=s.LatFix(n),e=s.AngRound(e),n=s.AngRound(n),l=(a=s.AngDiff(i,r)).e,a=a.d,o&t.LONG_UNROLL?(xt.lon1=i,xt.lon2=i+a+l):(xt.lon1=s.AngNormalize(i),xt.lon2=s.AngNormalize(r)),l*=h=s.copysign(1,a),M=(a*=h)*s.degree,S=(c=s.sincosde(a,l)).s,T=c.c,l=180-a-l,(f=Math.abs(e)<Math.abs(n)||isNaN(n)?-1:1)<0&&(h*=-1,[n,e]=[e,n]),e*=u=s.copysign(1,-e),n*=u,c=s.sincosd(e),_=this._f1*c.s,d=c.c,_/=c=s.hypot(_,d),d/=c,d=Math.max(t.tiny_,d),c=s.sincosd(n),p=this._f1*c.s,b=c.c,p/=c=s.hypot(p,b),b/=c,b=Math.max(t.tiny_,b),d<-_?b===d&&(p=s.copysign(_,p)):Math.abs(p)===-_&&(b=d),A=Math.sqrt(1+this._ep2*s.sq(_)),E=Math.sqrt(1+this._ep2*s.sq(p)),D=new Array(t.nC1_+1),B=new Array(t.nC2_+1),P=new Array(t.nC3_),(F=-90===e||0===S)&&(R=S,I=0,z=_,O=(N=T)*d,U=p,k=(G=1)*b,C=Math.atan2(Math.max(0,O*U-z*k),O*k+z*U),y=(L=this.Lengths(this._n,C,z,O,A,U,k,E,d,b,o|t.DISTANCE|t.REDUCEDLENGTH,D,B)).s12b,x=L.m12b,o&t.GEODESICSCALE&&(xt.M12=L.M12,xt.M21=L.M21),C<v||x>=0?((C<3*t.tiny_||C<g&&(y<0||x<0))&&(C=x=y=0),x*=this._b,y*=this._b,xt.a12=C/s.degree):F=!1),_t=2,!F&&0===_&&(this.f<=0||l>=180*this.f))N=G=0,R=I=1,y=this.a*M,C=$=M/this._f1,x=this._b*Math.sin(C),o&t.GEODESICSCALE&&(xt.M12=xt.M21=Math.cos(C)),xt.a12=a/this._f1;else if(!F)if(C=(L=this.InverseStart(_,d,A,p,b,E,M,S,T,D,B)).sig12,R=L.salp1,N=L.calp1,C>=0)I=L.salp2,G=L.calp2,H=L.dnm,y=C*this._b*H,x=s.sq(H)*this._b*Math.sin(C/H),o&t.GEODESICSCALE&&(xt.M12=xt.M21=Math.cos(C/H)),xt.a12=C/s.degree,$=M/(this._f1*H);else{for(V=0,q=t.tiny_,W=1,X=t.tiny_,Z=-1,K=!1,Y=!1;J=(L=this.Lambda12(_,d,A,p,b,E,R,N,S,T,V<20,D,B,P)).lam12,I=L.salp2,G=L.calp2,C=L.sig12,z=L.ssig1,O=L.csig1,U=L.ssig2,k=L.csig2,j=L.eps,pt=L.domg12,Q=L.dlam12,!Y&&Math.abs(J)>=(K?8:1)*g&&V!=m;++V)J>0&&(V<20||N/R>Z/X)?(X=R,Z=N):J<0&&(V<20||N/R<W/q)&&(q=R,W=N),V<20&&Q>0&&(tt=-J/Q,Math.abs(tt)<Math.PI&&(et=Math.sin(tt),(st=R*(it=Math.cos(tt))+N*et)>0))?(N=N*it-R*et,R=st,R/=c=s.hypot(R,N),N/=c,K=Math.abs(J)<=16*g):(R=(q+X)/2,N=(W+Z)/2,R/=c=s.hypot(R,N),N/=c,K=!1,Y=Math.abs(q-R)+(W-N)<w||Math.abs(R-X)+(N-Z)<w);nt=o|(o&(t.REDUCEDLENGTH|t.GEODESICSCALE)?t.DISTANCE:t.NONE),y=(L=this.Lengths(j,C,z,O,A,U,k,E,d,b,nt,D,B)).s12b,x=L.m12b,o&t.GEODESICSCALE&&(xt.M12=L.M12,xt.M21=L.M21),x*=this._b,y*=this._b,xt.a12=C/s.degree,o&t.AREA&&(wt=Math.sin(pt),_t=S*(yt=Math.cos(pt))-T*wt,dt=T*yt+S*wt)}return o&t.DISTANCE&&(xt.s12=0+y),o&t.REDUCEDLENGTH&&(xt.m12=0+x),o&t.AREA&&(rt=R*d,0!==(ot=s.hypot(N,R*_))&&0!==rt?(z=_,O=N*d,U=p,k=G*b,j=(lt=s.sq(ot)*this._ep2)/(2*(1+Math.sqrt(1+lt))+lt),ht=s.sq(this.a)*ot*rt*this._e2,z/=c=s.hypot(z,O),O/=c,U/=c=s.hypot(U,k),k/=c,ct=new Array(t.nC4_),this.C4f(j,ct),ft=t.SinCosSeries(!1,z,O,ct),ut=t.SinCosSeries(!1,U,k,ct),xt.S12=ht*(ut-ft)):xt.S12=0,F||2!=_t||(_t=Math.sin($),dt=Math.cos($)),!F&&dt>-.7071&&p-_<1.75?(pt=1+dt,mt=1+d,gt=1+b,at=2*Math.atan2(_t*(_*gt+p*mt),pt*(_*p+mt*gt))):(vt=G*N+I*R,0===(bt=I*N-G*R)&&vt<0&&(bt=t.tiny_*N,vt=-1),at=Math.atan2(bt,vt)),xt.S12+=this._c2*at,xt.S12*=f*h*u,xt.S12+=0),f<0&&([I,R]=[R,I],[G,N]=[N,G],o&t.GEODESICSCALE&&([xt.M21,xt.M12]=[xt.M12,xt.M21])),{vals:xt,salp1:R*=f*h,calp1:N*=f*u,salp2:I*=f*h,calp2:G*=f*u}},t.Geodesic.prototype.GenDirect=function(i,s,n,r,o,a){return a?a===t.LONG_UNROLL&&(a|=t.STANDARD):a=t.STANDARD,r||(a|=t.DISTANCE_IN),new e.GeodesicLine(this,i,s,n,a).GenPosition(r,o,a)},t.Geodesic.prototype.Direct=function(t,e,i,s,n){return this.GenDirect(t,e,i,!1,s,n)},t.Geodesic.prototype.ArcDirect=function(t,e,i,s,n){return this.GenDirect(t,e,i,!0,s,n)},t.Geodesic.prototype.Line=function(t,i,s,n){return new e.GeodesicLine(this,t,i,s,n)},t.Geodesic.prototype.DirectLine=function(t,e,i,s,n){return this.GenDirectLine(t,e,i,!1,s,n)},t.Geodesic.prototype.ArcDirectLine=function(t,e,i,s,n){return this.GenDirectLine(t,e,i,!0,s,n)},t.Geodesic.prototype.GenDirectLine=function(i,s,n,r,o,a){var l;return a||(a=t.STANDARD|t.DISTANCE_IN),r||(a|=t.DISTANCE_IN),(l=new e.GeodesicLine(this,i,s,n,a)).GenSetDistance(r,o),l},t.Geodesic.prototype.InverseLine=function(i,n,r,o,a){var l,h,c;return a||(a=t.STANDARD|t.DISTANCE_IN),l=this.InverseInt(i,n,r,o,t.ARC),c=s.atan2d(l.salp1,l.calp1),a&t.OUT_MASK&t.DISTANCE_IN&&(a|=t.DISTANCE),(h=new e.GeodesicLine(this,i,n,c,a,l.salp1,l.calp1)).SetArc(l.vals.a12),h},t.Geodesic.prototype.Polygon=function(t){return new i.PolygonArea(this,t)},t.WGS84=new t.Geodesic(n.WGS84.a,n.WGS84.f)}(n.Geodesic,n.GeodesicLine,n.PolygonArea,n.Math,n.Constants),function(t,e,i){"use strict";e.GeodesicLine=function(e,s,n,r,o,a,l){var h,c,f,u,_,d;o||(o=t.STANDARD|t.DISTANCE_IN),this.a=e.a,this.f=e.f,this._b=e._b,this._c2=e._c2,this._f1=e._f1,this.caps=o|t.LATITUDE|t.AZIMUTH|t.LONG_UNROLL,this.lat1=i.LatFix(s),this.lon1=n,void 0===a||void 0===l?(this.azi1=i.AngNormalize(r),h=i.sincosd(i.AngRound(this.azi1)),this.salp1=h.s,this.calp1=h.c):(this.azi1=r,this.salp1=a,this.calp1=l),h=i.sincosd(i.AngRound(this.lat1)),f=this._f1*h.s,c=h.c,f/=h=i.hypot(f,c),c/=h,c=Math.max(t.tiny_,c),this._dn1=Math.sqrt(1+e._ep2*i.sq(f)),this._salp0=this.salp1*c,this._calp0=i.hypot(this.calp1,this.salp1*f),this._ssig1=f,this._somg1=this._salp0*f,this._csig1=this._comg1=0!==f||0!==this.calp1?c*this.calp1:1,h=i.hypot(this._ssig1,this._csig1),this._ssig1/=h,this._csig1/=h,this._k2=i.sq(this._calp0)*e._ep2,u=this._k2/(2*(1+Math.sqrt(1+this._k2))+this._k2),this.caps&t.CAP_C1&&(this._A1m1=t.A1m1f(u),this._C1a=new Array(t.nC1_+1),t.C1f(u,this._C1a),this._B11=t.SinCosSeries(!0,this._ssig1,this._csig1,this._C1a),_=Math.sin(this._B11),d=Math.cos(this._B11),this._stau1=this._ssig1*d+this._csig1*_,this._ctau1=this._csig1*d-this._ssig1*_),this.caps&t.CAP_C1p&&(this._C1pa=new Array(t.nC1p_+1),t.C1pf(u,this._C1pa)),this.caps&t.CAP_C2&&(this._A2m1=t.A2m1f(u),this._C2a=new Array(t.nC2_+1),t.C2f(u,this._C2a),this._B21=t.SinCosSeries(!0,this._ssig1,this._csig1,this._C2a)),this.caps&t.CAP_C3&&(this._C3a=new Array(t.nC3_),e.C3f(u,this._C3a),this._A3c=-this.f*this._salp0*e.A3f(u),this._B31=t.SinCosSeries(!0,this._ssig1,this._csig1,this._C3a)),this.caps&t.CAP_C4&&(this._C4a=new Array(t.nC4_),e.C4f(u,this._C4a),this._A4=i.sq(this.a)*this._calp0*this._salp0*e._e2,this._B41=t.SinCosSeries(!1,this._ssig1,this._csig1,this._C4a)),this.a13=this.s13=NaN},e.GeodesicLine.prototype.GenPosition=function(e,s,n){var r,o,a,l,h,c,f,u,_,d,p,m,g,b,v,w,y,x,A,E,M,S,T,C,N,R,G={};return n?n===t.LONG_UNROLL&&(n|=t.STANDARD):n=t.STANDARD,n&=this.caps&t.OUT_MASK,G.lat1=this.lat1,G.azi1=this.azi1,G.lon1=n&t.LONG_UNROLL?this.lon1:i.AngNormalize(this.lon1),e?G.a12=s:G.s12=s,e||this.caps&t.DISTANCE_IN&t.OUT_MASK?(l=0,h=0,e?(r=s*i.degree,o=(T=i.sincosd(s)).s,a=T.c):(u=s/(this._b*(1+this._A1m1)),_=Math.sin(u),d=Math.cos(u),r=u-((l=-t.SinCosSeries(!0,this._stau1*d+this._ctau1*_,this._ctau1*d-this._stau1*_,this._C1pa))-this._B11),o=Math.sin(r),a=Math.cos(r),Math.abs(this.f)>.01&&(c=this._ssig1*a+this._csig1*o,f=this._csig1*a-this._ssig1*o,l=t.SinCosSeries(!0,c,f,this._C1a),r-=((1+this._A1m1)*(r+(l-this._B11))-s/this._b)/Math.sqrt(1+this._k2*i.sq(c)),o=Math.sin(r),a=Math.cos(r))),c=this._ssig1*a+this._csig1*o,f=this._csig1*a-this._ssig1*o,A=Math.sqrt(1+this._k2*i.sq(c)),n&(t.DISTANCE|t.REDUCEDLENGTH|t.GEODESICSCALE)&&((e||Math.abs(this.f)>.01)&&(l=t.SinCosSeries(!0,c,f,this._C1a)),h=(1+this._A1m1)*(l-this._B11)),g=this._calp0*c,0===(b=i.hypot(this._salp0,this._calp0*f))&&(b=f=t.tiny_),y=this._salp0,x=this._calp0*f,e&&n&t.DISTANCE&&(G.s12=this._b*((1+this._A1m1)*r+h)),n&t.LONGITUDE&&(v=this._salp0*c,w=f,m=i.copysign(1,this._salp0),p=((n&t.LONG_UNROLL?m*(r-(Math.atan2(c,f)-Math.atan2(this._ssig1,this._csig1))+(Math.atan2(m*v,w)-Math.atan2(m*this._somg1,this._comg1))):Math.atan2(v*this._comg1-w*this._somg1,w*this._comg1+v*this._somg1))+this._A3c*(r+(t.SinCosSeries(!0,c,f,this._C3a)-this._B31)))/i.degree,G.lon2=n&t.LONG_UNROLL?this.lon1+p:i.AngNormalize(i.AngNormalize(this.lon1)+i.AngNormalize(p))),n&t.LATITUDE&&(G.lat2=i.atan2d(g,this._f1*b)),n&t.AZIMUTH&&(G.azi2=i.atan2d(y,x)),n&(t.REDUCEDLENGTH|t.GEODESICSCALE)&&(E=t.SinCosSeries(!0,c,f,this._C2a),M=(1+this._A2m1)*(E-this._B21),S=(this._A1m1-this._A2m1)*r+(h-M),n&t.REDUCEDLENGTH&&(G.m12=this._b*(A*(this._csig1*c)-this._dn1*(this._ssig1*f)-this._csig1*f*S)),n&t.GEODESICSCALE&&(T=this._k2*(c-this._ssig1)*(c+this._ssig1)/(this._dn1+A),G.M12=a+(T*c-f*S)*this._ssig1/this._dn1,G.M21=a-(T*this._ssig1-this._csig1*S)*c/A)),n&t.AREA&&(C=t.SinCosSeries(!1,c,f,this._C4a),0===this._calp0||0===this._salp0?(N=y*this.calp1-x*this.salp1,R=x*this.calp1+y*this.salp1):(N=this._calp0*this._salp0*(a<=0?this._csig1*(1-a)+o*this._ssig1:o*(this._csig1*o/(1+a)+this._ssig1)),R=i.sq(this._salp0)+i.sq(this._calp0)*this._csig1*f),G.S12=this._c2*Math.atan2(N,R)+this._A4*(C-this._B41)),e||(G.a12=r/i.degree),G):(G.a12=NaN,G)},e.GeodesicLine.prototype.Position=function(t,e){return this.GenPosition(!1,t,e)},e.GeodesicLine.prototype.ArcPosition=function(t,e){return this.GenPosition(!0,t,e)},e.GeodesicLine.prototype.GenSetDistance=function(t,e){t?this.SetArc(e):this.SetDistance(e)},e.GeodesicLine.prototype.SetDistance=function(e){var i;this.s13=e,i=this.GenPosition(!1,this.s13,t.ARC),this.a13=0+i.a12},e.GeodesicLine.prototype.SetArc=function(e){var i;this.a13=e,i=this.GenPosition(!0,this.a13,t.DISTANCE),this.s13=0+i.s12}}(n.Geodesic,n.GeodesicLine,n.Math),function(t,e,i,s){"use strict";var n,r,o,a;n=function(t,e){var s=i.AngDiff(t,e).d;return t=i.AngNormalize(t),e=i.AngNormalize(e),s>0&&(t<0&&e>=0||t>0&&0===e)?1:s<0&&t>=0&&e<0?-1:0},r=function(t,e){return(0<=(e%=720)&&e<360||e<-360?0:1)-(0<=(t%=720)&&t<360||t<-360?0:1)},o=function(t,e,i,s,n){return t.Remainder(e),1&i&&t.Add((t.Sum()<0?1:-1)*e/2),s||t.Negate(),n?t.Sum()>e/2?t.Add(-e):t.Sum()<=-e/2&&t.Add(+e):t.Sum()>=e?t.Add(-e):t.Sum()<0&&t.Add(+e),0+t.Sum()},a=function(t,e,s,n,r){return t=i.remainder(t,e),1&s&&(t+=(t<0?1:-1)*e/2),n||(t*=-1),r?t>e/2?t-=e:t<=-e/2&&(t+=e):t>=e?t-=e:t<0&&(t+=e),0+t},t.PolygonArea=function(t,i){this._geod=t,this.a=this._geod.a,this.f=this._geod.f,this._area0=4*Math.PI*t._c2,this.polyline=i||!1,this._mask=e.LATITUDE|e.LONGITUDE|e.DISTANCE|(this.polyline?e.NONE:e.AREA|e.LONG_UNROLL),this.polyline||(this._areasum=new s.Accumulator(0)),this._perimetersum=new s.Accumulator(0),this.Clear()},t.PolygonArea.prototype.Clear=function(){this.num=0,this._crossings=0,this.polyline||this._areasum.Set(0),this._perimetersum.Set(0),this._lat0=this._lon0=this.lat=this.lon=NaN},t.PolygonArea.prototype.AddPoint=function(t,e){var i;0===this.num?(this._lat0=this.lat=t,this._lon0=this.lon=e):(i=this._geod.Inverse(this.lat,this.lon,t,e,this._mask),this._perimetersum.Add(i.s12),this.polyline||(this._areasum.Add(i.S12),this._crossings+=n(this.lon,e)),this.lat=t,this.lon=e),++this.num},t.PolygonArea.prototype.AddEdge=function(t,e){var i;this.num&&(i=this._geod.Direct(this.lat,this.lon,t,e,this._mask),this._perimetersum.Add(e),this.polyline||(this._areasum.Add(i.S12),this._crossings+=r(this.lon,i.lon2)),this.lat=i.lat2,this.lon=i.lon2),++this.num},t.PolygonArea.prototype.Compute=function(t,e){var i,r,a={number:this.num};return this.num<2?(a.perimeter=0,this.polyline||(a.area=0),a):this.polyline?(a.perimeter=this._perimetersum.Sum(),a):(i=this._geod.Inverse(this.lat,this.lon,this._lat0,this._lon0,this._mask),a.perimeter=this._perimetersum.Sum(i.s12),(r=new s.Accumulator(this._areasum)).Add(i.S12),a.area=o(r,this._area0,this._crossings+n(this.lon,this._lon0),t,e),a)},t.PolygonArea.prototype.TestPoint=function(t,e,i,s){var r,o,l,h,c={number:this.num+1};if(0===this.num)return c.perimeter=0,this.polyline||(c.area=0),c;for(c.perimeter=this._perimetersum.Sum(),o=this.polyline?0:this._areasum.Sum(),l=this._crossings,h=0;h<(this.polyline?1:2);++h)r=this._geod.Inverse(0===h?this.lat:t,0===h?this.lon:e,0!==h?this._lat0:t,0!==h?this._lon0:e,this._mask),c.perimeter+=r.s12,this.polyline||(o+=r.S12,l+=n(0===h?this.lon:e,0!==h?this._lon0:e));return this.polyline||(c.area=a(o,this._area0,l,i,s)),c},t.PolygonArea.prototype.TestEdge=function(t,e,i,s){var o,l,h,c={number:this.num?this.num+1:0};return 0===this.num||(c.perimeter=this._perimetersum.Sum()+e,this.polyline||(l=this._areasum.Sum(),h=this._crossings,l+=(o=this._geod.Direct(this.lat,this.lon,t,e,this._mask)).S12,h+=r(this.lon,o.lon2),h+=n(o.lon2,this._lon0),o=this._geod.Inverse(o.lat2,o.lon2,this._lat0,this._lon0,this._mask),c.perimeter+=o.s12,l+=o.S12,c.area=a(l,this._area0,h,i,s))),c}}(n.PolygonArea,n.Geodesic,n.Math,n.Accumulator),s=n,t.exports?t.exports=s:void 0===(i=function(){return s}.apply(e,[]))||(t.exports=i)},401:t=>{t.exports="#version 300 es\n\nin highp vec2 v_tex_coord;\n\n#ifdef MASK\nuniform sampler2D u_mask_sampler;\n#endif\n\nuniform highp float u_opacity;\n#ifdef MASK\nuniform int u_mask_val;\n#endif\n\nout highp vec4 fragColor;\n\nvoid main() {\n highp float fill_val = get_field_value(v_tex_coord);\n\n int draw_mask = 1;\n\n#ifdef MASK\n highp float mask_val = texture(u_mask_sampler, v_tex_coord).r;\n draw_mask = int(mask_val * 255.0) == u_mask_val ? 1 : 0;\n#endif\n\n if (isnan(fill_val) || draw_mask == 0) {\n discard;\n }\n\n lowp vec4 color = apply_colormap(fill_val);\n color.a = color.a * u_opacity;\n fragColor = color;\n}"},631:t=>{t.exports="#version 300 es\n\nuniform int u_offset;\n\nin vec2 a_pos; // Has grid point position\nin vec2 a_tex_coord; // zoom info is on the x coordinate\nin lowp float a_geom; // Has corner info\nuniform lowp float u_bb_size;\nuniform lowp float u_map_aspect;\nuniform lowp float u_zoom;\nuniform lowp float u_bb_width; // Normalized by texture width\nuniform lowp float u_bb_height; // Normalized by texture height\nuniform highp float u_bb_mag_bin_size;\nuniform highp float u_bb_mag_wrap;\nuniform int u_rotate_with_map;\n\nuniform sampler2D u_rot_sampler;\n\nout highp vec2 v_tex_coord;\n#ifdef COLORMAP\nout highp float v_mag;\n#endif\n\nmat4 scalingMatrix(float x_scale, float y_scale, float z_scale) {\n return mat4(x_scale, 0.0, 0.0, 0.0,\n 0.0, y_scale, 0.0, 0.0,\n 0.0, 0.0, z_scale, 0.0,\n 0.0, 0.0, 0.0, 1.0);\n}\n\nmat4 rotationZMatrix(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n\n return mat4( c, s, 0., 0.,\n -s, c, 0., 0.,\n 0., 0., 1., 0.,\n 0., 0., 0., 1.);\n}\n\nmat4 rotationXMatrix(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n\n return mat4( 1., 0., 0., 0.,\n 0., c, s, 0.,\n 0., -s, c, 0.,\n 0., 0., 0., 1.);\n}\n\nvoid main() {\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n mat4 map_stretch_matrix = scalingMatrix(1.0, 1. / u_map_aspect, 1.0);\n\n vec4 pivot_pos = projectTile(a_pos.xy + globe_offset);\n float globe_rotation = 0.0;\n\n if (u_rotate_with_map == 1) {\n vec4 pivot_pos_ihat = projectTile(a_pos.xy + globe_offset + vec2(1e-5, 0.));\n // Surely there's a more linear-algebra-y way to do this than converting all the rotations to an angle.\n vec2 pivot_east = normalize((inverse(map_stretch_matrix) * (pivot_pos_ihat - pivot_pos)).xy);\n globe_rotation = atan(pivot_east.x, pivot_east.y) - 3.141592654 / 2.0;\n }\n\n highp float min_zoom = floor(a_tex_coord.x);\n lowp float corner = a_geom;\n\n vec2 data_texcoord = a_tex_coord;\n data_texcoord.x = fract(data_texcoord.x);\n\n highp float u = get_field_value_u(data_texcoord);\n highp float v = get_field_value_v(data_texcoord);\n highp float rot = texture(u_rot_sampler, data_texcoord).r;\n\n lowp float bb_aspect = u_bb_width / u_bb_height;\n lowp float ang = (abs(u) < 1e-6 && abs(v) < 1e-6) ? 0. : atan(v, u) - 3.141592654 / 2.0;\n highp float mag = length(vec2(u, v));\n#ifdef COLORMAP\n v_mag = mag;\n#endif\n mag = floor(mag / u_bb_mag_bin_size + 0.5) * u_bb_mag_bin_size;\n\n vec4 offset = vec4(0.0, 0.0, 0.0, 0.0);\n vec2 texcoord = vec2(0.0, 0.0);\n \n if (u_zoom >= min_zoom) {\n // Subtracting a small number off of u_bb_mag_wrap fixes (I think) a precision issue on some GPUs\n vec2 tex_loc = vec2(mod(mag, u_bb_mag_wrap - 1e-5) / u_bb_mag_bin_size * u_bb_width, floor(mag / (u_bb_mag_wrap - 1e-5)) * u_bb_height);\n\n if (corner < 0.5) {\n offset = vec4(-u_bb_size, u_bb_size, 0., 0.);\n texcoord = tex_loc;\n }\n else if (corner < 1.5) {\n offset = vec4(u_bb_size, u_bb_size, 0., 0.);\n texcoord = tex_loc + vec2(u_bb_width, 0.0);\n }\n else if (corner < 2.5) {\n offset = vec4(-u_bb_size, -u_bb_size * (2. / bb_aspect - 1.), 0., 0.);\n texcoord = tex_loc + vec2(0.0, u_bb_height);\n }\n else if (corner < 3.5) {\n offset = vec4(u_bb_size, -u_bb_size * (2. / bb_aspect - 1.), 0., 0.);\n texcoord = tex_loc + vec2(u_bb_width, u_bb_height);\n }\n\n mat4 barb_rotation = rotationZMatrix(ang - globe_rotation - rot);\n offset = map_stretch_matrix * barb_rotation * offset;\n }\n\n gl_Position = pivot_pos + offset;\n v_tex_coord = texcoord;\n}"},820:t=>{t.exports="#version 300 es\n\nuniform int u_offset;\n\nin vec2 a_pos;\nin vec2 a_tex_coord;\n\nout highp vec2 v_tex_coord;\n\nvoid main() {\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n gl_Position = projectTile(a_pos.xy + globe_offset);\n v_tex_coord = a_tex_coord;\n}"},840:t=>{t.exports="#version 300 es\n\nuniform int u_offset;\n\nin vec3 a_pos;\nin vec2 a_extrusion;\nin float a_data;\n\n#ifdef ZOOM\nin float a_min_zoom;\n#endif\n\n#ifdef OFFSET\nin vec2 a_offset;\n#endif\n\nuniform lowp float u_line_width;\nuniform lowp float u_map_width;\nuniform lowp float u_map_height;\n//uniform highp float u_map_bearing;\n\n#ifdef ZOOM\nuniform lowp float u_zoom;\n#endif\n\n#ifdef OFFSET\nuniform int u_offset_rotates_with_map;\nuniform lowp float u_offset_scale;\n#endif\n\n#ifdef DATA\nout highp float v_data;\n#endif\n\nout highp float v_dist;\nout lowp float v_cross;\n\nmat4 scalingMatrix(float x_scale, float y_scale, float z_scale) {\n return mat4(x_scale, 0.0, 0.0, 0.0,\n 0.0, y_scale, 0.0, 0.0,\n 0.0, 0.0, z_scale, 0.0,\n 0.0, 0.0, 0.0, 1.0);\n}\n\nmat4 rotationZMatrix(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n\n return mat4( c, s, 0., 0.,\n -s, c, 0., 0.,\n 0., 0., 1., 0.,\n 0., 0., 0., 1.);\n}\n\nmat4 rotationXMatrix(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n\n return mat4( 1., 0., 0., 0.,\n 0., c, s, 0.,\n 0., -s, c, 0.,\n 0., 0., 0., 1.);\n}\n\nvoid main() {\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n v_dist = abs(a_pos.z);\n v_cross = sign(a_pos.z);\n vec4 center_pos = projectTile(a_pos.xy + globe_offset);\n vec4 offset = vec4(0.0, 0.0, 0.0, 0.0);\n\n#ifdef ZOOM\n if (u_zoom >= a_min_zoom) {\n#endif\n\n vec2 offset_ext = u_line_width * 2. * a_extrusion;\n\n mat4 map_stretch_matrix = scalingMatrix(u_map_height / u_map_width, 1., 1.);\n \n vec4 center_pos_ihat = projectTile(a_pos.xy + globe_offset + vec2(1e-5, 0.));\n // Surely there's a more linear-algebra-y way to do this than converting all the rotations to an angle.\n vec2 center_east = normalize((inverse(map_stretch_matrix) * (center_pos_ihat - center_pos)).xy);\n float globe_rotation = atan(center_east.x, center_east.y) - 3.141592654 / 2.0;\n mat4 rotation_matrix = rotationZMatrix(-globe_rotation);\n\n offset = map_stretch_matrix * rotation_matrix * vec4(offset_ext, 0., 0.);\n\n#ifdef OFFSET\n mat4 offset_matrix = scalingMatrix(1., u_map_width / u_map_height, 1.);\n if (u_offset_rotates_with_map == 1) {\n offset_matrix = offset_matrix * rotation_matrix;\n }\n else {\n offset = map_stretch_matrix * vec4(offset_ext, 0., 0.);\n }\n\n vec2 offset_offset = u_offset_scale * a_offset;\n offset += offset_matrix * vec4(offset_offset, 0., 0.);\n#endif\n\n#ifdef ZOOM\n }\n#endif\n\n gl_Position = center_pos + offset;\n\n#ifdef DATA\n v_data = a_data;\n#endif\n}"},873:t=>{t.exports="#version 300 es\n\nuniform int u_offset;\nuniform highp float u_map_width;\nuniform highp float u_map_height;\nuniform highp float u_map_zoom;\nuniform highp float u_font_size;\n\nin vec3 a_pos;\nin vec2 a_offset;\nin vec2 a_tex_coord;\n\n#ifdef DATA\nin highp float a_value;\n#endif\n\nout highp vec2 v_tex_coord;\n\n#ifdef DATA\nout highp float v_value;\n#endif\n\nmat4 scalingMatrix(float x_scale, float y_scale, float z_scale) {\n return mat4(x_scale, 0.0, 0.0, 0.0,\n 0.0, y_scale, 0.0, 0.0,\n 0.0, 0.0, z_scale, 0.0,\n 0.0, 0.0, 0.0, 1.0);\n}\n\nvoid main() {\n float min_zoom = a_pos.z;\n\n vec2 offset = a_offset;\n if (u_map_zoom < min_zoom)\n offset = vec2(0., 0.);\n\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n mat4 map_stretch_matrix = scalingMatrix(u_map_height / u_map_width, 1., 1.);\n\n gl_Position = projectTile(a_pos.xy + globe_offset) + u_font_size / 12. * 1.5 * map_stretch_matrix * vec4(offset, 0., 0.);\n v_tex_coord = a_tex_coord;\n\n#ifdef DATA\n v_value = a_value;\n#endif\n}"},934:t=>{t.exports="#version 300 es\n\nuniform sampler2D u_dash_sampler;\n\n#ifndef DATA\nuniform lowp vec4 u_color;\n#endif\n\nuniform lowp float u_line_width;\nuniform lowp float u_zoom;\nuniform int u_dash_pattern_length;\n\n#ifdef DATA\nin highp float v_data;\n#endif\n\nin highp float v_dist;\nin lowp float v_cross;\n\nout highp vec4 fragColor;\n\nvoid main() {\n lowp float dash_x = fract(v_dist * 2e2 * pow(2., floor(u_zoom)) / float(u_dash_pattern_length));\n lowp float dash = texture(u_dash_sampler, vec2(dash_x, 0.5)).r;\n\n lowp vec4 color;\n#ifdef DATA\n color = apply_colormap(v_data);\n#else\n color = u_color;\n#endif\n\n lowp float feather = clamp((1. - abs(v_cross)) * u_line_width, 0., 1.);\n color.a *= (dash >= 1. ? 1. : 0.) * feather;\n\n fragColor = color;\n}"},947:t=>{t.exports="#version 300 es\n\nin highp vec2 v_tex_coord;\n\n#ifdef DATA\nin highp float v_value;\n#endif\n\nuniform sampler2D u_sdf_sampler;\nuniform int u_is_halo;\n\n#ifndef DATA\nuniform lowp vec4 u_text_color;\n#endif\nuniform lowp vec4 u_halo_color;\n\n#define SDF_FILL 0.75\n#define SDF_HALO 0.45\n\nout highp vec4 fragColor;\n\nvoid main() {\n highp float sdf_val = texture(u_sdf_sampler, v_tex_coord).r;\n\n lowp float step_width = 0.08;\n lowp float alpha = smoothstep(SDF_FILL - step_width, SDF_FILL + step_width, sdf_val);\n\n#ifdef DATA\n lowp vec4 text_color = apply_colormap(v_value);\n#else\n lowp vec4 text_color = u_text_color;\n#endif\n\n lowp vec4 color = u_is_halo == 1 ? u_halo_color : text_color;\n\n if (u_is_halo == 1) {\n alpha = min(smoothstep(SDF_HALO - step_width, SDF_HALO + step_width, sdf_val), 1.0 - alpha);\n }\n\n color.a *= alpha;\n fragColor = color;\n}"}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={exports:{}};return t[s].call(r.exports,r,r.exports,i),r.exports}i.m=t,i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.u=t=>t+".autumnplot-gl.js",i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;i.g.importScripts&&(t=i.g.location+"");var e=i.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var s=e.getElementsByTagName("script");if(s.length)for(var n=s.length-1;n>-1&&(!t||!/^http(s?):/.test(t));)t=s[n--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=t})(),i.b=document.baseURI||self.location.href;var s={};return(()=>{"use strict";i.r(s),i.d(s,{Barbs:()=>vs,Color:()=>Ci,ColorMap:()=>Ri,ComputedScalarField:()=>Hs,ComputedVectorField:()=>Zs,Contour:()=>as,ContourFill:()=>_s,ContourLabels:()=>os,GeostationaryImage:()=>an,Grid:()=>is,Hodographs:()=>Cs,LambertGrid:()=>nn,MultiPlotLayer:()=>Ps,Paintball:()=>Ms,PlateCarreeGrid:()=>en,PlateCarreeRotatedGrid:()=>sn,PlotComponent:()=>B,PlotLayer:()=>Bs,RadarSweepGrid:()=>on,Raster:()=>us,RawObsField:()=>Ys,RawProfileField:()=>Ks,RawScalarField:()=>js,RawVectorField:()=>Xs,StationPlot:()=>Is,StructuredGrid:()=>Qs,UnstructuredGrid:()=>ss,colormaps:()=>ln,initAutumnPlot:()=>hn,makeColorBar:()=>Ls,makePaintballKey:()=>Os});const t=Symbol("Comlink.proxy"),e=Symbol("Comlink.endpoint"),n=Symbol("Comlink.releaseProxy"),r=Symbol("Comlink.thrown"),o=t=>"object"==typeof t&&null!==t||"function"==typeof t,a=new Map([["proxy",{canHandle:e=>o(e)&&e[t],serialize(t){const{port1:e,port2:i}=new MessageChannel;return l(t,e),[i,[i]]},deserialize:t=>(t.start(),c(t))}],["throw",{canHandle:t=>o(t)&&r in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function l(e,i=self){i.addEventListener("message",function s(n){if(!n||!n.data)return;const{id:o,type:a,path:c}=Object.assign({path:[]},n.data),f=(n.data.argumentList||[]).map(m);let u;try{const i=c.slice(0,-1).reduce((t,e)=>t[e],e),s=c.reduce((t,e)=>t[e],e);switch(a){case"GET":u=s;break;case"SET":i[c.slice(-1)[0]]=m(n.data.value),u=!0;break;case"APPLY":u=s.apply(i,f);break;case"CONSTRUCT":u=function(e){return Object.assign(e,{[t]:!0})}(new s(...f));break;case"ENDPOINT":{const{port1:t,port2:i}=new MessageChannel;l(e,i),u=function(t,e){return d.set(t,e),t}(t,[t])}break;case"RELEASE":u=void 0;break;default:return}}catch(t){u={value:t,[r]:0}}Promise.resolve(u).catch(t=>({value:t,[r]:0})).then(t=>{const[e,n]=p(t);i.postMessage(Object.assign(Object.assign({},e),{id:o}),n),"RELEASE"===a&&(i.removeEventListener("message",s),h(i))})}),i.start&&i.start()}function h(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function c(t,e){return u(t,[],e)}function f(t){if(t)throw new Error("Proxy has been released and is not useable")}function u(t,i=[],s=function(){}){let r=!1;const o=new Proxy(s,{get(e,s){if(f(r),s===n)return()=>g(t,{type:"RELEASE",path:i.map(t=>t.toString())}).then(()=>{h(t),r=!0});if("then"===s){if(0===i.length)return{then:()=>o};const e=g(t,{type:"GET",path:i.map(t=>t.toString())}).then(m);return e.then.bind(e)}return u(t,[...i,s])},set(e,s,n){f(r);const[o,a]=p(n);return g(t,{type:"SET",path:[...i,s].map(t=>t.toString()),value:o},a).then(m)},apply(s,n,o){f(r);const a=i[i.length-1];if(a===e)return g(t,{type:"ENDPOINT"}).then(m);if("bind"===a)return u(t,i.slice(0,-1));const[l,h]=_(o);return g(t,{type:"APPLY",path:i.map(t=>t.toString()),argumentList:l},h).then(m)},construct(e,s){f(r);const[n,o]=_(s);return g(t,{type:"CONSTRUCT",path:i.map(t=>t.toString()),argumentList:n},o).then(m)}});return o}function _(t){const e=t.map(p);return[e.map(t=>t[0]),(i=e.map(t=>t[1]),Array.prototype.concat.apply([],i))];var i}const d=new WeakMap;function p(t){for(const[e,i]of a)if(i.canHandle(t)){const[s,n]=i.serialize(t);return[{type:"HANDLER",name:e,value:s},n]}return[{type:"RAW",value:t},d.get(t)||[]]}function m(t){switch(t.type){case"HANDLER":return a.get(t.name).deserialize(t.value);case"RAW":return t.value}}function g(t,e,i){return new Promise(s=>{const n=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");t.addEventListener("message",function e(i){i.data&&i.data.id&&i.data.id===n&&(t.removeEventListener("message",e),s(i.data))}),t.start&&t.start(),t.postMessage(Object.assign({id:n},e),i)})}function b(t,e,i){let s=1,n=i;for(;t%n!=0||e%n!=0;)s+=1,n/=2;return s}class v{constructor(t,e){this.cached_values={},this.compute_value=t,this.make_key=void 0===e?(...t)=>JSON.stringify(t):e}getValue(...t){const e=this.make_key(...t);return e in this.cached_values||(this.cached_values[e]=this.compute_value(...t)),this.cached_values[e]}}function w(t,e){const i={...e};return void 0!==t&&Object.entries(t).forEach(([t,e])=>{i[t]=e}),i}function y(t){return t.constructor}function x(t,e){const i="#version 300 es\n";return e.startsWith(i)?i+t+"\n"+e.slice(16):t+"\n"+e}function A(t,e,i,s){const n={float16:"sampler2D",float32:"sampler2D",uint8:"lowp usampler2D",uint16:"mediump usampler2D",uint32:"highp usampler2D",int16:"mediump isampler2D",int32:"highp isampler2D"},r={float16:"highp float",float32:"highp float",uint8:"uint",uint16:"uint",uint32:"uint",int16:"int",int32:"int"},o=e.map((t,e)=>`uniform ${n[s[e]]} ${t};`).join("\n"),a=e.map((t,e)=>` ${r[s[e]]} ${t}_val = texture(${t}, tex_coord).r;`).join("\n");return e.forEach(t=>i=i.replaceAll(t,`${t}_val`)),x(`\n${o}\n\n${r[s[0]]} get_field_value(lowp vec2 tex_coord) {\n${a}\n return ${i};\n}`,t)}function E(t){if(0===t.length)return-1;let e=t[0],i=0;for(let s=1;s<t.length;s++)t[s]<e&&(i=s,e=t[s]);return i}function M(t){return"smu"in t&&"smv"in t}function S(t){return t.getParameter(t.VERSION).includes("WebGL 2.0")}function T(t){return"modelViewProjectionMatrix"in(e=t)&&"defaultProjectionData"in e&&"mainMatrix"in e.defaultProjectionData?{type:"maplibre",defaultProjectionData:{clippingPlane:[...t.defaultProjectionData.clippingPlane],fallbackMatrix:[...t.defaultProjectionData.fallbackMatrix],mainMatrix:[...t.defaultProjectionData.mainMatrix],projectionTransition:t.defaultProjectionData.projectionTransition,tileMercatorCoords:[...t.defaultProjectionData.tileMercatorCoords]},farZ:t.farZ,fov:t.fov,modelViewProjectionMatrix:[...t.modelViewProjectionMatrix],nearZ:t.nearZ,projectionMatrix:[...t.projectionMatrix],shaderData:t.shaderData}:{type:"autumn",mainMatrix:[...t],shaderData:null};var e}class C{constructor(t,e){this.workers=t.map(t=>({worker:c(t),is_busy:!1})),e&&this.workers.forEach(t=>e(t.worker)),this.queue=new Map}call(t,e,i){const s=this.workers.map((t,e)=>[t,e]).filter(([t,e])=>!t.is_busy)[0];if(void 0===s)this.enqueue(t,e,i);else{const[n,r]=s,o=()=>{if(this.queueSize(t)>0){const e=this.dequeue(t);if(void 0===e)return;this.startRun(n,t,e.args).then(e.callback).then(o)}};this.startRun(n,t,e).then(i).then(o)}}enqueue(t,e,i){const s=t.join("."),n=this.queue.get(s)||[];n.push({args:e,callback:i}),this.queue.set(s,n)}dequeue(t){const e=t.join("."),i=this.queue.get(e);if(!i)return;const s=i.shift();return this.queue.set(e,i),s}queueSize(t){const e=t.join("."),i=this.queue.get(e);return i?i.length:0}async startRun(t,e,i){let s=t.worker;e.forEach(t=>s=s[t]),t.is_busy=!0;const n=await s(...i);return t.is_busy=!1,n}}function N(t,e,i){return new Proxy(i,{get:(i,s)=>N(t,[...e,s],()=>{}),apply:(i,s,n)=>new Promise((i,s)=>t.call(e,n,i))})}function R(t,e){return N(new C(t,e),[],()=>{})}const G=c(new Worker(new URL(i.p+i.u(983),i.b)));let I=null;function D(t,e){if(null!==I)return I;const s=[];for(let t=0;t<e;t++)s.push(new Worker(new URL(i.p+i.u(812),i.b)));const n=R(s,e=>e.init(t));return I=n,n}class B{}function P(t,e){let i,s,n;const r=S(t);if("float16"==e){const e=t.getExtension("OES_texture_half_float"),o=t.getExtension("OES_texture_half_float_linear");if(r)i=t.R16F,s=t.HALF_FLOAT;else{if(null===e||null===o)throw"Float16 data are not supported on this hardware. Try Float32 data instead.";i=t.LUMINANCE,s=e.HALF_FLOAT_OES}n=2}else if("float32"==e){const e=t.getExtension("OES_texture_float"),o=t.getExtension("OES_texture_float_linear");if(!r&&null===e||!r&&null===o||"iOS"===function(){const t=window.navigator.userAgent,e=window.navigator.platform,i=["Macintosh","MacIntel","MacPPC","Mac68K"];let s=null;return-1!==i.indexOf(e)&&navigator.maxTouchPoints<=1?s="Mac OS":-1!==["iPhone","iPad","iPod"].indexOf(e)||-1!==i.indexOf(e)&&navigator.maxTouchPoints>1?s="iOS":-1!==["Win32","Win64","Windows","WinCE"].indexOf(e)?s="Windows":/Android/.test(t)?s="Android":/Linux/.test(e)&&(s="Linux"),s}())throw"Float32 data are not supported on this hardware. Try Float16 data instead.";i=r?t.R32F:t.LUMINANCE,s=t.FLOAT,n=4}else"uint16"==e?(i=r?t.R16UI:t.LUMINANCE,s=t.UNSIGNED_SHORT,n=2):"uint32"==e?(i=r?t.R32UI:t.LUMINANCE,s=t.UNSIGNED_INT,n=4):"int16"==e?(i=r?t.R16I:t.LUMINANCE,s=t.SHORT,n=2):"int32"==e?(i=r?t.R32I:t.LUMINANCE,s=t.INT,n=4):(i=r?t.R8:t.LUMINANCE,s=t.UNSIGNED_BYTE,n=1);return{format:i,type:s,row_alignment:n}}function F(t){const e=t=>{const e=Math.sin(t);return Math.tan(Math.PI/4-t/2)*Math.pow((1+r*e)/(1-r*e),r/2)},i=t=>{const e=Math.sin(t);return Math.cos(t)/Math.sqrt(1-r*r*e*e)},s=t.a,n=t.b,r=Math.sqrt(1-n*n/(s*s)),o=Math.PI/180;let a,l,{lon_0:h,lat_0:c,lat_std:f}=t;f=Array.isArray(f)&&f[0]==f[1]?f[0]:f,h*=o,c*=o;const u=e(c);if(Array.isArray(f)){let[t,s]=f;t*=o,s*=o;const n=e(t),r=e(s),h=i(t),c=i(s);l=Math.log(h/c)/Math.log(n/r),a=h/(l*Math.pow(n,l))}else{let t=f;t*=o;const s=e(t),n=i(t);l=Math.sin(t),a=n/(l*Math.pow(s,l))}const _=s*a*Math.pow(u,l),d=r*r,p=d*d,m=p*d,g=m*d,b=d/2+5*p/24+3*m/120-73*g/2016,v=7*p/24+29*m/120+233*g/6720,w=7*m/30+81*g/280,y=4729*g/20160;return(t,i,n)=>(n=void 0===n?{inverse:!1}:n).inverse?((t,e)=>{const i=Math.atan2(t,_-e)/l+h,n=Math.hypot(t,_-e)*Math.sign(l),r=Math.pow(n/(s*a),1/l),c=Math.PI/2-2*Math.atan(r),f=Math.sin(2*c),u=Math.cos(2*c);return[i/o,(c+f*(b+u*(v+u*(w+y*u))))/o]})(t,i):((t,i)=>{t*=o;const n=e(i*=o),r=s*a*Math.pow(n,l),c=l*(t-h);return[r*Math.sin(c),_-r*Math.cos(c)]})(t,i)}function L(t){const e=Math.sin(t*Math.PI/180),i=(180-90/Math.PI*Math.log((1+e)/(1-e)))/360;return Math.min(1.5,Math.max(-.5,i))}class z{constructor(t,e){if(isNaN(t)||isNaN(e))this.lng=NaN,this.lat=NaN;else if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}toMercatorCoord(){return isNaN(this.lng)||isNaN(this.lng)?{x:NaN,y:NaN}:{x:(t=this.lng,(180+t)/360),y:L(this.lat)};var t}static fromMercatorCoord(t,e){return isNaN(t)||isNaN(e)?new z(NaN,NaN):new z(function(t){return 360*t-180}(t),function(t){return 180*Math.atan(Math.sinh((180-360*t)*Math.PI/180))/Math.PI}(e))}}function O(t){return t.getParameter(t.VERSION).includes("WebGL 2.0")}class U{constructor(t,e,i,s,n,r){this.gl=t,this.n_coords_per_vert=i,this.dtype=((t,e)=>({Float32Array:t.FLOAT,Uint8Array:t.UNSIGNED_BYTE,Uint16Array:t.UNSIGNED_SHORT,Uint32Array:t.UNSIGNED_INT}[e.constructor.name]))(t,e),this.n_verts=e.length/i,this.draw_mode=s;const o=t.createBuffer();if(null===o)throw"Could not create WebGL buffer";this.buffer=o,t.bindBuffer(n,this.buffer),t.bufferData(n,e,r)}getDataSync(){const t=this.gl;if(!O(t))throw"getDataSync() needs webgl2";const e=new Float32Array(this.n_verts*this.n_coords_per_vert);return t.bindBuffer(t.ARRAY_BUFFER,this.buffer),t.getBufferSubData(t.ARRAY_BUFFER,0,e),e}}class k extends U{constructor(t,e,i,s,n){const r=void 0===(n=void 0===n?{}:n).usage?t.STATIC_DRAW:n.usage;if(super(t,e,i,s,t.ARRAY_BUFFER,r),this.is_per_instance=void 0!==n.per_instance&&n.per_instance,O(this.gl))this.vadFunc=this.gl.vertexAttribDivisor.bind(this.gl);else{const t=this.gl.getExtension("ANGLE_instanced_arrays");this.vadFunc=t.vertexAttribDivisorANGLE.bind(t)}}setPerInstance(t){this.is_per_instance=t}bindToProgram(t){this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.buffer),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(t,this.n_coords_per_vert,this.dtype,!1,0,0);const e=this.is_per_instance?1:0;this.vadFunc(t,e)}bindToTransformFeedback(t){if(!O(this.gl))throw"Transform feedbacks are a webgl2-only function";this.gl.bindTransformFeedback(this.gl.TRANSFORM_FEEDBACK,void 0===t?null:t),this.gl.bindBufferBase(this.gl.TRANSFORM_FEEDBACK_BUFFER,0,this.buffer)}}class j{constructor(t,e){this.gl=t;const i=t.createTexture();if(null===i)throw"Could not create WebGL texture";this.texture=i,this.tex_num=null,this.setImageData(e);const s=void 0===e.mag_filter?t.LINEAR:e.mag_filter,n=void 0===e.min_filter?t.LINEAR:e.min_filter;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,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,s)}setImageData(t){const e=this.gl;this.spec=t,e.bindTexture(e.TEXTURE_2D,this.texture);const i=O(e)?function(t,e,i){switch(i){case t.UNSIGNED_BYTE:switch(e){case t.RGBA8:case t.RGB5_A1:case t.RGBA4:case t.SRGB8_ALPHA8:return t.RGBA;case t.RGBA8UI:return t.RGBA_INTEGER;case t.RGB8:case t.RGB565:case t.SRGB8:return t.RGB;case t.RGB8UI:return t.RGB_INTEGER;case t.RG8:return t.RG;case t.RG8UI:return t.RG_INTEGER;case t.R8:return t.RED;case t.R8UI:return t.RED_INTEGER;case t.RGBA:return t.RGBA;case t.RGB:return t.RGB;case t.LUMINANCE_ALPHA:return t.LUMINANCE_ALPHA;case t.LUMINANCE:return t.LUMINANCE;case t.ALPHA:return t.ALPHA}break;case t.BYTE:switch(e){case t.RGBA8_SNORM:return t.RGBA;case t.RGBA8I:return t.RGBA_INTEGER;case t.RGB8_SNORM:return t.RGB;case t.RGB8I:return t.RGB_INTEGER;case t.RG8_SNORM:return t.RG;case t.RG8I:return t.RG_INTEGER;case t.R8_SNORM:return t.RED;case t.R8I:return t.RED_INTEGER}break;case t.UNSIGNED_SHORT_4_4_4_4:switch(e){case t.RGBA4:case t.RGBA:return t.RGBA}break;case t.UNSIGNED_SHORT_5_5_5_1:switch(e){case t.RGB5_A1:case t.RGBA:return t.RGBA}break;case t.UNSIGNED_INT_2_10_10_10_REV:switch(e){case t.RGB10_A2:case t.RGB5_A1:return t.RGBA;case t.RGB10_A2UI:return t.RGBA_INTEGER}break;case t.HALF_FLOAT:switch(e){case t.RGBA16F:return t.RGBA;case t.RGB16F:case t.R11F_G11F_B10F:case t.RGB9_E5:return t.RGB;case t.RG16F:return t.RG;case t.R16F:return t.RED}break;case t.FLOAT:switch(e){case t.RGBA32F:case t.RGBA16F:return t.RGBA;case t.RGB32F:case t.RGB16F:case t.R11F_G11F_B10F:case t.RGB9_E5:return t.RGB;case t.RG32F:case t.RG16F:return t.RG;case t.R32F:case t.R16F:return t.RED;case t.DEPTH_COMPONENT32F:return t.DEPTH_COMPONENT}break;case t.UNSIGNED_SHORT:switch(e){case t.RGBA16UI:return t.RGBA_INTEGER;case t.RGB16UI:return t.RGB_INTEGER;case t.RG16UI:return t.RG_INTEGER;case t.R16UI:return t.RED_INTEGER;case t.DEPTH_COMPONENT16:return t.DEPTH_COMPONENT}break;case t.SHORT:switch(e){case t.RGBA16I:return t.RGBA_INTEGER;case t.RGB16I:return t.RGB_INTEGER;case t.RG16I:return t.RG_INTEGER;case t.R16I:return t.RED_INTEGER}break;case t.UNSIGNED_INT:switch(e){case t.RGBA32UI:return t.RGBA_INTEGER;case t.RGB32UI:return t.RGB_INTEGER;case t.RG32UI:return t.RG_INTEGER;case t.R32UI:return t.RED_INTEGER;case t.DEPTH_COMPONENT24:case t.DEPTH_COMPONENT16:return t.DEPTH_COMPONENT}break;case t.INT:switch(e){case t.RGBA32I:return t.RGBA_INTEGER;case t.RGB32I:return t.RGB_INTEGER;case t.RG32I:return t.RG_INTEGER;case t.R32I:return t.RED_INTEGER}break;case t.UNSIGNED_SHORT_5_6_5:switch(e){case t.RGB565:case t.RGB:return t.RGB}break;case t.UNSIGNED_INT_10F_11F_11F_REV:if(e===t.R11F_G11F_B10F)return t.RGB;break;case t.UNSIGNED_INT_5_9_9_9_REV:if(e===t.RGB9_E5)return t.RGB;break;case t.UNSIGNED_INT_24_8:if(e===t.DEPTH24_STENCIL8)return t.DEPTH_STENCIL;break;case t.FLOAT_32_UNSIGNED_INT_24_8_REV:if(e===t.DEPTH32F_STENCIL8)return t.DEPTH_STENCIL;break;default:throw"Unknown format in getWebGL2InternalFormat"}throw"Invalid combination of internal format and data type"}(e,t.format,t.type):t.format,s=void 0===t.row_alignment?4:t.row_alignment;var n;e.pixelStorei(e.UNPACK_ALIGNMENT,s),"width"in(n=t)&&"height"in n?e.texImage2D(e.TEXTURE_2D,0,t.format,t.width,t.height,0,i,t.type,t.image):e.texImage2D(e.TEXTURE_2D,0,t.format,i,t.type,t.image)}bindToProgram(t,e){this.activate(e),this.gl.uniform1i(t,e)}activate(t){this.tex_num=t,this.gl.activeTexture(this.gl.TEXTURE0+this.tex_num),this.gl.bindTexture(this.gl.TEXTURE_2D,this.texture)}deactivate(){null!==this.tex_num&&(this.gl.activeTexture(this.gl.TEXTURE0+this.tex_num),this.gl.bindTexture(this.gl.TEXTURE_2D,null),this.tex_num=null)}delete(){this.gl.deleteTexture(this.texture),this.tex_num=null}}function $(t,e){const i=void 0===(e=void 0===e?{}:e).define?[]:[...e.define],s=[],n={},r=t.split("\n").map(t=>{const e=t.match(/#define\s+([\w\d_]+)/i);null!==e&&i.push(e[1]);const r=t.match(/#ifdef\s+([\w\d_]+)/i);if(null!==r)return s.push(r[1]),n[r[1]]=!0,"";const o=t.match(/#ifndef\s+([\w\d_]+)/i);if(null!==o)return s.push(o[1]),n[o[1]]=!1,"";if(null!==t.match(/#else/i)){const t=s[s.length-1];return n[t]=!n[t],""}if(null!==t.match(/#endif/i)){const t=s.pop();return n[t]=void 0,""}return s.map(t=>i.includes(t)==n[t]).reduce((t,e)=>t&&e,!0)?t:""}).join("\n");if(s.length>0)throw"Unterminated #ifdef/#ifndef block in shader";return r}class H{constructor(t,e,i,s){const n=void 0===(s=void 0===s?{}:s).define?[]:s.define,r=void 0===s.tf_varyings?null:s.tf_varyings;e=$(e,{define:n}),i=$(i,{define:n}),this.gl=t,this.prog=((t,e,i,s)=>{const n=t.createShader(t.VERTEX_SHADER);if(null===n)throw"Could not create vertex shader";if(t.shaderSource(n,e),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS)){const e=t.getShaderInfoLog(n);console.log("Vertex shader compiler log: "+e)}const r=t.createShader(t.FRAGMENT_SHADER);if(null===r)throw"Could not create fragment shader";if(t.shaderSource(r,i),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){const e=t.getShaderInfoLog(r);console.log("Fragment shader compiler log: "+e)}const o=t.createProgram();if(null===o)throw"Could not create shader program";if(t.attachShader(o,n),t.attachShader(o,r),null!==s){if(!O(t))throw"Transform feedback only supported in WebGL2";t.transformFeedbackVaryings(o,s,t.INTERLEAVED_ATTRIBS)}if(t.linkProgram(o),!t.getProgramParameter(o,t.LINK_STATUS)){const e=t.getProgramInfoLog(o);console.log("Linker log: "+e)}return o})(t,e,i,r),this.attributes={},this.uniforms={},this.n_verts=null,this.draw_mode=null,this.index_buffer=null,this.sampler_names=[],this.instance_count=0;const o=t=>{const e=t.indexOf("//");return e>=0&&(t=t.slice(0,e)),t};e=e.split("\n").map(o).join("\n"),i=i.split("\n").map(o).join("\n");const a=O(this.gl);if(!a&&(e.includes("#version 300 es")||i.includes("#version 300 es")))throw"WebGL2 context required for shader source containing '#version 300 es'";let l=a?/\b(?:in|attribute)+([\w ]+?) +([\w_]+);[\s]*/gm:/attribute +([\w ]+?) +([\w_]+);[\s]*/gm;for(const i of e.matchAll(l)){const[e,s,n]=i;this.attributes[n]={type:s,location:t.getAttribLocation(this.prog,n)}}for(const i of e.matchAll(/uniform +([\w ]+?) +([\w_]+)(?:[\s]*\[.*\])?;[\s]*/gm)){const[e,s,n]=i,r=s.split(" "),o=t.getUniformLocation(this.prog,n);if(null===o)throw`Could not get vertex shader uniform location for '${n}'`;this.uniforms[n]={type:r[r.length-1],location:o}}for(const e of i.matchAll(/uniform +([\w ]+?) +([\w_]+)(?:[\s]*\[.*\])?;[\s]*/gm)){const[i,s,n]=e,r=s.split(" "),o=t.getUniformLocation(this.prog,n);if(null===o)throw`Could not get fragment shader uniform location for '${n}'`;this.uniforms[n]={type:r[r.length-1],location:o}}if(Object.entries(this.uniforms).forEach(([t,e])=>{e.type.toLowerCase().endsWith("sampler2d")&&this.sampler_names.push(t)}),O(this.gl))this.daiFunc=this.gl.drawArraysInstanced.bind(this.gl),this.deiFunc=this.gl.drawElementsInstanced.bind(this.gl);else{const t=this.gl.getExtension("ANGLE_instanced_arrays");this.daiFunc=t.drawArraysInstancedANGLE.bind(t),this.deiFunc=t.drawElementsInstancedANGLE.bind(t)}}use(t,e,i,s){this.gl.useProgram(this.prog),void 0!==s?(s.bind(),this.index_buffer=s):this.index_buffer=null,this.draw_mode=null,this.n_verts=null,this.instance_count=0,void 0!==t&&this.bindAttributes(t),void 0!==e&&this.setUniforms(e),void 0!==i&&this.bindTextures(i)}bindAttributes(t){Object.entries(t).forEach(([t,e])=>{if(void 0===this.attributes[t])return void console.warn(`Skipping attribute buffer provided for '${t}' because the attribute was not found in the program.`);if(this.draw_mode=null===this.draw_mode?e.draw_mode:this.draw_mode,e.is_per_instance){if(0==this.instance_count)this.instance_count=e.n_verts;else if(this.instance_count!=e.n_verts)throw`Unexpected number of instances for attribute buffer ${t} (expected ${this.instance_count}, got ${e.n_verts})`}else{if(this.n_verts=null===this.n_verts?e.n_verts:this.n_verts,this.n_verts!=e.n_verts)throw`Unexpected number of vertices for attribute buffer ${t} (expected ${this.n_verts}, got ${e.n_verts}).`;if(this.draw_mode!=e.draw_mode)throw`Unexpected draw mode for attribute buffer ${t} (expected ${this.draw_mode}, got ${e.draw_mode}).`}const{type:i,location:s}=this.attributes[t];e.bindToProgram(s)})}setUniforms(t){Object.entries(t).forEach(([t,e])=>{if(void 0===this.uniforms[t])return void console.warn(`Skipping uniform value provided for '${t}' because the uniform was not found in the program.`);const{type:i,location:s}=this.uniforms[t];if("int"===i&&"number"==typeof e)this.gl.uniform1i(s,e);else if("float"===i&&"number"==typeof e)this.gl.uniform1f(s,e);else if("float"===i&&e instanceof Array)this.gl.uniform1fv(s,e);else if("vec2"===i&&e instanceof Array)this.gl.uniform2fv(s,e);else if("vec3"===i&&e instanceof Array)this.gl.uniform3fv(s,e);else if("vec4"===i&&e instanceof Array)this.gl.uniform4fv(s,e);else{if(!("mat4"===i&&e instanceof Array))throw`Could not figure out uniform function for type '${i}' and value '${String(e)}'`;this.gl.uniformMatrix4fv(s,!1,e)}})}bindTextures(t){Object.entries(t).forEach(([t,e])=>{if(void 0===this.uniforms[t])return void console.warn(`Skipping texture provided for sampler '${t}' because the sampler was not found in the program.`);const i=this.sampler_names.indexOf(t),{type:s,location:n}=this.uniforms[t];e.bindToProgram(n,i)})}draw(){if(null===this.draw_mode||null===this.n_verts)throw"Cannot draw without binding attribute buffers";null===this.index_buffer?0==this.instance_count?this.gl.drawArrays(this.draw_mode,0,this.n_verts):this.daiFunc(this.draw_mode,0,this.n_verts,this.instance_count):0==this.instance_count?this.gl.drawElements(this.draw_mode,this.index_buffer.n_verts,this.index_buffer.dtype,0):this.deiFunc(this.draw_mode,this.index_buffer.n_verts,this.index_buffer.dtype,0,this.instance_count)}}class V{constructor(t,e){this.gl=t,this.framebuffer=e}clear(t){const e=this.gl;if(null===e)throw"Register WebGL drawing context using registerGLContext() first";e.clearColor(...t),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer),e.clear(e.COLOR_BUFFER_BIT)}renderTo(t,e,i,s){const n=this.gl;if(null===n)throw"Register WebGL drawing context using registerGLContext() first";n.bindFramebuffer(n.FRAMEBUFFER,this.framebuffer),n.viewport(t,e,i,s)}copyToTexture(t,e,i,s,n){const r=this.gl;if(null===r)throw"Register WebGL drawing context using registerGLContext() first";r.bindFramebuffer(r.FRAMEBUFFER,this.framebuffer),t.activate(0),r.copyTexImage2D(r.TEXTURE_2D,0,t.spec.format,e,i,s,n,0)}}const q=new class extends V{constructor(){super(null,null)}registerGLContext(t){this.gl=t}};class W extends V{constructor(t,e){const i=t.createFramebuffer();if(null===i)throw"Could not create WebGL Framebuffer";super(t,i),this.texture=e,t.bindFramebuffer(t.FRAMEBUFFER,this.framebuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e.texture,0)}static screen(t){return q.registerGLContext(t),q}}const X=JSON.parse('{"levels":[20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140],"colors":["#e6f4ff","#dbf0fe","#d1ebfe","#c6e7fd","#bce3fd","#b1dffc","#a7dbfc","#9cd6fb","#92d2fb","#87cefa","#84c2f6","#81b7f1","#7eabed","#7ba0e8","#7994e4","#7688df","#737ddb","#7071d6","#6d66d2","#6a5acd","#7660cf","#8366d0","#8f6cd2","#9c72d3","#a878d5","#b47ed6","#c184d8","#cd8ad9","#da90db","#e696dc","#e390d9","#e08ad6","#dd84d3","#da7ed0","#d778cd","#d472ca","#d16cc7","#ce66c4","#cb60c1","#c85abe","#c453ba","#c04cb6","#bc45b2","#b83eae","#b437aa","#b030a6","#ac29a2","#a8229e","#a41b9a","#a01496","#a41080","#a80e75","#ac0e75","#b00c6a","#b4085f","#b80649","#bc043e","#c00233","#c80028","#c80028","#ca042a","#cc082c","#d00c2c","#d21432","#d41834","#d41834","#d61c36","#da243a","#dc283c","#de2c3e","#e03040","#e23442","#e43844","#e63c46","#e84048","#ea444a","#ec484c","#ee4c4e","#f05050","#f16052","#f27054","#f38056","#f49058","#f5a05a","#f6b05c","#f7c05e","#f8d060","#f9e062","#faf064","#f7eb61","#f4e65e","#f1e15b","#eedc58","#ebd755","#e8d252","#e5cd4f","#e2c84c","#dfc349","#dcbe46","#d9b943","#d6b440","#d3af3d","#d0aa3a","#cda537","#caa034","#c79b31","#c4962e","#c1912b","#be8c28","#bb8725","#b88222","#b57d1f","#b2781c","#af7319","#ac6e16","#a96913","#a66410","#a35f0d","#a05a0a","#a05a0a"]}'),Z=JSON.parse('{"levels":[20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80],"colors":["#f0f8ff","#dbf0fe","#c6e7fd","#b1dffc","#9cd6fb","#87cefa","#81b7f1","#7ba0e8","#7688df","#7071d6","#6a5acd","#8366d0","#9c72d3","#b47ed6","#cd8ad9","#e696dc","#e08ad6","#da7ed0","#d472ca","#ce66c4","#c85abe","#c04cb6","#b83eae","#b030a6","#a8229e","#a01496","#a81080","#b00c6a","#b8043e","#c80028","#c80028","#d01030","#d41834","#d82038","#dc283c","#e03040","#e43844","#e84048","#ec484c","#f05050","#f27054","#f49058","#f6b05c","#f8d060","#faf064","#f4e65e","#eedc58","#e8d252","#e2c84c","#dcbe46","#d6b440","#d0aa3a","#caa034","#c4962e","#be8c28","#b88222","#b2781c","#ac6e16","#a66410","#a05a0a"]}'),K=JSON.parse('{"levels":[0,100,200,300,400,500,600,700,800,900,1000,1100,1200,1300,1400,1500,1600,1700,1800,1900,2000,2100,2200,2300,2400,2500,2600,2700,2800,2900,3000,3100,3200,3300,3400,3500,3600,3700,3800,3900,4000,4100,4200,4300,4400,4500,4600,4700,4800,4900,5000,5100,5200,5300,5400,5500,5600,5700,5800,5900,6000,6500,7000,7500,8000,8500,9000,9500,10000],"colors":["#ffffff","#f0f0f0","#e1e1e1","#d2d2d2","#c3c3c3","#a5a5a5","#969696","#878787","#787878","#696969","#37536a","#436075","#506d80","#5c7a8b","#698796","#7594a2","#82a1ad","#8eaeb8","#9bbbc3","#a7c8ce","#e9dd96","#e8d186","#e7c575","#e6b865","#e5ac54","#e5a044","#e49433","#e38723","#e27b12","#e16f02","#dc4110","#d33b17","#ca351e","#c12e25","#b8282c","#af2234","#a61c3b","#9d1542","#940f49","#8b0950","#73088a","#7e1894","#8a289f","#9538a9","#a148b3","#ac59be","#b869c8","#c379d2","#cf89dd","#da99e7","#e9bec3","#e3b0b7","#dda3ac","#d795a0","#d18894","#ca7a89","#c46d7d","#be5f71","#b85266","#b2445a","#893d48","#8f4752","#96525b","#9c5c65","#a2676f","#a97178","#af7c82","#b6868b"]}'),Y=JSON.parse('{"levels":[-60,-59,-58,-57,-56,-55,-54,-53,-52,-51,-50,-49,-48,-47,-46,-45,-44,-43,-42,-41,-40,-39,-38,-37,-36,-35,-34,-33,-32,-31,-30,-29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120],"colors":["#235877","#2a5f7c","#316782","#396e87","#40768c","#477d91","#4e8497","#558c9c","#5d93a1","#649ba6","#6ba2ac","#72a9b1","#79b1b6","#81b8bb","#88c0c1","#8fc7c6","#96cecb","#9dd6d0","#a5ddd6","#ace5db","#b3ece0","#b3ece0","#b1e7df","#b0e1dd","#aedcdc","#add7da","#abd2d9","#aaccd8","#a8c7d6","#a7c2d5","#a5bcd4","#a4b7d2","#a2b2d1","#9fa7ce","#9ea2cd","#9c9dcb","#9c9dcb","#9b97ca","#9992c8","#988dc7","#9688c6","#9582c4","#9278c2","#9073c0","#8f6dbf","#8d68bd","#8c63bc","#8a5dbb","#8958b9","#8753b8","#864eb6","#8448b5","#8343b4","#813eb2","#8038b1","#7e33b0","#7d33ae","#7b29ad","#7a23ab","#781eaa","#a037af","#a443b3","#a74fb7","#ab5cbb","#af68bf","#b374c3","#b680c7","#ba8dcc","#be99d0","#c1a5d4","#c5b1d8","#c9bddc","#cdcae0","#d0d6e4","#d4e2e8","#deecf2","#d1e2ee","#c5d9ea","#b8cfe6","#acc5e3","#9fbbdf","#92b2db","#86a8d7","#799ed3","#6c94cf","#608bcb","#5381c7","#4777c4","#3a6dc0","#2d64bc","#215ab8","#1450b4","#0f4455","#1c4e5a","#2a585f","#376363","#456d68","#52776d","#5f8172","#6d8c77","#7a967c","#88a080","#95aa85","#a3b58a","#b0bf8f","#bdc994","#cbd399","#d8de9d","#e6e8a2","#f3f2a7","#f8eea2","#f0e199","#e8d591","#e1c888","#d9bc80","#d1af77","#c9a36f","#c19666","#ba8a5e","#b27d55","#aa714d","#a26444","#9b583c","#8b3f2b","#833222","#7b261a","#7b261a","#741911","#6c0d09","#640000","#5f0000","#630507","#670a0e","#6c0f15","#70141c","#741824","#781d2b","#7d2232","#812739","#852c40","#73372d","#7a4036","#80493f","#875349","#8e5c52","#94655b","#9b6e64","#a88177","#af8a80","#b69389","#bd9c92","#c3a69c","#caafa5","#d1b8ae","#d7c1b7","#decac0","#e5d4ca","#ebddd3","#f2e6dc","#e8dfd6","#e0d7cf","#d8d0c8","#d0c8c0","#c8c0b9","#c0b9b2","#b7b1ab","#afa9a4","#a7a29c","#9f9a95","#97938e","#8f8b87","#878380","#7f7c78","#777471","#6f6c6a","#666563","#5e5d5c","#565554","#4e4e4d","#464646"]}'),J=JSON.parse('{"levels":[-40,-39,-38,-37,-36,-35,-34,-33,-32,-31,-30,-29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90],"colors":["#986d4d","#966c4c","#946b4c","#926a4b","#90694b","#8e684a","#8c664a","#8a6549","#886448","#866348","#846247","#826147","#806046","#7e5f46","#7c5e45","#7a5d44","#785b44","#765a43","#745943","#725842","#715742","#6f5641","#6d5540","#6b5440","#69533f","#67523f","#65503e","#634f3d","#614e3d","#5f4d3c","#5d4c3c","#5b4b3b","#594a3b","#57493a","#554839","#534739","#514538","#4f4438","#4d4337","#4b4237","#494136","#4d4334","#514738","#564c3c","#5a5041","#5e5545","#625949","#675e4d","#6b6251","#6f6755","#746b5a","#78705e","#7c7462","#807966","#857d6a","#89826f","#8d8673","#928b77","#968f7b","#9a947f","#9e9883","#a39d88","#a7a18c","#aba690","#afaa94","#b8b39c","#b8b39c","#bcb8a1","#c1bca5","#c9c5ad","#c9cab1","#d2ceb6","#d2ceb6","#d6d3ba","#dfdcc2","#e3e0c6","#e7e5ca","#ebe9cf","#f0eed3","#f4f2d7","#e6f5e6","#d7f0d7","#c8eac8","#b9e5b9","#aadfaa","#9bda9b","#8cd48c","#7dcf7d","#6ec96e","#5fc45f","#30ae30","#2ca32c","#279927","#238e23","#1e831e","#1a791a","#156e15","#116311","#0c590c","#084e08","#61a3af","#5896a0","#508992","#477b83","#3e6e74","#366166","#2d5457","#244648","#1c393a","#132c2b","#66669a","#605e94","#59568e","#534e88","#4d4682","#463e7c","#403676","#3a2e70","#33266a","#2d1e64","#724071","#784573","#7d4b75","#835076","#885678","#8e5b7a","#93617c","#99667d","#9e6c7f","#a47181"]}'),Q=JSON.parse('{"levels":[-15,-14.53608247,-14.07216495,-13.60824742,-13.1443299,-12.68041237,-12.21649485,-11.75257732,-11.28865979,-10.82474227,-10.36082474,-9.89690722,-9.43298969,-8.96907216,-8.50515464,-8.04123711,-7.57731959,-7.11340206,-6.64948454,-6.18556701,-5.72164948,-5.25773196,-4.79381443,-4.32989691,-3.86597938,-3.40206186,-2.93814433,-2.4742268,-2.01030928,-1.54639175,-1.08247423,-0.6185567,-0.15463918,0.30927835,0.77319588,1.2371134,1.70103093,2.16494845,2.62886598,3.09278351,3.55670103,4.02061856,4.48453608,4.94845361,5.41237113,5.87628866,6.34020619,6.80412371,7.26804124,7.73195876,8.19587629,8.65979381,9.12371134,9.58762887,10.05154639,10.51546392,10.97938144,11.44329897,11.90721649,12.37113402,12.83505155,13.29896907,13.7628866,14.22680412,14.69072165,15.15463918,15.6185567,16.08247423,16.54639175,17.01030928,17.4742268,17.93814433,18.40206186,18.86597938,19.32989691,19.79381443,20.25773196,20.72164948,21.18556701,21.64948454,22.11340206,22.57731959,23.04123711,23.50515464,23.96907216,24.43298969,24.89690722,25.36082474,25.82474227,26.28865979,26.75257732,27.21649485,27.68041237,28.1443299,28.60824742,29.07216495,29.53608247,30,30.46391753,30.92783505,31.39175258,31.8556701,32.31958763,32.78350515,33.24742268,33.71134021,34.17525773,34.63917526,35.10309278,35.56701031,36.03092784,36.49484536,36.95876289,37.42268041,37.88659794,38.35051546,38.81443299,39.27835052,39.74226804,40.20618557,40.67010309,41.13402062,41.59793814,42.06185567,42.5257732,42.98969072,43.45360825,43.91752577,44.3814433,44.84536082,45.30927835,45.77319588,46.2371134,46.70103093,47.16494845,47.62886598,48.09278351,48.55670103,49.02061856,49.48453608,49.94845361,50.41237113,50.87628866,51.34020619,51.80412371,52.26804124,52.73195876,53.19587629,53.65979381,54.12371134,54.58762887,55.05154639,55.51546392,55.97938144,56.44329897,56.90721649,57.37113402,57.83505155,58.29896907,58.7628866,59.22680412,59.69072165,60.15463918,60.6185567,61.08247423,61.54639175,62.01030928,62.4742268,62.93814433,63.40206186,63.86597938,64.32989691,64.79381443,65.25773196,65.72164948,66.18556701,66.64948454,67.11340206,67.57731959,68.04123711,68.50515464,68.96907216,69.43298969,69.89690722,70.36082474,70.82474227,71.28865979,71.75257732,72.21649485,72.68041237,73.1443299,73.60824742,74.07216495,74.53608247,75],"colors":["#959052","#979356","#9c9a60","#a09c64","#a3a067","#a8a570","#aaa875","#acac79","#b1b182","#b5b587","#b6b88c","#bcbd93","#bfc199","#c1c39c","#c1c39c","#c6caa5","#cacdaa","#cccfaf","#cfd1b3","#cccfb3","#c8ccb3","#c6c8b3","#bfc3b3","#bfc3b3","#bcc1b3","#b8bdb3","#b5bab3","#afb5b3","#acb3b3","#aaafb3","#a7aeb3","#a3aab3","#a0a8b3","#9ca5b3","#9aa1b3","#97a0b3","#939cb3","#909ab3","#939ab5","#8c95b3","#8791b1","#838eb1","#808caf","#7c89af","#7785ae","#7482ac","#7080aa","#6b7caa","#6275a8","#5e72a7","#5e72a7","#5b70a5","#566da3","#5269a3","#4f67a1","#4b64a1","#4660a0","#425d9e","#4260a1","#4467a5","#486eaa","#4975ae","#4d7cb1","#4f83b5","#508aba","#5491bf","#5699c3","#599ec6","#5ba5ca","#5daccf","#60b3d4","#62bad8","#64c1db","#67c8df","#69cfe4","#6ed6e8","#67d6d6","#60d6c4","#59d6b3","#52d6a1","#4bd690","#42d67e","#3bd66d","#34d65b","#11d418","#11d116","#0fcd16","#0fc816","#0fc316","#0fbf15","#0fbc15","#0fb613","#0eb313","#0eaf13","#0eaa13","#0ca511","#0ca111","#0c9e11","#0c9911","#0c950f","#0c900f","#0a8c0f","#0a870f","#0a830e","#0a800e","#0a7c0c","#0a770c","#08720c","#086e0c","#086b0a","#08660a","#08620a","#085d08","#1c6708","#317208","#467c08","#5b8707","#6e9107","#839c05","#97a805","#acb105","#c1bc05","#d6c603","#e9d103","#ffe200","#ffd800","#ffd300","#ffc800","#ffc300","#ffba00","#ffb500","#ffb000","#ffac00","#ffa700","#ff9e00","#ff9900","#ff9300","#ff8900","#ff8500","#ff7f00","#ff0000","#f70000","#f00000","#e90000","#e20000","#db0000","#d40000","#cd0000","#c60000","#bf0000","#b80000","#b10000","#aa0000","#a30000","#9a0000","#930000","#8c0000","#850000","#7e0000","#770000","#700000","#ffffff","#fff4ff","#ffe9ff","#ffdfff","#ffd4ff","#ffc8ff","#ffbdff","#ffb3ff","#ffa8ff","#ff9cff","#ff91ff","#ff75ff","#fb6bfd","#f960f9","#f656f6","#f24bf4","#ef3ff0","#ed36ef","#e92aeb","#e61fe8","#e416e6","#e10ae2","#b100ff","#ac00fb","#a300f6","#9a00f4","#9300ef","#8700e9","#8200e8","#7900e2","#7200dd","#6900db","#6200d6"]}'),tt=JSON.parse('{"levels":[164,164.75694444,165.51388889,166.27083333,167.02777778,167.78472222,168.54166667,169.29861111,170.05555556,170.8125,171.56944444,172.32638889,173.08333333,173.84027778,174.59722222,175.35416667,176.11111111,176.86805556,177.625,178.38194444,179.13888889,179.89583333,180.65277778,181.40972222,182.16666667,182.92361111,183.68055556,184.4375,185.19444444,185.95138889,186.70833333,187.46527778,188.22222222,188.97916667,189.73611111,190.49305556,191.25,192.00694444,192.76388889,193.52083333,194.27777778,195.03472222,195.79166667,196.54861111,197.30555556,198.0625,198.81944444,199.57638889,200.33333333,201.09027778,201.84722222,202.60416667,203.36111111,204.11805556,204.875,205.63194444,206.38888889,207.14583333,207.90277778,208.65972222,209.41666667,210.17361111,210.93055556,211.6875,212.44444444,213.20138889,213.95833333,214.71527778,215.47222222,216.22916667,216.98611111,217.74305556,218.5,219.25694444,220.01388889,220.77083333,221.52777778,222.28472222,223.04166667,223.79861111,224.55555556,225.3125,226.06944444,226.82638889,227.58333333,228.34027778,229.09722222,229.85416667,230.61111111,231.36805556,232.125,232.88194444,233.63888889,234.39583333,235.15277778,235.90972222,236.66666667,237.42361111,238.18055556,238.9375,239.69444444,240.45138889,241.20833333,241.96527778,242.72222222,243.47916667,244.23611111,244.99305556,245.75,246.50694444,247.26388889,248.02083333,248.77777778,249.53472222,250.29166667,251.04861111,251.80555556,252.5625,253.31944444,254.07638889,254.83333333,255.59027778,256.34722222,257.10416667,257.86111111,258.61805556,259.375,260.13194444,260.88888889,261.64583333,262.40277778,263.15972222,263.91666667,264.67361111,265.43055556,266.1875,266.94444444,267.70138889,268.45833333,269.21527778,269.97222222,270.72916667,271.48611111,272.24305556,273],"colors":["#ff0000","#ff0800","#ff0f00","#ff1800","#ff1f00","#ff2800","#ff2f00","#ff3800","#ff3f00","#ff4800","#ff4f00","#ff5901","#ff6001","#ff6901","#ff7001","#ff7901","#ff8901","#ff9001","#ff9901","#ffa101","#ffaa01","#ffb101","#ffba01","#ffc101","#ffca01","#ffd101","#ffda01","#ffe201","#ffe901","#fff201","#fffb03","#f6f208","#efeb0c","#e6e213","#ddda18","#d4d11d","#cdc823","#c4c128","#bcb82d","#b3af33","#aaa838","#a39e3d","#9a9744","#918e49","#89854f","#827e54","#797559","#706d5e","#676464","#605d69","#56546e","#4f4b75","#464279","#3d3b7e","#363385","#2d2a89","#242190","#1c1a95","#13119a","#0c08a0","#0300a5","#0f0caa","#1c18ae","#2826b3","#3433b6","#423fbc","#4d4bbf","#5b59c4","#6766c8","#7472cd","#807ed1","#8c8cd6","#9a99db","#a5a5df","#b3b1e4","#bfbfe8","#cccced","#d8d8f0","#e4e4f6","#f2f2f9","#ffffff","#f6f9f6","#edf4ed","#e2efe2","#dae9da","#cfe4cf","#c6dfc6","#bdd8bd","#b3d4b3","#aacdaa","#a1c8a1","#97c397","#8ebd8e","#85b885","#7cb37c","#72ac72","#69a869","#60a160","#569c56","#4d974d","#429142","#3a8c3a","#318731","#268026","#1d7c1d","#137513","#0a700a","#016b01","#016e07","#01720e","#017515","#01791c","#017e23","#01822a","#018531","#018936","#018e3d","#019044","#01954b","#019952","#019c59","#01a160","#01a567","#01a86e","#01ac75","#01b17c","#03b382","#03b889","#03bc90","#03bf97","#03c39e","#03c8a5","#03ccac","#03cfb3","#03d4ba","#03d6c1","#03dbc8","#03dfcd","#03e2d4","#03e6db","#03ebe2","#03efe9","#03f2f0","#03f6f7"]}'),et="This constructor is not a subclass of Float16Array",it="The constructor property value is not an object",st="Attempting to access detached ArrayBuffer",nt="Cannot convert undefined or null to object",rt="Cannot mix BigInt and other types, use explicit conversions",ot="@@iterator property is not callable",at="Reduce of empty array with no initial value",lt="Offset is out of bounds";function ht(t){return(e,...i)=>ft(t,e,i)}function ct(t,e){return ht(pt(t,e).get)}const{apply:ft,construct:ut,defineProperty:_t,get:dt,getOwnPropertyDescriptor:pt,getPrototypeOf:mt,has:gt,ownKeys:bt,set:vt,setPrototypeOf:wt}=Reflect,yt=Proxy,{EPSILON:xt,MAX_SAFE_INTEGER:At,isFinite:Et,isNaN:Mt}=Number,{iterator:St,species:Tt,toStringTag:Ct,for:Nt}=Symbol,Rt=Object,{create:Gt,defineProperty:It,freeze:Dt,is:Bt}=Rt,Pt=Rt.prototype,Ft=Pt.__lookupGetter__?ht(Pt.__lookupGetter__):(t,e)=>{if(null==t)throw Ne(nt);let i=Rt(t);do{const t=pt(i,e);if(void 0!==t)return Lt(t,"get")?t.get:void 0}while(null!==(i=mt(i)))},Lt=Rt.hasOwn||ht(Pt.hasOwnProperty),zt=Array,Ot=zt.isArray,Ut=zt.prototype,kt=ht(Ut.join),jt=ht(Ut.push),$t=ht(Ut.toLocaleString),Ht=Ut[St],Vt=ht(Ht),{abs:qt,trunc:Wt}=Math,Xt=ArrayBuffer,Zt=Xt.isView,Kt=Xt.prototype,Yt=ht(Kt.slice),Jt=ct(Kt,"byteLength"),Qt="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:null,te=Qt&&ct(Qt.prototype,"byteLength"),ee=mt(Uint8Array),ie=ee.from,se=ee.prototype,ne=se[St],re=ht(se.keys),oe=ht(se.values),ae=ht(se.entries),le=ht(se.set),he=ht(se.reverse),ce=ht(se.fill),fe=ht(se.copyWithin),ue=ht(se.sort),_e=ht(se.slice),de=ht(se.subarray),pe=ct(se,"buffer"),me=ct(se,"byteOffset"),ge=ct(se,"length"),be=ct(se,Ct),ve=Uint8Array,we=Uint16Array,ye=(...t)=>ft(ie,we,t),xe=Uint32Array,Ae=Float32Array,Ee=mt([][St]()),Me=ht(Ee.next),Se=ht(function*(){}().next),Te=mt(Ee),Ce=DataView.prototype,Ne=(ht(Ce.getUint16),ht(Ce.setUint16),TypeError),Re=RangeError,Ge=WeakSet,Ie=Ge.prototype,De=ht(Ie.add),Be=ht(Ie.has),Pe=WeakMap,Fe=Pe.prototype,Le=ht(Fe.get),ze=ht(Fe.has),Oe=ht(Fe.set),Ue=new Pe,ke=Gt(null,{next:{value:function(){const t=Le(Ue,this);return Me(t)}},[St]:{value:function(){return this}}});function je(t){if(t[St]===Ht&&Ee.next===Me)return t;const e=Gt(ke);return Oe(Ue,e,Vt(t)),e}const $e=new Pe,He=Gt(Te,{next:{value:function(){const t=Le($e,this);return Se(t)},writable:!0,configurable:!0}});for(const t of bt(Ee))"next"!==t&&It(He,t,pt(Ee,t));function Ve(t){const e=Gt(He);return Oe($e,e,t),e}function qe(t){return null!==t&&"object"==typeof t||"function"==typeof t}function We(t){return null!==t&&"object"==typeof t}function Xe(t){return void 0!==be(t)}function Ze(t){const e=be(t);return"BigInt64Array"===e||"BigUint64Array"===e}function Ke(t){if(null===Qt)return!1;try{return te(t),!0}catch(t){return!1}}function Ye(t){return!!Ot(t)&&t[St]===Ht&&Ee.next===Me}function Je(t){if("string"!=typeof t)return!1;const e=+t;return t===e+""&&!!Et(e)&&e===Wt(e)}const Qe=Nt("__Float16Array__"),ti=1/xt,ei=5.960464477539063e-8,ii=.0009765625*ti;const si=new Xt(4),ni=new Ae(si),ri=new xe(si),oi=new we(512),ai=new ve(512);for(let t=0;t<256;++t){const e=t-127;e<-27?(oi[t]=0,oi[256|t]=32768,ai[t]=24,ai[256|t]=24):e<-14?(oi[t]=1024>>-e-14,oi[256|t]=1024>>-e-14|32768,ai[t]=-e-1,ai[256|t]=-e-1):e<=15?(oi[t]=e+15<<10,oi[256|t]=e+15<<10|32768,ai[t]=13,ai[256|t]=13):e<128?(oi[t]=31744,oi[256|t]=64512,ai[t]=24,ai[256|t]=24):(oi[t]=31744,oi[256|t]=64512,ai[t]=13,ai[256|t]=13)}function li(t){ni[0]=function(t){const e=+t;if(!Et(e)||0===e)return e;const i=e>0?1:-1,s=qt(e);if(s<6103515625e-14)return i*function(t){return t+ti-ti}(s/ei)*ei;const n=(1+ii)*s,r=n-(n-s);return r>65504||Mt(r)?i*(1/0):i*r}(t);const e=ri[0],i=e>>23&511;return oi[i]+((8388607&e)>>ai[i])}const hi=new xe(2048);for(let t=1;t<1024;++t){let e=t<<13,i=0;for(;!(8388608&e);)e<<=1,i-=8388608;e&=-8388609,i+=947912704,hi[t]=e|i}for(let t=1024;t<2048;++t)hi[t]=939524096+(t-1024<<13);const ci=new xe(64);for(let t=1;t<31;++t)ci[t]=t<<23;ci[31]=1199570944,ci[32]=2147483648;for(let t=33;t<63;++t)ci[t]=2147483648+(t-32<<23);ci[63]=3347054592;const fi=new we(64);for(let t=1;t<64;++t)32!==t&&(fi[t]=1024);function ui(t){const e=t>>10;return ri[0]=hi[fi[e]+(1023&t)]+ci[e],ni[0]}function _i(t){const e=+t;return Mt(e)||0===e?0:Wt(e)}function di(t){const e=_i(t);return e<0?0:e<At?e:At}function pi(t,e){if(!qe(t))throw Ne("This is not an object");const i=t.constructor;if(void 0===i)return e;if(!qe(i))throw Ne(it);const s=i[Tt];return null==s?e:s}function mi(t){if(Ke(t))return!1;try{return Yt(t,0,0),!1}catch(t){}return!0}function gi(t,e){const i=Mt(t),s=Mt(e);if(i&&s)return 0;if(i)return 1;if(s)return-1;if(t<e)return-1;if(t>e)return 1;if(0===t&&0===e){const i=Bt(t,0),s=Bt(e,0);if(!i&&s)return-1;if(i&&!s)return 1}return 0}const bi=new Pe;function vi(t){return ze(bi,t)||!Zt(t)&&function(t){if(!We(t))return!1;const e=mt(t);if(!We(e))return!1;const i=e.constructor;if(void 0===i)return!1;if(!qe(i))throw Ne(it);return gt(i,Qe)}(t)}function wi(t){if(!vi(t))throw Ne("This is not a Float16Array object")}function yi(t,e){const i=vi(t),s=Xe(t);if(!i&&!s)throw Ne("Species constructor didn't return TypedArray object");if("number"==typeof e){let s;if(i){const e=xi(t);s=ge(e)}else s=ge(t);if(s<e)throw Ne("Derived constructor created TypedArray object which was too small length")}if(Ze(t))throw Ne(rt)}function xi(t){const e=Le(bi,t);if(void 0!==e){if(mi(pe(e)))throw Ne(st);return e}const i=t.buffer;if(mi(i))throw Ne(st);const s=ut(Si,[i,t.byteOffset,t.length],t.constructor);return Le(bi,s)}function Ai(t){const e=ge(t),i=[];for(let s=0;s<e;++s)i[s]=ui(t[s]);return i}const Ei=new Ge;for(const t of bt(se)){if(t===Ct)continue;const e=pt(se,t);Lt(e,"get")&&"function"==typeof e.get&&De(Ei,e.get)}const Mi=Dt({get:(t,e,i)=>Je(e)&&Lt(t,e)?ui(dt(t,e)):Be(Ei,Ft(t,e))?dt(t,e):dt(t,e,i),set:(t,e,i,s)=>Je(e)&&Lt(t,e)?vt(t,e,li(i)):vt(t,e,i,s),getOwnPropertyDescriptor(t,e){if(Je(e)&&Lt(t,e)){const i=pt(t,e);return i.value=ui(i.value),i}return pt(t,e)},defineProperty:(t,e,i)=>Je(e)&&Lt(t,e)&&Lt(i,"value")?(i.value=li(i.value),_t(t,e,i)):_t(t,e,i)});class Si{constructor(t,e,i){let s;if(vi(t))s=ut(we,[xi(t)],new.target);else if(!qe(t)||(function(t){try{return Jt(t),!0}catch(t){return!1}}(n=t)||Ke(n)))s=ut(we,arguments,new.target);else{let e,i;if(Xe(t)){if(e=t,i=ge(t),mi(pe(t)))throw Ne(st);if(Ze(t))throw Ne(rt);const n=new Xt(2*i);s=ut(we,[n],new.target)}else{const n=t[St];if(null!=n&&"function"!=typeof n)throw Ne(ot);null!=n?Ye(t)?(e=t,i=t.length):(e=[...t],i=e.length):(e=t,i=di(e.length)),s=ut(we,[i],new.target)}for(let t=0;t<i;++t)s[t]=li(e[t])}var n;const r=new yt(s,Mi);return Oe(bi,r,s),r}static from(t,...e){const i=this;if(!gt(i,Qe))throw Ne(et);if(i===Si){if(vi(t)&&0===e.length){const e=xi(t),i=new we(pe(e),me(e),ge(e));return new Si(pe(_e(i)))}if(0===e.length)return new Si(pe(ye(t,li)));const i=e[0],s=e[1];return new Si(pe(ye(t,function(t,...e){return li(ft(i,this,[t,...je(e)]))},s)))}let s,n;const r=t[St];if(null!=r&&"function"!=typeof r)throw Ne(ot);if(null!=r)Ye(t)?(s=t,n=t.length):Xe(o=t)&&o[St]===ne&&Ee.next===Me?(s=t,n=ge(t)):(s=[...t],n=s.length);else{if(null==t)throw Ne(nt);s=Rt(t),n=di(s.length)}var o;const a=new i(n);if(0===e.length)for(let t=0;t<n;++t)a[t]=s[t];else{const t=e[0],i=e[1];for(let e=0;e<n;++e)a[e]=ft(t,i,[s[e],e])}return a}static of(...t){const e=this;if(!gt(e,Qe))throw Ne(et);const i=t.length;if(e===Si){const e=new Si(i),s=xi(e);for(let e=0;e<i;++e)s[e]=li(t[e]);return e}const s=new e(i);for(let e=0;e<i;++e)s[e]=t[e];return s}keys(){wi(this);const t=xi(this);return re(t)}values(){wi(this);const t=xi(this);return Ve(function*(){for(const e of oe(t))yield ui(e)}())}entries(){wi(this);const t=xi(this);return Ve(function*(){for(const[e,i]of ae(t))yield[e,ui(i)]}())}at(t){wi(this);const e=xi(this),i=ge(e),s=_i(t),n=s>=0?s:i+s;if(!(n<0||n>=i))return ui(e[n])}with(t,e){wi(this);const i=xi(this),s=ge(i),n=_i(t),r=n>=0?n:s+n,o=+e;if(r<0||r>=s)throw Re(lt);const a=new we(pe(i),me(i),ge(i)),l=new Si(pe(_e(a)));return xi(l)[r]=li(o),l}map(t,...e){wi(this);const i=xi(this),s=ge(i),n=e[0],r=pi(i,Si);if(r===Si){const e=new Si(s),r=xi(e);for(let e=0;e<s;++e){const s=ui(i[e]);r[e]=li(ft(t,n,[s,e,this]))}return e}const o=new r(s);yi(o,s);for(let e=0;e<s;++e){const s=ui(i[e]);o[e]=ft(t,n,[s,e,this])}return o}filter(t,...e){wi(this);const i=xi(this),s=ge(i),n=e[0],r=[];for(let e=0;e<s;++e){const s=ui(i[e]);ft(t,n,[s,e,this])&&jt(r,s)}const o=new(pi(i,Si))(r);return yi(o),o}reduce(t,...e){wi(this);const i=xi(this),s=ge(i);if(0===s&&0===e.length)throw Ne(at);let n,r;0===e.length?(n=ui(i[0]),r=1):(n=e[0],r=0);for(let e=r;e<s;++e)n=t(n,ui(i[e]),e,this);return n}reduceRight(t,...e){wi(this);const i=xi(this),s=ge(i);if(0===s&&0===e.length)throw Ne(at);let n,r;0===e.length?(n=ui(i[s-1]),r=s-2):(n=e[0],r=s-1);for(let e=r;e>=0;--e)n=t(n,ui(i[e]),e,this);return n}forEach(t,...e){wi(this);const i=xi(this),s=ge(i),n=e[0];for(let e=0;e<s;++e)ft(t,n,[ui(i[e]),e,this])}find(t,...e){wi(this);const i=xi(this),s=ge(i),n=e[0];for(let e=0;e<s;++e){const s=ui(i[e]);if(ft(t,n,[s,e,this]))return s}}findIndex(t,...e){wi(this);const i=xi(this),s=ge(i),n=e[0];for(let e=0;e<s;++e){const s=ui(i[e]);if(ft(t,n,[s,e,this]))return e}return-1}findLast(t,...e){wi(this);const i=xi(this),s=ge(i),n=e[0];for(let e=s-1;e>=0;--e){const s=ui(i[e]);if(ft(t,n,[s,e,this]))return s}}findLastIndex(t,...e){wi(this);const i=xi(this),s=ge(i),n=e[0];for(let e=s-1;e>=0;--e){const s=ui(i[e]);if(ft(t,n,[s,e,this]))return e}return-1}every(t,...e){wi(this);const i=xi(this),s=ge(i),n=e[0];for(let e=0;e<s;++e)if(!ft(t,n,[ui(i[e]),e,this]))return!1;return!0}some(t,...e){wi(this);const i=xi(this),s=ge(i),n=e[0];for(let e=0;e<s;++e)if(ft(t,n,[ui(i[e]),e,this]))return!0;return!1}set(t,...e){wi(this);const i=xi(this),s=_i(e[0]);if(s<0)throw Re(lt);if(null==t)throw Ne(nt);if(Ze(t))throw Ne(rt);if(vi(t))return le(xi(this),xi(t),s);if(Xe(t)&&mi(pe(t)))throw Ne(st);const n=ge(i),r=Rt(t),o=di(r.length);if(s===1/0||o+s>n)throw Re(lt);for(let t=0;t<o;++t)i[t+s]=li(r[t])}reverse(){wi(this);const t=xi(this);return he(t),this}toReversed(){wi(this);const t=xi(this),e=new we(pe(t),me(t),ge(t)),i=new Si(pe(_e(e))),s=xi(i);return he(s),i}fill(t,...e){wi(this);const i=xi(this);return ce(i,li(t),...je(e)),this}copyWithin(t,e,...i){wi(this);const s=xi(this);return fe(s,t,e,...je(i)),this}sort(t){wi(this);const e=xi(this),i=void 0!==t?t:gi;return ue(e,(t,e)=>i(ui(t),ui(e))),this}toSorted(t){wi(this);const e=xi(this);if(void 0!==t&&"function"!=typeof t)throw new Ne("The comparison function must be either a function or undefined");const i=void 0!==t?t:gi,s=new we(pe(e),me(e),ge(e)),n=new Si(pe(_e(s))),r=xi(n);return ue(r,(t,e)=>i(ui(t),ui(e))),n}slice(t,e){wi(this);const i=xi(this),s=pi(i,Si);if(s===Si){const s=new we(pe(i),me(i),ge(i));return new Si(pe(_e(s,t,e)))}const n=ge(i),r=_i(t),o=void 0===e?n:_i(e);let a,l;a=r===-1/0?0:r<0?n+r>0?n+r:0:n<r?n:r,l=o===-1/0?0:o<0?n+o>0?n+o:0:n<o?n:o;const h=l-a>0?l-a:0,c=new s(h);if(yi(c,h),0===h)return c;if(mi(pe(i)))throw Ne(st);let f=0;for(;a<l;)c[f]=ui(i[a]),++a,++f;return c}subarray(t,e){wi(this);const i=xi(this),s=pi(i,Si),n=new we(pe(i),me(i),ge(i)),r=de(n,t,e),o=new s(pe(r),me(r),ge(r));return yi(o),o}indexOf(t,...e){wi(this);const i=xi(this),s=ge(i);let n=_i(e[0]);if(n===1/0)return-1;n<0&&(n+=s,n<0&&(n=0));for(let e=n;e<s;++e)if(Lt(i,e)&&ui(i[e])===t)return e;return-1}lastIndexOf(t,...e){wi(this);const i=xi(this),s=ge(i);let n=e.length>=1?_i(e[0]):s-1;if(n===-1/0)return-1;n>=0?n=n<s-1?n:s-1:n+=s;for(let e=n;e>=0;--e)if(Lt(i,e)&&ui(i[e])===t)return e;return-1}includes(t,...e){wi(this);const i=xi(this),s=ge(i);let n=_i(e[0]);if(n===1/0)return!1;n<0&&(n+=s,n<0&&(n=0));const r=Mt(t);for(let e=n;e<s;++e){const s=ui(i[e]);if(r&&Mt(s))return!0;if(s===t)return!0}return!1}join(t){wi(this);const e=Ai(xi(this));return kt(e,t)}toLocaleString(...t){wi(this);const e=Ai(xi(this));return $t(e,...je(t))}get[Ct](){if(vi(this))return"Float16Array"}}It(Si,"BYTES_PER_ELEMENT",{value:2}),It(Si,Qe,{}),wt(Si,ee);const Ti=Si.prototype;It(Ti,"BYTES_PER_ELEMENT",{value:2}),It(Ti,St,{value:Ti.values,writable:!0,configurable:!0}),wt(Ti,se);class Ci{constructor(t){this.rgba=t}get r(){return this.rgba[0]}get g(){return this.rgba[1]}get b(){return this.rgba[2]}get a(){return this.rgba[3]}withOpacity(t){return new Ci([this.r,this.g,this.b,t])}toRGBHex(){return this.toRGBAHex().slice(0,-2)}toRGBAHex(){return((t,e)=>{let i=this.rgba;return"float"==(e=void 0===e?"float":e)&&(i=i.map(t=>Math.round(255*t))),"#"+i.map(t=>t.toString(16).padStart(2,"0").toUpperCase()).join("")})()}toRGBATuple(){return this.rgba}toHSVTuple(){return(t=>{const[e,i,s]=t,n=Math.max(e,i,s),r=n-Math.min(e,i,s);let o;if(0==r)o=0;else if(n==e)o=(i-s)/r*60%6;else if(n==i)o=60*((s-e)/r+2);else{if(n!=s)throw"You've messed something up in rgb2hsv()";o=60*((e-i)/r+4)}return[o,0==n?0:r/n,n]})([this.r,this.g,this.b])}static fromHex(t){return new Ci(((t,e)=>{e=void 0===e?"float":e;const i=t.match(/#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?/i);if(null===i)throw`Got '${t}' in hex2rgba, which does not look like a hex color`;let s=i.slice(1).filter(t=>void 0!==t).map(t=>parseInt(t,16));return"float"==e&&(s=s.map(t=>t/255)),void 0===s[3]?[s[0],s[1],s[2],1]:[s[0],s[1],s[2],s[3]]})(t))}static fromHSVTuple(t){const e=(t=>{const[e,i,s]=t,n=s*i,r=n*(1-Math.abs(e/60%2-1)),o=s-n;let a,l,h;if(0<=e&&e<60)a=n,l=r,h=0;else if(60<=e&&e<120)a=r,l=n,h=0;else if(120<=e&&e<180)a=0,l=n,h=r;else if(180<=e&&e<240)a=0,l=r,h=n;else if(240<=e&&e<300)a=r,l=0,h=n;else{if(!(300<=e&&e<360))throw"H is out of bounds in hsv2rgb";a=n,l=0,h=r}return[a+o,l+o,h+o]})(t);return new Ci([e[0],e[1],e[2],1])}static normalizeColor(t){return t instanceof Ci?t:Ci.fromHex(t)}}const Ni=i(374);class Ri{constructor(t,e,i){if(t.length!=e.length+1)throw`Mismatch between number of levels (${t.length}) and number of colors (${e.length}; expected ${t.length-1})`;this.levels=t,this.colors=e.map(t=>Ci.normalizeColor(t)),i=void 0===i?{}:i,this.overflow_color=void 0===i.overflow_color?null:Ci.normalizeColor(i.overflow_color),this.underflow_color=void 0===i.underflow_color?null:Ci.normalizeColor(i.underflow_color)}getColors(){return this.colors.map(t=>t.toRGBHex())}getOpacities(){return this.colors.map(t=>t.a)}getColor(t){if(t<this.levels[0])return null===this.underflow_color?"#00000000":this.underflow_color.toRGBAHex();if(t>this.levels[this.levels.length-1])return null===this.overflow_color?"#00000000":this.overflow_color.toRGBAHex();let e=-1;for(e=0;e<this.levels.length-1&&!(this.levels[e]<=t&&t<this.levels[e+1]);e++);return this.colors[Math.min(e,this.levels.length-2)].toRGBAHex()}withOpacity(t){const e=[],i=[],s={};for(let s=0;s<this.colors.length;s++){const n=this.colors[s],r=this.levels[s],o=this.levels[s+1],a=t(r,o),l=n.withOpacity(a);a>0&&(i[i.length-1]!=r&&i.push(r),i.push(o),e.push(l))}if(null!==this.underflow_color){const e=t(this.levels[0],this.levels[0]);e>0&&(s.underflow_color=this.underflow_color.withOpacity(e))}if(null!==this.overflow_color){const e=t(this.levels[this.levels.length-1],this.levels[this.levels.length-1]);e>0&&(s.overflow_color=this.overflow_color.withOpacity(e))}return new Ri(i,e,s)}static diverging(t,e,i,s,n){const r=[],o=[],a=(s-i)/(n-1),l=(s+i)/2,h=[0,0,.9],c=Ci.fromHex(t).toHSVTuple(),f=Ci.fromHex(e).toHSVTuple();for(let t=0;t<n;t++){const e=i+t*a;let n,o,u,_;e<l?(_=Math.pow((l-e)/(l-i),1.5),[n,o,u]=[c[0],h[1]+(c[1]-h[1])*_,h[2]+(c[2]-h[2])*_]):(_=Math.pow((e-l)/(s-l),1.5),[n,o,u]=[f[0],h[1]+(f[1]-h[1])*_,h[2]+(f[2]-h[2])*_]),r.push(Ci.fromHSVTuple([n,o,u]).withOpacity(Math.min(2*_,1)))}for(let t=0;t<=n;t++){const e=(s-i)/n;o.push(i+t*e)}return new Ri(o,r)}}function Gi(t,e){const i=t.colors.length,s={};return"over"!=e&&"both"!=e||(s.overflow_color=t.colors[i-1]),"under"!=e&&"both"!=e||(s.underflow_color=t.colors[0]),new Ri(t.levels,t.colors,s)}tt.colors=tt.colors.reverse();const Ii=Gi(X,"over").withOpacity((t,e)=>Math.min((e-20)/10,1)),Di=Gi(Z,"over").withOpacity((t,e)=>Math.min((e-20)/10,1)),Bi=Gi(K,"over").withOpacity((t,e)=>Math.min(e/1e3,1)),Pi=Gi(Y,"both"),Fi=Gi(J,"both"),Li=Gi(Q,"over"),zi=Gi(tt,"neither");class Oi{constructor(t){this.colormap=t,this.gl_elems=null}static applyShader(t){return x(Ni,t)}setupShaderVariables(t,e){const i=function(t){const e=[];for(let t=0;t<101;t++)e.push(t/100);const i=t.levels,s=i.length-1,n=i.map((t,e)=>e/s),r=i.map(t=>(t-i[0])/(i[s]-i[0])),o=e.map(t=>{let e;for(e=0;!(r[e]<=t&&t<=r[e+1]);e++);const i=(t-r[e])/(r[e+1]-r[e]);return n[e]*(1-i)+n[e+1]*i});return new Si(o)}(this.colormap),s=function(t){const e=document.createElement("canvas");e.width=t.colors.length,e.height=1;let i=e.getContext("2d");return t.colors.forEach((t,e)=>{if(null===i)throw"Could not get rendering context for colormap image canvas";i.fillStyle=t.toRGBAHex(),i.fillRect(e,0,1,1)}),e}(this.colormap),{format:n,type:r,row_alignment:o}=P(t,"float16"),a={format:t.RGBA,type:t.UNSIGNED_BYTE,image:s,mag_filter:e},l=new j(t,a),h={format:n,type:r,width:i.length,height:1,image:new Uint16Array(i.buffer),mag_filter:t.LINEAR,row_alignment:o},c=new j(t,h);this.gl_elems={cmap_texture:l,cmap_nonlin_texture:c}}bindShaderVariables(t){if(null===this.gl_elems)return;const e=this.colormap,i=null===e.underflow_color?[0,0,0,0]:e.underflow_color.toRGBATuple(),s=null===e.overflow_color?[0,0,0,0]:e.overflow_color.toRGBATuple();t.setUniforms({u_cmap_min:e.levels[0],u_cmap_max:e.levels[e.levels.length-1],u_n_index:101,u_underflow_color:i,u_overflow_color:s}),t.bindTextures({u_cmap_sampler:this.gl_elems.cmap_texture,u_cmap_nonlin_sampler:this.gl_elems.cmap_nonlin_texture})}}class Ui{constructor(t,e,i){this.vertex_shader_src=t,this.fragment_shader_src=e,this.shader_defines=i,this.program_map=new Map}getShaderProgram(t,e){const i=null===e?"default":e.variantName,s=this.program_map.get(i);if(void 0!==s)return s;let n=this.vertex_shader_src;n=x(null!==e?e.vertexShaderPrelude+"\n"+e.define:"\n uniform mat4 u_projection_matrix;\n\n vec4 projectTile(vec2 p) {\n vec4 result = u_projection_matrix * vec4(p, 0.0, 1.0);\n return result;\n }",n);const r=new H(t,n,this.fragment_shader_src,{define:this.shader_defines});return this.program_map.set(i,r),r}getShaderUniforms(t){return"maplibre"==t.type?t.shaderData.define.includes("GLOBE")?{u_projection_matrix:t.defaultProjectionData.mainMatrix,u_projection_fallback_matrix:t.defaultProjectionData.fallbackMatrix,u_projection_tile_mercator_coords:t.defaultProjectionData.tileMercatorCoords,u_projection_clipping_plane:t.defaultProjectionData.clippingPlane,u_projection_transition:t.defaultProjectionData.projectionTransition}:{u_projection_matrix:t.defaultProjectionData.mainMatrix}:{u_projection_matrix:t.mainMatrix}}}const ki=i(840),ji=i(934),$i={"-":[1],"--":[1,1,1,1,0,0],":":[1,0],"-.":[1,1,1,0,1,0]};class Hi{constructor(t,e,i){const s=void 0===(i=void 0===i?{}:i).color?"#000000":i.color;this.color=Ci.fromHex(s);const n=void 0===i.line_width?1:i.line_width,r=void 0===i.line_style?"-":i.line_style;this.offset_rotates_with_map=void 0===i.offset_rotates_with_map||i.offset_rotates_with_map,this.width=n;const o=[];this.vertices=new k(t,e.vertices,3,t.TRIANGLE_STRIP),this.extrusion=new k(t,e.extrusion,2,t.TRIANGLE_STRIP),void 0!==e.offsets?(this.offset=new k(t,e.offsets,2,t.TRIANGLE_STRIP),this.scale=void 0===i.offset_scale?1:i.offset_scale,o.push("OFFSET")):(this.offset=null,this.scale=null),void 0!==e.zoom?(this.min_zoom=new k(t,e.zoom,1,t.TRIANGLE_STRIP),o.push("ZOOM")):this.min_zoom=null;let a=ji;if(void 0!==e.data){o.push("DATA"),this.line_data=new k(t,e.data,1,t.TRIANGLE_STRIP);const n=void 0===i.cmap?new Ri([0,1],[s],{overflow_color:s,underflow_color:s}):i.cmap;this.cmap_gpu=new Oi(n),this.cmap_gpu.setupShaderVariables(t,t.NEAREST),a=Oi.applyShader(a)}else this.line_data=null,this.cmap_gpu=null;[this.n_dash,this.dash_texture]=function(t,e){const i=Array.isArray(e)?e:$i[e],s={format:S(t)?t.R8:t.LUMINANCE,type:t.UNSIGNED_BYTE,width:i.length,height:1,image:new Uint8Array(i.map(t=>t>0?255:0)),mag_filter:t.NEAREST,row_alignment:1};return[i.length,new j(t,s)]}(t,r),this.shader_manager=new Ui(ki,a,o)}static async make(t,e,i){const s=await G.makePolyLines(e);return new Hi(t,s,i)}render(t,e,[i,s],n,r,o){const a=T(e),l=this.shader_manager.getShaderProgram(t,a.shaderData),h={a_pos:this.vertices,a_extrusion:this.extrusion},c={u_line_width:this.width,u_map_width:i,u_map_height:s,u_offset:0,u_zoom:n,u_dash_pattern_length:this.n_dash,...this.shader_manager.getShaderUniforms(a)},f={u_dash_sampler:this.dash_texture};null!==this.offset&&null!==this.scale&&(h.a_offset=this.offset,c.u_offset_scale=this.scale*(s/i),c.u_offset_rotates_with_map=this.offset_rotates_with_map?1:0),null!==this.min_zoom&&(h.a_min_zoom=this.min_zoom),null!==this.line_data?h.a_data=this.line_data:c.u_color=this.color.toRGBATuple(),l.use(h,c,f),null!==this.cmap_gpu&&this.cmap_gpu.bindShaderVariables(l),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),l.draw(),"maplibre"==a.type&&a.shaderData.define.includes("GLOBE")||(l.setUniforms({u_offset:-2}),l.draw(),l.setUniforms({u_offset:-1}),l.draw(),l.setUniforms({u_offset:1}),l.draw())}}var Vi=i(335),qi=i.n(Vi);const Wi=i(873),Xi=i(947);const Zi=new v(async t=>{const e=t.map(async t=>{const e=await fetch(t);if(200!=e.status)throw`Error ${e.status} retrieving font pbf from '${t}'`;const i=await e.blob(),s=await i.arrayBuffer();return function(t){const e=(t,e,i)=>{if(void 0!==i)switch(t){case 1:e.id=i.readVarint();break;case 2:e.data=i.readBytes();break;case 3:e.width=i.readVarint()+6;break;case 4:e.height=i.readVarint()+6;break;case 5:e.left=i.readSVarint();break;case 6:e.top=i.readSVarint();break;case 7:e.advance=i.readVarint()}},i=(t,i,s)=>{if(void 0!==i&&void 0!==s&&3==t){const t=s.readMessage(e,{});i.push(t)}};return new(qi())(t).readFields((t,e,s)=>{void 0!==s&&1==t&&s.readMessage(i,e)},[])}(new Uint8Array(s))});return function(t){const e=t.filter(t=>void 0!==t.data),i=[],s=e.map(t=>{const e={x:0,y:0,w:t.width,h:t.height};return i.push({glyph:t,bin:e}),e}),{w:n,h:r}=function(t){let e=0,i=0;for(const s of t)e+=s.w*s.h,i=Math.max(i,s.w);t.sort((t,e)=>e.h-t.h);const s=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}];let n=0,r=0;for(const e of t)for(let t=s.length-1;t>=0;t--){const i=s[t];if(!(e.w>i.w||e.h>i.h)){if(e.x=i.x,e.y=i.y,r=Math.max(r,e.y+e.h),n=Math.max(n,e.x+e.w),e.w===i.w&&e.h===i.h){const e=s.pop();t<s.length&&(s[t]=e)}else e.h===i.h?(i.x+=e.w,i.w-=e.w):e.w===i.w?(i.y+=e.h,i.h-=e.h):(s.push({x:i.x+e.w,y:i.y,w:i.w-e.w,h:e.h}),i.y+=e.h,i.h-=e.h);break}}return{w:n,h:r,fill:e/(n*r)||0}}(s),o=new Uint8Array(n*r),a={};let l=0;i.forEach(t=>{const{bin:e,glyph:i}=t;if(void 0===e.x||void 0===e.y)throw"Potpack couldn't pack this pot, I guess?";a[i.id]={id:i.id,width:i.width,height:i.height,left:i.left,top:i.top,atlas_i:e.x,atlas_j:e.y,advance:i.advance},l=Math.max(l,i.height);for(let t=0;t<i.width;t++)for(let s=0;s<i.height;s++){const r=t+i.width*s,a=t+e.x+n*(s+e.y);o[a]=i.data[r]}});const h=a["M".charCodeAt(0)],c=void 0===h?l:h.height-h.top,f=void 0===h?0:-h.top;return{atlas:o,atlas_width:n,atlas_height:r,baseline:c,top:f,glyph_info:a}}((await Promise.all(e)).flat())}),Ki={horizontal_align:"left",vertical_align:"baseline",font_size:12,text_color:new Ci([0,0,0,1]),cmap:null,halo_color:new Ci([0,0,0,1]),halo:!1,offset_x:0,offset_y:0};class Yi{constructor(t,e,i,s){this.opts=w(s,Ki);const n=void 0===this.opts.text_color?new Ci([0,0,0,1]):this.opts.text_color,r=S(t)?t.R8:t.LUMINANCE,o=t.UNSIGNED_BYTE,a=0==i.atlas_width||0==i.atlas_height||0==i.atlas.length,l={format:r,type:o,width:a?1:i.atlas_width,height:a?1:i.atlas_height,image:a?new Uint8Array([0,0,0,0]):i.atlas,row_alignment:1,mag_filter:t.LINEAR};this.texture=new j(t,l);const h=6*e.map(t=>t.text.length).reduce((t,e)=>t+e,0),c=new Float32Array(3*h),f=new Float32Array(2*h),u=new Float32Array(2*h),_=new Float32Array(h);let d=0,p=0,m=0,g=0,b=!1;e.forEach(t=>{const{lat:e,lon:s,text:n}=t,r=void 0===t.min_zoom?0:t.min_zoom,o=void 0===t.data_value?NaN:t.data_value,{x:a,y:l}=new z(s,e).toMercatorCoord();b=b||void 0!==t.data_value;let h=this.opts.offset_x,v=this.opts.offset_y;const w=p;for(let t=0;t<n.length;t++){const e=n.charCodeAt(t),s=i.glyph_info[e];void 0!==s?(h+=s.left,c[d++]=a,c[d++]=l,c[d++]=r,c[d++]=a,c[d++]=l,c[d++]=r,c[d++]=a,c[d++]=l,c[d++]=r,c[d++]=a,c[d++]=l,c[d++]=r,c[d++]=a,c[d++]=l,c[d++]=r,c[d++]=a,c[d++]=l,c[d++]=r,f[p++]=h,f[p++]=v+i.baseline+s.top-s.height,f[p++]=h,f[p++]=v+i.baseline+s.top-s.height,f[p++]=h+s.width,f[p++]=v+i.baseline+s.top-s.height,f[p++]=h,f[p++]=v+i.baseline+s.top,f[p++]=h+s.width,f[p++]=v+i.baseline+s.top,f[p++]=h+s.width,f[p++]=v+i.baseline+s.top,u[m++]=s.atlas_i/i.atlas_width,u[m++]=(s.atlas_j+s.height)/i.atlas_height,u[m++]=s.atlas_i/i.atlas_width,u[m++]=(s.atlas_j+s.height)/i.atlas_height,u[m++]=(s.atlas_i+s.width)/i.atlas_width,u[m++]=(s.atlas_j+s.height)/i.atlas_height,u[m++]=s.atlas_i/i.atlas_width,u[m++]=s.atlas_j/i.atlas_height,u[m++]=(s.atlas_i+s.width)/i.atlas_width,u[m++]=s.atlas_j/i.atlas_height,u[m++]=(s.atlas_i+s.width)/i.atlas_width,u[m++]=s.atlas_j/i.atlas_height,_[g++]=o,_[g++]=o,_[g++]=o,_[g++]=o,_[g++]=o,_[g++]=o,h+=s.advance-s.left):h+=7}if("center"==this.opts.horizontal_align)for(let t=w;t<w+12*n.length;t+=2)f[t]-=(h-this.opts.offset_x)/2;else if("right"==this.opts.horizontal_align)for(let t=w;t<w+12*n.length;t+=2)f[t]-=h-this.opts.offset_x;if("top"==this.opts.vertical_align)for(let t=w+1;t<w+12*n.length;t+=2)f[t]-=i.baseline-i.top;else if("middle"==this.opts.vertical_align)for(let t=w+1;t<w+12*n.length;t+=2)f[t]-=(i.baseline-i.top)/2});const v=[];let y=Xi;if(b){v.push("DATA"),this.data=new k(t,_,1,t.TRIANGLE_STRIP);const e=null===this.opts.cmap?new Ri([0,1],[n],{overflow_color:n,underflow_color:n}):this.opts.cmap;this.cmap_gpu=new Oi(e),this.cmap_gpu.setupShaderVariables(t,t.NEAREST),y=Oi.applyShader(y)}else this.data=null,this.cmap_gpu=null;this.shader_manager=new Ui(Wi,y,v),this.anchors=new k(t,c,3,t.TRIANGLE_STRIP),this.offsets=new k(t,f,2,t.TRIANGLE_STRIP),this.texcoords=new k(t,u,2,t.TRIANGLE_STRIP),this.data=b?new k(t,_,1,t.TRIANGLE_STRIP):null}static async make(t,e,i,s){const n=256,r=e.map(t=>[...t.text]).flat().map(t=>t.charCodeAt(0)).filter((t,e,i)=>i.indexOf(t)==e);let o,a;if(r.length>0){const t=Math.min(...r),e=Math.max(...r);o=Math.floor(t/n)*n,a=Math.floor(e/n)*n}else o=0,a=0;const l=[];for(let t=o;t<=a;t+=n)l.push(i.replace("{range}",`${t}-${t+n-1}`));const h=await Zi.getValue(l);return 0!=h.atlas_height&&0!=h.atlas_width&&0!=h.atlas.length||console.warn(`No font data from '${i}'`),new Yi(t,e,h,s)}render(t,e,[i,s],n){const r=T(e),o=this.shader_manager.getShaderProgram(t,r.shaderData),a={a_pos:this.anchors,a_offset:this.offsets,a_tex_coord:this.texcoords},l={u_map_width:i,u_map_height:s,u_map_zoom:n,u_font_size:this.opts.font_size,u_halo_color:this.opts.halo_color.toRGBATuple(),u_offset:0,...this.shader_manager.getShaderUniforms(r)};null!==this.data?a.a_value=this.data:l.u_text_color=this.opts.text_color.toRGBATuple(),l.u_is_halo=this.opts.halo?1:0,o.use(a,l,{u_sdf_sampler:this.texture}),null!==this.cmap_gpu&&this.cmap_gpu.bindShaderVariables(o),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),o.draw(),this.opts.halo&&(o.setUniforms({u_is_halo:0}),o.draw()),"maplibre"==r.type&&r.shaderData.define.includes("GLOBE")||(o.setUniforms({u_offset:-2,u_is_halo:this.opts.halo?1:0}),o.draw(),this.opts.halo&&(o.setUniforms({u_is_halo:0}),o.draw()),o.setUniforms({u_offset:-1,u_is_halo:this.opts.halo?1:0}),o.draw(),this.opts.halo&&(o.setUniforms({u_is_halo:0}),o.draw()),o.setUniforms({u_offset:1,u_is_halo:this.opts.halo?1:0}),o.draw(),this.opts.halo&&(o.setUniforms({u_is_halo:0}),o.draw()))}}var Ji=i(317);function Qi(t){return class extends t{constructor(...t){super(...t),this.billboard_buffer_cache=new v((t,e,i)=>async function(t,e,i,s){const{lats:n,lons:r}=e.getEarthCoords(),o=e.getMinVisibleZoom(i),a=await G.makeBBElements(n,r,o,e.ni,e.nj,s);return{vertices:new k(t,a.pts,2,t.POINTS,{per_instance:!0}),texcoords:new k(t,a.tex_coords,2,t.POINTS,{per_instance:!0})}}(t,this,e,i)),this.vector_rotation_cache=new v((t,e)=>function(t,e,i){const s=e.getEarthCoords(),n=new Si(e.ni*e.nj).fill(parseFloat("nan"));if(i)n.fill(0);else{e.is_conformal||console.warn("Vector rotations for non-conformal projections are not supported. The output may look incorrect.");for(let t=0;t<s.lats.length;t++){const i=s.lons[t],r=s.lats[t];n[t]=e.getVectorRotationAtPoint(i,r)}}const{format:r,type:o,row_alignment:a}=P(t,"float16"),l={format:r,type:o,row_alignment:a,image:new Uint16Array(n.buffer),width:e.ni,height:e.nj,mag_filter:t.LINEAR};return{rotation:new j(t,l)}}(t,this,e))}async getWGLBillboardBuffers(t,e,i){return await this.billboard_buffer_cache.getValue(t,e,i)}getVectorRotationTexture(t,e){return this.vector_rotation_cache.getValue(t,e)}getVectorRotationAtPoint(t,e){const[i,s]=this.transform(t,e),[n,r]=this.transform(t+.01,e);return Math.atan2(r-s,n-i)}}}const ts=6378137,es=6356752.314245;class is{constructor(t,e,i,s){this.type=t,this.is_conformal=e,this.ni=i,this.nj=s}}class ss extends(Qi(is)){constructor(t,e){super("unstructured",!0,Math.min(t.length,4096),Math.floor(t.length/4096)+1),this.coords=t,this.zoom_arg=void 0===e?null:e,this.zoom_cache=new v(t=>{const e=Math.log2(t),i=this.coords.map(t=>({...new z(t.lon,t.lat).toMercatorCoord(),min_zoom:24})),s=new Ji.kdTree([...i],(t,e)=>Math.max(Math.abs(t.x-e.x),Math.abs(t.y-e.y)),["x","y"]),n=(t,i,r)=>{const o=Math.pow(.5,r+1),a=s.nearest({x:t,y:i,min_zoom:0},2,o);if(a.length>0){const[t,i]=a.sort((t,e)=>t[1]-e[1])[0];24==t.min_zoom&&(t.min_zoom=Math.max(r-e,0))}a.length>1&&r<24+e&&(n(t-o/2,i-o/2,r+1),n(t+o/2,i-o/2,r+1),n(t-o/2,i+o/2,r+1),n(t+o/2,i+o/2,r+1))};return n(.5,.5,-1),new Uint8Array(i.map(t=>t.min_zoom))})}copy(){return new ss(this.coords)}getEarthCoords(){return{lons:new Float32Array(this.coords.map(t=>t.lon)),lats:new Float32Array(this.coords.map(t=>t.lat))}}getGridCoords(){const{lons:t,lats:e}=this.getEarthCoords();return{x:t,y:e}}transform(t,e,i){return[t,e]}getMinVisibleZoom(t){return null!==this.zoom_arg?this.zoom_arg:this.zoom_cache.getValue(t)}getThinnedGrid(t,e){const i=this.getMinVisibleZoom(t);return new ss(this.coords.filter((t,s)=>i[s]<=e),i.filter(t=>t<=e))}thinDataArray(t,e){let i=0;const s=new(y(e))(this.ni*this.nj);for(let n=0;n<t.coords.length&&!(this.coords[i].lat==t.coords[n].lat&&this.coords[i].lon==t.coords[n].lon&&(s[i++]=e[n],i>=this.coords.length));n++);return s}sampleNearestGridPoint(t,e,i){const s=E(this.coords.map(i=>(i.lon-t)*(i.lon-t)+(i.lat-e)*(i.lat-e)));return{sample:i[s],sample_lon:this.coords[s].lon,sample_lat:this.coords[s].lat}}}const ns={color:"#000000",cmap:null,interval:1,levels:null,line_width:2,line_style:"-",quad_as_tri:!1},rs={n_decimal_places:0,font_face:"Trebuchet MS",font_size:12,font_url_template:"",label_formatter:t=>t.toString(),text_color:"#000000",halo_color:"#000000",halo:!1,density:1};class os extends B{constructor(t,e){super(),this.opts=w(e,rs),this.contours=t,this.text_collection=null,this.gl_elems=null}async updateField(){if(null===this.gl_elems)return;const t=this.gl_elems.map,e=this.gl_elems.gl,i=t.getStyle(),s=""==this.opts.font_url_template?i.glyphs:this.opts.font_url_template;if(void 0===s)throw"The map style doesn't have any glyph information. Please pass the font_url_template option to ContourLabels";const n=s.replace("{fontstack}",this.opts.font_face),r=[],o=await this.contours.getContours(),a=Object.keys(o).map(parseFloat);a.sort((t,e)=>t-e);const l=t.getMaxZoom(),h=.006/this.opts.density*Math.pow(2,7-l);Object.entries(o).forEach(([t,e])=>{const i=parseFloat(t)-a[0],s=this.opts.label_formatter(t);e.forEach(t=>{const e=t.map(t=>{const e=new z(...t).toMercatorCoord();return[e.x,e.y]}),n=[];e.forEach((t,i)=>{if(0==i)n.push(0);else{const s=e[i-1],r=Math.hypot(s[0]-t[0],s[1]-t[1]);n.push(n[i-1]+r)}});let o=0;for(let e=1;e<n.length;e++){const a=h*(o+i/2%1);if(n[e-1]<=a&&a<n[e]){const i=t[e-1],l=t[e],h=(a-n[e-1])/(n[e]-n[e-1]),c=(1-h)*i[0]+h*l[0],f=(1-h)*i[1]+h*l[1];r.push({coord:{lon:c,lat:f},text:s}),o++}}})});const c=new ss(r.map(t=>t.coord)).getMinVisibleZoom(4),f=r.map((t,e)=>({...t.coord,min_zoom:c[e],text:t.text})),u={horizontal_align:"center",vertical_align:"middle",font_size:this.opts.font_size,halo:this.opts.halo,text_color:Ci.fromHex(this.opts.text_color),halo_color:Ci.fromHex(this.opts.halo_color)};this.text_collection=await Yi.make(e,f,n,u),t.triggerRepaint()}async onAdd(t,e){this.gl_elems={gl:e,map:t},this.updateField()}render(t,e){if(null===this.gl_elems||null===this.text_collection)return;const i=this.gl_elems,s=i.map.getCanvas().width,n=i.map.getCanvas().height,r=i.map.getZoom();this.text_collection.render(t,e,[s,n],r)}}const as=class extends B{constructor(t,e){super(),this.field=t,this.opts=w(e,ns),this.gl_elems=null,this.contours=null}async updateField(t){if(this.field=t,null===this.gl_elems)return;const e=this.gl_elems.gl,i=await this.getContours(),s=[];Object.entries(i).forEach(([t,e])=>{const i=parseFloat(t),n=(r=this.opts.line_style)in $i||Array.isArray(r)&&r.length>0&&r.map(t=>"number"==typeof t).reduce((t,e)=>t&&e,!0)?this.opts.line_style:this.opts.line_style(i);var r;const o="number"==typeof this.opts.line_width?this.opts.line_width:this.opts.line_width(i),a=e.map(t=>{const e={vertices:t};return null!==this.opts.cmap&&(e.data=t.map(()=>i)),e}),l=s.filter(t=>t.line_style==n&&t.line_width==o);let h;0==l.length?(h={data:[],line_width:o,line_style:n},s.push(h)):h=l[0],h.data=h.data.concat(a)});const n=s.map(async t=>{const i={line_width:t.line_width,line_style:t.line_style};return null!==this.opts.cmap?i.cmap=this.opts.cmap:i.color=this.opts.color,await Hi.make(e,t.data,i)});Promise.all(n).then(t=>{null!==this.gl_elems&&(this.contours=t,this.gl_elems.map.triggerRepaint())})}async getContours(){const t=null===this.opts.levels?void 0:this.opts.levels;return await this.field.getContours({interval:this.opts.interval,levels:t,quad_as_tri:this.opts.quad_as_tri})}async onAdd(t,e){this.gl_elems={gl:e,map:t},await this.updateField(this.field)}render(t,e){if(null===this.gl_elems||null===this.contours)return;const i=this.gl_elems,s=i.map.getZoom(),n=i.map.getCanvas().width,r=i.map.getCanvas().height,o=i.map.getBearing(),a=i.map.getPitch();this.contours.forEach(i=>i.render(t,e,[n,r],s,o,a))}},ls=i(303),hs=i(401),cs={cmap:[new Ri([0,1],["#000000"],{overflow_color:"#000000",underflow_color:"#000000"})],cmap_mask:null,opacity:1};class fs extends B{constructor(t,e){super(),this.field=t,this.opts=w(e,cs),this.opts.cmap=Array.isArray(this.opts.cmap)?this.opts.cmap:[this.opts.cmap],this.cmap_gpu=this.opts.cmap.map(t=>new Oi(t)),this.gl_elems=null,this.fill_texture=null,this.mask_texture=null,this.image_mag_filter=null,this.cmap_mag_filter=null}async updateField(t,e){if(this.field=t,null===this.image_mag_filter||null===this.cmap_mag_filter)throw"Implement magnification filters in a subclass";if(null===this.gl_elems)return;const i=this.gl_elems.gl,s=this.gl_elems.map;if(this.fill_texture=this.field.updateTexImageData(i,this.image_mag_filter,this.fill_texture),void 0!==e){if(null===this.opts.cmap_mask)return void console.warn("A mask was passed to updateField on a Fill component that didn't have a mask. The updated mask will be ignored.");const{format:t,type:s,row_alignment:n}=P(i,"uint8"),r={format:t,type:s,width:this.field.grid.ni,height:this.field.grid.nj,image:e,mag_filter:i.NEAREST,row_alignment:n};null===this.mask_texture?this.mask_texture=new j(i,r):this.mask_texture.setImageData(r)}s.triggerRepaint()}async onAdd(t,e){const{vertices:i,texcoords:s}=await this.field.grid.getDomainBuffers(e);this.cmap_gpu.forEach(t=>{if(null===this.image_mag_filter||null===this.cmap_mag_filter)throw"Implement magnification filters in a subclass";t.setupShaderVariables(e,this.cmap_mag_filter)});const n=[];if(null!==this.opts.cmap_mask&&n.push("MASK"),null===this.image_mag_filter||null===this.cmap_mag_filter)throw"Implement magnification filters in a subclass";const r=this.field.getSamplerIds(),o=this.field.getExpression(),a=this.field.dtypes,l=A(Oi.applyShader(hs),r,o,a),h=new Ui(ls,l,n);this.gl_elems={gl:e,shader_manager:h,map:t,vertices:i,texcoords:s},this.updateField(this.field,null===this.opts.cmap_mask?void 0:this.opts.cmap_mask)}render(t,e){if(null===this.gl_elems||null===this.fill_texture)return;const i=this.gl_elems,s=T(e),n=this.gl_elems.shader_manager.getShaderProgram(t,s.shaderData),r=Object.fromEntries([...this.fill_texture.entries()]);n.use({a_pos:i.vertices,a_tex_coord:i.texcoords},{u_opacity:this.opts.opacity,...this.gl_elems.shader_manager.getShaderUniforms(s)},r),this.cmap_gpu.forEach((e,i)=>{n.setUniforms({u_offset:0}),null!==this.opts.cmap_mask&&null!==this.mask_texture&&(n.setUniforms({u_mask_val:i+1}),n.bindTextures({u_mask_sampler:this.mask_texture})),e.bindShaderVariables(n),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),n.draw(),"maplibre"==s.type&&s.shaderData.define.includes("GLOBE")||(n.setUniforms({u_offset:-2}),n.draw(),n.setUniforms({u_offset:-1}),n.draw(),n.setUniforms({u_offset:1}),n.draw())})}}class us extends fs{constructor(t,e){super(t,e)}async updateField(t,e){await super.updateField(t,e)}async onAdd(t,e){this.image_mag_filter=e.NEAREST,this.cmap_mag_filter=e.LINEAR,await super.onAdd(t,e)}render(t,e){super.render(t,e)}}class _s extends fs{constructor(t,e){super(t,e)}async updateField(t,e){await super.updateField(t,e)}async onAdd(t,e){this.image_mag_filter=e.LINEAR,this.cmap_mag_filter=e.NEAREST,await super.onAdd(t,e)}render(t,e){super.render(t,e)}}const ds=i(631),ps=i(254);class ms{constructor(t,e,i,s,n,r,o){o=void 0===o?{}:o,this.color=void 0===o.color?new Ci([0,0,0,1]):o.color,this.cmap=void 0===o.cmap?null:o.cmap,this.rotate_with_map=void 0===o.rotate_with_map||o.rotate_with_map,this.field=t,this.spec=n,this.size_multiplier=r,this.thin_fac=e,this.max_zoom=i,this.billboard_image=s,this.gl_elems=null,this.wind_textures=null}updateField(t){if(this.field=t,null===this.gl_elems)return;const e=this.gl_elems.gl,i=this.field.getThinnedField(this.thin_fac,this.max_zoom);this.wind_textures=i.updateTexImageData(e,e.NEAREST,this.wind_textures)}async setup(t){const e=this.field.grid.getThinnedGrid(this.thin_fac,this.max_zoom),i=new Float32Array([0,1,2,3]),s=new k(t,i,1,t.TRIANGLE_STRIP),{vertices:n,texcoords:r}=await e.getWGLBillboardBuffers(t,this.thin_fac,this.max_zoom),{rotation:o}=e.getVectorRotationTexture(t,"earth"==this.field.relative_to),a=new j(t,this.billboard_image),l=[];let h=ps,c=null;null!==this.cmap&&(h=Oi.applyShader(h),c=new Oi(this.cmap),c.setupShaderVariables(t,t.NEAREST),l.push("COLORMAP"));const f=this.field.getSamplerIds(),u=this.field.getExpressions(),_=function(t,e,i){const s=e.u.map(t=>`uniform sampler2D ${t};`).join("\n")+"\n"+e.v.map(t=>`uniform sampler2D ${t};`).join("\n"),n=e.u.map(t=>` highp float ${t}_val = texture(${t}, tex_coord).r;`).join("\n"),r=e.v.map(t=>` highp float ${t}_val = texture(${t}, tex_coord).r;`).join("\n");let o=i.u;e.u.forEach(t=>o=o.replaceAll(t,`${t}_val`));let a=i.v;return e.v.forEach(t=>a=a.replaceAll(t,`${t}_val`)),x(`\n${s}\n\nhighp float get_field_value_u(lowp vec2 tex_coord) {\n${n}\n return ${o};\n}\n\nhighp float get_field_value_v(lowp vec2 tex_coord) {\n${r}\n return ${a};\n}`,t)}(ds,f,u),d=new Ui(_,h,l);this.gl_elems={gl:t,shader_manager:d,geom_vertices:s,vertices:n,texcoords:r,texture:a,proj_rot_texture:o,cmap_gpu:c}}render(t,e,[i,s],n,r,o){if(null===this.gl_elems||null===this.wind_textures)return;const a=T(e),l=this.gl_elems.shader_manager.getShaderProgram(t,a.shaderData),h=this.gl_elems,c=this.spec.BB_HEIGHT*(s/i)*this.size_multiplier,f=this.spec.BB_WIDTH/this.spec.BB_TEX_WIDTH,u=this.spec.BB_HEIGHT/this.spec.BB_TEX_HEIGHT,_={u_sampler:h.texture,u_rot_sampler:h.proj_rot_texture,...Object.fromEntries([...this.wind_textures.u.entries()]),...Object.fromEntries([...this.wind_textures.v.entries()])};l.use({a_geom:h.geom_vertices,a_pos:h.vertices,a_tex_coord:h.texcoords},{u_bb_size:c,u_bb_width:f,u_bb_height:u,u_bb_mag_bin_size:this.spec.BB_MAG_BIN_SIZE,u_bb_mag_wrap:this.spec.BB_MAG_WRAP,u_offset:0,u_map_aspect:s/i,u_zoom:n,u_rotate_with_map:this.rotate_with_map?1:0,...this.gl_elems.shader_manager.getShaderUniforms(a)},_),null!==h.cmap_gpu?h.cmap_gpu.bindShaderVariables(l):l.setUniforms({u_bb_color:this.color.toRGBATuple()}),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),l.draw(),"maplibre"==a.type&&a.shaderData.define.includes("GLOBE")||(l.setUniforms({u_offset:-2}),l.draw(),l.setUniforms({u_offset:-1}),l.draw(),l.setUniforms({u_offset:1}),l.draw())}}const gs={BB_WIDTH:85,BB_HEIGHT:256,BB_TEX_WIDTH:1024,BB_TEX_HEIGHT:1024,BB_MAG_MAX:235,BB_MAG_WRAP:60,BB_MAG_BIN_SIZE:5},bs={color:"#000000",cmap:null,line_width:2,barb_size_multiplier:1,thin_fac:1},vs=class extends B{constructor(t,e){super(),this.fields=t,this.opts=w(e,bs),this.color=Ci.fromHex(this.opts.color),this.barb_texture=function(t,e){let i=document.createElement("canvas");function s(e,i,s,n){const r=t.BB_WIDTH/2-4,o=r/2;if(n<2.5)e.beginPath(),e.arc(i,s,r/2,0,2*Math.PI),e.stroke();else{let t=0,a=n,l=0;const h=Math.floor((a+2.5)/50);l+=h*r/2+o+(h-1)*o/2,a-=50*h;const c=Math.floor((a+2.5)/10);l+=c*o,a-=10*c,l+=Math.floor((a+2.5)/5)*o,n<7.5&&(l+=o),l=Math.max(120,l),e.beginPath(),e.moveTo(i,s),e.lineTo(i,s+l),a=n,t=s+l;let f=!1,u=!0;for(;a>47.5;)f&&(t+=o/2),u||e.moveTo(i,t),e.lineTo(i-r,t),e.lineTo(i,t-r/2),t-=r/2+o,a-=50,f=!0,u=!1;for(;a>7.5;)u||e.moveTo(i,t),e.lineTo(i-r,t+r/2),t-=o,a-=10,u=!1;for(n<7.5&&(t-=o);a>2.5;)e.moveTo(i,t),e.lineTo(i-r/2,t+r/4),a-=5;e.stroke()}}i.width=t.BB_TEX_WIDTH,i.height=t.BB_TEX_HEIGHT;let n=i.getContext("2d");if(null===n)throw"Could not get rendering context for the wind barb canvas";n.lineWidth=e,n.miterLimit=4;for(let e=0;e<=t.BB_MAG_MAX;e+=t.BB_MAG_BIN_SIZE)s(n,e%t.BB_MAG_WRAP/t.BB_MAG_BIN_SIZE*t.BB_WIDTH+t.BB_WIDTH/2,Math.floor(e/t.BB_MAG_WRAP)*t.BB_HEIGHT+t.BB_WIDTH/2,e);return i}(gs,this.opts.line_width/this.opts.barb_size_multiplier*4),this.gl_elems=null}async updateField(t){this.fields=t,null!==this.gl_elems&&(this.gl_elems.barb_billboards.updateField(t),this.gl_elems.map.triggerRepaint())}async onAdd(t,e){e.getExtension("OES_texture_float"),e.getExtension("OES_texture_float_linear");const i=t.getMaxZoom(),s={format:e.RGBA,type:e.UNSIGNED_BYTE,image:this.barb_texture,mag_filter:e.NEAREST},n=null===this.opts.cmap?void 0:this.opts.cmap,r=new ms(this.fields,this.opts.thin_fac,i,s,gs,.1*this.opts.barb_size_multiplier,{color:this.color,cmap:n});await r.setup(e),this.gl_elems={map:t,barb_billboards:r},this.updateField(this.fields)}render(t,e){if(null===this.gl_elems)return;const i=this.gl_elems,s=i.map.getZoom(),n=i.map.getCanvas().width,r=i.map.getCanvas().height,o=i.map.getBearing(),a=i.map.getPitch();i.barb_billboards.render(t,e,[n,r],s,o,a)}},ws=i(187),ys=i(820),xs=i(325),As=i(314),Es={colors:["#000000"],opacity:1},Ms=class extends B{constructor(t,e){super(),this.field=t,this.opts=w(e,Es),this.color_components=this.opts.colors.map(t=>Ci.fromHex(t).toRGBATuple()),this.gl_elems=null,this.fill_texture=null}async updateField(t){if(this.field=t,null===this.gl_elems)return;const e=this.gl_elems.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,2),this.fill_texture=this.field.updateTexImageData(e,e.NEAREST,this.fill_texture)}async onAdd(t,e){e.getExtension("OES_texture_float");const i=new k(e,new Float32Array([-1,-1,1,-1,-1,1,1,1]),2,e.TRIANGLE_STRIP),{vertices:s,texcoords:n}=await this.field.grid.getDomainBuffers(e),r=this.field.getSamplerIds(),o=this.field.getExpression(),a=this.field.dtypes,l=A(xs,r,o,a),h=new H(e,ws,l),c=new Ui(ys,As,[]),{format:f,type:u,row_alignment:_}=P(e,"float16"),d=new j(e,{format:f,type:u,width:this.field.grid.ni,height:this.field.grid.nj,image:null,mag_filter:e.LINEAR,row_alignment:_}),p=new W(e,d);this.gl_elems={gl:e,map:t,shader_program_1:h,shader_manager_2:c,vertices_step1:i,vertices_step2:s,texcoords_step2:n,framebuffer:p},this.updateField(this.field)}render(t,e){if(null===this.gl_elems||null===this.fill_texture)return;const i=this.gl_elems,s=(this.fill_texture,i.map),n=s.getCanvas().width,r=s.getCanvas().height,o=T(e),a=this.gl_elems.shader_program_1,l=this.gl_elems.shader_manager_2.getShaderProgram(t,o.shaderData),h=Object.fromEntries([...this.fill_texture.entries()]);this.color_components.forEach((e,s)=>{a.use({a_pos:i.vertices_step1},{u_imem:s},h),i.framebuffer.clear([0,0,0,1]),i.framebuffer.renderTo(0,0,this.field.grid.ni,this.field.grid.nj),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),a.draw(),l.use({a_pos:i.vertices_step2,a_tex_coord:i.texcoords_step2},{u_opacity:this.opts.opacity,u_color:e,u_offset:0,...i.shader_manager_2.getShaderUniforms(o)},{u_fill_sampler:i.framebuffer.texture}),W.screen(t).renderTo(0,0,n,r),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),l.draw(),"maplibre"==o.type&&o.shaderData.define.includes("GLOBE")||(l.setUniforms({u_offset:-2}),l.draw(),l.setUniforms({u_offset:-1}),l.draw(),l.setUniforms({u_offset:1}),l.draw())})}},Ss={BB_WIDTH:256,BB_HEIGHT:256,BB_TEX_WIDTH:256,BB_TEX_HEIGHT:256,BB_MAG_MAX:1e3,BB_MAG_WRAP:1e3,BB_MAG_BIN_SIZE:1e3},Ts={bgcolor:"#000000",thin_fac:1,hodo_line_width:2.5,background_line_width:1.5,height_cmap:new Ri([0,1,3,6,9],["#ffffcc","#a1dab4","#41b6c4","#225ea8"]),max_wind_speed_ring:80},Cs=class extends B{constructor(t,e){super(),this.profile_field=t,this.opts=w(e,Ts),this.hodo_bg_texture=function(t,e){let i=document.createElement("canvas");i.width=Ss.BB_TEX_WIDTH,i.height=Ss.BB_TEX_HEIGHT;let s=i.getContext("2d");if(null===s)throw"Could not get rendering context for the hodograph background canvas";s.lineWidth=t;for(let e=Ss.BB_TEX_WIDTH/4;e<=Ss.BB_TEX_WIDTH/2;e+=Ss.BB_TEX_WIDTH/4)s.beginPath(),s.arc(Ss.BB_TEX_WIDTH/2,Ss.BB_TEX_WIDTH/2,e-t/2,0,2*Math.PI),s.stroke();if(e){const t=Ss.BB_TEX_WIDTH/2,e=Ss.BB_TEX_WIDTH/2,i=20;s.beginPath(),s.moveTo(t,e),s.lineTo(t+i/2,e+i),s.lineTo(t-i/2,e+i),s.lineTo(t,e),s.fill()}else s.beginPath(),s.arc(Ss.BB_TEX_WIDTH/2,Ss.BB_TEX_WIDTH/2,t,0,2*Math.PI),s.fill();return i}(2.5*this.opts.background_line_width,M(t.profiles[0])),this.hodo_scale=(Ss.BB_TEX_WIDTH-this.opts.background_line_width/2)/(Ss.BB_TEX_WIDTH*this.opts.max_wind_speed_ring),this.bg_size=140,this.gl_elems=null,this.line_elems=null}async updateField(t){if(this.profile_field=t,null===this.gl_elems)return;const e=this.gl_elems.gl;this.gl_elems.bg_billboard.updateField(t.getStormMotionGrid());const i=this.profile_field.profiles,{lats:s,lons:n}=this.profile_field.getProfileCoords(),r=this.profile_field.grid.getMinVisibleZoom(this.opts.thin_fac),o=i.map((t,e)=>({offsets:[...t.u].map((e,i)=>M(t)?[e-t.smu,t.v[i]-t.smv]:[e,t.v[i]]),vertices:[...t.u].map(t=>[n[e],s[e]]),zoom:r[e],data:[...t.z]})),a=await Hi.make(e,o,{line_width:this.opts.hodo_line_width,cmap:this.opts.height_cmap,offset_scale:this.hodo_scale*this.bg_size,offset_rotates_with_map:!1}),l=i.map((t,e)=>{if(!M(t))return{vertices:[]};const i=Math.hypot(t.smu,t.smv),o=Math.PI/2-Math.atan2(-t.smv,-t.smu);return{offsets:[[2*Math.sin(o),2*Math.cos(o)],[i*Math.sin(o),i*Math.cos(o)]],vertices:[[n[e],s[e]],[n[e],s[e]]],zoom:r[e]}}),h=await Hi.make(e,l,{line_width:this.opts.background_line_width,color:this.opts.bgcolor,offset_scale:this.hodo_scale*this.bg_size,offset_rotates_with_map:!1});this.line_elems={hodo_line:a,sm_line:h}}async onAdd(t,e){const i={format:e.RGBA,type:e.UNSIGNED_BYTE,image:this.hodo_bg_texture,mag_filter:e.NEAREST},s=t.getMaxZoom(),n=new ms(this.profile_field.getStormMotionGrid(),this.opts.thin_fac,s,i,Ss,.004*this.bg_size,{color:Ci.fromHex(this.opts.bgcolor),rotate_with_map:!1});await n.setup(e),this.gl_elems={gl:e,map:t,bg_billboard:n},this.updateField(this.profile_field)}render(t,e){if(null===this.gl_elems||null===this.line_elems)return;const i=this.gl_elems,s=this.line_elems,n=i.map.getZoom(),r=i.map.getCanvas().width,o=i.map.getCanvas().height,a=i.map.getBearing(),l=i.map.getPitch();s.hodo_line.render(t,e,[r,o],n,a,l),s.sm_line.render(t,e,[r,o],n,a,a),i.bg_billboard.render(t,e,[r,o],n,a,l)}},Ns={"0/8":59658,"1/8":59659,"2/8":59660,"3/8":59661,"4/8":59662,"5/8":59663,"6/8":59664,"7/8":59665,"8/8":59666,clr:59658,few:59660,sct:59662,bkn:59664,ovc:59666,obsc:59667,va:59810,fu:59810,hz:59811,du:59812,bldu:59814,sa:59814,blsa:59814,vcblsa:59814,vcbldu:59814,blpy:59814,po:59816,vcpo:59816,vcds:59817,vcss:59817,br:59818,bcbr:59818,bc:59819,mifg:59820,vcts:59821,virga:59822,vcsh:59824,ts:59825,thdr:59825,vctshz:59825,tsfzfg:59825,tsbr:59825,tsdz:59825,vctsup:59825,"-tsup":59825,tsup:59825,"+tsup":59825,sq:59826,fc:59827,"+fc":59827,ds:59839,ss:59839,drsa:59839,drdu:59839,"+ds":59842,"+ss":59842,drsn:59844,"+drsn":59845,"-blsn":59846,blsn:59846,"+blsn":59847,vcblsn:59846,vcfg:59848,bcfg:59849,prfg:59852,fg:59853,fzfg:59857,"-vctsdz":59859,"-dz":59859,"-dzbr":59859,vctsdz:59861,dz:59861,"+vctsdz":59863,"+dz":59863,"-fzdz":59864,"-fzdzsn":59864,fzdz:59865,"+fzdz":59865,fzdzsn:59865,"-dzra":59866,dzra:59867,"+dzra":59867,"-ra":59869,"-rabr":59869,ra:59871,rabr:59871,rafg:59871,vcra:59871,"+ra":59873,"-fzra":59874,"-fzrasn":59874,"-fzrabr":59874,"-fzrapl":59874,"-fzrasnpl":59874,tsfzrapl:59875,"-tsfzra":59875,fzra:59875,"+fzra":59875,fzrasn:59875,tsfzra:59875,"-dzsn":59876,"-rasn":59876,"-snra":59876,"-sndz":59876,rasn:59877,"+rasn":59877,snra:59877,dzsn:59877,sndz:59877,"+dzsn":59877,"+sndz":59877,"-sn":59879,"-snbr":59879,sn:59881,"+sn":59883,"-snsg":59885,sg:59885,"-sg":59885,ic:59886,"-fzdzpl":59887,"-fzdzplsn":59887,fzdzpl:59887,"-fzraplsn":59887,fzrapl:59887,"+fzrapl":59887,"-rapl":59887,"-rasnpl":59887,"-raplsn":59887,"+rapl":59887,rapl:59887,"-snpl":59887,snpl:59887,"-pl":59887,pl:59887,"-plsn":59887,"-plra":59887,plra:59887,"-pldz":59887,"+pl":59887,plsn:59887,plup:59887,"+plsn":59887,"-sh":59888,"-shra":59888,sh:59889,shra:59889,"+sh":59889,"+shra":59889,"-shrasn":59891,"-shsnra":59891,"+shrabr":59892,shrasn:59892,"+shrasn":59892,shsnra:59892,"+shsnra":59892,"-shsn":59893,shsn:59894,"+shsn":59894,"-gs":59895,"-shgs":59895,fzraplgs:59896,"-sngs":59896,gsplsn:59896,gspl:59896,plgssn:59896,gs:59896,shgs:59896,"+gs":59896,"+shgs":59896,"-gr":59897,"-shgr":59897,"-sngr":59898,gr:59898,shgr:59898,"+gr":59898,"+shgr":59898,"-tsrasn":59907,tsrasn:59907,"-tssnra":59907,tssnra:59907,"-vctsra":59908,"-tsra":59908,tsra:59908,"-tsdz":59908,vctsra:59908,tspl:59909,"-tssn":59909,"-tspl":59909,tssn:59909,"-vctssn":59909,vctssn:59909,tsplsn:59909,tssnpl:59909,"-tssnpl":59909,"-tsragr":59910,tsrags:59910,tsragr:59910,tsgs:59910,tsgr:59910,"+tsfzrapl":59911,"+vctsra":59912,"+tsra":59912,"+tsfzra":59912,"+tssn":59913,"+tspl":59913,"+tsplsn":59913,"+vctssn":59913,tssa:59914,tsds:59914,tsdu:59914,"+tsgs":59915,"+tsgr":59915,"+tsrags":59915,"+tsragr":59915,in:59750,"-up":59750,up:59750,"+up":59751,"-fzup":59756,fzup:59756,"+fzup":59757},Rs={config:{},thin_fac:1,font_face:"Trebuchet MS",font_size:12,font_url_template:""};function Gs(t,e){let i,s,n,r;return e=void 0===e?10:e,"ll"==t||"cl"==t||"ul"==t?(i="right",n=-e):"lc"==t||"c"==t||"uc"==t?(i="center",n=0):(i="left",n=e),"ll"==t||"lc"==t||"lr"==t?(s="top",r=-e):"cl"==t||"c"==t||"cr"==t?(s="middle",r=0):(s="baseline",r=e),{horizontal_align:i,vertical_align:s,offset_x:n,offset_y:r}}const Is=class extends B{constructor(t,e){super(),this.field=t,this.opts=w(e,Rs),this.gl_elems=null,this.text_components=null}async updateField(t){if(this.field=t,null===this.gl_elems)return;const e=this.gl_elems.map,i=this.gl_elems.gl,s=this.gl_elems.barb_components,n=e.getStyle(),r=""==this.opts.font_url_template?n.glyphs:this.opts.font_url_template;if(void 0===r)throw"The map style doesn't have any glyph information. Please pass the font_url_template option to StationPlot";const o=r.replace("{fontstack}",this.opts.font_face),a=this.field.grid.getEarthCoords(),l=this.field.grid.getMinVisibleZoom(this.opts.thin_fac);let h=0,c=[];Object.entries(this.opts.config).forEach(async([t,e])=>{const n=t;if("number"==e.type||"string"==e.type){const t=e.pos,s=void 0===e.color?Ci.fromHex("#000000"):Ci.normalizeColor(e.color),r=void 0===e.halo_color?Ci.fromHex("#ffffff"):Ci.normalizeColor(e.halo_color),h=void 0===e.halo||e.halo;let f,u=null;if("number"==e.type){u=void 0===e.cmap?null:e.cmap;const t=this.field.getScalar(n),i=void 0===e.formatter?t=>null===t?"null":t.toString():e.formatter;f=t.map((t,e)=>{const s={text:i(t),lat:a.lats[e],lon:a.lons[e],min_zoom:l[e]};return null!==t&&(s.data_value=t),s})}else f=this.field.getStrings(n).map((t,e)=>({text:null===t?"":t,lat:a.lats[e],lon:a.lons[e],min_zoom:l[e]}));const _={...Gs(t),font_size:this.opts.font_size,halo:h,text_color:s,halo_color:r,cmap:u};c.push([Yi.make(i,f,o,_)])}else if("barb"==e.type){const t=this.field.getVector(n);s[h++].updateField(t)}else{if("symbol"!=e.type)throw`Unknown station plot configuration type ${e.type}`;{const t=e.pos,s=void 0===e.color?"#000000":e.color,o=void 0===e.halo_color?Ci.fromHex("#ffffff"):Ci.normalizeColor(e.halo_color),h=void 0===e.halo||e.halo,f=this.field.getStrings(n),u=r.replace("{fontstack}","wx_symbols"),_=[];f.forEach((t,e)=>{const i=null===t?"none":function(t){const e=t.toLowerCase();return e.includes("fzra")||e.includes("fz")&&e.includes("ra")?"freezing_rain":e.includes("pl")?"sleet":e.includes("sn")||e.includes("sg")||e.includes("gs")?"snow":e.includes("ra")||e.includes("dz")?"rain":e.includes("du")||e.includes("ds")||e.includes("ss")||e.includes("blsa")||e.includes("bldu")||e.includes("blpy")?"blowing_dust":e.includes("ts")||e.includes("thdr")?"thunder":e.includes("fg")?"fog":"none"}(t),n="string"==typeof s?s:s(t,i),r=_.filter(t=>t.color==n);let o;0==r.length?(o={specs:[],color:n},_.push(o)):o=r[0],o.specs.push({text:null===t?"":String.fromCharCode(Ns[t]),lat:a.lats[e],lon:a.lons[e],min_zoom:l[e]})});const d=[];_.forEach(e=>{const s={...Gs(t),font_size:this.opts.font_size,halo:h,text_color:Ci.normalizeColor(e.color),halo_color:o};void 0!==s.offset_x&&(s.offset_x-=3),d.push(Yi.make(i,e.specs,u,s))}),c.push(d)}}}),this.text_components=await Promise.all(c.map(t=>Promise.all(t))),e.triggerRepaint()}async onAdd(t,e){const i=Object.entries(this.opts.config).map(async([i,s])=>{const n=i;if("barb"==s.type){const i=this.field.getVector(n),r=void 0===s.color?"#000000":s.color,o=void 0===s.barb_size_multipler?1:s.barb_size_multipler,a=new vs(i,{thin_fac:this.opts.thin_fac,color:r,barb_size_multiplier:o});return await a.onAdd(t,e),a}}),s=(await Promise.all(i)).filter(t=>void 0!==t);this.gl_elems={map:t,gl:e,barb_components:s},this.updateField(this.field)}render(t,e){if(null===this.gl_elems||null===this.text_components)return;const i=this.gl_elems,s=this.text_components,n=this.gl_elems.barb_components,r=i.map.getCanvas().width,o=i.map.getCanvas().height,a=i.map.getZoom();let l=0,h=0;Object.values(this.opts.config).forEach((i,c)=>{"barb"==i.type?n[h++].render(t,e):s[l++].forEach(i=>i.render(t,e,[r,o],a))})}};class Ds{constructor(t){this.type="custom",this.id=t,this.map=null}repaint(){null!==this.map&&this.map.triggerRepaint()}}class Bs extends Ds{constructor(t,e){super(t),this.field=e}async onAdd(t,e){this.map=t,await this.field.onAdd(t,e)}render(t,e){this.field.render(t,e)}}class Ps extends Ds{constructor(t){super(t),this.fields={},this.field_key=null,this.map=null,this.gl=null}onAdd(t,e){this.map=t,this.gl=e,Object.values(this.fields).forEach(i=>{i.onAdd(t,e).then(t=>{this.repaint()})}),this.repaint()}render(t,e){null!==this.map&&null!==this.gl&&null!==this.field_key&&this.fields.hasOwnProperty(this.field_key)&&null!==this.fields[this.field_key]&&this.fields[this.field_key].render(t,e)}setActiveKey(t){this.field_key,this.field_key=t,this.repaint()}getKeys(){return Object.keys(this.fields)}addField(t,e){this.field_key,null!==this.map&&null!==this.gl&&null!==t&&t.onAdd(this.map,this.gl).then(t=>{this.repaint()}),this.fields[e]=t,null===this.field_key&&(this.field_key=e)}}const Fs=(t,e,i)=>{const s=document.createElementNS("http://www.w3.org/2000/svg",t);return void 0!==e&&Object.entries(e).forEach(([t,e])=>{s.setAttribute(t,e.toString())}),void 0!==i&&i.appendChild(s),s};function Ls(t,e){const i=e.label||"",s=e.ticks||t.levels,n=e.orientation||"vertical",r=e.fontface||"sans-serif",o=e.ticklabelsize||12,a=e.size_long||600,l=e.size_short||a/9,h=e.outline_and_text_color||"#000000",c=e.tick_direction||("vertical"==n?"left":"bottom");if("vertical"==n&&("top"==c||"bottom"==c)||"horizontal"==n&&("left"==c||"right"==c))throw`tick_direction of '${c} doesn't match an orientation of ${n}`;const f=t=>t.toString().length,u=f(s[0]),_=f(s[s.length-1]),d=null!==t.underflow_color||null!==t.overflow_color,p=a,m=l,g=Math.max("horizontal"==n?6*Math.max(u,_):8,d?m/(2*Math.sqrt(3)):0);let b,v,w,y,x,A,E,M,S,T,C;"vertical"==n?(b=p,v=m,w="left"==c?m-3-10:3,y=g,x=10,A=p-2*g,E=w+x,S=w+x/2,M=y+A,T=null===t.underflow_color?M:M+m/(2*Math.sqrt(3)),C=null===t.overflow_color?y:y-m/(2*Math.sqrt(3))):(v=p,b=m-6,w=g,y="bottom"==c?3:m-6-3-10,A=10,x=p-2*g,E=w+x,S=y+A/2,M=y+A,T=null===t.underflow_color?w:w-m/(2*Math.sqrt(3)),C=null===t.overflow_color?E:E+m/(2*Math.sqrt(3)));const N=t.colors.length,R=Fs("svg",{width:v,height:b}),G=Fs("g",{},R);let I;I="vertical"==n?"left"==c?{"text-anchor":"end",transform:`translate(${w}, ${y})`}:{transform:`translate(${w+x}, ${y})`}:"bottom"==c?{"text-anchor":"middle",transform:`translate(${w}, ${y+A})`}:{"text-anchor":"middle",transform:`translate(${w}, ${y})`};const D=Fs("g",I,R);if(t.colors.forEach((t,e)=>{let i={};i="vertical"==n?{x:w,y:y+A*(1-(e+1)/N),width:x,height:A/N}:{x:w+x*e/N,y,width:x/N,height:A},Fs("rect",{...i,fill:t.toRGBHex(),opacity:t.a},G)}),null!==t.underflow_color){let e;e="vertical"==n?`${E} ${M}, ${S} ${T}, ${w} ${M}, ${E} ${M}`:`${w} ${M}, ${T} ${S}, ${w} ${y}, ${w} ${M}`;const i={points:e,fill:t.underflow_color.toRGBHex(),opacity:t.underflow_color.a};Fs("polygon",i,G)}if(null!==t.overflow_color){let e;e="vertical"==n?`${w} ${y}, ${S} ${C}, ${E} ${y}, ${w} ${y}`:`${E} ${y}, ${C} ${S}, ${E} ${M}, ${E} ${y}`;const i={points:e,fill:t.overflow_color.toRGBHex(),opacity:t.overflow_color.a};Fs("polygon",i,G)}const B=t.levels[0],P=t.levels[t.levels.length-1];let F,L;return s.filter(t=>B<=t&&t<=P).forEach(e=>{const i=t.levels.map(t=>Math.abs(t-e));let s=i.indexOf(i.reduce((t,e)=>Math.min(t,e)));e<=t.levels[s]&&s>0&&(s-=1),s+=(e-t.levels[s])/(t.levels[s+1]-t.levels[s]);const a=Fs("g","vertical"==n?{transform:`translate(0, ${A*(1-s/N)})`}:{transform:`translate(${x*s/N}, 0)`},D);let l,f;l="vertical"==n?"left"==c?{x2:-6}:{x2:6}:"bottom"==c?{y2:6}:{y2:-6},Fs("line",{...l,stroke:h,"stroke-width":1.5},a),f="vertical"==n?"left"==c?{x:-9,dy:"0.32em"}:{x:9,dy:"0.32em"}:"bottom"==c?{y:9,dy:"0.8em"}:{y:-9,dy:"0em"},Fs("text",{...f,fill:h,style:`font-family: ${r}; font-size: ${o}pt`},a).textContent=e.toString()}),F="vertical"==n?`${w} ${y}, ${S} ${C}, ${E} ${y}, ${E} ${M}, ${S} ${T}, ${w} ${M}, ${w} ${y}`:`${w} ${y}, ${E} ${y}, ${C} ${S}, ${E} ${M}, ${w} ${M}, ${T} ${S}, ${w} ${y}`,Fs("polygon",{points:F,stroke:h,"stroke-width":1.5,fill:"none"},R),L="vertical"==n?"left"==c?{transform:`translate(15, ${b/2}) rotate(-90)`}:{transform:`translate(${v-6}, ${b/2}) rotate(-90)`}:"bottom"==c?{transform:`translate(${v/2}, ${b-5})`}:{transform:`translate(${v/2}, 15)`},Fs("text",{...L,fill:h,"text-anchor":"middle",style:`font-family: ${r};`},R).textContent=i,R}const zs={n_cols:1,swatch_text_space:100,fontface:"sans-serif"};function Os(t,e,i){if(t.length!=e.length)throw`Mismatch between the number of colors (${t.length}) and the number of labels (${e.length})`;const s=w(i,zs);let n,r;const o=s.swatch_text_space,a=s.n_cols,l=s.fontface,h=Math.ceil(t.length/a);r=(23+o)*a+5*(a+1),n=20*h+5*(h+1);const c=Fs("svg",{width:r,height:n}),f=Fs("g",{},c);return t.forEach((t,i)=>{const s=e[i],n=i%h,r=Math.floor(i/h);let a=1;"string"!=typeof t&&(a=t.a,t=t.toRGBHex());const c=5+r*(23+o+5),u=5+25*n;Fs("rect",{x:c,y:u,fill:t,opacity:a,width:20,height:20},f),Fs("text",{x:c+20+3,y:u+10,dy:"0.32em",fill:"#000000",style:`font-size: 0.8em; font-family: ${l};`},f).textContent=s}),c}function Us(t){return t instanceof Float32Array?"float32":t instanceof Uint8Array?"uint8":t instanceof Uint16Array?"uint16":t instanceof Uint32Array?"uint32":t instanceof Int16Array?"int16":t instanceof Int32Array?"int32":"float16"}class ks{operand(t,e){const i={"+":(t,e)=>t+e,"-":(t,e)=>t-e,"*":(t,e)=>t*e,"/":(t,e)=>t/e};return"number"==typeof t?new Hs([this],`{0} ${e} ${t.toFixed(100)}`,s=>i[e](s,t)):new Hs([this,t],`{0} ${e} {1}`,i[e])}multiply(t){return this.operand(t,"*")}divide(t){return this.operand(t,"/")}add(t){return this.operand(t,"+")}subtract(t){return this.operand(t,"-")}}class js extends ks{constructor(t,e){if(super(),this.grid=t,this.data=e,t.ni*t.nj!=e.length)throw`Data size (${e.length}) doesn't match the grid dimensions (${t.ni} x ${t.nj}; expected ${t.ni*t.nj} points)`;this.contour_cache=new v(async e=>{if("float16"!=Us(this.data)&&"float32"!=Us(this.data))throw`Grid is of type ${Us(this.data)}, which is not contourable (should be either float16 or float32)`;const i=this.getTextureData();if(!((s=i)instanceof Uint16Array||s instanceof Float32Array))throw"Type check for contourable array failed";var s;const n=D(void 0,1),r=await n.contourCreator(i,t.getGridCoords(),e);for(const e in r)for(let i=0;i<r[e].length;i++)for(let s=0;s<r[e][i].length;s++){const[n,o]=r[e][i][s];r[e][i][s]=t.transform(n,o,{inverse:!0})}return r})}get aryConstructor(){return y(this.data)}get dtypes(){return[Us(this.data)]}getTextureData(){const t=this.data,e=Us(t);return["float32","uint8","uint32","uint16","int32","int16"].includes(e)?t:new Uint16Array(t.buffer)}getWGLTextureSpec(t,e){const i=this.getTextureData(),{format:s,type:n,row_alignment:r}=P(t,Us(this.data));return new Map([["_0",{format:s,type:n,width:this.grid.ni,height:this.grid.nj,image:i,mag_filter:e,min_filter:e,row_alignment:r}]])}updateTexImageData(t,e,i){const s=this.getWGLTextureSpec(t,e);return null===i?i=new Map(this.getSamplerIds().map(e=>{const i=s.get(e);if(void 0===i)throw`Missing key '${e}' in fill_texture_specs`;return[e,new j(t,i)]})):this.getSamplerIds().forEach(t=>{const e=s.get(t);if(void 0===e)throw`Missing key '${t}' in fill_texture_specs`;const n=i?.get(t);if(void 0===n)throw`Missing key '${t}' in fill_textures`;n.setImageData(e)}),i}getSamplerIds(){return["_0"]}getExpression(){return"_0"}async getContours(t){return await this.contour_cache.getValue(t)}static aggregateFields(t,...e){return new Hs(e,"",t).renderCPU()}renderCPU(){return this}*iterateCPU(){for(let t=0;t<this.data.length;t++)yield this.data[t]}getThinnedField(t,e){const i=this.grid.getThinnedGrid(t,e),s=i.thinDataArray(this.grid,this.data);return new js(i,s)}sampleFieldWithCoord(t,e){return this.grid.sampleNearestGridPoint(t,e,this.data)}sampleField(t,e){return this.sampleFieldWithCoord(t,e).sample}}const $s="abcdefghijklmnopqrstuvwxyz";class Hs extends ks{constructor(t,e,i){super(),this.raw_fields=t,this.expression=e,this.cpu_func=i}get grid(){return this.raw_fields[0].grid}get aryConstructor(){return this.raw_fields[0].aryConstructor}get dtypes(){return this.raw_fields.map(t=>t.dtypes).flat()}updateTexImageData(t,e,i){const s=new Map;return this.raw_fields.forEach((n,r)=>{let o=null;if(null!==i){o=new Map;for(let[t,e]of i)t[t.length-1]==$s[r]&&o.set(t.slice(0,-1),e)}const a=n.updateTexImageData(t,e,o);for(let[t,e]of a)s.set(`${t}${$s[r]}`,e)}),s}getSamplerIds(){return this.raw_fields.map((t,e)=>t.getSamplerIds().map(t=>`${t}${$s[e]}`)).flat()}getExpression(){let t=this.expression;return this.raw_fields.forEach((e,i)=>{let s=e.getExpression();const n=s.match(/_0[a-z]*/g);if(null===n)throw"Field expression not found";n.forEach(t=>s=s.replace(t,`${t}${$s[i]}`)),t=t.replace(`{${i}}`,s)}),`(${t})`}getThinnedField(t,e){return new Hs(this.raw_fields.map(i=>i.getThinnedField(t,e)),this.expression,this.cpu_func)}sampleFieldWithCoord(t,e){const i=this.raw_fields.map(i=>i.sampleFieldWithCoord(t,e));return{sample:this.cpu_func(...i.map(t=>t.sample)),sample_lon:i[0].sample_lon,sample_lat:i[0].sample_lat}}sampleField(t,e){return this.sampleFieldWithCoord(t,e).sample}renderCPU(){const t=new this.aryConstructor([...this.iterateCPU()]);return new js(this.grid,t)}*iterateCPU(){const t=function*(...t){const e=t.map(t=>t[Symbol.iterator]());for(;;){const t=e.map(t=>t.next());if(t.some(t=>t.done))break;yield t.map(t=>t.value)}}(...this.raw_fields.map(t=>t.iterateCPU()));for(const e of function*(t,e){for(const i of t)yield e(...i)}(t,this.cpu_func))yield e}}function Vs(t,e){return`_${e}${t.slice(1)}`}function qs(t){return`_${t.slice(2)}`}class Ws{constructor(t,e,i){this.u=t,this.v=e,i=void 0===i?{}:i,this.relative_to=void 0===i.relative_to?"grid":i.relative_to}operandScalar(t,e){const i={"*":(t,e)=>t*e,"/":(t,e)=>t/e};if("number"==typeof t){const s=new Hs([this.u],`{0} ${e} ${t.toFixed(100)}`,s=>i[e](s,t)),n=new Hs([this.v],`{0} ${e} ${t.toFixed(100)}`,s=>i[e](s,t));return new Zs(s,n,{relative_to:this.relative_to})}const s=new Hs([this.u,t],`{0} ${e} {1}`,i[e]),n=new Hs([this.v,t],`{0} ${e} {1}`,i[e]);return new Zs(s,n,{relative_to:this.relative_to})}operandVector(t,e){const i={"+":(t,e)=>t+e,"-":(t,e)=>t-e},s=new Hs([this.u,t.u],`{0} ${e} {1}`,i[e]),n=new Hs([this.v,t.v],`{0} ${e} {1}`,i[e]);return new Zs(s,n,{relative_to:this.relative_to})}multiply(t){return this.operandScalar(t,"*")}divide(t){return this.operandScalar(t,"/")}add(t){return this.operandVector(t,"+")}subtract(t){return this.operandVector(t,"-")}updateTexImageData(t,e,i){const s=(t,e,i)=>{const s=new Map,n=i?qs:Vs;return t.forEach((t,i)=>{s.set(n(i,e),t)}),s},n=this.u.updateTexImageData(t,e,null===i?null:s(i.u,"u",!0)),r=this.v.updateTexImageData(t,e,null===i?null:s(i.v,"v",!0));return{u:s(n,"u",!1),v:s(r,"v",!1)}}magnitude(){return new Hs([this.u,this.v],"length(vec2({0}, {1}))",Math.hypot)}getThinnedField(t,e){const i=this.u.getThinnedField(t,e),s=this.v.getThinnedField(t,e);return new Zs(i,s,{relative_to:this.relative_to})}get grid(){return this.u.grid}sampleField(t,e){const i=this.u.sampleFieldWithCoord(t,e),s=this.v.sampleFieldWithCoord(t,e),n="earth"==this.relative_to?0:this.grid.getVectorRotationAtPoint(i.sample_lon,i.sample_lat),r=Math.hypot(i.sample,s.sample);let o=180*(Math.PI/2-Math.atan2(-s.sample,-i.sample)+n)/Math.PI;return o>360&&(o-=360),o<0&&(o+=360),[o,r]}getSamplerIds(){return{u:this.u.getSamplerIds().map(t=>Vs(t,"u")),v:this.v.getSamplerIds().map(t=>Vs(t,"v"))}}getExpressions(){const t=(t,e)=>{const i=t.match(/_0[a-z]*/g);if(null===i)throw"Field expression not found";return i.forEach(i=>t=t.replace(i,Vs(i,e))),t};return{u:t(this.u.getExpression(),"u"),v:t(this.v.getExpression(),"v")}}}class Xs extends Ws{constructor(t,e,i,s){super(new js(t,e),new js(t,i),s),this.u_ary=e,this.v_ary=i}getSamplerIds(){return{u:["_u0"],v:["_v0"]}}getExpressions(){return{u:"_u0",v:"_v0"}}}class Zs extends Ws{}class Ks{constructor(t,e){this.profiles=e,this.grid=t}getStormMotionGrid(){const t=this.profiles,e=new Si(this.grid.ni*this.grid.nj).fill(parseFloat("nan")),i=new Si(this.grid.ni*this.grid.nj).fill(parseFloat("nan"));return t.forEach(t=>{const s=t.ilon+this.grid.ni*t.jlat;M(t)?(e[s]=t.smu,i[s]=t.smv):(e[s]=0,i[s]=0)}),new Xs(this.grid,e,i,{relative_to:"grid"})}getProfileCoords(){const{lats:t,lons:e}=this.grid.getEarthCoords(),i=new Float32Array(this.profiles.length),s=new Float32Array(this.profiles.length);return this.profiles.forEach((n,r)=>{const o=n.ilon+n.jlat*this.grid.ni;i[r]=t[o],s[r]=e[o]}),{lats:i,lons:s}}}class Ys{constructor(t,e){this.grid=t,this.data=e}getScalar(t){const e=this.data.map(e=>e[t]);if(!e.map(t=>"number"==typeof t||null===t).reduce((t,e)=>t&&e,!0))throw`It doesn't look like ${t} contains scalar numerical data`;return e}getStrings(t){const e=this.data.map(e=>e[t]);if(!e.map(t=>"string"==typeof t||null===t).reduce((t,e)=>t&&e,!0))throw`It doesn't look like ${t} contains string data`;return e}getVector(t){const e=this.data.map(e=>e[t]);if(!e.map(t=>Array.isArray(t)).reduce((t,e)=>t&&e,!0))throw`It doesn't look like ${t} contains vector data`;const i=e,s=new Si(this.grid.ni*this.grid.nj).fill(parseFloat("nan")),n=new Si(this.grid.ni*this.grid.nj).fill(parseFloat("nan"));return i.forEach(([t,e],i)=>{if(null===t||null===e)return;const[r,o]=((t,e)=>[-t*Math.sin(e*Math.PI/180),-t*Math.cos(e*Math.PI/180)])(t,e);s[i]=r,n[i]=o}),new Xs(this.grid,s,n,{relative_to:"earth"})}}async function Js(t,e,i,s,n){const r=void 0===(n=void 0===n?{}:n).margin_r||n.margin_r,o=void 0===n.margin_s||n.margin_s,a=r?1/(2*e.ni):0,l=o?1/(2*e.nj):0,h=r?"center":"edge",c=o?"center":"edge",f=r?i:i+1,u=o?s:s+1,{lats:_,lons:d}=e.getEarthCoords(i,s,h,c),p=await G.makeDomainVerticesAndTexCoords(_,d,f,u,a,l);return{vertices:new k(t,p.vertices,2,t.TRIANGLE_STRIP),texcoords:new k(t,p.tex_coords,2,t.TRIANGLE_STRIP)}}class Qs extends(function(t){return class extends t{constructor(...t){super(...t),this.buffer_cache=new v(t=>this.makeDomainBuffers(t))}async getDomainBuffers(t){return await this.buffer_cache.getValue(t)}}}(is)){constructor(t,e,i,s,n,r){super(t,e,i,s),this.thin_x=void 0===n?1:n,this.thin_y=void 0===r?1:r}xyThinFromMaxZoom(t,e){const i=Math.log2(t),s=Math.max(i+1-e,0),n=Math.pow(2,s);return[n,n]}thinnedGridParameters(t,e,i,s,n,r){const[o,a]=this.xyThinFromMaxZoom(t,e),l=(n-i)/this.ni,h=(r-s)/this.nj;return{ni:Math.ceil(this.ni/o),nj:Math.ceil(this.nj/a),thin_x:o,thin_y:a,ll_x:i,ll_y:s,ur_x:n-(this.ni-1)%o*l,ur_y:r-(this.nj-1)%a*h}}getMinVisibleZoom(t){const e=new Uint8Array(this.ni*this.nj),i=t/Math.max(this.thin_x,this.thin_y);for(let t=0;t<this.nj*this.thin_y;t++)for(let s=0;s<this.ni*this.thin_x;s++)e[t*this.ni+s]=b(t,s,i);return e}thinDataArray(t,e){const i=new(y(e))(this.ni*this.nj);for(let s=0;s<this.ni;s++)for(let n=0;n<this.nj;n++){const r=s*this.thin_x+t.ni*n*this.thin_y;i[s+this.ni*n]=e[r]}return i}async makeDomainBuffers(t){return Js(t,this,Math.max(Math.floor(this.ni/20),20),Math.max(Math.floor(this.nj/20),20))}sampleNearestGridPoint(t,e,i){const[s,n]=this.transform(t,e),{x:r,y:o}=this.getGridCoords();let a=r[0],l=r[r.length-1];const h=r[1]-r[0];let c=o[0],f=o[o.length-1];const u=o[1]-o[0];if(h<0&&([a,l]=[l,a]),u<0&&([c,f]=[f,c]),s<a-.5*h||s>l+.5*h||n<c-.5*u||n>f+.5*u)return{sample:NaN,sample_lon:NaN,sample_lat:NaN};const _=E(r.map(t=>Math.abs(t-s))),d=E(o.map(t=>Math.abs(t-n))),p=_+d*this.ni,[m,g]=this.transform(r[_],o[d],{inverse:!0});return{sample:i[p],sample_lon:m,sample_lat:g}}}function tn(t){return class extends t{constructor(){super(...arguments),this.ll_cache=null,this.gc_cache=null}setupCoordinateCaches(t,e,i,s){const n=(e-t)/(this.ni-1),r=(s-i)/(this.nj-1);this.ll_cache=new v((e,s,o,a)=>{const l="center"==o?e:e+1,h="center"==a?s:s+1,c="center"==o?this.ni:this.ni+1,f="center"==a?this.nj:this.nj+1,u="center"==o?0:-n/2,_="center"==a?0:-r/2,d=new Float32Array(l*h),p=new Float32Array(l*h),m=(c-1)/(l-1)*n,g=(f-1)/(h-1)*r;for(let e=0;e<l;e++){const s=t+e*m+u;for(let t=0;t<h;t++){const n=i+t*g+_,[r,o]=this.transform(s,n,{inverse:!0}),a=e+t*l;d[a]=r,p[a]=o}}return{lons:d,lats:p}}),this.gc_cache=new v(()=>{const e=new Float32Array(this.ni),s=new Float32Array(this.nj);for(let i=0;i<this.ni;i++)e[i]=t+i*n;for(let t=0;t<this.nj;t++)s[t]=i+t*r;return{x:e,y:s}})}getEarthCoords(t,e,i,s){if(null===this.ll_cache)throw"Need to set up coordinate caches first";return t=void 0===t?this.ni:t,e=void 0===e?this.nj:e,i=void 0===i?"center":i,s=void 0===s?"center":s,this.ll_cache.getValue(t,e,i,s)}getGridCoords(){if(null===this.gc_cache)throw"Need to set up coordinate caches first";return this.gc_cache.getValue()}}}class en extends(Qi(tn(Qs))){constructor(t,e,i,s,n,r,o,a){super("latlon",!0,t,e,o,a),this.ll_lon=i,this.ll_lat=s,this.ur_lon=n,this.ur_lat=r,this.setupCoordinateCaches(i,n,s,r)}copy(t){const e=void 0!==(t=void 0!==t?t:{}).ni?t.ni:this.ni,i=void 0!==t.nj?t.nj:this.nj,s=void 0!==t.ll_lon?t.ll_lon:this.ll_lon,n=void 0!==t.ll_lat?t.ll_lat:this.ll_lat,r=void 0!==t.ur_lon?t.ur_lon:this.ur_lon,o=void 0!==t.ur_lat?t.ur_lat:this.ur_lat;return new en(e,i,s,n,r,o)}transform(t,e,i){return[t,e]}getThinnedGrid(t,e){const{ni:i,nj:s,thin_x:n,thin_y:r,ll_x:o,ll_y:a,ur_x:l,ur_y:h}=this.thinnedGridParameters(t,e,this.ll_lon,this.ll_lat,this.ur_lon,this.ur_lat);return new en(i,s,o,a,l,h,this.thin_x*n,this.thin_y*r)}}class sn extends(Qi(tn(Qs))){constructor(t,e,i,s,n,r,o,a,l,h,c){super("latlonrot",!0,t,e,h,c),this.np_lon=i,this.np_lat=s,this.lon_shift=n,this.ll_lon=r,this.ll_lat=o,this.ur_lon=a,this.ur_lat=l,this.llrot=function(t){const e=Math.PI/180,i=t.np_lat*e,s=t.np_lon*e,n=t.lon_shift*e,r=Math.sin(i),o=Math.cos(i);return(t,i,a)=>(a=void 0===a?{inverse:!1}:a).inverse?((t,i)=>{t*=e,i*=e;const a=Math.sin(i),l=Math.cos(i),h=Math.sin(t-s),c=Math.cos(t-s),f=Math.asin(r*a+o*l*c);let u=n+Math.atan2(l*h,r*l*c-o*a);return t>Math.PI&&(t-=2*Math.PI),[u/e,f/e]})(t,i):((t,i)=>{t*=e,i*=e;const a=Math.sin(i),l=Math.cos(i),h=Math.sin(t-n),c=Math.cos(t-n),f=Math.asin(r*a-o*l*c);let u=s+Math.atan2(l*h,r*l*c+o*a);return u>Math.PI&&(u-=2*Math.PI),[u/e,f/e]})(t,i)}({np_lon:i,np_lat:s,lon_shift:n}),this.setupCoordinateCaches(r,a,o,l)}copy(t){const e=void 0!==(t=void 0!==t?t:{}).ni?t.ni:this.ni,i=void 0!==t.nj?t.nj:this.nj,s=void 0!==t.ll_lon?t.ll_lon:this.ll_lon,n=void 0!==t.ll_lat?t.ll_lat:this.ll_lat,r=void 0!==t.ur_lon?t.ur_lon:this.ur_lon,o=void 0!==t.ur_lat?t.ur_lat:this.ur_lat;return new sn(e,i,this.np_lon,this.np_lat,this.lon_shift,s,n,r,o)}transform(t,e,i){const s="inverse"in(i=void 0===i?{}:i)&&i.inverse;return this.llrot(t,e,{inverse:!s})}getThinnedGrid(t,e){const{ni:i,nj:s,thin_x:n,thin_y:r,ll_x:o,ll_y:a,ur_x:l,ur_y:h}=this.thinnedGridParameters(t,e,this.ll_lon,this.ll_lat,this.ur_lon,this.ur_lat);return new sn(i,s,this.np_lon,this.np_lat,this.lon_shift,o,a,l,h,this.thin_x*n,this.thin_y*r)}}class nn extends(Qi(tn(Qs))){constructor(t,e,i,s,n,r,o,a,l,h,c,f,u){super("lcc",!0,t,e,f,u),this.lon_0=i,this.lat_0=s,this.lat_std=n,this.ll_x=r,this.ll_y=o,this.ur_x=a,this.ur_y=l,this.a=void 0===h?ts:h,this.b=void 0===c?es:c,this.lcc=F({lon_0:i,lat_0:s,lat_std:n,a:this.a,b:this.b}),this.setupCoordinateCaches(r,a,o,l)}static fromLLCornerLonLat(t,e,i,s,n,r,o,a,l,h,c){const f=F({lon_0:i,lat_0:s,lat_std:n,a:h=void 0===h?ts:h,b:c=void 0===c?es:c}),[u,_]=f(r,o);return new nn(t,e,i,s,n,u,_,u+t*a,_+e*l,h,c)}copy(t){const e=void 0!==(t=void 0!==t?t:{}).ni?t.ni:this.ni,i=void 0!==t.nj?t.nj:this.nj,s=void 0!==t.ll_x?t.ll_x:this.ll_x,n=void 0!==t.ll_y?t.ll_y:this.ll_y,r=void 0!==t.ur_x?t.ur_x:this.ur_x,o=void 0!==t.ur_y?t.ur_y:this.ur_y;return new nn(e,i,this.lon_0,this.lat_0,this.lat_std,s,n,r,o,this.a,this.b)}transform(t,e,i){const s=void 0!==(i=void 0===i?{}:i).inverse&&i.inverse;return this.lcc(t,e,{inverse:s})}getThinnedGrid(t,e){const{ni:i,nj:s,thin_x:n,thin_y:r,ll_x:o,ll_y:a,ur_x:l,ur_y:h}=this.thinnedGridParameters(t,e,this.ll_x,this.ll_y,this.ur_x,this.ur_y);return new nn(i,s,this.lon_0,this.lat_0,this.lat_std,o,a,l,h,this.a,this.b,this.thin_x*n,this.thin_y*r)}}var rn=i(387);class on extends(tn(Qs)){constructor(t,e,i,s,n,r,o,a,l,h){super("radar",!0,t,e,l,h),this.longitude=o,this.latitude=a,this.start_rn=i,this.end_rn=s,this.start_az=n,this.end_az=r,this.geod=rn.Geodesic.WGS84,this.setupCoordinateCaches(i,s,n,r)}copy(t){const e=void 0===(t=void 0===t?{}:t).ni?this.ni:t.ni,i=void 0===t.nj?this.nj:t.nj,s=void 0===t.longitude?this.longitude:t.longitude,n=void 0===t.latitude?this.latitude:t.latitude,r=void 0===t.start_rn?this.start_rn:t.start_rn,o=void 0===t.end_rn?this.end_rn:t.end_rn,a=void 0===t.start_az?this.start_az:t.start_az,l=void 0===t.end_az?this.end_az:t.end_az;return new on(e,i,r,o,a,l,s,n)}async makeDomainBuffers(t){return await Js(t,this,16,this.nj,{margin_r:!1,margin_s:!1})}transform(t,e,i){if(void 0!==(i=void 0===i?{}:i).inverse&&i.inverse){const i=this.geod.Direct(this.latitude,this.longitude,e,t);if(void 0===i.lon2||void 0===i.lat2)throw"Why are lon2 and lat2 not in the return value?";return[i.lon2,i.lat2]}{const i=this.geod.Inverse(this.latitude,this.longitude,e,t);if(void 0===i.azi1||void 0===i.s12)throw"Why are azi1 and s12 not in the return value?";if(!Number.isFinite(i.azi1)||!Number.isFinite(i.s12))return[NaN,NaN];const s=.5*(this.end_az-this.start_az)/this.ni;let n=i.azi1;for(;n<this.start_az-s;)n+=360;for(;n>=this.end_az+s;)n-=360;return[i.s12,n]}}getThinnedGrid(t,e){const{ni:i,nj:s,thin_x:n,thin_y:r,ll_x:o,ll_y:a,ur_x:l,ur_y:h}=this.thinnedGridParameters(t,e,this.end_az,this.end_rn,this.start_az,this.start_rn);return new on(i,s,a,h,o,l,this.longitude,this.latitude,n*this.thin_x,r*this.thin_y)}}class an extends(tn(Qs)){constructor(t,e,i,s,n,r,o,a,l){super("geostationary",!1,t,e,a,l),this.satellite_lon=o,this.ll_x=i,this.ll_y=s,this.ur_x=n,this.ur_y=r,this.vpp=function(t){const e=Math.PI/180,{lon_0:i,alt:s,a:n,b:r}=t,o=i*e,a=n*n,l=r*r,h=(t,i)=>{t*=e,i*=e;const n=Math.cos(i),h=Math.sin(i),c=Math.cos(t-o),f=Math.sin(t-o),u=r/Math.sqrt(1-(1-l/a)*n*n),_=u*n*c,d=u*n*f,p=u*h;return[Math.atan(-d/(s-_)),Math.atan(p/Math.sqrt((s-_)*(s-_)+d*d))]};return(t,i,n)=>n?.inverse?((t,i)=>{const n=Math.sin(t),r=Math.cos(t),h=Math.sin(i),c=Math.cos(i),f=n*n+r*r*(c*c+a/l*h*h),u=-2*s*r*c,_=u*u-4*f*(s*s-a);if(_<0)return[NaN,NaN];const d=(-u-Math.sqrt(_))/(2*f),p=d*r*c,m=-d*n,g=d*r*h,b=o-Math.atan(m/(s-p)),v=Math.atan(a/l*(g/Math.sqrt((s-p)*(s-p)+m*m)));return[b/e,v/e]})(t,i):h(t,i)}({lon_0:o,alt:42164160,a:6378137,b:6356752.31414}),this.setupCoordinateCaches(i,n,s,r)}async makeDomainBuffers(t){const e=Math.max(Math.floor(this.ni/20),20),i=Math.max(Math.floor(this.nj/20),20);return await Js(t,this,e,i,{margin_r:!1,margin_s:!1})}transform(t,e,i){const s=void 0!==(i=void 0===i?{}:i).inverse&&i.inverse;return this.vpp(t,e,{inverse:s})}copy(){return new an(this.ni,this.nj,this.ll_x,this.ll_y,this.ur_x,this.ur_y,this.satellite_lon)}getThinnedGrid(t,e){const{ni:i,nj:s,thin_x:n,thin_y:r,ll_x:o,ll_y:a,ur_x:l,ur_y:h}=this.thinnedGridParameters(t,e,this.ll_x,this.ll_y,this.ur_x,this.ur_y);return new an(i,s,o,a,l,h,this.satellite_lon,this.thin_x*n,this.thin_y*r)}}const ln={bluered:(t,e,i)=>Ri.diverging("#0000ff","#ff0000",t,e,i),redblue:(t,e,i)=>Ri.diverging("#ff0000","#0000ff",t,e,i),pw_speed500mb:Ii,pw_speed850mb:Di,pw_cape:Bi,pw_t2m:Pi,pw_td2m:Fi,nws_storm_clear_refl:Li,wv_cimss:zi};function hn(t){const e=void 0===(t=void 0===t?{}:t).contour_workers?1:t.contour_workers;D(t.wasm_base_url,e)}})(),s})());
|
|
3
3
|
//# sourceMappingURL=autumnplot-gl.js.map
|