autumnplot-gl 2.2.3 → 3.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 +65 -8
- package/dist/110.autumnplot-gl.js +2 -0
- package/dist/110.autumnplot-gl.js.map +1 -0
- package/dist/autumnplot-gl.js +3 -0
- package/dist/autumnplot-gl.js.LICENSE.txt +12 -0
- package/dist/autumnplot-gl.js.map +1 -0
- package/dist/marchingsquares.wasm +0 -0
- package/lib/AutumnTypes.d.ts +14 -13
- package/lib/Barbs.d.ts +10 -5
- package/lib/Barbs.js +22 -5
- package/lib/BillboardCollection.d.ts +11 -7
- package/lib/BillboardCollection.js +52 -30
- package/lib/ColorBar.js +51 -7
- package/lib/Colormap.d.ts +14 -3
- package/lib/Colormap.js +63 -12
- package/lib/Contour.d.ts +73 -18
- package/lib/Contour.js +180 -148
- package/lib/ContourCreator.d.ts +18 -0
- package/lib/ContourCreator.js +23 -0
- package/lib/Fill.d.ts +18 -7
- package/lib/Fill.js +73 -41
- package/lib/Grid.d.ts +167 -0
- package/lib/Grid.js +339 -0
- package/lib/Hodographs.d.ts +13 -6
- package/lib/Hodographs.js +58 -71
- package/lib/Map.d.ts +14 -3
- package/lib/Map.js +9 -0
- package/lib/Paintball.d.ts +11 -5
- package/lib/Paintball.js +35 -15
- package/lib/PlotComponent.d.ts +5 -5
- package/lib/PlotLayer.d.ts +12 -12
- package/lib/PlotLayer.js +16 -14
- package/lib/PlotLayer.worker.d.ts +2 -2
- package/lib/PlotLayer.worker.js +105 -66
- package/lib/PolylineCollection.d.ts +20 -9
- package/lib/PolylineCollection.js +158 -32
- package/lib/RawField.d.ts +11 -167
- package/lib/RawField.js +37 -383
- package/lib/TextCollection.d.ts +31 -0
- package/lib/TextCollection.js +295 -0
- package/lib/cpp/marchingsquares.d.ts +6 -0
- package/lib/cpp/marchingsquares.js +3449 -0
- package/lib/cpp/marchingsquares.wasm +0 -0
- package/lib/cpp/marchingsquares_embind.d.ts +6 -0
- package/lib/index.d.ts +13 -6
- package/lib/index.js +12 -3
- package/lib/utils.d.ts +5 -3
- package/lib/utils.js +17 -6
- package/package.json +14 -9
|
@@ -0,0 +1,3 @@
|
|
|
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\nuniform sampler2D u_sampler;\nuniform lowp vec3 u_bb_color;\n\nvoid main() {\n lowp vec4 tex_color = texture2D(u_sampler, v_tex_coord);\n gl_FragColor = vec4(u_bb_color, tex_color.a); // mix(vec4(1.0, 0.0, 0.0, 0.5), vec4(u_bb_color, 1.0), 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\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 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}"},824:t=>{t.exports="varying highp vec2 v_tex_coord;\n\nuniform sampler2D u_fill_sampler;\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 float u_opacity;\nuniform highp vec4 u_underflow_color;\nuniform highp vec4 u_overflow_color;\nuniform int u_n_index;\n\nvoid main() {\n lowp float index_buffer = 1. / (2. * float(u_n_index));\n highp float fill_val = texture2D(u_fill_sampler, v_tex_coord).r;\n lowp float normed_val = (fill_val - 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 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 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="#ifdef DATA\nvarying highp float v_data;\n\nuniform sampler2D u_cmap_sampler;\nuniform sampler2D u_cmap_nonlin_sampler;\nuniform highp float u_cmap_min;\nuniform highp float u_cmap_max;\nuniform int u_n_index;\n#else\nuniform lowp vec4 u_color;\n#endif\n\nvoid main() {\n lowp vec4 color;\n#ifdef DATA\n lowp float index_buffer = 1. / (2. * float(u_n_index));\n lowp float normed_val = (v_data - u_cmap_min) / (u_cmap_max - u_cmap_min);\n\n if (normed_val < 0.0 || normed_val > 1.0) {\n discard;\n }\n\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#else\n color = u_color;\n#endif\n gl_FragColor = color;\n}"},319:t=>{t.exports="uniform mat4 u_matrix;\nuniform int u_offset;\n\nattribute vec2 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\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 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 * 1.5 * 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 vec3 u_text_color;\nuniform lowp vec3 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 vec3 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 gl_FragColor = vec4(color, alpha);\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:()=>O("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:()=>O("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)&&O(`\`Module.${u}\` was supplied but \`${u}\` not included in INCOMING_MODULE_JS_API`),o.arguments&&o.arguments,W("arguments","arguments_"),o.thisProgram&&o.thisProgram,W("thisProgram","thisProgram"),o.quit&&o.quit,W("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"),W("asm","wasmExports"),W("read","read_"),W("readAsync","readAsync"),W("readBinary","readBinary"),W("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),W("wasmBinary","wasmBinary"),"object"!=typeof WebAssembly&&O("no native wasm support detected");var d,p,_,m,g,v,b,y,w=!1;function x(t,e){t||O("Assertion failed"+(e?": "+e:""))}function E(){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 T(){if(!w){var t=fe();0==t&&(t+=4);var e=v[t>>2],n=v[t+4>>2];34821223==e&&2310721022==n||O(`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]&&O("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,I=null,P=null,N={};function O(t){o.onAbort&&o.onAbort(t),h(t="Aborted("+t+")"),w=!0;var e=new WebAssembly.RuntimeError(t);throw r(e),e}var C={error(){O("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(){C.error()},createDataFile(){C.error()},createPreloadedFile(){C.error()},createLazyFile(){C.error()},open(){C.error()},mkdev(){C.error()},registerDevice(){C.error()},analyzePath(){C.error()},ErrnoError(){C.error()}};o.FS_createDataFile=C.createDataFile,o.FS_createPreloadedFile=C.createPreloadedFile;var k,B,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==k&&l)return new Uint8Array(l);if(a)return a(t);throw"both async and sync fetching of the wasm failed"}function z(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}`),k.startsWith("file://")&&h(`warning: Loading from a file URI (${k}) 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`),O(t)}))}function W(t,e,n=!0){Object.getOwnPropertyDescriptor(o,t)||Object.defineProperty(o,t,{configurable:!0,get(){O(`\`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 H(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)`;H(t)&&(e+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),O(e)}})}G(k="marchingsquares.wasm")||(B=k,k=o.locateFile?o.locateFile(B,s):s+B),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},Et=(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}`)}},Tt=(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=Tt(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}},It=[],Pt=t=>{var e=It[t];return e||(t>=It.length&&(It.length=t+1),It[t]=e=Rt.get(t)),x(Rt.get(t)==e,"JavaScript-side Wasm function table mirror is out of date!"),e},Nt=(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(Pt(e),`missing table entry in dynCall: ${e}`),Pt(e).apply(null,n)),Ot=(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),Nt(t,e,n)}})(t,e):Pt(e);return"function"!=typeof n&&ht(`unknown function pointer with signature ${t}: ${e}`),n},Ct=t=>{var e=ie(t),n=lt(e);return se(e),n},kt=(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 Bt(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},zt=t=>2*t.length,Wt=(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},Ht=(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 "+Ct(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=Tt(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),E(),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=Tt(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)=>{O(`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:Et(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=Ot(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(Ct).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 Tt(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:kt(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:Bt,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=zt,i=()=>m,s=1):4===e&&(r=Wt,o=Ht,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:()=>{O("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=>{O("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 Pt(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 Pt(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 Pt(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{Pt(t)()}catch(t){if(de(e),!(t instanceof D))throw t;le(1,0)}},invoke_vi:function(t,e){var n=he();try{Pt(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{Pt(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{Pt(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{Pt(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"),E(),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(N[t]),delete N[t]):h("warning: run dependency removed without ID"),0==M&&(null!==I&&(clearInterval(I),I=null),P)){var e=P;P=null,e()}}("wasm-instantiate"),oe;var n}t="wasm-instantiate",M++,o.monitorRunDependencies&&o.monitorRunDependencies(M),t?(x(!N[t]),N[t]=1,null===I&&"undefined"!=typeof setInterval&&(I=setInterval((()=>{if(w)return clearInterval(I),void(I=null);var t=!1;for(var e in N)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=k,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?z(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"),z(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}')`,H(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,T(),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(T(),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(),T()))}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($),P=function t(){ye||xe(),ye||(P=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:()=>Rr,ColorMap:()=>An,Contour:()=>sr,ContourFill:()=>mr,ContourLabels:()=>ar,Grid:()=>yo,Hodographs:()=>$r,LambertGrid:()=>Eo,MultiPlotLayer:()=>Zr,Paintball:()=>Br,PlateCarreeGrid:()=>wo,PlateCarreeRotatedGrid:()=>xo,PlotComponent:()=>O,PlotLayer:()=>Jr,Raster:()=>_r,RawProfileField:()=>_o,RawScalarField:()=>ho,RawVectorField:()=>po,colormaps:()=>To,initAutumnPlot:()=>Ao,makeColorBar:()=>Qr,makePaintballKey:()=>to});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))},x=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=function(t,e){var n=y(x(t,e),4),r=n[0],o=n[1],i=n[2];return n[3],[r,o,i]},T=function(t,e){var n=y(t,3);return function(t,e){var n=t;return"float"==(e=void 0===e?"float":e)&&(n=n.map((function(t){return Math.round(255*t)}))),"#"+n.map((function(t){return t.toString(16).padStart(2,"0").toUpperCase()})).join("")}([n[0],n[1],n[2],0],e).slice(0,-2)},A=function(t){var e,n=y(t,3),r=n[0],o=n[1],i=n[2],a=Math.max(r,o,i),s=a-Math.min(r,o,i);return 0==s?e=0:a==r?e=(o-i)/s*60%6:a==o?e=60*((i-r)/s+2):a==i&&(e=60*((r-o)/s+4)),[e,0==a?0:s/a,a]},S=function(t){var e,n,r,o=y(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;return 0<=i&&i<60?(e=l,n=c,r=0):60<=i&&i<120?(e=c,n=l,r=0):120<=i&&i<180?(e=0,n=l,r=c):180<=i&&i<240?(e=0,n=c,r=l):240<=i&&i<300?(e=c,n=0,r=l):300<=i&&i<360&&(e=l,n=0,r=c),[e+u,n+u,r+u]};function R(t,e,n){for(var r=1,o=n;t%o!=0||e%o!=0;)r+=1,o/=2;return r}function F(){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 M=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 I(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 P(t){return t.getParameter(t.VERSION).includes("WebGL 2.0")}var N=u(new Worker(new URL(n.p+n.u(110),n.b))),O=function(){};function C(t,e){var n,r,o,i,a,s,l,c=P(t);if(e){var u=t.getExtension("OES_texture_half_float"),f=t.getExtension("OES_texture_half_float_linear");if(!c&&null===u||!c&&null===f)throw"Float16 data are not supported on this hardware. Try Float32 data instead.";n=c?t.R16F:t.LUMINANCE,r=c?t.HALF_FLOAT: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 k(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,E=x*y,T=y/2+5*w/24+3*x/120-73*E/2016,A=7*w/24+29*x/120+233*E/6720,S=7*x/30+81*E/280,R=4729*E/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+_*(T+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 B=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}();const G="This constructor is not a subclass of Float16Array",L="The constructor property value is not an object",D="Attempting to access detached ArrayBuffer",U="Cannot convert undefined or null to object",j="Cannot mix BigInt and other types, use explicit conversions",z="@@iterator property is not callable",W="Reduce of empty array with no initial value",H="Offset is out of bounds";function V(t){return(e,...n)=>Y(t,e,n)}function $(t,e){return V(q(t,e).get)}const{apply:Y,construct:X,defineProperty:J,get:Z,getOwnPropertyDescriptor:q,getPrototypeOf:K,has:Q,ownKeys:tt,set:et,setPrototypeOf:nt}=Reflect,rt=Proxy,{EPSILON:ot,MAX_SAFE_INTEGER:it,isFinite:at,isNaN:st}=Number,{iterator:lt,species:ct,toStringTag:ut,for:ft}=Symbol,ht=Object,{create:dt,defineProperty:pt,freeze:_t,is:mt}=ht,gt=ht.prototype,vt=gt.__lookupGetter__?V(gt.__lookupGetter__):(t,e)=>{if(null==t)throw fe(U);let n=ht(t);do{const t=q(n,e);if(void 0!==t)return bt(t,"get")?t.get:void 0}while(null!==(n=K(n)))},bt=ht.hasOwn||V(gt.hasOwnProperty),yt=Array,wt=yt.isArray,xt=yt.prototype,Et=V(xt.join),Tt=V(xt.push),At=V(xt.toLocaleString),St=xt[lt],Rt=V(St),{abs:Ft,trunc:Mt}=Math,It=ArrayBuffer,Pt=It.isView,Nt=It.prototype,Ot=V(Nt.slice),Ct=$(Nt,"byteLength"),kt="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:null,Bt=kt&&$(kt.prototype,"byteLength"),Gt=K(Uint8Array),Lt=Gt.from,Dt=Gt.prototype,Ut=Dt[lt],jt=V(Dt.keys),zt=V(Dt.values),Wt=V(Dt.entries),Ht=V(Dt.set),Vt=V(Dt.reverse),$t=V(Dt.fill),Yt=V(Dt.copyWithin),Xt=V(Dt.sort),Jt=V(Dt.slice),Zt=V(Dt.subarray),qt=$(Dt,"buffer"),Kt=$(Dt,"byteOffset"),Qt=$(Dt,"length"),te=$(Dt,ut),ee=Uint8Array,ne=Uint16Array,re=(...t)=>Y(Lt,ne,t),oe=Uint32Array,ie=Float32Array,ae=K([][lt]()),se=V(ae.next),le=V(function*(){}().next),ce=K(ae),ue=DataView.prototype,fe=(V(ue.getUint16),V(ue.setUint16),TypeError),he=RangeError,de=WeakSet,pe=de.prototype,_e=V(pe.add),me=V(pe.has),ge=WeakMap,ve=ge.prototype,be=V(ve.get),ye=V(ve.has),we=V(ve.set),xe=new ge,Ee=dt(null,{next:{value:function(){const t=be(xe,this);return se(t)}},[lt]:{value:function(){return this}}});function Te(t){if(t[lt]===St&&ae.next===se)return t;const e=dt(Ee);return we(xe,e,Rt(t)),e}const Ae=new ge,Se=dt(ce,{next:{value:function(){const t=be(Ae,this);return le(t)},writable:!0,configurable:!0}});for(const t of tt(ae))"next"!==t&&pt(Se,t,q(ae,t));function Re(t){const e=dt(Se);return we(Ae,e,t),e}function Fe(t){return null!==t&&"object"==typeof t||"function"==typeof t}function Me(t){return null!==t&&"object"==typeof t}function Ie(t){return void 0!==te(t)}function Pe(t){const e=te(t);return"BigInt64Array"===e||"BigUint64Array"===e}function Ne(t){if(null===kt)return!1;try{return Bt(t),!0}catch(t){return!1}}function Oe(t){return!!wt(t)&&t[lt]===St&&ae.next===se}function Ce(t){if("string"!=typeof t)return!1;const e=+t;return t===e+""&&!!at(e)&&e===Mt(e)}const ke=ft("__Float16Array__"),Be=1/ot,Ge=5.960464477539063e-8,Le=.0009765625*Be;const De=new It(4),Ue=new ie(De),je=new oe(De),ze=new ne(512),We=new ee(512);for(let t=0;t<256;++t){const e=t-127;e<-27?(ze[t]=0,ze[256|t]=32768,We[t]=24,We[256|t]=24):e<-14?(ze[t]=1024>>-e-14,ze[256|t]=1024>>-e-14|32768,We[t]=-e-1,We[256|t]=-e-1):e<=15?(ze[t]=e+15<<10,ze[256|t]=e+15<<10|32768,We[t]=13,We[256|t]=13):e<128?(ze[t]=31744,ze[256|t]=64512,We[t]=24,We[256|t]=24):(ze[t]=31744,ze[256|t]=64512,We[t]=13,We[256|t]=13)}function He(t){Ue[0]=function(t){const e=+t;if(!at(e)||0===e)return e;const n=e>0?1:-1,r=Ft(e);if(r<6103515625e-14)return n*function(t){return t+Be-Be}(r/Ge)*Ge;const o=(1+Le)*r,i=o-(o-r);return i>65504||st(i)?n*(1/0):n*i}(t);const e=je[0],n=e>>23&511;return ze[n]+((8388607&e)>>We[n])}const Ve=new oe(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,Ve[t]=e|n}for(let t=1024;t<2048;++t)Ve[t]=939524096+(t-1024<<13);const $e=new oe(64);for(let t=1;t<31;++t)$e[t]=t<<23;$e[31]=1199570944,$e[32]=2147483648;for(let t=33;t<63;++t)$e[t]=2147483648+(t-32<<23);$e[63]=3347054592;const Ye=new ne(64);for(let t=1;t<64;++t)32!==t&&(Ye[t]=1024);function Xe(t){const e=t>>10;return je[0]=Ve[Ye[e]+(1023&t)]+$e[e],Ue[0]}function Je(t){const e=+t;return st(e)||0===e?0:Mt(e)}function Ze(t){const e=Je(t);return e<0?0:e<it?e:it}function qe(t,e){if(!Fe(t))throw fe("This is not an object");const n=t.constructor;if(void 0===n)return e;if(!Fe(n))throw fe(L);const r=n[ct];return null==r?e:r}function Ke(t){if(Ne(t))return!1;try{return Ot(t,0,0),!1}catch(t){}return!0}function Qe(t,e){const n=st(t),r=st(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=mt(t,0),r=mt(e,0);if(!n&&r)return-1;if(n&&!r)return 1}return 0}const tn=new ge;function en(t){return ye(tn,t)||!Pt(t)&&function(t){if(!Me(t))return!1;const e=K(t);if(!Me(e))return!1;const n=e.constructor;if(void 0===n)return!1;if(!Fe(n))throw fe(L);return Q(n,ke)}(t)}function nn(t){if(!en(t))throw fe("This is not a Float16Array object")}function rn(t,e){const n=en(t),r=Ie(t);if(!n&&!r)throw fe("Species constructor didn't return TypedArray object");if("number"==typeof e){let r;if(n){const e=on(t);r=Qt(e)}else r=Qt(t);if(r<e)throw fe("Derived constructor created TypedArray object which was too small length")}if(Pe(t))throw fe(j)}function on(t){const e=be(tn,t);if(void 0!==e){if(Ke(qt(e)))throw fe(D);return e}const n=t.buffer;if(Ke(n))throw fe(D);const r=X(cn,[n,t.byteOffset,t.length],t.constructor);return be(tn,r)}function an(t){const e=Qt(t),n=[];for(let r=0;r<e;++r)n[r]=Xe(t[r]);return n}const sn=new de;for(const t of tt(Dt)){if(t===ut)continue;const e=q(Dt,t);bt(e,"get")&&"function"==typeof e.get&&_e(sn,e.get)}const ln=_t({get:(t,e,n)=>Ce(e)&&bt(t,e)?Xe(Z(t,e)):me(sn,vt(t,e))?Z(t,e):Z(t,e,n),set:(t,e,n,r)=>Ce(e)&&bt(t,e)?et(t,e,He(n)):et(t,e,n,r),getOwnPropertyDescriptor(t,e){if(Ce(e)&&bt(t,e)){const n=q(t,e);return n.value=Xe(n.value),n}return q(t,e)},defineProperty:(t,e,n)=>Ce(e)&&bt(t,e)&&bt(n,"value")?(n.value=He(n.value),J(t,e,n)):J(t,e,n)});class cn{constructor(t,e,n){let r;if(en(t))r=X(ne,[on(t)],new.target);else if(!Fe(t)||(function(t){try{return Ct(t),!0}catch(t){return!1}}(o=t)||Ne(o)))r=X(ne,arguments,new.target);else{let e,n;if(Ie(t)){if(e=t,n=Qt(t),Ke(qt(t)))throw fe(D);if(Pe(t))throw fe(j);const o=new It(2*n);r=X(ne,[o],new.target)}else{const o=t[lt];if(null!=o&&"function"!=typeof o)throw fe(z);null!=o?Oe(t)?(e=t,n=t.length):(e=[...t],n=e.length):(e=t,n=Ze(e.length)),r=X(ne,[n],new.target)}for(let t=0;t<n;++t)r[t]=He(e[t])}var o;const i=new rt(r,ln);return we(tn,i,r),i}static from(t,...e){const n=this;if(!Q(n,ke))throw fe(G);if(n===cn){if(en(t)&&0===e.length){const e=on(t),n=new ne(qt(e),Kt(e),Qt(e));return new cn(qt(Jt(n)))}if(0===e.length)return new cn(qt(re(t,He)));const n=e[0],r=e[1];return new cn(qt(re(t,(function(t,...e){return He(Y(n,this,[t,...Te(e)]))}),r)))}let r,o;const i=t[lt];if(null!=i&&"function"!=typeof i)throw fe(z);if(null!=i)Oe(t)?(r=t,o=t.length):Ie(a=t)&&a[lt]===Ut&&ae.next===se?(r=t,o=Qt(t)):(r=[...t],o=r.length);else{if(null==t)throw fe(U);r=ht(t),o=Ze(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]=Y(t,n,[r[e],e])}return s}static of(...t){const e=this;if(!Q(e,ke))throw fe(G);const n=t.length;if(e===cn){const e=new cn(n),r=on(e);for(let e=0;e<n;++e)r[e]=He(t[e]);return e}const r=new e(n);for(let e=0;e<n;++e)r[e]=t[e];return r}keys(){nn(this);const t=on(this);return jt(t)}values(){nn(this);const t=on(this);return Re(function*(){for(const e of zt(t))yield Xe(e)}())}entries(){nn(this);const t=on(this);return Re(function*(){for(const[e,n]of Wt(t))yield[e,Xe(n)]}())}at(t){nn(this);const e=on(this),n=Qt(e),r=Je(t),o=r>=0?r:n+r;if(!(o<0||o>=n))return Xe(e[o])}with(t,e){nn(this);const n=on(this),r=Qt(n),o=Je(t),i=o>=0?o:r+o,a=+e;if(i<0||i>=r)throw he(H);const s=new ne(qt(n),Kt(n),Qt(n)),l=new cn(qt(Jt(s)));return on(l)[i]=He(a),l}map(t,...e){nn(this);const n=on(this),r=Qt(n),o=e[0],i=qe(n,cn);if(i===cn){const e=new cn(r),i=on(e);for(let e=0;e<r;++e){const r=Xe(n[e]);i[e]=He(Y(t,o,[r,e,this]))}return e}const a=new i(r);rn(a,r);for(let e=0;e<r;++e){const r=Xe(n[e]);a[e]=Y(t,o,[r,e,this])}return a}filter(t,...e){nn(this);const n=on(this),r=Qt(n),o=e[0],i=[];for(let e=0;e<r;++e){const r=Xe(n[e]);Y(t,o,[r,e,this])&&Tt(i,r)}const a=new(qe(n,cn))(i);return rn(a),a}reduce(t,...e){nn(this);const n=on(this),r=Qt(n);if(0===r&&0===e.length)throw fe(W);let o,i;0===e.length?(o=Xe(n[0]),i=1):(o=e[0],i=0);for(let e=i;e<r;++e)o=t(o,Xe(n[e]),e,this);return o}reduceRight(t,...e){nn(this);const n=on(this),r=Qt(n);if(0===r&&0===e.length)throw fe(W);let o,i;0===e.length?(o=Xe(n[r-1]),i=r-2):(o=e[0],i=r-1);for(let e=i;e>=0;--e)o=t(o,Xe(n[e]),e,this);return o}forEach(t,...e){nn(this);const n=on(this),r=Qt(n),o=e[0];for(let e=0;e<r;++e)Y(t,o,[Xe(n[e]),e,this])}find(t,...e){nn(this);const n=on(this),r=Qt(n),o=e[0];for(let e=0;e<r;++e){const r=Xe(n[e]);if(Y(t,o,[r,e,this]))return r}}findIndex(t,...e){nn(this);const n=on(this),r=Qt(n),o=e[0];for(let e=0;e<r;++e){const r=Xe(n[e]);if(Y(t,o,[r,e,this]))return e}return-1}findLast(t,...e){nn(this);const n=on(this),r=Qt(n),o=e[0];for(let e=r-1;e>=0;--e){const r=Xe(n[e]);if(Y(t,o,[r,e,this]))return r}}findLastIndex(t,...e){nn(this);const n=on(this),r=Qt(n),o=e[0];for(let e=r-1;e>=0;--e){const r=Xe(n[e]);if(Y(t,o,[r,e,this]))return e}return-1}every(t,...e){nn(this);const n=on(this),r=Qt(n),o=e[0];for(let e=0;e<r;++e)if(!Y(t,o,[Xe(n[e]),e,this]))return!1;return!0}some(t,...e){nn(this);const n=on(this),r=Qt(n),o=e[0];for(let e=0;e<r;++e)if(Y(t,o,[Xe(n[e]),e,this]))return!0;return!1}set(t,...e){nn(this);const n=on(this),r=Je(e[0]);if(r<0)throw he(H);if(null==t)throw fe(U);if(Pe(t))throw fe(j);if(en(t))return Ht(on(this),on(t),r);if(Ie(t)&&Ke(qt(t)))throw fe(D);const o=Qt(n),i=ht(t),a=Ze(i.length);if(r===1/0||a+r>o)throw he(H);for(let t=0;t<a;++t)n[t+r]=He(i[t])}reverse(){nn(this);const t=on(this);return Vt(t),this}toReversed(){nn(this);const t=on(this),e=new ne(qt(t),Kt(t),Qt(t)),n=new cn(qt(Jt(e))),r=on(n);return Vt(r),n}fill(t,...e){nn(this);const n=on(this);return $t(n,He(t),...Te(e)),this}copyWithin(t,e,...n){nn(this);const r=on(this);return Yt(r,t,e,...Te(n)),this}sort(t){nn(this);const e=on(this),n=void 0!==t?t:Qe;return Xt(e,((t,e)=>n(Xe(t),Xe(e)))),this}toSorted(t){nn(this);const e=on(this);if(void 0!==t&&"function"!=typeof t)throw new fe("The comparison function must be either a function or undefined");const n=void 0!==t?t:Qe,r=new ne(qt(e),Kt(e),Qt(e)),o=new cn(qt(Jt(r))),i=on(o);return Xt(i,((t,e)=>n(Xe(t),Xe(e)))),o}slice(t,e){nn(this);const n=on(this),r=qe(n,cn);if(r===cn){const r=new ne(qt(n),Kt(n),Qt(n));return new cn(qt(Jt(r,t,e)))}const o=Qt(n),i=Je(t),a=void 0===e?o:Je(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(rn(u,c),0===c)return u;if(Ke(qt(n)))throw fe(D);let f=0;for(;s<l;)u[f]=Xe(n[s]),++s,++f;return u}subarray(t,e){nn(this);const n=on(this),r=qe(n,cn),o=new ne(qt(n),Kt(n),Qt(n)),i=Zt(o,t,e),a=new r(qt(i),Kt(i),Qt(i));return rn(a),a}indexOf(t,...e){nn(this);const n=on(this),r=Qt(n);let o=Je(e[0]);if(o===1/0)return-1;o<0&&(o+=r,o<0&&(o=0));for(let e=o;e<r;++e)if(bt(n,e)&&Xe(n[e])===t)return e;return-1}lastIndexOf(t,...e){nn(this);const n=on(this),r=Qt(n);let o=e.length>=1?Je(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(bt(n,e)&&Xe(n[e])===t)return e;return-1}includes(t,...e){nn(this);const n=on(this),r=Qt(n);let o=Je(e[0]);if(o===1/0)return!1;o<0&&(o+=r,o<0&&(o=0));const i=st(t);for(let e=o;e<r;++e){const r=Xe(n[e]);if(i&&st(r))return!0;if(r===t)return!0}return!1}join(t){nn(this);const e=an(on(this));return Et(e,t)}toLocaleString(...t){nn(this);const e=an(on(this));return At(e,...Te(t))}get[ut](){if(en(this))return"Float16Array"}}pt(cn,"BYTES_PER_ELEMENT",{value:2}),pt(cn,ke,{}),nt(cn,Gt);const un=cn.prototype;pt(un,"BYTES_PER_ELEMENT",{value:2}),pt(un,lt,{value:un.values,writable:!0,configurable:!0}),nt(un,Dt);class fn{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 hn extends fn{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 dn(t){return t.getParameter(t.VERSION).includes("WebGL 2.0")}class pn{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=dn(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 _n(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 mn{constructor(t,e,n,r){e=_n(e,r),n=_n(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;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=dn(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}}}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],n)=>{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{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 gn{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 gn{constructor(){super(null,null)}registerGLContext(t){this.gl=t}};const vn=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"]}'),bn=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"]}'),yn=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"]}'),wn=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"]}'),xn=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"]}'),En=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"]}');var Tn=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},An=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"object"==typeof(e=t)&&"color"in e&&"opacity"in e?t:{color:t,opacity:1};var e};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.color}))},t.prototype.getOpacities=function(){return this.colors.map((function(t){return t.opacity}))},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={color:a.color,opacity: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={color:this.underflow_color.color,opacity: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={color:this.overflow_color.color,opacity: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=A(E(e)),p=A(E(n)),_=0;_<i;_++){var m=r+_*u,g=void 0,v=void 0,b=void 0,y=void 0;m<f?(y=(f-m)/(f-r),g=(a=Tn([d[0],h[1]+(d[1]-h[1])*y,h[2]+(d[2]-h[2])*y],3))[0],v=a[1],b=a[2]):m>=f&&(y=(m-f)/(o-f),g=(s=Tn([p[0],h[1]+(p[1]-h[1])*y,h[2]+(p[2]-h[2])*y],3))[0],v=s[1],b=s[2]);var w=T(S([g,v,b]));l.push({color:w,opacity:Math.min(2*y,1)})}for(var x=0;x<=i;x++){var R=(o-r)/i;c.push(r+x*R)}return new t(c,l)},t}();function Sn(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 An(t.levels,t.colors,r)}var Rn=Sn(vn,"over").withOpacity((function(t,e){return Math.min((e-20)/10,1)})),Fn=Sn(bn,"over").withOpacity((function(t,e){return Math.min((e-20)/10,1)})),Mn=Sn(yn,"over").withOpacity((function(t,e){return Math.min(e/1e3,1)})),In=Sn(wn,"both"),Pn=Sn(xn,"both"),Nn=Sn(En,"over");function On(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.color+Math.round(255*t.opacity).toString(16),n.fillRect(e,0,1,1)})),e}function Cn(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 cn(s)}var kn=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},Bn=n(319),Gn=n(559),Ln=function(){function t(t,e,n){n=void 0===n?{}:n,this.color=void 0===n.color?[0,0,0,1]:x(n.color);var r=void 0===n.line_width?1:n.line_width;this.width=r;var o=[];if(this.vertices=new hn(t,e.vertices,3,t.TRIANGLE_STRIP),this.extrusion=new hn(t,e.extrusion,2,t.TRIANGLE_STRIP),void 0!==e.offsets?(this.offset=new hn(t,e.offsets,2,t.TRIANGLE_STRIP),this.scale=void 0===n.offset_scale?1:n.offset_scale,o.push("OFFSET")):(this.offset=null,this.scale=null),void 0!==e.zoom?(this.min_zoom=new hn(t,e.zoom,1,t.TRIANGLE_STRIP),o.push("ZOOM")):this.min_zoom=null,this.cmap_min=-340282347e30,this.cmap_max=340282347e30,void 0!==e.data){this.min_zoom=new hn(t,e.zoom,1,t.TRIANGLE_STRIP),o.push("DATA");var i=C(t,!0),a=i.format,s=i.type,l=i.row_alignment,c=void 0;void 0===n.cmap?(c={format:t.RGBA,type:t.UNSIGNED_BYTE,width:1,height:1,image:new Uint8Array(this.color),mag_filter:t.NEAREST},this.index_map=new cn([0,1])):(c={format:t.RGBA,type:t.UNSIGNED_BYTE,image:On(n.cmap),mag_filter:t.NEAREST},this.cmap_min=n.cmap.levels[0],this.cmap_max=n.cmap.levels[n.cmap.levels.length-1],this.index_map=Cn(n.cmap));var u={format:a,type:s,width:this.index_map.length,height:1,image:new Uint16Array(this.index_map.buffer),mag_filter:t.LINEAR,row_alignment:l};this.cmap_nonlin_texture=new pn(t,u),this.line_texture=new pn(t,c),this.line_data=new hn(t,e.data,1,t.TRIANGLE_STRIP)}else this.line_texture=null,this.line_data=null,this.index_map=null;this.program=new mn(t,Bn,Gn,{define:o})}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,N.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=kn(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))}([],kn(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},f={};null!==this.offset&&(c.a_offset=this.offset,u.u_offset_scale=this.scale*(l/s)),null!==this.min_zoom&&(c.a_min_zoom=this.min_zoom,u.u_zoom=r),null!==this.line_data&&null!==this.line_texture?(c.a_data=this.line_data,f.u_cmap_sampler=this.line_texture,f.u_cmap_nonlin_sampler=this.cmap_nonlin_texture,u.u_cmap_min=this.cmap_min,u.u_cmap_max=this.cmap_max,u.u_n_index=this.index_map.length):u.u_color=this.color,this.program.use(c,u,f),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}(),Dn=n(614),Un=n.n(Dn),jn=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())}))},zn=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])}}},Wn=n(207),Hn=n(286),Vn=new M((function(t){return new mn(t,Wn,Hn)}));function $n(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;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 Yn(t){return jn(this,void 0,void 0,(function(){var e,n;return zn(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){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(3==t){var r=n.readMessage(i,{});e.push(r)}},n=new(Un())(o).readFields((function(t,e,n){1==t&&n.readMessage(a,e)}),[]),[2,$n(n)]}var o,i,a}))}))}var Xn,Jn={horizontal_align:"left",vertical_align:"baseline",font_size:12,text_color:[0,0,0],halo_color:[0,0,0],halo:!1},Zn=function(){function t(t,e,n,r){this.program=Vn.getValue(t),this.opts=I(r,Jn);var o={format:P(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 pn(t,o);var i=6*e.map((function(t){return t.text.length})).reduce((function(t,e){return t+e}),0),a=new Float32Array(3*i),s=new Float32Array(2*i),l=new Float32Array(2*i),c=0,u=0,f=0;e.forEach((function(t){for(var e=t.lat,o=t.lon,i=t.text,h=void 0===t.min_zoom?0:t.min_zoom,d=new B(o,e).toMercatorCoord(),p=d.x,_=d.y,m=0,g=u,v=0;v<i.length;v++){var b=i.charCodeAt(v),y=n.glyph_info[b];void 0!==y?(m+=y.left,a[c++]=p,a[c++]=_,a[c++]=h,a[c++]=p,a[c++]=_,a[c++]=h,a[c++]=p,a[c++]=_,a[c++]=h,a[c++]=p,a[c++]=_,a[c++]=h,a[c++]=p,a[c++]=_,a[c++]=h,a[c++]=p,a[c++]=_,a[c++]=h,s[u++]=m,s[u++]=n.baseline+y.top-y.height,s[u++]=m,s[u++]=n.baseline+y.top-y.height,s[u++]=m+y.width,s[u++]=n.baseline+y.top-y.height,s[u++]=m,s[u++]=n.baseline+y.top,s[u++]=m+y.width,s[u++]=n.baseline+y.top,s[u++]=m+y.width,s[u++]=n.baseline+y.top,l[f++]=y.atlas_i/n.atlas_width,l[f++]=(y.atlas_j+y.height)/n.atlas_height,l[f++]=y.atlas_i/n.atlas_width,l[f++]=(y.atlas_j+y.height)/n.atlas_height,l[f++]=(y.atlas_i+y.width)/n.atlas_width,l[f++]=(y.atlas_j+y.height)/n.atlas_height,l[f++]=y.atlas_i/n.atlas_width,l[f++]=y.atlas_j/n.atlas_height,l[f++]=(y.atlas_i+y.width)/n.atlas_width,l[f++]=y.atlas_j/n.atlas_height,l[f++]=(y.atlas_i+y.width)/n.atlas_width,l[f++]=y.atlas_j/n.atlas_height,m+=y.advance-y.left):m+=7}if("center"==r.horizontal_align)for(v=g;v<g+12*i.length;v+=2)s[v]-=m/2;else if("right"==r.horizontal_align)for(v=g;v<g+12*i.length;v+=2)s[v]-=m;if("top"==r.vertical_align)for(v=g+1;v<g+12*i.length;v+=2)s[v]-=n.baseline-n.top;else if("middle"==r.vertical_align)for(v=g+1;v<g+12*i.length;v+=2)s[v]-=(n.baseline-n.top)/2})),this.anchors=new hn(t,a,3,t.TRIANGLE_STRIP),this.offsets=new hn(t,s,2,t.TRIANGLE_STRIP),this.texcoords=new hn(t,l,2,t.TRIANGLE_STRIP)}return t.make=function(e,n,r,o){return jn(this,void 0,void 0,(function(){var i;return zn(this,(function(a){switch(a.label){case 0:return[4,Yn(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,u_halo_color:this.opts.halo_color,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}(),qn=n(526),Kn=(Xn=function(t,e){return Xn=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])},Xn(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}Xn(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())}))},tr=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])}}},er=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},nr=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))},rr={color:"#000000",interval:1,levels:void 0},or=function(t){function e(e,n){var r=t.call(this)||this;return r.field=e,r.opts=I(n,rr),r.gl_elems=null,r.contours=null,r}return Kn(e,t),e.prototype.updateField=function(t){return Qn(this,void 0,void 0,(function(){var e,n,r,o;return tr(this,(function(i){switch(i.label){case 0:return this.field=t,null===this.gl_elems?[2]:(e=this.gl_elems.gl,[4,this.getContours()]);case 1:return n=i.sent(),r=Object.values(n).flat().map((function(t){return{vertices:t}})),o=this,[4,Ln.make(e,r,{line_width:2,color:this.opts.color})];case 2:return o.contours=i.sent(),this.gl_elems.map.triggerRepaint(),[2]}}))}))},e.prototype.getContours=function(){return Qn(this,void 0,void 0,(function(){return tr(this,(function(t){switch(t.label){case 0:return[4,this.field.getContours({interval:this.opts.interval,levels:this.opts.levels})];case 1:return[2,t.sent()]}}))}))},e.prototype.onAdd=function(t,e){return Qn(this,void 0,void 0,(function(){return tr(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=nr([],er(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.render(t,e,[o,i],r,a,s)}},e}(O),ir={n_decimal_places:0,font_face:"Trebuchet MS",font_size:12,font_url_template:"",text_color:"#000000",halo_color:"#000000",halo:!1},ar=function(t){function e(e,n){var r=t.call(this)||this;return r.opts=I(n,ir),r.contours=e,r.text_collection=null,r.gl_elems=null,r}return Kn(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,A,S,R,F,M,I,P,N,O,C,k,G,L,D;return tr(this,(function(U){switch(U.label){case 0:return null===this.gl_elems?[2]:(t=this.gl_elems.map,e=this.gl_elems.gl,n=t.getStyle(),r=""==this.opts.font_url_template?n.glyphs:this.opts.font_url_template,o=r.replace("{range}","0-255").replace("{fontstack}",this.opts.font_face),i=[],[4,this.contours.getContours()]);case 1:for(a=U.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=er(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(B.bind.apply(B,nr([void 0],er(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 qn.kdTree(i,(function(t,e){return Math.hypot(t.lon-e.lon,t.lat-e.lat)}),["lon","lat"]),_=new B(h,u).toMercatorCoord(),m=_.x,g=_.y,v=new B(d,f).toMercatorCoord(),b=v.x,y=v.y,w=b-m,x=g-y,T=Math.round(4*w/c),A=Math.round(4*x/c),S=[],R=[],I=0;I<T;I++)S.push(m+I/T*w);for(P=0;P<A;P++)R.push(y+P/A*x);for(F=1,M=l-1;M>=0;M--){for(I=0;I<T;I+=F)for(P=0;P<A;P+=F)N=S[I],O=R[P],C=B.fromMercatorCoord(N,O),k=er(p.nearest({lon:C.lng,lat:C.lat,min_zoom:0,text:""},1)[0],2),G=k[0],k[1],G.min_zoom=M;F*=2}return L={horizontal_align:"center",vertical_align:"middle",font_size:this.opts.font_size,halo:this.opts.halo,text_color:E(this.opts.text_color),halo_color:E(this.opts.halo_color)},D=this,[4,Zn.make(e,i,o,L)];case 2:return D.text_collection=U.sent(),t.triggerRepaint(),[2]}}))}))},e.prototype.onAdd=function(t,e){return Qn(this,void 0,void 0,(function(){return tr(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}(O);const sr=or;var lr=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)}}(),cr=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())}))},ur=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=n(370),hr=n(824),dr={cmap:new An([0,1],["#000000"],{overflow_color:"#000000",underflow_color:"#000000"}),opacity:1},pr=function(t){function e(e,n){var r=t.call(this)||this;return r.field=e,r.opts=I(n,dr),r.cmap_image=On(r.opts.cmap),r.index_map=Cn(r.opts.cmap),r.gl_elems=null,r.fill_texture=null,r.image_mag_filter=null,r.cmap_mag_filter=null,r}return lr(e,t),e.prototype.updateField=function(t){return cr(this,void 0,void 0,(function(){var e,n,r,o,i,a,s,l;return ur(this,(function(c){return this.field=t,null===this.gl_elems||(e=this.gl_elems.gl,n=this.gl_elems.map,r=this.field.getTextureData(),o=C(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 pn(e,l):this.fill_texture.setImageData(l),n.triggerRepaint()),[2]}))}))},e.prototype.onAdd=function(t,e){return cr(this,void 0,void 0,(function(){var n,r,o,i,a,s,l,c,u,f,h,d,p,_;return ur(this,(function(m){switch(m.label){case 0:if(null===this.image_mag_filter||null===this.cmap_mag_filter)throw"Implement magnification filtes in a subclass";return n=new mn(e,fr,hr),[4,this.field.grid.getWGLBuffers(e)];case 1:return r=m.sent(),o=r.vertices,i=r.texcoords,a=o,s=i,l={format:e.RGBA,type:e.UNSIGNED_BYTE,image:this.cmap_image,mag_filter:this.cmap_mag_filter},c=new pn(e,l),u=C(e,!0),f=u.format,h=u.type,d=u.row_alignment,p={format:f,type:h,width:this.index_map.length,height:1,image:new Uint16Array(this.index_map.buffer),mag_filter:e.LINEAR,row_alignment:d},_=new pn(e,p),this.gl_elems={gl:e,map:t,program:n,vertices:a,texcoords:s,cmap_texture:c,cmap_nonlin_texture:_},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));var r=this.opts.cmap,o=null===r.underflow_color?[0,0,0,0]:E(r.underflow_color.color).concat(r.underflow_color.opacity),i=null===r.overflow_color?[0,0,0,0]:E(r.overflow_color.color).concat(r.overflow_color.opacity);n.program.use({a_pos:n.vertices,a_tex_coord:n.texcoords},{u_cmap_min:r.levels[0],u_cmap_max:r.levels[r.levels.length-1],u_matrix:e,u_opacity:this.opts.opacity,u_n_index:this.index_map.length,u_underflow_color:o,u_overflow_color:i,u_offset:0},{u_fill_sampler:this.fill_texture,u_cmap_sampler:n.cmap_texture,u_cmap_nonlin_sampler:n.cmap_nonlin_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}(O),_r=function(t){function e(e,n){return t.call(this,e,n)||this}return lr(e,t),e.prototype.updateField=function(e){return cr(this,void 0,void 0,(function(){return ur(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 cr(this,void 0,void 0,(function(){return ur(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}(pr),mr=function(t){function e(e,n){return t.call(this,e,n)||this}return lr(e,t),e.prototype.updateField=function(e){return cr(this,void 0,void 0,(function(){return ur(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 cr(this,void 0,void 0,(function(){return ur(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}(pr),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},vr=n(955),br=n(49),yr=function(){function t(t,e,n,r,o,i,a){this.field=t,this.spec=o,this.color=i,this.size_multiplier=a,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=C(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 pn(e,u),v:new pn(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;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(l){switch(l.label){case 0:return e=new mn(t,vr,br),[4,(n=this.field.getThinnedField(this.trim_inaccessible,this.trim_inaccessible)).grid.getWGLBillboardBuffers(t,this.thin_fac/this.trim_inaccessible,this.max_zoom)];case 1:return r=l.sent(),o=r.vertices,i=r.texcoords,a=n.grid.getVectorRotationTexture(t).rotation,s=new pn(t,this.billboard_image),this.gl_elems={gl:t,program:e,vertices:o,texcoords:i,texture:s,proj_rot_texture:a},[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=gr(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))}([],gr(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_bb_color:this.color,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}),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}(),wr=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)}}(),xr=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())}))},Er=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])}}},Tr={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},Ar=null,Sr={color:"#000000",thin_fac:1};const Rr=function(t){function e(e,n){var r=t.call(this)||this;r.fields=e,r.opts=I(n,Sr);var o=E(r.opts.color);return r.color_rgb=[o[0],o[1],o[2]],r.gl_elems=null,r}return wr(e,t),e.prototype.updateField=function(t){return xr(this,void 0,void 0,(function(){return Er(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 xr(this,void 0,void 0,(function(){var n,r,o;return Er(this,(function(i){switch(i.label){case 0:return e.getExtension("OES_texture_float"),e.getExtension("OES_texture_float_linear"),n=t.getMaxZoom(),null===Ar&&(Ar=function(){var t=document.createElement("canvas");function e(t,e,n,r){var o=Tr.BB_WIDTH/2-4,i=o/2;if(r<2.5)t.beginPath(),t.arc(e,n,o/2,0,2*Math.PI),t.stroke();else{var a=0,s=r,l=0,c=Math.floor((s+2.5)/50);l+=c*o/2+i+(c-1)*i/2,s-=50*c;var u=Math.floor((s+2.5)/10);l+=u*i,s-=10*u,l+=Math.floor((s+2.5)/5)*i,r<7.5&&(l+=i),l=Math.max(120,l),t.beginPath(),t.moveTo(e,n),t.lineTo(e,n+l),s=r,a=n+l;for(var f=!1,h=!0;s>47.5;)f&&(a+=i/2),h||t.moveTo(e,a),t.lineTo(e-o,a),t.lineTo(e,a-o/2),a-=o/2+i,s-=50,f=!0,h=!1;for(;s>7.5;)h||t.moveTo(e,a),t.lineTo(e-o,a+o/2),a-=i,s-=10,h=!1;for(r<7.5&&(a-=i);s>2.5;)t.moveTo(e,a),t.lineTo(e-o/2,a+o/4),s-=5;t.stroke()}}t.width=Tr.BB_TEX_WIDTH,t.height=Tr.BB_TEX_HEIGHT;var n=t.getContext("2d");if(null===n)throw"Could not get rendering context for the wind barb canvas";n.lineWidth=8,n.miterLimit=4;for(var r=0;r<=Tr.BB_MAG_MAX;r+=Tr.BB_MAG_BIN_SIZE)e(n,r%Tr.BB_MAG_WRAP/Tr.BB_MAG_BIN_SIZE*Tr.BB_WIDTH+Tr.BB_WIDTH/2,Math.floor(r/Tr.BB_MAG_WRAP)*Tr.BB_HEIGHT+Tr.BB_WIDTH/2,r);return t}()),r={format:e.RGBA,type:e.UNSIGNED_BYTE,image:Ar,mag_filter:e.NEAREST},[4,(o=new yr(this.fields,this.opts.thin_fac,n,r,Tr,this.color_rgb,.1)).setup(e)];case 1:return i.sent(),this.gl_elems={map:t,barb_billboards:o},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}(O);var Fr=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)}}(),Mr=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())}))},Ir=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])}}},Pr=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},Nr=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))},Or=n(431),Cr=n(714),kr={colors:["#000000"],opacity:1};const Br=function(t){function e(e,n){var r=t.call(this)||this;return r.field=e,r.opts=I(n,kr),r.color_components=Nr([],Pr(r.opts.colors),!1).reverse().map((function(t){return x(t)})).flat(),r.gl_elems=null,r.fill_texture=null,r}return Fr(e,t),e.prototype.updateField=function(t){return Mr(this,void 0,void 0,(function(){var e,n,r,o,i,a,s;return Ir(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=C(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 pn(e,s):this.fill_texture.setImageData(s)),[2]}))}))},e.prototype.onAdd=function(t,e){return Mr(this,void 0,void 0,(function(){var t,n,r,o,i,a;return Ir(this,(function(s){switch(s.label){case 0:return e.getExtension("OES_texture_float"),t=new mn(e,Or,Cr),[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=Nr([],Pr(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}(O);var Gr=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)}}(),Lr=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())}))},Dr=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])}}},Ur=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},jr=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))},zr={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},Wr=null,Hr=new An([0,1,3,6,9],["#ffffcc","#a1dab4","#41b6c4","#225ea8"]),Vr={bgcolor:"#000000",thin_fac:1};const $r=function(t){function e(e,n){var r=t.call(this)||this;return r.profile_field=e,r.opts=I(n,Vr),r.hodo_scale=(zr.BB_TEX_WIDTH-2)/(40*zr.BB_TEX_WIDTH),r.bg_size=140,r.gl_elems=null,r.line_elems=null,r}return Gr(e,t),e.prototype.updateField=function(t){return Lr(this,void 0,void 0,(function(){var e,n,r,o,i,a,s=this;return Dr(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=R(t.jlat,t.ilon,s.opts.thin_fac);return{offsets:jr([],Ur(t.u),!1).map((function(e,n){return[e-t.smu,t.v[n]-t.smv]})),vertices:jr([],Ur(t.u),!1).map((function(e){return[t.lon,t.lat]})),zoom:e,data:jr([],Ur(t.z),!1)}})),[4,Ln.make(e,r,{line_width:2.5,cmap:Hr,offset_scale:this.hodo_scale*this.bg_size})]);case 1:return o=l.sent(),i=n.map((function(t){var e=R(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,Ln.make(e,i,{line_width:1.5,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 Lr(this,void 0,void 0,(function(){var n,r,o;return Dr(this,(function(i){switch(i.label){case 0:return null===Wr&&(Wr=function(){var t=document.createElement("canvas");t.width=zr.BB_TEX_WIDTH,t.height=zr.BB_TEX_HEIGHT;var e=t.getContext("2d");if(null===e)throw"Could not get rendering context for the hodograph background canvas";e.lineWidth=4;for(var n=zr.BB_TEX_WIDTH/4;n<=zr.BB_TEX_WIDTH/2;n+=zr.BB_TEX_WIDTH/4)e.beginPath(),e.arc(zr.BB_TEX_WIDTH/2,zr.BB_TEX_WIDTH/2,n-2,0,2*Math.PI),e.stroke();var r=zr.BB_TEX_WIDTH/2,o=zr.BB_TEX_WIDTH/2;return e.beginPath(),e.moveTo(r,o),e.lineTo(r+10,o+20),e.lineTo(r-10,o+20),e.lineTo(r,o),e.fill(),t}()),n={format:e.RGBA,type:e.UNSIGNED_BYTE,image:Wr,mag_filter:e.NEAREST},r=t.getMaxZoom(),[4,(o=new yr(this.profile_field.getStormMotionGrid(),this.opts.thin_fac,r,n,zr,E(this.opts.bgcolor),.004*this.bg_size)).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}(O);var Yr=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)}}(),Xr=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}(),Jr=function(t){function e(e,n){var r=t.call(this,e)||this;return r.field=n,r}return Yr(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}(Xr),Zr=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 Yr(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}(Xr),qr=function(){return qr=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},qr.apply(this,arguments)},Kr=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 Qr(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,E=600,T=E/9,A=Math.max("horizontal"==o?6*Math.max(y,w):8,x?T/(2*Math.sqrt(3)):0);"vertical"==o?(l=E,c=T,p=(u="left"==s?53.66666666666667:3)+(h=10),m=u+h/2,_=(f=A)+(d=E-2*A),g=null===t.underflow_color?_:_+T/(2*Math.sqrt(3)),v=null===t.overflow_color?f:f-T/(2*Math.sqrt(3))):(c=E,l=T-6,p=(u=A)+(h=E-2*A),m=(f="bottom"==s?3:47.66666666666667)+(d=10)/2,_=f+d,g=null===t.underflow_color?u:u-T/(2*Math.sqrt(3)),v=null===t.overflow_color?p:p+T/(2*Math.sqrt(3)));var S,R=t.colors.length,F=Kr("svg",{width:c,height:l}),M=Kr("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 I=Kr("g",S,F);if(t.colors.forEach((function(t,e){Kr("rect",qr(qr({},"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.color,opacity:t.opacity}),M)})),null!==t.underflow_color){var P={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.color,opacity:t.underflow_color.opacity};Kr("polygon",P,M)}if(null!==t.overflow_color){var N={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.color,opacity:t.overflow_color.opacity};Kr("polygon",N,M)}var O,C,k=t.levels[0],B=t.levels[t.levels.length-1];return r.filter((function(t){return k<=t&&t<=B})).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=Kr("g",l,I);Kr("line",qr(qr({},"vertical"==o?"left"==s?{x2:-6}:{x2:6}:"bottom"==s?{y2:6}:{y2:-6}),{stroke:"#000000","stroke-width":1.5}),c),Kr("text",qr(qr({},"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()})),O="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),Kr("polygon",{points:O,stroke:"#000000","stroke-width":1.5,fill:"none"},F),C="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)")},Kr("text",qr(qr({},C),{fill:"#000000","text-anchor":"middle",style:"font-family: ".concat(i,";")}),F).textContent=n,F}function to(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=Kr("svg",{width:123*r+5*(r+1),height:20*i+5*(i+1)}),s=Kr("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.opacity,t=t.color);var u=5+128*l,f=5+25*a;Kr("rect",{x:u,y:f,fill:t,opacity:c,width:20,height:20},s),Kr("text",qr(qr({},{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 eo=n(176),no=n.n(eo);n.p;var ro=null;function oo(){return null===ro&&(ro=no()()),ro}function io(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,oo()];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 ao=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())}))},so=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])}}},lo=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.")},co=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},uo=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 fo(t){return t.constructor}var ho=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 M((function(t){return ao(n,void 0,void 0,(function(){return so(this,(function(e){switch(e.label){case 0:return[4,io(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 ao(this,void 0,void 0,(function(){return so(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 so(this,(function(l){switch(l.label){case 0:l.trys.push([0,5,6,7]),n=lo(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=fo(n[0].data),a=F.apply(void 0,uo([],co(n.map((function(t){return t.data}))),!1)),s=new i(o(a,(function(t){return e.apply(void 0,uo([],co(t),!1))})));return new t(n[0].grid,s)},t}(),po=function(){function t(t,e,n,r){r=void 0===r?{}:r,this.u=new ho(t,e),this.v=new ho(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(fo(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}(),_o=function(){function t(t,e){this.profiles=e,this.grid=t}return t.prototype.getStormMotionGrid=function(){var t=this,e=this.profiles,n=new cn(this.grid.ni*this.grid.nj).fill(parseFloat("nan")),r=new cn(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 po(this.grid,n,r,{relative_to:"grid"})},t}(),mo=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)}}(),go=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())}))},vo=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])}}},bo=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},yo=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 M((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 go(this,void 0,void 0,(function(){var r,o,i,a,s,l,c,u,f,h,d;return vo(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,N.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 hn(t,c.vertices,2,t.TRIANGLE_STRIP),h=new hn(t,c.tex_coords,2,t.TRIANGLE_STRIP),d=new hn(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 M((function(t,e,n){return function(t,e,n,r){return go(this,void 0,void 0,(function(){var o,i,a,s,l,c;return vo(this,(function(u){switch(u.label){case 0:return o=e.getEarthCoords(),i=o.lats,a=o.lons,[4,N.makeBBElements(i,a,e.ni,e.nj,n,r)];case 1:return s=u.sent(),l=new hn(t,s.pts,3,t.TRIANGLE_STRIP),c=new hn(t,s.tex_coords,2,t.TRIANGLE_STRIP),[2,{vertices:l,texcoords:c}]}}))}))}(t,o,e,n)})),this.vector_rotation_cache=new M((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 cn(n.lats.length),o=0;o<n.lats.length;o++){var i=n.lons[o],a=n.lats[o],s=bo(e.transform(i,a),2),l=s[0],c=s[1],u=bo(e.transform(i+.01,a),2),f=u[0],h=u[1];r[o]=Math.atan2(h-c,f-l)}var d=C(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 pn(t,p)}}(t,o)}))}return t.prototype.getWGLBuffers=function(t){return go(this,void 0,void 0,(function(){return vo(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 go(this,void 0,void 0,(function(){return vo(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}(),wo=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 M((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 M((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 mo(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}(yo),xo=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 M((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=bo(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 M((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 mo(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}(yo),Eo=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=k({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 M((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=bo(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 M((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 mo(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_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="inverse"in(n=void 0===n?{}:n)&&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}(yo),To={bluered:function(t,e,n){return An.diverging("#0000ff","#ff0000",t,e,n)},redblue:function(t,e,n){return An.diverging("#ff0000","#0000ff",t,e,n)},pw_speed500mb:Rn,pw_speed850mb:Fn,pw_cape:Mn,pw_t2m:In,pw_td2m:Pn,nws_storm_clear_refl:Nn};function Ao(){oo()}})(),r})()));
|
|
3
|
+
//# sourceMappingURL=autumnplot-gl.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* k-d Tree JavaScript - V 1.01
|
|
5
|
+
*
|
|
6
|
+
* https://github.com/ubilabs/kd-tree-javascript
|
|
7
|
+
*
|
|
8
|
+
* @author Mircea Pricop <pricop@ubilabs.net>, 2012
|
|
9
|
+
* @author Martin Kleppe <kleppe@ubilabs.net>, 2012
|
|
10
|
+
* @author Ubilabs http://ubilabs.net, 2012
|
|
11
|
+
* @license MIT License <http://www.opensource.org/licenses/mit-license.php>
|
|
12
|
+
*/
|