autumnplot-gl 4.0.0-beta → 4.0.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 +11 -207
- package/dist/983.autumnplot-gl.js +2 -0
- package/dist/983.autumnplot-gl.js.map +1 -0
- package/dist/autumnplot-gl.js +1 -1
- package/dist/autumnplot-gl.js.map +1 -1
- package/dist/marchingsquares.wasm +0 -0
- package/lib/AutumnTypes.d.ts +34 -3
- package/lib/AutumnTypes.js +4 -1
- package/lib/Barbs.d.ts +1 -0
- package/lib/Color.d.ts +1 -0
- package/lib/Color.js +1 -0
- package/lib/ColorBar.d.ts +9 -0
- package/lib/ColorBar.js +5 -4
- package/lib/Colormap.d.ts +1 -0
- package/lib/Contour.d.ts +10 -0
- package/lib/Contour.js +10 -0
- package/lib/ContourCreator.d.ts +5 -1
- package/lib/ContourCreator.js +3 -3
- package/lib/Fill.d.ts +2 -0
- package/lib/Grid.d.ts +10 -3
- package/lib/Grid.js +61 -8
- package/lib/Hodographs.d.ts +6 -0
- package/lib/Hodographs.js +34 -19
- package/lib/Map.d.ts +14 -1
- package/lib/Map.js +59 -3
- package/lib/Paintball.d.ts +1 -0
- package/lib/Paintball.js +1 -1
- package/lib/PlotComponent.d.ts +1 -0
- package/lib/PlotComponent.js +1 -0
- package/lib/PlotLayer.d.ts +2 -2
- package/lib/PlotLayer.js +2 -2
- package/lib/PlotLayer.worker.js +8 -2
- package/lib/RawField.d.ts +2 -0
- package/lib/RawField.js +9 -2
- package/lib/StationPlot.d.ts +59 -8
- package/lib/StationPlot.js +28 -11
- package/lib/TextCollection.js +3 -0
- package/lib/index.d.ts +9 -3
- package/lib/index.js +4 -2
- package/package.json +2 -2
- package/dist/110.autumnplot-gl.js +0 -2
- package/dist/110.autumnplot-gl.js.map +0 -1
package/dist/autumnplot-gl.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see autumnplot-gl.js.LICENSE.txt */
|
|
2
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.apgl=e():t.apgl=e()}(this,(()=>(()=>{var t={645:(t,e)=>{e.read=function(t,e,n,r,o){var i,a,s=8*o-r-1,l=(1<<s)-1,c=l>>1,u=-7,f=n?o-1:0,h=n?-1:1,d=t[e+f];for(f+=h,i=d&(1<<-u)-1,d>>=-u,u+=s;u>0;i=256*i+t[e+f],f+=h,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=256*a+t[e+f],f+=h,u-=8);if(0===i)i=1-c;else{if(i===l)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),i-=c}return(d?-1:1)*a*Math.pow(2,i-r)},e.write=function(t,e,n,r,o,i){var a,s,l,c=8*i-o-1,u=(1<<c)-1,f=u>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,p=r?1:-1,_=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(a++,l/=2),a+f>=u?(s=0,a=u):a+f>=1?(s=(e*l-1)*Math.pow(2,o),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[n+d]=255&s,d+=p,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;t[n+d]=255&a,d+=p,a/=256,c-=8);t[n+d-p]|=128*_}},526:function(t,e){var n,r;void 0===(r="function"==typeof(n=function(t){function e(t,e,n){this.obj=t,this.left=null,this.right=null,this.parent=n,this.dimension=e}function n(t){this.content=[],this.scoreFunction=t}n.prototype={push:function(t){this.content.push(t),this.bubbleUp(this.content.length-1)},pop:function(){var t=this.content[0],e=this.content.pop();return this.content.length>0&&(this.content[0]=e,this.sinkDown(0)),t},peek:function(){return this.content[0]},remove:function(t){for(var e=this.content.length,n=0;n<e;n++)if(this.content[n]==t){var r=this.content.pop();return void(n!=e-1&&(this.content[n]=r,this.scoreFunction(r)<this.scoreFunction(t)?this.bubbleUp(n):this.sinkDown(n)))}throw new Error("Node not found.")},size:function(){return this.content.length},bubbleUp:function(t){for(var e=this.content[t];t>0;){var n=Math.floor((t+1)/2)-1,r=this.content[n];if(!(this.scoreFunction(e)<this.scoreFunction(r)))break;this.content[n]=e,this.content[t]=r,t=n}},sinkDown:function(t){for(var e=this.content.length,n=this.content[t],r=this.scoreFunction(n);;){var o=2*(t+1),i=o-1,a=null;if(i<e){var s=this.content[i],l=this.scoreFunction(s);l<r&&(a=i)}if(o<e){var c=this.content[o];this.scoreFunction(c)<(null==a?r:l)&&(a=o)}if(null==a)break;this.content[t]=this.content[a],this.content[a]=n,t=a}}},t.kdTree=function(t,r,o){var i=this;Array.isArray(t)?this.root=function t(n,r,i){var a,s,l=r%o.length;return 0===n.length?null:1===n.length?new e(n[0],l,i):(n.sort((function(t,e){return t[o[l]]-e[o[l]]})),(s=new e(n[a=Math.floor(n.length/2)],l,i)).left=t(n.slice(0,a),r+1,s),s.right=t(n.slice(a+1),r+1,s),s)}(t,0,null):function(t){i.root=t,function t(e){e.left&&(e.left.parent=e,t(e.left)),e.right&&(e.right.parent=e,t(e.right))}(i.root)}(t),this.toJSON=function(t){t||(t=this.root);var n=new e(t.obj,t.dimension,null);return t.left&&(n.left=i.toJSON(t.left)),t.right&&(n.right=i.toJSON(t.right)),n},this.insert=function(t){var n,r,i=function e(n,r){if(null===n)return r;var i=o[n.dimension];return t[i]<n.obj[i]?e(n.left,n):e(n.right,n)}(this.root,null);null!==i?(n=new e(t,(i.dimension+1)%o.length,i),r=o[i.dimension],t[r]<i.obj[r]?i.left=n:i.right=n):this.root=new e(t,0,null)},this.remove=function(t){var e;null!==(e=function e(n){if(null===n)return null;if(n.obj===t)return n;var r=o[n.dimension];return t[r]<n.obj[r]?e(n.left):e(n.right)}(i.root))&&function t(e){function n(t,e){var r,i,a,s,l;return null===t?null:(r=o[e],t.dimension===e?null!==t.left?n(t.left,e):t:(i=t.obj[r],a=n(t.left,e),s=n(t.right,e),l=t,null!==a&&a.obj[r]<i&&(l=a),null!==s&&s.obj[r]<l.obj[r]&&(l=s),l))}var r,a,s;if(null===e.left&&null===e.right)return null===e.parent?void(i.root=null):(s=o[e.parent.dimension],void(e.obj[s]<e.parent.obj[s]?e.parent.left=null:e.parent.right=null));null!==e.right?(a=(r=n(e.right,e.dimension)).obj,t(r),e.obj=a):(a=(r=n(e.left,e.dimension)).obj,t(r),e.right=e.left,e.left=null,e.obj=a)}(e)},this.nearest=function(t,e,a){var s,l,c;if(c=new n((function(t){return-t[1]})),a)for(s=0;s<e;s+=1)c.push([null,a]);for(i.root&&function n(i){function a(t,n){c.push([t,n]),c.size()>e&&c.pop()}var s,l,u,f,h=o[i.dimension],d=r(t,i.obj),p={};for(f=0;f<o.length;f+=1)f===i.dimension?p[o[f]]=t[o[f]]:p[o[f]]=i.obj[o[f]];l=r(p,i.obj),null!==i.right||null!==i.left?(n(s=null===i.right?i.left:null===i.left?i.right:t[h]<i.obj[h]?i.left:i.right),(c.size()<e||d<c.peek()[1])&&a(i,d),(c.size()<e||Math.abs(l)<c.peek()[1])&&null!==(u=s===i.left?i.right:i.left)&&n(u)):(c.size()<e||d<c.peek()[1])&&a(i,d)}(i.root),l=[],s=0;s<Math.min(e,c.content.length);s+=1)c.content[s][0]&&l.push([c.content[s][0].obj,c.content[s][1]]);return l},this.balanceFactor=function(){return function t(e){return null===e?0:Math.max(t(e.left),t(e.right))+1}(i.root)/(Math.log(function t(e){return null===e?0:t(e.left)+t(e.right)+1}(i.root))/Math.log(2))}},t.BinaryHeap=n})?n.apply(e,[e]):n)||(t.exports=r)},614:(t,e,n)=>{"use strict";t.exports=o;var r=n(645);function o(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}o.Varint=0,o.Fixed64=1,o.Bytes=2,o.Fixed32=5;var i=4294967296,a=1/i,s="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function l(t){return t.type===o.Bytes?t.readVarint()+t.pos:t.pos+1}function c(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function u(t,e,n){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));n.realloc(r);for(var o=n.pos-1;o>=t;o--)n.buf[o+r]=n.buf[o]}function f(t,e){for(var n=0;n<t.length;n++)e.writeVarint(t[n])}function h(t,e){for(var n=0;n<t.length;n++)e.writeSVarint(t[n])}function d(t,e){for(var n=0;n<t.length;n++)e.writeFloat(t[n])}function p(t,e){for(var n=0;n<t.length;n++)e.writeDouble(t[n])}function _(t,e){for(var n=0;n<t.length;n++)e.writeBoolean(t[n])}function m(t,e){for(var n=0;n<t.length;n++)e.writeFixed32(t[n])}function g(t,e){for(var n=0;n<t.length;n++)e.writeSFixed32(t[n])}function v(t,e){for(var n=0;n<t.length;n++)e.writeFixed64(t[n])}function b(t,e){for(var n=0;n<t.length;n++)e.writeSFixed64(t[n])}function y(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function w(t,e,n){t[n]=e,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function x(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}o.prototype={destroy:function(){this.buf=null},readFields:function(t,e,n){for(n=n||this.length;this.pos<n;){var r=this.readVarint(),o=r>>3,i=this.pos;this.type=7&r,t(o,e,this),this.pos===i&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=y(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=x(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=y(this.buf,this.pos)+y(this.buf,this.pos+4)*i;return this.pos+=8,t},readSFixed64:function(){var t=y(this.buf,this.pos)+x(this.buf,this.pos+4)*i;return this.pos+=8,t},readFloat:function(){var t=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,n,r=this.buf;return e=127&(n=r[this.pos++]),n<128?e:(e|=(127&(n=r[this.pos++]))<<7,n<128?e:(e|=(127&(n=r[this.pos++]))<<14,n<128?e:(e|=(127&(n=r[this.pos++]))<<21,n<128?e:function(t,e,n){var r,o,i=n.buf;if(r=(112&(o=i[n.pos++]))>>4,o<128)return c(t,r,e);if(r|=(127&(o=i[n.pos++]))<<3,o<128)return c(t,r,e);if(r|=(127&(o=i[n.pos++]))<<10,o<128)return c(t,r,e);if(r|=(127&(o=i[n.pos++]))<<17,o<128)return c(t,r,e);if(r|=(127&(o=i[n.pos++]))<<24,o<128)return c(t,r,e);if(r|=(1&(o=i[n.pos++]))<<31,o<128)return c(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(n=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&s?function(t,e,n){return s.decode(t.subarray(e,n))}(this.buf,e,t):function(t,e,n){for(var r="",o=e;o<n;){var i,a,s,l=t[o],c=null,u=l>239?4:l>223?3:l>191?2:1;if(o+u>n)break;1===u?l<128&&(c=l):2===u?128==(192&(i=t[o+1]))&&(c=(31&l)<<6|63&i)<=127&&(c=null):3===u?(i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&((c=(15&l)<<12|(63&i)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(i=t[o+1],a=t[o+2],s=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&((c=(15&l)<<18|(63&i)<<12|(63&a)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,r+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),r+=String.fromCharCode(c),o+=u}return r}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==o.Bytes)return t.push(this.readVarint(e));var n=l(this);for(t=t||[];this.pos<n;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==o.Bytes)return t.push(this.readSVarint());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==o.Bytes)return t.push(this.readBoolean());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==o.Bytes)return t.push(this.readFloat());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==o.Bytes)return t.push(this.readDouble());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==o.Bytes)return t.push(this.readFixed32());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==o.Bytes)return t.push(this.readSFixed32());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==o.Bytes)return t.push(this.readFixed64());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==o.Bytes)return t.push(this.readSFixed64());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===o.Varint)for(;this.buf[this.pos++]>127;);else if(e===o.Bytes)this.pos=this.readVarint()+this.pos;else if(e===o.Fixed32)this.pos+=4;else{if(e!==o.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var n=new Uint8Array(e);n.set(this.buf),this.buf=n,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),w(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),w(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),w(this.buf,-1&t,this.pos),w(this.buf,Math.floor(t*a),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),w(this.buf,-1&t,this.pos),w(this.buf,Math.floor(t*a),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var n,r;if(t>=0?(n=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:(n=0,r=r+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,n){n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos]=127&t}(n,0,e),function(t,e){var n=(7&t)<<4;e.buf[e.pos++]|=n|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(r,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,n){for(var r,o,i=0;i<e.length;i++){if((r=e.charCodeAt(i))>55295&&r<57344){if(!o){r>56319||i+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):o=r;continue}if(r<56320){t[n++]=239,t[n++]=191,t[n++]=189,o=r;continue}r=o-55296<<10|r-56320|65536,o=null}else o&&(t[n++]=239,t[n++]=191,t[n++]=189,o=null);r<128?t[n++]=r:(r<2048?t[n++]=r>>6|192:(r<65536?t[n++]=r>>12|224:(t[n++]=r>>18|240,t[n++]=r>>12&63|128),t[n++]=r>>6&63|128),t[n++]=63&r|128)}return n}(this.buf,t,this.pos);var n=this.pos-e;n>=128&&u(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),r.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),r.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var n=0;n<e;n++)this.buf[this.pos++]=t[n]},writeRawMessage:function(t,e){this.pos++;var n=this.pos;t(e,this);var r=this.pos-n;r>=128&&u(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,n){this.writeTag(t,o.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,h,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,_,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,m,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,g,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,v,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,b,e)},writeBytesField:function(t,e){this.writeTag(t,o.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,o.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,o.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,o.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,o.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,o.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,o.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,o.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,o.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,o.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},49:t=>{t.exports="varying highp vec2 v_tex_coord;\n\n#ifdef COLORMAP\nvarying highp float v_mag;\n#else\nuniform lowp vec4 u_bb_color;\n#endif\n\nuniform sampler2D u_sampler;\n\nvoid main() {\n lowp vec4 tex_color = texture2D(u_sampler, v_tex_coord);\n\n lowp vec4 color;\n#ifdef COLORMAP\n color = apply_colormap(v_mag);\n#else\n color = u_bb_color;\n#endif\n\n color.a *= tex_color.a;\n gl_FragColor = color; // mix(vec4(1.0, 0.0, 0.0, 0.5), color, tex_color.a);\n}"},955:t=>{t.exports="uniform mat4 u_matrix;\nuniform int u_offset;\n\nattribute vec3 a_pos; // Has position, zoom, and corner info\nattribute vec2 a_tex_coord;\nuniform lowp float u_bb_size;\nuniform lowp float u_map_aspect;\nuniform lowp float u_zoom;\nuniform highp float u_map_bearing;\nuniform lowp float u_bb_width; // Normalized by texture width\nuniform lowp float u_bb_height; // Normalized by texture height\nuniform highp float u_bb_mag_bin_size;\n//uniform highp float u_bb_max_mag;\nuniform highp float u_bb_mag_wrap;\n\nuniform sampler2D u_u_sampler;\nuniform sampler2D u_v_sampler;\nuniform sampler2D u_rot_sampler;\n\nvarying highp vec2 v_tex_coord;\n#ifdef COLORMAP\nvarying highp float v_mag;\n#endif\n\nmat4 scalingMatrix(float x_scale, float y_scale, float z_scale) {\n return mat4(x_scale, 0.0, 0.0, 0.0,\n 0.0, y_scale, 0.0, 0.0,\n 0.0, 0.0, z_scale, 0.0,\n 0.0, 0.0, 0.0, 1.0);\n}\n\nmat4 rotationZMatrix(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n\n return mat4( c, s, 0., 0.,\n -s, c, 0., 0.,\n 0., 0., 1., 0.,\n 0., 0., 0., 1.);\n}\n\nmat4 rotationXMatrix(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n\n return mat4( 1., 0., 0., 0.,\n 0., c, s, 0.,\n 0., -s, c, 0.,\n 0., 0., 0., 1.);\n}\n\nvoid main() {\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n vec4 pivot_pos = u_matrix * vec4(a_pos.xy + globe_offset, 0.0, 1.0);\n highp float zoom_corner = a_pos.z;\n lowp float min_zoom = floor(zoom_corner / 4.0);\n lowp float corner = mod(zoom_corner, 4.0);\n\n highp float u = texture2D(u_u_sampler, a_tex_coord).r;\n highp float v = texture2D(u_v_sampler, a_tex_coord).r;\n highp float rot = texture2D(u_rot_sampler, a_tex_coord).r;\n\n lowp float bb_aspect = u_bb_width / u_bb_height;\n lowp float ang = (abs(u) < 1e-6 && abs(v) < 1e-6) ? 0. : atan(v, u) - 3.141592654 / 2.0;\n highp float mag = length(vec2(u, v));\n#ifdef COLORMAP\n v_mag = mag;\n#endif\n mag = floor(mag / u_bb_mag_bin_size + 0.5) * u_bb_mag_bin_size;\n\n vec4 offset = vec4(0.0, 0.0, 0.0, 0.0);\n vec2 texcoord = vec2(0.0, 0.0);\n \n if (u_zoom >= min_zoom) {\n // Subtracting a small number off of u_bb_mag_wrap fixes (I think) a precision issue on some GPUs\n vec2 tex_loc = vec2(mod(mag, u_bb_mag_wrap - 1e-5) / u_bb_mag_bin_size * u_bb_width, floor(mag / (u_bb_mag_wrap - 1e-5)) * u_bb_height);\n\n if (corner < 0.5) {\n offset = vec4(-u_bb_size, u_bb_size, 0., 0.);\n texcoord = tex_loc;\n }\n else if (corner < 1.5) {\n offset = vec4(u_bb_size, u_bb_size, 0., 0.);\n texcoord = tex_loc + vec2(u_bb_width, 0.0);\n }\n else if (corner < 2.5) {\n offset = vec4(-u_bb_size, -u_bb_size * (2. / bb_aspect - 1.), 0., 0.);\n texcoord = tex_loc + vec2(0.0, u_bb_height);\n }\n else if (corner < 3.5) {\n offset = vec4(u_bb_size, -u_bb_size * (2. / bb_aspect - 1.), 0., 0.);\n texcoord = tex_loc + vec2(u_bb_width, u_bb_height);\n }\n\n mat4 barb_rotation = rotationZMatrix(ang + radians(u_map_bearing) - rot);\n mat4 map_stretch_matrix = scalingMatrix(1.0, 1. / u_map_aspect, 1.0);\n offset = map_stretch_matrix * barb_rotation * offset;\n }\n\n gl_Position = pivot_pos + offset;\n v_tex_coord = texcoord;\n}"},351:t=>{t.exports="\nuniform sampler2D u_cmap_sampler;\nuniform sampler2D u_cmap_nonlin_sampler;\nuniform highp float u_cmap_min;\nuniform highp float u_cmap_max;\nuniform highp vec4 u_underflow_color;\nuniform highp vec4 u_overflow_color;\nuniform int u_n_index;\n\nlowp vec4 apply_colormap(highp float value) {\n lowp float normed_val = (value - u_cmap_min) / (u_cmap_max - u_cmap_min);\n \n lowp vec4 color;\n if (normed_val < 0.0) {\n color = u_underflow_color;\n }\n else if (normed_val > 1.0) {\n color = u_overflow_color;\n }\n else {\n lowp float index_buffer = 1. / (2. * float(u_n_index));\n normed_val = index_buffer + normed_val * (1. - 2. * index_buffer); // Chop off the half pixels on either end of the texture\n highp float nonlin_val = texture2D(u_cmap_nonlin_sampler, vec2(normed_val, 0.5)).r;\n color = texture2D(u_cmap_sampler, vec2(nonlin_val, 0.5));\n }\n\n return color;\n}"},824:t=>{t.exports="varying highp vec2 v_tex_coord;\n\nuniform sampler2D u_fill_sampler;\nuniform highp float u_opacity;\n\nbool isnan(highp float val) {\n return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true;\n}\n\nvoid main() {\n highp float fill_val = texture2D(u_fill_sampler, v_tex_coord).r;\n\n if (isnan(fill_val)) {\n discard;\n }\n\n lowp vec4 color = apply_colormap(fill_val);\n color.a = color.a * u_opacity;\n gl_FragColor = color;\n}"},370:t=>{t.exports="uniform mat4 u_matrix;\nuniform int u_offset;\n\nattribute vec2 a_pos;\nattribute vec2 a_tex_coord;\n\nvarying highp vec2 v_tex_coord;\n\nvoid main() {\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n gl_Position = u_matrix * vec4(a_pos + globe_offset, 0.0, 1.0);\n v_tex_coord = a_tex_coord;\n}"},714:t=>{t.exports="#define MAX_N_COLORS 24\n\nvarying highp vec2 v_tex_coord;\n\nuniform sampler2D u_fill_sampler;\nuniform lowp vec4 u_colors[MAX_N_COLORS];\nuniform int u_num_colors;\nuniform highp float u_opacity;\n\nvoid main() {\n highp float fill_val = texture2D(u_fill_sampler, v_tex_coord).r;\n \n if (fill_val < 0.5) {\n discard;\n }\n\n lowp vec4 color = vec4(0., 0., 0., 0.);\n\n for (int nclr = 0; nclr < MAX_N_COLORS ; nclr++) {\n if (nclr >= u_num_colors || fill_val < 0.99) { break; }\n\n lowp float mem_active = mod(fill_val, 2.);\n color = mix(color, u_colors[nclr], mem_active);\n fill_val = floor(fill_val / 2.);\n }\n\n color.a = color.a * u_opacity;\n gl_FragColor = color;\n}"},431:t=>{t.exports="uniform mat4 u_matrix;\nuniform int u_offset;\n\nattribute vec2 a_pos;\nattribute vec2 a_tex_coord;\n\nvarying highp vec2 v_tex_coord;\n\nvoid main() {\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n gl_Position = u_matrix * vec4(a_pos + globe_offset, 0.0, 1.0);\n v_tex_coord = a_tex_coord;\n}"},559:t=>{t.exports="\nuniform sampler2D u_dash_sampler;\n\n#ifndef DATA\nuniform lowp vec4 u_color;\n#endif\n\nuniform lowp float u_line_width;\nuniform lowp float u_zoom;\nuniform int u_dash_pattern_length;\n\n#ifdef DATA\nvarying highp float v_data;\n#endif\n\nvarying highp float v_dist;\nvarying lowp float v_cross;\n\nvoid main() {\n lowp float dash_x = fract(v_dist * 2e2 * pow(2., floor(u_zoom)) / float(u_dash_pattern_length));\n lowp float dash = texture2D(u_dash_sampler, vec2(dash_x, 0.5)).r;\n\n lowp vec4 color;\n#ifdef DATA\n color = apply_colormap(v_data);\n#else\n color = u_color;\n#endif\n\n lowp float feather = clamp((1. - abs(v_cross)) * u_line_width, 0., 1.);\n color.a *= (dash >= 1. ? 1. : 0.) * feather;\n\n gl_FragColor = color;\n}"},319:t=>{t.exports="uniform mat4 u_matrix;\nuniform int u_offset;\n\nattribute vec3 a_pos;\nattribute vec2 a_extrusion;\nattribute float a_data;\n\n#ifdef ZOOM\nattribute float a_min_zoom;\n#endif\n\n#ifdef OFFSET\nattribute vec2 a_offset;\n#endif\n\nuniform lowp float u_line_width;\nuniform lowp float u_map_width;\nuniform lowp float u_map_height;\nuniform highp float u_map_bearing;\n\n#ifdef ZOOM\nuniform lowp float u_zoom;\n#endif\n\n#ifdef OFFSET\nuniform lowp float u_offset_scale;\n#endif\n\n#ifdef DATA\nvarying highp float v_data;\n#endif\n\nvarying highp float v_dist;\nvarying lowp float v_cross;\n\nmat4 scalingMatrix(float x_scale, float y_scale, float z_scale) {\n return mat4(x_scale, 0.0, 0.0, 0.0,\n 0.0, y_scale, 0.0, 0.0,\n 0.0, 0.0, z_scale, 0.0,\n 0.0, 0.0, 0.0, 1.0);\n}\n\nmat4 rotationZMatrix(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n\n return mat4( c, s, 0., 0.,\n -s, c, 0., 0.,\n 0., 0., 1., 0.,\n 0., 0., 0., 1.);\n}\n\nmat4 rotationXMatrix(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n\n return mat4( 1., 0., 0., 0.,\n 0., c, s, 0.,\n 0., -s, c, 0.,\n 0., 0., 0., 1.);\n}\n\nvoid main() {\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n v_dist = abs(a_pos.z);\n v_cross = sign(a_pos.z);\n vec4 center_pos = u_matrix * vec4(a_pos.xy + globe_offset, 0.0, 1.0);\n vec4 offset = vec4(0.0, 0.0, 0.0, 0.0);\n\n#ifdef ZOOM\n if (u_zoom >= a_min_zoom) {\n#endif\n\n vec2 offset_ext = u_line_width * 2. * a_extrusion;\n\n mat4 map_stretch_matrix = scalingMatrix(u_map_height / u_map_width, 1., 1.);\n mat4 rotation_matrix = rotationZMatrix(radians(u_map_bearing)); \n offset = map_stretch_matrix * rotation_matrix * vec4(offset_ext, 0., 0.);\n\n#ifdef OFFSET\n map_stretch_matrix = scalingMatrix(1., u_map_width / u_map_height, 1.);\n vec2 offset_offset = u_offset_scale * a_offset;\n offset += map_stretch_matrix * rotation_matrix * vec4(offset_offset, 0., 0.);\n#endif\n\n#ifdef ZOOM\n }\n#endif\n\n gl_Position = center_pos + offset;\n\n#ifdef DATA\n v_data = a_data;\n#endif\n}"},286:t=>{t.exports="\nvarying highp vec2 v_tex_coord;\nuniform sampler2D u_sdf_sampler;\nuniform int u_is_halo;\n\nuniform lowp vec4 u_text_color;\nuniform lowp vec4 u_halo_color;\n\n#define SDF_FILL 0.75\n#define SDF_HALO 0.45\n\nvoid main() {\n highp float sdf_val = texture2D(u_sdf_sampler, v_tex_coord).r;\n\n lowp float step_width = 0.08;\n lowp float alpha = smoothstep(SDF_FILL - step_width, SDF_FILL + step_width, sdf_val);\n\n lowp vec4 color = u_is_halo == 1 ? u_halo_color : u_text_color;\n\n if (u_is_halo == 1) {\n alpha = min(smoothstep(SDF_HALO - step_width, SDF_HALO + step_width, sdf_val), 1.0 - alpha);\n }\n\n color.a *= alpha;\n gl_FragColor = color;\n}"},207:t=>{t.exports="\nuniform mat4 u_matrix;\nuniform int u_offset;\nuniform highp float u_map_width;\nuniform highp float u_map_height;\nuniform highp float u_map_zoom;\nuniform highp float u_font_size;\n\nattribute vec3 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_tex_coord;\n\nvarying highp vec2 v_tex_coord;\n\nmat4 scalingMatrix(float x_scale, float y_scale, float z_scale) {\n return mat4(x_scale, 0.0, 0.0, 0.0,\n 0.0, y_scale, 0.0, 0.0,\n 0.0, 0.0, z_scale, 0.0,\n 0.0, 0.0, 0.0, 1.0);\n}\n\nvoid main() {\n float min_zoom = a_pos.z;\n\n vec2 offset = a_offset;\n if (u_map_zoom < min_zoom)\n offset = vec2(0., 0.);\n\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n mat4 map_stretch_matrix = scalingMatrix(u_map_height / u_map_width, 1., 1.);\n\n gl_Position = u_matrix * vec4(a_pos.xy + globe_offset, 0.0, 1.0) + u_font_size / 12. * 1.5 * map_stretch_matrix * vec4(offset, 0., 0.);\n v_tex_coord = a_tex_coord;\n}"},176:t=>{var e,n=(e="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(t={}){var n,r,o=t;o.ready=new Promise(((t,e)=>{n=t,r=e})),["_main","getExceptionMessage","___get_exception_message","_free","_memory","___indirect_function_table","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(o.ready,t)||Object.defineProperty(o.ready,t,{get:()=>C("You are getting "+t+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js"),set:()=>C("You are setting "+t+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")})}));var i=Object.assign({},o);if(o.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");var a,s="";if("undefined"!=typeof document&&document.currentScript&&(s=document.currentScript.src),e&&(s=e),s=0!==s.indexOf("blob:")?s.substr(0,s.replace(/[?#].*/,"").lastIndexOf("/")+1):"","object"!=typeof window&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");var l,c,u,f=o.print||console.log.bind(console),h=o.printErr||console.error.bind(console);Object.assign(o,i),i=null,u="fetchSettings",Object.getOwnPropertyDescriptor(o,u)&&C(`\`Module.${u}\` was supplied but \`${u}\` not included in INCOMING_MODULE_JS_API`),o.arguments&&o.arguments,z("arguments","arguments_"),o.thisProgram&&o.thisProgram,z("thisProgram","thisProgram"),o.quit&&o.quit,z("quit","quit_"),x(void 0===o.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),x(void 0===o.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),x(void 0===o.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),x(void 0===o.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),x(void 0===o.read,"Module.read option was removed (modify read_ in JS)"),x(void 0===o.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),x(void 0===o.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),x(void 0===o.setWindowTitle,"Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"),x(void 0===o.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),z("asm","wasmExports"),z("read","read_"),z("readAsync","readAsync"),z("readBinary","readBinary"),z("setWindowTitle","setWindowTitle"),x(!0,"worker environment detected but not enabled at build time. Add 'worker' to `-sENVIRONMENT` to enable."),x(!0,"node environment detected but not enabled at build time. Add 'node' to `-sENVIRONMENT` to enable."),x(!0,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),o.wasmBinary&&(l=o.wasmBinary),z("wasmBinary","wasmBinary"),"object"!=typeof WebAssembly&&C("no native wasm support detected");var d,p,_,m,g,v,b,y,w=!1;function x(t,e){t||C("Assertion failed"+(e?": "+e:""))}function T(){var t=c.buffer;o.HEAP8=d=new Int8Array(t),o.HEAP16=_=new Int16Array(t),o.HEAPU8=p=new Uint8Array(t),o.HEAPU16=m=new Uint16Array(t),o.HEAP32=g=new Int32Array(t),o.HEAPU32=v=new Uint32Array(t),o.HEAPF32=b=new Float32Array(t),o.HEAPF64=y=new Float64Array(t)}function E(){if(!w){var t=fe();0==t&&(t+=4);var e=v[t>>2],n=v[t+4>>2];34821223==e&&2310721022==n||C(`Stack overflow! Stack cookie has been overwritten at ${Q(t)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${Q(n)} ${Q(e)}`),1668509029!=v[0]&&C("Runtime error: The application has corrupted its heap memory area (address zero)!")}}x(!o.STACK_SIZE,"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"),x("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support"),x(!o.wasmMemory,"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"),x(!o.INITIAL_MEMORY,"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically"),function(){var t=new Int16Array(1),e=new Int8Array(t.buffer);if(t[0]=25459,115!==e[0]||99!==e[1])throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"}();var A=[],S=[],R=[],F=!1;x(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),x(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),x(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),x(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var M=0,P=null,I=null,O={};function C(t){o.onAbort&&o.onAbort(t),h(t="Aborted("+t+")"),w=!0;var e=new WebAssembly.RuntimeError(t);throw r(e),e}var N={error(){C("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM")},init(){N.error()},createDataFile(){N.error()},createPreloadedFile(){N.error()},createLazyFile(){N.error()},open(){N.error()},mkdev(){N.error()},registerDevice(){N.error()},analyzePath(){N.error()},ErrnoError(){N.error()}};o.FS_createDataFile=N.createDataFile,o.FS_createPreloadedFile=N.createPreloadedFile;var B,k,G=t=>t.startsWith("data:application/octet-stream;base64,");function L(t){return function(){x(F,`native function \`${t}\` called before runtime initialization`);var e=oe[t];return x(e,`exported native function \`${t}\` not found`),e.apply(null,arguments)}}class D extends Error{}class U extends D{constructor(t){super(t),this.excPtr=t;const e=K(t);this.name=e[0],this.message=e[1]}}function j(t){if(t==B&&l)return new Uint8Array(l);if(a)return a(t);throw"both async and sync fetching of the wasm failed"}function H(t,e,n){return function(t){return l||"function"!=typeof fetch?Promise.resolve().then((()=>j(t))):fetch(t,{credentials:"same-origin"}).then((e=>{if(!e.ok)throw"failed to load wasm binary file at '"+t+"'";return e.arrayBuffer()})).catch((()=>j(t)))}(t).then((t=>WebAssembly.instantiate(t,e))).then((t=>t)).then(n,(t=>{h(`failed to asynchronously prepare wasm: ${t}`),B.startsWith("file://")&&h(`warning: Loading from a file URI (${B}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`),C(t)}))}function z(t,e,n=!0){Object.getOwnPropertyDescriptor(o,t)||Object.defineProperty(o,t,{configurable:!0,get(){C(`\`Module.${t}\` has been replaced by \`${e}\``+(n?" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)":""))}})}function W(t){return"FS_createPath"===t||"FS_createDataFile"===t||"FS_createPreloadedFile"===t||"FS_unlink"===t||"addRunDependency"===t||"FS_createLazyFile"===t||"FS_createDevice"===t||"removeRunDependency"===t}function V(t,e){"undefined"!=typeof globalThis&&Object.defineProperty(globalThis,t,{configurable:!0,get(){tt(`\`${t}\` is not longer defined by emscripten. ${e}`)}})}function $(t){Object.getOwnPropertyDescriptor(o,t)||Object.defineProperty(o,t,{configurable:!0,get(){var e=`'${t}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`;W(t)&&(e+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),C(e)}})}G(B="marchingsquares.wasm")||(k=B,B=o.locateFile?o.locateFile(k,s):s+k),V("buffer","Please use HEAP8.buffer or wasmMemory.buffer"),V("asm","Please use wasmExports instead");var Y=t=>{for(;t.length>0;)t.shift()(o)},X="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,J=(t,e,n)=>{for(var r=e+n,o=e;t[o]&&!(o>=r);)++o;if(o-e>16&&t.buffer&&X)return X.decode(t.subarray(e,o));for(var i="";e<o;){var a=t[e++];if(128&a){var s=63&t[e++];if(192!=(224&a)){var l=63&t[e++];if(224==(240&a)?a=(15&a)<<12|s<<6|l:(240!=(248&a)&&tt("Invalid UTF-8 leading byte "+Q(a)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),a=(7&a)<<18|s<<12|l<<6|63&t[e++]),a<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i},Z=(t,e)=>(x("number"==typeof t,`UTF8ToString expects a number (got ${typeof t})`),t?J(p,t,e):""),q=t=>{return e=()=>{var e=pe(4),n=pe(4);me(t,e,n);var r,o=v[e>>2],i=v[n>>2],a=Z(o);return se(o),i&&(r=Z(i),se(i)),[a,r]},n=he(),r=e(),de(n),r;var e,n,r},K=t=>q(t);o.getExceptionMessage=K,o.noExitRuntime;var Q=t=>(x("number"==typeof t),"0x"+(t>>>=0).toString(16).padStart(8,"0")),tt=t=>{tt.shown||(tt.shown={}),tt.shown[t]||(tt.shown[t]=1,h(t))},et=[],nt=0;function rt(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(t){v[this.ptr+4>>2]=t},this.get_type=function(){return v[this.ptr+4>>2]},this.set_destructor=function(t){v[this.ptr+8>>2]=t},this.get_destructor=function(){return v[this.ptr+8>>2]},this.set_caught=function(t){t=t?1:0,d[this.ptr+12>>0]=t},this.get_caught=function(){return 0!=d[this.ptr+12>>0]},this.set_rethrown=function(t){t=t?1:0,d[this.ptr+13>>0]=t},this.get_rethrown=function(){return 0!=d[this.ptr+13>>0]},this.init=function(t,e){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(e)},this.set_adjusted_ptr=function(t){v[this.ptr+16>>2]=t},this.get_adjusted_ptr=function(){return v[this.ptr+16>>2]},this.get_exception_ptr=function(){if(ve(this.get_type()))return v[this.excPtr>>2];var t=this.get_adjusted_ptr();return 0!==t?t:this.excPtr}}var ot,it,at,st=t=>{var e=nt&&nt.excPtr;if(!e)return ce(0),0;var n=new rt(e);n.set_adjusted_ptr(e);var r=n.get_type();if(!r)return ce(0),e;for(var o in t){var i=t[o];if(0===i||i===r)break;var a=n.ptr+16;if(ge(i,r,a))return ce(i),e}return ce(r),e},lt=t=>{for(var e="",n=t;p[n];)e+=ot[p[n++]];return e},ct={},ut={},ft={},ht=t=>{throw new it(t)},dt=t=>{throw new at(t)};function pt(t,e,n={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(t,e,n={}){var r=e.name;if(t||ht(`type "${r}" must have a positive integer typeid pointer`),ut.hasOwnProperty(t)){if(n.ignoreDuplicateRegistrations)return;ht(`Cannot register type '${r}' twice`)}if(ut[t]=e,delete ft[t],ct.hasOwnProperty(t)){var o=ct[t];delete ct[t],o.forEach((t=>t()))}}(t,e,n)}function _t(){this.allocated=[void 0],this.freelist=[]}var mt=new _t,gt=t=>{t>=mt.reserved&&0==--mt.get(t).refcount&&mt.free(t)},vt=()=>{for(var t=0,e=mt.reserved;e<mt.allocated.length;++e)void 0!==mt.allocated[e]&&++t;return t},bt=t=>(t||ht("Cannot use deleted val. handle = "+t),mt.get(t).value),yt=t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return mt.allocate({refcount:1,value:t})}};function wt(t){return this.fromWireType(g[t>>2])}var xt=t=>{if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t},Tt=(t,e)=>{switch(e){case 4:return function(t){return this.fromWireType(b[t>>2])};case 8:return function(t){return this.fromWireType(y[t>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},Et=(t,e)=>Object.defineProperty(e,"name",{value:t}),At=t=>{for(;t.length;){var e=t.pop();t.pop()(e)}};function St(t,e){if(!(t instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof t} which is not a function`);var n=Et(t.name||"unknownFunctionName",(function(){}));n.prototype=t.prototype;var r=new n,o=t.apply(r,e);return o instanceof Object?o:r}var Rt,Ft,Mt=(t,e,n)=>{if(void 0===t[e].overloadTable){var r=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||ht(`Function '${n}' called with an invalid number of arguments (${arguments.length}) - expects one of (${t[e].overloadTable})!`),t[e].overloadTable[arguments.length].apply(this,arguments)},t[e].overloadTable=[],t[e].overloadTable[r.argCount]=r}},Pt=[],It=t=>{var e=Pt[t];return e||(t>=Pt.length&&(Pt.length=t+1),Pt[t]=e=Rt.get(t)),x(Rt.get(t)==e,"JavaScript-side Wasm function table mirror is out of date!"),e},Ot=(t,e,n)=>t.includes("j")?((t,e,n)=>{x("dynCall_"+t in o,`bad function pointer type - dynCall function not found for sig '${t}'`),n&&n.length?x(n.length===t.substring(1).replace(/j/g,"--").length):x(1==t.length);var r=o["dynCall_"+t];return n&&n.length?r.apply(null,[e].concat(n)):r.call(null,e)})(t,e,n):(x(It(e),`missing table entry in dynCall: ${e}`),It(e).apply(null,n)),Ct=(t,e)=>{var n=(t=lt(t)).includes("j")?((t,e)=>{x(t.includes("j")||t.includes("p"),"getDynCaller should only be called with i64 sigs");var n=[];return function(){return n.length=0,Object.assign(n,arguments),Ot(t,e,n)}})(t,e):It(e);return"function"!=typeof n&&ht(`unknown function pointer with signature ${t}: ${e}`),n},Nt=t=>{var e=ie(t),n=lt(e);return se(e),n},Bt=(t,e,n)=>{switch(e){case 1:return n?t=>d[t>>0]:t=>p[t>>0];case 2:return n?t=>_[t>>1]:t=>m[t>>1];case 4:return n?t=>g[t>>2]:t=>v[t>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}};function kt(t){return this.fromWireType(v[t>>2])}var Gt,Lt=(t,e,n)=>(x("number"==typeof n,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),((t,e,n,r)=>{if(x("string"==typeof t,`stringToUTF8Array expects a string (got ${typeof t})`),!(r>0))return 0;for(var o=n,i=n+r-1,a=0;a<t.length;++a){var s=t.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++a)),s<=127){if(n>=i)break;e[n++]=s}else if(s<=2047){if(n+1>=i)break;e[n++]=192|s>>6,e[n++]=128|63&s}else if(s<=65535){if(n+2>=i)break;e[n++]=224|s>>12,e[n++]=128|s>>6&63,e[n++]=128|63&s}else{if(n+3>=i)break;s>1114111&&tt("Invalid Unicode code point "+Q(s)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),e[n++]=240|s>>18,e[n++]=128|s>>12&63,e[n++]=128|s>>6&63,e[n++]=128|63&s}}return e[n]=0,n-o})(t,p,e,n)),Dt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Ut=(t,e)=>{x(t%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var n=t,r=n>>1,o=r+e/2;!(r>=o)&&m[r];)++r;if((n=r<<1)-t>32&&Dt)return Dt.decode(p.subarray(t,n));for(var i="",a=0;!(a>=e/2);++a){var s=_[t+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i},jt=(t,e,n)=>{if(x(e%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),x("number"==typeof n,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===n&&(n=2147483647),n<2)return 0;for(var r=e,o=(n-=2)<2*t.length?n/2:t.length,i=0;i<o;++i){var a=t.charCodeAt(i);_[e>>1]=a,e+=2}return _[e>>1]=0,e-r},Ht=t=>2*t.length,zt=(t,e)=>{x(t%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var n=0,r="";!(n>=e/4);){var o=g[t+4*n>>2];if(0==o)break;if(++n,o>=65536){var i=o-65536;r+=String.fromCharCode(55296|i>>10,56320|1023&i)}else r+=String.fromCharCode(o)}return r},Wt=(t,e,n)=>{if(x(e%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),x("number"==typeof n,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===n&&(n=2147483647),n<4)return 0;for(var r=e,o=r+n-4,i=0;i<t.length;++i){var a=t.charCodeAt(i);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++i)),g[e>>2]=a,(e+=4)+4>o)break}return g[e>>2]=0,e-r},Vt=t=>{for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);r>=55296&&r<=57343&&++n,e+=4}return e},$t=(t,e)=>{var n=ut[t];return void 0===n&&ht(e+" has unknown type "+Nt(t)),n},Yt=(t,e,n)=>{var r=[],o=t.toWireType(r,n);return r.length&&(v[e>>2]=yt(r)),o},Xt=[],Jt={},Zt=t=>{var e=Jt[t];return void 0===e?lt(t):e},qt=(Reflect.construct,(t,e,n)=>{var r=((t,e)=>{for(var n=new Array(t),r=0;r<t;++r)n[r]=$t(v[e+4*r>>2],"parameter "+r);return n})(t,e),o=r.shift();t--;var i="return function (obj, func, destructorsRef, args) {\n",a=0,s=[];0===n&&s.push("obj");for(var l=["retType"],c=[o],u=0;u<t;++u)s.push("arg"+u),l.push("argType"+u),c.push(r[u]),i+=` var arg${u} = argType${u}.readValueFromPointer(args${a?"+"+a:""});\n`,a+=r[u].argPackAdvance;for(i+=` var rv = ${1===n?"new func":"func.call"}(${s.join(", ")});\n`,u=0;u<t;++u)r[u].deleteObject&&(i+=` argType${u}.deleteObject(arg${u});\n`);o.isVoid||(l.push("emval_returnValue"),c.push(Yt),i+=" return emval_returnValue(retType, destructorsRef, rv);\n"),i+="};\n",l.push(i);var f,h,d=St(Function,l).apply(null,c),p=`methodCaller<(${r.map((t=>t.name)).join(", ")}) => ${o.name}>`;return f=Et(p,d),h=Xt.length,Xt.push(f),h});Gt=()=>performance.now();var Kt=t=>{var e=c.buffer,n=(t-e.byteLength+65535)/65536;try{return c.grow(n),T(),1}catch(n){h(`growMemory: Attempted to grow heap from ${e.byteLength} bytes to ${t} bytes, but got error: ${n}`)}};var Qt,te,ee,ne=[null,[],[]];(()=>{for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);ot=t})(),it=o.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},at=o.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},Object.assign(_t.prototype,{get(t){return x(void 0!==this.allocated[t],`invalid handle: ${t}`),this.allocated[t]},has(t){return void 0!==this.allocated[t]},allocate(t){var e=this.freelist.pop()||this.allocated.length;return this.allocated[e]=t,e},free(t){x(void 0!==this.allocated[t]),this.allocated[t]=void 0,this.freelist.push(t)}}),mt.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),mt.reserved=mt.allocated.length,o.count_emval_handles=vt,Ft=o.UnboundTypeError=(Qt=Error,(ee=Et(te="UnboundTypeError",(function(t){this.name=te,this.message=t;var e=new Error(t).stack;void 0!==e&&(this.stack=this.toString()+"\n"+e.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(Qt.prototype),ee.prototype.constructor=ee,ee.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},ee);var re={__assert_fail:(t,e,n,r)=>{C(`Assertion failed: ${Z(t)}, at: `+[e?Z(e):"unknown filename",n,r?Z(r):"unknown function"])},__cxa_begin_catch:t=>{var e=new rt(t);return e.get_caught()||e.set_caught(!0),e.set_rethrown(!1),et.push(e),_e(e.excPtr),e.get_exception_ptr()},__cxa_find_matching_catch_2:()=>st([]),__cxa_find_matching_catch_3:t=>st([t]),__cxa_throw:(t,e,n)=>{throw new rt(t).init(e,n),nt=new U(t)},__resumeException:t=>{throw nt||(nt=new U(t)),nt},_embind_register_bigint:(t,e,n,r,o)=>{},_embind_register_bool:(t,e,n,r)=>{pt(t,{name:e=lt(e),fromWireType:function(t){return!!t},toWireType:function(t,e){return e?n:r},argPackAdvance:8,readValueFromPointer:function(t){return this.fromWireType(p[t])},destructorFunction:null})},_embind_register_emval:(t,e)=>{pt(t,{name:e=lt(e),fromWireType:t=>{var e=bt(t);return gt(t),e},toWireType:(t,e)=>yt(e),argPackAdvance:8,readValueFromPointer:wt,destructorFunction:null})},_embind_register_float:(t,e,n)=>{pt(t,{name:e=lt(e),fromWireType:t=>t,toWireType:(t,e)=>{if("number"!=typeof e&&"boolean"!=typeof e)throw new TypeError(`Cannot convert ${xt(e)} to ${this.name}`);return e},argPackAdvance:8,readValueFromPointer:Tt(e,n),destructorFunction:null})},_embind_register_function:(t,e,n,r,i,a,s)=>{var l=((t,e)=>{for(var n=[],r=0;r<t;r++)n.push(v[e+4*r>>2]);return n})(e,n);t=(t=>{const e=(t=t.trim()).indexOf("(");return-1!==e?(x(")"==t[t.length-1],"Parentheses for argument names should match."),t.substr(0,e)):t})(t=lt(t)),i=Ct(r,i),((t,e,n)=>{o.hasOwnProperty(t)?((void 0===n||void 0!==o[t].overloadTable&&void 0!==o[t].overloadTable[n])&&ht(`Cannot register public name '${t}' twice`),Mt(o,t,t),o.hasOwnProperty(n)&&ht(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`),o[t].overloadTable[n]=e):(o[t]=e,void 0!==n&&(o[t].numArguments=n))})(t,(function(){((t,e)=>{var n=[],r={};throw e.forEach((function t(e){r[e]||ut[e]||(ft[e]?ft[e].forEach(t):(n.push(e),r[e]=!0))})),new Ft(`${t}: `+n.map(Nt).join([", "]))})(`Cannot call ${t} due to unbound types`,l)}),e-1),((t,e,n)=>{function r(e){var r=n(e);r.length!==t.length&&dt("Mismatched type converter count");for(var o=0;o<t.length;++o)pt(t[o],r[o])}t.forEach((function(t){ft[t]=e}));var o=new Array(e.length),i=[],a=0;e.forEach(((t,e)=>{ut.hasOwnProperty(t)?o[e]=ut[t]:(i.push(t),ct.hasOwnProperty(t)||(ct[t]=[]),ct[t].push((()=>{o[e]=ut[t],++a===i.length&&r(o)})))})),0===i.length&&r(o)})([],l,(function(n){var r=[n[0],null].concat(n.slice(1));return((t,e,n)=>{o.hasOwnProperty(t)||dt("Replacing nonexistant public symbol"),void 0!==o[t].overloadTable&&void 0!==n?o[t].overloadTable[n]=e:(o[t]=e,o[t].argCount=n)})(t,function(t,e,n,r,o,i){var a=e.length;a<2&&ht("argTypes array size mismatch! Must at least get return value and 'this' types!"),x(!i,"Async bindings are only supported with JSPI.");for(var s=null!==e[1]&&null!==n,l=!1,c=1;c<e.length;++c)if(null!==e[c]&&void 0===e[c].destructorFunction){l=!0;break}var u="void"!==e[0].name,f="",h="";for(c=0;c<a-2;++c)f+=(0!==c?", ":"")+"arg"+c,h+=(0!==c?", ":"")+"arg"+c+"Wired";var d=`\n return function (${f}) {\n if (arguments.length !== ${a-2}) {\n throwBindingError('function ${t} called with ' + arguments.length + ' arguments, expected ${a-2}');\n }`;l&&(d+="var destructors = [];\n");var p=l?"destructors":"null",_=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],m=[ht,r,o,At,e[0],e[1]];for(s&&(d+="var thisWired = classParam.toWireType("+p+", this);\n"),c=0;c<a-2;++c)d+="var arg"+c+"Wired = argType"+c+".toWireType("+p+", arg"+c+"); // "+e[c+2].name+"\n",_.push("argType"+c),m.push(e[c+2]);if(s&&(h="thisWired"+(h.length>0?", ":"")+h),d+=(u||i?"var rv = ":"")+"invoker(fn"+(h.length>0?", ":"")+h+");\n",l)d+="runDestructors(destructors);\n";else for(c=s?1:2;c<e.length;++c){var g=1===c?"thisWired":"arg"+(c-2)+"Wired";null!==e[c].destructorFunction&&(d+=g+"_dtor("+g+"); // "+e[c].name+"\n",_.push(g+"_dtor"),m.push(e[c].destructorFunction))}u&&(d+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),d+="}\n",_.push(d);var v=St(Function,_).apply(null,m);return Et(t,v)}(t,r,null,i,a,s),e-1),[]}))},_embind_register_integer:(t,e,n,r,o)=>{e=lt(e),-1===o&&(o=4294967295);var i=t=>t;if(0===r){var a=32-8*n;i=t=>t<<a>>>a}var s=e.includes("unsigned"),l=(t,n)=>{if("number"!=typeof t&&"boolean"!=typeof t)throw new TypeError(`Cannot convert "${xt(t)}" to ${n}`);if(t<r||t>o)throw new TypeError(`Passing a number "${xt(t)}" from JS side to C/C++ side to an argument of type "${e}", which is outside the valid range [${r}, ${o}]!`)};pt(t,{name:e,fromWireType:i,toWireType:s?function(t,e){return l(e,this.name),e>>>0}:function(t,e){return l(e,this.name),e},argPackAdvance:8,readValueFromPointer:Bt(e,n,0!==r),destructorFunction:null})},_embind_register_memory_view:(t,e,n)=>{var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];function o(t){var e=v[t>>2],n=v[t+4>>2];return new r(d.buffer,n,e)}pt(t,{name:n=lt(n),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},_embind_register_std_string:(t,e)=>{var n="std::string"===(e=lt(e));pt(t,{name:e,fromWireType(t){var e,r=v[t>>2],o=t+4;if(n)for(var i=o,a=0;a<=r;++a){var s=o+a;if(a==r||0==p[s]){var l=Z(i,s-i);void 0===e?e=l:(e+=String.fromCharCode(0),e+=l),i=s+1}}else{var c=new Array(r);for(a=0;a<r;++a)c[a]=String.fromCharCode(p[o+a]);e=c.join("")}return se(t),e},toWireType(t,e){var r;e instanceof ArrayBuffer&&(e=new Uint8Array(e));var o="string"==typeof e;o||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||ht("Cannot pass non-string to std::string"),r=n&&o?(t=>{for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);r<=127?e++:r<=2047?e+=2:r>=55296&&r<=57343?(e+=4,++n):e+=3}return e})(e):e.length;var i=ae(4+r+1),a=i+4;if(v[i>>2]=r,n&&o)Lt(e,a,r+1);else if(o)for(var s=0;s<r;++s){var l=e.charCodeAt(s);l>255&&(se(a),ht("String has UTF-16 code units that do not fit in 8 bits")),p[a+s]=l}else for(s=0;s<r;++s)p[a+s]=e[s];return null!==t&&t.push(se,i),i},argPackAdvance:8,readValueFromPointer:kt,destructorFunction(t){se(t)}})},_embind_register_std_wstring:(t,e,n)=>{var r,o,i,a,s;n=lt(n),2===e?(r=Ut,o=jt,a=Ht,i=()=>m,s=1):4===e&&(r=zt,o=Wt,a=Vt,i=()=>v,s=2),pt(t,{name:n,fromWireType:t=>{for(var n,o=v[t>>2],a=i(),l=t+4,c=0;c<=o;++c){var u=t+4+c*e;if(c==o||0==a[u>>s]){var f=r(l,u-l);void 0===n?n=f:(n+=String.fromCharCode(0),n+=f),l=u+e}}return se(t),n},toWireType:(t,r)=>{"string"!=typeof r&&ht(`Cannot pass non-string to C++ string type ${n}`);var i=a(r),l=ae(4+i+e);return v[l>>2]=i>>s,o(r,l+4,i+e),null!==t&&t.push(se,l),l},argPackAdvance:8,readValueFromPointer:wt,destructorFunction(t){se(t)}})},_embind_register_void:(t,e)=>{pt(t,{isVoid:!0,name:e=lt(e),argPackAdvance:0,fromWireType:()=>{},toWireType:(t,e)=>{}})},_emscripten_get_now_is_monotonic:()=>1,_emval_as:(t,e,n)=>(t=bt(t),e=$t(e,"emval::as"),Yt(e,n,t)),_emval_call:(t,e,n,r)=>(t=Xt[t])(null,e=bt(e),n,r),_emval_call_method:(t,e,n,r,o)=>(t=Xt[t])(e=bt(e),e[n=Zt(n)],r,o),_emval_decref:gt,_emval_get_method_caller:qt,_emval_get_module_property:t=>(t=Zt(t),yt(o[t])),_emval_get_property:(t,e)=>(t=bt(t),e=bt(e),yt(t[e])),_emval_incref:t=>{t>4&&(mt.get(t).refcount+=1)},_emval_new_array:()=>yt([]),_emval_new_cstring:t=>yt(Zt(t)),_emval_new_object:()=>yt({}),_emval_run_destructors:t=>{var e=bt(t);At(e),gt(t)},_emval_set_property:(t,e,n)=>{t=bt(t),e=bt(e),n=bt(n),t[e]=n},_emval_take_value:(t,e)=>{var n=(t=$t(t,"_emval_take_value")).readValueFromPointer(e);return yt(n)},abort:()=>{C("native code called abort()")},emscripten_date_now:()=>Date.now(),emscripten_get_now:Gt,emscripten_memcpy_js:(t,e,n)=>p.copyWithin(t,e,e+n),emscripten_resize_heap:t=>{var e=p.length;x((t>>>=0)>e);var n=2147483648;if(t>n)return h(`Cannot enlarge memory, requested ${t} bytes, but the limit is 2147483648 bytes!`),!1;for(var r,o=1;o<=4;o*=2){var i=e*(1+.2/o);i=Math.min(i,t+100663296);var a=Math.min(n,(r=Math.max(t,i))+(65536-r%65536)%65536);if(Kt(a))return!0}return h(`Failed to grow the heap from ${e} bytes to ${a} bytes, not enough memory!`),!1},fd_close:t=>{C("fd_close called without SYSCALLS_REQUIRE_FILESYSTEM")},fd_seek:function(t,e,n,r,o){return a=n,x((i=e)==i>>>0||i==(0|i)),x(a===(0|a)),70;var i,a},fd_write:(t,e,n,r)=>{for(var o=0,i=0;i<n;i++){var a=v[e>>2],s=v[e+4>>2];e+=8;for(var l=0;l<s;l++)c=t,u=p[a+l],d=void 0,x(d=ne[c]),0===u||10===u?((1===c?f:h)(J(d,0)),d.length=0):d.push(u);o+=s}var c,u,d;return v[r>>2]=o,0},invoke_ii:function(t,e){var n=he();try{return It(t)(e)}catch(t){if(de(n),!(t instanceof D))throw t;le(1,0)}},invoke_iii:function(t,e,n){var r=he();try{return It(t)(e,n)}catch(t){if(de(r),!(t instanceof D))throw t;le(1,0)}},invoke_iiii:function(t,e,n,r){var o=he();try{return It(t)(e,n,r)}catch(t){if(de(o),!(t instanceof D))throw t;le(1,0)}},invoke_j:function(t){var e=he();try{return be(t)}catch(t){if(de(e),!(t instanceof D))throw t;le(1,0)}},invoke_v:function(t){var e=he();try{It(t)()}catch(t){if(de(e),!(t instanceof D))throw t;le(1,0)}},invoke_vi:function(t,e){var n=he();try{It(t)(e)}catch(t){if(de(n),!(t instanceof D))throw t;le(1,0)}},invoke_vii:function(t,e,n){var r=he();try{It(t)(e,n)}catch(t){if(de(r),!(t instanceof D))throw t;le(1,0)}},invoke_viii:function(t,e,n,r){var o=he();try{It(t)(e,n,r)}catch(t){if(de(o),!(t instanceof D))throw t;le(1,0)}},invoke_viiii:function(t,e,n,r,o){var i=he();try{It(t)(e,n,r,o)}catch(t){if(de(i),!(t instanceof D))throw t;le(1,0)}}},oe=function(){var t,e={env:re,wasi_snapshot_preview1:re};function n(t,e){return oe=t.exports,x(c=oe.memory,"memory not found in wasm exports"),T(),x(Rt=oe.__indirect_function_table,"table not found in wasm exports"),n=oe.__wasm_call_ctors,S.unshift(n),function(t){if(M--,o.monitorRunDependencies&&o.monitorRunDependencies(M),t?(x(O[t]),delete O[t]):h("warning: run dependency removed without ID"),0==M&&(null!==P&&(clearInterval(P),P=null),I)){var e=I;I=null,e()}}("wasm-instantiate"),oe;var n}t="wasm-instantiate",M++,o.monitorRunDependencies&&o.monitorRunDependencies(M),t?(x(!O[t]),O[t]=1,null===P&&"undefined"!=typeof setInterval&&(P=setInterval((()=>{if(w)return clearInterval(P),void(P=null);var t=!1;for(var e in O)t||(t=!0,h("still waiting on run dependencies:")),h(`dependency: ${e}`);t&&h("(end of list)")}),1e4))):h("warning: run dependency added without ID");var i,a,s,u,f=o;if(o.instantiateWasm)try{return o.instantiateWasm(e,n)}catch(t){h(`Module.instantiateWasm callback failed with error: ${t}`),r(t)}return(i=l,a=B,s=e,u=function(t){x(o===f,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),f=null,n(t.instance)},i||"function"!=typeof WebAssembly.instantiateStreaming||G(a)||"function"!=typeof fetch?H(a,s,u):fetch(a,{credentials:"same-origin"}).then((t=>WebAssembly.instantiateStreaming(t,s).then(u,(function(t){return h(`wasm streaming compile failed: ${t}`),h("falling back to ArrayBuffer instantiation"),H(a,s,u)}))))).catch(r),{}}(),ie=(L("__wasm_call_ctors"),L("__getTypeName")),ae=(L("__errno_location"),o._fflush=L("fflush"),L("malloc")),se=o._free=L("free"),le=L("setThrew"),ce=L("setTempRet0"),ue=()=>(ue=oe.emscripten_stack_init)(),fe=()=>(fe=oe.emscripten_stack_get_end)(),he=L("stackSave"),de=L("stackRestore"),pe=L("stackAlloc"),_e=(L("__cxa_free_exception"),L("__cxa_increment_exception_refcount")),me=(L("__cxa_decrement_exception_refcount"),o.___get_exception_message=L("__get_exception_message")),ge=L("__cxa_can_catch"),ve=L("__cxa_is_pointer_type"),be=o.dynCall_j=L("dynCall_j");o.dynCall_jiji=L("dynCall_jiji");["writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertU32PairToI53","zeroMemory","exitJS","isLeapYear","ydayFromDate","arraySum","addDays","setErrNo","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","getHostByName","initRandomFill","randomFill","getCallstack","emscriptenLog","convertPCtoSourceLocation","readEmAsmArgs","jstoi_q","jstoi_s","getExecutableName","listenOnce","autoResumeAudioContext","handleException","keepRuntimeAlive","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","asmjsMangle","asyncLoad","alignMemory","mmapAlloc","getNativeTypeSize","STACK_SIZE","STACK_ALIGN","POINTER_SIZE","ASSERTIONS","getCFunc","ccall","cwrap","uleb128Encode","sigToWasmTypes","generateFuncType","convertJsFunctionToWasm","getEmptyTableSlot","updateTableMap","getFunctionAddress","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","intArrayFromString","intArrayToString","AsciiToString","stringToAscii","stringToNewUTF8","stringToUTF8OnStack","writeArrayToMemory","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","findCanvasEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","demangle","demangleAll","jsStackTrace","stackTrace","getEnvStrings","checkWasiClock","wasiRightsToMuslOFlags","wasiOFlagsToMuslOFlags","createDyncallWrapper","safeSetTimeout","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","getPromise","makePromise","idsToPromises","makePromiseCallback","setMainLoop","getSocketFromFD","getSocketAddress","FS_createPreloadedFile","FS_modeStringToFlags","FS_getMode","FS_stdin_getChar","FS_createDataFile","FS_unlink","FS_mkdirTree","_setNetworkCallback","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","webgl_enable_ANGLE_instanced_arrays","webgl_enable_OES_vertex_array_object","webgl_enable_WEBGL_draw_buffers","webgl_enable_WEBGL_multi_draw","emscriptenWebGLGet","computeUnpackAlignedImageSize","colorChannelsInGlTextureFormat","emscriptenWebGLGetTexPixelData","__glGenObject","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","__glGetActiveAttribOrUniform","writeGLArray","registerWebGlEventCallback","runAndAbortIfError","SDL_unicode","SDL_ttfContext","SDL_audio","ALLOC_NORMAL","ALLOC_STACK","allocate","writeStringToMemory","writeAsciiToMemory","getFunctionArgsName","init_embind","getBasestPointer","registerInheritedInstance","unregisterInheritedInstance","getInheritedInstance","getInheritedInstanceCount","getLiveInheritedInstances","enumReadValueFromPointer","genericPointerToWireType","constNoSmartPtrRawPointerToWireType","nonConstNoSmartPtrRawPointerToWireType","init_RegisteredPointer","RegisteredPointer","RegisteredPointer_fromWireType","runDestructor","releaseClassHandle","detachFinalizer","attachFinalizer","makeClassHandle","init_ClassHandle","ClassHandle","throwInstanceAlreadyDeleted","flushPendingDeletes","setDelayFunction","RegisteredClass","shallowCopyInternalPointer","downcastPointer","upcastPointer","validateThis","char_0","char_9","makeLegalFunctionName","emval_get_global"].forEach((function(t){"undefined"==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get(){var e=`\`${t}\` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line`,n=t;n.startsWith("_")||(n="$"+t),e+=` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${n}')`,W(t)&&(e+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),tt(e)}}),$(t)}));var ye;function we(){var t;ue(),x(0==(3&(t=fe()))),0==t&&(t+=4),v[t>>2]=34821223,v[t+4>>2]=2310721022,v[0]=1668509029}function xe(){function t(){ye||(ye=!0,o.calledRun=!0,w||(x(!F),F=!0,E(),Y(S),n(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),x(!o._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(E(),o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)t=o.postRun.shift(),R.unshift(t);var t;Y(R)}()))}M>0||(we(),function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)t=o.preRun.shift(),A.unshift(t);var t;Y(A)}(),M>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),t()}),1)):t(),E()))}if(["run","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","addRunDependency","removeRunDependency","FS_createFolder","FS_createPath","FS_createLazyFile","FS_createLink","FS_createDevice","FS_readFile","out","err","callMain","abort","wasmMemory","wasmExports","stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0","writeStackCookie","checkStackCookie","convertI32PairToI53Checked","ptrToString","getHeapMax","growMemory","ENV","MONTH_DAYS_REGULAR","MONTH_DAYS_LEAP","MONTH_DAYS_REGULAR_CUMULATIVE","MONTH_DAYS_LEAP_CUMULATIVE","ERRNO_CODES","ERRNO_MESSAGES","DNS","Protocols","Sockets","timers","warnOnce","UNWIND_CACHE","readEmAsmArgsArray","dynCallLegacy","getDynCaller","dynCall","handleAllocatorInit","HandleAllocator","wasmTable","noExitRuntime","freeTableIndexes","functionsInTableMap","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","UTF16Decoder","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","JSEvents","specialHTMLTargets","currentFullscreenStrategy","restoreOldWindowedStyle","ExitStatus","flush_NO_FILESYSTEM","promiseMap","uncaughtExceptionCount","exceptionLast","exceptionCaught","ExceptionInfo","findMatchingCatch","getExceptionMessageCommon","incrementExceptionRefcount","decrementExceptionRefcount","getExceptionMessage","Browser","wget","SYSCALLS","preloadPlugins","FS_stdin_getChar_buffer","FS","MEMFS","TTY","PIPEFS","SOCKFS","tempFixedLengthArray","miniTempWebGLFloatBuffers","miniTempWebGLIntBuffers","GL","emscripten_webgl_power_preferences","AL","GLUT","EGL","GLEW","IDBStore","SDL","SDL_gfx","allocateUTF8","allocateUTF8OnStack","InternalError","BindingError","throwInternalError","throwBindingError","registeredTypes","awaitingDependencies","typeDependencies","tupleRegistrations","structRegistrations","sharedRegisterType","whenDependentTypesAreResolved","embind_charCodes","embind_init_charCodes","readLatin1String","getTypeName","getFunctionName","heap32VectorToArray","requireRegisteredType","UnboundTypeError","PureVirtualError","GenericWireTypeSize","throwUnboundTypeError","ensureOverloadTable","exposePublicSymbol","replacePublicSymbol","extendError","createNamedFunction","embindRepr","registeredInstances","registeredPointers","registerType","integerReadValueFromPointer","floatReadValueFromPointer","simpleReadValueFromPointer","readPointer","runDestructors","newFunc","craftInvokerFunction","embind__requireFunction","finalizationRegistry","detachFinalizer_deps","deletionQueue","delayFunction","emval_handles","emval_symbols","init_emval","count_emval_handles","getStringOrSymbol","Emval","emval_returnValue","emval_lookupTypes","emval_methodCallers","emval_addMethodCaller","reflectConstruct"].forEach($),I=function t(){ye||xe(),ye||(I=t)},o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();return xe(),t.ready});t.exports=n}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.m=t,n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.u=t=>t+".autumnplot-gl.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;n.g.importScripts&&(t=n.g.location+"");var e=n.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");r.length&&(t=r[r.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=t})(),n.b=document.baseURI||self.location.href;var r={};return(()=>{"use strict";n.r(r),n.d(r,{Barbs:()=>Er,Color:()=>yn,ColorMap:()=>Tn,Contour:()=>ir,ContourFill:()=>pr,ContourLabels:()=>or,Grid:()=>_o,Hodographs:()=>jr,LambertGrid:()=>vo,MultiPlotLayer:()=>Vr,Paintball:()=>Cr,PlateCarreeGrid:()=>mo,PlateCarreeRotatedGrid:()=>go,PlotComponent:()=>F,PlotLayer:()=>Wr,Raster:()=>dr,RawProfileField:()=>co,RawScalarField:()=>so,RawVectorField:()=>lo,colormaps:()=>bo,initAutumnPlot:()=>yo,makeColorBar:()=>Xr,makePaintballKey:()=>Jr});const t=Symbol("Comlink.proxy"),e=Symbol("Comlink.endpoint"),o=Symbol("Comlink.releaseProxy"),i=Symbol("Comlink.thrown"),a=t=>"object"==typeof t&&null!==t||"function"==typeof t,s=new Map([["proxy",{canHandle:e=>a(e)&&e[t],serialize(t){const{port1:e,port2:n}=new MessageChannel;return l(t,e),[n,[n]]},deserialize:t=>(t.start(),u(t))}],["throw",{canHandle:t=>a(t)&&i in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function l(e,n=self){n.addEventListener("message",(function r(o){if(!o||!o.data)return;const{id:a,type:s,path:u}=Object.assign({path:[]},o.data),f=(o.data.argumentList||[]).map(m);let h;try{const n=u.slice(0,-1).reduce(((t,e)=>t[e]),e),r=u.reduce(((t,e)=>t[e]),e);switch(s){case"GET":h=r;break;case"SET":n[u.slice(-1)[0]]=m(o.data.value),h=!0;break;case"APPLY":h=r.apply(n,f);break;case"CONSTRUCT":h=function(e){return Object.assign(e,{[t]:!0})}(new r(...f));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;l(e,n),h=function(t,e){return p.set(t,e),t}(t,[t])}break;case"RELEASE":h=void 0;break;default:return}}catch(t){h={value:t,[i]:0}}Promise.resolve(h).catch((t=>({value:t,[i]:0}))).then((t=>{const[e,o]=_(t);n.postMessage(Object.assign(Object.assign({},e),{id:a}),o),"RELEASE"===s&&(n.removeEventListener("message",r),c(n))}))})),n.start&&n.start()}function c(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function u(t,e){return h(t,[],e)}function f(t){if(t)throw new Error("Proxy has been released and is not useable")}function h(t,n=[],r=function(){}){let i=!1;const a=new Proxy(r,{get(e,r){if(f(i),r===o)return()=>g(t,{type:"RELEASE",path:n.map((t=>t.toString()))}).then((()=>{c(t),i=!0}));if("then"===r){if(0===n.length)return{then:()=>a};const e=g(t,{type:"GET",path:n.map((t=>t.toString()))}).then(m);return e.then.bind(e)}return h(t,[...n,r])},set(e,r,o){f(i);const[a,s]=_(o);return g(t,{type:"SET",path:[...n,r].map((t=>t.toString())),value:a},s).then(m)},apply(r,o,a){f(i);const s=n[n.length-1];if(s===e)return g(t,{type:"ENDPOINT"}).then(m);if("bind"===s)return h(t,n.slice(0,-1));const[l,c]=d(a);return g(t,{type:"APPLY",path:n.map((t=>t.toString())),argumentList:l},c).then(m)},construct(e,r){f(i);const[o,a]=d(r);return g(t,{type:"CONSTRUCT",path:n.map((t=>t.toString())),argumentList:o},a).then(m)}});return a}function d(t){const e=t.map(_);return[e.map((t=>t[0])),(n=e.map((t=>t[1])),Array.prototype.concat.apply([],n))];var n}const p=new WeakMap;function _(t){for(const[e,n]of s)if(n.canHandle(t)){const[r,o]=n.serialize(t);return[{type:"HANDLER",name:e,value:r},o]}return[{type:"RAW",value:t},p.get(t)||[]]}function m(t){switch(t.type){case"HANDLER":return s.get(t.name).deserialize(t.value);case"RAW":return t.value}}function g(t,e,n){return new Promise((r=>{const o=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");t.addEventListener("message",(function e(n){n.data&&n.data.id&&n.data.id===o&&(t.removeEventListener("message",e),r(n.data))})),t.start&&t.start(),t.postMessage(Object.assign({id:o},e),n)}))}var v=function(){return v=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},v.apply(this,arguments)},b=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},y=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},w=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))};function x(t,e,n){for(var r=1,o=n;t%o!=0||e%o!=0;)r+=1,o/=2;return r}function T(){var t,e,n,r=[];for(t=0;t<arguments.length;t++)r[t]=arguments[t];return b(this,(function(t){switch(t.label){case 0:e=r.map((function(t){return t[Symbol.iterator]()})),t.label=1;case 1:return(n=e.map((function(t){return t.next()}))).some((function(t){return t.done}))?[3,3]:[4,n.map((function(t){return t.value}))];case 2:return t.sent(),[3,1];case 3:return[2]}}))}var E=function(){function t(t,e){this.cached_values={},this.compute_value=t,this.make_key=void 0===e?function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return JSON.stringify(t)}:e}return t.prototype.getValue=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.make_key.apply(this,w([],y(t),!1));return n in this.cached_values||(this.cached_values[n]=this.compute_value.apply(this,w([],y(t),!1))),this.cached_values[n]},t}();function A(t,e){var n=v({},e);return void 0!==t&&Object.entries(t).forEach((function(t){var e=y(t,2),r=e[0],o=e[1];n[r]=o})),n}function S(t){return t.getParameter(t.VERSION).includes("WebGL 2.0")}var R=u(new Worker(new URL(n.p+n.u(110),n.b))),F=function(){};function M(t,e){var n,r,o,i,a,s,l,c=S(t);if(e){var u=t.getExtension("OES_texture_half_float"),f=t.getExtension("OES_texture_half_float_linear");if(c)n=t.R16F,r=t.HALF_FLOAT;else{if(null===u||null===f)throw"Float16 data are not supported on this hardware. Try Float32 data instead.";n=t.LUMINANCE,r=u.HALF_FLOAT_OES}o=2}else{if(u=t.getExtension("OES_texture_float"),f=t.getExtension("OES_texture_float_linear"),!c&&null===u||!c&&null===f||"iOS"===(i=window.navigator.userAgent,a=window.navigator.platform,l=null,-1!==(s=["Macintosh","MacIntel","MacPPC","Mac68K"]).indexOf(a)&&navigator.maxTouchPoints<=1?l="Mac OS":-1!==["iPhone","iPad","iPod"].indexOf(a)||-1!==s.indexOf(a)&&navigator.maxTouchPoints>1?l="iOS":-1!==["Win32","Win64","Windows","WinCE"].indexOf(a)?l="Windows":/Android/.test(i)?l="Android":/Linux/.test(a)&&(l="Linux"),l))throw"Float32 data are not supported on this hardware. Try Float16 data instead.";n=c?t.R32F:t.LUMINANCE,r=t.FLOAT,o=4}return{format:n,type:r,row_alignment:o}}function P(t){var e,n,r=function(t){var e=Math.sin(t);return Math.tan(Math.PI/4-t/2)*Math.pow((1+a*e)/(1-a*e),a/2)},o=function(t){var e=Math.sin(t);return Math.cos(t)/Math.sqrt(1-a*a*e*e)},i=6378137,a=Math.sqrt(.006694379990197619),s=Math.PI/180,l=t.lon_0,c=t.lat_0,u=t.lat_std;u=Array.isArray(u)&&u[0]==u[1]?u[0]:u,l*=s;var f=r(c*=s);if(Array.isArray(u)){var h=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}(u,2),d=h[0],p=h[1];p*=s;var _=r(d*=s),m=r(p),g=o(d),v=o(p);n=Math.log(g/v)/Math.log(_/m),e=g/(n*Math.pow(_,n))}else d=u,_=r(d*=s),g=o(d),n=Math.sin(d),e=g/(n*Math.pow(_,n));var b=i*e*Math.pow(f,n),y=a*a,w=y*y,x=w*y,T=x*y,E=y/2+5*w/24+3*x/120-73*T/2016,A=7*w/24+29*x/120+233*T/6720,S=7*x/30+81*T/280,R=4729*T/20160;return function(t,o,a){return(a=void 0===a?{inverse:!1}:a).inverse?(c=t,u=o,f=Math.atan2(c,b-u)/n+l,h=Math.hypot(c,b-u)*Math.sign(n),d=Math.pow(h/(i*e),1/n),p=Math.PI/2-2*Math.atan(d),_=Math.sin(2*p),m=Math.cos(2*p),[f/s,(p+_*(E+m*(A+m*(S+R*m))))/s]):function(t,o){t*=s;var a=r(o*=s),c=i*e*Math.pow(a,n),u=n*(t-l);return[c*Math.sin(u),b-c*Math.cos(u)]}(t,o);var c,u,f,h,d,p,_,m}}var I=function(){function t(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: (".concat(t,", ").concat(e,")"));if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}return t.prototype.toMercatorCoord=function(){return{x:(r=this.lng,(180+r)/360),y:(t=this.lat,e=Math.sin(t*Math.PI/180),n=(180-90/Math.PI*Math.log((1+e)/(1-e)))/360,Math.min(2,Math.max(-2,n)))};var t,e,n,r},t.fromMercatorCoord=function(e,n){return new t(function(t){return 360*t-180}(e),function(t){return 180*Math.atan(Math.sinh((180-360*t)*Math.PI/180))/Math.PI}(n))},t}();class O{constructor(t,e,n,r,o){this.gl=t,this.n_coords_per_vert=n,this.dtype=((t,e)=>({Float32Array:t.FLOAT,Uint8Array:t.UNSIGNED_BYTE,Uint16Array:t.UNSIGNED_SHORT,Uint32Array:t.UNSIGNED_INT}[e.constructor.name]))(t,e),this.n_verts=e.length/n,this.draw_mode=r;const i=t.createBuffer();if(null===i)throw"Could not create WebGL buffer";this.buffer=i,t.bindBuffer(o,this.buffer),t.bufferData(o,e,t.STATIC_DRAW)}}class C extends O{constructor(t,e,n,r){super(t,e,n,r,t.ARRAY_BUFFER)}bindToProgram(t){this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.buffer),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(t,this.n_coords_per_vert,this.dtype,!1,0,0)}}function N(t){return t.getParameter(t.VERSION).includes("WebGL 2.0")}class B{constructor(t,e){this.gl=t;const n=t.createTexture();if(null===n)throw"Could not create WebGL texture";this.texture=n,this.tex_num=null,this.setImageData(e);const r=void 0===e.mag_filter?t.LINEAR:e.mag_filter;t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,r)}setImageData(t){const e=this.gl;e.bindTexture(e.TEXTURE_2D,this.texture);const n=N(e)?function(t,e,n){switch(n){case t.UNSIGNED_BYTE:switch(e){case t.RGBA8:case t.RGB5_A1:case t.RGBA4:case t.SRGB8_ALPHA8:return t.RGBA;case t.RGBA8UI:return t.RGBA_INTEGER;case t.RGB8:case t.RGB565:case t.SRGB8:return t.RGB;case t.RGB8UI:return t.RGB_INTEGER;case t.RG8:return t.RG;case t.RG8UI:return t.RG_INTEGER;case t.R8:return t.RED;case t.R8UI:return t.RED_INTEGER;case t.RGBA:return t.RGBA;case t.RGB:return t.RGB;case t.LUMINANCE_ALPHA:return t.LUMINANCE_ALPHA;case t.LUMINANCE:return t.LUMINANCE;case t.ALPHA:return t.ALPHA}break;case t.BYTE:switch(e){case t.RGBA8_SNORM:return t.RGBA;case t.RGBA8I:return t.RGBA_INTEGER;case t.RGB8_SNORM:return t.RGB;case t.RGB8I:return t.RGB_INTEGER;case t.RG8_SNORM:return t.RG;case t.RG8I:return t.RG_INTEGER;case t.R8_SNORM:return t.RED;case t.R8I:return t.RED_INTEGER}break;case t.UNSIGNED_SHORT_4_4_4_4:switch(e){case t.RGBA4:case t.RGBA:return t.RGBA}break;case t.UNSIGNED_SHORT_5_5_5_1:switch(e){case t.RGB5_A1:case t.RGBA:return t.RGBA}break;case t.UNSIGNED_INT_2_10_10_10_REV:switch(e){case t.RGB10_A2:case t.RGB5_A1:return t.RGBA;case t.RGB10_A2UI:return t.RGBA_INTEGER}break;case t.HALF_FLOAT:switch(e){case t.RGBA16F:return t.RGBA;case t.RGB16F:case t.R11F_G11F_B10F:case t.RGB9_E5:return t.RGB;case t.RG16F:return t.RG;case t.R16F:return t.RED}break;case t.FLOAT:switch(e){case t.RGBA32F:case t.RGBA16F:return t.RGBA;case t.RGB32F:case t.RGB16F:case t.R11F_G11F_B10F:case t.RGB9_E5:return t.RGB;case t.RG32F:case t.RG16F:return t.RG;case t.R32F:case t.R16F:return t.RED;case t.DEPTH_COMPONENT32F:return t.DEPTH_COMPONENT}break;case t.UNSIGNED_SHORT:switch(e){case t.RGBA16UI:return t.RGBA_INTEGER;case t.RGB16UI:return t.RGB_INTEGER;case t.RG16UI:return t.RG_INTEGER;case t.R16UI:return t.RED_INTEGER;case t.DEPTH_COMPONENT16:return t.DEPTH_COMPONENT}break;case t.SHORT:switch(e){case t.RGBA16I:return t.RGBA_INTEGER;case t.RGB16I:return t.RGB_INTEGER;case t.RG16I:return t.RG_INTEGER;case t.R16I:return t.RED_INTEGER}break;case t.UNSIGNED_INT:switch(e){case t.RGBA32UI:return t.RGBA_INTEGER;case t.RGB32UI:return t.RGB_INTEGER;case t.RG32UI:return t.RG_INTEGER;case t.R32UI:return t.RED_INTEGER;case t.DEPTH_COMPONENT24:case t.DEPTH_COMPONENT16:return t.DEPTH_COMPONENT}break;case t.INT:switch(e){case t.RGBA32I:return t.RGBA_INTEGER;case t.RGB32I:return t.RGB_INTEGER;case t.RG32I:return t.RG_INTEGER;case t.R32I:return t.RED_INTEGER}break;case t.UNSIGNED_SHORT_5_6_5:switch(e){case t.RGB565:case t.RGB:return t.RGB}break;case t.UNSIGNED_INT_10F_11F_11F_REV:if(e===t.R11F_G11F_B10F)return t.RGB;break;case t.UNSIGNED_INT_5_9_9_9_REV:if(e===t.RGB9_E5)return t.RGB;break;case t.UNSIGNED_INT_24_8:if(e===t.DEPTH24_STENCIL8)return t.DEPTH_STENCIL;break;case t.FLOAT_32_UNSIGNED_INT_24_8_REV:if(e===t.DEPTH32F_STENCIL8)return t.DEPTH_STENCIL;break;default:throw"Unknown format in getWebGL2InternalFormat"}throw"Invalid combination of internal format and data type"}(e,t.format,t.type):t.format,r=void 0===t.row_alignment?4:t.row_alignment;e.pixelStorei(e.UNPACK_ALIGNMENT,r),void 0!==t.width&&void 0!==t.height?e.texImage2D(e.TEXTURE_2D,0,t.format,t.width,t.height,0,n,t.type,t.image):e.texImage2D(e.TEXTURE_2D,0,t.format,n,t.type,t.image)}bindToProgram(t,e){this.activate(e),this.gl.uniform1i(t,e)}activate(t){this.tex_num=t,this.gl.activeTexture(this.gl.TEXTURE0+this.tex_num),this.gl.bindTexture(this.gl.TEXTURE_2D,this.texture)}deactivate(){null!==this.tex_num&&(this.gl.activeTexture(this.gl.TEXTURE0+this.tex_num),this.gl.bindTexture(this.gl.TEXTURE_2D,null),this.tex_num=null)}delete(){this.gl.deleteTexture(this.texture),this.tex_num=null}}function k(t,e){const n=void 0===(e=void 0===e?{}:e).define?[]:[...e.define],r=[],o={},i=t.split("\n").map((t=>{const e=t.match(/#define\s+([\w\d_]+)/i);null!==e&&n.push(e[1]);const i=t.match(/#ifdef\s+([\w\d_]+)/i);if(null!==i)return r.push(i[1]),o[i[1]]=!0,"";const a=t.match(/#ifndef\s+([\w\d_]+)/i);if(null!==a)return r.push(a[1]),o[a[1]]=!1,"";if(null!==t.match(/#else/i)){const t=r[r.length-1];return o[t]=!o[t],""}if(null!==t.match(/#endif/i)){const t=r.pop();return o[t]=void 0,""}return r.map((t=>n.includes(t)==o[t])).reduce(((t,e)=>t&&e),!0)?t:""})).join("\n");if(r.length>0)throw"Unterminated #ifdef/#ifndef block in shader";return i}class G{constructor(t,e,n,r){e=k(e,r),n=k(n,r),this.gl=t,this.prog=((t,e,n)=>{const r=t.createShader(t.VERTEX_SHADER);if(null===r)throw"Could not create vertex shader";if(t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){const e=t.getShaderInfoLog(r);console.log("Vertex shader compiler log: "+e)}const o=t.createShader(t.FRAGMENT_SHADER);if(null===o)throw"Could not create fragment shader";if(t.shaderSource(o,n),t.compileShader(o),!t.getShaderParameter(o,t.COMPILE_STATUS)){const e=t.getShaderInfoLog(o);console.log("Fragment shader compiler log: "+e)}const i=t.createProgram();if(null===i)throw"Could not create shader program";if(t.attachShader(i,r),t.attachShader(i,o),t.linkProgram(i),!t.getProgramParameter(i,t.LINK_STATUS)){const e=t.getProgramInfoLog(i);console.log("Linker log: "+e)}return i})(t,e,n),this.attributes={},this.uniforms={},this.n_verts=null,this.draw_mode=null,this.index_buffer=null,this.sampler_names=[];const o=t=>{const e=t.indexOf("//");return e>=0&&(t=t.slice(0,e)),t};e=e.split("\n").map(o).join("\n"),n=n.split("\n").map(o).join("\n");const i=N(this.gl);if(!i&&(e.includes("#version 300 es")||n.includes("#version 300 es")))throw"WebGL2 context required for shader source containing '#version 300 es'";let a=i?/\b(?:in|attribute)+([\w ]+?) +([\w_]+);[\s]*$/gm:/attribute +([\w ]+?) +([\w_]+);[\s]*$/gm;for(const n of e.matchAll(a)){const[e,r,o]=n;this.attributes[o]={type:r,location:t.getAttribLocation(this.prog,o)}}for(const n of e.matchAll(/uniform +([\w ]+?) +([\w_]+)(?:[\s]*\[.*\])?;[\s]*$/gm)){const[e,r,o]=n,i=r.split(" "),a=t.getUniformLocation(this.prog,o);if(null===a)throw`Could not get vertex shader uniform location for '${o}'`;this.uniforms[o]={type:i[i.length-1],location:a}}for(const e of n.matchAll(/uniform +([\w ]+?) +([\w_]+)(?:[\s]*\[.*\])?;[\s]*$/gm)){const[n,r,o]=e,i=r.split(" "),a=t.getUniformLocation(this.prog,o);if(null===a)throw`Could not get fragment shader uniform location for '${o}'`;this.uniforms[o]={type:i[i.length-1],location:a}}Object.entries(this.uniforms).forEach((([t,e])=>{"sampler2d"==e.type.toLowerCase()&&this.sampler_names.push(t)}))}use(t,e,n,r){this.gl.useProgram(this.prog),void 0!==r?(r.bind(),this.index_buffer=r):this.index_buffer=null,this.draw_mode=null,this.n_verts=null,void 0!==t&&this.bindAttributes(t),void 0!==e&&this.setUniforms(e),void 0!==n&&this.bindTextures(n)}bindAttributes(t){Object.entries(t).forEach((([t,e])=>{if(void 0===this.attributes[t])return void console.warn(`Skipping attribute buffer provided for '${t}' because the attribute was not found in the program.`);if(this.n_verts=null===this.n_verts?e.n_verts:this.n_verts,this.draw_mode=null===this.draw_mode?e.draw_mode:this.draw_mode,this.draw_mode!=e.draw_mode)throw`Unexpected draw mode for attribute buffer ${t} (expected ${this.draw_mode}, got ${e.draw_mode}).`;if(this.n_verts!=e.n_verts)throw`Unexpected number of vertices for attribute buffer ${t} (expected ${this.n_verts}, got ${e.n_verts}).`;const{type:n,location:r}=this.attributes[t];e.bindToProgram(r)}))}setUniforms(t){Object.entries(t).forEach((([t,e])=>{if(void 0===this.uniforms[t])return void console.warn(`Skipping uniform value provided for '${t}' because the uniform was not found in the program.`);const{type:n,location:r}=this.uniforms[t];if("int"===n&&"number"==typeof e)this.gl.uniform1i(r,e);else if("float"===n&&"number"==typeof e)this.gl.uniform1f(r,e);else if("float"===n&&e instanceof Array)this.gl.uniform1fv(r,e);else if("vec2"===n&&e instanceof Array)this.gl.uniform2fv(r,e);else if("vec3"===n&&e instanceof Array)this.gl.uniform3fv(r,e);else if("vec4"===n&&e instanceof Array)this.gl.uniform4fv(r,e);else{if(!("mat4"===n&&e instanceof Array))throw`Could not figure out uniform function for type '${n}' and value '${String(e)}'`;this.gl.uniformMatrix4fv(r,!1,e)}}))}bindTextures(t){Object.entries(t).forEach((([t,e])=>{if(void 0===this.uniforms[t])return void console.warn(`Skipping texture provided for sampler '${t}' because the sampler was not found in the program.`);const n=this.sampler_names.indexOf(t),{type:r,location:o}=this.uniforms[t];e.bindToProgram(o,n)}))}draw(){if(null===this.draw_mode||null===this.n_verts)throw"Cannot draw without binding attribute buffers";null===this.index_buffer?this.gl.drawArrays(this.draw_mode,0,this.n_verts):this.gl.drawElements(this.draw_mode,this.index_buffer.n_verts,this.index_buffer.dtype,0)}}class L{constructor(t,e){this.gl=t,this.framebuffer=e}clear(t){const e=this.gl;if(null===e)throw"Register WebGL drawing context using registerGLContext() first";e.clearColor(...t),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer),e.clear(e.COLOR_BUFFER_BIT)}renderTo(t,e,n,r){const o=this.gl;if(null===o)throw"Register WebGL drawing context using registerGLContext() first";o.bindFramebuffer(o.FRAMEBUFFER,this.framebuffer),o.viewport(t,e,n,r)}copyToTexture(t,e,n,r,o){const i=this.gl;if(null===i)throw"Register WebGL drawing context using registerGLContext() first";i.bindFramebuffer(i.FRAMEBUFFER,this.framebuffer),t.activate(0),i.copyTexImage2D(i.TEXTURE_2D,0,i.RGBA,e,n,r,o,0)}}new class extends L{constructor(){super(null,null)}registerGLContext(t){this.gl=t}};const D=JSON.parse('{"levels":[20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140],"colors":["#e6f4ff","#dbf0fe","#d1ebfe","#c6e7fd","#bce3fd","#b1dffc","#a7dbfc","#9cd6fb","#92d2fb","#87cefa","#84c2f6","#81b7f1","#7eabed","#7ba0e8","#7994e4","#7688df","#737ddb","#7071d6","#6d66d2","#6a5acd","#7660cf","#8366d0","#8f6cd2","#9c72d3","#a878d5","#b47ed6","#c184d8","#cd8ad9","#da90db","#e696dc","#e390d9","#e08ad6","#dd84d3","#da7ed0","#d778cd","#d472ca","#d16cc7","#ce66c4","#cb60c1","#c85abe","#c453ba","#c04cb6","#bc45b2","#b83eae","#b437aa","#b030a6","#ac29a2","#a8229e","#a41b9a","#a01496","#a41080","#a80e75","#ac0e75","#b00c6a","#b4085f","#b80649","#bc043e","#c00233","#c80028","#c80028","#ca042a","#cc082c","#d00c2c","#d21432","#d41834","#d41834","#d61c36","#da243a","#dc283c","#de2c3e","#e03040","#e23442","#e43844","#e63c46","#e84048","#ea444a","#ec484c","#ee4c4e","#f05050","#f16052","#f27054","#f38056","#f49058","#f5a05a","#f6b05c","#f7c05e","#f8d060","#f9e062","#faf064","#f7eb61","#f4e65e","#f1e15b","#eedc58","#ebd755","#e8d252","#e5cd4f","#e2c84c","#dfc349","#dcbe46","#d9b943","#d6b440","#d3af3d","#d0aa3a","#cda537","#caa034","#c79b31","#c4962e","#c1912b","#be8c28","#bb8725","#b88222","#b57d1f","#b2781c","#af7319","#ac6e16","#a96913","#a66410","#a35f0d","#a05a0a","#a05a0a"]}'),U=JSON.parse('{"levels":[20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80],"colors":["#f0f8ff","#dbf0fe","#c6e7fd","#b1dffc","#9cd6fb","#87cefa","#81b7f1","#7ba0e8","#7688df","#7071d6","#6a5acd","#8366d0","#9c72d3","#b47ed6","#cd8ad9","#e696dc","#e08ad6","#da7ed0","#d472ca","#ce66c4","#c85abe","#c04cb6","#b83eae","#b030a6","#a8229e","#a01496","#a81080","#b00c6a","#b8043e","#c80028","#c80028","#d01030","#d41834","#d82038","#dc283c","#e03040","#e43844","#e84048","#ec484c","#f05050","#f27054","#f49058","#f6b05c","#f8d060","#faf064","#f4e65e","#eedc58","#e8d252","#e2c84c","#dcbe46","#d6b440","#d0aa3a","#caa034","#c4962e","#be8c28","#b88222","#b2781c","#ac6e16","#a66410","#a05a0a"]}'),j=JSON.parse('{"levels":[0,100,200,300,400,500,600,700,800,900,1000,1100,1200,1300,1400,1500,1600,1700,1800,1900,2000,2100,2200,2300,2400,2500,2600,2700,2800,2900,3000,3100,3200,3300,3400,3500,3600,3700,3800,3900,4000,4100,4200,4300,4400,4500,4600,4700,4800,4900,5000,5100,5200,5300,5400,5500,5600,5700,5800,5900,6000,6500,7000,7500,8000,8500,9000,9500,10000],"colors":["#ffffff","#f0f0f0","#e1e1e1","#d2d2d2","#c3c3c3","#a5a5a5","#969696","#878787","#787878","#696969","#37536a","#436075","#506d80","#5c7a8b","#698796","#7594a2","#82a1ad","#8eaeb8","#9bbbc3","#a7c8ce","#e9dd96","#e8d186","#e7c575","#e6b865","#e5ac54","#e5a044","#e49433","#e38723","#e27b12","#e16f02","#dc4110","#d33b17","#ca351e","#c12e25","#b8282c","#af2234","#a61c3b","#9d1542","#940f49","#8b0950","#73088a","#7e1894","#8a289f","#9538a9","#a148b3","#ac59be","#b869c8","#c379d2","#cf89dd","#da99e7","#e9bec3","#e3b0b7","#dda3ac","#d795a0","#d18894","#ca7a89","#c46d7d","#be5f71","#b85266","#b2445a","#893d48","#8f4752","#96525b","#9c5c65","#a2676f","#a97178","#af7c82","#b6868b"]}'),H=JSON.parse('{"levels":[-60,-59,-58,-57,-56,-55,-54,-53,-52,-51,-50,-49,-48,-47,-46,-45,-44,-43,-42,-41,-40,-39,-38,-37,-36,-35,-34,-33,-32,-31,-30,-29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120],"colors":["#235877","#2a5f7c","#316782","#396e87","#40768c","#477d91","#4e8497","#558c9c","#5d93a1","#649ba6","#6ba2ac","#72a9b1","#79b1b6","#81b8bb","#88c0c1","#8fc7c6","#96cecb","#9dd6d0","#a5ddd6","#ace5db","#b3ece0","#b3ece0","#b1e7df","#b0e1dd","#aedcdc","#add7da","#abd2d9","#aaccd8","#a8c7d6","#a7c2d5","#a5bcd4","#a4b7d2","#a2b2d1","#9fa7ce","#9ea2cd","#9c9dcb","#9c9dcb","#9b97ca","#9992c8","#988dc7","#9688c6","#9582c4","#9278c2","#9073c0","#8f6dbf","#8d68bd","#8c63bc","#8a5dbb","#8958b9","#8753b8","#864eb6","#8448b5","#8343b4","#813eb2","#8038b1","#7e33b0","#7d33ae","#7b29ad","#7a23ab","#781eaa","#a037af","#a443b3","#a74fb7","#ab5cbb","#af68bf","#b374c3","#b680c7","#ba8dcc","#be99d0","#c1a5d4","#c5b1d8","#c9bddc","#cdcae0","#d0d6e4","#d4e2e8","#deecf2","#d1e2ee","#c5d9ea","#b8cfe6","#acc5e3","#9fbbdf","#92b2db","#86a8d7","#799ed3","#6c94cf","#608bcb","#5381c7","#4777c4","#3a6dc0","#2d64bc","#215ab8","#1450b4","#0f4455","#1c4e5a","#2a585f","#376363","#456d68","#52776d","#5f8172","#6d8c77","#7a967c","#88a080","#95aa85","#a3b58a","#b0bf8f","#bdc994","#cbd399","#d8de9d","#e6e8a2","#f3f2a7","#f8eea2","#f0e199","#e8d591","#e1c888","#d9bc80","#d1af77","#c9a36f","#c19666","#ba8a5e","#b27d55","#aa714d","#a26444","#9b583c","#8b3f2b","#833222","#7b261a","#7b261a","#741911","#6c0d09","#640000","#5f0000","#630507","#670a0e","#6c0f15","#70141c","#741824","#781d2b","#7d2232","#812739","#852c40","#73372d","#7a4036","#80493f","#875349","#8e5c52","#94655b","#9b6e64","#a88177","#af8a80","#b69389","#bd9c92","#c3a69c","#caafa5","#d1b8ae","#d7c1b7","#decac0","#e5d4ca","#ebddd3","#f2e6dc","#e8dfd6","#e0d7cf","#d8d0c8","#d0c8c0","#c8c0b9","#c0b9b2","#b7b1ab","#afa9a4","#a7a29c","#9f9a95","#97938e","#8f8b87","#878380","#7f7c78","#777471","#6f6c6a","#666563","#5e5d5c","#565554","#4e4e4d","#464646"]}'),z=JSON.parse('{"levels":[-40,-39,-38,-37,-36,-35,-34,-33,-32,-31,-30,-29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90],"colors":["#986d4d","#966c4c","#946b4c","#926a4b","#90694b","#8e684a","#8c664a","#8a6549","#886448","#866348","#846247","#826147","#806046","#7e5f46","#7c5e45","#7a5d44","#785b44","#765a43","#745943","#725842","#715742","#6f5641","#6d5540","#6b5440","#69533f","#67523f","#65503e","#634f3d","#614e3d","#5f4d3c","#5d4c3c","#5b4b3b","#594a3b","#57493a","#554839","#534739","#514538","#4f4438","#4d4337","#4b4237","#494136","#4d4334","#514738","#564c3c","#5a5041","#5e5545","#625949","#675e4d","#6b6251","#6f6755","#746b5a","#78705e","#7c7462","#807966","#857d6a","#89826f","#8d8673","#928b77","#968f7b","#9a947f","#9e9883","#a39d88","#a7a18c","#aba690","#afaa94","#b8b39c","#b8b39c","#bcb8a1","#c1bca5","#c9c5ad","#c9cab1","#d2ceb6","#d2ceb6","#d6d3ba","#dfdcc2","#e3e0c6","#e7e5ca","#ebe9cf","#f0eed3","#f4f2d7","#e6f5e6","#d7f0d7","#c8eac8","#b9e5b9","#aadfaa","#9bda9b","#8cd48c","#7dcf7d","#6ec96e","#5fc45f","#30ae30","#2ca32c","#279927","#238e23","#1e831e","#1a791a","#156e15","#116311","#0c590c","#084e08","#61a3af","#5896a0","#508992","#477b83","#3e6e74","#366166","#2d5457","#244648","#1c393a","#132c2b","#66669a","#605e94","#59568e","#534e88","#4d4682","#463e7c","#403676","#3a2e70","#33266a","#2d1e64","#724071","#784573","#7d4b75","#835076","#885678","#8e5b7a","#93617c","#99667d","#9e6c7f","#a47181"]}'),W=JSON.parse('{"levels":[-15,-14.53608247,-14.07216495,-13.60824742,-13.1443299,-12.68041237,-12.21649485,-11.75257732,-11.28865979,-10.82474227,-10.36082474,-9.89690722,-9.43298969,-8.96907216,-8.50515464,-8.04123711,-7.57731959,-7.11340206,-6.64948454,-6.18556701,-5.72164948,-5.25773196,-4.79381443,-4.32989691,-3.86597938,-3.40206186,-2.93814433,-2.4742268,-2.01030928,-1.54639175,-1.08247423,-0.6185567,-0.15463918,0.30927835,0.77319588,1.2371134,1.70103093,2.16494845,2.62886598,3.09278351,3.55670103,4.02061856,4.48453608,4.94845361,5.41237113,5.87628866,6.34020619,6.80412371,7.26804124,7.73195876,8.19587629,8.65979381,9.12371134,9.58762887,10.05154639,10.51546392,10.97938144,11.44329897,11.90721649,12.37113402,12.83505155,13.29896907,13.7628866,14.22680412,14.69072165,15.15463918,15.6185567,16.08247423,16.54639175,17.01030928,17.4742268,17.93814433,18.40206186,18.86597938,19.32989691,19.79381443,20.25773196,20.72164948,21.18556701,21.64948454,22.11340206,22.57731959,23.04123711,23.50515464,23.96907216,24.43298969,24.89690722,25.36082474,25.82474227,26.28865979,26.75257732,27.21649485,27.68041237,28.1443299,28.60824742,29.07216495,29.53608247,30,30.46391753,30.92783505,31.39175258,31.8556701,32.31958763,32.78350515,33.24742268,33.71134021,34.17525773,34.63917526,35.10309278,35.56701031,36.03092784,36.49484536,36.95876289,37.42268041,37.88659794,38.35051546,38.81443299,39.27835052,39.74226804,40.20618557,40.67010309,41.13402062,41.59793814,42.06185567,42.5257732,42.98969072,43.45360825,43.91752577,44.3814433,44.84536082,45.30927835,45.77319588,46.2371134,46.70103093,47.16494845,47.62886598,48.09278351,48.55670103,49.02061856,49.48453608,49.94845361,50.41237113,50.87628866,51.34020619,51.80412371,52.26804124,52.73195876,53.19587629,53.65979381,54.12371134,54.58762887,55.05154639,55.51546392,55.97938144,56.44329897,56.90721649,57.37113402,57.83505155,58.29896907,58.7628866,59.22680412,59.69072165,60.15463918,60.6185567,61.08247423,61.54639175,62.01030928,62.4742268,62.93814433,63.40206186,63.86597938,64.32989691,64.79381443,65.25773196,65.72164948,66.18556701,66.64948454,67.11340206,67.57731959,68.04123711,68.50515464,68.96907216,69.43298969,69.89690722,70.36082474,70.82474227,71.28865979,71.75257732,72.21649485,72.68041237,73.1443299,73.60824742,74.07216495,74.53608247,75],"colors":["#959052","#979356","#9c9a60","#a09c64","#a3a067","#a8a570","#aaa875","#acac79","#b1b182","#b5b587","#b6b88c","#bcbd93","#bfc199","#c1c39c","#c1c39c","#c6caa5","#cacdaa","#cccfaf","#cfd1b3","#cccfb3","#c8ccb3","#c6c8b3","#bfc3b3","#bfc3b3","#bcc1b3","#b8bdb3","#b5bab3","#afb5b3","#acb3b3","#aaafb3","#a7aeb3","#a3aab3","#a0a8b3","#9ca5b3","#9aa1b3","#97a0b3","#939cb3","#909ab3","#939ab5","#8c95b3","#8791b1","#838eb1","#808caf","#7c89af","#7785ae","#7482ac","#7080aa","#6b7caa","#6275a8","#5e72a7","#5e72a7","#5b70a5","#566da3","#5269a3","#4f67a1","#4b64a1","#4660a0","#425d9e","#4260a1","#4467a5","#486eaa","#4975ae","#4d7cb1","#4f83b5","#508aba","#5491bf","#5699c3","#599ec6","#5ba5ca","#5daccf","#60b3d4","#62bad8","#64c1db","#67c8df","#69cfe4","#6ed6e8","#67d6d6","#60d6c4","#59d6b3","#52d6a1","#4bd690","#42d67e","#3bd66d","#34d65b","#11d418","#11d116","#0fcd16","#0fc816","#0fc316","#0fbf15","#0fbc15","#0fb613","#0eb313","#0eaf13","#0eaa13","#0ca511","#0ca111","#0c9e11","#0c9911","#0c950f","#0c900f","#0a8c0f","#0a870f","#0a830e","#0a800e","#0a7c0c","#0a770c","#08720c","#086e0c","#086b0a","#08660a","#08620a","#085d08","#1c6708","#317208","#467c08","#5b8707","#6e9107","#839c05","#97a805","#acb105","#c1bc05","#d6c603","#e9d103","#ffe200","#ffd800","#ffd300","#ffc800","#ffc300","#ffba00","#ffb500","#ffb000","#ffac00","#ffa700","#ff9e00","#ff9900","#ff9300","#ff8900","#ff8500","#ff7f00","#ff0000","#f70000","#f00000","#e90000","#e20000","#db0000","#d40000","#cd0000","#c60000","#bf0000","#b80000","#b10000","#aa0000","#a30000","#9a0000","#930000","#8c0000","#850000","#7e0000","#770000","#700000","#ffffff","#fff4ff","#ffe9ff","#ffdfff","#ffd4ff","#ffc8ff","#ffbdff","#ffb3ff","#ffa8ff","#ff9cff","#ff91ff","#ff75ff","#fb6bfd","#f960f9","#f656f6","#f24bf4","#ef3ff0","#ed36ef","#e92aeb","#e61fe8","#e416e6","#e10ae2","#b100ff","#ac00fb","#a300f6","#9a00f4","#9300ef","#8700e9","#8200e8","#7900e2","#7200dd","#6900db","#6200d6"]}'),V="This constructor is not a subclass of Float16Array",$="The constructor property value is not an object",Y="Attempting to access detached ArrayBuffer",X="Cannot convert undefined or null to object",J="Cannot mix BigInt and other types, use explicit conversions",Z="@@iterator property is not callable",q="Reduce of empty array with no initial value",K="Offset is out of bounds";function Q(t){return(e,...n)=>et(t,e,n)}function tt(t,e){return Q(it(t,e).get)}const{apply:et,construct:nt,defineProperty:rt,get:ot,getOwnPropertyDescriptor:it,getPrototypeOf:at,has:st,ownKeys:lt,set:ct,setPrototypeOf:ut}=Reflect,ft=Proxy,{EPSILON:ht,MAX_SAFE_INTEGER:dt,isFinite:pt,isNaN:_t}=Number,{iterator:mt,species:gt,toStringTag:vt,for:bt}=Symbol,yt=Object,{create:wt,defineProperty:xt,freeze:Tt,is:Et}=yt,At=yt.prototype,St=At.__lookupGetter__?Q(At.__lookupGetter__):(t,e)=>{if(null==t)throw be(X);let n=yt(t);do{const t=it(n,e);if(void 0!==t)return Rt(t,"get")?t.get:void 0}while(null!==(n=at(n)))},Rt=yt.hasOwn||Q(At.hasOwnProperty),Ft=Array,Mt=Ft.isArray,Pt=Ft.prototype,It=Q(Pt.join),Ot=Q(Pt.push),Ct=Q(Pt.toLocaleString),Nt=Pt[mt],Bt=Q(Nt),{abs:kt,trunc:Gt}=Math,Lt=ArrayBuffer,Dt=Lt.isView,Ut=Lt.prototype,jt=Q(Ut.slice),Ht=tt(Ut,"byteLength"),zt="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:null,Wt=zt&&tt(zt.prototype,"byteLength"),Vt=at(Uint8Array),$t=Vt.from,Yt=Vt.prototype,Xt=Yt[mt],Jt=Q(Yt.keys),Zt=Q(Yt.values),qt=Q(Yt.entries),Kt=Q(Yt.set),Qt=Q(Yt.reverse),te=Q(Yt.fill),ee=Q(Yt.copyWithin),ne=Q(Yt.sort),re=Q(Yt.slice),oe=Q(Yt.subarray),ie=tt(Yt,"buffer"),ae=tt(Yt,"byteOffset"),se=tt(Yt,"length"),le=tt(Yt,vt),ce=Uint8Array,ue=Uint16Array,fe=(...t)=>et($t,ue,t),he=Uint32Array,de=Float32Array,pe=at([][mt]()),_e=Q(pe.next),me=Q(function*(){}().next),ge=at(pe),ve=DataView.prototype,be=(Q(ve.getUint16),Q(ve.setUint16),TypeError),ye=RangeError,we=WeakSet,xe=we.prototype,Te=Q(xe.add),Ee=Q(xe.has),Ae=WeakMap,Se=Ae.prototype,Re=Q(Se.get),Fe=Q(Se.has),Me=Q(Se.set),Pe=new Ae,Ie=wt(null,{next:{value:function(){const t=Re(Pe,this);return _e(t)}},[mt]:{value:function(){return this}}});function Oe(t){if(t[mt]===Nt&&pe.next===_e)return t;const e=wt(Ie);return Me(Pe,e,Bt(t)),e}const Ce=new Ae,Ne=wt(ge,{next:{value:function(){const t=Re(Ce,this);return me(t)},writable:!0,configurable:!0}});for(const t of lt(pe))"next"!==t&&xt(Ne,t,it(pe,t));function Be(t){const e=wt(Ne);return Me(Ce,e,t),e}function ke(t){return null!==t&&"object"==typeof t||"function"==typeof t}function Ge(t){return null!==t&&"object"==typeof t}function Le(t){return void 0!==le(t)}function De(t){const e=le(t);return"BigInt64Array"===e||"BigUint64Array"===e}function Ue(t){if(null===zt)return!1;try{return Wt(t),!0}catch(t){return!1}}function je(t){return!!Mt(t)&&t[mt]===Nt&&pe.next===_e}function He(t){if("string"!=typeof t)return!1;const e=+t;return t===e+""&&!!pt(e)&&e===Gt(e)}const ze=bt("__Float16Array__"),We=1/ht,Ve=5.960464477539063e-8,$e=.0009765625*We;const Ye=new Lt(4),Xe=new de(Ye),Je=new he(Ye),Ze=new ue(512),qe=new ce(512);for(let t=0;t<256;++t){const e=t-127;e<-27?(Ze[t]=0,Ze[256|t]=32768,qe[t]=24,qe[256|t]=24):e<-14?(Ze[t]=1024>>-e-14,Ze[256|t]=1024>>-e-14|32768,qe[t]=-e-1,qe[256|t]=-e-1):e<=15?(Ze[t]=e+15<<10,Ze[256|t]=e+15<<10|32768,qe[t]=13,qe[256|t]=13):e<128?(Ze[t]=31744,Ze[256|t]=64512,qe[t]=24,qe[256|t]=24):(Ze[t]=31744,Ze[256|t]=64512,qe[t]=13,qe[256|t]=13)}function Ke(t){Xe[0]=function(t){const e=+t;if(!pt(e)||0===e)return e;const n=e>0?1:-1,r=kt(e);if(r<6103515625e-14)return n*function(t){return t+We-We}(r/Ve)*Ve;const o=(1+$e)*r,i=o-(o-r);return i>65504||_t(i)?n*(1/0):n*i}(t);const e=Je[0],n=e>>23&511;return Ze[n]+((8388607&e)>>qe[n])}const Qe=new he(2048);for(let t=1;t<1024;++t){let e=t<<13,n=0;for(;0==(8388608&e);)e<<=1,n-=8388608;e&=-8388609,n+=947912704,Qe[t]=e|n}for(let t=1024;t<2048;++t)Qe[t]=939524096+(t-1024<<13);const tn=new he(64);for(let t=1;t<31;++t)tn[t]=t<<23;tn[31]=1199570944,tn[32]=2147483648;for(let t=33;t<63;++t)tn[t]=2147483648+(t-32<<23);tn[63]=3347054592;const en=new ue(64);for(let t=1;t<64;++t)32!==t&&(en[t]=1024);function nn(t){const e=t>>10;return Je[0]=Qe[en[e]+(1023&t)]+tn[e],Xe[0]}function rn(t){const e=+t;return _t(e)||0===e?0:Gt(e)}function on(t){const e=rn(t);return e<0?0:e<dt?e:dt}function an(t,e){if(!ke(t))throw be("This is not an object");const n=t.constructor;if(void 0===n)return e;if(!ke(n))throw be($);const r=n[gt];return null==r?e:r}function sn(t){if(Ue(t))return!1;try{return jt(t,0,0),!1}catch(t){}return!0}function ln(t,e){const n=_t(t),r=_t(e);if(n&&r)return 0;if(n)return 1;if(r)return-1;if(t<e)return-1;if(t>e)return 1;if(0===t&&0===e){const n=Et(t,0),r=Et(e,0);if(!n&&r)return-1;if(n&&!r)return 1}return 0}const cn=new Ae;function un(t){return Fe(cn,t)||!Dt(t)&&function(t){if(!Ge(t))return!1;const e=at(t);if(!Ge(e))return!1;const n=e.constructor;if(void 0===n)return!1;if(!ke(n))throw be($);return st(n,ze)}(t)}function fn(t){if(!un(t))throw be("This is not a Float16Array object")}function hn(t,e){const n=un(t),r=Le(t);if(!n&&!r)throw be("Species constructor didn't return TypedArray object");if("number"==typeof e){let r;if(n){const e=dn(t);r=se(e)}else r=se(t);if(r<e)throw be("Derived constructor created TypedArray object which was too small length")}if(De(t))throw be(J)}function dn(t){const e=Re(cn,t);if(void 0!==e){if(sn(ie(e)))throw be(Y);return e}const n=t.buffer;if(sn(n))throw be(Y);const r=nt(gn,[n,t.byteOffset,t.length],t.constructor);return Re(cn,r)}function pn(t){const e=se(t),n=[];for(let r=0;r<e;++r)n[r]=nn(t[r]);return n}const _n=new we;for(const t of lt(Yt)){if(t===vt)continue;const e=it(Yt,t);Rt(e,"get")&&"function"==typeof e.get&&Te(_n,e.get)}const mn=Tt({get:(t,e,n)=>He(e)&&Rt(t,e)?nn(ot(t,e)):Ee(_n,St(t,e))?ot(t,e):ot(t,e,n),set:(t,e,n,r)=>He(e)&&Rt(t,e)?ct(t,e,Ke(n)):ct(t,e,n,r),getOwnPropertyDescriptor(t,e){if(He(e)&&Rt(t,e)){const n=it(t,e);return n.value=nn(n.value),n}return it(t,e)},defineProperty:(t,e,n)=>He(e)&&Rt(t,e)&&Rt(n,"value")?(n.value=Ke(n.value),rt(t,e,n)):rt(t,e,n)});class gn{constructor(t,e,n){let r;if(un(t))r=nt(ue,[dn(t)],new.target);else if(!ke(t)||(function(t){try{return Ht(t),!0}catch(t){return!1}}(o=t)||Ue(o)))r=nt(ue,arguments,new.target);else{let e,n;if(Le(t)){if(e=t,n=se(t),sn(ie(t)))throw be(Y);if(De(t))throw be(J);const o=new Lt(2*n);r=nt(ue,[o],new.target)}else{const o=t[mt];if(null!=o&&"function"!=typeof o)throw be(Z);null!=o?je(t)?(e=t,n=t.length):(e=[...t],n=e.length):(e=t,n=on(e.length)),r=nt(ue,[n],new.target)}for(let t=0;t<n;++t)r[t]=Ke(e[t])}var o;const i=new ft(r,mn);return Me(cn,i,r),i}static from(t,...e){const n=this;if(!st(n,ze))throw be(V);if(n===gn){if(un(t)&&0===e.length){const e=dn(t),n=new ue(ie(e),ae(e),se(e));return new gn(ie(re(n)))}if(0===e.length)return new gn(ie(fe(t,Ke)));const n=e[0],r=e[1];return new gn(ie(fe(t,(function(t,...e){return Ke(et(n,this,[t,...Oe(e)]))}),r)))}let r,o;const i=t[mt];if(null!=i&&"function"!=typeof i)throw be(Z);if(null!=i)je(t)?(r=t,o=t.length):Le(a=t)&&a[mt]===Xt&&pe.next===_e?(r=t,o=se(t)):(r=[...t],o=r.length);else{if(null==t)throw be(X);r=yt(t),o=on(r.length)}var a;const s=new n(o);if(0===e.length)for(let t=0;t<o;++t)s[t]=r[t];else{const t=e[0],n=e[1];for(let e=0;e<o;++e)s[e]=et(t,n,[r[e],e])}return s}static of(...t){const e=this;if(!st(e,ze))throw be(V);const n=t.length;if(e===gn){const e=new gn(n),r=dn(e);for(let e=0;e<n;++e)r[e]=Ke(t[e]);return e}const r=new e(n);for(let e=0;e<n;++e)r[e]=t[e];return r}keys(){fn(this);const t=dn(this);return Jt(t)}values(){fn(this);const t=dn(this);return Be(function*(){for(const e of Zt(t))yield nn(e)}())}entries(){fn(this);const t=dn(this);return Be(function*(){for(const[e,n]of qt(t))yield[e,nn(n)]}())}at(t){fn(this);const e=dn(this),n=se(e),r=rn(t),o=r>=0?r:n+r;if(!(o<0||o>=n))return nn(e[o])}with(t,e){fn(this);const n=dn(this),r=se(n),o=rn(t),i=o>=0?o:r+o,a=+e;if(i<0||i>=r)throw ye(K);const s=new ue(ie(n),ae(n),se(n)),l=new gn(ie(re(s)));return dn(l)[i]=Ke(a),l}map(t,...e){fn(this);const n=dn(this),r=se(n),o=e[0],i=an(n,gn);if(i===gn){const e=new gn(r),i=dn(e);for(let e=0;e<r;++e){const r=nn(n[e]);i[e]=Ke(et(t,o,[r,e,this]))}return e}const a=new i(r);hn(a,r);for(let e=0;e<r;++e){const r=nn(n[e]);a[e]=et(t,o,[r,e,this])}return a}filter(t,...e){fn(this);const n=dn(this),r=se(n),o=e[0],i=[];for(let e=0;e<r;++e){const r=nn(n[e]);et(t,o,[r,e,this])&&Ot(i,r)}const a=new(an(n,gn))(i);return hn(a),a}reduce(t,...e){fn(this);const n=dn(this),r=se(n);if(0===r&&0===e.length)throw be(q);let o,i;0===e.length?(o=nn(n[0]),i=1):(o=e[0],i=0);for(let e=i;e<r;++e)o=t(o,nn(n[e]),e,this);return o}reduceRight(t,...e){fn(this);const n=dn(this),r=se(n);if(0===r&&0===e.length)throw be(q);let o,i;0===e.length?(o=nn(n[r-1]),i=r-2):(o=e[0],i=r-1);for(let e=i;e>=0;--e)o=t(o,nn(n[e]),e,this);return o}forEach(t,...e){fn(this);const n=dn(this),r=se(n),o=e[0];for(let e=0;e<r;++e)et(t,o,[nn(n[e]),e,this])}find(t,...e){fn(this);const n=dn(this),r=se(n),o=e[0];for(let e=0;e<r;++e){const r=nn(n[e]);if(et(t,o,[r,e,this]))return r}}findIndex(t,...e){fn(this);const n=dn(this),r=se(n),o=e[0];for(let e=0;e<r;++e){const r=nn(n[e]);if(et(t,o,[r,e,this]))return e}return-1}findLast(t,...e){fn(this);const n=dn(this),r=se(n),o=e[0];for(let e=r-1;e>=0;--e){const r=nn(n[e]);if(et(t,o,[r,e,this]))return r}}findLastIndex(t,...e){fn(this);const n=dn(this),r=se(n),o=e[0];for(let e=r-1;e>=0;--e){const r=nn(n[e]);if(et(t,o,[r,e,this]))return e}return-1}every(t,...e){fn(this);const n=dn(this),r=se(n),o=e[0];for(let e=0;e<r;++e)if(!et(t,o,[nn(n[e]),e,this]))return!1;return!0}some(t,...e){fn(this);const n=dn(this),r=se(n),o=e[0];for(let e=0;e<r;++e)if(et(t,o,[nn(n[e]),e,this]))return!0;return!1}set(t,...e){fn(this);const n=dn(this),r=rn(e[0]);if(r<0)throw ye(K);if(null==t)throw be(X);if(De(t))throw be(J);if(un(t))return Kt(dn(this),dn(t),r);if(Le(t)&&sn(ie(t)))throw be(Y);const o=se(n),i=yt(t),a=on(i.length);if(r===1/0||a+r>o)throw ye(K);for(let t=0;t<a;++t)n[t+r]=Ke(i[t])}reverse(){fn(this);const t=dn(this);return Qt(t),this}toReversed(){fn(this);const t=dn(this),e=new ue(ie(t),ae(t),se(t)),n=new gn(ie(re(e))),r=dn(n);return Qt(r),n}fill(t,...e){fn(this);const n=dn(this);return te(n,Ke(t),...Oe(e)),this}copyWithin(t,e,...n){fn(this);const r=dn(this);return ee(r,t,e,...Oe(n)),this}sort(t){fn(this);const e=dn(this),n=void 0!==t?t:ln;return ne(e,((t,e)=>n(nn(t),nn(e)))),this}toSorted(t){fn(this);const e=dn(this);if(void 0!==t&&"function"!=typeof t)throw new be("The comparison function must be either a function or undefined");const n=void 0!==t?t:ln,r=new ue(ie(e),ae(e),se(e)),o=new gn(ie(re(r))),i=dn(o);return ne(i,((t,e)=>n(nn(t),nn(e)))),o}slice(t,e){fn(this);const n=dn(this),r=an(n,gn);if(r===gn){const r=new ue(ie(n),ae(n),se(n));return new gn(ie(re(r,t,e)))}const o=se(n),i=rn(t),a=void 0===e?o:rn(e);let s,l;s=i===-1/0?0:i<0?o+i>0?o+i:0:o<i?o:i,l=a===-1/0?0:a<0?o+a>0?o+a:0:o<a?o:a;const c=l-s>0?l-s:0,u=new r(c);if(hn(u,c),0===c)return u;if(sn(ie(n)))throw be(Y);let f=0;for(;s<l;)u[f]=nn(n[s]),++s,++f;return u}subarray(t,e){fn(this);const n=dn(this),r=an(n,gn),o=new ue(ie(n),ae(n),se(n)),i=oe(o,t,e),a=new r(ie(i),ae(i),se(i));return hn(a),a}indexOf(t,...e){fn(this);const n=dn(this),r=se(n);let o=rn(e[0]);if(o===1/0)return-1;o<0&&(o+=r,o<0&&(o=0));for(let e=o;e<r;++e)if(Rt(n,e)&&nn(n[e])===t)return e;return-1}lastIndexOf(t,...e){fn(this);const n=dn(this),r=se(n);let o=e.length>=1?rn(e[0]):r-1;if(o===-1/0)return-1;o>=0?o=o<r-1?o:r-1:o+=r;for(let e=o;e>=0;--e)if(Rt(n,e)&&nn(n[e])===t)return e;return-1}includes(t,...e){fn(this);const n=dn(this),r=se(n);let o=rn(e[0]);if(o===1/0)return!1;o<0&&(o+=r,o<0&&(o=0));const i=_t(t);for(let e=o;e<r;++e){const r=nn(n[e]);if(i&&_t(r))return!0;if(r===t)return!0}return!1}join(t){fn(this);const e=pn(dn(this));return It(e,t)}toLocaleString(...t){fn(this);const e=pn(dn(this));return Ct(e,...Oe(t))}get[vt](){if(un(this))return"Float16Array"}}xt(gn,"BYTES_PER_ELEMENT",{value:2}),xt(gn,ze,{}),ut(gn,Vt);const vn=gn.prototype;xt(vn,"BYTES_PER_ELEMENT",{value:2}),xt(vn,mt,{value:vn.values,writable:!0,configurable:!0}),ut(vn,Yt);var bn=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},yn=function(){function t(t){this.rgba=t}return Object.defineProperty(t.prototype,"r",{get:function(){return this.rgba[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"g",{get:function(){return this.rgba[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this.rgba[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"a",{get:function(){return this.rgba[3]},enumerable:!1,configurable:!0}),t.prototype.withOpacity=function(e){return new t([this.r,this.g,this.b,e])},t.prototype.toRGBHex=function(){return this.toRGBAHex().slice(0,-2)},t.prototype.toRGBAHex=function(){return e=this.rgba,"float"==(t=void 0===t?"float":t)&&(e=e.map((function(t){return Math.round(255*t)}))),"#"+e.map((function(t){return t.toString(16).padStart(2,"0").toUpperCase()})).join("");var t,e},t.prototype.toRGBATuple=function(){return this.rgba},t.prototype.toHSVTuple=function(){return function(t){var e,n=bn(t,3),r=n[0],o=n[1],i=n[2],a=Math.max(r,o,i),s=a-Math.min(r,o,i);if(0==s)e=0;else if(a==r)e=(o-i)/s*60%6;else if(a==o)e=60*((i-r)/s+2);else{if(a!=i)throw"You've messed something up in rgb2hsv()";e=60*((r-o)/s+4)}return[e,0==a?0:s/a,a]}([this.r,this.g,this.b])},t.fromHex=function(e){return new t(function(t,e){e=void 0===e?"float":e;var n=t.match(/#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?/i);if(null===n)throw"Got '".concat(t,"' in hex2rgba, which does not look like a hex color");var r=n.slice(1).filter((function(t){return void 0!==t})).map((function(t){return parseInt(t,16)}));return"float"==e&&(r=r.map((function(t){return t/255}))),void 0===r[3]?[r[0],r[1],r[2],1]:[r[0],r[1],r[2],r[3]]}(e))},t.fromHSVTuple=function(e){var n=function(t){var e,n,r,o=bn(t,3),i=o[0],a=o[1],s=o[2],l=s*a,c=l*(1-Math.abs(i/60%2-1)),u=s-l;if(0<=i&&i<60)e=l,n=c,r=0;else if(60<=i&&i<120)e=c,n=l,r=0;else if(120<=i&&i<180)e=0,n=l,r=c;else if(180<=i&&i<240)e=0,n=c,r=l;else if(240<=i&&i<300)e=c,n=0,r=l;else{if(!(300<=i&&i<360))throw"H is out of bounds in hsv2rgb";e=l,n=0,r=c}return[e+u,n+u,r+u]}(e);return new t([n[0],n[1],n[2],1])},t}(),wn=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},xn=n(351),Tn=function(){function t(t,e,n){if(t.length!=e.length+1)throw"Mismatch between number of levels (".concat(t.length,") and number of colors (").concat(e.length,"; expected ").concat(t.length-1,")");var r=function(t){return t instanceof yn?t:yn.fromHex(t)};this.levels=t,this.colors=e.map((function(t){return r(t)})),n=void 0===n?{}:n,this.overflow_color=void 0===n.overflow_color?null:r(n.overflow_color),this.underflow_color=void 0===n.underflow_color?null:r(n.underflow_color)}return t.prototype.getColors=function(){return this.colors.map((function(t){return t.toRGBHex()}))},t.prototype.getOpacities=function(){return this.colors.map((function(t){return t.a}))},t.prototype.withOpacity=function(e){for(var n=[],r=[],o={},i=0;i<this.colors.length;i++){var a=this.colors[i],s=this.levels[i],l=this.levels[i+1],c=e(s,l),u=a.withOpacity(c);c>0&&(r[r.length-1]!=s&&r.push(s),r.push(l),n.push(u))}if(null!==this.underflow_color){var f=e(this.levels[0],this.levels[0]);f>0&&(o.underflow_color=this.underflow_color.withOpacity(f))}if(null!==this.overflow_color){var h=e(this.levels[this.levels.length-1],this.levels[this.levels.length-1]);h>0&&(o.overflow_color=this.overflow_color.withOpacity(h))}return new t(r,n,o)},t.diverging=function(e,n,r,o,i){for(var a,s,l=[],c=[],u=(o-r)/(i-1),f=(o+r)/2,h=[0,0,.9],d=yn.fromHex(e).toHSVTuple(),p=yn.fromHex(n).toHSVTuple(),_=0;_<i;_++){var m=r+_*u,g=void 0,v=void 0,b=void 0,y=void 0;m<f?(y=Math.pow((f-m)/(f-r),1.5),g=(a=wn([d[0],h[1]+(d[1]-h[1])*y,h[2]+(d[2]-h[2])*y],3))[0],v=a[1],b=a[2]):(y=Math.pow((m-f)/(o-f),1.5),g=(s=wn([p[0],h[1]+(p[1]-h[1])*y,h[2]+(p[2]-h[2])*y],3))[0],v=s[1],b=s[2]),l.push(yn.fromHSVTuple([g,v,b]).withOpacity(Math.min(2*y,1)))}for(var w=0;w<=i;w++){var x=(o-r)/i;c.push(r+w*x)}return new t(c,l)},t}();function En(t,e){var n=t.colors.length,r={};return"over"!=e&&"both"!=e||(r.overflow_color=t.colors[n-1]),"under"!=e&&"both"!=e||(r.underflow_color=t.colors[0]),new Tn(t.levels,t.colors,r)}var An=En(D,"over").withOpacity((function(t,e){return Math.min((e-20)/10,1)})),Sn=En(U,"over").withOpacity((function(t,e){return Math.min((e-20)/10,1)})),Rn=En(j,"over").withOpacity((function(t,e){return Math.min(e/1e3,1)})),Fn=En(H,"both"),Mn=En(z,"both"),Pn=En(W,"over"),In=function(){function t(t){this.colormap=t,this.gl_elems=null}return t.applyShader=function(t){return xn+"\n"+t},t.prototype.setupShaderVariables=function(t,e){var n=function(t){for(var e=[],n=0;n<101;n++)e.push(n/100);var r=t.levels,o=r.length-1,i=r.map((function(t,e){return e/o})),a=r.map((function(t){return(t-r[0])/(r[o]-r[0])})),s=e.map((function(t){var e;for(e=0;!(a[e]<=t&&t<=a[e+1]);e++);var n=(t-a[e])/(a[e+1]-a[e]);return i[e]*(1-n)+i[e+1]*n}));return new gn(s)}(this.colormap),r=function(t){var e=document.createElement("canvas");e.width=t.colors.length,e.height=1;var n=e.getContext("2d");return t.colors.forEach((function(t,e){if(null===n)throw"Could not get rendering context for colormap image canvas";n.fillStyle=t.toRGBAHex(),n.fillRect(e,0,1,1)})),e}(this.colormap),o=M(t,!0),i=o.format,a=o.type,s=o.row_alignment,l={format:t.RGBA,type:t.UNSIGNED_BYTE,image:r,mag_filter:e},c=new B(t,l),u={format:i,type:a,width:n.length,height:1,image:new Uint16Array(n.buffer),mag_filter:t.LINEAR,row_alignment:s},f=new B(t,u);this.gl_elems={cmap_texture:c,cmap_nonlin_texture:f}},t.prototype.bindShaderVariables=function(t){if(null!==this.gl_elems){var e=this.colormap,n=null===e.underflow_color?[0,0,0,0]:e.underflow_color.toRGBATuple(),r=null===e.overflow_color?[0,0,0,0]:e.overflow_color.toRGBATuple();t.setUniforms({u_cmap_min:e.levels[0],u_cmap_max:e.levels[e.levels.length-1],u_n_index:101,u_underflow_color:n,u_overflow_color:r}),t.bindTextures({u_cmap_sampler:this.gl_elems.cmap_texture,u_cmap_nonlin_sampler:this.gl_elems.cmap_nonlin_texture})}},t}(),On=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Cn=n(319),Nn=n(559),Bn={"-":[1],"--":[1,1,1,1,0,0],":":[1,0],"-.":[1,1,1,0,1,0]},kn=function(){function t(t,e,n){var r,o=void 0===(n=void 0===n?{}:n).color?"#000000":n.color;this.color=yn.fromHex(o);var i=void 0===n.line_width?1:n.line_width,a=void 0===n.line_style?"-":n.line_style;this.width=i;var s=[];this.vertices=new C(t,e.vertices,3,t.TRIANGLE_STRIP),this.extrusion=new C(t,e.extrusion,2,t.TRIANGLE_STRIP),void 0!==e.offsets?(this.offset=new C(t,e.offsets,2,t.TRIANGLE_STRIP),this.scale=void 0===n.offset_scale?1:n.offset_scale,s.push("OFFSET")):(this.offset=null,this.scale=null),void 0!==e.zoom?(this.min_zoom=new C(t,e.zoom,1,t.TRIANGLE_STRIP),s.push("ZOOM")):this.min_zoom=null;var l=Nn;if(void 0!==e.data){s.push("DATA"),this.line_data=new C(t,e.data,1,t.TRIANGLE_STRIP);var c=void 0===n.cmap?new Tn([0,1],[o],{overflow_color:o,underflow_color:o}):n.cmap;this.cmap_gpu=new In(c),this.cmap_gpu.setupShaderVariables(t,t.NEAREST),l=In.applyShader(l)}else this.line_data=null,this.cmap_gpu=null;r=On(function(t,e){var n=Array.isArray(e)?e:Bn[e],r={format:S(t)?t.R8:t.LUMINANCE,type:t.UNSIGNED_BYTE,width:n.length,height:1,image:new Uint8Array(n.map((function(t){return t>0?255:0}))),mag_filter:t.NEAREST,row_alignment:1};return[n.length,new B(t,r)]}(t,a),2),this.n_dash=r[0],this.dash_texture=r[1],this.program=new G(t,Cn,l,{define:s})}return t.make=function(e,n,r){return o=this,i=void 0,s=function(){var o;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(i){switch(i.label){case 0:return[4,R.makePolyLines(n)];case 1:return o=i.sent(),[2,new t(e,o,r)]}}))},new((a=void 0)||(a=Promise))((function(t,e){function n(t){try{l(s.next(t))}catch(t){e(t)}}function r(t){try{l(s.throw(t))}catch(t){e(t)}}function l(e){var o;e.done?t(e.value):(o=e.value,o instanceof a?o:new a((function(t){t(o)}))).then(n,r)}l((s=s.apply(o,i||[])).next())}));var o,i,a,s},t.prototype.render=function(t,e,n,r,o,i){var a=On(n,2),s=a[0],l=a[1];e instanceof Float32Array&&(e=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],On(e),!1));var c={a_pos:this.vertices,a_extrusion:this.extrusion},u={u_matrix:e,u_line_width:this.width,u_map_width:s,u_map_height:l,u_map_bearing:o,u_offset:0,u_zoom:r,u_dash_pattern_length:this.n_dash},f={u_dash_sampler:this.dash_texture};null!==this.offset&&null!==this.scale&&(c.a_offset=this.offset,u.u_offset_scale=this.scale*(l/s)),null!==this.min_zoom&&(c.a_min_zoom=this.min_zoom),null!==this.line_data?c.a_data=this.line_data:u.u_color=this.color.toRGBATuple(),this.program.use(c,u,f),null!==this.cmap_gpu&&this.cmap_gpu.bindShaderVariables(this.program),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),this.program.draw(),this.program.setUniforms({u_offset:-2}),this.program.draw(),this.program.setUniforms({u_offset:-1}),this.program.draw(),this.program.setUniforms({u_offset:1}),this.program.draw()},t}(),Gn=n(614),Ln=n.n(Gn),Dn=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},Un=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},jn=n(207),Hn=n(286),zn=new E((function(t){return new G(t,jn,Hn)}));function Wn(t){var e=t.filter((function(t){return void 0!==t.data})),n=[],r=function(t){let e=0,n=0;for(const r of t)e+=r.w*r.h,n=Math.max(n,r.w);t.sort(((t,e)=>e.h-t.h));const r=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),n),h:1/0}];let o=0,i=0;for(const e of t)for(let t=r.length-1;t>=0;t--){const n=r[t];if(!(e.w>n.w||e.h>n.h)){if(e.x=n.x,e.y=n.y,i=Math.max(i,e.y+e.h),o=Math.max(o,e.x+e.w),e.w===n.w&&e.h===n.h){const e=r.pop();t<r.length&&(r[t]=e)}else e.h===n.h?(n.x+=e.w,n.w-=e.w):e.w===n.w?(n.y+=e.h,n.h-=e.h):(r.push({x:n.x+e.w,y:n.y,w:n.w-e.w,h:e.h}),n.y+=e.h,n.h-=e.h);break}}return{w:o,h:i,fill:e/(o*i)||0}}(e.map((function(t){var e={x:0,y:0,w:t.width,h:t.height};return n.push({glyph:t,bin:e}),e}))),o=r.w,i=r.h,a=new Uint8Array(o*i),s={};n.forEach((function(t){var e=t.bin,n=t.glyph;if(void 0===e.x||void 0===e.y)throw"Potpack couldn't pack this pot, I guess?";s[n.id]={id:n.id,width:n.width,height:n.height,left:n.left,top:n.top,atlas_i:e.x,atlas_j:e.y,advance:n.advance};for(var r=0;r<n.width;r++)for(var i=0;i<n.height;i++){var l=r+n.width*i,c=r+e.x+o*(i+e.y);a[c]=n.data[l]}}));var l=s["M".charCodeAt(0)],c=l.height-l.top,u=-l.top;return{atlas:a,atlas_width:o,atlas_height:i,baseline:c,top:u,glyph_info:s}}function Vn(t){return Dn(this,void 0,void 0,(function(){var e,n;return Un(this,(function(r){switch(r.label){case 0:return[4,fetch(t)];case 1:return[4,r.sent().blob()];case 2:return[4,r.sent().arrayBuffer()];case 3:return e=r.sent(),o=new Uint8Array(e),i=function(t,e,n){if(void 0!==n)switch(t){case 1:e.id=n.readVarint();break;case 2:e.data=n.readBytes();break;case 3:e.width=n.readVarint()+6;break;case 4:e.height=n.readVarint()+6;break;case 5:e.left=n.readSVarint();break;case 6:e.top=n.readSVarint();break;case 7:e.advance=n.readVarint()}},a=function(t,e,n){if(void 0!==e&&void 0!==n&&3==t){var r=n.readMessage(i,{});e.push(r)}},n=new(Ln())(o).readFields((function(t,e,n){void 0!==n&&1==t&&n.readMessage(a,e)}),[]),[2,Wn(n)]}var o,i,a}))}))}var $n,Yn={horizontal_align:"left",vertical_align:"baseline",font_size:12,text_color:new yn([0,0,0,1]),halo_color:new yn([0,0,0,1]),halo:!1},Xn=function(){function t(t,e,n,r){var o=this;this.program=zn.getValue(t),this.opts=A(r,Yn);var i={format:S(t)?t.R8:t.LUMINANCE,type:t.UNSIGNED_BYTE,width:n.atlas_width,height:n.atlas_height,image:n.atlas,row_alignment:1,mag_filter:t.LINEAR};this.texture=new B(t,i);var a=6*e.map((function(t){return t.text.length})).reduce((function(t,e){return t+e}),0),s=new Float32Array(3*a),l=new Float32Array(2*a),c=new Float32Array(2*a),u=0,f=0,h=0;e.forEach((function(t){for(var e=t.lat,r=t.lon,i=t.text,a=void 0===t.min_zoom?0:t.min_zoom,d=new I(r,e).toMercatorCoord(),p=d.x,_=d.y,m=0,g=f,v=0;v<i.length;v++){var b=i.charCodeAt(v),y=n.glyph_info[b];void 0!==y?(m+=y.left,s[u++]=p,s[u++]=_,s[u++]=a,s[u++]=p,s[u++]=_,s[u++]=a,s[u++]=p,s[u++]=_,s[u++]=a,s[u++]=p,s[u++]=_,s[u++]=a,s[u++]=p,s[u++]=_,s[u++]=a,s[u++]=p,s[u++]=_,s[u++]=a,l[f++]=m,l[f++]=n.baseline+y.top-y.height,l[f++]=m,l[f++]=n.baseline+y.top-y.height,l[f++]=m+y.width,l[f++]=n.baseline+y.top-y.height,l[f++]=m,l[f++]=n.baseline+y.top,l[f++]=m+y.width,l[f++]=n.baseline+y.top,l[f++]=m+y.width,l[f++]=n.baseline+y.top,c[h++]=y.atlas_i/n.atlas_width,c[h++]=(y.atlas_j+y.height)/n.atlas_height,c[h++]=y.atlas_i/n.atlas_width,c[h++]=(y.atlas_j+y.height)/n.atlas_height,c[h++]=(y.atlas_i+y.width)/n.atlas_width,c[h++]=(y.atlas_j+y.height)/n.atlas_height,c[h++]=y.atlas_i/n.atlas_width,c[h++]=y.atlas_j/n.atlas_height,c[h++]=(y.atlas_i+y.width)/n.atlas_width,c[h++]=y.atlas_j/n.atlas_height,c[h++]=(y.atlas_i+y.width)/n.atlas_width,c[h++]=y.atlas_j/n.atlas_height,m+=y.advance-y.left):m+=7}if("center"==o.opts.horizontal_align)for(v=g;v<g+12*i.length;v+=2)l[v]-=m/2;else if("right"==o.opts.horizontal_align)for(v=g;v<g+12*i.length;v+=2)l[v]-=m;if("top"==o.opts.vertical_align)for(v=g+1;v<g+12*i.length;v+=2)l[v]-=n.baseline-n.top;else if("middle"==o.opts.vertical_align)for(v=g+1;v<g+12*i.length;v+=2)l[v]-=(n.baseline-n.top)/2})),this.anchors=new C(t,s,3,t.TRIANGLE_STRIP),this.offsets=new C(t,l,2,t.TRIANGLE_STRIP),this.texcoords=new C(t,c,2,t.TRIANGLE_STRIP)}return t.make=function(e,n,r,o){return Dn(this,void 0,void 0,(function(){var i;return Un(this,(function(a){switch(a.label){case 0:return[4,Vn(r)];case 1:return i=a.sent(),[2,new t(e,n,i,o)]}}))}))},t.prototype.render=function(t,e,n,r){var o=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}(n,2),i={u_matrix:e,u_map_width:o[0],u_map_height:o[1],u_map_zoom:r,u_font_size:this.opts.font_size,u_text_color:this.opts.text_color.toRGBATuple(),u_halo_color:this.opts.halo_color.toRGBATuple(),u_offset:0};i.u_is_halo=this.opts.halo?1:0,this.program.use({a_pos:this.anchors,a_offset:this.offsets,a_tex_coord:this.texcoords},i,{u_sdf_sampler:this.texture}),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),this.program.draw(),this.opts.halo&&(this.program.setUniforms({u_is_halo:0}),this.program.draw()),this.program.setUniforms({u_offset:-2,u_is_halo:this.opts.halo?1:0}),this.program.draw(),this.opts.halo&&(this.program.setUniforms({u_is_halo:0}),this.program.draw()),this.program.setUniforms({u_offset:-1,u_is_halo:this.opts.halo?1:0}),this.program.draw(),this.opts.halo&&(this.program.setUniforms({u_is_halo:0}),this.program.draw()),this.program.setUniforms({u_offset:1,u_is_halo:this.opts.halo?1:0}),this.program.draw(),this.opts.halo&&(this.program.setUniforms({u_is_halo:0}),this.program.draw())},t}(),Jn=n(526),Zn=($n=function(t,e){return $n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},$n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}$n(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),qn=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},Kn=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},Qn=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},tr=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},er={color:"#000000",cmap:null,interval:1,levels:null,line_width:2,line_style:"-"},nr=function(t){function e(e,n){var r=t.call(this)||this;return r.field=e,r.opts=A(n,er),r.gl_elems=null,r.contours=null,r}return Zn(e,t),e.prototype.updateField=function(t){return qn(this,void 0,void 0,(function(){var e,n,r,o,i=this;return Kn(this,(function(a){switch(a.label){case 0:return this.field=t,null===this.gl_elems?[2]:(e=this.gl_elems.gl,[4,this.getContours()]);case 1:return n=a.sent(),r=[],Object.entries(n).forEach((function(t){var e,n,o=Qn(t,2),a=o[0],s=o[1],l=parseFloat(a),c=(e=i.opts.line_style)in Bn||Array.isArray(e)&&e.length>0&&e.map((function(t){return"number"==typeof t})).reduce((function(t,e){return t&&e}),!0)?i.opts.line_style:i.opts.line_style(l),u="number"==typeof i.opts.line_width?i.opts.line_width:i.opts.line_width(l),f=s.map((function(t){var e={vertices:t};return null!==i.opts.cmap&&(e.data=t.map((function(){return l}))),e})),h=r.filter((function(t){return t.line_style==c&&t.line_width==u}));0==h.length?(n={data:[],line_width:u,line_style:c},r.push(n)):n=h[0],n.data=n.data.concat(f)})),o=r.map((function(t){return qn(i,void 0,void 0,(function(){var n;return Kn(this,(function(r){switch(r.label){case 0:return n={line_width:t.line_width,line_style:t.line_style},null!==this.opts.cmap?n.cmap=this.opts.cmap:n.color=this.opts.color,[4,kn.make(e,t.data,n)];case 1:return[2,r.sent()]}}))}))})),Promise.all(o).then((function(t){null!==i.gl_elems&&(i.contours=t,i.gl_elems.map.triggerRepaint())})),[2]}}))}))},e.prototype.getContours=function(){return qn(this,void 0,void 0,(function(){var t;return Kn(this,(function(e){switch(e.label){case 0:return t=null===this.opts.levels?void 0:this.opts.levels,[4,this.field.getContours({interval:this.opts.interval,levels:t})];case 1:return[2,e.sent()]}}))}))},e.prototype.onAdd=function(t,e){return qn(this,void 0,void 0,(function(){return Kn(this,(function(n){switch(n.label){case 0:return this.gl_elems={gl:e,map:t},[4,this.updateField(this.field)];case 1:return n.sent(),[2]}}))}))},e.prototype.render=function(t,e){if(null!==this.gl_elems&&null!==this.contours){var n=this.gl_elems;e instanceof Float32Array&&(e=tr([],Qn(e),!1));var r=n.map.getZoom(),o=n.map.getCanvas().width,i=n.map.getCanvas().height,a=n.map.getBearing(),s=n.map.getPitch();this.contours.forEach((function(n){return n.render(t,e,[o,i],r,a,s)}))}},e}(F),rr={n_decimal_places:0,font_face:"Trebuchet MS",font_size:12,font_url_template:"",text_color:"#000000",halo_color:"#000000",halo:!1},or=function(t){function e(e,n){var r=t.call(this)||this;return r.opts=A(n,rr),r.contours=e,r.text_collection=null,r.gl_elems=null,r}return Zn(e,t),e.prototype.updateField=function(){return qn(this,void 0,void 0,(function(){var t,e,n,r,o,i,a,s,l,c,u,f,h,d,p,_,m,g,v,b,y,w,x,T,E,A,S,R,F,M,P,O,C,N,B,k,G,L;return Kn(this,(function(D){switch(D.label){case 0:if(null===this.gl_elems)return[2];if(t=this.gl_elems.map,e=this.gl_elems.gl,n=t.getStyle(),void 0===(r=""==this.opts.font_url_template?n.glyphs:this.opts.font_url_template))throw"The map style doesn't have any glyph information. Please pass the font_url_template option to ContourLabels";return o=r.replace("{range}","0-255").replace("{fontstack}",this.opts.font_face),i=[],[4,this.contours.getContours()];case 1:if(a=D.sent(),(s=Object.keys(a).map(parseFloat)).sort((function(t,e){return t-e})),l=t.getMaxZoom(),c=.01*Math.pow(2,7-l),u=null,f=null,h=null,d=null,Object.entries(a).forEach((function(t){var e=Qn(t,2),n=e[0],r=e[1],o=parseFloat(n)-s[0],a=n.toString();r.forEach((function(t){var e=t.map((function(t){var e=(new(I.bind.apply(I,tr([void 0],Qn(t),!1)))).toMercatorCoord();return[e.x,e.y]})),n=[];e.forEach((function(t,r){if(0==r)n.push(0);else{var o=e[r-1],i=Math.hypot(o[0]-t[0],o[1]-t[1]);n.push(n[r-1]+i)}}));for(var r=0,s=1;s<n.length;s++){var p=c*(r+o/2%1);if(n[s-1]<=p&&p<n[s]){var _=t[s-1],m=t[s],g=(p-n[s-1])/(n[s]-n[s-1]),v=(1-g)*_[0]+g*m[0],b=(1-g)*_[1]+g*m[1];(null===h||v<h)&&(h=v),(null===d||v>d)&&(d=v),(null===u||b<u)&&(u=b),(null===f||b>f)&&(f=b),i.push({lon:v,lat:b,min_zoom:l,text:a}),r++}}}))})),p=new Jn.kdTree(i,(function(t,e){return Math.hypot(t.lon-e.lon,t.lat-e.lat)}),["lon","lat"]),null===h||null===u||null===d||null===f)return[2];for(_=new I(h,u).toMercatorCoord(),m=_.x,g=_.y,v=new I(d,f).toMercatorCoord(),b=v.x,y=v.y,w=b-m,x=g-y,T=Math.round(4*w/c),E=Math.round(4*x/c),A=[],S=[],M=0;M<T;M++)A.push(m+M/T*w);for(P=0;P<E;P++)S.push(y+P/E*x);for(R=1,F=l-1;F>=0;F--){for(M=0;M<T;M+=R)for(P=0;P<E;P+=R)O=A[M],C=S[P],N=I.fromMercatorCoord(O,C),B=Qn(p.nearest({lon:N.lng,lat:N.lat,min_zoom:0,text:""},1)[0],2),k=B[0],B[1],k.min_zoom=F;R*=2}return G={horizontal_align:"center",vertical_align:"middle",font_size:this.opts.font_size,halo:this.opts.halo,text_color:yn.fromHex(this.opts.text_color),halo_color:yn.fromHex(this.opts.halo_color)},L=this,[4,Xn.make(e,i,o,G)];case 2:return L.text_collection=D.sent(),t.triggerRepaint(),[2]}}))}))},e.prototype.onAdd=function(t,e){return qn(this,void 0,void 0,(function(){return Kn(this,(function(n){return this.gl_elems={gl:e,map:t},this.updateField(),[2]}))}))},e.prototype.render=function(t,e){if(null!==this.gl_elems&&null!==this.text_collection){var n=this.gl_elems,r=n.map.getCanvas().width,o=n.map.getCanvas().height,i=n.map.getZoom();this.text_collection.render(t,e,[r,o],i)}},e}(F);const ir=nr;var ar=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),sr=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},lr=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},cr=n(370),ur=n(824),fr={cmap:new Tn([0,1],["#000000"],{overflow_color:"#000000",underflow_color:"#000000"}),opacity:1},hr=function(t){function e(e,n){var r=t.call(this)||this;return r.field=e,r.opts=A(n,fr),r.cmap_gpu=new In(r.opts.cmap),r.gl_elems=null,r.fill_texture=null,r.image_mag_filter=null,r.cmap_mag_filter=null,r}return ar(e,t),e.prototype.updateField=function(t){return sr(this,void 0,void 0,(function(){var e,n,r,o,i,a,s,l;return lr(this,(function(c){if(this.field=t,null===this.image_mag_filter||null===this.cmap_mag_filter)throw"Implement magnification filtes in a subclass";return null===this.gl_elems||(e=this.gl_elems.gl,n=this.gl_elems.map,r=this.field.getTextureData(),o=M(e,!(r instanceof Float32Array)),i=o.format,a=o.type,s=o.row_alignment,l={format:i,type:a,width:this.field.grid.ni,height:this.field.grid.nj,image:r,mag_filter:this.image_mag_filter,row_alignment:s},null===this.fill_texture?this.fill_texture=new B(e,l):this.fill_texture.setImageData(l),n.triggerRepaint()),[2]}))}))},e.prototype.onAdd=function(t,e){return sr(this,void 0,void 0,(function(){var n,r,o,i;return lr(this,(function(a){switch(a.label){case 0:if(null===this.image_mag_filter||null===this.cmap_mag_filter)throw"Implement magnification filtes in a subclass";return n=new G(e,cr,In.applyShader(ur)),[4,this.field.grid.getWGLBuffers(e)];case 1:return r=a.sent(),o=r.vertices,i=r.texcoords,this.cmap_gpu.setupShaderVariables(e,this.cmap_mag_filter),this.gl_elems={gl:e,map:t,program:n,vertices:o,texcoords:i},this.updateField(this.field),[2]}}))}))},e.prototype.render=function(t,e){if(null!==this.gl_elems&&null!==this.fill_texture){var n=this.gl_elems;e instanceof Float32Array&&(e=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}(e),!1)),n.program.use({a_pos:n.vertices,a_tex_coord:n.texcoords},{u_matrix:e,u_opacity:this.opts.opacity,u_offset:0},{u_fill_sampler:this.fill_texture}),this.cmap_gpu.bindShaderVariables(n.program),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),n.program.draw(),n.program.setUniforms({u_offset:-2}),n.program.draw(),n.program.setUniforms({u_offset:-1}),n.program.draw(),n.program.setUniforms({u_offset:1}),n.program.draw()}},e}(F),dr=function(t){function e(e,n){return t.call(this,e,n)||this}return ar(e,t),e.prototype.updateField=function(e){return sr(this,void 0,void 0,(function(){return lr(this,(function(n){switch(n.label){case 0:return[4,t.prototype.updateField.call(this,e)];case 1:return n.sent(),[2]}}))}))},e.prototype.onAdd=function(e,n){return sr(this,void 0,void 0,(function(){return lr(this,(function(r){switch(r.label){case 0:return this.image_mag_filter=n.NEAREST,this.cmap_mag_filter=n.LINEAR,[4,t.prototype.onAdd.call(this,e,n)];case 1:return r.sent(),[2]}}))}))},e.prototype.render=function(e,n){t.prototype.render.call(this,e,n)},e}(hr),pr=function(t){function e(e,n){return t.call(this,e,n)||this}return ar(e,t),e.prototype.updateField=function(e){return sr(this,void 0,void 0,(function(){return lr(this,(function(n){switch(n.label){case 0:return[4,t.prototype.updateField.call(this,e)];case 1:return n.sent(),[2]}}))}))},e.prototype.onAdd=function(e,n){return sr(this,void 0,void 0,(function(){return lr(this,(function(r){switch(r.label){case 0:return this.image_mag_filter=n.LINEAR,this.cmap_mag_filter=n.NEAREST,[4,t.prototype.onAdd.call(this,e,n)];case 1:return r.sent(),[2]}}))}))},e.prototype.render=function(e,n){t.prototype.render.call(this,e,n)},e}(hr),_r=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},mr=n(955),gr=n(49),vr=function(){function t(t,e,n,r,o,i,a){a=void 0===a?{}:a,this.color=void 0===a.color?new yn([0,0,0,1]):a.color,this.cmap=void 0===a.cmap?null:a.cmap,this.field=t,this.spec=o,this.size_multiplier=i,this.thin_fac=e,this.max_zoom=n,this.billboard_image=r,this.gl_elems=null,this.wind_textures=null;var s=Math.log2(e),l=Math.max(s+1-n,0);this.trim_inaccessible=Math.pow(2,l),this.show_field=!0}return t.prototype.updateField=function(t){if(this.field=t,null!==this.gl_elems){var e=this.gl_elems.gl,n=this.field.getThinnedField(this.trim_inaccessible,this.trim_inaccessible),r=n.getTextureData(),o=r.u,i=r.v;this.show_field=null!==o;var a=M(e,!(o instanceof Float32Array)),s=a.format,l=a.type,c=a.row_alignment,u={format:s,type:l,width:n.grid.ni,height:n.grid.nj,image:o,mag_filter:e.NEAREST,row_alignment:c},f={format:s,type:l,width:n.grid.ni,height:n.grid.nj,image:i,mag_filter:e.NEAREST,row_alignment:c};null===this.wind_textures?this.wind_textures={u:new B(e,u),v:new B(e,f)}:(this.wind_textures.u.setImageData(u),this.wind_textures.v.setImageData(f))}},t.prototype.setup=function(t){return e=this,n=void 0,o=function(){var e,n,r,o,i,a,s,l,c,u;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(f){switch(f.label){case 0:return[4,(e=this.field.getThinnedField(this.trim_inaccessible,this.trim_inaccessible)).grid.getWGLBillboardBuffers(t,this.thin_fac/this.trim_inaccessible,this.max_zoom)];case 1:return n=f.sent(),r=n.vertices,o=n.texcoords,i=e.grid.getVectorRotationTexture(t).rotation,a=new B(t,this.billboard_image),s=[],l=gr,c=null,null!==this.cmap&&(l=In.applyShader(l),(c=new In(this.cmap)).setupShaderVariables(t,t.NEAREST),s.push("COLORMAP")),u=new G(t,mr,l,{define:s}),this.gl_elems={gl:t,program:u,vertices:r,texcoords:o,texture:a,proj_rot_texture:i,cmap_gpu:c},[2]}}))},new((r=void 0)||(r=Promise))((function(t,i){function a(t){try{l(o.next(t))}catch(t){i(t)}}function s(t){try{l(o.throw(t))}catch(t){i(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(a,s)}l((o=o.apply(e,n||[])).next())}));var e,n,r,o},t.prototype.render=function(t,e,n,r,o,i){var a=_r(n,2),s=a[0],l=a[1];if(null!==this.gl_elems&&null!==this.wind_textures&&this.show_field){e instanceof Float32Array&&(e=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],_r(e),!1));var c=this.gl_elems,u=this.spec.BB_HEIGHT*(l/s)*this.size_multiplier,f=this.spec.BB_WIDTH/this.spec.BB_TEX_WIDTH,h=this.spec.BB_HEIGHT/this.spec.BB_TEX_HEIGHT;c.program.use({a_pos:c.vertices,a_tex_coord:c.texcoords},{u_bb_size:u,u_bb_width:f,u_bb_height:h,u_bb_mag_bin_size:this.spec.BB_MAG_BIN_SIZE,u_bb_mag_wrap:this.spec.BB_MAG_WRAP,u_offset:0,u_matrix:e,u_map_aspect:l/s,u_zoom:r,u_map_bearing:o},{u_sampler:c.texture,u_u_sampler:this.wind_textures.u,u_v_sampler:this.wind_textures.v,u_rot_sampler:c.proj_rot_texture}),null!==c.cmap_gpu?c.cmap_gpu.bindShaderVariables(c.program):c.program.setUniforms({u_bb_color:this.color.toRGBATuple()}),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),c.program.draw(),c.program.setUniforms({u_offset:-2}),c.program.draw(),c.program.setUniforms({u_offset:-1}),c.program.draw(),c.program.setUniforms({u_offset:1}),c.program.draw()}},t}(),br=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yr=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},wr=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},xr={BB_WIDTH:85,BB_HEIGHT:256,BB_TEX_WIDTH:1024,BB_TEX_HEIGHT:1024,BB_MAG_MAX:235,BB_MAG_WRAP:60,BB_MAG_BIN_SIZE:5},Tr={color:"#000000",cmap:null,line_width:2,barb_size_multiplier:1,thin_fac:1};const Er=function(t){function e(e,n){var r=t.call(this)||this;return r.fields=e,r.opts=A(n,Tr),r.color=yn.fromHex(r.opts.color),r.barb_texture=function(t,e){var n=document.createElement("canvas");function r(e,n,r,o){var i=t.BB_WIDTH/2-4,a=i/2;if(o<2.5)e.beginPath(),e.arc(n,r,i/2,0,2*Math.PI),e.stroke();else{var s=0,l=o,c=0,u=Math.floor((l+2.5)/50);c+=u*i/2+a+(u-1)*a/2,l-=50*u;var f=Math.floor((l+2.5)/10);c+=f*a,l-=10*f,c+=Math.floor((l+2.5)/5)*a,o<7.5&&(c+=a),c=Math.max(120,c),e.beginPath(),e.moveTo(n,r),e.lineTo(n,r+c),l=o,s=r+c;for(var h=!1,d=!0;l>47.5;)h&&(s+=a/2),d||e.moveTo(n,s),e.lineTo(n-i,s),e.lineTo(n,s-i/2),s-=i/2+a,l-=50,h=!0,d=!1;for(;l>7.5;)d||e.moveTo(n,s),e.lineTo(n-i,s+i/2),s-=a,l-=10,d=!1;for(o<7.5&&(s-=a);l>2.5;)e.moveTo(n,s),e.lineTo(n-i/2,s+i/4),l-=5;e.stroke()}}n.width=t.BB_TEX_WIDTH,n.height=t.BB_TEX_HEIGHT;var o=n.getContext("2d");if(null===o)throw"Could not get rendering context for the wind barb canvas";o.lineWidth=e,o.miterLimit=4;for(var i=0;i<=t.BB_MAG_MAX;i+=t.BB_MAG_BIN_SIZE)r(o,i%t.BB_MAG_WRAP/t.BB_MAG_BIN_SIZE*t.BB_WIDTH+t.BB_WIDTH/2,Math.floor(i/t.BB_MAG_WRAP)*t.BB_HEIGHT+t.BB_WIDTH/2,i);return n}(xr,r.opts.line_width/r.opts.barb_size_multiplier*4),r.gl_elems=null,r}return br(e,t),e.prototype.updateField=function(t){return yr(this,void 0,void 0,(function(){return wr(this,(function(e){return this.fields=t,null===this.gl_elems||(this.gl_elems.barb_billboards.updateField(t),this.gl_elems.map.triggerRepaint()),[2]}))}))},e.prototype.onAdd=function(t,e){return yr(this,void 0,void 0,(function(){var n,r,o,i;return wr(this,(function(a){switch(a.label){case 0:return e.getExtension("OES_texture_float"),e.getExtension("OES_texture_float_linear"),n=t.getMaxZoom(),r={format:e.RGBA,type:e.UNSIGNED_BYTE,image:this.barb_texture,mag_filter:e.NEAREST},o=null===this.opts.cmap?void 0:this.opts.cmap,[4,(i=new vr(this.fields,this.opts.thin_fac,n,r,xr,.1*this.opts.barb_size_multiplier,{color:this.color,cmap:o})).setup(e)];case 1:return a.sent(),this.gl_elems={map:t,barb_billboards:i},this.updateField(this.fields),[2]}}))}))},e.prototype.render=function(t,e){if(null!==this.gl_elems){var n=this.gl_elems,r=n.map.getZoom(),o=n.map.getCanvas().width,i=n.map.getCanvas().height,a=n.map.getBearing(),s=n.map.getPitch();n.barb_billboards.render(t,e,[o,i],r,a,s)}},e}(F);var Ar=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Sr=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},Rr=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},Fr=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Mr=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},Pr=n(431),Ir=n(714),Or={colors:["#000000"],opacity:1};const Cr=function(t){function e(e,n){var r=t.call(this)||this;return r.field=e,r.opts=A(n,Or),r.color_components=Mr([],Fr(r.opts.colors),!1).reverse().map((function(t){return yn.fromHex(t).toRGBATuple()})).flat(),r.gl_elems=null,r.fill_texture=null,r}return Ar(e,t),e.prototype.updateField=function(t){return Sr(this,void 0,void 0,(function(){var e,n,r,o,i,a,s;return Rr(this,(function(l){return this.field=t,null===this.gl_elems||((e=this.gl_elems.gl).pixelStorei(e.UNPACK_ALIGNMENT,2),n=this.field.getTextureData(),r=M(e,!(n instanceof Float32Array)),o=r.format,i=r.type,a=r.row_alignment,s={format:o,type:i,width:this.field.grid.ni,height:this.field.grid.nj,image:n,mag_filter:e.NEAREST,row_alignment:a},null===this.fill_texture?this.fill_texture=new B(e,s):this.fill_texture.setImageData(s)),[2]}))}))},e.prototype.onAdd=function(t,e){return Sr(this,void 0,void 0,(function(){var t,n,r,o,i,a;return Rr(this,(function(s){switch(s.label){case 0:return e.getExtension("OES_texture_float"),t=new G(e,Pr,Ir),[4,this.field.grid.getWGLBuffers(e)];case 1:return n=s.sent(),r=n.vertices,o=n.texcoords,i=r,a=o,this.gl_elems={gl:e,program:t,vertices:i,texcoords:a},this.updateField(this.field),[2]}}))}))},e.prototype.render=function(t,e){if(null!==this.gl_elems&&null!==this.fill_texture){var n=this.gl_elems;e instanceof Float32Array&&(e=Mr([],Fr(e),!1)),n.program.use({a_pos:n.vertices,a_tex_coord:n.texcoords},{u_matrix:e,u_opacity:this.opts.opacity,u_colors:this.color_components,u_num_colors:this.opts.colors.length,u_offset:0},{u_fill_sampler:this.fill_texture}),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),n.program.draw(),n.program.setUniforms({u_offset:-2}),n.program.draw(),n.program.setUniforms({u_offset:-1}),n.program.draw(),n.program.setUniforms({u_offset:1}),n.program.draw()}},e}(F);var Nr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Br=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},kr=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},Gr=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Lr=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},Dr={BB_WIDTH:256,BB_HEIGHT:256,BB_TEX_WIDTH:256,BB_TEX_HEIGHT:256,BB_MAG_MAX:1e3,BB_MAG_WRAP:1e3,BB_MAG_BIN_SIZE:1e3},Ur={bgcolor:"#000000",thin_fac:1,hodo_line_width:2.5,background_line_width:1.5,height_cmap:new Tn([0,1,3,6,9],["#ffffcc","#a1dab4","#41b6c4","#225ea8"])};const jr=function(t){function e(e,n){var r=t.call(this)||this;return r.profile_field=e,r.opts=A(n,Ur),r.hodo_bg_texture=function(t){var e=document.createElement("canvas");e.width=Dr.BB_TEX_WIDTH,e.height=Dr.BB_TEX_HEIGHT;var n=e.getContext("2d");if(null===n)throw"Could not get rendering context for the hodograph background canvas";n.lineWidth=t;for(var r=Dr.BB_TEX_WIDTH/4;r<=Dr.BB_TEX_WIDTH/2;r+=Dr.BB_TEX_WIDTH/4)n.beginPath(),n.arc(Dr.BB_TEX_WIDTH/2,Dr.BB_TEX_WIDTH/2,r-t/2,0,2*Math.PI),n.stroke();var o=Dr.BB_TEX_WIDTH/2,i=Dr.BB_TEX_WIDTH/2;return n.beginPath(),n.moveTo(o,i),n.lineTo(o+10,i+20),n.lineTo(o-10,i+20),n.lineTo(o,i),n.fill(),e}(2.5*r.opts.background_line_width),r.hodo_scale=(Dr.BB_TEX_WIDTH-r.opts.background_line_width/2)/(40*Dr.BB_TEX_WIDTH),r.bg_size=140,r.gl_elems=null,r.line_elems=null,r}return Nr(e,t),e.prototype.updateField=function(t){return Br(this,void 0,void 0,(function(){var e,n,r,o,i,a,s=this;return kr(this,(function(l){switch(l.label){case 0:return this.profile_field=t,null===this.gl_elems?[2]:(e=this.gl_elems.gl,this.gl_elems.bg_billboard.updateField(t.getStormMotionGrid()),n=this.profile_field.profiles,r=n.map((function(t){var e=x(t.jlat,t.ilon,s.opts.thin_fac);return{offsets:Lr([],Gr(t.u),!1).map((function(e,n){return[e-t.smu,t.v[n]-t.smv]})),vertices:Lr([],Gr(t.u),!1).map((function(e){return[t.lon,t.lat]})),zoom:e,data:Lr([],Gr(t.z),!1)}})),[4,kn.make(e,r,{line_width:this.opts.hodo_line_width,cmap:this.opts.height_cmap,offset_scale:this.hodo_scale*this.bg_size})]);case 1:return o=l.sent(),i=n.map((function(t){var e=x(t.jlat,t.ilon,s.opts.thin_fac),n=Math.hypot(t.smu,t.smv),r=Math.PI/2-Math.atan2(-t.smv,-t.smu);return{offsets:[[2*Math.sin(r),2*Math.cos(r)],[n*Math.sin(r),n*Math.cos(r)]],vertices:[[t.lon,t.lat],[t.lon,t.lat]],zoom:e}})),[4,kn.make(e,i,{line_width:this.opts.background_line_width,color:this.opts.bgcolor,offset_scale:this.hodo_scale*this.bg_size})];case 2:return a=l.sent(),this.line_elems={hodo_line:o,sm_line:a},[2]}}))}))},e.prototype.onAdd=function(t,e){return Br(this,void 0,void 0,(function(){var n,r,o;return kr(this,(function(i){switch(i.label){case 0:return n={format:e.RGBA,type:e.UNSIGNED_BYTE,image:this.hodo_bg_texture,mag_filter:e.NEAREST},r=t.getMaxZoom(),[4,(o=new vr(this.profile_field.getStormMotionGrid(),this.opts.thin_fac,r,n,Dr,.004*this.bg_size,{color:yn.fromHex(this.opts.bgcolor)})).setup(e)];case 1:return i.sent(),this.gl_elems={gl:e,map:t,bg_billboard:o},this.updateField(this.profile_field),[2]}}))}))},e.prototype.render=function(t,e){if(null!==this.gl_elems&&null!==this.line_elems){var n=this.gl_elems,r=this.line_elems,o=n.map.getZoom(),i=n.map.getCanvas().width,a=n.map.getCanvas().height,s=n.map.getBearing(),l=n.map.getPitch();r.hodo_line.render(t,e,[i,a],o,s,l),r.sm_line.render(t,e,[i,a],o,s,s),n.bg_billboard.render(t,e,[i,a],o,s,l)}},e}(F);var Hr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),zr=function(){function t(t){this.type="custom",this.id=t,this.map=null}return t.prototype.repaint=function(){null!==this.map&&this.map.triggerRepaint()},t}(),Wr=function(t){function e(e,n){var r=t.call(this,e)||this;return r.field=n,r}return Hr(e,t),e.prototype.onAdd=function(t,e){return n=this,r=void 0,i=function(){return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(n){switch(n.label){case 0:return this.map=t,[4,this.field.onAdd(t,e)];case 1:return n.sent(),[2]}}))},new((o=void 0)||(o=Promise))((function(t,e){function a(t){try{l(i.next(t))}catch(t){e(t)}}function s(t){try{l(i.throw(t))}catch(t){e(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(a,s)}l((i=i.apply(n,r||[])).next())}));var n,r,o,i},e.prototype.render=function(t,e){this.field.render(t,e)},e}(zr),Vr=function(t){function e(e){var n=t.call(this,e)||this;return n.fields={},n.field_key=null,n.map=null,n.gl=null,n}return Hr(e,t),e.prototype.onAdd=function(t,e){var n=this;this.map=t,this.gl=e,Object.values(this.fields).forEach((function(r){r.onAdd(t,e).then((function(t){n.repaint()}))})),this.repaint()},e.prototype.render=function(t,e){null!==this.map&&null!==this.gl&&null!==this.field_key&&this.fields.hasOwnProperty(this.field_key)&&null!==this.fields[this.field_key]&&this.fields[this.field_key].render(t,e)},e.prototype.setActiveKey=function(t){this.field_key,this.field_key=t,this.repaint()},e.prototype.getKeys=function(){return Object.keys(this.fields)},e.prototype.addField=function(t,e){var n=this;this.field_key,null!==this.map&&null!==this.gl&&null!==t&&t.onAdd(this.map,this.gl).then((function(t){n.repaint()})),this.fields[e]=t,null===this.field_key&&(this.field_key=e)},e}(zr),$r=function(){return $r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},$r.apply(this,arguments)},Yr=function(t,e,n){var r=document.createElementNS("http://www.w3.org/2000/svg",t);return void 0!==e&&Object.entries(e).forEach((function(t){var e=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}(t,2),n=e[0],o=e[1];r.setAttribute(n,o.toString())})),void 0!==n&&n.appendChild(r),r};function Xr(t,e){var n=e.label||"",r=e.ticks||t.levels,o=e.orientation||"vertical",i=e.fontface||"sans-serif",a=e.ticklabelsize||12,s=e.tick_direction||("vertical"==o?"left":"bottom");if("vertical"==o&&("top"==s||"bottom"==s)||"horizontal"==o&&("left"==s||"right"==s))throw"tick_direction of '".concat(s," doesn't match an orientation of ").concat(o);var l,c,u,f,h,d,p,_,m,g,v,b=function(t){return t.toString().length},y=b(r[0]),w=b(r[r.length-1]),x=null!==t.underflow_color||null!==t.overflow_color,T=600,E=T/9,A=Math.max("horizontal"==o?6*Math.max(y,w):8,x?E/(2*Math.sqrt(3)):0);"vertical"==o?(l=T,c=E,p=(u="left"==s?53.66666666666667:3)+(h=10),m=u+h/2,_=(f=A)+(d=T-2*A),g=null===t.underflow_color?_:_+E/(2*Math.sqrt(3)),v=null===t.overflow_color?f:f-E/(2*Math.sqrt(3))):(c=T,l=E-6,p=(u=A)+(h=T-2*A),m=(f="bottom"==s?3:47.66666666666667)+(d=10)/2,_=f+d,g=null===t.underflow_color?u:u-E/(2*Math.sqrt(3)),v=null===t.overflow_color?p:p+E/(2*Math.sqrt(3)));var S,R=t.colors.length,F=Yr("svg",{width:c,height:l}),M=Yr("g",{},F);S="vertical"==o?"left"==s?{"text-anchor":"end",transform:"translate(".concat(u,", ").concat(f,")")}:{transform:"translate(".concat(u+h,", ").concat(f,")")}:"bottom"==s?{"text-anchor":"middle",transform:"translate(".concat(u,", ").concat(f+d,")")}:{"text-anchor":"middle",transform:"translate(".concat(u,", ").concat(f,")")};var P=Yr("g",S,F);if(t.colors.forEach((function(t,e){Yr("rect",$r($r({},"vertical"==o?{x:u,y:f+d*(1-(e+1)/R),width:h,height:d/R}:{x:u+h*e/R,y:f,width:h/R,height:d}),{fill:t.toRGBHex(),opacity:t.a}),M)})),null!==t.underflow_color){var I={points:"vertical"==o?"".concat(p," ").concat(_,", ").concat(m," ").concat(g,", ").concat(u," ").concat(_,", ").concat(p," ").concat(_):"".concat(u," ").concat(_,", ").concat(g," ").concat(m,", ").concat(u," ").concat(f,", ").concat(u," ").concat(_),fill:t.underflow_color.toRGBHex(),opacity:t.underflow_color.a};Yr("polygon",I,M)}if(null!==t.overflow_color){var O={points:"vertical"==o?"".concat(u," ").concat(f,", ").concat(m," ").concat(v,", ").concat(p," ").concat(f,", ").concat(u," ").concat(f):"".concat(p," ").concat(f,", ").concat(v," ").concat(m,", ").concat(p," ").concat(_,", ").concat(p," ").concat(f),fill:t.overflow_color.toRGBHex(),opacity:t.overflow_color.a};Yr("polygon",O,M)}var C,N,B=t.levels[0],k=t.levels[t.levels.length-1];return r.filter((function(t){return B<=t&&t<=k})).forEach((function(e){var n=t.levels.map((function(t){return Math.abs(t-e)})),r=n.indexOf(n.reduce((function(t,e){return Math.min(t,e)})));e<=t.levels[r]&&r>0&&(r-=1),r+=(e-t.levels[r])/(t.levels[r+1]-t.levels[r]);var l="vertical"==o?{transform:"translate(0, ".concat(d*(1-r/R),")")}:{transform:"translate(".concat(h*r/R,", 0)")},c=Yr("g",l,P);Yr("line",$r($r({},"vertical"==o?"left"==s?{x2:-6}:{x2:6}:"bottom"==s?{y2:6}:{y2:-6}),{stroke:"#000000","stroke-width":1.5}),c),Yr("text",$r($r({},"vertical"==o?"left"==s?{x:-9,dy:"0.32em"}:{x:9,dy:"0.32em"}:"bottom"==s?{y:9,dy:"0.8em"}:{y:-9,dy:"0em"}),{fill:"#000000",style:"font-family: ".concat(i,"; font-size: ").concat(a,"pt")}),c).textContent=e.toString()})),C="vertical"==o?"".concat(u," ").concat(f,", ").concat(m," ").concat(v,", ").concat(p," ").concat(f,", ").concat(p," ").concat(_,", ")+"".concat(m," ").concat(g,", ").concat(u," ").concat(_,", ").concat(u," ").concat(f):"".concat(u," ").concat(f,", ").concat(p," ").concat(f,", ").concat(v," ").concat(m,", ").concat(p," ").concat(_,", ")+"".concat(u," ").concat(_,", ").concat(g," ").concat(m,", ").concat(u," ").concat(f),Yr("polygon",{points:C,stroke:"#000000","stroke-width":1.5,fill:"none"},F),N="vertical"==o?"left"==s?{transform:"translate(15, ".concat(l/2,") rotate(-90)")}:{transform:"translate(".concat(c-6,", ").concat(l/2,") rotate(-90)")}:"bottom"==s?{transform:"translate(".concat(c/2,", ").concat(l-5,")")}:{transform:"translate(".concat(c/2,", 15)")},Yr("text",$r($r({},N),{fill:"#000000","text-anchor":"middle",style:"font-family: ".concat(i,";")}),F).textContent=n,F}function Jr(t,e,n){if(t.length!=e.length)throw"Mismatch between the number of colors (".concat(t.length,") and the number of labels (").concat(e.length,")");var r=void 0===(n=void 0===n?{}:n).n_cols?1:n.n_cols,o=void 0===n.fontface?"sans-serif":n.fontface,i=Math.ceil(t.length/r),a=Yr("svg",{width:123*r+5*(r+1),height:20*i+5*(i+1)}),s=Yr("g",{},a);return t.forEach((function(t,n){var r=e[n],a=n%i,l=Math.floor(n/i),c=1;"string"!=typeof t&&(c=t.a,t=t.toRGBHex());var u=5+128*l,f=5+25*a;Yr("rect",{x:u,y:f,fill:t,opacity:c,width:20,height:20},s),Yr("text",$r($r({},{x:u+20+3,y:f+10,dy:"0.32em"}),{fill:"#000000",style:"font-size: 0.8em; font-family: ".concat(o,";")}),s).textContent=r})),a}var Zr=n(176),qr=n.n(Zr);n.p;var Kr=null;function Qr(){return null===Kr&&(Kr=qr()()),Kr}function to(t,e,n){return r=this,o=void 0,a=function(){var r,o,i,a,s,l;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(c){switch(c.label){case 0:if(void 0===n.interval&&void 0===n.levels)throw"Must supply either an interval or levels to contourCreator()";return r=void 0===n.interval?0:n.interval,[4,Qr()];case 1:return o=c.sent(),i=e.getGridCoords(),a=t instanceof Float32Array?o.getContourLevelsFloat32:o.getContourLevelsFloat16,s=t instanceof Float32Array?o.makeContoursFloat32:o.makeContoursFloat16,l=void 0===n.levels?a(t,e.ni,e.nj,r):n.levels,[2,s(t,i.x,i.y,l,(function(t,n){return e.transform(t,n,{inverse:!0})}))]}}))},new((i=void 0)||(i=Promise))((function(t,e){function n(t){try{l(a.next(t))}catch(t){e(t)}}function s(t){try{l(a.throw(t))}catch(t){e(t)}}function l(e){var r;e.done?t(e.value):(r=e.value,r instanceof i?r:new i((function(t){t(r)}))).then(n,s)}l((a=a.apply(r,o||[])).next())}));var r,o,i,a}var eo=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},no=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},ro=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},oo=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},io=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))};function ao(t){return t.constructor}var so=function(){function t(t,e){var n=this;if(this.grid=t,this.data=e,t.ni*t.nj!=e.length)throw"Data size (".concat(e.length,") doesn't match the grid dimensions (").concat(t.ni," x ").concat(t.nj,"; expected ").concat(t.ni*t.nj," points)");this.contour_cache=new E((function(t){return eo(n,void 0,void 0,(function(){return no(this,(function(e){switch(e.label){case 0:return[4,to(this.data,this.grid,t)];case 1:return[2,e.sent()]}}))}))}))}return t.prototype.getTextureData=function(){var t=this.data;return t instanceof Float32Array?t:new Uint16Array(t.buffer)},t.prototype.getContours=function(t){return eo(this,void 0,void 0,(function(){return no(this,(function(e){switch(e.label){case 0:return[4,this.contour_cache.getValue(t)];case 1:return[2,e.sent()]}}))}))},t.aggregateFields=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];function o(t,e){var n,r,o,i,a,s;return no(this,(function(l){switch(l.label){case 0:l.trys.push([0,5,6,7]),n=ro(t),r=n.next(),l.label=1;case 1:return r.done?[3,4]:(o=r.value,[4,e(o)]);case 2:l.sent(),l.label=3;case 3:return r=n.next(),[3,1];case 4:return[3,7];case 5:return i=l.sent(),a={error:i},[3,7];case 6:try{r&&!r.done&&(s=n.return)&&s.call(n)}finally{if(a)throw a.error}return[7];case 7:return[2]}}))}var i=ao(n[0].data),a=T.apply(void 0,io([],oo(n.map((function(t){return t.data}))),!1)),s=new i(o(a,(function(t){return e.apply(void 0,io([],oo(t),!1))})));return new t(n[0].grid,s)},t}(),lo=function(){function t(t,e,n,r){r=void 0===r?{}:r,this.u=new so(t,e),this.v=new so(t,n),this.relative_to=void 0===r.relative_to?"grid":r.relative_to}return t.prototype.getTextureData=function(){var t=this.u.data,e=this.v.data;return{u:t instanceof Float32Array?t:new Uint16Array(t.buffer),v:e instanceof Float32Array?e:new Uint16Array(e.buffer)}},t.prototype.getThinnedField=function(e,n){var r=this,o=this.grid.getThinnedGrid(e,n),i=function(t){for(var i=new(ao(t))(o.ni*o.nj),a=0;a<o.ni;a++)for(var s=0;s<o.nj;s++){var l=a*e+r.grid.ni*s*n;i[a+o.ni*s]=t[l]}return i},a=i(this.u.data),s=i(this.v.data);return new t(o,a,s,{relative_to:this.relative_to})},Object.defineProperty(t.prototype,"grid",{get:function(){return this.u.grid},enumerable:!1,configurable:!0}),t}(),co=function(){function t(t,e){this.profiles=e,this.grid=t}return t.prototype.getStormMotionGrid=function(){var t=this,e=this.profiles,n=new gn(this.grid.ni*this.grid.nj).fill(parseFloat("nan")),r=new gn(this.grid.ni*this.grid.nj).fill(parseFloat("nan"));return e.forEach((function(e){var o=e.ilon+t.grid.ni*e.jlat;n[o]=e.smu,r[o]=e.smv})),new lo(this.grid,n,r,{relative_to:"grid"})},t}(),uo=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),fo=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},ho=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},po=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},_o=function(){function t(t,e,n,r){var o=this;this.type=t,this.is_conformal=e,this.ni=n,this.nj=r,this.buffer_cache=new E((function(t){var e=Math.max(Math.floor(o.ni/50),20),n=Math.max(Math.floor(o.nj/50),20);return function(t,e,n){return fo(this,void 0,void 0,(function(){var r,o,i,a,s,l,c,u,f,h,d;return ho(this,(function(p){switch(p.label){case 0:return r=1/(2*(n=void 0!==n?n:e).ni),o=1/(2*n.nj),i=e.ni*e.nj/(n.ni*n.nj),a=e.getEarthCoords(),s=a.lats,l=a.lons,[4,R.makeDomainVerticesAndTexCoords(s,l,e.ni,e.nj,r,o)];case 1:for(c=p.sent(),u=0;u<c.grid_cell_size.length;u++)c.grid_cell_size[u]*=i;return f=new C(t,c.vertices,2,t.TRIANGLE_STRIP),h=new C(t,c.tex_coords,2,t.TRIANGLE_STRIP),d=new C(t,c.grid_cell_size,1,t.TRIANGLE_STRIP),[2,{vertices:f,texcoords:h,cellsize:d}]}}))}))}(t,o.copy({ni:e,nj:n}),o)})),this.billboard_buffer_cache=new E((function(t,e,n){return function(t,e,n,r){return fo(this,void 0,void 0,(function(){var o,i,a,s,l,c;return ho(this,(function(u){switch(u.label){case 0:return o=e.getEarthCoords(),i=o.lats,a=o.lons,[4,R.makeBBElements(i,a,e.ni,e.nj,n,r)];case 1:return s=u.sent(),l=new C(t,s.pts,3,t.TRIANGLE_STRIP),c=new C(t,s.tex_coords,2,t.TRIANGLE_STRIP),[2,{vertices:l,texcoords:c}]}}))}))}(t,o,e,n)})),this.vector_rotation_cache=new E((function(t){return function(t,e){var n=e.getEarthCoords();e.is_conformal||console.warn("Vector rotations for non-conformal projections are not supported. The output may look incorrect.");for(var r=new gn(n.lats.length),o=0;o<n.lats.length;o++){var i=n.lons[o],a=n.lats[o],s=po(e.transform(i,a),2),l=s[0],c=s[1],u=po(e.transform(i+.01,a),2),f=u[0],h=u[1];r[o]=Math.atan2(h-c,f-l)}var d=M(t,!0),p={format:d.format,type:d.type,row_alignment:d.row_alignment,image:new Uint16Array(r.buffer),width:e.ni,height:e.nj,mag_filter:t.LINEAR};return{rotation:new B(t,p)}}(t,o)}))}return t.prototype.getWGLBuffers=function(t){return fo(this,void 0,void 0,(function(){return ho(this,(function(e){switch(e.label){case 0:return[4,this.buffer_cache.getValue(t)];case 1:return[2,e.sent()]}}))}))},t.prototype.getWGLBillboardBuffers=function(t,e,n){return fo(this,void 0,void 0,(function(){return ho(this,(function(r){switch(r.label){case 0:return[4,this.billboard_buffer_cache.getValue(t,e,n)];case 1:return[2,r.sent()]}}))}))},t.prototype.getVectorRotationTexture=function(t){return this.vector_rotation_cache.getValue(t)},t}(),mo=function(t){function e(e,n,r,o,i,a){var s=t.call(this,"latlon",!0,e,n)||this;s.ll_lon=r,s.ll_lat=o,s.ur_lon=i,s.ur_lat=a;var l=(s.ur_lon-s.ll_lon)/(s.ni-1),c=(s.ur_lat-s.ll_lat)/(s.nj-1);return s.ll_cache=new E((function(){for(var t=new Float32Array(s.ni*s.nj),e=new Float32Array(s.ni*s.nj),n=0;n<s.ni;n++)for(var r=0;r<s.nj;r++){var o=n+r*s.ni;t[o]=s.ll_lon+n*l,e[o]=s.ll_lat+r*c}return{lons:t,lats:e}})),s.gc_cache=new E((function(){for(var t=new Float32Array(s.ni),e=new Float32Array(s.nj),n=0;n<s.ni;n++)t[n]=s.ll_lon+n*l;for(var r=0;r<s.nj;r++)e[r]=s.ll_lat+r*c;return{x:t,y:e}})),s}return uo(e,t),e.prototype.copy=function(t){return new e(void 0!==(t=void 0!==t?t:{}).ni?t.ni:this.ni,void 0!==t.nj?t.nj:this.nj,void 0!==t.ll_lon?t.ll_lon:this.ll_lon,void 0!==t.ll_lat?t.ll_lat:this.ll_lat,void 0!==t.ur_lon?t.ur_lon:this.ur_lon,void 0!==t.ur_lat?t.ur_lat:this.ur_lat)},e.prototype.getEarthCoords=function(){return this.ll_cache.getValue()},e.prototype.getGridCoords=function(){return this.gc_cache.getValue()},e.prototype.transform=function(t,e,n){return[t,e]},e.prototype.getThinnedGrid=function(t,n){var r=(this.ur_lon-this.ll_lon)/this.ni,o=(this.ur_lat-this.ll_lat)/this.nj,i=Math.ceil(this.ni/t),a=Math.ceil(this.nj/n),s=(this.ni-1)%t,l=(this.nj-1)%n;return new e(i,a,this.ll_lon,this.ll_lat,this.ur_lon-s*r,this.ur_lat-l*o)},e}(_o),go=function(t){function e(e,n,r,o,i,a,s,l,c){var u=t.call(this,"latlonrot",!0,e,n)||this;u.np_lon=r,u.np_lat=o,u.lon_shift=i,u.ll_lon=a,u.ll_lat=s,u.ur_lon=l,u.ur_lat=c,u.llrot=function(t){var e=Math.PI/180,n=t.np_lat*e,r=t.np_lon*e,o=t.lon_shift*e,i=Math.sin(n),a=Math.cos(n);return function(t,n,s){return(s=void 0===s?{inverse:!1}:s).inverse?function(t,n){t*=e,n*=e;var s=Math.sin(n),l=Math.cos(n),c=Math.sin(t-r),u=Math.cos(t-r),f=Math.asin(i*s+a*l*u),h=o+Math.atan2(l*c,i*l*u-a*s);return t>Math.PI&&(t-=2*Math.PI),[h/e,f/e]}(t,n):function(t,n){t*=e,n*=e;var s=Math.sin(n),l=Math.cos(n),c=Math.sin(t-o),u=Math.cos(t-o),f=Math.asin(i*s-a*l*u),h=r+Math.atan2(l*c,i*l*u+a*s);return h>Math.PI&&(h-=2*Math.PI),[h/e,f/e]}(t,n)}}({np_lon:r,np_lat:o,lon_shift:i});var f=(u.ur_lon-u.ll_lon)/(u.ni-1),h=(u.ur_lat-u.ll_lat)/(u.nj-1);return u.ll_cache=new E((function(){for(var t=new Float32Array(u.ni*u.nj),e=new Float32Array(u.ni*u.nj),n=0;n<u.ni;n++)for(var r=u.ll_lon+n*f,o=0;o<u.nj;o++){var i=u.ll_lat+o*h,a=po(u.llrot(r,i),2),s=a[0],l=a[1],c=n+o*u.ni;t[c]=s,e[c]=l}return{lons:t,lats:e}})),u.gc_cache=new E((function(){for(var t=new Float32Array(u.ni),e=new Float32Array(u.nj),n=0;n<u.ni;n++)t[n]=u.ll_lon+n*f;for(var r=0;r<u.nj;r++)e[r]=u.ll_lat+r*h;return{x:t,y:e}})),u}return uo(e,t),e.prototype.copy=function(t){var n=void 0!==(t=void 0!==t?t:{}).ni?t.ni:this.ni,r=void 0!==t.nj?t.nj:this.nj,o=void 0!==t.ll_lon?t.ll_lon:this.ll_lon,i=void 0!==t.ll_lat?t.ll_lat:this.ll_lat,a=void 0!==t.ur_lon?t.ur_lon:this.ur_lon,s=void 0!==t.ur_lat?t.ur_lat:this.ur_lat;return new e(n,r,this.np_lon,this.np_lat,this.lon_shift,o,i,a,s)},e.prototype.getEarthCoords=function(){return this.ll_cache.getValue()},e.prototype.getGridCoords=function(){return this.gc_cache.getValue()},e.prototype.transform=function(t,e,n){var r="inverse"in(n=void 0===n?{}:n)&&n.inverse;return this.llrot(t,e,{inverse:!r})},e.prototype.getThinnedGrid=function(t,n){var r=(this.ur_lon-this.ll_lon)/this.ni,o=(this.ur_lat-this.ll_lat)/this.nj,i=Math.ceil(this.ni/t),a=Math.ceil(this.nj/n),s=(this.ni-1)%t,l=(this.nj-1)%n,c=this.ll_lon,u=this.ll_lat,f=this.ur_lon-s*r,h=this.ur_lat-l*o;return new e(i,a,this.np_lon,this.np_lat,this.lon_shift,c,u,f,h)},e}(_o),vo=function(t){function e(e,n,r,o,i,a,s,l,c){var u=t.call(this,"lcc",!0,e,n)||this;u.lon_0=r,u.lat_0=o,u.lat_std=i,u.ll_x=a,u.ll_y=s,u.ur_x=l,u.ur_y=c,u.lcc=P({lon_0:r,lat_0:o,lat_std:i});var f=(u.ur_x-u.ll_x)/(u.ni-1),h=(u.ur_y-u.ll_y)/(u.nj-1);return u.ll_cache=new E((function(){for(var t=new Float32Array(u.ni*u.nj),e=new Float32Array(u.ni*u.nj),n=0;n<u.ni;n++)for(var r=u.ll_x+n*f,o=0;o<u.nj;o++){var i=u.ll_y+o*h,a=po(u.lcc(r,i,{inverse:!0}),2),s=a[0],l=a[1],c=n+o*u.ni;t[c]=s,e[c]=l}return{lons:t,lats:e}})),u.gc_cache=new E((function(){for(var t=new Float32Array(u.ni),e=new Float32Array(u.nj),n=0;n<u.ni;n++)t[n]=u.ll_x+n*f;for(var r=0;r<u.nj;r++)e[r]=u.ll_y+r*h;return{x:t,y:e}})),u}return uo(e,t),e.fromLLCornerLonLat=function(t,n,r,o,i,a,s,l,c){var u=P({lon_0:r,lat_0:o,lat_std:i}),f=po(u(a,s),2),h=f[0],d=f[1];return new e(t,n,r,o,i,h,d,h+t*l,d+n*c)},e.prototype.copy=function(t){var n=void 0!==(t=void 0!==t?t:{}).ni?t.ni:this.ni,r=void 0!==t.nj?t.nj:this.nj,o=void 0!==t.ll_x?t.ll_x:this.ll_x,i=void 0!==t.ll_y?t.ll_y:this.ll_y,a=void 0!==t.ur_x?t.ur_x:this.ur_x,s=void 0!==t.ur_y?t.ur_y:this.ur_y;return new e(n,r,this.lon_0,this.lat_0,this.lat_std,o,i,a,s)},e.prototype.getEarthCoords=function(){return this.ll_cache.getValue()},e.prototype.getGridCoords=function(){return this.gc_cache.getValue()},e.prototype.transform=function(t,e,n){var r=void 0!==(n=void 0===n?{}:n).inverse&&n.inverse;return this.lcc(t,e,{inverse:r})},e.prototype.getThinnedGrid=function(t,n){var r=(this.ur_x-this.ll_x)/this.ni,o=(this.ur_y-this.ll_y)/this.nj,i=Math.ceil(this.ni/t),a=Math.ceil(this.nj/n),s=(this.ni-1)%t,l=(this.nj-1)%n,c=this.ll_x,u=this.ll_y,f=this.ur_x-s*r,h=this.ur_y-l*o;return new e(i,a,this.lon_0,this.lat_0,this.lat_std,c,u,f,h)},e}(_o),bo={bluered:function(t,e,n){return Tn.diverging("#0000ff","#ff0000",t,e,n)},redblue:function(t,e,n){return Tn.diverging("#ff0000","#0000ff",t,e,n)},pw_speed500mb:An,pw_speed850mb:Sn,pw_cape:Rn,pw_t2m:Fn,pw_td2m:Mn,nws_storm_clear_refl:Pn};function yo(){Qr()}})(),r})()));
|
|
2
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.apgl=e():t.apgl=e()}(this,()=>(()=>{var t={251:(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*_}},254:t=>{t.exports="#version 300 es\n\nin highp vec2 v_tex_coord;\n\n#ifdef COLORMAP\nin highp float v_mag;\n#else\nuniform lowp vec4 u_bb_color;\n#endif\n\nuniform sampler2D u_sampler;\n\nout highp vec4 fragColor;\n\nvoid main() {\n lowp vec4 tex_color = texture(u_sampler, v_tex_coord);\n\n lowp vec4 color;\n#ifdef COLORMAP\n color = apply_colormap(v_mag);\n#else\n color = u_bb_color;\n#endif\n\n color.a *= tex_color.a;\n fragColor = color; // mix(vec4(1.0, 0.0, 0.0, 0.5), color, tex_color.a);\n}"},303:t=>{t.exports="#version 300 es\n\nuniform int u_offset;\n\nin vec2 a_pos;\nin vec2 a_tex_coord;\n\nout highp vec2 v_tex_coord;\n\nvoid main() {\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n gl_Position = projectTile(a_pos.xy + globe_offset);\n v_tex_coord = a_tex_coord;\n}"},317: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)},335:(t,e,n)=>{"use strict";t.exports=o;var r=n(251);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))}}},374:t=>{t.exports="\nuniform sampler2D u_cmap_sampler;\nuniform sampler2D u_cmap_nonlin_sampler;\nuniform highp float u_cmap_min;\nuniform highp float u_cmap_max;\nuniform highp vec4 u_underflow_color;\nuniform highp vec4 u_overflow_color;\nuniform int u_n_index;\n\nlowp vec4 apply_colormap(highp float value) {\n lowp float normed_val = (value - u_cmap_min) / (u_cmap_max - u_cmap_min);\n \n lowp vec4 color;\n if (normed_val < 0.0) {\n color = u_underflow_color;\n }\n else if (normed_val > 1.0) {\n color = u_overflow_color;\n }\n else {\n lowp float index_buffer = 1. / (2. * float(u_n_index));\n normed_val = index_buffer + normed_val * (1. - 2. * index_buffer); // Chop off the half pixels on either end of the texture\n highp float nonlin_val = texture(u_cmap_nonlin_sampler, vec2(normed_val, 0.5)).r;\n color = texture(u_cmap_sampler, vec2(nonlin_val, 0.5));\n }\n\n return color;\n}"},375:t=>{t.exports="#version 300 es\n\n#define MAX_N_COLORS 24\n\nin 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\nout highp vec4 fragColor;\n\nvoid main() {\n highp float fill_val = texture(u_fill_sampler, v_tex_coord).r;\n \n if (fill_val < 0.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 fragColor = color;\n}"},401:t=>{t.exports="#version 300 es\n\nin highp vec2 v_tex_coord;\n\nuniform sampler2D u_fill_sampler;\n\n#ifdef MASK\nuniform sampler2D u_mask_sampler;\n#endif\n\nuniform highp float u_opacity;\n#ifdef MASK\nuniform int u_mask_val;\n#endif\n\nout highp vec4 fragColor;\n\nvoid main() {\n highp float fill_val = texture(u_fill_sampler, v_tex_coord).r;\n\n int draw_mask = 1;\n\n#ifdef MASK\n highp float mask_val = texture(u_mask_sampler, v_tex_coord).r;\n draw_mask = int(mask_val * 255.0) == u_mask_val ? 1 : 0;\n#endif\n\n if (isnan(fill_val) || draw_mask == 0) {\n discard;\n }\n\n lowp vec4 color = apply_colormap(fill_val);\n color.a = color.a * u_opacity;\n fragColor = color;\n}"},533:t=>{var e,n=(e="undefined"!=typeof document?document.currentScript?.src:void 0,function(t={}){var n,r,o,i=t,a=new Promise((t,e)=>{r=t,o=e});if(["getExceptionMessage","incrementExceptionRefcount","decrementExceptionRefcount","_memory","___indirect_function_table","onRuntimeInitialized"].forEach(t=>{Object.getOwnPropertyDescriptor(a,t)||Object.defineProperty(a,t,{get:()=>G("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:()=>G("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")})}),i.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 s,l=Object.assign({},i),c="";if("undefined"!=typeof document&&document.currentScript&&(c=document.currentScript.src),e&&(c=e),c=c.startsWith("blob:")?"":c.substr(0,c.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?)");s=t=>(E(!U(t),"readAsync does not work with file:// URLs"),fetch(t,{credentials:"same-origin"}).then(t=>t.ok?t.arrayBuffer():Promise.reject(new Error(t.status+" : "+t.url))));var u,f,h,d=i.print||console.log.bind(console),p=i.printErr||console.error.bind(console);Object.assign(i,l),l=null,u="fetchSettings",Object.getOwnPropertyDescriptor(i,u)&&G(`\`Module.${u}\` was supplied but \`${u}\` not included in INCOMING_MODULE_JS_API`),i.arguments&&i.arguments,X("arguments","arguments_"),i.thisProgram&&i.thisProgram,X("thisProgram","thisProgram"),i.quit&&i.quit,X("quit","quit_"),E(void 0===i.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),E(void 0===i.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),E(void 0===i.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),E(void 0===i.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),E(void 0===i.read,"Module.read option was removed"),E(void 0===i.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),E(void 0===i.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),E(void 0===i.setWindowTitle,"Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"),E(void 0===i.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),X("asm","wasmExports"),X("readAsync","readAsync"),X("readBinary","readBinary"),X("setWindowTitle","setWindowTitle"),E(!0,"worker environment detected but not enabled at build time. Add `worker` to `-sENVIRONMENT` to enable."),E(!0,"node environment detected but not enabled at build time. Add `node` to `-sENVIRONMENT` to enable."),E(!0,"shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable."),i.wasmBinary&&(f=i.wasmBinary),X("wasmBinary","wasmBinary"),"object"!=typeof WebAssembly&&p("no native wasm support detected");var _,m,g,v,b,y,w,x,T=!1;function E(t,e){t||G("Assertion failed"+(e?": "+e:""))}function A(){var t=h.buffer;i.HEAP8=_=new Int8Array(t),i.HEAP16=g=new Int16Array(t),i.HEAPU8=m=new Uint8Array(t),i.HEAPU16=v=new Uint16Array(t),i.HEAP32=b=new Int32Array(t),i.HEAPU32=y=new Uint32Array(t),i.HEAPF32=w=new Float32Array(t),i.HEAPF64=x=new Float64Array(t)}function S(){if(!T){var t=me();0==t&&(t+=4);var e=y[t>>2],n=y[t+4>>2];34821223==e&&2310721022==n||G(`Stack overflow! Stack cookie has been overwritten at ${K(t)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${K(n)} ${K(e)}`),1668509029!=y[0]&&G("Runtime error: The application has corrupted its heap memory area (address zero)!")}}E(!i.STACK_SIZE,"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"),E("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support"),E(!i.wasmMemory,"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"),E(!i.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 M=[],R=[],P=[],F=!1;function I(t){M.unshift(t)}function O(t){P.unshift(t)}E(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),E(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),E(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),E(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 k=0,C=null,N=null,B={};function G(t){i.onAbort?.(t),p(t="Aborted("+t+")"),T=!0;var e=new WebAssembly.RuntimeError(t);throw o(e),e}var L={error(){G("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(){L.error()},createDataFile(){L.error()},createPreloadedFile(){L.error()},createLazyFile(){L.error()},open(){L.error()},mkdev(){L.error()},registerDevice(){L.error()},analyzePath(){L.error()},ErrnoError(){L.error()}};i.FS_createDataFile=L.createDataFile,i.FS_createPreloadedFile=L.createPreloadedFile;var j,D=t=>t.startsWith("data:application/octet-stream;base64,"),U=t=>t.startsWith("file://");function z(t,e){return(...n)=>{E(F,`native function \`${t}\` called before runtime initialization`);var r=ce[t];return E(r,`exported native function \`${t}\` not found`),E(n.length<=e,`native function \`${t}\` called with ${n.length} args but expects ${e}`),r(...n)}}class H extends Error{}class V extends H{constructor(t){super(t),this.excPtr=t;const e=ae(t);this.name=e[0],this.message=e[1]}}function W(t){if(t==j&&f)return new Uint8Array(f);throw"both async and sync fetching of the wasm failed"}function $(t,e,n){return function(t){return f?Promise.resolve().then(()=>W(t)):s(t).then(t=>new Uint8Array(t),()=>W(t))}(t).then(t=>WebAssembly.instantiate(t,e)).then(n,t=>{p(`failed to asynchronously prepare wasm: ${t}`),U(j)&&p(`warning: Loading from a file URI (${j}) 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`),G(t)})}function X(t,e,n=!0){Object.getOwnPropertyDescriptor(i,t)||Object.defineProperty(i,t,{configurable:!0,get(){G(`\`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 Y(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 Z(t,e){"undefined"!=typeof globalThis&&Object.defineProperty(globalThis,t,{configurable:!0,get(){et(`\`${t}\` is not longer defined by emscripten. ${e}`)}})}function J(t){Object.getOwnPropertyDescriptor(i,t)||Object.defineProperty(i,t,{configurable:!0,get(){var e=`'${t}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`;Y(t)&&(e+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),G(e)}})}Z("buffer","Please use HEAP8.buffer or wasmMemory.buffer"),Z("asm","Please use wasmExports instead");var q=t=>{for(;t.length>0;)t.shift()(i)};i.noExitRuntime;var K=t=>(E("number"==typeof t),"0x"+(t>>>=0).toString(16).padStart(8,"0")),Q=t=>ge(t),tt=()=>be(),et=t=>{et.shown||={},et.shown[t]||(et.shown[t]=1,p(t))},nt="undefined"!=typeof TextDecoder?new TextDecoder:void 0,rt=(t,e,n)=>{for(var r=e+n,o=e;t[o]&&!(o>=r);)++o;if(o-e>16&&t.buffer&&nt)return nt.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)&&et("Invalid UTF-8 leading byte "+K(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},ot=(t,e)=>(E("number"==typeof t,`UTF8ToString expects a number (got ${typeof t})`),t?rt(m,t,e):""),it=[],at=0;class st{constructor(t){this.excPtr=t,this.ptr=t-24}set_type(t){y[this.ptr+4>>2]=t}get_type(){return y[this.ptr+4>>2]}set_destructor(t){y[this.ptr+8>>2]=t}get_destructor(){return y[this.ptr+8>>2]}set_caught(t){t=t?1:0,_[this.ptr+12]=t}get_caught(){return 0!=_[this.ptr+12]}set_rethrown(t){t=t?1:0,_[this.ptr+13]=t}get_rethrown(){return 0!=_[this.ptr+13]}init(t,e){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(e)}set_adjusted_ptr(t){y[this.ptr+16>>2]=t}get_adjusted_ptr(){return y[this.ptr+16>>2]}get_exception_ptr(){if(Ee(this.get_type()))return y[this.excPtr>>2];var t=this.get_adjusted_ptr();return 0!==t?t:this.excPtr}}var lt,ct,ut,ft=t=>pe(t),ht=t=>{var e=at?.excPtr;if(!e)return ft(0),0;var n=new st(e);n.set_adjusted_ptr(e);var r=n.get_type();if(!r)return ft(0),e;for(var o of t){if(0===o||o===r)break;var i=n.ptr+16;if(Te(o,r,i))return ft(o),e}return ft(r),e},dt=t=>{for(var e="",n=t;m[n];)e+=lt[m[n++]];return e},pt={},_t={},mt={},gt=t=>{throw new ct(t)},vt=t=>{throw new ut(t)};function bt(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||gt(`type "${r}" must have a positive integer typeid pointer`),_t.hasOwnProperty(t)){if(n.ignoreDuplicateRegistrations)return;gt(`Cannot register type '${r}' twice`)}if(_t[t]=e,delete mt[t],pt.hasOwnProperty(t)){var o=pt[t];delete pt[t],o.forEach(t=>t())}}(t,e,n)}var yt=[],wt=[],xt=t=>{t>9&&0===--wt[t+1]&&(E(void 0!==wt[t],"Decref for unallocated handle."),wt[t]=void 0,yt.push(t))},Tt=t=>(t||gt("Cannot use deleted val. handle = "+t),E(2===t||void 0!==wt[t]&&t%2==0,`invalid handle: ${t}`),wt[t]),Et=t=>{switch(t){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const e=yt.pop()||wt.length;return wt[e]=t,wt[e+1]=1,e}}};function At(t){return this.fromWireType(y[t>>2])}var St={name:"emscripten::val",fromWireType:t=>{var e=Tt(t);return xt(t),e},toWireType:(t,e)=>Et(e),argPackAdvance:8,readValueFromPointer:At,destructorFunction:null},Mt=t=>{if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t},Rt=(t,e)=>{switch(e){case 4:return function(t){return this.fromWireType(w[t>>2])};case 8:return function(t){return this.fromWireType(x[t>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},Pt=(t,e)=>Object.defineProperty(e,"name",{value:t}),Ft=t=>{for(;t.length;){var e=t.pop();t.pop()(e)}};function It(t){for(var e=1;e<t.length;++e)if(null!==t[e]&&void 0===t[e].destructorFunction)return!0;return!1}function Ot(t,e){if(!(t instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof t} which is not a function`);var n=Pt(t.name||"unknownFunctionName",function(){});n.prototype=t.prototype;var r=new n,o=t.apply(r,e);return o instanceof Object?o:r}var kt,Ct,Nt,Bt=(t,e,n)=>{if(void 0===t[e].overloadTable){var r=t[e];t[e]=function(...r){return t[e].overloadTable.hasOwnProperty(r.length)||gt(`Function '${n}' called with an invalid number of arguments (${r.length}) - expects one of (${t[e].overloadTable})!`),t[e].overloadTable[r.length].apply(this,r)},t[e].overloadTable=[],t[e].overloadTable[r.argCount]=r}},Gt=[],Lt=t=>{var e=Gt[t];return e||(t>=Gt.length&&(Gt.length=t+1),Gt[t]=e=kt.get(t)),E(kt.get(t)==e,"JavaScript-side Wasm function table mirror is out of date!"),e},jt=(t,e)=>{var n,r,o=(t=dt(t)).includes("j")?(r=e,E((n=t).includes("j")||n.includes("p"),"getDynCaller should only be called with i64 sigs"),(...t)=>((t,e,n=[])=>t.includes("j")?((t,e,n)=>(E("dynCall_"+(t=t.replace(/p/g,"i"))in i,`bad function pointer type - dynCall function not found for sig '${t}'`),E(n?.length?n.length===t.substring(1).replace(/j/g,"--").length:1==t.length),(0,i["dynCall_"+t])(e,...n)))(t,e,n):(E(Lt(e),`missing table entry in dynCall: ${e}`),Lt(e)(...n)))(n,r,t)):Lt(e);return"function"!=typeof o&>(`unknown function pointer with signature ${t}: ${e}`),o},Dt=t=>{var e=ue(t),n=dt(e);return he(e),n},Ut=(t,e,n)=>{switch(e){case 1:return n?t=>_[t]:t=>m[t];case 2:return n?t=>g[t>>1]:t=>v[t>>1];case 4:return n?t=>b[t>>2]:t=>y[t>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},zt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Ht=(t,e)=>{E(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)&&v[r];)++r;if((n=r<<1)-t>32&&zt)return zt.decode(m.subarray(t,n));for(var i="",a=0;!(a>=e/2);++a){var s=g[t+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i},Vt=(t,e,n)=>{if(E(e%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),E("number"==typeof n,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),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);g[e>>1]=a,e+=2}return g[e>>1]=0,e-r},Wt=t=>2*t.length,$t=(t,e)=>{E(t%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var n=0,r="";!(n>=e/4);){var o=b[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},Xt=(t,e,n)=>{if(E(e%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),E("number"==typeof n,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),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)),b[e>>2]=a,(e+=4)+4>o)break}return b[e>>2]=0,e-r},Yt=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},Zt=(t,e)=>{var n=_t[t];return void 0===n&>(`${e} has unknown type ${Dt(t)}`),n},Jt=(t,e,n)=>{var r=[],o=t.toWireType(r,n);return r.length&&(y[e>>2]=Et(r)),o},qt=[],Kt={},Qt=t=>{var e=Kt[t];return void 0===e?dt(t):e};Reflect.construct,Nt=()=>performance.now();var te=t=>{var e=h.buffer,n=(t-e.byteLength+65535)/65536;try{return h.grow(n),A(),1}catch(n){p(`growMemory: Attempted to grow heap from ${e.byteLength} bytes to ${t} bytes, but got error: ${n}`)}},ee=[null,[],[]],ne=(t,e)=>{var n=ee[t];E(n),0===e||10===e?((1===t?d:p)(rt(n,0)),n.length=0):n.push(e)};i.incrementExceptionRefcount=t=>ye(t),i.decrementExceptionRefcount=t=>we(t);var re,oe,ie=t=>ve(t),ae=t=>(t=>{var e=tt(),n=ie(4),r=ie(4);xe(t,n,r);var o,i=y[n>>2],a=y[r>>2],s=ot(i);return he(i),a&&(o=ot(a),he(a)),Q(e),[s,o]})(t);i.getExceptionMessage=ae,(()=>{for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);lt=t})(),ct=i.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},ut=i.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},wt.push(0,1,void 0,1,null,1,!0,1,!1,1),E(10===wt.length),i.count_emval_handles=()=>wt.length/2-5-yt.length,Ct=i.UnboundTypeError=(re=Error,(oe=Pt("UnboundTypeError",function(t){this.name="UnboundTypeError",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(re.prototype),oe.prototype.constructor=oe,oe.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},oe);var se,le={__assert_fail:(t,e,n,r)=>{G(`Assertion failed: ${ot(t)}, at: `+[e?ot(e):"unknown filename",n,r?ot(r):"unknown function"])},__cxa_begin_catch:t=>{var e=new st(t);return e.get_caught()||e.set_caught(!0),e.set_rethrown(!1),it.push(e),ye(e.excPtr),e.get_exception_ptr()},__cxa_find_matching_catch_2:()=>ht([]),__cxa_find_matching_catch_3:t=>ht([t]),__cxa_throw:(t,e,n)=>{throw new st(t).init(e,n),at=new V(t)},__resumeException:t=>{throw at||(at=new V(t)),at},_abort_js:()=>{G("native code called abort()")},_embind_register_bigint:(t,e,n,r,o)=>{},_embind_register_bool:(t,e,n,r)=>{bt(t,{name:e=dt(e),fromWireType:function(t){return!!t},toWireType:function(t,e){return e?n:r},argPackAdvance:8,readValueFromPointer:function(t){return this.fromWireType(m[t])},destructorFunction:null})},_embind_register_emval:t=>bt(t,St),_embind_register_float:(t,e,n)=>{bt(t,{name:e=dt(e),fromWireType:t=>t,toWireType:(t,e)=>{if("number"!=typeof e&&"boolean"!=typeof e)throw new TypeError(`Cannot convert ${Mt(e)} to ${this.name}`);return e},argPackAdvance:8,readValueFromPointer:Rt(e,n),destructorFunction:null})},_embind_register_function:(t,e,n,r,o,a,s)=>{var l=((t,e)=>{for(var n=[],r=0;r<t;r++)n.push(y[e+4*r>>2]);return n})(e,n);t=(t=>{const e=(t=t.trim()).indexOf("(");return-1!==e?(E(")"==t[t.length-1],"Parentheses for argument names should match."),t.substr(0,e)):t})(t=dt(t)),o=jt(r,o),((t,e,n)=>{i.hasOwnProperty(t)?((void 0===n||void 0!==i[t].overloadTable&&void 0!==i[t].overloadTable[n])&>(`Cannot register public name '${t}' twice`),Bt(i,t,t),i.hasOwnProperty(n)&>(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`),i[t].overloadTable[n]=e):(i[t]=e,void 0!==n&&(i[t].numArguments=n))})(t,function(){((t,e)=>{var n=[],r={};throw e.forEach(function t(e){r[e]||_t[e]||(mt[e]?mt[e].forEach(t):(n.push(e),r[e]=!0))}),new Ct(`${t}: `+n.map(Dt).join([", "]))})(`Cannot call ${t} due to unbound types`,l)},e-1),((n,r)=>{function l(r){var l=(n=>{var r=[n[0],null].concat(n.slice(1));return((t,e,n)=>{i.hasOwnProperty(t)||vt("Replacing nonexistent public symbol"),void 0!==i[t].overloadTable&&void 0!==n?i[t].overloadTable[n]=e:(i[t]=e,i[t].argCount=n)})(t,function(t,e,n,r,o,i){var a=e.length;a<2&>("argTypes array size mismatch! Must at least get return value and 'this' types!"),E(!i,"Async bindings are only supported with JSPI.");for(var s=null!==e[1]&&null!==n,l=It(e),c="void"!==e[0].name,u=[t,gt,r,o,Ft,e[0],e[1]],f=0;f<a-2;++f)u.push(e[f+2]);if(!l)for(f=s?1:2;f<e.length;++f)null!==e[f].destructorFunction&&u.push(e[f].destructorFunction);let[h,d]=function(t,e,n,r){for(var o=It(t),i=t.length,a="",s="",l=0;l<i-2;++l)a+=(0!==l?", ":"")+"arg"+l,s+=(0!==l?", ":"")+"arg"+l+"Wired";var c=`\n return function (${a}) {\n if (arguments.length !== ${i-2}) {\n throwBindingError('function ' + humanName + ' called with ' + arguments.length + ' arguments, expected ${i-2}');\n }`;o&&(c+="var destructors = [];\n");var u=o?"destructors":"null",f=["humanName","throwBindingError","invoker","fn","runDestructors","retType","classParam"];for(e&&(c+="var thisWired = classParam['toWireType']("+u+", this);\n"),l=0;l<i-2;++l)c+="var arg"+l+"Wired = argType"+l+"['toWireType']("+u+", arg"+l+");\n",f.push("argType"+l);if(e&&(s="thisWired"+(s.length>0?", ":"")+s),c+=(n||r?"var rv = ":"")+"invoker(fn"+(s.length>0?", ":"")+s+");\n",o)c+="runDestructors(destructors);\n";else for(l=e?1:2;l<t.length;++l){var h=1===l?"thisWired":"arg"+(l-2)+"Wired";null!==t[l].destructorFunction&&(c+=`${h}_dtor(${h});\n`,f.push(`${h}_dtor`))}return n&&(c+="var ret = retType['fromWireType'](rv);\nreturn ret;\n"),c+="}\n",[f,c=`if (arguments.length !== ${f.length}){ throw new Error(humanName + "Expected ${f.length} closure arguments " + arguments.length + " given."); }\n${c}`]}(e,s,c,i);h.push(d);var p=Ot(Function,h)(...u);return Pt(t,p)}(t,r,null,o,a,s),e-1),[]})(r);l.length!==n.length&&vt("Mismatched type converter count");for(var c=0;c<n.length;++c)bt(n[c],l[c])}n.forEach(function(t){mt[t]=r});var c=new Array(r.length),u=[],f=0;r.forEach((t,e)=>{_t.hasOwnProperty(t)?c[e]=_t[t]:(u.push(t),pt.hasOwnProperty(t)||(pt[t]=[]),pt[t].push(()=>{c[e]=_t[t],++f===u.length&&l(c)}))}),0===u.length&&l(c)})([],l)},_embind_register_integer:(t,e,n,r,o)=>{e=dt(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 "${Mt(t)}" to ${n}`);if(t<r||t>o)throw new TypeError(`Passing a number "${Mt(t)}" from JS side to C/C++ side to an argument of type "${e}", which is outside the valid range [${r}, ${o}]!`)};bt(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:Ut(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=y[t>>2],n=y[t+4>>2];return new r(_.buffer,n,e)}bt(t,{name:n=dt(n),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},_embind_register_std_string:(t,e)=>{var n="std::string"===(e=dt(e));bt(t,{name:e,fromWireType(t){var e,r=y[t>>2],o=t+4;if(n)for(var i=o,a=0;a<=r;++a){var s=o+a;if(a==r||0==m[s]){var l=ot(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(m[o+a]);e=c.join("")}return he(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||gt("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,a,s,l=fe(4+r+1),c=l+4;if(y[l>>2]=r,n&&o)i=e,a=c,E("number"==typeof(s=r+1),"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),((t,e,n,r)=>{if(E("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&&et("Invalid Unicode code point "+K(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}}e[n]=0})(i,m,a,s);else if(o)for(var u=0;u<r;++u){var f=e.charCodeAt(u);f>255&&(he(c),gt("String has UTF-16 code units that do not fit in 8 bits")),m[c+u]=f}else for(u=0;u<r;++u)m[c+u]=e[u];return null!==t&&t.push(he,l),l},argPackAdvance:8,readValueFromPointer:At,destructorFunction(t){he(t)}})},_embind_register_std_wstring:(t,e,n)=>{var r,o,i,a;n=dt(n),2===e?(r=Ht,o=Vt,a=Wt,i=t=>v[t>>1]):4===e&&(r=$t,o=Xt,a=Yt,i=t=>y[t>>2]),bt(t,{name:n,fromWireType:t=>{for(var n,o=y[t>>2],a=t+4,s=0;s<=o;++s){var l=t+4+s*e;if(s==o||0==i(l)){var c=r(a,l-a);void 0===n?n=c:(n+=String.fromCharCode(0),n+=c),a=l+e}}return he(t),n},toWireType:(t,r)=>{"string"!=typeof r&>(`Cannot pass non-string to C++ string type ${n}`);var i=a(r),s=fe(4+i+e);return y[s>>2]=i/e,o(r,s+4,i+e),null!==t&&t.push(he,s),s},argPackAdvance:8,readValueFromPointer:At,destructorFunction(t){he(t)}})},_embind_register_void:(t,e)=>{bt(t,{isVoid:!0,name:e=dt(e),argPackAdvance:0,fromWireType:()=>{},toWireType:(t,e)=>{}})},_emscripten_get_now_is_monotonic:()=>1,_emscripten_memcpy_js:(t,e,n)=>m.copyWithin(t,e,e+n),_emval_as:(t,e,n)=>(t=Tt(t),e=Zt(e,"emval::as"),Jt(e,n,t)),_emval_call:(t,e,n,r)=>(t=qt[t])(null,e=Tt(e),n,r),_emval_call_method:(t,e,n,r,o)=>(t=qt[t])(e=Tt(e),e[n=Qt(n)],r,o),_emval_decref:xt,_emval_get_method_caller:(t,e,n)=>{var r=((t,e)=>{for(var n=new Array(t),r=0;r<t;++r)n[r]=Zt(y[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;i+=` var rv = ${1===n?"new func":"func.call"}(${s.join(", ")});\n`,o.isVoid||(l.push("emval_returnValue"),c.push(Jt),i+=" return emval_returnValue(retType, destructorsRef, rv);\n"),i+="};\n",l.push(i);var f,h,d=Ot(Function,l)(...c),p=`methodCaller<(${r.map(t=>t.name).join(", ")}) => ${o.name}>`;return f=Pt(p,d),h=qt.length,qt.push(f),h},_emval_get_module_property:t=>(t=Qt(t),Et(i[t])),_emval_get_property:(t,e)=>(t=Tt(t),e=Tt(e),Et(t[e])),_emval_incref:t=>{t>9&&(wt[t+1]+=1)},_emval_new_array:()=>Et([]),_emval_new_cstring:t=>Et(Qt(t)),_emval_new_object:()=>Et({}),_emval_run_destructors:t=>{var e=Tt(t);Ft(e),xt(t)},_emval_set_property:(t,e,n)=>{t=Tt(t),e=Tt(e),n=Tt(n),t[e]=n},_emval_take_value:(t,e)=>{var n=(t=Zt(t,"_emval_take_value")).readValueFromPointer(e);return Et(n)},emscripten_date_now:()=>Date.now(),emscripten_get_now:Nt,emscripten_resize_heap:t=>{var e=m.length;E((t>>>=0)>e);var n=2147483648;if(t>n)return p(`Cannot enlarge memory, requested ${t} bytes, but the limit is 2147483648 bytes!`),!1;for(var r=(t,e)=>t+(e-t%e)%e,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));if(te(a))return!0}return p(`Failed to grow the heap from ${e} bytes to ${a} bytes, not enough memory!`),!1},fd_close:t=>{G("fd_close called without SYSCALLS_REQUIRE_FILESYSTEM")},fd_seek:function(t,e,n,r,o){var i,a;return a=n,E((i=e)==i>>>0||i==(0|i)),E(a===(0|a)),70},fd_write:(t,e,n,r)=>{for(var o=0,i=0;i<n;i++){var a=y[e>>2],s=y[e+4>>2];e+=8;for(var l=0;l<s;l++)ne(t,m[a+l]);o+=s}return y[r>>2]=o,0},invoke_ii:function(t,e){var n=tt();try{return Lt(t)(e)}catch(t){if(Q(n),!(t instanceof H))throw t;de(1,0)}},invoke_iii:function(t,e,n){var r=tt();try{return Lt(t)(e,n)}catch(t){if(Q(r),!(t instanceof H))throw t;de(1,0)}},invoke_iiii:function(t,e,n,r){var o=tt();try{return Lt(t)(e,n,r)}catch(t){if(Q(o),!(t instanceof H))throw t;de(1,0)}},invoke_j:function(t){var e=tt();try{return Ae(t)}catch(t){if(Q(e),!(t instanceof H))throw t;de(1,0)}},invoke_v:function(t){var e=tt();try{Lt(t)()}catch(t){if(Q(e),!(t instanceof H))throw t;de(1,0)}},invoke_vi:function(t,e){var n=tt();try{Lt(t)(e)}catch(t){if(Q(n),!(t instanceof H))throw t;de(1,0)}},invoke_vii:function(t,e,n){var r=tt();try{Lt(t)(e,n)}catch(t){if(Q(r),!(t instanceof H))throw t;de(1,0)}},invoke_viii:function(t,e,n,r){var o=tt();try{Lt(t)(e,n,r)}catch(t){if(Q(o),!(t instanceof H))throw t;de(1,0)}},invoke_viiii:function(t,e,n,r,o){var i=tt();try{Lt(t)(e,n,r,o)}catch(t){if(Q(i),!(t instanceof H))throw t;de(1,0)}}},ce=function(){var t,e={env:le,wasi_snapshot_preview1:le};function n(t,e){var n;return ce=t.exports,E(h=ce.memory,"memory not found in wasm exports"),A(),E(kt=ce.__indirect_function_table,"table not found in wasm exports"),n=ce.__wasm_call_ctors,R.unshift(n),function(t){if(k--,i.monitorRunDependencies?.(k),t?(E(B[t]),delete B[t]):p("warning: run dependency removed without ID"),0==k&&(null!==C&&(clearInterval(C),C=null),N)){var e=N;N=null,e()}}("wasm-instantiate"),ce}t="wasm-instantiate",k++,i.monitorRunDependencies?.(k),t?(E(!B[t]),B[t]=1,null===C&&"undefined"!=typeof setInterval&&(C=setInterval(()=>{if(T)return clearInterval(C),void(C=null);var t=!1;for(var e in B)t||(t=!0,p("still waiting on run dependencies:")),p(`dependency: ${e}`);t&&p("(end of list)")},1e4))):p("warning: run dependency added without ID");var r,a,s,l,u,d,_=i;if(i.instantiateWasm)try{return i.instantiateWasm(e,n)}catch(t){p(`Module.instantiateWasm callback failed with error: ${t}`),o(t)}return j||(j=D(d="marchingsquares.wasm")?d:(u=d,i.locateFile?i.locateFile(u,c):c+u)),(r=f,a=j,s=e,l=function(t){E(i===_,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),_=null,n(t.instance)},r||"function"!=typeof WebAssembly.instantiateStreaming||D(a)||"function"!=typeof fetch?$(a,s,l):fetch(a,{credentials:"same-origin"}).then(t=>WebAssembly.instantiateStreaming(t,s).then(l,function(t){return p(`wasm streaming compile failed: ${t}`),p("falling back to ArrayBuffer instantiation"),$(a,s,l)}))).catch(o),{}}(),ue=(z("__wasm_call_ctors",0),z("__getTypeName",1)),fe=(z("fflush",1),z("malloc",1)),he=(z("strerror",1),z("free",1)),de=z("setThrew",2),pe=z("_emscripten_tempret_set",1),_e=()=>(_e=ce.emscripten_stack_init)(),me=()=>(me=ce.emscripten_stack_get_end)(),ge=t=>(ge=ce._emscripten_stack_restore)(t),ve=t=>(ve=ce._emscripten_stack_alloc)(t),be=()=>(be=ce.emscripten_stack_get_current)(),ye=(z("__cxa_free_exception",1),z("__cxa_increment_exception_refcount",1)),we=z("__cxa_decrement_exception_refcount",1),xe=z("__get_exception_message",3),Te=z("__cxa_can_catch",3),Ee=z("__cxa_is_pointer_type",1),Ae=i.dynCall_j=z("dynCall_j",1);function Se(){function t(){se||(se=!0,i.calledRun=!0,T||(E(!F),F=!0,S(),q(R),r(i),i.onRuntimeInitialized?.(),E(!i._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(S(),i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)O(i.postRun.shift());q(P)}()))}var e;k>0||(_e(),E(!(3&(e=me()))),0==e&&(e+=4),y[e>>2]=34821223,y[e+4>>2]=2310721022,y[0]=1668509029,function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)I(i.preRun.shift());q(M)}(),k>0||(i.setStatus?(i.setStatus("Running..."),setTimeout(function(){setTimeout(function(){i.setStatus("")},1),t()},1)):t(),S()))}if(i.dynCall_jiji=z("dynCall_jiji",5),["writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertU32PairToI53","getTempRet0","zeroMemory","exitJS","isLeapYear","ydayFromDate","arraySum","addDays","strError","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","initRandomFill","randomFill","emscriptenLog","readEmAsmArgs","jstoi_q","getExecutableName","listenOnce","autoResumeAudioContext","handleException","keepRuntimeAlive","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","asmjsMangle","asyncLoad","alignMemory","mmapAlloc","HandleAllocator","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","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","jsStackTrace","getCallstack","convertPCtoSourceLocation","getEnvStrings","checkWasiClock","wasiRightsToMuslOFlags","wasiOFlagsToMuslOFlags","createDyncallWrapper","safeSetTimeout","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","getPromise","makePromise","idsToPromises","makePromiseCallback","Browser_asyncPrepareDataCounter","setMainLoop","getSocketFromFD","getSocketAddress","FS_createPreloadedFile","FS_modeStringToFlags","FS_getMode","FS_stdin_getChar","FS_unlink","FS_createDataFile","FS_mkdirTree","_setNetworkCallback","heapObjectForWebGLType","toTypedArrayIndex","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","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","__glGetActiveAttribOrUniform","writeGLArray","registerWebGlEventCallback","runAndAbortIfError","ALLOC_NORMAL","ALLOC_STACK","allocate","writeStringToMemory","writeAsciiToMemory","setErrNo","demangle","stackTrace","getFunctionArgsName","createJsInvokerSignature","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}')`,Y(t)&&(e+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),et(e)}}),J(t)}),["run","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","addRunDependency","removeRunDependency","out","err","callMain","abort","wasmMemory","wasmExports","writeStackCookie","checkStackCookie","convertI32PairToI53Checked","stackSave","stackRestore","stackAlloc","setTempRet0","ptrToString","getHeapMax","growMemory","ENV","MONTH_DAYS_REGULAR","MONTH_DAYS_LEAP","MONTH_DAYS_REGULAR_CUMULATIVE","MONTH_DAYS_LEAP_CUMULATIVE","ERRNO_CODES","DNS","Protocols","Sockets","timers","warnOnce","readEmAsmArgsArray","jstoi_s","dynCallLegacy","getDynCaller","dynCall","wasmTable","noExitRuntime","freeTableIndexes","functionsInTableMap","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","UTF16Decoder","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","JSEvents","specialHTMLTargets","findCanvasEventTarget","currentFullscreenStrategy","restoreOldWindowedStyle","UNWIND_CACHE","ExitStatus","flush_NO_FILESYSTEM","promiseMap","uncaughtExceptionCount","exceptionLast","exceptionCaught","ExceptionInfo","findMatchingCatch","getExceptionMessageCommon","incrementExceptionRefcount","decrementExceptionRefcount","getExceptionMessage","Browser","getPreloadedImageData__data","wget","SYSCALLS","preloadPlugins","FS_stdin_getChar_buffer","FS_createPath","FS_createDevice","FS_readFile","FS","FS_createLazyFile","MEMFS","TTY","PIPEFS","SOCKFS","tempFixedLengthArray","miniTempWebGLFloatBuffers","miniTempWebGLIntBuffers","GL","AL","GLUT","EGL","GLEW","IDBStore","SDL","SDL_gfx","allocateUTF8","allocateUTF8OnStack","print","printErr","InternalError","BindingError","throwInternalError","throwBindingError","registeredTypes","awaitingDependencies","typeDependencies","tupleRegistrations","structRegistrations","sharedRegisterType","whenDependentTypesAreResolved","embind_charCodes","embind_init_charCodes","readLatin1String","getTypeName","getFunctionName","heap32VectorToArray","requireRegisteredType","usesDestructorStack","createJsInvoker","UnboundTypeError","PureVirtualError","GenericWireTypeSize","EmValType","throwUnboundTypeError","ensureOverloadTable","exposePublicSymbol","replacePublicSymbol","extendError","createNamedFunction","embindRepr","registeredInstances","registeredPointers","registerType","integerReadValueFromPointer","floatReadValueFromPointer","readPointer","runDestructors","newFunc","craftInvokerFunction","embind__requireFunction","finalizationRegistry","detachFinalizer_deps","deletionQueue","delayFunction","emval_freelist","emval_handles","emval_symbols","init_emval","count_emval_handles","getStringOrSymbol","Emval","emval_returnValue","emval_lookupTypes","emval_methodCallers","emval_addMethodCaller","reflectConstruct"].forEach(J),N=function t(){se||Se(),se||(N=t)},i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();Se(),n=a;for(const e of Object.keys(i))e in t||Object.defineProperty(t,e,{configurable:!0,get(){G(`Access to module property ('${e}') is no longer possible via the module constructor argument; Instead, use the result of the module constructor.`)}});return n});t.exports=n},631:t=>{t.exports="#version 300 es\n\nuniform int u_offset;\n\nin vec2 a_pos; // Has grid point position\nin vec2 a_tex_coord; // zoom info is on the x coordinate\nin lowp float a_geom; // Has corner info\nuniform lowp float u_bb_size;\nuniform lowp float u_map_aspect;\nuniform lowp float u_zoom;\nuniform lowp float u_bb_width; // Normalized by texture width\nuniform lowp float u_bb_height; // Normalized by texture height\nuniform highp float u_bb_mag_bin_size;\nuniform highp float u_bb_mag_wrap;\nuniform int u_rotate_with_map;\n\nuniform sampler2D u_u_sampler;\nuniform sampler2D u_v_sampler;\nuniform sampler2D u_rot_sampler;\n\nout highp vec2 v_tex_coord;\n#ifdef COLORMAP\nout highp float v_mag;\n#endif\n\nmat4 scalingMatrix(float x_scale, float y_scale, float z_scale) {\n return mat4(x_scale, 0.0, 0.0, 0.0,\n 0.0, y_scale, 0.0, 0.0,\n 0.0, 0.0, z_scale, 0.0,\n 0.0, 0.0, 0.0, 1.0);\n}\n\nmat4 rotationZMatrix(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n\n return mat4( c, s, 0., 0.,\n -s, c, 0., 0.,\n 0., 0., 1., 0.,\n 0., 0., 0., 1.);\n}\n\nmat4 rotationXMatrix(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n\n return mat4( 1., 0., 0., 0.,\n 0., c, s, 0.,\n 0., -s, c, 0.,\n 0., 0., 0., 1.);\n}\n\nvoid main() {\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n mat4 map_stretch_matrix = scalingMatrix(1.0, 1. / u_map_aspect, 1.0);\n\n vec4 pivot_pos = projectTile(a_pos.xy + globe_offset);\n float globe_rotation = 0.0;\n\n if (u_rotate_with_map == 1) {\n vec4 pivot_pos_ihat = projectTile(a_pos.xy + globe_offset + vec2(1e-5, 0.));\n // Surely there's a more linear-algebra-y way to do this than converting all the rotations to an angle.\n vec2 pivot_east = normalize((inverse(map_stretch_matrix) * (pivot_pos_ihat - pivot_pos)).xy);\n globe_rotation = atan(pivot_east.x, pivot_east.y) - 3.141592654 / 2.0;\n }\n\n highp float min_zoom = floor(a_tex_coord.x);\n lowp float corner = a_geom;\n\n vec2 data_texcoord = a_tex_coord;\n data_texcoord.x = fract(data_texcoord.x);\n\n highp float u = texture(u_u_sampler, data_texcoord).r;\n highp float v = texture(u_v_sampler, data_texcoord).r;\n highp float rot = texture(u_rot_sampler, data_texcoord).r;\n\n lowp float bb_aspect = u_bb_width / u_bb_height;\n lowp float ang = (abs(u) < 1e-6 && abs(v) < 1e-6) ? 0. : atan(v, u) - 3.141592654 / 2.0;\n highp float mag = length(vec2(u, v));\n#ifdef COLORMAP\n v_mag = mag;\n#endif\n mag = floor(mag / u_bb_mag_bin_size + 0.5) * u_bb_mag_bin_size;\n\n vec4 offset = vec4(0.0, 0.0, 0.0, 0.0);\n vec2 texcoord = vec2(0.0, 0.0);\n \n if (u_zoom >= min_zoom) {\n // Subtracting a small number off of u_bb_mag_wrap fixes (I think) a precision issue on some GPUs\n vec2 tex_loc = vec2(mod(mag, u_bb_mag_wrap - 1e-5) / u_bb_mag_bin_size * u_bb_width, floor(mag / (u_bb_mag_wrap - 1e-5)) * u_bb_height);\n\n if (corner < 0.5) {\n offset = vec4(-u_bb_size, u_bb_size, 0., 0.);\n texcoord = tex_loc;\n }\n else if (corner < 1.5) {\n offset = vec4(u_bb_size, u_bb_size, 0., 0.);\n texcoord = tex_loc + vec2(u_bb_width, 0.0);\n }\n else if (corner < 2.5) {\n offset = vec4(-u_bb_size, -u_bb_size * (2. / bb_aspect - 1.), 0., 0.);\n texcoord = tex_loc + vec2(0.0, u_bb_height);\n }\n else if (corner < 3.5) {\n offset = vec4(u_bb_size, -u_bb_size * (2. / bb_aspect - 1.), 0., 0.);\n texcoord = tex_loc + vec2(u_bb_width, u_bb_height);\n }\n\n mat4 barb_rotation = rotationZMatrix(ang - globe_rotation - rot);\n offset = map_stretch_matrix * barb_rotation * offset;\n }\n\n gl_Position = pivot_pos + offset;\n v_tex_coord = texcoord;\n}"},829:t=>{t.exports="#version 300 es\n\nuniform int u_offset;\n\nin vec2 a_pos;\nin vec2 a_tex_coord;\n\nout highp vec2 v_tex_coord;\n\nvoid main() {\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n gl_Position = projectTile(a_pos.xy + globe_offset);\n v_tex_coord = a_tex_coord;\n}"},840:t=>{t.exports="#version 300 es\n\nuniform int u_offset;\n\nin vec3 a_pos;\nin vec2 a_extrusion;\nin float a_data;\n\n#ifdef ZOOM\nin float a_min_zoom;\n#endif\n\n#ifdef OFFSET\nin vec2 a_offset;\n#endif\n\nuniform lowp float u_line_width;\nuniform lowp float u_map_width;\nuniform lowp float u_map_height;\n//uniform highp float u_map_bearing;\n\n#ifdef ZOOM\nuniform lowp float u_zoom;\n#endif\n\n#ifdef OFFSET\nuniform int u_offset_rotates_with_map;\nuniform lowp float u_offset_scale;\n#endif\n\n#ifdef DATA\nout highp float v_data;\n#endif\n\nout highp float v_dist;\nout lowp float v_cross;\n\nmat4 scalingMatrix(float x_scale, float y_scale, float z_scale) {\n return mat4(x_scale, 0.0, 0.0, 0.0,\n 0.0, y_scale, 0.0, 0.0,\n 0.0, 0.0, z_scale, 0.0,\n 0.0, 0.0, 0.0, 1.0);\n}\n\nmat4 rotationZMatrix(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n\n return mat4( c, s, 0., 0.,\n -s, c, 0., 0.,\n 0., 0., 1., 0.,\n 0., 0., 0., 1.);\n}\n\nmat4 rotationXMatrix(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n\n return mat4( 1., 0., 0., 0.,\n 0., c, s, 0.,\n 0., -s, c, 0.,\n 0., 0., 0., 1.);\n}\n\nvoid main() {\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n v_dist = abs(a_pos.z);\n v_cross = sign(a_pos.z);\n vec4 center_pos = projectTile(a_pos.xy + globe_offset);\n vec4 offset = vec4(0.0, 0.0, 0.0, 0.0);\n\n#ifdef ZOOM\n if (u_zoom >= a_min_zoom) {\n#endif\n\n vec2 offset_ext = u_line_width * 2. * a_extrusion;\n\n mat4 map_stretch_matrix = scalingMatrix(u_map_height / u_map_width, 1., 1.);\n \n vec4 center_pos_ihat = projectTile(a_pos.xy + globe_offset + vec2(1e-5, 0.));\n // Surely there's a more linear-algebra-y way to do this than converting all the rotations to an angle.\n vec2 center_east = normalize((inverse(map_stretch_matrix) * (center_pos_ihat - center_pos)).xy);\n float globe_rotation = atan(center_east.x, center_east.y) - 3.141592654 / 2.0;\n mat4 rotation_matrix = rotationZMatrix(-globe_rotation);\n\n offset = map_stretch_matrix * rotation_matrix * vec4(offset_ext, 0., 0.);\n\n#ifdef OFFSET\n mat4 offset_matrix = scalingMatrix(1., u_map_width / u_map_height, 1.);\n if (u_offset_rotates_with_map == 1) {\n offset_matrix = offset_matrix * rotation_matrix;\n }\n else {\n offset = map_stretch_matrix * vec4(offset_ext, 0., 0.);\n }\n\n vec2 offset_offset = u_offset_scale * a_offset;\n offset += offset_matrix * vec4(offset_offset, 0., 0.);\n#endif\n\n#ifdef ZOOM\n }\n#endif\n\n gl_Position = center_pos + offset;\n\n#ifdef DATA\n v_data = a_data;\n#endif\n}"},873:t=>{t.exports="#version 300 es\n\nuniform int u_offset;\nuniform highp float u_map_width;\nuniform highp float u_map_height;\nuniform highp float u_map_zoom;\nuniform highp float u_font_size;\n\nin vec3 a_pos;\nin vec2 a_offset;\nin vec2 a_tex_coord;\n\nout 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 = projectTile(a_pos.xy + globe_offset) + u_font_size / 12. * 1.5 * map_stretch_matrix * vec4(offset, 0., 0.);\n v_tex_coord = a_tex_coord;\n}"},934:t=>{t.exports="#version 300 es\n\nuniform sampler2D u_dash_sampler;\n\n#ifndef DATA\nuniform lowp vec4 u_color;\n#endif\n\nuniform lowp float u_line_width;\nuniform lowp float u_zoom;\nuniform int u_dash_pattern_length;\n\n#ifdef DATA\nin highp float v_data;\n#endif\n\nin highp float v_dist;\nin lowp float v_cross;\n\nout highp vec4 fragColor;\n\nvoid main() {\n lowp float dash_x = fract(v_dist * 2e2 * pow(2., floor(u_zoom)) / float(u_dash_pattern_length));\n lowp float dash = texture(u_dash_sampler, vec2(dash_x, 0.5)).r;\n\n lowp vec4 color;\n#ifdef DATA\n color = apply_colormap(v_data);\n#else\n color = u_color;\n#endif\n\n lowp float feather = clamp((1. - abs(v_cross)) * u_line_width, 0., 1.);\n color.a *= (dash >= 1. ? 1. : 0.) * feather;\n\n fragColor = color;\n}"},947:t=>{t.exports="#version 300 es\n\nin highp vec2 v_tex_coord;\nuniform sampler2D u_sdf_sampler;\nuniform int u_is_halo;\n\nuniform lowp vec4 u_text_color;\nuniform lowp vec4 u_halo_color;\n\n#define SDF_FILL 0.75\n#define SDF_HALO 0.45\n\nout highp vec4 fragColor;\n\nvoid main() {\n highp float sdf_val = texture(u_sdf_sampler, v_tex_coord).r;\n\n lowp float step_width = 0.08;\n lowp float alpha = smoothstep(SDF_FILL - step_width, SDF_FILL + step_width, sdf_val);\n\n lowp vec4 color = u_is_halo == 1 ? u_halo_color : u_text_color;\n\n if (u_is_halo == 1) {\n alpha = min(smoothstep(SDF_HALO - step_width, SDF_HALO + step_width, sdf_val), 1.0 - alpha);\n }\n\n color.a *= alpha;\n fragColor = color;\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&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&(!t||!/^http(s?):/.test(t));)t=r[o--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").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:()=>lo,Color:()=>An,ColorMap:()=>Rn,Contour:()=>Rr,ContourFill:()=>Kr,ContourLabels:()=>Mr,Grid:()=>dr,Hodographs:()=>Ao,LambertGrid:()=>gr,MultiPlotLayer:()=>Lo,Paintball:()=>go,PlateCarreeGrid:()=>_r,PlateCarreeRotatedGrid:()=>mr,PlotComponent:()=>k,PlotLayer:()=>Go,Raster:()=>qr,RawObsField:()=>zr,RawProfileField:()=>Ur,RawScalarField:()=>jr,RawVectorField:()=>Dr,StationPlot:()=>Co,StructuredGrid:()=>pr,UnstructuredGrid:()=>vr,colormaps:()=>Ho,initAutumnPlot:()=>Vo,makeColorBar:()=>Uo,makePaintballKey:()=>zo});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="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},y=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 w(t,e,n){for(var r=1,o=n;t%o!=0||e%o!=0;)r+=1,o/=2;return r}function x(){var t,e,n,r=[];for(t=0;t<arguments.length;t++)r[t]=arguments[t];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(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 T=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,y([],b(t),!1));return n in this.cached_values||(this.cached_values[n]=this.compute_value.apply(this,y([],b(t),!1))),this.cached_values[n]},t}();function E(t,e){var n=v({},e);return void 0!==t&&Object.entries(t).forEach(function(t){var e=b(t,2),r=e[0],o=e[1];n[r]=o}),n}function A(t){return t.constructor}function S(t,e){var n="#version 300 es\n";return e.startsWith(n)?n+t+"\n"+e.slice(16):t+"\n"+e}var M=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},R=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 P(t){return"smu"in t&&"smv"in t}function F(t){return t.getParameter(t.VERSION).includes("WebGL 2.0")}function I(t){return"modelViewProjectionMatrix"in(e=t)&&"defaultProjectionData"in e&&"mainMatrix"in e.defaultProjectionData?{type:"maplibre",defaultProjectionData:{clippingPlane:R([],M(t.defaultProjectionData.clippingPlane),!1),fallbackMatrix:R([],M(t.defaultProjectionData.fallbackMatrix),!1),mainMatrix:R([],M(t.defaultProjectionData.mainMatrix),!1),projectionTransition:t.defaultProjectionData.projectionTransition,tileMercatorCoords:R([],M(t.defaultProjectionData.tileMercatorCoords),!1)},farZ:t.farZ,fov:t.fov,modelViewProjectionMatrix:R([],M(t.modelViewProjectionMatrix),!1),nearZ:t.nearZ,projectionMatrix:R([],M(t.projectionMatrix),!1),shaderData:t.shaderData}:{type:"autumn",mainMatrix:R([],M(t),!1),shaderData:null};var e}var O=u(new Worker(new URL(n.p+n.u(983),n.b))),k=function(){};function C(t,e){var n,r,o,i,a,s,l,c=F(t);if("float16"==e){var u=t.getExtension("OES_texture_half_float"),f=t.getExtension("OES_texture_half_float_linear");if(c)n=t.R16F,r=t.HALF_FLOAT;else{if(null===u||null===f)throw"Float16 data are not supported on this hardware. Try Float32 data instead.";n=t.LUMINANCE,r=u.HALF_FLOAT_OES}o=2}else if("float32"==e){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}else n=c?t.R8:t.LUMINANCE,r=t.UNSIGNED_BYTE,o=1;return{format:n,type:r,row_alignment:o}}function N(t){var e,n,r=function(t){var e=Math.sin(t);return Math.tan(Math.PI/4-t/2)*Math.pow((1+s*e)/(1-s*e),s/2)},o=function(t){var e=Math.sin(t);return Math.cos(t)/Math.sqrt(1-s*s*e*e)},i=t.a,a=t.b,s=Math.sqrt(1-a*a/(i*i)),l=Math.PI/180,c=t.lon_0,u=t.lat_0,f=t.lat_std;f=Array.isArray(f)&&f[0]==f[1]?f[0]:f,c*=l;var h=r(u*=l);if(Array.isArray(f)){var d=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}(f,2),p=d[0],_=d[1];_*=l;var m=r(p*=l),g=r(_),v=o(p),b=o(_);n=Math.log(v/b)/Math.log(m/g),e=v/(n*Math.pow(m,n))}else p=f,m=r(p*=l),v=o(p),n=Math.sin(p),e=v/(n*Math.pow(m,n));var y=i*e*Math.pow(h,n),w=s*s,x=w*w,T=x*w,E=T*w,A=w/2+5*x/24+3*T/120-73*E/2016,S=7*x/24+29*T/120+233*E/6720,M=7*T/30+81*E/280,R=4729*E/20160;return function(t,o,a){return(a=void 0===a?{inverse:!1}:a).inverse?(s=t,u=o,f=Math.atan2(s,y-u)/n+c,h=Math.hypot(s,y-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/l,(p+_*(A+m*(S+m*(M+R*m))))/l]):function(t,o){t*=l;var a=r(o*=l),s=i*e*Math.pow(a,n),u=n*(t-c);return[s*Math.sin(u),y-s*Math.cos(u)]}(t,o);var s,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(1.5,Math.max(-.5,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}();function G(t){return t.getParameter(t.VERSION).includes("WebGL 2.0")}class L{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 j extends L{constructor(t,e,n,r,o){if(super(t,e,n,r,t.ARRAY_BUFFER),o=void 0===o?{}:o,this.is_per_instance=void 0!==o.per_instance&&o.per_instance,G(this.gl))this.vadFunc=this.gl.vertexAttribDivisor.bind(this.gl);else{const t=this.gl.getExtension("ANGLE_instanced_arrays");this.vadFunc=t.vertexAttribDivisorANGLE.bind(t)}}bindToProgram(t){this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.buffer),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(t,this.n_coords_per_vert,this.dtype,!1,0,0);const e=this.is_per_instance?1:0;this.vadFunc(t,e)}}class D{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;this.spec=t,e.bindTexture(e.TEXTURE_2D,this.texture);const n=G(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;var o;e.pixelStorei(e.UNPACK_ALIGNMENT,r),"width"in(o=t)&&"height"in o?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 U(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 z{constructor(t,e,n,r){e=U(e,r),n=U(n,r),this.gl=t,this.prog=((t,e,n)=>{const r=t.createShader(t.VERTEX_SHADER);if(null===r)throw"Could not create vertex shader";if(t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){const e=t.getShaderInfoLog(r);console.log("Vertex shader compiler log: "+e)}const o=t.createShader(t.FRAGMENT_SHADER);if(null===o)throw"Could not create fragment shader";if(t.shaderSource(o,n),t.compileShader(o),!t.getShaderParameter(o,t.COMPILE_STATUS)){const e=t.getShaderInfoLog(o);console.log("Fragment shader compiler log: "+e)}const i=t.createProgram();if(null===i)throw"Could not create shader program";if(t.attachShader(i,r),t.attachShader(i,o),t.linkProgram(i),!t.getProgramParameter(i,t.LINK_STATUS)){const e=t.getProgramInfoLog(i);console.log("Linker log: "+e)}return i})(t,e,n),this.attributes={},this.uniforms={},this.n_verts=null,this.draw_mode=null,this.index_buffer=null,this.sampler_names=[],this.instance_count=0;const o=t=>{const e=t.indexOf("//");return e>=0&&(t=t.slice(0,e)),t};e=e.split("\n").map(o).join("\n"),n=n.split("\n").map(o).join("\n");const i=G(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}}if(Object.entries(this.uniforms).forEach(([t,e])=>{"sampler2d"==e.type.toLowerCase()&&this.sampler_names.push(t)}),G(this.gl))this.daiFunc=this.gl.drawArraysInstanced.bind(this.gl),this.deiFunc=this.gl.drawElementsInstanced.bind(this.gl);else{const t=this.gl.getExtension("ANGLE_instanced_arrays");this.daiFunc=t.drawArraysInstancedANGLE.bind(t),this.deiFunc=t.drawElementsInstancedANGLE.bind(t)}}use(t,e,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,this.instance_count=0,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.draw_mode=null===this.draw_mode?e.draw_mode:this.draw_mode,e.is_per_instance){if(0==this.instance_count)this.instance_count=e.n_verts;else if(this.instance_count!=e.n_verts)throw`Unexpected number of instances for attribute buffer ${t} (expected ${this.instance_count}, got ${e.n_verts})`}else{if(this.n_verts=null===this.n_verts?e.n_verts:this.n_verts,this.n_verts!=e.n_verts)throw`Unexpected number of vertices for attribute buffer ${t} (expected ${this.n_verts}, got ${e.n_verts}).`;if(this.draw_mode!=e.draw_mode)throw`Unexpected draw mode for attribute buffer ${t} (expected ${this.draw_mode}, got ${e.draw_mode}).`}const{type:n,location:r}=this.attributes[t];e.bindToProgram(r)})}setUniforms(t){Object.entries(t).forEach(([t,e])=>{if(void 0===this.uniforms[t])return void console.warn(`Skipping uniform value provided for '${t}' because the uniform was not found in the program.`);const{type:n,location:r}=this.uniforms[t];if("int"===n&&"number"==typeof e)this.gl.uniform1i(r,e);else if("float"===n&&"number"==typeof e)this.gl.uniform1f(r,e);else if("float"===n&&e instanceof Array)this.gl.uniform1fv(r,e);else if("vec2"===n&&e instanceof Array)this.gl.uniform2fv(r,e);else if("vec3"===n&&e instanceof Array)this.gl.uniform3fv(r,e);else if("vec4"===n&&e instanceof Array)this.gl.uniform4fv(r,e);else{if(!("mat4"===n&&e instanceof Array))throw`Could not figure out uniform function for type '${n}' and value '${String(e)}'`;this.gl.uniformMatrix4fv(r,!1,e)}})}bindTextures(t){Object.entries(t).forEach(([t,e])=>{if(void 0===this.uniforms[t])return void console.warn(`Skipping texture provided for sampler '${t}' because the sampler was not found in the program.`);const n=this.sampler_names.indexOf(t),{type:r,location:o}=this.uniforms[t];e.bindToProgram(o,n)})}draw(){if(null===this.draw_mode||null===this.n_verts)throw"Cannot draw without binding attribute buffers";null===this.index_buffer?0==this.instance_count?this.gl.drawArrays(this.draw_mode,0,this.n_verts):this.daiFunc(this.draw_mode,0,this.n_verts,this.instance_count):0==this.instance_count?this.gl.drawElements(this.draw_mode,this.index_buffer.n_verts,this.index_buffer.dtype,0):this.deiFunc(this.draw_mode,this.index_buffer.n_verts,this.index_buffer.dtype,0,this.instance_count)}}class H{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,t.spec.format,e,n,r,o,0)}}new class extends H{constructor(){super(null,null)}registerGLContext(t){this.gl=t}};const V=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"]}'),W=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"]}'),$=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"]}'),X=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"]}'),Y=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"]}'),Z=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"]}'),J="This constructor is not a subclass of Float16Array",q="The constructor property value is not an object",K="Attempting to access detached ArrayBuffer",Q="Cannot convert undefined or null to object",tt="Cannot mix BigInt and other types, use explicit conversions",et="@@iterator property is not callable",nt="Reduce of empty array with no initial value",rt="Offset is out of bounds";function ot(t){return(e,...n)=>at(t,e,n)}function it(t,e){return ot(ut(t,e).get)}const{apply:at,construct:st,defineProperty:lt,get:ct,getOwnPropertyDescriptor:ut,getPrototypeOf:ft,has:ht,ownKeys:dt,set:pt,setPrototypeOf:_t}=Reflect,mt=Proxy,{EPSILON:gt,MAX_SAFE_INTEGER:vt,isFinite:bt,isNaN:yt}=Number,{iterator:wt,species:xt,toStringTag:Tt,for:Et}=Symbol,At=Object,{create:St,defineProperty:Mt,freeze:Rt,is:Pt}=At,Ft=At.prototype,It=Ft.__lookupGetter__?ot(Ft.__lookupGetter__):(t,e)=>{if(null==t)throw Ee(Q);let n=At(t);do{const t=ut(n,e);if(void 0!==t)return Ot(t,"get")?t.get:void 0}while(null!==(n=ft(n)))},Ot=At.hasOwn||ot(Ft.hasOwnProperty),kt=Array,Ct=kt.isArray,Nt=kt.prototype,Bt=ot(Nt.join),Gt=ot(Nt.push),Lt=ot(Nt.toLocaleString),jt=Nt[wt],Dt=ot(jt),{abs:Ut,trunc:zt}=Math,Ht=ArrayBuffer,Vt=Ht.isView,Wt=Ht.prototype,$t=ot(Wt.slice),Xt=it(Wt,"byteLength"),Yt="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:null,Zt=Yt&&it(Yt.prototype,"byteLength"),Jt=ft(Uint8Array),qt=Jt.from,Kt=Jt.prototype,Qt=Kt[wt],te=ot(Kt.keys),ee=ot(Kt.values),ne=ot(Kt.entries),re=ot(Kt.set),oe=ot(Kt.reverse),ie=ot(Kt.fill),ae=ot(Kt.copyWithin),se=ot(Kt.sort),le=ot(Kt.slice),ce=ot(Kt.subarray),ue=it(Kt,"buffer"),fe=it(Kt,"byteOffset"),he=it(Kt,"length"),de=it(Kt,Tt),pe=Uint8Array,_e=Uint16Array,me=(...t)=>at(qt,_e,t),ge=Uint32Array,ve=Float32Array,be=ft([][wt]()),ye=ot(be.next),we=ot(function*(){}().next),xe=ft(be),Te=DataView.prototype,Ee=(ot(Te.getUint16),ot(Te.setUint16),TypeError),Ae=RangeError,Se=WeakSet,Me=Se.prototype,Re=ot(Me.add),Pe=ot(Me.has),Fe=WeakMap,Ie=Fe.prototype,Oe=ot(Ie.get),ke=ot(Ie.has),Ce=ot(Ie.set),Ne=new Fe,Be=St(null,{next:{value:function(){const t=Oe(Ne,this);return ye(t)}},[wt]:{value:function(){return this}}});function Ge(t){if(t[wt]===jt&&be.next===ye)return t;const e=St(Be);return Ce(Ne,e,Dt(t)),e}const Le=new Fe,je=St(xe,{next:{value:function(){const t=Oe(Le,this);return we(t)},writable:!0,configurable:!0}});for(const t of dt(be))"next"!==t&&Mt(je,t,ut(be,t));function De(t){const e=St(je);return Ce(Le,e,t),e}function Ue(t){return null!==t&&"object"==typeof t||"function"==typeof t}function ze(t){return null!==t&&"object"==typeof t}function He(t){return void 0!==de(t)}function Ve(t){const e=de(t);return"BigInt64Array"===e||"BigUint64Array"===e}function We(t){if(null===Yt)return!1;try{return Zt(t),!0}catch(t){return!1}}function $e(t){return!!Ct(t)&&t[wt]===jt&&be.next===ye}function Xe(t){if("string"!=typeof t)return!1;const e=+t;return t===e+""&&!!bt(e)&&e===zt(e)}const Ye=Et("__Float16Array__"),Ze=1/gt,Je=5.960464477539063e-8,qe=.0009765625*Ze;const Ke=new Ht(4),Qe=new ve(Ke),tn=new ge(Ke),en=new _e(512),nn=new pe(512);for(let t=0;t<256;++t){const e=t-127;e<-27?(en[t]=0,en[256|t]=32768,nn[t]=24,nn[256|t]=24):e<-14?(en[t]=1024>>-e-14,en[256|t]=1024>>-e-14|32768,nn[t]=-e-1,nn[256|t]=-e-1):e<=15?(en[t]=e+15<<10,en[256|t]=e+15<<10|32768,nn[t]=13,nn[256|t]=13):e<128?(en[t]=31744,en[256|t]=64512,nn[t]=24,nn[256|t]=24):(en[t]=31744,en[256|t]=64512,nn[t]=13,nn[256|t]=13)}function rn(t){Qe[0]=function(t){const e=+t;if(!bt(e)||0===e)return e;const n=e>0?1:-1,r=Ut(e);if(r<6103515625e-14)return n*function(t){return t+Ze-Ze}(r/Je)*Je;const o=(1+qe)*r,i=o-(o-r);return i>65504||yt(i)?n*(1/0):n*i}(t);const e=tn[0],n=e>>23&511;return en[n]+((8388607&e)>>nn[n])}const on=new ge(2048);for(let t=1;t<1024;++t){let e=t<<13,n=0;for(;!(8388608&e);)e<<=1,n-=8388608;e&=-8388609,n+=947912704,on[t]=e|n}for(let t=1024;t<2048;++t)on[t]=939524096+(t-1024<<13);const an=new ge(64);for(let t=1;t<31;++t)an[t]=t<<23;an[31]=1199570944,an[32]=2147483648;for(let t=33;t<63;++t)an[t]=2147483648+(t-32<<23);an[63]=3347054592;const sn=new _e(64);for(let t=1;t<64;++t)32!==t&&(sn[t]=1024);function ln(t){const e=t>>10;return tn[0]=on[sn[e]+(1023&t)]+an[e],Qe[0]}function cn(t){const e=+t;return yt(e)||0===e?0:zt(e)}function un(t){const e=cn(t);return e<0?0:e<vt?e:vt}function fn(t,e){if(!Ue(t))throw Ee("This is not an object");const n=t.constructor;if(void 0===n)return e;if(!Ue(n))throw Ee(q);const r=n[xt];return null==r?e:r}function hn(t){if(We(t))return!1;try{return $t(t,0,0),!1}catch(t){}return!0}function dn(t,e){const n=yt(t),r=yt(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=Pt(t,0),r=Pt(e,0);if(!n&&r)return-1;if(n&&!r)return 1}return 0}const pn=new Fe;function _n(t){return ke(pn,t)||!Vt(t)&&function(t){if(!ze(t))return!1;const e=ft(t);if(!ze(e))return!1;const n=e.constructor;if(void 0===n)return!1;if(!Ue(n))throw Ee(q);return ht(n,Ye)}(t)}function mn(t){if(!_n(t))throw Ee("This is not a Float16Array object")}function gn(t,e){const n=_n(t),r=He(t);if(!n&&!r)throw Ee("Species constructor didn't return TypedArray object");if("number"==typeof e){let r;if(n){const e=vn(t);r=he(e)}else r=he(t);if(r<e)throw Ee("Derived constructor created TypedArray object which was too small length")}if(Ve(t))throw Ee(tt)}function vn(t){const e=Oe(pn,t);if(void 0!==e){if(hn(ue(e)))throw Ee(K);return e}const n=t.buffer;if(hn(n))throw Ee(K);const r=st(xn,[n,t.byteOffset,t.length],t.constructor);return Oe(pn,r)}function bn(t){const e=he(t),n=[];for(let r=0;r<e;++r)n[r]=ln(t[r]);return n}const yn=new Se;for(const t of dt(Kt)){if(t===Tt)continue;const e=ut(Kt,t);Ot(e,"get")&&"function"==typeof e.get&&Re(yn,e.get)}const wn=Rt({get:(t,e,n)=>Xe(e)&&Ot(t,e)?ln(ct(t,e)):Pe(yn,It(t,e))?ct(t,e):ct(t,e,n),set:(t,e,n,r)=>Xe(e)&&Ot(t,e)?pt(t,e,rn(n)):pt(t,e,n,r),getOwnPropertyDescriptor(t,e){if(Xe(e)&&Ot(t,e)){const n=ut(t,e);return n.value=ln(n.value),n}return ut(t,e)},defineProperty:(t,e,n)=>Xe(e)&&Ot(t,e)&&Ot(n,"value")?(n.value=rn(n.value),lt(t,e,n)):lt(t,e,n)});class xn{constructor(t,e,n){let r;if(_n(t))r=st(_e,[vn(t)],new.target);else if(!Ue(t)||(function(t){try{return Xt(t),!0}catch(t){return!1}}(o=t)||We(o)))r=st(_e,arguments,new.target);else{let e,n;if(He(t)){if(e=t,n=he(t),hn(ue(t)))throw Ee(K);if(Ve(t))throw Ee(tt);const o=new Ht(2*n);r=st(_e,[o],new.target)}else{const o=t[wt];if(null!=o&&"function"!=typeof o)throw Ee(et);null!=o?$e(t)?(e=t,n=t.length):(e=[...t],n=e.length):(e=t,n=un(e.length)),r=st(_e,[n],new.target)}for(let t=0;t<n;++t)r[t]=rn(e[t])}var o;const i=new mt(r,wn);return Ce(pn,i,r),i}static from(t,...e){const n=this;if(!ht(n,Ye))throw Ee(J);if(n===xn){if(_n(t)&&0===e.length){const e=vn(t),n=new _e(ue(e),fe(e),he(e));return new xn(ue(le(n)))}if(0===e.length)return new xn(ue(me(t,rn)));const n=e[0],r=e[1];return new xn(ue(me(t,function(t,...e){return rn(at(n,this,[t,...Ge(e)]))},r)))}let r,o;const i=t[wt];if(null!=i&&"function"!=typeof i)throw Ee(et);if(null!=i)$e(t)?(r=t,o=t.length):He(a=t)&&a[wt]===Qt&&be.next===ye?(r=t,o=he(t)):(r=[...t],o=r.length);else{if(null==t)throw Ee(Q);r=At(t),o=un(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]=at(t,n,[r[e],e])}return s}static of(...t){const e=this;if(!ht(e,Ye))throw Ee(J);const n=t.length;if(e===xn){const e=new xn(n),r=vn(e);for(let e=0;e<n;++e)r[e]=rn(t[e]);return e}const r=new e(n);for(let e=0;e<n;++e)r[e]=t[e];return r}keys(){mn(this);const t=vn(this);return te(t)}values(){mn(this);const t=vn(this);return De(function*(){for(const e of ee(t))yield ln(e)}())}entries(){mn(this);const t=vn(this);return De(function*(){for(const[e,n]of ne(t))yield[e,ln(n)]}())}at(t){mn(this);const e=vn(this),n=he(e),r=cn(t),o=r>=0?r:n+r;if(!(o<0||o>=n))return ln(e[o])}with(t,e){mn(this);const n=vn(this),r=he(n),o=cn(t),i=o>=0?o:r+o,a=+e;if(i<0||i>=r)throw Ae(rt);const s=new _e(ue(n),fe(n),he(n)),l=new xn(ue(le(s)));return vn(l)[i]=rn(a),l}map(t,...e){mn(this);const n=vn(this),r=he(n),o=e[0],i=fn(n,xn);if(i===xn){const e=new xn(r),i=vn(e);for(let e=0;e<r;++e){const r=ln(n[e]);i[e]=rn(at(t,o,[r,e,this]))}return e}const a=new i(r);gn(a,r);for(let e=0;e<r;++e){const r=ln(n[e]);a[e]=at(t,o,[r,e,this])}return a}filter(t,...e){mn(this);const n=vn(this),r=he(n),o=e[0],i=[];for(let e=0;e<r;++e){const r=ln(n[e]);at(t,o,[r,e,this])&&Gt(i,r)}const a=new(fn(n,xn))(i);return gn(a),a}reduce(t,...e){mn(this);const n=vn(this),r=he(n);if(0===r&&0===e.length)throw Ee(nt);let o,i;0===e.length?(o=ln(n[0]),i=1):(o=e[0],i=0);for(let e=i;e<r;++e)o=t(o,ln(n[e]),e,this);return o}reduceRight(t,...e){mn(this);const n=vn(this),r=he(n);if(0===r&&0===e.length)throw Ee(nt);let o,i;0===e.length?(o=ln(n[r-1]),i=r-2):(o=e[0],i=r-1);for(let e=i;e>=0;--e)o=t(o,ln(n[e]),e,this);return o}forEach(t,...e){mn(this);const n=vn(this),r=he(n),o=e[0];for(let e=0;e<r;++e)at(t,o,[ln(n[e]),e,this])}find(t,...e){mn(this);const n=vn(this),r=he(n),o=e[0];for(let e=0;e<r;++e){const r=ln(n[e]);if(at(t,o,[r,e,this]))return r}}findIndex(t,...e){mn(this);const n=vn(this),r=he(n),o=e[0];for(let e=0;e<r;++e){const r=ln(n[e]);if(at(t,o,[r,e,this]))return e}return-1}findLast(t,...e){mn(this);const n=vn(this),r=he(n),o=e[0];for(let e=r-1;e>=0;--e){const r=ln(n[e]);if(at(t,o,[r,e,this]))return r}}findLastIndex(t,...e){mn(this);const n=vn(this),r=he(n),o=e[0];for(let e=r-1;e>=0;--e){const r=ln(n[e]);if(at(t,o,[r,e,this]))return e}return-1}every(t,...e){mn(this);const n=vn(this),r=he(n),o=e[0];for(let e=0;e<r;++e)if(!at(t,o,[ln(n[e]),e,this]))return!1;return!0}some(t,...e){mn(this);const n=vn(this),r=he(n),o=e[0];for(let e=0;e<r;++e)if(at(t,o,[ln(n[e]),e,this]))return!0;return!1}set(t,...e){mn(this);const n=vn(this),r=cn(e[0]);if(r<0)throw Ae(rt);if(null==t)throw Ee(Q);if(Ve(t))throw Ee(tt);if(_n(t))return re(vn(this),vn(t),r);if(He(t)&&hn(ue(t)))throw Ee(K);const o=he(n),i=At(t),a=un(i.length);if(r===1/0||a+r>o)throw Ae(rt);for(let t=0;t<a;++t)n[t+r]=rn(i[t])}reverse(){mn(this);const t=vn(this);return oe(t),this}toReversed(){mn(this);const t=vn(this),e=new _e(ue(t),fe(t),he(t)),n=new xn(ue(le(e))),r=vn(n);return oe(r),n}fill(t,...e){mn(this);const n=vn(this);return ie(n,rn(t),...Ge(e)),this}copyWithin(t,e,...n){mn(this);const r=vn(this);return ae(r,t,e,...Ge(n)),this}sort(t){mn(this);const e=vn(this),n=void 0!==t?t:dn;return se(e,(t,e)=>n(ln(t),ln(e))),this}toSorted(t){mn(this);const e=vn(this);if(void 0!==t&&"function"!=typeof t)throw new Ee("The comparison function must be either a function or undefined");const n=void 0!==t?t:dn,r=new _e(ue(e),fe(e),he(e)),o=new xn(ue(le(r))),i=vn(o);return se(i,(t,e)=>n(ln(t),ln(e))),o}slice(t,e){mn(this);const n=vn(this),r=fn(n,xn);if(r===xn){const r=new _e(ue(n),fe(n),he(n));return new xn(ue(le(r,t,e)))}const o=he(n),i=cn(t),a=void 0===e?o:cn(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(gn(u,c),0===c)return u;if(hn(ue(n)))throw Ee(K);let f=0;for(;s<l;)u[f]=ln(n[s]),++s,++f;return u}subarray(t,e){mn(this);const n=vn(this),r=fn(n,xn),o=new _e(ue(n),fe(n),he(n)),i=ce(o,t,e),a=new r(ue(i),fe(i),he(i));return gn(a),a}indexOf(t,...e){mn(this);const n=vn(this),r=he(n);let o=cn(e[0]);if(o===1/0)return-1;o<0&&(o+=r,o<0&&(o=0));for(let e=o;e<r;++e)if(Ot(n,e)&&ln(n[e])===t)return e;return-1}lastIndexOf(t,...e){mn(this);const n=vn(this),r=he(n);let o=e.length>=1?cn(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(Ot(n,e)&&ln(n[e])===t)return e;return-1}includes(t,...e){mn(this);const n=vn(this),r=he(n);let o=cn(e[0]);if(o===1/0)return!1;o<0&&(o+=r,o<0&&(o=0));const i=yt(t);for(let e=o;e<r;++e){const r=ln(n[e]);if(i&&yt(r))return!0;if(r===t)return!0}return!1}join(t){mn(this);const e=bn(vn(this));return Bt(e,t)}toLocaleString(...t){mn(this);const e=bn(vn(this));return Lt(e,...Ge(t))}get[Tt](){if(_n(this))return"Float16Array"}}Mt(xn,"BYTES_PER_ELEMENT",{value:2}),Mt(xn,Ye,{}),_t(xn,Jt);const Tn=xn.prototype;Mt(Tn,"BYTES_PER_ELEMENT",{value:2}),Mt(Tn,wt,{value:Tn.values,writable:!0,configurable:!0}),_t(Tn,Kt);var En=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){this.rgba=t}return Object.defineProperty(t.prototype,"r",{get:function(){return this.rgba[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"g",{get:function(){return this.rgba[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this.rgba[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"a",{get:function(){return this.rgba[3]},enumerable:!1,configurable:!0}),t.prototype.withOpacity=function(e){return new t([this.r,this.g,this.b,e])},t.prototype.toRGBHex=function(){return this.toRGBAHex().slice(0,-2)},t.prototype.toRGBAHex=function(){return e=this.rgba,"float"==(t=void 0===t?"float":t)&&(e=e.map(function(t){return Math.round(255*t)})),"#"+e.map(function(t){return t.toString(16).padStart(2,"0").toUpperCase()}).join("");var t,e},t.prototype.toRGBATuple=function(){return this.rgba},t.prototype.toHSVTuple=function(){return function(t){var e,n=En(t,3),r=n[0],o=n[1],i=n[2],a=Math.max(r,o,i),s=a-Math.min(r,o,i);if(0==s)e=0;else if(a==r)e=(o-i)/s*60%6;else if(a==o)e=60*((i-r)/s+2);else{if(a!=i)throw"You've messed something up in rgb2hsv()";e=60*((r-o)/s+4)}return[e,0==a?0:s/a,a]}([this.r,this.g,this.b])},t.fromHex=function(e){return new t(function(t,e){e=void 0===e?"float":e;var n=t.match(/#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?/i);if(null===n)throw"Got '".concat(t,"' in hex2rgba, which does not look like a hex color");var r=n.slice(1).filter(function(t){return void 0!==t}).map(function(t){return parseInt(t,16)});return"float"==e&&(r=r.map(function(t){return t/255})),void 0===r[3]?[r[0],r[1],r[2],1]:[r[0],r[1],r[2],r[3]]}(e))},t.fromHSVTuple=function(e){var n=function(t){var e,n,r,o=En(t,3),i=o[0],a=o[1],s=o[2],l=s*a,c=l*(1-Math.abs(i/60%2-1)),u=s-l;if(0<=i&&i<60)e=l,n=c,r=0;else if(60<=i&&i<120)e=c,n=l,r=0;else if(120<=i&&i<180)e=0,n=l,r=c;else if(180<=i&&i<240)e=0,n=c,r=l;else if(240<=i&&i<300)e=c,n=0,r=l;else{if(!(300<=i&&i<360))throw"H is out of bounds in hsv2rgb";e=l,n=0,r=c}return[e+u,n+u,r+u]}(e);return new t([n[0],n[1],n[2],1])},t.normalizeColor=function(e){return e instanceof t?e:t.fromHex(e)},t}(),Sn=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},Mn=n(374),Rn=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,")");this.levels=t,this.colors=e.map(function(t){return An.normalizeColor(t)}),n=void 0===n?{}:n,this.overflow_color=void 0===n.overflow_color?null:An.normalizeColor(n.overflow_color),this.underflow_color=void 0===n.underflow_color?null:An.normalizeColor(n.underflow_color)}return t.prototype.getColors=function(){return this.colors.map(function(t){return t.toRGBHex()})},t.prototype.getOpacities=function(){return this.colors.map(function(t){return t.a})},t.prototype.withOpacity=function(e){for(var n=[],r=[],o={},i=0;i<this.colors.length;i++){var a=this.colors[i],s=this.levels[i],l=this.levels[i+1],c=e(s,l),u=a.withOpacity(c);c>0&&(r[r.length-1]!=s&&r.push(s),r.push(l),n.push(u))}if(null!==this.underflow_color){var f=e(this.levels[0],this.levels[0]);f>0&&(o.underflow_color=this.underflow_color.withOpacity(f))}if(null!==this.overflow_color){var h=e(this.levels[this.levels.length-1],this.levels[this.levels.length-1]);h>0&&(o.overflow_color=this.overflow_color.withOpacity(h))}return new t(r,n,o)},t.diverging=function(e,n,r,o,i){for(var a,s,l=[],c=[],u=(o-r)/(i-1),f=(o+r)/2,h=[0,0,.9],d=An.fromHex(e).toHSVTuple(),p=An.fromHex(n).toHSVTuple(),_=0;_<i;_++){var m=r+_*u,g=void 0,v=void 0,b=void 0,y=void 0;m<f?(y=Math.pow((f-m)/(f-r),1.5),g=(a=Sn([d[0],h[1]+(d[1]-h[1])*y,h[2]+(d[2]-h[2])*y],3))[0],v=a[1],b=a[2]):(y=Math.pow((m-f)/(o-f),1.5),g=(s=Sn([p[0],h[1]+(p[1]-h[1])*y,h[2]+(p[2]-h[2])*y],3))[0],v=s[1],b=s[2]),l.push(An.fromHSVTuple([g,v,b]).withOpacity(Math.min(2*y,1)))}for(var w=0;w<=i;w++){var x=(o-r)/i;c.push(r+w*x)}return new t(c,l)},t}();function Pn(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 Rn(t.levels,t.colors,r)}var Fn=Pn(V,"over").withOpacity(function(t,e){return Math.min((e-20)/10,1)}),In=Pn(W,"over").withOpacity(function(t,e){return Math.min((e-20)/10,1)}),On=Pn($,"over").withOpacity(function(t,e){return Math.min(e/1e3,1)}),kn=Pn(X,"both"),Cn=Pn(Y,"both"),Nn=Pn(Z,"over"),Bn=function(){function t(t){this.colormap=t,this.gl_elems=null}return t.applyShader=function(t){return S(Mn,t)},t.prototype.setupShaderVariables=function(t,e){var n=function(t){for(var e=[],n=0;n<101;n++)e.push(n/100);var r=t.levels,o=r.length-1,i=r.map(function(t,e){return e/o}),a=r.map(function(t){return(t-r[0])/(r[o]-r[0])}),s=e.map(function(t){var e;for(e=0;!(a[e]<=t&&t<=a[e+1]);e++);var n=(t-a[e])/(a[e+1]-a[e]);return i[e]*(1-n)+i[e+1]*n});return new xn(s)}(this.colormap),r=function(t){var e=document.createElement("canvas");e.width=t.colors.length,e.height=1;var n=e.getContext("2d");return t.colors.forEach(function(t,e){if(null===n)throw"Could not get rendering context for colormap image canvas";n.fillStyle=t.toRGBAHex(),n.fillRect(e,0,1,1)}),e}(this.colormap),o=C(t,"float16"),i=o.format,a=o.type,s=o.row_alignment,l={format:t.RGBA,type:t.UNSIGNED_BYTE,image:r,mag_filter:e},c=new D(t,l),u={format:i,type:a,width:n.length,height:1,image:new Uint16Array(n.buffer),mag_filter:t.LINEAR,row_alignment:s},f=new D(t,u);this.gl_elems={cmap_texture:c,cmap_nonlin_texture:f}},t.prototype.bindShaderVariables=function(t){if(null!==this.gl_elems){var e=this.colormap,n=null===e.underflow_color?[0,0,0,0]:e.underflow_color.toRGBATuple(),r=null===e.overflow_color?[0,0,0,0]:e.overflow_color.toRGBATuple();t.setUniforms({u_cmap_min:e.levels[0],u_cmap_max:e.levels[e.levels.length-1],u_n_index:101,u_underflow_color:n,u_overflow_color:r}),t.bindTextures({u_cmap_sampler:this.gl_elems.cmap_texture,u_cmap_nonlin_sampler:this.gl_elems.cmap_nonlin_texture})}},t}(),Gn=function(){function t(t,e,n){this.vertex_shader_src=t,this.fragment_shader_src=e,this.shader_defines=n,this.program_map=new Map}return t.prototype.getShaderProgram=function(t,e){var n=null===e?"default":e.variantName,r=this.program_map.get(n);if(void 0!==r)return r;var o=this.vertex_shader_src;o=S(null!==e?e.vertexShaderPrelude+"\n"+e.define:"\n uniform mat4 u_projection_matrix;\n\n vec4 projectTile(vec2 p) {\n vec4 result = u_projection_matrix * vec4(p, 0.0, 1.0);\n return result;\n }",o);var i=new z(t,o,this.fragment_shader_src,{define:this.shader_defines});return this.program_map.set(n,i),i},t.prototype.getShaderUniforms=function(t){return"maplibre"==t.type?t.shaderData.define.includes("GLOBE")?{u_projection_matrix:t.defaultProjectionData.mainMatrix,u_projection_fallback_matrix:t.defaultProjectionData.fallbackMatrix,u_projection_tile_mercator_coords:t.defaultProjectionData.tileMercatorCoords,u_projection_clipping_plane:t.defaultProjectionData.clippingPlane,u_projection_transition:t.defaultProjectionData.projectionTransition}:{u_projection_matrix:t.defaultProjectionData.mainMatrix}:{u_projection_matrix:t.mainMatrix}},t}(),Ln=function(){return Ln=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},Ln.apply(this,arguments)},jn=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},Dn=n(840),Un=n(934),zn={"-":[1],"--":[1,1,1,1,0,0],":":[1,0],"-.":[1,1,1,0,1,0]},Hn=function(){function t(t,e,n){var r,o=void 0===(n=void 0===n?{}:n).color?"#000000":n.color;this.color=An.fromHex(o);var i=void 0===n.line_width?1:n.line_width,a=void 0===n.line_style?"-":n.line_style;this.offset_rotates_with_map=void 0===n.offset_rotates_with_map||n.offset_rotates_with_map,this.width=i;var s=[];this.vertices=new j(t,e.vertices,3,t.TRIANGLE_STRIP),this.extrusion=new j(t,e.extrusion,2,t.TRIANGLE_STRIP),void 0!==e.offsets?(this.offset=new j(t,e.offsets,2,t.TRIANGLE_STRIP),this.scale=void 0===n.offset_scale?1:n.offset_scale,s.push("OFFSET")):(this.offset=null,this.scale=null),void 0!==e.zoom?(this.min_zoom=new j(t,e.zoom,1,t.TRIANGLE_STRIP),s.push("ZOOM")):this.min_zoom=null;var l=Un;if(void 0!==e.data){s.push("DATA"),this.line_data=new j(t,e.data,1,t.TRIANGLE_STRIP);var c=void 0===n.cmap?new Rn([0,1],[o],{overflow_color:o,underflow_color:o}):n.cmap;this.cmap_gpu=new Bn(c),this.cmap_gpu.setupShaderVariables(t,t.NEAREST),l=Bn.applyShader(l)}else this.line_data=null,this.cmap_gpu=null;r=jn(function(t,e){var n=Array.isArray(e)?e:zn[e],r={format:F(t)?t.R8:t.LUMINANCE,type:t.UNSIGNED_BYTE,width:n.length,height:1,image:new Uint8Array(n.map(function(t){return t>0?255:0})),mag_filter:t.NEAREST,row_alignment:1};return[n.length,new D(t,r)]}(t,a),2),this.n_dash=r[0],this.dash_texture=r[1],this.shader_manager=new Gn(Dn,l,s)}return t.make=function(e,n,r){return o=this,i=void 0,s=function(){var o;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,function(i){switch(i.label){case 0:return[4,O.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=jn(n,2),s=a[0],l=a[1],c=I(e),u=this.shader_manager.getShaderProgram(t,c.shaderData),f={a_pos:this.vertices,a_extrusion:this.extrusion},h=Ln({u_line_width:this.width,u_map_width:s,u_map_height:l,u_offset:0,u_zoom:r,u_dash_pattern_length:this.n_dash},this.shader_manager.getShaderUniforms(c)),d={u_dash_sampler:this.dash_texture};null!==this.offset&&null!==this.scale&&(f.a_offset=this.offset,h.u_offset_scale=this.scale*(l/s),h.u_offset_rotates_with_map=this.offset_rotates_with_map?1:0),null!==this.min_zoom&&(f.a_min_zoom=this.min_zoom),null!==this.line_data?f.a_data=this.line_data:h.u_color=this.color.toRGBATuple(),u.use(f,h,d),null!==this.cmap_gpu&&this.cmap_gpu.bindShaderVariables(u),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),u.draw(),"maplibre"==c.type&&c.shaderData.define.includes("GLOBE")||(u.setUniforms({u_offset:-2}),u.draw(),u.setUniforms({u_offset:-1}),u.draw(),u.setUniforms({u_offset:1}),u.draw())},t}(),Vn=n(335),Wn=n.n(Vn),$n=function(){return $n=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},$n.apply(this,arguments)},Xn=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())})},Yn=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])}}},Zn=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},Jn=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))},qn=n(873),Kn=n(947);function Qn(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={},l=0;n.forEach(function(t){var e=t.bin,n=t.glyph;if(void 0===e.x||void 0===e.y)throw"Potpack couldn't pack this pot, I guess?";s[n.id]={id:n.id,width:n.width,height:n.height,left:n.left,top:n.top,atlas_i:e.x,atlas_j:e.y,advance:n.advance},l=Math.max(l,n.height);for(var r=0;r<n.width;r++)for(var i=0;i<n.height;i++){var c=r+n.width*i,u=r+e.x+o*(i+e.y);a[u]=n.data[c]}});var c=s["M".charCodeAt(0)],u=void 0===c?l:c.height-c.top,f=void 0===c?0:-c.top;return{atlas:a,atlas_width:o,atlas_height:i,baseline:u,top:f,glyph_info:s}}var tr,er=new T(function(t){return Xn(void 0,void 0,void 0,function(){var e;return Yn(this,function(n){switch(n.label){case 0:return e=t.map(function(t){return Xn(void 0,void 0,void 0,function(){var e,n;return Yn(this,function(r){switch(r.label){case 0:return[4,fetch(t)];case 1:if(200!=(e=r.sent()).status)throw"Error ".concat(e.status," retrieving font pbf from '").concat(t,"'");return[4,e.blob()];case 2:return[4,r.sent().arrayBuffer()];case 3:return n=r.sent(),[2,(o=new Uint8Array(n),i=function(t,e,n){if(void 0!==n)switch(t){case 1:e.id=n.readVarint();break;case 2:e.data=n.readBytes();break;case 3:e.width=n.readVarint()+6;break;case 4:e.height=n.readVarint()+6;break;case 5:e.left=n.readSVarint();break;case 6:e.top=n.readSVarint();break;case 7:e.advance=n.readVarint()}},a=function(t,e,n){if(void 0!==e&&void 0!==n&&3==t){var r=n.readMessage(i,{});e.push(r)}},new(Wn())(o).readFields(function(t,e,n){void 0!==n&&1==t&&n.readMessage(a,e)},[]))]}var o,i,a})})}),[4,Promise.all(e)];case 1:return[2,Qn(n.sent().flat())]}})})}),nr={horizontal_align:"left",vertical_align:"baseline",font_size:12,text_color:new An([0,0,0,1]),halo_color:new An([0,0,0,1]),halo:!1,offset_x:0,offset_y:0},rr=function(){function t(t,e,n,r){var o=this;this.opts=E(r,nr);var i=F(t)?t.R8:t.LUMINANCE,a=t.UNSIGNED_BYTE,s=0==n.atlas_width||0==n.atlas_height||0==n.atlas.length,l={format:i,type:a,width:s?1:n.atlas_width,height:s?1:n.atlas_height,image:s?new Uint8Array([0,0,0,0]):n.atlas,row_alignment:1,mag_filter:t.LINEAR};this.texture=new D(t,l);var c=6*e.map(function(t){return t.text.length}).reduce(function(t,e){return t+e},0),u=new Float32Array(3*c),f=new Float32Array(2*c),h=new Float32Array(2*c),d=0,p=0,_=0;e.forEach(function(t){for(var e=t.lat,r=t.lon,i=t.text,a=void 0===t.min_zoom?0:t.min_zoom,s=new B(r,e).toMercatorCoord(),l=s.x,c=s.y,m=o.opts.offset_x,g=o.opts.offset_y,v=p,b=0;b<i.length;b++){var y=i.charCodeAt(b),w=n.glyph_info[y];void 0!==w?(m+=w.left,u[d++]=l,u[d++]=c,u[d++]=a,u[d++]=l,u[d++]=c,u[d++]=a,u[d++]=l,u[d++]=c,u[d++]=a,u[d++]=l,u[d++]=c,u[d++]=a,u[d++]=l,u[d++]=c,u[d++]=a,u[d++]=l,u[d++]=c,u[d++]=a,f[p++]=m,f[p++]=g+n.baseline+w.top-w.height,f[p++]=m,f[p++]=g+n.baseline+w.top-w.height,f[p++]=m+w.width,f[p++]=g+n.baseline+w.top-w.height,f[p++]=m,f[p++]=g+n.baseline+w.top,f[p++]=m+w.width,f[p++]=g+n.baseline+w.top,f[p++]=m+w.width,f[p++]=g+n.baseline+w.top,h[_++]=w.atlas_i/n.atlas_width,h[_++]=(w.atlas_j+w.height)/n.atlas_height,h[_++]=w.atlas_i/n.atlas_width,h[_++]=(w.atlas_j+w.height)/n.atlas_height,h[_++]=(w.atlas_i+w.width)/n.atlas_width,h[_++]=(w.atlas_j+w.height)/n.atlas_height,h[_++]=w.atlas_i/n.atlas_width,h[_++]=w.atlas_j/n.atlas_height,h[_++]=(w.atlas_i+w.width)/n.atlas_width,h[_++]=w.atlas_j/n.atlas_height,h[_++]=(w.atlas_i+w.width)/n.atlas_width,h[_++]=w.atlas_j/n.atlas_height,m+=w.advance-w.left):m+=7}if("center"==o.opts.horizontal_align)for(b=v;b<v+12*i.length;b+=2)f[b]-=(m-o.opts.offset_x)/2;else if("right"==o.opts.horizontal_align)for(b=v;b<v+12*i.length;b+=2)f[b]-=m-o.opts.offset_x;if("top"==o.opts.vertical_align)for(b=v+1;b<v+12*i.length;b+=2)f[b]-=n.baseline-n.top;else if("middle"==o.opts.vertical_align)for(b=v+1;b<v+12*i.length;b+=2)f[b]-=(n.baseline-n.top)/2}),this.shader_manager=new Gn(qn,Kn,[]),this.anchors=new j(t,u,3,t.TRIANGLE_STRIP),this.offsets=new j(t,f,2,t.TRIANGLE_STRIP),this.texcoords=new j(t,h,2,t.TRIANGLE_STRIP)}return t.make=function(e,n,r,o){return Xn(this,void 0,void 0,function(){var i,a,s,l,c,u,f,h,d;return Yn(this,function(p){switch(p.label){case 0:for(i=256,a=n.map(function(t){return Jn([],Zn(t.text),!1)}).flat().map(function(t){return t.charCodeAt(0)}).filter(function(t,e,n){return n.indexOf(t)==e}),s=Math.min.apply(Math,Jn([],Zn(a),!1)),l=Math.max.apply(Math,Jn([],Zn(a),!1)),c=Math.floor(s/i)*i,u=Math.floor(l/i)*i,f=[],h=c;h<=u;h+=i)f.push(r.replace("{range}","".concat(h,"-").concat(h+i-1)));return[4,er.getValue(f)];case 1:return 0!=(d=p.sent()).atlas_height&&0!=d.atlas_width&&0!=d.atlas.length||console.warn("No font data from '".concat(r,"'")),[2,new t(e,n,d,o)]}})})},t.prototype.render=function(t,e,n,r){var o=Zn(n,2),i=o[0],a=o[1],s=I(e),l=this.shader_manager.getShaderProgram(t,s.shaderData),c=$n({u_map_width:i,u_map_height:a,u_map_zoom:r,u_font_size:this.opts.font_size,u_text_color:this.opts.text_color.toRGBATuple(),u_halo_color:this.opts.halo_color.toRGBATuple(),u_offset:0},this.shader_manager.getShaderUniforms(s));c.u_is_halo=this.opts.halo?1:0,l.use({a_pos:this.anchors,a_offset:this.offsets,a_tex_coord:this.texcoords},c,{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),l.draw(),this.opts.halo&&(l.setUniforms({u_is_halo:0}),l.draw()),"maplibre"==s.type&&s.shaderData.define.includes("GLOBE")||(l.setUniforms({u_offset:-2,u_is_halo:this.opts.halo?1:0}),l.draw(),this.opts.halo&&(l.setUniforms({u_is_halo:0}),l.draw()),l.setUniforms({u_offset:-1,u_is_halo:this.opts.halo?1:0}),l.draw(),this.opts.halo&&(l.setUniforms({u_is_halo:0}),l.draw()),l.setUniforms({u_offset:1,u_is_halo:this.opts.halo?1:0}),l.draw(),this.opts.halo&&(l.setUniforms({u_is_halo:0}),l.draw()))},t}(),or=n(317),ir=(tr=function(t,e){return tr=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])},tr(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}tr(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),ar=function(){return ar=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},ar.apply(this,arguments)},sr=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}l((r=r.apply(t,e||[])).next())})},lr=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},cr=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},ur=6378137,fr=6356752.314245;function hr(t){if(0===t.length)return-1;for(var e=t[0],n=0,r=1;r<t.length;r++)t[r]<e&&(n=r,e=t[r]);return n}var dr=function(){function t(t,e,n,r){var o=this;this.type=t,this.is_conformal=e,this.ni=n,this.nj=r,this.billboard_buffer_cache=new T(function(t,e,n){return function(t,e,n,r){return sr(this,void 0,void 0,function(){var o,i,a,s,l,c,u;return lr(this,function(f){switch(f.label){case 0:return o=e.getEarthCoords(),i=o.lats,a=o.lons,s=e.getMinVisibleZoom(n),[4,O.makeBBElements(i,a,s,e.ni,e.nj,r)];case 1:return l=f.sent(),c=new j(t,l.pts,2,t.POINTS,{per_instance:!0}),u=new j(t,l.tex_coords,2,t.POINTS,{per_instance:!0}),[2,{vertices:c,texcoords:u}]}})})}(t,o,e,n)}),this.vector_rotation_cache=new T(function(t,e){return function(t,e,n){var r=e.getEarthCoords(),o=new xn(e.ni*e.nj).fill(parseFloat("nan"));if(n)o.fill(0);else{e.is_conformal||console.warn("Vector rotations for non-conformal projections are not supported. The output may look incorrect.");for(var i=0;i<r.lats.length;i++){var a=r.lons[i],s=r.lats[i];o[i]=e.getVectorRotationAtPoint(a,s)}}var l=C(t,"float16"),c={format:l.format,type:l.type,row_alignment:l.row_alignment,image:new Uint16Array(o.buffer),width:e.ni,height:e.nj,mag_filter:t.LINEAR};return{rotation:new D(t,c)}}(t,o,e)})}return t.prototype.getWGLBillboardBuffers=function(t,e,n){return sr(this,void 0,void 0,function(){return lr(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.getVectorRotationAtPoint=function(t,e){var n=cr(this.transform(t,e),2),r=n[0],o=n[1],i=cr(this.transform(t+.01,e),2),a=i[0],s=i[1];return Math.atan2(s-o,a-r)},t.prototype.getVectorRotationTexture=function(t,e){return this.vector_rotation_cache.getValue(t,e)},t}(),pr=function(t){function e(e,n,r,o,i,a){var s=t.call(this,e,n,r,o)||this;return s.thin_x=void 0===i?1:i,s.thin_y=void 0===a?1:a,s.buffer_cache=new T(function(t){var e=Math.max(Math.floor(s.ni/20),20),n=Math.max(Math.floor(s.nj/20),20);return function(t,e,n,r){return sr(this,void 0,void 0,function(){var o,i,a,s,l,c,u,f;return lr(this,function(h){switch(h.label){case 0:return o=1/(2*e.ni),i=1/(2*e.nj),a=e.getEarthCoords(n,r),s=a.lats,l=a.lons,[4,O.makeDomainVerticesAndTexCoords(s,l,n,r,o,i)];case 1:return c=h.sent(),u=new j(t,c.vertices,2,t.TRIANGLE_STRIP),f=new j(t,c.tex_coords,2,t.TRIANGLE_STRIP),[2,{vertices:u,texcoords:f}]}})})}(t,s,e,n)}),s}return ir(e,t),e.prototype.xyThinFromMaxZoom=function(t,e){var n=Math.log2(t),r=Math.max(n+1-e,0),o=Math.pow(2,r);return[o,o]},e.prototype.getMinVisibleZoom=function(t){for(var e=new Uint8Array(this.ni*this.nj),n=t/Math.max(this.thin_x,this.thin_y),r=0;r<this.nj*this.thin_y;r++)for(var o=0;o<this.ni*this.thin_x;o++)e[r*this.ni+o]=w(r,o,n);return e},e.prototype.thinDataArray=function(t,e){for(var n=new(A(e))(this.ni*this.nj),r=0;r<this.ni;r++)for(var o=0;o<this.nj;o++){var i=r*this.thin_x+t.ni*o*this.thin_y;n[r+this.ni*o]=e[i]}return n},e.prototype.getWGLBuffers=function(t){return sr(this,void 0,void 0,function(){return lr(this,function(e){switch(e.label){case 0:return[4,this.buffer_cache.getValue(t)];case 1:return[2,e.sent()]}})})},e.prototype.sampleNearestGridPoint=function(t,e,n){var r=cr(this.transform(t,e),2),o=r[0],i=r[1],a=this.getGridCoords(),s=a.x,l=a.y,c=s[0],u=s[s.length-1],f=s[1]-s[0],h=l[0],d=l[l.length-1],p=l[1]-l[0];if(o<c-.5*f||o>u+.5*f||i<h-.5*p||i>d+.5*p)return{sample:NaN,sample_lon:NaN,sample_lat:NaN};var _=hr(s.map(function(t){return Math.abs(t-o)})),m=hr(l.map(function(t){return Math.abs(t-i)})),g=_+m*this.ni,v=cr(this.transform(s[_],l[m],{inverse:!0}),2),b=v[0],y=v[1];return{sample:n[g],sample_lon:b,sample_lat:y}},e}(dr),_r=function(t){function e(e,n,r,o,i,a,s,l){var c=t.call(this,"latlon",!0,e,n,s,l)||this;c.ll_lon=r,c.ll_lat=o,c.ur_lon=i,c.ur_lat=a;var u=(c.ur_lon-c.ll_lon)/(c.ni-1),f=(c.ur_lat-c.ll_lat)/(c.nj-1);return c.ll_cache=new T(function(t,e){for(var n=new Float32Array(t*e),r=new Float32Array(t*e),o=(c.ni-1)/(t-1)*u,i=(c.nj-1)/(e-1)*f,a=0;a<t;a++)for(var s=0;s<e;s++){var l=a+s*t;n[l]=c.ll_lon+a*o,r[l]=c.ll_lat+s*i}return{lons:n,lats:r}}),c.gc_cache=new T(function(){for(var t=new Float32Array(c.ni),e=new Float32Array(c.nj),n=0;n<c.ni;n++)t[n]=c.ll_lon+n*u;for(var r=0;r<c.nj;r++)e[r]=c.ll_lat+r*f;return{x:t,y:e}}),c}return ir(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(t,e){return t=void 0===t?this.ni:t,e=void 0===e?this.nj:e,this.ll_cache.getValue(t,e)},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=cr(this.xyThinFromMaxZoom(t,n),2),o=r[0],i=r[1],a=(this.ur_lon-this.ll_lon)/this.ni,s=(this.ur_lat-this.ll_lat)/this.nj,l=Math.ceil(this.ni/o),c=Math.ceil(this.nj/i),u=(this.ni-1)%o,f=(this.nj-1)%i;return new e(l,c,this.ll_lon,this.ll_lat,this.ur_lon-u*a,this.ur_lat-f*s,this.thin_x*o,this.thin_y*i)},e}(pr),mr=function(t){function e(e,n,r,o,i,a,s,l,c,u,f){var h=t.call(this,"latlonrot",!0,e,n,u,f)||this;h.np_lon=r,h.np_lat=o,h.lon_shift=i,h.ll_lon=a,h.ll_lat=s,h.ur_lon=l,h.ur_lat=c,h.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 d=(h.ur_lon-h.ll_lon)/(h.ni-1),p=(h.ur_lat-h.ll_lat)/(h.nj-1);return h.ll_cache=new T(function(t,e){for(var n=new Float32Array(t*e),r=new Float32Array(t*e),o=(h.ni-1)/(t-1)*d,i=(h.nj-1)/(e-1)*p,a=0;a<t;a++)for(var s=h.ll_lon+a*o,l=0;l<e;l++){var c=h.ll_lat+l*i,u=cr(h.llrot(s,c),2),f=u[0],_=u[1],m=a+l*t;n[m]=f,r[m]=_}return{lons:n,lats:r}}),h.gc_cache=new T(function(){for(var t=new Float32Array(h.ni),e=new Float32Array(h.nj),n=0;n<h.ni;n++)t[n]=h.ll_lon+n*d;for(var r=0;r<h.nj;r++)e[r]=h.ll_lat+r*p;return{x:t,y:e}}),h}return ir(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(t,e){return t=void 0===t?this.ni:t,e=void 0===e?this.nj:e,this.ll_cache.getValue(t,e)},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=cr(this.xyThinFromMaxZoom(t,n),2),o=r[0],i=r[1],a=(this.ur_lon-this.ll_lon)/this.ni,s=(this.ur_lat-this.ll_lat)/this.nj,l=Math.ceil(this.ni/o),c=Math.ceil(this.nj/i),u=(this.ni-1)%o,f=(this.nj-1)%i,h=this.ll_lon,d=this.ll_lat,p=this.ur_lon-u*a,_=this.ur_lat-f*s;return new e(l,c,this.np_lon,this.np_lat,this.lon_shift,h,d,p,_,this.thin_x*o,this.thin_y*i)},e}(pr),gr=function(t){function e(e,n,r,o,i,a,s,l,c,u,f,h,d){var p=t.call(this,"lcc",!0,e,n,h,d)||this;p.lon_0=r,p.lat_0=o,p.lat_std=i,p.ll_x=a,p.ll_y=s,p.ur_x=l,p.ur_y=c,p.a=void 0===u?ur:u,p.b=void 0===f?fr:f,p.lcc=N({lon_0:r,lat_0:o,lat_std:i,a:p.a,b:p.b});var _=(p.ur_x-p.ll_x)/p.ni,m=(p.ur_y-p.ll_y)/p.nj;return p.ll_cache=new T(function(t,e){for(var n=new Float32Array(t*e),r=new Float32Array(t*e),o=(p.ni-1)/(t-1)*_,i=(p.nj-1)/(e-1)*m,a=0;a<t;a++)for(var s=p.ll_x+a*o,l=0;l<e;l++){var c=p.ll_y+l*i,u=cr(p.lcc(s,c,{inverse:!0}),2),f=u[0],h=u[1],d=a+l*t;n[d]=f,r[d]=h}return{lons:n,lats:r}}),p.gc_cache=new T(function(){for(var t=new Float32Array(p.ni),e=new Float32Array(p.nj),n=0;n<p.ni;n++)t[n]=p.ll_x+n*_;for(var r=0;r<p.nj;r++)e[r]=p.ll_y+r*m;return{x:t,y:e}}),p}return ir(e,t),e.fromLLCornerLonLat=function(t,n,r,o,i,a,s,l,c,u,f){var h=N({lon_0:r,lat_0:o,lat_std:i,a:u=void 0===u?ur:u,b:f=void 0===f?fr:f}),d=cr(h(a,s),2),p=d[0],_=d[1];return new e(t,n,r,o,i,p,_,p+t*l,_+n*c,u,f)},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,this.a,this.b)},e.prototype.getEarthCoords=function(t,e){return t=void 0===t?this.ni:t,e=void 0===e?this.nj:e,this.ll_cache.getValue(t,e)},e.prototype.getGridCoords=function(){return this.gc_cache.getValue()},e.prototype.transform=function(t,e,n){var r=void 0!==(n=void 0===n?{}:n).inverse&&n.inverse;return this.lcc(t,e,{inverse:r})},e.prototype.getThinnedGrid=function(t,n){var r=cr(this.xyThinFromMaxZoom(t,n),2),o=r[0],i=r[1],a=(this.ur_x-this.ll_x)/this.ni,s=(this.ur_y-this.ll_y)/this.nj,l=Math.ceil(this.ni/o),c=Math.ceil(this.nj/i),u=(this.ni-1)%o,f=(this.nj-1)%i,h=this.ll_x,d=this.ll_y,p=this.ur_x-u*a,_=this.ur_y-f*s;return new e(l,c,this.lon_0,this.lat_0,this.lat_std,h,d,p,_,this.a,this.b,this.thin_x*o,this.thin_y*i)},e}(pr),vr=function(t){function e(e,n){var r=this;return(r=t.call(this,"unstructured",!0,Math.min(e.length,4096),Math.floor(e.length/4096)+1)||this).coords=e,r.zoom_arg=void 0===n?null:n,r.zoom_cache=new T(function(t){var e=Math.log2(t),n=r.coords.map(function(t){return ar(ar({},new B(t.lon,t.lat).toMercatorCoord()),{min_zoom:24})}),o=new or.kdTree(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))}([],cr(n),!1),function(t,e){return Math.max(Math.abs(t.x-e.x),Math.abs(t.y-e.y))},["x","y"]),i=function(t,n,r){var a=Math.pow(.5,r+1),s=o.nearest({x:t,y:n,min_zoom:0},2,a);if(s.length>0){var l=cr(s.sort(function(t,e){return t[1]-e[1]})[0],2),c=l[0];l[1],24==c.min_zoom&&(c.min_zoom=Math.max(r-e,0))}s.length>1&&r<24+e&&(i(t-a/2,n-a/2,r+1),i(t+a/2,n-a/2,r+1),i(t-a/2,n+a/2,r+1),i(t+a/2,n+a/2,r+1))};return i(.5,.5,0),new Uint8Array(n.map(function(t){return t.min_zoom}))}),r}return ir(e,t),e.prototype.copy=function(){return new e(this.coords)},e.prototype.getEarthCoords=function(){return{lons:new Float32Array(this.coords.map(function(t){return t.lon})),lats:new Float32Array(this.coords.map(function(t){return t.lat}))}},e.prototype.getGridCoords=function(){var t=this.getEarthCoords();return{x:t.lons,y:t.lats}},e.prototype.transform=function(t,e,n){return[t,e]},e.prototype.getMinVisibleZoom=function(t){return null!==this.zoom_arg?this.zoom_arg:this.zoom_cache.getValue(t)},e.prototype.getThinnedGrid=function(t,n){var r=this.getMinVisibleZoom(t);return new e(this.coords.filter(function(t,e){return r[e]<=n}),r.filter(function(t){return t<=n}))},e.prototype.thinDataArray=function(t,e){for(var n=0,r=new(A(e))(this.ni*this.nj),o=0;o<t.coords.length&&!(this.coords[n].lat==t.coords[o].lat&&this.coords[n].lon==t.coords[o].lon&&(r[n++]=e[o],n>=this.coords.length));o++);return r},e.prototype.sampleNearestGridPoint=function(t,e,n){var r=hr(this.coords.map(function(n){return(n.lon-t)*(n.lon-t)+(n.lat-e)*(n.lat-e)}));return{sample:n[r],sample_lon:this.coords[r].lon,sample_lat:this.coords[r].lat}},e}(dr),br=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yr=function(){return yr=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},yr.apply(this,arguments)},wr=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())})},xr=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=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},Er={color:"#000000",cmap:null,interval:1,levels:null,line_width:2,line_style:"-",quad_as_tri:!1},Ar=function(t){function e(e,n){var r=t.call(this)||this;return r.field=e,r.opts=E(n,Er),r.gl_elems=null,r.contours=null,r}return br(e,t),e.prototype.updateField=function(t){return wr(this,void 0,void 0,function(){var e,n,r,o,i=this;return xr(this,function(a){switch(a.label){case 0:return this.field=t,null===this.gl_elems?[2]:(e=this.gl_elems.gl,[4,this.getContours()]);case 1:return n=a.sent(),r=[],Object.entries(n).forEach(function(t){var e,n,o=Tr(t,2),a=o[0],s=o[1],l=parseFloat(a),c=(e=i.opts.line_style)in zn||Array.isArray(e)&&e.length>0&&e.map(function(t){return"number"==typeof t}).reduce(function(t,e){return t&&e},!0)?i.opts.line_style:i.opts.line_style(l),u="number"==typeof i.opts.line_width?i.opts.line_width:i.opts.line_width(l),f=s.map(function(t){var e={vertices:t};return null!==i.opts.cmap&&(e.data=t.map(function(){return l})),e}),h=r.filter(function(t){return t.line_style==c&&t.line_width==u});0==h.length?(n={data:[],line_width:u,line_style:c},r.push(n)):n=h[0],n.data=n.data.concat(f)}),o=r.map(function(t){return wr(i,void 0,void 0,function(){var n;return xr(this,function(r){switch(r.label){case 0:return n={line_width:t.line_width,line_style:t.line_style},null!==this.opts.cmap?n.cmap=this.opts.cmap:n.color=this.opts.color,[4,Hn.make(e,t.data,n)];case 1:return[2,r.sent()]}})})}),Promise.all(o).then(function(t){null!==i.gl_elems&&(i.contours=t,i.gl_elems.map.triggerRepaint())}),[2]}})})},e.prototype.getContours=function(){return wr(this,void 0,void 0,function(){var t;return xr(this,function(e){switch(e.label){case 0:return t=null===this.opts.levels?void 0:this.opts.levels,[4,this.field.getContours({interval:this.opts.interval,levels:t,quad_as_tri:this.opts.quad_as_tri})];case 1:return[2,e.sent()]}})})},e.prototype.onAdd=function(t,e){return wr(this,void 0,void 0,function(){return xr(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,r=n.map.getZoom(),o=n.map.getCanvas().width,i=n.map.getCanvas().height,a=n.map.getBearing(),s=n.map.getPitch();this.contours.forEach(function(n){return n.render(t,e,[o,i],r,a,s)})}},e}(k),Sr={n_decimal_places:0,font_face:"Trebuchet MS",font_size:12,font_url_template:"",text_color:"#000000",halo_color:"#000000",halo:!1,density:1},Mr=function(t){function e(e,n){var r=t.call(this)||this;return r.opts=E(n,Sr),r.contours=e,r.text_collection=null,r.gl_elems=null,r}return br(e,t),e.prototype.updateField=function(){return wr(this,void 0,void 0,function(){var t,e,n,r,o,i,a,s,l,c,u,f,h,d,p;return xr(this,function(_){switch(_.label){case 0:if(null===this.gl_elems)return[2];if(t=this.gl_elems.map,e=this.gl_elems.gl,n=t.getStyle(),void 0===(r=""==this.opts.font_url_template?n.glyphs:this.opts.font_url_template))throw"The map style doesn't have any glyph information. Please pass the font_url_template option to ContourLabels";return o=r.replace("{fontstack}",this.opts.font_face),i=[],[4,this.contours.getContours()];case 1:return a=_.sent(),(s=Object.keys(a).map(parseFloat)).sort(function(t,e){return t-e}),l=t.getMaxZoom(),c=.006/this.opts.density*Math.pow(2,7-l),Object.entries(a).forEach(function(t){var e=Tr(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,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))}([void 0],Tr(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 l=c*(r+o/2%1);if(n[s-1]<=l&&l<n[s]){var u=t[s-1],f=t[s],h=(l-n[s-1])/(n[s]-n[s-1]),d=(1-h)*u[0]+h*f[0],p=(1-h)*u[1]+h*f[1];i.push({coord:{lon:d,lat:p},text:a}),r++}}})}),u=new vr(i.map(function(t){return t.coord})),f=u.getMinVisibleZoom(4),h=i.map(function(t,e){return yr(yr({},t.coord),{min_zoom:f[e],text:t.text})}),d={horizontal_align:"center",vertical_align:"middle",font_size:this.opts.font_size,halo:this.opts.halo,text_color:An.fromHex(this.opts.text_color),halo_color:An.fromHex(this.opts.halo_color)},p=this,[4,rr.make(e,h,o,d)];case 2:return p.text_collection=_.sent(),t.triggerRepaint(),[2]}})})},e.prototype.onAdd=function(t,e){return wr(this,void 0,void 0,function(){return xr(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}(k);const Rr=Ar;var Pr=n(533),Fr=n.n(Pr);n.p;var Ir=null;function Or(t){return null===Ir&&(Ir=Fr()({locateFile:function(e,n){return(void 0===t.document_script?n:t.document_script)+e}})),Ir}function kr(t,e,n){return r=this,o=void 0,a=function(){var r,o,i,a,s,l,c;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(u){switch(u.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,o=void 0!==n.quad_as_tri&&n.quad_as_tri,[4,Or({})];case 1:return i=u.sent(),a=e.getGridCoords(),s=t instanceof Float32Array?i.getContourLevelsFloat32:i.getContourLevelsFloat16,l=t instanceof Float32Array?i.makeContoursFloat32:i.makeContoursFloat16,c=void 0===n.levels?s(t,e.ni,e.nj,r):n.levels,[2,l(t,a.x,a.y,c,function(t,n){return e.transform(t,n,{inverse:!0})},o)]}})},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 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())})},Nr=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])}}},Br=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},Gr=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 Lr(t){return t instanceof Float32Array?"float32":t instanceof Uint8Array?"uint8":"float16"}var jr=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 T(function(t){return Cr(n,void 0,void 0,function(){return Nr(this,function(e){switch(e.label){case 0:return[4,kr(this.data,this.grid,t)];case 1:return[2,e.sent()]}})})})}return t.prototype.getTextureData=function(){var t=this.data,e=Lr(t);return"float32"==e||"uint8"==e?t:new Uint16Array(t.buffer)},t.prototype.getWGLTextureSpec=function(t,e){var n=this.getTextureData(),r=C(t,Lr(this.data)),o=r.format,i=r.type,a=r.row_alignment;return{format:o,type:i,width:this.grid.ni,height:this.grid.nj,image:n,mag_filter:e,row_alignment:a}},t.prototype.getContours=function(t){return Cr(this,void 0,void 0,function(){return Nr(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];var o=new(A(n[0].data))(function(t,e){var n,r,o,i,a,s;return Nr(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,7]),n=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.")}(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]}})}(x.apply(void 0,Gr([],Br(n.map(function(t){return t.data})),!1)),function(t){return e.apply(void 0,Gr([],Br(t),!1))}));return new t(n[0].grid,o)},t.prototype.sampleField=function(t,e){return this.grid.sampleNearestGridPoint(t,e,this.data).sample},t}(),Dr=function(){function t(t,e,n,r){r=void 0===r?{}:r,this.u=new jr(t,e),this.v=new jr(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,n=Lr(t),r=Lr(t);return{u:"float32"==n||"uint8"==n?t:new Uint16Array(t.buffer),v:"float32"==r||"uint8"==r?e:new Uint16Array(e.buffer)}},t.prototype.getWGLTextureSpecs=function(t,e){var n=this.getTextureData(),r=n.u,o=n.v,i=C(t,Lr(this.u.data)),a=i.format,s=i.type,l=i.row_alignment;return{u:{format:a,type:s,width:this.grid.ni,height:this.grid.nj,image:r,mag_filter:e,row_alignment:l},v:{format:a,type:s,width:this.grid.ni,height:this.grid.nj,image:o,mag_filter:e,row_alignment:l}}},t.prototype.getThinnedField=function(e,n){var r=this.grid.getThinnedGrid(e,n),o=r.thinDataArray(this.grid,this.u.data),i=r.thinDataArray(this.grid,this.v.data);return new t(r,o,i,{relative_to:this.relative_to})},Object.defineProperty(t.prototype,"grid",{get:function(){return this.u.grid},enumerable:!1,configurable:!0}),t.prototype.sampleField=function(t,e){var n=this.grid.sampleNearestGridPoint(t,e,this.u.data),r=this.grid.sampleNearestGridPoint(t,e,this.v.data),o="earth"==this.relative_to?0:this.grid.getVectorRotationAtPoint(n.sample_lon,n.sample_lat),i=Math.hypot(n.sample,r.sample),a=180*(Math.PI/2-Math.atan2(-r.sample,-n.sample)+o)/Math.PI;return a>360&&(a-=360),a<0&&(a+=360),[a,i]},t}(),Ur=function(){function t(t,e){this.profiles=e,this.grid=t}return t.prototype.getStormMotionGrid=function(){var t=this,e=this.profiles,n=new xn(this.grid.ni*this.grid.nj).fill(parseFloat("nan")),r=new xn(this.grid.ni*this.grid.nj).fill(parseFloat("nan"));return e.forEach(function(e){var o=e.ilon+t.grid.ni*e.jlat;P(e)?(n[o]=e.smu,r[o]=e.smv):(n[o]=0,r[o]=0)}),new Dr(this.grid,n,r,{relative_to:"grid"})},t.prototype.getProfileCoords=function(){var t=this,e=this.grid.getEarthCoords(),n=e.lats,r=e.lons,o=new Float32Array(this.profiles.length),i=new Float32Array(this.profiles.length);return this.profiles.forEach(function(e,a){var s=e.ilon+e.jlat*t.grid.ni;o[a]=n[s],i[a]=r[s]}),{lats:o,lons:i}},t}(),zr=function(){function t(t,e){this.grid=t,this.data=e}return t.prototype.getScalar=function(t){var e=this.data.map(function(e){return e[t]});if(!e.map(function(t){return"number"==typeof t||null===t}).reduce(function(t,e){return t&&e},!0))throw"It doesn't look like ".concat(t," contains scalar numerical data");return e},t.prototype.getStrings=function(t){var e=this.data.map(function(e){return e[t]});if(!e.map(function(t){return"string"==typeof t||null===t}).reduce(function(t,e){return t&&e},!0))throw"It doesn't look like ".concat(t," contains string data");return e},t.prototype.getVector=function(t){var e=this.data.map(function(e){return e[t]});if(!e.map(function(t){return Array.isArray(t)}).reduce(function(t,e){return t&&e},!0))throw"It doesn't look like ".concat(t," contains vector data");var n=e,r=new xn(this.grid.ni*this.grid.nj).fill(parseFloat("nan")),o=new xn(this.grid.ni*this.grid.nj).fill(parseFloat("nan"));return n.forEach(function(t,e){var n=Br(t,2),i=n[0],a=n[1];if(null!==i&&null!==a){var s=Br(function(t,e){return[-t*Math.sin(e*Math.PI/180),-t*Math.cos(e*Math.PI/180)]}(i,a),2),l=s[0],c=s[1];r[e]=l,o[e]=c}}),new Dr(this.grid,r,o,{relative_to:"earth"})},t}(),Hr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vr=function(){return Vr=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},Vr.apply(this,arguments)},Wr=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())})},$r=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},Xr=n(303),Yr=n(401),Zr={cmap:[new Rn([0,1],["#000000"],{overflow_color:"#000000",underflow_color:"#000000"})],cmap_mask:null,opacity:1},Jr=function(t){function e(e,n){var r=t.call(this)||this;return r.field=e,r.opts=E(n,Zr),r.opts.cmap=Array.isArray(r.opts.cmap)?r.opts.cmap:[r.opts.cmap],r.cmap_gpu=r.opts.cmap.map(function(t){return new Bn(t)}),r.gl_elems=null,r.fill_texture=null,r.mask_texture=null,r.image_mag_filter=null,r.cmap_mag_filter=null,r}return Hr(e,t),e.prototype.updateField=function(t,e){return Wr(this,void 0,void 0,function(){var n,r,o,i,a;return $r(this,function(s){if(this.field=t,null===this.image_mag_filter||null===this.cmap_mag_filter)throw"Implement magnification filters in a subclass";if(null===this.gl_elems)return[2];if(n=this.gl_elems.gl,r=this.gl_elems.map,o=this.field.getWGLTextureSpec(n,this.image_mag_filter),null===this.fill_texture?this.fill_texture=new D(n,o):this.fill_texture.setImageData(o),void 0!==e){if(null===this.opts.cmap_mask)return console.warn("A mask was passed to updateField on a Fill component that didn't have a mask. The updated mask will be ignored."),[2];i=new jr(this.field.grid,e),a=i.getWGLTextureSpec(n,n.NEAREST),null===this.mask_texture?this.mask_texture=new D(n,a):this.mask_texture.setImageData(a)}return r.triggerRepaint(),[2]})})},e.prototype.onAdd=function(t,e){return Wr(this,void 0,void 0,function(){var n,r,o,i,a,s=this;return $r(this,function(l){switch(l.label){case 0:return[4,this.field.grid.getWGLBuffers(e)];case 1:return n=l.sent(),r=n.vertices,o=n.texcoords,this.cmap_gpu.forEach(function(t){if(null===s.image_mag_filter||null===s.cmap_mag_filter)throw"Implement magnification filters in a subclass";t.setupShaderVariables(e,s.cmap_mag_filter)}),i=[],null!==this.opts.cmap_mask&&i.push("MASK"),a=new Gn(Xr,Bn.applyShader(Yr),i),this.gl_elems={gl:e,shader_manager:a,map:t,vertices:r,texcoords:o},this.updateField(this.field,null===this.opts.cmap_mask?void 0:this.opts.cmap_mask),[2]}})})},e.prototype.render=function(t,e){var n=this;if(null!==this.gl_elems&&null!==this.fill_texture){var r=this.gl_elems,o=I(e),i=this.gl_elems.shader_manager.getShaderProgram(t,o.shaderData);i.use({a_pos:r.vertices,a_tex_coord:r.texcoords},Vr({u_opacity:this.opts.opacity},this.gl_elems.shader_manager.getShaderUniforms(o)),{u_fill_sampler:this.fill_texture}),this.cmap_gpu.forEach(function(e,r){i.setUniforms({u_offset:0}),null!==n.opts.cmap_mask&&null!==n.mask_texture&&(i.setUniforms({u_mask_val:r+1}),i.bindTextures({u_mask_sampler:n.mask_texture})),e.bindShaderVariables(i),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),i.draw(),"maplibre"==o.type&&o.shaderData.define.includes("GLOBE")||(i.setUniforms({u_offset:-2}),i.draw(),i.setUniforms({u_offset:-1}),i.draw(),i.setUniforms({u_offset:1}),i.draw())})}},e}(k),qr=function(t){function e(e,n){return t.call(this,e,n)||this}return Hr(e,t),e.prototype.updateField=function(e,n){return Wr(this,void 0,void 0,function(){return $r(this,function(r){switch(r.label){case 0:return[4,t.prototype.updateField.call(this,e,n)];case 1:return r.sent(),[2]}})})},e.prototype.onAdd=function(e,n){return Wr(this,void 0,void 0,function(){return $r(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}(Jr),Kr=function(t){function e(e,n){return t.call(this,e,n)||this}return Hr(e,t),e.prototype.updateField=function(e,n){return Wr(this,void 0,void 0,function(){return $r(this,function(r){switch(r.label){case 0:return[4,t.prototype.updateField.call(this,e,n)];case 1:return r.sent(),[2]}})})},e.prototype.onAdd=function(e,n){return Wr(this,void 0,void 0,function(){return $r(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}(Jr),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)},to=n(631),eo=n(254),no=function(){function t(t,e,n,r,o,i,a){a=void 0===a?{}:a,this.color=void 0===a.color?new An([0,0,0,1]):a.color,this.cmap=void 0===a.cmap?null:a.cmap,this.rotate_with_map=void 0===a.rotate_with_map||a.rotate_with_map,this.field=t,this.spec=o,this.size_multiplier=i,this.thin_fac=e,this.max_zoom=n,this.billboard_image=r,this.gl_elems=null,this.wind_textures=null}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.thin_fac,this.max_zoom).getWGLTextureSpecs(e,e.NEAREST),r=n.u,o=n.v;null===this.wind_textures?this.wind_textures={u:new D(e,r),v:new D(e,o)}:(this.wind_textures.u.setImageData(r),this.wind_textures.v.setImageData(o))}},t.prototype.setup=function(t){return e=this,n=void 0,o=function(){var e,n,r,o,i,a,s,l,c,u,f,h;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(d){switch(d.label){case 0:return e=this.field.grid.getThinnedGrid(this.thin_fac,this.max_zoom),n=new Float32Array([0,1,2,3]),r=new j(t,n,1,t.TRIANGLE_STRIP),[4,e.getWGLBillboardBuffers(t,this.thin_fac,this.max_zoom)];case 1:return o=d.sent(),i=o.vertices,a=o.texcoords,s=e.getVectorRotationTexture(t,"earth"==this.field.relative_to).rotation,l=new D(t,this.billboard_image),c=[],u=eo,f=null,null!==this.cmap&&(u=Bn.applyShader(u),(f=new Bn(this.cmap)).setupShaderVariables(t,t.NEAREST),c.push("COLORMAP")),h=new Gn(to,u,c),this.gl_elems={gl:t,shader_manager:h,geom_vertices:r,vertices:i,texcoords:a,texture:l,proj_rot_texture:s,cmap_gpu:f},[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=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),s=a[0],l=a[1];if(null!==this.gl_elems&&null!==this.wind_textures){var c=I(e),u=this.gl_elems.shader_manager.getShaderProgram(t,c.shaderData),f=this.gl_elems,h=this.spec.BB_HEIGHT*(l/s)*this.size_multiplier,d=this.spec.BB_WIDTH/this.spec.BB_TEX_WIDTH,p=this.spec.BB_HEIGHT/this.spec.BB_TEX_HEIGHT;u.use({a_geom:f.geom_vertices,a_pos:f.vertices,a_tex_coord:f.texcoords},Qr({u_bb_size:h,u_bb_width:d,u_bb_height:p,u_bb_mag_bin_size:this.spec.BB_MAG_BIN_SIZE,u_bb_mag_wrap:this.spec.BB_MAG_WRAP,u_offset:0,u_map_aspect:l/s,u_zoom:r,u_rotate_with_map:this.rotate_with_map?1:0},this.gl_elems.shader_manager.getShaderUniforms(c)),{u_sampler:f.texture,u_u_sampler:this.wind_textures.u,u_v_sampler:this.wind_textures.v,u_rot_sampler:f.proj_rot_texture}),null!==f.cmap_gpu?f.cmap_gpu.bindShaderVariables(u):u.setUniforms({u_bb_color:this.color.toRGBATuple()}),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),u.draw(),"maplibre"==c.type&&c.shaderData.define.includes("GLOBE")||(u.setUniforms({u_offset:-2}),u.draw(),u.setUniforms({u_offset:-1}),u.draw(),u.setUniforms({u_offset:1}),u.draw())}},t}(),ro=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)}}(),oo=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())})},io=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])}}},ao={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},so={color:"#000000",cmap:null,line_width:2,barb_size_multiplier:1,thin_fac:1};const lo=function(t){function e(e,n){var r=t.call(this)||this;return r.fields=e,r.opts=E(n,so),r.color=An.fromHex(r.opts.color),r.barb_texture=function(t,e){var n=document.createElement("canvas");function r(e,n,r,o){var i=t.BB_WIDTH/2-4,a=i/2;if(o<2.5)e.beginPath(),e.arc(n,r,i/2,0,2*Math.PI),e.stroke();else{var s=0,l=o,c=0,u=Math.floor((l+2.5)/50);c+=u*i/2+a+(u-1)*a/2,l-=50*u;var f=Math.floor((l+2.5)/10);c+=f*a,l-=10*f,c+=Math.floor((l+2.5)/5)*a,o<7.5&&(c+=a),c=Math.max(120,c),e.beginPath(),e.moveTo(n,r),e.lineTo(n,r+c),l=o,s=r+c;for(var h=!1,d=!0;l>47.5;)h&&(s+=a/2),d||e.moveTo(n,s),e.lineTo(n-i,s),e.lineTo(n,s-i/2),s-=i/2+a,l-=50,h=!0,d=!1;for(;l>7.5;)d||e.moveTo(n,s),e.lineTo(n-i,s+i/2),s-=a,l-=10,d=!1;for(o<7.5&&(s-=a);l>2.5;)e.moveTo(n,s),e.lineTo(n-i/2,s+i/4),l-=5;e.stroke()}}n.width=t.BB_TEX_WIDTH,n.height=t.BB_TEX_HEIGHT;var o=n.getContext("2d");if(null===o)throw"Could not get rendering context for the wind barb canvas";o.lineWidth=e,o.miterLimit=4;for(var i=0;i<=t.BB_MAG_MAX;i+=t.BB_MAG_BIN_SIZE)r(o,i%t.BB_MAG_WRAP/t.BB_MAG_BIN_SIZE*t.BB_WIDTH+t.BB_WIDTH/2,Math.floor(i/t.BB_MAG_WRAP)*t.BB_HEIGHT+t.BB_WIDTH/2,i);return n}(ao,r.opts.line_width/r.opts.barb_size_multiplier*4),r.gl_elems=null,r}return ro(e,t),e.prototype.updateField=function(t){return oo(this,void 0,void 0,function(){return io(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 oo(this,void 0,void 0,function(){var n,r,o,i;return io(this,function(a){switch(a.label){case 0:return e.getExtension("OES_texture_float"),e.getExtension("OES_texture_float_linear"),n=t.getMaxZoom(),r={format:e.RGBA,type:e.UNSIGNED_BYTE,image:this.barb_texture,mag_filter:e.NEAREST},o=null===this.opts.cmap?void 0:this.opts.cmap,[4,(i=new no(this.fields,this.opts.thin_fac,n,r,ao,.1*this.opts.barb_size_multiplier,{color:this.color,cmap:o})).setup(e)];case 1:return a.sent(),this.gl_elems={map:t,barb_billboards:i},this.updateField(this.fields),[2]}})})},e.prototype.render=function(t,e){if(null!==this.gl_elems){var n=this.gl_elems,r=n.map.getZoom(),o=n.map.getCanvas().width,i=n.map.getCanvas().height,a=n.map.getBearing(),s=n.map.getPitch();n.barb_billboards.render(t,e,[o,i],r,a,s)}},e}(k);var co=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)}}(),uo=function(){return uo=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},uo.apply(this,arguments)},fo=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}l((r=r.apply(t,e||[])).next())})},ho=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},po=n(829),_o=n(375),mo={colors:["#000000"],opacity:1};const go=function(t){function e(e,n){var r=t.call(this)||this;return r.field=e,r.opts=E(n,mo),r.color_components=r.opts.colors.map(function(t){return An.fromHex(t).toRGBATuple()}).flat(),r.gl_elems=null,r.fill_texture=null,r}return co(e,t),e.prototype.updateField=function(t){return fo(this,void 0,void 0,function(){var e,n;return ho(this,function(r){return this.field=t,null===this.gl_elems||((e=this.gl_elems.gl).pixelStorei(e.UNPACK_ALIGNMENT,2),n=this.field.getWGLTextureSpec(e,e.NEAREST),null===this.fill_texture?this.fill_texture=new D(e,n):this.fill_texture.setImageData(n)),[2]})})},e.prototype.onAdd=function(t,e){return fo(this,void 0,void 0,function(){var t,n,r,o,i,a;return ho(this,function(s){switch(s.label){case 0:return e.getExtension("OES_texture_float"),[4,this.field.grid.getWGLBuffers(e)];case 1:return t=s.sent(),n=t.vertices,r=t.texcoords,o=n,i=r,a=new Gn(po,_o,[]),this.gl_elems={gl:e,shader_manager:a,vertices:o,texcoords:i},this.updateField(this.field),[2]}})})},e.prototype.render=function(t,e){if(null!==this.gl_elems&&null!==this.fill_texture){var n=this.gl_elems,r=I(e),o=this.gl_elems.shader_manager.getShaderProgram(t,r.shaderData);o.use({a_pos:n.vertices,a_tex_coord:n.texcoords},uo({u_opacity:this.opts.opacity,u_colors:this.color_components,u_num_colors:this.opts.colors.length,u_offset:0},this.gl_elems.shader_manager.getShaderUniforms(r)),{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),o.draw(),"maplibre"==r.type&&r.shaderData.define.includes("GLOBE")||(o.setUniforms({u_offset:-2}),o.draw(),o.setUniforms({u_offset:-1}),o.draw(),o.setUniforms({u_offset:1}),o.draw())}},e}(k);var vo=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)}}(),bo=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())})},yo=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])}}},wo=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},xo=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))},To={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},Eo={bgcolor:"#000000",thin_fac:1,hodo_line_width:2.5,background_line_width:1.5,height_cmap:new Rn([0,1,3,6,9],["#ffffcc","#a1dab4","#41b6c4","#225ea8"]),max_wind_speed_ring:80};const Ao=function(t){function e(e,n){var r=t.call(this)||this;return r.profile_field=e,r.opts=E(n,Eo),r.hodo_bg_texture=function(t,e){var n=document.createElement("canvas");n.width=To.BB_TEX_WIDTH,n.height=To.BB_TEX_HEIGHT;var r=n.getContext("2d");if(null===r)throw"Could not get rendering context for the hodograph background canvas";r.lineWidth=t;for(var o=To.BB_TEX_WIDTH/4;o<=To.BB_TEX_WIDTH/2;o+=To.BB_TEX_WIDTH/4)r.beginPath(),r.arc(To.BB_TEX_WIDTH/2,To.BB_TEX_WIDTH/2,o-t/2,0,2*Math.PI),r.stroke();if(e){var i=To.BB_TEX_WIDTH/2,a=To.BB_TEX_WIDTH/2;r.beginPath(),r.moveTo(i,a),r.lineTo(i+10,a+20),r.lineTo(i-10,a+20),r.lineTo(i,a),r.fill()}else r.beginPath(),r.arc(To.BB_TEX_WIDTH/2,To.BB_TEX_WIDTH/2,t,0,2*Math.PI),r.fill();return n}(2.5*r.opts.background_line_width,P(e.profiles[0])),r.hodo_scale=(To.BB_TEX_WIDTH-r.opts.background_line_width/2)/(To.BB_TEX_WIDTH*r.opts.max_wind_speed_ring),r.bg_size=140,r.gl_elems=null,r.line_elems=null,r}return vo(e,t),e.prototype.updateField=function(t){return bo(this,void 0,void 0,function(){var e,n,r,o,i,a,s,l,c,u;return yo(this,function(f){switch(f.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=this.profile_field.getProfileCoords(),o=r.lats,i=r.lons,a=this.profile_field.grid.getMinVisibleZoom(this.opts.thin_fac),s=n.map(function(t,e){return{offsets:xo([],wo(t.u),!1).map(function(e,n){return P(t)?[e-t.smu,t.v[n]-t.smv]:[e,t.v[n]]}),vertices:xo([],wo(t.u),!1).map(function(t){return[i[e],o[e]]}),zoom:a[e],data:xo([],wo(t.z),!1)}}),[4,Hn.make(e,s,{line_width:this.opts.hodo_line_width,cmap:this.opts.height_cmap,offset_scale:this.hodo_scale*this.bg_size,offset_rotates_with_map:!1})]);case 1:return l=f.sent(),c=n.map(function(t,e){if(!P(t))return{vertices:[]};var 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:[[i[e],o[e]],[i[e],o[e]]],zoom:a[e]}}),[4,Hn.make(e,c,{line_width:this.opts.background_line_width,color:this.opts.bgcolor,offset_scale:this.hodo_scale*this.bg_size,offset_rotates_with_map:!1})];case 2:return u=f.sent(),this.line_elems={hodo_line:l,sm_line:u},[2]}})})},e.prototype.onAdd=function(t,e){return bo(this,void 0,void 0,function(){var n,r,o;return yo(this,function(i){switch(i.label){case 0:return n={format:e.RGBA,type:e.UNSIGNED_BYTE,image:this.hodo_bg_texture,mag_filter:e.NEAREST},r=t.getMaxZoom(),[4,(o=new no(this.profile_field.getStormMotionGrid(),this.opts.thin_fac,r,n,To,.004*this.bg_size,{color:An.fromHex(this.opts.bgcolor),rotate_with_map:!1})).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}(k);var So=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)}}(),Mo=function(){return Mo=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},Mo.apply(this,arguments)},Ro=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())})},Po=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])}}},Fo=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Io={"0/8":59658,"1/8":59659,"2/8":59660,"3/8":59661,"4/8":59662,"5/8":59663,"6/8":59664,"7/8":59665,"8/8":59666,clr:59658,few:59660,sct:59662,bkn:59664,ovc:59666,obsc:59667,va:59810,fu:59810,hz:59811,du:59812,bldu:59814,sa:59814,blsa:59814,vcblsa:59814,vcbldu:59814,blpy:59814,po:59816,vcpo:59816,vcds:59817,vcss:59817,br:59818,bcbr:59818,bc:59819,mifg:59820,vcts:59821,virga:59822,vcsh:59824,ts:59825,thdr:59825,vctshz:59825,tsfzfg:59825,tsbr:59825,tsdz:59825,vctsup:59825,"-tsup":59825,tsup:59825,"+tsup":59825,sq:59826,fc:59827,"+fc":59827,ds:59839,ss:59839,drsa:59839,drdu:59839,"+ds":59842,"+ss":59842,drsn:59844,"+drsn":59845,"-blsn":59846,blsn:59846,"+blsn":59847,vcblsn:59846,vcfg:59848,bcfg:59849,prfg:59852,fg:59853,fzfg:59857,"-vctsdz":59859,"-dz":59859,"-dzbr":59859,vctsdz:59861,dz:59861,"+vctsdz":59863,"+dz":59863,"-fzdz":59864,"-fzdzsn":59864,fzdz:59865,"+fzdz":59865,fzdzsn:59865,"-dzra":59866,dzra:59867,"+dzra":59867,"-ra":59869,"-rabr":59869,ra:59871,rabr:59871,rafg:59871,vcra:59871,"+ra":59873,"-fzra":59874,"-fzrasn":59874,"-fzrabr":59874,"-fzrapl":59874,"-fzrasnpl":59874,tsfzrapl:59875,"-tsfzra":59875,fzra:59875,"+fzra":59875,fzrasn:59875,tsfzra:59875,"-dzsn":59876,"-rasn":59876,"-snra":59876,"-sndz":59876,rasn:59877,"+rasn":59877,snra:59877,dzsn:59877,sndz:59877,"+dzsn":59877,"+sndz":59877,"-sn":59879,"-snbr":59879,sn:59881,"+sn":59883,"-snsg":59885,sg:59885,"-sg":59885,ic:59886,"-fzdzpl":59887,"-fzdzplsn":59887,fzdzpl:59887,"-fzraplsn":59887,fzrapl:59887,"+fzrapl":59887,"-rapl":59887,"-rasnpl":59887,"-raplsn":59887,"+rapl":59887,rapl:59887,"-snpl":59887,snpl:59887,"-pl":59887,pl:59887,"-plsn":59887,"-plra":59887,plra:59887,"-pldz":59887,"+pl":59887,plsn:59887,plup:59887,"+plsn":59887,"-sh":59888,"-shra":59888,sh:59889,shra:59889,"+sh":59889,"+shra":59889,"-shrasn":59891,"-shsnra":59891,"+shrabr":59892,shrasn:59892,"+shrasn":59892,shsnra:59892,"+shsnra":59892,"-shsn":59893,shsn:59894,"+shsn":59894,"-gs":59895,"-shgs":59895,fzraplgs:59896,"-sngs":59896,gsplsn:59896,gspl:59896,plgssn:59896,gs:59896,shgs:59896,"+gs":59896,"+shgs":59896,"-gr":59897,"-shgr":59897,"-sngr":59898,gr:59898,shgr:59898,"+gr":59898,"+shgr":59898,"-tsrasn":59907,tsrasn:59907,"-tssnra":59907,tssnra:59907,"-vctsra":59908,"-tsra":59908,tsra:59908,"-tsdz":59908,vctsra:59908,tspl:59909,"-tssn":59909,"-tspl":59909,tssn:59909,"-vctssn":59909,vctssn:59909,tsplsn:59909,tssnpl:59909,"-tssnpl":59909,"-tsragr":59910,tsrags:59910,tsragr:59910,tsgs:59910,tsgr:59910,"+tsfzrapl":59911,"+vctsra":59912,"+tsra":59912,"+tsfzra":59912,"+tssn":59913,"+tspl":59913,"+tsplsn":59913,"+vctssn":59913,tssa:59914,tsds:59914,tsdu:59914,"+tsgs":59915,"+tsgr":59915,"+tsrags":59915,"+tsragr":59915,in:59750,"-up":59750,up:59750,"+up":59751,"-fzup":59756,fzup:59756,"+fzup":59757},Oo={config:{},thin_fac:1,font_face:"Trebuchet MS",font_size:12,font_url_template:""};function ko(t,e){var n,r,o,i;return e=void 0===e?10:e,"ll"==t||"cl"==t||"ul"==t?(n="right",o=-e):"lc"==t||"c"==t||"uc"==t?(n="center",o=0):(n="left",o=e),"ll"==t||"lc"==t||"lr"==t?(r="top",i=-e):"cl"==t||"c"==t||"cr"==t?(r="middle",i=0):(r="baseline",i=e),{horizontal_align:n,vertical_align:r,offset_x:o,offset_y:i}}const Co=function(t){function e(e,n){var r=t.call(this)||this;return r.field=e,r.opts=E(n,Oo),r.gl_elems=null,r.text_components=null,r}return So(e,t),e.prototype.updateField=function(t){return Ro(this,void 0,void 0,function(){var e,n,r,o,i,a,s,l,c,u=this;return Po(this,function(f){switch(f.label){case 0:if(this.field=t,null===this.gl_elems)return[2];if(e=this.gl_elems.map,n=this.gl_elems.gl,r=this.gl_elems.barb_components,o=e.getStyle(),void 0===(i=""==this.opts.font_url_template?o.glyphs:this.opts.font_url_template))throw"The map style doesn't have any glyph information. Please pass the font_url_template option to StationPlot";return a=i.replace("{fontstack}",this.opts.font_face),s=0,l=Object.entries(this.opts.config).map(function(t){return Ro(u,[t],void 0,function(t){var e,o,l,c,u,f,h,d,p,_,m,g,v,b,y=Fo(t,2),w=y[0],x=y[1];return Po(this,function(t){switch(t.label){case 0:return e=w,"number"!=x.type&&"string"!=x.type?[3,2]:(u=x.pos,f=void 0===x.color?An.fromHex("#000000"):An.normalizeColor(x.color),h=void 0===x.halo_color?An.fromHex("#ffffff"):An.normalizeColor(x.halo_color),d=void 0===x.halo||x.halo,o=this.field.grid.getEarthCoords(),l=this.field.grid.getMinVisibleZoom(this.opts.thin_fac),v=void 0,"number"==x.type?(p=this.field.getScalar(e),c=void 0===x.formatter?function(t){return null===t?"null":t.toString()}:x.formatter,v=p.map(function(t,e){return{text:c(t),lat:o.lats[e],lon:o.lons[e],min_zoom:l[e]}})):(p=this.field.getStrings(e),v=p.map(function(t,e){return{text:null===t?"":t,lat:o.lats[e],lon:o.lons[e],min_zoom:l[e]}})),b=Mo(Mo({},ko(u)),{font_size:this.opts.font_size,halo:d,text_color:f,halo_color:h}),[4,rr.make(n,v,a,b)]);case 1:case 4:return[2,t.sent()];case 2:return"barb"!=x.type?[3,3]:(p=this.field.getVector(e),r[s++].updateField(p),[3,6]);case 3:return"symbol"!=x.type?[3,5]:(u=x.pos,f=void 0===x.color?An.fromHex("#000000"):An.normalizeColor(x.color),h=void 0===x.halo_color?An.fromHex("#ffffff"):An.normalizeColor(x.halo_color),d=void 0===x.halo||x.halo,p=this.field.getStrings(e),_=this.field.grid.getEarthCoords(),m=this.field.grid.getMinVisibleZoom(this.opts.thin_fac),g=i.replace("{fontstack}","wx_symbols"),v=p.map(function(t,e){return{text:null===t?"":String.fromCharCode(Io[t]),lat:_.lats[e],lon:_.lons[e],min_zoom:m[e]}}),void 0!==(b=Mo(Mo({},ko(u)),{font_size:this.opts.font_size,halo:d,text_color:f,halo_color:h})).offset_x&&(b.offset_x-=3),[4,rr.make(n,v,g,b)]);case 5:throw"Unknown station plot configuration type ".concat(x.type);case 6:return[2]}})})}),c=this,[4,Promise.all(l)];case 1:return c.text_components=f.sent().filter(function(t){return void 0!==t}),e.triggerRepaint(),[2]}})})},e.prototype.onAdd=function(t,e){return Ro(this,void 0,void 0,function(){var n,r,o=this;return Po(this,function(i){switch(i.label){case 0:return n=Object.entries(this.opts.config).map(function(n){return Ro(o,[n],void 0,function(n){var r,o,i,a,s,l=Fo(n,2),c=l[0],u=l[1];return Po(this,function(n){switch(n.label){case 0:return r=c,"barb"!=u.type?[3,2]:(o=this.field.getVector(r),i=void 0===u.color?"#000000":u.color,a=void 0===u.barb_size_multipler?1:u.barb_size_multipler,[4,(s=new lo(o,{thin_fac:this.opts.thin_fac,color:i,barb_size_multiplier:a})).onAdd(t,e)]);case 1:return n.sent(),[2,s];case 2:return[2]}})})}),[4,Promise.all(n)];case 1:return r=i.sent().filter(function(t){return void 0!==t}),this.gl_elems={map:t,gl:e,barb_components:r},this.updateField(this.field),[2]}})})},e.prototype.render=function(t,e){if(null!==this.gl_elems&&null!==this.text_components){var n=this.gl_elems,r=this.text_components,o=this.gl_elems.barb_components,i=n.map.getCanvas().width,a=n.map.getCanvas().height,s=n.map.getZoom(),l=0,c=0;Object.values(this.opts.config).forEach(function(n){"barb"==n.type?o[c++].render(t,e):r[l++].render(t,e,[i,a],s)})}},e}(k);var No=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)}}(),Bo=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}(),Go=function(t){function e(e,n){var r=t.call(this,e)||this;return r.field=n,r}return No(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}(Bo),Lo=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 No(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}(Bo),jo=function(){return jo=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},jo.apply(this,arguments)},Do=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 Uo(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.size_long||600,l=e.size_short||s/9,c=e.outline_and_text_color||"#000000",u=e.tick_direction||("vertical"==o?"left":"bottom");if("vertical"==o&&("top"==u||"bottom"==u)||"horizontal"==o&&("left"==u||"right"==u))throw"tick_direction of '".concat(u," doesn't match an orientation of ").concat(o);var f,h,d,p,_,m,g,v,b,y,w,x=function(t){return t.toString().length},T=x(r[0]),E=x(r[r.length-1]),A=null!==t.underflow_color||null!==t.overflow_color,S=s,M=l,R=Math.max("horizontal"==o?6*Math.max(T,E):8,A?M/(2*Math.sqrt(3)):0);"vertical"==o?(f=S,h=M,g=(d="left"==u?M-3-10:3)+(_=10),b=d+_/2,v=(p=R)+(m=S-2*R),y=null===t.underflow_color?v:v+M/(2*Math.sqrt(3)),w=null===t.overflow_color?p:p-M/(2*Math.sqrt(3))):(h=S,f=M-6,g=(d=R)+(_=S-2*R),b=(p="bottom"==u?3:M-6-3-10)+(m=10)/2,v=p+m,y=null===t.underflow_color?d:d-M/(2*Math.sqrt(3)),w=null===t.overflow_color?g:g+M/(2*Math.sqrt(3)));var P,F=t.colors.length,I=Do("svg",{width:h,height:f}),O=Do("g",{},I);P="vertical"==o?"left"==u?{"text-anchor":"end",transform:"translate(".concat(d,", ").concat(p,")")}:{transform:"translate(".concat(d+_,", ").concat(p,")")}:"bottom"==u?{"text-anchor":"middle",transform:"translate(".concat(d,", ").concat(p+m,")")}:{"text-anchor":"middle",transform:"translate(".concat(d,", ").concat(p,")")};var k=Do("g",P,I);if(t.colors.forEach(function(t,e){Do("rect",jo(jo({},"vertical"==o?{x:d,y:p+m*(1-(e+1)/F),width:_,height:m/F}:{x:d+_*e/F,y:p,width:_/F,height:m}),{fill:t.toRGBHex(),opacity:t.a}),O)}),null!==t.underflow_color){var C={points:"vertical"==o?"".concat(g," ").concat(v,", ").concat(b," ").concat(y,", ").concat(d," ").concat(v,", ").concat(g," ").concat(v):"".concat(d," ").concat(v,", ").concat(y," ").concat(b,", ").concat(d," ").concat(p,", ").concat(d," ").concat(v),fill:t.underflow_color.toRGBHex(),opacity:t.underflow_color.a};Do("polygon",C,O)}if(null!==t.overflow_color){var N={points:"vertical"==o?"".concat(d," ").concat(p,", ").concat(b," ").concat(w,", ").concat(g," ").concat(p,", ").concat(d," ").concat(p):"".concat(g," ").concat(p,", ").concat(w," ").concat(b,", ").concat(g," ").concat(v,", ").concat(g," ").concat(p),fill:t.overflow_color.toRGBHex(),opacity:t.overflow_color.a};Do("polygon",N,O)}var B,G,L=t.levels[0],j=t.levels[t.levels.length-1];return r.filter(function(t){return L<=t&&t<=j}).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 s="vertical"==o?{transform:"translate(0, ".concat(m*(1-r/F),")")}:{transform:"translate(".concat(_*r/F,", 0)")},l=Do("g",s,k);Do("line",jo(jo({},"vertical"==o?"left"==u?{x2:-6}:{x2:6}:"bottom"==u?{y2:6}:{y2:-6}),{stroke:c,"stroke-width":1.5}),l),Do("text",jo(jo({},"vertical"==o?"left"==u?{x:-9,dy:"0.32em"}:{x:9,dy:"0.32em"}:"bottom"==u?{y:9,dy:"0.8em"}:{y:-9,dy:"0em"}),{fill:c,style:"font-family: ".concat(i,"; font-size: ").concat(a,"pt")}),l).textContent=e.toString()}),B="vertical"==o?"".concat(d," ").concat(p,", ").concat(b," ").concat(w,", ").concat(g," ").concat(p,", ").concat(g," ").concat(v,", ")+"".concat(b," ").concat(y,", ").concat(d," ").concat(v,", ").concat(d," ").concat(p):"".concat(d," ").concat(p,", ").concat(g," ").concat(p,", ").concat(w," ").concat(b,", ").concat(g," ").concat(v,", ")+"".concat(d," ").concat(v,", ").concat(y," ").concat(b,", ").concat(d," ").concat(p),Do("polygon",{points:B,stroke:c,"stroke-width":1.5,fill:"none"},I),G="vertical"==o?"left"==u?{transform:"translate(15, ".concat(f/2,") rotate(-90)")}:{transform:"translate(".concat(h-6,", ").concat(f/2,") rotate(-90)")}:"bottom"==u?{transform:"translate(".concat(h/2,", ").concat(f-5,")")}:{transform:"translate(".concat(h/2,", 15)")},Do("text",jo(jo({},G),{fill:c,"text-anchor":"middle",style:"font-family: ".concat(i,";")}),I).textContent=n,I}function zo(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=Do("svg",{width:123*r+5*(r+1),height:20*i+5*(i+1)}),s=Do("g",{},a);return t.forEach(function(t,n){var r=e[n],a=n%i,l=Math.floor(n/i),c=1;"string"!=typeof t&&(c=t.a,t=t.toRGBHex());var u=5+128*l,f=5+25*a;Do("rect",{x:u,y:f,fill:t,opacity:c,width:20,height:20},s),Do("text",jo(jo({},{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 Ho={bluered:function(t,e,n){return Rn.diverging("#0000ff","#ff0000",t,e,n)},redblue:function(t,e,n){return Rn.diverging("#ff0000","#0000ff",t,e,n)},pw_speed500mb:Fn,pw_speed850mb:In,pw_cape:On,pw_t2m:kn,pw_td2m:Cn,nws_storm_clear_refl:Nn};function Vo(t){Or({document_script:(t=void 0===t?{}:t).wasm_base_url})}})(),r})());
|
|
3
3
|
//# sourceMappingURL=autumnplot-gl.js.map
|